TiFlash reads unexpected virtual column
- 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)
1. clone the repo https://github.com/pingcap-inc/tiflash-scripts
2. connect to tidb
3. execute the command: source agg_sub_data_1000.test
### 2. What did you expect to see? (Required)
no error
### 3. What did you see instead (Required)
```
[2026-01-27T19:13:42.683Z] File: /home/jenkins/agent/git/tiflash/integrated/ops/ti.sh.cmds/ci/fullstack_tests/randgen-mpp/agg_sub_data_1000.test
[2026-01-27T19:13:42.683Z] Error line: 319
[2026-01-27T19:13:42.683Z] Error: tiflash use agg_sub_datat1000; set @@tidb_isolation_read_engines='tiflash,tidb'; set @@tidb_allow_mpp=1;SELECT table1 . col_varchar_binary_key NOT IN ( SELECT 'y' UNION SELECT 'j' ) AS field1 FROM ( I AS table1 INNER JOIN C AS table2 ON (table2 . pk = table1 . col_decimal_40_not_null_key ) ) WHERE ( EXISTS ( SELECT SUBQUERY2_t1 . col_decimal_30_10_not_null AS SUBQUERY2_field1 FROM ( II AS SUBQUERY2_t1 INNER JOIN D AS SUBQUERY2_t2 ON (SUBQUERY2_t2 . col_varchar_binary_not_null_key = SUBQUERY2_t1 . col_varchar_binary_key ) ) ) ) AND ( table1 . col_varchar_binary_key > 'r' OR table1 . col_int_key BETWEEN 62 AND ( 62 + 80 ) ) ;
[2026-01-27T19:13:42.683Z] Result:
[2026-01-27T19:13:42.683Z] ERROR 1105 (HY000) at line 1: other error for mpp stream: Code: 49, e.displayText() = DB::Exception: String TiDB::TableInfo::getColumnName(const ColumnID) const: Invalidate column id -5 for table ii, e.what() = DB::Exception,
[2026-01-27T19:13:42.683Z] Expected:
[2026-01-27T19:13:42.683Z] +--------+
[2026-01-27T19:13:42.683Z] | field1 |
[2026-01-27T19:13:42.683Z] +--------+
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 0 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 0 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 0 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] | 1 |
[2026-01-27T19:13:42.683Z] +--------+
```
### 4. What is your TiDB version? (Required)
nightly(811a10e115d416aadcc9407ac4df0fdd4deb1181)
Contributor guide
Assessment
This issue has not been assessed yet.