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,executor: fix select big number on hash partition table panic (#17881) #18186

Merged
merged 5 commits into from
Aug 3, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #17881 to release-4.0


What problem does this PR solve?

Issue Number: close #17813

Problem Summary:

What is changed and how it works?

What's Changed:

Use abs(val % pi.Num) rather than abs(val) % pi.Num

How it Works:

abs(9223372036854775808) get a negative number that is not expected.

We must make sure the return pos is a positive number:

pos = abs(val) % pi.Num
p[pos]

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Release note

  • Fix a panic on hash partition table when the query condition is that the partition column equals to a big number like 9223372036854775808

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@tiancaiamao please accept the invitation then you can push to the cherry-pick pull requests.
https://github.com/ti-srebot/tidb/invitations

@imtbkcat
Copy link

@tiancaiamao please fix conflict

@tiancaiamao
Copy link
Contributor

/run-all-tests

@tiancaiamao
Copy link
Contributor

PTAL @imtbkcat @wjhuang2016

Copy link
Member

@wjhuang2016 wjhuang2016 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot
Copy link
Contributor Author

@wjhuang2016, Thanks for your review, however we are sorry that your vote won't be count. You are not a reviewer or committer or co-leader or leader for the related sigs:execution(slack).

@zz-jason zz-jason modified the milestones: v4.0.2, v4.0.3 Jul 10, 2020
@tiancaiamao
Copy link
Contributor

PTAL @imtbkcat

@winoros winoros modified the milestones: v4.0.3, v4.0.4 Jul 15, 2020
@imtbkcat imtbkcat modified the milestones: v4.0.4, v4.0.5 Jul 28, 2020
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

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 3, 2020
@imtbkcat
Copy link

imtbkcat commented Aug 3, 2020

/merge

@ti-srebot
Copy link
Contributor Author

Sorry @imtbkcat, you don't have permission to trigger auto merge event on this branch.

@imtbkcat
Copy link

imtbkcat commented Aug 3, 2020

/run-all-tests

@jackysp jackysp merged commit e3b553d into pingcap:release-4.0 Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/LGT1 Indicates that a PR has LGTM 1. type/bugfix This PR fixes a bug. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants