Fix CockroachDB timestampdiff errors caused by `round()` return type
This commit is contained in:
parent
d1be36b303
commit
ce48a51eaa
|
@ -859,7 +859,7 @@ public class CockroachLegacyDialect extends Dialect {
|
|||
case SECOND:
|
||||
case NANOSECOND:
|
||||
case NATIVE:
|
||||
return "round(extract(epoch from ?3-?2)" + EPOCH.conversionFactor( unit, this ) + ")";
|
||||
return "round(extract(epoch from ?3-?2)" + EPOCH.conversionFactor( unit, this ) + ")::int";
|
||||
default:
|
||||
throw new SemanticException( "unrecognized field: " + unit );
|
||||
}
|
||||
|
|
|
@ -861,7 +861,7 @@ public class CockroachDialect extends Dialect {
|
|||
case SECOND:
|
||||
case NANOSECOND:
|
||||
case NATIVE:
|
||||
return "round(extract(epoch from ?3-?2)" + EPOCH.conversionFactor( unit, this ) + ")";
|
||||
return "round(extract(epoch from ?3-?2)" + EPOCH.conversionFactor( unit, this ) + ")::int";
|
||||
default:
|
||||
throw new SemanticException( "Unrecognized field: " + unit );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue