You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Informix actually supports up to 10 microseconds
718
-
// but defaults to milliseconds (so use that)
719
-
return1_000_000;
716
+
// since we do computations with intervals,
717
+
// may as well just use seconds as the NATIVE
718
+
// precision, do minimize conversion factors
719
+
return1_000_000_000;
720
+
// // Informix actually supports up to 10 microseconds
721
+
// // but defaults to milliseconds (so use that)
722
+
// return 1_000_000;
720
723
}
721
724
722
725
@Override@SuppressWarnings("deprecation")
@@ -729,8 +732,8 @@ public String timestampdiffPattern(TemporalUnit unit, TemporalType fromTemporalT
729
732
caseNATIVE ->
730
733
fromTemporalType == TemporalType.TIME
731
734
// arguably, we don't really need to retain the milliseconds for a time, since times don't usually come with millis
732
-
? "((mod(to_number(cast(cast(sum(?3-?2) as interval second(6) to second) as varchar(9))),86400)+to_number(cast(cast(sum(?3-?2) as interval fraction to fraction) as varchar(6))))*1e3)"
733
-
: "((to_number(cast(cast(sum(?3-?2) as interval day(9) to day) as varchar(12)))*86400+mod(to_number(cast(cast(sum(?3-?2) as interval second(6) to second) as varchar(9))),86400)+to_number(cast(cast(sum(?3-?2) as interval fraction to fraction) as varchar(6))))*1e3)";
735
+
? "(mod(to_number(cast(cast(sum(?3-?2) as interval second(6) to second) as varchar(9))),86400)+to_number(cast(cast(sum(?3-?2) as interval fraction to fraction) as varchar(6))))"
736
+
: "(to_number(cast(cast(sum(?3-?2) as interval day(9) to day) as varchar(12)))*86400+mod(to_number(cast(cast(sum(?3-?2) as interval second(6) to second) as varchar(9))),86400)+to_number(cast(cast(sum(?3-?2) as interval fraction to fraction) as varchar(6))))";
734
737
caseSECOND -> "to_number(cast(cast(sum(?3-?2) as interval second(9) to fraction) as varchar(15)))";
735
738
caseNANOSECOND -> "(to_number(cast(cast(sum(?3-?2) as interval second(9) to fraction) as varchar(15)))*1e9)";
736
739
default -> "to_number(cast(cast(sum(?3-?2) as interval ?1(9) to ?1) as varchar(12)))";
0 commit comments