Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
AilinKid committed Mar 10, 2020
1 parent 6aa6247 commit 1f136c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions executor/insert_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,8 @@ func (e *InsertValues) getColDefaultValue(idx int, col *table.Column) (d types.D
if e.colDefaultVals != nil && e.colDefaultVals[idx].valid {
if !col.DefaultIsExpr {
return e.colDefaultVals[idx].val, nil
} else {
return table.EvalColDefaultExprNode(e.ctx, col.ToInfo(), e.colDefaultVals[idx].expr)
}
return table.EvalColDefaultExpr(e.ctx, col.ToInfo(), e.colDefaultVals[idx].expr)
}
var (
defaultVal types.Datum
Expand All @@ -529,7 +528,7 @@ func (e *InsertValues) getColDefaultValue(idx int, col *table.Column) (d types.D
if err != nil {
return types.Datum{}, err
}
defaultVal, err = table.EvalColDefaultExprNode(e.ctx, col.ToInfo(), defaultExpr)
defaultVal, err = table.EvalColDefaultExpr(e.ctx, col.ToInfo(), defaultExpr)
}
if err != nil {
return types.Datum{}, err
Expand Down
2 changes: 1 addition & 1 deletion table/column.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func GetColDefaultExpr(col *model.ColumnInfo) (ast.ExprNode, error) {
}

// EvalColDefaultExpr eval default expr node to explicit default value.
func EvalColDefaultExprNode(ctx sessionctx.Context, col *model.ColumnInfo, defaultExpr ast.ExprNode) (types.Datum, error) {
func EvalColDefaultExpr(ctx sessionctx.Context, col *model.ColumnInfo, defaultExpr ast.ExprNode) (types.Datum, error) {
d, err := expression.EvalAstExpr(ctx, defaultExpr)
if err != nil {
return types.Datum{}, err
Expand Down

0 comments on commit 1f136c7

Please sign in to comment.