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 `cast(-num as datetime)` to return null instead of error #10368

Merged
merged 8 commits into from May 8, 2019

Conversation

Projects
None yet
3 participants
@qw4990
Copy link
Contributor

commented May 6, 2019

What problem does this PR solve?

Fix #9769

What is changed and how it works?

Call handleInvalidTimeError to handle errors.

Check List

Tests

  • Unit test
{0, types.NewIntDatum(0), types.KindInt64, "0"},
{0, types.NewIntDatum(-1), types.KindInt64, "0"},
{0, types.NewIntDatum(12345), types.KindInt64, "0"},
//{0, types.NewIntDatum(0), types.KindInt64, "0"},

This comment has been minimized.

Copy link
@qw4990

qw4990 May 6, 2019

Author Contributor

This is another bug(#10361) and I will fix it by another PR.

result.Check(testkit.Rows("0"))
result = tk.MustQuery("SELECT UNIX_TIMESTAMP(12345);")
result.Check(testkit.Rows("0"))
//result = tk.MustQuery("SELECT UNIX_TIMESTAMP(-1);")

This comment has been minimized.

Copy link
@qw4990

qw4990 May 6, 2019

Author Contributor

This is another bug(#10361) and I will fix it by another PR.

@codecov

This comment has been minimized.

Copy link

commented May 6, 2019

Codecov Report

Merging #10368 into master will decrease coverage by 0.0214%.
The diff coverage is 50%.

@@               Coverage Diff                @@
##             master     #10368        +/-   ##
================================================
- Coverage   77.3669%   77.3454%   -0.0215%     
================================================
  Files           412        412                
  Lines         85702      85687        -15     
================================================
- Hits          66305      66275        -30     
- Misses        14363      14383        +20     
+ Partials       5034       5029         -5

@qw4990 qw4990 force-pushed the qw4990:fix-9769 branch from e5bada7 to 96e666d May 6, 2019

@qw4990 qw4990 requested review from erjiaqing, lamxTyler and XuHuaiyu May 6, 2019

@qw4990 qw4990 referenced this pull request May 7, 2019

Open

Incompatible issues about date and time functions #9717

29 of 33 tasks complete

@qw4990 qw4990 requested a review from zz-jason May 8, 2019

@XuHuaiyu

This comment has been minimized.

Copy link
Contributor

commented May 8, 2019

/run-all-tests

@XuHuaiyu
Copy link
Contributor

left a comment

LGTM

@XuHuaiyu XuHuaiyu changed the title expression: fix issue that `cast` is not compatible with MySQL expression: fix `cast(-num as datetime)` to return null instead of error May 8, 2019

@XuHuaiyu XuHuaiyu added the status/LGT1 label May 8, 2019

@qw4990 qw4990 force-pushed the qw4990:fix-9769 branch from 7d24dc2 to c3b1086 May 8, 2019

@lamxTyler
Copy link
Member

left a comment

LGTM

@lamxTyler

This comment has been minimized.

Copy link
Member

commented May 8, 2019

/run-all-tests

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

@qw4990

This comment has been minimized.

Copy link
Contributor Author

commented May 8, 2019

/run-all-tests

@qw4990 qw4990 merged commit 2133b06 into pingcap:master May 8, 2019

8 checks passed

ci/circleci Your tests passed on CircleCI!
Details
codecov/patch 50% of diff hit (target 0%)
Details
codecov/project 77.3454% (-0.0215%) compared to d5fcfb0
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
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.