Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Reminiscent committed Sep 22, 2022
1 parent e78f0e2 commit 7b26599
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions planner/core/planbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3892,11 +3892,11 @@ func (b *PlanBuilder) buildSelectPlanOfInsert(ctx context.Context, insert *ast.I
}
sel.Fields.Fields = append(sel.Fields.Fields, &ast.SelectField{Expr: colName, Offset: len(sel.Fields.Fields)})
}
defer func() {
defer func(originSelFieldLen int) {
// Revert the change for ast. Because when we use the 'prepare' and 'execute' statement it will both build plan which will cause problem.
// You can see the issue #37187 for more details.
sel.Fields.Fields = sel.Fields.Fields[:actualColLen]
}()
sel.Fields.Fields = sel.Fields.Fields[:originSelFieldLen]
}(actualColLen)
}
}
}
Expand Down

0 comments on commit 7b26599

Please sign in to comment.