types/question: fix the variable reallocation in the function EncodeIndexSeekKey (#17831) (#17833)

This commit is contained in:
DaMeiren
2020-06-15 15:59:48 +08:00
committed by GitHub
parent 8943b1edc4
commit 0321395ea9

View File

@ -559,7 +559,7 @@ func Unflatten(datum types.Datum, ft *types.FieldType, loc *time.Location) (type
// EncodeIndexSeekKey encodes an index value to kv.Key.
func EncodeIndexSeekKey(tableID int64, idxID int64, encodedValue []byte) kv.Key {
key := make([]byte, 0, prefixLen+len(encodedValue))
key := make([]byte, 0, RecordRowKeyLen+len(encodedValue))
key = appendTableIndexPrefix(key, tableID)
key = codec.EncodeInt(key, idxID)
key = append(key, encodedValue...)