Skip to content

Commit cd9d3c0

Browse files
committed
planner: avoid slicesgrow in the buildDataSource
Signed-off-by: Weizhen Wang <[email protected]>
1 parent d9dc3f4 commit cd9d3c0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/planner/core/logical_plan_builder.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -4604,16 +4604,16 @@ func (b *PlanBuilder) buildDataSource(ctx context.Context, tn *ast.TableName, as
46044604
IndexHints: b.TableHints().IndexHintList,
46054605
IndexMergeHints: indexMergeHints,
46064606
PossibleAccessPaths: possiblePaths,
4607-
Columns: make([]*model.ColumnInfo, 0, len(columns)),
4607+
Columns: make([]*model.ColumnInfo, 0, len(columns)+1),
46084608
PartitionNames: tn.PartitionNames,
4609-
TblCols: make([]*expression.Column, 0, len(columns)),
4609+
TblCols: make([]*expression.Column, 0, len(columns)+1),
46104610
PreferPartitions: make(map[int][]ast.CIStr),
46114611
IS: b.is,
46124612
IsForUpdateRead: b.isForUpdateRead,
46134613
}.Init(b.ctx, b.getSelectOffset())
46144614
var handleCols util.HandleCols
4615-
schema := expression.NewSchema(make([]*expression.Column, 0, len(columns))...)
4616-
names := make([]*types.FieldName, 0, len(columns))
4615+
schema := expression.NewSchema(make([]*expression.Column, 0, len(columns)+1)...)
4616+
names := make([]*types.FieldName, 0, len(columns)+1)
46174617
for i, col := range columns {
46184618
ds.Columns = append(ds.Columns, col.ToInfo())
46194619
names = append(names, &types.FieldName{

0 commit comments

Comments
 (0)