pingcap / pingcap/tiflash

Not found column generated_column_x when late materialization is enabled

Open
#10,485 0 comments 0 reactions 1 assignee View on GitHub

@gengliqi is already working on this.

Since Oct 17, 2025.

component/compute may-affects-6.5 may-affects-7.1 may-affects-7.5 may-affects-8.1 may-affects-8.5 severity/major type/bug
Dominant language
C++
Stars
1k
Forks
423
Avg merge
1d 15h
Merged PRs (30d)
24

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)
mysql> create table t2 (a int, b int as (a+2) virtual);
Query OK, 0 rows affected (0.02 sec)

mysql> insert into t2(a) values(1), (2), (3);
Query OK, 3 rows affected (0.01 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> insert into t2(a) select a + 2 from t2;
Query OK, 3 rows affected (0.01 sec)
Records: 3  Duplicates: 0  Warnings: 0

// Repeat 12 times
mysql> insert into t2(a) select a + 200 from t2;
Query OK, 12288 rows affected (0.06 sec)
Records: 12288  Duplicates: 0  Warnings: 0

mysql> alter table t2 set tiflash replica 1;
Query OK, 0 rows affected (0.05 sec)

mysql> set tidb_isolation_read_engines='tiflash';
Query OK, 0 rows affected (0.00 sec)

mysql> set tidb_opt_enable_late_materialization=off;
Query OK, 0 rows affected (0.00 sec)

mysql> explain select a, b from t2 where a < 100;
+---------------------------+-----------+--------------+---------------+--------------------------------------+
| id                        | estRows   | task         | access object | operator info                        |
+---------------------------+-----------+--------------+---------------+--------------------------------------+
| TableReader_9             | 13.00     | root         |               | MppVersion: 3, data:ExchangeSender_8 |
| └─ExchangeSender_8        | 13.00     | mpp[tiflash] |               | ExchangeType: PassThrough            |
|   └─Selection_7           | 13.00     | mpp[tiflash] |               | lt(test.t2.a, 100)                   |
|     └─TableFullScan_6     | 196608.00 | mpp[tiflash] | table:t2      | keep order:false                     |
+---------------------------+-----------+--------------+---------------+--------------------------------------+
4 rows in set (0.01 sec)

mysql> select a, b from t2 where a < 100;
+------+------+
| a    | b    |
+------+------+
|    1 |    3 |
|    2 |    4 |
|    3 |    5 |
|    3 |    5 |
|    4 |    6 |
|    5 |    7 |
+------+------+
6 rows in set (0.01 sec)

mysql> set tidb_opt_enable_late_materialization=on;
Query OK, 0 rows affected (0.00 sec)

mysql> explain select a, b from t2 where a < 100;
+-------------------------+----------+--------------+---------------+-----------------------------------------------------------------------+
| id                      | estRows  | task         | access object | operator info                                                         |
+-------------------------+----------+--------------+---------------+-----------------------------------------------------------------------+
| TableReader_8           | 65339.39 | root         |               | MppVersion: 3, data:ExchangeSender_7                                  |
| └─ExchangeSender_7      | 65339.39 | mpp[tiflash] |               | ExchangeType: PassThrough                                             |
|   └─TableFullScan_6     | 65339.39 | mpp[tiflash] | table:t2      | pushed down filter:lt(test.t2.a, 100), keep order:false, stats:pseudo |
+-------------------------+----------+--------------+---------------+-----------------------------------------------------------------------+
3 rows in set (0.00 sec)

mysql> select a, b from t2 where a < 100;
ERROR 1105 (HY000): other error for mpp stream: Code: 10, e.displayText() = DB::Exception: Not found column generated_column_1 in block. There are only columns: a, less(a, 100_Int64)_collator_63 , e.what() = DB::Exception,
2. What did you expect to see? (Required)

Query succeed.

3. What did you see instead (Required)

Unexpected error

4. What is your TiFlash version? (Required)

Master

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.