*: handle signed/unsigned in the partition pruning#15436
Merged
lysu merged 4 commits intopingcap:masterfrom Mar 24, 2020
Merged
*: handle signed/unsigned in the partition pruning#15436lysu merged 4 commits intopingcap:masterfrom
lysu merged 4 commits intopingcap:masterfrom
Conversation
Contributor
Author
Contributor
Author
|
Some fail cases are range columns partition, we have to merge this one first |
Contributor
Author
imtbkcat
reviewed
Mar 20, 2020
| pruner := rangePruner{lessThan, col, fn} | ||
| pruner := rangePruner{ | ||
| lessThan: lessThanDataInt{ | ||
| data: partExpr.ForRangePruning.LessThan, |
There was a problem hiding this comment.
Using copy here is better? Copy could avoid race here.
Contributor
Author
There was a problem hiding this comment.
It's read-only data... free from data race, so the copy is unnecessary.
The LessThan is different from expression.Expression or ast.StmtNode
The visit function modify the node like here:
node.XX = XX.Accept(Visitor)
And the expression is also modified during use (ugly code).
Contributor
Author
|
PTAL @lysu |
Contributor
Author
|
/run-all-tests |
Codecov Report
@@ Coverage Diff @@
## master #15436 +/- ##
===========================================
Coverage 80.7970% 80.7970%
===========================================
Files 503 503
Lines 136021 136021
===========================================
Hits 109901 109901
Misses 17687 17687
Partials 8433 8433 |
This was referenced Mar 24, 2020
tiancaiamao
added a commit
to tiancaiamao/tidb
that referenced
this pull request
May 15, 2020
tiancaiamao
added a commit
to tiancaiamao/tidb
that referenced
this pull request
May 15, 2020
sre-bot
pushed a commit
that referenced
this pull request
May 20, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Problem Summary:
The old
lessThanDatause int64 for data representation.However, the partition by range less than value can be signed or unsigned.
If it's unsigned, it may be out of the int64 range.
What is changed and how it works?
What's Changed:
makeLessThanDataprocessing to the table creating to reduce allocationexpression.ParseSimpleExprsWithNamesHow it Works:
Compare function now use an unsigned flag to handle the unsigned case.
Related changes
Check List
Tests
Release note