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

An batchCop query for a table containing generated columns returns an error #51330

Closed
bindsang opened this issue Feb 27, 2024 · 7 comments
Closed
Labels

Comments

@bindsang
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

-- create table
create table generate_demo (
id bigint not null,
created_at datetime not null,
is_removed boolean not null,
updated_at datetime null,
__since_at datetime generated as (updated_at) virtual,
primary key (id)
);
-- set tiflash replica
alter table test.generate_demo set tiflash replica 1;
-- init data
insert into generate_demo (id, created_at, is_removed, updated_at) values (1, now(), 0, null), (2, now(), 1, now())
;

This error occurs only if the __since_at column is set to virtual.
use 'alter table .... add column....' to add generated column is the same with the statement 'create table .....'

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

I expect to see the below query execute successful and return correct results.

set tidb_isolation_read_engines = ‘tikv,tiflash’;
select * from generate_demo 
order by created_at asc
limit 100;

3. What did you see instead (Required)

I received error like this:

Error Code: 1105
Not found column table_scan_1 in block. There are only columns: table_scan_0, table_scan_2

the execution plan is:

id                          estRows  task               access object        operator info                                       
--------------------------  -------  -----------------  -------------------  ----------------------------------------------------
TopN_7                      2.00     root                                    test.generate_demo.created_at, offset:0, count:100  
└─TableReader_14            2.00     root                                    data:TopN_13                                        
  └─TopN_13                 2.00     batchCop[tiflash]                       test.generate_demo.created_at, offset:0, count:100  
    └─TableFullScan_12      2.00     batchCop[tiflash]  table:generate_demo  keep order:false, stats:pseudo                      

4. What is your TiDB version? (Required)

Release Version: v7.1.2
Edition: Community
Git Commit Hash: aa6ed99
Git Branch: heads/refs/tags/v7.1.2
UTC Build Time: 2023-10-21 07:46:04
GoVersion: go1.20.10
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: unistore

@bindsang bindsang added the type/bug The issue is confirmed as a bug. label Feb 27, 2024
@aytrack
Copy link
Contributor

aytrack commented Feb 27, 2024

can not reproduce this on master and v7.5.1

@SeaRise
Copy link
Contributor

SeaRise commented Feb 27, 2024

same as pingcap/tiflash#8787

@SeaRise
Copy link
Contributor

SeaRise commented Feb 27, 2024

can not reproduce this on master and v7.5.1

pingcap/tiflash#8787 (comment)
master branch also has this problem

Copy link

ti-chi-bot bot commented Feb 27, 2024

@SeaRise: The label(s) affect-7.5 cannot be applied. These labels are supported: fuzz/sqlancer, challenge-program, compatibility-breaker, first-time-contributor, contribution, good first issue, correctness, duplicate, proposal, security, ok-to-test, needs-ok-to-test, needs-more-info, needs-cherry-pick-release-5.4, needs-cherry-pick-release-6.1, needs-cherry-pick-release-6.5, needs-cherry-pick-release-7.1, needs-cherry-pick-release-7.5, needs-cherry-pick-release-7.6, affects-5.4, affects-6.1, affects-6.5, affects-7.1, affects-7.5, affects-7.6, may-affects-5.4, may-affects-6.1, may-affects-6.5, may-affects-7.1, may-affects-7.5, may-affects-7.6.

In response to this:

/label affect-7.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@SeaRise
Copy link
Contributor

SeaRise commented Feb 27, 2024

/label affects-7.5

Copy link

ti-chi-bot bot commented Feb 27, 2024

@SeaRise: The label(s) affect-7.5 cannot be applied. These labels are supported: fuzz/sqlancer, challenge-program, compatibility-breaker, first-time-contributor, contribution, good first issue, correctness, duplicate, proposal, security, ok-to-test, needs-ok-to-test, needs-more-info, needs-cherry-pick-release-5.4, needs-cherry-pick-release-6.1, needs-cherry-pick-release-6.5, needs-cherry-pick-release-7.1, needs-cherry-pick-release-7.5, needs-cherry-pick-release-7.6, affects-5.4, affects-6.1, affects-6.5, affects-7.1, affects-7.5, affects-7.6, may-affects-5.4, may-affects-6.1, may-affects-6.5, may-affects-7.1, may-affects-7.5, may-affects-7.6.

In response to this:

/label affect-7.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@guo-shaoge
Copy link
Collaborator

pingcap/tiflash#8787

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants