Skip to content
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

Merged
merged 16 commits into from
Jun 7, 2017
Merged

style: change return to keep code style clean #3407

merged 16 commits into from
Jun 7, 2017

Conversation

hawkingrei
Copy link
Member

Keep code style consistent

@shenli
Copy link
Member

shenli commented Jun 6, 2017

LGTM
@XuHuaiyu PTAL

@shenli
Copy link
Member

shenli commented Jun 6, 2017

Please fix CI.

@XuHuaiyu
Copy link
Contributor

XuHuaiyu commented Jun 6, 2017

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)
Copy link
Contributor

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

Copy link
Member Author

@hawkingrei hawkingrei Jun 6, 2017

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

}
days, err := args[0].ToInt64(b.ctx.GetSessionVars().StmtCtx)
d.SetMysqlTime(types.TimeFromDays(days))
return d, nil
return d, err
Copy link
Contributor

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 XuHuaiyu added the contribution This PR is from a community contributor. label Jun 6, 2017
@hawkingrei
Copy link
Member Author

@XuHuaiyu PTAL

@XuHuaiyu
Copy link
Contributor

XuHuaiyu commented Jun 7, 2017

LGTM

@XuHuaiyu XuHuaiyu added the status/LGT2 Indicates that a PR has LGTM 2. label Jun 7, 2017
@shenli shenli merged commit 0fec425 into pingcap:master Jun 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants