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
Copy file name to clipboardExpand all lines: hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/InformixDialect.java
+28-14Lines changed: 28 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -436,7 +436,6 @@ public String extractPattern(TemporalUnit unit) {
436
436
caseDAY_OF_WEEK -> "(weekday(?2)+1)";
437
437
caseDAY_OF_MONTH -> "day(?2)";
438
438
caseEPOCH -> "(to_number(cast(cast(sum(?2-datetime(1970-1-1) year to day) as interval day(9) to day) as varchar(12)))*86400+to_number(cast(cast(sum(cast(?2 as datetime hour to second)-datetime(00:00:00) hour to second) as interval second(6) to second) as varchar(9))))";
439
-
caseNATIVE -> "((to_number(cast(cast(sum(?2) as interval day(9) to day) as varchar(12)))*86400+mod(to_number(cast(cast(sum(?2) as interval second(6) to second) as varchar(9))),86400)+to_number(cast(cast(sum(?2) as interval fraction to fraction) as varchar(6))))*1e3)";
440
439
default -> "?1(?2)";
441
440
};
442
441
}
@@ -695,16 +694,21 @@ public String getCurrentTimestampSelectString() {
// 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)";
734
+
caseSECOND -> "to_number(cast(cast(sum(?3-?2) as interval second(9) to fraction) as varchar(15)))";
735
+
caseNANOSECOND -> "(to_number(cast(cast(sum(?3-?2) as interval second(9) to fraction) as varchar(15)))*1e9)";
736
+
default -> "to_number(cast(cast(sum(?3-?2) as interval ?1(9) to ?1) as varchar(12)))";
737
+
};
738
+
}
725
739
}
726
740
727
741
@Override
@@ -948,7 +962,7 @@ public void appendDateTimeLiteral(
0 commit comments