-
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 #580
Conversation
Codecov ReportBase: 35.51% // Head: 36.65% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #580 +/- ##
==========================================
+ Coverage 35.51% 36.65% +1.13%
==========================================
Files 189 192 +3
Lines 21532 22042 +510
==========================================
+ Hits 7648 8079 +431
- Misses 12993 13054 +61
- Partials 891 909 +18
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. |
|
||
// format - YY-MM-DD, YYYY-MM-DD | ||
pat := "^\\d{1,4}[~!@#$%^&*_+\\-=:;,.|?/]{1}\\d{1,2}[~!@#$%^&*_+\\-=:;,.|?/]{1}\\d{1,2}$" | ||
match, err := regexp.MatchString(pat, dateArgs) |
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.
Define reg as global variable
} | ||
// format - YYYYMMDD, YYMMDD | ||
pat = "^\\d{5,8}$" | ||
match, err = regexp.MatchString(pat, dateArgs) |
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.
ditto
} | ||
|
||
pat := "^\\d{1,4}[~!@#$%^&*_+\\-=:;,|?/]{1}\\d{1,2}[~!@#$%^&*_+\\-=:;,|?/]{1}\\d{1,2}$" | ||
match, err := regexp.MatchString(pat, datetimeArr[0]) |
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.
ditto
} else { | ||
// format - YYYYMMDDhhmmss.ms | ||
pat := "^\\d{11,14}$" | ||
match, err := regexp.MatchString(pat, datetimeArgs) |
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.
ditto
这些都不可以用标准库来处理吗? |
求推荐~~ |
|
按周会讨论的思路重新整理下逻辑吧 |
What this PR does:
Which issue(s) this PR fixes:
Fixes #570 #569 #568
Special notes for your reviewer:
Does this PR introduce a user-facing change?: