提交 9079cbd5 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Pass Value to valueToOffsetDateTime() for consistency

上级 72342962
......@@ -3829,8 +3829,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet, JdbcResultS
return type.cast(LocalDateTimeUtils.valueToInstant(value));
} else if (LocalDateTimeUtils.isOffsetDateTime(type) &&
value instanceof ValueTimestampTimeZone) {
return type.cast(LocalDateTimeUtils.valueToOffsetDateTime(
(ValueTimestampTimeZone) value));
return type.cast(LocalDateTimeUtils.valueToOffsetDateTime(value));
} else {
throw unsupported(type.getName());
}
......
......@@ -459,8 +459,9 @@ public class LocalDateTimeUtils {
* @param value the value to convert
* @return the OffsetDateTime
*/
public static Object valueToOffsetDateTime(ValueTimestampTimeZone value) {
return timestampWithTimeZoneToOffsetDateTime((TimestampWithTimeZone) value.getObject());
public static Object valueToOffsetDateTime(Value value) {
ValueTimestampTimeZone valueTimestampTimeZone = (ValueTimestampTimeZone) value.convertTo(Value.TIMESTAMP_TZ);
return timestampWithTimeZoneToOffsetDateTime((TimestampWithTimeZone) valueTimestampTimeZone.getObject());
}
private static Object timestampWithTimeZoneToOffsetDateTime(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论