diff --git a/Firebird.3/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(Firebird.3).sql b/Firebird.3/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(Firebird.3).sql new file mode 100644 index 000000000000..00d2ffdedf54 --- /dev/null +++ b/Firebird.3/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(Firebird.3).sql @@ -0,0 +1,415 @@ +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "t1"."StartDateTime", + "t1"."StartDateTime2", + "t1"."EndDateTime", + "t1"."PreNotification", + "t1"."PreNotification2", + "t1"."PreNotification3", + "t1"."StrField", + "t1"."Status" +FROM + "Common_Topology_Locations" "t1" + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + Extract(year from "x"."StartDateTime2") = 2023 + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + DateAdd(Millisecond, 300000, "x"."StartDateTime2") > CAST('2025-08-31 17:52:48.101' AS timestamp) + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + DateAdd(Millisecond, 3153600000000, "x"."StartDateTime2") > CAST('2025-08-31 17:52:48.106' AS timestamp) + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + CAST("x"."PreNotification" / 10000 AS Float), + CAST("x"."PreNotification" / 10000000 AS Float) +FROM + "Common_Topology_Locations" "x" +WHERE + CAST("x"."PreNotification" / 10000000 AS Float) < CAST("x"."PreNotification" / 10000 AS Float) + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime2" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime4" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime5" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime6" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime7" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."Value_1" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "x"."NotificationDateTime4" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime4" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + Cast(DateDiff(millisecond, "t"."StartDateTime", "t"."EndDateTime") * 10000 as BIGINT) +FROM + "Common_Topology_Locations" "t" + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT) +FROM + "Common_Topology_Locations" "x" + +BeforeExecute +-- Firebird.3 Firebird3 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + "x"."diff" +FROM + ( + SELECT + Cast(DateDiff(millisecond, "t"."StartDateTime", "t"."EndDateTime") * 10000 as BIGINT) as "diff" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."diff" < @p + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT) +FROM + "Common_Topology_Locations" "x" +WHERE + CAST((Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT)) / 36000000000 AS Float) < 5 + +BeforeExecute +-- Firebird.3 Firebird3 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + "x"."diff" +FROM + ( + SELECT + Cast(DateDiff(millisecond, "t"."StartDateTime", "t"."EndDateTime") * 10000 as BIGINT) as "diff" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."diff" < @p + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT) +FROM + "Common_Topology_Locations" "x" +WHERE + CAST((Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT)) / 36000000000 AS Float) < 2 + diff --git a/Firebird.3/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(Firebird.3).sql b/Firebird.3/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(Firebird.3).sql new file mode 100644 index 000000000000..cde82102bae9 --- /dev/null +++ b/Firebird.3/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(Firebird.3).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status", + "x"."NotificationDateTime" +FROM + ( + SELECT + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime", + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + ("x"."Status" <> 'New' OR "x"."Status" IS NULL) AND + ("x"."Status" <> 'Completed' OR "x"."Status" IS NULL) AND + "x"."NotificationDateTime" < CAST('2025-08-31 17:52:48.322' AS timestamp) AND + CAST("x"."StartDateTime" AS Date) < CAST(CAST('2025-08-31 17:52:48.322' AS timestamp) AS Date) + diff --git a/Firebird.3/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(Firebird.3).sql b/Firebird.3/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(Firebird.3).sql new file mode 100644 index 000000000000..e127bd0c9f97 --- /dev/null +++ b/Firebird.3/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(Firebird.3).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +FETCH NEXT 1 ROWS ONLY + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +FETCH NEXT 1 ROWS ONLY + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +WHERE + Extract(hour from DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime")) = 13 +FETCH NEXT 1 ROWS ONLY + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +WHERE + Extract(minute from DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime")) = 51 +FETCH NEXT 1 ROWS ONLY + +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +WHERE + CAST(Floor(Extract(second from DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime"))) AS Int) >= 52 AND + CAST(Floor(Extract(second from DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime"))) AS Int) <= 54 +FETCH NEXT 1 ROWS ONLY + diff --git a/Firebird.3/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(Firebird.3).sql b/Firebird.3/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(Firebird.3).sql new file mode 100644 index 000000000000..0dcdfd9ad2c3 --- /dev/null +++ b/Firebird.3/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(Firebird.3).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- Firebird.3 Firebird3 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + Extract(hour from "x"."StartDateTime") = 13 +FETCH NEXT 1 ROWS ONLY + diff --git a/Firebird.4/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(Firebird.4).sql b/Firebird.4/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(Firebird.4).sql new file mode 100644 index 000000000000..4d87d18cafab --- /dev/null +++ b/Firebird.4/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(Firebird.4).sql @@ -0,0 +1,415 @@ +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "t1"."StartDateTime", + "t1"."StartDateTime2", + "t1"."EndDateTime", + "t1"."PreNotification", + "t1"."PreNotification2", + "t1"."PreNotification3", + "t1"."StrField", + "t1"."Status" +FROM + "Common_Topology_Locations" "t1" + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + Extract(year from "x"."StartDateTime2") = 2023 + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + DateAdd(Millisecond, 300000, "x"."StartDateTime2") > CAST('2025-08-31 17:46:51.412' AS timestamp) + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + DateAdd(Millisecond, 3153600000000, "x"."StartDateTime2") > CAST('2025-08-31 17:46:51.417' AS timestamp) + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + CAST("x"."PreNotification" / 10000 AS Float), + CAST("x"."PreNotification" / 10000000 AS Float) +FROM + "Common_Topology_Locations" "x" +WHERE + CAST("x"."PreNotification" / 10000000 AS Float) < CAST("x"."PreNotification" / 10000 AS Float) + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime2" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime4" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime5" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime6" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime7" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."Value_1" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "x"."NotificationDateTime4" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime4" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + Cast(DateDiff(millisecond, "t"."StartDateTime", "t"."EndDateTime") * 10000 as BIGINT) +FROM + "Common_Topology_Locations" "t" + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT) +FROM + "Common_Topology_Locations" "x" + +BeforeExecute +-- Firebird.4 Firebird4 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + "x"."diff" +FROM + ( + SELECT + Cast(DateDiff(millisecond, "t"."StartDateTime", "t"."EndDateTime") * 10000 as BIGINT) as "diff" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."diff" < @p + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT) +FROM + "Common_Topology_Locations" "x" +WHERE + CAST((Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT)) / 36000000000 AS Float) < 5 + +BeforeExecute +-- Firebird.4 Firebird4 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + "x"."diff" +FROM + ( + SELECT + Cast(DateDiff(millisecond, "t"."StartDateTime", "t"."EndDateTime") * 10000 as BIGINT) as "diff" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."diff" < @p + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT) +FROM + "Common_Topology_Locations" "x" +WHERE + CAST((Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT)) / 36000000000 AS Float) < 2 + diff --git a/Firebird.4/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(Firebird.4).sql b/Firebird.4/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(Firebird.4).sql new file mode 100644 index 000000000000..86dd4ca271e2 --- /dev/null +++ b/Firebird.4/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(Firebird.4).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status", + "x"."NotificationDateTime" +FROM + ( + SELECT + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime", + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + ("x"."Status" <> 'New' OR "x"."Status" IS NULL) AND + ("x"."Status" <> 'Completed' OR "x"."Status" IS NULL) AND + "x"."NotificationDateTime" < CAST('2025-08-31 17:46:51.644' AS timestamp) AND + CAST("x"."StartDateTime" AS Date) < CAST(CAST('2025-08-31 17:46:51.644' AS timestamp) AS Date) + diff --git a/Firebird.4/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(Firebird.4).sql b/Firebird.4/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(Firebird.4).sql new file mode 100644 index 000000000000..e49142a82e1d --- /dev/null +++ b/Firebird.4/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(Firebird.4).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +FETCH NEXT 1 ROWS ONLY + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +FETCH NEXT 1 ROWS ONLY + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +WHERE + Extract(hour from DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime")) = 13 +FETCH NEXT 1 ROWS ONLY + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +WHERE + Extract(minute from DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime")) = 51 +FETCH NEXT 1 ROWS ONLY + +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +WHERE + CAST(Floor(Extract(second from DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime"))) AS Int) >= 52 AND + CAST(Floor(Extract(second from DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime"))) AS Int) <= 54 +FETCH NEXT 1 ROWS ONLY + diff --git a/Firebird.4/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(Firebird.4).sql b/Firebird.4/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(Firebird.4).sql new file mode 100644 index 000000000000..fd6db06dd373 --- /dev/null +++ b/Firebird.4/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(Firebird.4).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- Firebird.4 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + Extract(hour from "x"."StartDateTime") = 13 +FETCH NEXT 1 ROWS ONLY + diff --git a/Firebird.5/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(Firebird.5).sql b/Firebird.5/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(Firebird.5).sql new file mode 100644 index 000000000000..a58bd1871166 --- /dev/null +++ b/Firebird.5/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(Firebird.5).sql @@ -0,0 +1,415 @@ +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "t1"."StartDateTime", + "t1"."StartDateTime2", + "t1"."EndDateTime", + "t1"."PreNotification", + "t1"."PreNotification2", + "t1"."PreNotification3", + "t1"."StrField", + "t1"."Status" +FROM + "Common_Topology_Locations" "t1" + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + Extract(year from "x"."StartDateTime2") = 2023 + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + DateAdd(Millisecond, 300000, "x"."StartDateTime2") > CAST('2025-08-31 17:54:32.623' AS timestamp) + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + DateAdd(Millisecond, 3153600000000, "x"."StartDateTime2") > CAST('2025-08-31 17:54:32.628' AS timestamp) + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + CAST("x"."PreNotification" / 10000 AS Float), + CAST("x"."PreNotification" / 10000000 AS Float) +FROM + "Common_Topology_Locations" "x" +WHERE + CAST("x"."PreNotification" / 10000000 AS Float) < CAST("x"."PreNotification" / 10000 AS Float) + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime2" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime4" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime5" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime6" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime7" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime2") as "Value_1", + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -1 * ("t"."PreNotification" / 10000), "t"."StartDateTime") as "NotificationDateTime", + DateAdd(Millisecond, -1 * ("t"."PreNotification2" / 10000), "t"."StartDateTime") as "NotificationDateTime2", + DateAdd(Millisecond, -1 * ("t"."PreNotification3" / 10000), "t"."StartDateTime") as "NotificationDateTime3", + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime5", + DateAdd(Millisecond, "t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime6", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime2") as "NotificationDateTime7", + Extract(day from "t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."Value_1" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "x"."NotificationDateTime4" +FROM + ( + SELECT + DateAdd(Millisecond, -"t"."PreNotification3" / 10000, "t"."StartDateTime") as "NotificationDateTime4" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime4" < CAST('2020-02-29 17:54:55.123' AS timestamp) + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + Cast(DateDiff(millisecond, "t"."StartDateTime", "t"."EndDateTime") * 10000 as BIGINT) +FROM + "Common_Topology_Locations" "t" + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT) +FROM + "Common_Topology_Locations" "x" + +BeforeExecute +-- Firebird.5 Firebird4 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + "x"."diff" +FROM + ( + SELECT + Cast(DateDiff(millisecond, "t"."StartDateTime", "t"."EndDateTime") * 10000 as BIGINT) as "diff" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."diff" < @p + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT) +FROM + "Common_Topology_Locations" "x" +WHERE + CAST((Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT)) / 36000000000 AS Float) < 5 + +BeforeExecute +-- Firebird.5 Firebird4 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + "x"."diff" +FROM + ( + SELECT + Cast(DateDiff(millisecond, "t"."StartDateTime", "t"."EndDateTime") * 10000 as BIGINT) as "diff" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."diff" < @p + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT) +FROM + "Common_Topology_Locations" "x" +WHERE + CAST((Cast(DateDiff(millisecond, "x"."StartDateTime", "x"."EndDateTime") * 10000 as BIGINT)) / 36000000000 AS Float) < 2 + diff --git a/Firebird.5/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(Firebird.5).sql b/Firebird.5/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(Firebird.5).sql new file mode 100644 index 000000000000..8626aa46d8e2 --- /dev/null +++ b/Firebird.5/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(Firebird.5).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status", + "x"."NotificationDateTime" +FROM + ( + SELECT + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") as "NotificationDateTime", + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + ("x"."Status" <> 'New' OR "x"."Status" IS NULL) AND + ("x"."Status" <> 'Completed' OR "x"."Status" IS NULL) AND + "x"."NotificationDateTime" < CAST('2025-08-31 17:54:32.854' AS timestamp) AND + CAST("x"."StartDateTime" AS Date) < CAST(CAST('2025-08-31 17:54:32.854' AS timestamp) AS Date) + diff --git a/Firebird.5/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(Firebird.5).sql b/Firebird.5/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(Firebird.5).sql new file mode 100644 index 000000000000..7e0d50c33b42 --- /dev/null +++ b/Firebird.5/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(Firebird.5).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +FETCH NEXT 1 ROWS ONLY + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "t"."StartDateTime", + "t"."PreNotification", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +FETCH NEXT 1 ROWS ONLY + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +WHERE + Extract(hour from DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime")) = 13 +FETCH NEXT 1 ROWS ONLY + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +WHERE + Extract(minute from DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime")) = 51 +FETCH NEXT 1 ROWS ONLY + +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime") +FROM + "Common_Topology_Locations" "t" +WHERE + CAST(Floor(Extract(second from DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime"))) AS Int) >= 52 AND + CAST(Floor(Extract(second from DateAdd(Millisecond, -"t"."PreNotification" / 10000, "t"."StartDateTime"))) AS Int) <= 54 +FETCH NEXT 1 ROWS ONLY + diff --git a/Firebird.5/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(Firebird.5).sql b/Firebird.5/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(Firebird.5).sql new file mode 100644 index 000000000000..882449ba0ed7 --- /dev/null +++ b/Firebird.5/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(Firebird.5).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- Firebird.5 Firebird4 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + Extract(hour from "x"."StartDateTime") = 13 +FETCH NEXT 1 ROWS ONLY + diff --git a/MariaDB.11/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MariaDB.11).sql b/MariaDB.11/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MariaDB.11).sql new file mode 100644 index 000000000000..8dc55ea1fbc0 --- /dev/null +++ b/MariaDB.11/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MariaDB.11).sql @@ -0,0 +1,419 @@ +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `t1`.`StartDateTime`, + `t1`.`StartDateTime2`, + `t1`.`EndDateTime`, + `t1`.`PreNotification`, + `t1`.`PreNotification2`, + `t1`.`PreNotification3`, + `t1`.`StrField`, + `t1`.`Status` +FROM + `Common_Topology_Locations` `t1` + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Extract(year from `x`.`StartDateTime2`) = 2023 + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql +DECLARE @Value Int64 +SET @Value = 300000 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Date_Add(`x`.`StartDateTime2`, Interval (@Value * 1000) Microsecond) > '2025-08-31 17:58:43.601' + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql +DECLARE @Value Int64 +SET @Value = 3153600000000 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Date_Add(`x`.`StartDateTime2`, Interval (@Value * 1000) Microsecond) > '2025-08-31 17:58:43.607' + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + CAST(`x`.`PreNotification` / 10000 AS DOUBLE), + CAST(`x`.`PreNotification` / 10000000 AS DOUBLE) +FROM + `Common_Topology_Locations` `x` +WHERE + CAST(`x`.`PreNotification` / 10000000 AS DOUBLE) < CAST(`x`.`PreNotification` / 10000 AS DOUBLE) + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime2` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime4` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime5` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime6` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime7` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`Value_1` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `x`.`NotificationDateTime4` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime4` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `t` + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql +DECLARE @p Int64 +SET @p = 180000000000 + +SELECT + `x`.`diff` +FROM + ( + SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 as `diff` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`diff` < @p + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` +WHERE + CAST((TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10) / 36000000000 AS DOUBLE) < 5 + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql +DECLARE @p Int64 +SET @p = 72000000000 + +SELECT + `x`.`diff` +FROM + ( + SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 as `diff` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`diff` < @p + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` +WHERE + CAST((TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10) / 36000000000 AS DOUBLE) < 2 + diff --git a/MariaDB.11/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MariaDB.11).sql b/MariaDB.11/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MariaDB.11).sql new file mode 100644 index 000000000000..2b5b4b6a3c65 --- /dev/null +++ b/MariaDB.11/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MariaDB.11).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status`, + `x`.`NotificationDateTime` +FROM + ( + SELECT + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime`, + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + (`x`.`Status` <> 'New' OR `x`.`Status` IS NULL) AND + (`x`.`Status` <> 'Completed' OR `x`.`Status` IS NULL) AND + `x`.`NotificationDateTime` < '2025-08-31 17:58:43.755' AND + Date(`x`.`StartDateTime`) < Date('2025-08-31 17:58:43.755') + diff --git a/MariaDB.11/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MariaDB.11).sql b/MariaDB.11/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MariaDB.11).sql new file mode 100644 index 000000000000..e88b70a285e1 --- /dev/null +++ b/MariaDB.11/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MariaDB.11).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +LIMIT 1 + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +LIMIT 1 + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(hour from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) = 13 +LIMIT 1 + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(minute from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) = 51 +LIMIT 1 + +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(second from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) >= 52 AND + Extract(second from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) <= 54 +LIMIT 1 + diff --git a/MariaDB.11/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MariaDB.11).sql b/MariaDB.11/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MariaDB.11).sql new file mode 100644 index 000000000000..9e882a988046 --- /dev/null +++ b/MariaDB.11/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MariaDB.11).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- MariaDB.11 MariaDB.10.MySqlConnector MySql + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Extract(hour from `x`.`StartDateTime`) = 13 +LIMIT 1 + diff --git a/MySql.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MySql.5.7).sql b/MySql.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MySql.5.7).sql new file mode 100644 index 000000000000..bf53cd5c06fc --- /dev/null +++ b/MySql.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MySql.5.7).sql @@ -0,0 +1,419 @@ +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `t1`.`StartDateTime`, + `t1`.`StartDateTime2`, + `t1`.`EndDateTime`, + `t1`.`PreNotification`, + `t1`.`PreNotification2`, + `t1`.`PreNotification3`, + `t1`.`StrField`, + `t1`.`Status` +FROM + `Common_Topology_Locations` `t1` + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Extract(year from `x`.`StartDateTime2`) = 2023 + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 +DECLARE @Value Int64 +SET @Value = 300000 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Date_Add(`x`.`StartDateTime2`, Interval (@Value * 1000) Microsecond) > '2025-08-31 18:03:18.612' + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 +DECLARE @Value Int64 +SET @Value = 3153600000000 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Date_Add(`x`.`StartDateTime2`, Interval (@Value * 1000) Microsecond) > '2025-08-31 18:03:18.617' + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + CAST(`x`.`PreNotification` / 10000 AS DECIMAL(29, 10)), + CAST(`x`.`PreNotification` / 10000000 AS DECIMAL(29, 10)) +FROM + `Common_Topology_Locations` `x` +WHERE + CAST(`x`.`PreNotification` / 10000000 AS DECIMAL(29, 10)) < CAST(`x`.`PreNotification` / 10000 AS DECIMAL(29, 10)) + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime2` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime4` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime5` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime6` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime7` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`Value_1` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `x`.`NotificationDateTime4` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime4` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `t` + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 +DECLARE @p Int64 +SET @p = 180000000000 + +SELECT + `x`.`diff` +FROM + ( + SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 as `diff` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`diff` < @p + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` +WHERE + CAST((TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10) / 36000000000 AS DECIMAL(29, 10)) < 5 + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 +DECLARE @p Int64 +SET @p = 72000000000 + +SELECT + `x`.`diff` +FROM + ( + SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 as `diff` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`diff` < @p + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` +WHERE + CAST((TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10) / 36000000000 AS DECIMAL(29, 10)) < 2 + diff --git a/MySql.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MySql.5.7).sql b/MySql.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MySql.5.7).sql new file mode 100644 index 000000000000..c31ba0253719 --- /dev/null +++ b/MySql.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MySql.5.7).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status`, + `x`.`NotificationDateTime` +FROM + ( + SELECT + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime`, + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + (`x`.`Status` <> 'New' OR `x`.`Status` IS NULL) AND + (`x`.`Status` <> 'Completed' OR `x`.`Status` IS NULL) AND + `x`.`NotificationDateTime` < '2025-08-31 18:03:18.952' AND + Date(`x`.`StartDateTime`) < Date('2025-08-31 18:03:18.952') + diff --git a/MySql.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MySql.5.7).sql b/MySql.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MySql.5.7).sql new file mode 100644 index 000000000000..6b0e97f96c20 --- /dev/null +++ b/MySql.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MySql.5.7).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +LIMIT 1 + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +LIMIT 1 + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(hour from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) = 13 +LIMIT 1 + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(minute from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) = 51 +LIMIT 1 + +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(second from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) >= 52 AND + Extract(second from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) <= 54 +LIMIT 1 + diff --git a/MySql.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MySql.5.7).sql b/MySql.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MySql.5.7).sql new file mode 100644 index 000000000000..5ec722e976ea --- /dev/null +++ b/MySql.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MySql.5.7).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- MySql.5.7 MySql.5.7.MySql.Data MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Extract(hour from `x`.`StartDateTime`) = 13 +LIMIT 1 + diff --git a/MySql.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MySql.8.0).sql b/MySql.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MySql.8.0).sql new file mode 100644 index 000000000000..0c2eb4e40043 --- /dev/null +++ b/MySql.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MySql.8.0).sql @@ -0,0 +1,419 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t1`.`StartDateTime`, + `t1`.`StartDateTime2`, + `t1`.`EndDateTime`, + `t1`.`PreNotification`, + `t1`.`PreNotification2`, + `t1`.`PreNotification3`, + `t1`.`StrField`, + `t1`.`Status` +FROM + `Common_Topology_Locations` `t1` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Extract(year from `x`.`StartDateTime2`) = 2023 + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 +DECLARE @Value Int64 +SET @Value = 300000 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Date_Add(`x`.`StartDateTime2`, Interval (@Value * 1000) Microsecond) > '2025-08-31 18:07:32.556' + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 +DECLARE @Value Int64 +SET @Value = 3153600000000 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Date_Add(`x`.`StartDateTime2`, Interval (@Value * 1000) Microsecond) > '2025-08-31 18:07:32.561' + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + CAST(`x`.`PreNotification` / 10000 AS DOUBLE), + CAST(`x`.`PreNotification` / 10000000 AS DOUBLE) +FROM + `Common_Topology_Locations` `x` +WHERE + CAST(`x`.`PreNotification` / 10000000 AS DOUBLE) < CAST(`x`.`PreNotification` / 10000 AS DOUBLE) + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime2` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime4` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime5` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime6` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime7` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`Value_1` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `x`.`NotificationDateTime4` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime4` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `t` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 +DECLARE @p Int64 +SET @p = 180000000000 + +SELECT + `x`.`diff` +FROM + ( + SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 as `diff` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`diff` < @p + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` +WHERE + CAST((TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10) / 36000000000 AS DOUBLE) < 5 + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 +DECLARE @p Int64 +SET @p = 72000000000 + +SELECT + `x`.`diff` +FROM + ( + SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 as `diff` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`diff` < @p + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` +WHERE + CAST((TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10) / 36000000000 AS DOUBLE) < 2 + diff --git a/MySql.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MySql.8.0).sql b/MySql.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MySql.8.0).sql new file mode 100644 index 000000000000..3d72026386bc --- /dev/null +++ b/MySql.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MySql.8.0).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status`, + `x`.`NotificationDateTime` +FROM + ( + SELECT + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime`, + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + (`x`.`Status` <> 'New' OR `x`.`Status` IS NULL) AND + (`x`.`Status` <> 'Completed' OR `x`.`Status` IS NULL) AND + `x`.`NotificationDateTime` < '2025-08-31 18:07:32.907' AND + Date(`x`.`StartDateTime`) < Date('2025-08-31 18:07:32.907') + diff --git a/MySql.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MySql.8.0).sql b/MySql.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MySql.8.0).sql new file mode 100644 index 000000000000..02b2ee4d5abb --- /dev/null +++ b/MySql.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MySql.8.0).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +LIMIT 1 + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +LIMIT 1 + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(hour from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) = 13 +LIMIT 1 + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(minute from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) = 51 +LIMIT 1 + +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(second from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) >= 52 AND + Extract(second from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) <= 54 +LIMIT 1 + diff --git a/MySql.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MySql.8.0).sql b/MySql.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MySql.8.0).sql new file mode 100644 index 000000000000..f0f900e9893a --- /dev/null +++ b/MySql.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MySql.8.0).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- MySql.8.0 MySql.8.0.MySql.Data MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Extract(hour from `x`.`StartDateTime`) = 13 +LIMIT 1 + diff --git a/MySqlConnector.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MySqlConnector.5.7).sql b/MySqlConnector.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MySqlConnector.5.7).sql new file mode 100644 index 000000000000..e1f2c5740ea9 --- /dev/null +++ b/MySqlConnector.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MySqlConnector.5.7).sql @@ -0,0 +1,419 @@ +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `t1`.`StartDateTime`, + `t1`.`StartDateTime2`, + `t1`.`EndDateTime`, + `t1`.`PreNotification`, + `t1`.`PreNotification2`, + `t1`.`PreNotification3`, + `t1`.`StrField`, + `t1`.`Status` +FROM + `Common_Topology_Locations` `t1` + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Extract(year from `x`.`StartDateTime2`) = 2023 + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 +DECLARE @Value Int64 +SET @Value = 300000 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Date_Add(`x`.`StartDateTime2`, Interval (@Value * 1000) Microsecond) > '2025-08-31 18:03:18.776' + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 +DECLARE @Value Int64 +SET @Value = 3153600000000 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Date_Add(`x`.`StartDateTime2`, Interval (@Value * 1000) Microsecond) > '2025-08-31 18:03:18.780' + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + CAST(`x`.`PreNotification` / 10000 AS DECIMAL(29, 10)), + CAST(`x`.`PreNotification` / 10000000 AS DECIMAL(29, 10)) +FROM + `Common_Topology_Locations` `x` +WHERE + CAST(`x`.`PreNotification` / 10000000 AS DECIMAL(29, 10)) < CAST(`x`.`PreNotification` / 10000 AS DECIMAL(29, 10)) + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime2` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime4` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime5` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime6` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime7` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`Value_1` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `x`.`NotificationDateTime4` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime4` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `t` + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 +DECLARE @p Int64 +SET @p = 180000000000 + +SELECT + `x`.`diff` +FROM + ( + SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 as `diff` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`diff` < @p + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` +WHERE + CAST((TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10) / 36000000000 AS DECIMAL(29, 10)) < 5 + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 +DECLARE @p Int64 +SET @p = 72000000000 + +SELECT + `x`.`diff` +FROM + ( + SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 as `diff` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`diff` < @p + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` +WHERE + CAST((TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10) / 36000000000 AS DECIMAL(29, 10)) < 2 + diff --git a/MySqlConnector.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MySqlConnector.5.7).sql b/MySqlConnector.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MySqlConnector.5.7).sql new file mode 100644 index 000000000000..8a5229c3a442 --- /dev/null +++ b/MySqlConnector.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MySqlConnector.5.7).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status`, + `x`.`NotificationDateTime` +FROM + ( + SELECT + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime`, + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + (`x`.`Status` <> 'New' OR `x`.`Status` IS NULL) AND + (`x`.`Status` <> 'Completed' OR `x`.`Status` IS NULL) AND + `x`.`NotificationDateTime` < '2025-08-31 18:03:18.972' AND + Date(`x`.`StartDateTime`) < Date('2025-08-31 18:03:18.972') + diff --git a/MySqlConnector.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MySqlConnector.5.7).sql b/MySqlConnector.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MySqlConnector.5.7).sql new file mode 100644 index 000000000000..eab3ed9b328d --- /dev/null +++ b/MySqlConnector.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MySqlConnector.5.7).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +LIMIT 1 + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +LIMIT 1 + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(hour from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) = 13 +LIMIT 1 + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(minute from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) = 51 +LIMIT 1 + +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(second from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) >= 52 AND + Extract(second from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) <= 54 +LIMIT 1 + diff --git a/MySqlConnector.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MySqlConnector.5.7).sql b/MySqlConnector.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MySqlConnector.5.7).sql new file mode 100644 index 000000000000..3cd661c5a88a --- /dev/null +++ b/MySqlConnector.5.7/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MySqlConnector.5.7).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- MySqlConnector.5.7 MySql.5.7.MySqlConnector MySql57 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Extract(hour from `x`.`StartDateTime`) = 13 +LIMIT 1 + diff --git a/MySqlConnector.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..619c6b8bd581 --- /dev/null +++ b/MySqlConnector.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(MySqlConnector.8.0).sql @@ -0,0 +1,419 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t1`.`StartDateTime`, + `t1`.`StartDateTime2`, + `t1`.`EndDateTime`, + `t1`.`PreNotification`, + `t1`.`PreNotification2`, + `t1`.`PreNotification3`, + `t1`.`StrField`, + `t1`.`Status` +FROM + `Common_Topology_Locations` `t1` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Extract(year from `x`.`StartDateTime2`) = 2023 + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 +DECLARE @Value Int64 +SET @Value = 300000 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Date_Add(`x`.`StartDateTime2`, Interval (@Value * 1000) Microsecond) > '2025-08-31 18:07:32.731' + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 +DECLARE @Value Int64 +SET @Value = 3153600000000 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Date_Add(`x`.`StartDateTime2`, Interval (@Value * 1000) Microsecond) > '2025-08-31 18:07:32.736' + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + CAST(`x`.`PreNotification` / 10000 AS DOUBLE), + CAST(`x`.`PreNotification` / 10000000 AS DOUBLE) +FROM + `Common_Topology_Locations` `x` +WHERE + CAST(`x`.`PreNotification` / 10000000 AS DOUBLE) < CAST(`x`.`PreNotification` / 10000 AS DOUBLE) + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime2` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime4` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime5` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime6` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime7` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`PreNotification`, + `x`.`NotificationDateTime`, + `x`.`NotificationDateTime2`, + `x`.`NotificationDateTime3`, + `x`.`NotificationDateTime4`, + `x`.`NotificationDateTime5`, + `x`.`NotificationDateTime6`, + `x`.`NotificationDateTime7`, + `x`.`Value_1`, + `x`.`Day_1` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `Value_1`, + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification` / 10000)) * 1000) Microsecond) as `NotificationDateTime`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification2` / 10000)) * 1000) Microsecond) as `NotificationDateTime2`, + Date_Add(`t`.`StartDateTime`, Interval ((-1 * (`t`.`PreNotification3` / 10000)) * 1000) Microsecond) as `NotificationDateTime3`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime5`, + Date_Add(`t`.`StartDateTime`, Interval ((`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime6`, + Date_Add(`t`.`StartDateTime2`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime7`, + Extract(day from `t`.`StrField`) as `Day_1` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`Value_1` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `x`.`NotificationDateTime4` +FROM + ( + SELECT + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification3` / 10000) * 1000) Microsecond) as `NotificationDateTime4` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`NotificationDateTime4` < '2020-02-29 17:54:55.123' + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `t` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 +DECLARE @p Int64 +SET @p = 180000000000 + +SELECT + `x`.`diff` +FROM + ( + SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 as `diff` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`diff` < @p + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` +WHERE + CAST((TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10) / 36000000000 AS DOUBLE) < 5 + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 +DECLARE @p Int64 +SET @p = 72000000000 + +SELECT + `x`.`diff` +FROM + ( + SELECT + TIMESTAMPDIFF(MICROSECOND, `t`.`StartDateTime`, `t`.`EndDateTime`) * 10 as `diff` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + `x`.`diff` < @p + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10 +FROM + `Common_Topology_Locations` `x` +WHERE + CAST((TIMESTAMPDIFF(MICROSECOND, `x`.`StartDateTime`, `x`.`EndDateTime`) * 10) / 36000000000 AS DOUBLE) < 2 + diff --git a/MySqlConnector.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..c0ef39f67caf --- /dev/null +++ b/MySqlConnector.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(MySqlConnector.8.0).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status`, + `x`.`NotificationDateTime` +FROM + ( + SELECT + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) as `NotificationDateTime`, + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField` + FROM + `Common_Topology_Locations` `t` + ) `x` +WHERE + (`x`.`Status` <> 'New' OR `x`.`Status` IS NULL) AND + (`x`.`Status` <> 'Completed' OR `x`.`Status` IS NULL) AND + `x`.`NotificationDateTime` < '2025-08-31 18:07:32.930' AND + Date(`x`.`StartDateTime`) < Date('2025-08-31 18:07:32.931') + diff --git a/MySqlConnector.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..a366e727c91a --- /dev/null +++ b/MySqlConnector.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(MySqlConnector.8.0).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +LIMIT 1 + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t`.`StartDateTime`, + `t`.`PreNotification`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +LIMIT 1 + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(hour from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) = 13 +LIMIT 1 + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(minute from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) = 51 +LIMIT 1 + +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `t`.`StartDateTime`, + `t`.`StartDateTime2`, + `t`.`EndDateTime`, + `t`.`PreNotification`, + `t`.`PreNotification2`, + `t`.`PreNotification3`, + `t`.`StrField`, + `t`.`Status`, + Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond) +FROM + `Common_Topology_Locations` `t` +WHERE + Extract(second from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) >= 52 AND + Extract(second from Date_Add(`t`.`StartDateTime`, Interval ((-`t`.`PreNotification` / 10000) * 1000) Microsecond)) <= 54 +LIMIT 1 + diff --git a/MySqlConnector.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MySqlConnector.8.0).sql b/MySqlConnector.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MySqlConnector.8.0).sql new file mode 100644 index 000000000000..f5d9158e1f33 --- /dev/null +++ b/MySqlConnector.8.0/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(MySqlConnector.8.0).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- MySqlConnector.8.0 MySql.8.0.MySqlConnector MySql80 + +SELECT + `x`.`StartDateTime`, + `x`.`StartDateTime2`, + `x`.`EndDateTime`, + `x`.`PreNotification`, + `x`.`PreNotification2`, + `x`.`PreNotification3`, + `x`.`StrField`, + `x`.`Status` +FROM + `Common_Topology_Locations` `x` +WHERE + Extract(hour from `x`.`StartDateTime`) = 13 +LIMIT 1 + diff --git a/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.13).sql new file mode 100644 index 000000000000..477db4e4aeae --- /dev/null +++ b/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.13).sql @@ -0,0 +1,3 @@ +BeforeExecute +INSERT BULK "Common_Language"(LanguageID, TimeSpan, TimeSpanNull) + diff --git a/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.13).sql new file mode 100644 index 000000000000..f4c0bee93ed5 --- /dev/null +++ b/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.13).sql @@ -0,0 +1,409 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."StartDateTime", + t1."StartDateTime2", + t1."EndDateTime", + t1."PreNotification", + t1."PreNotification2", + t1."PreNotification3", + t1."StrField", + t1."Status" +FROM + "Common_Topology_Locations" t1 + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + Floor(Extract(year From x."StartDateTime2"))::Int = 2023 + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL +DECLARE @Value Interval -- Object +SET @Value = 00:05:00 + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + x."StartDateTime2" + :Value > '2025-08-31 18:15:17.460'::timestamp + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL +DECLARE @Value Interval -- Object +SET @Value = 36500.00:00:00 + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + x."StartDateTime2" + :Value > '2025-08-31 18:15:17.463'::timestamp + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + (x."PreNotification" / 10000)::Float, + (x."PreNotification" / 10000000)::Float +FROM + "Common_Topology_Locations" x +WHERE + (x."PreNotification" / 10000000)::Float < (x."PreNotification" / 10000)::Float + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime2" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime4" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime5" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime6" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime7" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime2" - t."PreNotification3" as "Value_1", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."Value_1" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."NotificationDateTime4" +FROM + ( + SELECT + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime4" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + ((t."EndDateTime"::timestamp - t."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" t + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL +DECLARE @p Interval -- Object +SET @p = 05:00:00 + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval < :p + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((extract(second from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) + extract(minute from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 60 + extract(hour from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 3600 + extract(day from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 86400) / 3600)::Float < 5 + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL +DECLARE @p Interval -- Object +SET @p = 02:00:00 + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval < :p + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((extract(second from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) + extract(minute from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 60 + extract(hour from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 3600 + extract(day from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 86400) / 3600)::Float < 2 + diff --git a/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.13).sql new file mode 100644 index 000000000000..b8e24a35eee8 --- /dev/null +++ b/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.13).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status", + x."NotificationDateTime" +FROM + ( + SELECT + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime", + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField" + FROM + "Common_Topology_Locations" t + ) x +WHERE + (x."Status" <> 'New' OR x."Status" IS NULL) AND + (x."Status" <> 'Completed' OR x."Status" IS NULL) AND + x."NotificationDateTime" < '2025-08-31 18:15:17.667'::timestamp AND + Date_Trunc('day', x."StartDateTime") < Date_Trunc('day', '2025-08-31 18:15:17.668'::timestamp) + diff --git a/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.13).sql new file mode 100644 index 000000000000..43a32cb9152d --- /dev/null +++ b/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.13).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +LIMIT 1 + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +LIMIT 1 + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(hour From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int = 13 +LIMIT 1 + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(minute From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int = 51 +LIMIT 1 + +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(second From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int >= 52 AND + Floor(Extract(second From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int <= 54 +LIMIT 1 + diff --git a/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.13).sql b/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.13).sql new file mode 100644 index 000000000000..2f55e8197c73 --- /dev/null +++ b/PostgreSQL.13/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.13).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- PostgreSQL.13 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + Floor(Extract(hour From x."StartDateTime"))::Int = 13 +LIMIT 1 + diff --git a/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.14).sql new file mode 100644 index 000000000000..477db4e4aeae --- /dev/null +++ b/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.14).sql @@ -0,0 +1,3 @@ +BeforeExecute +INSERT BULK "Common_Language"(LanguageID, TimeSpan, TimeSpanNull) + diff --git a/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.14).sql new file mode 100644 index 000000000000..931d95bbbd9f --- /dev/null +++ b/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.14).sql @@ -0,0 +1,409 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t1."StartDateTime", + t1."StartDateTime2", + t1."EndDateTime", + t1."PreNotification", + t1."PreNotification2", + t1."PreNotification3", + t1."StrField", + t1."Status" +FROM + "Common_Topology_Locations" t1 + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + Floor(Extract(year From x."StartDateTime2"))::Int = 2023 + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL +DECLARE @Value Interval -- Object +SET @Value = 00:05:00 + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + x."StartDateTime2" + :Value > '2025-08-31 18:21:49.383'::timestamp + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL +DECLARE @Value Interval -- Object +SET @Value = 36500.00:00:00 + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + x."StartDateTime2" + :Value > '2025-08-31 18:21:49.386'::timestamp + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + (x."PreNotification" / 10000)::Float, + (x."PreNotification" / 10000000)::Float +FROM + "Common_Topology_Locations" x +WHERE + (x."PreNotification" / 10000000)::Float < (x."PreNotification" / 10000)::Float + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime2" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime4" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime5" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime6" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime7" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime2" - t."PreNotification3" as "Value_1", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."Value_1" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."NotificationDateTime4" +FROM + ( + SELECT + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime4" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + ((t."EndDateTime"::timestamp - t."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" t + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL +DECLARE @p Interval -- Object +SET @p = 05:00:00 + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval < :p + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((extract(second from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) + extract(minute from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 60 + extract(hour from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 3600 + extract(day from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 86400) / 3600)::Float < 5 + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL +DECLARE @p Interval -- Object +SET @p = 02:00:00 + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval < :p + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((extract(second from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) + extract(minute from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 60 + extract(hour from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 3600 + extract(day from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 86400) / 3600)::Float < 2 + diff --git a/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.14).sql new file mode 100644 index 000000000000..208a19405cb1 --- /dev/null +++ b/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.14).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status", + x."NotificationDateTime" +FROM + ( + SELECT + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime", + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField" + FROM + "Common_Topology_Locations" t + ) x +WHERE + (x."Status" <> 'New' OR x."Status" IS NULL) AND + (x."Status" <> 'Completed' OR x."Status" IS NULL) AND + x."NotificationDateTime" < '2025-08-31 18:21:49.572'::timestamp AND + Date_Trunc('day', x."StartDateTime") < Date_Trunc('day', '2025-08-31 18:21:49.572'::timestamp) + diff --git a/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.14).sql new file mode 100644 index 000000000000..6526f9d231d2 --- /dev/null +++ b/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.14).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +LIMIT 1 + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +LIMIT 1 + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(hour From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int = 13 +LIMIT 1 + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(minute From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int = 51 +LIMIT 1 + +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(second From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int >= 52 AND + Floor(Extract(second From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int <= 54 +LIMIT 1 + diff --git a/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.14).sql b/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.14).sql new file mode 100644 index 000000000000..67f0fe80ced9 --- /dev/null +++ b/PostgreSQL.14/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.14).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- PostgreSQL.14 PostgreSQL.9.5 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + Floor(Extract(hour From x."StartDateTime"))::Int = 13 +LIMIT 1 + diff --git a/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.15).sql new file mode 100644 index 000000000000..477db4e4aeae --- /dev/null +++ b/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.15).sql @@ -0,0 +1,3 @@ +BeforeExecute +INSERT BULK "Common_Language"(LanguageID, TimeSpan, TimeSpanNull) + diff --git a/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.15).sql new file mode 100644 index 000000000000..d1d6ba38fc8e --- /dev/null +++ b/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.15).sql @@ -0,0 +1,409 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t1."StartDateTime", + t1."StartDateTime2", + t1."EndDateTime", + t1."PreNotification", + t1."PreNotification2", + t1."PreNotification3", + t1."StrField", + t1."Status" +FROM + "Common_Topology_Locations" t1 + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + Floor(Extract(year From x."StartDateTime2"))::Int = 2023 + +BeforeExecute +-- PostgreSQL.15 PostgreSQL +DECLARE @Value Interval -- Object +SET @Value = 00:05:00 + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + x."StartDateTime2" + :Value > '2025-08-31 18:27:48.709'::timestamp + +BeforeExecute +-- PostgreSQL.15 PostgreSQL +DECLARE @Value Interval -- Object +SET @Value = 36500.00:00:00 + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + x."StartDateTime2" + :Value > '2025-08-31 18:27:48.713'::timestamp + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + (x."PreNotification" / 10000)::Float, + (x."PreNotification" / 10000000)::Float +FROM + "Common_Topology_Locations" x +WHERE + (x."PreNotification" / 10000000)::Float < (x."PreNotification" / 10000)::Float + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime2" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime4" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime5" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime6" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime7" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime2" - t."PreNotification3" as "Value_1", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."Value_1" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."NotificationDateTime4" +FROM + ( + SELECT + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime4" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + ((t."EndDateTime"::timestamp - t."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" t + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x + +BeforeExecute +-- PostgreSQL.15 PostgreSQL +DECLARE @p Interval -- Object +SET @p = 05:00:00 + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval < :p + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((extract(second from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) + extract(minute from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 60 + extract(hour from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 3600 + extract(day from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 86400) / 3600)::Float < 5 + +BeforeExecute +-- PostgreSQL.15 PostgreSQL +DECLARE @p Interval -- Object +SET @p = 02:00:00 + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval < :p + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((extract(second from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) + extract(minute from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 60 + extract(hour from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 3600 + extract(day from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 86400) / 3600)::Float < 2 + diff --git a/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.15).sql new file mode 100644 index 000000000000..cbc0d57ef93c --- /dev/null +++ b/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.15).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status", + x."NotificationDateTime" +FROM + ( + SELECT + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime", + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField" + FROM + "Common_Topology_Locations" t + ) x +WHERE + (x."Status" <> 'New' OR x."Status" IS NULL) AND + (x."Status" <> 'Completed' OR x."Status" IS NULL) AND + x."NotificationDateTime" < '2025-08-31 18:27:48.898'::timestamp AND + Date_Trunc('day', x."StartDateTime") < Date_Trunc('day', '2025-08-31 18:27:48.898'::timestamp) + diff --git a/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.15).sql new file mode 100644 index 000000000000..e5397b9b890a --- /dev/null +++ b/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.15).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +LIMIT 1 + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +LIMIT 1 + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(hour From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int = 13 +LIMIT 1 + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(minute From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int = 51 +LIMIT 1 + +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(second From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int >= 52 AND + Floor(Extract(second From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int <= 54 +LIMIT 1 + diff --git a/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.15).sql b/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.15).sql new file mode 100644 index 000000000000..f2a4966b4e29 --- /dev/null +++ b/PostgreSQL.15/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.15).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + Floor(Extract(hour From x."StartDateTime"))::Int = 13 +LIMIT 1 + diff --git a/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.16).sql new file mode 100644 index 000000000000..477db4e4aeae --- /dev/null +++ b/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.16).sql @@ -0,0 +1,3 @@ +BeforeExecute +INSERT BULK "Common_Language"(LanguageID, TimeSpan, TimeSpanNull) + diff --git a/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.16).sql new file mode 100644 index 000000000000..3065ef715f3f --- /dev/null +++ b/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.16).sql @@ -0,0 +1,409 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t1."StartDateTime", + t1."StartDateTime2", + t1."EndDateTime", + t1."PreNotification", + t1."PreNotification2", + t1."PreNotification3", + t1."StrField", + t1."Status" +FROM + "Common_Topology_Locations" t1 + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + Floor(Extract(year From x."StartDateTime2"))::Int = 2023 + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL +DECLARE @Value Interval -- Object +SET @Value = 00:05:00 + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + x."StartDateTime2" + :Value > '2025-08-31 18:26:38.276'::timestamp + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL +DECLARE @Value Interval -- Object +SET @Value = 36500.00:00:00 + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + x."StartDateTime2" + :Value > '2025-08-31 18:26:38.280'::timestamp + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + (x."PreNotification" / 10000)::Float, + (x."PreNotification" / 10000000)::Float +FROM + "Common_Topology_Locations" x +WHERE + (x."PreNotification" / 10000000)::Float < (x."PreNotification" / 10000)::Float + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime2" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime4" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime5" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime6" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime7" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime2" - t."PreNotification3" as "Value_1", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."Value_1" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."NotificationDateTime4" +FROM + ( + SELECT + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime4" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + ((t."EndDateTime"::timestamp - t."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" t + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL +DECLARE @p Interval -- Object +SET @p = 05:00:00 + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval < :p + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((extract(second from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) + extract(minute from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 60 + extract(hour from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 3600 + extract(day from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 86400) / 3600)::Float < 5 + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL +DECLARE @p Interval -- Object +SET @p = 02:00:00 + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval < :p + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((extract(second from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) + extract(minute from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 60 + extract(hour from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 3600 + extract(day from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 86400) / 3600)::Float < 2 + diff --git a/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.16).sql new file mode 100644 index 000000000000..1a663361754f --- /dev/null +++ b/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.16).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status", + x."NotificationDateTime" +FROM + ( + SELECT + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime", + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField" + FROM + "Common_Topology_Locations" t + ) x +WHERE + (x."Status" <> 'New' OR x."Status" IS NULL) AND + (x."Status" <> 'Completed' OR x."Status" IS NULL) AND + x."NotificationDateTime" < '2025-08-31 18:26:38.461'::timestamp AND + Date_Trunc('day', x."StartDateTime") < Date_Trunc('day', '2025-08-31 18:26:38.461'::timestamp) + diff --git a/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.16).sql new file mode 100644 index 000000000000..2ba98ef01858 --- /dev/null +++ b/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.16).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +LIMIT 1 + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +LIMIT 1 + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(hour From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int = 13 +LIMIT 1 + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(minute From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int = 51 +LIMIT 1 + +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(second From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int >= 52 AND + Floor(Extract(second From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int <= 54 +LIMIT 1 + diff --git a/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.16).sql b/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.16).sql new file mode 100644 index 000000000000..c875642cf8a8 --- /dev/null +++ b/PostgreSQL.16/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.16).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- PostgreSQL.16 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + Floor(Extract(hour From x."StartDateTime"))::Int = 13 +LIMIT 1 + diff --git a/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.17).sql new file mode 100644 index 000000000000..477db4e4aeae --- /dev/null +++ b/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.17).sql @@ -0,0 +1,3 @@ +BeforeExecute +INSERT BULK "Common_Language"(LanguageID, TimeSpan, TimeSpanNull) + diff --git a/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.17).sql new file mode 100644 index 000000000000..8a1a28613bf2 --- /dev/null +++ b/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.17).sql @@ -0,0 +1,409 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t1."StartDateTime", + t1."StartDateTime2", + t1."EndDateTime", + t1."PreNotification", + t1."PreNotification2", + t1."PreNotification3", + t1."StrField", + t1."Status" +FROM + "Common_Topology_Locations" t1 + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + Floor(Extract(year From x."StartDateTime2"))::Int = 2023 + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL +DECLARE @Value Interval -- Object +SET @Value = 00:05:00 + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + x."StartDateTime2" + :Value > '2025-08-31 18:28:21.978'::timestamp + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL +DECLARE @Value Interval -- Object +SET @Value = 36500.00:00:00 + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + x."StartDateTime2" + :Value > '2025-08-31 18:28:21.981'::timestamp + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + (x."PreNotification" / 10000)::Float, + (x."PreNotification" / 10000000)::Float +FROM + "Common_Topology_Locations" x +WHERE + (x."PreNotification" / 10000000)::Float < (x."PreNotification" / 10000)::Float + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime2" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime4" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime5" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime6" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime7" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime2" - t."PreNotification3" as "Value_1", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."Value_1" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."NotificationDateTime4" +FROM + ( + SELECT + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime4" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + ((t."EndDateTime"::timestamp - t."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" t + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL +DECLARE @p Interval -- Object +SET @p = 05:00:00 + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval < :p + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((extract(second from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) + extract(minute from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 60 + extract(hour from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 3600 + extract(day from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 86400) / 3600)::Float < 5 + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL +DECLARE @p Interval -- Object +SET @p = 02:00:00 + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval < :p + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((extract(second from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) + extract(minute from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 60 + extract(hour from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 3600 + extract(day from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 86400) / 3600)::Float < 2 + diff --git a/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.17).sql new file mode 100644 index 000000000000..59a17fda5dfc --- /dev/null +++ b/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.17).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status", + x."NotificationDateTime" +FROM + ( + SELECT + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime", + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField" + FROM + "Common_Topology_Locations" t + ) x +WHERE + (x."Status" <> 'New' OR x."Status" IS NULL) AND + (x."Status" <> 'Completed' OR x."Status" IS NULL) AND + x."NotificationDateTime" < '2025-08-31 18:28:22.149'::timestamp AND + Date_Trunc('day', x."StartDateTime") < Date_Trunc('day', '2025-08-31 18:28:22.149'::timestamp) + diff --git a/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.17).sql new file mode 100644 index 000000000000..220cee93e12f --- /dev/null +++ b/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.17).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +LIMIT 1 + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +LIMIT 1 + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(hour From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int = 13 +LIMIT 1 + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(minute From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int = 51 +LIMIT 1 + +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(second From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int >= 52 AND + Floor(Extract(second From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int <= 54 +LIMIT 1 + diff --git a/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.17).sql b/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.17).sql new file mode 100644 index 000000000000..cd1a8b6e0d72 --- /dev/null +++ b/PostgreSQL.17/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.17).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- PostgreSQL.17 PostgreSQL.15 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + Floor(Extract(hour From x."StartDateTime"))::Int = 13 +LIMIT 1 + diff --git a/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.18).sql new file mode 100644 index 000000000000..477db4e4aeae --- /dev/null +++ b/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_BulkCopy(PostgreSQL.18).sql @@ -0,0 +1,3 @@ +BeforeExecute +INSERT BULK "Common_Language"(LanguageID, TimeSpan, TimeSpanNull) + diff --git a/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.18).sql new file mode 100644 index 000000000000..af3c8923934c --- /dev/null +++ b/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(PostgreSQL.18).sql @@ -0,0 +1,409 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t1."StartDateTime", + t1."StartDateTime2", + t1."EndDateTime", + t1."PreNotification", + t1."PreNotification2", + t1."PreNotification3", + t1."StrField", + t1."Status" +FROM + "Common_Topology_Locations" t1 + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + Floor(Extract(year From x."StartDateTime2"))::Int = 2023 + +BeforeExecute +-- PostgreSQL.18 PostgreSQL +DECLARE @Value Interval -- Object +SET @Value = 00:05:00 + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + x."StartDateTime2" + :Value > '2025-08-31 18:31:01.926'::timestamp + +BeforeExecute +-- PostgreSQL.18 PostgreSQL +DECLARE @Value Interval -- Object +SET @Value = 36500.00:00:00 + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + x."StartDateTime2" + :Value > '2025-08-31 18:31:01.929'::timestamp + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + (x."PreNotification" / 10000)::Float, + (x."PreNotification" / 10000000)::Float +FROM + "Common_Topology_Locations" x +WHERE + (x."PreNotification" / 10000000)::Float < (x."PreNotification" / 10000)::Float + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime2" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime4" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime5" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime6" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" - t."PreNotification3" as "Value_1", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime7" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + x."StartDateTime", + x."PreNotification", + x."NotificationDateTime", + x."NotificationDateTime2", + x."NotificationDateTime3", + x."NotificationDateTime4", + x."NotificationDateTime5", + x."NotificationDateTime6", + x."NotificationDateTime7", + x."Value_1", + x."Day_1" +FROM + ( + SELECT + t."StartDateTime2" - t."PreNotification3" as "Value_1", + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-1 * (t."PreNotification" / 10000)) * Interval '1 Millisecond' as "NotificationDateTime", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification2") + extract(minute from t."PreNotification2") * 60 + extract(hour from t."PreNotification2") * 3600 + extract(day from t."PreNotification2") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime2", + t."StartDateTime" + (-1 * ((extract(second from t."PreNotification3") + extract(minute from t."PreNotification3") * 60 + extract(hour from t."PreNotification3") * 3600 + extract(day from t."PreNotification3") * 86400) * 1000)) * Interval '1 Millisecond' as "NotificationDateTime3", + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime5", + t."StartDateTime" + (t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime6", + t."StartDateTime2" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime7", + Floor(Extract(day From t."StrField"))::Int as "Day_1" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."Value_1" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + x."NotificationDateTime4" +FROM + ( + SELECT + t."StartDateTime" - t."PreNotification3" as "NotificationDateTime4" + FROM + "Common_Topology_Locations" t + ) x +WHERE + x."NotificationDateTime4" < '2020-02-29 17:54:55.123'::timestamp + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + ((t."EndDateTime"::timestamp - t."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" t + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x + +BeforeExecute +-- PostgreSQL.18 PostgreSQL +DECLARE @p Interval -- Object +SET @p = 05:00:00 + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval < :p + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((extract(second from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) + extract(minute from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 60 + extract(hour from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 3600 + extract(day from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 86400) / 3600)::Float < 5 + +BeforeExecute +-- PostgreSQL.18 PostgreSQL +DECLARE @p Interval -- Object +SET @p = 02:00:00 + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval < :p + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval +FROM + "Common_Topology_Locations" x +WHERE + ((extract(second from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) + extract(minute from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 60 + extract(hour from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 3600 + extract(day from ((x."EndDateTime"::timestamp - x."StartDateTime"::timestamp))::interval) * 86400) / 3600)::Float < 2 + diff --git a/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.18).sql new file mode 100644 index 000000000000..c02bf8faec3c --- /dev/null +++ b/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(PostgreSQL.18).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status", + x."NotificationDateTime" +FROM + ( + SELECT + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' as "NotificationDateTime", + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField" + FROM + "Common_Topology_Locations" t + ) x +WHERE + (x."Status" <> 'New' OR x."Status" IS NULL) AND + (x."Status" <> 'Completed' OR x."Status" IS NULL) AND + x."NotificationDateTime" < '2025-08-31 18:31:02.100'::timestamp AND + Date_Trunc('day', x."StartDateTime") < Date_Trunc('day', '2025-08-31 18:31:02.100'::timestamp) + diff --git a/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.18).sql new file mode 100644 index 000000000000..5f7b3b4e7912 --- /dev/null +++ b/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(PostgreSQL.18).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +LIMIT 1 + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t."StartDateTime", + t."PreNotification", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +LIMIT 1 + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(hour From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int = 13 +LIMIT 1 + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(minute From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int = 51 +LIMIT 1 + +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + t."StartDateTime", + t."StartDateTime2", + t."EndDateTime", + t."PreNotification", + t."PreNotification2", + t."PreNotification3", + t."StrField", + t."Status", + t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond' +FROM + "Common_Topology_Locations" t +WHERE + Floor(Extract(second From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int >= 52 AND + Floor(Extract(second From (t."StartDateTime" + (-t."PreNotification" / 10) * Interval '1 Microsecond')))::Int <= 54 +LIMIT 1 + diff --git a/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.18).sql b/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.18).sql new file mode 100644 index 000000000000..8c8534271463 --- /dev/null +++ b/PostgreSQL.18/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(PostgreSQL.18).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- PostgreSQL.18 PostgreSQL + +SELECT + x."StartDateTime", + x."StartDateTime2", + x."EndDateTime", + x."PreNotification", + x."PreNotification2", + x."PreNotification3", + x."StrField", + x."Status" +FROM + "Common_Topology_Locations" x +WHERE + Floor(Extract(hour From x."StartDateTime"))::Int = 13 +LIMIT 1 + diff --git a/SapHana.Odbc.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SapHana.Odbc.LinqService).sql index a17a1d13f4ee..5f5debaa27c3 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SapHana.Odbc.LinqService).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc SELECT - Nano100_Between("t"."DateTimeValue", Add_Seconds("t"."DateTimeValue", 2023456.7890000001)) / 10000 + Nano100_Between("t"."DateTimeValue", Add_Nano100("t"."DateTimeValue", 20234567890000)) / 10000 FROM "LinqDataTypes" "t" diff --git a/SapHana.Odbc.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SapHana.Odbc.LinqService).sql b/SapHana.Odbc.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SapHana.Odbc.LinqService).sql index a17a1d13f4ee..5f5debaa27c3 100644 --- a/SapHana.Odbc.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SapHana.Odbc.LinqService).sql +++ b/SapHana.Odbc.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SapHana.Odbc.LinqService).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc SELECT - Nano100_Between("t"."DateTimeValue", Add_Seconds("t"."DateTimeValue", 2023456.7890000001)) / 10000 + Nano100_Between("t"."DateTimeValue", Add_Nano100("t"."DateTimeValue", 20234567890000)) / 10000 FROM "LinqDataTypes" "t" diff --git a/SapHana.Odbc/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SapHana.Odbc).sql index a17a1d13f4ee..5f5debaa27c3 100644 --- a/SapHana.Odbc/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SapHana.Odbc).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc SELECT - Nano100_Between("t"."DateTimeValue", Add_Seconds("t"."DateTimeValue", 2023456.7890000001)) / 10000 + Nano100_Between("t"."DateTimeValue", Add_Nano100("t"."DateTimeValue", 20234567890000)) / 10000 FROM "LinqDataTypes" "t" diff --git a/SapHana.Odbc/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SapHana.Odbc).sql b/SapHana.Odbc/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SapHana.Odbc).sql index a17a1d13f4ee..5f5debaa27c3 100644 --- a/SapHana.Odbc/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SapHana.Odbc).sql +++ b/SapHana.Odbc/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SapHana.Odbc).sql @@ -2,7 +2,7 @@ -- SapHana.Odbc SapHanaOdbc SELECT - Nano100_Between("t"."DateTimeValue", Add_Seconds("t"."DateTimeValue", 2023456.7890000001)) / 10000 + Nano100_Between("t"."DateTimeValue", Add_Nano100("t"."DateTimeValue", 20234567890000)) / 10000 FROM "LinqDataTypes" "t" diff --git a/SapHana.Odbc/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SapHana.Odbc).sql b/SapHana.Odbc/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SapHana.Odbc).sql new file mode 100644 index 000000000000..b7fce51386ec --- /dev/null +++ b/SapHana.Odbc/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SapHana.Odbc).sql @@ -0,0 +1,419 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) +FROM + "Common_Topology_Locations" "t" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t1"."StartDateTime", + "t1"."StartDateTime2", + "t1"."EndDateTime", + "t1"."PreNotification", + "t1"."PreNotification2", + "t1"."PreNotification3", + "t1"."StrField", + "t1"."Status" +FROM + "Common_Topology_Locations" "t1" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + Year("x"."StartDateTime2") = 2023 + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc +DECLARE @Value BigInt -- Int64 +SET @Value = 3000000000 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + Add_Nano100("x"."StartDateTime2", ?) > '2025-08-31 18:53:14.596' + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc +DECLARE @Value BigInt -- Int64 +SET @Value = 31536000000000000 + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + Add_Nano100("x"."StartDateTime2", ?) > '2025-08-31 18:53:14.614' + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + CAST("x"."PreNotification" / 10000 AS Double), + CAST("x"."PreNotification" / 10000000 AS Double) +FROM + "Common_Topology_Locations" "x" +WHERE + CAST("x"."PreNotification" / 10000000 AS Double) < CAST("x"."PreNotification" / 10000 AS Double) + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification" / 10000)) * 10000) as "NotificationDateTime", + "t"."StartDateTime", + "t"."PreNotification", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification2" / 10000)) * 10000) as "NotificationDateTime2", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification3" / 10000)) * 10000) as "NotificationDateTime3", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification3" ) as "NotificationDateTime4", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) as "NotificationDateTime5", + Add_Nano100("t"."StartDateTime", "t"."PreNotification" ) as "NotificationDateTime6", + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification" ) as "NotificationDateTime7", + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification3" ) as "Value_1", + DayOfMonth("t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime" < '2020-02-29 17:54:55.123' + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification2" / 10000)) * 10000) as "NotificationDateTime2", + "t"."StartDateTime", + "t"."PreNotification", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification" / 10000)) * 10000) as "NotificationDateTime", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification3" / 10000)) * 10000) as "NotificationDateTime3", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification3" ) as "NotificationDateTime4", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) as "NotificationDateTime5", + Add_Nano100("t"."StartDateTime", "t"."PreNotification" ) as "NotificationDateTime6", + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification" ) as "NotificationDateTime7", + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification3" ) as "Value_1", + DayOfMonth("t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime2" < '2020-02-29 17:54:55.123' + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + Add_Nano100("t"."StartDateTime", -"t"."PreNotification3" ) as "NotificationDateTime4", + "t"."StartDateTime", + "t"."PreNotification", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification" / 10000)) * 10000) as "NotificationDateTime", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification2" / 10000)) * 10000) as "NotificationDateTime2", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification3" / 10000)) * 10000) as "NotificationDateTime3", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) as "NotificationDateTime5", + Add_Nano100("t"."StartDateTime", "t"."PreNotification" ) as "NotificationDateTime6", + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification" ) as "NotificationDateTime7", + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification3" ) as "Value_1", + DayOfMonth("t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime4" < '2020-02-29 17:54:55.123' + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) as "NotificationDateTime5", + "t"."StartDateTime", + "t"."PreNotification", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification" / 10000)) * 10000) as "NotificationDateTime", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification2" / 10000)) * 10000) as "NotificationDateTime2", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification3" / 10000)) * 10000) as "NotificationDateTime3", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification3" ) as "NotificationDateTime4", + Add_Nano100("t"."StartDateTime", "t"."PreNotification" ) as "NotificationDateTime6", + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification" ) as "NotificationDateTime7", + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification3" ) as "Value_1", + DayOfMonth("t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime5" < '2020-02-29 17:54:55.123' + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + Add_Nano100("t"."StartDateTime", "t"."PreNotification" ) as "NotificationDateTime6", + "t"."StartDateTime", + "t"."PreNotification", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification" / 10000)) * 10000) as "NotificationDateTime", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification2" / 10000)) * 10000) as "NotificationDateTime2", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification3" / 10000)) * 10000) as "NotificationDateTime3", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification3" ) as "NotificationDateTime4", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) as "NotificationDateTime5", + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification" ) as "NotificationDateTime7", + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification3" ) as "Value_1", + DayOfMonth("t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime6" < '2020-02-29 17:54:55.123' + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification" ) as "NotificationDateTime7", + "t"."StartDateTime", + "t"."PreNotification", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification" / 10000)) * 10000) as "NotificationDateTime", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification2" / 10000)) * 10000) as "NotificationDateTime2", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification3" / 10000)) * 10000) as "NotificationDateTime3", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification3" ) as "NotificationDateTime4", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) as "NotificationDateTime5", + Add_Nano100("t"."StartDateTime", "t"."PreNotification" ) as "NotificationDateTime6", + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification3" ) as "Value_1", + DayOfMonth("t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime7" < '2020-02-29 17:54:55.123' + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "x"."StartDateTime", + "x"."PreNotification", + "x"."NotificationDateTime", + "x"."NotificationDateTime2", + "x"."NotificationDateTime3", + "x"."NotificationDateTime4", + "x"."NotificationDateTime5", + "x"."NotificationDateTime6", + "x"."NotificationDateTime7", + "x"."Value_1", + "x"."Day_1" +FROM + ( + SELECT + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification3" ) as "Value_1", + "t"."StartDateTime", + "t"."PreNotification", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification" / 10000)) * 10000) as "NotificationDateTime", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification2" / 10000)) * 10000) as "NotificationDateTime2", + Add_Nano100("t"."StartDateTime", (-1 * ("t"."PreNotification3" / 10000)) * 10000) as "NotificationDateTime3", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification3" ) as "NotificationDateTime4", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) as "NotificationDateTime5", + Add_Nano100("t"."StartDateTime", "t"."PreNotification" ) as "NotificationDateTime6", + Add_Nano100("t"."StartDateTime2", -"t"."PreNotification" ) as "NotificationDateTime7", + DayOfMonth("t"."StrField") as "Day_1" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."Value_1" < '2020-02-29 17:54:55.123' + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "x"."NotificationDateTime4" +FROM + ( + SELECT + Add_Nano100("t"."StartDateTime", -"t"."PreNotification3" ) as "NotificationDateTime4" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."NotificationDateTime4" < '2020-02-29 17:54:55.123' + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + Nano100_Between("t"."StartDateTime", "t"."EndDateTime") +FROM + "Common_Topology_Locations" "t" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + Nano100_Between("x"."StartDateTime", "x"."EndDateTime") +FROM + "Common_Topology_Locations" "x" + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + "x"."diff" +FROM + ( + SELECT + Nano100_Between("t"."StartDateTime", "t"."EndDateTime") as "diff" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."diff" < ? + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + Nano100_Between("x"."StartDateTime", "x"."EndDateTime") +FROM + "Common_Topology_Locations" "x" +WHERE + CAST(Nano100_Between("x"."StartDateTime", "x"."EndDateTime") / 36000000000 AS Double) < 5 + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + "x"."diff" +FROM + ( + SELECT + Nano100_Between("t"."StartDateTime", "t"."EndDateTime") as "diff" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + "x"."diff" < ? + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + Nano100_Between("x"."StartDateTime", "x"."EndDateTime") +FROM + "Common_Topology_Locations" "x" +WHERE + CAST(Nano100_Between("x"."StartDateTime", "x"."EndDateTime") / 36000000000 AS Double) < 2 + diff --git a/SapHana.Odbc/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SapHana.Odbc).sql b/SapHana.Odbc/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SapHana.Odbc).sql new file mode 100644 index 000000000000..a92dd3c1341f --- /dev/null +++ b/SapHana.Odbc/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SapHana.Odbc).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status", + "x"."NotificationDateTime" +FROM + ( + SELECT + "t"."Status", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) as "NotificationDateTime", + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField" + FROM + "Common_Topology_Locations" "t" + ) "x" +WHERE + ("x"."Status" <> 'New' OR "x"."Status" IS NULL) AND + ("x"."Status" <> 'Completed' OR "x"."Status" IS NULL) AND + "x"."NotificationDateTime" < '2025-08-31 18:53:15.054' AND + To_Date("x"."StartDateTime") < To_Date('2025-08-31 18:53:15.054') + diff --git a/SapHana.Odbc/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SapHana.Odbc).sql b/SapHana.Odbc/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SapHana.Odbc).sql new file mode 100644 index 000000000000..bccbc262e8e7 --- /dev/null +++ b/SapHana.Odbc/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SapHana.Odbc).sql @@ -0,0 +1,86 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) +FROM + "Common_Topology_Locations" "t" +LIMIT 1 + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t"."StartDateTime", + "t"."PreNotification", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) +FROM + "Common_Topology_Locations" "t" +LIMIT 1 + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) +FROM + "Common_Topology_Locations" "t" +WHERE + Hour(Add_Nano100("t"."StartDateTime", -"t"."PreNotification" )) = 13 +LIMIT 1 + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) +FROM + "Common_Topology_Locations" "t" +WHERE + Minute(Add_Nano100("t"."StartDateTime", -"t"."PreNotification" )) = 51 +LIMIT 1 + +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "t"."StartDateTime", + "t"."StartDateTime2", + "t"."EndDateTime", + "t"."PreNotification", + "t"."PreNotification2", + "t"."PreNotification3", + "t"."StrField", + "t"."Status", + Add_Nano100("t"."StartDateTime", -"t"."PreNotification" ) +FROM + "Common_Topology_Locations" "t" +WHERE + Second(Add_Nano100("t"."StartDateTime", -"t"."PreNotification" )) >= 52 AND + Second(Add_Nano100("t"."StartDateTime", -"t"."PreNotification" )) <= 54 +LIMIT 1 + diff --git a/SapHana.Odbc/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SapHana.Odbc).sql b/SapHana.Odbc/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SapHana.Odbc).sql new file mode 100644 index 000000000000..351a8a6b372a --- /dev/null +++ b/SapHana.Odbc/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SapHana.Odbc).sql @@ -0,0 +1,18 @@ +BeforeExecute +-- SapHana.Odbc SapHanaOdbc + +SELECT + "x"."StartDateTime", + "x"."StartDateTime2", + "x"."EndDateTime", + "x"."PreNotification", + "x"."PreNotification2", + "x"."PreNotification3", + "x"."StrField", + "x"."Status" +FROM + "Common_Topology_Locations" "x" +WHERE + Hour("x"."StartDateTime") = 13 +LIMIT 1 + diff --git a/SqlServer.2016.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016.LinqService).sql index 57f4a8be8ce9..910d313e94d6 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2016.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016.LinqService).sql index 19ea84eeda6e..14fcda5464ac 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016.LinqService).sql index 28404c0b4993..6f815c9f1aba 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016.LinqService).sql index 28404c0b4993..6f815c9f1aba 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016.LinqService).sql index 28404c0b4993..6f815c9f1aba 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016.LinqService).sql index f6e3e96fec74..ee05fb8737fc 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016.LinqService).sql index 39edc1af94f8..bf3778fc9d10 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016.LinqService).sql index 8e32a60f0f58..21395fcb12ff 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016.LinqService).sql index 8f904c0edfca..32ba4b5132f6 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016.LinqService).sql index f43163634b8a..c79e9842815f 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016.LinqService).sql index 28404c0b4993..6f815c9f1aba 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016.LinqService).sql index f6e3e96fec74..ee05fb8737fc 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016.LinqService).sql index 39edc1af94f8..bf3778fc9d10 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016.LinqService).sql index 8e32a60f0f58..21395fcb12ff 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016.LinqService).sql index 8f904c0edfca..32ba4b5132f6 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016.LinqService).sql index 5b510a89003b..f50790764c11 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016.LinqService).sql index 5c383c7a0cdf..6e2c9c7dc4b3 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016.LinqService).sql index aa0d865ed660..1bc3dcecdd85 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016.LinqService).sql index 32c78814b6cf..a59f8ba0bd2b 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016.LinqService).sql index 10e5357023d0..40dba16aacd6 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016.LinqService).sql index 5b510a89003b..f50790764c11 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016.LinqService).sql index 5c383c7a0cdf..6e2c9c7dc4b3 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016.LinqService).sql index aa0d865ed660..1bc3dcecdd85 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016.LinqService).sql index 32c78814b6cf..a59f8ba0bd2b 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016.LinqService).sql b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016.LinqService).sql index 10e5357023d0..40dba16aacd6 100644 --- a/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016.LinqService).sql +++ b/SqlServer.2016.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016.MS.LinqService).sql index f6f659577571..884c6167a3cf 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016.MS.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016.MS.LinqService).sql index 2a1657196c05..b62deae0f4f2 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016.MS.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016.MS.LinqService).sql index bbf66d74be43..f2d98b341b3a 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016.MS.LinqService).sql index bbf66d74be43..f2d98b341b3a 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016.MS.LinqService).sql index bbf66d74be43..f2d98b341b3a 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016.MS.LinqService).sql index cefc746da4ed..3b59f78b3a50 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016.MS.LinqService).sql index c1d5e2af99b3..ae673458e393 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016.MS.LinqService).sql index a9470ed5a1f5..7146dfb1c2c1 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016.MS.LinqService).sql index 8a7d832f74ae..dba2f3b6e956 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016.MS.LinqService).sql index 31e03ab6edf4..a3d7fa7a0057 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016.MS.LinqService).sql index bbf66d74be43..f2d98b341b3a 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016.MS.LinqService).sql index cefc746da4ed..3b59f78b3a50 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016.MS.LinqService).sql index c1d5e2af99b3..ae673458e393 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016.MS.LinqService).sql index a9470ed5a1f5..7146dfb1c2c1 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016.MS.LinqService).sql index 8a7d832f74ae..dba2f3b6e956 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016.MS.LinqService).sql index 921739555c22..3a5fdc967a15 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016.MS.LinqService).sql index 7a0f4e9a164c..4e5ec452f92e 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016.MS.LinqService).sql index e3a48ffa1a69..e8fcf7c0d80e 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016.MS.LinqService).sql index 05d259098af1..df44e58349d0 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016.MS.LinqService).sql index de21cb33b87e..f388fe17fdab 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016.MS.LinqService).sql index 921739555c22..3a5fdc967a15 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016.MS.LinqService).sql index 7a0f4e9a164c..4e5ec452f92e 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016.MS.LinqService).sql index e3a48ffa1a69..e8fcf7c0d80e 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016.MS.LinqService).sql index 05d259098af1..df44e58349d0 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016.MS.LinqService).sql b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016.MS.LinqService).sql index de21cb33b87e..f388fe17fdab 100644 --- a/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016.MS.LinqService).sql +++ b/SqlServer.2016.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016.MS).sql index f6f659577571..884c6167a3cf 100644 --- a/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016.MS).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016.MS).sql index 2a1657196c05..b62deae0f4f2 100644 --- a/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016.MS).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2016.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016.MS).sql index bbf66d74be43..f2d98b341b3a 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016.MS).sql index bbf66d74be43..f2d98b341b3a 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016.MS).sql index bbf66d74be43..f2d98b341b3a 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016.MS).sql index cefc746da4ed..3b59f78b3a50 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016.MS).sql index c1d5e2af99b3..ae673458e393 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016.MS).sql index a9470ed5a1f5..7146dfb1c2c1 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016.MS).sql index 8a7d832f74ae..dba2f3b6e956 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016.MS).sql index 31e03ab6edf4..a3d7fa7a0057 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016.MS).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016.MS).sql index bbf66d74be43..f2d98b341b3a 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016.MS).sql index cefc746da4ed..3b59f78b3a50 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016.MS).sql index c1d5e2af99b3..ae673458e393 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016.MS).sql index a9470ed5a1f5..7146dfb1c2c1 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016.MS).sql index 8a7d832f74ae..dba2f3b6e956 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016.MS).sql index 921739555c22..3a5fdc967a15 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016.MS).sql index 7a0f4e9a164c..4e5ec452f92e 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016.MS).sql index e3a48ffa1a69..e8fcf7c0d80e 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016.MS).sql index 05d259098af1..df44e58349d0 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016.MS).sql index de21cb33b87e..f388fe17fdab 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016.MS).sql index 921739555c22..3a5fdc967a15 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016.MS).sql index 7a0f4e9a164c..4e5ec452f92e 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016.MS).sql index e3a48ffa1a69..e8fcf7c0d80e 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016.MS).sql index 05d259098af1..df44e58349d0 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016.MS).sql index de21cb33b87e..f388fe17fdab 100644 --- a/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016.MS).sql +++ b/SqlServer.2016.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2016.MS SqlServer.2016 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..fa09602176d3 --- /dev/null +++ b/SqlServer.2016.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2016.MS).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 17, 47, 22, 7514319, 7) + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 17, 47, 22, 7614823, 7) + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.2016.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..231331884f60 --- /dev/null +++ b/SqlServer.2016.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2016.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 17, 47, 23, 288643, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 17, 47, 23, 290591, 7) AS Date) + diff --git a/SqlServer.2016.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..d7f67897cc84 --- /dev/null +++ b/SqlServer.2016.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2016.MS).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.2016.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2016.MS).sql b/SqlServer.2016.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2016.MS).sql new file mode 100644 index 000000000000..8a9b5f579195 --- /dev/null +++ b/SqlServer.2016.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2016.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2016.MS SqlServer.2016 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 + diff --git a/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016).sql index 57f4a8be8ce9..910d313e94d6 100644 --- a/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2016).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016).sql index 19ea84eeda6e..14fcda5464ac 100644 --- a/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2016).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2016/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016).sql index 28404c0b4993..6f815c9f1aba 100644 --- a/SqlServer.2016/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016).sql index 28404c0b4993..6f815c9f1aba 100644 --- a/SqlServer.2016/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016).sql index 28404c0b4993..6f815c9f1aba 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016).sql index f6e3e96fec74..ee05fb8737fc 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016).sql index 39edc1af94f8..bf3778fc9d10 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016).sql index 8e32a60f0f58..21395fcb12ff 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016).sql index 8f904c0edfca..32ba4b5132f6 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016).sql index f43163634b8a..c79e9842815f 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2016).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016).sql index 28404c0b4993..6f815c9f1aba 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016).sql index f6e3e96fec74..ee05fb8737fc 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016).sql index 39edc1af94f8..bf3778fc9d10 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016).sql index 8e32a60f0f58..21395fcb12ff 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016).sql index 8f904c0edfca..32ba4b5132f6 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016).sql index 5b510a89003b..f50790764c11 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016).sql index 5c383c7a0cdf..6e2c9c7dc4b3 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016).sql index aa0d865ed660..1bc3dcecdd85 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016).sql index 32c78814b6cf..a59f8ba0bd2b 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016).sql index 10e5357023d0..40dba16aacd6 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016).sql index 5b510a89003b..f50790764c11 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016).sql index 5c383c7a0cdf..6e2c9c7dc4b3 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016).sql index aa0d865ed660..1bc3dcecdd85 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016).sql index 32c78814b6cf..a59f8ba0bd2b 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016).sql b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016).sql index 10e5357023d0..40dba16aacd6 100644 --- a/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016).sql +++ b/SqlServer.2016/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2016).sql @@ -2,7 +2,7 @@ -- SqlServer.2016 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2016/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2016).sql new file mode 100644 index 000000000000..54650a161e6a --- /dev/null +++ b/SqlServer.2016/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2016).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2016 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.2016 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 17, 47, 22, 4811274, 7) + +BeforeExecute +-- SqlServer.2016 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 17, 47, 22, 4919101, 7) + +BeforeExecute +-- SqlServer.2016 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.2016 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2016 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.2016 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2016 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.2016 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2016 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.2016/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2016).sql new file mode 100644 index 000000000000..9ddca1fbe6b5 --- /dev/null +++ b/SqlServer.2016/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2016).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 17, 47, 22, 9984363, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 17, 47, 22, 9986265, 7) AS Date) + diff --git a/SqlServer.2016/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2016).sql new file mode 100644 index 000000000000..7c18828a8284 --- /dev/null +++ b/SqlServer.2016/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2016).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2016 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2016 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.2016 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.2016 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.2016/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2016).sql b/SqlServer.2016/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2016).sql new file mode 100644 index 000000000000..fe6e4a9c70a3 --- /dev/null +++ b/SqlServer.2016/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2016).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2016 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 + diff --git a/SqlServer.2017.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017.LinqService).sql index 7175c1c4fb37..394cc33d98d5 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2017.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017.LinqService).sql index 6e2d2ef9f6b0..440ab82e3533 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017.LinqService).sql index 3f08c77bf049..13e7d83f5837 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017.LinqService).sql index 3f08c77bf049..13e7d83f5837 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017.LinqService).sql index 3f08c77bf049..13e7d83f5837 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017.LinqService).sql index 8ffaea065bc6..5736cd9ae0f3 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017.LinqService).sql index 8df5ad3d5f66..1268a4714a2b 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017.LinqService).sql index 2b387279ebe0..b5bcd4ba9681 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017.LinqService).sql index f02f4820ec9a..765e4a2c4006 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017.LinqService).sql index c7638777156c..134eb5087925 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017.LinqService).sql index 3f08c77bf049..13e7d83f5837 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017.LinqService).sql index 8ffaea065bc6..5736cd9ae0f3 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017.LinqService).sql index 8df5ad3d5f66..1268a4714a2b 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017.LinqService).sql index 2b387279ebe0..b5bcd4ba9681 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017.LinqService).sql index f02f4820ec9a..765e4a2c4006 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017.LinqService).sql index 25587ddc3283..b6a513a53c9c 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017.LinqService).sql index f1c0bc5e5007..01f26afd3061 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017.LinqService).sql index 00bedfee5513..ec39f3172da8 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017.LinqService).sql index 7ff4ef5b452f..963b6f9d018c 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017.LinqService).sql index 7029eda9f0aa..acde74134af1 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017.LinqService).sql index 25587ddc3283..b6a513a53c9c 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017.LinqService).sql index f1c0bc5e5007..01f26afd3061 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017.LinqService).sql index 00bedfee5513..ec39f3172da8 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017.LinqService).sql index 7ff4ef5b452f..963b6f9d018c 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017.LinqService).sql b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017.LinqService).sql index 7029eda9f0aa..acde74134af1 100644 --- a/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017.LinqService).sql +++ b/SqlServer.2017.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017.MS.LinqService).sql index 28fc5dc14c4b..4f05f19f6401 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017.MS.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017.MS.LinqService).sql index 326fb1c5662a..4f27aad9b8ea 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017.MS.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017.MS.LinqService).sql index 1793d444725b..a0346f34936b 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017.MS.LinqService).sql index 1793d444725b..a0346f34936b 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017.MS.LinqService).sql index 1793d444725b..a0346f34936b 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017.MS.LinqService).sql index 75c2a2f25a1d..e796e28c3e7a 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017.MS.LinqService).sql index 1a3907ef4a97..c131555cf31a 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017.MS.LinqService).sql index cfc434afa136..1042b22a7750 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017.MS.LinqService).sql index 31d65e46993c..5e48c678e7f1 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017.MS.LinqService).sql index 2590c68427c8..e91cc588472e 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017.MS.LinqService).sql index 1793d444725b..a0346f34936b 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017.MS.LinqService).sql index 75c2a2f25a1d..e796e28c3e7a 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017.MS.LinqService).sql index 1a3907ef4a97..c131555cf31a 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017.MS.LinqService).sql index cfc434afa136..1042b22a7750 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017.MS.LinqService).sql index 31d65e46993c..5e48c678e7f1 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017.MS.LinqService).sql index da3bf26d0192..8b170f888ae4 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017.MS.LinqService).sql index b0e19a8c9800..3d7e011fa488 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017.MS.LinqService).sql index b58e4304b19d..3e8ab927e3bc 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017.MS.LinqService).sql index a924771e0bd6..e04eb71028a1 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017.MS.LinqService).sql index 18782a7d18f8..fa9412da3d4d 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017.MS.LinqService).sql index da3bf26d0192..8b170f888ae4 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017.MS.LinqService).sql index b0e19a8c9800..3d7e011fa488 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017.MS.LinqService).sql index b58e4304b19d..3e8ab927e3bc 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017.MS.LinqService).sql index a924771e0bd6..e04eb71028a1 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017.MS.LinqService).sql b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017.MS.LinqService).sql index 18782a7d18f8..fa9412da3d4d 100644 --- a/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017.MS.LinqService).sql +++ b/SqlServer.2017.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017.MS).sql index 28fc5dc14c4b..4f05f19f6401 100644 --- a/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017.MS).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017.MS).sql index 326fb1c5662a..4f27aad9b8ea 100644 --- a/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017.MS).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2017.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017.MS).sql index 1793d444725b..a0346f34936b 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017.MS).sql index 1793d444725b..a0346f34936b 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017.MS).sql index 1793d444725b..a0346f34936b 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017.MS).sql index 75c2a2f25a1d..e796e28c3e7a 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017.MS).sql index 1a3907ef4a97..c131555cf31a 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017.MS).sql index cfc434afa136..1042b22a7750 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017.MS).sql index 31d65e46993c..5e48c678e7f1 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017.MS).sql index 2590c68427c8..e91cc588472e 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017.MS).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017.MS).sql index 1793d444725b..a0346f34936b 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017.MS).sql index 75c2a2f25a1d..e796e28c3e7a 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017.MS).sql index 1a3907ef4a97..c131555cf31a 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017.MS).sql index cfc434afa136..1042b22a7750 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017.MS).sql index 31d65e46993c..5e48c678e7f1 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017.MS).sql index da3bf26d0192..8b170f888ae4 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017.MS).sql index b0e19a8c9800..3d7e011fa488 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017.MS).sql index b58e4304b19d..3e8ab927e3bc 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017.MS).sql index a924771e0bd6..e04eb71028a1 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017.MS).sql index 18782a7d18f8..fa9412da3d4d 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017.MS).sql index da3bf26d0192..8b170f888ae4 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017.MS).sql index b0e19a8c9800..3d7e011fa488 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017.MS).sql index b58e4304b19d..3e8ab927e3bc 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017.MS).sql index a924771e0bd6..e04eb71028a1 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017.MS).sql index 18782a7d18f8..fa9412da3d4d 100644 --- a/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017.MS).sql +++ b/SqlServer.2017.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2017.MS SqlServer.2017 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..e44fe0dfc596 --- /dev/null +++ b/SqlServer.2017.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2017.MS).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 42, 39, 8176413, 7) + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 42, 39, 8259248, 7) + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.2017.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..d27a30a9962c --- /dev/null +++ b/SqlServer.2017.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2017.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 18, 42, 40, 508200, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 18, 42, 40, 510070, 7) AS Date) + diff --git a/SqlServer.2017.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..7db3e1108aae --- /dev/null +++ b/SqlServer.2017.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2017.MS).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.2017.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2017.MS).sql b/SqlServer.2017.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2017.MS).sql new file mode 100644 index 000000000000..e7dd357525e2 --- /dev/null +++ b/SqlServer.2017.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2017.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2017.MS SqlServer.2017 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 + diff --git a/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017).sql index 7175c1c4fb37..394cc33d98d5 100644 --- a/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2017).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017).sql index 6e2d2ef9f6b0..440ab82e3533 100644 --- a/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2017).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2017/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017).sql index 3f08c77bf049..13e7d83f5837 100644 --- a/SqlServer.2017/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017).sql index 3f08c77bf049..13e7d83f5837 100644 --- a/SqlServer.2017/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017).sql index 3f08c77bf049..13e7d83f5837 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017).sql index 8ffaea065bc6..5736cd9ae0f3 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017).sql index 8df5ad3d5f66..1268a4714a2b 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017).sql index 2b387279ebe0..b5bcd4ba9681 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017).sql index f02f4820ec9a..765e4a2c4006 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017).sql index c7638777156c..134eb5087925 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2017).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017).sql index 3f08c77bf049..13e7d83f5837 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017).sql index 8ffaea065bc6..5736cd9ae0f3 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017).sql index 8df5ad3d5f66..1268a4714a2b 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017).sql index 2b387279ebe0..b5bcd4ba9681 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017).sql index f02f4820ec9a..765e4a2c4006 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017).sql index 25587ddc3283..b6a513a53c9c 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017).sql index f1c0bc5e5007..01f26afd3061 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017).sql index 00bedfee5513..ec39f3172da8 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017).sql index 7ff4ef5b452f..963b6f9d018c 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017).sql index 7029eda9f0aa..acde74134af1 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017).sql index 25587ddc3283..b6a513a53c9c 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017).sql index f1c0bc5e5007..01f26afd3061 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017).sql index 00bedfee5513..ec39f3172da8 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017).sql index 7ff4ef5b452f..963b6f9d018c 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017).sql b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017).sql index 7029eda9f0aa..acde74134af1 100644 --- a/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017).sql +++ b/SqlServer.2017/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2017).sql @@ -2,7 +2,7 @@ -- SqlServer.2017 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2017/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2017).sql new file mode 100644 index 000000000000..565b472fd495 --- /dev/null +++ b/SqlServer.2017/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2017).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2017 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.2017 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 42, 39, 5725004, 7) + +BeforeExecute +-- SqlServer.2017 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 42, 39, 5812708, 7) + +BeforeExecute +-- SqlServer.2017 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.2017 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2017 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.2017 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2017 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.2017 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2017 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.2017/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2017).sql new file mode 100644 index 000000000000..fb7b245a5769 --- /dev/null +++ b/SqlServer.2017/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2017).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 18, 42, 40, 191286, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 18, 42, 40, 193491, 7) AS Date) + diff --git a/SqlServer.2017/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2017).sql new file mode 100644 index 000000000000..7529ac526384 --- /dev/null +++ b/SqlServer.2017/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2017).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2017 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2017 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.2017 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.2017 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.2017/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2017).sql b/SqlServer.2017/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2017).sql new file mode 100644 index 000000000000..3ff3361f8c7a --- /dev/null +++ b/SqlServer.2017/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2017).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2017 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 + diff --git a/SqlServer.2019.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019.LinqService).sql index 165c3bdd09a7..a5f94c70829e 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2019.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019.LinqService).sql index 1be4eedef65b..7d5520aaee80 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019.LinqService).sql index ef2fe5b03d5f..7cac0a4f00cb 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019.LinqService).sql index ef2fe5b03d5f..7cac0a4f00cb 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019.LinqService).sql index ef2fe5b03d5f..7cac0a4f00cb 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019.LinqService).sql index c261ee00888c..2614d20b9d3d 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019.LinqService).sql index 5de3b014a01c..8d3d1aab85e5 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019.LinqService).sql index 10b896da9ca4..1b9024a37ea1 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019.LinqService).sql index 60d491af1499..94bf57b2e49f 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019.LinqService).sql index de808a98a04a..1b11f1e562af 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019.LinqService).sql index ef2fe5b03d5f..7cac0a4f00cb 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019.LinqService).sql index c261ee00888c..2614d20b9d3d 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019.LinqService).sql index 5de3b014a01c..8d3d1aab85e5 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019.LinqService).sql index 10b896da9ca4..1b9024a37ea1 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019.LinqService).sql index 60d491af1499..94bf57b2e49f 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019.LinqService).sql index 3e7b5eda7306..4074643e0e95 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019.LinqService).sql index 6e6e2be79f2d..4984ce8b12dc 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019.LinqService).sql index cddcbb766e5c..9744c9dfada7 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019.LinqService).sql index 928b61d1130c..2512a25fdef0 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019.LinqService).sql index ba54081e3724..ebb809ebf51e 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019.LinqService).sql index 3e7b5eda7306..4074643e0e95 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019.LinqService).sql index 6e6e2be79f2d..4984ce8b12dc 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019.LinqService).sql index cddcbb766e5c..9744c9dfada7 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019.LinqService).sql index 928b61d1130c..2512a25fdef0 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019.LinqService).sql b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019.LinqService).sql index ba54081e3724..ebb809ebf51e 100644 --- a/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019.LinqService).sql +++ b/SqlServer.2019.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019.MS.LinqService).sql index c1dee3ecdd06..d0c20b0798de 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019.MS.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019.MS.LinqService).sql index 802eedff019b..f2c31f3fd9fd 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019.MS.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019.MS.LinqService).sql index a0d573dbeed9..70c669271478 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019.MS.LinqService).sql index a0d573dbeed9..70c669271478 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019.MS.LinqService).sql index a0d573dbeed9..70c669271478 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019.MS.LinqService).sql index eb115e87468a..5392c8820b6b 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019.MS.LinqService).sql index ccab5c678de7..721c43852624 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019.MS.LinqService).sql index a6fd56f1e6d0..5a5cfae8c4b8 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019.MS.LinqService).sql index bcaa4955ef3c..ba035ae02f09 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019.MS.LinqService).sql index 99afb6560cba..2042a5a53e1a 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019.MS.LinqService).sql index a0d573dbeed9..70c669271478 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019.MS.LinqService).sql index eb115e87468a..5392c8820b6b 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019.MS.LinqService).sql index ccab5c678de7..721c43852624 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019.MS.LinqService).sql index a6fd56f1e6d0..5a5cfae8c4b8 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019.MS.LinqService).sql index bcaa4955ef3c..ba035ae02f09 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019.MS.LinqService).sql index 914a459b4930..80e7f989cbea 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019.MS.LinqService).sql index 4185b81327ec..a9c0f852ed7f 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019.MS.LinqService).sql index bb5eaf80e4b4..3a9c5986b10e 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019.MS.LinqService).sql index 45c6c6467089..74b0eeeaaf9a 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019.MS.LinqService).sql index 1365dc58d3f3..95872f1ee690 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019.MS.LinqService).sql index 914a459b4930..80e7f989cbea 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019.MS.LinqService).sql index 4185b81327ec..a9c0f852ed7f 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019.MS.LinqService).sql index bb5eaf80e4b4..3a9c5986b10e 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019.MS.LinqService).sql index 45c6c6467089..74b0eeeaaf9a 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019.MS.LinqService).sql b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019.MS.LinqService).sql index 1365dc58d3f3..95872f1ee690 100644 --- a/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019.MS.LinqService).sql +++ b/SqlServer.2019.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019.MS).sql index c1dee3ecdd06..d0c20b0798de 100644 --- a/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019.MS).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019.MS).sql index 802eedff019b..f2c31f3fd9fd 100644 --- a/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019.MS).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2019.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019.MS).sql index a0d573dbeed9..70c669271478 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019.MS).sql index a0d573dbeed9..70c669271478 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019.MS).sql index a0d573dbeed9..70c669271478 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019.MS).sql index eb115e87468a..5392c8820b6b 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019.MS).sql index ccab5c678de7..721c43852624 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019.MS).sql index a6fd56f1e6d0..5a5cfae8c4b8 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019.MS).sql index bcaa4955ef3c..ba035ae02f09 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019.MS).sql index 99afb6560cba..2042a5a53e1a 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019.MS).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019.MS).sql index a0d573dbeed9..70c669271478 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019.MS).sql index eb115e87468a..5392c8820b6b 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019.MS).sql index ccab5c678de7..721c43852624 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019.MS).sql index a6fd56f1e6d0..5a5cfae8c4b8 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019.MS).sql index bcaa4955ef3c..ba035ae02f09 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019.MS).sql index 914a459b4930..80e7f989cbea 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019.MS).sql index 4185b81327ec..a9c0f852ed7f 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019.MS).sql index bb5eaf80e4b4..3a9c5986b10e 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019.MS).sql index 45c6c6467089..74b0eeeaaf9a 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019.MS).sql index 1365dc58d3f3..95872f1ee690 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019.MS).sql index 914a459b4930..80e7f989cbea 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019.MS).sql index 4185b81327ec..a9c0f852ed7f 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019.MS).sql index bb5eaf80e4b4..3a9c5986b10e 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019.MS).sql index 45c6c6467089..74b0eeeaaf9a 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019.MS).sql index 1365dc58d3f3..95872f1ee690 100644 --- a/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019.MS).sql +++ b/SqlServer.2019.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2019.MS SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..6f8933c2a8fe --- /dev/null +++ b/SqlServer.2019.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2019.MS).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 17, 35, 3, 3808247, 7) + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 17, 35, 3, 3904639, 7) + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.2019.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..bd55bc2fe719 --- /dev/null +++ b/SqlServer.2019.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2019.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 17, 35, 3, 6454516, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 17, 35, 3, 6456426, 7) AS Date) + diff --git a/SqlServer.2019.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..b44ab821f69c --- /dev/null +++ b/SqlServer.2019.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2019.MS).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.2019.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2019.MS).sql b/SqlServer.2019.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2019.MS).sql new file mode 100644 index 000000000000..f15e864c94d5 --- /dev/null +++ b/SqlServer.2019.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2019.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2019.MS SqlServer.2019 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 + diff --git a/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019).sql index 165c3bdd09a7..a5f94c70829e 100644 --- a/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2019).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019).sql index 1be4eedef65b..7d5520aaee80 100644 --- a/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2019).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2019/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019).sql index ef2fe5b03d5f..7cac0a4f00cb 100644 --- a/SqlServer.2019/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019).sql index ef2fe5b03d5f..7cac0a4f00cb 100644 --- a/SqlServer.2019/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019).sql index ef2fe5b03d5f..7cac0a4f00cb 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019).sql index c261ee00888c..2614d20b9d3d 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019).sql index 5de3b014a01c..8d3d1aab85e5 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019).sql index 10b896da9ca4..1b9024a37ea1 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019).sql index 60d491af1499..94bf57b2e49f 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019).sql index de808a98a04a..1b11f1e562af 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2019).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019).sql index ef2fe5b03d5f..7cac0a4f00cb 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019).sql index c261ee00888c..2614d20b9d3d 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019).sql index 5de3b014a01c..8d3d1aab85e5 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019).sql index 10b896da9ca4..1b9024a37ea1 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019).sql index 60d491af1499..94bf57b2e49f 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019).sql index 3e7b5eda7306..4074643e0e95 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019).sql index 6e6e2be79f2d..4984ce8b12dc 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019).sql index cddcbb766e5c..9744c9dfada7 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019).sql index 928b61d1130c..2512a25fdef0 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019).sql index ba54081e3724..ebb809ebf51e 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019).sql index 3e7b5eda7306..4074643e0e95 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019).sql index 6e6e2be79f2d..4984ce8b12dc 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019).sql index cddcbb766e5c..9744c9dfada7 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019).sql index 928b61d1130c..2512a25fdef0 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019).sql b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019).sql index ba54081e3724..ebb809ebf51e 100644 --- a/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019).sql +++ b/SqlServer.2019/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2019).sql @@ -2,7 +2,7 @@ -- SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2019/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2019).sql new file mode 100644 index 000000000000..8f767a4a1eba --- /dev/null +++ b/SqlServer.2019/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2019).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2019 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.2019 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 17, 35, 3, 1303426, 7) + +BeforeExecute +-- SqlServer.2019 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 17, 35, 3, 1403412, 7) + +BeforeExecute +-- SqlServer.2019 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.2019 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.2019 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.2019/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2019).sql new file mode 100644 index 000000000000..31c9046c01e9 --- /dev/null +++ b/SqlServer.2019/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2019).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 17, 35, 3, 6139936, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 17, 35, 3, 6141873, 7) AS Date) + diff --git a/SqlServer.2019/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2019).sql new file mode 100644 index 000000000000..610770a29d39 --- /dev/null +++ b/SqlServer.2019/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2019).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.2019/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2019).sql b/SqlServer.2019/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2019).sql new file mode 100644 index 000000000000..7e28bd64c31e --- /dev/null +++ b/SqlServer.2019/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2019).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2019 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 + diff --git a/SqlServer.2022.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022.LinqService).sql index 7784edf22bf1..6c3394fdb0e0 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2022.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022.LinqService).sql index 39932575aff1..7ffef6730c39 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022.LinqService).sql index 9219c0b2b24e..2838d6b09a6a 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022.LinqService).sql index 9219c0b2b24e..2838d6b09a6a 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022.LinqService).sql index 9219c0b2b24e..2838d6b09a6a 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022.LinqService).sql index 7c94c36105fc..4c1027f06761 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022.LinqService).sql index 198eeedaa5e5..7bf565c9fac5 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022.LinqService).sql index 0c596e93f7fe..c088fd6400a5 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022.LinqService).sql index 254bded0b23c..7009f760b8f5 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022.LinqService).sql index 75a3ef8ee24b..361ca7f47e25 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022.LinqService).sql index 9219c0b2b24e..2838d6b09a6a 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022.LinqService).sql index 7c94c36105fc..4c1027f06761 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022.LinqService).sql index 198eeedaa5e5..7bf565c9fac5 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022.LinqService).sql index 0c596e93f7fe..c088fd6400a5 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022.LinqService).sql index 254bded0b23c..7009f760b8f5 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022.LinqService).sql index 6521890d607a..a48f13b9c03e 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022.LinqService).sql index 96fe70997614..0798f64e2693 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022.LinqService).sql index 82c0f354ea72..410264cd0646 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022.LinqService).sql index 01f534cd9bae..b6e7b74bf6fd 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022.LinqService).sql index 8f2ed9423175..9b7d37bb6106 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022.LinqService).sql index 6521890d607a..a48f13b9c03e 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022.LinqService).sql index 96fe70997614..0798f64e2693 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022.LinqService).sql index 82c0f354ea72..410264cd0646 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022.LinqService).sql index 01f534cd9bae..b6e7b74bf6fd 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022.LinqService).sql b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022.LinqService).sql index 8f2ed9423175..9b7d37bb6106 100644 --- a/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022.LinqService).sql +++ b/SqlServer.2022.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022.MS.LinqService).sql index c3b20281dfbd..288ab3e02bd9 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022.MS.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022.MS.LinqService).sql index 7aeb319c20a6..f5f0168acaa7 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022.MS.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022.MS.LinqService).sql index 0e70af123214..fffffb668808 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022.MS.LinqService).sql index 0e70af123214..fffffb668808 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022.MS.LinqService).sql index 0e70af123214..fffffb668808 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022.MS.LinqService).sql index 4b4c05919314..6fbaf513691b 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022.MS.LinqService).sql index 0a9f43971809..e44975cdb129 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022.MS.LinqService).sql index 65f49d300331..0d75cac4dde4 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022.MS.LinqService).sql index fb8a81034595..a0905253502d 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022.MS.LinqService).sql index 33356239b011..d75ee1a6bac8 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022.MS.LinqService).sql index 0e70af123214..fffffb668808 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022.MS.LinqService).sql index 4b4c05919314..6fbaf513691b 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022.MS.LinqService).sql index 0a9f43971809..e44975cdb129 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022.MS.LinqService).sql index 65f49d300331..0d75cac4dde4 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022.MS.LinqService).sql index fb8a81034595..a0905253502d 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022.MS.LinqService).sql index cd6e8a97b9b4..e88f1f0caf64 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022.MS.LinqService).sql index 0bcfe4de3616..81660a70039b 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022.MS.LinqService).sql index c4b713cbf984..535e0325a82e 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022.MS.LinqService).sql index 8cf36108f363..d78038b7dd7a 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022.MS.LinqService).sql index 8babfa6cdf8b..1248936029e8 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022.MS.LinqService).sql index cd6e8a97b9b4..e88f1f0caf64 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022.MS.LinqService).sql index 0bcfe4de3616..81660a70039b 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022.MS.LinqService).sql index c4b713cbf984..535e0325a82e 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022.MS.LinqService).sql index 8cf36108f363..d78038b7dd7a 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022.MS.LinqService).sql b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022.MS.LinqService).sql index 8babfa6cdf8b..1248936029e8 100644 --- a/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022.MS.LinqService).sql +++ b/SqlServer.2022.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022.MS).sql index c3b20281dfbd..288ab3e02bd9 100644 --- a/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022.MS).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022.MS).sql index 7aeb319c20a6..f5f0168acaa7 100644 --- a/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022.MS).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2022.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022.MS).sql index 0e70af123214..fffffb668808 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022.MS).sql index 0e70af123214..fffffb668808 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022.MS).sql index 0e70af123214..fffffb668808 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022.MS).sql index 4b4c05919314..6fbaf513691b 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022.MS).sql index 0a9f43971809..e44975cdb129 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022.MS).sql index 65f49d300331..0d75cac4dde4 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022.MS).sql index fb8a81034595..a0905253502d 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022.MS).sql index 33356239b011..d75ee1a6bac8 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022.MS).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022.MS).sql index 0e70af123214..fffffb668808 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022.MS).sql index 4b4c05919314..6fbaf513691b 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022.MS).sql index 0a9f43971809..e44975cdb129 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022.MS).sql index 65f49d300331..0d75cac4dde4 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022.MS).sql index fb8a81034595..a0905253502d 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022.MS).sql index cd6e8a97b9b4..e88f1f0caf64 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022.MS).sql index 0bcfe4de3616..81660a70039b 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022.MS).sql index c4b713cbf984..535e0325a82e 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022.MS).sql index 8cf36108f363..d78038b7dd7a 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022.MS).sql index 8babfa6cdf8b..1248936029e8 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022.MS).sql index cd6e8a97b9b4..e88f1f0caf64 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022.MS).sql index 0bcfe4de3616..81660a70039b 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022.MS).sql index c4b713cbf984..535e0325a82e 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022.MS).sql index 8cf36108f363..d78038b7dd7a 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022.MS).sql index 8babfa6cdf8b..1248936029e8 100644 --- a/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022.MS).sql +++ b/SqlServer.2022.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2022.MS SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..5cb069f4befb --- /dev/null +++ b/SqlServer.2022.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2022.MS).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 46, 54, 3137797, 7) + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 46, 54, 3233720, 7) + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.2022.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..8e735c16c3e4 --- /dev/null +++ b/SqlServer.2022.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2022.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 18, 46, 54, 5457918, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 18, 46, 54, 5460352, 7) AS Date) + diff --git a/SqlServer.2022.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..f9399502d9ba --- /dev/null +++ b/SqlServer.2022.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2022.MS).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.2022.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2022.MS).sql b/SqlServer.2022.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2022.MS).sql new file mode 100644 index 000000000000..8b4f3e2ae776 --- /dev/null +++ b/SqlServer.2022.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2022.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2022.MS SqlServer.2022 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 + diff --git a/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022).sql index 7784edf22bf1..6c3394fdb0e0 100644 --- a/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2022).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022).sql index 39932575aff1..7ffef6730c39 100644 --- a/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2022).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2022/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022).sql index 9219c0b2b24e..2838d6b09a6a 100644 --- a/SqlServer.2022/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022).sql index 9219c0b2b24e..2838d6b09a6a 100644 --- a/SqlServer.2022/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022).sql index 9219c0b2b24e..2838d6b09a6a 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022).sql index 7c94c36105fc..4c1027f06761 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022).sql index 198eeedaa5e5..7bf565c9fac5 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022).sql index 0c596e93f7fe..c088fd6400a5 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022).sql index 254bded0b23c..7009f760b8f5 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022).sql index 75a3ef8ee24b..361ca7f47e25 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2022).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022).sql index 9219c0b2b24e..2838d6b09a6a 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022).sql index 7c94c36105fc..4c1027f06761 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022).sql index 198eeedaa5e5..7bf565c9fac5 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022).sql index 0c596e93f7fe..c088fd6400a5 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022).sql index 254bded0b23c..7009f760b8f5 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022).sql index 6521890d607a..a48f13b9c03e 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022).sql index 96fe70997614..0798f64e2693 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022).sql index 82c0f354ea72..410264cd0646 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022).sql index 01f534cd9bae..b6e7b74bf6fd 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022).sql index 8f2ed9423175..9b7d37bb6106 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022).sql index 6521890d607a..a48f13b9c03e 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022).sql index 96fe70997614..0798f64e2693 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022).sql index 82c0f354ea72..410264cd0646 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022).sql index 01f534cd9bae..b6e7b74bf6fd 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022).sql b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022).sql index 8f2ed9423175..9b7d37bb6106 100644 --- a/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022).sql +++ b/SqlServer.2022/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2022).sql @@ -2,7 +2,7 @@ -- SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2022/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2022).sql new file mode 100644 index 000000000000..c98f35a6d64d --- /dev/null +++ b/SqlServer.2022/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2022).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2022 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.2022 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 46, 54, 641124, 7) + +BeforeExecute +-- SqlServer.2022 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 46, 54, 727996, 7) + +BeforeExecute +-- SqlServer.2022 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.2022 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.2022 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.2022/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2022).sql new file mode 100644 index 000000000000..8514f49729d0 --- /dev/null +++ b/SqlServer.2022/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2022).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 18, 46, 54, 5169005, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 18, 46, 54, 5171417, 7) AS Date) + diff --git a/SqlServer.2022/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2022).sql new file mode 100644 index 000000000000..780bf99f59e9 --- /dev/null +++ b/SqlServer.2022/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2022).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.2022/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2022).sql b/SqlServer.2022/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2022).sql new file mode 100644 index 000000000000..fac16560eca5 --- /dev/null +++ b/SqlServer.2022/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2022).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2022 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 + diff --git a/SqlServer.2025.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025.LinqService).sql index 2e383fa0f902..949de232f5e5 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2025.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025.LinqService).sql index 46f20698439a..ebf31b5b022d 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025.LinqService).sql index be19a479fe43..3b05c13d7ce2 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025.LinqService).sql index be19a479fe43..3b05c13d7ce2 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025.LinqService).sql index be19a479fe43..3b05c13d7ce2 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025.LinqService).sql index 3e93e612bdd6..a826576a1ecf 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025.LinqService).sql index dacd5ec1009f..319a322bb026 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025.LinqService).sql index 49b63f532cc0..ab842a8d80a6 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025.LinqService).sql index 071936dc9f95..c631cb64d4fd 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025.LinqService).sql index 7c42166e5ac8..85f41b671a7b 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025.LinqService).sql index be19a479fe43..3b05c13d7ce2 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025.LinqService).sql index 3e93e612bdd6..a826576a1ecf 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025.LinqService).sql index dacd5ec1009f..319a322bb026 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025.LinqService).sql index 49b63f532cc0..ab842a8d80a6 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025.LinqService).sql index 071936dc9f95..c631cb64d4fd 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025.LinqService).sql index 482a8fd857a9..e78d0a8e5d82 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025.LinqService).sql index 3a0ef788ab57..6a6a54bbb332 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025.LinqService).sql index 778d4404027f..a44129bcffed 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025.LinqService).sql index 57592a9b4be3..18a2f0b84623 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025.LinqService).sql index 99fae08a8ef5..5c14f56d7c47 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025.LinqService).sql index 482a8fd857a9..e78d0a8e5d82 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025.LinqService).sql index 3a0ef788ab57..6a6a54bbb332 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025.LinqService).sql index 778d4404027f..a44129bcffed 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025.LinqService).sql index 57592a9b4be3..18a2f0b84623 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025.LinqService).sql b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025.LinqService).sql index 99fae08a8ef5..5c14f56d7c47 100644 --- a/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025.LinqService).sql +++ b/SqlServer.2025.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025.MS.LinqService).sql index 1077246deea0..9891bc147c9f 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025.MS.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025.MS.LinqService).sql index ef924f4a4b72..fb34fbd19382 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025.MS.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025.MS.LinqService).sql index c9d19760c723..bf4ab637b3b0 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025.MS.LinqService).sql index c9d19760c723..bf4ab637b3b0 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025.MS.LinqService).sql index c9d19760c723..bf4ab637b3b0 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025.MS.LinqService).sql index d2becabfa952..36112c879336 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025.MS.LinqService).sql index 74a12b150ab0..9bfd6cd9de72 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025.MS.LinqService).sql index 71b774a9de84..676777ca252d 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025.MS.LinqService).sql index 5d86b0b19020..fa2d8873d2f5 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025.MS.LinqService).sql index 46b93b981db1..fee492baaedc 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025.MS.LinqService).sql index c9d19760c723..bf4ab637b3b0 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025.MS.LinqService).sql index d2becabfa952..36112c879336 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025.MS.LinqService).sql index 74a12b150ab0..9bfd6cd9de72 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025.MS.LinqService).sql index 71b774a9de84..676777ca252d 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025.MS.LinqService).sql index 5d86b0b19020..fa2d8873d2f5 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025.MS.LinqService).sql index 8cd73c1fc794..3b783a588ae5 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025.MS.LinqService).sql index 1d95fc11186b..09e37da1baee 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025.MS.LinqService).sql index 4dba91fe3eb3..527a38b9af21 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025.MS.LinqService).sql index 85d748f46631..45fd336c34a3 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025.MS.LinqService).sql index e23522376921..9be6493ab359 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025.MS.LinqService).sql index 8cd73c1fc794..3b783a588ae5 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025.MS.LinqService).sql index 1d95fc11186b..09e37da1baee 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025.MS.LinqService).sql index 4dba91fe3eb3..527a38b9af21 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025.MS.LinqService).sql index 85d748f46631..45fd336c34a3 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025.MS.LinqService).sql b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025.MS.LinqService).sql index e23522376921..9be6493ab359 100644 --- a/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025.MS.LinqService).sql +++ b/SqlServer.2025.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025.MS).sql index 1077246deea0..9891bc147c9f 100644 --- a/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025.MS).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025.MS).sql index ef924f4a4b72..fb34fbd19382 100644 --- a/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025.MS).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2025.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025.MS).sql index c9d19760c723..bf4ab637b3b0 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025.MS).sql index c9d19760c723..bf4ab637b3b0 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025.MS).sql index c9d19760c723..bf4ab637b3b0 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025.MS).sql index d2becabfa952..36112c879336 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025.MS).sql index 74a12b150ab0..9bfd6cd9de72 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025.MS).sql index 71b774a9de84..676777ca252d 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025.MS).sql index 5d86b0b19020..fa2d8873d2f5 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025.MS).sql index 46b93b981db1..fee492baaedc 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025.MS).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025.MS).sql index c9d19760c723..bf4ab637b3b0 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025.MS).sql index d2becabfa952..36112c879336 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025.MS).sql index 74a12b150ab0..9bfd6cd9de72 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025.MS).sql index 71b774a9de84..676777ca252d 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025.MS).sql index 5d86b0b19020..fa2d8873d2f5 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025.MS).sql index 8cd73c1fc794..3b783a588ae5 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025.MS).sql index 1d95fc11186b..09e37da1baee 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025.MS).sql index 4dba91fe3eb3..527a38b9af21 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025.MS).sql index 85d748f46631..45fd336c34a3 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025.MS).sql index e23522376921..9be6493ab359 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025.MS).sql index 8cd73c1fc794..3b783a588ae5 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025.MS).sql index 1d95fc11186b..09e37da1baee 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025.MS).sql index 4dba91fe3eb3..527a38b9af21 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025.MS).sql index 85d748f46631..45fd336c34a3 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025.MS).sql index e23522376921..9be6493ab359 100644 --- a/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025.MS).sql +++ b/SqlServer.2025.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..42f9869f23dd --- /dev/null +++ b/SqlServer.2025.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2025.MS).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 47, 26, 4543465, 7) + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 47, 26, 4628795, 7) + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.2025.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..bf8c18c5b87b --- /dev/null +++ b/SqlServer.2025.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2025.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 18, 47, 26, 7024136, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 18, 47, 26, 7025942, 7) AS Date) + diff --git a/SqlServer.2025.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..168d73b7581e --- /dev/null +++ b/SqlServer.2025.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2025.MS).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.2025.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2025.MS).sql b/SqlServer.2025.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2025.MS).sql new file mode 100644 index 000000000000..e1385f10db3f --- /dev/null +++ b/SqlServer.2025.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2025.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2025.MS SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 + diff --git a/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025).sql index 2e383fa0f902..949de232f5e5 100644 --- a/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.2025).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025).sql index 46f20698439a..ebf31b5b022d 100644 --- a/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.2025).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.2025/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025).sql index be19a479fe43..3b05c13d7ce2 100644 --- a/SqlServer.2025/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025).sql index be19a479fe43..3b05c13d7ce2 100644 --- a/SqlServer.2025/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025).sql index be19a479fe43..3b05c13d7ce2 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025).sql index 3e93e612bdd6..a826576a1ecf 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025).sql index dacd5ec1009f..319a322bb026 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025).sql index 49b63f532cc0..ab842a8d80a6 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025).sql index 071936dc9f95..c631cb64d4fd 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025).sql index 7c42166e5ac8..85f41b671a7b 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.2025).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025).sql index be19a479fe43..3b05c13d7ce2 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025).sql index 3e93e612bdd6..a826576a1ecf 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025).sql index dacd5ec1009f..319a322bb026 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025).sql index 49b63f532cc0..ab842a8d80a6 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025).sql index 071936dc9f95..c631cb64d4fd 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025).sql index 482a8fd857a9..e78d0a8e5d82 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025).sql index 3a0ef788ab57..6a6a54bbb332 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025).sql index 778d4404027f..a44129bcffed 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025).sql index 57592a9b4be3..18a2f0b84623 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025).sql index 99fae08a8ef5..5c14f56d7c47 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025).sql index 482a8fd857a9..e78d0a8e5d82 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025).sql index 3a0ef788ab57..6a6a54bbb332 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025).sql index 778d4404027f..a44129bcffed 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025).sql index 57592a9b4be3..18a2f0b84623 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025).sql b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025).sql index 99fae08a8ef5..5c14f56d7c47 100644 --- a/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025).sql +++ b/SqlServer.2025/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.2025).sql @@ -2,7 +2,7 @@ -- SqlServer.2025 SqlServer.2022 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.2025/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2025).sql new file mode 100644 index 000000000000..b93b94a79a3c --- /dev/null +++ b/SqlServer.2025/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.2025).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 47, 26, 2016183, 7) + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 47, 26, 2110389, 7) + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.2025/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2025).sql new file mode 100644 index 000000000000..56cbd133143c --- /dev/null +++ b/SqlServer.2025/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.2025).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 18, 47, 26, 6741966, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 18, 47, 26, 6743861, 7) AS Date) + diff --git a/SqlServer.2025/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2025).sql new file mode 100644 index 000000000000..4c3224ee1ca0 --- /dev/null +++ b/SqlServer.2025/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.2025).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.2025/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2025).sql b/SqlServer.2025/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2025).sql new file mode 100644 index 000000000000..db37a874b7bf --- /dev/null +++ b/SqlServer.2025/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.2025).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.2025 SqlServer.2022 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 + diff --git a/SqlServer.Contained.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained.LinqService).sql index e5075e11d30d..18491e9aeac8 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.Contained.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained.LinqService).sql index 707ea1281e61..ced95ff7a9a1 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained.LinqService).sql index 6812313fde35..020791d9961f 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained.LinqService).sql index 6812313fde35..020791d9961f 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained.LinqService).sql index 6812313fde35..020791d9961f 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained.LinqService).sql index b8b124baf6d6..df8463b4b27a 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained.LinqService).sql index 27313e680b5f..f00695d43e0c 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained.LinqService).sql index 58896f474148..91b5c2a7eecf 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained.LinqService).sql index b3c00a8da526..aa1ef4e64989 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained.LinqService).sql index e750be20080a..f02afd3476f7 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained.LinqService).sql index 6812313fde35..020791d9961f 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained.LinqService).sql index b8b124baf6d6..df8463b4b27a 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained.LinqService).sql index 27313e680b5f..f00695d43e0c 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained.LinqService).sql index 58896f474148..91b5c2a7eecf 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained.LinqService).sql index b3c00a8da526..aa1ef4e64989 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained.LinqService).sql index 2fa6b9b24636..dc72b3df8eb8 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained.LinqService).sql index ba0c7236fa96..968acc72118f 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained.LinqService).sql index 4a560c0a0dff..e2a3f41d81af 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained.LinqService).sql index 33a42d8a89e9..7658c6f94914 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained.LinqService).sql index 9517cbba2c3e..573087e87ba7 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained.LinqService).sql index 2fa6b9b24636..dc72b3df8eb8 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained.LinqService).sql index ba0c7236fa96..968acc72118f 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained.LinqService).sql index 4a560c0a0dff..e2a3f41d81af 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained.LinqService).sql index 33a42d8a89e9..7658c6f94914 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained.LinqService).sql b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained.LinqService).sql index 9517cbba2c3e..573087e87ba7 100644 --- a/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained.LinqService).sql +++ b/SqlServer.Contained.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained.MS.LinqService).sql index 1a1e0f61f519..49cab7d3b444 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained.MS.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained.MS.LinqService).sql index 71311457bb65..83ee496fa8ea 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained.MS.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained.MS.LinqService).sql index 6877614e1422..d63d1e2db9f4 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained.MS.LinqService).sql index 6877614e1422..d63d1e2db9f4 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained.MS.LinqService).sql index 6877614e1422..d63d1e2db9f4 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained.MS.LinqService).sql index 29b70620fff9..a804df90fe19 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained.MS.LinqService).sql index 8e125fa4d3d6..90dbcc5363a9 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained.MS.LinqService).sql index 442e5edf547c..7f00bc6b4079 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained.MS.LinqService).sql index 3ab11d318d36..d9437f07ba38 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained.MS.LinqService).sql index 0130f3831ab8..e6595bf1fd2d 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained.MS.LinqService).sql index 6877614e1422..d63d1e2db9f4 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained.MS.LinqService).sql index 29b70620fff9..a804df90fe19 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained.MS.LinqService).sql index 8e125fa4d3d6..90dbcc5363a9 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained.MS.LinqService).sql index 442e5edf547c..7f00bc6b4079 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained.MS.LinqService).sql index 3ab11d318d36..d9437f07ba38 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained.MS.LinqService).sql index ae4d10a9dcff..2f0c03063205 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained.MS.LinqService).sql index 02496fa67ee9..be648c1a45e8 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained.MS.LinqService).sql index 2c944e6aadbc..42669acda6ad 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained.MS.LinqService).sql index 6d14a0596fed..65673fd8b6bf 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained.MS.LinqService).sql index fc10133992f6..8338e016d3de 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained.MS.LinqService).sql index ae4d10a9dcff..2f0c03063205 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained.MS.LinqService).sql index 02496fa67ee9..be648c1a45e8 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained.MS.LinqService).sql index 2c944e6aadbc..42669acda6ad 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained.MS.LinqService).sql index 6d14a0596fed..65673fd8b6bf 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained.MS.LinqService).sql b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained.MS.LinqService).sql index fc10133992f6..8338e016d3de 100644 --- a/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained.MS.LinqService).sql +++ b/SqlServer.Contained.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained.MS).sql index 1a1e0f61f519..49cab7d3b444 100644 --- a/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained.MS).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained.MS).sql index 71311457bb65..83ee496fa8ea 100644 --- a/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained.MS).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained.MS).sql index 6877614e1422..d63d1e2db9f4 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained.MS).sql index 6877614e1422..d63d1e2db9f4 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained.MS).sql index 6877614e1422..d63d1e2db9f4 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained.MS).sql index 29b70620fff9..a804df90fe19 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained.MS).sql index 8e125fa4d3d6..90dbcc5363a9 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained.MS).sql index 442e5edf547c..7f00bc6b4079 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained.MS).sql index 3ab11d318d36..d9437f07ba38 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained.MS).sql index 0130f3831ab8..e6595bf1fd2d 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained.MS).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained.MS).sql index 6877614e1422..d63d1e2db9f4 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained.MS).sql index 29b70620fff9..a804df90fe19 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained.MS).sql index 8e125fa4d3d6..90dbcc5363a9 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained.MS).sql index 442e5edf547c..7f00bc6b4079 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained.MS).sql index 3ab11d318d36..d9437f07ba38 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained.MS).sql index ae4d10a9dcff..2f0c03063205 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained.MS).sql index 02496fa67ee9..be648c1a45e8 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained.MS).sql index 2c944e6aadbc..42669acda6ad 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained.MS).sql index 6d14a0596fed..65673fd8b6bf 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained.MS).sql index fc10133992f6..8338e016d3de 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained.MS).sql index ae4d10a9dcff..2f0c03063205 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained.MS).sql index 02496fa67ee9..be648c1a45e8 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained.MS).sql index 2c944e6aadbc..42669acda6ad 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained.MS).sql index 6d14a0596fed..65673fd8b6bf 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained.MS).sql index fc10133992f6..8338e016d3de 100644 --- a/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained.MS).sql +++ b/SqlServer.Contained.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained.MS SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..8f676d8510fc --- /dev/null +++ b/SqlServer.Contained.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.Contained.MS).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 5, 9129357, 7) + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 5, 9238957, 7) + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.Contained.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..b21763db4268 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.Contained.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 6, 2405081, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 6, 2406927, 7) AS Date) + diff --git a/SqlServer.Contained.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..3e39a948ab42 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.Contained.MS).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.Contained.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.Contained.MS).sql b/SqlServer.Contained.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.Contained.MS).sql new file mode 100644 index 000000000000..6f472066e1e6 --- /dev/null +++ b/SqlServer.Contained.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.Contained.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.Contained.MS SqlServer.2019 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 + diff --git a/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained).sql index e5075e11d30d..18491e9aeac8 100644 --- a/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.Contained).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained).sql index 707ea1281e61..ced95ff7a9a1 100644 --- a/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.Contained).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.Contained/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained).sql index 6812313fde35..020791d9961f 100644 --- a/SqlServer.Contained/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained).sql index 6812313fde35..020791d9961f 100644 --- a/SqlServer.Contained/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained).sql index 6812313fde35..020791d9961f 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained).sql index b8b124baf6d6..df8463b4b27a 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained).sql index 27313e680b5f..f00695d43e0c 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained).sql index 58896f474148..91b5c2a7eecf 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained).sql index b3c00a8da526..aa1ef4e64989 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained).sql index e750be20080a..f02afd3476f7 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.Contained).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained).sql index 6812313fde35..020791d9961f 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained).sql index b8b124baf6d6..df8463b4b27a 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained).sql index 27313e680b5f..f00695d43e0c 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained).sql index 58896f474148..91b5c2a7eecf 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained).sql index b3c00a8da526..aa1ef4e64989 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained).sql index 2fa6b9b24636..dc72b3df8eb8 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained).sql index ba0c7236fa96..968acc72118f 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained).sql index 4a560c0a0dff..e2a3f41d81af 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained).sql index 33a42d8a89e9..7658c6f94914 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained).sql index 9517cbba2c3e..573087e87ba7 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained).sql index 2fa6b9b24636..dc72b3df8eb8 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained).sql index ba0c7236fa96..968acc72118f 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained).sql index 4a560c0a0dff..e2a3f41d81af 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained).sql index 33a42d8a89e9..7658c6f94914 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained).sql b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained).sql index 9517cbba2c3e..573087e87ba7 100644 --- a/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained).sql +++ b/SqlServer.Contained/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.Contained).sql @@ -2,7 +2,7 @@ -- SqlServer.Contained SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.Contained/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.Contained).sql new file mode 100644 index 000000000000..565177c776ea --- /dev/null +++ b/SqlServer.Contained/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.Contained).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 5, 6582716, 7) + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 5, 6685121, 7) + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.Contained/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.Contained).sql new file mode 100644 index 000000000000..79f080961a77 --- /dev/null +++ b/SqlServer.Contained/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.Contained).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 6, 2162426, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 6, 2164297, 7) AS Date) + diff --git a/SqlServer.Contained/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.Contained).sql new file mode 100644 index 000000000000..6f5bb02cb6ad --- /dev/null +++ b/SqlServer.Contained/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.Contained).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.Contained/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.Contained).sql b/SqlServer.Contained/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.Contained).sql new file mode 100644 index 000000000000..92c5ccf36d73 --- /dev/null +++ b/SqlServer.Contained/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.Contained).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.Contained SqlServer.2019 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 + diff --git a/SqlServer.SA.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA.LinqService).sql index 991a617c5239..bb8f0a1ee447 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.SA.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA.LinqService).sql index 74a807956f61..54b5c0cfe68d 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA.LinqService).sql index 09f746aec50d..e6fb986cbf4d 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA.LinqService).sql index 09f746aec50d..e6fb986cbf4d 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA.LinqService).sql index 09f746aec50d..e6fb986cbf4d 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA.LinqService).sql index 774714401e5e..12c10762fd3b 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA.LinqService).sql index c8bc848c037e..c7dedd6ecc54 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA.LinqService).sql index 0c10119004b6..9ac6016371a4 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA.LinqService).sql index 6d67a04cd15a..e155b121bddb 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA.LinqService).sql index b9914a068457..e6495cb23422 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA.LinqService).sql index 09f746aec50d..e6fb986cbf4d 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA.LinqService).sql index 774714401e5e..12c10762fd3b 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA.LinqService).sql index c8bc848c037e..c7dedd6ecc54 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA.LinqService).sql index 0c10119004b6..9ac6016371a4 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA.LinqService).sql index 6d67a04cd15a..e155b121bddb 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA.LinqService).sql index 6b7694a9f5b5..04f36fd5035a 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA.LinqService).sql index 5beeb729e203..04d6281e3525 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA.LinqService).sql index e5304c87cbd6..8845a757c564 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA.LinqService).sql index fdbaf2f4a8de..2e84c2e1fb4c 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA.LinqService).sql index 3a6e2e9b4f2d..42dda0f0c157 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA.LinqService).sql index 6b7694a9f5b5..04f36fd5035a 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA.LinqService).sql index 5beeb729e203..04d6281e3525 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA.LinqService).sql index e5304c87cbd6..8845a757c564 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA.LinqService).sql index fdbaf2f4a8de..2e84c2e1fb4c 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA.LinqService).sql b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA.LinqService).sql index 3a6e2e9b4f2d..42dda0f0c157 100644 --- a/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA.LinqService).sql +++ b/SqlServer.SA.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA.MS.LinqService).sql index 5601af537cf6..01e0081aff28 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA.MS.LinqService).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA.MS.LinqService).sql index 3e54c233a495..fec4466c72dc 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA.MS.LinqService).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA.MS.LinqService).sql index 3ca1f90aeb67..79512001a8e3 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA.MS.LinqService).sql index 3ca1f90aeb67..79512001a8e3 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA.MS.LinqService).sql index 3ca1f90aeb67..79512001a8e3 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA.MS.LinqService).sql index 597983559022..ed7a812a3a59 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA.MS.LinqService).sql index 8073e7a10cbe..926b4fa6a453 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA.MS.LinqService).sql index a86adb9010f9..bf1baa349080 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA.MS.LinqService).sql index 9ac239b845ff..ac9af6819091 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA.MS.LinqService).sql index b4bc38d7bff8..515affa8d429 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA.MS.LinqService).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA.MS.LinqService).sql index 3ca1f90aeb67..79512001a8e3 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA.MS.LinqService).sql index 597983559022..ed7a812a3a59 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA.MS.LinqService).sql index 8073e7a10cbe..926b4fa6a453 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA.MS.LinqService).sql index a86adb9010f9..bf1baa349080 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA.MS.LinqService).sql index 9ac239b845ff..ac9af6819091 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA.MS.LinqService).sql index 621f2d540577..2c5cc0dcec1b 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA.MS.LinqService).sql index cc020f7134f5..764caea4b56a 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA.MS.LinqService).sql index ae3cc41184fc..fffb8492d537 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA.MS.LinqService).sql index d4109a5f6ade..9c476ce52209 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA.MS.LinqService).sql index 4cde89753d60..8c758b669733 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA.MS.LinqService).sql index 621f2d540577..2c5cc0dcec1b 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA.MS.LinqService).sql index cc020f7134f5..764caea4b56a 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA.MS.LinqService).sql index ae3cc41184fc..fffb8492d537 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA.MS.LinqService).sql index d4109a5f6ade..9c476ce52209 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA.MS.LinqService).sql b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA.MS.LinqService).sql index 4cde89753d60..8c758b669733 100644 --- a/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA.MS.LinqService).sql +++ b/SqlServer.SA.MS.LinqService/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA.MS.LinqService).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA.MS).sql index 5601af537cf6..01e0081aff28 100644 --- a/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA.MS).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA.MS).sql index 3e54c233a495..fec4466c72dc 100644 --- a/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA.MS).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.SA.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA.MS).sql index 3ca1f90aeb67..79512001a8e3 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA.MS).sql index 3ca1f90aeb67..79512001a8e3 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA.MS).sql index 3ca1f90aeb67..79512001a8e3 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA.MS).sql index 597983559022..ed7a812a3a59 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA.MS).sql index 8073e7a10cbe..926b4fa6a453 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA.MS).sql index a86adb9010f9..bf1baa349080 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA.MS).sql index 9ac239b845ff..ac9af6819091 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA.MS).sql index b4bc38d7bff8..515affa8d429 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA.MS).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA.MS).sql index 3ca1f90aeb67..79512001a8e3 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA.MS).sql index 597983559022..ed7a812a3a59 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA.MS).sql index 8073e7a10cbe..926b4fa6a453 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA.MS).sql index a86adb9010f9..bf1baa349080 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA.MS).sql index 9ac239b845ff..ac9af6819091 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA.MS).sql index 621f2d540577..2c5cc0dcec1b 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA.MS).sql index cc020f7134f5..764caea4b56a 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA.MS).sql index ae3cc41184fc..fffb8492d537 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA.MS).sql index d4109a5f6ade..9c476ce52209 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA.MS).sql index 4cde89753d60..8c758b669733 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA.MS).sql index 621f2d540577..2c5cc0dcec1b 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA.MS).sql index cc020f7134f5..764caea4b56a 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA.MS).sql index ae3cc41184fc..fffb8492d537 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA.MS).sql index d4109a5f6ade..9c476ce52209 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA.MS).sql index 4cde89753d60..8c758b669733 100644 --- a/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA.MS).sql +++ b/SqlServer.SA.MS/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA.MS).sql @@ -2,7 +2,7 @@ -- SqlServer.SA.MS SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..c4648e8d917a --- /dev/null +++ b/SqlServer.SA.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.SA.MS).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 5, 4049051, 7) + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 5, 4151044, 7) + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.SA.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..dc6aa4ef3a1f --- /dev/null +++ b/SqlServer.SA.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.SA.MS).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 6, 1900753, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 6, 1903048, 7) AS Date) + diff --git a/SqlServer.SA.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..2aa0fe9d8a48 --- /dev/null +++ b/SqlServer.SA.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.SA.MS).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.SA.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.SA.MS).sql b/SqlServer.SA.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.SA.MS).sql new file mode 100644 index 000000000000..c59f20e19bb2 --- /dev/null +++ b/SqlServer.SA.MS/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.SA.MS).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.SA.MS SqlServer.2019 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 + diff --git a/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA).sql index 991a617c5239..bb8f0a1ee447 100644 --- a/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test1(SqlServer.SA).sql @@ -11,7 +11,7 @@ SELECT TOP (@take) FROM ( SELECT - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff], [x].[EventUser] as [User_1], [x].[ProcessID] as [Proc] FROM diff --git a/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA).sql index 74a807956f61..54b5c0cfe68d 100644 --- a/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/AnalyticTests/Tests.Linq.AnalyticTests.Issue1799Test2(SqlServer.SA).sql @@ -13,7 +13,7 @@ FROM SELECT [x].[EventUser] as [User_1], [x].[ProcessID], - DateDiff(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] + DateDiff_Big(minute, LAG([x].[EventTime]) OVER(PARTITION BY [x].[EventUser], [x].[ProcessID] ORDER BY [x].[EventTime]), [x].[EventTime]) as [Diff] FROM [Issue1799Table1] [x] ) [g_1] diff --git a/SqlServer.SA/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA).sql index 09f746aec50d..e6fb986cbf4d 100644 --- a/SqlServer.SA/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.DateDiffDay(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA).sql index 09f746aec50d..e6fb986cbf4d 100644 --- a/SqlServer.SA/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateOnlyFunctionTests/Tests.Linq.DateOnlyFunctionTests.SubDateDay(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA).sql index 09f746aec50d..e6fb986cbf4d 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffDay(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA).sql index 774714401e5e..12c10762fd3b 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffHour(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA).sql index c8bc848c037e..c7dedd6ecc54 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMillisecond(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA).sql index 0c10119004b6..9ac6016371a4 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffMinute(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA).sql index 6d67a04cd15a..e155b121bddb 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateDiffSecond(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA).sql index b9914a068457..e6495cb23422 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.DateTimeSum(SqlServer.SA).sql @@ -4,8 +4,8 @@ SELECT [g_1].[ID], COUNT(*), - SUM(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), - MAX(DateDiff(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) + SUM(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))), + MAX(DateDiff_Big(millisecond, [g_1].[DateTimeValue], DateAdd(day, 1, [g_1].[DateTimeValue]))) FROM [LinqDataTypes] [g_1] GROUP BY diff --git a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA).sql index 09f746aec50d..e6fb986cbf4d 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateDay(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(day, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA).sql index 774714401e5e..12c10762fd3b 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateHour(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) + DateDiff_Big(hour, [t].[DateTimeValue], DateAdd(hour, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA).sql index c8bc848c037e..c7dedd6ecc54 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMillisecond(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) + DateDiff_Big(millisecond, [t].[DateTimeValue], DateAdd(millisecond, 2023456789, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA).sql index 0c10119004b6..9ac6016371a4 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateMinute(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(minute, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA).sql index 6d67a04cd15a..e155b121bddb 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeFunctionsTests/Tests.Linq.DateTimeFunctionsTests.SubDateSecond(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) + DateDiff_Big(second, [t].[DateTimeValue], DateAdd(minute, 100, [t].[DateTimeValue])) FROM [LinqDataTypes] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA).sql index 6b7694a9f5b5..04f36fd5035a 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffDay(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA).sql index 5beeb729e203..04d6281e3525 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffHour(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA).sql index e5304c87cbd6..8845a757c564 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMillisecond(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA).sql index fdbaf2f4a8de..2e84c2e1fb4c 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffMinute(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA).sql index 3a6e2e9b4f2d..42dda0f0c157 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.DateDiffSecond(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA).sql index 6b7694a9f5b5..04f36fd5035a 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateDay(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) + DateDiff_Big(day, [t].[TransactionDate], DateAdd(hour, 96, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA).sql index 5beeb729e203..04d6281e3525 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateHour(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) + DateDiff_Big(hour, [t].[TransactionDate], DateAdd(hour, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA).sql index e5304c87cbd6..8845a757c564 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMillisecond(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) + DateDiff_Big(millisecond, [t].[TransactionDate], DateAdd(second, 1, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA).sql index fdbaf2f4a8de..2e84c2e1fb4c 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateMinute(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(minute, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA).sql b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA).sql index 3a6e2e9b4f2d..42dda0f0c157 100644 --- a/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA).sql +++ b/SqlServer.SA/Tests/Linq/DateTimeOffsetTests/Tests.Linq.DateTimeOffsetTests.SubDateSecond(SqlServer.SA).sql @@ -2,7 +2,7 @@ -- SqlServer.SA SqlServer.2019 SELECT - DateDiff(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) + DateDiff_Big(second, [t].[TransactionDate], DateAdd(minute, 100, [t].[TransactionDate])) FROM [Transactions] [t] diff --git a/SqlServer.SA/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.SA).sql new file mode 100644 index 000000000000..732326f4726e --- /dev/null +++ b/SqlServer.SA/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test1(SqlServer.SA).sql @@ -0,0 +1,423 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [t1].[StartDateTime], + [t1].[StartDateTime2], + [t1].[EndDateTime], + [t1].[PreNotification], + [t1].[PreNotification2], + [t1].[PreNotification3], + [t1].[StrField], + [t1].[Status] +FROM + [Common_Topology_Locations] [t1] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(year, [x].[StartDateTime2]) = 2023 + +BeforeExecute +-- SqlServer.SA SqlServer.2019 +DECLARE @Value BigInt -- Int64 +SET @Value = 300000 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 0 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 5, 1337849, 7) + +BeforeExecute +-- SqlServer.SA SqlServer.2019 +DECLARE @Value BigInt -- Int64 +SET @Value = 0 +DECLARE @Value_1 BigInt -- Int64 +SET @Value_1 = 876000 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DateAdd(millisecond, @Value, DateAdd(hour, @Value_1, [x].[StartDateTime2])) > DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 5, 1436800, 7) + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + CAST([x].[PreNotification] / 10000 AS Float), + CAST([x].[PreNotification] / 10000000 AS Float) +FROM + [Common_Topology_Locations] [x] +WHERE + CAST([x].[PreNotification] / 10000000 AS Float) < CAST([x].[PreNotification] / 10000 AS Float) + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime2] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime5] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime6] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime7] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[PreNotification], + [x].[NotificationDateTime], + [x].[NotificationDateTime2], + [x].[NotificationDateTime3], + [x].[NotificationDateTime4], + [x].[NotificationDateTime5], + [x].[NotificationDateTime6], + [x].[NotificationDateTime7], + [x].[Value_1], + [x].[Day_1] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime2])) as [Value_1], + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, -1 * ([t].[PreNotification] / 10000), [t].[StartDateTime]) as [NotificationDateTime], + DateAdd(millisecond, -1 * ([t].[PreNotification2] / 10000), [t].[StartDateTime]) as [NotificationDateTime2], + DateAdd(millisecond, -1 * ([t].[PreNotification3] / 10000), [t].[StartDateTime]) as [NotificationDateTime3], + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime5], + DateAdd(millisecond, ([t].[PreNotification] / 10000) % 3600000, DateAdd(hour, ([t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime6], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime2])) as [NotificationDateTime7], + DatePart(day, [t].[StrField]) as [Day_1] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[Value_1] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231000, 7) + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[NotificationDateTime4] +FROM + ( + SELECT + DateAdd(millisecond, (-[t].[PreNotification3] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification3] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime4] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[NotificationDateTime4] < DATETIME2FROMPARTS(2020, 2, 29, 17, 54, 55, 1231234, 7) + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 +DECLARE @p BigInt -- Int64 +SET @p = 180000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 5 + +BeforeExecute +-- SqlServer.SA SqlServer.2019 +DECLARE @p BigInt -- Int64 +SET @p = 72000000000 + +SELECT + [x].[diff] +FROM + ( + SELECT + DateDiff_Big(nanosecond, [t].[StartDateTime], [t].[EndDateTime]) / 100 as [diff] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + [x].[diff] < @p + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100 +FROM + [Common_Topology_Locations] [x] +WHERE + CAST((DateDiff_Big(nanosecond, [x].[StartDateTime], [x].[EndDateTime]) / 100) / 36000000000 AS Float) < 2 + diff --git a/SqlServer.SA/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.SA).sql new file mode 100644 index 000000000000..7ca5a10255a2 --- /dev/null +++ b/SqlServer.SA/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test2(SqlServer.SA).sql @@ -0,0 +1,34 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status], + [x].[NotificationDateTime] +FROM + ( + SELECT + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) as [NotificationDateTime], + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField] + FROM + [Common_Topology_Locations] [t] + ) [x] +WHERE + ([x].[Status] <> N'New' OR [x].[Status] IS NULL) AND + ([x].[Status] <> N'Completed' OR [x].[Status] IS NULL) AND + [x].[NotificationDateTime] < DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 6, 1530847, 7) AND + CAST([x].[StartDateTime] AS Date) < CAST(DATETIME2FROMPARTS(2025, 8, 31, 18, 53, 6, 1533410, 7) AS Date) + diff --git a/SqlServer.SA/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.SA).sql new file mode 100644 index 000000000000..552e3a3d4c69 --- /dev/null +++ b/SqlServer.SA/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test3(SqlServer.SA).sql @@ -0,0 +1,81 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[PreNotification], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(hour, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 13 + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(minute, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) = 51 + +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT TOP (1) + [t].[StartDateTime], + [t].[StartDateTime2], + [t].[EndDateTime], + [t].[PreNotification], + [t].[PreNotification2], + [t].[PreNotification3], + [t].[StrField], + [t].[Status], + DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime])) +FROM + [Common_Topology_Locations] [t] +WHERE + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) >= 52 AND + DatePart(second, DateAdd(millisecond, (-[t].[PreNotification] / 10000) % 3600000, DateAdd(hour, (-[t].[PreNotification] / 10000) / 3600000, [t].[StartDateTime]))) <= 54 + diff --git a/SqlServer.SA/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.SA).sql b/SqlServer.SA/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.SA).sql new file mode 100644 index 000000000000..5df788ae13fd --- /dev/null +++ b/SqlServer.SA/Tests/UserTests/Test3993/Test3993Tests/Tests.UserTests.Test3993.Test3993Tests.TestIssue3993_Test4(SqlServer.SA).sql @@ -0,0 +1,17 @@ +BeforeExecute +-- SqlServer.SA SqlServer.2019 + +SELECT TOP (1) + [x].[StartDateTime], + [x].[StartDateTime2], + [x].[EndDateTime], + [x].[PreNotification], + [x].[PreNotification2], + [x].[PreNotification3], + [x].[StrField], + [x].[Status] +FROM + [Common_Topology_Locations] [x] +WHERE + DatePart(hour, [x].[StartDateTime]) = 13 +