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

Function DecodeIfNull

pkg/util/encoding/encoding.go:846–851  ·  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

844// safe to call DecodeIfNull on their encoded values.
845// This function handles both ascendingly and descendingly encoded NULLs.
846func DecodeIfNull(b []byte) ([]byte, bool) {
847 if PeekType(b) == Null {
848 return b[1:], true
849 }
850 return b, false
851}
852
853// DecodeIfNotNull decodes a not-NULL value from the input buffer. If the input
854// 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…