MCPcopy
hub / github.com/pingcap/tidb / TempIndexKey2IndexKey

Function TempIndexKey2IndexKey

pkg/tablecodec/tablecodec.go:1296–1301  ·  view source on GitHub ↗

TempIndexKey2IndexKey generates an index key from temporary index key.

(tempIdxKey []byte)

Source from the content-addressed store, hash-verified

1294
1295// TempIndexKey2IndexKey generates an index key from temporary index key.
1296func TempIndexKey2IndexKey(tempIdxKey []byte) {
1297 tmpIdxIDBytes := tempIdxKey[prefixLen : prefixLen+idLen]
1298 tempIdxID := codec.DecodeCmpUintToInt(binary.BigEndian.Uint64(tmpIdxIDBytes))
1299 eid := codec.EncodeIntToCmpUint(tempIdxID & IndexIDMask)
1300 binary.BigEndian.PutUint64(tempIdxKey[prefixLen:], eid)
1301}
1302
1303// IsTempIndexKey checks whether the input key is for a temp index.
1304func IsTempIndexKey(indexKey []byte) (isTemp bool) {

Callers 5

checkHandleConsistencyFunction · 0.92
batchCheckAndInsertMethod · 0.92
fetchTempIndexValsMethod · 0.92
TestTempIndexKeyFunction · 0.85

Calls 2

DecodeCmpUintToIntFunction · 0.92
EncodeIntToCmpUintFunction · 0.92

Tested by 1

TestTempIndexKeyFunction · 0.68