pingcap / pingcap/tidb

Panic triggered at chunk.(*Column).AppendFloat64 (util/chunk/column.go:265)

Open
#42,737 2 comments 2 reactions 0 assignees View on GitHub
affects-5.4 affects-6.1 affects-6.5 affects-7.1 may-affects-4.0 may-affects-5.0 may-affects-5.1 may-affects-5.2 may-affects-5.3 severity/moderate sig/execution type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

**Setup the database:**

```
CREATE TABLE t0 (c0 double, c1 varchar(100));
INSERT INTO t0 VALUES (1, NULL);
```

**Testcase**
```
select
exists (
select
FIRST_VALUE(ref_131.c0) over (partition by ref_131.c1) as c0
from
t0 as ref_131
) as c4
from
t0 as ref_0;
```

### 2. What did you expect to see? (Required)

No panic.

### 3. What did you see instead (Required)

```
ERROR 1105 (HY000): runtime error: index out of range [0] with length 0
```
TiDB log:
```
[err="runtime error: index out of range [0] with length 0
github.com/pingcap/tidb/executor.recoveryShuffleExec
/root/tidb/executor/shuffle.go:255
github.com/pingcap/tidb/executor.(*shuffleWorker).run.func1
/root/tidb/executor/shuffle.go:384
runtime.gopanic
/usr/local/go/src/runtime/panic.go:884
runtime.goPanicIndex
/usr/local/go/src/runtime/panic.go:113
github.com/pingcap/tidb/util/chunk.(*Column).AppendFloat64
/root/tidb/util/chunk/column.go:265
github.com/pingcap/tidb/util/chunk.(*Chunk).AppendFloat64
/root/tidb/util/chunk/chunk.go:507
github.com/pingcap/tidb/executor/aggfuncs.(*value4Float64).appendResult
/root/tidb/executor/aggfuncs/func_value.go:132
github.com/pingcap/tidb/executor/aggfuncs.(*firstValue).AppendFinalResult2Chunk
/root/tidb/executor/aggfuncs/func_value.go:282
github.com/pingcap/tidb/executor.(*PipelinedWindowExec).produce
/root/tidb/executor/pipelined_window.go:402
github.com/pingcap/tidb/executor.(*PipelinedWindowExec).Next
/root/tidb/executor/pipelined_window.go:153
github.com/pingcap/tidb/executor.Next
/root/tidb/executor/executor.go:326
github.com/pingcap/tidb/executor.(*shuffleWorker).run
/root/tidb/executor/shuffle.go:394
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1598"]
```

### 4. What is your TiDB version? (Required)

+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v7.1.0-alpha-27-gf5ca27ef3
Edition: Community
Git Commit Hash: f5ca27ef326e94fb29b4ba35a5d59aa575f66880
Git Branch: master
UTC Build Time: 2023-03-23 13:57:53
GoVersion: go1.20.2
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: unistore |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.