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

parser, expression: implement builtin LAST_DAY #4290

Merged
merged 34 commits into from
Aug 23, 2017

Conversation

spongedu
Copy link
Contributor

}
bf, err := newBaseBuiltinFuncWithTp(args, ctx, tpTime, tpTime)
bf.tp.Tp, bf.tp.Flen, bf.tp.Decimal = mysql.TypeDate, mysql.MaxDateWidth, types.DefaultFsp
if err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move the error check up, just after newBaseBuiltinFuncWithTp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

@shenli shenli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

parser/parser.y Outdated
@@ -372,6 +372,7 @@ import (
toBase64 "TO_BASE64"
toDays "TO_DAYS"
toSeconds "TO_SECONDS"
lastDay "LAST_DAY"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -103,6 +103,10 @@ func (t mysqlTime) GoTime(loc *gotime.Location) (gotime.Time, error) {
return tm, nil
}

func (t mysqlTime) IsLeapYear() bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add unit test for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jackysp
Copy link
Member

jackysp commented Aug 23, 2017

Please resolve the conflicts.

@jackysp jackysp added conflicting status/LGT1 Indicates that a PR has LGTM 1. labels Aug 23, 2017
Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 23, 2017
@zz-jason zz-jason merged commit 31819a8 into pingcap:master Aug 23, 2017
@spongedu spongedu deleted the builtin_lastday branch August 23, 2017 08:48
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Dec 18, 2019
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.

5 participants