Skip to content

Commit

Permalink
pick parts of the 51765
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Keao <[email protected]>
  • Loading branch information
YangKeao committed Dec 5, 2024
1 parent 7ee734f commit a364749
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ddl/ddl_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4843,12 +4843,14 @@ func SetDefaultValue(ctx sessionctx.Context, col *table.Column, option *ast.Colu
col.DefaultIsExpr = isSeqExpr
}

if hasDefaultValue, value, err = checkColumnDefaultValue(ctx, col, value); err != nil {
return hasDefaultValue, errors.Trace(err)
}
value, err = convertTimestampDefaultValToUTC(ctx, value, col)
if err != nil {
return hasDefaultValue, errors.Trace(err)
if !col.DefaultIsExpr {
if hasDefaultValue, value, err = checkColumnDefaultValue(ctx, col, value); err != nil {
return hasDefaultValue, errors.Trace(err)
}
value, err = convertTimestampDefaultValToUTC(ctx, value, col)
if err != nil {
return hasDefaultValue, errors.Trace(err)
}
}
err = setDefaultValueWithBinaryPadding(col, value)
if err != nil {
Expand Down

0 comments on commit a364749

Please sign in to comment.