Skip to content

Commit

Permalink
close pingcap#29469; fix: mistakenly shadowed name idx
Browse files Browse the repository at this point in the history
Signed-off-by: ekexium <ekexium@gmail.com>
  • Loading branch information
ekexium committed Nov 4, 2021
1 parent 2f8f4d6 commit 786d2bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions util/admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,17 +379,17 @@ func CheckRecordAndIndex(ctx context.Context, sessCtx sessionctx.Context, txn kv
return tablecodec.EncodeRecordKey(t.RecordPrefix(), handle)
},
IndexEncode: func(idxRow *consistency.RecordData) kv.Key {
var idx table.Index
var matchingIdx table.Index
for _, v := range t.Indices() {
if strings.EqualFold(v.Meta().Name.String(), idx.Meta().Name.O) {
idx = v
matchingIdx = v
break
}
}
if idx == nil {
if matchingIdx == nil {
return nil
}
k, _, err := idx.GenIndexKey(sessCtx.GetSessionVars().StmtCtx, idxRow.Values, idxRow.Handle, nil)
k, _, err := matchingIdx.GenIndexKey(sessCtx.GetSessionVars().StmtCtx, idxRow.Values, idxRow.Handle, nil)
if err != nil {
return nil
}
Expand Down

0 comments on commit 786d2bd

Please sign in to comment.