diff --git a/ClickHouse.Driver.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver.LinqService,False).sql b/ClickHouse.Driver.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver.LinqService,False).sql index 1f078584e0cf..afb90601a308 100644 --- a/ClickHouse.Driver.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver.LinqService,False).sql +++ b/ClickHouse.Driver.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver.LinqService,False).sql @@ -10,7 +10,7 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 diff --git a/ClickHouse.Driver.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver.LinqService,True).sql b/ClickHouse.Driver.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver.LinqService,True).sql index 1f078584e0cf..afb90601a308 100644 --- a/ClickHouse.Driver.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver.LinqService,True).sql +++ b/ClickHouse.Driver.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver.LinqService,True).sql @@ -10,7 +10,7 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 BeforeExecute -- ClickHouse.Driver ClickHouse (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 diff --git a/ClickHouse.Driver/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver,False).sql b/ClickHouse.Driver/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver,False).sql index 527f735bc322..43f5f1e23ae8 100644 --- a/ClickHouse.Driver/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver,False).sql +++ b/ClickHouse.Driver/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver,False).sql @@ -10,7 +10,7 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 BeforeExecute -- ClickHouse.Driver ClickHouse @@ -24,5 +24,5 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 diff --git a/ClickHouse.Driver/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver,True).sql b/ClickHouse.Driver/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver,True).sql index 527f735bc322..43f5f1e23ae8 100644 --- a/ClickHouse.Driver/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver,True).sql +++ b/ClickHouse.Driver/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Driver,True).sql @@ -10,7 +10,7 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 BeforeExecute -- ClickHouse.Driver ClickHouse @@ -24,5 +24,5 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 diff --git a/ClickHouse.MySql.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql.LinqService,False).sql b/ClickHouse.MySql.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql.LinqService,False).sql index f08d67a1977d..faeb4dc688a9 100644 --- a/ClickHouse.MySql.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql.LinqService,False).sql +++ b/ClickHouse.MySql.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql.LinqService,False).sql @@ -10,7 +10,7 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 diff --git a/ClickHouse.MySql.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql.LinqService,True).sql b/ClickHouse.MySql.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql.LinqService,True).sql index f08d67a1977d..faeb4dc688a9 100644 --- a/ClickHouse.MySql.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql.LinqService,True).sql +++ b/ClickHouse.MySql.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql.LinqService,True).sql @@ -10,7 +10,7 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 BeforeExecute -- ClickHouse.MySql ClickHouse (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 diff --git a/ClickHouse.MySql/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql,False).sql b/ClickHouse.MySql/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql,False).sql index 7691b482c495..7316d82b0121 100644 --- a/ClickHouse.MySql/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql,False).sql +++ b/ClickHouse.MySql/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql,False).sql @@ -10,7 +10,7 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 BeforeExecute -- ClickHouse.MySql ClickHouse @@ -24,5 +24,5 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 diff --git a/ClickHouse.MySql/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql,True).sql b/ClickHouse.MySql/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql,True).sql index 7691b482c495..7316d82b0121 100644 --- a/ClickHouse.MySql/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql,True).sql +++ b/ClickHouse.MySql/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.MySql,True).sql @@ -10,7 +10,7 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 BeforeExecute -- ClickHouse.MySql ClickHouse @@ -24,5 +24,5 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 diff --git a/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica.LinqService,False).sql b/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica.LinqService,False).sql index 43fe0930c8a2..88ade1539a5d 100644 --- a/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica.LinqService,False).sql +++ b/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica.LinqService,False).sql @@ -10,7 +10,7 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 diff --git a/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica.LinqService,True).sql b/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica.LinqService,True).sql index 43fe0930c8a2..88ade1539a5d 100644 --- a/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica.LinqService,True).sql +++ b/ClickHouse.Octonica.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica.LinqService,True).sql @@ -10,7 +10,7 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 BeforeExecute -- ClickHouse.Octonica ClickHouse (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 diff --git a/ClickHouse.Octonica/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica,False).sql b/ClickHouse.Octonica/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica,False).sql index 02e18af6c09a..ada3d6e3579a 100644 --- a/ClickHouse.Octonica/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica,False).sql +++ b/ClickHouse.Octonica/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica,False).sql @@ -10,7 +10,7 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -24,5 +24,5 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 diff --git a/ClickHouse.Octonica/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica,True).sql b/ClickHouse.Octonica/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica,True).sql index 02e18af6c09a..ada3d6e3579a 100644 --- a/ClickHouse.Octonica/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica,True).sql +++ b/ClickHouse.Octonica/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(ClickHouse.Octonica,True).sql @@ -10,7 +10,7 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 BeforeExecute -- ClickHouse.Octonica ClickHouse @@ -24,5 +24,5 @@ SELECT FROM Person r WHERE - r.PersonID + 1 = 0 + r.PersonID = -1 diff --git a/DB2.LinqService/Tests/Linq/CteTests/Tests.Linq.CteTests.IssueCteDuplicateColumn(DB2.LinqService).sql b/DB2.LinqService/Tests/Linq/CteTests/Tests.Linq.CteTests.IssueCteDuplicateColumn(DB2.LinqService).sql index 1f1109269728..876977920f64 100644 --- a/DB2.LinqService/Tests/Linq/CteTests/Tests.Linq.CteTests.IssueCteDuplicateColumn(DB2.LinqService).sql +++ b/DB2.LinqService/Tests/Linq/CteTests/Tests.Linq.CteTests.IssueCteDuplicateColumn(DB2.LinqService).sql @@ -25,10 +25,8 @@ AS "t2"."Id1", "record2"."Id2" FROM - CTE_1 "t2", - CTE_1 "record2" - WHERE - "t2"."Id2" = "record2"."Id1" + CTE_1 "t2" + INNER JOIN CTE_1 "record2" ON "t2"."Id2" = "record2"."Id1" ) SELECT "t3"."Id1", diff --git a/DB2/Tests/DataProvider/DB2Tests/Tests.DataProvider.DB2Tests.Issue2763Test(DB2).sql b/DB2/Tests/DataProvider/DB2Tests/Tests.DataProvider.DB2Tests.Issue2763Test(DB2).sql index 217be80f3885..3833bd732685 100644 --- a/DB2/Tests/DataProvider/DB2Tests/Tests.DataProvider.DB2Tests.Issue2763Test(DB2).sql +++ b/DB2/Tests/DataProvider/DB2Tests/Tests.DataProvider.DB2Tests.Issue2763Test(DB2).sql @@ -20,7 +20,7 @@ SELECT FROM SYSCAT.INDEXES WHERE - UNIQUERULE = 'P' AND TABSCHEMA IN ('DB2INST1', 'NULLID', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS') + UNIQUERULE = 'P' AND TABSCHEMA IN ('DB2INST1', 'NULLID', 'SESSION', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS') BeforeExecute -- DB2 DB2.LUW DB2LUW @@ -41,7 +41,7 @@ SELECT FROM SYSCAT.COLUMNS WHERE - TABSCHEMA IN ('DB2INST1', 'NULLID', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS') + TABSCHEMA IN ('DB2INST1', 'NULLID', 'SESSION', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS') BeforeExecute -- DB2 DB2.LUW DB2LUW @@ -58,7 +58,7 @@ SELECT FROM SYSCAT.REFERENCES WHERE - TABSCHEMA IN ('DB2INST1', 'NULLID', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS') + TABSCHEMA IN ('DB2INST1', 'NULLID', 'SESSION', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS') BeforeExecute -- DB2 DB2.LUW DB2LUW @@ -78,7 +78,7 @@ SELECT * FROM ( FROM SYSCAT.PROCEDURES p LEFT JOIN SYSCAT.MODULEOBJECTS o ON p.SPECIFICNAME = o.SPECIFICNAME - WHERE p.PROCSCHEMA IN ('DB2INST1', 'NULLID', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS') + WHERE p.PROCSCHEMA IN ('DB2INST1', 'NULLID', 'SESSION', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS') UNION ALL SELECT f.SPECIFICNAME, @@ -93,7 +93,7 @@ SELECT * FROM ( FROM SYSCAT.FUNCTIONS f LEFT JOIN SYSCAT.MODULEOBJECTS o ON f.SPECIFICNAME = o.SPECIFICNAME - WHERE f.FUNCSCHEMA IN ('DB2INST1', 'NULLID', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS')) + WHERE f.FUNCSCHEMA IN ('DB2INST1', 'NULLID', 'SESSION', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS')) ORDER BY OBJECTMODULENAME, PROCSCHEMA, PROCNAME, PARM_COUNT BeforeExecute @@ -113,7 +113,7 @@ SELECT NULLS FROM SYSCAT.PROCPARMS -WHERE PROCSCHEMA IN ('DB2INST1', 'NULLID', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS') +WHERE PROCSCHEMA IN ('DB2INST1', 'NULLID', 'SESSION', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS') UNION ALL SELECT SPECIFICNAME, @@ -128,7 +128,7 @@ SELECT 'Y' FROM SYSCAT.FUNCPARMS - WHERE ROWTYPE <> 'R' AND FUNCSCHEMA IN ('DB2INST1', 'NULLID', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS') + WHERE ROWTYPE <> 'R' AND FUNCSCHEMA IN ('DB2INST1', 'NULLID', 'SESSION', 'SQLJ', 'SYSCAT', 'SYSFUN', 'SYSIBM', 'SYSIBMADM', 'SYSIBMINTERNAL', 'SYSIBMTS', 'SYSPROC', 'SYSPUBLIC', 'SYSSTAT', 'SYSTOOLS') BeforeExecute BeginTransaction diff --git a/DB2/Tests/Linq/CteTests/Tests.Linq.CteTests.IssueCteDuplicateColumn(DB2).sql b/DB2/Tests/Linq/CteTests/Tests.Linq.CteTests.IssueCteDuplicateColumn(DB2).sql index 5a3bcc4a8473..bb8265106e06 100644 --- a/DB2/Tests/Linq/CteTests/Tests.Linq.CteTests.IssueCteDuplicateColumn(DB2).sql +++ b/DB2/Tests/Linq/CteTests/Tests.Linq.CteTests.IssueCteDuplicateColumn(DB2).sql @@ -25,10 +25,8 @@ AS "t2"."Id1", "record2"."Id2" FROM - CTE_1 "t2", - CTE_1 "record2" - WHERE - "t2"."Id2" = "record2"."Id1" + CTE_1 "t2" + INNER JOIN CTE_1 "record2" ON "t2"."Id2" = "record2"."Id1" ) SELECT "t3"."Id1", diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.13).sql new file mode 100644 index 000000000000..06fbc52570bf --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.13).sql @@ -0,0 +1,164 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 1 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'bc7b663d-0fde-4327-8f92-5d8cc3a11d11'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C1' +DECLARE @Name Text(2) -- String +SET @Name = 'N1' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 2 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'a948600d-de21-4f74-8ac2-9516b287076e'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C2' +DECLARE @Name Text(2) -- String +SET @Name = 'N2' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 3 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'bd3973a5-4323-4dd8-9f4f-df9f93e2a627'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C3' +DECLARE @Name Text(2) -- String +SET @Name = 'N3' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +SELECT s."Id", s."Code", s."IsDeleted", s."Name", s."PermanentId" +FROM "Subdivisions" AS s +WHERE s."Id"::bigint = 1 + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id"::BigInt = 1 + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @id Bigint -- Int64 +SET @id = 1 + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id" = :id + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id" IN (2, 3) + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."PermanentId", + t1."Code", + t1."Name", + t1."IsDeleted" +FROM + "Subdivisions" t1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..4e983e532ea5 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.13).sql @@ -0,0 +1,10 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "Issue261Table" t1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..08d57ad749ee --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.13).sql @@ -0,0 +1,43 @@ +Parameters: +@p0='?' (DbType = Object), @p1='?', @p2='?' (DbType = Object), @p3='?' (DbType = Object), @p4='?', @p5='?' (DbType = Object), @p6='?' (DbType = Object), @p7='?', @p8='?' (DbType = Object) + +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p0, @p1, @p2) +RETURNING "Id"; +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p3, @p4, @p5) +RETURNING "Id"; +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p6, @p7, @p8) +RETURNING "Id"; + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +INSERT INTO "Issue4783DBRecords" +( + "Source", + "Status", + "NullableStatus" +) +VALUES +('linq2db','open'::issue4783db_status,'open'::issue4783db_status), +('linq2db','closed'::issue4783db_status,'closed'::issue4783db_status), +('linq2db','closed'::issue4783db_status,NULL) + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4783DBRecords" t1 +ORDER BY + t1."Id" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..b81b471b059f --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.13).sql @@ -0,0 +1,10 @@ +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name" +FROM + "Issue4917DBRecords" t1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.13).sql new file mode 100644 index 000000000000..51c3d7adada3 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.13).sql @@ -0,0 +1,5 @@ +SELECT w."Id", w."Value" +FROM "WithDuplicateProperties" AS w +WHERE w."Value" = 1 + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.13).sql new file mode 100644 index 000000000000..56e9098f0dce --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.13).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.9.5 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.9.5 PostgreSQL + +INSERT INTO "NoIdentity" +( + "Id", + "Name" +) +VALUES +('bc7b663d-0fde-4327-8f92-5d8cc3a11d11'::uuid,'John Doe'), +('a948600d-de21-4f74-8ac2-9516b287076e'::uuid,'Jane Doe') + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.9.5 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.13).sql new file mode 100644 index 000000000000..a1b82e0ca535 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.13).sql @@ -0,0 +1,32 @@ +Parameters: +@p0='?', @p1='?', @p2='?', @p3='?', @p4='?' + +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p0) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p1) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p2) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p3) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p4) +RETURNING "Id"; + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Discriminator", + t1."Id" +FROM + "WithInheritance" t1 +WHERE + t1."Discriminator" IN ('WithInheritanceA2', 'WithInheritanceA1', 'WithInheritanceA') + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.13).sql new file mode 100644 index 000000000000..4c761cf4cb54 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.13).sql @@ -0,0 +1,33 @@ +-- PostgreSQL.9.5 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +INSERT ASYNC BULK "NoIdentity"(Id, Name) + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.9.5 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.13).sql new file mode 100644 index 000000000000..bb8aca9d9bde --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.13).sql @@ -0,0 +1,33 @@ +-- PostgreSQL.9.5 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +INSERT BULK "NoIdentity"(Id, Name) + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.9.5 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.13).sql new file mode 100644 index 000000000000..5b8ae756e22c --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.13).sql @@ -0,0 +1,76 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +INSERT INTO "SkipModes" ("Id", "InsertOnly") +VALUES (@p0, @p1); + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 2 +DECLARE @InsertOnly Integer -- Int32 +SET @InsertOnly = 2 + +INSERT INTO "SkipModes" +( + "Id", + "InsertOnly" +) +VALUES +( + :Id, + :InsertOnly +) + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."InsertOnly", + t1."UpdateOnly", + t1."ReadOnly" +FROM + "SkipModes" t1 +ORDER BY + t1."Id" + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +UPDATE "SkipModes" SET "UpdateOnly" = @p0 +WHERE "Id" = @p1; + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @UpdateOnly Integer -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id Integer -- Int32 +SET @Id = 2 + +UPDATE + "SkipModes" +SET + "UpdateOnly" = :UpdateOnly +WHERE + "SkipModes"."Id" = :Id + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."InsertOnly", + t1."UpdateOnly", + t1."ReadOnly" +FROM + "SkipModes" t1 +ORDER BY + t1."Id" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.13).sql new file mode 100644 index 000000000000..7b856d05427d --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.13).sql @@ -0,0 +1,38 @@ +-- PostgreSQL.9.5 PostgreSQL + +CREATE TEMPORARY TABLE "WithIdentity" +( + "Id" integer NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_WithIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.9.5 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.9.5 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + +-- PostgreSQL.9.5 PostgreSQL + +DROP TABLE IF EXISTS "WithIdentity" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.13).sql new file mode 100644 index 000000000000..453dc5513e7e --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.13).sql @@ -0,0 +1,28 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int64), @p3='?' (DbType = Int64), @p4='?' (DbType = Decimal), @p5='?' (DbType = Decimal) + +INSERT INTO "UIntTable" ("Field16", "Field16N", "Field32", "Field32N", "Field64", "Field64N") +VALUES (@p0, @p1, @p2, @p3, @p4, @p5) +RETURNING "ID"; + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) +DECLARE @field64 Numeric(1, 0) -- Decimal +SET @field64 = 5 + +SELECT + e."ID", + e."Field16", + e."Field32", + e."Field64", + e."Field16N", + e."Field32N", + e."Field64N" +FROM + "UIntTable" e +WHERE + e."Field64" = :field64 +LIMIT 1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.13,False,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.13,False,False).sql new file mode 100644 index 000000000000..4fadd949b642 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.13,False,False).sql @@ -0,0 +1,12 @@ +SELECT e.id, e.name, s0.id, s0.master_id, s0.name, s0.id0, s0.master_id0, s0.name0, c.id, c.name, c.parent_id +FROM entities AS e +LEFT JOIN ( + SELECT d.id, d.master_id, d.name, s.id AS id0, s.master_id AS master_id0, s.name AS name0 + FROM details AS d + LEFT JOIN sub_details AS s ON d.id = s.master_id +) AS s0 ON e.id = s0.master_id +LEFT JOIN children AS c ON e.id = c.parent_id +WHERE e.name = 'Alpha' +ORDER BY e.id, s0.id, s0.id0 + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.13,False,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.13,False,True).sql new file mode 100644 index 000000000000..4fadd949b642 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.13,False,True).sql @@ -0,0 +1,12 @@ +SELECT e.id, e.name, s0.id, s0.master_id, s0.name, s0.id0, s0.master_id0, s0.name0, c.id, c.name, c.parent_id +FROM entities AS e +LEFT JOIN ( + SELECT d.id, d.master_id, d.name, s.id AS id0, s.master_id AS master_id0, s.name AS name0 + FROM details AS d + LEFT JOIN sub_details AS s ON d.id = s.master_id +) AS s0 ON e.id = s0.master_id +LEFT JOIN children AS c ON e.id = c.parent_id +WHERE e.name = 'Alpha' +ORDER BY e.id, s0.id, s0.id0 + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.13,True,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.13,True,False).sql new file mode 100644 index 000000000000..21d060e44313 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.13,True,False).sql @@ -0,0 +1,76 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."Id", + m_1."Id_1", + d_1.id, + d_1.master_id, + d_1.name +FROM + ( + SELECT DISTINCT + d.id as "Id", + t1."Id" as "Id_1" + FROM + ( + SELECT DISTINCT + e.id as "Id" + FROM + entities e + WHERE + e.name = 'Alpha' + ) t1 + INNER JOIN details d ON t1."Id" = d.master_id + ) m_1 + INNER JOIN sub_details d_1 ON m_1."Id" = d_1.master_id + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.id, + d.master_id, + d.name +FROM + entities m_1 + INNER JOIN details d ON m_1.id = d.master_id +WHERE + m_1.name = 'Alpha' + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.id, + d.parent_id, + d.name +FROM + entities m_1 + INNER JOIN children d ON m_1.id = d.parent_id +WHERE + m_1.name = 'Alpha' + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e.id, + e.name +FROM + entities e +WHERE + e.name = 'Alpha' + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.13,True,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.13,True,True).sql new file mode 100644 index 000000000000..21d060e44313 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.13,True,True).sql @@ -0,0 +1,76 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."Id", + m_1."Id_1", + d_1.id, + d_1.master_id, + d_1.name +FROM + ( + SELECT DISTINCT + d.id as "Id", + t1."Id" as "Id_1" + FROM + ( + SELECT DISTINCT + e.id as "Id" + FROM + entities e + WHERE + e.name = 'Alpha' + ) t1 + INNER JOIN details d ON t1."Id" = d.master_id + ) m_1 + INNER JOIN sub_details d_1 ON m_1."Id" = d_1.master_id + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.id, + d.master_id, + d.name +FROM + entities m_1 + INNER JOIN details d ON m_1.id = d.master_id +WHERE + m_1.name = 'Alpha' + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.id, + d.parent_id, + d.name +FROM + entities m_1 + INNER JOIN children d ON m_1.id = d.parent_id +WHERE + m_1.name = 'Alpha' + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e.id, + e.name +FROM + entities e +WHERE + e.name = 'Alpha' + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.13).sql new file mode 100644 index 000000000000..1f665e79775c --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.13).sql @@ -0,0 +1,13 @@ +Parameters: +@p0='test insert ef' (Nullable = false) + +INSERT INTO entities (name) +VALUES (@p0) +RETURNING id; + + +SELECT e.id, e.name +FROM entities AS e +LIMIT 2 + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.13).sql new file mode 100644 index 000000000000..8dd9d2f5df81 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.13).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @name Text(11) -- String +SET @name = 'test insert' + +INSERT INTO entities +( + name +) +VALUES +( + :name +) +RETURNING + id + + + +Parameters: +@id='50' + +SELECT e.id, e.name +FROM entities AS e +WHERE e.id::bigint = @id +LIMIT 2 + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.13,False,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.13,False,True).sql new file mode 100644 index 000000000000..803b4f11e467 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.13,False,True).sql @@ -0,0 +1,10 @@ +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.13,True,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.13,True,False).sql new file mode 100644 index 000000000000..bec89c93edbf --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.13,True,False).sql @@ -0,0 +1,31 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.13,True,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.13,True,True).sql new file mode 100644 index 000000000000..bec89c93edbf --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.13,True,True).sql @@ -0,0 +1,31 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..588606bea69e --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.13,False).sql @@ -0,0 +1,41 @@ +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..f9fe2df232ed --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.13,True).sql @@ -0,0 +1,41 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.13,False,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.13,False,True).sql new file mode 100644 index 000000000000..8d38ce10d713 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.13,False,True).sql @@ -0,0 +1,5 @@ +SELECT d.id, d.master_id, d.name, e.id, e.name +FROM details AS d +INNER JOIN entities AS e ON d.master_id = e.id + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.13,True,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.13,True,False).sql new file mode 100644 index 000000000000..b5ce715f04fb --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.13,True,False).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.13,True,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.13,True,True).sql new file mode 100644 index 000000000000..b5ce715f04fb --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.13,True,True).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.13,False,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.13,False,True).sql new file mode 100644 index 000000000000..8d38ce10d713 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.13,False,True).sql @@ -0,0 +1,5 @@ +SELECT d.id, d.master_id, d.name, e.id, e.name +FROM details AS d +INNER JOIN entities AS e ON d.master_id = e.id + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.13,True,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.13,True,True).sql new file mode 100644 index 000000000000..b5ce715f04fb --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.13,True,True).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.13,Default).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.13,Default).sql new file mode 100644 index 000000000000..f755eeefd191 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.13,Default).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.13,MultipleRows).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.13,MultipleRows).sql new file mode 100644 index 000000000000..f755eeefd191 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.13,MultipleRows).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.13,ProviderSpecific).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.13,ProviderSpecific).sql new file mode 100644 index 000000000000..f755eeefd191 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.13,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.13,RowByRow).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.13,RowByRow).sql new file mode 100644 index 000000000000..f755eeefd191 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.13,RowByRow).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.13).sql new file mode 100644 index 000000000000..adeb323d784c --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.13).sql @@ -0,0 +1,10 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @p='?' (DbType = Int32) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductID" > 0 +ORDER BY p."ProductID" +LIMIT @p + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.13).sql new file mode 100644 index 000000000000..41af5f94d478 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.13).sql @@ -0,0 +1,52 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.13).sql new file mode 100644 index 000000000000..48778ea0af47 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.13).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.13).sql new file mode 100644 index 000000000000..48778ea0af47 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.13).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.13).sql new file mode 100644 index 000000000000..6a862480a060 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.13).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id" +FROM + "Patents" t1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..1152699fae3c --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.13).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT p."Id" AS "PatentId", @userId0 AS "UserId" +FROM "Patents" AS p +LEFT JOIN "PatentAssessment" AS p0 ON p."Id" = p0."PatentId" +WHERE p0."PatentId" IS NULL OR p0."TechnicalReviewerId" <> @userId OR p0."TechnicalReviewerId" IS NULL + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @userId Integer -- Int32 +SET @userId = 1 + +SELECT + p."Id" +FROM + "Patents" p + LEFT JOIN "PatentAssessment" "a_Assessment" ON p."Id" = "a_Assessment"."PatentId" +WHERE + "a_Assessment"."PatentId" IS NULL OR "a_Assessment"."TechnicalReviewerId" <> :userId OR + "a_Assessment"."TechnicalReviewerId" IS NULL + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..6f858c86bdd7 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.13).sql @@ -0,0 +1,21 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."Id", + e."Linked", + ( + SELECT + ARRAY_AGG(DISTINCT r."Id") + FROM + "Issue155Table" r + WHERE + e."Id" = ANY(r."Linked") + ) +FROM + "Issue155Table" e +WHERE + e."Id" = 1 +LIMIT 2 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.13).sql new file mode 100644 index 000000000000..4e8e429af477 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.13).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + COUNT(*) +FROM + "Parents" x +WHERE + ( + SELECT + "a_Children"."IsActive" + FROM + "Children" "a_Children" + WHERE + x."Id" = "a_Children"."ParentId" + LIMIT 1 + ) = False + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.13).sql new file mode 100644 index 000000000000..d7d1642931f5 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.13).sql @@ -0,0 +1,18 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + COUNT(*) +FROM + "Parents" x +WHERE + NOT EXISTS( + SELECT + * + FROM + "Children" y + WHERE + x."Id" = y."ParentId" AND y."IsActive" + ) + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..6a862480a060 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.13).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id" +FROM + "Patents" t1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..acb306ff44c2 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.13).sql @@ -0,0 +1,11 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id" +FROM + "Issue340Entities" x +WHERE + x."IsActive" = True + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..03659969fda7 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.13).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.9.5 PostgreSQL + +UPDATE + "PostgreTestTable" +SET + ("Title", "SearchVector") = ( + SELECT + "PostgreTestTable"."Title", + to_tsvector('test') + FROM + "PostgreTestTable" x + WHERE + "PostgreTestTable"."Id" = x."Id" + ) +WHERE + "PostgreTestTable"."Id" = 1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..f706b6824e5d --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.13).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + 1 +FROM + "Parents" ua +WHERE + ua."ParentId" = 55377 AND EXISTS( + SELECT + * + FROM + "Parents" t1 + ) + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.13).sql new file mode 100644 index 000000000000..d9d5de6c5245 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.13).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @DateTimeOffset TimestampTz -- DateTime +SET @DateTimeOffset = '2020-02-29T17:54:55.1231234+00:00' +DECLARE @DateTimeOffsetN TimestampTz -- DateTime +SET @DateTimeOffsetN = '2020-02-29T17:54:55.1231234+00:00' + +UPDATE + "Types" +SET + "DateTimeOffset" = :DateTimeOffset, + "DateTimeOffsetN" = :DateTimeOffsetN +WHERE + "Types"."Id" = 2 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.13).sql new file mode 100644 index 000000000000..38a114a38455 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.13).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @DateTimeOffsetWithConverter Bigint -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter Bigint -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + "Types" +SET + "DateTimeOffsetWithConverter" = :DateTimeOffsetWithConverter, + "DateTimeOffsetNWithConverter" = :DateTimeOffsetNWithConverter +WHERE + "Types"."Id" = 2 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.13).sql new file mode 100644 index 000000000000..1c5775a1156f --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.13).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."Id", + d_1."Key_1", + d_1."SUM_1", + d_1."ToValue" +FROM + "Parents" m_1 + INNER JOIN LATERAL ( + SELECT + d."ParentId" as "Key_1", + SUM(d."Id") as "SUM_1", + STRING_AGG(d."Name", ', ') as "ToValue" + FROM + "Children" d + WHERE + m_1."Id" = d."ParentId" + GROUP BY + d."ParentId" + ) d_1 ON 1=1 + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + c_1."Id" +FROM + "Parents" c_1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..96f974c7ffa1 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.13).sql @@ -0,0 +1,36 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + id."Id" +FROM + ( + SELECT + p."Id" + FROM + "Issue4629Posts" p + WHERE + ( + SELECT + SUM("a_Tags"."Weight") + FROM + "Issue4629Tags" "a_Tags" + WHERE + p."Id" = "a_Tags"."PostId" AND "a_Tags"."Weight" > 1 + ) > 5 + ORDER BY + ( + SELECT + SUM("a_Tags_1"."Weight") + FROM + "Issue4629Tags" "a_Tags_1" + WHERE + p."Id" = "a_Tags_1"."PostId" + ) + LIMIT :take + ) id + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..c4f58cc92ad8 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.13).sql @@ -0,0 +1,20 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @id Integer -- Int32 +SET @id = 2 + +SELECT + t1."Index_1" +FROM + ( + SELECT + x."Id", + ROW_NUMBER() OVER(ORDER BY x."Id") as "Index_1" + FROM + "Parents" x + ) t1 +WHERE + t1."Id" = :id +LIMIT 1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..f2cc76bf7e3f --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.13).sql @@ -0,0 +1,40 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."Key_1", + d."CfAllowValue", + d."DateFrom" +FROM + ( + SELECT + p."AclNameId" as "Key_1" + FROM + "Issue4624Items" p + GROUP BY + p."AclNameId" + LIMIT 1 + ) m_1 + INNER JOIN "Issue4624Items" d ON m_1."Key_1" = d."AclNameId" +ORDER BY + d."DateFrom" + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."AclNameId" +FROM + "Issue4624Items" p +GROUP BY + p."AclNameId" +LIMIT 1 + + + +DisposeTransaction + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..a60b24170dab --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.13).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id" +FROM + "Masters" t1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..16ad7682ff03 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.13).sql @@ -0,0 +1,21 @@ +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + x."Id", + x."IsActive", + x."ParentId", + x."Name" +FROM + "Children" x +WHERE + x."Name" LIKE '%Test%' ESCAPE '~' +ORDER BY + x."Name" + + + +SELECT c."Id", c."IsActive", c."Name", c."ParentId" +FROM "Children" AS c +WHERE c."Name" LIKE 'Test%' + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..7bc9a2328ffe --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.13,False).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..7bc9a2328ffe --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.13,True).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..7bc9a2328ffe --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.13,False).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..7bc9a2328ffe --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.13,True).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.13).sql new file mode 100644 index 000000000000..cea078e29863 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.13).sql @@ -0,0 +1,18 @@ +SELECT COALESCE(i0."Name", '') || '>' || i."Name" +FROM "Issue73Entities" AS i +LEFT JOIN "Issue73Entities" AS i0 ON i."ParentId" = i0."Id" +WHERE i."Name" = 'Name1_3' + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + "a_Parent"."Name" || '>' || x."Name" +FROM + "Issue73Entities" x + LEFT JOIN "Issue73Entities" "a_Parent" ON x."ParentId" = "a_Parent"."Id" +WHERE + x."Name" = 'Name1_3' + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.13).sql new file mode 100644 index 000000000000..9fd241684177 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.13).sql @@ -0,0 +1,30 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32) + +INSERT INTO "IssueEnum" ("Value") +VALUES (@p0) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p1) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p2) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p3) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p4) +RETURNING "Id"; + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Value" +FROM + "IssueEnum" t1 + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.13).sql new file mode 100644 index 000000000000..05e16af17bf1 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.13).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @guids -2147483621 -- Object +SET @guids = {'271425b1-ebe8-400d-b71d-a6e47a460ae3'::uuid,'b75de94e-6d7b-4c70-bfa1-f8639a6a5b35'::uuid} + +SELECT + m_1."Id", + m_1."Guids" +FROM + "EntityWithArrays" m_1 +WHERE + m_1."Guids" && :guids + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.13).sql new file mode 100644 index 000000000000..2cb671ae9097 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.13).sql @@ -0,0 +1,20 @@ +-- PostgreSQL.9.5 PostgreSQL + +INSERT INTO "EntityWithXmin" +( + "Value" +) +VALUES +('Str1'), +('Str2'), +('Str3'), +('Str4'), +('Str5'), +('Str6'), +('Str7'), +('Str8'), +('Str9'), +('Str10') + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.13,Local).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.13,Local).sql new file mode 100644 index 000000000000..b597796187c5 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.13,Local).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.13,Unspecified).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.13,Unspecified).sql new file mode 100644 index 000000000000..b597796187c5 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.13,Unspecified).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.13,Utc).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.13,Utc).sql new file mode 100644 index 000000000000..b597796187c5 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.13,Utc).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.13).sql new file mode 100644 index 000000000000..4d205bed27ca --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.13).sql @@ -0,0 +1,27 @@ +Parameters: +@date='?' (DbType = DateTime2) + +SELECT e."Id", e."Duration", e."Name" +FROM "Events" AS e +WHERE e."Duration" @> @date OR lower(e."Duration") = @date OR upper(e."Duration") = @date OR isempty(e."Duration") OR isempty(e."Duration" * e."Duration") + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @date Timestamp -- DateTime2 +SET @date = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Name", + e."Duration" +FROM + "Events" e +WHERE + e."Duration" @> :date OR + lower(e."Duration") = :date OR + upper(e."Duration") = :date OR + isempty(e."Duration") OR + isempty(e."Duration" * e."Duration") + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.13).sql new file mode 100644 index 000000000000..e41068c96ae8 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.13).sql @@ -0,0 +1,15 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @guids -2147483621 -- Object +SET @guids = {'271425b1-ebe8-400d-b71d-a6e47a460ae3'::uuid,'b75de94e-6d7b-4c70-bfa1-f8639a6a5b35'::uuid} + +SELECT + m_1."Id", + m_1."Guids" +FROM + "EntityWithArrays" m_1 + INNER JOIN LATERAL UNNEST(m_1."Guids") g_1(value) ON 1=1 +WHERE + m_1."Guids" && :guids + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.13).sql new file mode 100644 index 000000000000..619293b024a5 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.13).sql @@ -0,0 +1,16 @@ +SELECT e."Name" +FROM views."EventsView" AS e +WHERE e."Name" LIKE 'any%' + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."Name" +FROM + views."EventsView" e +WHERE + e."Name" LIKE 'any%' ESCAPE '~' + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.13).sql new file mode 100644 index 000000000000..dd4c9ca164fc --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.13).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" IS NOT NULL + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.13).sql new file mode 100644 index 000000000000..d95cee20fee5 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.13).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" LIKE '%anything%' ESCAPE '~' + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.13).sql new file mode 100644 index 000000000000..ffac6df73c83 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.13).sql @@ -0,0 +1,24 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @value Varchar(10) -- String +SET @value = '%anything%' + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" LIKE :value ESCAPE '~' + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.13).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.13).sql new file mode 100644 index 000000000000..ae3cb53e09af --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.13).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o1."OrderID", o1."ProductID", p0."ProductID", o3."OrderId", o3."ProductId", o3."Quantity", o1."Quantity", p0."ProductName" +FROM "Orders" AS o +INNER JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Quantity" + FROM "Order Details" AS o0 + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS o1 ON o."OrderID" = o1."OrderID" +INNER JOIN ( + SELECT p."ProductID", p."ProductName" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +) AS p0 ON o1."ProductID" = p0."ProductID" +LEFT JOIN ( + SELECT o2."OrderID" AS "OrderId", o2."ProductID" AS "ProductId", o2."Quantity" + FROM "Order Details" AS o2 + WHERE @ef_filter__p2 OR NOT (o2."IsDeleted") OR NOT (o2."IsDeleted") +) AS o3 ON p0."ProductID" = o3."ProductId" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", o1."OrderID", o1."ProductID", p0."ProductID", o3."OrderId" + + +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."ProductId", + d."OrderID", + d."ProductID", + d."Quantity" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId" + FROM + "Orders" e + INNER JOIN "Order Details" od ON e."OrderID" = od."OrderID" + INNER JOIN "Products" "a_Product" ON od."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d ON m_1."ProductId" = d."ProductID" + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + "a_Product"."ProductID", + od."OrderID", + od."ProductID", + od."Quantity", + "a_Product"."ProductName" +FROM + "Orders" o + INNER JOIN "Order Details" od ON o."OrderID" = od."OrderID" + INNER JOIN "Products" "a_Product" ON od."ProductID" = "a_Product"."ProductID" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..93bc825a419c --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.13,False).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS p + WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%') + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + "Products" e + WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..fadef1e067de --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.13,True).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS p + WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%') + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + "Products" e + WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..6a9291f2eab2 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.13,False).sql @@ -0,0 +1,17 @@ +-- PostgreSQL.9.5 PostgreSQL + +DELETE FROM + "Products" e +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' AND e."ProductName" = 'a' + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..50e1466e63b2 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.13,True).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.9.5 PostgreSQL + +DELETE FROM + "Products" e +WHERE + NOT e."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' AND + e."ProductName" = 'a' + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..5155bca47ae2 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.13,False).sql @@ -0,0 +1,94 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2; + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..44010114a9d1 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.13,True).sql @@ -0,0 +1,105 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2; + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..33e5b2164cb5 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.13,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..33e2b2a492ab --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.13,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..33e5b2164cb5 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.13,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..33e2b2a492ab --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.13,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..048de81c2aa0 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.13,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder", s."OrderID0", s."ProductID1", s."Discount0", s."IsDeleted1", s."Quantity0", s."UnitPrice1" +FROM "Orders" AS o +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder", o2."OrderID" AS "OrderID0", o2."ProductID" AS "ProductID1", o2."Discount" AS "Discount0", o2."IsDeleted" AS "IsDeleted1", o2."Quantity" AS "Quantity0", o2."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + LEFT JOIN ( + SELECT o1."OrderID", o1."ProductID", o1."Discount", o1."IsDeleted", o1."Quantity", o1."UnitPrice" + FROM "Order Details" AS o1 + WHERE @ef_filter__p2 OR NOT (o1."IsDeleted") OR NOT (o1."IsDeleted") + ) AS o2 ON p0."ProductID" = o2."ProductID" + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", s."OrderID", s."ProductID", s."ProductID0", s."OrderID0" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..0b19cceb4c35 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.13,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder", s."OrderID0", s."ProductID1", s."Discount0", s."IsDeleted1", s."Quantity0", s."UnitPrice1" +FROM "Orders" AS o +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder", o2."OrderID" AS "OrderID0", o2."ProductID" AS "ProductID1", o2."Discount" AS "Discount0", o2."IsDeleted" AS "IsDeleted1", o2."Quantity" AS "Quantity0", o2."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + LEFT JOIN ( + SELECT o1."OrderID", o1."ProductID", o1."Discount", o1."IsDeleted", o1."Quantity", o1."UnitPrice" + FROM "Order Details" AS o1 + WHERE @ef_filter__p2 OR NOT (o1."IsDeleted") OR NOT (o1."IsDeleted") + ) AS o2 ON p0."ProductID" = o2."ProductID" + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", s."OrderID", s."ProductID", s."ProductID0", s."OrderID0" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..1bb8ddc4ae74 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.13,False).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e + LEFT JOIN "Products" op ON op."ProductID" <> e."ProductID" AND op."ProductName" = e."ProductName" +WHERE + op."ProductID" IS NULL + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..c06e04c6eff8 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.13,True).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e + LEFT JOIN "Products" op ON op."ProductID" <> e."ProductID" AND op."ProductName" = e."ProductName" AND NOT op."IsDeleted" +WHERE + NOT e."IsDeleted" AND op."ProductID" IS NULL + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..c7efba886866 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.13,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", o."OrderID", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + e_1."IsDeleted", + e_1."TerritoryID", + e_1."TerritoryDescription", + e_1."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" e_1 ON d."TerritoryID" = e_1."TerritoryID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + e_1."IsDeleted", + e_1."ProductID", + e_1."ProductName", + e_1."SupplierID", + e_1."CategoryID", + e_1."QuantityPerUnit", + e_1."UnitPrice", + e_1."UnitsInStock", + e_1."UnitsOnOrder", + e_1."ReorderLevel", + e_1."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" e_1 ON d."ProductID" = e_1."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath", + o."OrderID" +FROM + "Orders" o + LEFT JOIN "Employees" "a_Employee" ON o."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..dae3d7d32224 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.13,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", o."OrderID", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + e_1."IsDeleted", + e_1."TerritoryID", + e_1."TerritoryDescription", + e_1."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" e_1 ON d."TerritoryID" = e_1."TerritoryID" +WHERE + NOT e_1."IsDeleted" AND NOT d."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + e_1."IsDeleted", + e_1."ProductID", + e_1."ProductName", + e_1."SupplierID", + e_1."CategoryID", + e_1."QuantityPerUnit", + e_1."UnitPrice", + e_1."UnitsInStock", + e_1."UnitsOnOrder", + e_1."ReorderLevel", + e_1."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" e_1 ON d."ProductID" = e_1."ProductID" +WHERE + NOT e_1."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath", + o."OrderID" +FROM + "Orders" o + LEFT JOIN "Employees" "a_Employee" ON o."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT o."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..b0ecfa57aa98 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.13,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..d10efc19f8af --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.13,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" AND NOT "a_ReportsToNavigation"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..e92f58f2f4f8 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.13,False).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."City" IS NOT NULL + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..55c03a3d4409 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.13,True).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + NOT e."IsDeleted" AND e."City" IS NOT NULL + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..20bfc5514d81 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.13,False).sql @@ -0,0 +1,70 @@ +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" +FROM "Products" AS p +INNER JOIN "Order Details" AS o ON p."ProductID" = o."ProductID" + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice" +FROM "Products" AS p +INNER JOIN ( + SELECT o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" + FROM "Order Details" AS o + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS o0 ON p."ProductID" = o0."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..8f01826f0ddd --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.13,True).sql @@ -0,0 +1,74 @@ +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" +FROM "Products" AS p +INNER JOIN "Order Details" AS o ON p."ProductID" = o."ProductID" + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" +WHERE + NOT d."IsDeleted" + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice" +FROM "Products" AS p +INNER JOIN ( + SELECT o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" + FROM "Order Details" AS o + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS o0 ON p."ProductID" = o0."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" +WHERE + NOT p."IsDeleted" AND NOT d."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..78db904ac501 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.13,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + "a_Territory"."IsDeleted", + "a_Territory"."TerritoryID", + "a_Territory"."TerritoryDescription", + "a_Territory"."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" "a_Territory" ON d."TerritoryID" = "a_Territory"."TerritoryID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..4d641d2fc468 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.13,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + "a_Territory"."IsDeleted", + "a_Territory"."TerritoryID", + "a_Territory"."TerritoryDescription", + "a_Territory"."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" "a_Territory" ON d."TerritoryID" = "a_Territory"."TerritoryID" +WHERE + NOT "a_Territory"."IsDeleted" AND NOT d."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..09f9a4f8bac5 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.13,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", e2."EmployeeID", e2."TerritoryID", e2."IsDeleted", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted" + FROM "EmployeeTerritories" AS e1 + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS e2 ON e0."EmployeeID" = e2."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p8 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", e2."EmployeeID", e2."TerritoryID", s."OrderID", s."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..987e599d70e6 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.13,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", e2."EmployeeID", e2."TerritoryID", e2."IsDeleted", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted" + FROM "EmployeeTerritories" AS e1 + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS e2 ON e0."EmployeeID" = e2."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p8 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", e2."EmployeeID", e2."TerritoryID", s."OrderID", s."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" +WHERE + NOT d."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..cc31cd2be68b --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.13,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductName", p."ProductID", s1."Discount", s1."OrderID", s1."CustomerID", s1."EmployeeID", s1."Freight", s1."IsDeleted", s1."OrderDate", s1."RequiredDate", s1."ShipAddress", s1."ShipCity", s1."ShipCountry", s1."ShipName", s1."ShipPostalCode", s1."ShipRegion", s1."ShipVia", s1."ShippedDate", s1."OrderID0", s1."ProductID", s1."ProductID0", s1."SupplierID", s1."ProductID1", s1."CategoryID", s1."Discontinued", s1."IsDeleted0", s1."ProductName", s1."QuantityPerUnit", s1."ReorderLevel", s1."SupplierID0", s1."UnitPrice", s1."UnitsInStock", s1."UnitsOnOrder" +FROM "Products" AS p +LEFT JOIN ( + SELECT o."Discount", o1."OrderID", o1."CustomerID", o1."EmployeeID", o1."Freight", o1."IsDeleted", o1."OrderDate", o1."RequiredDate", o1."ShipAddress", o1."ShipCity", o1."ShipCountry", o1."ShipName", o1."ShipPostalCode", o1."ShipRegion", o1."ShipVia", o1."ShippedDate", o."OrderID" AS "OrderID0", o."ProductID", p1."ProductID" AS "ProductID0", s0."SupplierID", p3."ProductID" AS "ProductID1", p3."CategoryID", p3."Discontinued", p3."IsDeleted" AS "IsDeleted0", p3."ProductName", p3."QuantityPerUnit", p3."ReorderLevel", p3."SupplierID" AS "SupplierID0", p3."UnitPrice", p3."UnitsInStock", p3."UnitsOnOrder" + FROM "Order Details" AS o + INNER JOIN ( + SELECT o0."OrderID", o0."CustomerID", o0."EmployeeID", o0."Freight", o0."IsDeleted", o0."OrderDate", o0."RequiredDate", o0."ShipAddress", o0."ShipCity", o0."ShipCountry", o0."ShipName", o0."ShipPostalCode", o0."ShipRegion", o0."ShipVia", o0."ShippedDate" + FROM "Orders" AS o0 + WHERE @ef_filter__p4 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") + ) AS o1 ON o."OrderID" = o1."OrderID" + INNER JOIN ( + SELECT p0."ProductID", p0."SupplierID" + FROM "Products" AS p0 + WHERE @ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted") + ) AS p1 ON o."ProductID" = p1."ProductID" + LEFT JOIN ( + SELECT s."SupplierID" + FROM "Suppliers" AS s + WHERE @ef_filter__p6 OR NOT (s."IsDeleted") OR NOT (s."IsDeleted") + ) AS s0 ON p1."SupplierID" = s0."SupplierID" + LEFT JOIN ( + SELECT p2."ProductID", p2."CategoryID", p2."Discontinued", p2."IsDeleted", p2."ProductName", p2."QuantityPerUnit", p2."ReorderLevel", p2."SupplierID", p2."UnitPrice", p2."UnitsInStock", p2."UnitsOnOrder" + FROM "Products" AS p2 + WHERE @ef_filter__p0 OR NOT (p2."IsDeleted") OR NOT (p2."IsDeleted") + ) AS p3 ON s0."SupplierID" = p3."SupplierID" + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS s1 ON p."ProductID" = s1."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +ORDER BY p."ProductID", s1."OrderID0", s1."ProductID", s1."OrderID", s1."ProductID0", s1."SupplierID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."SupplierId", + m_1."ProductId", + d_1."IsDeleted", + d_1."ProductID", + d_1."ProductName", + d_1."SupplierID", + d_1."CategoryID", + d_1."QuantityPerUnit", + d_1."UnitPrice", + d_1."UnitsInStock", + d_1."UnitsOnOrder", + d_1."ReorderLevel", + d_1."Discontinued" +FROM + ( + SELECT DISTINCT + "a_Supplier"."SupplierID" as "SupplierId", + t1."ProductId" + FROM + ( + SELECT DISTINCT + e."ProductID" as "ProductId" + FROM + "Products" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."ProductId" = d."ProductID" + INNER JOIN "Orders" e_1 ON d."OrderID" = e_1."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + LEFT JOIN "Suppliers" "a_Supplier" ON "a_Product"."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" + WHERE + NOT e_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + ) m_1 + INNER JOIN "Products" d_1 ON m_1."SupplierId" = d_1."SupplierID" OR m_1."SupplierId" IS NULL AND d_1."SupplierID" IS NULL +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductID", + d."Discount", + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Supplier"."SupplierID" +FROM + "Products" m_1 + INNER JOIN "Order Details" d ON m_1."ProductID" = d."ProductID" + INNER JOIN "Orders" e ON d."OrderID" = e."OrderID" + LEFT JOIN "Suppliers" "a_Supplier" ON m_1."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" +WHERE + NOT m_1."IsDeleted" AND NOT e."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + p."ProductName", + p."ProductID" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..cc31cd2be68b --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.13,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductName", p."ProductID", s1."Discount", s1."OrderID", s1."CustomerID", s1."EmployeeID", s1."Freight", s1."IsDeleted", s1."OrderDate", s1."RequiredDate", s1."ShipAddress", s1."ShipCity", s1."ShipCountry", s1."ShipName", s1."ShipPostalCode", s1."ShipRegion", s1."ShipVia", s1."ShippedDate", s1."OrderID0", s1."ProductID", s1."ProductID0", s1."SupplierID", s1."ProductID1", s1."CategoryID", s1."Discontinued", s1."IsDeleted0", s1."ProductName", s1."QuantityPerUnit", s1."ReorderLevel", s1."SupplierID0", s1."UnitPrice", s1."UnitsInStock", s1."UnitsOnOrder" +FROM "Products" AS p +LEFT JOIN ( + SELECT o."Discount", o1."OrderID", o1."CustomerID", o1."EmployeeID", o1."Freight", o1."IsDeleted", o1."OrderDate", o1."RequiredDate", o1."ShipAddress", o1."ShipCity", o1."ShipCountry", o1."ShipName", o1."ShipPostalCode", o1."ShipRegion", o1."ShipVia", o1."ShippedDate", o."OrderID" AS "OrderID0", o."ProductID", p1."ProductID" AS "ProductID0", s0."SupplierID", p3."ProductID" AS "ProductID1", p3."CategoryID", p3."Discontinued", p3."IsDeleted" AS "IsDeleted0", p3."ProductName", p3."QuantityPerUnit", p3."ReorderLevel", p3."SupplierID" AS "SupplierID0", p3."UnitPrice", p3."UnitsInStock", p3."UnitsOnOrder" + FROM "Order Details" AS o + INNER JOIN ( + SELECT o0."OrderID", o0."CustomerID", o0."EmployeeID", o0."Freight", o0."IsDeleted", o0."OrderDate", o0."RequiredDate", o0."ShipAddress", o0."ShipCity", o0."ShipCountry", o0."ShipName", o0."ShipPostalCode", o0."ShipRegion", o0."ShipVia", o0."ShippedDate" + FROM "Orders" AS o0 + WHERE @ef_filter__p4 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") + ) AS o1 ON o."OrderID" = o1."OrderID" + INNER JOIN ( + SELECT p0."ProductID", p0."SupplierID" + FROM "Products" AS p0 + WHERE @ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted") + ) AS p1 ON o."ProductID" = p1."ProductID" + LEFT JOIN ( + SELECT s."SupplierID" + FROM "Suppliers" AS s + WHERE @ef_filter__p6 OR NOT (s."IsDeleted") OR NOT (s."IsDeleted") + ) AS s0 ON p1."SupplierID" = s0."SupplierID" + LEFT JOIN ( + SELECT p2."ProductID", p2."CategoryID", p2."Discontinued", p2."IsDeleted", p2."ProductName", p2."QuantityPerUnit", p2."ReorderLevel", p2."SupplierID", p2."UnitPrice", p2."UnitsInStock", p2."UnitsOnOrder" + FROM "Products" AS p2 + WHERE @ef_filter__p0 OR NOT (p2."IsDeleted") OR NOT (p2."IsDeleted") + ) AS p3 ON s0."SupplierID" = p3."SupplierID" + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS s1 ON p."ProductID" = s1."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +ORDER BY p."ProductID", s1."OrderID0", s1."ProductID", s1."OrderID", s1."ProductID0", s1."SupplierID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."SupplierId", + m_1."ProductId", + d_1."IsDeleted", + d_1."ProductID", + d_1."ProductName", + d_1."SupplierID", + d_1."CategoryID", + d_1."QuantityPerUnit", + d_1."UnitPrice", + d_1."UnitsInStock", + d_1."UnitsOnOrder", + d_1."ReorderLevel", + d_1."Discontinued" +FROM + ( + SELECT DISTINCT + "a_Supplier"."SupplierID" as "SupplierId", + t1."ProductId" + FROM + ( + SELECT DISTINCT + e."ProductID" as "ProductId" + FROM + "Products" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."ProductId" = d."ProductID" + INNER JOIN "Orders" e_1 ON d."OrderID" = e_1."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + LEFT JOIN "Suppliers" "a_Supplier" ON "a_Product"."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" + WHERE + NOT e_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + ) m_1 + INNER JOIN "Products" d_1 ON m_1."SupplierId" = d_1."SupplierID" OR m_1."SupplierId" IS NULL AND d_1."SupplierID" IS NULL +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductID", + d."Discount", + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Supplier"."SupplierID" +FROM + "Products" m_1 + INNER JOIN "Order Details" d ON m_1."ProductID" = d."ProductID" + INNER JOIN "Orders" e ON d."OrderID" = e."OrderID" + LEFT JOIN "Suppliers" "a_Supplier" ON m_1."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" +WHERE + NOT m_1."IsDeleted" AND NOT e."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + p."ProductName", + p."ProductID" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..9c69f07ee787 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.13,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", p1."ProductID", p1."CategoryID", p1."Discontinued", p1."IsDeleted", p1."ProductName", p1."QuantityPerUnit", p1."ReorderLevel", p1."SupplierID", p1."UnitPrice", p1."UnitsInStock", p1."UnitsOnOrder" +FROM "Products" AS p +CROSS JOIN ( + SELECT p0."ProductID", p0."CategoryID", p0."Discontinued", p0."IsDeleted", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Products" AS p0 + WHERE (@ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o0 + WHERE (@ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted")) AND p0."ProductID" = o0."ProductID") +) AS p1 +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o + WHERE (@ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted")) AND p."ProductID" = o."ProductID") AND p."ProductID" = p1."ProductID" +ORDER BY p."ProductID" + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued", + pd2."IsDeleted", + pd2."ProductID", + pd2."ProductName", + pd2."SupplierID", + pd2."CategoryID", + pd2."QuantityPerUnit", + pd2."UnitPrice", + pd2."UnitsInStock", + pd2."UnitsOnOrder", + pd2."ReorderLevel", + pd2."Discontinued" +FROM + "Products" e, + "Products" pd2 +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_2 + WHERE + pd2."ProductID" = e_2."ProductID" + ) > 0 AND + e."ProductID" = pd2."ProductID" +ORDER BY + e."ProductID" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..3eb6df5ea909 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.13,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", p1."ProductID", p1."CategoryID", p1."Discontinued", p1."IsDeleted", p1."ProductName", p1."QuantityPerUnit", p1."ReorderLevel", p1."SupplierID", p1."UnitPrice", p1."UnitsInStock", p1."UnitsOnOrder" +FROM "Products" AS p +CROSS JOIN ( + SELECT p0."ProductID", p0."CategoryID", p0."Discontinued", p0."IsDeleted", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Products" AS p0 + WHERE (@ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o0 + WHERE (@ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted")) AND p0."ProductID" = o0."ProductID") +) AS p1 +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o + WHERE (@ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted")) AND p."ProductID" = o."ProductID") AND p."ProductID" = p1."ProductID" +ORDER BY p."ProductID" + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued", + pd2."IsDeleted", + pd2."ProductID", + pd2."ProductName", + pd2."SupplierID", + pd2."CategoryID", + pd2."QuantityPerUnit", + pd2."UnitPrice", + pd2."UnitsInStock", + pd2."UnitsOnOrder", + pd2."ReorderLevel", + pd2."Discontinued" +FROM + "Products" e, + "Products" pd2 +WHERE + NOT e."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + NOT pd2."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_2 + WHERE + NOT e_2."IsDeleted" AND pd2."ProductID" = e_2."ProductID" + ) > 0 AND + e."ProductID" = pd2."ProductID" +ORDER BY + e."ProductID" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..809fe6977f1f --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.13,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" +FROM "Employees" AS e +WHERE (@ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted")) AND e."EmployeeID" = @test + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath" +FROM + "Employees" e +WHERE + e."EmployeeID" = :test + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..da707f2ade0b --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.13,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" +FROM "Employees" AS e +WHERE (@ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted")) AND e."EmployeeID" = @test + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath" +FROM + "Employees" e +WHERE + NOT e."IsDeleted" AND e."EmployeeID" = :test + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..58c86314349f --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.13,False).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."IsDeleted", c."Phone", c."PostalCode", c."Region" +FROM "Customers" AS c +WHERE @ef_filter__p0 OR NOT (c."IsDeleted") OR NOT (c."IsDeleted") +LIMIT 1 + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) +DECLARE @CompanyName Varchar(34) -- String +SET @CompanyName = 'Ana Trujillo Emparedados y helados' +DECLARE @CustomerId Varchar(5) -- String +SET @CustomerId = 'ANATR' + +UPDATE + "Customers" +SET + "CompanyName" = :CompanyName +WHERE + "Customers"."CustomerID" = :CustomerId + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..cadd868c9d74 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.13,True).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."IsDeleted", c."Phone", c."PostalCode", c."Region" +FROM "Customers" AS c +WHERE @ef_filter__p0 OR NOT (c."IsDeleted") OR NOT (c."IsDeleted") +LIMIT 1 + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) +DECLARE @CompanyName Varchar(19) -- String +SET @CompanyName = 'Alfreds Futterkiste' +DECLARE @CustomerId Varchar(5) -- String +SET @CustomerId = 'ALFKI' + +UPDATE + "Customers" +SET + "CompanyName" = :CompanyName +WHERE + NOT "Customers"."IsDeleted" AND "Customers"."CustomerID" = :CustomerId + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..d639ce6d850c --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.13,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."QuantityPerUnit" AS "Quantity" +FROM "Products" AS p +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."QuantityPerUnit" +FROM + "Products" p + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..7bce3d733d34 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.13,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."QuantityPerUnit" AS "Quantity" +FROM "Products" AS p +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."QuantityPerUnit" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..59a1af5f0fe1 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.13,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +/* Tagged query */ +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..70496dfd20de --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.13,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +/* Tagged query */ +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" AND NOT "a_ReportsToNavigation"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..e9b9df712991 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.13,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..71750953660c --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.13,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..d7652f745c94 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.13,False).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT max(p."QuantityPerUnit") +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE 'U%' + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + MAX(e."QuantityPerUnit") +FROM + "Products" e +WHERE + e."ProductName" LIKE 'U%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL + +DELETE FROM + "Products" e +WHERE + e."ProductName" = 'a' + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..3db75c00d35c --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.13,True).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT max(p."QuantityPerUnit") +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE 'U%' + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + MAX(e."QuantityPerUnit") +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE 'U%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL + +DELETE FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" = 'a' + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..4c377165658c --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.13,False).sql @@ -0,0 +1,25 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..d1381041082b --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.13,True).sql @@ -0,0 +1,27 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" +WHERE + NOT p."IsDeleted" AND NOT c_1."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..4c377165658c --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.13,False).sql @@ -0,0 +1,25 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..d1381041082b --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.13,True).sql @@ -0,0 +1,27 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" +WHERE + NOT p."IsDeleted" AND NOT c_1."IsDeleted" + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..da3d6872fcaf --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.13,False).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..da3d6872fcaf --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.13,True).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..c6110c07ea11 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.13,False).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.9.5 PostgreSQL (asynchronously) +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..c6110c07ea11 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.13,True).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.9.5 PostgreSQL (asynchronously) +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.13,False).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.13,False).sql new file mode 100644 index 000000000000..9973b036f924 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.13,False).sql @@ -0,0 +1,29 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' + + + diff --git a/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.13,True).sql b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.13,True).sql new file mode 100644 index 000000000000..197f1ce5db37 --- /dev/null +++ b/PostgreSQL.13.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.13,True).sql @@ -0,0 +1,29 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.14).sql new file mode 100644 index 000000000000..06fbc52570bf --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.14).sql @@ -0,0 +1,164 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 1 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'bc7b663d-0fde-4327-8f92-5d8cc3a11d11'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C1' +DECLARE @Name Text(2) -- String +SET @Name = 'N1' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 2 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'a948600d-de21-4f74-8ac2-9516b287076e'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C2' +DECLARE @Name Text(2) -- String +SET @Name = 'N2' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 3 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'bd3973a5-4323-4dd8-9f4f-df9f93e2a627'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C3' +DECLARE @Name Text(2) -- String +SET @Name = 'N3' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +SELECT s."Id", s."Code", s."IsDeleted", s."Name", s."PermanentId" +FROM "Subdivisions" AS s +WHERE s."Id"::bigint = 1 + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id"::BigInt = 1 + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @id Bigint -- Int64 +SET @id = 1 + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id" = :id + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id" IN (2, 3) + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."PermanentId", + t1."Code", + t1."Name", + t1."IsDeleted" +FROM + "Subdivisions" t1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..4e983e532ea5 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.14).sql @@ -0,0 +1,10 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "Issue261Table" t1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..08d57ad749ee --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.14).sql @@ -0,0 +1,43 @@ +Parameters: +@p0='?' (DbType = Object), @p1='?', @p2='?' (DbType = Object), @p3='?' (DbType = Object), @p4='?', @p5='?' (DbType = Object), @p6='?' (DbType = Object), @p7='?', @p8='?' (DbType = Object) + +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p0, @p1, @p2) +RETURNING "Id"; +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p3, @p4, @p5) +RETURNING "Id"; +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p6, @p7, @p8) +RETURNING "Id"; + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +INSERT INTO "Issue4783DBRecords" +( + "Source", + "Status", + "NullableStatus" +) +VALUES +('linq2db','open'::issue4783db_status,'open'::issue4783db_status), +('linq2db','closed'::issue4783db_status,'closed'::issue4783db_status), +('linq2db','closed'::issue4783db_status,NULL) + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4783DBRecords" t1 +ORDER BY + t1."Id" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..b81b471b059f --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.14).sql @@ -0,0 +1,10 @@ +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name" +FROM + "Issue4917DBRecords" t1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.14).sql new file mode 100644 index 000000000000..51c3d7adada3 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.14).sql @@ -0,0 +1,5 @@ +SELECT w."Id", w."Value" +FROM "WithDuplicateProperties" AS w +WHERE w."Value" = 1 + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.14).sql new file mode 100644 index 000000000000..56e9098f0dce --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.14).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.9.5 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.9.5 PostgreSQL + +INSERT INTO "NoIdentity" +( + "Id", + "Name" +) +VALUES +('bc7b663d-0fde-4327-8f92-5d8cc3a11d11'::uuid,'John Doe'), +('a948600d-de21-4f74-8ac2-9516b287076e'::uuid,'Jane Doe') + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.9.5 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.14).sql new file mode 100644 index 000000000000..a1b82e0ca535 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.14).sql @@ -0,0 +1,32 @@ +Parameters: +@p0='?', @p1='?', @p2='?', @p3='?', @p4='?' + +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p0) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p1) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p2) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p3) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p4) +RETURNING "Id"; + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Discriminator", + t1."Id" +FROM + "WithInheritance" t1 +WHERE + t1."Discriminator" IN ('WithInheritanceA2', 'WithInheritanceA1', 'WithInheritanceA') + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.14).sql new file mode 100644 index 000000000000..4c761cf4cb54 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.14).sql @@ -0,0 +1,33 @@ +-- PostgreSQL.9.5 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +INSERT ASYNC BULK "NoIdentity"(Id, Name) + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.9.5 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.14).sql new file mode 100644 index 000000000000..bb8aca9d9bde --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.14).sql @@ -0,0 +1,33 @@ +-- PostgreSQL.9.5 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +INSERT BULK "NoIdentity"(Id, Name) + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.9.5 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.14).sql new file mode 100644 index 000000000000..5b8ae756e22c --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.14).sql @@ -0,0 +1,76 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +INSERT INTO "SkipModes" ("Id", "InsertOnly") +VALUES (@p0, @p1); + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 2 +DECLARE @InsertOnly Integer -- Int32 +SET @InsertOnly = 2 + +INSERT INTO "SkipModes" +( + "Id", + "InsertOnly" +) +VALUES +( + :Id, + :InsertOnly +) + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."InsertOnly", + t1."UpdateOnly", + t1."ReadOnly" +FROM + "SkipModes" t1 +ORDER BY + t1."Id" + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +UPDATE "SkipModes" SET "UpdateOnly" = @p0 +WHERE "Id" = @p1; + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @UpdateOnly Integer -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id Integer -- Int32 +SET @Id = 2 + +UPDATE + "SkipModes" +SET + "UpdateOnly" = :UpdateOnly +WHERE + "SkipModes"."Id" = :Id + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."InsertOnly", + t1."UpdateOnly", + t1."ReadOnly" +FROM + "SkipModes" t1 +ORDER BY + t1."Id" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.14).sql new file mode 100644 index 000000000000..7b856d05427d --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.14).sql @@ -0,0 +1,38 @@ +-- PostgreSQL.9.5 PostgreSQL + +CREATE TEMPORARY TABLE "WithIdentity" +( + "Id" integer NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_WithIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.9.5 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.9.5 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + +-- PostgreSQL.9.5 PostgreSQL + +DROP TABLE IF EXISTS "WithIdentity" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.14).sql new file mode 100644 index 000000000000..453dc5513e7e --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.14).sql @@ -0,0 +1,28 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int64), @p3='?' (DbType = Int64), @p4='?' (DbType = Decimal), @p5='?' (DbType = Decimal) + +INSERT INTO "UIntTable" ("Field16", "Field16N", "Field32", "Field32N", "Field64", "Field64N") +VALUES (@p0, @p1, @p2, @p3, @p4, @p5) +RETURNING "ID"; + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) +DECLARE @field64 Numeric(1, 0) -- Decimal +SET @field64 = 5 + +SELECT + e."ID", + e."Field16", + e."Field32", + e."Field64", + e."Field16N", + e."Field32N", + e."Field64N" +FROM + "UIntTable" e +WHERE + e."Field64" = :field64 +LIMIT 1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.14,False,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.14,False,False).sql new file mode 100644 index 000000000000..4fadd949b642 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.14,False,False).sql @@ -0,0 +1,12 @@ +SELECT e.id, e.name, s0.id, s0.master_id, s0.name, s0.id0, s0.master_id0, s0.name0, c.id, c.name, c.parent_id +FROM entities AS e +LEFT JOIN ( + SELECT d.id, d.master_id, d.name, s.id AS id0, s.master_id AS master_id0, s.name AS name0 + FROM details AS d + LEFT JOIN sub_details AS s ON d.id = s.master_id +) AS s0 ON e.id = s0.master_id +LEFT JOIN children AS c ON e.id = c.parent_id +WHERE e.name = 'Alpha' +ORDER BY e.id, s0.id, s0.id0 + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.14,False,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.14,False,True).sql new file mode 100644 index 000000000000..4fadd949b642 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.14,False,True).sql @@ -0,0 +1,12 @@ +SELECT e.id, e.name, s0.id, s0.master_id, s0.name, s0.id0, s0.master_id0, s0.name0, c.id, c.name, c.parent_id +FROM entities AS e +LEFT JOIN ( + SELECT d.id, d.master_id, d.name, s.id AS id0, s.master_id AS master_id0, s.name AS name0 + FROM details AS d + LEFT JOIN sub_details AS s ON d.id = s.master_id +) AS s0 ON e.id = s0.master_id +LEFT JOIN children AS c ON e.id = c.parent_id +WHERE e.name = 'Alpha' +ORDER BY e.id, s0.id, s0.id0 + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.14,True,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.14,True,False).sql new file mode 100644 index 000000000000..21d060e44313 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.14,True,False).sql @@ -0,0 +1,76 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."Id", + m_1."Id_1", + d_1.id, + d_1.master_id, + d_1.name +FROM + ( + SELECT DISTINCT + d.id as "Id", + t1."Id" as "Id_1" + FROM + ( + SELECT DISTINCT + e.id as "Id" + FROM + entities e + WHERE + e.name = 'Alpha' + ) t1 + INNER JOIN details d ON t1."Id" = d.master_id + ) m_1 + INNER JOIN sub_details d_1 ON m_1."Id" = d_1.master_id + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.id, + d.master_id, + d.name +FROM + entities m_1 + INNER JOIN details d ON m_1.id = d.master_id +WHERE + m_1.name = 'Alpha' + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.id, + d.parent_id, + d.name +FROM + entities m_1 + INNER JOIN children d ON m_1.id = d.parent_id +WHERE + m_1.name = 'Alpha' + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e.id, + e.name +FROM + entities e +WHERE + e.name = 'Alpha' + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.14,True,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.14,True,True).sql new file mode 100644 index 000000000000..21d060e44313 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.14,True,True).sql @@ -0,0 +1,76 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."Id", + m_1."Id_1", + d_1.id, + d_1.master_id, + d_1.name +FROM + ( + SELECT DISTINCT + d.id as "Id", + t1."Id" as "Id_1" + FROM + ( + SELECT DISTINCT + e.id as "Id" + FROM + entities e + WHERE + e.name = 'Alpha' + ) t1 + INNER JOIN details d ON t1."Id" = d.master_id + ) m_1 + INNER JOIN sub_details d_1 ON m_1."Id" = d_1.master_id + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.id, + d.master_id, + d.name +FROM + entities m_1 + INNER JOIN details d ON m_1.id = d.master_id +WHERE + m_1.name = 'Alpha' + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.id, + d.parent_id, + d.name +FROM + entities m_1 + INNER JOIN children d ON m_1.id = d.parent_id +WHERE + m_1.name = 'Alpha' + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e.id, + e.name +FROM + entities e +WHERE + e.name = 'Alpha' + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.14).sql new file mode 100644 index 000000000000..1f665e79775c --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.14).sql @@ -0,0 +1,13 @@ +Parameters: +@p0='test insert ef' (Nullable = false) + +INSERT INTO entities (name) +VALUES (@p0) +RETURNING id; + + +SELECT e.id, e.name +FROM entities AS e +LIMIT 2 + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.14).sql new file mode 100644 index 000000000000..8dd9d2f5df81 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.14).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @name Text(11) -- String +SET @name = 'test insert' + +INSERT INTO entities +( + name +) +VALUES +( + :name +) +RETURNING + id + + + +Parameters: +@id='50' + +SELECT e.id, e.name +FROM entities AS e +WHERE e.id::bigint = @id +LIMIT 2 + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.14,False,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.14,False,True).sql new file mode 100644 index 000000000000..803b4f11e467 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.14,False,True).sql @@ -0,0 +1,10 @@ +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.14,True,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.14,True,False).sql new file mode 100644 index 000000000000..bec89c93edbf --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.14,True,False).sql @@ -0,0 +1,31 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.14,True,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.14,True,True).sql new file mode 100644 index 000000000000..bec89c93edbf --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.14,True,True).sql @@ -0,0 +1,31 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..588606bea69e --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.14,False).sql @@ -0,0 +1,41 @@ +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..f9fe2df232ed --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.14,True).sql @@ -0,0 +1,41 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.14,False,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.14,False,True).sql new file mode 100644 index 000000000000..8d38ce10d713 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.14,False,True).sql @@ -0,0 +1,5 @@ +SELECT d.id, d.master_id, d.name, e.id, e.name +FROM details AS d +INNER JOIN entities AS e ON d.master_id = e.id + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.14,True,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.14,True,False).sql new file mode 100644 index 000000000000..b5ce715f04fb --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.14,True,False).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.14,True,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.14,True,True).sql new file mode 100644 index 000000000000..b5ce715f04fb --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.14,True,True).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.14,False,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.14,False,True).sql new file mode 100644 index 000000000000..8d38ce10d713 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.14,False,True).sql @@ -0,0 +1,5 @@ +SELECT d.id, d.master_id, d.name, e.id, e.name +FROM details AS d +INNER JOIN entities AS e ON d.master_id = e.id + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.14,True,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.14,True,True).sql new file mode 100644 index 000000000000..b5ce715f04fb --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.14,True,True).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.14,Default).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.14,Default).sql new file mode 100644 index 000000000000..f755eeefd191 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.14,Default).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.14,MultipleRows).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.14,MultipleRows).sql new file mode 100644 index 000000000000..f755eeefd191 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.14,MultipleRows).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.14,ProviderSpecific).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.14,ProviderSpecific).sql new file mode 100644 index 000000000000..f755eeefd191 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.14,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.14,RowByRow).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.14,RowByRow).sql new file mode 100644 index 000000000000..f755eeefd191 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.14,RowByRow).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.14).sql new file mode 100644 index 000000000000..adeb323d784c --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.14).sql @@ -0,0 +1,10 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @p='?' (DbType = Int32) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductID" > 0 +ORDER BY p."ProductID" +LIMIT @p + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.14).sql new file mode 100644 index 000000000000..41af5f94d478 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.14).sql @@ -0,0 +1,52 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.14).sql new file mode 100644 index 000000000000..48778ea0af47 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.14).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.14).sql new file mode 100644 index 000000000000..48778ea0af47 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.14).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.14).sql new file mode 100644 index 000000000000..6a862480a060 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.14).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id" +FROM + "Patents" t1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..1152699fae3c --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.14).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT p."Id" AS "PatentId", @userId0 AS "UserId" +FROM "Patents" AS p +LEFT JOIN "PatentAssessment" AS p0 ON p."Id" = p0."PatentId" +WHERE p0."PatentId" IS NULL OR p0."TechnicalReviewerId" <> @userId OR p0."TechnicalReviewerId" IS NULL + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @userId Integer -- Int32 +SET @userId = 1 + +SELECT + p."Id" +FROM + "Patents" p + LEFT JOIN "PatentAssessment" "a_Assessment" ON p."Id" = "a_Assessment"."PatentId" +WHERE + "a_Assessment"."PatentId" IS NULL OR "a_Assessment"."TechnicalReviewerId" <> :userId OR + "a_Assessment"."TechnicalReviewerId" IS NULL + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..6f858c86bdd7 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.14).sql @@ -0,0 +1,21 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."Id", + e."Linked", + ( + SELECT + ARRAY_AGG(DISTINCT r."Id") + FROM + "Issue155Table" r + WHERE + e."Id" = ANY(r."Linked") + ) +FROM + "Issue155Table" e +WHERE + e."Id" = 1 +LIMIT 2 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.14).sql new file mode 100644 index 000000000000..4e8e429af477 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.14).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + COUNT(*) +FROM + "Parents" x +WHERE + ( + SELECT + "a_Children"."IsActive" + FROM + "Children" "a_Children" + WHERE + x."Id" = "a_Children"."ParentId" + LIMIT 1 + ) = False + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.14).sql new file mode 100644 index 000000000000..d7d1642931f5 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.14).sql @@ -0,0 +1,18 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + COUNT(*) +FROM + "Parents" x +WHERE + NOT EXISTS( + SELECT + * + FROM + "Children" y + WHERE + x."Id" = y."ParentId" AND y."IsActive" + ) + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..6a862480a060 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.14).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id" +FROM + "Patents" t1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..acb306ff44c2 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.14).sql @@ -0,0 +1,11 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + x."Id" +FROM + "Issue340Entities" x +WHERE + x."IsActive" = True + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..03659969fda7 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.14).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.9.5 PostgreSQL + +UPDATE + "PostgreTestTable" +SET + ("Title", "SearchVector") = ( + SELECT + "PostgreTestTable"."Title", + to_tsvector('test') + FROM + "PostgreTestTable" x + WHERE + "PostgreTestTable"."Id" = x."Id" + ) +WHERE + "PostgreTestTable"."Id" = 1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..f706b6824e5d --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.14).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + 1 +FROM + "Parents" ua +WHERE + ua."ParentId" = 55377 AND EXISTS( + SELECT + * + FROM + "Parents" t1 + ) + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.14).sql new file mode 100644 index 000000000000..d9d5de6c5245 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.14).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @DateTimeOffset TimestampTz -- DateTime +SET @DateTimeOffset = '2020-02-29T17:54:55.1231234+00:00' +DECLARE @DateTimeOffsetN TimestampTz -- DateTime +SET @DateTimeOffsetN = '2020-02-29T17:54:55.1231234+00:00' + +UPDATE + "Types" +SET + "DateTimeOffset" = :DateTimeOffset, + "DateTimeOffsetN" = :DateTimeOffsetN +WHERE + "Types"."Id" = 2 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.14).sql new file mode 100644 index 000000000000..38a114a38455 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.14).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @DateTimeOffsetWithConverter Bigint -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter Bigint -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + "Types" +SET + "DateTimeOffsetWithConverter" = :DateTimeOffsetWithConverter, + "DateTimeOffsetNWithConverter" = :DateTimeOffsetNWithConverter +WHERE + "Types"."Id" = 2 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.14).sql new file mode 100644 index 000000000000..1c5775a1156f --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.14).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."Id", + d_1."Key_1", + d_1."SUM_1", + d_1."ToValue" +FROM + "Parents" m_1 + INNER JOIN LATERAL ( + SELECT + d."ParentId" as "Key_1", + SUM(d."Id") as "SUM_1", + STRING_AGG(d."Name", ', ') as "ToValue" + FROM + "Children" d + WHERE + m_1."Id" = d."ParentId" + GROUP BY + d."ParentId" + ) d_1 ON 1=1 + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + c_1."Id" +FROM + "Parents" c_1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..96f974c7ffa1 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.14).sql @@ -0,0 +1,36 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + id."Id" +FROM + ( + SELECT + p."Id" + FROM + "Issue4629Posts" p + WHERE + ( + SELECT + SUM("a_Tags"."Weight") + FROM + "Issue4629Tags" "a_Tags" + WHERE + p."Id" = "a_Tags"."PostId" AND "a_Tags"."Weight" > 1 + ) > 5 + ORDER BY + ( + SELECT + SUM("a_Tags_1"."Weight") + FROM + "Issue4629Tags" "a_Tags_1" + WHERE + p."Id" = "a_Tags_1"."PostId" + ) + LIMIT :take + ) id + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..c4f58cc92ad8 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.14).sql @@ -0,0 +1,20 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @id Integer -- Int32 +SET @id = 2 + +SELECT + t1."Index_1" +FROM + ( + SELECT + x."Id", + ROW_NUMBER() OVER(ORDER BY x."Id") as "Index_1" + FROM + "Parents" x + ) t1 +WHERE + t1."Id" = :id +LIMIT 1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..f2cc76bf7e3f --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.14).sql @@ -0,0 +1,40 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."Key_1", + d."CfAllowValue", + d."DateFrom" +FROM + ( + SELECT + p."AclNameId" as "Key_1" + FROM + "Issue4624Items" p + GROUP BY + p."AclNameId" + LIMIT 1 + ) m_1 + INNER JOIN "Issue4624Items" d ON m_1."Key_1" = d."AclNameId" +ORDER BY + d."DateFrom" + + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."AclNameId" +FROM + "Issue4624Items" p +GROUP BY + p."AclNameId" +LIMIT 1 + + + +DisposeTransaction + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..a60b24170dab --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.14).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id" +FROM + "Masters" t1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..16ad7682ff03 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.14).sql @@ -0,0 +1,21 @@ +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + x."Id", + x."IsActive", + x."ParentId", + x."Name" +FROM + "Children" x +WHERE + x."Name" LIKE '%Test%' ESCAPE '~' +ORDER BY + x."Name" + + + +SELECT c."Id", c."IsActive", c."Name", c."ParentId" +FROM "Children" AS c +WHERE c."Name" LIKE 'Test%' + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..7bc9a2328ffe --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.14,False).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..7bc9a2328ffe --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.14,True).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..7bc9a2328ffe --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.14,False).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..7bc9a2328ffe --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.14,True).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.14).sql new file mode 100644 index 000000000000..cea078e29863 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.14).sql @@ -0,0 +1,18 @@ +SELECT COALESCE(i0."Name", '') || '>' || i."Name" +FROM "Issue73Entities" AS i +LEFT JOIN "Issue73Entities" AS i0 ON i."ParentId" = i0."Id" +WHERE i."Name" = 'Name1_3' + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + "a_Parent"."Name" || '>' || x."Name" +FROM + "Issue73Entities" x + LEFT JOIN "Issue73Entities" "a_Parent" ON x."ParentId" = "a_Parent"."Id" +WHERE + x."Name" = 'Name1_3' + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.14).sql new file mode 100644 index 000000000000..9fd241684177 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.14).sql @@ -0,0 +1,30 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32) + +INSERT INTO "IssueEnum" ("Value") +VALUES (@p0) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p1) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p2) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p3) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p4) +RETURNING "Id"; + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Value" +FROM + "IssueEnum" t1 + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.14).sql new file mode 100644 index 000000000000..05e16af17bf1 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.14).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @guids -2147483621 -- Object +SET @guids = {'271425b1-ebe8-400d-b71d-a6e47a460ae3'::uuid,'b75de94e-6d7b-4c70-bfa1-f8639a6a5b35'::uuid} + +SELECT + m_1."Id", + m_1."Guids" +FROM + "EntityWithArrays" m_1 +WHERE + m_1."Guids" && :guids + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.14).sql new file mode 100644 index 000000000000..2cb671ae9097 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.14).sql @@ -0,0 +1,20 @@ +-- PostgreSQL.9.5 PostgreSQL + +INSERT INTO "EntityWithXmin" +( + "Value" +) +VALUES +('Str1'), +('Str2'), +('Str3'), +('Str4'), +('Str5'), +('Str6'), +('Str7'), +('Str8'), +('Str9'), +('Str10') + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.14,Local).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.14,Local).sql new file mode 100644 index 000000000000..b597796187c5 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.14,Local).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.14,Unspecified).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.14,Unspecified).sql new file mode 100644 index 000000000000..b597796187c5 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.14,Unspecified).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.14,Utc).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.14,Utc).sql new file mode 100644 index 000000000000..b597796187c5 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.14,Utc).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.14).sql new file mode 100644 index 000000000000..4d205bed27ca --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.14).sql @@ -0,0 +1,27 @@ +Parameters: +@date='?' (DbType = DateTime2) + +SELECT e."Id", e."Duration", e."Name" +FROM "Events" AS e +WHERE e."Duration" @> @date OR lower(e."Duration") = @date OR upper(e."Duration") = @date OR isempty(e."Duration") OR isempty(e."Duration" * e."Duration") + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @date Timestamp -- DateTime2 +SET @date = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Name", + e."Duration" +FROM + "Events" e +WHERE + e."Duration" @> :date OR + lower(e."Duration") = :date OR + upper(e."Duration") = :date OR + isempty(e."Duration") OR + isempty(e."Duration" * e."Duration") + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.14).sql new file mode 100644 index 000000000000..e41068c96ae8 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.14).sql @@ -0,0 +1,15 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @guids -2147483621 -- Object +SET @guids = {'271425b1-ebe8-400d-b71d-a6e47a460ae3'::uuid,'b75de94e-6d7b-4c70-bfa1-f8639a6a5b35'::uuid} + +SELECT + m_1."Id", + m_1."Guids" +FROM + "EntityWithArrays" m_1 + INNER JOIN LATERAL UNNEST(m_1."Guids") g_1(value) ON 1=1 +WHERE + m_1."Guids" && :guids + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.14).sql new file mode 100644 index 000000000000..619293b024a5 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.14).sql @@ -0,0 +1,16 @@ +SELECT e."Name" +FROM views."EventsView" AS e +WHERE e."Name" LIKE 'any%' + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."Name" +FROM + views."EventsView" e +WHERE + e."Name" LIKE 'any%' ESCAPE '~' + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.14).sql new file mode 100644 index 000000000000..dd4c9ca164fc --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.14).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" IS NOT NULL + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.14).sql new file mode 100644 index 000000000000..d95cee20fee5 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.14).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" LIKE '%anything%' ESCAPE '~' + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.14).sql new file mode 100644 index 000000000000..ffac6df73c83 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.14).sql @@ -0,0 +1,24 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @value Varchar(10) -- String +SET @value = '%anything%' + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" LIKE :value ESCAPE '~' + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.14).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.14).sql new file mode 100644 index 000000000000..ae3cb53e09af --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.14).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o1."OrderID", o1."ProductID", p0."ProductID", o3."OrderId", o3."ProductId", o3."Quantity", o1."Quantity", p0."ProductName" +FROM "Orders" AS o +INNER JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Quantity" + FROM "Order Details" AS o0 + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS o1 ON o."OrderID" = o1."OrderID" +INNER JOIN ( + SELECT p."ProductID", p."ProductName" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +) AS p0 ON o1."ProductID" = p0."ProductID" +LEFT JOIN ( + SELECT o2."OrderID" AS "OrderId", o2."ProductID" AS "ProductId", o2."Quantity" + FROM "Order Details" AS o2 + WHERE @ef_filter__p2 OR NOT (o2."IsDeleted") OR NOT (o2."IsDeleted") +) AS o3 ON p0."ProductID" = o3."ProductId" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", o1."OrderID", o1."ProductID", p0."ProductID", o3."OrderId" + + +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."ProductId", + d."OrderID", + d."ProductID", + d."Quantity" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId" + FROM + "Orders" e + INNER JOIN "Order Details" od ON e."OrderID" = od."OrderID" + INNER JOIN "Products" "a_Product" ON od."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d ON m_1."ProductId" = d."ProductID" + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + "a_Product"."ProductID", + od."OrderID", + od."ProductID", + od."Quantity", + "a_Product"."ProductName" +FROM + "Orders" o + INNER JOIN "Order Details" od ON o."OrderID" = od."OrderID" + INNER JOIN "Products" "a_Product" ON od."ProductID" = "a_Product"."ProductID" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..93bc825a419c --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.14,False).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS p + WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%') + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + "Products" e + WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..fadef1e067de --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.14,True).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS p + WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%') + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + "Products" e + WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..6a9291f2eab2 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.14,False).sql @@ -0,0 +1,17 @@ +-- PostgreSQL.9.5 PostgreSQL + +DELETE FROM + "Products" e +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' AND e."ProductName" = 'a' + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..50e1466e63b2 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.14,True).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.9.5 PostgreSQL + +DELETE FROM + "Products" e +WHERE + NOT e."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' AND + e."ProductName" = 'a' + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..5155bca47ae2 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.14,False).sql @@ -0,0 +1,94 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2; + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..44010114a9d1 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.14,True).sql @@ -0,0 +1,105 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2; + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..33e5b2164cb5 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.14,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..33e2b2a492ab --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.14,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..33e5b2164cb5 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.14,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..33e2b2a492ab --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.14,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..048de81c2aa0 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.14,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder", s."OrderID0", s."ProductID1", s."Discount0", s."IsDeleted1", s."Quantity0", s."UnitPrice1" +FROM "Orders" AS o +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder", o2."OrderID" AS "OrderID0", o2."ProductID" AS "ProductID1", o2."Discount" AS "Discount0", o2."IsDeleted" AS "IsDeleted1", o2."Quantity" AS "Quantity0", o2."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + LEFT JOIN ( + SELECT o1."OrderID", o1."ProductID", o1."Discount", o1."IsDeleted", o1."Quantity", o1."UnitPrice" + FROM "Order Details" AS o1 + WHERE @ef_filter__p2 OR NOT (o1."IsDeleted") OR NOT (o1."IsDeleted") + ) AS o2 ON p0."ProductID" = o2."ProductID" + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", s."OrderID", s."ProductID", s."ProductID0", s."OrderID0" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..0b19cceb4c35 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.14,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder", s."OrderID0", s."ProductID1", s."Discount0", s."IsDeleted1", s."Quantity0", s."UnitPrice1" +FROM "Orders" AS o +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder", o2."OrderID" AS "OrderID0", o2."ProductID" AS "ProductID1", o2."Discount" AS "Discount0", o2."IsDeleted" AS "IsDeleted1", o2."Quantity" AS "Quantity0", o2."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + LEFT JOIN ( + SELECT o1."OrderID", o1."ProductID", o1."Discount", o1."IsDeleted", o1."Quantity", o1."UnitPrice" + FROM "Order Details" AS o1 + WHERE @ef_filter__p2 OR NOT (o1."IsDeleted") OR NOT (o1."IsDeleted") + ) AS o2 ON p0."ProductID" = o2."ProductID" + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", s."OrderID", s."ProductID", s."ProductID0", s."OrderID0" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..1bb8ddc4ae74 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.14,False).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e + LEFT JOIN "Products" op ON op."ProductID" <> e."ProductID" AND op."ProductName" = e."ProductName" +WHERE + op."ProductID" IS NULL + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..c06e04c6eff8 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.14,True).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e + LEFT JOIN "Products" op ON op."ProductID" <> e."ProductID" AND op."ProductName" = e."ProductName" AND NOT op."IsDeleted" +WHERE + NOT e."IsDeleted" AND op."ProductID" IS NULL + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..c7efba886866 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.14,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", o."OrderID", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + e_1."IsDeleted", + e_1."TerritoryID", + e_1."TerritoryDescription", + e_1."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" e_1 ON d."TerritoryID" = e_1."TerritoryID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + e_1."IsDeleted", + e_1."ProductID", + e_1."ProductName", + e_1."SupplierID", + e_1."CategoryID", + e_1."QuantityPerUnit", + e_1."UnitPrice", + e_1."UnitsInStock", + e_1."UnitsOnOrder", + e_1."ReorderLevel", + e_1."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" e_1 ON d."ProductID" = e_1."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath", + o."OrderID" +FROM + "Orders" o + LEFT JOIN "Employees" "a_Employee" ON o."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..dae3d7d32224 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.14,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", o."OrderID", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + e_1."IsDeleted", + e_1."TerritoryID", + e_1."TerritoryDescription", + e_1."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" e_1 ON d."TerritoryID" = e_1."TerritoryID" +WHERE + NOT e_1."IsDeleted" AND NOT d."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + e_1."IsDeleted", + e_1."ProductID", + e_1."ProductName", + e_1."SupplierID", + e_1."CategoryID", + e_1."QuantityPerUnit", + e_1."UnitPrice", + e_1."UnitsInStock", + e_1."UnitsOnOrder", + e_1."ReorderLevel", + e_1."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" e_1 ON d."ProductID" = e_1."ProductID" +WHERE + NOT e_1."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath", + o."OrderID" +FROM + "Orders" o + LEFT JOIN "Employees" "a_Employee" ON o."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT o."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..b0ecfa57aa98 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.14,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..d10efc19f8af --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.14,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" AND NOT "a_ReportsToNavigation"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..e92f58f2f4f8 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.14,False).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."City" IS NOT NULL + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..55c03a3d4409 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.14,True).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + NOT e."IsDeleted" AND e."City" IS NOT NULL + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..20bfc5514d81 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.14,False).sql @@ -0,0 +1,70 @@ +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" +FROM "Products" AS p +INNER JOIN "Order Details" AS o ON p."ProductID" = o."ProductID" + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice" +FROM "Products" AS p +INNER JOIN ( + SELECT o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" + FROM "Order Details" AS o + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS o0 ON p."ProductID" = o0."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..8f01826f0ddd --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.14,True).sql @@ -0,0 +1,74 @@ +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" +FROM "Products" AS p +INNER JOIN "Order Details" AS o ON p."ProductID" = o."ProductID" + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" +WHERE + NOT d."IsDeleted" + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice" +FROM "Products" AS p +INNER JOIN ( + SELECT o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" + FROM "Order Details" AS o + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS o0 ON p."ProductID" = o0."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" +WHERE + NOT p."IsDeleted" AND NOT d."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..78db904ac501 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.14,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + "a_Territory"."IsDeleted", + "a_Territory"."TerritoryID", + "a_Territory"."TerritoryDescription", + "a_Territory"."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" "a_Territory" ON d."TerritoryID" = "a_Territory"."TerritoryID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..4d641d2fc468 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.14,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + "a_Territory"."IsDeleted", + "a_Territory"."TerritoryID", + "a_Territory"."TerritoryDescription", + "a_Territory"."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" "a_Territory" ON d."TerritoryID" = "a_Territory"."TerritoryID" +WHERE + NOT "a_Territory"."IsDeleted" AND NOT d."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..09f9a4f8bac5 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.14,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", e2."EmployeeID", e2."TerritoryID", e2."IsDeleted", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted" + FROM "EmployeeTerritories" AS e1 + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS e2 ON e0."EmployeeID" = e2."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p8 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", e2."EmployeeID", e2."TerritoryID", s."OrderID", s."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..987e599d70e6 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.14,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", e2."EmployeeID", e2."TerritoryID", e2."IsDeleted", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted" + FROM "EmployeeTerritories" AS e1 + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS e2 ON e0."EmployeeID" = e2."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p8 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", e2."EmployeeID", e2."TerritoryID", s."OrderID", s."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" +WHERE + NOT d."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..cc31cd2be68b --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.14,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductName", p."ProductID", s1."Discount", s1."OrderID", s1."CustomerID", s1."EmployeeID", s1."Freight", s1."IsDeleted", s1."OrderDate", s1."RequiredDate", s1."ShipAddress", s1."ShipCity", s1."ShipCountry", s1."ShipName", s1."ShipPostalCode", s1."ShipRegion", s1."ShipVia", s1."ShippedDate", s1."OrderID0", s1."ProductID", s1."ProductID0", s1."SupplierID", s1."ProductID1", s1."CategoryID", s1."Discontinued", s1."IsDeleted0", s1."ProductName", s1."QuantityPerUnit", s1."ReorderLevel", s1."SupplierID0", s1."UnitPrice", s1."UnitsInStock", s1."UnitsOnOrder" +FROM "Products" AS p +LEFT JOIN ( + SELECT o."Discount", o1."OrderID", o1."CustomerID", o1."EmployeeID", o1."Freight", o1."IsDeleted", o1."OrderDate", o1."RequiredDate", o1."ShipAddress", o1."ShipCity", o1."ShipCountry", o1."ShipName", o1."ShipPostalCode", o1."ShipRegion", o1."ShipVia", o1."ShippedDate", o."OrderID" AS "OrderID0", o."ProductID", p1."ProductID" AS "ProductID0", s0."SupplierID", p3."ProductID" AS "ProductID1", p3."CategoryID", p3."Discontinued", p3."IsDeleted" AS "IsDeleted0", p3."ProductName", p3."QuantityPerUnit", p3."ReorderLevel", p3."SupplierID" AS "SupplierID0", p3."UnitPrice", p3."UnitsInStock", p3."UnitsOnOrder" + FROM "Order Details" AS o + INNER JOIN ( + SELECT o0."OrderID", o0."CustomerID", o0."EmployeeID", o0."Freight", o0."IsDeleted", o0."OrderDate", o0."RequiredDate", o0."ShipAddress", o0."ShipCity", o0."ShipCountry", o0."ShipName", o0."ShipPostalCode", o0."ShipRegion", o0."ShipVia", o0."ShippedDate" + FROM "Orders" AS o0 + WHERE @ef_filter__p4 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") + ) AS o1 ON o."OrderID" = o1."OrderID" + INNER JOIN ( + SELECT p0."ProductID", p0."SupplierID" + FROM "Products" AS p0 + WHERE @ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted") + ) AS p1 ON o."ProductID" = p1."ProductID" + LEFT JOIN ( + SELECT s."SupplierID" + FROM "Suppliers" AS s + WHERE @ef_filter__p6 OR NOT (s."IsDeleted") OR NOT (s."IsDeleted") + ) AS s0 ON p1."SupplierID" = s0."SupplierID" + LEFT JOIN ( + SELECT p2."ProductID", p2."CategoryID", p2."Discontinued", p2."IsDeleted", p2."ProductName", p2."QuantityPerUnit", p2."ReorderLevel", p2."SupplierID", p2."UnitPrice", p2."UnitsInStock", p2."UnitsOnOrder" + FROM "Products" AS p2 + WHERE @ef_filter__p0 OR NOT (p2."IsDeleted") OR NOT (p2."IsDeleted") + ) AS p3 ON s0."SupplierID" = p3."SupplierID" + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS s1 ON p."ProductID" = s1."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +ORDER BY p."ProductID", s1."OrderID0", s1."ProductID", s1."OrderID", s1."ProductID0", s1."SupplierID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."SupplierId", + m_1."ProductId", + d_1."IsDeleted", + d_1."ProductID", + d_1."ProductName", + d_1."SupplierID", + d_1."CategoryID", + d_1."QuantityPerUnit", + d_1."UnitPrice", + d_1."UnitsInStock", + d_1."UnitsOnOrder", + d_1."ReorderLevel", + d_1."Discontinued" +FROM + ( + SELECT DISTINCT + "a_Supplier"."SupplierID" as "SupplierId", + t1."ProductId" + FROM + ( + SELECT DISTINCT + e."ProductID" as "ProductId" + FROM + "Products" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."ProductId" = d."ProductID" + INNER JOIN "Orders" e_1 ON d."OrderID" = e_1."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + LEFT JOIN "Suppliers" "a_Supplier" ON "a_Product"."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" + WHERE + NOT e_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + ) m_1 + INNER JOIN "Products" d_1 ON m_1."SupplierId" = d_1."SupplierID" OR m_1."SupplierId" IS NULL AND d_1."SupplierID" IS NULL +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductID", + d."Discount", + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Supplier"."SupplierID" +FROM + "Products" m_1 + INNER JOIN "Order Details" d ON m_1."ProductID" = d."ProductID" + INNER JOIN "Orders" e ON d."OrderID" = e."OrderID" + LEFT JOIN "Suppliers" "a_Supplier" ON m_1."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" +WHERE + NOT m_1."IsDeleted" AND NOT e."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + p."ProductName", + p."ProductID" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..cc31cd2be68b --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.14,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductName", p."ProductID", s1."Discount", s1."OrderID", s1."CustomerID", s1."EmployeeID", s1."Freight", s1."IsDeleted", s1."OrderDate", s1."RequiredDate", s1."ShipAddress", s1."ShipCity", s1."ShipCountry", s1."ShipName", s1."ShipPostalCode", s1."ShipRegion", s1."ShipVia", s1."ShippedDate", s1."OrderID0", s1."ProductID", s1."ProductID0", s1."SupplierID", s1."ProductID1", s1."CategoryID", s1."Discontinued", s1."IsDeleted0", s1."ProductName", s1."QuantityPerUnit", s1."ReorderLevel", s1."SupplierID0", s1."UnitPrice", s1."UnitsInStock", s1."UnitsOnOrder" +FROM "Products" AS p +LEFT JOIN ( + SELECT o."Discount", o1."OrderID", o1."CustomerID", o1."EmployeeID", o1."Freight", o1."IsDeleted", o1."OrderDate", o1."RequiredDate", o1."ShipAddress", o1."ShipCity", o1."ShipCountry", o1."ShipName", o1."ShipPostalCode", o1."ShipRegion", o1."ShipVia", o1."ShippedDate", o."OrderID" AS "OrderID0", o."ProductID", p1."ProductID" AS "ProductID0", s0."SupplierID", p3."ProductID" AS "ProductID1", p3."CategoryID", p3."Discontinued", p3."IsDeleted" AS "IsDeleted0", p3."ProductName", p3."QuantityPerUnit", p3."ReorderLevel", p3."SupplierID" AS "SupplierID0", p3."UnitPrice", p3."UnitsInStock", p3."UnitsOnOrder" + FROM "Order Details" AS o + INNER JOIN ( + SELECT o0."OrderID", o0."CustomerID", o0."EmployeeID", o0."Freight", o0."IsDeleted", o0."OrderDate", o0."RequiredDate", o0."ShipAddress", o0."ShipCity", o0."ShipCountry", o0."ShipName", o0."ShipPostalCode", o0."ShipRegion", o0."ShipVia", o0."ShippedDate" + FROM "Orders" AS o0 + WHERE @ef_filter__p4 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") + ) AS o1 ON o."OrderID" = o1."OrderID" + INNER JOIN ( + SELECT p0."ProductID", p0."SupplierID" + FROM "Products" AS p0 + WHERE @ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted") + ) AS p1 ON o."ProductID" = p1."ProductID" + LEFT JOIN ( + SELECT s."SupplierID" + FROM "Suppliers" AS s + WHERE @ef_filter__p6 OR NOT (s."IsDeleted") OR NOT (s."IsDeleted") + ) AS s0 ON p1."SupplierID" = s0."SupplierID" + LEFT JOIN ( + SELECT p2."ProductID", p2."CategoryID", p2."Discontinued", p2."IsDeleted", p2."ProductName", p2."QuantityPerUnit", p2."ReorderLevel", p2."SupplierID", p2."UnitPrice", p2."UnitsInStock", p2."UnitsOnOrder" + FROM "Products" AS p2 + WHERE @ef_filter__p0 OR NOT (p2."IsDeleted") OR NOT (p2."IsDeleted") + ) AS p3 ON s0."SupplierID" = p3."SupplierID" + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS s1 ON p."ProductID" = s1."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +ORDER BY p."ProductID", s1."OrderID0", s1."ProductID", s1."OrderID", s1."ProductID0", s1."SupplierID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."SupplierId", + m_1."ProductId", + d_1."IsDeleted", + d_1."ProductID", + d_1."ProductName", + d_1."SupplierID", + d_1."CategoryID", + d_1."QuantityPerUnit", + d_1."UnitPrice", + d_1."UnitsInStock", + d_1."UnitsOnOrder", + d_1."ReorderLevel", + d_1."Discontinued" +FROM + ( + SELECT DISTINCT + "a_Supplier"."SupplierID" as "SupplierId", + t1."ProductId" + FROM + ( + SELECT DISTINCT + e."ProductID" as "ProductId" + FROM + "Products" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."ProductId" = d."ProductID" + INNER JOIN "Orders" e_1 ON d."OrderID" = e_1."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + LEFT JOIN "Suppliers" "a_Supplier" ON "a_Product"."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" + WHERE + NOT e_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + ) m_1 + INNER JOIN "Products" d_1 ON m_1."SupplierId" = d_1."SupplierID" OR m_1."SupplierId" IS NULL AND d_1."SupplierID" IS NULL +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + m_1."ProductID", + d."Discount", + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Supplier"."SupplierID" +FROM + "Products" m_1 + INNER JOIN "Order Details" d ON m_1."ProductID" = d."ProductID" + INNER JOIN "Orders" e ON d."OrderID" = e."OrderID" + LEFT JOIN "Suppliers" "a_Supplier" ON m_1."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" +WHERE + NOT m_1."IsDeleted" AND NOT e."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + p."ProductName", + p."ProductID" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..9c69f07ee787 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.14,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", p1."ProductID", p1."CategoryID", p1."Discontinued", p1."IsDeleted", p1."ProductName", p1."QuantityPerUnit", p1."ReorderLevel", p1."SupplierID", p1."UnitPrice", p1."UnitsInStock", p1."UnitsOnOrder" +FROM "Products" AS p +CROSS JOIN ( + SELECT p0."ProductID", p0."CategoryID", p0."Discontinued", p0."IsDeleted", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Products" AS p0 + WHERE (@ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o0 + WHERE (@ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted")) AND p0."ProductID" = o0."ProductID") +) AS p1 +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o + WHERE (@ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted")) AND p."ProductID" = o."ProductID") AND p."ProductID" = p1."ProductID" +ORDER BY p."ProductID" + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued", + pd2."IsDeleted", + pd2."ProductID", + pd2."ProductName", + pd2."SupplierID", + pd2."CategoryID", + pd2."QuantityPerUnit", + pd2."UnitPrice", + pd2."UnitsInStock", + pd2."UnitsOnOrder", + pd2."ReorderLevel", + pd2."Discontinued" +FROM + "Products" e, + "Products" pd2 +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_2 + WHERE + pd2."ProductID" = e_2."ProductID" + ) > 0 AND + e."ProductID" = pd2."ProductID" +ORDER BY + e."ProductID" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..3eb6df5ea909 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.14,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", p1."ProductID", p1."CategoryID", p1."Discontinued", p1."IsDeleted", p1."ProductName", p1."QuantityPerUnit", p1."ReorderLevel", p1."SupplierID", p1."UnitPrice", p1."UnitsInStock", p1."UnitsOnOrder" +FROM "Products" AS p +CROSS JOIN ( + SELECT p0."ProductID", p0."CategoryID", p0."Discontinued", p0."IsDeleted", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Products" AS p0 + WHERE (@ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o0 + WHERE (@ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted")) AND p0."ProductID" = o0."ProductID") +) AS p1 +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o + WHERE (@ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted")) AND p."ProductID" = o."ProductID") AND p."ProductID" = p1."ProductID" +ORDER BY p."ProductID" + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued", + pd2."IsDeleted", + pd2."ProductID", + pd2."ProductName", + pd2."SupplierID", + pd2."CategoryID", + pd2."QuantityPerUnit", + pd2."UnitPrice", + pd2."UnitsInStock", + pd2."UnitsOnOrder", + pd2."ReorderLevel", + pd2."Discontinued" +FROM + "Products" e, + "Products" pd2 +WHERE + NOT e."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + NOT pd2."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_2 + WHERE + NOT e_2."IsDeleted" AND pd2."ProductID" = e_2."ProductID" + ) > 0 AND + e."ProductID" = pd2."ProductID" +ORDER BY + e."ProductID" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..809fe6977f1f --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.14,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" +FROM "Employees" AS e +WHERE (@ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted")) AND e."EmployeeID" = @test + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath" +FROM + "Employees" e +WHERE + e."EmployeeID" = :test + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..da707f2ade0b --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.14,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" +FROM "Employees" AS e +WHERE (@ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted")) AND e."EmployeeID" = @test + + +-- PostgreSQL.9.5 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath" +FROM + "Employees" e +WHERE + NOT e."IsDeleted" AND e."EmployeeID" = :test + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..58c86314349f --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.14,False).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."IsDeleted", c."Phone", c."PostalCode", c."Region" +FROM "Customers" AS c +WHERE @ef_filter__p0 OR NOT (c."IsDeleted") OR NOT (c."IsDeleted") +LIMIT 1 + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) +DECLARE @CompanyName Varchar(34) -- String +SET @CompanyName = 'Ana Trujillo Emparedados y helados' +DECLARE @CustomerId Varchar(5) -- String +SET @CustomerId = 'ANATR' + +UPDATE + "Customers" +SET + "CompanyName" = :CompanyName +WHERE + "Customers"."CustomerID" = :CustomerId + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..cadd868c9d74 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.14,True).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."IsDeleted", c."Phone", c."PostalCode", c."Region" +FROM "Customers" AS c +WHERE @ef_filter__p0 OR NOT (c."IsDeleted") OR NOT (c."IsDeleted") +LIMIT 1 + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) +DECLARE @CompanyName Varchar(19) -- String +SET @CompanyName = 'Alfreds Futterkiste' +DECLARE @CustomerId Varchar(5) -- String +SET @CustomerId = 'ALFKI' + +UPDATE + "Customers" +SET + "CompanyName" = :CompanyName +WHERE + NOT "Customers"."IsDeleted" AND "Customers"."CustomerID" = :CustomerId + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..d639ce6d850c --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.14,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."QuantityPerUnit" AS "Quantity" +FROM "Products" AS p +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."QuantityPerUnit" +FROM + "Products" p + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..7bce3d733d34 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.14,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."QuantityPerUnit" AS "Quantity" +FROM "Products" AS p +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."QuantityPerUnit" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..59a1af5f0fe1 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.14,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +/* Tagged query */ +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..70496dfd20de --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.14,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.9.5 PostgreSQL + +/* Tagged query */ +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" AND NOT "a_ReportsToNavigation"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..e9b9df712991 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.14,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..71750953660c --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.14,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransaction + + +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..d7652f745c94 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.14,False).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT max(p."QuantityPerUnit") +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE 'U%' + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + MAX(e."QuantityPerUnit") +FROM + "Products" e +WHERE + e."ProductName" LIKE 'U%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL + +DELETE FROM + "Products" e +WHERE + e."ProductName" = 'a' + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..3db75c00d35c --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.14,True).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT max(p."QuantityPerUnit") +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE 'U%' + + +-- PostgreSQL.9.5 PostgreSQL (asynchronously) + +SELECT + MAX(e."QuantityPerUnit") +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE 'U%' ESCAPE '~' + + + +-- PostgreSQL.9.5 PostgreSQL + +DELETE FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" = 'a' + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..4c377165658c --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.14,False).sql @@ -0,0 +1,25 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..d1381041082b --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.14,True).sql @@ -0,0 +1,27 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" +WHERE + NOT p."IsDeleted" AND NOT c_1."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..4c377165658c --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.14,False).sql @@ -0,0 +1,25 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..d1381041082b --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.14,True).sql @@ -0,0 +1,27 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" +WHERE + NOT p."IsDeleted" AND NOT c_1."IsDeleted" + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..da3d6872fcaf --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.14,False).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..da3d6872fcaf --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.14,True).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.9.5 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..c6110c07ea11 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.14,False).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.9.5 PostgreSQL (asynchronously) +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..c6110c07ea11 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.14,True).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.9.5 PostgreSQL (asynchronously) +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.14,False).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.14,False).sql new file mode 100644 index 000000000000..9973b036f924 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.14,False).sql @@ -0,0 +1,29 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' + + + diff --git a/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.14,True).sql b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.14,True).sql new file mode 100644 index 000000000000..197f1ce5db37 --- /dev/null +++ b/PostgreSQL.14.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.14,True).sql @@ -0,0 +1,29 @@ +-- PostgreSQL.9.5 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.15).sql new file mode 100644 index 000000000000..4fcd588921f5 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.15).sql @@ -0,0 +1,164 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 1 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'bc7b663d-0fde-4327-8f92-5d8cc3a11d11'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C1' +DECLARE @Name Text(2) -- String +SET @Name = 'N1' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 2 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'a948600d-de21-4f74-8ac2-9516b287076e'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C2' +DECLARE @Name Text(2) -- String +SET @Name = 'N2' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 3 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'bd3973a5-4323-4dd8-9f4f-df9f93e2a627'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C3' +DECLARE @Name Text(2) -- String +SET @Name = 'N3' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +SELECT s."Id", s."Code", s."IsDeleted", s."Name", s."PermanentId" +FROM "Subdivisions" AS s +WHERE s."Id"::bigint = 1 + + +-- PostgreSQL.15 PostgreSQL + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id"::BigInt = 1 + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @id Bigint -- Int64 +SET @id = 1 + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id" = :id + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id" IN (2, 3) + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."PermanentId", + t1."Code", + t1."Name", + t1."IsDeleted" +FROM + "Subdivisions" t1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..f1084f10fea9 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.15).sql @@ -0,0 +1,10 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "Issue261Table" t1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..bb41027286ac --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.15).sql @@ -0,0 +1,43 @@ +Parameters: +@p0='?' (DbType = Object), @p1='?', @p2='?' (DbType = Object), @p3='?' (DbType = Object), @p4='?', @p5='?' (DbType = Object), @p6='?' (DbType = Object), @p7='?', @p8='?' (DbType = Object) + +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p0, @p1, @p2) +RETURNING "Id"; +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p3, @p4, @p5) +RETURNING "Id"; +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p6, @p7, @p8) +RETURNING "Id"; + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +INSERT INTO "Issue4783DBRecords" +( + "Source", + "Status", + "NullableStatus" +) +VALUES +('linq2db','open'::issue4783db_status,'open'::issue4783db_status), +('linq2db','closed'::issue4783db_status,'closed'::issue4783db_status), +('linq2db','closed'::issue4783db_status,NULL) + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4783DBRecords" t1 +ORDER BY + t1."Id" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..897eb5cfa288 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.15).sql @@ -0,0 +1,10 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name" +FROM + "Issue4917DBRecords" t1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..f6df37c54ab6 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test(PostgreSQL.15).sql @@ -0,0 +1,161 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE issue_4940_temp_table +( + "Id" integer NOT NULL, + "Source" text NOT NULL, + "Status" issue4940db_status NOT NULL, + "NullableStatus" issue4940db_status NULL +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +INSERT INTO issue_4940_temp_table +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +(1,'TempTable','open'::issue4940db_status,'closed'::issue4940db_status), +(2,'TempTable','closed'::issue4940db_status,NULL) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 1 +DECLARE @Source Text(6) -- String +SET @Source = 'Insert' +DECLARE @Status Enum -- Object +SET @Status = 'open'::issue4940db_status +DECLARE @NullableStatus Enum -- Object +SET @NullableStatus = 'closed'::issue4940db_status + +INSERT INTO "Issue4940DBRecords" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + :Id, + :Source, + :Status, + :NullableStatus +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 2 +DECLARE @Source Text(6) -- String +SET @Source = 'Insert' +DECLARE @Status Enum -- Object +SET @Status = 'closed'::issue4940db_status +DECLARE @NullableStatus Unknown -- Object +SET @NullableStatus = NULL + +INSERT INTO "Issue4940DBRecords" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + :Id, + :Source, + :Status, + :NullableStatus +) + + + +INSERT BULK "Issue4940DBRecords"(Id, Source, Status, NullableStatus) + + + +-- PostgreSQL.15 PostgreSQL + +MERGE INTO "Issue4940DBRecords" "Target" +USING (VALUES + ('Merge',5,'open'::issue4940db_status,'open'::issue4940db_status), + ('Merge',6,'open'::issue4940db_status,NULL) +) "Source" +( + "Source", + "Id", + "Status", + "NullableStatus" +) +ON ("Target"."Source" = "Source"."Source") + +WHEN NOT MATCHED THEN +INSERT +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + "Source"."Id", + "Source"."Source", + "Source"."Status", + "Source"."NullableStatus" +) + +WHEN MATCHED THEN +UPDATE +SET + "Id" = "Source"."Id", + "Source" = "Source"."Source", + "Status" = "Source"."Status", + "NullableStatus" = "Source"."NullableStatus" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4940DBRecords" t1 +ORDER BY + t1."Id" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + issue_4940_temp_table t1 +ORDER BY + t1."Id" + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS issue_4940_temp_table + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test_NotMapped(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test_NotMapped(PostgreSQL.15).sql new file mode 100644 index 000000000000..6bd53455985e --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test_NotMapped(PostgreSQL.15).sql @@ -0,0 +1,120 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "Issue4940RecordNotMapped" +( + "Id" Int NOT NULL, + "Source" text NULL, + "Status" issue4940db_status NOT NULL, + "NullableStatus" issue4940db_status NULL +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +INSERT INTO "Issue4940RecordNotMapped" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +(1,'TempTable','open'::issue4940db_status,'open'::issue4940db_status), +(2,'TempTable','closed'::issue4940db_status,NULL) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 3 +DECLARE @Source Text(6) -- String +SET @Source = 'Insert' +DECLARE @Status Enum -- Object +SET @Status = 'open'::issue4940db_status +DECLARE @NullableStatus Unknown -- Object +SET @NullableStatus = NULL + +INSERT INTO "Issue4940RecordNotMapped" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + :Id, + :Source, + :Status, + :NullableStatus +) + + + +INSERT BULK "Issue4940RecordNotMapped"(Id, Source, Status, NullableStatus) + + + +-- PostgreSQL.15 PostgreSQL + +MERGE INTO "Issue4940RecordNotMapped" "Target" +USING (VALUES + ('Merge',6,'open'::issue4940db_status,'closed'::issue4940db_status), + ('Merge',7,'open'::issue4940db_status,NULL) +) "Source" +( + "Source", + "Id", + "Status", + "NullableStatus" +) +ON ("Target"."Source" = "Source"."Source" OR "Target"."Source" IS NULL AND "Source"."Source" IS NULL) + +WHEN NOT MATCHED THEN +INSERT +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + "Source"."Id", + "Source"."Source", + "Source"."Status", + "Source"."NullableStatus" +) + +WHEN MATCHED THEN +UPDATE +SET + "Id" = "Source"."Id", + "Source" = "Source"."Source", + "Status" = "Source"."Status", + "NullableStatus" = "Source"."NullableStatus" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4940RecordNotMapped" t1 +ORDER BY + t1."Id" + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "Issue4940RecordNotMapped" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.15).sql new file mode 100644 index 000000000000..51c3d7adada3 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.15).sql @@ -0,0 +1,5 @@ +SELECT w."Id", w."Value" +FROM "WithDuplicateProperties" AS w +WHERE w."Value" = 1 + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.15).sql new file mode 100644 index 000000000000..784356a58fff --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.15).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +INSERT INTO "NoIdentity" +( + "Id", + "Name" +) +VALUES +('bc7b663d-0fde-4327-8f92-5d8cc3a11d11'::uuid,'John Doe'), +('a948600d-de21-4f74-8ac2-9516b287076e'::uuid,'Jane Doe') + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.15).sql new file mode 100644 index 000000000000..33cc2a28335a --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.15).sql @@ -0,0 +1,32 @@ +Parameters: +@p0='?', @p1='?', @p2='?', @p3='?', @p4='?' + +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p0) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p1) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p2) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p3) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p4) +RETURNING "Id"; + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Discriminator", + t1."Id" +FROM + "WithInheritance" t1 +WHERE + t1."Discriminator" IN ('WithInheritanceA2', 'WithInheritanceA1', 'WithInheritanceA') + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.15).sql new file mode 100644 index 000000000000..7595bb53108a --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.15).sql @@ -0,0 +1,33 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +INSERT ASYNC BULK "NoIdentity"(Id, Name) + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.15).sql new file mode 100644 index 000000000000..39a4028e0d5e --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.15).sql @@ -0,0 +1,33 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +INSERT BULK "NoIdentity"(Id, Name) + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.15).sql new file mode 100644 index 000000000000..0e82f5a61940 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.15).sql @@ -0,0 +1,76 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +INSERT INTO "SkipModes" ("Id", "InsertOnly") +VALUES (@p0, @p1); + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 2 +DECLARE @InsertOnly Integer -- Int32 +SET @InsertOnly = 2 + +INSERT INTO "SkipModes" +( + "Id", + "InsertOnly" +) +VALUES +( + :Id, + :InsertOnly +) + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."InsertOnly", + t1."UpdateOnly", + t1."ReadOnly" +FROM + "SkipModes" t1 +ORDER BY + t1."Id" + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +UPDATE "SkipModes" SET "UpdateOnly" = @p0 +WHERE "Id" = @p1; + + +-- PostgreSQL.15 PostgreSQL +DECLARE @UpdateOnly Integer -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id Integer -- Int32 +SET @Id = 2 + +UPDATE + "SkipModes" +SET + "UpdateOnly" = :UpdateOnly +WHERE + "SkipModes"."Id" = :Id + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."InsertOnly", + t1."UpdateOnly", + t1."ReadOnly" +FROM + "SkipModes" t1 +ORDER BY + t1."Id" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.15).sql new file mode 100644 index 000000000000..ddd5304821a7 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.15).sql @@ -0,0 +1,38 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "WithIdentity" +( + "Id" integer NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_WithIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "WithIdentity" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.15).sql new file mode 100644 index 000000000000..6b7704deafe1 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.15).sql @@ -0,0 +1,28 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int64), @p3='?' (DbType = Int64), @p4='?' (DbType = Decimal), @p5='?' (DbType = Decimal) + +INSERT INTO "UIntTable" ("Field16", "Field16N", "Field32", "Field32N", "Field64", "Field64N") +VALUES (@p0, @p1, @p2, @p3, @p4, @p5) +RETURNING "ID"; + + +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @field64 Numeric(1, 0) -- Decimal +SET @field64 = 5 + +SELECT + e."ID", + e."Field16", + e."Field32", + e."Field64", + e."Field16N", + e."Field32N", + e."Field64N" +FROM + "UIntTable" e +WHERE + e."Field64" = :field64 +LIMIT 1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.15,False,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.15,False,False).sql new file mode 100644 index 000000000000..4fadd949b642 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.15,False,False).sql @@ -0,0 +1,12 @@ +SELECT e.id, e.name, s0.id, s0.master_id, s0.name, s0.id0, s0.master_id0, s0.name0, c.id, c.name, c.parent_id +FROM entities AS e +LEFT JOIN ( + SELECT d.id, d.master_id, d.name, s.id AS id0, s.master_id AS master_id0, s.name AS name0 + FROM details AS d + LEFT JOIN sub_details AS s ON d.id = s.master_id +) AS s0 ON e.id = s0.master_id +LEFT JOIN children AS c ON e.id = c.parent_id +WHERE e.name = 'Alpha' +ORDER BY e.id, s0.id, s0.id0 + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.15,False,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.15,False,True).sql new file mode 100644 index 000000000000..4fadd949b642 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.15,False,True).sql @@ -0,0 +1,12 @@ +SELECT e.id, e.name, s0.id, s0.master_id, s0.name, s0.id0, s0.master_id0, s0.name0, c.id, c.name, c.parent_id +FROM entities AS e +LEFT JOIN ( + SELECT d.id, d.master_id, d.name, s.id AS id0, s.master_id AS master_id0, s.name AS name0 + FROM details AS d + LEFT JOIN sub_details AS s ON d.id = s.master_id +) AS s0 ON e.id = s0.master_id +LEFT JOIN children AS c ON e.id = c.parent_id +WHERE e.name = 'Alpha' +ORDER BY e.id, s0.id, s0.id0 + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.15,True,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.15,True,False).sql new file mode 100644 index 000000000000..a7b4bb1ff42f --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.15,True,False).sql @@ -0,0 +1,76 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Id", + m_1."Id_1", + d_1.id, + d_1.master_id, + d_1.name +FROM + ( + SELECT DISTINCT + d.id as "Id", + t1."Id" as "Id_1" + FROM + ( + SELECT DISTINCT + e.id as "Id" + FROM + entities e + WHERE + e.name = 'Alpha' + ) t1 + INNER JOIN details d ON t1."Id" = d.master_id + ) m_1 + INNER JOIN sub_details d_1 ON m_1."Id" = d_1.master_id + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.id, + d.master_id, + d.name +FROM + entities m_1 + INNER JOIN details d ON m_1.id = d.master_id +WHERE + m_1.name = 'Alpha' + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.id, + d.parent_id, + d.name +FROM + entities m_1 + INNER JOIN children d ON m_1.id = d.parent_id +WHERE + m_1.name = 'Alpha' + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e.id, + e.name +FROM + entities e +WHERE + e.name = 'Alpha' + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.15,True,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.15,True,True).sql new file mode 100644 index 000000000000..a7b4bb1ff42f --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.15,True,True).sql @@ -0,0 +1,76 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Id", + m_1."Id_1", + d_1.id, + d_1.master_id, + d_1.name +FROM + ( + SELECT DISTINCT + d.id as "Id", + t1."Id" as "Id_1" + FROM + ( + SELECT DISTINCT + e.id as "Id" + FROM + entities e + WHERE + e.name = 'Alpha' + ) t1 + INNER JOIN details d ON t1."Id" = d.master_id + ) m_1 + INNER JOIN sub_details d_1 ON m_1."Id" = d_1.master_id + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.id, + d.master_id, + d.name +FROM + entities m_1 + INNER JOIN details d ON m_1.id = d.master_id +WHERE + m_1.name = 'Alpha' + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.id, + d.parent_id, + d.name +FROM + entities m_1 + INNER JOIN children d ON m_1.id = d.parent_id +WHERE + m_1.name = 'Alpha' + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e.id, + e.name +FROM + entities e +WHERE + e.name = 'Alpha' + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.15).sql new file mode 100644 index 000000000000..1f665e79775c --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.15).sql @@ -0,0 +1,13 @@ +Parameters: +@p0='test insert ef' (Nullable = false) + +INSERT INTO entities (name) +VALUES (@p0) +RETURNING id; + + +SELECT e.id, e.name +FROM entities AS e +LIMIT 2 + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.15).sql new file mode 100644 index 000000000000..ce1197584240 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.15).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @name Text(11) -- String +SET @name = 'test insert' + +INSERT INTO entities +( + name +) +VALUES +( + :name +) +RETURNING + id + + + +Parameters: +@id='50' + +SELECT e.id, e.name +FROM entities AS e +WHERE e.id::bigint = @id +LIMIT 2 + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.15,False,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.15,False,True).sql new file mode 100644 index 000000000000..803b4f11e467 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.15,False,True).sql @@ -0,0 +1,10 @@ +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.15,True,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.15,True,False).sql new file mode 100644 index 000000000000..64a4d6beef99 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.15,True,False).sql @@ -0,0 +1,31 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.15,True,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.15,True,True).sql new file mode 100644 index 000000000000..64a4d6beef99 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.15,True,True).sql @@ -0,0 +1,31 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..28ad2b078f61 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.15,False).sql @@ -0,0 +1,41 @@ +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..3ca3ee146fbb --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.15,True).sql @@ -0,0 +1,41 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.15,False,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.15,False,True).sql new file mode 100644 index 000000000000..8d38ce10d713 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.15,False,True).sql @@ -0,0 +1,5 @@ +SELECT d.id, d.master_id, d.name, e.id, e.name +FROM details AS d +INNER JOIN entities AS e ON d.master_id = e.id + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.15,True,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.15,True,False).sql new file mode 100644 index 000000000000..5907ebd3fc01 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.15,True,False).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.15,True,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.15,True,True).sql new file mode 100644 index 000000000000..5907ebd3fc01 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.15,True,True).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.15,False,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.15,False,True).sql new file mode 100644 index 000000000000..8d38ce10d713 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.15,False,True).sql @@ -0,0 +1,5 @@ +SELECT d.id, d.master_id, d.name, e.id, e.name +FROM details AS d +INNER JOIN entities AS e ON d.master_id = e.id + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.15,True,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.15,True,True).sql new file mode 100644 index 000000000000..5907ebd3fc01 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.15,True,True).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.15,Default).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.15,Default).sql new file mode 100644 index 000000000000..71ae5334d03f --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.15,Default).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.15,MultipleRows).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.15,MultipleRows).sql new file mode 100644 index 000000000000..71ae5334d03f --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.15,MultipleRows).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.15,ProviderSpecific).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.15,ProviderSpecific).sql new file mode 100644 index 000000000000..71ae5334d03f --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.15,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.15,RowByRow).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.15,RowByRow).sql new file mode 100644 index 000000000000..71ae5334d03f --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.15,RowByRow).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.15).sql new file mode 100644 index 000000000000..adeb323d784c --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.15).sql @@ -0,0 +1,10 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @p='?' (DbType = Int32) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductID" > 0 +ORDER BY p."ProductID" +LIMIT @p + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.15).sql new file mode 100644 index 000000000000..3b44a93907dd --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.15).sql @@ -0,0 +1,52 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.15).sql new file mode 100644 index 000000000000..28476ddd63c9 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.15).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.15).sql new file mode 100644 index 000000000000..28476ddd63c9 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.15).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.15).sql new file mode 100644 index 000000000000..b7e831126fbf --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.15).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id" +FROM + "Patents" t1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..f9618badbc13 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.15).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT p."Id" AS "PatentId", @userId0 AS "UserId" +FROM "Patents" AS p +LEFT JOIN "PatentAssessment" AS p0 ON p."Id" = p0."PatentId" +WHERE p0."PatentId" IS NULL OR p0."TechnicalReviewerId" <> @userId OR p0."TechnicalReviewerId" IS NULL + + +-- PostgreSQL.15 PostgreSQL +DECLARE @userId Integer -- Int32 +SET @userId = 1 + +SELECT + p."Id" +FROM + "Patents" p + LEFT JOIN "PatentAssessment" "a_Assessment" ON p."Id" = "a_Assessment"."PatentId" +WHERE + "a_Assessment"."PatentId" IS NULL OR "a_Assessment"."TechnicalReviewerId" <> :userId OR + "a_Assessment"."TechnicalReviewerId" IS NULL + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..34c99bd03604 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.15).sql @@ -0,0 +1,21 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."Id", + e."Linked", + ( + SELECT + ARRAY_AGG(DISTINCT r."Id") + FROM + "Issue155Table" r + WHERE + e."Id" = ANY(r."Linked") + ) +FROM + "Issue155Table" e +WHERE + e."Id" = 1 +LIMIT 2 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.15).sql new file mode 100644 index 000000000000..e4044c4b1d3d --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.15).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + COUNT(*) +FROM + "Parents" x +WHERE + ( + SELECT + "a_Children"."IsActive" + FROM + "Children" "a_Children" + WHERE + x."Id" = "a_Children"."ParentId" + LIMIT 1 + ) = False + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.15).sql new file mode 100644 index 000000000000..1c50903f9c81 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.15).sql @@ -0,0 +1,18 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + COUNT(*) +FROM + "Parents" x +WHERE + NOT EXISTS( + SELECT + * + FROM + "Children" y + WHERE + x."Id" = y."ParentId" AND y."IsActive" + ) + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..b7e831126fbf --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.15).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id" +FROM + "Patents" t1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..475577c27094 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.15).sql @@ -0,0 +1,11 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id" +FROM + "Issue340Entities" x +WHERE + x."IsActive" = True + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..1d1e37e9f7a9 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.15).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.15 PostgreSQL + +UPDATE + "PostgreTestTable" +SET + ("Title", "SearchVector") = ( + SELECT + "PostgreTestTable"."Title", + to_tsvector('test') + FROM + "PostgreTestTable" x + WHERE + "PostgreTestTable"."Id" = x."Id" + ) +WHERE + "PostgreTestTable"."Id" = 1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..13e7894d0f20 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.15).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + 1 +FROM + "Parents" ua +WHERE + ua."ParentId" = 55377 AND EXISTS( + SELECT + * + FROM + "Parents" t1 + ) + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.15).sql new file mode 100644 index 000000000000..2deaab506768 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.15).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @DateTimeOffset TimestampTz -- DateTime +SET @DateTimeOffset = '2020-02-29T17:54:55.1231234+00:00' +DECLARE @DateTimeOffsetN TimestampTz -- DateTime +SET @DateTimeOffsetN = '2020-02-29T17:54:55.1231234+00:00' + +UPDATE + "Types" +SET + "DateTimeOffset" = :DateTimeOffset, + "DateTimeOffsetN" = :DateTimeOffsetN +WHERE + "Types"."Id" = 2 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.15).sql new file mode 100644 index 000000000000..27280032538f --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.15).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @DateTimeOffsetWithConverter Bigint -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter Bigint -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + "Types" +SET + "DateTimeOffsetWithConverter" = :DateTimeOffsetWithConverter, + "DateTimeOffsetNWithConverter" = :DateTimeOffsetNWithConverter +WHERE + "Types"."Id" = 2 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.15).sql new file mode 100644 index 000000000000..bc43196a3204 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.15).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Id", + d_1."Key_1", + d_1."SUM_1", + d_1."ToValue" +FROM + "Parents" m_1 + INNER JOIN LATERAL ( + SELECT + d."ParentId" as "Key_1", + SUM(d."Id") as "SUM_1", + STRING_AGG(d."Name", ', ') as "ToValue" + FROM + "Children" d + WHERE + m_1."Id" = d."ParentId" + GROUP BY + d."ParentId" + ) d_1 ON 1=1 + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + c_1."Id" +FROM + "Parents" c_1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..d0307a15be51 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.15).sql @@ -0,0 +1,36 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + id."Id" +FROM + ( + SELECT + p."Id" + FROM + "Issue4629Posts" p + WHERE + ( + SELECT + SUM("a_Tags"."Weight") + FROM + "Issue4629Tags" "a_Tags" + WHERE + p."Id" = "a_Tags"."PostId" AND "a_Tags"."Weight" > 1 + ) > 5 + ORDER BY + ( + SELECT + SUM("a_Tags_1"."Weight") + FROM + "Issue4629Tags" "a_Tags_1" + WHERE + p."Id" = "a_Tags_1"."PostId" + ) + LIMIT :take + ) id + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..d5c80521cd2d --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.15).sql @@ -0,0 +1,20 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @id Integer -- Int32 +SET @id = 2 + +SELECT + t1."Index_1" +FROM + ( + SELECT + x."Id", + ROW_NUMBER() OVER(ORDER BY x."Id") as "Index_1" + FROM + "Parents" x + ) t1 +WHERE + t1."Id" = :id +LIMIT 1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..fae98f1d22cb --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.15).sql @@ -0,0 +1,40 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Key_1", + d."CfAllowValue", + d."DateFrom" +FROM + ( + SELECT + p."AclNameId" as "Key_1" + FROM + "Issue4624Items" p + GROUP BY + p."AclNameId" + LIMIT 1 + ) m_1 + INNER JOIN "Issue4624Items" d ON m_1."Key_1" = d."AclNameId" +ORDER BY + d."DateFrom" + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."AclNameId" +FROM + "Issue4624Items" p +GROUP BY + p."AclNameId" +LIMIT 1 + + + +DisposeTransaction + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..a3153abcbb60 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.15).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id" +FROM + "Masters" t1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4667Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4667Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..3fa0695edb2e --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4667Test(PostgreSQL.15).sql @@ -0,0 +1,31 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @value Json -- Object +SET @value = {[property, value]} + +MERGE INTO "Issue4667" "Target" +USING (VALUES + (1,'{"test" : 1}'::jsonb,:value::json) +) "Source" +( + "Id", + "Payload", + "Headers" +) +ON ("Target".id = "Source"."Id") + +WHEN NOT MATCHED THEN +INSERT +( + id, + payload, + headers +) +VALUES +( + "Source"."Id", + "Source"."Payload", + "Source"."Headers" +) + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..42990f4614dc --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.15).sql @@ -0,0 +1,21 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + x."Id", + x."IsActive", + x."ParentId", + x."Name" +FROM + "Children" x +WHERE + x."Name" LIKE '%Test%' ESCAPE '~' +ORDER BY + x."Name" + + + +SELECT c."Id", c."IsActive", c."Name", c."ParentId" +FROM "Children" AS c +WHERE c."Name" LIKE 'Test%' + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..93e342b64ae0 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.15,False).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..93e342b64ae0 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.15,True).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..93e342b64ae0 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.15,False).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..93e342b64ae0 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.15,True).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.15).sql new file mode 100644 index 000000000000..62531c28ad48 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.15).sql @@ -0,0 +1,18 @@ +SELECT COALESCE(i0."Name", '') || '>' || i."Name" +FROM "Issue73Entities" AS i +LEFT JOIN "Issue73Entities" AS i0 ON i."ParentId" = i0."Id" +WHERE i."Name" = 'Name1_3' + + +-- PostgreSQL.15 PostgreSQL + +SELECT + "a_Parent"."Name" || '>' || x."Name" +FROM + "Issue73Entities" x + LEFT JOIN "Issue73Entities" "a_Parent" ON x."ParentId" = "a_Parent"."Id" +WHERE + x."Name" = 'Name1_3' + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.15).sql new file mode 100644 index 000000000000..9f6fdc246f26 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.15).sql @@ -0,0 +1,30 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32) + +INSERT INTO "IssueEnum" ("Value") +VALUES (@p0) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p1) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p2) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p3) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p4) +RETURNING "Id"; + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Value" +FROM + "IssueEnum" t1 + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.15).sql new file mode 100644 index 000000000000..dea9fca0781b --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.15).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @guids -2147483621 -- Object +SET @guids = {'271425b1-ebe8-400d-b71d-a6e47a460ae3'::uuid,'b75de94e-6d7b-4c70-bfa1-f8639a6a5b35'::uuid} + +SELECT + m_1."Id", + m_1."Guids" +FROM + "EntityWithArrays" m_1 +WHERE + m_1."Guids" && :guids + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.15).sql new file mode 100644 index 000000000000..7c2264341440 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.15).sql @@ -0,0 +1,20 @@ +-- PostgreSQL.15 PostgreSQL + +INSERT INTO "EntityWithXmin" +( + "Value" +) +VALUES +('Str1'), +('Str2'), +('Str3'), +('Str4'), +('Str5'), +('Str6'), +('Str7'), +('Str8'), +('Str9'), +('Str10') + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.15,Local).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.15,Local).sql new file mode 100644 index 000000000000..1d7992d38759 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.15,Local).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.15,Unspecified).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.15,Unspecified).sql new file mode 100644 index 000000000000..1d7992d38759 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.15,Unspecified).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.15,Utc).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.15,Utc).sql new file mode 100644 index 000000000000..1d7992d38759 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.15,Utc).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.15).sql new file mode 100644 index 000000000000..7512830f1412 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.15).sql @@ -0,0 +1,27 @@ +Parameters: +@date='?' (DbType = DateTime2) + +SELECT e."Id", e."Duration", e."Name" +FROM "Events" AS e +WHERE e."Duration" @> @date OR lower(e."Duration") = @date OR upper(e."Duration") = @date OR isempty(e."Duration") OR isempty(e."Duration" * e."Duration") + + +-- PostgreSQL.15 PostgreSQL +DECLARE @date Timestamp -- DateTime2 +SET @date = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Name", + e."Duration" +FROM + "Events" e +WHERE + e."Duration" @> :date OR + lower(e."Duration") = :date OR + upper(e."Duration") = :date OR + isempty(e."Duration") OR + isempty(e."Duration" * e."Duration") + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.15).sql new file mode 100644 index 000000000000..a270b408fa11 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.15).sql @@ -0,0 +1,15 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @guids -2147483621 -- Object +SET @guids = {'271425b1-ebe8-400d-b71d-a6e47a460ae3'::uuid,'b75de94e-6d7b-4c70-bfa1-f8639a6a5b35'::uuid} + +SELECT + m_1."Id", + m_1."Guids" +FROM + "EntityWithArrays" m_1 + INNER JOIN LATERAL UNNEST(m_1."Guids") g_1(value) ON 1=1 +WHERE + m_1."Guids" && :guids + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.15).sql new file mode 100644 index 000000000000..62ac6f949779 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.15).sql @@ -0,0 +1,16 @@ +SELECT e."Name" +FROM views."EventsView" AS e +WHERE e."Name" LIKE 'any%' + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."Name" +FROM + views."EventsView" e +WHERE + e."Name" LIKE 'any%' ESCAPE '~' + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.15).sql new file mode 100644 index 000000000000..8024b0b4b5bc --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.15).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" IS NOT NULL + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.15).sql new file mode 100644 index 000000000000..7e920fba7c61 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.15).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" LIKE '%anything%' ESCAPE '~' + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.15).sql new file mode 100644 index 000000000000..4b8dfe4a71d4 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.15).sql @@ -0,0 +1,24 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @value Varchar(10) -- String +SET @value = '%anything%' + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" LIKE :value ESCAPE '~' + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.15).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.15).sql new file mode 100644 index 000000000000..9ad91620744d --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.15).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o1."OrderID", o1."ProductID", p0."ProductID", o3."OrderId", o3."ProductId", o3."Quantity", o1."Quantity", p0."ProductName" +FROM "Orders" AS o +INNER JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Quantity" + FROM "Order Details" AS o0 + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS o1 ON o."OrderID" = o1."OrderID" +INNER JOIN ( + SELECT p."ProductID", p."ProductName" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +) AS p0 ON o1."ProductID" = p0."ProductID" +LEFT JOIN ( + SELECT o2."OrderID" AS "OrderId", o2."ProductID" AS "ProductId", o2."Quantity" + FROM "Order Details" AS o2 + WHERE @ef_filter__p2 OR NOT (o2."IsDeleted") OR NOT (o2."IsDeleted") +) AS o3 ON p0."ProductID" = o3."ProductId" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", o1."OrderID", o1."ProductID", p0."ProductID", o3."OrderId" + + +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."ProductId", + d."OrderID", + d."ProductID", + d."Quantity" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId" + FROM + "Orders" e + INNER JOIN "Order Details" od ON e."OrderID" = od."OrderID" + INNER JOIN "Products" "a_Product" ON od."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d ON m_1."ProductId" = d."ProductID" + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + "a_Product"."ProductID", + od."OrderID", + od."ProductID", + od."Quantity", + "a_Product"."ProductName" +FROM + "Orders" o + INNER JOIN "Order Details" od ON o."OrderID" = od."OrderID" + INNER JOIN "Products" "a_Product" ON od."ProductID" = "a_Product"."ProductID" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..9ad2c05355c0 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.15,False).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS p + WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%') + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + "Products" e + WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..0dde33fef5a9 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.15,True).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS p + WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%') + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + "Products" e + WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..80ff17482e05 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.15,False).sql @@ -0,0 +1,17 @@ +-- PostgreSQL.15 PostgreSQL + +DELETE FROM + "Products" e +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' AND e."ProductName" = 'a' + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..4e79bf65b6bb --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.15,True).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.15 PostgreSQL + +DELETE FROM + "Products" e +WHERE + NOT e."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' AND + e."ProductName" = 'a' + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..ad8a19493cc0 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.15,False).sql @@ -0,0 +1,94 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2; + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..afa60754b4a3 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.15,True).sql @@ -0,0 +1,105 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2; + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..86efccdbd1df --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.15,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..9657ac2e8836 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.15,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..86efccdbd1df --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.15,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..9657ac2e8836 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.15,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..1322e477c4ed --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.15,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder", s."OrderID0", s."ProductID1", s."Discount0", s."IsDeleted1", s."Quantity0", s."UnitPrice1" +FROM "Orders" AS o +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder", o2."OrderID" AS "OrderID0", o2."ProductID" AS "ProductID1", o2."Discount" AS "Discount0", o2."IsDeleted" AS "IsDeleted1", o2."Quantity" AS "Quantity0", o2."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + LEFT JOIN ( + SELECT o1."OrderID", o1."ProductID", o1."Discount", o1."IsDeleted", o1."Quantity", o1."UnitPrice" + FROM "Order Details" AS o1 + WHERE @ef_filter__p2 OR NOT (o1."IsDeleted") OR NOT (o1."IsDeleted") + ) AS o2 ON p0."ProductID" = o2."ProductID" + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", s."OrderID", s."ProductID", s."ProductID0", s."OrderID0" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..fd750acbf799 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.15,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder", s."OrderID0", s."ProductID1", s."Discount0", s."IsDeleted1", s."Quantity0", s."UnitPrice1" +FROM "Orders" AS o +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder", o2."OrderID" AS "OrderID0", o2."ProductID" AS "ProductID1", o2."Discount" AS "Discount0", o2."IsDeleted" AS "IsDeleted1", o2."Quantity" AS "Quantity0", o2."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + LEFT JOIN ( + SELECT o1."OrderID", o1."ProductID", o1."Discount", o1."IsDeleted", o1."Quantity", o1."UnitPrice" + FROM "Order Details" AS o1 + WHERE @ef_filter__p2 OR NOT (o1."IsDeleted") OR NOT (o1."IsDeleted") + ) AS o2 ON p0."ProductID" = o2."ProductID" + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", s."OrderID", s."ProductID", s."ProductID0", s."OrderID0" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..fe5c59d3b2ca --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.15,False).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e + LEFT JOIN "Products" op ON op."ProductID" <> e."ProductID" AND op."ProductName" = e."ProductName" +WHERE + op."ProductID" IS NULL + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..926343941e78 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.15,True).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e + LEFT JOIN "Products" op ON op."ProductID" <> e."ProductID" AND op."ProductName" = e."ProductName" AND NOT op."IsDeleted" +WHERE + NOT e."IsDeleted" AND op."ProductID" IS NULL + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..154ab410fc4a --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.15,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", o."OrderID", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + e_1."IsDeleted", + e_1."TerritoryID", + e_1."TerritoryDescription", + e_1."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" e_1 ON d."TerritoryID" = e_1."TerritoryID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + e_1."IsDeleted", + e_1."ProductID", + e_1."ProductName", + e_1."SupplierID", + e_1."CategoryID", + e_1."QuantityPerUnit", + e_1."UnitPrice", + e_1."UnitsInStock", + e_1."UnitsOnOrder", + e_1."ReorderLevel", + e_1."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" e_1 ON d."ProductID" = e_1."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath", + o."OrderID" +FROM + "Orders" o + LEFT JOIN "Employees" "a_Employee" ON o."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..1385bd04a775 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.15,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", o."OrderID", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + e_1."IsDeleted", + e_1."TerritoryID", + e_1."TerritoryDescription", + e_1."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" e_1 ON d."TerritoryID" = e_1."TerritoryID" +WHERE + NOT e_1."IsDeleted" AND NOT d."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + e_1."IsDeleted", + e_1."ProductID", + e_1."ProductName", + e_1."SupplierID", + e_1."CategoryID", + e_1."QuantityPerUnit", + e_1."UnitPrice", + e_1."UnitsInStock", + e_1."UnitsOnOrder", + e_1."ReorderLevel", + e_1."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" e_1 ON d."ProductID" = e_1."ProductID" +WHERE + NOT e_1."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath", + o."OrderID" +FROM + "Orders" o + LEFT JOIN "Employees" "a_Employee" ON o."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT o."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..70b3fe349991 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.15,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..d799f0c8ee68 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.15,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" AND NOT "a_ReportsToNavigation"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..e045c824756e --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.15,False).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."City" IS NOT NULL + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..9dd8b5452a5b --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.15,True).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + NOT e."IsDeleted" AND e."City" IS NOT NULL + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..011e49fdd3d9 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.15,False).sql @@ -0,0 +1,70 @@ +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" +FROM "Products" AS p +INNER JOIN "Order Details" AS o ON p."ProductID" = o."ProductID" + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice" +FROM "Products" AS p +INNER JOIN ( + SELECT o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" + FROM "Order Details" AS o + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS o0 ON p."ProductID" = o0."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..88e51fccdd4b --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.15,True).sql @@ -0,0 +1,74 @@ +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" +FROM "Products" AS p +INNER JOIN "Order Details" AS o ON p."ProductID" = o."ProductID" + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" +WHERE + NOT d."IsDeleted" + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice" +FROM "Products" AS p +INNER JOIN ( + SELECT o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" + FROM "Order Details" AS o + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS o0 ON p."ProductID" = o0."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" +WHERE + NOT p."IsDeleted" AND NOT d."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..869719113c9a --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.15,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + "a_Territory"."IsDeleted", + "a_Territory"."TerritoryID", + "a_Territory"."TerritoryDescription", + "a_Territory"."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" "a_Territory" ON d."TerritoryID" = "a_Territory"."TerritoryID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..3003bc050257 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.15,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + "a_Territory"."IsDeleted", + "a_Territory"."TerritoryID", + "a_Territory"."TerritoryDescription", + "a_Territory"."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" "a_Territory" ON d."TerritoryID" = "a_Territory"."TerritoryID" +WHERE + NOT "a_Territory"."IsDeleted" AND NOT d."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..e49ae0c5940b --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.15,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", e2."EmployeeID", e2."TerritoryID", e2."IsDeleted", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted" + FROM "EmployeeTerritories" AS e1 + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS e2 ON e0."EmployeeID" = e2."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p8 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", e2."EmployeeID", e2."TerritoryID", s."OrderID", s."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..a3094071b928 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.15,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", e2."EmployeeID", e2."TerritoryID", e2."IsDeleted", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted" + FROM "EmployeeTerritories" AS e1 + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS e2 ON e0."EmployeeID" = e2."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p8 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", e2."EmployeeID", e2."TerritoryID", s."OrderID", s."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" +WHERE + NOT d."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..5eda4221dfa9 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.15,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductName", p."ProductID", s1."Discount", s1."OrderID", s1."CustomerID", s1."EmployeeID", s1."Freight", s1."IsDeleted", s1."OrderDate", s1."RequiredDate", s1."ShipAddress", s1."ShipCity", s1."ShipCountry", s1."ShipName", s1."ShipPostalCode", s1."ShipRegion", s1."ShipVia", s1."ShippedDate", s1."OrderID0", s1."ProductID", s1."ProductID0", s1."SupplierID", s1."ProductID1", s1."CategoryID", s1."Discontinued", s1."IsDeleted0", s1."ProductName", s1."QuantityPerUnit", s1."ReorderLevel", s1."SupplierID0", s1."UnitPrice", s1."UnitsInStock", s1."UnitsOnOrder" +FROM "Products" AS p +LEFT JOIN ( + SELECT o."Discount", o1."OrderID", o1."CustomerID", o1."EmployeeID", o1."Freight", o1."IsDeleted", o1."OrderDate", o1."RequiredDate", o1."ShipAddress", o1."ShipCity", o1."ShipCountry", o1."ShipName", o1."ShipPostalCode", o1."ShipRegion", o1."ShipVia", o1."ShippedDate", o."OrderID" AS "OrderID0", o."ProductID", p1."ProductID" AS "ProductID0", s0."SupplierID", p3."ProductID" AS "ProductID1", p3."CategoryID", p3."Discontinued", p3."IsDeleted" AS "IsDeleted0", p3."ProductName", p3."QuantityPerUnit", p3."ReorderLevel", p3."SupplierID" AS "SupplierID0", p3."UnitPrice", p3."UnitsInStock", p3."UnitsOnOrder" + FROM "Order Details" AS o + INNER JOIN ( + SELECT o0."OrderID", o0."CustomerID", o0."EmployeeID", o0."Freight", o0."IsDeleted", o0."OrderDate", o0."RequiredDate", o0."ShipAddress", o0."ShipCity", o0."ShipCountry", o0."ShipName", o0."ShipPostalCode", o0."ShipRegion", o0."ShipVia", o0."ShippedDate" + FROM "Orders" AS o0 + WHERE @ef_filter__p4 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") + ) AS o1 ON o."OrderID" = o1."OrderID" + INNER JOIN ( + SELECT p0."ProductID", p0."SupplierID" + FROM "Products" AS p0 + WHERE @ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted") + ) AS p1 ON o."ProductID" = p1."ProductID" + LEFT JOIN ( + SELECT s."SupplierID" + FROM "Suppliers" AS s + WHERE @ef_filter__p6 OR NOT (s."IsDeleted") OR NOT (s."IsDeleted") + ) AS s0 ON p1."SupplierID" = s0."SupplierID" + LEFT JOIN ( + SELECT p2."ProductID", p2."CategoryID", p2."Discontinued", p2."IsDeleted", p2."ProductName", p2."QuantityPerUnit", p2."ReorderLevel", p2."SupplierID", p2."UnitPrice", p2."UnitsInStock", p2."UnitsOnOrder" + FROM "Products" AS p2 + WHERE @ef_filter__p0 OR NOT (p2."IsDeleted") OR NOT (p2."IsDeleted") + ) AS p3 ON s0."SupplierID" = p3."SupplierID" + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS s1 ON p."ProductID" = s1."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +ORDER BY p."ProductID", s1."OrderID0", s1."ProductID", s1."OrderID", s1."ProductID0", s1."SupplierID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."SupplierId", + m_1."ProductId", + d_1."IsDeleted", + d_1."ProductID", + d_1."ProductName", + d_1."SupplierID", + d_1."CategoryID", + d_1."QuantityPerUnit", + d_1."UnitPrice", + d_1."UnitsInStock", + d_1."UnitsOnOrder", + d_1."ReorderLevel", + d_1."Discontinued" +FROM + ( + SELECT DISTINCT + "a_Supplier"."SupplierID" as "SupplierId", + t1."ProductId" + FROM + ( + SELECT DISTINCT + e."ProductID" as "ProductId" + FROM + "Products" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."ProductId" = d."ProductID" + INNER JOIN "Orders" e_1 ON d."OrderID" = e_1."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + LEFT JOIN "Suppliers" "a_Supplier" ON "a_Product"."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" + WHERE + NOT e_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + ) m_1 + INNER JOIN "Products" d_1 ON m_1."SupplierId" = d_1."SupplierID" OR m_1."SupplierId" IS NULL AND d_1."SupplierID" IS NULL +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductID", + d."Discount", + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Supplier"."SupplierID" +FROM + "Products" m_1 + INNER JOIN "Order Details" d ON m_1."ProductID" = d."ProductID" + INNER JOIN "Orders" e ON d."OrderID" = e."OrderID" + LEFT JOIN "Suppliers" "a_Supplier" ON m_1."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" +WHERE + NOT m_1."IsDeleted" AND NOT e."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + p."ProductName", + p."ProductID" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..5eda4221dfa9 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.15,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductName", p."ProductID", s1."Discount", s1."OrderID", s1."CustomerID", s1."EmployeeID", s1."Freight", s1."IsDeleted", s1."OrderDate", s1."RequiredDate", s1."ShipAddress", s1."ShipCity", s1."ShipCountry", s1."ShipName", s1."ShipPostalCode", s1."ShipRegion", s1."ShipVia", s1."ShippedDate", s1."OrderID0", s1."ProductID", s1."ProductID0", s1."SupplierID", s1."ProductID1", s1."CategoryID", s1."Discontinued", s1."IsDeleted0", s1."ProductName", s1."QuantityPerUnit", s1."ReorderLevel", s1."SupplierID0", s1."UnitPrice", s1."UnitsInStock", s1."UnitsOnOrder" +FROM "Products" AS p +LEFT JOIN ( + SELECT o."Discount", o1."OrderID", o1."CustomerID", o1."EmployeeID", o1."Freight", o1."IsDeleted", o1."OrderDate", o1."RequiredDate", o1."ShipAddress", o1."ShipCity", o1."ShipCountry", o1."ShipName", o1."ShipPostalCode", o1."ShipRegion", o1."ShipVia", o1."ShippedDate", o."OrderID" AS "OrderID0", o."ProductID", p1."ProductID" AS "ProductID0", s0."SupplierID", p3."ProductID" AS "ProductID1", p3."CategoryID", p3."Discontinued", p3."IsDeleted" AS "IsDeleted0", p3."ProductName", p3."QuantityPerUnit", p3."ReorderLevel", p3."SupplierID" AS "SupplierID0", p3."UnitPrice", p3."UnitsInStock", p3."UnitsOnOrder" + FROM "Order Details" AS o + INNER JOIN ( + SELECT o0."OrderID", o0."CustomerID", o0."EmployeeID", o0."Freight", o0."IsDeleted", o0."OrderDate", o0."RequiredDate", o0."ShipAddress", o0."ShipCity", o0."ShipCountry", o0."ShipName", o0."ShipPostalCode", o0."ShipRegion", o0."ShipVia", o0."ShippedDate" + FROM "Orders" AS o0 + WHERE @ef_filter__p4 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") + ) AS o1 ON o."OrderID" = o1."OrderID" + INNER JOIN ( + SELECT p0."ProductID", p0."SupplierID" + FROM "Products" AS p0 + WHERE @ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted") + ) AS p1 ON o."ProductID" = p1."ProductID" + LEFT JOIN ( + SELECT s."SupplierID" + FROM "Suppliers" AS s + WHERE @ef_filter__p6 OR NOT (s."IsDeleted") OR NOT (s."IsDeleted") + ) AS s0 ON p1."SupplierID" = s0."SupplierID" + LEFT JOIN ( + SELECT p2."ProductID", p2."CategoryID", p2."Discontinued", p2."IsDeleted", p2."ProductName", p2."QuantityPerUnit", p2."ReorderLevel", p2."SupplierID", p2."UnitPrice", p2."UnitsInStock", p2."UnitsOnOrder" + FROM "Products" AS p2 + WHERE @ef_filter__p0 OR NOT (p2."IsDeleted") OR NOT (p2."IsDeleted") + ) AS p3 ON s0."SupplierID" = p3."SupplierID" + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS s1 ON p."ProductID" = s1."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +ORDER BY p."ProductID", s1."OrderID0", s1."ProductID", s1."OrderID", s1."ProductID0", s1."SupplierID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."SupplierId", + m_1."ProductId", + d_1."IsDeleted", + d_1."ProductID", + d_1."ProductName", + d_1."SupplierID", + d_1."CategoryID", + d_1."QuantityPerUnit", + d_1."UnitPrice", + d_1."UnitsInStock", + d_1."UnitsOnOrder", + d_1."ReorderLevel", + d_1."Discontinued" +FROM + ( + SELECT DISTINCT + "a_Supplier"."SupplierID" as "SupplierId", + t1."ProductId" + FROM + ( + SELECT DISTINCT + e."ProductID" as "ProductId" + FROM + "Products" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."ProductId" = d."ProductID" + INNER JOIN "Orders" e_1 ON d."OrderID" = e_1."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + LEFT JOIN "Suppliers" "a_Supplier" ON "a_Product"."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" + WHERE + NOT e_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + ) m_1 + INNER JOIN "Products" d_1 ON m_1."SupplierId" = d_1."SupplierID" OR m_1."SupplierId" IS NULL AND d_1."SupplierID" IS NULL +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductID", + d."Discount", + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Supplier"."SupplierID" +FROM + "Products" m_1 + INNER JOIN "Order Details" d ON m_1."ProductID" = d."ProductID" + INNER JOIN "Orders" e ON d."OrderID" = e."OrderID" + LEFT JOIN "Suppliers" "a_Supplier" ON m_1."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" +WHERE + NOT m_1."IsDeleted" AND NOT e."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + p."ProductName", + p."ProductID" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..0847adcfc185 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.15,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", p1."ProductID", p1."CategoryID", p1."Discontinued", p1."IsDeleted", p1."ProductName", p1."QuantityPerUnit", p1."ReorderLevel", p1."SupplierID", p1."UnitPrice", p1."UnitsInStock", p1."UnitsOnOrder" +FROM "Products" AS p +CROSS JOIN ( + SELECT p0."ProductID", p0."CategoryID", p0."Discontinued", p0."IsDeleted", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Products" AS p0 + WHERE (@ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o0 + WHERE (@ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted")) AND p0."ProductID" = o0."ProductID") +) AS p1 +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o + WHERE (@ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted")) AND p."ProductID" = o."ProductID") AND p."ProductID" = p1."ProductID" +ORDER BY p."ProductID" + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued", + pd2."IsDeleted", + pd2."ProductID", + pd2."ProductName", + pd2."SupplierID", + pd2."CategoryID", + pd2."QuantityPerUnit", + pd2."UnitPrice", + pd2."UnitsInStock", + pd2."UnitsOnOrder", + pd2."ReorderLevel", + pd2."Discontinued" +FROM + "Products" e, + "Products" pd2 +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_2 + WHERE + pd2."ProductID" = e_2."ProductID" + ) > 0 AND + e."ProductID" = pd2."ProductID" +ORDER BY + e."ProductID" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..04ba1b8e5f72 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.15,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", p1."ProductID", p1."CategoryID", p1."Discontinued", p1."IsDeleted", p1."ProductName", p1."QuantityPerUnit", p1."ReorderLevel", p1."SupplierID", p1."UnitPrice", p1."UnitsInStock", p1."UnitsOnOrder" +FROM "Products" AS p +CROSS JOIN ( + SELECT p0."ProductID", p0."CategoryID", p0."Discontinued", p0."IsDeleted", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Products" AS p0 + WHERE (@ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o0 + WHERE (@ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted")) AND p0."ProductID" = o0."ProductID") +) AS p1 +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o + WHERE (@ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted")) AND p."ProductID" = o."ProductID") AND p."ProductID" = p1."ProductID" +ORDER BY p."ProductID" + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued", + pd2."IsDeleted", + pd2."ProductID", + pd2."ProductName", + pd2."SupplierID", + pd2."CategoryID", + pd2."QuantityPerUnit", + pd2."UnitPrice", + pd2."UnitsInStock", + pd2."UnitsOnOrder", + pd2."ReorderLevel", + pd2."Discontinued" +FROM + "Products" e, + "Products" pd2 +WHERE + NOT e."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + NOT pd2."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_2 + WHERE + NOT e_2."IsDeleted" AND pd2."ProductID" = e_2."ProductID" + ) > 0 AND + e."ProductID" = pd2."ProductID" +ORDER BY + e."ProductID" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..63067274c9cd --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.15,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" +FROM "Employees" AS e +WHERE (@ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted")) AND e."EmployeeID" = @test + + +-- PostgreSQL.15 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath" +FROM + "Employees" e +WHERE + e."EmployeeID" = :test + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..e531c3a24552 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.15,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" +FROM "Employees" AS e +WHERE (@ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted")) AND e."EmployeeID" = @test + + +-- PostgreSQL.15 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath" +FROM + "Employees" e +WHERE + NOT e."IsDeleted" AND e."EmployeeID" = :test + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..0990c71bdc5a --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.15,False).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."IsDeleted", c."Phone", c."PostalCode", c."Region" +FROM "Customers" AS c +WHERE @ef_filter__p0 OR NOT (c."IsDeleted") OR NOT (c."IsDeleted") +LIMIT 1 + + +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @CompanyName Varchar(34) -- String +SET @CompanyName = 'Ana Trujillo Emparedados y helados' +DECLARE @CustomerId Varchar(5) -- String +SET @CustomerId = 'ANATR' + +UPDATE + "Customers" +SET + "CompanyName" = :CompanyName +WHERE + "Customers"."CustomerID" = :CustomerId + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..521f1ad821a7 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.15,True).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."IsDeleted", c."Phone", c."PostalCode", c."Region" +FROM "Customers" AS c +WHERE @ef_filter__p0 OR NOT (c."IsDeleted") OR NOT (c."IsDeleted") +LIMIT 1 + + +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @CompanyName Varchar(19) -- String +SET @CompanyName = 'Alfreds Futterkiste' +DECLARE @CustomerId Varchar(5) -- String +SET @CustomerId = 'ALFKI' + +UPDATE + "Customers" +SET + "CompanyName" = :CompanyName +WHERE + NOT "Customers"."IsDeleted" AND "Customers"."CustomerID" = :CustomerId + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..3b29b573ef51 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.15,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."QuantityPerUnit" AS "Quantity" +FROM "Products" AS p +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."QuantityPerUnit" +FROM + "Products" p + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..4177f13c9745 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.15,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."QuantityPerUnit" AS "Quantity" +FROM "Products" AS p +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."QuantityPerUnit" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..a0724be4e659 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.15,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +/* Tagged query */ +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..0b77940afe8d --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.15,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +/* Tagged query */ +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" AND NOT "a_ReportsToNavigation"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..a649ec7ecf67 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.15,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..5c91aaf63e7e --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.15,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..336c14fe6c64 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.15,False).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT max(p."QuantityPerUnit") +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE 'U%' + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + MAX(e."QuantityPerUnit") +FROM + "Products" e +WHERE + e."ProductName" LIKE 'U%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL + +DELETE FROM + "Products" e +WHERE + e."ProductName" = 'a' + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..8371d15eb814 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.15,True).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT max(p."QuantityPerUnit") +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE 'U%' + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + MAX(e."QuantityPerUnit") +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE 'U%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL + +DELETE FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" = 'a' + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..4add18d4f9bc --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.15,False).sql @@ -0,0 +1,25 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..a791b8e5626d --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.15,True).sql @@ -0,0 +1,27 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" +WHERE + NOT p."IsDeleted" AND NOT c_1."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..4add18d4f9bc --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.15,False).sql @@ -0,0 +1,25 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..a791b8e5626d --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.15,True).sql @@ -0,0 +1,27 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" +WHERE + NOT p."IsDeleted" AND NOT c_1."IsDeleted" + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..c654b34b7aa4 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.15,False).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..c654b34b7aa4 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.15,True).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..38e8e3ad5e55 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.15,False).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..38e8e3ad5e55 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.15,True).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.15,False).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.15,False).sql new file mode 100644 index 000000000000..4cff1be3a285 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.15,False).sql @@ -0,0 +1,29 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' + + + diff --git a/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.15,True).sql b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.15,True).sql new file mode 100644 index 000000000000..293ad4e24147 --- /dev/null +++ b/PostgreSQL.15.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.15,True).sql @@ -0,0 +1,29 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.16).sql new file mode 100644 index 000000000000..4fcd588921f5 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.16).sql @@ -0,0 +1,164 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 1 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'bc7b663d-0fde-4327-8f92-5d8cc3a11d11'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C1' +DECLARE @Name Text(2) -- String +SET @Name = 'N1' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 2 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'a948600d-de21-4f74-8ac2-9516b287076e'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C2' +DECLARE @Name Text(2) -- String +SET @Name = 'N2' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 3 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'bd3973a5-4323-4dd8-9f4f-df9f93e2a627'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C3' +DECLARE @Name Text(2) -- String +SET @Name = 'N3' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +SELECT s."Id", s."Code", s."IsDeleted", s."Name", s."PermanentId" +FROM "Subdivisions" AS s +WHERE s."Id"::bigint = 1 + + +-- PostgreSQL.15 PostgreSQL + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id"::BigInt = 1 + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @id Bigint -- Int64 +SET @id = 1 + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id" = :id + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id" IN (2, 3) + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."PermanentId", + t1."Code", + t1."Name", + t1."IsDeleted" +FROM + "Subdivisions" t1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..f1084f10fea9 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.16).sql @@ -0,0 +1,10 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "Issue261Table" t1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..bb41027286ac --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.16).sql @@ -0,0 +1,43 @@ +Parameters: +@p0='?' (DbType = Object), @p1='?', @p2='?' (DbType = Object), @p3='?' (DbType = Object), @p4='?', @p5='?' (DbType = Object), @p6='?' (DbType = Object), @p7='?', @p8='?' (DbType = Object) + +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p0, @p1, @p2) +RETURNING "Id"; +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p3, @p4, @p5) +RETURNING "Id"; +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p6, @p7, @p8) +RETURNING "Id"; + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +INSERT INTO "Issue4783DBRecords" +( + "Source", + "Status", + "NullableStatus" +) +VALUES +('linq2db','open'::issue4783db_status,'open'::issue4783db_status), +('linq2db','closed'::issue4783db_status,'closed'::issue4783db_status), +('linq2db','closed'::issue4783db_status,NULL) + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4783DBRecords" t1 +ORDER BY + t1."Id" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..897eb5cfa288 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.16).sql @@ -0,0 +1,10 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name" +FROM + "Issue4917DBRecords" t1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..f6df37c54ab6 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test(PostgreSQL.16).sql @@ -0,0 +1,161 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE issue_4940_temp_table +( + "Id" integer NOT NULL, + "Source" text NOT NULL, + "Status" issue4940db_status NOT NULL, + "NullableStatus" issue4940db_status NULL +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +INSERT INTO issue_4940_temp_table +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +(1,'TempTable','open'::issue4940db_status,'closed'::issue4940db_status), +(2,'TempTable','closed'::issue4940db_status,NULL) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 1 +DECLARE @Source Text(6) -- String +SET @Source = 'Insert' +DECLARE @Status Enum -- Object +SET @Status = 'open'::issue4940db_status +DECLARE @NullableStatus Enum -- Object +SET @NullableStatus = 'closed'::issue4940db_status + +INSERT INTO "Issue4940DBRecords" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + :Id, + :Source, + :Status, + :NullableStatus +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 2 +DECLARE @Source Text(6) -- String +SET @Source = 'Insert' +DECLARE @Status Enum -- Object +SET @Status = 'closed'::issue4940db_status +DECLARE @NullableStatus Unknown -- Object +SET @NullableStatus = NULL + +INSERT INTO "Issue4940DBRecords" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + :Id, + :Source, + :Status, + :NullableStatus +) + + + +INSERT BULK "Issue4940DBRecords"(Id, Source, Status, NullableStatus) + + + +-- PostgreSQL.15 PostgreSQL + +MERGE INTO "Issue4940DBRecords" "Target" +USING (VALUES + ('Merge',5,'open'::issue4940db_status,'open'::issue4940db_status), + ('Merge',6,'open'::issue4940db_status,NULL) +) "Source" +( + "Source", + "Id", + "Status", + "NullableStatus" +) +ON ("Target"."Source" = "Source"."Source") + +WHEN NOT MATCHED THEN +INSERT +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + "Source"."Id", + "Source"."Source", + "Source"."Status", + "Source"."NullableStatus" +) + +WHEN MATCHED THEN +UPDATE +SET + "Id" = "Source"."Id", + "Source" = "Source"."Source", + "Status" = "Source"."Status", + "NullableStatus" = "Source"."NullableStatus" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4940DBRecords" t1 +ORDER BY + t1."Id" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + issue_4940_temp_table t1 +ORDER BY + t1."Id" + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS issue_4940_temp_table + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test_NotMapped(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test_NotMapped(PostgreSQL.16).sql new file mode 100644 index 000000000000..6bd53455985e --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test_NotMapped(PostgreSQL.16).sql @@ -0,0 +1,120 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "Issue4940RecordNotMapped" +( + "Id" Int NOT NULL, + "Source" text NULL, + "Status" issue4940db_status NOT NULL, + "NullableStatus" issue4940db_status NULL +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +INSERT INTO "Issue4940RecordNotMapped" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +(1,'TempTable','open'::issue4940db_status,'open'::issue4940db_status), +(2,'TempTable','closed'::issue4940db_status,NULL) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 3 +DECLARE @Source Text(6) -- String +SET @Source = 'Insert' +DECLARE @Status Enum -- Object +SET @Status = 'open'::issue4940db_status +DECLARE @NullableStatus Unknown -- Object +SET @NullableStatus = NULL + +INSERT INTO "Issue4940RecordNotMapped" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + :Id, + :Source, + :Status, + :NullableStatus +) + + + +INSERT BULK "Issue4940RecordNotMapped"(Id, Source, Status, NullableStatus) + + + +-- PostgreSQL.15 PostgreSQL + +MERGE INTO "Issue4940RecordNotMapped" "Target" +USING (VALUES + ('Merge',6,'open'::issue4940db_status,'closed'::issue4940db_status), + ('Merge',7,'open'::issue4940db_status,NULL) +) "Source" +( + "Source", + "Id", + "Status", + "NullableStatus" +) +ON ("Target"."Source" = "Source"."Source" OR "Target"."Source" IS NULL AND "Source"."Source" IS NULL) + +WHEN NOT MATCHED THEN +INSERT +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + "Source"."Id", + "Source"."Source", + "Source"."Status", + "Source"."NullableStatus" +) + +WHEN MATCHED THEN +UPDATE +SET + "Id" = "Source"."Id", + "Source" = "Source"."Source", + "Status" = "Source"."Status", + "NullableStatus" = "Source"."NullableStatus" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4940RecordNotMapped" t1 +ORDER BY + t1."Id" + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "Issue4940RecordNotMapped" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.16).sql new file mode 100644 index 000000000000..51c3d7adada3 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.16).sql @@ -0,0 +1,5 @@ +SELECT w."Id", w."Value" +FROM "WithDuplicateProperties" AS w +WHERE w."Value" = 1 + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.16).sql new file mode 100644 index 000000000000..784356a58fff --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.16).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +INSERT INTO "NoIdentity" +( + "Id", + "Name" +) +VALUES +('bc7b663d-0fde-4327-8f92-5d8cc3a11d11'::uuid,'John Doe'), +('a948600d-de21-4f74-8ac2-9516b287076e'::uuid,'Jane Doe') + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.16).sql new file mode 100644 index 000000000000..33cc2a28335a --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.16).sql @@ -0,0 +1,32 @@ +Parameters: +@p0='?', @p1='?', @p2='?', @p3='?', @p4='?' + +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p0) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p1) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p2) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p3) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p4) +RETURNING "Id"; + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Discriminator", + t1."Id" +FROM + "WithInheritance" t1 +WHERE + t1."Discriminator" IN ('WithInheritanceA2', 'WithInheritanceA1', 'WithInheritanceA') + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.16).sql new file mode 100644 index 000000000000..7595bb53108a --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.16).sql @@ -0,0 +1,33 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +INSERT ASYNC BULK "NoIdentity"(Id, Name) + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.16).sql new file mode 100644 index 000000000000..39a4028e0d5e --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.16).sql @@ -0,0 +1,33 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +INSERT BULK "NoIdentity"(Id, Name) + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.16).sql new file mode 100644 index 000000000000..0e82f5a61940 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.16).sql @@ -0,0 +1,76 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +INSERT INTO "SkipModes" ("Id", "InsertOnly") +VALUES (@p0, @p1); + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 2 +DECLARE @InsertOnly Integer -- Int32 +SET @InsertOnly = 2 + +INSERT INTO "SkipModes" +( + "Id", + "InsertOnly" +) +VALUES +( + :Id, + :InsertOnly +) + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."InsertOnly", + t1."UpdateOnly", + t1."ReadOnly" +FROM + "SkipModes" t1 +ORDER BY + t1."Id" + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +UPDATE "SkipModes" SET "UpdateOnly" = @p0 +WHERE "Id" = @p1; + + +-- PostgreSQL.15 PostgreSQL +DECLARE @UpdateOnly Integer -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id Integer -- Int32 +SET @Id = 2 + +UPDATE + "SkipModes" +SET + "UpdateOnly" = :UpdateOnly +WHERE + "SkipModes"."Id" = :Id + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."InsertOnly", + t1."UpdateOnly", + t1."ReadOnly" +FROM + "SkipModes" t1 +ORDER BY + t1."Id" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.16).sql new file mode 100644 index 000000000000..ddd5304821a7 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.16).sql @@ -0,0 +1,38 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "WithIdentity" +( + "Id" integer NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_WithIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "WithIdentity" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.16).sql new file mode 100644 index 000000000000..6b7704deafe1 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.16).sql @@ -0,0 +1,28 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int64), @p3='?' (DbType = Int64), @p4='?' (DbType = Decimal), @p5='?' (DbType = Decimal) + +INSERT INTO "UIntTable" ("Field16", "Field16N", "Field32", "Field32N", "Field64", "Field64N") +VALUES (@p0, @p1, @p2, @p3, @p4, @p5) +RETURNING "ID"; + + +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @field64 Numeric(1, 0) -- Decimal +SET @field64 = 5 + +SELECT + e."ID", + e."Field16", + e."Field32", + e."Field64", + e."Field16N", + e."Field32N", + e."Field64N" +FROM + "UIntTable" e +WHERE + e."Field64" = :field64 +LIMIT 1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.16,False,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.16,False,False).sql new file mode 100644 index 000000000000..4fadd949b642 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.16,False,False).sql @@ -0,0 +1,12 @@ +SELECT e.id, e.name, s0.id, s0.master_id, s0.name, s0.id0, s0.master_id0, s0.name0, c.id, c.name, c.parent_id +FROM entities AS e +LEFT JOIN ( + SELECT d.id, d.master_id, d.name, s.id AS id0, s.master_id AS master_id0, s.name AS name0 + FROM details AS d + LEFT JOIN sub_details AS s ON d.id = s.master_id +) AS s0 ON e.id = s0.master_id +LEFT JOIN children AS c ON e.id = c.parent_id +WHERE e.name = 'Alpha' +ORDER BY e.id, s0.id, s0.id0 + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.16,False,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.16,False,True).sql new file mode 100644 index 000000000000..4fadd949b642 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.16,False,True).sql @@ -0,0 +1,12 @@ +SELECT e.id, e.name, s0.id, s0.master_id, s0.name, s0.id0, s0.master_id0, s0.name0, c.id, c.name, c.parent_id +FROM entities AS e +LEFT JOIN ( + SELECT d.id, d.master_id, d.name, s.id AS id0, s.master_id AS master_id0, s.name AS name0 + FROM details AS d + LEFT JOIN sub_details AS s ON d.id = s.master_id +) AS s0 ON e.id = s0.master_id +LEFT JOIN children AS c ON e.id = c.parent_id +WHERE e.name = 'Alpha' +ORDER BY e.id, s0.id, s0.id0 + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.16,True,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.16,True,False).sql new file mode 100644 index 000000000000..a7b4bb1ff42f --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.16,True,False).sql @@ -0,0 +1,76 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Id", + m_1."Id_1", + d_1.id, + d_1.master_id, + d_1.name +FROM + ( + SELECT DISTINCT + d.id as "Id", + t1."Id" as "Id_1" + FROM + ( + SELECT DISTINCT + e.id as "Id" + FROM + entities e + WHERE + e.name = 'Alpha' + ) t1 + INNER JOIN details d ON t1."Id" = d.master_id + ) m_1 + INNER JOIN sub_details d_1 ON m_1."Id" = d_1.master_id + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.id, + d.master_id, + d.name +FROM + entities m_1 + INNER JOIN details d ON m_1.id = d.master_id +WHERE + m_1.name = 'Alpha' + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.id, + d.parent_id, + d.name +FROM + entities m_1 + INNER JOIN children d ON m_1.id = d.parent_id +WHERE + m_1.name = 'Alpha' + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e.id, + e.name +FROM + entities e +WHERE + e.name = 'Alpha' + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.16,True,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.16,True,True).sql new file mode 100644 index 000000000000..a7b4bb1ff42f --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.16,True,True).sql @@ -0,0 +1,76 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Id", + m_1."Id_1", + d_1.id, + d_1.master_id, + d_1.name +FROM + ( + SELECT DISTINCT + d.id as "Id", + t1."Id" as "Id_1" + FROM + ( + SELECT DISTINCT + e.id as "Id" + FROM + entities e + WHERE + e.name = 'Alpha' + ) t1 + INNER JOIN details d ON t1."Id" = d.master_id + ) m_1 + INNER JOIN sub_details d_1 ON m_1."Id" = d_1.master_id + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.id, + d.master_id, + d.name +FROM + entities m_1 + INNER JOIN details d ON m_1.id = d.master_id +WHERE + m_1.name = 'Alpha' + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.id, + d.parent_id, + d.name +FROM + entities m_1 + INNER JOIN children d ON m_1.id = d.parent_id +WHERE + m_1.name = 'Alpha' + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e.id, + e.name +FROM + entities e +WHERE + e.name = 'Alpha' + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.16).sql new file mode 100644 index 000000000000..1f665e79775c --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.16).sql @@ -0,0 +1,13 @@ +Parameters: +@p0='test insert ef' (Nullable = false) + +INSERT INTO entities (name) +VALUES (@p0) +RETURNING id; + + +SELECT e.id, e.name +FROM entities AS e +LIMIT 2 + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.16).sql new file mode 100644 index 000000000000..ce1197584240 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.16).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @name Text(11) -- String +SET @name = 'test insert' + +INSERT INTO entities +( + name +) +VALUES +( + :name +) +RETURNING + id + + + +Parameters: +@id='50' + +SELECT e.id, e.name +FROM entities AS e +WHERE e.id::bigint = @id +LIMIT 2 + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.16,False,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.16,False,True).sql new file mode 100644 index 000000000000..803b4f11e467 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.16,False,True).sql @@ -0,0 +1,10 @@ +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.16,True,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.16,True,False).sql new file mode 100644 index 000000000000..64a4d6beef99 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.16,True,False).sql @@ -0,0 +1,31 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.16,True,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.16,True,True).sql new file mode 100644 index 000000000000..64a4d6beef99 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.16,True,True).sql @@ -0,0 +1,31 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..28ad2b078f61 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.16,False).sql @@ -0,0 +1,41 @@ +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..3ca3ee146fbb --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.16,True).sql @@ -0,0 +1,41 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.16,False,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.16,False,True).sql new file mode 100644 index 000000000000..8d38ce10d713 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.16,False,True).sql @@ -0,0 +1,5 @@ +SELECT d.id, d.master_id, d.name, e.id, e.name +FROM details AS d +INNER JOIN entities AS e ON d.master_id = e.id + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.16,True,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.16,True,False).sql new file mode 100644 index 000000000000..5907ebd3fc01 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.16,True,False).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.16,True,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.16,True,True).sql new file mode 100644 index 000000000000..5907ebd3fc01 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.16,True,True).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.16,False,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.16,False,True).sql new file mode 100644 index 000000000000..8d38ce10d713 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.16,False,True).sql @@ -0,0 +1,5 @@ +SELECT d.id, d.master_id, d.name, e.id, e.name +FROM details AS d +INNER JOIN entities AS e ON d.master_id = e.id + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.16,True,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.16,True,True).sql new file mode 100644 index 000000000000..5907ebd3fc01 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.16,True,True).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.16,Default).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.16,Default).sql new file mode 100644 index 000000000000..71ae5334d03f --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.16,Default).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.16,MultipleRows).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.16,MultipleRows).sql new file mode 100644 index 000000000000..71ae5334d03f --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.16,MultipleRows).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.16,ProviderSpecific).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.16,ProviderSpecific).sql new file mode 100644 index 000000000000..71ae5334d03f --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.16,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.16,RowByRow).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.16,RowByRow).sql new file mode 100644 index 000000000000..71ae5334d03f --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.16,RowByRow).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.16).sql new file mode 100644 index 000000000000..adeb323d784c --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.16).sql @@ -0,0 +1,10 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @p='?' (DbType = Int32) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductID" > 0 +ORDER BY p."ProductID" +LIMIT @p + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.16).sql new file mode 100644 index 000000000000..3b44a93907dd --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.16).sql @@ -0,0 +1,52 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.16).sql new file mode 100644 index 000000000000..28476ddd63c9 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.16).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.16).sql new file mode 100644 index 000000000000..28476ddd63c9 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.16).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.16).sql new file mode 100644 index 000000000000..b7e831126fbf --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.16).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id" +FROM + "Patents" t1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..f9618badbc13 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.16).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT p."Id" AS "PatentId", @userId0 AS "UserId" +FROM "Patents" AS p +LEFT JOIN "PatentAssessment" AS p0 ON p."Id" = p0."PatentId" +WHERE p0."PatentId" IS NULL OR p0."TechnicalReviewerId" <> @userId OR p0."TechnicalReviewerId" IS NULL + + +-- PostgreSQL.15 PostgreSQL +DECLARE @userId Integer -- Int32 +SET @userId = 1 + +SELECT + p."Id" +FROM + "Patents" p + LEFT JOIN "PatentAssessment" "a_Assessment" ON p."Id" = "a_Assessment"."PatentId" +WHERE + "a_Assessment"."PatentId" IS NULL OR "a_Assessment"."TechnicalReviewerId" <> :userId OR + "a_Assessment"."TechnicalReviewerId" IS NULL + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..34c99bd03604 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.16).sql @@ -0,0 +1,21 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."Id", + e."Linked", + ( + SELECT + ARRAY_AGG(DISTINCT r."Id") + FROM + "Issue155Table" r + WHERE + e."Id" = ANY(r."Linked") + ) +FROM + "Issue155Table" e +WHERE + e."Id" = 1 +LIMIT 2 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.16).sql new file mode 100644 index 000000000000..e4044c4b1d3d --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.16).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + COUNT(*) +FROM + "Parents" x +WHERE + ( + SELECT + "a_Children"."IsActive" + FROM + "Children" "a_Children" + WHERE + x."Id" = "a_Children"."ParentId" + LIMIT 1 + ) = False + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.16).sql new file mode 100644 index 000000000000..1c50903f9c81 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.16).sql @@ -0,0 +1,18 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + COUNT(*) +FROM + "Parents" x +WHERE + NOT EXISTS( + SELECT + * + FROM + "Children" y + WHERE + x."Id" = y."ParentId" AND y."IsActive" + ) + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..b7e831126fbf --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.16).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id" +FROM + "Patents" t1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..475577c27094 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.16).sql @@ -0,0 +1,11 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id" +FROM + "Issue340Entities" x +WHERE + x."IsActive" = True + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..1d1e37e9f7a9 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.16).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.15 PostgreSQL + +UPDATE + "PostgreTestTable" +SET + ("Title", "SearchVector") = ( + SELECT + "PostgreTestTable"."Title", + to_tsvector('test') + FROM + "PostgreTestTable" x + WHERE + "PostgreTestTable"."Id" = x."Id" + ) +WHERE + "PostgreTestTable"."Id" = 1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..13e7894d0f20 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.16).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + 1 +FROM + "Parents" ua +WHERE + ua."ParentId" = 55377 AND EXISTS( + SELECT + * + FROM + "Parents" t1 + ) + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.16).sql new file mode 100644 index 000000000000..2deaab506768 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.16).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @DateTimeOffset TimestampTz -- DateTime +SET @DateTimeOffset = '2020-02-29T17:54:55.1231234+00:00' +DECLARE @DateTimeOffsetN TimestampTz -- DateTime +SET @DateTimeOffsetN = '2020-02-29T17:54:55.1231234+00:00' + +UPDATE + "Types" +SET + "DateTimeOffset" = :DateTimeOffset, + "DateTimeOffsetN" = :DateTimeOffsetN +WHERE + "Types"."Id" = 2 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.16).sql new file mode 100644 index 000000000000..27280032538f --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.16).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @DateTimeOffsetWithConverter Bigint -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter Bigint -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + "Types" +SET + "DateTimeOffsetWithConverter" = :DateTimeOffsetWithConverter, + "DateTimeOffsetNWithConverter" = :DateTimeOffsetNWithConverter +WHERE + "Types"."Id" = 2 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.16).sql new file mode 100644 index 000000000000..de0253d7f486 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.16).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Id", + d_1."Key_1", + d_1."SUM_1", + d_1."Issue4626AnyValue" +FROM + "Parents" m_1 + INNER JOIN LATERAL ( + SELECT + d."ParentId" as "Key_1", + SUM(d."Id") as "SUM_1", + ANY_VALUE(d."Name") as "Issue4626AnyValue" + FROM + "Children" d + WHERE + m_1."Id" = d."ParentId" + GROUP BY + d."ParentId" + ) d_1 ON 1=1 + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + c_1."Id" +FROM + "Parents" c_1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.16).sql new file mode 100644 index 000000000000..bc43196a3204 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.16).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Id", + d_1."Key_1", + d_1."SUM_1", + d_1."ToValue" +FROM + "Parents" m_1 + INNER JOIN LATERAL ( + SELECT + d."ParentId" as "Key_1", + SUM(d."Id") as "SUM_1", + STRING_AGG(d."Name", ', ') as "ToValue" + FROM + "Children" d + WHERE + m_1."Id" = d."ParentId" + GROUP BY + d."ParentId" + ) d_1 ON 1=1 + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + c_1."Id" +FROM + "Parents" c_1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..d0307a15be51 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.16).sql @@ -0,0 +1,36 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + id."Id" +FROM + ( + SELECT + p."Id" + FROM + "Issue4629Posts" p + WHERE + ( + SELECT + SUM("a_Tags"."Weight") + FROM + "Issue4629Tags" "a_Tags" + WHERE + p."Id" = "a_Tags"."PostId" AND "a_Tags"."Weight" > 1 + ) > 5 + ORDER BY + ( + SELECT + SUM("a_Tags_1"."Weight") + FROM + "Issue4629Tags" "a_Tags_1" + WHERE + p."Id" = "a_Tags_1"."PostId" + ) + LIMIT :take + ) id + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..d5c80521cd2d --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.16).sql @@ -0,0 +1,20 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @id Integer -- Int32 +SET @id = 2 + +SELECT + t1."Index_1" +FROM + ( + SELECT + x."Id", + ROW_NUMBER() OVER(ORDER BY x."Id") as "Index_1" + FROM + "Parents" x + ) t1 +WHERE + t1."Id" = :id +LIMIT 1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..fae98f1d22cb --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.16).sql @@ -0,0 +1,40 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Key_1", + d."CfAllowValue", + d."DateFrom" +FROM + ( + SELECT + p."AclNameId" as "Key_1" + FROM + "Issue4624Items" p + GROUP BY + p."AclNameId" + LIMIT 1 + ) m_1 + INNER JOIN "Issue4624Items" d ON m_1."Key_1" = d."AclNameId" +ORDER BY + d."DateFrom" + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."AclNameId" +FROM + "Issue4624Items" p +GROUP BY + p."AclNameId" +LIMIT 1 + + + +DisposeTransaction + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..a3153abcbb60 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.16).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id" +FROM + "Masters" t1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4667Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4667Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..3fa0695edb2e --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4667Test(PostgreSQL.16).sql @@ -0,0 +1,31 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @value Json -- Object +SET @value = {[property, value]} + +MERGE INTO "Issue4667" "Target" +USING (VALUES + (1,'{"test" : 1}'::jsonb,:value::json) +) "Source" +( + "Id", + "Payload", + "Headers" +) +ON ("Target".id = "Source"."Id") + +WHEN NOT MATCHED THEN +INSERT +( + id, + payload, + headers +) +VALUES +( + "Source"."Id", + "Source"."Payload", + "Source"."Headers" +) + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..42990f4614dc --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.16).sql @@ -0,0 +1,21 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + x."Id", + x."IsActive", + x."ParentId", + x."Name" +FROM + "Children" x +WHERE + x."Name" LIKE '%Test%' ESCAPE '~' +ORDER BY + x."Name" + + + +SELECT c."Id", c."IsActive", c."Name", c."ParentId" +FROM "Children" AS c +WHERE c."Name" LIKE 'Test%' + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..93e342b64ae0 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.16,False).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..93e342b64ae0 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.16,True).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..93e342b64ae0 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.16,False).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..93e342b64ae0 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.16,True).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.16).sql new file mode 100644 index 000000000000..62531c28ad48 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.16).sql @@ -0,0 +1,18 @@ +SELECT COALESCE(i0."Name", '') || '>' || i."Name" +FROM "Issue73Entities" AS i +LEFT JOIN "Issue73Entities" AS i0 ON i."ParentId" = i0."Id" +WHERE i."Name" = 'Name1_3' + + +-- PostgreSQL.15 PostgreSQL + +SELECT + "a_Parent"."Name" || '>' || x."Name" +FROM + "Issue73Entities" x + LEFT JOIN "Issue73Entities" "a_Parent" ON x."ParentId" = "a_Parent"."Id" +WHERE + x."Name" = 'Name1_3' + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.16).sql new file mode 100644 index 000000000000..9f6fdc246f26 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.16).sql @@ -0,0 +1,30 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32) + +INSERT INTO "IssueEnum" ("Value") +VALUES (@p0) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p1) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p2) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p3) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p4) +RETURNING "Id"; + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Value" +FROM + "IssueEnum" t1 + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.16).sql new file mode 100644 index 000000000000..dea9fca0781b --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.16).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @guids -2147483621 -- Object +SET @guids = {'271425b1-ebe8-400d-b71d-a6e47a460ae3'::uuid,'b75de94e-6d7b-4c70-bfa1-f8639a6a5b35'::uuid} + +SELECT + m_1."Id", + m_1."Guids" +FROM + "EntityWithArrays" m_1 +WHERE + m_1."Guids" && :guids + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.16).sql new file mode 100644 index 000000000000..7c2264341440 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.16).sql @@ -0,0 +1,20 @@ +-- PostgreSQL.15 PostgreSQL + +INSERT INTO "EntityWithXmin" +( + "Value" +) +VALUES +('Str1'), +('Str2'), +('Str3'), +('Str4'), +('Str5'), +('Str6'), +('Str7'), +('Str8'), +('Str9'), +('Str10') + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.16,Local).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.16,Local).sql new file mode 100644 index 000000000000..1d7992d38759 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.16,Local).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.16,Unspecified).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.16,Unspecified).sql new file mode 100644 index 000000000000..1d7992d38759 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.16,Unspecified).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.16,Utc).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.16,Utc).sql new file mode 100644 index 000000000000..1d7992d38759 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.16,Utc).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.16).sql new file mode 100644 index 000000000000..7512830f1412 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.16).sql @@ -0,0 +1,27 @@ +Parameters: +@date='?' (DbType = DateTime2) + +SELECT e."Id", e."Duration", e."Name" +FROM "Events" AS e +WHERE e."Duration" @> @date OR lower(e."Duration") = @date OR upper(e."Duration") = @date OR isempty(e."Duration") OR isempty(e."Duration" * e."Duration") + + +-- PostgreSQL.15 PostgreSQL +DECLARE @date Timestamp -- DateTime2 +SET @date = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Name", + e."Duration" +FROM + "Events" e +WHERE + e."Duration" @> :date OR + lower(e."Duration") = :date OR + upper(e."Duration") = :date OR + isempty(e."Duration") OR + isempty(e."Duration" * e."Duration") + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.16).sql new file mode 100644 index 000000000000..a270b408fa11 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.16).sql @@ -0,0 +1,15 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @guids -2147483621 -- Object +SET @guids = {'271425b1-ebe8-400d-b71d-a6e47a460ae3'::uuid,'b75de94e-6d7b-4c70-bfa1-f8639a6a5b35'::uuid} + +SELECT + m_1."Id", + m_1."Guids" +FROM + "EntityWithArrays" m_1 + INNER JOIN LATERAL UNNEST(m_1."Guids") g_1(value) ON 1=1 +WHERE + m_1."Guids" && :guids + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.16).sql new file mode 100644 index 000000000000..62ac6f949779 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.16).sql @@ -0,0 +1,16 @@ +SELECT e."Name" +FROM views."EventsView" AS e +WHERE e."Name" LIKE 'any%' + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."Name" +FROM + views."EventsView" e +WHERE + e."Name" LIKE 'any%' ESCAPE '~' + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.16).sql new file mode 100644 index 000000000000..8024b0b4b5bc --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.16).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" IS NOT NULL + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.16).sql new file mode 100644 index 000000000000..7e920fba7c61 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.16).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" LIKE '%anything%' ESCAPE '~' + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.16).sql new file mode 100644 index 000000000000..4b8dfe4a71d4 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.16).sql @@ -0,0 +1,24 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @value Varchar(10) -- String +SET @value = '%anything%' + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" LIKE :value ESCAPE '~' + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.16).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.16).sql new file mode 100644 index 000000000000..9ad91620744d --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.16).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o1."OrderID", o1."ProductID", p0."ProductID", o3."OrderId", o3."ProductId", o3."Quantity", o1."Quantity", p0."ProductName" +FROM "Orders" AS o +INNER JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Quantity" + FROM "Order Details" AS o0 + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS o1 ON o."OrderID" = o1."OrderID" +INNER JOIN ( + SELECT p."ProductID", p."ProductName" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +) AS p0 ON o1."ProductID" = p0."ProductID" +LEFT JOIN ( + SELECT o2."OrderID" AS "OrderId", o2."ProductID" AS "ProductId", o2."Quantity" + FROM "Order Details" AS o2 + WHERE @ef_filter__p2 OR NOT (o2."IsDeleted") OR NOT (o2."IsDeleted") +) AS o3 ON p0."ProductID" = o3."ProductId" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", o1."OrderID", o1."ProductID", p0."ProductID", o3."OrderId" + + +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."ProductId", + d."OrderID", + d."ProductID", + d."Quantity" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId" + FROM + "Orders" e + INNER JOIN "Order Details" od ON e."OrderID" = od."OrderID" + INNER JOIN "Products" "a_Product" ON od."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d ON m_1."ProductId" = d."ProductID" + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + "a_Product"."ProductID", + od."OrderID", + od."ProductID", + od."Quantity", + "a_Product"."ProductName" +FROM + "Orders" o + INNER JOIN "Order Details" od ON o."OrderID" = od."OrderID" + INNER JOIN "Products" "a_Product" ON od."ProductID" = "a_Product"."ProductID" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..9ad2c05355c0 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.16,False).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS p + WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%') + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + "Products" e + WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..0dde33fef5a9 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.16,True).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS p + WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%') + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + "Products" e + WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..80ff17482e05 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.16,False).sql @@ -0,0 +1,17 @@ +-- PostgreSQL.15 PostgreSQL + +DELETE FROM + "Products" e +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' AND e."ProductName" = 'a' + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..4e79bf65b6bb --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.16,True).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.15 PostgreSQL + +DELETE FROM + "Products" e +WHERE + NOT e."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' AND + e."ProductName" = 'a' + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..ad8a19493cc0 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.16,False).sql @@ -0,0 +1,94 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2; + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..afa60754b4a3 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.16,True).sql @@ -0,0 +1,105 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2; + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..86efccdbd1df --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.16,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..9657ac2e8836 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.16,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..86efccdbd1df --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.16,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..9657ac2e8836 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.16,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..1322e477c4ed --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.16,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder", s."OrderID0", s."ProductID1", s."Discount0", s."IsDeleted1", s."Quantity0", s."UnitPrice1" +FROM "Orders" AS o +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder", o2."OrderID" AS "OrderID0", o2."ProductID" AS "ProductID1", o2."Discount" AS "Discount0", o2."IsDeleted" AS "IsDeleted1", o2."Quantity" AS "Quantity0", o2."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + LEFT JOIN ( + SELECT o1."OrderID", o1."ProductID", o1."Discount", o1."IsDeleted", o1."Quantity", o1."UnitPrice" + FROM "Order Details" AS o1 + WHERE @ef_filter__p2 OR NOT (o1."IsDeleted") OR NOT (o1."IsDeleted") + ) AS o2 ON p0."ProductID" = o2."ProductID" + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", s."OrderID", s."ProductID", s."ProductID0", s."OrderID0" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..fd750acbf799 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.16,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder", s."OrderID0", s."ProductID1", s."Discount0", s."IsDeleted1", s."Quantity0", s."UnitPrice1" +FROM "Orders" AS o +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder", o2."OrderID" AS "OrderID0", o2."ProductID" AS "ProductID1", o2."Discount" AS "Discount0", o2."IsDeleted" AS "IsDeleted1", o2."Quantity" AS "Quantity0", o2."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + LEFT JOIN ( + SELECT o1."OrderID", o1."ProductID", o1."Discount", o1."IsDeleted", o1."Quantity", o1."UnitPrice" + FROM "Order Details" AS o1 + WHERE @ef_filter__p2 OR NOT (o1."IsDeleted") OR NOT (o1."IsDeleted") + ) AS o2 ON p0."ProductID" = o2."ProductID" + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", s."OrderID", s."ProductID", s."ProductID0", s."OrderID0" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..fe5c59d3b2ca --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.16,False).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e + LEFT JOIN "Products" op ON op."ProductID" <> e."ProductID" AND op."ProductName" = e."ProductName" +WHERE + op."ProductID" IS NULL + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..926343941e78 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.16,True).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e + LEFT JOIN "Products" op ON op."ProductID" <> e."ProductID" AND op."ProductName" = e."ProductName" AND NOT op."IsDeleted" +WHERE + NOT e."IsDeleted" AND op."ProductID" IS NULL + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..154ab410fc4a --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.16,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", o."OrderID", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + e_1."IsDeleted", + e_1."TerritoryID", + e_1."TerritoryDescription", + e_1."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" e_1 ON d."TerritoryID" = e_1."TerritoryID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + e_1."IsDeleted", + e_1."ProductID", + e_1."ProductName", + e_1."SupplierID", + e_1."CategoryID", + e_1."QuantityPerUnit", + e_1."UnitPrice", + e_1."UnitsInStock", + e_1."UnitsOnOrder", + e_1."ReorderLevel", + e_1."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" e_1 ON d."ProductID" = e_1."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath", + o."OrderID" +FROM + "Orders" o + LEFT JOIN "Employees" "a_Employee" ON o."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..1385bd04a775 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.16,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", o."OrderID", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + e_1."IsDeleted", + e_1."TerritoryID", + e_1."TerritoryDescription", + e_1."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" e_1 ON d."TerritoryID" = e_1."TerritoryID" +WHERE + NOT e_1."IsDeleted" AND NOT d."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + e_1."IsDeleted", + e_1."ProductID", + e_1."ProductName", + e_1."SupplierID", + e_1."CategoryID", + e_1."QuantityPerUnit", + e_1."UnitPrice", + e_1."UnitsInStock", + e_1."UnitsOnOrder", + e_1."ReorderLevel", + e_1."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" e_1 ON d."ProductID" = e_1."ProductID" +WHERE + NOT e_1."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath", + o."OrderID" +FROM + "Orders" o + LEFT JOIN "Employees" "a_Employee" ON o."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT o."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..70b3fe349991 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.16,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..d799f0c8ee68 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.16,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" AND NOT "a_ReportsToNavigation"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..e045c824756e --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.16,False).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."City" IS NOT NULL + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..9dd8b5452a5b --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.16,True).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + NOT e."IsDeleted" AND e."City" IS NOT NULL + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..011e49fdd3d9 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.16,False).sql @@ -0,0 +1,70 @@ +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" +FROM "Products" AS p +INNER JOIN "Order Details" AS o ON p."ProductID" = o."ProductID" + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice" +FROM "Products" AS p +INNER JOIN ( + SELECT o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" + FROM "Order Details" AS o + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS o0 ON p."ProductID" = o0."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..88e51fccdd4b --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.16,True).sql @@ -0,0 +1,74 @@ +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" +FROM "Products" AS p +INNER JOIN "Order Details" AS o ON p."ProductID" = o."ProductID" + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" +WHERE + NOT d."IsDeleted" + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice" +FROM "Products" AS p +INNER JOIN ( + SELECT o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" + FROM "Order Details" AS o + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS o0 ON p."ProductID" = o0."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" +WHERE + NOT p."IsDeleted" AND NOT d."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..869719113c9a --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.16,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + "a_Territory"."IsDeleted", + "a_Territory"."TerritoryID", + "a_Territory"."TerritoryDescription", + "a_Territory"."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" "a_Territory" ON d."TerritoryID" = "a_Territory"."TerritoryID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..3003bc050257 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.16,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + "a_Territory"."IsDeleted", + "a_Territory"."TerritoryID", + "a_Territory"."TerritoryDescription", + "a_Territory"."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" "a_Territory" ON d."TerritoryID" = "a_Territory"."TerritoryID" +WHERE + NOT "a_Territory"."IsDeleted" AND NOT d."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..e49ae0c5940b --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.16,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", e2."EmployeeID", e2."TerritoryID", e2."IsDeleted", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted" + FROM "EmployeeTerritories" AS e1 + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS e2 ON e0."EmployeeID" = e2."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p8 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", e2."EmployeeID", e2."TerritoryID", s."OrderID", s."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..a3094071b928 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.16,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", e2."EmployeeID", e2."TerritoryID", e2."IsDeleted", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted" + FROM "EmployeeTerritories" AS e1 + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS e2 ON e0."EmployeeID" = e2."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p8 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", e2."EmployeeID", e2."TerritoryID", s."OrderID", s."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" +WHERE + NOT d."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..5eda4221dfa9 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.16,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductName", p."ProductID", s1."Discount", s1."OrderID", s1."CustomerID", s1."EmployeeID", s1."Freight", s1."IsDeleted", s1."OrderDate", s1."RequiredDate", s1."ShipAddress", s1."ShipCity", s1."ShipCountry", s1."ShipName", s1."ShipPostalCode", s1."ShipRegion", s1."ShipVia", s1."ShippedDate", s1."OrderID0", s1."ProductID", s1."ProductID0", s1."SupplierID", s1."ProductID1", s1."CategoryID", s1."Discontinued", s1."IsDeleted0", s1."ProductName", s1."QuantityPerUnit", s1."ReorderLevel", s1."SupplierID0", s1."UnitPrice", s1."UnitsInStock", s1."UnitsOnOrder" +FROM "Products" AS p +LEFT JOIN ( + SELECT o."Discount", o1."OrderID", o1."CustomerID", o1."EmployeeID", o1."Freight", o1."IsDeleted", o1."OrderDate", o1."RequiredDate", o1."ShipAddress", o1."ShipCity", o1."ShipCountry", o1."ShipName", o1."ShipPostalCode", o1."ShipRegion", o1."ShipVia", o1."ShippedDate", o."OrderID" AS "OrderID0", o."ProductID", p1."ProductID" AS "ProductID0", s0."SupplierID", p3."ProductID" AS "ProductID1", p3."CategoryID", p3."Discontinued", p3."IsDeleted" AS "IsDeleted0", p3."ProductName", p3."QuantityPerUnit", p3."ReorderLevel", p3."SupplierID" AS "SupplierID0", p3."UnitPrice", p3."UnitsInStock", p3."UnitsOnOrder" + FROM "Order Details" AS o + INNER JOIN ( + SELECT o0."OrderID", o0."CustomerID", o0."EmployeeID", o0."Freight", o0."IsDeleted", o0."OrderDate", o0."RequiredDate", o0."ShipAddress", o0."ShipCity", o0."ShipCountry", o0."ShipName", o0."ShipPostalCode", o0."ShipRegion", o0."ShipVia", o0."ShippedDate" + FROM "Orders" AS o0 + WHERE @ef_filter__p4 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") + ) AS o1 ON o."OrderID" = o1."OrderID" + INNER JOIN ( + SELECT p0."ProductID", p0."SupplierID" + FROM "Products" AS p0 + WHERE @ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted") + ) AS p1 ON o."ProductID" = p1."ProductID" + LEFT JOIN ( + SELECT s."SupplierID" + FROM "Suppliers" AS s + WHERE @ef_filter__p6 OR NOT (s."IsDeleted") OR NOT (s."IsDeleted") + ) AS s0 ON p1."SupplierID" = s0."SupplierID" + LEFT JOIN ( + SELECT p2."ProductID", p2."CategoryID", p2."Discontinued", p2."IsDeleted", p2."ProductName", p2."QuantityPerUnit", p2."ReorderLevel", p2."SupplierID", p2."UnitPrice", p2."UnitsInStock", p2."UnitsOnOrder" + FROM "Products" AS p2 + WHERE @ef_filter__p0 OR NOT (p2."IsDeleted") OR NOT (p2."IsDeleted") + ) AS p3 ON s0."SupplierID" = p3."SupplierID" + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS s1 ON p."ProductID" = s1."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +ORDER BY p."ProductID", s1."OrderID0", s1."ProductID", s1."OrderID", s1."ProductID0", s1."SupplierID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."SupplierId", + m_1."ProductId", + d_1."IsDeleted", + d_1."ProductID", + d_1."ProductName", + d_1."SupplierID", + d_1."CategoryID", + d_1."QuantityPerUnit", + d_1."UnitPrice", + d_1."UnitsInStock", + d_1."UnitsOnOrder", + d_1."ReorderLevel", + d_1."Discontinued" +FROM + ( + SELECT DISTINCT + "a_Supplier"."SupplierID" as "SupplierId", + t1."ProductId" + FROM + ( + SELECT DISTINCT + e."ProductID" as "ProductId" + FROM + "Products" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."ProductId" = d."ProductID" + INNER JOIN "Orders" e_1 ON d."OrderID" = e_1."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + LEFT JOIN "Suppliers" "a_Supplier" ON "a_Product"."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" + WHERE + NOT e_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + ) m_1 + INNER JOIN "Products" d_1 ON m_1."SupplierId" = d_1."SupplierID" OR m_1."SupplierId" IS NULL AND d_1."SupplierID" IS NULL +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductID", + d."Discount", + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Supplier"."SupplierID" +FROM + "Products" m_1 + INNER JOIN "Order Details" d ON m_1."ProductID" = d."ProductID" + INNER JOIN "Orders" e ON d."OrderID" = e."OrderID" + LEFT JOIN "Suppliers" "a_Supplier" ON m_1."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" +WHERE + NOT m_1."IsDeleted" AND NOT e."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + p."ProductName", + p."ProductID" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..5eda4221dfa9 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.16,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductName", p."ProductID", s1."Discount", s1."OrderID", s1."CustomerID", s1."EmployeeID", s1."Freight", s1."IsDeleted", s1."OrderDate", s1."RequiredDate", s1."ShipAddress", s1."ShipCity", s1."ShipCountry", s1."ShipName", s1."ShipPostalCode", s1."ShipRegion", s1."ShipVia", s1."ShippedDate", s1."OrderID0", s1."ProductID", s1."ProductID0", s1."SupplierID", s1."ProductID1", s1."CategoryID", s1."Discontinued", s1."IsDeleted0", s1."ProductName", s1."QuantityPerUnit", s1."ReorderLevel", s1."SupplierID0", s1."UnitPrice", s1."UnitsInStock", s1."UnitsOnOrder" +FROM "Products" AS p +LEFT JOIN ( + SELECT o."Discount", o1."OrderID", o1."CustomerID", o1."EmployeeID", o1."Freight", o1."IsDeleted", o1."OrderDate", o1."RequiredDate", o1."ShipAddress", o1."ShipCity", o1."ShipCountry", o1."ShipName", o1."ShipPostalCode", o1."ShipRegion", o1."ShipVia", o1."ShippedDate", o."OrderID" AS "OrderID0", o."ProductID", p1."ProductID" AS "ProductID0", s0."SupplierID", p3."ProductID" AS "ProductID1", p3."CategoryID", p3."Discontinued", p3."IsDeleted" AS "IsDeleted0", p3."ProductName", p3."QuantityPerUnit", p3."ReorderLevel", p3."SupplierID" AS "SupplierID0", p3."UnitPrice", p3."UnitsInStock", p3."UnitsOnOrder" + FROM "Order Details" AS o + INNER JOIN ( + SELECT o0."OrderID", o0."CustomerID", o0."EmployeeID", o0."Freight", o0."IsDeleted", o0."OrderDate", o0."RequiredDate", o0."ShipAddress", o0."ShipCity", o0."ShipCountry", o0."ShipName", o0."ShipPostalCode", o0."ShipRegion", o0."ShipVia", o0."ShippedDate" + FROM "Orders" AS o0 + WHERE @ef_filter__p4 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") + ) AS o1 ON o."OrderID" = o1."OrderID" + INNER JOIN ( + SELECT p0."ProductID", p0."SupplierID" + FROM "Products" AS p0 + WHERE @ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted") + ) AS p1 ON o."ProductID" = p1."ProductID" + LEFT JOIN ( + SELECT s."SupplierID" + FROM "Suppliers" AS s + WHERE @ef_filter__p6 OR NOT (s."IsDeleted") OR NOT (s."IsDeleted") + ) AS s0 ON p1."SupplierID" = s0."SupplierID" + LEFT JOIN ( + SELECT p2."ProductID", p2."CategoryID", p2."Discontinued", p2."IsDeleted", p2."ProductName", p2."QuantityPerUnit", p2."ReorderLevel", p2."SupplierID", p2."UnitPrice", p2."UnitsInStock", p2."UnitsOnOrder" + FROM "Products" AS p2 + WHERE @ef_filter__p0 OR NOT (p2."IsDeleted") OR NOT (p2."IsDeleted") + ) AS p3 ON s0."SupplierID" = p3."SupplierID" + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS s1 ON p."ProductID" = s1."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +ORDER BY p."ProductID", s1."OrderID0", s1."ProductID", s1."OrderID", s1."ProductID0", s1."SupplierID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."SupplierId", + m_1."ProductId", + d_1."IsDeleted", + d_1."ProductID", + d_1."ProductName", + d_1."SupplierID", + d_1."CategoryID", + d_1."QuantityPerUnit", + d_1."UnitPrice", + d_1."UnitsInStock", + d_1."UnitsOnOrder", + d_1."ReorderLevel", + d_1."Discontinued" +FROM + ( + SELECT DISTINCT + "a_Supplier"."SupplierID" as "SupplierId", + t1."ProductId" + FROM + ( + SELECT DISTINCT + e."ProductID" as "ProductId" + FROM + "Products" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."ProductId" = d."ProductID" + INNER JOIN "Orders" e_1 ON d."OrderID" = e_1."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + LEFT JOIN "Suppliers" "a_Supplier" ON "a_Product"."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" + WHERE + NOT e_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + ) m_1 + INNER JOIN "Products" d_1 ON m_1."SupplierId" = d_1."SupplierID" OR m_1."SupplierId" IS NULL AND d_1."SupplierID" IS NULL +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductID", + d."Discount", + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Supplier"."SupplierID" +FROM + "Products" m_1 + INNER JOIN "Order Details" d ON m_1."ProductID" = d."ProductID" + INNER JOIN "Orders" e ON d."OrderID" = e."OrderID" + LEFT JOIN "Suppliers" "a_Supplier" ON m_1."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" +WHERE + NOT m_1."IsDeleted" AND NOT e."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + p."ProductName", + p."ProductID" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..0847adcfc185 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.16,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", p1."ProductID", p1."CategoryID", p1."Discontinued", p1."IsDeleted", p1."ProductName", p1."QuantityPerUnit", p1."ReorderLevel", p1."SupplierID", p1."UnitPrice", p1."UnitsInStock", p1."UnitsOnOrder" +FROM "Products" AS p +CROSS JOIN ( + SELECT p0."ProductID", p0."CategoryID", p0."Discontinued", p0."IsDeleted", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Products" AS p0 + WHERE (@ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o0 + WHERE (@ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted")) AND p0."ProductID" = o0."ProductID") +) AS p1 +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o + WHERE (@ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted")) AND p."ProductID" = o."ProductID") AND p."ProductID" = p1."ProductID" +ORDER BY p."ProductID" + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued", + pd2."IsDeleted", + pd2."ProductID", + pd2."ProductName", + pd2."SupplierID", + pd2."CategoryID", + pd2."QuantityPerUnit", + pd2."UnitPrice", + pd2."UnitsInStock", + pd2."UnitsOnOrder", + pd2."ReorderLevel", + pd2."Discontinued" +FROM + "Products" e, + "Products" pd2 +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_2 + WHERE + pd2."ProductID" = e_2."ProductID" + ) > 0 AND + e."ProductID" = pd2."ProductID" +ORDER BY + e."ProductID" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..04ba1b8e5f72 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.16,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", p1."ProductID", p1."CategoryID", p1."Discontinued", p1."IsDeleted", p1."ProductName", p1."QuantityPerUnit", p1."ReorderLevel", p1."SupplierID", p1."UnitPrice", p1."UnitsInStock", p1."UnitsOnOrder" +FROM "Products" AS p +CROSS JOIN ( + SELECT p0."ProductID", p0."CategoryID", p0."Discontinued", p0."IsDeleted", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Products" AS p0 + WHERE (@ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o0 + WHERE (@ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted")) AND p0."ProductID" = o0."ProductID") +) AS p1 +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o + WHERE (@ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted")) AND p."ProductID" = o."ProductID") AND p."ProductID" = p1."ProductID" +ORDER BY p."ProductID" + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued", + pd2."IsDeleted", + pd2."ProductID", + pd2."ProductName", + pd2."SupplierID", + pd2."CategoryID", + pd2."QuantityPerUnit", + pd2."UnitPrice", + pd2."UnitsInStock", + pd2."UnitsOnOrder", + pd2."ReorderLevel", + pd2."Discontinued" +FROM + "Products" e, + "Products" pd2 +WHERE + NOT e."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + NOT pd2."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_2 + WHERE + NOT e_2."IsDeleted" AND pd2."ProductID" = e_2."ProductID" + ) > 0 AND + e."ProductID" = pd2."ProductID" +ORDER BY + e."ProductID" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..63067274c9cd --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.16,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" +FROM "Employees" AS e +WHERE (@ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted")) AND e."EmployeeID" = @test + + +-- PostgreSQL.15 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath" +FROM + "Employees" e +WHERE + e."EmployeeID" = :test + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..e531c3a24552 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.16,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" +FROM "Employees" AS e +WHERE (@ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted")) AND e."EmployeeID" = @test + + +-- PostgreSQL.15 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath" +FROM + "Employees" e +WHERE + NOT e."IsDeleted" AND e."EmployeeID" = :test + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..0990c71bdc5a --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.16,False).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."IsDeleted", c."Phone", c."PostalCode", c."Region" +FROM "Customers" AS c +WHERE @ef_filter__p0 OR NOT (c."IsDeleted") OR NOT (c."IsDeleted") +LIMIT 1 + + +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @CompanyName Varchar(34) -- String +SET @CompanyName = 'Ana Trujillo Emparedados y helados' +DECLARE @CustomerId Varchar(5) -- String +SET @CustomerId = 'ANATR' + +UPDATE + "Customers" +SET + "CompanyName" = :CompanyName +WHERE + "Customers"."CustomerID" = :CustomerId + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..521f1ad821a7 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.16,True).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."IsDeleted", c."Phone", c."PostalCode", c."Region" +FROM "Customers" AS c +WHERE @ef_filter__p0 OR NOT (c."IsDeleted") OR NOT (c."IsDeleted") +LIMIT 1 + + +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @CompanyName Varchar(19) -- String +SET @CompanyName = 'Alfreds Futterkiste' +DECLARE @CustomerId Varchar(5) -- String +SET @CustomerId = 'ALFKI' + +UPDATE + "Customers" +SET + "CompanyName" = :CompanyName +WHERE + NOT "Customers"."IsDeleted" AND "Customers"."CustomerID" = :CustomerId + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..3b29b573ef51 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.16,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."QuantityPerUnit" AS "Quantity" +FROM "Products" AS p +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."QuantityPerUnit" +FROM + "Products" p + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..4177f13c9745 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.16,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."QuantityPerUnit" AS "Quantity" +FROM "Products" AS p +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."QuantityPerUnit" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..a0724be4e659 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.16,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +/* Tagged query */ +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..0b77940afe8d --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.16,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +/* Tagged query */ +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" AND NOT "a_ReportsToNavigation"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..a649ec7ecf67 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.16,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..5c91aaf63e7e --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.16,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..336c14fe6c64 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.16,False).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT max(p."QuantityPerUnit") +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE 'U%' + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + MAX(e."QuantityPerUnit") +FROM + "Products" e +WHERE + e."ProductName" LIKE 'U%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL + +DELETE FROM + "Products" e +WHERE + e."ProductName" = 'a' + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..8371d15eb814 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.16,True).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT max(p."QuantityPerUnit") +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE 'U%' + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + MAX(e."QuantityPerUnit") +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE 'U%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL + +DELETE FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" = 'a' + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..4add18d4f9bc --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.16,False).sql @@ -0,0 +1,25 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..a791b8e5626d --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.16,True).sql @@ -0,0 +1,27 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" +WHERE + NOT p."IsDeleted" AND NOT c_1."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..4add18d4f9bc --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.16,False).sql @@ -0,0 +1,25 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..a791b8e5626d --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.16,True).sql @@ -0,0 +1,27 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" +WHERE + NOT p."IsDeleted" AND NOT c_1."IsDeleted" + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..c654b34b7aa4 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.16,False).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..c654b34b7aa4 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.16,True).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..38e8e3ad5e55 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.16,False).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..38e8e3ad5e55 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.16,True).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.16,False).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.16,False).sql new file mode 100644 index 000000000000..4cff1be3a285 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.16,False).sql @@ -0,0 +1,29 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' + + + diff --git a/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.16,True).sql b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.16,True).sql new file mode 100644 index 000000000000..293ad4e24147 --- /dev/null +++ b/PostgreSQL.16.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.16,True).sql @@ -0,0 +1,29 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.17).sql new file mode 100644 index 000000000000..4fcd588921f5 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.17).sql @@ -0,0 +1,164 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 1 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'bc7b663d-0fde-4327-8f92-5d8cc3a11d11'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C1' +DECLARE @Name Text(2) -- String +SET @Name = 'N1' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 2 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'a948600d-de21-4f74-8ac2-9516b287076e'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C2' +DECLARE @Name Text(2) -- String +SET @Name = 'N2' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 3 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'bd3973a5-4323-4dd8-9f4f-df9f93e2a627'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C3' +DECLARE @Name Text(2) -- String +SET @Name = 'N3' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +SELECT s."Id", s."Code", s."IsDeleted", s."Name", s."PermanentId" +FROM "Subdivisions" AS s +WHERE s."Id"::bigint = 1 + + +-- PostgreSQL.15 PostgreSQL + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id"::BigInt = 1 + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @id Bigint -- Int64 +SET @id = 1 + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id" = :id + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id" IN (2, 3) + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."PermanentId", + t1."Code", + t1."Name", + t1."IsDeleted" +FROM + "Subdivisions" t1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..f1084f10fea9 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.17).sql @@ -0,0 +1,10 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "Issue261Table" t1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..bb41027286ac --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.17).sql @@ -0,0 +1,43 @@ +Parameters: +@p0='?' (DbType = Object), @p1='?', @p2='?' (DbType = Object), @p3='?' (DbType = Object), @p4='?', @p5='?' (DbType = Object), @p6='?' (DbType = Object), @p7='?', @p8='?' (DbType = Object) + +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p0, @p1, @p2) +RETURNING "Id"; +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p3, @p4, @p5) +RETURNING "Id"; +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p6, @p7, @p8) +RETURNING "Id"; + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +INSERT INTO "Issue4783DBRecords" +( + "Source", + "Status", + "NullableStatus" +) +VALUES +('linq2db','open'::issue4783db_status,'open'::issue4783db_status), +('linq2db','closed'::issue4783db_status,'closed'::issue4783db_status), +('linq2db','closed'::issue4783db_status,NULL) + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4783DBRecords" t1 +ORDER BY + t1."Id" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..897eb5cfa288 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.17).sql @@ -0,0 +1,10 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name" +FROM + "Issue4917DBRecords" t1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..f6df37c54ab6 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test(PostgreSQL.17).sql @@ -0,0 +1,161 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE issue_4940_temp_table +( + "Id" integer NOT NULL, + "Source" text NOT NULL, + "Status" issue4940db_status NOT NULL, + "NullableStatus" issue4940db_status NULL +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +INSERT INTO issue_4940_temp_table +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +(1,'TempTable','open'::issue4940db_status,'closed'::issue4940db_status), +(2,'TempTable','closed'::issue4940db_status,NULL) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 1 +DECLARE @Source Text(6) -- String +SET @Source = 'Insert' +DECLARE @Status Enum -- Object +SET @Status = 'open'::issue4940db_status +DECLARE @NullableStatus Enum -- Object +SET @NullableStatus = 'closed'::issue4940db_status + +INSERT INTO "Issue4940DBRecords" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + :Id, + :Source, + :Status, + :NullableStatus +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 2 +DECLARE @Source Text(6) -- String +SET @Source = 'Insert' +DECLARE @Status Enum -- Object +SET @Status = 'closed'::issue4940db_status +DECLARE @NullableStatus Unknown -- Object +SET @NullableStatus = NULL + +INSERT INTO "Issue4940DBRecords" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + :Id, + :Source, + :Status, + :NullableStatus +) + + + +INSERT BULK "Issue4940DBRecords"(Id, Source, Status, NullableStatus) + + + +-- PostgreSQL.15 PostgreSQL + +MERGE INTO "Issue4940DBRecords" "Target" +USING (VALUES + ('Merge',5,'open'::issue4940db_status,'open'::issue4940db_status), + ('Merge',6,'open'::issue4940db_status,NULL) +) "Source" +( + "Source", + "Id", + "Status", + "NullableStatus" +) +ON ("Target"."Source" = "Source"."Source") + +WHEN NOT MATCHED THEN +INSERT +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + "Source"."Id", + "Source"."Source", + "Source"."Status", + "Source"."NullableStatus" +) + +WHEN MATCHED THEN +UPDATE +SET + "Id" = "Source"."Id", + "Source" = "Source"."Source", + "Status" = "Source"."Status", + "NullableStatus" = "Source"."NullableStatus" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4940DBRecords" t1 +ORDER BY + t1."Id" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + issue_4940_temp_table t1 +ORDER BY + t1."Id" + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS issue_4940_temp_table + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test_NotMapped(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test_NotMapped(PostgreSQL.17).sql new file mode 100644 index 000000000000..6bd53455985e --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test_NotMapped(PostgreSQL.17).sql @@ -0,0 +1,120 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "Issue4940RecordNotMapped" +( + "Id" Int NOT NULL, + "Source" text NULL, + "Status" issue4940db_status NOT NULL, + "NullableStatus" issue4940db_status NULL +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +INSERT INTO "Issue4940RecordNotMapped" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +(1,'TempTable','open'::issue4940db_status,'open'::issue4940db_status), +(2,'TempTable','closed'::issue4940db_status,NULL) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 3 +DECLARE @Source Text(6) -- String +SET @Source = 'Insert' +DECLARE @Status Enum -- Object +SET @Status = 'open'::issue4940db_status +DECLARE @NullableStatus Unknown -- Object +SET @NullableStatus = NULL + +INSERT INTO "Issue4940RecordNotMapped" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + :Id, + :Source, + :Status, + :NullableStatus +) + + + +INSERT BULK "Issue4940RecordNotMapped"(Id, Source, Status, NullableStatus) + + + +-- PostgreSQL.15 PostgreSQL + +MERGE INTO "Issue4940RecordNotMapped" "Target" +USING (VALUES + ('Merge',6,'open'::issue4940db_status,'closed'::issue4940db_status), + ('Merge',7,'open'::issue4940db_status,NULL) +) "Source" +( + "Source", + "Id", + "Status", + "NullableStatus" +) +ON ("Target"."Source" = "Source"."Source" OR "Target"."Source" IS NULL AND "Source"."Source" IS NULL) + +WHEN NOT MATCHED THEN +INSERT +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + "Source"."Id", + "Source"."Source", + "Source"."Status", + "Source"."NullableStatus" +) + +WHEN MATCHED THEN +UPDATE +SET + "Id" = "Source"."Id", + "Source" = "Source"."Source", + "Status" = "Source"."Status", + "NullableStatus" = "Source"."NullableStatus" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4940RecordNotMapped" t1 +ORDER BY + t1."Id" + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "Issue4940RecordNotMapped" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.17).sql new file mode 100644 index 000000000000..51c3d7adada3 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.17).sql @@ -0,0 +1,5 @@ +SELECT w."Id", w."Value" +FROM "WithDuplicateProperties" AS w +WHERE w."Value" = 1 + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.17).sql new file mode 100644 index 000000000000..784356a58fff --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.17).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +INSERT INTO "NoIdentity" +( + "Id", + "Name" +) +VALUES +('bc7b663d-0fde-4327-8f92-5d8cc3a11d11'::uuid,'John Doe'), +('a948600d-de21-4f74-8ac2-9516b287076e'::uuid,'Jane Doe') + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.17).sql new file mode 100644 index 000000000000..33cc2a28335a --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.17).sql @@ -0,0 +1,32 @@ +Parameters: +@p0='?', @p1='?', @p2='?', @p3='?', @p4='?' + +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p0) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p1) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p2) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p3) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p4) +RETURNING "Id"; + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Discriminator", + t1."Id" +FROM + "WithInheritance" t1 +WHERE + t1."Discriminator" IN ('WithInheritanceA2', 'WithInheritanceA1', 'WithInheritanceA') + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.17).sql new file mode 100644 index 000000000000..7595bb53108a --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.17).sql @@ -0,0 +1,33 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +INSERT ASYNC BULK "NoIdentity"(Id, Name) + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.17).sql new file mode 100644 index 000000000000..39a4028e0d5e --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.17).sql @@ -0,0 +1,33 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +INSERT BULK "NoIdentity"(Id, Name) + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.17).sql new file mode 100644 index 000000000000..0e82f5a61940 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.17).sql @@ -0,0 +1,76 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +INSERT INTO "SkipModes" ("Id", "InsertOnly") +VALUES (@p0, @p1); + + +-- PostgreSQL.15 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 2 +DECLARE @InsertOnly Integer -- Int32 +SET @InsertOnly = 2 + +INSERT INTO "SkipModes" +( + "Id", + "InsertOnly" +) +VALUES +( + :Id, + :InsertOnly +) + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."InsertOnly", + t1."UpdateOnly", + t1."ReadOnly" +FROM + "SkipModes" t1 +ORDER BY + t1."Id" + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +UPDATE "SkipModes" SET "UpdateOnly" = @p0 +WHERE "Id" = @p1; + + +-- PostgreSQL.15 PostgreSQL +DECLARE @UpdateOnly Integer -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id Integer -- Int32 +SET @Id = 2 + +UPDATE + "SkipModes" +SET + "UpdateOnly" = :UpdateOnly +WHERE + "SkipModes"."Id" = :Id + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."InsertOnly", + t1."UpdateOnly", + t1."ReadOnly" +FROM + "SkipModes" t1 +ORDER BY + t1."Id" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.17).sql new file mode 100644 index 000000000000..ddd5304821a7 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.17).sql @@ -0,0 +1,38 @@ +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "WithIdentity" +( + "Id" integer NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_WithIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + +-- PostgreSQL.15 PostgreSQL + +DROP TABLE IF EXISTS "WithIdentity" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.17).sql new file mode 100644 index 000000000000..6b7704deafe1 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.17).sql @@ -0,0 +1,28 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int64), @p3='?' (DbType = Int64), @p4='?' (DbType = Decimal), @p5='?' (DbType = Decimal) + +INSERT INTO "UIntTable" ("Field16", "Field16N", "Field32", "Field32N", "Field64", "Field64N") +VALUES (@p0, @p1, @p2, @p3, @p4, @p5) +RETURNING "ID"; + + +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @field64 Numeric(1, 0) -- Decimal +SET @field64 = 5 + +SELECT + e."ID", + e."Field16", + e."Field32", + e."Field64", + e."Field16N", + e."Field32N", + e."Field64N" +FROM + "UIntTable" e +WHERE + e."Field64" = :field64 +LIMIT 1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.17,False,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.17,False,False).sql new file mode 100644 index 000000000000..4fadd949b642 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.17,False,False).sql @@ -0,0 +1,12 @@ +SELECT e.id, e.name, s0.id, s0.master_id, s0.name, s0.id0, s0.master_id0, s0.name0, c.id, c.name, c.parent_id +FROM entities AS e +LEFT JOIN ( + SELECT d.id, d.master_id, d.name, s.id AS id0, s.master_id AS master_id0, s.name AS name0 + FROM details AS d + LEFT JOIN sub_details AS s ON d.id = s.master_id +) AS s0 ON e.id = s0.master_id +LEFT JOIN children AS c ON e.id = c.parent_id +WHERE e.name = 'Alpha' +ORDER BY e.id, s0.id, s0.id0 + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.17,False,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.17,False,True).sql new file mode 100644 index 000000000000..4fadd949b642 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.17,False,True).sql @@ -0,0 +1,12 @@ +SELECT e.id, e.name, s0.id, s0.master_id, s0.name, s0.id0, s0.master_id0, s0.name0, c.id, c.name, c.parent_id +FROM entities AS e +LEFT JOIN ( + SELECT d.id, d.master_id, d.name, s.id AS id0, s.master_id AS master_id0, s.name AS name0 + FROM details AS d + LEFT JOIN sub_details AS s ON d.id = s.master_id +) AS s0 ON e.id = s0.master_id +LEFT JOIN children AS c ON e.id = c.parent_id +WHERE e.name = 'Alpha' +ORDER BY e.id, s0.id, s0.id0 + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.17,True,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.17,True,False).sql new file mode 100644 index 000000000000..a7b4bb1ff42f --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.17,True,False).sql @@ -0,0 +1,76 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Id", + m_1."Id_1", + d_1.id, + d_1.master_id, + d_1.name +FROM + ( + SELECT DISTINCT + d.id as "Id", + t1."Id" as "Id_1" + FROM + ( + SELECT DISTINCT + e.id as "Id" + FROM + entities e + WHERE + e.name = 'Alpha' + ) t1 + INNER JOIN details d ON t1."Id" = d.master_id + ) m_1 + INNER JOIN sub_details d_1 ON m_1."Id" = d_1.master_id + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.id, + d.master_id, + d.name +FROM + entities m_1 + INNER JOIN details d ON m_1.id = d.master_id +WHERE + m_1.name = 'Alpha' + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.id, + d.parent_id, + d.name +FROM + entities m_1 + INNER JOIN children d ON m_1.id = d.parent_id +WHERE + m_1.name = 'Alpha' + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e.id, + e.name +FROM + entities e +WHERE + e.name = 'Alpha' + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.17,True,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.17,True,True).sql new file mode 100644 index 000000000000..a7b4bb1ff42f --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.17,True,True).sql @@ -0,0 +1,76 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Id", + m_1."Id_1", + d_1.id, + d_1.master_id, + d_1.name +FROM + ( + SELECT DISTINCT + d.id as "Id", + t1."Id" as "Id_1" + FROM + ( + SELECT DISTINCT + e.id as "Id" + FROM + entities e + WHERE + e.name = 'Alpha' + ) t1 + INNER JOIN details d ON t1."Id" = d.master_id + ) m_1 + INNER JOIN sub_details d_1 ON m_1."Id" = d_1.master_id + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.id, + d.master_id, + d.name +FROM + entities m_1 + INNER JOIN details d ON m_1.id = d.master_id +WHERE + m_1.name = 'Alpha' + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.id, + d.parent_id, + d.name +FROM + entities m_1 + INNER JOIN children d ON m_1.id = d.parent_id +WHERE + m_1.name = 'Alpha' + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e.id, + e.name +FROM + entities e +WHERE + e.name = 'Alpha' + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.17).sql new file mode 100644 index 000000000000..1f665e79775c --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.17).sql @@ -0,0 +1,13 @@ +Parameters: +@p0='test insert ef' (Nullable = false) + +INSERT INTO entities (name) +VALUES (@p0) +RETURNING id; + + +SELECT e.id, e.name +FROM entities AS e +LIMIT 2 + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.17).sql new file mode 100644 index 000000000000..ce1197584240 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.17).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @name Text(11) -- String +SET @name = 'test insert' + +INSERT INTO entities +( + name +) +VALUES +( + :name +) +RETURNING + id + + + +Parameters: +@id='50' + +SELECT e.id, e.name +FROM entities AS e +WHERE e.id::bigint = @id +LIMIT 2 + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.17,False,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.17,False,True).sql new file mode 100644 index 000000000000..803b4f11e467 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.17,False,True).sql @@ -0,0 +1,10 @@ +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.17,True,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.17,True,False).sql new file mode 100644 index 000000000000..64a4d6beef99 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.17,True,False).sql @@ -0,0 +1,31 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.17,True,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.17,True,True).sql new file mode 100644 index 000000000000..64a4d6beef99 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.17,True,True).sql @@ -0,0 +1,31 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..28ad2b078f61 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.17,False).sql @@ -0,0 +1,41 @@ +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..3ca3ee146fbb --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.17,True).sql @@ -0,0 +1,41 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.17,False,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.17,False,True).sql new file mode 100644 index 000000000000..8d38ce10d713 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.17,False,True).sql @@ -0,0 +1,5 @@ +SELECT d.id, d.master_id, d.name, e.id, e.name +FROM details AS d +INNER JOIN entities AS e ON d.master_id = e.id + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.17,True,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.17,True,False).sql new file mode 100644 index 000000000000..5907ebd3fc01 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.17,True,False).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.17,True,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.17,True,True).sql new file mode 100644 index 000000000000..5907ebd3fc01 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.17,True,True).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.17,False,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.17,False,True).sql new file mode 100644 index 000000000000..8d38ce10d713 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.17,False,True).sql @@ -0,0 +1,5 @@ +SELECT d.id, d.master_id, d.name, e.id, e.name +FROM details AS d +INNER JOIN entities AS e ON d.master_id = e.id + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.17,True,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.17,True,True).sql new file mode 100644 index 000000000000..5907ebd3fc01 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.17,True,True).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.17,Default).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.17,Default).sql new file mode 100644 index 000000000000..71ae5334d03f --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.17,Default).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.17,MultipleRows).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.17,MultipleRows).sql new file mode 100644 index 000000000000..71ae5334d03f --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.17,MultipleRows).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.17,ProviderSpecific).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.17,ProviderSpecific).sql new file mode 100644 index 000000000000..71ae5334d03f --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.17,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.17,RowByRow).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.17,RowByRow).sql new file mode 100644 index 000000000000..71ae5334d03f --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.17,RowByRow).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.17).sql new file mode 100644 index 000000000000..adeb323d784c --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.17).sql @@ -0,0 +1,10 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @p='?' (DbType = Int32) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductID" > 0 +ORDER BY p."ProductID" +LIMIT @p + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.17).sql new file mode 100644 index 000000000000..3b44a93907dd --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.17).sql @@ -0,0 +1,52 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.17).sql new file mode 100644 index 000000000000..28476ddd63c9 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.17).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.17).sql new file mode 100644 index 000000000000..28476ddd63c9 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.17).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.17).sql new file mode 100644 index 000000000000..b7e831126fbf --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.17).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id" +FROM + "Patents" t1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..f9618badbc13 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.17).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT p."Id" AS "PatentId", @userId0 AS "UserId" +FROM "Patents" AS p +LEFT JOIN "PatentAssessment" AS p0 ON p."Id" = p0."PatentId" +WHERE p0."PatentId" IS NULL OR p0."TechnicalReviewerId" <> @userId OR p0."TechnicalReviewerId" IS NULL + + +-- PostgreSQL.15 PostgreSQL +DECLARE @userId Integer -- Int32 +SET @userId = 1 + +SELECT + p."Id" +FROM + "Patents" p + LEFT JOIN "PatentAssessment" "a_Assessment" ON p."Id" = "a_Assessment"."PatentId" +WHERE + "a_Assessment"."PatentId" IS NULL OR "a_Assessment"."TechnicalReviewerId" <> :userId OR + "a_Assessment"."TechnicalReviewerId" IS NULL + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..34c99bd03604 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.17).sql @@ -0,0 +1,21 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."Id", + e."Linked", + ( + SELECT + ARRAY_AGG(DISTINCT r."Id") + FROM + "Issue155Table" r + WHERE + e."Id" = ANY(r."Linked") + ) +FROM + "Issue155Table" e +WHERE + e."Id" = 1 +LIMIT 2 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.17).sql new file mode 100644 index 000000000000..e4044c4b1d3d --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.17).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + COUNT(*) +FROM + "Parents" x +WHERE + ( + SELECT + "a_Children"."IsActive" + FROM + "Children" "a_Children" + WHERE + x."Id" = "a_Children"."ParentId" + LIMIT 1 + ) = False + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.17).sql new file mode 100644 index 000000000000..1c50903f9c81 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.17).sql @@ -0,0 +1,18 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + COUNT(*) +FROM + "Parents" x +WHERE + NOT EXISTS( + SELECT + * + FROM + "Children" y + WHERE + x."Id" = y."ParentId" AND y."IsActive" + ) + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..b7e831126fbf --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.17).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id" +FROM + "Patents" t1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..475577c27094 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.17).sql @@ -0,0 +1,11 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + x."Id" +FROM + "Issue340Entities" x +WHERE + x."IsActive" = True + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..1d1e37e9f7a9 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.17).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.15 PostgreSQL + +UPDATE + "PostgreTestTable" +SET + ("Title", "SearchVector") = ( + SELECT + "PostgreTestTable"."Title", + to_tsvector('test') + FROM + "PostgreTestTable" x + WHERE + "PostgreTestTable"."Id" = x."Id" + ) +WHERE + "PostgreTestTable"."Id" = 1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..13e7894d0f20 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.17).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + 1 +FROM + "Parents" ua +WHERE + ua."ParentId" = 55377 AND EXISTS( + SELECT + * + FROM + "Parents" t1 + ) + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.17).sql new file mode 100644 index 000000000000..2deaab506768 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.17).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @DateTimeOffset TimestampTz -- DateTime +SET @DateTimeOffset = '2020-02-29T17:54:55.1231234+00:00' +DECLARE @DateTimeOffsetN TimestampTz -- DateTime +SET @DateTimeOffsetN = '2020-02-29T17:54:55.1231234+00:00' + +UPDATE + "Types" +SET + "DateTimeOffset" = :DateTimeOffset, + "DateTimeOffsetN" = :DateTimeOffsetN +WHERE + "Types"."Id" = 2 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.17).sql new file mode 100644 index 000000000000..27280032538f --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.17).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @DateTimeOffsetWithConverter Bigint -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter Bigint -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + "Types" +SET + "DateTimeOffsetWithConverter" = :DateTimeOffsetWithConverter, + "DateTimeOffsetNWithConverter" = :DateTimeOffsetNWithConverter +WHERE + "Types"."Id" = 2 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.17).sql new file mode 100644 index 000000000000..de0253d7f486 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.17).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Id", + d_1."Key_1", + d_1."SUM_1", + d_1."Issue4626AnyValue" +FROM + "Parents" m_1 + INNER JOIN LATERAL ( + SELECT + d."ParentId" as "Key_1", + SUM(d."Id") as "SUM_1", + ANY_VALUE(d."Name") as "Issue4626AnyValue" + FROM + "Children" d + WHERE + m_1."Id" = d."ParentId" + GROUP BY + d."ParentId" + ) d_1 ON 1=1 + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + c_1."Id" +FROM + "Parents" c_1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.17).sql new file mode 100644 index 000000000000..bc43196a3204 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.17).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Id", + d_1."Key_1", + d_1."SUM_1", + d_1."ToValue" +FROM + "Parents" m_1 + INNER JOIN LATERAL ( + SELECT + d."ParentId" as "Key_1", + SUM(d."Id") as "SUM_1", + STRING_AGG(d."Name", ', ') as "ToValue" + FROM + "Children" d + WHERE + m_1."Id" = d."ParentId" + GROUP BY + d."ParentId" + ) d_1 ON 1=1 + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + c_1."Id" +FROM + "Parents" c_1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..d0307a15be51 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.17).sql @@ -0,0 +1,36 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + id."Id" +FROM + ( + SELECT + p."Id" + FROM + "Issue4629Posts" p + WHERE + ( + SELECT + SUM("a_Tags"."Weight") + FROM + "Issue4629Tags" "a_Tags" + WHERE + p."Id" = "a_Tags"."PostId" AND "a_Tags"."Weight" > 1 + ) > 5 + ORDER BY + ( + SELECT + SUM("a_Tags_1"."Weight") + FROM + "Issue4629Tags" "a_Tags_1" + WHERE + p."Id" = "a_Tags_1"."PostId" + ) + LIMIT :take + ) id + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..d5c80521cd2d --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.17).sql @@ -0,0 +1,20 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @id Integer -- Int32 +SET @id = 2 + +SELECT + t1."Index_1" +FROM + ( + SELECT + x."Id", + ROW_NUMBER() OVER(ORDER BY x."Id") as "Index_1" + FROM + "Parents" x + ) t1 +WHERE + t1."Id" = :id +LIMIT 1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..fae98f1d22cb --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.17).sql @@ -0,0 +1,40 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."Key_1", + d."CfAllowValue", + d."DateFrom" +FROM + ( + SELECT + p."AclNameId" as "Key_1" + FROM + "Issue4624Items" p + GROUP BY + p."AclNameId" + LIMIT 1 + ) m_1 + INNER JOIN "Issue4624Items" d ON m_1."Key_1" = d."AclNameId" +ORDER BY + d."DateFrom" + + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."AclNameId" +FROM + "Issue4624Items" p +GROUP BY + p."AclNameId" +LIMIT 1 + + + +DisposeTransaction + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..adfeed0266d8 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(PostgreSQL.17).sql @@ -0,0 +1,47 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @systemId Varchar(6) -- String +SET @systemId = 'system' + +MERGE INTO "Issue4642Table2" "Target" +USING ( + SELECT + y."Id", + y."SystemId", + y."Timestamp" as "Timestamp_1" + FROM + "Issue4642Table1" x + INNER JOIN "Issue4642Table2" y ON x."Id" = y."Id" + WHERE + x."Id" IN (1) AND y."SystemId" = :systemId +) "Source" +( + "Id", + "SystemId", + "Timestamp_1" +) +ON ("Target"."Id" = "Source"."Id" AND "Target"."SystemId" = "Source"."SystemId") + +WHEN MATCHED THEN +UPDATE +SET + "Timestamp" = "Source"."Timestamp_1" + +WHEN NOT MATCHED THEN +INSERT +( + "Id", + "SystemId", + "Timestamp" +) +VALUES +( + "Source"."Id", + "Source"."SystemId", + "Source"."Timestamp_1" +) +RETURNING + merge_action(), + "Target"."Id" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..a3153abcbb60 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.17).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id" +FROM + "Masters" t1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4667Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4667Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..3fa0695edb2e --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4667Test(PostgreSQL.17).sql @@ -0,0 +1,31 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @value Json -- Object +SET @value = {[property, value]} + +MERGE INTO "Issue4667" "Target" +USING (VALUES + (1,'{"test" : 1}'::jsonb,:value::json) +) "Source" +( + "Id", + "Payload", + "Headers" +) +ON ("Target".id = "Source"."Id") + +WHEN NOT MATCHED THEN +INSERT +( + id, + payload, + headers +) +VALUES +( + "Source"."Id", + "Source"."Payload", + "Source"."Headers" +) + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..42990f4614dc --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.17).sql @@ -0,0 +1,21 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + x."Id", + x."IsActive", + x."ParentId", + x."Name" +FROM + "Children" x +WHERE + x."Name" LIKE '%Test%' ESCAPE '~' +ORDER BY + x."Name" + + + +SELECT c."Id", c."IsActive", c."Name", c."ParentId" +FROM "Children" AS c +WHERE c."Name" LIKE 'Test%' + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..93e342b64ae0 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.17,False).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..93e342b64ae0 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.17,True).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..93e342b64ae0 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.17,False).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..93e342b64ae0 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.17,True).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.17).sql new file mode 100644 index 000000000000..62531c28ad48 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.17).sql @@ -0,0 +1,18 @@ +SELECT COALESCE(i0."Name", '') || '>' || i."Name" +FROM "Issue73Entities" AS i +LEFT JOIN "Issue73Entities" AS i0 ON i."ParentId" = i0."Id" +WHERE i."Name" = 'Name1_3' + + +-- PostgreSQL.15 PostgreSQL + +SELECT + "a_Parent"."Name" || '>' || x."Name" +FROM + "Issue73Entities" x + LEFT JOIN "Issue73Entities" "a_Parent" ON x."ParentId" = "a_Parent"."Id" +WHERE + x."Name" = 'Name1_3' + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.17).sql new file mode 100644 index 000000000000..9f6fdc246f26 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.17).sql @@ -0,0 +1,30 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32) + +INSERT INTO "IssueEnum" ("Value") +VALUES (@p0) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p1) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p2) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p3) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p4) +RETURNING "Id"; + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Value" +FROM + "IssueEnum" t1 + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.17).sql new file mode 100644 index 000000000000..dea9fca0781b --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.17).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @guids -2147483621 -- Object +SET @guids = {'271425b1-ebe8-400d-b71d-a6e47a460ae3'::uuid,'b75de94e-6d7b-4c70-bfa1-f8639a6a5b35'::uuid} + +SELECT + m_1."Id", + m_1."Guids" +FROM + "EntityWithArrays" m_1 +WHERE + m_1."Guids" && :guids + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.17).sql new file mode 100644 index 000000000000..7c2264341440 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.17).sql @@ -0,0 +1,20 @@ +-- PostgreSQL.15 PostgreSQL + +INSERT INTO "EntityWithXmin" +( + "Value" +) +VALUES +('Str1'), +('Str2'), +('Str3'), +('Str4'), +('Str5'), +('Str6'), +('Str7'), +('Str8'), +('Str9'), +('Str10') + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.17,Local).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.17,Local).sql new file mode 100644 index 000000000000..1d7992d38759 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.17,Local).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.17,Unspecified).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.17,Unspecified).sql new file mode 100644 index 000000000000..1d7992d38759 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.17,Unspecified).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.17,Utc).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.17,Utc).sql new file mode 100644 index 000000000000..1d7992d38759 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.17,Utc).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.15 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.17).sql new file mode 100644 index 000000000000..7512830f1412 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.17).sql @@ -0,0 +1,27 @@ +Parameters: +@date='?' (DbType = DateTime2) + +SELECT e."Id", e."Duration", e."Name" +FROM "Events" AS e +WHERE e."Duration" @> @date OR lower(e."Duration") = @date OR upper(e."Duration") = @date OR isempty(e."Duration") OR isempty(e."Duration" * e."Duration") + + +-- PostgreSQL.15 PostgreSQL +DECLARE @date Timestamp -- DateTime2 +SET @date = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Name", + e."Duration" +FROM + "Events" e +WHERE + e."Duration" @> :date OR + lower(e."Duration") = :date OR + upper(e."Duration") = :date OR + isempty(e."Duration") OR + isempty(e."Duration" * e."Duration") + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.17).sql new file mode 100644 index 000000000000..a270b408fa11 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.17).sql @@ -0,0 +1,15 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @guids -2147483621 -- Object +SET @guids = {'271425b1-ebe8-400d-b71d-a6e47a460ae3'::uuid,'b75de94e-6d7b-4c70-bfa1-f8639a6a5b35'::uuid} + +SELECT + m_1."Id", + m_1."Guids" +FROM + "EntityWithArrays" m_1 + INNER JOIN LATERAL UNNEST(m_1."Guids") g_1(value) ON 1=1 +WHERE + m_1."Guids" && :guids + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.17).sql new file mode 100644 index 000000000000..62ac6f949779 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.17).sql @@ -0,0 +1,16 @@ +SELECT e."Name" +FROM views."EventsView" AS e +WHERE e."Name" LIKE 'any%' + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."Name" +FROM + views."EventsView" e +WHERE + e."Name" LIKE 'any%' ESCAPE '~' + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.17).sql new file mode 100644 index 000000000000..8024b0b4b5bc --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.17).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" IS NOT NULL + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.17).sql new file mode 100644 index 000000000000..7e920fba7c61 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.17).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" LIKE '%anything%' ESCAPE '~' + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.17).sql new file mode 100644 index 000000000000..4b8dfe4a71d4 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.17).sql @@ -0,0 +1,24 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @value Varchar(10) -- String +SET @value = '%anything%' + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" LIKE :value ESCAPE '~' + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.17).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.17).sql new file mode 100644 index 000000000000..9ad91620744d --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.17).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o1."OrderID", o1."ProductID", p0."ProductID", o3."OrderId", o3."ProductId", o3."Quantity", o1."Quantity", p0."ProductName" +FROM "Orders" AS o +INNER JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Quantity" + FROM "Order Details" AS o0 + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS o1 ON o."OrderID" = o1."OrderID" +INNER JOIN ( + SELECT p."ProductID", p."ProductName" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +) AS p0 ON o1."ProductID" = p0."ProductID" +LEFT JOIN ( + SELECT o2."OrderID" AS "OrderId", o2."ProductID" AS "ProductId", o2."Quantity" + FROM "Order Details" AS o2 + WHERE @ef_filter__p2 OR NOT (o2."IsDeleted") OR NOT (o2."IsDeleted") +) AS o3 ON p0."ProductID" = o3."ProductId" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", o1."OrderID", o1."ProductID", p0."ProductID", o3."OrderId" + + +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."ProductId", + d."OrderID", + d."ProductID", + d."Quantity" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId" + FROM + "Orders" e + INNER JOIN "Order Details" od ON e."OrderID" = od."OrderID" + INNER JOIN "Products" "a_Product" ON od."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d ON m_1."ProductId" = d."ProductID" + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + "a_Product"."ProductID", + od."OrderID", + od."ProductID", + od."Quantity", + "a_Product"."ProductName" +FROM + "Orders" o + INNER JOIN "Order Details" od ON o."OrderID" = od."OrderID" + INNER JOIN "Products" "a_Product" ON od."ProductID" = "a_Product"."ProductID" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..9ad2c05355c0 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.17,False).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS p + WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%') + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + "Products" e + WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..0dde33fef5a9 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.17,True).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS p + WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%') + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + "Products" e + WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..80ff17482e05 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.17,False).sql @@ -0,0 +1,17 @@ +-- PostgreSQL.15 PostgreSQL + +DELETE FROM + "Products" e +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' AND e."ProductName" = 'a' + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..4e79bf65b6bb --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.17,True).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.15 PostgreSQL + +DELETE FROM + "Products" e +WHERE + NOT e."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' AND + e."ProductName" = 'a' + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..ad8a19493cc0 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.17,False).sql @@ -0,0 +1,94 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2; + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..afa60754b4a3 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.17,True).sql @@ -0,0 +1,105 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2; + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..86efccdbd1df --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.17,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..9657ac2e8836 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.17,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..86efccdbd1df --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.17,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..9657ac2e8836 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.17,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..1322e477c4ed --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.17,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder", s."OrderID0", s."ProductID1", s."Discount0", s."IsDeleted1", s."Quantity0", s."UnitPrice1" +FROM "Orders" AS o +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder", o2."OrderID" AS "OrderID0", o2."ProductID" AS "ProductID1", o2."Discount" AS "Discount0", o2."IsDeleted" AS "IsDeleted1", o2."Quantity" AS "Quantity0", o2."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + LEFT JOIN ( + SELECT o1."OrderID", o1."ProductID", o1."Discount", o1."IsDeleted", o1."Quantity", o1."UnitPrice" + FROM "Order Details" AS o1 + WHERE @ef_filter__p2 OR NOT (o1."IsDeleted") OR NOT (o1."IsDeleted") + ) AS o2 ON p0."ProductID" = o2."ProductID" + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", s."OrderID", s."ProductID", s."ProductID0", s."OrderID0" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..fd750acbf799 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.17,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder", s."OrderID0", s."ProductID1", s."Discount0", s."IsDeleted1", s."Quantity0", s."UnitPrice1" +FROM "Orders" AS o +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder", o2."OrderID" AS "OrderID0", o2."ProductID" AS "ProductID1", o2."Discount" AS "Discount0", o2."IsDeleted" AS "IsDeleted1", o2."Quantity" AS "Quantity0", o2."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + LEFT JOIN ( + SELECT o1."OrderID", o1."ProductID", o1."Discount", o1."IsDeleted", o1."Quantity", o1."UnitPrice" + FROM "Order Details" AS o1 + WHERE @ef_filter__p2 OR NOT (o1."IsDeleted") OR NOT (o1."IsDeleted") + ) AS o2 ON p0."ProductID" = o2."ProductID" + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", s."OrderID", s."ProductID", s."ProductID0", s."OrderID0" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..fe5c59d3b2ca --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.17,False).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e + LEFT JOIN "Products" op ON op."ProductID" <> e."ProductID" AND op."ProductName" = e."ProductName" +WHERE + op."ProductID" IS NULL + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..926343941e78 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.17,True).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e + LEFT JOIN "Products" op ON op."ProductID" <> e."ProductID" AND op."ProductName" = e."ProductName" AND NOT op."IsDeleted" +WHERE + NOT e."IsDeleted" AND op."ProductID" IS NULL + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..154ab410fc4a --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.17,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", o."OrderID", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + e_1."IsDeleted", + e_1."TerritoryID", + e_1."TerritoryDescription", + e_1."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" e_1 ON d."TerritoryID" = e_1."TerritoryID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + e_1."IsDeleted", + e_1."ProductID", + e_1."ProductName", + e_1."SupplierID", + e_1."CategoryID", + e_1."QuantityPerUnit", + e_1."UnitPrice", + e_1."UnitsInStock", + e_1."UnitsOnOrder", + e_1."ReorderLevel", + e_1."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" e_1 ON d."ProductID" = e_1."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath", + o."OrderID" +FROM + "Orders" o + LEFT JOIN "Employees" "a_Employee" ON o."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..1385bd04a775 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.17,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", o."OrderID", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + e_1."IsDeleted", + e_1."TerritoryID", + e_1."TerritoryDescription", + e_1."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" e_1 ON d."TerritoryID" = e_1."TerritoryID" +WHERE + NOT e_1."IsDeleted" AND NOT d."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + e_1."IsDeleted", + e_1."ProductID", + e_1."ProductName", + e_1."SupplierID", + e_1."CategoryID", + e_1."QuantityPerUnit", + e_1."UnitPrice", + e_1."UnitsInStock", + e_1."UnitsOnOrder", + e_1."ReorderLevel", + e_1."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" e_1 ON d."ProductID" = e_1."ProductID" +WHERE + NOT e_1."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath", + o."OrderID" +FROM + "Orders" o + LEFT JOIN "Employees" "a_Employee" ON o."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT o."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..70b3fe349991 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.17,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..d799f0c8ee68 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.17,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" AND NOT "a_ReportsToNavigation"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..e045c824756e --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.17,False).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."City" IS NOT NULL + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..9dd8b5452a5b --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.17,True).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + NOT e."IsDeleted" AND e."City" IS NOT NULL + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..011e49fdd3d9 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.17,False).sql @@ -0,0 +1,70 @@ +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" +FROM "Products" AS p +INNER JOIN "Order Details" AS o ON p."ProductID" = o."ProductID" + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice" +FROM "Products" AS p +INNER JOIN ( + SELECT o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" + FROM "Order Details" AS o + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS o0 ON p."ProductID" = o0."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..88e51fccdd4b --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.17,True).sql @@ -0,0 +1,74 @@ +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" +FROM "Products" AS p +INNER JOIN "Order Details" AS o ON p."ProductID" = o."ProductID" + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" +WHERE + NOT d."IsDeleted" + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice" +FROM "Products" AS p +INNER JOIN ( + SELECT o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" + FROM "Order Details" AS o + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS o0 ON p."ProductID" = o0."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" +WHERE + NOT p."IsDeleted" AND NOT d."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..869719113c9a --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.17,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + "a_Territory"."IsDeleted", + "a_Territory"."TerritoryID", + "a_Territory"."TerritoryDescription", + "a_Territory"."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" "a_Territory" ON d."TerritoryID" = "a_Territory"."TerritoryID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..3003bc050257 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.17,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + "a_Territory"."IsDeleted", + "a_Territory"."TerritoryID", + "a_Territory"."TerritoryDescription", + "a_Territory"."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" "a_Territory" ON d."TerritoryID" = "a_Territory"."TerritoryID" +WHERE + NOT "a_Territory"."IsDeleted" AND NOT d."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..e49ae0c5940b --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.17,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", e2."EmployeeID", e2."TerritoryID", e2."IsDeleted", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted" + FROM "EmployeeTerritories" AS e1 + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS e2 ON e0."EmployeeID" = e2."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p8 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", e2."EmployeeID", e2."TerritoryID", s."OrderID", s."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..a3094071b928 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.17,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", e2."EmployeeID", e2."TerritoryID", e2."IsDeleted", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted" + FROM "EmployeeTerritories" AS e1 + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS e2 ON e0."EmployeeID" = e2."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p8 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", e2."EmployeeID", e2."TerritoryID", s."OrderID", s."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" +WHERE + NOT d."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..5eda4221dfa9 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.17,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductName", p."ProductID", s1."Discount", s1."OrderID", s1."CustomerID", s1."EmployeeID", s1."Freight", s1."IsDeleted", s1."OrderDate", s1."RequiredDate", s1."ShipAddress", s1."ShipCity", s1."ShipCountry", s1."ShipName", s1."ShipPostalCode", s1."ShipRegion", s1."ShipVia", s1."ShippedDate", s1."OrderID0", s1."ProductID", s1."ProductID0", s1."SupplierID", s1."ProductID1", s1."CategoryID", s1."Discontinued", s1."IsDeleted0", s1."ProductName", s1."QuantityPerUnit", s1."ReorderLevel", s1."SupplierID0", s1."UnitPrice", s1."UnitsInStock", s1."UnitsOnOrder" +FROM "Products" AS p +LEFT JOIN ( + SELECT o."Discount", o1."OrderID", o1."CustomerID", o1."EmployeeID", o1."Freight", o1."IsDeleted", o1."OrderDate", o1."RequiredDate", o1."ShipAddress", o1."ShipCity", o1."ShipCountry", o1."ShipName", o1."ShipPostalCode", o1."ShipRegion", o1."ShipVia", o1."ShippedDate", o."OrderID" AS "OrderID0", o."ProductID", p1."ProductID" AS "ProductID0", s0."SupplierID", p3."ProductID" AS "ProductID1", p3."CategoryID", p3."Discontinued", p3."IsDeleted" AS "IsDeleted0", p3."ProductName", p3."QuantityPerUnit", p3."ReorderLevel", p3."SupplierID" AS "SupplierID0", p3."UnitPrice", p3."UnitsInStock", p3."UnitsOnOrder" + FROM "Order Details" AS o + INNER JOIN ( + SELECT o0."OrderID", o0."CustomerID", o0."EmployeeID", o0."Freight", o0."IsDeleted", o0."OrderDate", o0."RequiredDate", o0."ShipAddress", o0."ShipCity", o0."ShipCountry", o0."ShipName", o0."ShipPostalCode", o0."ShipRegion", o0."ShipVia", o0."ShippedDate" + FROM "Orders" AS o0 + WHERE @ef_filter__p4 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") + ) AS o1 ON o."OrderID" = o1."OrderID" + INNER JOIN ( + SELECT p0."ProductID", p0."SupplierID" + FROM "Products" AS p0 + WHERE @ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted") + ) AS p1 ON o."ProductID" = p1."ProductID" + LEFT JOIN ( + SELECT s."SupplierID" + FROM "Suppliers" AS s + WHERE @ef_filter__p6 OR NOT (s."IsDeleted") OR NOT (s."IsDeleted") + ) AS s0 ON p1."SupplierID" = s0."SupplierID" + LEFT JOIN ( + SELECT p2."ProductID", p2."CategoryID", p2."Discontinued", p2."IsDeleted", p2."ProductName", p2."QuantityPerUnit", p2."ReorderLevel", p2."SupplierID", p2."UnitPrice", p2."UnitsInStock", p2."UnitsOnOrder" + FROM "Products" AS p2 + WHERE @ef_filter__p0 OR NOT (p2."IsDeleted") OR NOT (p2."IsDeleted") + ) AS p3 ON s0."SupplierID" = p3."SupplierID" + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS s1 ON p."ProductID" = s1."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +ORDER BY p."ProductID", s1."OrderID0", s1."ProductID", s1."OrderID", s1."ProductID0", s1."SupplierID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."SupplierId", + m_1."ProductId", + d_1."IsDeleted", + d_1."ProductID", + d_1."ProductName", + d_1."SupplierID", + d_1."CategoryID", + d_1."QuantityPerUnit", + d_1."UnitPrice", + d_1."UnitsInStock", + d_1."UnitsOnOrder", + d_1."ReorderLevel", + d_1."Discontinued" +FROM + ( + SELECT DISTINCT + "a_Supplier"."SupplierID" as "SupplierId", + t1."ProductId" + FROM + ( + SELECT DISTINCT + e."ProductID" as "ProductId" + FROM + "Products" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."ProductId" = d."ProductID" + INNER JOIN "Orders" e_1 ON d."OrderID" = e_1."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + LEFT JOIN "Suppliers" "a_Supplier" ON "a_Product"."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" + WHERE + NOT e_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + ) m_1 + INNER JOIN "Products" d_1 ON m_1."SupplierId" = d_1."SupplierID" OR m_1."SupplierId" IS NULL AND d_1."SupplierID" IS NULL +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductID", + d."Discount", + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Supplier"."SupplierID" +FROM + "Products" m_1 + INNER JOIN "Order Details" d ON m_1."ProductID" = d."ProductID" + INNER JOIN "Orders" e ON d."OrderID" = e."OrderID" + LEFT JOIN "Suppliers" "a_Supplier" ON m_1."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" +WHERE + NOT m_1."IsDeleted" AND NOT e."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + p."ProductName", + p."ProductID" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..5eda4221dfa9 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.17,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductName", p."ProductID", s1."Discount", s1."OrderID", s1."CustomerID", s1."EmployeeID", s1."Freight", s1."IsDeleted", s1."OrderDate", s1."RequiredDate", s1."ShipAddress", s1."ShipCity", s1."ShipCountry", s1."ShipName", s1."ShipPostalCode", s1."ShipRegion", s1."ShipVia", s1."ShippedDate", s1."OrderID0", s1."ProductID", s1."ProductID0", s1."SupplierID", s1."ProductID1", s1."CategoryID", s1."Discontinued", s1."IsDeleted0", s1."ProductName", s1."QuantityPerUnit", s1."ReorderLevel", s1."SupplierID0", s1."UnitPrice", s1."UnitsInStock", s1."UnitsOnOrder" +FROM "Products" AS p +LEFT JOIN ( + SELECT o."Discount", o1."OrderID", o1."CustomerID", o1."EmployeeID", o1."Freight", o1."IsDeleted", o1."OrderDate", o1."RequiredDate", o1."ShipAddress", o1."ShipCity", o1."ShipCountry", o1."ShipName", o1."ShipPostalCode", o1."ShipRegion", o1."ShipVia", o1."ShippedDate", o."OrderID" AS "OrderID0", o."ProductID", p1."ProductID" AS "ProductID0", s0."SupplierID", p3."ProductID" AS "ProductID1", p3."CategoryID", p3."Discontinued", p3."IsDeleted" AS "IsDeleted0", p3."ProductName", p3."QuantityPerUnit", p3."ReorderLevel", p3."SupplierID" AS "SupplierID0", p3."UnitPrice", p3."UnitsInStock", p3."UnitsOnOrder" + FROM "Order Details" AS o + INNER JOIN ( + SELECT o0."OrderID", o0."CustomerID", o0."EmployeeID", o0."Freight", o0."IsDeleted", o0."OrderDate", o0."RequiredDate", o0."ShipAddress", o0."ShipCity", o0."ShipCountry", o0."ShipName", o0."ShipPostalCode", o0."ShipRegion", o0."ShipVia", o0."ShippedDate" + FROM "Orders" AS o0 + WHERE @ef_filter__p4 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") + ) AS o1 ON o."OrderID" = o1."OrderID" + INNER JOIN ( + SELECT p0."ProductID", p0."SupplierID" + FROM "Products" AS p0 + WHERE @ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted") + ) AS p1 ON o."ProductID" = p1."ProductID" + LEFT JOIN ( + SELECT s."SupplierID" + FROM "Suppliers" AS s + WHERE @ef_filter__p6 OR NOT (s."IsDeleted") OR NOT (s."IsDeleted") + ) AS s0 ON p1."SupplierID" = s0."SupplierID" + LEFT JOIN ( + SELECT p2."ProductID", p2."CategoryID", p2."Discontinued", p2."IsDeleted", p2."ProductName", p2."QuantityPerUnit", p2."ReorderLevel", p2."SupplierID", p2."UnitPrice", p2."UnitsInStock", p2."UnitsOnOrder" + FROM "Products" AS p2 + WHERE @ef_filter__p0 OR NOT (p2."IsDeleted") OR NOT (p2."IsDeleted") + ) AS p3 ON s0."SupplierID" = p3."SupplierID" + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS s1 ON p."ProductID" = s1."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +ORDER BY p."ProductID", s1."OrderID0", s1."ProductID", s1."OrderID", s1."ProductID0", s1."SupplierID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."SupplierId", + m_1."ProductId", + d_1."IsDeleted", + d_1."ProductID", + d_1."ProductName", + d_1."SupplierID", + d_1."CategoryID", + d_1."QuantityPerUnit", + d_1."UnitPrice", + d_1."UnitsInStock", + d_1."UnitsOnOrder", + d_1."ReorderLevel", + d_1."Discontinued" +FROM + ( + SELECT DISTINCT + "a_Supplier"."SupplierID" as "SupplierId", + t1."ProductId" + FROM + ( + SELECT DISTINCT + e."ProductID" as "ProductId" + FROM + "Products" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."ProductId" = d."ProductID" + INNER JOIN "Orders" e_1 ON d."OrderID" = e_1."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + LEFT JOIN "Suppliers" "a_Supplier" ON "a_Product"."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" + WHERE + NOT e_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + ) m_1 + INNER JOIN "Products" d_1 ON m_1."SupplierId" = d_1."SupplierID" OR m_1."SupplierId" IS NULL AND d_1."SupplierID" IS NULL +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + m_1."ProductID", + d."Discount", + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Supplier"."SupplierID" +FROM + "Products" m_1 + INNER JOIN "Order Details" d ON m_1."ProductID" = d."ProductID" + INNER JOIN "Orders" e ON d."OrderID" = e."OrderID" + LEFT JOIN "Suppliers" "a_Supplier" ON m_1."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" +WHERE + NOT m_1."IsDeleted" AND NOT e."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + p."ProductName", + p."ProductID" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..0847adcfc185 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.17,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", p1."ProductID", p1."CategoryID", p1."Discontinued", p1."IsDeleted", p1."ProductName", p1."QuantityPerUnit", p1."ReorderLevel", p1."SupplierID", p1."UnitPrice", p1."UnitsInStock", p1."UnitsOnOrder" +FROM "Products" AS p +CROSS JOIN ( + SELECT p0."ProductID", p0."CategoryID", p0."Discontinued", p0."IsDeleted", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Products" AS p0 + WHERE (@ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o0 + WHERE (@ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted")) AND p0."ProductID" = o0."ProductID") +) AS p1 +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o + WHERE (@ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted")) AND p."ProductID" = o."ProductID") AND p."ProductID" = p1."ProductID" +ORDER BY p."ProductID" + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued", + pd2."IsDeleted", + pd2."ProductID", + pd2."ProductName", + pd2."SupplierID", + pd2."CategoryID", + pd2."QuantityPerUnit", + pd2."UnitPrice", + pd2."UnitsInStock", + pd2."UnitsOnOrder", + pd2."ReorderLevel", + pd2."Discontinued" +FROM + "Products" e, + "Products" pd2 +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_2 + WHERE + pd2."ProductID" = e_2."ProductID" + ) > 0 AND + e."ProductID" = pd2."ProductID" +ORDER BY + e."ProductID" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..04ba1b8e5f72 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.17,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", p1."ProductID", p1."CategoryID", p1."Discontinued", p1."IsDeleted", p1."ProductName", p1."QuantityPerUnit", p1."ReorderLevel", p1."SupplierID", p1."UnitPrice", p1."UnitsInStock", p1."UnitsOnOrder" +FROM "Products" AS p +CROSS JOIN ( + SELECT p0."ProductID", p0."CategoryID", p0."Discontinued", p0."IsDeleted", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Products" AS p0 + WHERE (@ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o0 + WHERE (@ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted")) AND p0."ProductID" = o0."ProductID") +) AS p1 +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o + WHERE (@ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted")) AND p."ProductID" = o."ProductID") AND p."ProductID" = p1."ProductID" +ORDER BY p."ProductID" + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued", + pd2."IsDeleted", + pd2."ProductID", + pd2."ProductName", + pd2."SupplierID", + pd2."CategoryID", + pd2."QuantityPerUnit", + pd2."UnitPrice", + pd2."UnitsInStock", + pd2."UnitsOnOrder", + pd2."ReorderLevel", + pd2."Discontinued" +FROM + "Products" e, + "Products" pd2 +WHERE + NOT e."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + NOT pd2."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_2 + WHERE + NOT e_2."IsDeleted" AND pd2."ProductID" = e_2."ProductID" + ) > 0 AND + e."ProductID" = pd2."ProductID" +ORDER BY + e."ProductID" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..63067274c9cd --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.17,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" +FROM "Employees" AS e +WHERE (@ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted")) AND e."EmployeeID" = @test + + +-- PostgreSQL.15 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath" +FROM + "Employees" e +WHERE + e."EmployeeID" = :test + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..e531c3a24552 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.17,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" +FROM "Employees" AS e +WHERE (@ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted")) AND e."EmployeeID" = @test + + +-- PostgreSQL.15 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath" +FROM + "Employees" e +WHERE + NOT e."IsDeleted" AND e."EmployeeID" = :test + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..0990c71bdc5a --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.17,False).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."IsDeleted", c."Phone", c."PostalCode", c."Region" +FROM "Customers" AS c +WHERE @ef_filter__p0 OR NOT (c."IsDeleted") OR NOT (c."IsDeleted") +LIMIT 1 + + +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @CompanyName Varchar(34) -- String +SET @CompanyName = 'Ana Trujillo Emparedados y helados' +DECLARE @CustomerId Varchar(5) -- String +SET @CustomerId = 'ANATR' + +UPDATE + "Customers" +SET + "CompanyName" = :CompanyName +WHERE + "Customers"."CustomerID" = :CustomerId + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..521f1ad821a7 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.17,True).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."IsDeleted", c."Phone", c."PostalCode", c."Region" +FROM "Customers" AS c +WHERE @ef_filter__p0 OR NOT (c."IsDeleted") OR NOT (c."IsDeleted") +LIMIT 1 + + +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @CompanyName Varchar(19) -- String +SET @CompanyName = 'Alfreds Futterkiste' +DECLARE @CustomerId Varchar(5) -- String +SET @CustomerId = 'ALFKI' + +UPDATE + "Customers" +SET + "CompanyName" = :CompanyName +WHERE + NOT "Customers"."IsDeleted" AND "Customers"."CustomerID" = :CustomerId + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..3b29b573ef51 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.17,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."QuantityPerUnit" AS "Quantity" +FROM "Products" AS p +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."QuantityPerUnit" +FROM + "Products" p + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..4177f13c9745 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.17,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."QuantityPerUnit" AS "Quantity" +FROM "Products" AS p +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +SELECT + p."QuantityPerUnit" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..a0724be4e659 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.17,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +/* Tagged query */ +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..0b77940afe8d --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.17,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.15 PostgreSQL + +/* Tagged query */ +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" AND NOT "a_ReportsToNavigation"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..a649ec7ecf67 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.17,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..5c91aaf63e7e --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.17,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.15 PostgreSQL + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransaction + + +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..336c14fe6c64 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.17,False).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT max(p."QuantityPerUnit") +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE 'U%' + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + MAX(e."QuantityPerUnit") +FROM + "Products" e +WHERE + e."ProductName" LIKE 'U%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL + +DELETE FROM + "Products" e +WHERE + e."ProductName" = 'a' + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..8371d15eb814 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.17,True).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT max(p."QuantityPerUnit") +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE 'U%' + + +-- PostgreSQL.15 PostgreSQL (asynchronously) + +SELECT + MAX(e."QuantityPerUnit") +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE 'U%' ESCAPE '~' + + + +-- PostgreSQL.15 PostgreSQL + +DELETE FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" = 'a' + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..4add18d4f9bc --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.17,False).sql @@ -0,0 +1,25 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..a791b8e5626d --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.17,True).sql @@ -0,0 +1,27 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" +WHERE + NOT p."IsDeleted" AND NOT c_1."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..4add18d4f9bc --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.17,False).sql @@ -0,0 +1,25 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..a791b8e5626d --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.17,True).sql @@ -0,0 +1,27 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" +WHERE + NOT p."IsDeleted" AND NOT c_1."IsDeleted" + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..c654b34b7aa4 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.17,False).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..c654b34b7aa4 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.17,True).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.15 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..38e8e3ad5e55 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.17,False).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..38e8e3ad5e55 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.17,True).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.15 PostgreSQL (asynchronously) +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.17,False).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.17,False).sql new file mode 100644 index 000000000000..4cff1be3a285 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.17,False).sql @@ -0,0 +1,29 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' + + + diff --git a/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.17,True).sql b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.17,True).sql new file mode 100644 index 000000000000..293ad4e24147 --- /dev/null +++ b/PostgreSQL.17.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.17,True).sql @@ -0,0 +1,29 @@ +-- PostgreSQL.15 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.18).sql new file mode 100644 index 000000000000..fc8761564556 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(PostgreSQL.18).sql @@ -0,0 +1,164 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 1 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'bc7b663d-0fde-4327-8f92-5d8cc3a11d11'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C1' +DECLARE @Name Text(2) -- String +SET @Name = 'N1' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 2 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'a948600d-de21-4f74-8ac2-9516b287076e'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C2' +DECLARE @Name Text(2) -- String +SET @Name = 'N2' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @Id Bigint -- Int64 +SET @Id = 3 +DECLARE @PermanentId Uuid -- Guid +SET @PermanentId = 'bd3973a5-4323-4dd8-9f4f-df9f93e2a627'::uuid +DECLARE @Code Text(2) -- String +SET @Code = 'C3' +DECLARE @Name Text(2) -- String +SET @Name = 'N3' +DECLARE @IsDeleted Boolean +SET @IsDeleted = NULL + +INSERT INTO "Subdivisions" +( + "Id", + "PermanentId", + "Code", + "Name", + "IsDeleted" +) +VALUES +( + :Id, + :PermanentId, + :Code, + :Name, + :IsDeleted +) +RETURNING + "Id" + + + +SELECT s."Id", s."Code", s."IsDeleted", s."Name", s."PermanentId" +FROM "Subdivisions" AS s +WHERE s."Id"::bigint = 1 + + +-- PostgreSQL.18 PostgreSQL + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id"::BigInt = 1 + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @id Bigint -- Int64 +SET @id = 1 + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id" = :id + + + +-- PostgreSQL.18 PostgreSQL + +SELECT + s."Id", + s."PermanentId", + s."Code", + s."Name", + s."IsDeleted" +FROM + "Subdivisions" s +WHERE + s."Id" IN (2, 3) + + + +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."PermanentId", + t1."Code", + t1."Name", + t1."IsDeleted" +FROM + "Subdivisions" t1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..e6405e55213c --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(PostgreSQL.18).sql @@ -0,0 +1,10 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "Issue261Table" t1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..b0e9ac1314ec --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4783Test(PostgreSQL.18).sql @@ -0,0 +1,43 @@ +Parameters: +@p0='?' (DbType = Object), @p1='?', @p2='?' (DbType = Object), @p3='?' (DbType = Object), @p4='?', @p5='?' (DbType = Object), @p6='?' (DbType = Object), @p7='?', @p8='?' (DbType = Object) + +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p0, @p1, @p2) +RETURNING "Id"; +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p3, @p4, @p5) +RETURNING "Id"; +INSERT INTO "Issue4783DBRecords" ("NullableStatus", "Source", "Status") +VALUES (@p6, @p7, @p8) +RETURNING "Id"; + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +INSERT INTO "Issue4783DBRecords" +( + "Source", + "Status", + "NullableStatus" +) +VALUES +('linq2db','open'::issue4783db_status,'open'::issue4783db_status), +('linq2db','closed'::issue4783db_status,'closed'::issue4783db_status), +('linq2db','closed'::issue4783db_status,NULL) + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4783DBRecords" t1 +ORDER BY + t1."Id" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..d73129c4b2d6 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4917Test(PostgreSQL.18).sql @@ -0,0 +1,10 @@ +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Name" +FROM + "Issue4917DBRecords" t1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..22cf82990c66 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test(PostgreSQL.18).sql @@ -0,0 +1,161 @@ +-- PostgreSQL.18 PostgreSQL + +CREATE TEMPORARY TABLE issue_4940_temp_table +( + "Id" integer NOT NULL, + "Source" text NOT NULL, + "Status" issue4940db_status NOT NULL, + "NullableStatus" issue4940db_status NULL +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.18 PostgreSQL + +INSERT INTO issue_4940_temp_table +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +(1,'TempTable','open'::issue4940db_status,'closed'::issue4940db_status), +(2,'TempTable','closed'::issue4940db_status,NULL) + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 1 +DECLARE @Source Text(6) -- String +SET @Source = 'Insert' +DECLARE @Status Enum -- Object +SET @Status = 'open'::issue4940db_status +DECLARE @NullableStatus Enum -- Object +SET @NullableStatus = 'closed'::issue4940db_status + +INSERT INTO "Issue4940DBRecords" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + :Id, + :Source, + :Status, + :NullableStatus +) + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 2 +DECLARE @Source Text(6) -- String +SET @Source = 'Insert' +DECLARE @Status Enum -- Object +SET @Status = 'closed'::issue4940db_status +DECLARE @NullableStatus Unknown -- Object +SET @NullableStatus = NULL + +INSERT INTO "Issue4940DBRecords" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + :Id, + :Source, + :Status, + :NullableStatus +) + + + +INSERT BULK "Issue4940DBRecords"(Id, Source, Status, NullableStatus) + + + +-- PostgreSQL.18 PostgreSQL + +MERGE INTO "Issue4940DBRecords" "Target" +USING (VALUES + ('Merge',5,'open'::issue4940db_status,'open'::issue4940db_status), + ('Merge',6,'open'::issue4940db_status,NULL) +) "Source" +( + "Source", + "Id", + "Status", + "NullableStatus" +) +ON ("Target"."Source" = "Source"."Source") + +WHEN NOT MATCHED THEN +INSERT +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + "Source"."Id", + "Source"."Source", + "Source"."Status", + "Source"."NullableStatus" +) + +WHEN MATCHED THEN +UPDATE +SET + "Id" = "Source"."Id", + "Source" = "Source"."Source", + "Status" = "Source"."Status", + "NullableStatus" = "Source"."NullableStatus" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4940DBRecords" t1 +ORDER BY + t1."Id" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + issue_4940_temp_table t1 +ORDER BY + t1."Id" + + + +-- PostgreSQL.18 PostgreSQL + +DROP TABLE IF EXISTS issue_4940_temp_table + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test_NotMapped(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test_NotMapped(PostgreSQL.18).sql new file mode 100644 index 000000000000..ed46c9895346 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4940Test_NotMapped(PostgreSQL.18).sql @@ -0,0 +1,120 @@ +-- PostgreSQL.18 PostgreSQL + +CREATE TEMPORARY TABLE "Issue4940RecordNotMapped" +( + "Id" Int NOT NULL, + "Source" text NULL, + "Status" issue4940db_status NOT NULL, + "NullableStatus" issue4940db_status NULL +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.18 PostgreSQL + +INSERT INTO "Issue4940RecordNotMapped" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +(1,'TempTable','open'::issue4940db_status,'open'::issue4940db_status), +(2,'TempTable','closed'::issue4940db_status,NULL) + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 3 +DECLARE @Source Text(6) -- String +SET @Source = 'Insert' +DECLARE @Status Enum -- Object +SET @Status = 'open'::issue4940db_status +DECLARE @NullableStatus Unknown -- Object +SET @NullableStatus = NULL + +INSERT INTO "Issue4940RecordNotMapped" +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + :Id, + :Source, + :Status, + :NullableStatus +) + + + +INSERT BULK "Issue4940RecordNotMapped"(Id, Source, Status, NullableStatus) + + + +-- PostgreSQL.18 PostgreSQL + +MERGE INTO "Issue4940RecordNotMapped" "Target" +USING (VALUES + ('Merge',6,'open'::issue4940db_status,'closed'::issue4940db_status), + ('Merge',7,'open'::issue4940db_status,NULL) +) "Source" +( + "Source", + "Id", + "Status", + "NullableStatus" +) +ON ("Target"."Source" = "Source"."Source" OR "Target"."Source" IS NULL AND "Source"."Source" IS NULL) + +WHEN NOT MATCHED THEN +INSERT +( + "Id", + "Source", + "Status", + "NullableStatus" +) +VALUES +( + "Source"."Id", + "Source"."Source", + "Source"."Status", + "Source"."NullableStatus" +) + +WHEN MATCHED THEN +UPDATE +SET + "Id" = "Source"."Id", + "Source" = "Source"."Source", + "Status" = "Source"."Status", + "NullableStatus" = "Source"."NullableStatus" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Source", + t1."Status", + t1."NullableStatus" +FROM + "Issue4940RecordNotMapped" t1 +ORDER BY + t1."Id" + + + +-- PostgreSQL.18 PostgreSQL + +DROP TABLE IF EXISTS "Issue4940RecordNotMapped" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.18).sql new file mode 100644 index 000000000000..51c3d7adada3 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(PostgreSQL.18).sql @@ -0,0 +1,5 @@ +SELECT w."Id", w."Value" +FROM "WithDuplicateProperties" AS w +WHERE w."Value" = 1 + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.18).sql new file mode 100644 index 000000000000..be1c112d3b5b --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(PostgreSQL.18).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.18 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.18 PostgreSQL + +INSERT INTO "NoIdentity" +( + "Id", + "Name" +) +VALUES +('bc7b663d-0fde-4327-8f92-5d8cc3a11d11'::uuid,'John Doe'), +('a948600d-de21-4f74-8ac2-9516b287076e'::uuid,'Jane Doe') + + + +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.18 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.18).sql new file mode 100644 index 000000000000..2c3a1d024628 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(PostgreSQL.18).sql @@ -0,0 +1,32 @@ +Parameters: +@p0='?', @p1='?', @p2='?', @p3='?', @p4='?' + +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p0) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p1) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p2) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p3) +RETURNING "Id"; +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p4) +RETURNING "Id"; + + +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Discriminator", + t1."Id" +FROM + "WithInheritance" t1 +WHERE + t1."Discriminator" IN ('WithInheritanceA2', 'WithInheritanceA1', 'WithInheritanceA') + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.18).sql new file mode 100644 index 000000000000..8d54626fb72c --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(PostgreSQL.18).sql @@ -0,0 +1,33 @@ +-- PostgreSQL.18 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +INSERT ASYNC BULK "NoIdentity"(Id, Name) + + + +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.18 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.18).sql new file mode 100644 index 000000000000..61cc2ca964e4 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(PostgreSQL.18).sql @@ -0,0 +1,33 @@ +-- PostgreSQL.18 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +INSERT BULK "NoIdentity"(Id, Name) + + + +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."Name" +FROM + "NoIdentity" t1 + + + +-- PostgreSQL.18 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.18).sql new file mode 100644 index 000000000000..1624065c806a --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(PostgreSQL.18).sql @@ -0,0 +1,76 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +INSERT INTO "SkipModes" ("Id", "InsertOnly") +VALUES (@p0, @p1); + + +-- PostgreSQL.18 PostgreSQL +DECLARE @Id Integer -- Int32 +SET @Id = 2 +DECLARE @InsertOnly Integer -- Int32 +SET @InsertOnly = 2 + +INSERT INTO "SkipModes" +( + "Id", + "InsertOnly" +) +VALUES +( + :Id, + :InsertOnly +) + + + +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."InsertOnly", + t1."UpdateOnly", + t1."ReadOnly" +FROM + "SkipModes" t1 +ORDER BY + t1."Id" + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +UPDATE "SkipModes" SET "UpdateOnly" = @p0 +WHERE "Id" = @p1; + + +-- PostgreSQL.18 PostgreSQL +DECLARE @UpdateOnly Integer -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id Integer -- Int32 +SET @Id = 2 + +UPDATE + "SkipModes" +SET + "UpdateOnly" = :UpdateOnly +WHERE + "SkipModes"."Id" = :Id + + + +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."InsertOnly", + t1."UpdateOnly", + t1."ReadOnly" +FROM + "SkipModes" t1 +ORDER BY + t1."Id" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.18).sql new file mode 100644 index 000000000000..90c6c0cff2bf --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(PostgreSQL.18).sql @@ -0,0 +1,38 @@ +-- PostgreSQL.18 PostgreSQL + +CREATE TEMPORARY TABLE "WithIdentity" +( + "Id" integer NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_WithIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.18 PostgreSQL + +CREATE TEMPORARY TABLE "NoIdentity" +( + "Id" uuid NOT NULL, + "Name" text NOT NULL, + + CONSTRAINT "PK_NoIdentity" PRIMARY KEY ("Id") +) +ON COMMIT PRESERVE ROWS + + + +-- PostgreSQL.18 PostgreSQL + +DROP TABLE IF EXISTS "NoIdentity" + + + +-- PostgreSQL.18 PostgreSQL + +DROP TABLE IF EXISTS "WithIdentity" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.18).sql new file mode 100644 index 000000000000..4a8d5a6644da --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(PostgreSQL.18).sql @@ -0,0 +1,28 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int64), @p3='?' (DbType = Int64), @p4='?' (DbType = Decimal), @p5='?' (DbType = Decimal) + +INSERT INTO "UIntTable" ("Field16", "Field16N", "Field32", "Field32N", "Field64", "Field64N") +VALUES (@p0, @p1, @p2, @p3, @p4, @p5) +RETURNING "ID"; + + +-- PostgreSQL.18 PostgreSQL (asynchronously) +DECLARE @field64 Numeric(1, 0) -- Decimal +SET @field64 = 5 + +SELECT + e."ID", + e."Field16", + e."Field32", + e."Field64", + e."Field16N", + e."Field32N", + e."Field64N" +FROM + "UIntTable" e +WHERE + e."Field64" = :field64 +LIMIT 1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.18,False,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.18,False,False).sql new file mode 100644 index 000000000000..4fadd949b642 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.18,False,False).sql @@ -0,0 +1,12 @@ +SELECT e.id, e.name, s0.id, s0.master_id, s0.name, s0.id0, s0.master_id0, s0.name0, c.id, c.name, c.parent_id +FROM entities AS e +LEFT JOIN ( + SELECT d.id, d.master_id, d.name, s.id AS id0, s.master_id AS master_id0, s.name AS name0 + FROM details AS d + LEFT JOIN sub_details AS s ON d.id = s.master_id +) AS s0 ON e.id = s0.master_id +LEFT JOIN children AS c ON e.id = c.parent_id +WHERE e.name = 'Alpha' +ORDER BY e.id, s0.id, s0.id0 + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.18,False,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.18,False,True).sql new file mode 100644 index 000000000000..4fadd949b642 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.18,False,True).sql @@ -0,0 +1,12 @@ +SELECT e.id, e.name, s0.id, s0.master_id, s0.name, s0.id0, s0.master_id0, s0.name0, c.id, c.name, c.parent_id +FROM entities AS e +LEFT JOIN ( + SELECT d.id, d.master_id, d.name, s.id AS id0, s.master_id AS master_id0, s.name AS name0 + FROM details AS d + LEFT JOIN sub_details AS s ON d.id = s.master_id +) AS s0 ON e.id = s0.master_id +LEFT JOIN children AS c ON e.id = c.parent_id +WHERE e.name = 'Alpha' +ORDER BY e.id, s0.id, s0.id0 + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.18,True,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.18,True,False).sql new file mode 100644 index 000000000000..bc573018b306 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.18,True,False).sql @@ -0,0 +1,76 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1."Id", + m_1."Id_1", + d_1.id, + d_1.master_id, + d_1.name +FROM + ( + SELECT DISTINCT + d.id as "Id", + t1."Id" as "Id_1" + FROM + ( + SELECT DISTINCT + e.id as "Id" + FROM + entities e + WHERE + e.name = 'Alpha' + ) t1 + INNER JOIN details d ON t1."Id" = d.master_id + ) m_1 + INNER JOIN sub_details d_1 ON m_1."Id" = d_1.master_id + + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1.id, + d.id, + d.master_id, + d.name +FROM + entities m_1 + INNER JOIN details d ON m_1.id = d.master_id +WHERE + m_1.name = 'Alpha' + + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1.id, + d.id, + d.parent_id, + d.name +FROM + entities m_1 + INNER JOIN children d ON m_1.id = d.parent_id +WHERE + m_1.name = 'Alpha' + + + +DisposeTransaction + + +-- PostgreSQL.18 PostgreSQL + +SELECT + e.id, + e.name +FROM + entities e +WHERE + e.name = 'Alpha' + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.18,True,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.18,True,True).sql new file mode 100644 index 000000000000..bc573018b306 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestIncludeDetails(PostgreSQL.18,True,True).sql @@ -0,0 +1,76 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1."Id", + m_1."Id_1", + d_1.id, + d_1.master_id, + d_1.name +FROM + ( + SELECT DISTINCT + d.id as "Id", + t1."Id" as "Id_1" + FROM + ( + SELECT DISTINCT + e.id as "Id" + FROM + entities e + WHERE + e.name = 'Alpha' + ) t1 + INNER JOIN details d ON t1."Id" = d.master_id + ) m_1 + INNER JOIN sub_details d_1 ON m_1."Id" = d_1.master_id + + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1.id, + d.id, + d.master_id, + d.name +FROM + entities m_1 + INNER JOIN details d ON m_1.id = d.master_id +WHERE + m_1.name = 'Alpha' + + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1.id, + d.id, + d.parent_id, + d.name +FROM + entities m_1 + INNER JOIN children d ON m_1.id = d.parent_id +WHERE + m_1.name = 'Alpha' + + + +DisposeTransaction + + +-- PostgreSQL.18 PostgreSQL + +SELECT + e.id, + e.name +FROM + entities e +WHERE + e.name = 'Alpha' + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.18).sql new file mode 100644 index 000000000000..1f665e79775c --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertEfCore(PostgreSQL.18).sql @@ -0,0 +1,13 @@ +Parameters: +@p0='test insert ef' (Nullable = false) + +INSERT INTO entities (name) +VALUES (@p0) +RETURNING id; + + +SELECT e.id, e.name +FROM entities AS e +LIMIT 2 + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.18).sql new file mode 100644 index 000000000000..9d5bde695f88 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestInsertWithoutNew(PostgreSQL.18).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @name Text(11) -- String +SET @name = 'test insert' + +INSERT INTO entities +( + name +) +VALUES +( + :name +) +RETURNING + id + + + +Parameters: +@id='50' + +SELECT e.id, e.name +FROM entities AS e +WHERE e.id::bigint = @id +LIMIT 2 + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.18,False,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.18,False,True).sql new file mode 100644 index 000000000000..803b4f11e467 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.18,False,True).sql @@ -0,0 +1,10 @@ +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.18,True,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.18,True,False).sql new file mode 100644 index 000000000000..2b617408eaa6 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.18,True,False).sql @@ -0,0 +1,31 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.18 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.18,True,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.18,True,True).sql new file mode 100644 index 000000000000..2b617408eaa6 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyInclude(PostgreSQL.18,True,True).sql @@ -0,0 +1,31 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.18 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..f975e7d372a1 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.18,False).sql @@ -0,0 +1,41 @@ +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.18 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..350edce7f5c8 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestManyToManyIncludeTrackerPoison(PostgreSQL.18,True).sql @@ -0,0 +1,41 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1.id, + d.entity_id, + d.item_id, + "a_Item".id, + "a_Item".name +FROM + entities m_1 + INNER JOIN entity2_item d ON m_1.id = d.entity_id + INNER JOIN items "a_Item" ON d.item_id = "a_Item".id + + + +DisposeTransaction + + +-- PostgreSQL.18 PostgreSQL + +SELECT + t1.id, + t1.name +FROM + entities t1 + + + +SELECT e.id, e.name, s.entity_id, s.item_id, s.id, s.name +FROM entities AS e +LEFT JOIN ( + SELECT e0.entity_id, e0.item_id, i.id, i.name + FROM entity2_item AS e0 + INNER JOIN items AS i ON e0.item_id = i.id +) AS s ON e.id = s.entity_id +ORDER BY e.id, s.entity_id, s.item_id + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.18,False,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.18,False,True).sql new file mode 100644 index 000000000000..8d38ce10d713 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.18,False,True).sql @@ -0,0 +1,5 @@ +SELECT d.id, d.master_id, d.name, e.id, e.name +FROM details AS d +INNER JOIN entities AS e ON d.master_id = e.id + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.18,True,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.18,True,False).sql new file mode 100644 index 000000000000..9d7cc4c16d40 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.18,True,False).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.18,True,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.18,True,True).sql new file mode 100644 index 000000000000..9d7cc4c16d40 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude(PostgreSQL.18,True,True).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.18,False,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.18,False,True).sql new file mode 100644 index 000000000000..8d38ce10d713 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.18,False,True).sql @@ -0,0 +1,5 @@ +SELECT d.id, d.master_id, d.name, e.id, e.name +FROM details AS d +INNER JOIN entities AS e ON d.master_id = e.id + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.18,True,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.18,True,True).sql new file mode 100644 index 000000000000..9d7cc4c16d40 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IdTests/LinqToDB.EntityFrameworkCore.Tests.IdTests.TestMasterInclude2(PostgreSQL.18,True,True).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + t1.id, + t1.master_id, + t1.name, + "a_Master".id, + "a_Master".name +FROM + details t1 + INNER JOIN entities "a_Master" ON t1.master_id = "a_Master".id + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.18,Default).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.18,Default).sql new file mode 100644 index 000000000000..98a2a1074633 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.18,Default).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.18,MultipleRows).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.18,MultipleRows).sql new file mode 100644 index 000000000000..98a2a1074633 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.18,MultipleRows).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.18,ProviderSpecific).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.18,ProviderSpecific).sql new file mode 100644 index 000000000000..98a2a1074633 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.18,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.18,RowByRow).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.18,RowByRow).sql new file mode 100644 index 000000000000..98a2a1074633 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(PostgreSQL.18,RowByRow).sql @@ -0,0 +1,42 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @BlogType Varchar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url Text(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @BlogType Varchar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url Text(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO "Blogs" +( + "BlogType", + "Url" +) +VALUES +( + :BlogType, + :Url +) + + + +SELECT b."Id", b."BlogType", b."Url" +FROM "Blogs" AS b + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.18).sql new file mode 100644 index 000000000000..adeb323d784c --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(PostgreSQL.18).sql @@ -0,0 +1,10 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @p='?' (DbType = Int32) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductID" > 0 +ORDER BY p."ProductID" +LIMIT @p + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.18).sql new file mode 100644 index 000000000000..494a8d04099b --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(PostgreSQL.18).sql @@ -0,0 +1,52 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.18).sql new file mode 100644 index 000000000000..bce5ee50bde7 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(PostgreSQL.18).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.18).sql new file mode 100644 index 000000000000..bce5ee50bde7 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(PostgreSQL.18).sql @@ -0,0 +1,26 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 2 + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductID" > 0 +ORDER BY + e."ProductID" +LIMIT :take + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.18).sql new file mode 100644 index 000000000000..89c1175c11c5 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(PostgreSQL.18).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id" +FROM + "Patents" t1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..6d46321cc069 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(PostgreSQL.18).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT p."Id" AS "PatentId", @userId0 AS "UserId" +FROM "Patents" AS p +LEFT JOIN "PatentAssessment" AS p0 ON p."Id" = p0."PatentId" +WHERE p0."PatentId" IS NULL OR p0."TechnicalReviewerId" <> @userId OR p0."TechnicalReviewerId" IS NULL + + +-- PostgreSQL.18 PostgreSQL +DECLARE @userId Integer -- Int32 +SET @userId = 1 + +SELECT + p."Id" +FROM + "Patents" p + LEFT JOIN "PatentAssessment" "a_Assessment" ON p."Id" = "a_Assessment"."PatentId" +WHERE + "a_Assessment"."PatentId" IS NULL OR "a_Assessment"."TechnicalReviewerId" <> :userId OR + "a_Assessment"."TechnicalReviewerId" IS NULL + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..8ad699017e2a --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue155Test(PostgreSQL.18).sql @@ -0,0 +1,21 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + e."Id", + e."Linked", + ( + SELECT + ARRAY_AGG(DISTINCT r."Id") + FROM + "Issue155Table" r + WHERE + e."Id" = ANY(r."Linked") + ) +FROM + "Issue155Table" e +WHERE + e."Id" = 1 +LIMIT 2 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.18).sql new file mode 100644 index 000000000000..c4248d5dd841 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(PostgreSQL.18).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + COUNT(*) +FROM + "Parents" x +WHERE + ( + SELECT + "a_Children"."IsActive" + FROM + "Children" "a_Children" + WHERE + x."Id" = "a_Children"."ParentId" + LIMIT 1 + ) = False + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.18).sql new file mode 100644 index 000000000000..f58c7ec86d30 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(PostgreSQL.18).sql @@ -0,0 +1,18 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + COUNT(*) +FROM + "Parents" x +WHERE + NOT EXISTS( + SELECT + * + FROM + "Children" y + WHERE + x."Id" = y."ParentId" AND y."IsActive" + ) + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..89c1175c11c5 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(PostgreSQL.18).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id" +FROM + "Patents" t1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..e03006b7d17e --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(PostgreSQL.18).sql @@ -0,0 +1,11 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + x."Id" +FROM + "Issue340Entities" x +WHERE + x."IsActive" = True + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..398cb8da3fa0 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue3491Test(PostgreSQL.18).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.18 PostgreSQL + +UPDATE + "PostgreTestTable" +SET + ("Title", "SearchVector") = ( + SELECT + "PostgreTestTable"."Title", + to_tsvector('test') + FROM + "PostgreTestTable" x + WHERE + "PostgreTestTable"."Id" = x."Id" + ) +WHERE + "PostgreTestTable"."Id" = 1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..78446e3f1889 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(PostgreSQL.18).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + 1 +FROM + "Parents" ua +WHERE + ua."ParentId" = 55377 AND EXISTS( + SELECT + * + FROM + "Parents" t1 + ) + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.18).sql new file mode 100644 index 000000000000..595424efab1b --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(PostgreSQL.18).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @DateTimeOffset TimestampTz -- DateTime +SET @DateTimeOffset = '2020-02-29T17:54:55.1231234+00:00' +DECLARE @DateTimeOffsetN TimestampTz -- DateTime +SET @DateTimeOffsetN = '2020-02-29T17:54:55.1231234+00:00' + +UPDATE + "Types" +SET + "DateTimeOffset" = :DateTimeOffset, + "DateTimeOffsetN" = :DateTimeOffsetN +WHERE + "Types"."Id" = 2 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.18).sql new file mode 100644 index 000000000000..b5eb7583db48 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(PostgreSQL.18).sql @@ -0,0 +1,16 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @DateTimeOffsetWithConverter Bigint -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter Bigint -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + "Types" +SET + "DateTimeOffsetWithConverter" = :DateTimeOffsetWithConverter, + "DateTimeOffsetNWithConverter" = :DateTimeOffsetNWithConverter +WHERE + "Types"."Id" = 2 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.18).sql new file mode 100644 index 000000000000..ba4e3496f65d --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test1(PostgreSQL.18).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1."Id", + d_1."Key_1", + d_1."SUM_1", + d_1."Issue4626AnyValue" +FROM + "Parents" m_1 + INNER JOIN LATERAL ( + SELECT + d."ParentId" as "Key_1", + SUM(d."Id") as "SUM_1", + ANY_VALUE(d."Name") as "Issue4626AnyValue" + FROM + "Children" d + WHERE + m_1."Id" = d."ParentId" + GROUP BY + d."ParentId" + ) d_1 ON 1=1 + + + +DisposeTransaction + + +-- PostgreSQL.18 PostgreSQL + +SELECT + c_1."Id" +FROM + "Parents" c_1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.18).sql new file mode 100644 index 000000000000..3ff6f2931e00 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(PostgreSQL.18).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1."Id", + d_1."Key_1", + d_1."SUM_1", + d_1."ToValue" +FROM + "Parents" m_1 + INNER JOIN LATERAL ( + SELECT + d."ParentId" as "Key_1", + SUM(d."Id") as "SUM_1", + STRING_AGG(d."Name", ', ') as "ToValue" + FROM + "Children" d + WHERE + m_1."Id" = d."ParentId" + GROUP BY + d."ParentId" + ) d_1 ON 1=1 + + + +DisposeTransaction + + +-- PostgreSQL.18 PostgreSQL + +SELECT + c_1."Id" +FROM + "Parents" c_1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..4fdd6741cf3b --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(PostgreSQL.18).sql @@ -0,0 +1,36 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @take Integer -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + id."Id" +FROM + ( + SELECT + p."Id" + FROM + "Issue4629Posts" p + WHERE + ( + SELECT + SUM("a_Tags"."Weight") + FROM + "Issue4629Tags" "a_Tags" + WHERE + p."Id" = "a_Tags"."PostId" AND "a_Tags"."Weight" > 1 + ) > 5 + ORDER BY + ( + SELECT + SUM("a_Tags_1"."Weight") + FROM + "Issue4629Tags" "a_Tags_1" + WHERE + p."Id" = "a_Tags_1"."PostId" + ) + LIMIT :take + ) id + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..b0fbfb0cc386 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(PostgreSQL.18).sql @@ -0,0 +1,20 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @id Integer -- Int32 +SET @id = 2 + +SELECT + t1."Index_1" +FROM + ( + SELECT + x."Id", + ROW_NUMBER() OVER(ORDER BY x."Id") as "Index_1" + FROM + "Parents" x + ) t1 +WHERE + t1."Id" = :id +LIMIT 1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..e7f8e5d567b7 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(PostgreSQL.18).sql @@ -0,0 +1,40 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1."Key_1", + d."CfAllowValue", + d."DateFrom" +FROM + ( + SELECT + p."AclNameId" as "Key_1" + FROM + "Issue4624Items" p + GROUP BY + p."AclNameId" + LIMIT 1 + ) m_1 + INNER JOIN "Issue4624Items" d ON m_1."Key_1" = d."AclNameId" +ORDER BY + d."DateFrom" + + + +-- PostgreSQL.18 PostgreSQL + +SELECT + p."AclNameId" +FROM + "Issue4624Items" p +GROUP BY + p."AclNameId" +LIMIT 1 + + + +DisposeTransaction + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..6d50e846fe0e --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(PostgreSQL.18).sql @@ -0,0 +1,47 @@ +-- PostgreSQL.18 PostgreSQL (asynchronously) +DECLARE @systemId Varchar(6) -- String +SET @systemId = 'system' + +MERGE INTO "Issue4642Table2" "Target" +USING ( + SELECT + y."Id", + y."SystemId", + y."Timestamp" as "Timestamp_1" + FROM + "Issue4642Table1" x + INNER JOIN "Issue4642Table2" y ON x."Id" = y."Id" + WHERE + x."Id" IN (1) AND y."SystemId" = :systemId +) "Source" +( + "Id", + "SystemId", + "Timestamp_1" +) +ON ("Target"."Id" = "Source"."Id" AND "Target"."SystemId" = "Source"."SystemId") + +WHEN MATCHED THEN +UPDATE +SET + "Timestamp" = "Source"."Timestamp_1" + +WHEN NOT MATCHED THEN +INSERT +( + "Id", + "SystemId", + "Timestamp" +) +VALUES +( + "Source"."Id", + "Source"."SystemId", + "Source"."Timestamp_1" +) +RETURNING + merge_action(), + NEW."Id" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..f9b05c441471 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(PostgreSQL.18).sql @@ -0,0 +1,9 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id" +FROM + "Masters" t1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4667Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4667Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..745e05297194 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4667Test(PostgreSQL.18).sql @@ -0,0 +1,31 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @value Json -- Object +SET @value = {[property, value]} + +MERGE INTO "Issue4667" "Target" +USING (VALUES + (1,'{"test" : 1}'::jsonb,:value::json) +) "Source" +( + "Id", + "Payload", + "Headers" +) +ON ("Target".id = "Source"."Id") + +WHEN NOT MATCHED THEN +INSERT +( + id, + payload, + headers +) +VALUES +( + "Source"."Id", + "Source"."Payload", + "Source"."Headers" +) + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..79cdc01fd1b6 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(PostgreSQL.18).sql @@ -0,0 +1,21 @@ +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + x."Id", + x."IsActive", + x."ParentId", + x."Name" +FROM + "Children" x +WHERE + x."Name" LIKE '%Test%' ESCAPE '~' +ORDER BY + x."Name" + + + +SELECT c."Id", c."IsActive", c."Name", c."ParentId" +FROM "Children" AS c +WHERE c."Name" LIKE 'Test%' + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..ff5f58a85dad --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.18,False).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..ff5f58a85dad --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(PostgreSQL.18,True).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..ff5f58a85dad --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.18,False).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..ff5f58a85dad --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(PostgreSQL.18,True).sql @@ -0,0 +1,12 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."Id", + t1."MasterId", + "a_Master"."Id" +FROM + "Details" t1 + INNER JOIN "Masters" "a_Master" ON t1."MasterId" = "a_Master"."Id" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.18).sql new file mode 100644 index 000000000000..cb12b6b4f52d --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(PostgreSQL.18).sql @@ -0,0 +1,18 @@ +SELECT COALESCE(i0."Name", '') || '>' || i."Name" +FROM "Issue73Entities" AS i +LEFT JOIN "Issue73Entities" AS i0 ON i."ParentId" = i0."Id" +WHERE i."Name" = 'Name1_3' + + +-- PostgreSQL.18 PostgreSQL + +SELECT + "a_Parent"."Name" || '>' || x."Name" +FROM + "Issue73Entities" x + LEFT JOIN "Issue73Entities" "a_Parent" ON x."ParentId" = "a_Parent"."Id" +WHERE + x."Name" = 'Name1_3' + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.18).sql new file mode 100644 index 000000000000..d03ad7989c26 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(PostgreSQL.18).sql @@ -0,0 +1,30 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32) + +INSERT INTO "IssueEnum" ("Value") +VALUES (@p0) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p1) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p2) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p3) +RETURNING "Id"; +INSERT INTO "IssueEnum" ("Value") +VALUES (@p4) +RETURNING "Id"; + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + t1."Id", + t1."Value" +FROM + "IssueEnum" t1 + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.18).sql new file mode 100644 index 000000000000..a8f4887e8534 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestArray(PostgreSQL.18).sql @@ -0,0 +1,14 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @guids -2147483621 -- Object +SET @guids = {'271425b1-ebe8-400d-b71d-a6e47a460ae3'::uuid,'b75de94e-6d7b-4c70-bfa1-f8639a6a5b35'::uuid} + +SELECT + m_1."Id", + m_1."Guids" +FROM + "EntityWithArrays" m_1 +WHERE + m_1."Guids" && :guids + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.18).sql new file mode 100644 index 000000000000..0e6e2e18b123 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestConcurrencyToken(PostgreSQL.18).sql @@ -0,0 +1,20 @@ +-- PostgreSQL.18 PostgreSQL + +INSERT INTO "EntityWithXmin" +( + "Value" +) +VALUES +('Str1'), +('Str2'), +('Str3'), +('Str4'), +('Str5'), +('Str6'), +('Str7'), +('Str8'), +('Str9'), +('Str10') + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.18,Local).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.18,Local).sql new file mode 100644 index 000000000000..537891bf00a5 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.18,Local).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.18,Unspecified).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.18,Unspecified).sql new file mode 100644 index 000000000000..537891bf00a5 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.18,Unspecified).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.18,Utc).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.18,Utc).sql new file mode 100644 index 000000000000..537891bf00a5 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestDateTimeKind(PostgreSQL.18,Utc).sql @@ -0,0 +1,90 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @dt Timestamp -- DateTime2 +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp1" = :dt + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @ldt Timestamp -- DateTime2 +SET @ldt = 02/29/2020 17:54:55 + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."Timestamp2" = :ldt + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @dt TimestampTz -- DateTime +SET @dt = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ1" = :dt + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @dto TimestampTz -- DateTime +SET @dto = '2020-02-29T17:14:55.1231234+00:00' + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ2" = :dto + + + +-- PostgreSQL.18 PostgreSQL +DECLARE @ins TimestampTz -- DateTime +SET @ins = 2020-02-29T17:14:55Z + +SELECT + e."Id", + e."Timestamp1", + e."Timestamp2", + e."TimestampTZ1", + e."TimestampTZ2", + e."TimestampTZ3" +FROM + "TimeStamps" e +WHERE + e."TimestampTZ3" = :ins + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.18).sql new file mode 100644 index 000000000000..9d7c2acabf1d --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestFunctionsMapping(PostgreSQL.18).sql @@ -0,0 +1,27 @@ +Parameters: +@date='?' (DbType = DateTime2) + +SELECT e."Id", e."Duration", e."Name" +FROM "Events" AS e +WHERE e."Duration" @> @date OR lower(e."Duration") = @date OR upper(e."Duration") = @date OR isempty(e."Duration") OR isempty(e."Duration" * e."Duration") + + +-- PostgreSQL.18 PostgreSQL +DECLARE @date Timestamp -- DateTime2 +SET @date = '2020-02-29 17:54:55.123'::timestamp + +SELECT + e."Id", + e."Name", + e."Duration" +FROM + "Events" e +WHERE + e."Duration" @> :date OR + lower(e."Duration") = :date OR + upper(e."Duration") = :date OR + isempty(e."Duration") OR + isempty(e."Duration" * e."Duration") + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.18).sql new file mode 100644 index 000000000000..8769339b9603 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestUnnest(PostgreSQL.18).sql @@ -0,0 +1,15 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @guids -2147483621 -- Object +SET @guids = {'271425b1-ebe8-400d-b71d-a6e47a460ae3'::uuid,'b75de94e-6d7b-4c70-bfa1-f8639a6a5b35'::uuid} + +SELECT + m_1."Id", + m_1."Guids" +FROM + "EntityWithArrays" m_1 + INNER JOIN LATERAL UNNEST(m_1."Guids") g_1(value) ON 1=1 +WHERE + m_1."Guids" && :guids + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.18).sql new file mode 100644 index 000000000000..5ad202f249b9 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/NpgSqlTests/LinqToDB.EntityFrameworkCore.Tests.NpgSqlTests.TestViewMapping(PostgreSQL.18).sql @@ -0,0 +1,16 @@ +SELECT e."Name" +FROM views."EventsView" AS e +WHERE e."Name" LIKE 'any%' + + +-- PostgreSQL.18 PostgreSQL + +SELECT + e."Name" +FROM + views."EventsView" e +WHERE + e."Name" LIKE 'any%' ESCAPE '~' + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.18).sql new file mode 100644 index 000000000000..20c039cb4708 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(PostgreSQL.18).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" IS NOT NULL + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.18).sql new file mode 100644 index 000000000000..6ce26ebb3f8c --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(PostgreSQL.18).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" LIKE '%anything%' ESCAPE '~' + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.18).sql new file mode 100644 index 000000000000..1cee7e745765 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(PostgreSQL.18).sql @@ -0,0 +1,24 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @value Varchar(10) -- String +SET @value = '%anything%' + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."Address" LIKE :value ESCAPE '~' + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.18).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.18).sql new file mode 100644 index 000000000000..9f73e4aa67fb --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(PostgreSQL.18).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o1."OrderID", o1."ProductID", p0."ProductID", o3."OrderId", o3."ProductId", o3."Quantity", o1."Quantity", p0."ProductName" +FROM "Orders" AS o +INNER JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Quantity" + FROM "Order Details" AS o0 + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS o1 ON o."OrderID" = o1."OrderID" +INNER JOIN ( + SELECT p."ProductID", p."ProductName" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +) AS p0 ON o1."ProductID" = p0."ProductID" +LEFT JOIN ( + SELECT o2."OrderID" AS "OrderId", o2."ProductID" AS "ProductId", o2."Quantity" + FROM "Order Details" AS o2 + WHERE @ef_filter__p2 OR NOT (o2."IsDeleted") OR NOT (o2."IsDeleted") +) AS o3 ON p0."ProductID" = o3."ProductId" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", o1."OrderID", o1."ProductID", p0."ProductID", o3."OrderId" + + +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1."ProductId", + d."OrderID", + d."ProductID", + d."Quantity" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId" + FROM + "Orders" e + INNER JOIN "Order Details" od ON e."OrderID" = od."OrderID" + INNER JOIN "Products" "a_Product" ON od."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d ON m_1."ProductId" = d."ProductID" + + + +DisposeTransaction + + +-- PostgreSQL.18 PostgreSQL + +SELECT + "a_Product"."ProductID", + od."OrderID", + od."ProductID", + od."Quantity", + "a_Product"."ProductName" +FROM + "Orders" o + INNER JOIN "Order Details" od ON o."OrderID" = od."OrderID" + INNER JOIN "Products" "a_Product" ON od."ProductID" = "a_Product"."ProductID" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..fce29ad5d5b5 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.18,False).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS p + WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%') + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + "Products" e + WHERE + e."ProductName" LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..9b1891324042 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(PostgreSQL.18,True).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS p + WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE '%a%') + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + "Products" e + WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..137c7969936b --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.18,False).sql @@ -0,0 +1,17 @@ +-- PostgreSQL.18 PostgreSQL + +DELETE FROM + "Products" e +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' AND e."ProductName" = 'a' + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..dce340088c08 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(PostgreSQL.18,True).sql @@ -0,0 +1,19 @@ +-- PostgreSQL.18 PostgreSQL + +DELETE FROM + "Products" e +WHERE + NOT e."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' AND + e."ProductName" = 'a' + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..6c518d6b4db4 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.18,False).sql @@ -0,0 +1,94 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2; + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..199438598c5d --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(PostgreSQL.18,True).sql @@ -0,0 +1,105 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2; + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..e2cf04ee3a16 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.18,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..737294126a4d --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(PostgreSQL.18,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..e2cf04ee3a16 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.18,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..737294126a4d --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(PostgreSQL.18,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..7e75efd8ed69 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.18,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder", s."OrderID0", s."ProductID1", s."Discount0", s."IsDeleted1", s."Quantity0", s."UnitPrice1" +FROM "Orders" AS o +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder", o2."OrderID" AS "OrderID0", o2."ProductID" AS "ProductID1", o2."Discount" AS "Discount0", o2."IsDeleted" AS "IsDeleted1", o2."Quantity" AS "Quantity0", o2."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + LEFT JOIN ( + SELECT o1."OrderID", o1."ProductID", o1."Discount", o1."IsDeleted", o1."Quantity", o1."UnitPrice" + FROM "Order Details" AS o1 + WHERE @ef_filter__p2 OR NOT (o1."IsDeleted") OR NOT (o1."IsDeleted") + ) AS o2 ON p0."ProductID" = o2."ProductID" + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", s."OrderID", s."ProductID", s."ProductID0", s."OrderID0" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..cc94da118e8b --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(PostgreSQL.18,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder", s."OrderID0", s."ProductID1", s."Discount0", s."IsDeleted1", s."Quantity0", s."UnitPrice1" +FROM "Orders" AS o +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder", o2."OrderID" AS "OrderID0", o2."ProductID" AS "ProductID1", o2."Discount" AS "Discount0", o2."IsDeleted" AS "IsDeleted1", o2."Quantity" AS "Quantity0", o2."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p4 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + LEFT JOIN ( + SELECT o1."OrderID", o1."ProductID", o1."Discount", o1."IsDeleted", o1."Quantity", o1."UnitPrice" + FROM "Order Details" AS o1 + WHERE @ef_filter__p2 OR NOT (o1."IsDeleted") OR NOT (o1."IsDeleted") + ) AS o2 ON p0."ProductID" = o2."ProductID" + WHERE @ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", s."OrderID", s."ProductID", s."ProductID0", s."OrderID0" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."ProductId", + m_1."OrderId", + d_1."IsDeleted", + d_1."OrderID", + d_1."ProductID", + d_1."UnitPrice", + d_1."Quantity", + d_1."Discount" +FROM + ( + SELECT DISTINCT + "a_Product"."ProductID" as "ProductId", + t1."OrderId" + FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d_1 ON m_1."ProductId" = d_1."ProductID" +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..bebb9a47fe6b --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.18,False).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e + LEFT JOIN "Products" op ON op."ProductID" <> e."ProductID" AND op."ProductName" = e."ProductName" +WHERE + op."ProductID" IS NULL + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..d8d8614c654d --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(PostgreSQL.18,True).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e + LEFT JOIN "Products" op ON op."ProductID" <> e."ProductID" AND op."ProductName" = e."ProductName" AND NOT op."IsDeleted" +WHERE + NOT e."IsDeleted" AND op."ProductID" IS NULL + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..b70c41808938 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.18,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", o."OrderID", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + e_1."IsDeleted", + e_1."TerritoryID", + e_1."TerritoryDescription", + e_1."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" e_1 ON d."TerritoryID" = e_1."TerritoryID" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + e_1."IsDeleted", + e_1."ProductID", + e_1."ProductName", + e_1."SupplierID", + e_1."CategoryID", + e_1."QuantityPerUnit", + e_1."UnitPrice", + e_1."UnitsInStock", + e_1."UnitsOnOrder", + e_1."ReorderLevel", + e_1."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" e_1 ON d."ProductID" = e_1."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath", + o."OrderID" +FROM + "Orders" o + LEFT JOIN "Employees" "a_Employee" ON o."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..16fe81319d69 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(PostgreSQL.18,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", o."OrderID", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + e_1."IsDeleted", + e_1."TerritoryID", + e_1."TerritoryDescription", + e_1."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" e_1 ON d."TerritoryID" = e_1."TerritoryID" +WHERE + NOT e_1."IsDeleted" AND NOT d."IsDeleted" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + e_1."IsDeleted", + e_1."ProductID", + e_1."ProductName", + e_1."SupplierID", + e_1."CategoryID", + e_1."QuantityPerUnit", + e_1."UnitPrice", + e_1."UnitsInStock", + e_1."UnitsOnOrder", + e_1."ReorderLevel", + e_1."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" e_1 ON d."ProductID" = e_1."ProductID" +WHERE + NOT e_1."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath", + o."OrderID" +FROM + "Orders" o + LEFT JOIN "Employees" "a_Employee" ON o."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT o."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..987e6d5a71c4 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.18,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.18 PostgreSQL + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..20e5d51160ad --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(PostgreSQL.18,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.18 PostgreSQL + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" AND NOT "a_ReportsToNavigation"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..08556dc40b1e --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.18,False).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + e."City" IS NOT NULL + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..275b40dae95a --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(PostgreSQL.18,True).sql @@ -0,0 +1,22 @@ +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."CustomerID", + e."CompanyName", + e."ContactName", + e."ContactTitle", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."Phone", + e."Fax" +FROM + "Customers" e +WHERE + NOT e."IsDeleted" AND e."City" IS NOT NULL + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..404abbbc015a --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.18,False).sql @@ -0,0 +1,70 @@ +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" +FROM "Products" AS p +INNER JOIN "Order Details" AS o ON p."ProductID" = o."ProductID" + + +-- PostgreSQL.18 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice" +FROM "Products" AS p +INNER JOIN ( + SELECT o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" + FROM "Order Details" AS o + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS o0 ON p."ProductID" = o0."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.18 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..6209d9242a9f --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(PostgreSQL.18,True).sql @@ -0,0 +1,74 @@ +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" +FROM "Products" AS p +INNER JOIN "Order Details" AS o ON p."ProductID" = o."ProductID" + + +-- PostgreSQL.18 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" +WHERE + NOT d."IsDeleted" + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice" +FROM "Products" AS p +INNER JOIN ( + SELECT o."OrderID", o."ProductID", o."Discount", o."IsDeleted", o."Quantity", o."UnitPrice" + FROM "Order Details" AS o + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS o0 ON p."ProductID" = o0."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.18 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount" +FROM + "Products" p + INNER JOIN "Order Details" d ON p."ProductID" = d."ProductID" +WHERE + NOT p."IsDeleted" AND NOT d."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..7f4cd676ee59 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.18,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + "a_Territory"."IsDeleted", + "a_Territory"."TerritoryID", + "a_Territory"."TerritoryDescription", + "a_Territory"."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" "a_Territory" ON d."TerritoryID" = "a_Territory"."TerritoryID" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..9098bca05507 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(PostgreSQL.18,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", s."EmployeeID", s."TerritoryID", s."IsDeleted", s."TerritoryID0", s."IsDeleted0", s."RegionID", s."TerritoryDescription", s0."OrderID", s0."ProductID", s0."Discount", s0."IsDeleted", s0."Quantity", s0."UnitPrice", s0."ProductID0", s0."CategoryID", s0."Discontinued", s0."IsDeleted0", s0."ProductName", s0."QuantityPerUnit", s0."ReorderLevel", s0."SupplierID", s0."UnitPrice0", s0."UnitsInStock", s0."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted", t0."TerritoryID" AS "TerritoryID0", t0."IsDeleted" AS "IsDeleted0", t0."RegionID", t0."TerritoryDescription" + FROM "EmployeeTerritories" AS e1 + INNER JOIN ( + SELECT t."TerritoryID", t."IsDeleted", t."RegionID", t."TerritoryDescription" + FROM "Territories" AS t + WHERE @ef_filter__p8 OR NOT (t."IsDeleted") OR NOT (t."IsDeleted") + ) AS t0 ON e1."TerritoryID" = t0."TerritoryID" + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS s ON e0."EmployeeID" = s."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p10 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s0 ON o."OrderID" = s0."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", s."EmployeeID", s."TerritoryID", s."TerritoryID0", s0."OrderID", s0."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID", + "a_Territory"."IsDeleted", + "a_Territory"."TerritoryID", + "a_Territory"."TerritoryDescription", + "a_Territory"."RegionID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + INNER JOIN "Territories" "a_Territory" ON d."TerritoryID" = "a_Territory"."TerritoryID" +WHERE + NOT "a_Territory"."IsDeleted" AND NOT d."IsDeleted" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..92e5d8123fcd --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.18,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", e2."EmployeeID", e2."TerritoryID", e2."IsDeleted", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted" + FROM "EmployeeTerritories" AS e1 + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS e2 ON e0."EmployeeID" = e2."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p8 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", e2."EmployeeID", e2."TerritoryID", s."OrderID", s."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..652cf00d1224 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(PostgreSQL.18,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT o."OrderID", o."CustomerID", o."EmployeeID", o."Freight", o."IsDeleted", o."OrderDate", o."RequiredDate", o."ShipAddress", o."ShipCity", o."ShipCountry", o."ShipName", o."ShipPostalCode", o."ShipRegion", o."ShipVia", o."ShippedDate", e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy", e2."EmployeeID", e2."TerritoryID", e2."IsDeleted", s."OrderID", s."ProductID", s."Discount", s."IsDeleted", s."Quantity", s."UnitPrice", s."ProductID0", s."CategoryID", s."Discontinued", s."IsDeleted0", s."ProductName", s."QuantityPerUnit", s."ReorderLevel", s."SupplierID", s."UnitPrice0", s."UnitsInStock", s."UnitsOnOrder" +FROM "Orders" AS o +LEFT JOIN ( + SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" + FROM "Employees" AS e + WHERE @ef_filter__p2 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") +) AS e0 ON o."EmployeeID" = e0."EmployeeID" +LEFT JOIN ( + SELECT e1."EmployeeID", e1."TerritoryID", e1."IsDeleted" + FROM "EmployeeTerritories" AS e1 + WHERE @ef_filter__p4 OR NOT (e1."IsDeleted") OR NOT (e1."IsDeleted") +) AS e2 ON e0."EmployeeID" = e2."EmployeeID" +LEFT JOIN ( + SELECT o0."OrderID", o0."ProductID", o0."Discount", o0."IsDeleted", o0."Quantity", o0."UnitPrice", p0."ProductID" AS "ProductID0", p0."CategoryID", p0."Discontinued", p0."IsDeleted" AS "IsDeleted0", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice" AS "UnitPrice0", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Order Details" AS o0 + INNER JOIN ( + SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder" + FROM "Products" AS p + WHERE @ef_filter__p8 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + ) AS p0 ON o0."ProductID" = p0."ProductID" + WHERE @ef_filter__p6 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") +) AS s ON o."OrderID" = s."OrderID" +WHERE @ef_filter__p0 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +ORDER BY o."OrderID", e0."EmployeeID", e2."EmployeeID", e2."TerritoryID", s."OrderID", s."ProductID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."EmployeeId", + d."IsDeleted", + d."EmployeeID", + d."TerritoryID" +FROM + ( + SELECT DISTINCT + "a_Employee"."EmployeeID" as "EmployeeId" + FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "EmployeeTerritories" d ON m_1."EmployeeId" = d."EmployeeID" +WHERE + NOT d."IsDeleted" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."OrderId", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + ( + SELECT DISTINCT + e."OrderID" as "OrderId" + FROM + "Orders" e + WHERE + NOT e."IsDeleted" + ) m_1 + INNER JOIN "Order Details" d ON m_1."OrderId" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT "a_Product"."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Employee"."IsDeleted", + "a_Employee"."EmployeeID", + "a_Employee"."LastName", + "a_Employee"."FirstName", + "a_Employee"."Title", + "a_Employee"."TitleOfCourtesy", + "a_Employee"."BirthDate", + "a_Employee"."HireDate", + "a_Employee"."Address", + "a_Employee"."City", + "a_Employee"."Region", + "a_Employee"."PostalCode", + "a_Employee"."Country", + "a_Employee"."HomePhone", + "a_Employee"."Extension", + "a_Employee"."Photo", + "a_Employee"."Notes", + "a_Employee"."ReportsTo", + "a_Employee"."PhotoPath" +FROM + "Orders" e + LEFT JOIN "Employees" "a_Employee" ON e."EmployeeID" = "a_Employee"."EmployeeID" AND NOT "a_Employee"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..d714f3e065bf --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.18,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductName", p."ProductID", s1."Discount", s1."OrderID", s1."CustomerID", s1."EmployeeID", s1."Freight", s1."IsDeleted", s1."OrderDate", s1."RequiredDate", s1."ShipAddress", s1."ShipCity", s1."ShipCountry", s1."ShipName", s1."ShipPostalCode", s1."ShipRegion", s1."ShipVia", s1."ShippedDate", s1."OrderID0", s1."ProductID", s1."ProductID0", s1."SupplierID", s1."ProductID1", s1."CategoryID", s1."Discontinued", s1."IsDeleted0", s1."ProductName", s1."QuantityPerUnit", s1."ReorderLevel", s1."SupplierID0", s1."UnitPrice", s1."UnitsInStock", s1."UnitsOnOrder" +FROM "Products" AS p +LEFT JOIN ( + SELECT o."Discount", o1."OrderID", o1."CustomerID", o1."EmployeeID", o1."Freight", o1."IsDeleted", o1."OrderDate", o1."RequiredDate", o1."ShipAddress", o1."ShipCity", o1."ShipCountry", o1."ShipName", o1."ShipPostalCode", o1."ShipRegion", o1."ShipVia", o1."ShippedDate", o."OrderID" AS "OrderID0", o."ProductID", p1."ProductID" AS "ProductID0", s0."SupplierID", p3."ProductID" AS "ProductID1", p3."CategoryID", p3."Discontinued", p3."IsDeleted" AS "IsDeleted0", p3."ProductName", p3."QuantityPerUnit", p3."ReorderLevel", p3."SupplierID" AS "SupplierID0", p3."UnitPrice", p3."UnitsInStock", p3."UnitsOnOrder" + FROM "Order Details" AS o + INNER JOIN ( + SELECT o0."OrderID", o0."CustomerID", o0."EmployeeID", o0."Freight", o0."IsDeleted", o0."OrderDate", o0."RequiredDate", o0."ShipAddress", o0."ShipCity", o0."ShipCountry", o0."ShipName", o0."ShipPostalCode", o0."ShipRegion", o0."ShipVia", o0."ShippedDate" + FROM "Orders" AS o0 + WHERE @ef_filter__p4 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") + ) AS o1 ON o."OrderID" = o1."OrderID" + INNER JOIN ( + SELECT p0."ProductID", p0."SupplierID" + FROM "Products" AS p0 + WHERE @ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted") + ) AS p1 ON o."ProductID" = p1."ProductID" + LEFT JOIN ( + SELECT s."SupplierID" + FROM "Suppliers" AS s + WHERE @ef_filter__p6 OR NOT (s."IsDeleted") OR NOT (s."IsDeleted") + ) AS s0 ON p1."SupplierID" = s0."SupplierID" + LEFT JOIN ( + SELECT p2."ProductID", p2."CategoryID", p2."Discontinued", p2."IsDeleted", p2."ProductName", p2."QuantityPerUnit", p2."ReorderLevel", p2."SupplierID", p2."UnitPrice", p2."UnitsInStock", p2."UnitsOnOrder" + FROM "Products" AS p2 + WHERE @ef_filter__p0 OR NOT (p2."IsDeleted") OR NOT (p2."IsDeleted") + ) AS p3 ON s0."SupplierID" = p3."SupplierID" + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS s1 ON p."ProductID" = s1."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +ORDER BY p."ProductID", s1."OrderID0", s1."ProductID", s1."OrderID", s1."ProductID0", s1."SupplierID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."SupplierId", + m_1."ProductId", + d_1."IsDeleted", + d_1."ProductID", + d_1."ProductName", + d_1."SupplierID", + d_1."CategoryID", + d_1."QuantityPerUnit", + d_1."UnitPrice", + d_1."UnitsInStock", + d_1."UnitsOnOrder", + d_1."ReorderLevel", + d_1."Discontinued" +FROM + ( + SELECT DISTINCT + "a_Supplier"."SupplierID" as "SupplierId", + t1."ProductId" + FROM + ( + SELECT DISTINCT + e."ProductID" as "ProductId" + FROM + "Products" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."ProductId" = d."ProductID" + INNER JOIN "Orders" e_1 ON d."OrderID" = e_1."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + LEFT JOIN "Suppliers" "a_Supplier" ON "a_Product"."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" + WHERE + NOT e_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + ) m_1 + INNER JOIN "Products" d_1 ON m_1."SupplierId" = d_1."SupplierID" OR m_1."SupplierId" IS NULL AND d_1."SupplierID" IS NULL +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."ProductID", + d."Discount", + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Supplier"."SupplierID" +FROM + "Products" m_1 + INNER JOIN "Order Details" d ON m_1."ProductID" = d."ProductID" + INNER JOIN "Orders" e ON d."OrderID" = e."OrderID" + LEFT JOIN "Suppliers" "a_Supplier" ON m_1."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" +WHERE + NOT m_1."IsDeleted" AND NOT e."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + p."ProductName", + p."ProductID" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..d714f3e065bf --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(PostgreSQL.18,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductName", p."ProductID", s1."Discount", s1."OrderID", s1."CustomerID", s1."EmployeeID", s1."Freight", s1."IsDeleted", s1."OrderDate", s1."RequiredDate", s1."ShipAddress", s1."ShipCity", s1."ShipCountry", s1."ShipName", s1."ShipPostalCode", s1."ShipRegion", s1."ShipVia", s1."ShippedDate", s1."OrderID0", s1."ProductID", s1."ProductID0", s1."SupplierID", s1."ProductID1", s1."CategoryID", s1."Discontinued", s1."IsDeleted0", s1."ProductName", s1."QuantityPerUnit", s1."ReorderLevel", s1."SupplierID0", s1."UnitPrice", s1."UnitsInStock", s1."UnitsOnOrder" +FROM "Products" AS p +LEFT JOIN ( + SELECT o."Discount", o1."OrderID", o1."CustomerID", o1."EmployeeID", o1."Freight", o1."IsDeleted", o1."OrderDate", o1."RequiredDate", o1."ShipAddress", o1."ShipCity", o1."ShipCountry", o1."ShipName", o1."ShipPostalCode", o1."ShipRegion", o1."ShipVia", o1."ShippedDate", o."OrderID" AS "OrderID0", o."ProductID", p1."ProductID" AS "ProductID0", s0."SupplierID", p3."ProductID" AS "ProductID1", p3."CategoryID", p3."Discontinued", p3."IsDeleted" AS "IsDeleted0", p3."ProductName", p3."QuantityPerUnit", p3."ReorderLevel", p3."SupplierID" AS "SupplierID0", p3."UnitPrice", p3."UnitsInStock", p3."UnitsOnOrder" + FROM "Order Details" AS o + INNER JOIN ( + SELECT o0."OrderID", o0."CustomerID", o0."EmployeeID", o0."Freight", o0."IsDeleted", o0."OrderDate", o0."RequiredDate", o0."ShipAddress", o0."ShipCity", o0."ShipCountry", o0."ShipName", o0."ShipPostalCode", o0."ShipRegion", o0."ShipVia", o0."ShippedDate" + FROM "Orders" AS o0 + WHERE @ef_filter__p4 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted") + ) AS o1 ON o."OrderID" = o1."OrderID" + INNER JOIN ( + SELECT p0."ProductID", p0."SupplierID" + FROM "Products" AS p0 + WHERE @ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted") + ) AS p1 ON o."ProductID" = p1."ProductID" + LEFT JOIN ( + SELECT s."SupplierID" + FROM "Suppliers" AS s + WHERE @ef_filter__p6 OR NOT (s."IsDeleted") OR NOT (s."IsDeleted") + ) AS s0 ON p1."SupplierID" = s0."SupplierID" + LEFT JOIN ( + SELECT p2."ProductID", p2."CategoryID", p2."Discontinued", p2."IsDeleted", p2."ProductName", p2."QuantityPerUnit", p2."ReorderLevel", p2."SupplierID", p2."UnitPrice", p2."UnitsInStock", p2."UnitsOnOrder" + FROM "Products" AS p2 + WHERE @ef_filter__p0 OR NOT (p2."IsDeleted") OR NOT (p2."IsDeleted") + ) AS p3 ON s0."SupplierID" = p3."SupplierID" + WHERE @ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted") +) AS s1 ON p."ProductID" = s1."ProductID" +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") +ORDER BY p."ProductID", s1."OrderID0", s1."ProductID", s1."OrderID", s1."ProductID0", s1."SupplierID" + + +BeginTransactionAsync(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."SupplierId", + m_1."ProductId", + d_1."IsDeleted", + d_1."ProductID", + d_1."ProductName", + d_1."SupplierID", + d_1."CategoryID", + d_1."QuantityPerUnit", + d_1."UnitPrice", + d_1."UnitsInStock", + d_1."UnitsOnOrder", + d_1."ReorderLevel", + d_1."Discontinued" +FROM + ( + SELECT DISTINCT + "a_Supplier"."SupplierID" as "SupplierId", + t1."ProductId" + FROM + ( + SELECT DISTINCT + e."ProductID" as "ProductId" + FROM + "Products" e + WHERE + NOT e."IsDeleted" + ) t1 + INNER JOIN "Order Details" d ON t1."ProductId" = d."ProductID" + INNER JOIN "Orders" e_1 ON d."OrderID" = e_1."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + LEFT JOIN "Suppliers" "a_Supplier" ON "a_Product"."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" + WHERE + NOT e_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + ) m_1 + INNER JOIN "Products" d_1 ON m_1."SupplierId" = d_1."SupplierID" OR m_1."SupplierId" IS NULL AND d_1."SupplierID" IS NULL +WHERE + NOT d_1."IsDeleted" + + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + m_1."ProductID", + d."Discount", + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry", + "a_Supplier"."SupplierID" +FROM + "Products" m_1 + INNER JOIN "Order Details" d ON m_1."ProductID" = d."ProductID" + INNER JOIN "Orders" e ON d."OrderID" = e."OrderID" + LEFT JOIN "Suppliers" "a_Supplier" ON m_1."SupplierID" = "a_Supplier"."SupplierID" AND NOT "a_Supplier"."IsDeleted" +WHERE + NOT m_1."IsDeleted" AND NOT e."IsDeleted" AND NOT d."IsDeleted" + + + +DisposeTransactionAsync + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + p."ProductName", + p."ProductID" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..3bf2293bf329 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.18,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", p1."ProductID", p1."CategoryID", p1."Discontinued", p1."IsDeleted", p1."ProductName", p1."QuantityPerUnit", p1."ReorderLevel", p1."SupplierID", p1."UnitPrice", p1."UnitsInStock", p1."UnitsOnOrder" +FROM "Products" AS p +CROSS JOIN ( + SELECT p0."ProductID", p0."CategoryID", p0."Discontinued", p0."IsDeleted", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Products" AS p0 + WHERE (@ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o0 + WHERE (@ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted")) AND p0."ProductID" = o0."ProductID") +) AS p1 +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o + WHERE (@ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted")) AND p."ProductID" = o."ProductID") AND p."ProductID" = p1."ProductID" +ORDER BY p."ProductID" + + +-- PostgreSQL.18 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued", + pd2."IsDeleted", + pd2."ProductID", + pd2."ProductName", + pd2."SupplierID", + pd2."CategoryID", + pd2."QuantityPerUnit", + pd2."UnitPrice", + pd2."UnitsInStock", + pd2."UnitsOnOrder", + pd2."ReorderLevel", + pd2."Discontinued" +FROM + "Products" e, + "Products" pd2 +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_2 + WHERE + pd2."ProductID" = e_2."ProductID" + ) > 0 AND + e."ProductID" = pd2."ProductID" +ORDER BY + e."ProductID" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..110407f585ec --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(PostgreSQL.18,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT p."ProductID", p."CategoryID", p."Discontinued", p."IsDeleted", p."ProductName", p."QuantityPerUnit", p."ReorderLevel", p."SupplierID", p."UnitPrice", p."UnitsInStock", p."UnitsOnOrder", p1."ProductID", p1."CategoryID", p1."Discontinued", p1."IsDeleted", p1."ProductName", p1."QuantityPerUnit", p1."ReorderLevel", p1."SupplierID", p1."UnitPrice", p1."UnitsInStock", p1."UnitsOnOrder" +FROM "Products" AS p +CROSS JOIN ( + SELECT p0."ProductID", p0."CategoryID", p0."Discontinued", p0."IsDeleted", p0."ProductName", p0."QuantityPerUnit", p0."ReorderLevel", p0."SupplierID", p0."UnitPrice", p0."UnitsInStock", p0."UnitsOnOrder" + FROM "Products" AS p0 + WHERE (@ef_filter__p0 OR NOT (p0."IsDeleted") OR NOT (p0."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o0 + WHERE (@ef_filter__p2 OR NOT (o0."IsDeleted") OR NOT (o0."IsDeleted")) AND p0."ProductID" = o0."ProductID") +) AS p1 +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS o + WHERE (@ef_filter__p2 OR NOT (o."IsDeleted") OR NOT (o."IsDeleted")) AND p."ProductID" = o."ProductID") AND p."ProductID" = p1."ProductID" +ORDER BY p."ProductID" + + +-- PostgreSQL.18 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued", + pd2."IsDeleted", + pd2."ProductID", + pd2."ProductName", + pd2."SupplierID", + pd2."CategoryID", + pd2."QuantityPerUnit", + pd2."UnitPrice", + pd2."UnitsInStock", + pd2."UnitsOnOrder", + pd2."ReorderLevel", + pd2."Discontinued" +FROM + "Products" e, + "Products" pd2 +WHERE + NOT e."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + NOT pd2."IsDeleted" AND + ( + SELECT + COUNT(*) + FROM + "Order Details" e_2 + WHERE + NOT e_2."IsDeleted" AND pd2."ProductID" = e_2."ProductID" + ) > 0 AND + e."ProductID" = pd2."ProductID" +ORDER BY + e."ProductID" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..c2148eb30a27 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.18,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" +FROM "Employees" AS e +WHERE (@ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted")) AND e."EmployeeID" = @test + + +-- PostgreSQL.18 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath" +FROM + "Employees" e +WHERE + e."EmployeeID" = :test + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..61be17c4f3f3 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(PostgreSQL.18,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy" +FROM "Employees" AS e +WHERE (@ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted")) AND e."EmployeeID" = @test + + +-- PostgreSQL.18 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath" +FROM + "Employees" e +WHERE + NOT e."IsDeleted" AND e."EmployeeID" = :test + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..0dabd2f1949a --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.18,False).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."IsDeleted", c."Phone", c."PostalCode", c."Region" +FROM "Customers" AS c +WHERE @ef_filter__p0 OR NOT (c."IsDeleted") OR NOT (c."IsDeleted") +LIMIT 1 + + +-- PostgreSQL.18 PostgreSQL (asynchronously) +DECLARE @CompanyName Varchar(34) -- String +SET @CompanyName = 'Ana Trujillo Emparedados y helados' +DECLARE @CustomerId Varchar(5) -- String +SET @CustomerId = 'ANATR' + +UPDATE + "Customers" +SET + "CompanyName" = :CompanyName +WHERE + "Customers"."CustomerID" = :CustomerId + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..12bf52adf20c --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(PostgreSQL.18,True).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT c."CustomerID", c."Address", c."City", c."CompanyName", c."ContactName", c."ContactTitle", c."Country", c."Fax", c."IsDeleted", c."Phone", c."PostalCode", c."Region" +FROM "Customers" AS c +WHERE @ef_filter__p0 OR NOT (c."IsDeleted") OR NOT (c."IsDeleted") +LIMIT 1 + + +-- PostgreSQL.18 PostgreSQL (asynchronously) +DECLARE @CompanyName Varchar(19) -- String +SET @CompanyName = 'Alfreds Futterkiste' +DECLARE @CustomerId Varchar(5) -- String +SET @CustomerId = 'ALFKI' + +UPDATE + "Customers" +SET + "CompanyName" = :CompanyName +WHERE + NOT "Customers"."IsDeleted" AND "Customers"."CustomerID" = :CustomerId + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..f391045790a9 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.18,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."QuantityPerUnit" AS "Quantity" +FROM "Products" AS p +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.18 PostgreSQL + +SELECT + p."QuantityPerUnit" +FROM + "Products" p + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..447b718cd691 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(PostgreSQL.18,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT p."QuantityPerUnit" AS "Quantity" +FROM "Products" AS p +WHERE @ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted") + + +-- PostgreSQL.18 PostgreSQL + +SELECT + p."QuantityPerUnit" +FROM + "Products" p +WHERE + NOT p."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..7458f04cd718 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.18,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.18 PostgreSQL + +/* Tagged query */ +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..ffd6f1632543 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(PostgreSQL.18,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT e."EmployeeID", e."Address", e."BirthDate", e."City", e."Country", e."Extension", e."FirstName", e."HireDate", e."HomePhone", e."IsDeleted", e."LastName", e."Notes", e."Photo", e."PhotoPath", e."PostalCode", e."Region", e."ReportsTo", e."Title", e."TitleOfCourtesy", e1."EmployeeID", e1."Address", e1."BirthDate", e1."City", e1."Country", e1."Extension", e1."FirstName", e1."HireDate", e1."HomePhone", e1."IsDeleted", e1."LastName", e1."Notes", e1."Photo", e1."PhotoPath", e1."PostalCode", e1."Region", e1."ReportsTo", e1."Title", e1."TitleOfCourtesy" +FROM "Employees" AS e +LEFT JOIN ( + SELECT e0."EmployeeID", e0."Address", e0."BirthDate", e0."City", e0."Country", e0."Extension", e0."FirstName", e0."HireDate", e0."HomePhone", e0."IsDeleted", e0."LastName", e0."Notes", e0."Photo", e0."PhotoPath", e0."PostalCode", e0."Region", e0."ReportsTo", e0."Title", e0."TitleOfCourtesy" + FROM "Employees" AS e0 + WHERE @ef_filter__p0 OR NOT (e0."IsDeleted") OR NOT (e0."IsDeleted") +) AS e1 ON e."ReportsTo" = e1."EmployeeID" +WHERE @ef_filter__p0 OR NOT (e."IsDeleted") OR NOT (e."IsDeleted") + + +-- PostgreSQL.18 PostgreSQL + +/* Tagged query */ +SELECT + e."IsDeleted", + e."EmployeeID", + e."LastName", + e."FirstName", + e."Title", + e."TitleOfCourtesy", + e."BirthDate", + e."HireDate", + e."Address", + e."City", + e."Region", + e."PostalCode", + e."Country", + e."HomePhone", + e."Extension", + e."Photo", + e."Notes", + e."ReportsTo", + e."PhotoPath", + "a_ReportsToNavigation"."IsDeleted", + "a_ReportsToNavigation"."EmployeeID", + "a_ReportsToNavigation"."LastName", + "a_ReportsToNavigation"."FirstName", + "a_ReportsToNavigation"."Title", + "a_ReportsToNavigation"."TitleOfCourtesy", + "a_ReportsToNavigation"."BirthDate", + "a_ReportsToNavigation"."HireDate", + "a_ReportsToNavigation"."Address", + "a_ReportsToNavigation"."City", + "a_ReportsToNavigation"."Region", + "a_ReportsToNavigation"."PostalCode", + "a_ReportsToNavigation"."Country", + "a_ReportsToNavigation"."HomePhone", + "a_ReportsToNavigation"."Extension", + "a_ReportsToNavigation"."Photo", + "a_ReportsToNavigation"."Notes", + "a_ReportsToNavigation"."ReportsTo", + "a_ReportsToNavigation"."PhotoPath" +FROM + "Employees" e + LEFT JOIN "Employees" "a_ReportsToNavigation" ON e."ReportsTo" = "a_ReportsToNavigation"."EmployeeID" AND NOT "a_ReportsToNavigation"."IsDeleted" +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..0b5ce42fc88c --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.18,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" + + + +DisposeTransaction + + +-- PostgreSQL.18 PostgreSQL + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..1410213b3d9f --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(PostgreSQL.18,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(RepeatableRead) + + +-- PostgreSQL.18 PostgreSQL + +SELECT + m_1."OrderID", + d."IsDeleted", + d."OrderID", + d."ProductID", + d."UnitPrice", + d."Quantity", + d."Discount", + "a_Product"."IsDeleted", + "a_Product"."ProductID", + "a_Product"."ProductName", + "a_Product"."SupplierID", + "a_Product"."CategoryID", + "a_Product"."QuantityPerUnit", + "a_Product"."UnitPrice", + "a_Product"."UnitsInStock", + "a_Product"."UnitsOnOrder", + "a_Product"."ReorderLevel", + "a_Product"."Discontinued" +FROM + "Orders" m_1 + INNER JOIN "Order Details" d ON m_1."OrderID" = d."OrderID" + INNER JOIN "Products" "a_Product" ON d."ProductID" = "a_Product"."ProductID" +WHERE + NOT m_1."IsDeleted" AND NOT "a_Product"."IsDeleted" AND + NOT d."IsDeleted" + + + +DisposeTransaction + + +-- PostgreSQL.18 PostgreSQL + +SELECT + e."IsDeleted", + e."OrderID", + e."CustomerID", + e."EmployeeID", + e."OrderDate", + e."RequiredDate", + e."ShippedDate", + e."ShipVia", + e."Freight", + e."ShipName", + e."ShipAddress", + e."ShipCity", + e."ShipRegion", + e."ShipPostalCode", + e."ShipCountry" +FROM + "Orders" e +WHERE + NOT e."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..a4e7469df4c4 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.18,False).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT max(p."QuantityPerUnit") +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE 'U%' + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + MAX(e."QuantityPerUnit") +FROM + "Products" e +WHERE + e."ProductName" LIKE 'U%' ESCAPE '~' + + + +-- PostgreSQL.18 PostgreSQL + +DELETE FROM + "Products" e +WHERE + e."ProductName" = 'a' + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..bca3177977c8 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(PostgreSQL.18,True).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT max(p."QuantityPerUnit") +FROM "Products" AS p +WHERE (@ef_filter__p0 OR NOT (p."IsDeleted") OR NOT (p."IsDeleted")) AND p."ProductName" LIKE 'U%' + + +-- PostgreSQL.18 PostgreSQL (asynchronously) + +SELECT + MAX(e."QuantityPerUnit") +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" LIKE 'U%' ESCAPE '~' + + + +-- PostgreSQL.18 PostgreSQL + +DELETE FROM + "Products" e +WHERE + NOT e."IsDeleted" AND e."ProductName" = 'a' + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..6e434a61e2b1 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.18,False).sql @@ -0,0 +1,25 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..72c6fde295f8 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(PostgreSQL.18,True).sql @@ -0,0 +1,27 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" +WHERE + NOT p."IsDeleted" AND NOT c_1."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..6e434a61e2b1 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.18,False).sql @@ -0,0 +1,25 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..72c6fde295f8 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(PostgreSQL.18,True).sql @@ -0,0 +1,27 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + p."IsDeleted", + p."ProductID", + p."ProductName", + p."SupplierID", + p."CategoryID", + p."QuantityPerUnit", + p."UnitPrice", + p."UnitsInStock", + p."UnitsOnOrder", + p."ReorderLevel", + p."Discontinued", + c_1."IsDeleted", + c_1."CategoryID", + c_1."CategoryName", + c_1."Description", + c_1."Picture" +FROM + "Products" p + INNER JOIN "Categories" c_1 ON c_1."CategoryID" = p."CategoryID" +WHERE + NOT p."IsDeleted" AND NOT c_1."IsDeleted" + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..13ab607e97dc --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.18,False).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..13ab607e97dc --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(PostgreSQL.18,True).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.18 PostgreSQL +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..ba13bb251570 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.18,False).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.18 PostgreSQL (asynchronously) +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..ba13bb251570 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(PostgreSQL.18,True).sql @@ -0,0 +1,13 @@ +-- PostgreSQL.18 PostgreSQL (asynchronously) +DECLARE @test Integer -- Int32 +SET @test = 1 + +UPDATE + "Employees" +SET + "Address" = "Employees"."Address" +WHERE + "Employees"."EmployeeID" = :test + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.18,False).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.18,False).sql new file mode 100644 index 000000000000..5a5655046c1b --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.18,False).sql @@ -0,0 +1,29 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' + + + diff --git a/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.18,True).sql b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.18,True).sql new file mode 100644 index 000000000000..f7cb392c5d69 --- /dev/null +++ b/PostgreSQL.18.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(PostgreSQL.18,True).sql @@ -0,0 +1,29 @@ +-- PostgreSQL.18 PostgreSQL + +SELECT + e."IsDeleted", + e."ProductID", + e."ProductName", + e."SupplierID", + e."CategoryID", + e."QuantityPerUnit", + e."UnitPrice", + e."UnitsInStock", + e."UnitsOnOrder", + e."ReorderLevel", + e."Discontinued" +FROM + "Products" e +WHERE + NOT e."IsDeleted" AND ( + SELECT + COUNT(*) + FROM + "Order Details" e_1 + WHERE + NOT e_1."IsDeleted" AND e."ProductID" = e_1."ProductID" + ) > 0 AND + e."ProductName" LIKE 'a%' ESCAPE '~' + + + diff --git a/SQLite.Classic.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.LinqService,False).sql b/SQLite.Classic.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.LinqService,False).sql index c82abc89482c..6138b85c3db0 100644 --- a/SQLite.Classic.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.LinqService,False).sql +++ b/SQLite.Classic.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.LinqService,False).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.Classic.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.LinqService,True).sql b/SQLite.Classic.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.LinqService,True).sql index c82abc89482c..6138b85c3db0 100644 --- a/SQLite.Classic.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.LinqService,True).sql +++ b/SQLite.Classic.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.LinqService,True).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.Classic SQLite (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM.LinqService,False).sql b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM.LinqService,False).sql index 69eab060e9cc..bff7132d2ad1 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM.LinqService,False).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM.LinqService,False).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM.LinqService,True).sql b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM.LinqService,True).sql index 69eab060e9cc..bff7132d2ad1 100644 --- a/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM.LinqService,True).sql +++ b/SQLite.Classic.MPM.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM.LinqService,True).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.Classic.MPM/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM,False).sql b/SQLite.Classic.MPM/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM,False).sql index 008c46597f22..2405f39c9a33 100644 --- a/SQLite.Classic.MPM/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM,False).sql +++ b/SQLite.Classic.MPM/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM,False).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.Classic.MPM/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM,True).sql b/SQLite.Classic.MPM/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM,True).sql index 008c46597f22..2405f39c9a33 100644 --- a/SQLite.Classic.MPM/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM,True).sql +++ b/SQLite.Classic.MPM/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPM,True).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.Classic.MPM SQLite.Classic SQLite @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU.LinqService,False).sql b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU.LinqService,False).sql index fda4709f9690..4857c9cd9a13 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU.LinqService,False).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU.LinqService,False).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU.LinqService,True).sql b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU.LinqService,True).sql index fda4709f9690..4857c9cd9a13 100644 --- a/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU.LinqService,True).sql +++ b/SQLite.Classic.MPU.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU.LinqService,True).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.Classic.MPU/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU,False).sql b/SQLite.Classic.MPU/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU,False).sql index d352ab261cda..7b74613df28c 100644 --- a/SQLite.Classic.MPU/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU,False).sql +++ b/SQLite.Classic.MPU/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU,False).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.Classic.MPU/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU,True).sql b/SQLite.Classic.MPU/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU,True).sql index d352ab261cda..7b74613df28c 100644 --- a/SQLite.Classic.MPU/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU,True).sql +++ b/SQLite.Classic.MPU/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic.MPU,True).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.Classic.MPU SQLite.Classic SQLite @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.Classic/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic,False).sql b/SQLite.Classic/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic,False).sql index af524e641401..c0ce897519ff 100644 --- a/SQLite.Classic/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic,False).sql +++ b/SQLite.Classic/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic,False).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.Classic SQLite @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.Classic/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic,True).sql b/SQLite.Classic/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic,True).sql index af524e641401..c0ce897519ff 100644 --- a/SQLite.Classic/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic,True).sql +++ b/SQLite.Classic/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.Classic,True).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.Classic SQLite @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SQLite.MS).sql new file mode 100644 index 000000000000..263333b18740 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SQLite.MS).sql @@ -0,0 +1,176 @@ +-- SQLite.MS SQLite +DECLARE @Id -- Int64 +SET @Id = 1 +DECLARE @PermanentId -- Guid +SET @PermanentId = 'BC7B663D-0FDE-4327-8F92-5D8CC3A11D11' +DECLARE @Code NVarChar(2) -- String +SET @Code = 'C1' +DECLARE @Name NVarChar(2) -- String +SET @Name = 'N1' +DECLARE @IsDeleted -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + + + +-- SQLite.MS SQLite + +SELECT last_insert_rowid() + + + +-- SQLite.MS SQLite +DECLARE @Id -- Int64 +SET @Id = 2 +DECLARE @PermanentId -- Guid +SET @PermanentId = 'A948600D-DE21-4F74-8AC2-9516B287076E' +DECLARE @Code NVarChar(2) -- String +SET @Code = 'C2' +DECLARE @Name NVarChar(2) -- String +SET @Name = 'N2' +DECLARE @IsDeleted -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + + + +-- SQLite.MS SQLite + +SELECT last_insert_rowid() + + + +-- SQLite.MS SQLite +DECLARE @Id -- Int64 +SET @Id = 3 +DECLARE @PermanentId -- Guid +SET @PermanentId = 'BD3973A5-4323-4DD8-9F4F-DF9F93E2A627' +DECLARE @Code NVarChar(2) -- String +SET @Code = 'C3' +DECLARE @Name NVarChar(2) -- String +SET @Name = 'N3' +DECLARE @IsDeleted -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + + + +-- SQLite.MS SQLite + +SELECT last_insert_rowid() + + + +SELECT "s"."Id", "s"."Code", "s"."IsDeleted", "s"."Name", "s"."PermanentId" +FROM "Subdivisions" AS "s" +WHERE CAST("s"."Id" AS INTEGER) = 1 + + +-- SQLite.MS SQLite + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + CAST([s].[Id] AS INTEGER) = 1 + + + +-- SQLite.MS SQLite +DECLARE @id -- Int64 +SET @id = 1 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] = @id + + + +-- SQLite.MS SQLite + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] IN (2, 3) + + + +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[PermanentId], + [t1].[Code], + [t1].[Name], + [t1].[IsDeleted] +FROM + [Subdivisions] [t1] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SQLite.MS).sql new file mode 100644 index 000000000000..bdd4382c1258 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SQLite.MS).sql @@ -0,0 +1,10 @@ +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [Issue261Table] [t1] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue306Test(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue306Test(SQLite.MS).sql new file mode 100644 index 000000000000..2e9c93865a1c --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue306Test(SQLite.MS).sql @@ -0,0 +1,14 @@ +-- SQLite.MS SQLite +DECLARE @id -- Int32 +SET @id = 1 + +SELECT + [e].[Id], + [e].[Value] +FROM + [Issue306Entity] [e] +WHERE + [e].[Id] = @id + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SQLite.MS).sql new file mode 100644 index 000000000000..caa6900711cc --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SQLite.MS).sql @@ -0,0 +1,5 @@ +SELECT "w"."Id", "w"."Value" +FROM "WithDuplicateProperties" AS "w" +WHERE "w"."Value" = 1 + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SQLite.MS).sql new file mode 100644 index 000000000000..d3008394ee7e --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SQLite.MS).sql @@ -0,0 +1,41 @@ +-- SQLite.MS SQLite + +CREATE TEMPORARY TABLE temp.[NoIdentity] +( + [Id] TEXT NOT NULL, + [Name] TEXT NOT NULL, + + CONSTRAINT [PK_NoIdentity] PRIMARY KEY ([Id]) +) + + + +-- SQLite.MS SQLite + +INSERT INTO temp.[NoIdentity] +( + [Id], + [Name] +) +VALUES +('BC7B663D-0FDE-4327-8F92-5D8CC3A11D11','John Doe'), +('A948600D-DE21-4F74-8AC2-9516B287076E','Jane Doe') + + + +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[Name] +FROM + temp.[NoIdentity] [t1] + + + +-- SQLite.MS SQLite + +DROP TABLE IF EXISTS temp.[NoIdentity] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SQLite.MS).sql new file mode 100644 index 000000000000..7dbf85d1b6f9 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SQLite.MS).sql @@ -0,0 +1,38 @@ +-- SQLite.MS SQLite + +CREATE TEMPORARY TABLE temp.[WithIdentity] +( + [Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + [Name] TEXT NOT NULL +) + + + +-- SQLite.MS SQLite + +INSERT INTO temp.[WithIdentity] +( + [Name] +) +VALUES +('John Doe'), +('Jane Doe') + + + +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[Name] +FROM + temp.[WithIdentity] [t1] + + + +-- SQLite.MS SQLite + +DROP TABLE IF EXISTS temp.[WithIdentity] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SQLite.MS).sql new file mode 100644 index 000000000000..50034c289518 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SQLite.MS).sql @@ -0,0 +1,52 @@ +Parameters: +@p0='?' (Size = 16) + +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p0) +RETURNING "Id"; + + +Parameters: +@p0='?' (Size = 17) + +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p0) +RETURNING "Id"; + + +Parameters: +@p0='?' (Size = 17) + +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p0) +RETURNING "Id"; + + +Parameters: +@p0='?' (Size = 17) + +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p0) +RETURNING "Id"; + + +Parameters: +@p0='?' (Size = 17) + +INSERT INTO "WithInheritance" ("Discriminator") +VALUES (@p0) +RETURNING "Id"; + + +-- SQLite.MS SQLite + +SELECT + [t1].[Discriminator], + [t1].[Id] +FROM + [WithInheritance] [t1] +WHERE + [t1].[Discriminator] IN ('WithInheritanceA2', 'WithInheritanceA1', 'WithInheritanceA') + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SQLite.MS).sql new file mode 100644 index 000000000000..ddf8489bb1a8 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SQLite.MS).sql @@ -0,0 +1,41 @@ +-- SQLite.MS SQLite + +CREATE TEMPORARY TABLE temp.[NoIdentity] +( + [Id] TEXT NOT NULL, + [Name] TEXT NOT NULL, + + CONSTRAINT [PK_NoIdentity] PRIMARY KEY ([Id]) +) + + + +-- SQLite.MS SQLite (asynchronously) + +INSERT INTO temp.[NoIdentity] +( + [Id], + [Name] +) +VALUES +('BC7B663D-0FDE-4327-8F92-5D8CC3A11D11','John Doe'), +('A948600D-DE21-4F74-8AC2-9516B287076E','Jane Doe') + + + +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[Name] +FROM + temp.[NoIdentity] [t1] + + + +-- SQLite.MS SQLite + +DROP TABLE IF EXISTS temp.[NoIdentity] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SQLite.MS).sql new file mode 100644 index 000000000000..d3008394ee7e --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SQLite.MS).sql @@ -0,0 +1,41 @@ +-- SQLite.MS SQLite + +CREATE TEMPORARY TABLE temp.[NoIdentity] +( + [Id] TEXT NOT NULL, + [Name] TEXT NOT NULL, + + CONSTRAINT [PK_NoIdentity] PRIMARY KEY ([Id]) +) + + + +-- SQLite.MS SQLite + +INSERT INTO temp.[NoIdentity] +( + [Id], + [Name] +) +VALUES +('BC7B663D-0FDE-4327-8F92-5D8CC3A11D11','John Doe'), +('A948600D-DE21-4F74-8AC2-9516B287076E','Jane Doe') + + + +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[Name] +FROM + temp.[NoIdentity] [t1] + + + +-- SQLite.MS SQLite + +DROP TABLE IF EXISTS temp.[NoIdentity] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SQLite.MS).sql new file mode 100644 index 000000000000..82cab4893e01 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SQLite.MS).sql @@ -0,0 +1,77 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +INSERT INTO "SkipModes" ("Id", "InsertOnly") +VALUES (@p0, @p1); + + +-- SQLite.MS SQLite +DECLARE @Id -- Int32 +SET @Id = 2 +DECLARE @InsertOnly -- Int32 +SET @InsertOnly = 2 + +INSERT INTO [SkipModes] +( + [Id], + [InsertOnly] +) +VALUES +( + @Id, + @InsertOnly +) + + + +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +UPDATE "SkipModes" SET "UpdateOnly" = @p0 +WHERE "Id" = @p1 +RETURNING 1; + + +-- SQLite.MS SQLite +DECLARE @UpdateOnly -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id -- Int32 +SET @Id = 2 + +UPDATE + [SkipModes] +SET + [UpdateOnly] = @UpdateOnly +WHERE + [SkipModes].[Id] = @Id + + + +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SQLite.MS).sql new file mode 100644 index 000000000000..340adb9bd8d6 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SQLite.MS).sql @@ -0,0 +1,34 @@ +-- SQLite.MS SQLite + +CREATE TEMPORARY TABLE temp.[WithIdentity] +( + [Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + [Name] TEXT NOT NULL +) + + + +-- SQLite.MS SQLite + +CREATE TEMPORARY TABLE temp.[NoIdentity] +( + [Id] TEXT NOT NULL, + [Name] TEXT NOT NULL, + + CONSTRAINT [PK_NoIdentity] PRIMARY KEY ([Id]) +) + + + +-- SQLite.MS SQLite + +DROP TABLE IF EXISTS temp.[NoIdentity] + + + +-- SQLite.MS SQLite + +DROP TABLE IF EXISTS temp.[WithIdentity] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SQLite.MS).sql new file mode 100644 index 000000000000..ad3c4676673a --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SQLite.MS).sql @@ -0,0 +1,28 @@ +Parameters: +@p0='?' (DbType = UInt16), @p1='?' (DbType = UInt16), @p2='?' (DbType = UInt32), @p3='?' (DbType = UInt32), @p4='?' (DbType = UInt64), @p5='?' (DbType = UInt64) + +INSERT INTO "UIntTable" ("Field16", "Field16N", "Field32", "Field32N", "Field64", "Field64N") +VALUES (@p0, @p1, @p2, @p3, @p4, @p5) +RETURNING "ID"; + + +-- SQLite.MS SQLite (asynchronously) +DECLARE @field64 Decimal +SET @field64 = 5 + +SELECT + [e].[ID], + [e].[Field16], + [e].[Field32], + [e].[Field64], + [e].[Field16N], + [e].[Field32N], + [e].[Field64N] +FROM + [UIntTable] [e] +WHERE + [e].[Field64] = @field64 +LIMIT 1 + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SQLite.MS,Default).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SQLite.MS,Default).sql new file mode 100644 index 000000000000..e56d91282771 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SQLite.MS,Default).sql @@ -0,0 +1,42 @@ +-- SQLite.MS SQLite +DECLARE @BlogType NVarChar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url NVarChar(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SQLite.MS SQLite +DECLARE @BlogType NVarChar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url NVarChar(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT "b"."Id", "b"."BlogType", "b"."Url" +FROM "Blogs" AS "b" + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SQLite.MS,MultipleRows).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SQLite.MS,MultipleRows).sql new file mode 100644 index 000000000000..e56d91282771 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SQLite.MS,MultipleRows).sql @@ -0,0 +1,42 @@ +-- SQLite.MS SQLite +DECLARE @BlogType NVarChar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url NVarChar(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SQLite.MS SQLite +DECLARE @BlogType NVarChar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url NVarChar(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT "b"."Id", "b"."BlogType", "b"."Url" +FROM "Blogs" AS "b" + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SQLite.MS,ProviderSpecific).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SQLite.MS,ProviderSpecific).sql new file mode 100644 index 000000000000..e56d91282771 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SQLite.MS,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- SQLite.MS SQLite +DECLARE @BlogType NVarChar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url NVarChar(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SQLite.MS SQLite +DECLARE @BlogType NVarChar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url NVarChar(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT "b"."Id", "b"."BlogType", "b"."Url" +FROM "Blogs" AS "b" + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SQLite.MS,RowByRow).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SQLite.MS,RowByRow).sql new file mode 100644 index 000000000000..e56d91282771 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SQLite.MS,RowByRow).sql @@ -0,0 +1,42 @@ +-- SQLite.MS SQLite +DECLARE @BlogType NVarChar(9) -- String +SET @BlogType = 'blog_base' +DECLARE @Url NVarChar(7) -- String +SET @Url = 'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SQLite.MS SQLite +DECLARE @BlogType NVarChar(8) -- String +SET @BlogType = 'blog_rss' +DECLARE @Url NVarChar(6) -- String +SET @Url = 'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT "b"."Id", "b"."BlogType", "b"."Url" +FROM "Blogs" AS "b" + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SQLite.MS).sql new file mode 100644 index 000000000000..d48bc06461ad --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SQLite.MS).sql @@ -0,0 +1,10 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @p='?' (DbType = Int32) + +SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder" +FROM "Products" AS "p" +WHERE (@ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted")) AND "p"."ProductID" > 0 +ORDER BY "p"."ProductID" +LIMIT @p + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SQLite.MS).sql new file mode 100644 index 000000000000..1a1073ba7a6b --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SQLite.MS).sql @@ -0,0 +1,52 @@ +-- SQLite.MS SQLite +DECLARE @take -- Int32 +SET @take = 2 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] +LIMIT @take + + + +-- SQLite.MS SQLite +DECLARE @take -- Int32 +SET @take = 2 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] +LIMIT @take + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SQLite.MS).sql new file mode 100644 index 000000000000..4d4446e0759a --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SQLite.MS).sql @@ -0,0 +1,26 @@ +-- SQLite.MS SQLite +DECLARE @take -- Int32 +SET @take = 2 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] +LIMIT @take + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SQLite.MS).sql new file mode 100644 index 000000000000..4d4446e0759a --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SQLite.MS).sql @@ -0,0 +1,26 @@ +-- SQLite.MS SQLite +DECLARE @take -- Int32 +SET @take = 2 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] +LIMIT @take + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SQLite.MS).sql new file mode 100644 index 000000000000..017ca41486dc --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SQLite.MS).sql @@ -0,0 +1,9 @@ +-- SQLite.MS SQLite + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SQLite.MS).sql new file mode 100644 index 000000000000..6850077dbb8e --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SQLite.MS).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT "p"."Id" AS "PatentId", @userId0 AS "UserId" +FROM "Patents" AS "p" +LEFT JOIN "PatentAssessment" AS "p0" ON "p"."Id" = "p0"."PatentId" +WHERE "p0"."PatentId" IS NULL OR "p0"."TechnicalReviewerId" <> @userId OR "p0"."TechnicalReviewerId" IS NULL + + +-- SQLite.MS SQLite +DECLARE @userId -- Int32 +SET @userId = 1 + +SELECT + [p].[Id] +FROM + [Patents] [p] + LEFT JOIN [PatentAssessment] [a_Assessment] ON [p].[Id] = [a_Assessment].[PatentId] +WHERE + [a_Assessment].[PatentId] IS NULL OR [a_Assessment].[TechnicalReviewerId] <> @userId OR + [a_Assessment].[TechnicalReviewerId] IS NULL + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SQLite.MS).sql new file mode 100644 index 000000000000..839c86ac9ef5 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SQLite.MS).sql @@ -0,0 +1,19 @@ +-- SQLite.MS SQLite + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + ( + SELECT + [a_Children].[IsActive] + FROM + [Children] [a_Children] + WHERE + [x].[Id] = [a_Children].[ParentId] + LIMIT 1 + ) = 0 + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SQLite.MS).sql new file mode 100644 index 000000000000..5a8548a603de --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SQLite.MS).sql @@ -0,0 +1,18 @@ +-- SQLite.MS SQLite + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + NOT EXISTS( + SELECT + * + FROM + [Children] [y] + WHERE + [x].[Id] = [y].[ParentId] AND [y].[IsActive] + ) + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SQLite.MS).sql new file mode 100644 index 000000000000..017ca41486dc --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SQLite.MS).sql @@ -0,0 +1,9 @@ +-- SQLite.MS SQLite + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SQLite.MS).sql new file mode 100644 index 000000000000..c64bedf275f7 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SQLite.MS).sql @@ -0,0 +1,11 @@ +-- SQLite.MS SQLite + +SELECT + [x].[Id] +FROM + [Issue340Entities] [x] +WHERE + [x].[IsActive] = 1 + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SQLite.MS).sql new file mode 100644 index 000000000000..e4621ee1cea7 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SQLite.MS).sql @@ -0,0 +1,16 @@ +-- SQLite.MS SQLite + +SELECT + 1 +FROM + [Parents] [ua] +WHERE + [ua].[ParentId] = 55377 AND EXISTS( + SELECT + * + FROM + [Parents] [t1] + ) + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SQLite.MS).sql new file mode 100644 index 000000000000..bc880aeeb5b0 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SQLite.MS).sql @@ -0,0 +1,16 @@ +-- SQLite.MS SQLite +DECLARE @DateTimeOffset -- DateTimeOffset +SET @DateTimeOffset = '2020-02-29T17:54:55.1231234+00:00' +DECLARE @DateTimeOffsetN -- DateTimeOffset +SET @DateTimeOffsetN = '2020-02-29T17:54:55.1231234+00:00' + +UPDATE + [Types] +SET + [DateTimeOffset] = @DateTimeOffset, + [DateTimeOffsetN] = @DateTimeOffsetN +WHERE + [Types].[Id] = 2 + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SQLite.MS).sql new file mode 100644 index 000000000000..64610e7c0788 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SQLite.MS).sql @@ -0,0 +1,16 @@ +-- SQLite.MS SQLite +DECLARE @DateTimeOffsetWithConverter -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + [Types] +SET + [DateTimeOffsetWithConverter] = @DateTimeOffsetWithConverter, + [DateTimeOffsetNWithConverter] = @DateTimeOffsetNWithConverter +WHERE + [Types].[Id] = 2 + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SQLite.MS).sql new file mode 100644 index 000000000000..6acce26f918a --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SQLite.MS).sql @@ -0,0 +1,36 @@ +-- SQLite.MS SQLite +DECLARE @take -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + [id].[Id] +FROM + ( + SELECT + [p].[Id] + FROM + [Issue4629Posts] [p] + WHERE + ( + SELECT + SUM([a_Tags].[Weight]) + FROM + [Issue4629Tags] [a_Tags] + WHERE + [p].[Id] = [a_Tags].[PostId] AND [a_Tags].[Weight] > 1 + ) > 5 + ORDER BY + ( + SELECT + SUM([a_Tags_1].[Weight]) + FROM + [Issue4629Tags] [a_Tags_1] + WHERE + [p].[Id] = [a_Tags_1].[PostId] + ) + LIMIT @take + ) [id] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SQLite.MS).sql new file mode 100644 index 000000000000..4af40be83ffd --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SQLite.MS).sql @@ -0,0 +1,20 @@ +-- SQLite.MS SQLite +DECLARE @id -- Int32 +SET @id = 2 + +SELECT + [t1].[Index_1] +FROM + ( + SELECT + [x].[Id], + ROW_NUMBER() OVER(ORDER BY [x].[Id]) as [Index_1] + FROM + [Parents] [x] + ) [t1] +WHERE + [t1].[Id] = @id +LIMIT 1 + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SQLite.MS).sql new file mode 100644 index 000000000000..56f16b7abb28 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SQLite.MS).sql @@ -0,0 +1,40 @@ +BeginTransaction(Serializable) + + +-- SQLite.MS SQLite + +SELECT + [m_1].[Key_1], + [d].[CfAllowValue], + [d].[DateFrom] +FROM + ( + SELECT + [p].[AclNameId] as [Key_1] + FROM + [Issue4624Items] [p] + GROUP BY + [p].[AclNameId] + LIMIT 1 + ) [m_1] + INNER JOIN [Issue4624Items] [d] ON [m_1].[Key_1] = [d].[AclNameId] +ORDER BY + [d].[DateFrom] + + + +-- SQLite.MS SQLite + +SELECT + [p].[AclNameId] +FROM + [Issue4624Items] [p] +GROUP BY + [p].[AclNameId] +LIMIT 1 + + + +DisposeTransaction + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(SQLite.MS).sql new file mode 100644 index 000000000000..2f937ead34a2 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4653Test(SQLite.MS).sql @@ -0,0 +1,9 @@ +-- SQLite.MS SQLite + +SELECT + [t1].[Id] +FROM + [Masters] [t1] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SQLite.MS).sql new file mode 100644 index 000000000000..60117d9a8b72 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SQLite.MS).sql @@ -0,0 +1,21 @@ +-- SQLite.MS SQLite (asynchronously) + +SELECT + [x].[Id], + [x].[IsActive], + [x].[ParentId], + [x].[Name] +FROM + [Children] [x] +WHERE + [x].[Name] LIKE '%Test%' ESCAPE '~' +ORDER BY + [x].[Name] + + + +SELECT "c"."Id", "c"."IsActive", "c"."Name", "c"."ParentId" +FROM "Children" AS "c" +WHERE "c"."Name" LIKE 'Test%' + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SQLite.MS).sql new file mode 100644 index 000000000000..c452b1fe6520 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SQLite.MS).sql @@ -0,0 +1,64 @@ +-- SQLite.MS SQLite + +CREATE TEMPORARY TABLE temp.[Issue4671Entity1TMP] +( + [Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + [Value] INTEGER NOT NULL +) + + + +-- SQLite.MS SQLite + +INSERT INTO [Issue4671Entity1] +( + [Value] +) +VALUES +( + 1 +) + + + +-- SQLite.MS SQLite + +INSERT INTO temp.[Issue4671Entity1TMP] +( + [Value] +) +VALUES +( + 2 +) + + + +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[Value] +FROM + [Issue4671Entity1] [t1] +LIMIT 2 + + + +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[Value] +FROM + temp.[Issue4671Entity1TMP] [t1] +LIMIT 2 + + + +-- SQLite.MS SQLite + +DROP TABLE IF EXISTS temp.[Issue4671Entity1TMP] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SQLite.MS,False).sql new file mode 100644 index 000000000000..8c9cb60b7d55 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SQLite.MS,False).sql @@ -0,0 +1,12 @@ +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SQLite.MS,True).sql new file mode 100644 index 000000000000..8c9cb60b7d55 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SQLite.MS,True).sql @@ -0,0 +1,12 @@ +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SQLite.MS,False).sql new file mode 100644 index 000000000000..8c9cb60b7d55 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SQLite.MS,False).sql @@ -0,0 +1,12 @@ +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SQLite.MS,True).sql new file mode 100644 index 000000000000..8c9cb60b7d55 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SQLite.MS,True).sql @@ -0,0 +1,12 @@ +-- SQLite.MS SQLite + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SQLite.MS).sql new file mode 100644 index 000000000000..a055d35a3a3f --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SQLite.MS).sql @@ -0,0 +1,18 @@ +SELECT COALESCE("i0"."Name", '') || '>' || "i"."Name" +FROM "Issue73Entities" AS "i" +LEFT JOIN "Issue73Entities" AS "i0" ON "i"."ParentId" = "i0"."Id" +WHERE "i"."Name" = 'Name1_3' + + +-- SQLite.MS SQLite + +SELECT + [a_Parent].[Name] || '>' || [x].[Name] +FROM + [Issue73Entities] [x] + LEFT JOIN [Issue73Entities] [a_Parent] ON [x].[ParentId] = [a_Parent].[Id] +WHERE + [x].[Name] = 'Name1_3' + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SQLite.MS).sql new file mode 100644 index 000000000000..4a7464d4c641 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SQLite.MS).sql @@ -0,0 +1,50 @@ +Parameters: +@p0='?' (DbType = Int32) + +INSERT INTO "IssueEnum" ("Value") +VALUES (@p0) +RETURNING "Id"; + + +Parameters: +@p0='?' (DbType = Int32) + +INSERT INTO "IssueEnum" ("Value") +VALUES (@p0) +RETURNING "Id"; + + +Parameters: +@p0='?' (DbType = Int32) + +INSERT INTO "IssueEnum" ("Value") +VALUES (@p0) +RETURNING "Id"; + + +Parameters: +@p0='?' (DbType = Int32) + +INSERT INTO "IssueEnum" ("Value") +VALUES (@p0) +RETURNING "Id"; + + +Parameters: +@p0='?' (DbType = Int32) + +INSERT INTO "IssueEnum" ("Value") +VALUES (@p0) +RETURNING "Id"; + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [t1].[Id], + [t1].[Value] +FROM + [IssueEnum] [t1] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SQLite.MS).sql new file mode 100644 index 000000000000..ec7089ff965e --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SQLite.MS).sql @@ -0,0 +1,22 @@ +-- SQLite.MS SQLite + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] IS NOT NULL + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SQLite.MS).sql new file mode 100644 index 000000000000..e2b31ec79006 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SQLite.MS).sql @@ -0,0 +1,22 @@ +-- SQLite.MS SQLite + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE '%anything%' ESCAPE '~' + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SQLite.MS).sql new file mode 100644 index 000000000000..ee1e7e1e4f3c --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SQLite.MS).sql @@ -0,0 +1,24 @@ +-- SQLite.MS SQLite +DECLARE @value NVarChar(10) -- String +SET @value = '%anything%' + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE @value ESCAPE '~' + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/SQLiteTests/LinqToDB.EntityFrameworkCore.Tests.SQLiteTests.TestFunctionsMapping(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/SQLiteTests/LinqToDB.EntityFrameworkCore.Tests.SQLiteTests.TestFunctionsMapping(SQLite.MS).sql new file mode 100644 index 000000000000..69504a3af0cc --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/SQLiteTests/LinqToDB.EntityFrameworkCore.Tests.SQLiteTests.TestFunctionsMapping(SQLite.MS).sql @@ -0,0 +1,13 @@ +-- SQLite.MS SQLite + +SELECT + [e].[IsDeleted], + [e].[CategoryID], + [e].[CategoryName], + [e].[Description], + [e].[Picture] +FROM + [Categories] [e] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SQLite.MS).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SQLite.MS).sql new file mode 100644 index 000000000000..6ce63f821602 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SQLite.MS).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT "o"."OrderID", "o1"."OrderID", "o1"."ProductID", "p0"."ProductID", "o3"."OrderId", "o3"."ProductId", "o3"."Quantity", "o1"."Quantity", "p0"."ProductName" +FROM "Orders" AS "o" +INNER JOIN ( + SELECT "o0"."OrderID", "o0"."ProductID", "o0"."Quantity" + FROM "Order Details" AS "o0" + WHERE @ef_filter__p2 OR NOT ("o0"."IsDeleted") OR NOT ("o0"."IsDeleted") +) AS "o1" ON "o"."OrderID" = "o1"."OrderID" +INNER JOIN ( + SELECT "p"."ProductID", "p"."ProductName" + FROM "Products" AS "p" + WHERE @ef_filter__p4 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") +) AS "p0" ON "o1"."ProductID" = "p0"."ProductID" +LEFT JOIN ( + SELECT "o2"."OrderID" AS "OrderId", "o2"."ProductID" AS "ProductId", "o2"."Quantity" + FROM "Order Details" AS "o2" + WHERE @ef_filter__p2 OR NOT ("o2"."IsDeleted") OR NOT ("o2"."IsDeleted") +) AS "o3" ON "p0"."ProductID" = "o3"."ProductId" +WHERE @ef_filter__p0 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted") +ORDER BY "o"."OrderID", "o1"."OrderID", "o1"."ProductID", "p0"."ProductID", "o3"."OrderId" + + +BeginTransaction(Serializable) + + +-- SQLite.MS SQLite + +SELECT + [m_1].[ProductId], + [d].[OrderID], + [d].[ProductID], + [d].[Quantity] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId] + FROM + [Orders] [e] + INNER JOIN [Order Details] [od] ON [e].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductId] = [d].[ProductID] + + + +DisposeTransaction + + +-- SQLite.MS SQLite + +SELECT + [a_Product].[ProductID], + [od].[OrderID], + [od].[ProductID], + [od].[Quantity], + [a_Product].[ProductName] +FROM + [Orders] [o] + INNER JOIN [Order Details] [od] ON [o].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SQLite.MS,False).sql new file mode 100644 index 000000000000..afce47af90c8 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SQLite.MS,False).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder" +FROM "Products" AS "p" +WHERE (@ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted")) AND instr("p"."ProductName", 'a') > 0 + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder" +FROM "Products" AS "p" +WHERE (@ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted")) AND instr("p"."ProductName", 'a') > 0 + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS "p" + WHERE (@ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted")) AND instr("p"."ProductName", 'a') > 0) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE '%a%' ESCAPE '~' + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE '%a%' ESCAPE '~' + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE '%a%' ESCAPE '~' + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[ProductName] LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SQLite.MS,True).sql new file mode 100644 index 000000000000..0057f6411363 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SQLite.MS,True).sql @@ -0,0 +1,102 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder" +FROM "Products" AS "p" +WHERE (@ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted")) AND instr("p"."ProductName", 'a') > 0 + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder" +FROM "Products" AS "p" +WHERE (@ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted")) AND instr("p"."ProductName", 'a') > 0 + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT EXISTS ( + SELECT 1 + FROM "Products" AS "p" + WHERE (@ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted")) AND instr("p"."ProductName", 'a') > 0) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + NOT [e].[IsDeleted] AND [e].[ProductName] LIKE '%a%' ESCAPE '~' + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + NOT [e].[IsDeleted] AND [e].[ProductName] LIKE '%a%' ESCAPE '~' + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + NOT [e].[IsDeleted] AND [e].[ProductName] LIKE '%a%' ESCAPE '~' + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + NOT [e].[IsDeleted] AND [e].[ProductName] LIKE '%a%' ESCAPE '~' + ) + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SQLite.MS,False).sql new file mode 100644 index 000000000000..6cb69e2549eb --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SQLite.MS,False).sql @@ -0,0 +1,17 @@ +-- SQLite.MS SQLite + +DELETE FROM + [Products] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e] + WHERE + [Products].[ProductID] = [e].[ProductID] + ) > 0 AND + [Products].[ProductName] LIKE 'a%' ESCAPE '~' AND [Products].[ProductName] = 'a' + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SQLite.MS,True).sql new file mode 100644 index 000000000000..65d82bdb16dc --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SQLite.MS,True).sql @@ -0,0 +1,19 @@ +-- SQLite.MS SQLite + +DELETE FROM + [Products] +WHERE + NOT [Products].[IsDeleted] AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e] + WHERE + NOT [e].[IsDeleted] AND [Products].[ProductID] = [e].[ProductID] + ) > 0 AND + [Products].[ProductName] LIKE 'a%' ESCAPE '~' AND + [Products].[ProductName] = 'a' + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SQLite.MS,False).sql new file mode 100644 index 000000000000..304bdeae7b26 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SQLite.MS,False).sql @@ -0,0 +1,95 @@ +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Decimal) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2 +RETURNING 1; + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SQLite.MS,True).sql new file mode 100644 index 000000000000..bdf3af5d9f93 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SQLite.MS,True).sql @@ -0,0 +1,106 @@ +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + NOT [e].[IsDeleted] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + NOT [a_Product].[IsDeleted] AND NOT [d].[IsDeleted] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + NOT [d_1].[IsDeleted] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + NOT [m_1].[IsDeleted] AND NOT [a_Product].[IsDeleted] AND + NOT [d].[IsDeleted] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + NOT [e].[IsDeleted] + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Decimal) + +UPDATE "Order Details" SET "UnitPrice" = @p0 +WHERE "OrderID" = @p1 AND "ProductID" = @p2 +RETURNING 1; + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SQLite.MS,False).sql new file mode 100644 index 000000000000..af826b68d955 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SQLite.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SQLite.MS,True).sql new file mode 100644 index 000000000000..b9f02a13923c --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SQLite.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + NOT [e].[IsDeleted] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + NOT [a_Product].[IsDeleted] AND NOT [d].[IsDeleted] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + NOT [d_1].[IsDeleted] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + NOT [m_1].[IsDeleted] AND NOT [a_Product].[IsDeleted] AND + NOT [d].[IsDeleted] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + NOT [e].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SQLite.MS,False).sql new file mode 100644 index 000000000000..af826b68d955 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SQLite.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SQLite.MS,True).sql new file mode 100644 index 000000000000..b9f02a13923c --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SQLite.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + NOT [e].[IsDeleted] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + NOT [a_Product].[IsDeleted] AND NOT [d].[IsDeleted] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + NOT [d_1].[IsDeleted] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + NOT [m_1].[IsDeleted] AND NOT [a_Product].[IsDeleted] AND + NOT [d].[IsDeleted] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + NOT [e].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SQLite.MS,False).sql new file mode 100644 index 000000000000..7e28402afa33 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SQLite.MS,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT "o"."OrderID", "o"."CustomerID", "o"."EmployeeID", "o"."Freight", "o"."IsDeleted", "o"."OrderDate", "o"."RequiredDate", "o"."ShipAddress", "o"."ShipCity", "o"."ShipCountry", "o"."ShipName", "o"."ShipPostalCode", "o"."ShipRegion", "o"."ShipVia", "o"."ShippedDate", "s"."OrderID", "s"."ProductID", "s"."Discount", "s"."IsDeleted", "s"."Quantity", "s"."UnitPrice", "s"."ProductID0", "s"."CategoryID", "s"."Discontinued", "s"."IsDeleted0", "s"."ProductName", "s"."QuantityPerUnit", "s"."ReorderLevel", "s"."SupplierID", "s"."UnitPrice0", "s"."UnitsInStock", "s"."UnitsOnOrder", "s"."OrderID0", "s"."ProductID1", "s"."Discount0", "s"."IsDeleted1", "s"."Quantity0", "s"."UnitPrice1" +FROM "Orders" AS "o" +LEFT JOIN ( + SELECT "o0"."OrderID", "o0"."ProductID", "o0"."Discount", "o0"."IsDeleted", "o0"."Quantity", "o0"."UnitPrice", "p0"."ProductID" AS "ProductID0", "p0"."CategoryID", "p0"."Discontinued", "p0"."IsDeleted" AS "IsDeleted0", "p0"."ProductName", "p0"."QuantityPerUnit", "p0"."ReorderLevel", "p0"."SupplierID", "p0"."UnitPrice" AS "UnitPrice0", "p0"."UnitsInStock", "p0"."UnitsOnOrder", "o2"."OrderID" AS "OrderID0", "o2"."ProductID" AS "ProductID1", "o2"."Discount" AS "Discount0", "o2"."IsDeleted" AS "IsDeleted1", "o2"."Quantity" AS "Quantity0", "o2"."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS "o0" + INNER JOIN ( + SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder" + FROM "Products" AS "p" + WHERE @ef_filter__p4 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") + ) AS "p0" ON "o0"."ProductID" = "p0"."ProductID" + LEFT JOIN ( + SELECT "o1"."OrderID", "o1"."ProductID", "o1"."Discount", "o1"."IsDeleted", "o1"."Quantity", "o1"."UnitPrice" + FROM "Order Details" AS "o1" + WHERE @ef_filter__p2 OR NOT ("o1"."IsDeleted") OR NOT ("o1"."IsDeleted") + ) AS "o2" ON "p0"."ProductID" = "o2"."ProductID" + WHERE @ef_filter__p2 OR NOT ("o0"."IsDeleted") OR NOT ("o0"."IsDeleted") +) AS "s" ON "o"."OrderID" = "s"."OrderID" +WHERE @ef_filter__p0 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted") +ORDER BY "o"."OrderID", "s"."OrderID", "s"."ProductID", "s"."ProductID0", "s"."OrderID0" + + +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SQLite.MS,True).sql new file mode 100644 index 000000000000..d163d503b781 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SQLite.MS,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT "o"."OrderID", "o"."CustomerID", "o"."EmployeeID", "o"."Freight", "o"."IsDeleted", "o"."OrderDate", "o"."RequiredDate", "o"."ShipAddress", "o"."ShipCity", "o"."ShipCountry", "o"."ShipName", "o"."ShipPostalCode", "o"."ShipRegion", "o"."ShipVia", "o"."ShippedDate", "s"."OrderID", "s"."ProductID", "s"."Discount", "s"."IsDeleted", "s"."Quantity", "s"."UnitPrice", "s"."ProductID0", "s"."CategoryID", "s"."Discontinued", "s"."IsDeleted0", "s"."ProductName", "s"."QuantityPerUnit", "s"."ReorderLevel", "s"."SupplierID", "s"."UnitPrice0", "s"."UnitsInStock", "s"."UnitsOnOrder", "s"."OrderID0", "s"."ProductID1", "s"."Discount0", "s"."IsDeleted1", "s"."Quantity0", "s"."UnitPrice1" +FROM "Orders" AS "o" +LEFT JOIN ( + SELECT "o0"."OrderID", "o0"."ProductID", "o0"."Discount", "o0"."IsDeleted", "o0"."Quantity", "o0"."UnitPrice", "p0"."ProductID" AS "ProductID0", "p0"."CategoryID", "p0"."Discontinued", "p0"."IsDeleted" AS "IsDeleted0", "p0"."ProductName", "p0"."QuantityPerUnit", "p0"."ReorderLevel", "p0"."SupplierID", "p0"."UnitPrice" AS "UnitPrice0", "p0"."UnitsInStock", "p0"."UnitsOnOrder", "o2"."OrderID" AS "OrderID0", "o2"."ProductID" AS "ProductID1", "o2"."Discount" AS "Discount0", "o2"."IsDeleted" AS "IsDeleted1", "o2"."Quantity" AS "Quantity0", "o2"."UnitPrice" AS "UnitPrice1" + FROM "Order Details" AS "o0" + INNER JOIN ( + SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder" + FROM "Products" AS "p" + WHERE @ef_filter__p4 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") + ) AS "p0" ON "o0"."ProductID" = "p0"."ProductID" + LEFT JOIN ( + SELECT "o1"."OrderID", "o1"."ProductID", "o1"."Discount", "o1"."IsDeleted", "o1"."Quantity", "o1"."UnitPrice" + FROM "Order Details" AS "o1" + WHERE @ef_filter__p2 OR NOT ("o1"."IsDeleted") OR NOT ("o1"."IsDeleted") + ) AS "o2" ON "p0"."ProductID" = "o2"."ProductID" + WHERE @ef_filter__p2 OR NOT ("o0"."IsDeleted") OR NOT ("o0"."IsDeleted") +) AS "s" ON "o"."OrderID" = "s"."OrderID" +WHERE @ef_filter__p0 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted") +ORDER BY "o"."OrderID", "s"."OrderID", "s"."ProductID", "s"."ProductID0", "s"."OrderID0" + + +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + NOT [e].[IsDeleted] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + NOT [a_Product].[IsDeleted] AND NOT [d].[IsDeleted] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + NOT [d_1].[IsDeleted] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + NOT [m_1].[IsDeleted] AND NOT [a_Product].[IsDeleted] AND + NOT [d].[IsDeleted] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + NOT [e].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SQLite.MS,False).sql new file mode 100644 index 000000000000..7d30818c3030 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SQLite.MS,False).sql @@ -0,0 +1,22 @@ +-- SQLite.MS SQLite + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] +WHERE + [op].[ProductID] IS NULL + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SQLite.MS,True).sql new file mode 100644 index 000000000000..5a23ab173b07 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SQLite.MS,True).sql @@ -0,0 +1,22 @@ +-- SQLite.MS SQLite + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] AND NOT [op].[IsDeleted] +WHERE + NOT [e].[IsDeleted] AND [op].[ProductID] IS NULL + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SQLite.MS,False).sql new file mode 100644 index 000000000000..c9279150d8e7 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SQLite.MS,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT "e0"."EmployeeID", "e0"."Address", "e0"."BirthDate", "e0"."City", "e0"."Country", "e0"."Extension", "e0"."FirstName", "e0"."HireDate", "e0"."HomePhone", "e0"."IsDeleted", "e0"."LastName", "e0"."Notes", "e0"."Photo", "e0"."PhotoPath", "e0"."PostalCode", "e0"."Region", "e0"."ReportsTo", "e0"."Title", "e0"."TitleOfCourtesy", "o"."OrderID", "s"."EmployeeID", "s"."TerritoryID", "s"."IsDeleted", "s"."TerritoryID0", "s"."IsDeleted0", "s"."RegionID", "s"."TerritoryDescription", "s0"."OrderID", "s0"."ProductID", "s0"."Discount", "s0"."IsDeleted", "s0"."Quantity", "s0"."UnitPrice", "s0"."ProductID0", "s0"."CategoryID", "s0"."Discontinued", "s0"."IsDeleted0", "s0"."ProductName", "s0"."QuantityPerUnit", "s0"."ReorderLevel", "s0"."SupplierID", "s0"."UnitPrice0", "s0"."UnitsInStock", "s0"."UnitsOnOrder" +FROM "Orders" AS "o" +LEFT JOIN ( + SELECT "e"."EmployeeID", "e"."Address", "e"."BirthDate", "e"."City", "e"."Country", "e"."Extension", "e"."FirstName", "e"."HireDate", "e"."HomePhone", "e"."IsDeleted", "e"."LastName", "e"."Notes", "e"."Photo", "e"."PhotoPath", "e"."PostalCode", "e"."Region", "e"."ReportsTo", "e"."Title", "e"."TitleOfCourtesy" + FROM "Employees" AS "e" + WHERE @ef_filter__p2 OR NOT ("e"."IsDeleted") OR NOT ("e"."IsDeleted") +) AS "e0" ON "o"."EmployeeID" = "e0"."EmployeeID" +LEFT JOIN ( + SELECT "e1"."EmployeeID", "e1"."TerritoryID", "e1"."IsDeleted", "t0"."TerritoryID" AS "TerritoryID0", "t0"."IsDeleted" AS "IsDeleted0", "t0"."RegionID", "t0"."TerritoryDescription" + FROM "EmployeeTerritories" AS "e1" + INNER JOIN ( + SELECT "t"."TerritoryID", "t"."IsDeleted", "t"."RegionID", "t"."TerritoryDescription" + FROM "Territories" AS "t" + WHERE @ef_filter__p8 OR NOT ("t"."IsDeleted") OR NOT ("t"."IsDeleted") + ) AS "t0" ON "e1"."TerritoryID" = "t0"."TerritoryID" + WHERE @ef_filter__p4 OR NOT ("e1"."IsDeleted") OR NOT ("e1"."IsDeleted") +) AS "s" ON "e0"."EmployeeID" = "s"."EmployeeID" +LEFT JOIN ( + SELECT "o0"."OrderID", "o0"."ProductID", "o0"."Discount", "o0"."IsDeleted", "o0"."Quantity", "o0"."UnitPrice", "p0"."ProductID" AS "ProductID0", "p0"."CategoryID", "p0"."Discontinued", "p0"."IsDeleted" AS "IsDeleted0", "p0"."ProductName", "p0"."QuantityPerUnit", "p0"."ReorderLevel", "p0"."SupplierID", "p0"."UnitPrice" AS "UnitPrice0", "p0"."UnitsInStock", "p0"."UnitsOnOrder" + FROM "Order Details" AS "o0" + INNER JOIN ( + SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder" + FROM "Products" AS "p" + WHERE @ef_filter__p10 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") + ) AS "p0" ON "o0"."ProductID" = "p0"."ProductID" + WHERE @ef_filter__p6 OR NOT ("o0"."IsDeleted") OR NOT ("o0"."IsDeleted") +) AS "s0" ON "o"."OrderID" = "s0"."OrderID" +WHERE @ef_filter__p0 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted") +ORDER BY "o"."OrderID", "e0"."EmployeeID", "s"."EmployeeID", "s"."TerritoryID", "s"."TerritoryID0", "s0"."OrderID", "s0"."ProductID" + + +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SQLite.MS,True).sql new file mode 100644 index 000000000000..bd5cb4363cd1 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SQLite.MS,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT "e0"."EmployeeID", "e0"."Address", "e0"."BirthDate", "e0"."City", "e0"."Country", "e0"."Extension", "e0"."FirstName", "e0"."HireDate", "e0"."HomePhone", "e0"."IsDeleted", "e0"."LastName", "e0"."Notes", "e0"."Photo", "e0"."PhotoPath", "e0"."PostalCode", "e0"."Region", "e0"."ReportsTo", "e0"."Title", "e0"."TitleOfCourtesy", "o"."OrderID", "s"."EmployeeID", "s"."TerritoryID", "s"."IsDeleted", "s"."TerritoryID0", "s"."IsDeleted0", "s"."RegionID", "s"."TerritoryDescription", "s0"."OrderID", "s0"."ProductID", "s0"."Discount", "s0"."IsDeleted", "s0"."Quantity", "s0"."UnitPrice", "s0"."ProductID0", "s0"."CategoryID", "s0"."Discontinued", "s0"."IsDeleted0", "s0"."ProductName", "s0"."QuantityPerUnit", "s0"."ReorderLevel", "s0"."SupplierID", "s0"."UnitPrice0", "s0"."UnitsInStock", "s0"."UnitsOnOrder" +FROM "Orders" AS "o" +LEFT JOIN ( + SELECT "e"."EmployeeID", "e"."Address", "e"."BirthDate", "e"."City", "e"."Country", "e"."Extension", "e"."FirstName", "e"."HireDate", "e"."HomePhone", "e"."IsDeleted", "e"."LastName", "e"."Notes", "e"."Photo", "e"."PhotoPath", "e"."PostalCode", "e"."Region", "e"."ReportsTo", "e"."Title", "e"."TitleOfCourtesy" + FROM "Employees" AS "e" + WHERE @ef_filter__p2 OR NOT ("e"."IsDeleted") OR NOT ("e"."IsDeleted") +) AS "e0" ON "o"."EmployeeID" = "e0"."EmployeeID" +LEFT JOIN ( + SELECT "e1"."EmployeeID", "e1"."TerritoryID", "e1"."IsDeleted", "t0"."TerritoryID" AS "TerritoryID0", "t0"."IsDeleted" AS "IsDeleted0", "t0"."RegionID", "t0"."TerritoryDescription" + FROM "EmployeeTerritories" AS "e1" + INNER JOIN ( + SELECT "t"."TerritoryID", "t"."IsDeleted", "t"."RegionID", "t"."TerritoryDescription" + FROM "Territories" AS "t" + WHERE @ef_filter__p8 OR NOT ("t"."IsDeleted") OR NOT ("t"."IsDeleted") + ) AS "t0" ON "e1"."TerritoryID" = "t0"."TerritoryID" + WHERE @ef_filter__p4 OR NOT ("e1"."IsDeleted") OR NOT ("e1"."IsDeleted") +) AS "s" ON "e0"."EmployeeID" = "s"."EmployeeID" +LEFT JOIN ( + SELECT "o0"."OrderID", "o0"."ProductID", "o0"."Discount", "o0"."IsDeleted", "o0"."Quantity", "o0"."UnitPrice", "p0"."ProductID" AS "ProductID0", "p0"."CategoryID", "p0"."Discontinued", "p0"."IsDeleted" AS "IsDeleted0", "p0"."ProductName", "p0"."QuantityPerUnit", "p0"."ReorderLevel", "p0"."SupplierID", "p0"."UnitPrice" AS "UnitPrice0", "p0"."UnitsInStock", "p0"."UnitsOnOrder" + FROM "Order Details" AS "o0" + INNER JOIN ( + SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder" + FROM "Products" AS "p" + WHERE @ef_filter__p10 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") + ) AS "p0" ON "o0"."ProductID" = "p0"."ProductID" + WHERE @ef_filter__p6 OR NOT ("o0"."IsDeleted") OR NOT ("o0"."IsDeleted") +) AS "s0" ON "o"."OrderID" = "s0"."OrderID" +WHERE @ef_filter__p0 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted") +ORDER BY "o"."OrderID", "e0"."EmployeeID", "s"."EmployeeID", "s"."TerritoryID", "s"."TerritoryID0", "s0"."OrderID", "s0"."ProductID" + + +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND NOT [a_Employee].[IsDeleted] + WHERE + NOT [e].[IsDeleted] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] +WHERE + NOT [e_1].[IsDeleted] AND NOT [d].[IsDeleted] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + NOT [e].[IsDeleted] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] +WHERE + NOT [e_1].[IsDeleted] AND NOT [d].[IsDeleted] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] AND NOT [a_Employee].[IsDeleted] +WHERE + NOT [o].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SQLite.MS,False).sql new file mode 100644 index 000000000000..f492071b073a --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SQLite.MS,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT "e"."EmployeeID", "e"."Address", "e"."BirthDate", "e"."City", "e"."Country", "e"."Extension", "e"."FirstName", "e"."HireDate", "e"."HomePhone", "e"."IsDeleted", "e"."LastName", "e"."Notes", "e"."Photo", "e"."PhotoPath", "e"."PostalCode", "e"."Region", "e"."ReportsTo", "e"."Title", "e"."TitleOfCourtesy", "e1"."EmployeeID", "e1"."Address", "e1"."BirthDate", "e1"."City", "e1"."Country", "e1"."Extension", "e1"."FirstName", "e1"."HireDate", "e1"."HomePhone", "e1"."IsDeleted", "e1"."LastName", "e1"."Notes", "e1"."Photo", "e1"."PhotoPath", "e1"."PostalCode", "e1"."Region", "e1"."ReportsTo", "e1"."Title", "e1"."TitleOfCourtesy" +FROM "Employees" AS "e" +LEFT JOIN ( + SELECT "e0"."EmployeeID", "e0"."Address", "e0"."BirthDate", "e0"."City", "e0"."Country", "e0"."Extension", "e0"."FirstName", "e0"."HireDate", "e0"."HomePhone", "e0"."IsDeleted", "e0"."LastName", "e0"."Notes", "e0"."Photo", "e0"."PhotoPath", "e0"."PostalCode", "e0"."Region", "e0"."ReportsTo", "e0"."Title", "e0"."TitleOfCourtesy" + FROM "Employees" AS "e0" + WHERE @ef_filter__p0 OR NOT ("e0"."IsDeleted") OR NOT ("e0"."IsDeleted") +) AS "e1" ON "e"."ReportsTo" = "e1"."EmployeeID" +WHERE @ef_filter__p0 OR NOT ("e"."IsDeleted") OR NOT ("e"."IsDeleted") + + +-- SQLite.MS SQLite + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SQLite.MS,True).sql new file mode 100644 index 000000000000..4b5bf759f640 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SQLite.MS,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT "e"."EmployeeID", "e"."Address", "e"."BirthDate", "e"."City", "e"."Country", "e"."Extension", "e"."FirstName", "e"."HireDate", "e"."HomePhone", "e"."IsDeleted", "e"."LastName", "e"."Notes", "e"."Photo", "e"."PhotoPath", "e"."PostalCode", "e"."Region", "e"."ReportsTo", "e"."Title", "e"."TitleOfCourtesy", "e1"."EmployeeID", "e1"."Address", "e1"."BirthDate", "e1"."City", "e1"."Country", "e1"."Extension", "e1"."FirstName", "e1"."HireDate", "e1"."HomePhone", "e1"."IsDeleted", "e1"."LastName", "e1"."Notes", "e1"."Photo", "e1"."PhotoPath", "e1"."PostalCode", "e1"."Region", "e1"."ReportsTo", "e1"."Title", "e1"."TitleOfCourtesy" +FROM "Employees" AS "e" +LEFT JOIN ( + SELECT "e0"."EmployeeID", "e0"."Address", "e0"."BirthDate", "e0"."City", "e0"."Country", "e0"."Extension", "e0"."FirstName", "e0"."HireDate", "e0"."HomePhone", "e0"."IsDeleted", "e0"."LastName", "e0"."Notes", "e0"."Photo", "e0"."PhotoPath", "e0"."PostalCode", "e0"."Region", "e0"."ReportsTo", "e0"."Title", "e0"."TitleOfCourtesy" + FROM "Employees" AS "e0" + WHERE @ef_filter__p0 OR NOT ("e0"."IsDeleted") OR NOT ("e0"."IsDeleted") +) AS "e1" ON "e"."ReportsTo" = "e1"."EmployeeID" +WHERE @ef_filter__p0 OR NOT ("e"."IsDeleted") OR NOT ("e"."IsDeleted") + + +-- SQLite.MS SQLite + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND NOT [a_ReportsToNavigation].[IsDeleted] +WHERE + NOT [e].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SQLite.MS,False).sql new file mode 100644 index 000000000000..20b69cc0c2a2 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SQLite.MS,False).sql @@ -0,0 +1,22 @@ +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[City] IS NOT NULL + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SQLite.MS,True).sql new file mode 100644 index 000000000000..00339e112e1e --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SQLite.MS,True).sql @@ -0,0 +1,22 @@ +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + NOT [e].[IsDeleted] AND [e].[City] IS NOT NULL + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SQLite.MS,False).sql new file mode 100644 index 000000000000..6268af9241a9 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SQLite.MS,False).sql @@ -0,0 +1,70 @@ +SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder", "o"."OrderID", "o"."ProductID", "o"."Discount", "o"."IsDeleted", "o"."Quantity", "o"."UnitPrice" +FROM "Products" AS "p" +INNER JOIN "Order Details" AS "o" ON "p"."ProductID" = "o"."ProductID" + + +-- SQLite.MS SQLite + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder", "o0"."OrderID", "o0"."ProductID", "o0"."Discount", "o0"."IsDeleted", "o0"."Quantity", "o0"."UnitPrice" +FROM "Products" AS "p" +INNER JOIN ( + SELECT "o"."OrderID", "o"."ProductID", "o"."Discount", "o"."IsDeleted", "o"."Quantity", "o"."UnitPrice" + FROM "Order Details" AS "o" + WHERE @ef_filter__p2 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted") +) AS "o0" ON "p"."ProductID" = "o0"."ProductID" +WHERE @ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") + + +-- SQLite.MS SQLite + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SQLite.MS,True).sql new file mode 100644 index 000000000000..783f82834bbb --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SQLite.MS,True).sql @@ -0,0 +1,74 @@ +SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder", "o"."OrderID", "o"."ProductID", "o"."Discount", "o"."IsDeleted", "o"."Quantity", "o"."UnitPrice" +FROM "Products" AS "p" +INNER JOIN "Order Details" AS "o" ON "p"."ProductID" = "o"."ProductID" + + +-- SQLite.MS SQLite + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + NOT [d].[IsDeleted] + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder", "o0"."OrderID", "o0"."ProductID", "o0"."Discount", "o0"."IsDeleted", "o0"."Quantity", "o0"."UnitPrice" +FROM "Products" AS "p" +INNER JOIN ( + SELECT "o"."OrderID", "o"."ProductID", "o"."Discount", "o"."IsDeleted", "o"."Quantity", "o"."UnitPrice" + FROM "Order Details" AS "o" + WHERE @ef_filter__p2 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted") +) AS "o0" ON "p"."ProductID" = "o0"."ProductID" +WHERE @ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") + + +-- SQLite.MS SQLite + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + NOT [p].[IsDeleted] AND NOT [d].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SQLite.MS,False).sql new file mode 100644 index 000000000000..ed2dd6837eb0 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SQLite.MS,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT "o"."OrderID", "o"."CustomerID", "o"."EmployeeID", "o"."Freight", "o"."IsDeleted", "o"."OrderDate", "o"."RequiredDate", "o"."ShipAddress", "o"."ShipCity", "o"."ShipCountry", "o"."ShipName", "o"."ShipPostalCode", "o"."ShipRegion", "o"."ShipVia", "o"."ShippedDate", "e0"."EmployeeID", "e0"."Address", "e0"."BirthDate", "e0"."City", "e0"."Country", "e0"."Extension", "e0"."FirstName", "e0"."HireDate", "e0"."HomePhone", "e0"."IsDeleted", "e0"."LastName", "e0"."Notes", "e0"."Photo", "e0"."PhotoPath", "e0"."PostalCode", "e0"."Region", "e0"."ReportsTo", "e0"."Title", "e0"."TitleOfCourtesy", "s"."EmployeeID", "s"."TerritoryID", "s"."IsDeleted", "s"."TerritoryID0", "s"."IsDeleted0", "s"."RegionID", "s"."TerritoryDescription", "s0"."OrderID", "s0"."ProductID", "s0"."Discount", "s0"."IsDeleted", "s0"."Quantity", "s0"."UnitPrice", "s0"."ProductID0", "s0"."CategoryID", "s0"."Discontinued", "s0"."IsDeleted0", "s0"."ProductName", "s0"."QuantityPerUnit", "s0"."ReorderLevel", "s0"."SupplierID", "s0"."UnitPrice0", "s0"."UnitsInStock", "s0"."UnitsOnOrder" +FROM "Orders" AS "o" +LEFT JOIN ( + SELECT "e"."EmployeeID", "e"."Address", "e"."BirthDate", "e"."City", "e"."Country", "e"."Extension", "e"."FirstName", "e"."HireDate", "e"."HomePhone", "e"."IsDeleted", "e"."LastName", "e"."Notes", "e"."Photo", "e"."PhotoPath", "e"."PostalCode", "e"."Region", "e"."ReportsTo", "e"."Title", "e"."TitleOfCourtesy" + FROM "Employees" AS "e" + WHERE @ef_filter__p2 OR NOT ("e"."IsDeleted") OR NOT ("e"."IsDeleted") +) AS "e0" ON "o"."EmployeeID" = "e0"."EmployeeID" +LEFT JOIN ( + SELECT "e1"."EmployeeID", "e1"."TerritoryID", "e1"."IsDeleted", "t0"."TerritoryID" AS "TerritoryID0", "t0"."IsDeleted" AS "IsDeleted0", "t0"."RegionID", "t0"."TerritoryDescription" + FROM "EmployeeTerritories" AS "e1" + INNER JOIN ( + SELECT "t"."TerritoryID", "t"."IsDeleted", "t"."RegionID", "t"."TerritoryDescription" + FROM "Territories" AS "t" + WHERE @ef_filter__p8 OR NOT ("t"."IsDeleted") OR NOT ("t"."IsDeleted") + ) AS "t0" ON "e1"."TerritoryID" = "t0"."TerritoryID" + WHERE @ef_filter__p4 OR NOT ("e1"."IsDeleted") OR NOT ("e1"."IsDeleted") +) AS "s" ON "e0"."EmployeeID" = "s"."EmployeeID" +LEFT JOIN ( + SELECT "o0"."OrderID", "o0"."ProductID", "o0"."Discount", "o0"."IsDeleted", "o0"."Quantity", "o0"."UnitPrice", "p0"."ProductID" AS "ProductID0", "p0"."CategoryID", "p0"."Discontinued", "p0"."IsDeleted" AS "IsDeleted0", "p0"."ProductName", "p0"."QuantityPerUnit", "p0"."ReorderLevel", "p0"."SupplierID", "p0"."UnitPrice" AS "UnitPrice0", "p0"."UnitsInStock", "p0"."UnitsOnOrder" + FROM "Order Details" AS "o0" + INNER JOIN ( + SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder" + FROM "Products" AS "p" + WHERE @ef_filter__p10 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") + ) AS "p0" ON "o0"."ProductID" = "p0"."ProductID" + WHERE @ef_filter__p6 OR NOT ("o0"."IsDeleted") OR NOT ("o0"."IsDeleted") +) AS "s0" ON "o"."OrderID" = "s0"."OrderID" +WHERE @ef_filter__p0 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted") +ORDER BY "o"."OrderID", "e0"."EmployeeID", "s"."EmployeeID", "s"."TerritoryID", "s"."TerritoryID0", "s0"."OrderID", "s0"."ProductID" + + +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SQLite.MS,True).sql new file mode 100644 index 000000000000..e4d0ce512ebc --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SQLite.MS,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT "o"."OrderID", "o"."CustomerID", "o"."EmployeeID", "o"."Freight", "o"."IsDeleted", "o"."OrderDate", "o"."RequiredDate", "o"."ShipAddress", "o"."ShipCity", "o"."ShipCountry", "o"."ShipName", "o"."ShipPostalCode", "o"."ShipRegion", "o"."ShipVia", "o"."ShippedDate", "e0"."EmployeeID", "e0"."Address", "e0"."BirthDate", "e0"."City", "e0"."Country", "e0"."Extension", "e0"."FirstName", "e0"."HireDate", "e0"."HomePhone", "e0"."IsDeleted", "e0"."LastName", "e0"."Notes", "e0"."Photo", "e0"."PhotoPath", "e0"."PostalCode", "e0"."Region", "e0"."ReportsTo", "e0"."Title", "e0"."TitleOfCourtesy", "s"."EmployeeID", "s"."TerritoryID", "s"."IsDeleted", "s"."TerritoryID0", "s"."IsDeleted0", "s"."RegionID", "s"."TerritoryDescription", "s0"."OrderID", "s0"."ProductID", "s0"."Discount", "s0"."IsDeleted", "s0"."Quantity", "s0"."UnitPrice", "s0"."ProductID0", "s0"."CategoryID", "s0"."Discontinued", "s0"."IsDeleted0", "s0"."ProductName", "s0"."QuantityPerUnit", "s0"."ReorderLevel", "s0"."SupplierID", "s0"."UnitPrice0", "s0"."UnitsInStock", "s0"."UnitsOnOrder" +FROM "Orders" AS "o" +LEFT JOIN ( + SELECT "e"."EmployeeID", "e"."Address", "e"."BirthDate", "e"."City", "e"."Country", "e"."Extension", "e"."FirstName", "e"."HireDate", "e"."HomePhone", "e"."IsDeleted", "e"."LastName", "e"."Notes", "e"."Photo", "e"."PhotoPath", "e"."PostalCode", "e"."Region", "e"."ReportsTo", "e"."Title", "e"."TitleOfCourtesy" + FROM "Employees" AS "e" + WHERE @ef_filter__p2 OR NOT ("e"."IsDeleted") OR NOT ("e"."IsDeleted") +) AS "e0" ON "o"."EmployeeID" = "e0"."EmployeeID" +LEFT JOIN ( + SELECT "e1"."EmployeeID", "e1"."TerritoryID", "e1"."IsDeleted", "t0"."TerritoryID" AS "TerritoryID0", "t0"."IsDeleted" AS "IsDeleted0", "t0"."RegionID", "t0"."TerritoryDescription" + FROM "EmployeeTerritories" AS "e1" + INNER JOIN ( + SELECT "t"."TerritoryID", "t"."IsDeleted", "t"."RegionID", "t"."TerritoryDescription" + FROM "Territories" AS "t" + WHERE @ef_filter__p8 OR NOT ("t"."IsDeleted") OR NOT ("t"."IsDeleted") + ) AS "t0" ON "e1"."TerritoryID" = "t0"."TerritoryID" + WHERE @ef_filter__p4 OR NOT ("e1"."IsDeleted") OR NOT ("e1"."IsDeleted") +) AS "s" ON "e0"."EmployeeID" = "s"."EmployeeID" +LEFT JOIN ( + SELECT "o0"."OrderID", "o0"."ProductID", "o0"."Discount", "o0"."IsDeleted", "o0"."Quantity", "o0"."UnitPrice", "p0"."ProductID" AS "ProductID0", "p0"."CategoryID", "p0"."Discontinued", "p0"."IsDeleted" AS "IsDeleted0", "p0"."ProductName", "p0"."QuantityPerUnit", "p0"."ReorderLevel", "p0"."SupplierID", "p0"."UnitPrice" AS "UnitPrice0", "p0"."UnitsInStock", "p0"."UnitsOnOrder" + FROM "Order Details" AS "o0" + INNER JOIN ( + SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder" + FROM "Products" AS "p" + WHERE @ef_filter__p10 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") + ) AS "p0" ON "o0"."ProductID" = "p0"."ProductID" + WHERE @ef_filter__p6 OR NOT ("o0"."IsDeleted") OR NOT ("o0"."IsDeleted") +) AS "s0" ON "o"."OrderID" = "s0"."OrderID" +WHERE @ef_filter__p0 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted") +ORDER BY "o"."OrderID", "e0"."EmployeeID", "s"."EmployeeID", "s"."TerritoryID", "s"."TerritoryID0", "s0"."OrderID", "s0"."ProductID" + + +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND NOT [a_Employee].[IsDeleted] + WHERE + NOT [e].[IsDeleted] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] +WHERE + NOT [a_Territory].[IsDeleted] AND NOT [d].[IsDeleted] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + NOT [e].[IsDeleted] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + NOT [a_Product].[IsDeleted] AND NOT [d].[IsDeleted] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND NOT [a_Employee].[IsDeleted] +WHERE + NOT [e].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SQLite.MS,False).sql new file mode 100644 index 000000000000..90293ee656e1 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SQLite.MS,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT "o"."OrderID", "o"."CustomerID", "o"."EmployeeID", "o"."Freight", "o"."IsDeleted", "o"."OrderDate", "o"."RequiredDate", "o"."ShipAddress", "o"."ShipCity", "o"."ShipCountry", "o"."ShipName", "o"."ShipPostalCode", "o"."ShipRegion", "o"."ShipVia", "o"."ShippedDate", "e0"."EmployeeID", "e0"."Address", "e0"."BirthDate", "e0"."City", "e0"."Country", "e0"."Extension", "e0"."FirstName", "e0"."HireDate", "e0"."HomePhone", "e0"."IsDeleted", "e0"."LastName", "e0"."Notes", "e0"."Photo", "e0"."PhotoPath", "e0"."PostalCode", "e0"."Region", "e0"."ReportsTo", "e0"."Title", "e0"."TitleOfCourtesy", "e2"."EmployeeID", "e2"."TerritoryID", "e2"."IsDeleted", "s"."OrderID", "s"."ProductID", "s"."Discount", "s"."IsDeleted", "s"."Quantity", "s"."UnitPrice", "s"."ProductID0", "s"."CategoryID", "s"."Discontinued", "s"."IsDeleted0", "s"."ProductName", "s"."QuantityPerUnit", "s"."ReorderLevel", "s"."SupplierID", "s"."UnitPrice0", "s"."UnitsInStock", "s"."UnitsOnOrder" +FROM "Orders" AS "o" +LEFT JOIN ( + SELECT "e"."EmployeeID", "e"."Address", "e"."BirthDate", "e"."City", "e"."Country", "e"."Extension", "e"."FirstName", "e"."HireDate", "e"."HomePhone", "e"."IsDeleted", "e"."LastName", "e"."Notes", "e"."Photo", "e"."PhotoPath", "e"."PostalCode", "e"."Region", "e"."ReportsTo", "e"."Title", "e"."TitleOfCourtesy" + FROM "Employees" AS "e" + WHERE @ef_filter__p2 OR NOT ("e"."IsDeleted") OR NOT ("e"."IsDeleted") +) AS "e0" ON "o"."EmployeeID" = "e0"."EmployeeID" +LEFT JOIN ( + SELECT "e1"."EmployeeID", "e1"."TerritoryID", "e1"."IsDeleted" + FROM "EmployeeTerritories" AS "e1" + WHERE @ef_filter__p4 OR NOT ("e1"."IsDeleted") OR NOT ("e1"."IsDeleted") +) AS "e2" ON "e0"."EmployeeID" = "e2"."EmployeeID" +LEFT JOIN ( + SELECT "o0"."OrderID", "o0"."ProductID", "o0"."Discount", "o0"."IsDeleted", "o0"."Quantity", "o0"."UnitPrice", "p0"."ProductID" AS "ProductID0", "p0"."CategoryID", "p0"."Discontinued", "p0"."IsDeleted" AS "IsDeleted0", "p0"."ProductName", "p0"."QuantityPerUnit", "p0"."ReorderLevel", "p0"."SupplierID", "p0"."UnitPrice" AS "UnitPrice0", "p0"."UnitsInStock", "p0"."UnitsOnOrder" + FROM "Order Details" AS "o0" + INNER JOIN ( + SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder" + FROM "Products" AS "p" + WHERE @ef_filter__p8 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") + ) AS "p0" ON "o0"."ProductID" = "p0"."ProductID" + WHERE @ef_filter__p6 OR NOT ("o0"."IsDeleted") OR NOT ("o0"."IsDeleted") +) AS "s" ON "o"."OrderID" = "s"."OrderID" +WHERE @ef_filter__p0 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted") +ORDER BY "o"."OrderID", "e0"."EmployeeID", "e2"."EmployeeID", "e2"."TerritoryID", "s"."OrderID", "s"."ProductID" + + +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SQLite.MS,True).sql new file mode 100644 index 000000000000..1f3f31176e8e --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SQLite.MS,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT "o"."OrderID", "o"."CustomerID", "o"."EmployeeID", "o"."Freight", "o"."IsDeleted", "o"."OrderDate", "o"."RequiredDate", "o"."ShipAddress", "o"."ShipCity", "o"."ShipCountry", "o"."ShipName", "o"."ShipPostalCode", "o"."ShipRegion", "o"."ShipVia", "o"."ShippedDate", "e0"."EmployeeID", "e0"."Address", "e0"."BirthDate", "e0"."City", "e0"."Country", "e0"."Extension", "e0"."FirstName", "e0"."HireDate", "e0"."HomePhone", "e0"."IsDeleted", "e0"."LastName", "e0"."Notes", "e0"."Photo", "e0"."PhotoPath", "e0"."PostalCode", "e0"."Region", "e0"."ReportsTo", "e0"."Title", "e0"."TitleOfCourtesy", "e2"."EmployeeID", "e2"."TerritoryID", "e2"."IsDeleted", "s"."OrderID", "s"."ProductID", "s"."Discount", "s"."IsDeleted", "s"."Quantity", "s"."UnitPrice", "s"."ProductID0", "s"."CategoryID", "s"."Discontinued", "s"."IsDeleted0", "s"."ProductName", "s"."QuantityPerUnit", "s"."ReorderLevel", "s"."SupplierID", "s"."UnitPrice0", "s"."UnitsInStock", "s"."UnitsOnOrder" +FROM "Orders" AS "o" +LEFT JOIN ( + SELECT "e"."EmployeeID", "e"."Address", "e"."BirthDate", "e"."City", "e"."Country", "e"."Extension", "e"."FirstName", "e"."HireDate", "e"."HomePhone", "e"."IsDeleted", "e"."LastName", "e"."Notes", "e"."Photo", "e"."PhotoPath", "e"."PostalCode", "e"."Region", "e"."ReportsTo", "e"."Title", "e"."TitleOfCourtesy" + FROM "Employees" AS "e" + WHERE @ef_filter__p2 OR NOT ("e"."IsDeleted") OR NOT ("e"."IsDeleted") +) AS "e0" ON "o"."EmployeeID" = "e0"."EmployeeID" +LEFT JOIN ( + SELECT "e1"."EmployeeID", "e1"."TerritoryID", "e1"."IsDeleted" + FROM "EmployeeTerritories" AS "e1" + WHERE @ef_filter__p4 OR NOT ("e1"."IsDeleted") OR NOT ("e1"."IsDeleted") +) AS "e2" ON "e0"."EmployeeID" = "e2"."EmployeeID" +LEFT JOIN ( + SELECT "o0"."OrderID", "o0"."ProductID", "o0"."Discount", "o0"."IsDeleted", "o0"."Quantity", "o0"."UnitPrice", "p0"."ProductID" AS "ProductID0", "p0"."CategoryID", "p0"."Discontinued", "p0"."IsDeleted" AS "IsDeleted0", "p0"."ProductName", "p0"."QuantityPerUnit", "p0"."ReorderLevel", "p0"."SupplierID", "p0"."UnitPrice" AS "UnitPrice0", "p0"."UnitsInStock", "p0"."UnitsOnOrder" + FROM "Order Details" AS "o0" + INNER JOIN ( + SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder" + FROM "Products" AS "p" + WHERE @ef_filter__p8 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") + ) AS "p0" ON "o0"."ProductID" = "p0"."ProductID" + WHERE @ef_filter__p6 OR NOT ("o0"."IsDeleted") OR NOT ("o0"."IsDeleted") +) AS "s" ON "o"."OrderID" = "s"."OrderID" +WHERE @ef_filter__p0 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted") +ORDER BY "o"."OrderID", "e0"."EmployeeID", "e2"."EmployeeID", "e2"."TerritoryID", "s"."OrderID", "s"."ProductID" + + +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND NOT [a_Employee].[IsDeleted] + WHERE + NOT [e].[IsDeleted] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] +WHERE + NOT [d].[IsDeleted] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + NOT [e].[IsDeleted] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + NOT [a_Product].[IsDeleted] AND NOT [d].[IsDeleted] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND NOT [a_Employee].[IsDeleted] +WHERE + NOT [e].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SQLite.MS,False).sql new file mode 100644 index 000000000000..36712b8a0f17 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SQLite.MS,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT "p"."ProductName", "p"."ProductID", "s1"."Discount", "s1"."OrderID", "s1"."CustomerID", "s1"."EmployeeID", "s1"."Freight", "s1"."IsDeleted", "s1"."OrderDate", "s1"."RequiredDate", "s1"."ShipAddress", "s1"."ShipCity", "s1"."ShipCountry", "s1"."ShipName", "s1"."ShipPostalCode", "s1"."ShipRegion", "s1"."ShipVia", "s1"."ShippedDate", "s1"."OrderID0", "s1"."ProductID", "s1"."ProductID0", "s1"."SupplierID", "s1"."ProductID1", "s1"."CategoryID", "s1"."Discontinued", "s1"."IsDeleted0", "s1"."ProductName", "s1"."QuantityPerUnit", "s1"."ReorderLevel", "s1"."SupplierID0", "s1"."UnitPrice", "s1"."UnitsInStock", "s1"."UnitsOnOrder" +FROM "Products" AS "p" +LEFT JOIN ( + SELECT "o"."Discount", "o1"."OrderID", "o1"."CustomerID", "o1"."EmployeeID", "o1"."Freight", "o1"."IsDeleted", "o1"."OrderDate", "o1"."RequiredDate", "o1"."ShipAddress", "o1"."ShipCity", "o1"."ShipCountry", "o1"."ShipName", "o1"."ShipPostalCode", "o1"."ShipRegion", "o1"."ShipVia", "o1"."ShippedDate", "o"."OrderID" AS "OrderID0", "o"."ProductID", "p1"."ProductID" AS "ProductID0", "s0"."SupplierID", "p3"."ProductID" AS "ProductID1", "p3"."CategoryID", "p3"."Discontinued", "p3"."IsDeleted" AS "IsDeleted0", "p3"."ProductName", "p3"."QuantityPerUnit", "p3"."ReorderLevel", "p3"."SupplierID" AS "SupplierID0", "p3"."UnitPrice", "p3"."UnitsInStock", "p3"."UnitsOnOrder" + FROM "Order Details" AS "o" + INNER JOIN ( + SELECT "o0"."OrderID", "o0"."CustomerID", "o0"."EmployeeID", "o0"."Freight", "o0"."IsDeleted", "o0"."OrderDate", "o0"."RequiredDate", "o0"."ShipAddress", "o0"."ShipCity", "o0"."ShipCountry", "o0"."ShipName", "o0"."ShipPostalCode", "o0"."ShipRegion", "o0"."ShipVia", "o0"."ShippedDate" + FROM "Orders" AS "o0" + WHERE @ef_filter__p4 OR NOT ("o0"."IsDeleted") OR NOT ("o0"."IsDeleted") + ) AS "o1" ON "o"."OrderID" = "o1"."OrderID" + INNER JOIN ( + SELECT "p0"."ProductID", "p0"."SupplierID" + FROM "Products" AS "p0" + WHERE @ef_filter__p0 OR NOT ("p0"."IsDeleted") OR NOT ("p0"."IsDeleted") + ) AS "p1" ON "o"."ProductID" = "p1"."ProductID" + LEFT JOIN ( + SELECT "s"."SupplierID" + FROM "Suppliers" AS "s" + WHERE @ef_filter__p6 OR NOT ("s"."IsDeleted") OR NOT ("s"."IsDeleted") + ) AS "s0" ON "p1"."SupplierID" = "s0"."SupplierID" + LEFT JOIN ( + SELECT "p2"."ProductID", "p2"."CategoryID", "p2"."Discontinued", "p2"."IsDeleted", "p2"."ProductName", "p2"."QuantityPerUnit", "p2"."ReorderLevel", "p2"."SupplierID", "p2"."UnitPrice", "p2"."UnitsInStock", "p2"."UnitsOnOrder" + FROM "Products" AS "p2" + WHERE @ef_filter__p0 OR NOT ("p2"."IsDeleted") OR NOT ("p2"."IsDeleted") + ) AS "p3" ON "s0"."SupplierID" = "p3"."SupplierID" + WHERE @ef_filter__p2 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted") +) AS "s1" ON "p"."ProductID" = "s1"."ProductID" +WHERE @ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") +ORDER BY "p"."ProductID", "s1"."OrderID0", "s1"."ProductID", "s1"."OrderID", "s1"."ProductID0", "s1"."SupplierID" + + +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + NOT [e].[IsDeleted] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND NOT [a_Supplier].[IsDeleted] + WHERE + NOT [e_1].[IsDeleted] AND NOT [a_Product].[IsDeleted] AND + NOT [d].[IsDeleted] + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + NOT [d_1].[IsDeleted] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND NOT [a_Supplier].[IsDeleted] +WHERE + NOT [m_1].[IsDeleted] AND NOT [e].[IsDeleted] AND NOT [d].[IsDeleted] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + NOT [p].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SQLite.MS,True).sql new file mode 100644 index 000000000000..36712b8a0f17 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SQLite.MS,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT "p"."ProductName", "p"."ProductID", "s1"."Discount", "s1"."OrderID", "s1"."CustomerID", "s1"."EmployeeID", "s1"."Freight", "s1"."IsDeleted", "s1"."OrderDate", "s1"."RequiredDate", "s1"."ShipAddress", "s1"."ShipCity", "s1"."ShipCountry", "s1"."ShipName", "s1"."ShipPostalCode", "s1"."ShipRegion", "s1"."ShipVia", "s1"."ShippedDate", "s1"."OrderID0", "s1"."ProductID", "s1"."ProductID0", "s1"."SupplierID", "s1"."ProductID1", "s1"."CategoryID", "s1"."Discontinued", "s1"."IsDeleted0", "s1"."ProductName", "s1"."QuantityPerUnit", "s1"."ReorderLevel", "s1"."SupplierID0", "s1"."UnitPrice", "s1"."UnitsInStock", "s1"."UnitsOnOrder" +FROM "Products" AS "p" +LEFT JOIN ( + SELECT "o"."Discount", "o1"."OrderID", "o1"."CustomerID", "o1"."EmployeeID", "o1"."Freight", "o1"."IsDeleted", "o1"."OrderDate", "o1"."RequiredDate", "o1"."ShipAddress", "o1"."ShipCity", "o1"."ShipCountry", "o1"."ShipName", "o1"."ShipPostalCode", "o1"."ShipRegion", "o1"."ShipVia", "o1"."ShippedDate", "o"."OrderID" AS "OrderID0", "o"."ProductID", "p1"."ProductID" AS "ProductID0", "s0"."SupplierID", "p3"."ProductID" AS "ProductID1", "p3"."CategoryID", "p3"."Discontinued", "p3"."IsDeleted" AS "IsDeleted0", "p3"."ProductName", "p3"."QuantityPerUnit", "p3"."ReorderLevel", "p3"."SupplierID" AS "SupplierID0", "p3"."UnitPrice", "p3"."UnitsInStock", "p3"."UnitsOnOrder" + FROM "Order Details" AS "o" + INNER JOIN ( + SELECT "o0"."OrderID", "o0"."CustomerID", "o0"."EmployeeID", "o0"."Freight", "o0"."IsDeleted", "o0"."OrderDate", "o0"."RequiredDate", "o0"."ShipAddress", "o0"."ShipCity", "o0"."ShipCountry", "o0"."ShipName", "o0"."ShipPostalCode", "o0"."ShipRegion", "o0"."ShipVia", "o0"."ShippedDate" + FROM "Orders" AS "o0" + WHERE @ef_filter__p4 OR NOT ("o0"."IsDeleted") OR NOT ("o0"."IsDeleted") + ) AS "o1" ON "o"."OrderID" = "o1"."OrderID" + INNER JOIN ( + SELECT "p0"."ProductID", "p0"."SupplierID" + FROM "Products" AS "p0" + WHERE @ef_filter__p0 OR NOT ("p0"."IsDeleted") OR NOT ("p0"."IsDeleted") + ) AS "p1" ON "o"."ProductID" = "p1"."ProductID" + LEFT JOIN ( + SELECT "s"."SupplierID" + FROM "Suppliers" AS "s" + WHERE @ef_filter__p6 OR NOT ("s"."IsDeleted") OR NOT ("s"."IsDeleted") + ) AS "s0" ON "p1"."SupplierID" = "s0"."SupplierID" + LEFT JOIN ( + SELECT "p2"."ProductID", "p2"."CategoryID", "p2"."Discontinued", "p2"."IsDeleted", "p2"."ProductName", "p2"."QuantityPerUnit", "p2"."ReorderLevel", "p2"."SupplierID", "p2"."UnitPrice", "p2"."UnitsInStock", "p2"."UnitsOnOrder" + FROM "Products" AS "p2" + WHERE @ef_filter__p0 OR NOT ("p2"."IsDeleted") OR NOT ("p2"."IsDeleted") + ) AS "p3" ON "s0"."SupplierID" = "p3"."SupplierID" + WHERE @ef_filter__p2 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted") +) AS "s1" ON "p"."ProductID" = "s1"."ProductID" +WHERE @ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") +ORDER BY "p"."ProductID", "s1"."OrderID0", "s1"."ProductID", "s1"."OrderID", "s1"."ProductID0", "s1"."SupplierID" + + +BeginTransactionAsync(Serializable) + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + NOT [e].[IsDeleted] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND NOT [a_Supplier].[IsDeleted] + WHERE + NOT [e_1].[IsDeleted] AND NOT [a_Product].[IsDeleted] AND + NOT [d].[IsDeleted] + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + NOT [d_1].[IsDeleted] + + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND NOT [a_Supplier].[IsDeleted] +WHERE + NOT [m_1].[IsDeleted] AND NOT [e].[IsDeleted] AND NOT [d].[IsDeleted] + + + +DisposeTransactionAsync + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + NOT [p].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SQLite.MS,False).sql new file mode 100644 index 000000000000..6e3626698171 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SQLite.MS,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder", "p1"."ProductID", "p1"."CategoryID", "p1"."Discontinued", "p1"."IsDeleted", "p1"."ProductName", "p1"."QuantityPerUnit", "p1"."ReorderLevel", "p1"."SupplierID", "p1"."UnitPrice", "p1"."UnitsInStock", "p1"."UnitsOnOrder" +FROM "Products" AS "p" +CROSS JOIN ( + SELECT "p0"."ProductID", "p0"."CategoryID", "p0"."Discontinued", "p0"."IsDeleted", "p0"."ProductName", "p0"."QuantityPerUnit", "p0"."ReorderLevel", "p0"."SupplierID", "p0"."UnitPrice", "p0"."UnitsInStock", "p0"."UnitsOnOrder" + FROM "Products" AS "p0" + WHERE (@ef_filter__p0 OR NOT ("p0"."IsDeleted") OR NOT ("p0"."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS "o0" + WHERE (@ef_filter__p2 OR NOT ("o0"."IsDeleted") OR NOT ("o0"."IsDeleted")) AND "p0"."ProductID" = "o0"."ProductID") +) AS "p1" +WHERE (@ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS "o" + WHERE (@ef_filter__p2 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted")) AND "p"."ProductID" = "o"."ProductID") AND "p"."ProductID" = "p1"."ProductID" +ORDER BY "p"."ProductID" + + +-- SQLite.MS SQLite + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SQLite.MS,True).sql new file mode 100644 index 000000000000..3cde369fae47 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SQLite.MS,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT "p"."ProductID", "p"."CategoryID", "p"."Discontinued", "p"."IsDeleted", "p"."ProductName", "p"."QuantityPerUnit", "p"."ReorderLevel", "p"."SupplierID", "p"."UnitPrice", "p"."UnitsInStock", "p"."UnitsOnOrder", "p1"."ProductID", "p1"."CategoryID", "p1"."Discontinued", "p1"."IsDeleted", "p1"."ProductName", "p1"."QuantityPerUnit", "p1"."ReorderLevel", "p1"."SupplierID", "p1"."UnitPrice", "p1"."UnitsInStock", "p1"."UnitsOnOrder" +FROM "Products" AS "p" +CROSS JOIN ( + SELECT "p0"."ProductID", "p0"."CategoryID", "p0"."Discontinued", "p0"."IsDeleted", "p0"."ProductName", "p0"."QuantityPerUnit", "p0"."ReorderLevel", "p0"."SupplierID", "p0"."UnitPrice", "p0"."UnitsInStock", "p0"."UnitsOnOrder" + FROM "Products" AS "p0" + WHERE (@ef_filter__p0 OR NOT ("p0"."IsDeleted") OR NOT ("p0"."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS "o0" + WHERE (@ef_filter__p2 OR NOT ("o0"."IsDeleted") OR NOT ("o0"."IsDeleted")) AND "p0"."ProductID" = "o0"."ProductID") +) AS "p1" +WHERE (@ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted")) AND EXISTS ( + SELECT 1 + FROM "Order Details" AS "o" + WHERE (@ef_filter__p2 OR NOT ("o"."IsDeleted") OR NOT ("o"."IsDeleted")) AND "p"."ProductID" = "o"."ProductID") AND "p"."ProductID" = "p1"."ProductID" +ORDER BY "p"."ProductID" + + +-- SQLite.MS SQLite + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + NOT [e].[IsDeleted] AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + NOT [e_1].[IsDeleted] AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + NOT [pd2].[IsDeleted] AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + NOT [e_2].[IsDeleted] AND [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SQLite.MS,False).sql new file mode 100644 index 000000000000..2d988d010721 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SQLite.MS,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT "e"."EmployeeID", "e"."Address", "e"."BirthDate", "e"."City", "e"."Country", "e"."Extension", "e"."FirstName", "e"."HireDate", "e"."HomePhone", "e"."IsDeleted", "e"."LastName", "e"."Notes", "e"."Photo", "e"."PhotoPath", "e"."PostalCode", "e"."Region", "e"."ReportsTo", "e"."Title", "e"."TitleOfCourtesy" +FROM "Employees" AS "e" +WHERE (@ef_filter__p0 OR NOT ("e"."IsDeleted") OR NOT ("e"."IsDeleted")) AND "e"."EmployeeID" = @test + + +-- SQLite.MS SQLite +DECLARE @test -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[EmployeeID] = @test + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SQLite.MS,True).sql new file mode 100644 index 000000000000..a3f816902e9f --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SQLite.MS,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT "e"."EmployeeID", "e"."Address", "e"."BirthDate", "e"."City", "e"."Country", "e"."Extension", "e"."FirstName", "e"."HireDate", "e"."HomePhone", "e"."IsDeleted", "e"."LastName", "e"."Notes", "e"."Photo", "e"."PhotoPath", "e"."PostalCode", "e"."Region", "e"."ReportsTo", "e"."Title", "e"."TitleOfCourtesy" +FROM "Employees" AS "e" +WHERE (@ef_filter__p0 OR NOT ("e"."IsDeleted") OR NOT ("e"."IsDeleted")) AND "e"."EmployeeID" = @test + + +-- SQLite.MS SQLite +DECLARE @test -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + NOT [e].[IsDeleted] AND [e].[EmployeeID] = @test + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SQLite.MS,False).sql new file mode 100644 index 000000000000..aed80e4a2515 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SQLite.MS,False).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT "c"."CustomerID", "c"."Address", "c"."City", "c"."CompanyName", "c"."ContactName", "c"."ContactTitle", "c"."Country", "c"."Fax", "c"."IsDeleted", "c"."Phone", "c"."PostalCode", "c"."Region" +FROM "Customers" AS "c" +WHERE @ef_filter__p0 OR NOT ("c"."IsDeleted") OR NOT ("c"."IsDeleted") +LIMIT 1 + + +-- SQLite.MS SQLite (asynchronously) +DECLARE @CompanyName NVarChar(19) -- String +SET @CompanyName = 'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = 'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[CustomerID] = @CustomerId + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SQLite.MS,True).sql new file mode 100644 index 000000000000..c50d7d996db6 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SQLite.MS,True).sql @@ -0,0 +1,24 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT "c"."CustomerID", "c"."Address", "c"."City", "c"."CompanyName", "c"."ContactName", "c"."ContactTitle", "c"."Country", "c"."Fax", "c"."IsDeleted", "c"."Phone", "c"."PostalCode", "c"."Region" +FROM "Customers" AS "c" +WHERE @ef_filter__p0 OR NOT ("c"."IsDeleted") OR NOT ("c"."IsDeleted") +LIMIT 1 + + +-- SQLite.MS SQLite (asynchronously) +DECLARE @CompanyName NVarChar(19) -- String +SET @CompanyName = 'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = 'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + NOT [Customers].[IsDeleted] AND [Customers].[CustomerID] = @CustomerId + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SQLite.MS,False).sql new file mode 100644 index 000000000000..d66aad7e8b9b --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SQLite.MS,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT "p"."QuantityPerUnit" AS "Quantity" +FROM "Products" AS "p" +WHERE @ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") + + +-- SQLite.MS SQLite + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SQLite.MS,True).sql new file mode 100644 index 000000000000..31d3d40abf44 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SQLite.MS,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT "p"."QuantityPerUnit" AS "Quantity" +FROM "Products" AS "p" +WHERE @ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted") + + +-- SQLite.MS SQLite + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] +WHERE + NOT [p].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SQLite.MS,False).sql new file mode 100644 index 000000000000..d5e5685ac74e --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SQLite.MS,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT "e"."EmployeeID", "e"."Address", "e"."BirthDate", "e"."City", "e"."Country", "e"."Extension", "e"."FirstName", "e"."HireDate", "e"."HomePhone", "e"."IsDeleted", "e"."LastName", "e"."Notes", "e"."Photo", "e"."PhotoPath", "e"."PostalCode", "e"."Region", "e"."ReportsTo", "e"."Title", "e"."TitleOfCourtesy", "e1"."EmployeeID", "e1"."Address", "e1"."BirthDate", "e1"."City", "e1"."Country", "e1"."Extension", "e1"."FirstName", "e1"."HireDate", "e1"."HomePhone", "e1"."IsDeleted", "e1"."LastName", "e1"."Notes", "e1"."Photo", "e1"."PhotoPath", "e1"."PostalCode", "e1"."Region", "e1"."ReportsTo", "e1"."Title", "e1"."TitleOfCourtesy" +FROM "Employees" AS "e" +LEFT JOIN ( + SELECT "e0"."EmployeeID", "e0"."Address", "e0"."BirthDate", "e0"."City", "e0"."Country", "e0"."Extension", "e0"."FirstName", "e0"."HireDate", "e0"."HomePhone", "e0"."IsDeleted", "e0"."LastName", "e0"."Notes", "e0"."Photo", "e0"."PhotoPath", "e0"."PostalCode", "e0"."Region", "e0"."ReportsTo", "e0"."Title", "e0"."TitleOfCourtesy" + FROM "Employees" AS "e0" + WHERE @ef_filter__p0 OR NOT ("e0"."IsDeleted") OR NOT ("e0"."IsDeleted") +) AS "e1" ON "e"."ReportsTo" = "e1"."EmployeeID" +WHERE @ef_filter__p0 OR NOT ("e"."IsDeleted") OR NOT ("e"."IsDeleted") + + +-- SQLite.MS SQLite + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SQLite.MS,True).sql new file mode 100644 index 000000000000..c9e571250047 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SQLite.MS,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT "e"."EmployeeID", "e"."Address", "e"."BirthDate", "e"."City", "e"."Country", "e"."Extension", "e"."FirstName", "e"."HireDate", "e"."HomePhone", "e"."IsDeleted", "e"."LastName", "e"."Notes", "e"."Photo", "e"."PhotoPath", "e"."PostalCode", "e"."Region", "e"."ReportsTo", "e"."Title", "e"."TitleOfCourtesy", "e1"."EmployeeID", "e1"."Address", "e1"."BirthDate", "e1"."City", "e1"."Country", "e1"."Extension", "e1"."FirstName", "e1"."HireDate", "e1"."HomePhone", "e1"."IsDeleted", "e1"."LastName", "e1"."Notes", "e1"."Photo", "e1"."PhotoPath", "e1"."PostalCode", "e1"."Region", "e1"."ReportsTo", "e1"."Title", "e1"."TitleOfCourtesy" +FROM "Employees" AS "e" +LEFT JOIN ( + SELECT "e0"."EmployeeID", "e0"."Address", "e0"."BirthDate", "e0"."City", "e0"."Country", "e0"."Extension", "e0"."FirstName", "e0"."HireDate", "e0"."HomePhone", "e0"."IsDeleted", "e0"."LastName", "e0"."Notes", "e0"."Photo", "e0"."PhotoPath", "e0"."PostalCode", "e0"."Region", "e0"."ReportsTo", "e0"."Title", "e0"."TitleOfCourtesy" + FROM "Employees" AS "e0" + WHERE @ef_filter__p0 OR NOT ("e0"."IsDeleted") OR NOT ("e0"."IsDeleted") +) AS "e1" ON "e"."ReportsTo" = "e1"."EmployeeID" +WHERE @ef_filter__p0 OR NOT ("e"."IsDeleted") OR NOT ("e"."IsDeleted") + + +-- SQLite.MS SQLite + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND NOT [a_ReportsToNavigation].[IsDeleted] +WHERE + NOT [e].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SQLite.MS,False).sql new file mode 100644 index 000000000000..1c49c3e5fe8d --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SQLite.MS,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(Serializable) + + +-- SQLite.MS SQLite + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransaction + + +-- SQLite.MS SQLite + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SQLite.MS,True).sql new file mode 100644 index 000000000000..92c88e083021 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SQLite.MS,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(Serializable) + + +-- SQLite.MS SQLite + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + NOT [m_1].[IsDeleted] AND NOT [a_Product].[IsDeleted] AND + NOT [d].[IsDeleted] + + + +DisposeTransaction + + +-- SQLite.MS SQLite + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + NOT [e].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SQLite.MS,False).sql new file mode 100644 index 000000000000..a72d60cece10 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SQLite.MS,False).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX("p"."QuantityPerUnit") +FROM "Products" AS "p" +WHERE (@ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted")) AND "p"."ProductName" LIKE 'U%' + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE 'U%' ESCAPE '~' + + + +-- SQLite.MS SQLite + +DELETE FROM + [Products] +WHERE + [Products].[ProductName] = 'a' + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SQLite.MS,True).sql new file mode 100644 index 000000000000..df4d6f7593de --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SQLite.MS,True).sql @@ -0,0 +1,28 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX("p"."QuantityPerUnit") +FROM "Products" AS "p" +WHERE (@ef_filter__p0 OR NOT ("p"."IsDeleted") OR NOT ("p"."IsDeleted")) AND "p"."ProductName" LIKE 'U%' + + +-- SQLite.MS SQLite (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + NOT [e].[IsDeleted] AND [e].[ProductName] LIKE 'U%' ESCAPE '~' + + + +-- SQLite.MS SQLite + +DELETE FROM + [Products] +WHERE + NOT [Products].[IsDeleted] AND [Products].[ProductName] = 'a' + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SQLite.MS,False).sql new file mode 100644 index 000000000000..5f700222a741 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SQLite.MS,False).sql @@ -0,0 +1,25 @@ +-- SQLite.MS SQLite + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SQLite.MS,True).sql new file mode 100644 index 000000000000..bc3d061418ad --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SQLite.MS,True).sql @@ -0,0 +1,27 @@ +-- SQLite.MS SQLite + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + NOT [p].[IsDeleted] AND NOT [c_1].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SQLite.MS,False).sql new file mode 100644 index 000000000000..5f700222a741 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SQLite.MS,False).sql @@ -0,0 +1,25 @@ +-- SQLite.MS SQLite + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SQLite.MS,True).sql new file mode 100644 index 000000000000..bc3d061418ad --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SQLite.MS,True).sql @@ -0,0 +1,27 @@ +-- SQLite.MS SQLite + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + NOT [p].[IsDeleted] AND NOT [c_1].[IsDeleted] + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SQLite.MS,False).sql new file mode 100644 index 000000000000..307f845debcb --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SQLite.MS,False).sql @@ -0,0 +1,13 @@ +-- SQLite.MS SQLite +DECLARE @test -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SQLite.MS,True).sql new file mode 100644 index 000000000000..307f845debcb --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SQLite.MS,True).sql @@ -0,0 +1,13 @@ +-- SQLite.MS SQLite +DECLARE @test -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SQLite.MS,False).sql new file mode 100644 index 000000000000..ae96033d53cd --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SQLite.MS,False).sql @@ -0,0 +1,13 @@ +-- SQLite.MS SQLite (asynchronously) +DECLARE @test -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SQLite.MS,True).sql new file mode 100644 index 000000000000..ae96033d53cd --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SQLite.MS,True).sql @@ -0,0 +1,13 @@ +-- SQLite.MS SQLite (asynchronously) +DECLARE @test -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SQLite.MS,False).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SQLite.MS,False).sql new file mode 100644 index 000000000000..fa85006e1901 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SQLite.MS,False).sql @@ -0,0 +1,29 @@ +-- SQLite.MS SQLite + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE 'a%' ESCAPE '~' + + + diff --git a/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SQLite.MS,True).sql b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SQLite.MS,True).sql new file mode 100644 index 000000000000..0894ea7b3722 --- /dev/null +++ b/SQLite.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SQLite.MS,True).sql @@ -0,0 +1,29 @@ +-- SQLite.MS SQLite + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + NOT [e].[IsDeleted] AND ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + NOT [e_1].[IsDeleted] AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE 'a%' ESCAPE '~' + + + diff --git a/SQLite.MS.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS.LinqService,False).sql b/SQLite.MS.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS.LinqService,False).sql index b1a363767502..93bfa2dda41b 100644 --- a/SQLite.MS.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS.LinqService,False).sql +++ b/SQLite.MS.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS.LinqService,False).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.MS.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS.LinqService,True).sql b/SQLite.MS.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS.LinqService,True).sql index b1a363767502..93bfa2dda41b 100644 --- a/SQLite.MS.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS.LinqService,True).sql +++ b/SQLite.MS.LinqService/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS.LinqService,True).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.MS SQLite (asynchronously) @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.MS/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS,False).sql b/SQLite.MS/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS,False).sql index abe7f43c12f5..2493046b6f2f 100644 --- a/SQLite.MS/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS,False).sql +++ b/SQLite.MS/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS,False).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.MS SQLite @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SQLite.MS/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS,True).sql b/SQLite.MS/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS,True).sql index abe7f43c12f5..2493046b6f2f 100644 --- a/SQLite.MS/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS,True).sql +++ b/SQLite.MS/Tests/UserTests/Issue3148Tests/Tests.UserTests.Issue3148Tests.TestDefaultExpression_15(SQLite.MS,True).sql @@ -10,7 +10,7 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 BeforeExecute -- SQLite.MS SQLite @@ -24,5 +24,5 @@ SELECT FROM [Person] [r] WHERE - [r].[PersonID] + 1 = 0 + [r].[PersonID] = -1 diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..3c917cc5d002 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2016.MS).sql @@ -0,0 +1,164 @@ +-- SqlServer.2016 +DECLARE @Id BigInt -- Int64 +SET @Id = 1 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bc7b663d-0fde-4327-8f92-5d8cc3a11d11' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C1' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N1' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2016 +DECLARE @Id BigInt -- Int64 +SET @Id = 2 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'a948600d-de21-4f74-8ac2-9516b287076e' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C2' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N2' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2016 +DECLARE @Id BigInt -- Int64 +SET @Id = 3 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bd3973a5-4323-4dd8-9f4f-df9f93e2a627' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C3' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N3' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +SELECT [s].[Id], [s].[Code], [s].[IsDeleted], [s].[Name], [s].[PermanentId] +FROM [Subdivisions] AS [s] +WHERE CAST([s].[Id] AS bigint) = CAST(1 AS bigint) + + +-- SqlServer.2016 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + CAST([s].[Id] AS BigInt) = 1 + + + +-- SqlServer.2016 +DECLARE @id BigInt -- Int64 +SET @id = 1 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] = @id + + + +-- SqlServer.2016 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] IN (2, 3) + + + +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[PermanentId], + [t1].[Code], + [t1].[Name], + [t1].[IsDeleted] +FROM + [Subdivisions] [t1] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..a9576b412d21 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2016.MS).sql @@ -0,0 +1,10 @@ +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [Issue261Table] [t1] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..e7675024cc2d --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2016.MS).sql @@ -0,0 +1,86 @@ +-- SqlServer.2016 + +CREATE TABLE [tempdb]..[#Issue4657TempTable1] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable1](Id, Code) + + + +-- SqlServer.2016 + +CREATE TABLE [tempdb]..[#Issue4657TempTable2] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable2](Id, Code) + + + +-- SqlServer.2016 + +WITH [CTE_1] ([Id], [Code]) +AS +( + SELECT + [t1].[ID], + [t1].[CODE] + FROM + [Issue4657Table] [t1] +) +MERGE INTO [CTE_1] [Target] +USING ( + SELECT + [t2].[Id], + [t2].[Code] + FROM + [tempdb]..[#Issue4657TempTable1] [t2] +) [Source] +( + [Id], + [Code] +) +ON ([Target].[Id] = [Source].[Id]) + +WHEN NOT MATCHED THEN +INSERT +( + [Code] +) +VALUES +( + [Source].[Code] +) +OUTPUT + INSERTED.[Id], + INSERTED.[Code] +INTO [tempdb]..[#Issue4657TempTable2] +( + [Id], + [Code] +) +; + + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable2] + + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable1] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..3c073d8eed0b --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2016.MS).sql @@ -0,0 +1,5 @@ +SELECT [w].[Id], [w].[Value] +FROM [WithDuplicateProperties] AS [w] +WHERE [w].[Value] = 1 + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..7c7080777567 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2016.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2016 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..ea170d8bafe9 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2016.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2016 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#WithIdentity](Name) + + + +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#WithIdentity] [t1] + + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..1438a20ae1f3 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2016.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (Size = 21), @p1='?' (Size = 21), @p2='?' (Size = 21), @p3='?' (Size = 21), @p4='?' (Size = 21) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [WithInheritance] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Discriminator], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Discriminator]) +VALUES (i.[Discriminator]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2016 + +SELECT + [t1].[Discriminator], + [t1].[Id] +FROM + [WithInheritance] [t1] +WHERE + [t1].[Discriminator] IN (N'WithInheritanceA2', N'WithInheritanceA1', N'WithInheritanceA') + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..89f79eba0fcc --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2016.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2016 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT ASYNC BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..7c7080777567 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2016.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2016 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..09b50847adf1 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2016.MS).sql @@ -0,0 +1,81 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [SkipModes] ([Id], [InsertOnly]) +VALUES (@p0, @p1); + + +-- SqlServer.2016 +DECLARE @Id Int -- Int32 +SET @Id = 2 +DECLARE @InsertOnly Int -- Int32 +SET @InsertOnly = 2 + +INSERT INTO [SkipModes] +( + [Id], + [InsertOnly] +) +VALUES +( + @Id, + @InsertOnly +) + + + +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [SkipModes] SET [UpdateOnly] = @p0 +OUTPUT 1 +WHERE [Id] = @p1; + + +-- SqlServer.2016 +DECLARE @UpdateOnly Int -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id Int -- Int32 +SET @Id = 2 + +UPDATE + [SkipModes] +SET + [UpdateOnly] = @UpdateOnly +WHERE + [SkipModes].[Id] = @Id + + + +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..88e7f266b1b2 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2016.MS).sql @@ -0,0 +1,36 @@ +-- SqlServer.2016 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2016 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..77a4eae3a981 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2016.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int64), @p3='?' (DbType = Int64), @p4='?' (Precision = 20) (DbType = Decimal), @p5='?' (Precision = 20) (DbType = Decimal) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [UIntTable] ([Field16], [Field16N], [Field32], [Field32N], [Field64], [Field64N]) +OUTPUT INSERTED.[ID] +VALUES (@p0, @p1, @p2, @p3, @p4, @p5); + + +-- SqlServer.2016 (asynchronously) +DECLARE @field64 Decimal +SET @field64 = 5 + +SELECT TOP (1) + [e].[ID], + [e].[Field16], + [e].[Field32], + [e].[Field64], + [e].[Field16N], + [e].[Field32N], + [e].[Field64N] +FROM + [UIntTable] [e] +WHERE + [e].[Field64] = @field64 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2016.MS,Default).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2016.MS,Default).sql new file mode 100644 index 000000000000..94430eca40e6 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2016.MS,Default).sql @@ -0,0 +1,42 @@ +-- SqlServer.2016 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2016 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2016.MS,MultipleRows).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2016.MS,MultipleRows).sql new file mode 100644 index 000000000000..94430eca40e6 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2016.MS,MultipleRows).sql @@ -0,0 +1,42 @@ +-- SqlServer.2016 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2016 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2016.MS,ProviderSpecific).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2016.MS,ProviderSpecific).sql new file mode 100644 index 000000000000..94430eca40e6 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2016.MS,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- SqlServer.2016 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2016 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2016.MS,RowByRow).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2016.MS,RowByRow).sql new file mode 100644 index 000000000000..94430eca40e6 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2016.MS,RowByRow).sql @@ -0,0 +1,42 @@ +-- SqlServer.2016 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2016 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..1ebb5efc7168 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2016.MS).sql @@ -0,0 +1,9 @@ +Parameters: +@p='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(@p) [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] > 0 +ORDER BY [p].[ProductID] + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..28f06ca496d3 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2016.MS).sql @@ -0,0 +1,50 @@ +-- SqlServer.2016 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + +-- SqlServer.2016 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..1ce752c59042 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2016.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2016 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..1ce752c59042 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2016.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2016 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..b008c0aa5d3e --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2016.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2016 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..5128932e8c8a --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2016.MS).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT [p].[Id] AS [PatentId], @userId0 AS [UserId] +FROM [Patents] AS [p] +LEFT JOIN [PatentAssessment] AS [p0] ON [p].[Id] = [p0].[PatentId] +WHERE [p0].[PatentId] IS NULL OR [p0].[TechnicalReviewerId] <> @userId OR [p0].[TechnicalReviewerId] IS NULL + + +-- SqlServer.2016 +DECLARE @userId Int -- Int32 +SET @userId = 1 + +SELECT + [p].[Id] +FROM + [Patents] [p] + LEFT JOIN [PatentAssessment] [a_Assessment] ON [p].[Id] = [a_Assessment].[PatentId] +WHERE + [a_Assessment].[PatentId] IS NULL OR [a_Assessment].[TechnicalReviewerId] <> @userId OR + [a_Assessment].[TechnicalReviewerId] IS NULL + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..874560b8dec8 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2016.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2016 + +CREATE TABLE [tempdb]..[#Issue129Table] +( + [Id] int NOT NULL IDENTITY, + [Key] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#Issue129Table] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..553ba1fbb3d9 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2016.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2016 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + ( + SELECT TOP (1) + [a_Children].[IsActive] + FROM + [Children] [a_Children] + WHERE + [x].[Id] = [a_Children].[ParentId] + ) = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..f277dff41319 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2016.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2016 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + NOT EXISTS( + SELECT + * + FROM + [Children] [y] + WHERE + [x].[Id] = [y].[ParentId] AND [y].[IsActive] = 1 + ) + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..b008c0aa5d3e --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2016.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2016 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..cb06be592a2c --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2016.MS).sql @@ -0,0 +1,11 @@ +-- SqlServer.2016 + +SELECT + [x].[Id] +FROM + [Issue340Entities] [x] +WHERE + [x].[IsActive] = 1 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..97528890950a --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2016.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2016 + +SELECT + 1 +FROM + [Parents] [ua] +WHERE + [ua].[ParentId] = 55377 AND EXISTS( + SELECT + * + FROM + [Parents] [t1] + ) + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..9219a16591c7 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2016.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2016 +DECLARE @DateTimeOffset DateTimeOffset +SET @DateTimeOffset = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) +DECLARE @DateTimeOffsetN DateTimeOffset +SET @DateTimeOffsetN = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) + +UPDATE + [Types] +SET + [DateTimeOffset] = @DateTimeOffset, + [DateTimeOffsetN] = @DateTimeOffsetN +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..d5e1e6868177 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2016.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2016 +DECLARE @DateTimeOffsetWithConverter BigInt -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter BigInt -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + [Types] +SET + [DateTimeOffsetWithConverter] = @DateTimeOffsetWithConverter, + [DateTimeOffsetNWithConverter] = @DateTimeOffsetNWithConverter +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..2835ed42c33d --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2016.MS).sql @@ -0,0 +1,41 @@ +-- SqlServer.2016 +DECLARE @take Int -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + [id].[Id] +FROM + ( + SELECT TOP (@take) + [t1].[Id] + FROM + ( + SELECT + [p].[Id], + ( + SELECT + SUM([a_Tags].[Weight]) + FROM + [Issue4629Tags] [a_Tags] + WHERE + [p].[Id] = [a_Tags].[PostId] + ) as [SUM_1] + FROM + [Issue4629Posts] [p] + ) [t1] + WHERE + ( + SELECT + SUM([a_Tags_1].[Weight]) + FROM + [Issue4629Tags] [a_Tags_1] + WHERE + [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 + ) > 5 + ORDER BY + [t1].[SUM_1] + ) [id] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..8b06edb74961 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2016.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2016 +DECLARE @id Int -- Int32 +SET @id = 2 + +SELECT TOP (1) + [t1].[Index_1] +FROM + ( + SELECT + [x].[Id], + ROW_NUMBER() OVER(ORDER BY [x].[Id]) as [Index_1] + FROM + [Parents] [x] + ) [t1] +WHERE + [t1].[Id] = @id + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..300776b8bcfd --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2016.MS).sql @@ -0,0 +1,38 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2016 + +SELECT + [m_1].[Key_1], + [d].[CfAllowValue], + [d].[DateFrom] +FROM + ( + SELECT TOP (1) + [p].[AclNameId] as [Key_1] + FROM + [Issue4624Items] [p] + GROUP BY + [p].[AclNameId] + ) [m_1] + INNER JOIN [Issue4624Items] [d] ON [m_1].[Key_1] = [d].[AclNameId] +ORDER BY + [d].[DateFrom] + + + +-- SqlServer.2016 + +SELECT TOP (1) + [p].[AclNameId] +FROM + [Issue4624Items] [p] +GROUP BY + [p].[AclNameId] + + + +DisposeTransaction + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..97d7f342ea3a --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2016.MS).sql @@ -0,0 +1,48 @@ +-- SqlServer.2016 (asynchronously) +DECLARE @systemId VarChar(20) -- AnsiString +SET @systemId = N'system' + +MERGE INTO [Issue4642Table2] [Target] +USING ( + SELECT + [y].[Id], + [y].[SystemId], + [y].[Timestamp] as [Timestamp_1] + FROM + [Issue4642Table1] [x] + INNER JOIN [Issue4642Table2] [y] ON [x].[Id] = [y].[Id] + WHERE + [x].[Id] IN (1) AND [y].[SystemId] = @systemId +) [Source] +( + [Id], + [SystemId], + [Timestamp_1] +) +ON ([Target].[Id] = [Source].[Id] AND [Target].[SystemId] = [Source].[SystemId]) + +WHEN MATCHED THEN +UPDATE +SET + [Timestamp] = [Source].[Timestamp_1] + +WHEN NOT MATCHED THEN +INSERT +( + [Id], + [SystemId], + [Timestamp] +) +VALUES +( + [Source].[Id], + [Source].[SystemId], + [Source].[Timestamp_1] +) +OUTPUT + $action, + INSERTED.[Id] +; + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..9e01bf37009b --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2016.MS).sql @@ -0,0 +1,4 @@ +INSERT BULK [Issue4663]() + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..1fccb1a6a87b --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2016.MS).sql @@ -0,0 +1,21 @@ +-- SqlServer.2016 (asynchronously) + +SELECT + [x].[Id], + [x].[IsActive], + [x].[ParentId], + [x].[Name] +FROM + [Children] [x] +WHERE + [x].[Name] LIKE N'%Test%' ESCAPE N'~' +ORDER BY + [x].[Name] + + + +SELECT [c].[Id], [c].[IsActive], [c].[Name], [c].[ParentId] +FROM [Children] AS [c] +WHERE [c].[Name] LIKE N'Test%' + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..fcb047836a1f --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2016.MS).sql @@ -0,0 +1,64 @@ +-- SqlServer.2016 + +CREATE TABLE [tempdb]..[#Issue4671Entity1TMP] +( + [Id] int NOT NULL IDENTITY, + [Value] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2016 + +INSERT INTO [Issue4671Entity1] +( + [Value] +) +VALUES +( + 1 +) + + + +-- SqlServer.2016 + +INSERT INTO [tempdb]..[#Issue4671Entity1TMP] +( + [Value] +) +VALUES +( + 2 +) + + + +-- SqlServer.2016 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [Issue4671Entity1] [t1] + + + +-- SqlServer.2016 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [tempdb]..[#Issue4671Entity1TMP] [t1] + + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4671Entity1TMP] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..cc9dd2bfb1a0 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2016.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..cc9dd2bfb1a0 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2016.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..cc9dd2bfb1a0 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2016.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..cc9dd2bfb1a0 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2016.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2016 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..ffe3f3be7956 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2016.MS).sql @@ -0,0 +1,18 @@ +SELECT COALESCE([i0].[Name], N'') + N'>' + [i].[Name] +FROM [Issue73Entities] AS [i] +LEFT JOIN [Issue73Entities] AS [i0] ON [i].[ParentId] = [i0].[Id] +WHERE [i].[Name] = N'Name1_3' + + +-- SqlServer.2016 + +SELECT + [a_Parent].[Name] + N'>' + [x].[Name] +FROM + [Issue73Entities] [x] + LEFT JOIN [Issue73Entities] [a_Parent] ON [x].[ParentId] = [a_Parent].[Id] +WHERE + [x].[Name] = N'Name1_3' + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..6f95cc9d1d45 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2016.MS).sql @@ -0,0 +1,27 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [IssueEnum] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Value], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Value]) +VALUES (i.[Value]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2016 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Value] +FROM + [IssueEnum] [t1] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..dae4dd6db8b1 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2016.MS).sql @@ -0,0 +1,33 @@ +-- SqlServer.2016 + +DELETE [t1] +FROM + [EventScheduleItem] [t1] + + + +Parameters: +@p0='?' (Size = 1) (DbType = Byte), @p1='?' (DbType = Guid), @p2='?' (Size = 4000), @p3='?' (Size = 4000) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [EventScheduleItem] ([CrashEnum], [GuidColumn], [JsonColumn], [NameLocalized_JSON]) +OUTPUT INSERTED.[Id] +VALUES (@p0, @p1, @p2, @p3); + + +-- SqlServer.2016 + +SELECT TOP (1) + [p].[Id], + [p].[NameLocalized_JSON], + [p].[CrashEnum], + [p].[GuidColumn], + JSON_VALUE([p].[JsonColumn], N'some') +FROM + [EventScheduleItem] [p] +WHERE + [p].[Id] < 10 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..b1a53c185aa5 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2016.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2016 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] IS NOT NULL + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..83ea347d55ed --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2016.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2016 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE N'%anything%' ESCAPE N'~' + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..afa01b9f2ee5 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2016.MS).sql @@ -0,0 +1,24 @@ +-- SqlServer.2016 +DECLARE @value NVarChar(60) -- String +SET @value = N'%anything%' + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE @value ESCAPE N'~' + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..3b9ef35555e5 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2016.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..bd4324e21afd --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2016.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..3b9ef35555e5 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2016.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..bd4324e21afd --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2016.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..f92661498f94 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2016.MS).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId], [o3].[ProductId], [o3].[Quantity], [o1].[Quantity], [p0].[ProductName] +FROM [Orders] AS [o] +INNER JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Quantity] + FROM [Order Details] AS [o0] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [o1] ON [o].[OrderID] = [o1].[OrderID] +INNER JOIN ( + SELECT [p].[ProductID], [p].[ProductName] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +) AS [p0] ON [o1].[ProductID] = [p0].[ProductID] +LEFT JOIN ( + SELECT [o2].[OrderID] AS [OrderId], [o2].[ProductID] AS [ProductId], [o2].[Quantity] + FROM [Order Details] AS [o2] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) +) AS [o3] ON [p0].[ProductID] = [o3].[ProductId] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId] + + +BeginTransaction(RepeatableRead) + + +-- SqlServer.2016 + +SELECT + [m_1].[ProductId], + [d].[OrderID], + [d].[ProductID], + [d].[Quantity] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId] + FROM + [Orders] [e] + INNER JOIN [Order Details] [od] ON [e].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductId] = [d].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2016 + +SELECT + [a_Product].[ProductID], + [od].[OrderID], + [od].[ProductID], + [od].[Quantity], + [a_Product].[ProductName] +FROM + [Orders] [o] + INNER JOIN [Order Details] [od] ON [o].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..a40afa8d78f3 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2016.MS,False).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2016 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..534d71bc2f38 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2016.MS,True).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2016 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..c61ca2330926 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2016.MS,False).sql @@ -0,0 +1,18 @@ +-- SqlServer.2016 + +DELETE [e] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..afeed8d50c2f --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2016.MS,True).sql @@ -0,0 +1,20 @@ +-- SqlServer.2016 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..16132fee1973 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2016.MS,False).sql @@ -0,0 +1,97 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..ccb1033e241e --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2016.MS,True).sql @@ -0,0 +1,108 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..57043be44ab7 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2016.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..586b89e689f4 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2016.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..57043be44ab7 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2016.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..586b89e689f4 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2016.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..91f622554265 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2016.MS,False).sql @@ -0,0 +1,97 @@ +-- SqlServer.2016 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2016 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +-- SqlServer.2016 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] + + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..21cff92553c1 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2016.MS,True).sql @@ -0,0 +1,101 @@ +-- SqlServer.2016 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2016 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2016 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..30186afec7e3 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2016.MS).sql @@ -0,0 +1,30 @@ +CREATE OR ALTER FUNCTION dbo.[ProcessLong] + ( + @secondsNumber int + ) + RETURNS int + AS + BEGIN + declare @startTime datetime = getutcdate() + while datediff(second, @startTime, getutcdate()) < @secondsNumber + begin + set @startTime = @startTime + end + return 1 + END + + +-- SqlServer.2016 +DECLARE @commandExecutionTime Int -- Int32 +SET @commandExecutionTime = 5 + +SELECT TOP (1) + dbo.ProcessLong(@commandExecutionTime) +FROM + [Products] [e] + + + +DROP FUNCTION IF EXISTS [dbo].[ProcessLong] + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..6e16fc4dc65d --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2016.MS,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..b5ccc699c367 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2016.MS,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..25ac89f1695e --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2016.MS,False).sql @@ -0,0 +1,101 @@ +-- SqlServer.2016 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2016 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] + + + +-- SqlServer.2016 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..6d3e9807a9c3 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2016.MS,True).sql @@ -0,0 +1,105 @@ +-- SqlServer.2016 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2016 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2016 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..9ea6964e2b04 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2016.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2016 (asynchronously) +DECLARE @take Int -- Int32 +SET @take = 20 + +DELETE [x] +FROM + ( + SELECT TOP (@take) + [e].[CustomerID] as [CustomerId] + FROM + [Customers] [e] + WHERE + [e].[IsDeleted] = 1 + ) [x] +WHERE + 1 = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..259b708d2c24 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2016.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2016 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] +WHERE + [op].[ProductID] IS NULL + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..b75a369f77ff --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2016.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2016 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] AND [op].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 AND [op].[ProductID] IS NULL + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..403f520110bf --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2016.MS,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..125c8ce48306 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2016.MS,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [o].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..e246c52fdba0 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2016.MS,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..1a89540ac93b --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2016.MS,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2016.MS).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..9cb782f80a82 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2016.MS).sql @@ -0,0 +1,23 @@ +-- SqlServer.2016 + +SELECT + [p].[OrderID], + DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate])), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate]))) +FROM + [Orders] [p] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..1a9c8206a238 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2016.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[City] IS NOT NULL + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..7c3e6ed55e4e --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2016.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[City] IS NOT NULL + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..d5efe7234e19 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2016.MS,False).sql @@ -0,0 +1,70 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2016 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..8e067f0b824f --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2016.MS,True).sql @@ -0,0 +1,74 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2016 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [d].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [p].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..680b2fd20dd1 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2016.MS,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..af859902b30a --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2016.MS,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] +WHERE + [a_Territory].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..f63f175e6560 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2016.MS,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..552ed0c5cb7f --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2016.MS,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] +WHERE + [d].[IsDeleted] = 0 + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..26270846836f --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2016.MS,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..26270846836f --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2016.MS,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2016 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2016 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..4db16266709c --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2016.MS,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2016 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..c191e4f479ea --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2016.MS,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2016 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [pd2].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [e_2].[IsDeleted] = 0 AND [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..2d0414299a31 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2016.MS,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2016 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[EmployeeID] = @test + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..22ed0c266cc9 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2016.MS,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2016 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[EmployeeID] = @test + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..522ffe375b27 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2016.MS,False).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..941539df10ce --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2016.MS,True).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[IsDeleted] = 0 AND [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..ec499a2a37b6 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2016.MS,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..7601ff6d12e8 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2016.MS,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..921336e4b76b --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2016.MS,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..9169b8d76053 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2016.MS,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2016 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..11856a55c99a --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2016.MS,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2016 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2016 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..594fe654f0f0 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2016.MS,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2016 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransaction + + +-- SqlServer.2016 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..7e36fa2eb1bd --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2016.MS,False).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2016 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2016 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..fcbe8aa1dc51 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2016.MS,True).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2016 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2016 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..b10be63eafdf --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2016.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2016 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..907314dfa9e0 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2016.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2016 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..b10be63eafdf --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2016.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2016 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..907314dfa9e0 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2016.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2016 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..c6ed707334da --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2016.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2016 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..c6ed707334da --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2016.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2016 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..f99c8013371b --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2016.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2016 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..f99c8013371b --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2016.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2016 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2016.MS,False).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2016.MS,False).sql new file mode 100644 index 000000000000..fe9db35fe1a4 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2016.MS,False).sql @@ -0,0 +1,29 @@ +-- SqlServer.2016 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2016.MS,True).sql b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2016.MS,True).sql new file mode 100644 index 000000000000..26d9068811a5 --- /dev/null +++ b/SqlServer.2016.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2016.MS,True).sql @@ -0,0 +1,29 @@ +-- SqlServer.2016 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..5be93bab8e12 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2017.MS).sql @@ -0,0 +1,164 @@ +-- SqlServer.2017 +DECLARE @Id BigInt -- Int64 +SET @Id = 1 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bc7b663d-0fde-4327-8f92-5d8cc3a11d11' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C1' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N1' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2017 +DECLARE @Id BigInt -- Int64 +SET @Id = 2 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'a948600d-de21-4f74-8ac2-9516b287076e' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C2' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N2' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2017 +DECLARE @Id BigInt -- Int64 +SET @Id = 3 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bd3973a5-4323-4dd8-9f4f-df9f93e2a627' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C3' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N3' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +SELECT [s].[Id], [s].[Code], [s].[IsDeleted], [s].[Name], [s].[PermanentId] +FROM [Subdivisions] AS [s] +WHERE CAST([s].[Id] AS bigint) = CAST(1 AS bigint) + + +-- SqlServer.2017 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + CAST([s].[Id] AS BigInt) = 1 + + + +-- SqlServer.2017 +DECLARE @id BigInt -- Int64 +SET @id = 1 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] = @id + + + +-- SqlServer.2017 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] IN (2, 3) + + + +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[PermanentId], + [t1].[Code], + [t1].[Name], + [t1].[IsDeleted] +FROM + [Subdivisions] [t1] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..5d09b9d19e1b --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2017.MS).sql @@ -0,0 +1,10 @@ +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [Issue261Table] [t1] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..7352859cd3b1 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2017.MS).sql @@ -0,0 +1,86 @@ +-- SqlServer.2017 + +CREATE TABLE [tempdb]..[#Issue4657TempTable1] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable1](Id, Code) + + + +-- SqlServer.2017 + +CREATE TABLE [tempdb]..[#Issue4657TempTable2] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable2](Id, Code) + + + +-- SqlServer.2017 + +WITH [CTE_1] ([Id], [Code]) +AS +( + SELECT + [t1].[ID], + [t1].[CODE] + FROM + [Issue4657Table] [t1] +) +MERGE INTO [CTE_1] [Target] +USING ( + SELECT + [t2].[Id], + [t2].[Code] + FROM + [tempdb]..[#Issue4657TempTable1] [t2] +) [Source] +( + [Id], + [Code] +) +ON ([Target].[Id] = [Source].[Id]) + +WHEN NOT MATCHED THEN +INSERT +( + [Code] +) +VALUES +( + [Source].[Code] +) +OUTPUT + INSERTED.[Id], + INSERTED.[Code] +INTO [tempdb]..[#Issue4657TempTable2] +( + [Id], + [Code] +) +; + + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable2] + + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable1] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..3c073d8eed0b --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2017.MS).sql @@ -0,0 +1,5 @@ +SELECT [w].[Id], [w].[Value] +FROM [WithDuplicateProperties] AS [w] +WHERE [w].[Value] = 1 + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..a65f436ef9a1 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2017.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2017 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..693e637f101a --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2017.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2017 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#WithIdentity](Name) + + + +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#WithIdentity] [t1] + + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..76431a5a4e53 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2017.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (Size = 21), @p1='?' (Size = 21), @p2='?' (Size = 21), @p3='?' (Size = 21), @p4='?' (Size = 21) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [WithInheritance] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Discriminator], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Discriminator]) +VALUES (i.[Discriminator]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2017 + +SELECT + [t1].[Discriminator], + [t1].[Id] +FROM + [WithInheritance] [t1] +WHERE + [t1].[Discriminator] IN (N'WithInheritanceA2', N'WithInheritanceA1', N'WithInheritanceA') + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..3f4a10f0d59d --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2017.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2017 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT ASYNC BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..a65f436ef9a1 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2017.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2017 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..f0803845a39a --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2017.MS).sql @@ -0,0 +1,81 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [SkipModes] ([Id], [InsertOnly]) +VALUES (@p0, @p1); + + +-- SqlServer.2017 +DECLARE @Id Int -- Int32 +SET @Id = 2 +DECLARE @InsertOnly Int -- Int32 +SET @InsertOnly = 2 + +INSERT INTO [SkipModes] +( + [Id], + [InsertOnly] +) +VALUES +( + @Id, + @InsertOnly +) + + + +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [SkipModes] SET [UpdateOnly] = @p0 +OUTPUT 1 +WHERE [Id] = @p1; + + +-- SqlServer.2017 +DECLARE @UpdateOnly Int -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id Int -- Int32 +SET @Id = 2 + +UPDATE + [SkipModes] +SET + [UpdateOnly] = @UpdateOnly +WHERE + [SkipModes].[Id] = @Id + + + +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..64a87a2d75e4 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2017.MS).sql @@ -0,0 +1,36 @@ +-- SqlServer.2017 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2017 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..fcfe2c2223e2 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2017.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int64), @p3='?' (DbType = Int64), @p4='?' (Precision = 20) (DbType = Decimal), @p5='?' (Precision = 20) (DbType = Decimal) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [UIntTable] ([Field16], [Field16N], [Field32], [Field32N], [Field64], [Field64N]) +OUTPUT INSERTED.[ID] +VALUES (@p0, @p1, @p2, @p3, @p4, @p5); + + +-- SqlServer.2017 (asynchronously) +DECLARE @field64 Decimal +SET @field64 = 5 + +SELECT TOP (1) + [e].[ID], + [e].[Field16], + [e].[Field32], + [e].[Field64], + [e].[Field16N], + [e].[Field32N], + [e].[Field64N] +FROM + [UIntTable] [e] +WHERE + [e].[Field64] = @field64 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2017.MS,Default).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2017.MS,Default).sql new file mode 100644 index 000000000000..1eb8a1f6c1cb --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2017.MS,Default).sql @@ -0,0 +1,42 @@ +-- SqlServer.2017 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2017 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2017.MS,MultipleRows).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2017.MS,MultipleRows).sql new file mode 100644 index 000000000000..1eb8a1f6c1cb --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2017.MS,MultipleRows).sql @@ -0,0 +1,42 @@ +-- SqlServer.2017 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2017 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2017.MS,ProviderSpecific).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2017.MS,ProviderSpecific).sql new file mode 100644 index 000000000000..1eb8a1f6c1cb --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2017.MS,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- SqlServer.2017 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2017 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2017.MS,RowByRow).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2017.MS,RowByRow).sql new file mode 100644 index 000000000000..1eb8a1f6c1cb --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2017.MS,RowByRow).sql @@ -0,0 +1,42 @@ +-- SqlServer.2017 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2017 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..1ebb5efc7168 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2017.MS).sql @@ -0,0 +1,9 @@ +Parameters: +@p='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(@p) [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] > 0 +ORDER BY [p].[ProductID] + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..910f7527fc2a --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2017.MS).sql @@ -0,0 +1,50 @@ +-- SqlServer.2017 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + +-- SqlServer.2017 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..2ebd71a9a1b9 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2017.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2017 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..2ebd71a9a1b9 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2017.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2017 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..f770f57f0943 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2017.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2017 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..3759dd0f2226 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2017.MS).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT [p].[Id] AS [PatentId], @userId0 AS [UserId] +FROM [Patents] AS [p] +LEFT JOIN [PatentAssessment] AS [p0] ON [p].[Id] = [p0].[PatentId] +WHERE [p0].[PatentId] IS NULL OR [p0].[TechnicalReviewerId] <> @userId OR [p0].[TechnicalReviewerId] IS NULL + + +-- SqlServer.2017 +DECLARE @userId Int -- Int32 +SET @userId = 1 + +SELECT + [p].[Id] +FROM + [Patents] [p] + LEFT JOIN [PatentAssessment] [a_Assessment] ON [p].[Id] = [a_Assessment].[PatentId] +WHERE + [a_Assessment].[PatentId] IS NULL OR [a_Assessment].[TechnicalReviewerId] <> @userId OR + [a_Assessment].[TechnicalReviewerId] IS NULL + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..ae1f1ee11cb2 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2017.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2017 + +CREATE TABLE [tempdb]..[#Issue129Table] +( + [Id] int NOT NULL IDENTITY, + [Key] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#Issue129Table] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..0956208ebb15 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2017.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2017 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + ( + SELECT TOP (1) + [a_Children].[IsActive] + FROM + [Children] [a_Children] + WHERE + [x].[Id] = [a_Children].[ParentId] + ) = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..c5bb0a10bc9a --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2017.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2017 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + NOT EXISTS( + SELECT + * + FROM + [Children] [y] + WHERE + [x].[Id] = [y].[ParentId] AND [y].[IsActive] = 1 + ) + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..f770f57f0943 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2017.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2017 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..62a6cd5bbb28 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2017.MS).sql @@ -0,0 +1,11 @@ +-- SqlServer.2017 + +SELECT + [x].[Id] +FROM + [Issue340Entities] [x] +WHERE + [x].[IsActive] = 1 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..a287818bca82 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2017.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2017 + +SELECT + 1 +FROM + [Parents] [ua] +WHERE + [ua].[ParentId] = 55377 AND EXISTS( + SELECT + * + FROM + [Parents] [t1] + ) + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..74d9ede6448d --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2017.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2017 +DECLARE @DateTimeOffset DateTimeOffset +SET @DateTimeOffset = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) +DECLARE @DateTimeOffsetN DateTimeOffset +SET @DateTimeOffsetN = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) + +UPDATE + [Types] +SET + [DateTimeOffset] = @DateTimeOffset, + [DateTimeOffsetN] = @DateTimeOffsetN +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..c27acde1aa79 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2017.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2017 +DECLARE @DateTimeOffsetWithConverter BigInt -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter BigInt -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + [Types] +SET + [DateTimeOffsetWithConverter] = @DateTimeOffsetWithConverter, + [DateTimeOffsetNWithConverter] = @DateTimeOffsetNWithConverter +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..c8f7e72ccf51 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2017.MS).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2017 + +SELECT + [m_1].[Id], + [d_1].[Key_1], + [d_1].[SUM_1], + [d_1].[ToValue] +FROM + [Parents] [m_1] + CROSS APPLY ( + SELECT + [d].[ParentId] as [Key_1], + SUM([d].[Id]) as [SUM_1], + STRING_AGG([d].[Name], N', ') as [ToValue] + FROM + [Children] [d] + WHERE + [m_1].[Id] = [d].[ParentId] + GROUP BY + [d].[ParentId] + ) [d_1] + + + +DisposeTransaction + + +-- SqlServer.2017 + +SELECT + [c_1].[Id] +FROM + [Parents] [c_1] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..399f10baf60b --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2017.MS).sql @@ -0,0 +1,41 @@ +-- SqlServer.2017 +DECLARE @take Int -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + [id].[Id] +FROM + ( + SELECT TOP (@take) + [t1].[Id] + FROM + ( + SELECT + [p].[Id], + ( + SELECT + SUM([a_Tags].[Weight]) + FROM + [Issue4629Tags] [a_Tags] + WHERE + [p].[Id] = [a_Tags].[PostId] + ) as [SUM_1] + FROM + [Issue4629Posts] [p] + ) [t1] + WHERE + ( + SELECT + SUM([a_Tags_1].[Weight]) + FROM + [Issue4629Tags] [a_Tags_1] + WHERE + [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 + ) > 5 + ORDER BY + [t1].[SUM_1] + ) [id] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..03cce2f8ab75 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2017.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2017 +DECLARE @id Int -- Int32 +SET @id = 2 + +SELECT TOP (1) + [t1].[Index_1] +FROM + ( + SELECT + [x].[Id], + ROW_NUMBER() OVER(ORDER BY [x].[Id]) as [Index_1] + FROM + [Parents] [x] + ) [t1] +WHERE + [t1].[Id] = @id + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..b7826ed4190e --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2017.MS).sql @@ -0,0 +1,38 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2017 + +SELECT + [m_1].[Key_1], + [d].[CfAllowValue], + [d].[DateFrom] +FROM + ( + SELECT TOP (1) + [p].[AclNameId] as [Key_1] + FROM + [Issue4624Items] [p] + GROUP BY + [p].[AclNameId] + ) [m_1] + INNER JOIN [Issue4624Items] [d] ON [m_1].[Key_1] = [d].[AclNameId] +ORDER BY + [d].[DateFrom] + + + +-- SqlServer.2017 + +SELECT TOP (1) + [p].[AclNameId] +FROM + [Issue4624Items] [p] +GROUP BY + [p].[AclNameId] + + + +DisposeTransaction + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..15997abc6f5b --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2017.MS).sql @@ -0,0 +1,48 @@ +-- SqlServer.2017 (asynchronously) +DECLARE @systemId VarChar(20) -- AnsiString +SET @systemId = N'system' + +MERGE INTO [Issue4642Table2] [Target] +USING ( + SELECT + [y].[Id], + [y].[SystemId], + [y].[Timestamp] as [Timestamp_1] + FROM + [Issue4642Table1] [x] + INNER JOIN [Issue4642Table2] [y] ON [x].[Id] = [y].[Id] + WHERE + [x].[Id] IN (1) AND [y].[SystemId] = @systemId +) [Source] +( + [Id], + [SystemId], + [Timestamp_1] +) +ON ([Target].[Id] = [Source].[Id] AND [Target].[SystemId] = [Source].[SystemId]) + +WHEN MATCHED THEN +UPDATE +SET + [Timestamp] = [Source].[Timestamp_1] + +WHEN NOT MATCHED THEN +INSERT +( + [Id], + [SystemId], + [Timestamp] +) +VALUES +( + [Source].[Id], + [Source].[SystemId], + [Source].[Timestamp_1] +) +OUTPUT + $action, + INSERTED.[Id] +; + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..9e01bf37009b --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2017.MS).sql @@ -0,0 +1,4 @@ +INSERT BULK [Issue4663]() + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..431dff149469 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2017.MS).sql @@ -0,0 +1,21 @@ +-- SqlServer.2017 (asynchronously) + +SELECT + [x].[Id], + [x].[IsActive], + [x].[ParentId], + [x].[Name] +FROM + [Children] [x] +WHERE + [x].[Name] LIKE N'%Test%' ESCAPE N'~' +ORDER BY + [x].[Name] + + + +SELECT [c].[Id], [c].[IsActive], [c].[Name], [c].[ParentId] +FROM [Children] AS [c] +WHERE [c].[Name] LIKE N'Test%' + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..0ed40be0a4e4 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2017.MS).sql @@ -0,0 +1,64 @@ +-- SqlServer.2017 + +CREATE TABLE [tempdb]..[#Issue4671Entity1TMP] +( + [Id] int NOT NULL IDENTITY, + [Value] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2017 + +INSERT INTO [Issue4671Entity1] +( + [Value] +) +VALUES +( + 1 +) + + + +-- SqlServer.2017 + +INSERT INTO [tempdb]..[#Issue4671Entity1TMP] +( + [Value] +) +VALUES +( + 2 +) + + + +-- SqlServer.2017 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [Issue4671Entity1] [t1] + + + +-- SqlServer.2017 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [tempdb]..[#Issue4671Entity1TMP] [t1] + + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4671Entity1TMP] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..dab2259eccf9 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2017.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..dab2259eccf9 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2017.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..dab2259eccf9 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2017.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..dab2259eccf9 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2017.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2017 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..5a9542e320aa --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2017.MS).sql @@ -0,0 +1,18 @@ +SELECT COALESCE([i0].[Name], N'') + N'>' + [i].[Name] +FROM [Issue73Entities] AS [i] +LEFT JOIN [Issue73Entities] AS [i0] ON [i].[ParentId] = [i0].[Id] +WHERE [i].[Name] = N'Name1_3' + + +-- SqlServer.2017 + +SELECT + [a_Parent].[Name] + N'>' + [x].[Name] +FROM + [Issue73Entities] [x] + LEFT JOIN [Issue73Entities] [a_Parent] ON [x].[ParentId] = [a_Parent].[Id] +WHERE + [x].[Name] = N'Name1_3' + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..be2d009fe0d9 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2017.MS).sql @@ -0,0 +1,27 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [IssueEnum] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Value], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Value]) +VALUES (i.[Value]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2017 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Value] +FROM + [IssueEnum] [t1] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..a4c62af07d0d --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2017.MS).sql @@ -0,0 +1,33 @@ +-- SqlServer.2017 + +DELETE [t1] +FROM + [EventScheduleItem] [t1] + + + +Parameters: +@p0='?' (Size = 1) (DbType = Byte), @p1='?' (DbType = Guid), @p2='?' (Size = 4000), @p3='?' (Size = 4000) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [EventScheduleItem] ([CrashEnum], [GuidColumn], [JsonColumn], [NameLocalized_JSON]) +OUTPUT INSERTED.[Id] +VALUES (@p0, @p1, @p2, @p3); + + +-- SqlServer.2017 + +SELECT TOP (1) + [p].[Id], + [p].[NameLocalized_JSON], + [p].[CrashEnum], + [p].[GuidColumn], + JSON_VALUE([p].[JsonColumn], N'some') +FROM + [EventScheduleItem] [p] +WHERE + [p].[Id] < 10 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..e5291747a1bf --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2017.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2017 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] IS NOT NULL + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..27890e00c4ed --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2017.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2017 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE N'%anything%' ESCAPE N'~' + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..8a6c667532f3 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2017.MS).sql @@ -0,0 +1,24 @@ +-- SqlServer.2017 +DECLARE @value NVarChar(60) -- String +SET @value = N'%anything%' + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE @value ESCAPE N'~' + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..20fead4a3e6d --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2017.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..316fcde71009 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2017.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..20fead4a3e6d --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2017.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..316fcde71009 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2017.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..9ce7a71c6739 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2017.MS).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId], [o3].[ProductId], [o3].[Quantity], [o1].[Quantity], [p0].[ProductName] +FROM [Orders] AS [o] +INNER JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Quantity] + FROM [Order Details] AS [o0] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [o1] ON [o].[OrderID] = [o1].[OrderID] +INNER JOIN ( + SELECT [p].[ProductID], [p].[ProductName] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +) AS [p0] ON [o1].[ProductID] = [p0].[ProductID] +LEFT JOIN ( + SELECT [o2].[OrderID] AS [OrderId], [o2].[ProductID] AS [ProductId], [o2].[Quantity] + FROM [Order Details] AS [o2] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) +) AS [o3] ON [p0].[ProductID] = [o3].[ProductId] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId] + + +BeginTransaction(RepeatableRead) + + +-- SqlServer.2017 + +SELECT + [m_1].[ProductId], + [d].[OrderID], + [d].[ProductID], + [d].[Quantity] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId] + FROM + [Orders] [e] + INNER JOIN [Order Details] [od] ON [e].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductId] = [d].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2017 + +SELECT + [a_Product].[ProductID], + [od].[OrderID], + [od].[ProductID], + [od].[Quantity], + [a_Product].[ProductName] +FROM + [Orders] [o] + INNER JOIN [Order Details] [od] ON [o].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..b2e30a335294 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2017.MS,False).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2017 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..1f8dbecdb27b --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2017.MS,True).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2017 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..b7d42b55fbd3 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2017.MS,False).sql @@ -0,0 +1,18 @@ +-- SqlServer.2017 + +DELETE [e] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..93c4bb52af5c --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2017.MS,True).sql @@ -0,0 +1,20 @@ +-- SqlServer.2017 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..2a684918e4c7 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2017.MS,False).sql @@ -0,0 +1,97 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..ac39f62d4ee8 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2017.MS,True).sql @@ -0,0 +1,108 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..6f13b73d1faf --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2017.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..535e2e9e177c --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2017.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..6f13b73d1faf --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2017.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..535e2e9e177c --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2017.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..a870d1b559a9 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2017.MS,False).sql @@ -0,0 +1,97 @@ +-- SqlServer.2017 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2017 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +-- SqlServer.2017 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] + + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..34583edecdad --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2017.MS,True).sql @@ -0,0 +1,101 @@ +-- SqlServer.2017 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2017 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2017 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..459883101b11 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2017.MS).sql @@ -0,0 +1,30 @@ +CREATE OR ALTER FUNCTION dbo.[ProcessLong] + ( + @secondsNumber int + ) + RETURNS int + AS + BEGIN + declare @startTime datetime = getutcdate() + while datediff(second, @startTime, getutcdate()) < @secondsNumber + begin + set @startTime = @startTime + end + return 1 + END + + +-- SqlServer.2017 +DECLARE @commandExecutionTime Int -- Int32 +SET @commandExecutionTime = 5 + +SELECT TOP (1) + dbo.ProcessLong(@commandExecutionTime) +FROM + [Products] [e] + + + +DROP FUNCTION IF EXISTS [dbo].[ProcessLong] + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..0fda8ab436ca --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2017.MS,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..6d80285ecd68 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2017.MS,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..49b18d3f472a --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2017.MS,False).sql @@ -0,0 +1,101 @@ +-- SqlServer.2017 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2017 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] + + + +-- SqlServer.2017 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..f093f4ec46fe --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2017.MS,True).sql @@ -0,0 +1,105 @@ +-- SqlServer.2017 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2017 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2017 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..07499e057238 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2017.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2017 (asynchronously) +DECLARE @take Int -- Int32 +SET @take = 20 + +DELETE [x] +FROM + ( + SELECT TOP (@take) + [e].[CustomerID] as [CustomerId] + FROM + [Customers] [e] + WHERE + [e].[IsDeleted] = 1 + ) [x] +WHERE + 1 = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..b171f703e5c3 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2017.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2017 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] +WHERE + [op].[ProductID] IS NULL + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..ccecf54749b8 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2017.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2017 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] AND [op].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 AND [op].[ProductID] IS NULL + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..b7251c857c5d --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2017.MS,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..b238a157ccbf --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2017.MS,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [o].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..496c97919dc2 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2017.MS,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..fcf4c7be337d --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2017.MS,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2017.MS).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..7ff6dac7bef7 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2017.MS).sql @@ -0,0 +1,23 @@ +-- SqlServer.2017 + +SELECT + [p].[OrderID], + DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate])), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate]))) +FROM + [Orders] [p] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..1251ac1fa481 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2017.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[City] IS NOT NULL + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..ceec125988f7 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2017.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[City] IS NOT NULL + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..24c04b322433 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2017.MS,False).sql @@ -0,0 +1,70 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2017 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..636ef878fa54 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2017.MS,True).sql @@ -0,0 +1,74 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2017 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [d].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [p].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..97cd73785dfd --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2017.MS,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..b440aee3d02e --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2017.MS,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] +WHERE + [a_Territory].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..bd0de71cc748 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2017.MS,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..6c7026c924a8 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2017.MS,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] +WHERE + [d].[IsDeleted] = 0 + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..d0ca2c0824d0 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2017.MS,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..d0ca2c0824d0 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2017.MS,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2017 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2017 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..6b091756cf19 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2017.MS,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2017 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..7590ff5371c3 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2017.MS,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2017 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [pd2].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [e_2].[IsDeleted] = 0 AND [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..75c671feb64c --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2017.MS,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2017 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[EmployeeID] = @test + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..b9d933baccf4 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2017.MS,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2017 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[EmployeeID] = @test + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..fcdcf76ed45e --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2017.MS,False).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..1e00ad94e9ec --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2017.MS,True).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[IsDeleted] = 0 AND [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..9b89c049ee02 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2017.MS,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..21e627137d7d --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2017.MS,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..e24c09db874d --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2017.MS,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..4fe143eba196 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2017.MS,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2017 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..fe2886a799e0 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2017.MS,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2017 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2017 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..b97606a48c8f --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2017.MS,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2017 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransaction + + +-- SqlServer.2017 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..c1ef8ec1f763 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2017.MS,False).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2017 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2017 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..fa57ac7a16a2 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2017.MS,True).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2017 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2017 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..f6486fd2a2cb --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2017.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2017 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..0a29aed146ba --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2017.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2017 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..f6486fd2a2cb --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2017.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2017 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..0a29aed146ba --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2017.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2017 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..9c25e72c0af2 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2017.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2017 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..9c25e72c0af2 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2017.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2017 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..da7f187c9c06 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2017.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2017 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..da7f187c9c06 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2017.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2017 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2017.MS,False).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2017.MS,False).sql new file mode 100644 index 000000000000..8a01388ac1e4 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2017.MS,False).sql @@ -0,0 +1,29 @@ +-- SqlServer.2017 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2017.MS,True).sql b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2017.MS,True).sql new file mode 100644 index 000000000000..18181794c436 --- /dev/null +++ b/SqlServer.2017.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2017.MS,True).sql @@ -0,0 +1,29 @@ +-- SqlServer.2017 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..f4ea9cad8c0e --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2019.MS).sql @@ -0,0 +1,164 @@ +-- SqlServer.2019 +DECLARE @Id BigInt -- Int64 +SET @Id = 1 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bc7b663d-0fde-4327-8f92-5d8cc3a11d11' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C1' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N1' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2019 +DECLARE @Id BigInt -- Int64 +SET @Id = 2 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'a948600d-de21-4f74-8ac2-9516b287076e' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C2' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N2' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2019 +DECLARE @Id BigInt -- Int64 +SET @Id = 3 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bd3973a5-4323-4dd8-9f4f-df9f93e2a627' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C3' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N3' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +SELECT [s].[Id], [s].[Code], [s].[IsDeleted], [s].[Name], [s].[PermanentId] +FROM [Subdivisions] AS [s] +WHERE CAST([s].[Id] AS bigint) = CAST(1 AS bigint) + + +-- SqlServer.2019 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + CAST([s].[Id] AS BigInt) = 1 + + + +-- SqlServer.2019 +DECLARE @id BigInt -- Int64 +SET @id = 1 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] = @id + + + +-- SqlServer.2019 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] IN (2, 3) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[PermanentId], + [t1].[Code], + [t1].[Name], + [t1].[IsDeleted] +FROM + [Subdivisions] [t1] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..d0a2e7227562 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2019.MS).sql @@ -0,0 +1,10 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [Issue261Table] [t1] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..60f7d781fb04 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2019.MS).sql @@ -0,0 +1,86 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#Issue4657TempTable1] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable1](Id, Code) + + + +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#Issue4657TempTable2] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable2](Id, Code) + + + +-- SqlServer.2019 + +WITH [CTE_1] ([Id], [Code]) +AS +( + SELECT + [t1].[ID], + [t1].[CODE] + FROM + [Issue4657Table] [t1] +) +MERGE INTO [CTE_1] [Target] +USING ( + SELECT + [t2].[Id], + [t2].[Code] + FROM + [tempdb]..[#Issue4657TempTable1] [t2] +) [Source] +( + [Id], + [Code] +) +ON ([Target].[Id] = [Source].[Id]) + +WHEN NOT MATCHED THEN +INSERT +( + [Code] +) +VALUES +( + [Source].[Code] +) +OUTPUT + INSERTED.[Id], + INSERTED.[Code] +INTO [tempdb]..[#Issue4657TempTable2] +( + [Id], + [Code] +) +; + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable2] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable1] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..3c073d8eed0b --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2019.MS).sql @@ -0,0 +1,5 @@ +SELECT [w].[Id], [w].[Value] +FROM [WithDuplicateProperties] AS [w] +WHERE [w].[Value] = 1 + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..296a860d31ad --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2019.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..5b6a76f71f5a --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2019.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#WithIdentity](Name) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#WithIdentity] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..c9d2b3a570d6 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2019.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (Size = 21), @p1='?' (Size = 21), @p2='?' (Size = 21), @p3='?' (Size = 21), @p4='?' (Size = 21) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [WithInheritance] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Discriminator], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Discriminator]) +VALUES (i.[Discriminator]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2019 + +SELECT + [t1].[Discriminator], + [t1].[Id] +FROM + [WithInheritance] [t1] +WHERE + [t1].[Discriminator] IN (N'WithInheritanceA2', N'WithInheritanceA1', N'WithInheritanceA') + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..8150b6cb1987 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2019.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT ASYNC BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..296a860d31ad --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2019.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..edb0ac36559f --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2019.MS).sql @@ -0,0 +1,81 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [SkipModes] ([Id], [InsertOnly]) +VALUES (@p0, @p1); + + +-- SqlServer.2019 +DECLARE @Id Int -- Int32 +SET @Id = 2 +DECLARE @InsertOnly Int -- Int32 +SET @InsertOnly = 2 + +INSERT INTO [SkipModes] +( + [Id], + [InsertOnly] +) +VALUES +( + @Id, + @InsertOnly +) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [SkipModes] SET [UpdateOnly] = @p0 +OUTPUT 1 +WHERE [Id] = @p1; + + +-- SqlServer.2019 +DECLARE @UpdateOnly Int -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id Int -- Int32 +SET @Id = 2 + +UPDATE + [SkipModes] +SET + [UpdateOnly] = @UpdateOnly +WHERE + [SkipModes].[Id] = @Id + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..bcce43fc19e3 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2019.MS).sql @@ -0,0 +1,36 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..e17a48ea8525 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2019.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int64), @p3='?' (DbType = Int64), @p4='?' (Precision = 20) (DbType = Decimal), @p5='?' (Precision = 20) (DbType = Decimal) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [UIntTable] ([Field16], [Field16N], [Field32], [Field32N], [Field64], [Field64N]) +OUTPUT INSERTED.[ID] +VALUES (@p0, @p1, @p2, @p3, @p4, @p5); + + +-- SqlServer.2019 (asynchronously) +DECLARE @field64 Decimal +SET @field64 = 5 + +SELECT TOP (1) + [e].[ID], + [e].[Field16], + [e].[Field32], + [e].[Field64], + [e].[Field16N], + [e].[Field32N], + [e].[Field64N] +FROM + [UIntTable] [e] +WHERE + [e].[Field64] = @field64 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2019.MS,Default).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2019.MS,Default).sql new file mode 100644 index 000000000000..ef4fca5e40c2 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2019.MS,Default).sql @@ -0,0 +1,42 @@ +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2019.MS,MultipleRows).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2019.MS,MultipleRows).sql new file mode 100644 index 000000000000..ef4fca5e40c2 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2019.MS,MultipleRows).sql @@ -0,0 +1,42 @@ +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2019.MS,ProviderSpecific).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2019.MS,ProviderSpecific).sql new file mode 100644 index 000000000000..ef4fca5e40c2 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2019.MS,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2019.MS,RowByRow).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2019.MS,RowByRow).sql new file mode 100644 index 000000000000..ef4fca5e40c2 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2019.MS,RowByRow).sql @@ -0,0 +1,42 @@ +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..1ebb5efc7168 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2019.MS).sql @@ -0,0 +1,9 @@ +Parameters: +@p='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(@p) [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] > 0 +ORDER BY [p].[ProductID] + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..50478132b979 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2019.MS).sql @@ -0,0 +1,50 @@ +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..0cb1f8ea01ee --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2019.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..0cb1f8ea01ee --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2019.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..4e7e76234be0 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2019.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..35c6d311487d --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2019.MS).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT [p].[Id] AS [PatentId], @userId0 AS [UserId] +FROM [Patents] AS [p] +LEFT JOIN [PatentAssessment] AS [p0] ON [p].[Id] = [p0].[PatentId] +WHERE [p0].[PatentId] IS NULL OR [p0].[TechnicalReviewerId] <> @userId OR [p0].[TechnicalReviewerId] IS NULL + + +-- SqlServer.2019 +DECLARE @userId Int -- Int32 +SET @userId = 1 + +SELECT + [p].[Id] +FROM + [Patents] [p] + LEFT JOIN [PatentAssessment] [a_Assessment] ON [p].[Id] = [a_Assessment].[PatentId] +WHERE + [a_Assessment].[PatentId] IS NULL OR [a_Assessment].[TechnicalReviewerId] <> @userId OR + [a_Assessment].[TechnicalReviewerId] IS NULL + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..ba68e55c9a00 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2019.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#Issue129Table] +( + [Id] int NOT NULL IDENTITY, + [Key] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Issue129Table] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..258b0a15f3c9 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2019.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2019 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + ( + SELECT TOP (1) + [a_Children].[IsActive] + FROM + [Children] [a_Children] + WHERE + [x].[Id] = [a_Children].[ParentId] + ) = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..5810bc973a93 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2019.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2019 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + NOT EXISTS( + SELECT + * + FROM + [Children] [y] + WHERE + [x].[Id] = [y].[ParentId] AND [y].[IsActive] = 1 + ) + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..4e7e76234be0 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2019.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..704432ff4ed5 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2019.MS).sql @@ -0,0 +1,11 @@ +-- SqlServer.2019 + +SELECT + [x].[Id] +FROM + [Issue340Entities] [x] +WHERE + [x].[IsActive] = 1 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..3f1448451434 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2019.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2019 + +SELECT + 1 +FROM + [Parents] [ua] +WHERE + [ua].[ParentId] = 55377 AND EXISTS( + SELECT + * + FROM + [Parents] [t1] + ) + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..8566d73acf0e --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2019.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2019 +DECLARE @DateTimeOffset DateTimeOffset +SET @DateTimeOffset = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) +DECLARE @DateTimeOffsetN DateTimeOffset +SET @DateTimeOffsetN = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) + +UPDATE + [Types] +SET + [DateTimeOffset] = @DateTimeOffset, + [DateTimeOffsetN] = @DateTimeOffsetN +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..75454c418574 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2019.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2019 +DECLARE @DateTimeOffsetWithConverter BigInt -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter BigInt -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + [Types] +SET + [DateTimeOffsetWithConverter] = @DateTimeOffsetWithConverter, + [DateTimeOffsetNWithConverter] = @DateTimeOffsetNWithConverter +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..031f31d1d27a --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2019.MS).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[Id], + [d_1].[Key_1], + [d_1].[SUM_1], + [d_1].[ToValue] +FROM + [Parents] [m_1] + CROSS APPLY ( + SELECT + [d].[ParentId] as [Key_1], + SUM([d].[Id]) as [SUM_1], + STRING_AGG([d].[Name], N', ') as [ToValue] + FROM + [Children] [d] + WHERE + [m_1].[Id] = [d].[ParentId] + GROUP BY + [d].[ParentId] + ) [d_1] + + + +DisposeTransaction + + +-- SqlServer.2019 + +SELECT + [c_1].[Id] +FROM + [Parents] [c_1] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..7ead679a1527 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2019.MS).sql @@ -0,0 +1,41 @@ +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + [id].[Id] +FROM + ( + SELECT TOP (@take) + [t1].[Id] + FROM + ( + SELECT + [p].[Id], + ( + SELECT + SUM([a_Tags].[Weight]) + FROM + [Issue4629Tags] [a_Tags] + WHERE + [p].[Id] = [a_Tags].[PostId] + ) as [SUM_1] + FROM + [Issue4629Posts] [p] + ) [t1] + WHERE + ( + SELECT + SUM([a_Tags_1].[Weight]) + FROM + [Issue4629Tags] [a_Tags_1] + WHERE + [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 + ) > 5 + ORDER BY + [t1].[SUM_1] + ) [id] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..a55842bd197f --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2019.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2019 +DECLARE @id Int -- Int32 +SET @id = 2 + +SELECT TOP (1) + [t1].[Index_1] +FROM + ( + SELECT + [x].[Id], + ROW_NUMBER() OVER(ORDER BY [x].[Id]) as [Index_1] + FROM + [Parents] [x] + ) [t1] +WHERE + [t1].[Id] = @id + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..ba78803d30e3 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2019.MS).sql @@ -0,0 +1,38 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[Key_1], + [d].[CfAllowValue], + [d].[DateFrom] +FROM + ( + SELECT TOP (1) + [p].[AclNameId] as [Key_1] + FROM + [Issue4624Items] [p] + GROUP BY + [p].[AclNameId] + ) [m_1] + INNER JOIN [Issue4624Items] [d] ON [m_1].[Key_1] = [d].[AclNameId] +ORDER BY + [d].[DateFrom] + + + +-- SqlServer.2019 + +SELECT TOP (1) + [p].[AclNameId] +FROM + [Issue4624Items] [p] +GROUP BY + [p].[AclNameId] + + + +DisposeTransaction + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..edb46114590f --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2019.MS).sql @@ -0,0 +1,48 @@ +-- SqlServer.2019 (asynchronously) +DECLARE @systemId VarChar(20) -- AnsiString +SET @systemId = N'system' + +MERGE INTO [Issue4642Table2] [Target] +USING ( + SELECT + [y].[Id], + [y].[SystemId], + [y].[Timestamp] as [Timestamp_1] + FROM + [Issue4642Table1] [x] + INNER JOIN [Issue4642Table2] [y] ON [x].[Id] = [y].[Id] + WHERE + [x].[Id] IN (1) AND [y].[SystemId] = @systemId +) [Source] +( + [Id], + [SystemId], + [Timestamp_1] +) +ON ([Target].[Id] = [Source].[Id] AND [Target].[SystemId] = [Source].[SystemId]) + +WHEN MATCHED THEN +UPDATE +SET + [Timestamp] = [Source].[Timestamp_1] + +WHEN NOT MATCHED THEN +INSERT +( + [Id], + [SystemId], + [Timestamp] +) +VALUES +( + [Source].[Id], + [Source].[SystemId], + [Source].[Timestamp_1] +) +OUTPUT + $action, + INSERTED.[Id] +; + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..9e01bf37009b --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2019.MS).sql @@ -0,0 +1,4 @@ +INSERT BULK [Issue4663]() + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..64b17fdf632f --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2019.MS).sql @@ -0,0 +1,21 @@ +-- SqlServer.2019 (asynchronously) + +SELECT + [x].[Id], + [x].[IsActive], + [x].[ParentId], + [x].[Name] +FROM + [Children] [x] +WHERE + [x].[Name] LIKE N'%Test%' ESCAPE N'~' +ORDER BY + [x].[Name] + + + +SELECT [c].[Id], [c].[IsActive], [c].[Name], [c].[ParentId] +FROM [Children] AS [c] +WHERE [c].[Name] LIKE N'Test%' + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..28d5a6cc9614 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2019.MS).sql @@ -0,0 +1,64 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#Issue4671Entity1TMP] +( + [Id] int NOT NULL IDENTITY, + [Value] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2019 + +INSERT INTO [Issue4671Entity1] +( + [Value] +) +VALUES +( + 1 +) + + + +-- SqlServer.2019 + +INSERT INTO [tempdb]..[#Issue4671Entity1TMP] +( + [Value] +) +VALUES +( + 2 +) + + + +-- SqlServer.2019 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [Issue4671Entity1] [t1] + + + +-- SqlServer.2019 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [tempdb]..[#Issue4671Entity1TMP] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4671Entity1TMP] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..070587834a0d --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2019.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..070587834a0d --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2019.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..070587834a0d --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2019.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..070587834a0d --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2019.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..d073d5a4991e --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2019.MS).sql @@ -0,0 +1,18 @@ +SELECT COALESCE([i0].[Name], N'') + N'>' + [i].[Name] +FROM [Issue73Entities] AS [i] +LEFT JOIN [Issue73Entities] AS [i0] ON [i].[ParentId] = [i0].[Id] +WHERE [i].[Name] = N'Name1_3' + + +-- SqlServer.2019 + +SELECT + [a_Parent].[Name] + N'>' + [x].[Name] +FROM + [Issue73Entities] [x] + LEFT JOIN [Issue73Entities] [a_Parent] ON [x].[ParentId] = [a_Parent].[Id] +WHERE + [x].[Name] = N'Name1_3' + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..b54f58d48099 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2019.MS).sql @@ -0,0 +1,27 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [IssueEnum] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Value], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Value]) +VALUES (i.[Value]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Value] +FROM + [IssueEnum] [t1] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..34f1af64d74e --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2019.MS).sql @@ -0,0 +1,33 @@ +-- SqlServer.2019 + +DELETE [t1] +FROM + [EventScheduleItem] [t1] + + + +Parameters: +@p0='?' (Size = 1) (DbType = Byte), @p1='?' (DbType = Guid), @p2='?' (Size = 4000), @p3='?' (Size = 4000) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [EventScheduleItem] ([CrashEnum], [GuidColumn], [JsonColumn], [NameLocalized_JSON]) +OUTPUT INSERTED.[Id] +VALUES (@p0, @p1, @p2, @p3); + + +-- SqlServer.2019 + +SELECT TOP (1) + [p].[Id], + [p].[NameLocalized_JSON], + [p].[CrashEnum], + [p].[GuidColumn], + JSON_VALUE([p].[JsonColumn], N'some') +FROM + [EventScheduleItem] [p] +WHERE + [p].[Id] < 10 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..a24dc14a9334 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2019.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] IS NOT NULL + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..f7a667df571d --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2019.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE N'%anything%' ESCAPE N'~' + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..dab1d88abf6f --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2019.MS).sql @@ -0,0 +1,24 @@ +-- SqlServer.2019 +DECLARE @value NVarChar(60) -- String +SET @value = N'%anything%' + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE @value ESCAPE N'~' + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..6d12fd195a9a --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2019.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..ca7e93507bc9 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2019.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..6d12fd195a9a --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2019.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..ca7e93507bc9 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2019.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..15c8c155e669 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2019.MS).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId], [o3].[ProductId], [o3].[Quantity], [o1].[Quantity], [p0].[ProductName] +FROM [Orders] AS [o] +INNER JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Quantity] + FROM [Order Details] AS [o0] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [o1] ON [o].[OrderID] = [o1].[OrderID] +INNER JOIN ( + SELECT [p].[ProductID], [p].[ProductName] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +) AS [p0] ON [o1].[ProductID] = [p0].[ProductID] +LEFT JOIN ( + SELECT [o2].[OrderID] AS [OrderId], [o2].[ProductID] AS [ProductId], [o2].[Quantity] + FROM [Order Details] AS [o2] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) +) AS [o3] ON [p0].[ProductID] = [o3].[ProductId] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId] + + +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[ProductId], + [d].[OrderID], + [d].[ProductID], + [d].[Quantity] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId] + FROM + [Orders] [e] + INNER JOIN [Order Details] [od] ON [e].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductId] = [d].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2019 + +SELECT + [a_Product].[ProductID], + [od].[OrderID], + [od].[ProductID], + [od].[Quantity], + [a_Product].[ProductName] +FROM + [Orders] [o] + INNER JOIN [Order Details] [od] ON [o].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..af1623557b95 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2019.MS,False).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..a6417d4b7fae --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2019.MS,True).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..6d7ae3281c3e --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2019.MS,False).sql @@ -0,0 +1,18 @@ +-- SqlServer.2019 + +DELETE [e] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..4589c539a694 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2019.MS,True).sql @@ -0,0 +1,20 @@ +-- SqlServer.2019 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..0fef112a6a7e --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2019.MS,False).sql @@ -0,0 +1,97 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..d678fcc3933c --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2019.MS,True).sql @@ -0,0 +1,108 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..47586f0d6f35 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2019.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..e5bc8cb6bc3a --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2019.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..47586f0d6f35 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2019.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..e5bc8cb6bc3a --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2019.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..88d69d626530 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2019.MS,False).sql @@ -0,0 +1,97 @@ +-- SqlServer.2019 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2019 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..6ef22539e4b0 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2019.MS,True).sql @@ -0,0 +1,101 @@ +-- SqlServer.2019 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2019 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..6f17fedd4de3 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2019.MS).sql @@ -0,0 +1,30 @@ +CREATE OR ALTER FUNCTION dbo.[ProcessLong] + ( + @secondsNumber int + ) + RETURNS int + AS + BEGIN + declare @startTime datetime = getutcdate() + while datediff(second, @startTime, getutcdate()) < @secondsNumber + begin + set @startTime = @startTime + end + return 1 + END + + +-- SqlServer.2019 +DECLARE @commandExecutionTime Int -- Int32 +SET @commandExecutionTime = 5 + +SELECT TOP (1) + dbo.ProcessLong(@commandExecutionTime) +FROM + [Products] [e] + + + +DROP FUNCTION IF EXISTS [dbo].[ProcessLong] + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..817b0fe041ff --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2019.MS,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..8f2a09f8d6c5 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2019.MS,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..1cf5916f419c --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2019.MS,False).sql @@ -0,0 +1,101 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2019 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] + + + +-- SqlServer.2019 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..02c92ea0e231 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2019.MS,True).sql @@ -0,0 +1,105 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2019 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2019 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..2b11598875d3 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2019.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2019 (asynchronously) +DECLARE @take Int -- Int32 +SET @take = 20 + +DELETE [x] +FROM + ( + SELECT TOP (@take) + [e].[CustomerID] as [CustomerId] + FROM + [Customers] [e] + WHERE + [e].[IsDeleted] = 1 + ) [x] +WHERE + 1 = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..087247f5f6ee --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2019.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] +WHERE + [op].[ProductID] IS NULL + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..0c4e8ef2e001 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2019.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] AND [op].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 AND [op].[ProductID] IS NULL + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..fcf371b17424 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2019.MS,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..74a8238d140f --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2019.MS,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [o].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..0b67e90243ec --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2019.MS,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..6067ff3aa434 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2019.MS,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2019.MS).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..66eaedf0de5b --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2019.MS).sql @@ -0,0 +1,23 @@ +-- SqlServer.2019 + +SELECT + [p].[OrderID], + DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate])), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate]))) +FROM + [Orders] [p] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..0e654888589a --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2019.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[City] IS NOT NULL + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..c6c846af0838 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2019.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[City] IS NOT NULL + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..7b93d9e58cf0 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2019.MS,False).sql @@ -0,0 +1,70 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..4b50b3ccfdca --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2019.MS,True).sql @@ -0,0 +1,74 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [d].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [p].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..1edc91305932 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2019.MS,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..ba76110a138c --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2019.MS,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] +WHERE + [a_Territory].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..5382121f2488 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2019.MS,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..49d8968dab3f --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2019.MS,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] +WHERE + [d].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..60be32753abd --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2019.MS,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..60be32753abd --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2019.MS,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..6a7a58f5cfeb --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2019.MS,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..7b4406a29f17 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2019.MS,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [pd2].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [e_2].[IsDeleted] = 0 AND [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..f6f296b4dccf --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2019.MS,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2019 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[EmployeeID] = @test + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..303ddd479ace --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2019.MS,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2019 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[EmployeeID] = @test + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..f51580716385 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2019.MS,False).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..2d942ca09ef4 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2019.MS,True).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[IsDeleted] = 0 AND [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..6862c7991309 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2019.MS,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..b49320353fc7 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2019.MS,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..83395629ef32 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2019.MS,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..6beacfaf2f89 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2019.MS,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..47e29c3042dc --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2019.MS,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..c658272e6a38 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2019.MS,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransaction + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..e2f9dc98230d --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2019.MS,False).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2019 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2019 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..44a866a70a51 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2019.MS,True).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2019 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2019 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..cea556913db9 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2019.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..8080c7592c12 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2019.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..cea556913db9 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2019.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..8080c7592c12 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2019.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..6c03cbf4db19 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2019.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2019 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..6c03cbf4db19 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2019.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2019 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..559ab88d725d --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2019.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2019 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..559ab88d725d --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2019.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2019 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2019.MS,False).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2019.MS,False).sql new file mode 100644 index 000000000000..a522f6213776 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2019.MS,False).sql @@ -0,0 +1,29 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2019.MS,True).sql b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2019.MS,True).sql new file mode 100644 index 000000000000..1625b2c9c8f4 --- /dev/null +++ b/SqlServer.2019.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2019.MS,True).sql @@ -0,0 +1,29 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..359ceabf2c94 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2022.MS).sql @@ -0,0 +1,164 @@ +-- SqlServer.2022 +DECLARE @Id BigInt -- Int64 +SET @Id = 1 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bc7b663d-0fde-4327-8f92-5d8cc3a11d11' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C1' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N1' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2022 +DECLARE @Id BigInt -- Int64 +SET @Id = 2 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'a948600d-de21-4f74-8ac2-9516b287076e' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C2' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N2' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2022 +DECLARE @Id BigInt -- Int64 +SET @Id = 3 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bd3973a5-4323-4dd8-9f4f-df9f93e2a627' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C3' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N3' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +SELECT [s].[Id], [s].[Code], [s].[IsDeleted], [s].[Name], [s].[PermanentId] +FROM [Subdivisions] AS [s] +WHERE CAST([s].[Id] AS bigint) = CAST(1 AS bigint) + + +-- SqlServer.2022 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + CAST([s].[Id] AS BigInt) = 1 + + + +-- SqlServer.2022 +DECLARE @id BigInt -- Int64 +SET @id = 1 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] = @id + + + +-- SqlServer.2022 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] IN (2, 3) + + + +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[PermanentId], + [t1].[Code], + [t1].[Name], + [t1].[IsDeleted] +FROM + [Subdivisions] [t1] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..61a82adf5b35 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2022.MS).sql @@ -0,0 +1,10 @@ +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [Issue261Table] [t1] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..9906afb52dac --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2022.MS).sql @@ -0,0 +1,86 @@ +-- SqlServer.2022 + +CREATE TABLE [tempdb]..[#Issue4657TempTable1] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable1](Id, Code) + + + +-- SqlServer.2022 + +CREATE TABLE [tempdb]..[#Issue4657TempTable2] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable2](Id, Code) + + + +-- SqlServer.2022 + +WITH [CTE_1] ([Id], [Code]) +AS +( + SELECT + [t1].[ID], + [t1].[CODE] + FROM + [Issue4657Table] [t1] +) +MERGE INTO [CTE_1] [Target] +USING ( + SELECT + [t2].[Id], + [t2].[Code] + FROM + [tempdb]..[#Issue4657TempTable1] [t2] +) [Source] +( + [Id], + [Code] +) +ON ([Target].[Id] = [Source].[Id]) + +WHEN NOT MATCHED THEN +INSERT +( + [Code] +) +VALUES +( + [Source].[Code] +) +OUTPUT + INSERTED.[Id], + INSERTED.[Code] +INTO [tempdb]..[#Issue4657TempTable2] +( + [Id], + [Code] +) +; + + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable2] + + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable1] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..3c073d8eed0b --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2022.MS).sql @@ -0,0 +1,5 @@ +SELECT [w].[Id], [w].[Value] +FROM [WithDuplicateProperties] AS [w] +WHERE [w].[Value] = 1 + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..f88dcfe3f005 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2022.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2022 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..c90a7196a680 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2022.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2022 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#WithIdentity](Name) + + + +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#WithIdentity] [t1] + + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..53c3da1a3a24 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2022.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (Size = 21), @p1='?' (Size = 21), @p2='?' (Size = 21), @p3='?' (Size = 21), @p4='?' (Size = 21) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [WithInheritance] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Discriminator], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Discriminator]) +VALUES (i.[Discriminator]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2022 + +SELECT + [t1].[Discriminator], + [t1].[Id] +FROM + [WithInheritance] [t1] +WHERE + [t1].[Discriminator] IN (N'WithInheritanceA2', N'WithInheritanceA1', N'WithInheritanceA') + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..f6f2597c7356 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2022.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2022 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT ASYNC BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..f88dcfe3f005 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2022.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2022 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..f8c0101a242d --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2022.MS).sql @@ -0,0 +1,81 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [SkipModes] ([Id], [InsertOnly]) +VALUES (@p0, @p1); + + +-- SqlServer.2022 +DECLARE @Id Int -- Int32 +SET @Id = 2 +DECLARE @InsertOnly Int -- Int32 +SET @InsertOnly = 2 + +INSERT INTO [SkipModes] +( + [Id], + [InsertOnly] +) +VALUES +( + @Id, + @InsertOnly +) + + + +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [SkipModes] SET [UpdateOnly] = @p0 +OUTPUT 1 +WHERE [Id] = @p1; + + +-- SqlServer.2022 +DECLARE @UpdateOnly Int -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id Int -- Int32 +SET @Id = 2 + +UPDATE + [SkipModes] +SET + [UpdateOnly] = @UpdateOnly +WHERE + [SkipModes].[Id] = @Id + + + +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..249f0a5a0524 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2022.MS).sql @@ -0,0 +1,36 @@ +-- SqlServer.2022 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2022 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..c611c9ee60d4 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2022.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int64), @p3='?' (DbType = Int64), @p4='?' (Precision = 20) (DbType = Decimal), @p5='?' (Precision = 20) (DbType = Decimal) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [UIntTable] ([Field16], [Field16N], [Field32], [Field32N], [Field64], [Field64N]) +OUTPUT INSERTED.[ID] +VALUES (@p0, @p1, @p2, @p3, @p4, @p5); + + +-- SqlServer.2022 (asynchronously) +DECLARE @field64 Decimal +SET @field64 = 5 + +SELECT TOP (1) + [e].[ID], + [e].[Field16], + [e].[Field32], + [e].[Field64], + [e].[Field16N], + [e].[Field32N], + [e].[Field64N] +FROM + [UIntTable] [e] +WHERE + [e].[Field64] = @field64 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2022.MS,Default).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2022.MS,Default).sql new file mode 100644 index 000000000000..3e8aed69202f --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2022.MS,Default).sql @@ -0,0 +1,42 @@ +-- SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2022.MS,MultipleRows).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2022.MS,MultipleRows).sql new file mode 100644 index 000000000000..3e8aed69202f --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2022.MS,MultipleRows).sql @@ -0,0 +1,42 @@ +-- SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2022.MS,ProviderSpecific).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2022.MS,ProviderSpecific).sql new file mode 100644 index 000000000000..3e8aed69202f --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2022.MS,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2022.MS,RowByRow).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2022.MS,RowByRow).sql new file mode 100644 index 000000000000..3e8aed69202f --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2022.MS,RowByRow).sql @@ -0,0 +1,42 @@ +-- SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..1ebb5efc7168 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2022.MS).sql @@ -0,0 +1,9 @@ +Parameters: +@p='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(@p) [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] > 0 +ORDER BY [p].[ProductID] + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..2de9ba673124 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2022.MS).sql @@ -0,0 +1,50 @@ +-- SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + +-- SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..a3ee59af2707 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2022.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..a3ee59af2707 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2022.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..1ea8ab425237 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2022.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2022 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..87b6a448841a --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2022.MS).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT [p].[Id] AS [PatentId], @userId0 AS [UserId] +FROM [Patents] AS [p] +LEFT JOIN [PatentAssessment] AS [p0] ON [p].[Id] = [p0].[PatentId] +WHERE [p0].[PatentId] IS NULL OR [p0].[TechnicalReviewerId] <> @userId OR [p0].[TechnicalReviewerId] IS NULL + + +-- SqlServer.2022 +DECLARE @userId Int -- Int32 +SET @userId = 1 + +SELECT + [p].[Id] +FROM + [Patents] [p] + LEFT JOIN [PatentAssessment] [a_Assessment] ON [p].[Id] = [a_Assessment].[PatentId] +WHERE + [a_Assessment].[PatentId] IS NULL OR [a_Assessment].[TechnicalReviewerId] <> @userId OR + [a_Assessment].[TechnicalReviewerId] IS NULL + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..17ed2ec55a17 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2022.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2022 + +CREATE TABLE [tempdb]..[#Issue129Table] +( + [Id] int NOT NULL IDENTITY, + [Key] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#Issue129Table] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..1f302ec06ff1 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2022.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2022 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + ( + SELECT TOP (1) + [a_Children].[IsActive] + FROM + [Children] [a_Children] + WHERE + [x].[Id] = [a_Children].[ParentId] + ) = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..493b75e16a51 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2022.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2022 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + NOT EXISTS( + SELECT + * + FROM + [Children] [y] + WHERE + [x].[Id] = [y].[ParentId] AND [y].[IsActive] = 1 + ) + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..1ea8ab425237 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2022.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2022 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..4f389a2c95ba --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2022.MS).sql @@ -0,0 +1,11 @@ +-- SqlServer.2022 + +SELECT + [x].[Id] +FROM + [Issue340Entities] [x] +WHERE + [x].[IsActive] = 1 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..0b43e0bafc24 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2022.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2022 + +SELECT + 1 +FROM + [Parents] [ua] +WHERE + [ua].[ParentId] = 55377 AND EXISTS( + SELECT + * + FROM + [Parents] [t1] + ) + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..73c52cc983f4 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2022.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2022 +DECLARE @DateTimeOffset DateTimeOffset +SET @DateTimeOffset = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) +DECLARE @DateTimeOffsetN DateTimeOffset +SET @DateTimeOffsetN = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) + +UPDATE + [Types] +SET + [DateTimeOffset] = @DateTimeOffset, + [DateTimeOffsetN] = @DateTimeOffsetN +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..4a94df867841 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2022.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2022 +DECLARE @DateTimeOffsetWithConverter BigInt -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter BigInt -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + [Types] +SET + [DateTimeOffsetWithConverter] = @DateTimeOffsetWithConverter, + [DateTimeOffsetNWithConverter] = @DateTimeOffsetNWithConverter +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..d48d14eabf47 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2022.MS).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2022 + +SELECT + [m_1].[Id], + [d_1].[Key_1], + [d_1].[SUM_1], + [d_1].[ToValue] +FROM + [Parents] [m_1] + CROSS APPLY ( + SELECT + [d].[ParentId] as [Key_1], + SUM([d].[Id]) as [SUM_1], + STRING_AGG([d].[Name], N', ') as [ToValue] + FROM + [Children] [d] + WHERE + [m_1].[Id] = [d].[ParentId] + GROUP BY + [d].[ParentId] + ) [d_1] + + + +DisposeTransaction + + +-- SqlServer.2022 + +SELECT + [c_1].[Id] +FROM + [Parents] [c_1] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..c76c9a03b301 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2022.MS).sql @@ -0,0 +1,41 @@ +-- SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + [id].[Id] +FROM + ( + SELECT TOP (@take) + [t1].[Id] + FROM + ( + SELECT + [p].[Id], + ( + SELECT + SUM([a_Tags].[Weight]) + FROM + [Issue4629Tags] [a_Tags] + WHERE + [p].[Id] = [a_Tags].[PostId] + ) as [SUM_1] + FROM + [Issue4629Posts] [p] + ) [t1] + WHERE + ( + SELECT + SUM([a_Tags_1].[Weight]) + FROM + [Issue4629Tags] [a_Tags_1] + WHERE + [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 + ) > 5 + ORDER BY + [t1].[SUM_1] + ) [id] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..596de3080e00 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2022.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2022 +DECLARE @id Int -- Int32 +SET @id = 2 + +SELECT TOP (1) + [t1].[Index_1] +FROM + ( + SELECT + [x].[Id], + ROW_NUMBER() OVER(ORDER BY [x].[Id]) as [Index_1] + FROM + [Parents] [x] + ) [t1] +WHERE + [t1].[Id] = @id + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..c58ac903a7c4 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2022.MS).sql @@ -0,0 +1,38 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2022 + +SELECT + [m_1].[Key_1], + [d].[CfAllowValue], + [d].[DateFrom] +FROM + ( + SELECT TOP (1) + [p].[AclNameId] as [Key_1] + FROM + [Issue4624Items] [p] + GROUP BY + [p].[AclNameId] + ) [m_1] + INNER JOIN [Issue4624Items] [d] ON [m_1].[Key_1] = [d].[AclNameId] +ORDER BY + [d].[DateFrom] + + + +-- SqlServer.2022 + +SELECT TOP (1) + [p].[AclNameId] +FROM + [Issue4624Items] [p] +GROUP BY + [p].[AclNameId] + + + +DisposeTransaction + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..977fff19dfb0 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2022.MS).sql @@ -0,0 +1,48 @@ +-- SqlServer.2022 (asynchronously) +DECLARE @systemId VarChar(20) -- AnsiString +SET @systemId = N'system' + +MERGE INTO [Issue4642Table2] [Target] +USING ( + SELECT + [y].[Id], + [y].[SystemId], + [y].[Timestamp] as [Timestamp_1] + FROM + [Issue4642Table1] [x] + INNER JOIN [Issue4642Table2] [y] ON [x].[Id] = [y].[Id] + WHERE + [x].[Id] IN (1) AND [y].[SystemId] = @systemId +) [Source] +( + [Id], + [SystemId], + [Timestamp_1] +) +ON ([Target].[Id] = [Source].[Id] AND [Target].[SystemId] = [Source].[SystemId]) + +WHEN MATCHED THEN +UPDATE +SET + [Timestamp] = [Source].[Timestamp_1] + +WHEN NOT MATCHED THEN +INSERT +( + [Id], + [SystemId], + [Timestamp] +) +VALUES +( + [Source].[Id], + [Source].[SystemId], + [Source].[Timestamp_1] +) +OUTPUT + $action, + INSERTED.[Id] +; + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..9e01bf37009b --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2022.MS).sql @@ -0,0 +1,4 @@ +INSERT BULK [Issue4663]() + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..efb1d90fc749 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2022.MS).sql @@ -0,0 +1,21 @@ +-- SqlServer.2022 (asynchronously) + +SELECT + [x].[Id], + [x].[IsActive], + [x].[ParentId], + [x].[Name] +FROM + [Children] [x] +WHERE + [x].[Name] LIKE N'%Test%' ESCAPE N'~' +ORDER BY + [x].[Name] + + + +SELECT [c].[Id], [c].[IsActive], [c].[Name], [c].[ParentId] +FROM [Children] AS [c] +WHERE [c].[Name] LIKE N'Test%' + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..eaf5e8f06da0 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2022.MS).sql @@ -0,0 +1,64 @@ +-- SqlServer.2022 + +CREATE TABLE [tempdb]..[#Issue4671Entity1TMP] +( + [Id] int NOT NULL IDENTITY, + [Value] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2022 + +INSERT INTO [Issue4671Entity1] +( + [Value] +) +VALUES +( + 1 +) + + + +-- SqlServer.2022 + +INSERT INTO [tempdb]..[#Issue4671Entity1TMP] +( + [Value] +) +VALUES +( + 2 +) + + + +-- SqlServer.2022 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [Issue4671Entity1] [t1] + + + +-- SqlServer.2022 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [tempdb]..[#Issue4671Entity1TMP] [t1] + + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4671Entity1TMP] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..721176b5bc5f --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2022.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..721176b5bc5f --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2022.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..721176b5bc5f --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2022.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..721176b5bc5f --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2022.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..9e73cd0124bb --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2022.MS).sql @@ -0,0 +1,18 @@ +SELECT COALESCE([i0].[Name], N'') + N'>' + [i].[Name] +FROM [Issue73Entities] AS [i] +LEFT JOIN [Issue73Entities] AS [i0] ON [i].[ParentId] = [i0].[Id] +WHERE [i].[Name] = N'Name1_3' + + +-- SqlServer.2022 + +SELECT + [a_Parent].[Name] + N'>' + [x].[Name] +FROM + [Issue73Entities] [x] + LEFT JOIN [Issue73Entities] [a_Parent] ON [x].[ParentId] = [a_Parent].[Id] +WHERE + [x].[Name] = N'Name1_3' + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..89d029e59381 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2022.MS).sql @@ -0,0 +1,27 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [IssueEnum] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Value], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Value]) +VALUES (i.[Value]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Value] +FROM + [IssueEnum] [t1] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..d5200e104725 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2022.MS).sql @@ -0,0 +1,33 @@ +-- SqlServer.2022 + +DELETE [t1] +FROM + [EventScheduleItem] [t1] + + + +Parameters: +@p0='?' (Size = 1) (DbType = Byte), @p1='?' (DbType = Guid), @p2='?' (Size = 4000), @p3='?' (Size = 4000) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [EventScheduleItem] ([CrashEnum], [GuidColumn], [JsonColumn], [NameLocalized_JSON]) +OUTPUT INSERTED.[Id] +VALUES (@p0, @p1, @p2, @p3); + + +-- SqlServer.2022 + +SELECT TOP (1) + [p].[Id], + [p].[NameLocalized_JSON], + [p].[CrashEnum], + [p].[GuidColumn], + JSON_VALUE([p].[JsonColumn], N'some') +FROM + [EventScheduleItem] [p] +WHERE + [p].[Id] < 10 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..0124f6ef516c --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2022.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] IS NOT NULL + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..95ad3e463596 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2022.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE N'%anything%' ESCAPE N'~' + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..9b0ab1e04c8a --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2022.MS).sql @@ -0,0 +1,24 @@ +-- SqlServer.2022 +DECLARE @value NVarChar(60) -- String +SET @value = N'%anything%' + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE @value ESCAPE N'~' + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..2601aaf7d466 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2022.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..830b15f009df --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2022.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..2601aaf7d466 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2022.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..830b15f009df --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2022.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..226584170b6f --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2022.MS).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId], [o3].[ProductId], [o3].[Quantity], [o1].[Quantity], [p0].[ProductName] +FROM [Orders] AS [o] +INNER JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Quantity] + FROM [Order Details] AS [o0] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [o1] ON [o].[OrderID] = [o1].[OrderID] +INNER JOIN ( + SELECT [p].[ProductID], [p].[ProductName] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +) AS [p0] ON [o1].[ProductID] = [p0].[ProductID] +LEFT JOIN ( + SELECT [o2].[OrderID] AS [OrderId], [o2].[ProductID] AS [ProductId], [o2].[Quantity] + FROM [Order Details] AS [o2] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) +) AS [o3] ON [p0].[ProductID] = [o3].[ProductId] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId] + + +BeginTransaction(RepeatableRead) + + +-- SqlServer.2022 + +SELECT + [m_1].[ProductId], + [d].[OrderID], + [d].[ProductID], + [d].[Quantity] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId] + FROM + [Orders] [e] + INNER JOIN [Order Details] [od] ON [e].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductId] = [d].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2022 + +SELECT + [a_Product].[ProductID], + [od].[OrderID], + [od].[ProductID], + [od].[Quantity], + [a_Product].[ProductName] +FROM + [Orders] [o] + INNER JOIN [Order Details] [od] ON [o].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..6334fd2224f8 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2022.MS,False).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2022 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..9b136eb6905c --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2022.MS,True).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2022 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..d36cd184f723 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2022.MS,False).sql @@ -0,0 +1,18 @@ +-- SqlServer.2022 + +DELETE [e] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..77e2a9c6bd2f --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2022.MS,True).sql @@ -0,0 +1,20 @@ +-- SqlServer.2022 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..cb7b335c615a --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2022.MS,False).sql @@ -0,0 +1,97 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..2861ca3e3667 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2022.MS,True).sql @@ -0,0 +1,108 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..84a364636750 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2022.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..1df7030c8bf1 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2022.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..84a364636750 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2022.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..1df7030c8bf1 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2022.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..812c91d81b14 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2022.MS,False).sql @@ -0,0 +1,97 @@ +-- SqlServer.2022 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2022 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +-- SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] + + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..b9f860331f9a --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2022.MS,True).sql @@ -0,0 +1,101 @@ +-- SqlServer.2022 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2022 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..440292c41f36 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2022.MS).sql @@ -0,0 +1,30 @@ +CREATE OR ALTER FUNCTION dbo.[ProcessLong] + ( + @secondsNumber int + ) + RETURNS int + AS + BEGIN + declare @startTime datetime = getutcdate() + while datediff(second, @startTime, getutcdate()) < @secondsNumber + begin + set @startTime = @startTime + end + return 1 + END + + +-- SqlServer.2022 +DECLARE @commandExecutionTime Int -- Int32 +SET @commandExecutionTime = 5 + +SELECT TOP (1) + dbo.ProcessLong(@commandExecutionTime) +FROM + [Products] [e] + + + +DROP FUNCTION IF EXISTS [dbo].[ProcessLong] + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..b2bd86f98859 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2022.MS,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..2f55c796bbd1 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2022.MS,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..2c5e31c5ee1e --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2022.MS,False).sql @@ -0,0 +1,101 @@ +-- SqlServer.2022 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2022 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] + + + +-- SqlServer.2022 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..abb360377cb6 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2022.MS,True).sql @@ -0,0 +1,105 @@ +-- SqlServer.2022 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2022 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2022 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..54136afe6f2d --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2022.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2022 (asynchronously) +DECLARE @take Int -- Int32 +SET @take = 20 + +DELETE [x] +FROM + ( + SELECT TOP (@take) + [e].[CustomerID] as [CustomerId] + FROM + [Customers] [e] + WHERE + [e].[IsDeleted] = 1 + ) [x] +WHERE + 1 = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..3d1397b68b2e --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2022.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] +WHERE + [op].[ProductID] IS NULL + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..fb11892a023a --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2022.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] AND [op].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 AND [op].[ProductID] IS NULL + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..7ba6664a71a6 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2022.MS,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..51858c018b15 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2022.MS,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [o].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..7e637e6d38c0 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2022.MS,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..74d91d75eeeb --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2022.MS,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2022.MS).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..c354e6b463a0 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2022.MS).sql @@ -0,0 +1,23 @@ +-- SqlServer.2022 + +SELECT + [p].[OrderID], + DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate])), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate]))) +FROM + [Orders] [p] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..7dc28fdc6009 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2022.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[City] IS NOT NULL + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..36d911dde948 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2022.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[City] IS NOT NULL + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..d27ca98f3f5e --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2022.MS,False).sql @@ -0,0 +1,70 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..6e07baac9428 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2022.MS,True).sql @@ -0,0 +1,74 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [d].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [p].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..c38a6cd43113 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2022.MS,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..e22e02721445 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2022.MS,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] +WHERE + [a_Territory].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..a475929c6d04 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2022.MS,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..db2b5345f7c5 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2022.MS,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] +WHERE + [d].[IsDeleted] = 0 + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..b7b3ac947f29 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2022.MS,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..b7b3ac947f29 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2022.MS,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2022 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..454d3f83b1bf --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2022.MS,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..fffe4fc1c806 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2022.MS,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [pd2].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [e_2].[IsDeleted] = 0 AND [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..e2bb4919146a --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2022.MS,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2022 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[EmployeeID] = @test + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..acbc2c0986f4 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2022.MS,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2022 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[EmployeeID] = @test + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..4fb0a28ce202 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2022.MS,False).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..a9e77f87e59a --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2022.MS,True).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[IsDeleted] = 0 AND [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..4f2978dc03d0 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2022.MS,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..7059380cd45b --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2022.MS,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..15fa58202ff0 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2022.MS,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..166c79296130 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2022.MS,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2022 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..a2c4f6aa0639 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2022.MS,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2022 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..acf40d05f2f1 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2022.MS,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2022 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransaction + + +-- SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..0630b428fe3d --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2022.MS,False).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2022 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2022 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..9a0bf3d21244 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2022.MS,True).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2022 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2022 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..de3bb736e95a --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2022.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..ee908bd88b77 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2022.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..de3bb736e95a --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2022.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..ee908bd88b77 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2022.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..6cc0084c3173 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2022.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2022 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..6cc0084c3173 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2022.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2022 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..e6bd8f88e478 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2022.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2022 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..e6bd8f88e478 --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2022.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2022 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2022.MS,False).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2022.MS,False).sql new file mode 100644 index 000000000000..39c7d48fa4ff --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2022.MS,False).sql @@ -0,0 +1,29 @@ +-- SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2022.MS,True).sql b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2022.MS,True).sql new file mode 100644 index 000000000000..2f656cd95b4b --- /dev/null +++ b/SqlServer.2022.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2022.MS,True).sql @@ -0,0 +1,29 @@ +-- SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..5f30fea76468 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.2025.MS).sql @@ -0,0 +1,164 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @Id BigInt -- Int64 +SET @Id = 1 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bc7b663d-0fde-4327-8f92-5d8cc3a11d11' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C1' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N1' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @Id BigInt -- Int64 +SET @Id = 2 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'a948600d-de21-4f74-8ac2-9516b287076e' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C2' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N2' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @Id BigInt -- Int64 +SET @Id = 3 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bd3973a5-4323-4dd8-9f4f-df9f93e2a627' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C3' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N3' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +SELECT [s].[Id], [s].[Code], [s].[IsDeleted], [s].[Name], [s].[PermanentId] +FROM [Subdivisions] AS [s] +WHERE CAST([s].[Id] AS bigint) = CAST(1 AS bigint) + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + CAST([s].[Id] AS BigInt) = 1 + + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @id BigInt -- Int64 +SET @id = 1 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] = @id + + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] IN (2, 3) + + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[PermanentId], + [t1].[Code], + [t1].[Name], + [t1].[IsDeleted] +FROM + [Subdivisions] [t1] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..81773816dd2c --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.2025.MS).sql @@ -0,0 +1,10 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [Issue261Table] [t1] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..b8dda32a9f0f --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.2025.MS).sql @@ -0,0 +1,86 @@ +-- SqlServer.2025 SqlServer.2022 + +CREATE TABLE [tempdb]..[#Issue4657TempTable1] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable1](Id, Code) + + + +-- SqlServer.2025 SqlServer.2022 + +CREATE TABLE [tempdb]..[#Issue4657TempTable2] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable2](Id, Code) + + + +-- SqlServer.2025 SqlServer.2022 + +WITH [CTE_1] ([Id], [Code]) +AS +( + SELECT + [t1].[ID], + [t1].[CODE] + FROM + [Issue4657Table] [t1] +) +MERGE INTO [CTE_1] [Target] +USING ( + SELECT + [t2].[Id], + [t2].[Code] + FROM + [tempdb]..[#Issue4657TempTable1] [t2] +) [Source] +( + [Id], + [Code] +) +ON ([Target].[Id] = [Source].[Id]) + +WHEN NOT MATCHED THEN +INSERT +( + [Code] +) +VALUES +( + [Source].[Code] +) +OUTPUT + INSERTED.[Id], + INSERTED.[Code] +INTO [tempdb]..[#Issue4657TempTable2] +( + [Id], + [Code] +) +; + + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable2] + + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable1] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..3c073d8eed0b --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.2025.MS).sql @@ -0,0 +1,5 @@ +SELECT [w].[Id], [w].[Value] +FROM [WithDuplicateProperties] AS [w] +WHERE [w].[Value] = 1 + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..97e919682b3b --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.2025.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2025 SqlServer.2022 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..511b8d6175bc --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.2025.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2025 SqlServer.2022 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#WithIdentity](Name) + + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#WithIdentity] [t1] + + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..fabd126228e1 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.2025.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (Size = 21), @p1='?' (Size = 21), @p2='?' (Size = 21), @p3='?' (Size = 21), @p4='?' (Size = 21) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [WithInheritance] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Discriminator], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Discriminator]) +VALUES (i.[Discriminator]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Discriminator], + [t1].[Id] +FROM + [WithInheritance] [t1] +WHERE + [t1].[Discriminator] IN (N'WithInheritanceA2', N'WithInheritanceA1', N'WithInheritanceA') + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..961477d49af6 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.2025.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2025 SqlServer.2022 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT ASYNC BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..97e919682b3b --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.2025.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2025 SqlServer.2022 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..50f9cab3f619 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.2025.MS).sql @@ -0,0 +1,81 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [SkipModes] ([Id], [InsertOnly]) +VALUES (@p0, @p1); + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @Id Int -- Int32 +SET @Id = 2 +DECLARE @InsertOnly Int -- Int32 +SET @InsertOnly = 2 + +INSERT INTO [SkipModes] +( + [Id], + [InsertOnly] +) +VALUES +( + @Id, + @InsertOnly +) + + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [SkipModes] SET [UpdateOnly] = @p0 +OUTPUT 1 +WHERE [Id] = @p1; + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @UpdateOnly Int -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id Int -- Int32 +SET @Id = 2 + +UPDATE + [SkipModes] +SET + [UpdateOnly] = @UpdateOnly +WHERE + [SkipModes].[Id] = @Id + + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..93bb1feb1971 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.2025.MS).sql @@ -0,0 +1,36 @@ +-- SqlServer.2025 SqlServer.2022 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2025 SqlServer.2022 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..3cd5ef48a747 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.2025.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int64), @p3='?' (DbType = Int64), @p4='?' (Precision = 20) (DbType = Decimal), @p5='?' (Precision = 20) (DbType = Decimal) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [UIntTable] ([Field16], [Field16N], [Field32], [Field32N], [Field64], [Field64N]) +OUTPUT INSERTED.[ID] +VALUES (@p0, @p1, @p2, @p3, @p4, @p5); + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) +DECLARE @field64 Decimal +SET @field64 = 5 + +SELECT TOP (1) + [e].[ID], + [e].[Field16], + [e].[Field32], + [e].[Field64], + [e].[Field16N], + [e].[Field32N], + [e].[Field64N] +FROM + [UIntTable] [e] +WHERE + [e].[Field64] = @field64 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2025.MS,Default).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2025.MS,Default).sql new file mode 100644 index 000000000000..e80328b964bd --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2025.MS,Default).sql @@ -0,0 +1,42 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2025.MS,MultipleRows).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2025.MS,MultipleRows).sql new file mode 100644 index 000000000000..e80328b964bd --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2025.MS,MultipleRows).sql @@ -0,0 +1,42 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2025.MS,ProviderSpecific).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2025.MS,ProviderSpecific).sql new file mode 100644 index 000000000000..e80328b964bd --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2025.MS,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2025.MS,RowByRow).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2025.MS,RowByRow).sql new file mode 100644 index 000000000000..e80328b964bd --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.2025.MS,RowByRow).sql @@ -0,0 +1,42 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..1ebb5efc7168 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.2025.MS).sql @@ -0,0 +1,9 @@ +Parameters: +@p='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(@p) [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] > 0 +ORDER BY [p].[ProductID] + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..3056c47eb288 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.2025.MS).sql @@ -0,0 +1,50 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..79daa7bfda71 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.2025.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..79daa7bfda71 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.2025.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..7d1cc3944651 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.2025.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..7cfc0b3911a1 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.2025.MS).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT [p].[Id] AS [PatentId], @userId0 AS [UserId] +FROM [Patents] AS [p] +LEFT JOIN [PatentAssessment] AS [p0] ON [p].[Id] = [p0].[PatentId] +WHERE [p0].[PatentId] IS NULL OR [p0].[TechnicalReviewerId] <> @userId OR [p0].[TechnicalReviewerId] IS NULL + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @userId Int -- Int32 +SET @userId = 1 + +SELECT + [p].[Id] +FROM + [Patents] [p] + LEFT JOIN [PatentAssessment] [a_Assessment] ON [p].[Id] = [a_Assessment].[PatentId] +WHERE + [a_Assessment].[PatentId] IS NULL OR [a_Assessment].[TechnicalReviewerId] <> @userId OR + [a_Assessment].[TechnicalReviewerId] IS NULL + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..0fbba2a46f1a --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.2025.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2025 SqlServer.2022 + +CREATE TABLE [tempdb]..[#Issue129Table] +( + [Id] int NOT NULL IDENTITY, + [Key] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#Issue129Table] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..f622be026878 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.2025.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + ( + SELECT TOP (1) + [a_Children].[IsActive] + FROM + [Children] [a_Children] + WHERE + [x].[Id] = [a_Children].[ParentId] + ) = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..ff8bc6649e10 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.2025.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + NOT EXISTS( + SELECT + * + FROM + [Children] [y] + WHERE + [x].[Id] = [y].[ParentId] AND [y].[IsActive] = 1 + ) + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..7d1cc3944651 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.2025.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..187749709082 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.2025.MS).sql @@ -0,0 +1,11 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [x].[Id] +FROM + [Issue340Entities] [x] +WHERE + [x].[IsActive] = 1 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..a392876c5428 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.2025.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + 1 +FROM + [Parents] [ua] +WHERE + [ua].[ParentId] = 55377 AND EXISTS( + SELECT + * + FROM + [Parents] [t1] + ) + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..387fb268b898 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.2025.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @DateTimeOffset DateTimeOffset +SET @DateTimeOffset = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) +DECLARE @DateTimeOffsetN DateTimeOffset +SET @DateTimeOffsetN = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) + +UPDATE + [Types] +SET + [DateTimeOffset] = @DateTimeOffset, + [DateTimeOffsetN] = @DateTimeOffsetN +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..da6161239bdb --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.2025.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @DateTimeOffsetWithConverter BigInt -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter BigInt -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + [Types] +SET + [DateTimeOffsetWithConverter] = @DateTimeOffsetWithConverter, + [DateTimeOffsetNWithConverter] = @DateTimeOffsetNWithConverter +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..0df0afb74323 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.2025.MS).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [m_1].[Id], + [d_1].[Key_1], + [d_1].[SUM_1], + [d_1].[ToValue] +FROM + [Parents] [m_1] + CROSS APPLY ( + SELECT + [d].[ParentId] as [Key_1], + SUM([d].[Id]) as [SUM_1], + STRING_AGG([d].[Name], N', ') as [ToValue] + FROM + [Children] [d] + WHERE + [m_1].[Id] = [d].[ParentId] + GROUP BY + [d].[ParentId] + ) [d_1] + + + +DisposeTransaction + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [c_1].[Id] +FROM + [Parents] [c_1] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..dd23c1be82f4 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.2025.MS).sql @@ -0,0 +1,41 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + [id].[Id] +FROM + ( + SELECT TOP (@take) + [t1].[Id] + FROM + ( + SELECT + [p].[Id], + ( + SELECT + SUM([a_Tags].[Weight]) + FROM + [Issue4629Tags] [a_Tags] + WHERE + [p].[Id] = [a_Tags].[PostId] + ) as [SUM_1] + FROM + [Issue4629Posts] [p] + ) [t1] + WHERE + ( + SELECT + SUM([a_Tags_1].[Weight]) + FROM + [Issue4629Tags] [a_Tags_1] + WHERE + [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 + ) > 5 + ORDER BY + [t1].[SUM_1] + ) [id] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..19f0ef9eadad --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.2025.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @id Int -- Int32 +SET @id = 2 + +SELECT TOP (1) + [t1].[Index_1] +FROM + ( + SELECT + [x].[Id], + ROW_NUMBER() OVER(ORDER BY [x].[Id]) as [Index_1] + FROM + [Parents] [x] + ) [t1] +WHERE + [t1].[Id] = @id + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..a36562b3949f --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.2025.MS).sql @@ -0,0 +1,38 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [m_1].[Key_1], + [d].[CfAllowValue], + [d].[DateFrom] +FROM + ( + SELECT TOP (1) + [p].[AclNameId] as [Key_1] + FROM + [Issue4624Items] [p] + GROUP BY + [p].[AclNameId] + ) [m_1] + INNER JOIN [Issue4624Items] [d] ON [m_1].[Key_1] = [d].[AclNameId] +ORDER BY + [d].[DateFrom] + + + +-- SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [p].[AclNameId] +FROM + [Issue4624Items] [p] +GROUP BY + [p].[AclNameId] + + + +DisposeTransaction + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..6bba2d35210b --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.2025.MS).sql @@ -0,0 +1,48 @@ +-- SqlServer.2025 SqlServer.2022 (asynchronously) +DECLARE @systemId VarChar(20) -- AnsiString +SET @systemId = N'system' + +MERGE INTO [Issue4642Table2] [Target] +USING ( + SELECT + [y].[Id], + [y].[SystemId], + [y].[Timestamp] as [Timestamp_1] + FROM + [Issue4642Table1] [x] + INNER JOIN [Issue4642Table2] [y] ON [x].[Id] = [y].[Id] + WHERE + [x].[Id] IN (1) AND [y].[SystemId] = @systemId +) [Source] +( + [Id], + [SystemId], + [Timestamp_1] +) +ON ([Target].[Id] = [Source].[Id] AND [Target].[SystemId] = [Source].[SystemId]) + +WHEN MATCHED THEN +UPDATE +SET + [Timestamp] = [Source].[Timestamp_1] + +WHEN NOT MATCHED THEN +INSERT +( + [Id], + [SystemId], + [Timestamp] +) +VALUES +( + [Source].[Id], + [Source].[SystemId], + [Source].[Timestamp_1] +) +OUTPUT + $action, + INSERTED.[Id] +; + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..9e01bf37009b --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.2025.MS).sql @@ -0,0 +1,4 @@ +INSERT BULK [Issue4663]() + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..87e7507a93f2 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.2025.MS).sql @@ -0,0 +1,21 @@ +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [x].[Id], + [x].[IsActive], + [x].[ParentId], + [x].[Name] +FROM + [Children] [x] +WHERE + [x].[Name] LIKE N'%Test%' ESCAPE N'~' +ORDER BY + [x].[Name] + + + +SELECT [c].[Id], [c].[IsActive], [c].[Name], [c].[ParentId] +FROM [Children] AS [c] +WHERE [c].[Name] LIKE N'Test%' + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..d727d935b67e --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.2025.MS).sql @@ -0,0 +1,64 @@ +-- SqlServer.2025 SqlServer.2022 + +CREATE TABLE [tempdb]..[#Issue4671Entity1TMP] +( + [Id] int NOT NULL IDENTITY, + [Value] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2025 SqlServer.2022 + +INSERT INTO [Issue4671Entity1] +( + [Value] +) +VALUES +( + 1 +) + + + +-- SqlServer.2025 SqlServer.2022 + +INSERT INTO [tempdb]..[#Issue4671Entity1TMP] +( + [Value] +) +VALUES +( + 2 +) + + + +-- SqlServer.2025 SqlServer.2022 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [Issue4671Entity1] [t1] + + + +-- SqlServer.2025 SqlServer.2022 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [tempdb]..[#Issue4671Entity1TMP] [t1] + + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4671Entity1TMP] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..8accbd506b1f --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2025.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..8accbd506b1f --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.2025.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..8accbd506b1f --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2025.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..8accbd506b1f --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.2025.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..9acea5b4b656 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.2025.MS).sql @@ -0,0 +1,18 @@ +SELECT COALESCE([i0].[Name], N'') + N'>' + [i].[Name] +FROM [Issue73Entities] AS [i] +LEFT JOIN [Issue73Entities] AS [i0] ON [i].[ParentId] = [i0].[Id] +WHERE [i].[Name] = N'Name1_3' + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [a_Parent].[Name] + N'>' + [x].[Name] +FROM + [Issue73Entities] [x] + LEFT JOIN [Issue73Entities] [a_Parent] ON [x].[ParentId] = [a_Parent].[Id] +WHERE + [x].[Name] = N'Name1_3' + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..c227b97dc114 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.2025.MS).sql @@ -0,0 +1,27 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [IssueEnum] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Value], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Value]) +VALUES (i.[Value]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Value] +FROM + [IssueEnum] [t1] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..73acd7662c74 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.2025.MS).sql @@ -0,0 +1,33 @@ +-- SqlServer.2025 SqlServer.2022 + +DELETE [t1] +FROM + [EventScheduleItem] [t1] + + + +Parameters: +@p0='?' (Size = 1) (DbType = Byte), @p1='?' (DbType = Guid), @p2='?' (Size = 4000), @p3='?' (Size = 4000) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [EventScheduleItem] ([CrashEnum], [GuidColumn], [JsonColumn], [NameLocalized_JSON]) +OUTPUT INSERTED.[Id] +VALUES (@p0, @p1, @p2, @p3); + + +-- SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [p].[Id], + [p].[NameLocalized_JSON], + [p].[CrashEnum], + [p].[GuidColumn], + JSON_VALUE([p].[JsonColumn], N'some') +FROM + [EventScheduleItem] [p] +WHERE + [p].[Id] < 10 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..68094772f53e --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.2025.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] IS NOT NULL + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..4b49d931aba6 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.2025.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE N'%anything%' ESCAPE N'~' + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..0148c4058b6e --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.2025.MS).sql @@ -0,0 +1,24 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @value NVarChar(60) -- String +SET @value = N'%anything%' + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE @value ESCAPE N'~' + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..38170fef8cf2 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.2025.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..c5b618745fa4 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.2025.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..38170fef8cf2 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.2025.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..c5b618745fa4 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.2025.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..190ba2b4e69c --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.2025.MS).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId], [o3].[ProductId], [o3].[Quantity], [o1].[Quantity], [p0].[ProductName] +FROM [Orders] AS [o] +INNER JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Quantity] + FROM [Order Details] AS [o0] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [o1] ON [o].[OrderID] = [o1].[OrderID] +INNER JOIN ( + SELECT [p].[ProductID], [p].[ProductName] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +) AS [p0] ON [o1].[ProductID] = [p0].[ProductID] +LEFT JOIN ( + SELECT [o2].[OrderID] AS [OrderId], [o2].[ProductID] AS [ProductId], [o2].[Quantity] + FROM [Order Details] AS [o2] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) +) AS [o3] ON [p0].[ProductID] = [o3].[ProductId] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId] + + +BeginTransaction(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [m_1].[ProductId], + [d].[OrderID], + [d].[ProductID], + [d].[Quantity] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId] + FROM + [Orders] [e] + INNER JOIN [Order Details] [od] ON [e].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductId] = [d].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [a_Product].[ProductID], + [od].[OrderID], + [od].[ProductID], + [od].[Quantity], + [a_Product].[ProductName] +FROM + [Orders] [o] + INNER JOIN [Order Details] [od] ON [o].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..ee9fed4270d5 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2025.MS,False).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..ebab6e563514 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.2025.MS,True).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..3054e646f811 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2025.MS,False).sql @@ -0,0 +1,18 @@ +-- SqlServer.2025 SqlServer.2022 + +DELETE [e] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..be2768713cbe --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.2025.MS,True).sql @@ -0,0 +1,20 @@ +-- SqlServer.2025 SqlServer.2022 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..eb129b7ba0b0 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2025.MS,False).sql @@ -0,0 +1,97 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..c6e5b6846911 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.2025.MS,True).sql @@ -0,0 +1,108 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..11bb8fddf73a --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2025.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..6a4f4f7b95d4 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.2025.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..11bb8fddf73a --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2025.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..6a4f4f7b95d4 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.2025.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..376e41e08e90 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2025.MS,False).sql @@ -0,0 +1,97 @@ +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] + + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..b4d9d3484282 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.2025.MS,True).sql @@ -0,0 +1,101 @@ +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..efcf4ada1fc9 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.2025.MS).sql @@ -0,0 +1,30 @@ +CREATE OR ALTER FUNCTION dbo.[ProcessLong] + ( + @secondsNumber int + ) + RETURNS int + AS + BEGIN + declare @startTime datetime = getutcdate() + while datediff(second, @startTime, getutcdate()) < @secondsNumber + begin + set @startTime = @startTime + end + return 1 + END + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @commandExecutionTime Int -- Int32 +SET @commandExecutionTime = 5 + +SELECT TOP (1) + dbo.ProcessLong(@commandExecutionTime) +FROM + [Products] [e] + + + +DROP FUNCTION IF EXISTS [dbo].[ProcessLong] + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..9c4f129ec58f --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2025.MS,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..5ee0c52aac2f --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.2025.MS,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..f0521e0090cd --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2025.MS,False).sql @@ -0,0 +1,101 @@ +-- SqlServer.2025 SqlServer.2022 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2025 SqlServer.2022 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] + + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..fb7ccdb11255 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.2025.MS,True).sql @@ -0,0 +1,105 @@ +-- SqlServer.2025 SqlServer.2022 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2025 SqlServer.2022 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..d83a27716c65 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.2025.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2025 SqlServer.2022 (asynchronously) +DECLARE @take Int -- Int32 +SET @take = 20 + +DELETE [x] +FROM + ( + SELECT TOP (@take) + [e].[CustomerID] as [CustomerId] + FROM + [Customers] [e] + WHERE + [e].[IsDeleted] = 1 + ) [x] +WHERE + 1 = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..31109948cf41 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2025.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] +WHERE + [op].[ProductID] IS NULL + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..38cf5c4613b4 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.2025.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] AND [op].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 AND [op].[ProductID] IS NULL + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..7fb4b0615416 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2025.MS,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..725a0afa751d --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.2025.MS,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [o].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..ead080da080f --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2025.MS,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..34a6e6f6a8f7 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.2025.MS,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2025.MS).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..82fd0e373c54 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.2025.MS).sql @@ -0,0 +1,23 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [p].[OrderID], + DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate])), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate]))) +FROM + [Orders] [p] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..e159266300a3 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2025.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[City] IS NOT NULL + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..98b138000623 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.2025.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[City] IS NOT NULL + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..5d25de27d03f --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2025.MS,False).sql @@ -0,0 +1,70 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..b31e404eee2a --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.2025.MS,True).sql @@ -0,0 +1,74 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [d].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [p].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..f70c44e2fb9d --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2025.MS,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..0eaecee81241 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.2025.MS,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] +WHERE + [a_Territory].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..92a60758e547 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2025.MS,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..ff7943d95de6 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.2025.MS,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] +WHERE + [d].[IsDeleted] = 0 + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..14ab898334a3 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2025.MS,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..14ab898334a3 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.2025.MS,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..42b30adacb22 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2025.MS,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..9b7167f869cd --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.2025.MS,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [pd2].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [e_2].[IsDeleted] = 0 AND [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..c59b23c89298 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2025.MS,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[EmployeeID] = @test + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..d1c67aa71d54 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.2025.MS,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2025 SqlServer.2022 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[EmployeeID] = @test + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..4ef70c30135c --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2025.MS,False).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..d88eff932427 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.2025.MS,True).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[IsDeleted] = 0 AND [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..8aa6f841a044 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2025.MS,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..63749a9b4450 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.2025.MS,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..c57934b6f759 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2025.MS,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..044e7853c499 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.2025.MS,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2025 SqlServer.2022 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..b8e866e83f17 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2025.MS,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..9a7b61b38ac6 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.2025.MS,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransaction + + +-- SqlServer.2025 SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..fb069841ec49 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2025.MS,False).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2025 SqlServer.2022 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..7d1c024fa300 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.2025.MS,True).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2025 SqlServer.2022 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2025 SqlServer.2022 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..2dfe3e35d6f6 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2025.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..627e738f6f49 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.2025.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..2dfe3e35d6f6 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2025.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..627e738f6f49 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.2025.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..54ca942bfaa0 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2025.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..54ca942bfaa0 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.2025.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2025 SqlServer.2022 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..087d83835bab --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2025.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2025 SqlServer.2022 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..087d83835bab --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.2025.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2025 SqlServer.2022 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2025.MS,False).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2025.MS,False).sql new file mode 100644 index 000000000000..5ed78f33aa5d --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2025.MS,False).sql @@ -0,0 +1,29 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2025.MS,True).sql b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2025.MS,True).sql new file mode 100644 index 000000000000..67ad3ce423f7 --- /dev/null +++ b/SqlServer.2025.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.2025.MS,True).sql @@ -0,0 +1,29 @@ +-- SqlServer.2025 SqlServer.2022 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/SqlServer.2025.MS/Tests/DataProvider/SqlServerTypeTests/Tests.DataProvider.SqlServerTypeTests.TestVectorType(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/DataProvider/SqlServerTypeTests/Tests.DataProvider.SqlServerTypeTests.TestVectorType(SqlServer.2025.MS).sql index 9a825700ac52..e4f8384ddf32 100644 --- a/SqlServer.2025.MS/Tests/DataProvider/SqlServerTypeTests/Tests.DataProvider.SqlServerTypeTests.TestVectorType(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/DataProvider/SqlServerTypeTests/Tests.DataProvider.SqlServerTypeTests.TestVectorType(SqlServer.2025.MS).sql @@ -29,7 +29,7 @@ FROM BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 -DECLARE @Column 36(16) -- Binary +DECLARE @Column Vector(16) -- Binary SET @Column = JSON_ARRAY(1.2, -1.1) DECLARE @ColumnNullable NVarChar -- String SET @ColumnNullable = NULL @@ -65,7 +65,7 @@ FROM BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 -DECLARE @p1 36(16) -- Binary +DECLARE @p1 Vector(16) -- Binary SET @p1 = JSON_ARRAY(1.2, -1.1) DECLARE @p2 NVarChar -- String SET @p2 = NULL @@ -162,7 +162,7 @@ FROM BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 -DECLARE @Column 36(16) -- Binary +DECLARE @Column Vector(16) -- Binary SET @Column = JSON_ARRAY(5.2, -3.1) DECLARE @ColumnNullable NVarChar -- String SET @ColumnNullable = NULL @@ -198,7 +198,7 @@ FROM BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 -DECLARE @p1 36(16) -- Binary +DECLARE @p1 Vector(16) -- Binary SET @p1 = JSON_ARRAY(5.2, -3.1) DECLARE @p2 NVarChar -- String SET @p2 = NULL @@ -291,9 +291,9 @@ FROM BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 -DECLARE @Column 36(16) -- Binary +DECLARE @Column Vector(16) -- Binary SET @Column = JSON_ARRAY(11.2, -4.1) -DECLARE @ColumnNullable 36(16) -- Binary +DECLARE @ColumnNullable Vector(16) -- Binary SET @ColumnNullable = JSON_ARRAY(5.2, -3.1) INSERT INTO [TypeTable`2] @@ -325,9 +325,9 @@ FROM BeforeExecute -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 -DECLARE @p1 36(16) -- Binary +DECLARE @p1 Vector(16) -- Binary SET @p1 = JSON_ARRAY(11.2, -4.1) -DECLARE @p2 36(16) -- Binary +DECLARE @p2 Vector(16) -- Binary SET @p2 = JSON_ARRAY(5.2, -3.1) INSERT INTO [TypeTable`2] diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..f4ea9cad8c0e --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.Contained.MS).sql @@ -0,0 +1,164 @@ +-- SqlServer.2019 +DECLARE @Id BigInt -- Int64 +SET @Id = 1 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bc7b663d-0fde-4327-8f92-5d8cc3a11d11' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C1' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N1' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2019 +DECLARE @Id BigInt -- Int64 +SET @Id = 2 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'a948600d-de21-4f74-8ac2-9516b287076e' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C2' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N2' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2019 +DECLARE @Id BigInt -- Int64 +SET @Id = 3 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bd3973a5-4323-4dd8-9f4f-df9f93e2a627' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C3' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N3' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +SELECT [s].[Id], [s].[Code], [s].[IsDeleted], [s].[Name], [s].[PermanentId] +FROM [Subdivisions] AS [s] +WHERE CAST([s].[Id] AS bigint) = CAST(1 AS bigint) + + +-- SqlServer.2019 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + CAST([s].[Id] AS BigInt) = 1 + + + +-- SqlServer.2019 +DECLARE @id BigInt -- Int64 +SET @id = 1 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] = @id + + + +-- SqlServer.2019 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] IN (2, 3) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[PermanentId], + [t1].[Code], + [t1].[Name], + [t1].[IsDeleted] +FROM + [Subdivisions] [t1] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..d0a2e7227562 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.Contained.MS).sql @@ -0,0 +1,10 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [Issue261Table] [t1] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..60f7d781fb04 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.Contained.MS).sql @@ -0,0 +1,86 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#Issue4657TempTable1] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable1](Id, Code) + + + +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#Issue4657TempTable2] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable2](Id, Code) + + + +-- SqlServer.2019 + +WITH [CTE_1] ([Id], [Code]) +AS +( + SELECT + [t1].[ID], + [t1].[CODE] + FROM + [Issue4657Table] [t1] +) +MERGE INTO [CTE_1] [Target] +USING ( + SELECT + [t2].[Id], + [t2].[Code] + FROM + [tempdb]..[#Issue4657TempTable1] [t2] +) [Source] +( + [Id], + [Code] +) +ON ([Target].[Id] = [Source].[Id]) + +WHEN NOT MATCHED THEN +INSERT +( + [Code] +) +VALUES +( + [Source].[Code] +) +OUTPUT + INSERTED.[Id], + INSERTED.[Code] +INTO [tempdb]..[#Issue4657TempTable2] +( + [Id], + [Code] +) +; + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable2] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable1] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..3c073d8eed0b --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.Contained.MS).sql @@ -0,0 +1,5 @@ +SELECT [w].[Id], [w].[Value] +FROM [WithDuplicateProperties] AS [w] +WHERE [w].[Value] = 1 + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..296a860d31ad --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.Contained.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..5b6a76f71f5a --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.Contained.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#WithIdentity](Name) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#WithIdentity] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..c9d2b3a570d6 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.Contained.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (Size = 21), @p1='?' (Size = 21), @p2='?' (Size = 21), @p3='?' (Size = 21), @p4='?' (Size = 21) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [WithInheritance] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Discriminator], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Discriminator]) +VALUES (i.[Discriminator]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2019 + +SELECT + [t1].[Discriminator], + [t1].[Id] +FROM + [WithInheritance] [t1] +WHERE + [t1].[Discriminator] IN (N'WithInheritanceA2', N'WithInheritanceA1', N'WithInheritanceA') + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..8150b6cb1987 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.Contained.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT ASYNC BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..296a860d31ad --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.Contained.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..edb0ac36559f --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.Contained.MS).sql @@ -0,0 +1,81 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [SkipModes] ([Id], [InsertOnly]) +VALUES (@p0, @p1); + + +-- SqlServer.2019 +DECLARE @Id Int -- Int32 +SET @Id = 2 +DECLARE @InsertOnly Int -- Int32 +SET @InsertOnly = 2 + +INSERT INTO [SkipModes] +( + [Id], + [InsertOnly] +) +VALUES +( + @Id, + @InsertOnly +) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [SkipModes] SET [UpdateOnly] = @p0 +OUTPUT 1 +WHERE [Id] = @p1; + + +-- SqlServer.2019 +DECLARE @UpdateOnly Int -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id Int -- Int32 +SET @Id = 2 + +UPDATE + [SkipModes] +SET + [UpdateOnly] = @UpdateOnly +WHERE + [SkipModes].[Id] = @Id + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..bcce43fc19e3 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.Contained.MS).sql @@ -0,0 +1,36 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..e17a48ea8525 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.Contained.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int64), @p3='?' (DbType = Int64), @p4='?' (Precision = 20) (DbType = Decimal), @p5='?' (Precision = 20) (DbType = Decimal) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [UIntTable] ([Field16], [Field16N], [Field32], [Field32N], [Field64], [Field64N]) +OUTPUT INSERTED.[ID] +VALUES (@p0, @p1, @p2, @p3, @p4, @p5); + + +-- SqlServer.2019 (asynchronously) +DECLARE @field64 Decimal +SET @field64 = 5 + +SELECT TOP (1) + [e].[ID], + [e].[Field16], + [e].[Field32], + [e].[Field64], + [e].[Field16N], + [e].[Field32N], + [e].[Field64N] +FROM + [UIntTable] [e] +WHERE + [e].[Field64] = @field64 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.Contained.MS,Default).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.Contained.MS,Default).sql new file mode 100644 index 000000000000..ef4fca5e40c2 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.Contained.MS,Default).sql @@ -0,0 +1,42 @@ +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.Contained.MS,MultipleRows).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.Contained.MS,MultipleRows).sql new file mode 100644 index 000000000000..ef4fca5e40c2 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.Contained.MS,MultipleRows).sql @@ -0,0 +1,42 @@ +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.Contained.MS,ProviderSpecific).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.Contained.MS,ProviderSpecific).sql new file mode 100644 index 000000000000..ef4fca5e40c2 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.Contained.MS,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.Contained.MS,RowByRow).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.Contained.MS,RowByRow).sql new file mode 100644 index 000000000000..ef4fca5e40c2 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.Contained.MS,RowByRow).sql @@ -0,0 +1,42 @@ +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..1ebb5efc7168 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.Contained.MS).sql @@ -0,0 +1,9 @@ +Parameters: +@p='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(@p) [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] > 0 +ORDER BY [p].[ProductID] + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..50478132b979 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.Contained.MS).sql @@ -0,0 +1,50 @@ +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..0cb1f8ea01ee --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.Contained.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..0cb1f8ea01ee --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.Contained.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..4e7e76234be0 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.Contained.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..35c6d311487d --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.Contained.MS).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT [p].[Id] AS [PatentId], @userId0 AS [UserId] +FROM [Patents] AS [p] +LEFT JOIN [PatentAssessment] AS [p0] ON [p].[Id] = [p0].[PatentId] +WHERE [p0].[PatentId] IS NULL OR [p0].[TechnicalReviewerId] <> @userId OR [p0].[TechnicalReviewerId] IS NULL + + +-- SqlServer.2019 +DECLARE @userId Int -- Int32 +SET @userId = 1 + +SELECT + [p].[Id] +FROM + [Patents] [p] + LEFT JOIN [PatentAssessment] [a_Assessment] ON [p].[Id] = [a_Assessment].[PatentId] +WHERE + [a_Assessment].[PatentId] IS NULL OR [a_Assessment].[TechnicalReviewerId] <> @userId OR + [a_Assessment].[TechnicalReviewerId] IS NULL + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..ba68e55c9a00 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.Contained.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#Issue129Table] +( + [Id] int NOT NULL IDENTITY, + [Key] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Issue129Table] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..258b0a15f3c9 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.Contained.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2019 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + ( + SELECT TOP (1) + [a_Children].[IsActive] + FROM + [Children] [a_Children] + WHERE + [x].[Id] = [a_Children].[ParentId] + ) = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..5810bc973a93 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.Contained.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2019 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + NOT EXISTS( + SELECT + * + FROM + [Children] [y] + WHERE + [x].[Id] = [y].[ParentId] AND [y].[IsActive] = 1 + ) + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..4e7e76234be0 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.Contained.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..704432ff4ed5 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.Contained.MS).sql @@ -0,0 +1,11 @@ +-- SqlServer.2019 + +SELECT + [x].[Id] +FROM + [Issue340Entities] [x] +WHERE + [x].[IsActive] = 1 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..3f1448451434 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.Contained.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2019 + +SELECT + 1 +FROM + [Parents] [ua] +WHERE + [ua].[ParentId] = 55377 AND EXISTS( + SELECT + * + FROM + [Parents] [t1] + ) + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..8566d73acf0e --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.Contained.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2019 +DECLARE @DateTimeOffset DateTimeOffset +SET @DateTimeOffset = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) +DECLARE @DateTimeOffsetN DateTimeOffset +SET @DateTimeOffsetN = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) + +UPDATE + [Types] +SET + [DateTimeOffset] = @DateTimeOffset, + [DateTimeOffsetN] = @DateTimeOffsetN +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..75454c418574 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.Contained.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2019 +DECLARE @DateTimeOffsetWithConverter BigInt -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter BigInt -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + [Types] +SET + [DateTimeOffsetWithConverter] = @DateTimeOffsetWithConverter, + [DateTimeOffsetNWithConverter] = @DateTimeOffsetNWithConverter +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..031f31d1d27a --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.Contained.MS).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[Id], + [d_1].[Key_1], + [d_1].[SUM_1], + [d_1].[ToValue] +FROM + [Parents] [m_1] + CROSS APPLY ( + SELECT + [d].[ParentId] as [Key_1], + SUM([d].[Id]) as [SUM_1], + STRING_AGG([d].[Name], N', ') as [ToValue] + FROM + [Children] [d] + WHERE + [m_1].[Id] = [d].[ParentId] + GROUP BY + [d].[ParentId] + ) [d_1] + + + +DisposeTransaction + + +-- SqlServer.2019 + +SELECT + [c_1].[Id] +FROM + [Parents] [c_1] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..7ead679a1527 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.Contained.MS).sql @@ -0,0 +1,41 @@ +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + [id].[Id] +FROM + ( + SELECT TOP (@take) + [t1].[Id] + FROM + ( + SELECT + [p].[Id], + ( + SELECT + SUM([a_Tags].[Weight]) + FROM + [Issue4629Tags] [a_Tags] + WHERE + [p].[Id] = [a_Tags].[PostId] + ) as [SUM_1] + FROM + [Issue4629Posts] [p] + ) [t1] + WHERE + ( + SELECT + SUM([a_Tags_1].[Weight]) + FROM + [Issue4629Tags] [a_Tags_1] + WHERE + [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 + ) > 5 + ORDER BY + [t1].[SUM_1] + ) [id] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..a55842bd197f --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.Contained.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2019 +DECLARE @id Int -- Int32 +SET @id = 2 + +SELECT TOP (1) + [t1].[Index_1] +FROM + ( + SELECT + [x].[Id], + ROW_NUMBER() OVER(ORDER BY [x].[Id]) as [Index_1] + FROM + [Parents] [x] + ) [t1] +WHERE + [t1].[Id] = @id + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..ba78803d30e3 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.Contained.MS).sql @@ -0,0 +1,38 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[Key_1], + [d].[CfAllowValue], + [d].[DateFrom] +FROM + ( + SELECT TOP (1) + [p].[AclNameId] as [Key_1] + FROM + [Issue4624Items] [p] + GROUP BY + [p].[AclNameId] + ) [m_1] + INNER JOIN [Issue4624Items] [d] ON [m_1].[Key_1] = [d].[AclNameId] +ORDER BY + [d].[DateFrom] + + + +-- SqlServer.2019 + +SELECT TOP (1) + [p].[AclNameId] +FROM + [Issue4624Items] [p] +GROUP BY + [p].[AclNameId] + + + +DisposeTransaction + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..edb46114590f --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.Contained.MS).sql @@ -0,0 +1,48 @@ +-- SqlServer.2019 (asynchronously) +DECLARE @systemId VarChar(20) -- AnsiString +SET @systemId = N'system' + +MERGE INTO [Issue4642Table2] [Target] +USING ( + SELECT + [y].[Id], + [y].[SystemId], + [y].[Timestamp] as [Timestamp_1] + FROM + [Issue4642Table1] [x] + INNER JOIN [Issue4642Table2] [y] ON [x].[Id] = [y].[Id] + WHERE + [x].[Id] IN (1) AND [y].[SystemId] = @systemId +) [Source] +( + [Id], + [SystemId], + [Timestamp_1] +) +ON ([Target].[Id] = [Source].[Id] AND [Target].[SystemId] = [Source].[SystemId]) + +WHEN MATCHED THEN +UPDATE +SET + [Timestamp] = [Source].[Timestamp_1] + +WHEN NOT MATCHED THEN +INSERT +( + [Id], + [SystemId], + [Timestamp] +) +VALUES +( + [Source].[Id], + [Source].[SystemId], + [Source].[Timestamp_1] +) +OUTPUT + $action, + INSERTED.[Id] +; + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..9e01bf37009b --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.Contained.MS).sql @@ -0,0 +1,4 @@ +INSERT BULK [Issue4663]() + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..64b17fdf632f --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.Contained.MS).sql @@ -0,0 +1,21 @@ +-- SqlServer.2019 (asynchronously) + +SELECT + [x].[Id], + [x].[IsActive], + [x].[ParentId], + [x].[Name] +FROM + [Children] [x] +WHERE + [x].[Name] LIKE N'%Test%' ESCAPE N'~' +ORDER BY + [x].[Name] + + + +SELECT [c].[Id], [c].[IsActive], [c].[Name], [c].[ParentId] +FROM [Children] AS [c] +WHERE [c].[Name] LIKE N'Test%' + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..28d5a6cc9614 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.Contained.MS).sql @@ -0,0 +1,64 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#Issue4671Entity1TMP] +( + [Id] int NOT NULL IDENTITY, + [Value] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2019 + +INSERT INTO [Issue4671Entity1] +( + [Value] +) +VALUES +( + 1 +) + + + +-- SqlServer.2019 + +INSERT INTO [tempdb]..[#Issue4671Entity1TMP] +( + [Value] +) +VALUES +( + 2 +) + + + +-- SqlServer.2019 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [Issue4671Entity1] [t1] + + + +-- SqlServer.2019 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [tempdb]..[#Issue4671Entity1TMP] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4671Entity1TMP] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..070587834a0d --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.Contained.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..070587834a0d --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.Contained.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..070587834a0d --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.Contained.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..070587834a0d --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.Contained.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..d073d5a4991e --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.Contained.MS).sql @@ -0,0 +1,18 @@ +SELECT COALESCE([i0].[Name], N'') + N'>' + [i].[Name] +FROM [Issue73Entities] AS [i] +LEFT JOIN [Issue73Entities] AS [i0] ON [i].[ParentId] = [i0].[Id] +WHERE [i].[Name] = N'Name1_3' + + +-- SqlServer.2019 + +SELECT + [a_Parent].[Name] + N'>' + [x].[Name] +FROM + [Issue73Entities] [x] + LEFT JOIN [Issue73Entities] [a_Parent] ON [x].[ParentId] = [a_Parent].[Id] +WHERE + [x].[Name] = N'Name1_3' + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..b54f58d48099 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.Contained.MS).sql @@ -0,0 +1,27 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [IssueEnum] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Value], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Value]) +VALUES (i.[Value]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Value] +FROM + [IssueEnum] [t1] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..34f1af64d74e --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.Contained.MS).sql @@ -0,0 +1,33 @@ +-- SqlServer.2019 + +DELETE [t1] +FROM + [EventScheduleItem] [t1] + + + +Parameters: +@p0='?' (Size = 1) (DbType = Byte), @p1='?' (DbType = Guid), @p2='?' (Size = 4000), @p3='?' (Size = 4000) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [EventScheduleItem] ([CrashEnum], [GuidColumn], [JsonColumn], [NameLocalized_JSON]) +OUTPUT INSERTED.[Id] +VALUES (@p0, @p1, @p2, @p3); + + +-- SqlServer.2019 + +SELECT TOP (1) + [p].[Id], + [p].[NameLocalized_JSON], + [p].[CrashEnum], + [p].[GuidColumn], + JSON_VALUE([p].[JsonColumn], N'some') +FROM + [EventScheduleItem] [p] +WHERE + [p].[Id] < 10 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..a24dc14a9334 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.Contained.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] IS NOT NULL + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..f7a667df571d --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.Contained.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE N'%anything%' ESCAPE N'~' + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..dab1d88abf6f --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.Contained.MS).sql @@ -0,0 +1,24 @@ +-- SqlServer.2019 +DECLARE @value NVarChar(60) -- String +SET @value = N'%anything%' + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE @value ESCAPE N'~' + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..6d12fd195a9a --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.Contained.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..ca7e93507bc9 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.Contained.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..6d12fd195a9a --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.Contained.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..ca7e93507bc9 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.Contained.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..15c8c155e669 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.Contained.MS).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId], [o3].[ProductId], [o3].[Quantity], [o1].[Quantity], [p0].[ProductName] +FROM [Orders] AS [o] +INNER JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Quantity] + FROM [Order Details] AS [o0] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [o1] ON [o].[OrderID] = [o1].[OrderID] +INNER JOIN ( + SELECT [p].[ProductID], [p].[ProductName] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +) AS [p0] ON [o1].[ProductID] = [p0].[ProductID] +LEFT JOIN ( + SELECT [o2].[OrderID] AS [OrderId], [o2].[ProductID] AS [ProductId], [o2].[Quantity] + FROM [Order Details] AS [o2] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) +) AS [o3] ON [p0].[ProductID] = [o3].[ProductId] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId] + + +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[ProductId], + [d].[OrderID], + [d].[ProductID], + [d].[Quantity] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId] + FROM + [Orders] [e] + INNER JOIN [Order Details] [od] ON [e].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductId] = [d].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2019 + +SELECT + [a_Product].[ProductID], + [od].[OrderID], + [od].[ProductID], + [od].[Quantity], + [a_Product].[ProductName] +FROM + [Orders] [o] + INNER JOIN [Order Details] [od] ON [o].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..af1623557b95 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.Contained.MS,False).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..a6417d4b7fae --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.Contained.MS,True).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..6d7ae3281c3e --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.Contained.MS,False).sql @@ -0,0 +1,18 @@ +-- SqlServer.2019 + +DELETE [e] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..4589c539a694 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.Contained.MS,True).sql @@ -0,0 +1,20 @@ +-- SqlServer.2019 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..0fef112a6a7e --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.Contained.MS,False).sql @@ -0,0 +1,97 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..d678fcc3933c --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.Contained.MS,True).sql @@ -0,0 +1,108 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..47586f0d6f35 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.Contained.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..e5bc8cb6bc3a --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.Contained.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..47586f0d6f35 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.Contained.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..e5bc8cb6bc3a --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.Contained.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..88d69d626530 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.Contained.MS,False).sql @@ -0,0 +1,97 @@ +-- SqlServer.2019 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2019 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..6ef22539e4b0 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.Contained.MS,True).sql @@ -0,0 +1,101 @@ +-- SqlServer.2019 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2019 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..6f17fedd4de3 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.Contained.MS).sql @@ -0,0 +1,30 @@ +CREATE OR ALTER FUNCTION dbo.[ProcessLong] + ( + @secondsNumber int + ) + RETURNS int + AS + BEGIN + declare @startTime datetime = getutcdate() + while datediff(second, @startTime, getutcdate()) < @secondsNumber + begin + set @startTime = @startTime + end + return 1 + END + + +-- SqlServer.2019 +DECLARE @commandExecutionTime Int -- Int32 +SET @commandExecutionTime = 5 + +SELECT TOP (1) + dbo.ProcessLong(@commandExecutionTime) +FROM + [Products] [e] + + + +DROP FUNCTION IF EXISTS [dbo].[ProcessLong] + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..817b0fe041ff --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.Contained.MS,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..8f2a09f8d6c5 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.Contained.MS,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..1cf5916f419c --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.Contained.MS,False).sql @@ -0,0 +1,101 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2019 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] + + + +-- SqlServer.2019 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..02c92ea0e231 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.Contained.MS,True).sql @@ -0,0 +1,105 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2019 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2019 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..2b11598875d3 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.Contained.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2019 (asynchronously) +DECLARE @take Int -- Int32 +SET @take = 20 + +DELETE [x] +FROM + ( + SELECT TOP (@take) + [e].[CustomerID] as [CustomerId] + FROM + [Customers] [e] + WHERE + [e].[IsDeleted] = 1 + ) [x] +WHERE + 1 = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..087247f5f6ee --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.Contained.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] +WHERE + [op].[ProductID] IS NULL + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..0c4e8ef2e001 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.Contained.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] AND [op].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 AND [op].[ProductID] IS NULL + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..fcf371b17424 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.Contained.MS,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..74a8238d140f --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.Contained.MS,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [o].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..0b67e90243ec --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.Contained.MS,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..6067ff3aa434 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.Contained.MS,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..66eaedf0de5b --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.Contained.MS).sql @@ -0,0 +1,23 @@ +-- SqlServer.2019 + +SELECT + [p].[OrderID], + DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate])), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate]))) +FROM + [Orders] [p] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..0e654888589a --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.Contained.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[City] IS NOT NULL + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..c6c846af0838 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.Contained.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[City] IS NOT NULL + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..7b93d9e58cf0 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.Contained.MS,False).sql @@ -0,0 +1,70 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..4b50b3ccfdca --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.Contained.MS,True).sql @@ -0,0 +1,74 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [d].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [p].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..1edc91305932 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.Contained.MS,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..ba76110a138c --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.Contained.MS,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] +WHERE + [a_Territory].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..5382121f2488 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.Contained.MS,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..49d8968dab3f --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.Contained.MS,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] +WHERE + [d].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..60be32753abd --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.Contained.MS,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..60be32753abd --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.Contained.MS,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..6a7a58f5cfeb --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.Contained.MS,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..7b4406a29f17 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.Contained.MS,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [pd2].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [e_2].[IsDeleted] = 0 AND [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..f6f296b4dccf --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.Contained.MS,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2019 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[EmployeeID] = @test + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..303ddd479ace --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.Contained.MS,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2019 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[EmployeeID] = @test + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..f51580716385 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.Contained.MS,False).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..2d942ca09ef4 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.Contained.MS,True).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[IsDeleted] = 0 AND [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..6862c7991309 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.Contained.MS,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..b49320353fc7 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.Contained.MS,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..83395629ef32 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.Contained.MS,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..6beacfaf2f89 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.Contained.MS,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..47e29c3042dc --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.Contained.MS,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..c658272e6a38 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.Contained.MS,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransaction + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..e2f9dc98230d --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.Contained.MS,False).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2019 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2019 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..44a866a70a51 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.Contained.MS,True).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2019 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2019 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..cea556913db9 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.Contained.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..8080c7592c12 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.Contained.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..cea556913db9 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.Contained.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..8080c7592c12 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.Contained.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..6c03cbf4db19 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.Contained.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2019 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..6c03cbf4db19 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.Contained.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2019 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..559ab88d725d --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.Contained.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2019 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..559ab88d725d --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.Contained.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2019 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.Contained.MS,False).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.Contained.MS,False).sql new file mode 100644 index 000000000000..a522f6213776 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.Contained.MS,False).sql @@ -0,0 +1,29 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.Contained.MS,True).sql b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.Contained.MS,True).sql new file mode 100644 index 000000000000..1625b2c9c8f4 --- /dev/null +++ b/SqlServer.Contained.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.Contained.MS,True).sql @@ -0,0 +1,29 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..f4ea9cad8c0e --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ConvertorTests/LinqToDB.EntityFrameworkCore.Tests.ConvertorTests.TestToList(SqlServer.SA.MS).sql @@ -0,0 +1,164 @@ +-- SqlServer.2019 +DECLARE @Id BigInt -- Int64 +SET @Id = 1 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bc7b663d-0fde-4327-8f92-5d8cc3a11d11' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C1' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N1' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2019 +DECLARE @Id BigInt -- Int64 +SET @Id = 2 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'a948600d-de21-4f74-8ac2-9516b287076e' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C2' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N2' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +-- SqlServer.2019 +DECLARE @Id BigInt -- Int64 +SET @Id = 3 +DECLARE @PermanentId UniqueIdentifier -- Guid +SET @PermanentId = 'bd3973a5-4323-4dd8-9f4f-df9f93e2a627' +DECLARE @Code NVarChar(4000) -- String +SET @Code = N'C3' +DECLARE @Name NVarChar(4000) -- String +SET @Name = N'N3' +DECLARE @IsDeleted Bit -- Boolean +SET @IsDeleted = NULL + +INSERT INTO [Subdivisions] +( + [Id], + [PermanentId], + [Code], + [Name], + [IsDeleted] +) +VALUES +( + @Id, + @PermanentId, + @Code, + @Name, + @IsDeleted +) + +SELECT SCOPE_IDENTITY() + + + +SELECT [s].[Id], [s].[Code], [s].[IsDeleted], [s].[Name], [s].[PermanentId] +FROM [Subdivisions] AS [s] +WHERE CAST([s].[Id] AS bigint) = CAST(1 AS bigint) + + +-- SqlServer.2019 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + CAST([s].[Id] AS BigInt) = 1 + + + +-- SqlServer.2019 +DECLARE @id BigInt -- Int64 +SET @id = 1 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] = @id + + + +-- SqlServer.2019 + +SELECT + [s].[Id], + [s].[PermanentId], + [s].[Code], + [s].[Name], + [s].[IsDeleted] +FROM + [Subdivisions] [s] +WHERE + [s].[Id] IN (2, 3) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[PermanentId], + [t1].[Code], + [t1].[Name], + [t1].[IsDeleted] +FROM + [Subdivisions] [t1] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..d0a2e7227562 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue261Test(SqlServer.SA.MS).sql @@ -0,0 +1,10 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [Issue261Table] [t1] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..60f7d781fb04 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/CustomContextIssueTests/LinqToDB.EntityFrameworkCore.Tests.CustomContextIssueTests.Issue4657Test(SqlServer.SA.MS).sql @@ -0,0 +1,86 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#Issue4657TempTable1] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable1](Id, Code) + + + +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#Issue4657TempTable2] +( + [Id] Int NOT NULL, + [Code] Int NOT NULL +) + + + +INSERT BULK [tempdb]..[#Issue4657TempTable2](Id, Code) + + + +-- SqlServer.2019 + +WITH [CTE_1] ([Id], [Code]) +AS +( + SELECT + [t1].[ID], + [t1].[CODE] + FROM + [Issue4657Table] [t1] +) +MERGE INTO [CTE_1] [Target] +USING ( + SELECT + [t2].[Id], + [t2].[Code] + FROM + [tempdb]..[#Issue4657TempTable1] [t2] +) [Source] +( + [Id], + [Code] +) +ON ([Target].[Id] = [Source].[Id]) + +WHEN NOT MATCHED THEN +INSERT +( + [Code] +) +VALUES +( + [Source].[Code] +) +OUTPUT + INSERTED.[Id], + INSERTED.[Code] +INTO [tempdb]..[#Issue4657TempTable2] +( + [Id], + [Code] +) +; + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable2] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4657TempTable1] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..3c073d8eed0b --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestAmbiguousProperties(SqlServer.SA.MS).sql @@ -0,0 +1,5 @@ +SELECT [w].[Id], [w].[Value] +FROM [WithDuplicateProperties] AS [w] +WHERE [w].[Value] = 1 + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..296a860d31ad --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyNoIdentity(SqlServer.SA.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..5b6a76f71f5a --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestBulkCopyWithIdentity(SqlServer.SA.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#WithIdentity](Name) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#WithIdentity] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..c9d2b3a570d6 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestInheritance(SqlServer.SA.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (Size = 21), @p1='?' (Size = 21), @p2='?' (Size = 21), @p3='?' (Size = 21), @p4='?' (Size = 21) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [WithInheritance] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Discriminator], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Discriminator]) +VALUES (i.[Discriminator]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2019 + +SELECT + [t1].[Discriminator], + [t1].[Id] +FROM + [WithInheritance] [t1] +WHERE + [t1].[Discriminator] IN (N'WithInheritanceA2', N'WithInheritanceA1', N'WithInheritanceA') + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..8150b6cb1987 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyAsyncNoIdentity(SqlServer.SA.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT ASYNC BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..296a860d31ad --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestNativeBulkCopyNoIdentity(SqlServer.SA.MS).sql @@ -0,0 +1,32 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +INSERT BULK [tempdb]..[#NoIdentity](Id, Name) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[Name] +FROM + [tempdb]..[#NoIdentity] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..edb0ac36559f --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestSkipModes(SqlServer.SA.MS).sql @@ -0,0 +1,81 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [SkipModes] ([Id], [InsertOnly]) +VALUES (@p0, @p1); + + +-- SqlServer.2019 +DECLARE @Id Int -- Int32 +SET @Id = 2 +DECLARE @InsertOnly Int -- Int32 +SET @InsertOnly = 2 + +INSERT INTO [SkipModes] +( + [Id], + [InsertOnly] +) +VALUES +( + @Id, + @InsertOnly +) + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + +Parameters: +@p1='?' (DbType = Int32), @p0='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [SkipModes] SET [UpdateOnly] = @p0 +OUTPUT 1 +WHERE [Id] = @p1; + + +-- SqlServer.2019 +DECLARE @UpdateOnly Int -- Int32 +SET @UpdateOnly = 12 +DECLARE @Id Int -- Int32 +SET @Id = 2 + +UPDATE + [SkipModes] +SET + [UpdateOnly] = @UpdateOnly +WHERE + [SkipModes].[Id] = @Id + + + +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[InsertOnly], + [t1].[UpdateOnly], + [t1].[ReadOnly] +FROM + [SkipModes] [t1] +ORDER BY + [t1].[Id] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..bcce43fc19e3 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestTableCreation(SqlServer.SA.MS).sql @@ -0,0 +1,36 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#WithIdentity] +( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#NoIdentity] +( + [Id] uniqueidentifier NOT NULL, + [Name] nvarchar(max) NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#NoIdentity] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#WithIdentity] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..e17a48ea8525 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ForMappingTests/LinqToDB.EntityFrameworkCore.Tests.ForMappingTests.TestUIntTable(SqlServer.SA.MS).sql @@ -0,0 +1,29 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int64), @p3='?' (DbType = Int64), @p4='?' (Precision = 20) (DbType = Decimal), @p5='?' (Precision = 20) (DbType = Decimal) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [UIntTable] ([Field16], [Field16N], [Field32], [Field32N], [Field64], [Field64N]) +OUTPUT INSERTED.[ID] +VALUES (@p0, @p1, @p2, @p3, @p4, @p5); + + +-- SqlServer.2019 (asynchronously) +DECLARE @field64 Decimal +SET @field64 = 5 + +SELECT TOP (1) + [e].[ID], + [e].[Field16], + [e].[Field32], + [e].[Field64], + [e].[Field16N], + [e].[Field32N], + [e].[Field64N] +FROM + [UIntTable] [e] +WHERE + [e].[Field64] = @field64 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.SA.MS,Default).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.SA.MS,Default).sql new file mode 100644 index 000000000000..ef4fca5e40c2 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.SA.MS,Default).sql @@ -0,0 +1,42 @@ +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.SA.MS,MultipleRows).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.SA.MS,MultipleRows).sql new file mode 100644 index 000000000000..ef4fca5e40c2 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.SA.MS,MultipleRows).sql @@ -0,0 +1,42 @@ +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.SA.MS,ProviderSpecific).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.SA.MS,ProviderSpecific).sql new file mode 100644 index 000000000000..ef4fca5e40c2 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.SA.MS,ProviderSpecific).sql @@ -0,0 +1,42 @@ +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.SA.MS,RowByRow).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.SA.MS,RowByRow).sql new file mode 100644 index 000000000000..ef4fca5e40c2 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InheritanceTests/LinqToDB.EntityFrameworkCore.Tests.InheritanceTests.TestInheritanceBulkCopy(SqlServer.SA.MS,RowByRow).sql @@ -0,0 +1,42 @@ +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_base' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'BlogUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +-- SqlServer.2019 +DECLARE @BlogType NVarChar(200) -- String +SET @BlogType = N'blog_rss' +DECLARE @Url NVarChar(4000) -- String +SET @Url = N'RssUrl' + +INSERT INTO [Blogs] +( + [BlogType], + [Url] +) +VALUES +( + @BlogType, + @Url +) + + + +SELECT [b].[Id], [b].[BlogType], [b].[Url] +FROM [Blogs] AS [b] + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..1ebb5efc7168 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestEfCoreSideOfComboInterceptor(SqlServer.SA.MS).sql @@ -0,0 +1,9 @@ +Parameters: +@p='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(@p) [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] > 0 +ORDER BY [p].[ProductID] + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..50478132b979 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestExplicitDataContextInterceptors(SqlServer.SA.MS).sql @@ -0,0 +1,50 @@ +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..0cb1f8ea01ee --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestInterceptors(SqlServer.SA.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..0cb1f8ea01ee --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/InterceptorTests/LinqToDB.EntityFrameworkCore.Tests.InterceptorTests.TestLinqToDBSideOfComboInterceptor(SqlServer.SA.MS).sql @@ -0,0 +1,25 @@ +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductID] > 0 +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..4e7e76234be0 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.AsNoTrackingWithIdentityResolutionHandling(SqlServer.SA.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..35c6d311487d --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue117Test(SqlServer.SA.MS).sql @@ -0,0 +1,24 @@ +Parameters: +@userId0='?' (DbType = Int32), @userId='?' (DbType = Int32) + +SELECT [p].[Id] AS [PatentId], @userId0 AS [UserId] +FROM [Patents] AS [p] +LEFT JOIN [PatentAssessment] AS [p0] ON [p].[Id] = [p0].[PatentId] +WHERE [p0].[PatentId] IS NULL OR [p0].[TechnicalReviewerId] <> @userId OR [p0].[TechnicalReviewerId] IS NULL + + +-- SqlServer.2019 +DECLARE @userId Int -- Int32 +SET @userId = 1 + +SELECT + [p].[Id] +FROM + [Patents] [p] + LEFT JOIN [PatentAssessment] [a_Assessment] ON [p].[Id] = [a_Assessment].[PatentId] +WHERE + [a_Assessment].[PatentId] IS NULL OR [a_Assessment].[TechnicalReviewerId] <> @userId OR + [a_Assessment].[TechnicalReviewerId] IS NULL + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..ba68e55c9a00 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue129Test(SqlServer.SA.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#Issue129Table] +( + [Id] int NOT NULL IDENTITY, + [Key] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Issue129Table] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..258b0a15f3c9 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test1(SqlServer.SA.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2019 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + ( + SELECT TOP (1) + [a_Children].[IsActive] + FROM + [Children] [a_Children] + WHERE + [x].[Id] = [a_Children].[ParentId] + ) = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..5810bc973a93 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue201Test2(SqlServer.SA.MS).sql @@ -0,0 +1,18 @@ +-- SqlServer.2019 + +SELECT + COUNT(*) +FROM + [Parents] [x] +WHERE + NOT EXISTS( + SELECT + * + FROM + [Children] [y] + WHERE + [x].[Id] = [y].[ParentId] AND [y].[IsActive] = 1 + ) + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..4e7e76234be0 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue321Test(SqlServer.SA.MS).sql @@ -0,0 +1,9 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id] +FROM + [Patents] [t1] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..704432ff4ed5 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue340Test(SqlServer.SA.MS).sql @@ -0,0 +1,11 @@ +-- SqlServer.2019 + +SELECT + [x].[Id] +FROM + [Issue340Entities] [x] +WHERE + [x].[IsActive] = 1 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..3f1448451434 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4570Test(SqlServer.SA.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2019 + +SELECT + 1 +FROM + [Parents] [ua] +WHERE + [ua].[ParentId] = 55377 AND EXISTS( + SELECT + * + FROM + [Parents] [t1] + ) + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..8566d73acf0e --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestDefault(SqlServer.SA.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2019 +DECLARE @DateTimeOffset DateTimeOffset +SET @DateTimeOffset = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) +DECLARE @DateTimeOffsetN DateTimeOffset +SET @DateTimeOffsetN = DATETIMEOFFSETFROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 0, 0, 7) + +UPDATE + [Types] +SET + [DateTimeOffset] = @DateTimeOffset, + [DateTimeOffsetN] = @DateTimeOffsetN +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..75454c418574 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4625TestWithConverter(SqlServer.SA.MS).sql @@ -0,0 +1,16 @@ +-- SqlServer.2019 +DECLARE @DateTimeOffsetWithConverter BigInt -- Int64 +SET @DateTimeOffsetWithConverter = 1304956839836121088 +DECLARE @DateTimeOffsetNWithConverter BigInt -- Int64 +SET @DateTimeOffsetNWithConverter = 1304956839836121088 + +UPDATE + [Types] +SET + [DateTimeOffsetWithConverter] = @DateTimeOffsetWithConverter, + [DateTimeOffsetNWithConverter] = @DateTimeOffsetNWithConverter +WHERE + [Types].[Id] = 2 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..031f31d1d27a --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4626Test2(SqlServer.SA.MS).sql @@ -0,0 +1,39 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[Id], + [d_1].[Key_1], + [d_1].[SUM_1], + [d_1].[ToValue] +FROM + [Parents] [m_1] + CROSS APPLY ( + SELECT + [d].[ParentId] as [Key_1], + SUM([d].[Id]) as [SUM_1], + STRING_AGG([d].[Name], N', ') as [ToValue] + FROM + [Children] [d] + WHERE + [m_1].[Id] = [d].[ParentId] + GROUP BY + [d].[ParentId] + ) [d_1] + + + +DisposeTransaction + + +-- SqlServer.2019 + +SELECT + [c_1].[Id] +FROM + [Parents] [c_1] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..7ead679a1527 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4629Test(SqlServer.SA.MS).sql @@ -0,0 +1,41 @@ +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 10 + +SELECT + COUNT(*) OVER(), + [id].[Id] +FROM + ( + SELECT TOP (@take) + [t1].[Id] + FROM + ( + SELECT + [p].[Id], + ( + SELECT + SUM([a_Tags].[Weight]) + FROM + [Issue4629Tags] [a_Tags] + WHERE + [p].[Id] = [a_Tags].[PostId] + ) as [SUM_1] + FROM + [Issue4629Posts] [p] + ) [t1] + WHERE + ( + SELECT + SUM([a_Tags_1].[Weight]) + FROM + [Issue4629Tags] [a_Tags_1] + WHERE + [t1].[Id] = [a_Tags_1].[PostId] AND [a_Tags_1].[Weight] > 1 + ) > 5 + ORDER BY + [t1].[SUM_1] + ) [id] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..a55842bd197f --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4630Test(SqlServer.SA.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2019 +DECLARE @id Int -- Int32 +SET @id = 2 + +SELECT TOP (1) + [t1].[Index_1] +FROM + ( + SELECT + [x].[Id], + ROW_NUMBER() OVER(ORDER BY [x].[Id]) as [Index_1] + FROM + [Parents] [x] + ) [t1] +WHERE + [t1].[Id] = @id + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..ba78803d30e3 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4638Test(SqlServer.SA.MS).sql @@ -0,0 +1,38 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[Key_1], + [d].[CfAllowValue], + [d].[DateFrom] +FROM + ( + SELECT TOP (1) + [p].[AclNameId] as [Key_1] + FROM + [Issue4624Items] [p] + GROUP BY + [p].[AclNameId] + ) [m_1] + INNER JOIN [Issue4624Items] [d] ON [m_1].[Key_1] = [d].[AclNameId] +ORDER BY + [d].[DateFrom] + + + +-- SqlServer.2019 + +SELECT TOP (1) + [p].[AclNameId] +FROM + [Issue4624Items] [p] +GROUP BY + [p].[AclNameId] + + + +DisposeTransaction + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..edb46114590f --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4642Test(SqlServer.SA.MS).sql @@ -0,0 +1,48 @@ +-- SqlServer.2019 (asynchronously) +DECLARE @systemId VarChar(20) -- AnsiString +SET @systemId = N'system' + +MERGE INTO [Issue4642Table2] [Target] +USING ( + SELECT + [y].[Id], + [y].[SystemId], + [y].[Timestamp] as [Timestamp_1] + FROM + [Issue4642Table1] [x] + INNER JOIN [Issue4642Table2] [y] ON [x].[Id] = [y].[Id] + WHERE + [x].[Id] IN (1) AND [y].[SystemId] = @systemId +) [Source] +( + [Id], + [SystemId], + [Timestamp_1] +) +ON ([Target].[Id] = [Source].[Id] AND [Target].[SystemId] = [Source].[SystemId]) + +WHEN MATCHED THEN +UPDATE +SET + [Timestamp] = [Source].[Timestamp_1] + +WHEN NOT MATCHED THEN +INSERT +( + [Id], + [SystemId], + [Timestamp] +) +VALUES +( + [Source].[Id], + [Source].[SystemId], + [Source].[Timestamp_1] +) +OUTPUT + $action, + INSERTED.[Id] +; + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..9e01bf37009b --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4663Test(SqlServer.SA.MS).sql @@ -0,0 +1,4 @@ +INSERT BULK [Issue4663]() + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..64b17fdf632f --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4669Test(SqlServer.SA.MS).sql @@ -0,0 +1,21 @@ +-- SqlServer.2019 (asynchronously) + +SELECT + [x].[Id], + [x].[IsActive], + [x].[ParentId], + [x].[Name] +FROM + [Children] [x] +WHERE + [x].[Name] LIKE N'%Test%' ESCAPE N'~' +ORDER BY + [x].[Name] + + + +SELECT [c].[Id], [c].[IsActive], [c].[Name], [c].[ParentId] +FROM [Children] AS [c] +WHERE [c].[Name] LIKE N'Test%' + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..28d5a6cc9614 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue4671Test1(SqlServer.SA.MS).sql @@ -0,0 +1,64 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#Issue4671Entity1TMP] +( + [Id] int NOT NULL IDENTITY, + [Value] int NOT NULL, + + PRIMARY KEY CLUSTERED ([Id]) +) + + + +-- SqlServer.2019 + +INSERT INTO [Issue4671Entity1] +( + [Value] +) +VALUES +( + 1 +) + + + +-- SqlServer.2019 + +INSERT INTO [tempdb]..[#Issue4671Entity1TMP] +( + [Value] +) +VALUES +( + 2 +) + + + +-- SqlServer.2019 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [Issue4671Entity1] [t1] + + + +-- SqlServer.2019 + +SELECT TOP (2) + [t1].[Id], + [t1].[Value] +FROM + [tempdb]..[#Issue4671Entity1TMP] [t1] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Issue4671Entity1TMP] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..070587834a0d --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.SA.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..070587834a0d --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestNoTracking(SqlServer.SA.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..070587834a0d --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.SA.MS,False).sql @@ -0,0 +1,12 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..070587834a0d --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue66TestWithTracking(SqlServer.SA.MS,True).sql @@ -0,0 +1,12 @@ +-- SqlServer.2019 + +SELECT + [t1].[Id], + [t1].[MasterId], + [a_Master].[Id] +FROM + [Details] [t1] + INNER JOIN [Masters] [a_Master] ON [t1].[MasterId] = [a_Master].[Id] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..d073d5a4991e --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.Issue73Test(SqlServer.SA.MS).sql @@ -0,0 +1,18 @@ +SELECT COALESCE([i0].[Name], N'') + N'>' + [i].[Name] +FROM [Issue73Entities] AS [i] +LEFT JOIN [Issue73Entities] AS [i0] ON [i].[ParentId] = [i0].[Id] +WHERE [i].[Name] = N'Name1_3' + + +-- SqlServer.2019 + +SELECT + [a_Parent].[Name] + N'>' + [x].[Name] +FROM + [Issue73Entities] [x] + LEFT JOIN [Issue73Entities] [a_Parent] ON [x].[ParentId] = [a_Parent].[Id] +WHERE + [x].[Name] = N'Name1_3' + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..b54f58d48099 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/IssueTests/LinqToDB.EntityFrameworkCore.Tests.IssueTests.IssueEnumTest(SqlServer.SA.MS).sql @@ -0,0 +1,27 @@ +Parameters: +@p0='?' (DbType = Int32), @p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p3='?' (DbType = Int32), @p4='?' (DbType = Int32) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +MERGE [IssueEnum] USING ( +VALUES (@p0, 0), +(@p1, 1), +(@p2, 2), +(@p3, 3), +(@p4, 4)) AS i ([Value], _Position) ON 1=0 +WHEN NOT MATCHED THEN +INSERT ([Value]) +VALUES (i.[Value]) +OUTPUT INSERTED.[Id], i._Position; + + +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[Id], + [t1].[Value] +FROM + [IssueEnum] [t1] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..34f1af64d74e --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/JsonConvertTests/LinqToDB.EntityFrameworkCore.Tests.JsonConvertTests.TestJsonConvert(SqlServer.SA.MS).sql @@ -0,0 +1,33 @@ +-- SqlServer.2019 + +DELETE [t1] +FROM + [EventScheduleItem] [t1] + + + +Parameters: +@p0='?' (Size = 1) (DbType = Byte), @p1='?' (DbType = Guid), @p2='?' (Size = 4000), @p3='?' (Size = 4000) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +INSERT INTO [EventScheduleItem] ([CrashEnum], [GuidColumn], [JsonColumn], [NameLocalized_JSON]) +OUTPUT INSERTED.[Id] +VALUES (@p0, @p1, @p2, @p3); + + +-- SqlServer.2019 + +SELECT TOP (1) + [p].[Id], + [p].[NameLocalized_JSON], + [p].[CrashEnum], + [p].[GuidColumn], + JSON_VALUE([p].[JsonColumn], N'some') +FROM + [EventScheduleItem] [p] +WHERE + [p].[Id] < 10 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..a24dc14a9334 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.SimpleProviderTest(SqlServer.SA.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] IS NOT NULL + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..f7a667df571d --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslation(SqlServer.SA.MS).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE N'%anything%' ESCAPE N'~' + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..dab1d88abf6f --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/PomeloMySqlTests/LinqToDB.EntityFrameworkCore.Tests.PomeloMySqlTests.TestFunctionTranslationParameter(SqlServer.SA.MS).sql @@ -0,0 +1,24 @@ +-- SqlServer.2019 +DECLARE @value NVarChar(60) -- String +SET @value = N'%anything%' + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[Address] LIKE @value ESCAPE N'~' + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..6d12fd195a9a --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated(SqlServer.SA.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..ca7e93507bc9 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlInterpolated2(SqlServer.SA.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..6d12fd195a9a --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw(SqlServer.SA.MS).sql @@ -0,0 +1,25 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] +FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 +) AS [l] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [t1].[IsDeleted], + [t1].[CategoryID], + [t1].[CategoryName], + [t1].[Description], + [t1].[Picture] +FROM + ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [t1] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..ca7e93507bc9 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.FromSqlRaw2(SqlServer.SA.MS).sql @@ -0,0 +1,31 @@ +Parameters: +p0='?' (DbType = Int32), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [l0].[CategoryID], [l0].[CategoryName], [l0].[Description], [l0].[IsDeleted], [l0].[Picture] +FROM [Categories] AS [c] +CROSS JOIN ( + SELECT [l].[CategoryID], [l].[CategoryName], [l].[Description], [l].[IsDeleted], [l].[Picture] + FROM ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = @p0 + ) AS [l] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) OR [l].[IsDeleted] = CAST(0 AS bit) +) AS [l0] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [c2].[IsDeleted], + [c2].[CategoryID], + [c2].[CategoryName], + [c2].[Description], + [c2].[Picture] +FROM + [Categories] [c1] + CROSS JOIN ( + SELECT * FROM [dbo].[Categories] WHERE CategoryId = 1 + ) [c2] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..15c8c155e669 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.NavigationProperties(SqlServer.SA.MS).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId], [o3].[ProductId], [o3].[Quantity], [o1].[Quantity], [p0].[ProductName] +FROM [Orders] AS [o] +INNER JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Quantity] + FROM [Order Details] AS [o0] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [o1] ON [o].[OrderID] = [o1].[OrderID] +INNER JOIN ( + SELECT [p].[ProductID], [p].[ProductName] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +) AS [p0] ON [o1].[ProductID] = [p0].[ProductID] +LEFT JOIN ( + SELECT [o2].[OrderID] AS [OrderId], [o2].[ProductID] AS [ProductId], [o2].[Quantity] + FROM [Order Details] AS [o2] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) OR [o2].[IsDeleted] = CAST(0 AS bit) +) AS [o3] ON [p0].[ProductID] = [o3].[ProductId] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [o1].[OrderID], [o1].[ProductID], [p0].[ProductID], [o3].[OrderId] + + +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[ProductId], + [d].[OrderID], + [d].[ProductID], + [d].[Quantity] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId] + FROM + [Orders] [e] + INNER JOIN [Order Details] [od] ON [e].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductId] = [d].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2019 + +SELECT + [a_Product].[ProductID], + [od].[OrderID], + [od].[ProductID], + [od].[Quantity], + [a_Product].[ProductName] +FROM + [Orders] [o] + INNER JOIN [Order Details] [od] ON [o].[OrderID] = [od].[OrderID] + INNER JOIN [Products] [a_Product] ON [od].[ProductID] = [a_Product].[ProductID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..af1623557b95 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.SA.MS,False).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..a6417d4b7fae --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestAsyncMethods(SqlServer.SA.MS,True).sql @@ -0,0 +1,105 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%' + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT CASE + WHEN EXISTS ( + SELECT 1 + FROM [Products] AS [p] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'%a%') THEN CAST(1 AS bit) + ELSE CAST(0 AS bit) +END + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + + + +-- SqlServer.2019 (asynchronously) + +SELECT + IIF(EXISTS( + SELECT + * + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'%a%' ESCAPE N'~' + ), 1, 0) + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..6d7ae3281c3e --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.SA.MS,False).sql @@ -0,0 +1,18 @@ +-- SqlServer.2019 + +DELETE [e] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..4589c539a694 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCallback(SqlServer.SA.MS,True).sql @@ -0,0 +1,20 @@ +-- SqlServer.2019 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' AND + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..0fef112a6a7e --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.SA.MS,False).sql @@ -0,0 +1,97 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..d678fcc3933c --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTracker(SqlServer.SA.MS,True).sql @@ -0,0 +1,108 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@p1='?' (DbType = Int32), @p2='?' (DbType = Int32), @p0='?' (DbType = Currency) + +SET IMPLICIT_TRANSACTIONS OFF; +SET NOCOUNT ON; +UPDATE [Order Details] SET [UnitPrice] = @p0 +OUTPUT 1 +WHERE [OrderID] = @p1 AND [ProductID] = @p2; + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..47586f0d6f35 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.SA.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..e5bc8cb6bc3a --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled1(SqlServer.SA.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..47586f0d6f35 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.SA.MS,False).sql @@ -0,0 +1,87 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..e5bc8cb6bc3a --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerDisabled2(SqlServer.SA.MS,True).sql @@ -0,0 +1,98 @@ +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..88d69d626530 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.SA.MS,False).sql @@ -0,0 +1,97 @@ +-- SqlServer.2019 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2019 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..6ef22539e4b0 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestChangeTrackerTemporaryTable(SqlServer.SA.MS,True).sql @@ -0,0 +1,101 @@ +-- SqlServer.2019 (asynchronously) + +CREATE TABLE [tempdb]..[#Orders] +( + [IsDeleted] bit NOT NULL, + [OrderID] int NOT NULL, + [CustomerID] nvarchar(5) NULL, + [EmployeeID] int NULL, + [OrderDate] datetime NULL, + [RequiredDate] datetime NULL, + [ShippedDate] datetime NULL, + [ShipVia] int NULL, + [Freight] money NULL, + [ShipName] nvarchar(40) NULL, + [ShipAddress] nvarchar(60) NULL, + [ShipCity] nvarchar(15) NULL, + [ShipRegion] nvarchar(15) NULL, + [ShipPostalCode] nvarchar(10) NULL, + [ShipCountry] nvarchar(15) NULL, + + PRIMARY KEY CLUSTERED ([OrderID]) +) + + + +-- SqlServer.2019 (asynchronously) + +INSERT INTO [tempdb]..[#Orders] +( + [IsDeleted], + [OrderID], + [CustomerID], + [EmployeeID], + [OrderDate], + [RequiredDate], + [ShippedDate], + [ShipVia], + [Freight], + [ShipName], + [ShipAddress], + [ShipCity], + [ShipRegion], + [ShipPostalCode], + [ShipCountry] +) +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2019 +DECLARE @take Int -- Int32 +SET @take = 2 + +SELECT TOP (@take) + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [tempdb]..[#Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#Orders] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..6f17fedd4de3 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCommandTimeout(SqlServer.SA.MS).sql @@ -0,0 +1,30 @@ +CREATE OR ALTER FUNCTION dbo.[ProcessLong] + ( + @secondsNumber int + ) + RETURNS int + AS + BEGIN + declare @startTime datetime = getutcdate() + while datediff(second, @startTime, getutcdate()) < @secondsNumber + begin + set @startTime = @startTime + end + return 1 + END + + +-- SqlServer.2019 +DECLARE @commandExecutionTime Int -- Int32 +SET @commandExecutionTime = 5 + +SELECT TOP (1) + dbo.ProcessLong(@commandExecutionTime) +FROM + [Products] [e] + + + +DROP FUNCTION IF EXISTS [dbo].[ProcessLong] + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..817b0fe041ff --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.SA.MS,False).sql @@ -0,0 +1,111 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..8f2a09f8d6c5 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestContinuousQueries(SqlServer.SA.MS,True).sql @@ -0,0 +1,122 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder], [s].[OrderID0], [s].[ProductID1], [s].[Discount0], [s].[IsDeleted1], [s].[Quantity0], [s].[UnitPrice1] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder], [o2].[OrderID] AS [OrderID0], [o2].[ProductID] AS [ProductID1], [o2].[Discount] AS [Discount0], [o2].[IsDeleted] AS [IsDeleted1], [o2].[Quantity] AS [Quantity0], [o2].[UnitPrice] AS [UnitPrice1] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + LEFT JOIN ( + SELECT [o1].[OrderID], [o1].[ProductID], [o1].[Discount], [o1].[IsDeleted], [o1].[Quantity], [o1].[UnitPrice] + FROM [Order Details] AS [o1] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) OR [o1].[IsDeleted] = CAST(0 AS bit) + ) AS [o2] ON [p0].[ProductID] = [o2].[ProductID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [s].[OrderID], [s].[ProductID], [s].[ProductID0], [s].[OrderID0] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductId], + [m_1].[OrderId], + [d_1].[IsDeleted], + [d_1].[OrderID], + [d_1].[ProductID], + [d_1].[UnitPrice], + [d_1].[Quantity], + [d_1].[Discount] +FROM + ( + SELECT DISTINCT + [a_Product].[ProductID] as [ProductId], + [t1].[OrderId] + FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d_1] ON [m_1].[ProductId] = [d_1].[ProductID] +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..1cf5916f419c --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.SA.MS,False).sql @@ -0,0 +1,101 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2019 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] + + + +-- SqlServer.2019 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..02c92ea0e231 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestCreateTempTable(SqlServer.SA.MS,True).sql @@ -0,0 +1,105 @@ +-- SqlServer.2019 + +CREATE TABLE [tempdb]..[#TestEmployees] +( + [IsDeleted] bit NOT NULL, + [EmployeeID] int NOT NULL, + [LastName] nvarchar(20) NOT NULL, + [FirstName] nvarchar(10) NOT NULL, + [Title] nvarchar(30) NULL, + [TitleOfCourtesy] nvarchar(25) NULL, + [BirthDate] datetime NULL, + [HireDate] datetime NULL, + [Address] nvarchar(60) NULL, + [City] nvarchar(15) NULL, + [Region] nvarchar(15) NULL, + [PostalCode] nvarchar(10) NULL, + [Country] nvarchar(15) NULL, + [HomePhone] nvarchar(24) NULL, + [Extension] nvarchar(4) NULL, + [Photo] varbinary(max) NULL, + [Notes] nvarchar(max) NULL, + [ReportsTo] int NULL, + [PhotoPath] nvarchar(255) NULL, + + PRIMARY KEY CLUSTERED ([EmployeeID]) +) + + + +-- SqlServer.2019 + +INSERT INTO [tempdb]..[#TestEmployees] +( + [IsDeleted], + [EmployeeID], + [LastName], + [FirstName], + [Title], + [TitleOfCourtesy], + [BirthDate], + [HireDate], + [Address], + [City], + [Region], + [PostalCode], + [Country], + [HomePhone], + [Extension], + [Photo], + [Notes], + [ReportsTo], + [PhotoPath] +) +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +-- SqlServer.2019 + +SELECT + COUNT(*) +FROM + [tempdb]..[#TestEmployees] [e] +WHERE + [e].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT COUNT(*) +FROM [Employees] AS [e] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +DROP TABLE IF EXISTS [tempdb]..[#TestEmployees] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..2b11598875d3 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDeleteFrom(SqlServer.SA.MS).sql @@ -0,0 +1,19 @@ +-- SqlServer.2019 (asynchronously) +DECLARE @take Int -- Int32 +SET @take = 20 + +DELETE [x] +FROM + ( + SELECT TOP (@take) + [e].[CustomerID] as [CustomerId] + FROM + [Customers] [e] + WHERE + [e].[IsDeleted] = 1 + ) [x] +WHERE + 1 = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..087247f5f6ee --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.SA.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] +WHERE + [op].[ProductID] IS NULL + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..0c4e8ef2e001 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestDemo2(SqlServer.SA.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] + LEFT JOIN [Products] [op] ON [op].[ProductID] <> [e].[ProductID] AND [op].[ProductName] = [e].[ProductName] AND [op].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 AND [op].[ProductID] IS NULL + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..fcf371b17424 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.SA.MS,False).sql @@ -0,0 +1,126 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..74a8238d140f --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestEager(SqlServer.SA.MS,True).sql @@ -0,0 +1,136 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [o].[OrderID], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [e_1].[IsDeleted], + [e_1].[TerritoryID], + [e_1].[TerritoryDescription], + [e_1].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [e_1] ON [d].[TerritoryID] = [e_1].[TerritoryID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [e_1].[IsDeleted], + [e_1].[ProductID], + [e_1].[ProductName], + [e_1].[SupplierID], + [e_1].[CategoryID], + [e_1].[QuantityPerUnit], + [e_1].[UnitPrice], + [e_1].[UnitsInStock], + [e_1].[UnitsOnOrder], + [e_1].[ReorderLevel], + [e_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [e_1] ON [d].[ProductID] = [e_1].[ProductID] +WHERE + [e_1].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath], + [o].[OrderID] +FROM + [Orders] [o] + LEFT JOIN [Employees] [a_Employee] ON [o].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [o].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..0b67e90243ec --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.SA.MS,False).sql @@ -0,0 +1,60 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..6067ff3aa434 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestForeignKey(SqlServer.SA.MS,True).sql @@ -0,0 +1,62 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.SA.MS).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..66eaedf0de5b --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestFunctions(SqlServer.SA.MS).sql @@ -0,0 +1,23 @@ +-- SqlServer.2019 + +SELECT + [p].[OrderID], + DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(year, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(month, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(day, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(hour, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(minute, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate]), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(second, [p].[ShippedDate], [p].[OrderDate])), + DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate])), + IIF([p].[OrderDate] IS NULL, NULL, DATEDIFF(millisecond, [p].[ShippedDate], DateAdd(millisecond, 100, [p].[ShippedDate]))) +FROM + [Orders] [p] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..0e654888589a --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.SA.MS,False).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[City] IS NOT NULL + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..c6c846af0838 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGetTable(SqlServer.SA.MS,True).sql @@ -0,0 +1,22 @@ +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[CustomerID], + [e].[CompanyName], + [e].[ContactName], + [e].[ContactTitle], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[Phone], + [e].[Fax] +FROM + [Customers] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[City] IS NOT NULL + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..7b93d9e58cf0 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.SA.MS,False).sql @@ -0,0 +1,70 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..4b50b3ccfdca --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestGlobalQueryFilters(SqlServer.SA.MS,True).sql @@ -0,0 +1,74 @@ +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN [Order Details] AS [o] ON [p].[ProductID] = [o].[ProductID] + + +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [d].[IsDeleted] = 0 + + + +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice] +FROM [Products] AS [p] +INNER JOIN ( + SELECT [o].[OrderID], [o].[ProductID], [o].[Discount], [o].[IsDeleted], [o].[Quantity], [o].[UnitPrice] + FROM [Order Details] AS [o] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [o0] ON [p].[ProductID] = [o0].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount] +FROM + [Products] [p] + INNER JOIN [Order Details] [d] ON [p].[ProductID] = [d].[ProductID] +WHERE + [p].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..1edc91305932 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.SA.MS,False).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..ba76110a138c --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestInclude(SqlServer.SA.MS,True).sql @@ -0,0 +1,150 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p10='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [s].[EmployeeID], [s].[TerritoryID], [s].[IsDeleted], [s].[TerritoryID0], [s].[IsDeleted0], [s].[RegionID], [s].[TerritoryDescription], [s0].[OrderID], [s0].[ProductID], [s0].[Discount], [s0].[IsDeleted], [s0].[Quantity], [s0].[UnitPrice], [s0].[ProductID0], [s0].[CategoryID], [s0].[Discontinued], [s0].[IsDeleted0], [s0].[PeriodEnd], [s0].[PeriodStart], [s0].[ProductName], [s0].[QuantityPerUnit], [s0].[ReorderLevel], [s0].[SupplierID], [s0].[UnitPrice0], [s0].[UnitsInStock], [s0].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted], [t0].[TerritoryID] AS [TerritoryID0], [t0].[IsDeleted] AS [IsDeleted0], [t0].[RegionID], [t0].[TerritoryDescription] + FROM [EmployeeTerritories] AS [e1] + INNER JOIN ( + SELECT [t].[TerritoryID], [t].[IsDeleted], [t].[RegionID], [t].[TerritoryDescription] + FROM [Territories] AS [t] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) OR [t].[IsDeleted] = CAST(0 AS bit) + ) AS [t0] ON [e1].[TerritoryID] = [t0].[TerritoryID] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [e0].[EmployeeID] = [s].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p10 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s0] ON [o].[OrderID] = [s0].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [s].[EmployeeID], [s].[TerritoryID], [s].[TerritoryID0], [s0].[OrderID], [s0].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID], + [a_Territory].[IsDeleted], + [a_Territory].[TerritoryID], + [a_Territory].[TerritoryDescription], + [a_Territory].[RegionID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + INNER JOIN [Territories] [a_Territory] ON [d].[TerritoryID] = [a_Territory].[TerritoryID] +WHERE + [a_Territory].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..5382121f2488 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.SA.MS,False).sql @@ -0,0 +1,130 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..49d8968dab3f --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestIncludeString(SqlServer.SA.MS,True).sql @@ -0,0 +1,140 @@ +Parameters: +@ef_filter__p2='?' (DbType = Boolean), @ef_filter__p4='?' (DbType = Boolean), @ef_filter__p8='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean) + +SELECT [o].[OrderID], [o].[CustomerID], [o].[EmployeeID], [o].[Freight], [o].[IsDeleted], [o].[OrderDate], [o].[RequiredDate], [o].[ShipAddress], [o].[ShipCity], [o].[ShipCountry], [o].[ShipName], [o].[ShipPostalCode], [o].[ShipRegion], [o].[ShipVia], [o].[ShippedDate], [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy], [e2].[EmployeeID], [e2].[TerritoryID], [e2].[IsDeleted], [s].[OrderID], [s].[ProductID], [s].[Discount], [s].[IsDeleted], [s].[Quantity], [s].[UnitPrice], [s].[ProductID0], [s].[CategoryID], [s].[Discontinued], [s].[IsDeleted0], [s].[PeriodEnd], [s].[PeriodStart], [s].[ProductName], [s].[QuantityPerUnit], [s].[ReorderLevel], [s].[SupplierID], [s].[UnitPrice0], [s].[UnitsInStock], [s].[UnitsOnOrder] +FROM [Orders] AS [o] +LEFT JOIN ( + SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] + FROM [Employees] AS [e] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) +) AS [e0] ON [o].[EmployeeID] = [e0].[EmployeeID] +LEFT JOIN ( + SELECT [e1].[EmployeeID], [e1].[TerritoryID], [e1].[IsDeleted] + FROM [EmployeeTerritories] AS [e1] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) OR [e1].[IsDeleted] = CAST(0 AS bit) +) AS [e2] ON [e0].[EmployeeID] = [e2].[EmployeeID] +LEFT JOIN ( + SELECT [o0].[OrderID], [o0].[ProductID], [o0].[Discount], [o0].[IsDeleted], [o0].[Quantity], [o0].[UnitPrice], [p0].[ProductID] AS [ProductID0], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted] AS [IsDeleted0], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice] AS [UnitPrice0], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Order Details] AS [o0] + INNER JOIN ( + SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder] + FROM [Products] AS [p] + WHERE @ef_filter__p8 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + ) AS [p0] ON [o0].[ProductID] = [p0].[ProductID] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) +) AS [s] ON [o].[OrderID] = [s].[OrderID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +ORDER BY [o].[OrderID], [e0].[EmployeeID], [e2].[EmployeeID], [e2].[TerritoryID], [s].[OrderID], [s].[ProductID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[EmployeeId], + [d].[IsDeleted], + [d].[EmployeeID], + [d].[TerritoryID] +FROM + ( + SELECT DISTINCT + [a_Employee].[EmployeeID] as [EmployeeId] + FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [EmployeeTerritories] [d] ON [m_1].[EmployeeId] = [d].[EmployeeID] +WHERE + [d].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[OrderId], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + ( + SELECT DISTINCT + [e].[OrderID] as [OrderId] + FROM + [Orders] [e] + WHERE + [e].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderId] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [a_Product].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Employee].[IsDeleted], + [a_Employee].[EmployeeID], + [a_Employee].[LastName], + [a_Employee].[FirstName], + [a_Employee].[Title], + [a_Employee].[TitleOfCourtesy], + [a_Employee].[BirthDate], + [a_Employee].[HireDate], + [a_Employee].[Address], + [a_Employee].[City], + [a_Employee].[Region], + [a_Employee].[PostalCode], + [a_Employee].[Country], + [a_Employee].[HomePhone], + [a_Employee].[Extension], + [a_Employee].[Photo], + [a_Employee].[Notes], + [a_Employee].[ReportsTo], + [a_Employee].[PhotoPath] +FROM + [Orders] [e] + LEFT JOIN [Employees] [a_Employee] ON [e].[EmployeeID] = [a_Employee].[EmployeeID] AND [a_Employee].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..60be32753abd --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.SA.MS,False).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..60be32753abd --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestLoadFilter(SqlServer.SA.MS,True).sql @@ -0,0 +1,127 @@ +Parameters: +@ef_filter__p4='?' (DbType = Boolean), @ef_filter__p0='?' (DbType = Boolean), @ef_filter__p6='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductName], [p].[ProductID], [s1].[Discount], [s1].[OrderID], [s1].[CustomerID], [s1].[EmployeeID], [s1].[Freight], [s1].[IsDeleted], [s1].[OrderDate], [s1].[RequiredDate], [s1].[ShipAddress], [s1].[ShipCity], [s1].[ShipCountry], [s1].[ShipName], [s1].[ShipPostalCode], [s1].[ShipRegion], [s1].[ShipVia], [s1].[ShippedDate], [s1].[OrderID0], [s1].[ProductID], [s1].[ProductID0], [s1].[SupplierID], [s1].[ProductID1], [s1].[CategoryID], [s1].[Discontinued], [s1].[IsDeleted0], [s1].[PeriodEnd], [s1].[PeriodStart], [s1].[ProductName], [s1].[QuantityPerUnit], [s1].[ReorderLevel], [s1].[SupplierID0], [s1].[UnitPrice], [s1].[UnitsInStock], [s1].[UnitsOnOrder] +FROM [Products] AS [p] +LEFT JOIN ( + SELECT [o].[Discount], [o1].[OrderID], [o1].[CustomerID], [o1].[EmployeeID], [o1].[Freight], [o1].[IsDeleted], [o1].[OrderDate], [o1].[RequiredDate], [o1].[ShipAddress], [o1].[ShipCity], [o1].[ShipCountry], [o1].[ShipName], [o1].[ShipPostalCode], [o1].[ShipRegion], [o1].[ShipVia], [o1].[ShippedDate], [o].[OrderID] AS [OrderID0], [o].[ProductID], [p1].[ProductID] AS [ProductID0], [s0].[SupplierID], [p3].[ProductID] AS [ProductID1], [p3].[CategoryID], [p3].[Discontinued], [p3].[IsDeleted] AS [IsDeleted0], [p3].[PeriodEnd], [p3].[PeriodStart], [p3].[ProductName], [p3].[QuantityPerUnit], [p3].[ReorderLevel], [p3].[SupplierID] AS [SupplierID0], [p3].[UnitPrice], [p3].[UnitsInStock], [p3].[UnitsOnOrder] + FROM [Order Details] AS [o] + INNER JOIN ( + SELECT [o0].[OrderID], [o0].[CustomerID], [o0].[EmployeeID], [o0].[Freight], [o0].[IsDeleted], [o0].[OrderDate], [o0].[RequiredDate], [o0].[ShipAddress], [o0].[ShipCity], [o0].[ShipCountry], [o0].[ShipName], [o0].[ShipPostalCode], [o0].[ShipRegion], [o0].[ShipVia], [o0].[ShippedDate] + FROM [Orders] AS [o0] + WHERE @ef_filter__p4 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) + ) AS [o1] ON [o].[OrderID] = [o1].[OrderID] + INNER JOIN ( + SELECT [p0].[ProductID], [p0].[SupplierID] + FROM [Products] AS [p0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) + ) AS [p1] ON [o].[ProductID] = [p1].[ProductID] + LEFT JOIN ( + SELECT [s].[SupplierID] + FROM [Suppliers] AS [s] + WHERE @ef_filter__p6 = CAST(1 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) OR [s].[IsDeleted] = CAST(0 AS bit) + ) AS [s0] ON [p1].[SupplierID] = [s0].[SupplierID] + LEFT JOIN ( + SELECT [p2].[ProductID], [p2].[CategoryID], [p2].[Discontinued], [p2].[IsDeleted], [p2].[PeriodEnd], [p2].[PeriodStart], [p2].[ProductName], [p2].[QuantityPerUnit], [p2].[ReorderLevel], [p2].[SupplierID], [p2].[UnitPrice], [p2].[UnitsInStock], [p2].[UnitsOnOrder] + FROM [Products] AS [p2] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) OR [p2].[IsDeleted] = CAST(0 AS bit) + ) AS [p3] ON [s0].[SupplierID] = [p3].[SupplierID] + WHERE @ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) +) AS [s1] ON [p].[ProductID] = [s1].[ProductID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) +ORDER BY [p].[ProductID], [s1].[OrderID0], [s1].[ProductID], [s1].[OrderID], [s1].[ProductID0], [s1].[SupplierID] + + +BeginTransactionAsync(RepeatableRead) + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[SupplierId], + [m_1].[ProductId], + [d_1].[IsDeleted], + [d_1].[ProductID], + [d_1].[ProductName], + [d_1].[SupplierID], + [d_1].[CategoryID], + [d_1].[QuantityPerUnit], + [d_1].[UnitPrice], + [d_1].[UnitsInStock], + [d_1].[UnitsOnOrder], + [d_1].[ReorderLevel], + [d_1].[Discontinued] +FROM + ( + SELECT DISTINCT + [a_Supplier].[SupplierID] as [SupplierId], + [t1].[ProductId] + FROM + ( + SELECT DISTINCT + [e].[ProductID] as [ProductId] + FROM + [Products] [e] + WHERE + [e].[IsDeleted] = 0 + ) [t1] + INNER JOIN [Order Details] [d] ON [t1].[ProductId] = [d].[ProductID] + INNER JOIN [Orders] [e_1] ON [d].[OrderID] = [e_1].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + LEFT JOIN [Suppliers] [a_Supplier] ON [a_Product].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 + WHERE + [e_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + ) [m_1] + INNER JOIN [Products] [d_1] ON [m_1].[SupplierId] = [d_1].[SupplierID] OR [m_1].[SupplierId] IS NULL AND [d_1].[SupplierID] IS NULL +WHERE + [d_1].[IsDeleted] = 0 + + + +-- SqlServer.2019 (asynchronously) + +SELECT + [m_1].[ProductID], + [d].[Discount], + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry], + [a_Supplier].[SupplierID] +FROM + [Products] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[ProductID] = [d].[ProductID] + INNER JOIN [Orders] [e] ON [d].[OrderID] = [e].[OrderID] + LEFT JOIN [Suppliers] [a_Supplier] ON [m_1].[SupplierID] = [a_Supplier].[SupplierID] AND [a_Supplier].[IsDeleted] = 0 +WHERE + [m_1].[IsDeleted] = 0 AND [e].[IsDeleted] = 0 AND [d].[IsDeleted] = 0 + + + +DisposeTransactionAsync + + +-- SqlServer.2019 (asynchronously) + +SELECT + [p].[ProductName], + [p].[ProductID] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..6a7a58f5cfeb --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.SA.MS,False).sql @@ -0,0 +1,71 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..7b4406a29f17 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNestingFunctions(SqlServer.SA.MS,True).sql @@ -0,0 +1,73 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @ef_filter__p2='?' (DbType = Boolean) + +SELECT [p].[ProductID], [p].[CategoryID], [p].[Discontinued], [p].[IsDeleted], [p].[PeriodEnd], [p].[PeriodStart], [p].[ProductName], [p].[QuantityPerUnit], [p].[ReorderLevel], [p].[SupplierID], [p].[UnitPrice], [p].[UnitsInStock], [p].[UnitsOnOrder], [p1].[ProductID], [p1].[CategoryID], [p1].[Discontinued], [p1].[IsDeleted], [p1].[PeriodEnd], [p1].[PeriodStart], [p1].[ProductName], [p1].[QuantityPerUnit], [p1].[ReorderLevel], [p1].[SupplierID], [p1].[UnitPrice], [p1].[UnitsInStock], [p1].[UnitsOnOrder] +FROM [Products] AS [p] +CROSS JOIN ( + SELECT [p0].[ProductID], [p0].[CategoryID], [p0].[Discontinued], [p0].[IsDeleted], [p0].[PeriodEnd], [p0].[PeriodStart], [p0].[ProductName], [p0].[QuantityPerUnit], [p0].[ReorderLevel], [p0].[SupplierID], [p0].[UnitPrice], [p0].[UnitsInStock], [p0].[UnitsOnOrder] + FROM [Products] AS [p0] + WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit) OR [p0].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o0] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit) OR [o0].[IsDeleted] = CAST(0 AS bit)) AND [p0].[ProductID] = [o0].[ProductID]) +) AS [p1] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND EXISTS ( + SELECT 1 + FROM [Order Details] AS [o] + WHERE (@ef_filter__p2 = CAST(1 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit) OR [o].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductID] = [o].[ProductID]) AND [p].[ProductID] = [p1].[ProductID] +ORDER BY [p].[ProductID] + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued], + [pd2].[IsDeleted], + [pd2].[ProductID], + [pd2].[ProductName], + [pd2].[SupplierID], + [pd2].[CategoryID], + [pd2].[QuantityPerUnit], + [pd2].[UnitPrice], + [pd2].[UnitsInStock], + [pd2].[UnitsOnOrder], + [pd2].[ReorderLevel], + [pd2].[Discontinued] +FROM + [Products] [e], + [Products] [pd2] +WHERE + [e].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [pd2].[IsDeleted] = 0 AND + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_2] + WHERE + [e_2].[IsDeleted] = 0 AND [pd2].[ProductID] = [e_2].[ProductID] + ) > 0 AND + [e].[ProductID] = [pd2].[ProductID] +ORDER BY + [e].[ProductID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..f6f296b4dccf --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.SA.MS,False).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2019 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[EmployeeID] = @test + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..303ddd479ace --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestNullability(SqlServer.SA.MS,True).sql @@ -0,0 +1,39 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean), @test='?' (DbType = Int32) + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy] +FROM [Employees] AS [e] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit)) AND [e].[EmployeeID] = @test + + +-- SqlServer.2019 +DECLARE @test Int -- Int32 +SET @test = 1 + +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath] +FROM + [Employees] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[EmployeeID] = @test + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..f51580716385 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.SA.MS,False).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..2d942ca09ef4 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestSetUpdate(SqlServer.SA.MS,True).sql @@ -0,0 +1,23 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT TOP(1) [c].[CustomerID], [c].[Address], [c].[City], [c].[CompanyName], [c].[ContactName], [c].[ContactTitle], [c].[Country], [c].[Fax], [c].[IsDeleted], [c].[Phone], [c].[PostalCode], [c].[Region] +FROM [Customers] AS [c] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) OR [c].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 (asynchronously) +DECLARE @CompanyName NVarChar(40) -- String +SET @CompanyName = N'Alfreds Futterkiste' +DECLARE @CustomerId NVarChar(5) -- String +SET @CustomerId = N'ALFKI' + +UPDATE + [Customers] +SET + [CompanyName] = @CompanyName +WHERE + [Customers].[IsDeleted] = 0 AND [Customers].[CustomerID] = @CustomerId + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..6862c7991309 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.SA.MS,False).sql @@ -0,0 +1,17 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..b49320353fc7 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestShadowProperty(SqlServer.SA.MS,True).sql @@ -0,0 +1,19 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT [p].[QuantityPerUnit] AS [Quantity] +FROM [Products] AS [p] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +SELECT + [p].[QuantityPerUnit] +FROM + [Products] [p] +WHERE + [p].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..83395629ef32 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.SA.MS,False).sql @@ -0,0 +1,63 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..6beacfaf2f89 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTagWith(SqlServer.SA.MS,True).sql @@ -0,0 +1,65 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +-- Tagged query + +SELECT [e].[EmployeeID], [e].[Address], [e].[BirthDate], [e].[City], [e].[Country], [e].[Extension], [e].[FirstName], [e].[HireDate], [e].[HomePhone], [e].[IsDeleted], [e].[LastName], [e].[Notes], [e].[Photo], [e].[PhotoPath], [e].[PostalCode], [e].[Region], [e].[ReportsTo], [e].[Title], [e].[TitleOfCourtesy], [e1].[EmployeeID], [e1].[Address], [e1].[BirthDate], [e1].[City], [e1].[Country], [e1].[Extension], [e1].[FirstName], [e1].[HireDate], [e1].[HomePhone], [e1].[IsDeleted], [e1].[LastName], [e1].[Notes], [e1].[Photo], [e1].[PhotoPath], [e1].[PostalCode], [e1].[Region], [e1].[ReportsTo], [e1].[Title], [e1].[TitleOfCourtesy] +FROM [Employees] AS [e] +LEFT JOIN ( + SELECT [e0].[EmployeeID], [e0].[Address], [e0].[BirthDate], [e0].[City], [e0].[Country], [e0].[Extension], [e0].[FirstName], [e0].[HireDate], [e0].[HomePhone], [e0].[IsDeleted], [e0].[LastName], [e0].[Notes], [e0].[Photo], [e0].[PhotoPath], [e0].[PostalCode], [e0].[Region], [e0].[ReportsTo], [e0].[Title], [e0].[TitleOfCourtesy] + FROM [Employees] AS [e0] + WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) OR [e0].[IsDeleted] = CAST(0 AS bit) +) AS [e1] ON [e].[ReportsTo] = [e1].[EmployeeID] +WHERE @ef_filter__p0 = CAST(1 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) OR [e].[IsDeleted] = CAST(0 AS bit) + + +-- SqlServer.2019 + +/* Tagged query */ +SELECT + [e].[IsDeleted], + [e].[EmployeeID], + [e].[LastName], + [e].[FirstName], + [e].[Title], + [e].[TitleOfCourtesy], + [e].[BirthDate], + [e].[HireDate], + [e].[Address], + [e].[City], + [e].[Region], + [e].[PostalCode], + [e].[Country], + [e].[HomePhone], + [e].[Extension], + [e].[Photo], + [e].[Notes], + [e].[ReportsTo], + [e].[PhotoPath], + [a_ReportsToNavigation].[IsDeleted], + [a_ReportsToNavigation].[EmployeeID], + [a_ReportsToNavigation].[LastName], + [a_ReportsToNavigation].[FirstName], + [a_ReportsToNavigation].[Title], + [a_ReportsToNavigation].[TitleOfCourtesy], + [a_ReportsToNavigation].[BirthDate], + [a_ReportsToNavigation].[HireDate], + [a_ReportsToNavigation].[Address], + [a_ReportsToNavigation].[City], + [a_ReportsToNavigation].[Region], + [a_ReportsToNavigation].[PostalCode], + [a_ReportsToNavigation].[Country], + [a_ReportsToNavigation].[HomePhone], + [a_ReportsToNavigation].[Extension], + [a_ReportsToNavigation].[Photo], + [a_ReportsToNavigation].[Notes], + [a_ReportsToNavigation].[ReportsTo], + [a_ReportsToNavigation].[PhotoPath] +FROM + [Employees] [e] + LEFT JOIN [Employees] [a_ReportsToNavigation] ON [e].[ReportsTo] = [a_ReportsToNavigation].[EmployeeID] AND [a_ReportsToNavigation].[IsDeleted] = 0 +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..47e29c3042dc --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.SA.MS,False).sql @@ -0,0 +1,57 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] + + + +DisposeTransaction + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..c658272e6a38 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestToList(SqlServer.SA.MS,True).sql @@ -0,0 +1,62 @@ +BeginTransaction(RepeatableRead) + + +-- SqlServer.2019 + +SELECT + [m_1].[OrderID], + [d].[IsDeleted], + [d].[OrderID], + [d].[ProductID], + [d].[UnitPrice], + [d].[Quantity], + [d].[Discount], + [a_Product].[IsDeleted], + [a_Product].[ProductID], + [a_Product].[ProductName], + [a_Product].[SupplierID], + [a_Product].[CategoryID], + [a_Product].[QuantityPerUnit], + [a_Product].[UnitPrice], + [a_Product].[UnitsInStock], + [a_Product].[UnitsOnOrder], + [a_Product].[ReorderLevel], + [a_Product].[Discontinued] +FROM + [Orders] [m_1] + INNER JOIN [Order Details] [d] ON [m_1].[OrderID] = [d].[OrderID] + INNER JOIN [Products] [a_Product] ON [d].[ProductID] = [a_Product].[ProductID] +WHERE + [m_1].[IsDeleted] = 0 AND [a_Product].[IsDeleted] = 0 AND + [d].[IsDeleted] = 0 + + + +DisposeTransaction + + +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[OrderID], + [e].[CustomerID], + [e].[EmployeeID], + [e].[OrderDate], + [e].[RequiredDate], + [e].[ShippedDate], + [e].[ShipVia], + [e].[Freight], + [e].[ShipName], + [e].[ShipAddress], + [e].[ShipCity], + [e].[ShipRegion], + [e].[ShipPostalCode], + [e].[ShipCountry] +FROM + [Orders] [e] +WHERE + [e].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..e2f9dc98230d --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.SA.MS,False).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2019 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2019 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[ProductName] = N'a' + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..44a866a70a51 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransaction(SqlServer.SA.MS,True).sql @@ -0,0 +1,29 @@ +Parameters: +@ef_filter__p0='?' (DbType = Boolean) + +SELECT MAX([p].[QuantityPerUnit]) +FROM [Products] AS [p] +WHERE (@ef_filter__p0 = CAST(1 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit) OR [p].[IsDeleted] = CAST(0 AS bit)) AND [p].[ProductName] LIKE N'U%' + + +-- SqlServer.2019 (asynchronously) + +SELECT + MAX([e].[QuantityPerUnit]) +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] LIKE N'U%' ESCAPE N'~' + + + +-- SqlServer.2019 + +DELETE [e] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND [e].[ProductName] = N'a' + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..cea556913db9 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.SA.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..8080c7592c12 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformation(SqlServer.SA.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..cea556913db9 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.SA.MS,False).sql @@ -0,0 +1,25 @@ +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..8080c7592c12 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestTransformationTable(SqlServer.SA.MS,True).sql @@ -0,0 +1,27 @@ +-- SqlServer.2019 + +SELECT + [p].[IsDeleted], + [p].[ProductID], + [p].[ProductName], + [p].[SupplierID], + [p].[CategoryID], + [p].[QuantityPerUnit], + [p].[UnitPrice], + [p].[UnitsInStock], + [p].[UnitsOnOrder], + [p].[ReorderLevel], + [p].[Discontinued], + [c_1].[IsDeleted], + [c_1].[CategoryID], + [c_1].[CategoryName], + [c_1].[Description], + [c_1].[Picture] +FROM + [Products] [p] + INNER JOIN [Categories] [c_1] ON [c_1].[CategoryID] = [p].[CategoryID] +WHERE + [p].[IsDeleted] = 0 AND [c_1].[IsDeleted] = 0 + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..6c03cbf4db19 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.SA.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2019 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..6c03cbf4db19 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdate(SqlServer.SA.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2019 +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..559ab88d725d --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.SA.MS,False).sql @@ -0,0 +1,13 @@ +-- SqlServer.2019 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..559ab88d725d --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestUpdateAsync(SqlServer.SA.MS,True).sql @@ -0,0 +1,13 @@ +-- SqlServer.2019 (asynchronously) +DECLARE @test Int -- Int32 +SET @test = 1 + +UPDATE + [Employees] +SET + [Address] = [Employees].[Address] +WHERE + [Employees].[EmployeeID] = @test + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.SA.MS,False).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.SA.MS,False).sql new file mode 100644 index 000000000000..a522f6213776 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.SA.MS,False).sql @@ -0,0 +1,29 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.SA.MS,True).sql b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.SA.MS,True).sql new file mode 100644 index 000000000000..1625b2c9c8f4 --- /dev/null +++ b/SqlServer.SA.MS.EF10/LinqToDB/EntityFrameworkCore/Tests/ToolsTests/LinqToDB.EntityFrameworkCore.Tests.ToolsTests.TestView(SqlServer.SA.MS,True).sql @@ -0,0 +1,29 @@ +-- SqlServer.2019 + +SELECT + [e].[IsDeleted], + [e].[ProductID], + [e].[ProductName], + [e].[SupplierID], + [e].[CategoryID], + [e].[QuantityPerUnit], + [e].[UnitPrice], + [e].[UnitsInStock], + [e].[UnitsOnOrder], + [e].[ReorderLevel], + [e].[Discontinued] +FROM + [Products] [e] +WHERE + [e].[IsDeleted] = 0 AND ( + SELECT + COUNT(*) + FROM + [Order Details] [e_1] + WHERE + [e_1].[IsDeleted] = 0 AND [e].[ProductID] = [e_1].[ProductID] + ) > 0 AND + [e].[ProductName] LIKE N'a%' ESCAPE N'~' + + + diff --git a/Sybase.Managed.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.CharIndex2(Sybase.Managed.LinqService).sql b/Sybase.Managed.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.CharIndex2(Sybase.Managed.LinqService).sql index 03ed8934e236..ce2a201a0818 100644 --- a/Sybase.Managed.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.CharIndex2(Sybase.Managed.LinqService).sql +++ b/Sybase.Managed.LinqService/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.CharIndex2(Sybase.Managed.LinqService).sql @@ -10,6 +10,6 @@ SELECT FROM [Person] [p] WHERE - CharIndex('p', Substring([p].[LastName], 2, Len([p].[LastName]))) + 1 = 3 AND + CharIndex('p', Substring([p].[LastName], 2, Len([p].[LastName]))) = 2 AND [p].[PersonID] = 1 diff --git a/Sybase.Managed/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.CharIndex2(Sybase.Managed).sql b/Sybase.Managed/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.CharIndex2(Sybase.Managed).sql index 91dff47c75b1..7000380072d8 100644 --- a/Sybase.Managed/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.CharIndex2(Sybase.Managed).sql +++ b/Sybase.Managed/Tests/Linq/StringFunctionTests/Tests.Linq.StringFunctionTests.CharIndex2(Sybase.Managed).sql @@ -10,6 +10,6 @@ SELECT FROM [Person] [p] WHERE - CharIndex('p', Substring([p].[LastName], 2, Len([p].[LastName]))) + 1 = 3 AND + CharIndex('p', Substring([p].[LastName], 2, Len([p].[LastName]))) = 2 AND [p].[PersonID] = 1