-
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
types: fix StrToDate handling of %h and %p (#17395) #17498
Conversation
/run-all-tests |
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
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
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
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
cherry-pick #17395 to release-4.0
What problem does this PR solve?
Problem Summary: handling of
%h
in date format is not consistent with MySQL. MySQL only allows1..12
(with or without zero padding), while TiDB allows01..24
(with zero padding).What is changed and how it works?
What's Changed:
types/time.go
:hour24TwoDigits
, now%h
and%I
are synonyms.How it Works:
Related changes
N/A
Check List
Tests
Side effects
13:00:00 am
,%h:%i:%s %p
used to be valid, now it is not, since%h
must be in1..12
range.1:00:00 am
,%h:%i:%s %p
used to be invalid (single digit hour), not it is.Release note
%h
in date formats should now be in 1..12 range.