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

planner, table: set PrimaryPrefixColumnIds correctly #23250

Merged
merged 12 commits into from
Mar 12, 2021
3 changes: 0 additions & 3 deletions planner/core/plan_to_pb.go
Original file line number Diff line number Diff line change
@@ -197,9 +197,6 @@ func (p *PhysicalTableScan) ToPB(ctx sessionctx.Context, storeType kv.StoreType)
executorID = p.ExplainID().String()
}
err := SetPBColumnsDefaultValue(ctx, tsExec.Columns, p.Columns)
if p.Table.IsCommonHandle {
tsExec.PrimaryPrefixColumnIds = tables.PrimaryPrefixColumnIDs(p.Table)
}
return &tipb.Executor{Tp: tipb.ExecType_TypeTableScan, TblScan: tsExec, ExecutorId: &executorID}, err
}

3 changes: 3 additions & 0 deletions table/tables/tables.go
Original file line number Diff line number Diff line change
@@ -1746,5 +1746,8 @@ func BuildTableScanFromInfos(tableInfo *model.TableInfo, columnInfos []*model.Co
Columns: util.ColumnsToProto(columnInfos, tableInfo.PKIsHandle),
PrimaryColumnIds: pkColIds,
}
if tableInfo.IsCommonHandle {
tsExec.PrimaryPrefixColumnIds = PrimaryPrefixColumnIDs(tableInfo)
}
return tsExec
}