Skip to content

Commit

Permalink
planner: avoid slicesgrow in the buildDataSource
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <[email protected]>
  • Loading branch information
hawkingrei committed Jan 10, 2025
1 parent d9dc3f4 commit cd9d3c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4604,16 +4604,16 @@ func (b *PlanBuilder) buildDataSource(ctx context.Context, tn *ast.TableName, as
IndexHints: b.TableHints().IndexHintList,
IndexMergeHints: indexMergeHints,
PossibleAccessPaths: possiblePaths,
Columns: make([]*model.ColumnInfo, 0, len(columns)),
Columns: make([]*model.ColumnInfo, 0, len(columns)+1),
PartitionNames: tn.PartitionNames,
TblCols: make([]*expression.Column, 0, len(columns)),
TblCols: make([]*expression.Column, 0, len(columns)+1),
PreferPartitions: make(map[int][]ast.CIStr),
IS: b.is,
IsForUpdateRead: b.isForUpdateRead,
}.Init(b.ctx, b.getSelectOffset())
var handleCols util.HandleCols
schema := expression.NewSchema(make([]*expression.Column, 0, len(columns))...)
names := make([]*types.FieldName, 0, len(columns))
schema := expression.NewSchema(make([]*expression.Column, 0, len(columns)+1)...)
names := make([]*types.FieldName, 0, len(columns)+1)
for i, col := range columns {
ds.Columns = append(ds.Columns, col.ToInfo())
names = append(names, &types.FieldName{
Expand Down

0 comments on commit cd9d3c0

Please sign in to comment.