MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / DecodeIfNull

Function DecodeIfNull

pkg/util/encoding/encoding.go:1182–1187  ·  view source on GitHub ↗

DecodeIfNull decodes a NULL value from the input buffer. If the input buffer contains a null at the start of the buffer then it is removed from the buffer and true is returned for the second result. Otherwise, the buffer is returned unchanged and false is returned for the second result. Since the NU

(b []byte)

Source from the content-addressed store, hash-verified

1180// safe to call DecodeIfNull on their encoded values.
1181// This function handles both ascendingly and descendingly encoded NULLs.
1182func DecodeIfNull(b []byte) ([]byte, bool) {
1183 if PeekType(b) == Null {
1184 return b[1:], true
1185 }
1186 return b, false
1187}
1188
1189// DecodeIfNotNull decodes a not-NULL value from the input buffer. If the input
1190// buffer contains a not-NULL marker at the start of the buffer then it is

Callers 1

prettyPrintFirstValueFunction · 0.85

Calls 1

PeekTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…