From 0321395ea9f0c4e20f89bc72e9dc3e32b42dec46 Mon Sep 17 00:00:00 2001 From: DaMeiren Date: Mon, 15 Jun 2020 15:59:48 +0800 Subject: [PATCH] types/question: fix the variable reallocation in the function EncodeIndexSeekKey (#17831) (#17833) --- tablecodec/tablecodec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tablecodec/tablecodec.go b/tablecodec/tablecodec.go index 36de2a375c..2ea60221d8 100644 --- a/tablecodec/tablecodec.go +++ b/tablecodec/tablecodec.go @@ -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...)