Skip to content

Commit

Permalink
planner: set the partition id to table id in DAG request (#14745)
Browse files Browse the repository at this point in the history
  • Loading branch information
lzmhhh123 committed Feb 14, 2020
1 parent f71425b commit 36d2dbb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions planner/core/plan_to_pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ func (p *PhysicalTableScan) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
Columns: model.ColumnsToProto(p.Columns, p.Table.PKIsHandle),
Desc: p.Desc,
}
if p.isPartition {
tsExec.TableId = p.physicalTableID
}
err := SetPBColumnsDefaultValue(ctx, tsExec.Columns, p.Columns)
return &tipb.Executor{Tp: tipb.ExecType_TypeTableScan, TblScan: tsExec}, err
}
Expand Down Expand Up @@ -140,6 +143,9 @@ func (p *PhysicalIndexScan) ToPB(ctx sessionctx.Context) (*tipb.Executor, error)
Columns: model.ColumnsToProto(columns, p.Table.PKIsHandle),
Desc: p.Desc,
}
if p.isPartition {
idxExec.TableId = p.physicalTableID
}
unique := checkCoverIndex(p.Index, p.Ranges)
idxExec.Unique = &unique
return &tipb.Executor{Tp: tipb.ExecType_TypeIndexScan, IdxScan: idxExec}, nil
Expand Down

0 comments on commit 36d2dbb

Please sign in to comment.