From 686bb2f8e00f97783bd9c4e5ebbc57b4b45a9d69 Mon Sep 17 00:00:00 2001 From: Yiding Cui Date: Wed, 26 Jun 2024 10:05:51 +0800 Subject: [PATCH] planner: remove dead codes for buildDelete (#54212) --- pkg/planner/core/logical_plan_builder.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/pkg/planner/core/logical_plan_builder.go b/pkg/planner/core/logical_plan_builder.go index cf3fcf2f54..cffecbdb5a 100644 --- a/pkg/planner/core/logical_plan_builder.go +++ b/pkg/planner/core/logical_plan_builder.go @@ -6199,21 +6199,6 @@ func (b *PlanBuilder) buildDelete(ctx context.Context, ds *ast.DeleteStmt) (base proj.SetOutputNames(p.OutputNames()[:oldLen]) p = proj - handleColsMap := b.handleHelper.tailMap() - for _, cols := range handleColsMap { - for _, col := range cols { - for i := 0; i < col.NumCols(); i++ { - exprCol := col.GetCol(i) - if proj.Schema().Contains(exprCol) { - continue - } - proj.Exprs = append(proj.Exprs, exprCol) - proj.Schema().Columns = append(proj.Schema().Columns, exprCol) - proj.SetOutputNames(append(proj.OutputNames(), types.EmptyName)) - } - } - } - del := Delete{ IsMultiTable: ds.IsMultiTable, }.Init(b.ctx) @@ -6285,6 +6270,7 @@ func (b *PlanBuilder) buildDelete(ctx context.Context, ds *ast.DeleteStmt) (base b.visitInfo = appendVisitInfo(b.visitInfo, mysql.DeletePriv, dbName, v.Name.L, "", authErr) } } + handleColsMap := b.handleHelper.tailMap() tblID2Handle, err := resolveIndicesForTblID2Handle(handleColsMap, p.Schema()) if err != nil { return nil, err