planner: set the partition id to table id in DAG request (#14745)
This commit is contained in:
committed by
GitHub
parent
f71425b32b
commit
36d2dbb7b1
@ -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
|
||||
}
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user