MCPcopy Create free account
hub / github.com/pingcap/tidb / CutIndexKeyTo

Function CutIndexKeyTo

pkg/tablecodec/tablecodec.go:747–759  ·  view source on GitHub ↗

CutIndexKeyTo cuts encoded index key into colIDs to bytes slices. The caller should prepare the memory of the result values.

(key kv.Key, values [][]byte)

Source from the content-addressed store, hash-verified

745// CutIndexKeyTo cuts encoded index key into colIDs to bytes slices.
746// The caller should prepare the memory of the result values.
747func CutIndexKeyTo(key kv.Key, values [][]byte) (b []byte, err error) {
748 b = key[prefixLen+idLen:]
749 length := len(values)
750 for i := 0; i < length; i++ {
751 var val []byte
752 val, b, err = codec.CutOne(b)
753 if err != nil {
754 return nil, errors.Trace(err)
755 }
756 values[i] = val
757 }
758 return
759}
760
761// CutIndexKeyNew cuts encoded index key into colIDs to bytes slices.
762// The returned value b is the remaining bytes of the key which would be empty if it is unique index or handle data

Callers 2

CutIndexKeyNewFunction · 0.85

Calls 1

CutOneFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…