Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query partition table failed after rename column #9787

Open
Lloyd-Pottiger opened this issue Jan 15, 2025 · 1 comment
Open

Query partition table failed after rename column #9787

Lloyd-Pottiger opened this issue Jan 15, 2025 · 1 comment
Assignees
Labels
affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. component/storage severity/critical type/bug The issue is confirmed as a bug.

Comments

@Lloyd-Pottiger
Copy link
Contributor

Lloyd-Pottiger commented Jan 15, 2025

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> CREATE TABLE `t6f9b1fca` (
    ->   `col5def` mediumint DEFAULT '1398811',
    ->   `colb0ec` datetime DEFAULT '8060-08-20 09:18:05',
    ->   `colc4d2` year(4) DEFAULT '2123',
    ->   `colf318` enum('vzd','f1y','wndk','bdw9','qkg','pj','z3','6pj2q','zgm','x5qj','uiyv') DEFAULT 'bdw9',
    ->   `3f60e6b3` decimal(33,25) DEFAULT '-66552329.3166265233570726682245357',
    ->   `colf8a2` bigint DEFAULT '600923851820286643',
    ->   `col9e6f` float DEFAULT '1.9193193',
    ->   `col972e` mediumint DEFAULT '-74934',
    ->   `col9328` varchar(109) DEFAULT 'hkq8osq',
    ->   `col8e36` double DEFAULT '1.5676352034154104'
    -> ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin /*T! SHARD_ROW_ID_BITS=1 */ COMMENT='27f3f141'
    -> PARTITION BY HASH (`colf8a2`) PARTITIONS 9;
Query OK, 0 rows affected (0.11 sec)

mysql> insert into t6f9b1fca values ();
Query OK, 1 row affected (0.00 sec)

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

mysql> select * from t6f9b1fca;
Empty set (0.16 sec)

mysql> alter table t6f9b1fca change 3f60e6b3 3f60e6b2 decimal(33,25) DEFAULT '-66552329.3166265233570726682245357';
Query OK, 0 rows affected (0.02 sec)

mysql> set tidb_enforce_mpp=1; select * from `t6f9b1fca`;
ERROR 1105 (HY000): other error for mpp stream: Code: 10, e.displayText() = DB::Exception: Not found column 3f60e6b3 in block. There are only columns: _tidb_rowid, _INTERNAL_VERSION, _INTERNAL_DELMARK, col5def, colb0ec, col7211, colc4d2, colf318, col7579, 3f60e6b2, colf8a2, col9e6f, col972e, col9328, col8e36: (while creating read sources from storage, keyspace_id=4294967295 table_id=119 logical_table_id=110), e.what() = DB::Exception,

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

success

3. What did you see instead (Required)

failed

4. What is your TiFlash version? (Required)

master

@Lloyd-Pottiger
Copy link
Contributor Author

Lloyd-Pottiger commented Jan 15, 2025

  1. create a table, and create tiflash replica -> synchronise schema of logical table
  2. write a row -> synchronise schema of one of the partitions (physical table)
  3. rename column -> will not trigger synchronise schema
  4. query the table -> synchronise schema of other partitions (physical table), but schema of logical table and physical table with data will not be updated.

When we query the table, we will use the schema of the logical table to find names of columns to read (column 3f60e6b3). But empty partitions does not contains column 3f60e6b3, so the query failed.

@Lloyd-Pottiger Lloyd-Pottiger removed affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-8.5 This bug affects the 8.5.x(LTS) versions. component/storage severity/critical type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

1 participant