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

types: refine the parsing logic of INTERVAL to correct DATE_ADD/DATE_SUB #9874

Merged
merged 11 commits into from
Mar 30, 2019

Conversation

b41sh
Copy link
Member

@b41sh b41sh commented Mar 24, 2019

What problem does this PR solve?

fix #9715, the problem that date_add and date_sub are incompatible with MySQL.

What is changed and how it works?

modify extractDayHour and extractYearMonth function to compatible with Mysql

Check List

Tests

  • Unit test
  • Integration test

@codecov
Copy link

codecov bot commented Mar 24, 2019

Codecov Report

Merging #9874 into master will increase coverage by 0.0144%.
The diff coverage is 80.851%.

@@               Coverage Diff                @@
##             master      #9874        +/-   ##
================================================
+ Coverage   77.5253%   77.5397%   +0.0144%     
================================================
  Files           404        404                
  Lines         81732      81562       -170     
================================================
- Hits          63363      63243       -120     
+ Misses        13662      13644        -18     
+ Partials       4707       4675        -32

types/time.go Outdated Show resolved Hide resolved
types/time.go Outdated Show resolved Hide resolved
types/time.go Outdated Show resolved Hide resolved
types/time.go Outdated Show resolved Hide resolved
@zz-jason zz-jason added contribution This PR is from a community contributor. type/bugfix This PR fixes a bug. component/expression labels Mar 25, 2019
@qw4990 qw4990 self-requested a review March 25, 2019 06:26
types/time.go Outdated Show resolved Hide resolved
types/time.go Show resolved Hide resolved
Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

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

LGTM

@qw4990 qw4990 added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 27, 2019
@b41sh
Copy link
Member Author

b41sh commented Mar 30, 2019

@zz-jason PTAL

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@zz-jason
Copy link
Member

/run-all-tests

@zz-jason zz-jason added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 30, 2019
@zz-jason zz-jason changed the title fix date_add and date_sub are incompatible with Mysql types: refine the parsing logic of INTERVAL to correct DATE_ADD/DATE_SUB Mar 30, 2019
@zz-jason zz-jason merged commit cebc7ff into pingcap:master Mar 30, 2019
@zz-jason
Copy link
Member

@b41sh please cherry pick this PR to release-2.1

@b41sh
Copy link
Member Author

b41sh commented Mar 31, 2019

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression contribution This PR is from a community contributor. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

date_add and date_sub are incompatible with Mysql
3 participants