Describe the bug
array_position panics when the optional start_from argument is i64::MIN. The planner/constant folder subtracts one from the value without checking for underflow.
To Reproduce
EXPLAIN SELECT array_position([1], 1, -9223372036854775808);
Actual behavior
thread 'main' panicked at datafusion/functions-nested/src/position.rs:210:21:
attempt to subtract with overflow
Expected behavior
Return a normal error for an invalid start_from value, not a panic.
Describe the bug
array_positionpanics when the optionalstart_fromargument isi64::MIN. The planner/constant folder subtracts one from the value without checking for underflow.To Reproduce
Actual behavior
Expected behavior
Return a normal error for an invalid
start_fromvalue, not a panic.