Describe the bug
array_repeat can panic on scalar elements when the total repeated-value count overflows usize while summing counts.
To Reproduce
SELECT array_repeat(1, c)
FROM (
VALUES
(9223372036854775807),
(9223372036854775807),
(9223372036854775807)
) AS t(c);
Actual behavior
thread 'main' panicked at .../library/core/src/iter/traits/accum.rs:204:1:
attempt to add with overflow
Expected behavior
Return an execution error for an output-size overflow, not a panic.
Notes
The overflow comes from summing the per-row repeat counts before building the result.
Describe the bug
array_repeatcan panic on scalar elements when the total repeated-value count overflowsusizewhile summing counts.To Reproduce
Actual behavior
Expected behavior
Return an execution error for an output-size overflow, not a panic.
Notes
The overflow comes from summing the per-row repeat counts before building the result.