Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tangenta committed Nov 27, 2023
1 parent fa2644f commit a49dc23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion br/pkg/lightning/backend/kv/sql2kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func CollectGeneratedColumns(se *Session, meta *model.TableInfo, cols []*table.C
var genCols []GeneratedCol
for i, col := range cols {
if col.GeneratedExpr != nil {
expr, err := expression.RewriteAstExpr(se, col.GeneratedExpr.Clone(), schema, names, true)
expr, err := expression.RewriteAstExpr(se, col.GeneratedExpr.Internal(), schema, names, true)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/table/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func NewClonableExprNode(ctor func() ast.ExprNode, internal ast.ExprNode) *Clona
}
}

// Clone mades a "copy" of the internal ast.ExprNode by reconstructing it.
// Clone makes a "copy" of the internal ast.ExprNode by reconstructing it.
func (n *ClonableExprNode) Clone() ast.ExprNode {
intest.AssertNotNil(n.ctor)
if n.ctor == nil {
Expand All @@ -76,7 +76,7 @@ func (n *ClonableExprNode) Clone() ast.ExprNode {
}

// Internal returns the reference of the internal ast.ExprNode.
// Note: only use this method when you are sure that the internal ast.ExprNode is not modified.
// Note: only use this method when you are sure that the internal ast.ExprNode is not modified concurrently.
func (n *ClonableExprNode) Internal() ast.ExprNode {
return n.internal
}
Expand Down

0 comments on commit a49dc23

Please sign in to comment.