-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Builtin: Add a new built-in functin MAKEDATE #3105
Conversation
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
expression/builtin_time.go
Outdated
if args[0].IsNull() || args[1].IsNull() { | ||
return d, nil | ||
} | ||
year := args[0].GetInt64() |
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.
Use args[0].ToInt64(). MySQL also accept other type of input:
mysql> select makedate("71", 1);
+-------------------+
| makedate("71", 1) |
+-------------------+
| 1971-01-01 |
+-------------------+
1 row in set (0.00 sec)
expression/builtin_time.go
Outdated
return d, nil | ||
} | ||
year := args[0].GetInt64() | ||
dayOfYear := args[1].GetInt64() |
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.
So as here.
@shenli Well, has been repaired, thank you |
LGTM |
Add a new built-in functin MAKEDATE
#236