Skip to content

Commit b1f202d

Browse files
authored
Add assertion for input value in IntervalTo* functions (#14762)
1 parent fec2654 commit b1f202d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ydb/library/yql/udfs/common/datetime/datetime_udf.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ namespace {
215215
SIMPLE_STRICT_UDF(TIntervalTo##unit, type(TAutoMap<TInterval>)) { \
216216
Y_UNUSED(valueBuilder); \
217217
const i64 input = args[0].Get<i64>(); \
218+
Y_DEBUG_ABORT_UNLESS(input > -(i64)NUdf::MAX_TIMESTAMP && input < (i64)NUdf::MAX_TIMESTAMP); \
218219
TDuration duration = TDuration::MicroSeconds(std::abs(input)); \
219220
return TUnboxedValuePod(static_cast<type>(input >= 0 ? duration.unit() : -duration.unit())); \
220221
}

0 commit comments

Comments
 (0)