prometheus/promql
Julien eaf47798af
promql: fix panic with @ modifier on empty ranges (#18020)
When using the @ modifier with a timestamp that has no data, several
PromQL range functions were panicking with "index out of range [0]
with length 0". This was introduced by #16797 which changed function
signatures to use concrete types instead of interfaces.

The panic occurred because functions were accessing array elements
(matrixVal[0], vectorVals[0][0]) without checking if the arrays were
empty first.

Fixes #18018

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-02-06 08:30:15 +00:00
..
fuzz-data textparse: Add fuzzing and fix bug caught 2017-07-07 11:12:17 +02:00
parser Merge pull request #17626 from aviralgarg05/fix-promqltest-counter-reset-hint-comparison 2026-01-22 15:03:20 +01:00
promqltest promql: fix panic with @ modifier on empty ranges (#18020) 2026-02-06 08:30:15 +00:00
bench_test.go Merge pull request #17548 from linasm/improve-BenchmarkJoinQuery 2026-02-03 11:53:08 +00:00
durations.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
durations_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
engine.go promql: fix smoothed interpolation across counter resets 2026-02-02 11:54:35 +01:00
engine_internal_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
engine_test.go tests(teststorage): Close Storage in the helper (#17902) 2026-01-23 08:41:35 +00:00
functions.go promql: fix panic with @ modifier on empty ranges (#18020) 2026-02-06 08:30:15 +00:00
functions_internal_test.go promql: fix smoothed interpolation across counter resets 2026-02-02 11:54:35 +01:00
functions_test.go tests(teststorage): Close Storage in the helper (#17902) 2026-01-23 08:41:35 +00:00
fuzz.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
fuzz_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
histogram_stats_iterator.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00
histogram_stats_iterator_test.go feat(tsdb): new AppenderV2 and AtST interface for chunks 2026-01-14 13:15:09 +01:00
info.go promql: info function: fix series without identifying labels not being returned (#17898) 2026-01-20 16:53:27 +01:00
promql_test.go tests(teststorage): Close Storage in the helper (#17902) 2026-01-23 08:41:35 +00:00
quantile.go Use custom annotation for histogram quantile monotonicity info to provide more details (#15578) 2026-02-05 18:35:48 +01:00
quantile_test.go Use custom annotation for histogram quantile monotonicity info to provide more details (#15578) 2026-02-05 18:35:48 +01:00
query_logger.go fix(promql): prevent panic in trimStringByBytes on invalid UTF-8 2026-01-24 16:06:42 +01:00
query_logger_test.go fix(promql): prevent panic in trimStringByBytes on invalid UTF-8 2026-01-24 16:06:42 +01:00
value.go feat(tsdb): new AppenderV2 and AtST interface for chunks 2026-01-14 13:15:09 +01:00
value_test.go Remove copyright date from headers (#17785) 2026-01-05 13:46:21 +01:00