MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / DecomposeKeyTokens

Function DecomposeKeyTokens

pkg/util/encoding/encoding.go:2521–2539  ·  view source on GitHub ↗

DecomposeKeyTokens breaks apart a key into its individual key-encoded values and returns a slice of byte slices, one for each key-encoded value. It also returns whether the key contains a NULL value.

(b []byte)

Source from the content-addressed store, hash-verified

2519// and returns a slice of byte slices, one for each key-encoded value.
2520// It also returns whether the key contains a NULL value.
2521func DecomposeKeyTokens(b []byte) (tokens [][]byte, containsNull bool, err error) {
2522 var out [][]byte
2523
2524 for len(b) > 0 {
2525 tokenLen, err := PeekLength(b)
2526 if err != nil {
2527 return nil, false, err
2528 }
2529
2530 if PeekType(b) == Null {
2531 containsNull = true
2532 }
2533
2534 out = append(out, b[:tokenLen])
2535 b = b[tokenLen:]
2536 }
2537
2538 return out, containsNull, nil
2539}
2540
2541// getInvertedIndexKeyLength finds the length of an inverted index key
2542// encoded as a byte array.

Callers

nothing calls this directly

Calls 2

PeekLengthFunction · 0.85
PeekTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…