pingcap / pingcap/tidb

runtime error: index out of range [7] with length 4

Open
#64,886 6 comments 0 reactions 0 assignees View on GitHub
component/unistore contribution may-affects-7.1 may-affects-7.5 may-affects-8.1 may-affects-8.5 severity/major 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)

The following test case triggers a runtime error:

```
CREATE TABLE t1(c0 FLOAT UNSIGNED ZEROFILL , PRIMARY KEY(c0));
INSERT INTO t1(c0) VALUES (0.3);
SET @a = 602065819;
PREPARE prepare_query FROM 'SELECT IF(?, t1.c0, t1.c0) FROM t1 WHERE t1.c0 GROUP BY true';
EXECUTE prepare_query USING @a; -- runtime error: index out of range [7] with length 4
DEALLOCATE PREPARE prepare_query;
```

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

### 3. What did you see instead (Required)
runtime error: index out of range [7] with length 4

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

tidb_version()
Release Version: v9.0.0-beta.2.pre-855-gbc50e0d3e2\nEdition: Community\nGit Commit Hash: bc50e0d3e2319f0993c6e2152b48e0b0bb378fbc\nGit Branch: master\nUTC Build Time: 2025-12-05 12:40:26\nGoVersion: go1.23.12\nRace Enabled: false\nCheck Table Before Drop: false\nStore: unistore\nKernel Type: Classic

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.