-
Notifications
You must be signed in to change notification settings - Fork 92
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
Support MySQL CAST_TIME/CAST_DATE/CAST_DATETIME function #606
Conversation
Codecov ReportBase: 35.82% // Head: 36.95% // Increases project coverage by
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## master #606 +/- ##
==========================================
+ Coverage 35.82% 36.95% +1.12%
==========================================
Files 195 198 +3
Lines 21659 22145 +486
==========================================
+ Hits 7759 8183 +424
- Misses 13006 13053 +47
- Partials 894 909 +15
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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 fix
…-db#606) * add node config support (arana-db#464) * Support MySQL CAST_CHAR function. * format style * Support MySQL CAST_TIME function. (arana-db#570) * Support MySQL CAST_DATE function. (arana-db#569) * Support MySQL CAST_DATETIME function. (arana-db#568) * Support MySQL CAST_TIME/CAST_DATE/CAST_DATETIME function * Resolve Conversation
转换需求:非标准格式时间字符串转成标准格式时间字符串
cast_time.go
cast_time_test.go
解析格式(分割符固定为冒号):
1)+-D hhh:mm:ss.ms,+-D hhh:mm.ms,+-D hhh.ms
2)+-hhh:mm:ss.ms,+-hhh:mm.ms
3)+-hhhmmss.ms,+-mmss.ms,+-ss.ms
统一输出:
+-hhh:mm:ss
cast_date.go
cast_date_test.go
解析格式(分割符为任意个非字母数字符号):
1)YY-MM-DD, YYYY-MM-DD
2)YYYYMMDD, YYMMDD
统一输出:
YYYY-MM-DD
cast_datetime.go
cast_datetime_test.go
解析格式(分割符为任意个非字母数字符号):
1)YYYY-MM-DD hh:mm:ss.ms, YY-MM-DD hh:mm:ss.ms
2)YYYYMMDDhhmmss.ms, YYMMDDhhmmss.ms
统一输出:
YYYY-MM-DD hh:mm:ss
排除Carbon函数库,理由是:函数库支持对标准时间格式进行各类加减和比较运算,不符合需求