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: fix a bug of FromGoTime when handling rounding #12240

Merged
merged 2 commits into from
Sep 18, 2019

Conversation

tiancaiamao
Copy link
Contributor

What problem does this PR solve?

Fix #12163

FromGoTime("2019-09-11 11:17:47.999999666") should be round to

{2019 9 11 11 17 48 0}

But the old code get

{2019 9 11 11 17 47 1000000}

That cause the bug in issues/12163

What is changed and how it works?

Fix the FromGoTime function

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

Release note

  • Write release note for bug-fix or new feature.

FromGoTime("2019-09-11 11:17:47.999999666") should round to
{2019 9 11 11 17 48 0}
But get
{2019 9 11 11 17 47 1000000}
@tiancaiamao
Copy link
Contributor Author

PTAL @crazycs520 @jackysp @lysu

@codecov
Copy link

codecov bot commented Sep 17, 2019

Codecov Report

Merging #12240 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #12240   +/-   ##
===========================================
  Coverage   81.2985%   81.2985%           
===========================================
  Files           454        454           
  Lines        100008     100008           
===========================================
  Hits          81305      81305           
  Misses        12873      12873           
  Partials       5830       5830

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 zz-jason added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 17, 2019
Copy link
Contributor

@lysu lysu left a comment

Choose a reason for hiding this comment

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

LGTM

@lysu lysu added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 18, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Sep 18, 2019

/run-all-tests

@sre-bot sre-bot merged commit 8279053 into pingcap:master Sep 18, 2019
@sre-bot
Copy link
Contributor

sre-bot commented Sep 18, 2019

cherry pick to release-3.0 failed

@tiancaiamao tiancaiamao deleted the from-go-time branch September 18, 2019 05:41
@sre-bot
Copy link
Contributor

sre-bot commented Sep 18, 2019

cherry pick to release-3.1 failed

@sre-bot
Copy link
Contributor

sre-bot commented Sep 18, 2019

cherry pick to release-2.1 failed

jacklightChen added a commit to jacklightChen/tidb that referenced this pull request Sep 18, 2019
types: fix a bug of `FromGoTime` when handling rounding (pingcap#12240)
@sre-bot
Copy link
Contributor

sre-bot commented Apr 7, 2020

It seems that, not for sure, we failed to cherry-pick this commit to release-2.1 release-3.0. Please comment '/run-cherry-picker' to try to trigger the cherry-picker if we did fail to cherry-pick this commit before. @tiancaiamao PTAL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/util status/can-merge Indicates a PR has been approved by a committer. 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.

Default current_timestamp function may lead to invalid time format
4 participants