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

*: fix bug when unsigned histogram meets signed ranges in feedback #10415

Merged
merged 4 commits into from
May 14, 2019

Conversation

alivxxx
Copy link
Contributor

@alivxxx alivxxx commented May 10, 2019

What problem does this PR solve?

Sometimes, the planner will generate signed scan ranges for an unsigned primary key.
So when feedback split the signed ranges according to a histogram, it may split ranges to [5(signed), +inf(unsigned)], and it is not valid when we call validRange and will be dropped, which will lead to the wrong scan ranges.

What is changed and how it works?

First, it fixes the cases that planner generate signed ranges for the unsigned primary key; Second, it adds checks when we split ranges and make sure that the type of histogram and ranges match.

Check List

Tests

  • Integration test

Code changes

  • Has exported function/method change

Side effects

  • None

Related changes

  • Need to cherry-pick to the release branch

@codecov
Copy link

codecov bot commented May 13, 2019

Codecov Report

Merging #10415 into master will decrease coverage by 0.0035%.
The diff coverage is 62.5%.

@@               Coverage Diff                @@
##             master     #10415        +/-   ##
================================================
- Coverage   77.3312%   77.3277%   -0.0036%     
================================================
  Files           412        412                
  Lines         86467      86555        +88     
================================================
+ Hits          66866      66931        +65     
- Misses        14474      14488        +14     
- Partials       5127       5136         +9

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

Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

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

LGTM

@qw4990
Copy link
Contributor

qw4990 commented May 14, 2019

/run-all-tests

@alivxxx alivxxx merged commit 7d7c146 into pingcap:master May 14, 2019
@alivxxx alivxxx deleted the feedback branch May 14, 2019 07:49
@alivxxx alivxxx added the status/LGT2 Indicates that a PR has LGTM 2. label May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/statistics 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.

3 participants