tidb
tidb copied to clipboard
slice bounds out of range
Bug Report
1. Minimal reproduce step (Required)
select distinct avg(nullif(77.15, PI())); --runtime error: slice bounds out of range [:1] with capacity 0
2. What did you expect to see? (Required)
No error
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
tiup playground nightly --host 0.0.0.0 --kv 3 --tiflash 3
8.0.11-TiDB-v9.0.0-beta.1.pre-554-gb1a5536a64-dirty
/label fuzz/sqlancer
If we return buf, err in line 1520, we can get the result with warning.
https://github.com/pingcap/tidb/blob/6a12f31171dda2ef20ad4f81f6b2cd95bf13feab/pkg/util/codec/codec.go#L1511-L1523
Since https://github.com/pingcap/tidb/pull/48613, https://github.com/pingcap/tidb/blob/v8.5.2/pkg/executor/aggregate/agg_util.go#L149-L150
The codec.HashGroupKey return error and errCtx.HandleError set it to nil.
@YangKeao PTAL