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 failed when there are extra table id column in tablescan and have filters pushed down #7496

Closed
Lloyd-Pottiger opened this issue May 18, 2023 · 0 comments · Fixed by #7497
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. component/storage severity/major type/bug The issue is confirmed as a bug.

Comments

@Lloyd-Pottiger
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> drop table if exists test.t;
mysql> create table test.t(id int, age int, t time, key(id)) partition by range(id) ( partition p0 values less than (100), partition p1 values less than (200), partition p2 values less than (300));
mysql> insert into test.t values (1, 10, '700:11:11.1234'), (10, 11, '700:11:11.1234');
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> insert into test.t select * from test.t;
mysql> alter table test.t set tiflash replica 1;
mysql> analyze table test.t;
mysql> begin; set @@session.tidb_isolation_read_engines='tiflash'; set @@session.tidb_partition_prune_mode='dynamic'; insert into test.t values (11, 10, '700:11:11.1234'), (12, 11, '710:11:11.1234'); select * from test.t where id > 10; select hour(t) as hour, sum(age) from test.t where id > 10 group by hour; commit;
mysql> drop table test.t;

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

mysql> begin; set @@session.tidb_isolation_read_engines='tiflash'; set @@session.tidb_partition_prune_mode='dynamic'; insert into test.t values (11, 10, '700:11:11.1234'), (12, 11, '710:11:11.1234'); select * from test.t where id > 10; select hour(t) as hour, sum(age) from test.t where id > 10 group by hour; commit;
+------+------+-----------+
| id   | age  | t         |
+------+------+-----------+
|   11 |   10 | 700:11:11 |
|   12 |   11 | 710:11:11 |
+------+------+-----------+
+------+----------+
| hour | sum(age) |
+------+----------+
|  710 |       11 |
|  700 |       10 |
+------+----------+

3. What did you see instead (Required)

ERROR 1105 (HY000) at line 1: Check columns_to_read_map.contains(cid) failed: ColumnID(-3) not found in columns_to_read_map: (while creating read sources from storage `db_2`.`t_89`, table_id: 89)

4. What is your TiFlash version? (Required)

master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.1 This bug affects the 7.1.x(LTS) versions. component/storage severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant