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

GeneratedColumn flag is missed when push down table scan to tiflash for partition table #59831

Open
guo-shaoge opened this issue Feb 28, 2025 · 1 comment
Labels
type/bug The issue is confirmed as a bug.

Comments

@guo-shaoge
Copy link
Collaborator

guo-shaoge commented Feb 28, 2025

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

func BuildPartitionTableScanFromInfos(tableInfo *model.TableInfo, columnInfos []*model.ColumnInfo, fastScan bool) *tipb.PartitionTableScan {
pkColIDs := TryGetCommonPkColumnIds(tableInfo)
tsExec := &tipb.PartitionTableScan{
TableId: tableInfo.ID,
Columns: util.ColumnsToProto(columnInfos, tableInfo.PKIsHandle, false, false),
PrimaryColumnIds: pkColIDs,
IsFastScan: &fastScan,
}
if tableInfo.IsCommonHandle {
tsExec.PrimaryPrefixColumnIds = PrimaryPrefixColumnIDs(tableInfo)
}
return tsExec
}

L1785 calls ColumnsToProto(), it assume isTiFlashStore is false(the last argument), which is wrong. Because tiflash can also call this function.

And the GeneratedColumnFlag will be missed because this bug, check

if isTiFlashStore && c.IsVirtualGenerated() {

In most case, tiflash will fill default value into this virtual generated column. But sometimes tiflash will not see the schema of virtual column (check #40663 (comment)), and issue/40663 will happen.

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

master 7569592

@guo-shaoge guo-shaoge added the type/bug The issue is confirmed as a bug. label Feb 28, 2025
@guo-shaoge
Copy link
Collaborator Author

this bug is introduced by #55463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

1 participant