File tree Expand file tree Collapse file tree 4 files changed +29
-3
lines changed
Xtensive.Orm.SqlServer/Sql.Drivers.SqlServer/v13
Xtensive.Orm.Tests/Linq/DateTimeAndDateTimeOffset Expand file tree Collapse file tree 4 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 1
1
[main] NodeCollection supports different equality comparers for internal name index
2
+ [sqlserver] Fixed TimeSpan.Ticks extraction problem
2
3
[oracle] Fixed scheme extraction for case-sensitive schema names
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public override void Visit(SqlFunctionCall node)
36
36
// we have to use time consuming algorithm here because
37
37
// DATEDIFF_BIG can throw arithmetic overflow on nanoseconds
38
38
// 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 ) ) ) ;
40
40
}
41
41
else {
42
42
base . Visit ( node ) ;
Original file line number Diff line number Diff line change 1
- // Copyright (C) 2016-2021 Xtensive LLC.
1
+ // Copyright (C) 2016-2022 Xtensive LLC.
2
2
// This code is distributed under MIT license terms.
3
3
// See the License.txt file in the project root for more information.
4
4
// Created by: Alex Groznov
@@ -188,5 +188,16 @@ public void ExtractDayOfWeekTest()
188
188
RunWrongTest < SingleDateTimeEntity > ( c => c . NullableDateTime . Value . DayOfWeek == WrongDateTime . DayOfWeek ) ;
189
189
} ) ;
190
190
}
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
+ }
191
202
}
192
203
}
Original file line number Diff line number Diff line change 1
- // Copyright (C) 2016-2021 Xtensive LLC.
1
+ // Copyright (C) 2016-2022 Xtensive LLC.
2
2
// This code is distributed under MIT license terms.
3
3
// See the License.txt file in the project root for more information.
4
4
// Created by: Alex Groznov
@@ -189,6 +189,20 @@ public void ExtractTimeOfDayWithMillisecondsTest()
189
189
} ) ;
190
190
}
191
191
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
+
192
206
[ Test ]
193
207
public void ExtractTimeOfDayOfNullableValueTest ( )
194
208
{
You can’t perform that action at this time.
0 commit comments