Skip to content
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

expression,types: improve str_to_date builtin function compatibility #9617

Merged
merged 4 commits into from
Mar 9, 2019

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Mar 8, 2019

What problem does this PR solve?

mysql:

mysql> select str_to_date('10/28/2011 9:46:29 Am','%m/%d/%Y %l:%i:%s %p');
+-------------------------------------------------------------+
| str_to_date('10/28/2011 9:46:29 Am','%m/%d/%Y %l:%i:%s %p') |
+-------------------------------------------------------------+
| 2011-10-28 09:46:29                                         |
+-------------------------------------------------------------+
1 row in set (0.00 sec)

tidb:

mysql> select str_to_date('10/28/2011 9:46:29 Am','%m/%d/%Y %l:%i:%s %p');
+-------------------------------------------------------------+
| str_to_date('10/28/2011 9:46:29 Am','%m/%d/%Y %l:%i:%s %p') |
+-------------------------------------------------------------+
| NULL                                                        |
+-------------------------------------------------------------+
1 row in set, 1 warning (0.00 sec)

%p formator should accept both AM/PM and am/pm, it's case insensitive

What is changed and how it works?

Tiny fix

Check List

Tests

  • Unit test

%p formator should accept both AM/PM and am/pm, it's case insensitive
@tiancaiamao
Copy link
Contributor Author

PTAL @winkyao @lysu

@codecov
Copy link

codecov bot commented Mar 8, 2019

Codecov Report

Merging #9617 into master will increase coverage by 0.0016%.
The diff coverage is 57.1428%.

@@               Coverage Diff                @@
##             master      #9617        +/-   ##
================================================
+ Coverage   67.3832%   67.3849%   +0.0016%     
================================================
  Files           374        374                
  Lines         78938      78942         +4     
================================================
+ Hits          53191      53195         +4     
  Misses        20994      20994                
  Partials       4753       4753

@xiekeyi98 xiekeyi98 mentioned this pull request Mar 8, 2019
@shenli
Copy link
Member

shenli commented Mar 8, 2019

LGTM
Please add labels for this PR.

Copy link
Contributor

@lysu lysu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lysu lysu added the status/LGT2 Indicates that a PR has LGTM 2. label Mar 9, 2019
@lysu
Copy link
Contributor

lysu commented Mar 9, 2019

/run-all-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT2 Indicates that a PR has LGTM 2. type/compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants