-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style: change return to keep code style clean #3407
Conversation
LGTM |
Please fix CI. |
Please fix CI, rest LGTM @hawkingrei |
@@ -395,7 +394,7 @@ func (b *builtinFromDaysSig) eval(row []types.Datum) (d types.Datum, err error) | |||
} | |||
days, err := args[0].ToInt64(b.ctx.GetSessionVars().StmtCtx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The err
is not handled, so CI failed. @hawkingrei
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@XuHuaiyu but I add error handler. CI still failed
…to fix/return_code_style
…to fix/return_code_style
expression/builtin_time.go
Outdated
} | ||
days, err := args[0].ToInt64(b.ctx.GetSessionVars().StmtCtx) | ||
d.SetMysqlTime(types.TimeFromDays(days)) | ||
return d, nil | ||
return d, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If args[0] is a string like "z500z",
ToInt64 will cause a TruncatedError,
thus, test case can not be passed if we change return d, nil
to return d, err
.
You can keep it return d, nil
currently.
@XuHuaiyu PTAL |
LGTM |
Keep code style consistent