-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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 batch point get return wrong result for in(null) #18851
Conversation
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.
LGTM
PTAL @zz-jason |
4.0 PR #18848 |
executor/point_get.go
Outdated
@@ -339,6 +339,10 @@ func (e *PointGetExecutor) get(ctx context.Context, key kv.Key) ([]byte, error) | |||
func EncodeUniqueIndexKey(ctx sessionctx.Context, tblInfo *model.TableInfo, idxInfo *model.IndexInfo, idxVals []types.Datum, tID int64) (_ []byte, err error) { | |||
sc := ctx.GetSessionVars().StmtCtx | |||
for i := range idxVals { | |||
if idxVals[i].IsNull() { |
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.
I think is no the right place to fix the bug.
The idxVals should be skipped in higher level.
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.
We should let the caller know the built key is not valid.
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.
Done
Codecov Report
@@ Coverage Diff @@
## master #18851 +/- ##
===========================================
Coverage 79.1582% 79.1582%
===========================================
Files 546 546
Lines 147718 147718
===========================================
Hits 116931 116931
Misses 21342 21342
Partials 9445 9445 |
LGTM |
/merge |
/run-all-tests |
@tiancaiamao merge failed. |
/run-check_dev_2 |
/merge |
/run-all-tests |
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.
LGTM
@tiancaiamao merge failed. |
LGTM |
@AndreMouche,Thanks for your review. However, LGTM is restricted to Reviewers or higher roles.See the corresponding SIG page for more information. Related SIGs: execution(slack). |
/merge |
/run-all-tests |
What problem does this PR solve?
Issue Number: close #18843
Problem Summary:
What is changed and how it works?
What's Changed:
When constucting point get index key, the datum is convert to the column type.
If the datum is null, convert it to string would construct the wrong index key.
How it Works:
Do not convert the datum if it's null.
Related changes
Check List
Tests
Release note