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

planner: fix wrong `DATE/DATETIME` comparison in `BETWEEN` function #10313

Merged
merged 6 commits into from May 6, 2019

Conversation

Projects
None yet
4 participants
@erjiaqing
Copy link
Contributor

commented Apr 29, 2019

What problem does this PR solve?

Fix #9764

What is changed and how it works?

Add converts in betweenToExpression when GetCmpTp4MinMax returns DateTime type. The behavior should be same as MySQL 8.0 now.

In mysql, If all values are string-like (string & datetime) and contains datetime, then values are converted to datetime.

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change
@codecov

This comment has been minimized.

Copy link

commented Apr 29, 2019

Codecov Report

Merging #10313 into master will increase coverage by 0.017%.
The diff coverage is 100%.

@@              Coverage Diff               @@
##             master    #10313       +/-   ##
==============================================
+ Coverage   77.6699%   77.687%   +0.017%     
==============================================
  Files           411       411               
  Lines         85441     85457       +16     
==============================================
+ Hits          66362     66389       +27     
+ Misses        14117     14112        -5     
+ Partials       4962      4956        -6
@codecov

This comment has been minimized.

Copy link

commented Apr 29, 2019

Codecov Report

Merging #10313 into master will increase coverage by 0.0071%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master     #10313        +/-   ##
================================================
+ Coverage   77.6576%   77.6648%   +0.0071%     
================================================
  Files           411        411                
  Lines         85434      85466        +32     
================================================
+ Hits          66346      66377        +31     
+ Misses        14127      14125         -2     
- Partials       4961       4964         +3

@erjiaqing erjiaqing changed the title check if between contains datetime planner: check if between contains datetime Apr 29, 2019

@erjiaqing erjiaqing changed the title planner: check if between contains datetime planner: fix wrong `DATE/DATETIME` comparison in `BETWEEN` function Apr 29, 2019

@qw4990 qw4990 self-requested a review Apr 29, 2019

@qw4990 qw4990 referenced this pull request Apr 29, 2019

Open

Incompatible issues about date and time functions #9717

29 of 33 tasks complete

@qw4990 qw4990 requested a review from XuHuaiyu Apr 30, 2019

@qw4990
Copy link
Contributor

left a comment

LGTM

@c4pt0r c4pt0r added the status/LGT1 label May 1, 2019

erjiaqing added some commits May 5, 2019

@qw4990 qw4990 requested review from lamxTyler and winoros May 6, 2019

@lamxTyler
Copy link
Member

left a comment

LGTM

@lamxTyler lamxTyler added status/LGT2 and removed status/LGT1 labels May 6, 2019

@lamxTyler

This comment has been minimized.

Copy link
Member

commented May 6, 2019

/run-all-tests

@qw4990 qw4990 merged commit 7e80053 into pingcap:master May 6, 2019

16 checks passed

ci/circleci Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 0%)
Details
codecov/project 77.6648% (+0.0071%) compared to 190990b
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/build_check_race Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev_2 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

@erjiaqing erjiaqing deleted the erjiaqing:issue_9764 branch May 9, 2019

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.