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: fix date_add interval month,year diffs from mysql (#8988) #9284

Merged
merged 1 commit into from
Feb 13, 2019

Conversation

haplone
Copy link
Contributor

@haplone haplone commented Feb 12, 2019

What problem does this PR solve?

date_add interval month diffs from mysql

when we execute select date_add('2018-01-31',interval 1 month) in mysql we got 2018-02-28

but in tidb we got 2018-03-03

What is changed and how it works?

  • fix the gap between golang api time.DateDate and mysql date_sub with days in expression/builtin_time.go
  • add GetLastDay in types/mytime.go to get last day in month
  • add test for above methods

Check List

Tests

  • Unit test

@jackysp
Copy link
Member

jackysp commented Feb 12, 2019

/run-all-tests tidb-test=release-2.1 tidb-private-test=release-2.1 tikv=release-2.1

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@zimulala zimulala merged commit adae3b0 into pingcap:release-2.1 Feb 13, 2019
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Dec 18, 2019
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants