-
-
Notifications
You must be signed in to change notification settings - Fork 234
implement built-in function str_to_date
#523
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
Conversation
str_to_date
'U': nil, | ||
'u': nil, | ||
'V': nil, | ||
'v': nil, | ||
'W': nil, | ||
'w': nil, | ||
'X': nil, | ||
'x': 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.
TODO
@zachmu it doesn't seem I can tag reviewers, but this is ready for a first pass while I finish up the final few format specifiers. |
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.
Overall this looks really good, thanks for the contribution!
The only things missing:
- An engine test (e.g. enginetest/queries.go)
- I think the time zone semantics are incorrect. Probably need all results in UTC for this to work reliably for everyone
I missed the timezone setup in the test, I get it now :) I'm going to go ahead and merge this in, please add an engine test as a followup. You can implement the missing week specifiers, or leave them as TODO for now. Those are pretty obscure for the purpose of date parsing. |
Closes #518
This PR implements the STR_TO_DATE MySQL function.
In places where the spec is ambiguous, I'm attempting to match the behavior of MySQL version 8 from my manual testing. I need to implement a few more parsers and add more test cases to cover the expected behavior.
cc @zachmu