Skip to content

Commit ea47c13

Browse files
committed
Merge branch '7.0' into 7.0-oracle-schemas-fix
# Conflicts: # ChangeLog/7.0.3_dev.txt
2 parents bd7b9f4 + 6f00508 commit ea47c13

File tree

4 files changed

+29
-3
lines changed

4 files changed

+29
-3
lines changed

ChangeLog/7.0.3_dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[main] NodeCollection supports different equality comparers for internal name index
2+
[sqlserver] Fixed TimeSpan.Ticks extraction problem
23
[oracle] Fixed scheme extraction for case-sensitive schema names

Orm/Xtensive.Orm.SqlServer/Sql.Drivers.SqlServer/v13/Compiler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public override void Visit(SqlFunctionCall node)
3636
// we have to use time consuming algorithm here because
3737
// DATEDIFF_BIG can throw arithmetic overflow on nanoseconds
3838
// so we should handle it by this big formula
39-
Visit(CastToLong(DateTimeSubtractDateTimeExpensive(binary.Right, binary.Left)));
39+
Visit(CastToLong(DateTimeSubtractDateTimeExpensive(binary.Left, binary.Right)));
4040
}
4141
else {
4242
base.Visit(node);

Orm/Xtensive.Orm.Tests/Linq/DateTimeAndDateTimeOffset/DateTime/PartsExtractionTest.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2016-2021 Xtensive LLC.
1+
// Copyright (C) 2016-2022 Xtensive LLC.
22
// This code is distributed under MIT license terms.
33
// See the License.txt file in the project root for more information.
44
// Created by: Alex Groznov
@@ -188,5 +188,16 @@ public void ExtractDayOfWeekTest()
188188
RunWrongTest<SingleDateTimeEntity>(c => c.NullableDateTime.Value.DayOfWeek == WrongDateTime.DayOfWeek);
189189
});
190190
}
191+
192+
[Test]
193+
public void ExtractTimeOfDayTicksTest()
194+
{
195+
Require.ProviderIsNot(StorageProvider.PostgreSql | StorageProvider.Oracle);
196+
197+
ExecuteInsideSession(() => {
198+
RunTest<SingleDateTimeEntity>(c => c.DateTime.TimeOfDay.Ticks == FirstDateTime.TimeOfDay.Ticks);
199+
RunWrongTest<SingleDateTimeEntity>(c => c.DateTime.TimeOfDay.Ticks < FirstDateTime.TimeOfDay.Ticks);
200+
});
201+
}
191202
}
192203
}

Orm/Xtensive.Orm.Tests/Linq/DateTimeAndDateTimeOffset/DateTimeOffset/PartsExtractionTest.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2016-2021 Xtensive LLC.
1+
// Copyright (C) 2016-2022 Xtensive LLC.
22
// This code is distributed under MIT license terms.
33
// See the License.txt file in the project root for more information.
44
// Created by: Alex Groznov
@@ -189,6 +189,20 @@ public void ExtractTimeOfDayWithMillisecondsTest()
189189
});
190190
}
191191

192+
[Test]
193+
public void ExtractTimeOfDayTicksTest()
194+
{
195+
Require.ProviderIsNot(StorageProvider.PostgreSql | StorageProvider.Oracle);
196+
197+
ExecuteInsideSession(() => {
198+
var firstDateTimeOffset = TryMoveToLocalTimeZone(FirstDateTimeOffset);
199+
RunTest<SingleDateTimeOffsetEntity>(c => c.DateTimeOffset.TimeOfDay.Ticks == firstDateTimeOffset.TimeOfDay.Ticks);
200+
201+
var wrongDateTimeOffset = TryMoveToLocalTimeZone(WrongDateTimeOffset);
202+
RunWrongTest<SingleDateTimeOffsetEntity>(c => c.DateTimeOffset.TimeOfDay.Ticks == wrongDateTimeOffset.TimeOfDay.Ticks);
203+
});
204+
}
205+
192206
[Test]
193207
public void ExtractTimeOfDayOfNullableValueTest()
194208
{

0 commit comments

Comments
 (0)