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 incorrect weekday for ALLOW_INVALID_DATES mode #10864

Merged
merged 10 commits into from
Jul 12, 2019

Conversation

b41sh
Copy link
Member

@b41sh b41sh commented Jun 19, 2019

What problem does this PR solve?

Fix the problem invalid weekday function
#10835

What is changed and how it works?

ignore GoTime error

Check List

Tests

  • Unit test
  • Integration test

@codecov
Copy link

codecov bot commented Jun 20, 2019

Codecov Report

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

@@             Coverage Diff             @@
##             master     #10864   +/-   ##
===========================================
  Coverage   81.2957%   81.2957%           
===========================================
  Files           423        423           
  Lines         90124      90124           
===========================================
  Hits          73267      73267           
  Misses        11557      11557           
  Partials       5300       5300

@imtbkcat imtbkcat added contribution This PR is from a community contributor. type/bugfix This PR fixes a bug. labels Jul 8, 2019
Copy link

@imtbkcat imtbkcat left a comment

Choose a reason for hiding this comment

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

Please add some test.

if err != nil {
return 0
return t1.Weekday()
Copy link

Choose a reason for hiding this comment

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

Suggested change
return t1.Weekday()
t1, _ := t.GoTime(gotime.Local)
return t1.Weekday()

I think this is better.

Copy link
Member Author

@b41sh b41sh Jul 8, 2019

Choose a reason for hiding this comment

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

we can't ignore err check

@imtbkcat imtbkcat added type/compatibility and removed type/bugfix This PR fixes a bug. labels Jul 8, 2019
@imtbkcat imtbkcat changed the title fix incorrect weekday types: fix incorrect weekday for ALLOW_INVALID_DATES mode Jul 8, 2019
Copy link
Member

@winoros winoros left a comment

Choose a reason for hiding this comment

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

lgtm

@imtbkcat
Copy link

/run-all-tests

Copy link

@imtbkcat imtbkcat left a comment

Choose a reason for hiding this comment

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

LGTM

@cyliu0
Copy link
Contributor

cyliu0 commented Nov 6, 2019

@b41sh We may need to cherry pick this one to release branches including release-3.1.

@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. @imtbkcat PTAL.

@imtbkcat
Copy link

imtbkcat commented Apr 8, 2020

/run-cherry-picker

sre-bot pushed a commit to sre-bot/tidb that referenced this pull request Apr 8, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Apr 8, 2020

cherry pick to release-2.1 in PR #16169

@sre-bot
Copy link
Contributor

sre-bot commented Apr 8, 2020

cherry pick to release-3.0 in PR #16170

@sre-bot
Copy link
Contributor

sre-bot commented Apr 8, 2020

cherry pick to release-3.1 in PR #16171

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. type/bugfix This PR fixes a bug. type/compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants