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

Projects
None yet
3 participants
@haplone
Copy link
Contributor

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

This comment has been minimized.

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

@jackysp
Copy link
Member

jackysp left a comment

LGTM

@zimulala
Copy link
Member

zimulala left a comment

LGTM

@zimulala zimulala merged commit adae3b0 into pingcap:release-2.1 Feb 13, 2019

13 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/common-test job succeeded
Details
idc-jenkins-ci-tidb/integration-common-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-compatibility-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/integration-ddl-test Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/mybatis-test job succeeded
Details
idc-jenkins-ci-tidb/sqllogic-test-1 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/sqllogic-test-2 Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.