-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
executor: fix cast function will ignore tht error for point-get key construction #22869
Conversation
Signed-off-by: ailinkid <314806019@qq.com>
Signed-off-by: ailinkid <314806019@qq.com>
executor/point_get.go
Outdated
@@ -424,8 +424,13 @@ func EncodeUniqueIndexValuesForKey(ctx sessionctx.Context, tblInfo *model.TableI | |||
str, err = idxVals[i].ToString() | |||
idxVals[i].SetString(str, colInfo.FieldType.Collate) | |||
} else { | |||
// Since this func is only used batch point get, the idxVals should be exactly equals to value in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a truncated error or an overflow error is thrown when converting the type of `idxVal[i]` to the type of `colInfo`, the `idxVal` does not exist in the `idxInfo` for sure.
Signed-off-by: ailinkid <314806019@qq.com>
/run-all-tests |
/LGTM |
/LGTM |
@guo-shaoge: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/LGTM |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 7a06aa6
|
/run-check_dev_2 |
/run-check_dev_2 |
1 similar comment
/run-check_dev_2 |
/run-unit-test |
1 similar comment
/run-unit-test |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #23211 |
Signed-off-by: ailinkid 314806019@qq.com
What problem does this PR solve?
Issue Number: close #22839
What is changed and how it works?
What's Changed:
For (batch) point get, the idxVals should exactly equal to the value in the index record. Cast errors like truncate/data-too-long will trim the idxVals value to the short another one, which will lead to unexpected results. Here we force the cast func to return all the errors.
Seems #17245 is doing the same thing, but it is only for the Overflow error.
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Release note