-
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
parser, expression: implement builtin LAST_DAY #4290
Conversation
Merge master code
Code Merge
expression/builtin_time.go
Outdated
} | ||
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 { |
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.
move the error check up, just after newBaseBuiltinFuncWithTp
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.
ok
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.
Rest LGTM
parser/parser.y
Outdated
@@ -372,6 +372,7 @@ import ( | |||
toBase64 "TO_BASE64" | |||
toDays "TO_DAYS" | |||
toSeconds "TO_SECONDS" | |||
lastDay "LAST_DAY" |
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.
Indent.
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.
done
@@ -103,6 +103,10 @@ func (t mysqlTime) GoTime(loc *gotime.Location) (gotime.Time, error) { | |||
return tm, nil | |||
} | |||
|
|||
func (t mysqlTime) IsLeapYear() bool { |
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.
Please add unit test for this.
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.
done
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.
LGTM
Please resolve the conflicts. |
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.
LGTM
for #4080
details about 'LAST_DAY', see: https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_last-day