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

Function DecodeIfNotNull

pkg/util/encoding/encoding.go:861–866  ·  view source on GitHub ↗

DecodeIfNotNull decodes a not-NULL value from the input buffer. If the input buffer contains a not-NULL marker 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 re

(b []byte)

Source from the content-addressed store, hash-verified

859// distinguish not-NULL from the empty string.
860// This function handles both ascendingly and descendingly encoded NULLs.
861func DecodeIfNotNull(b []byte) ([]byte, bool) {
862 if PeekType(b) == NotNull {
863 return b[1:], true
864 }
865 return b, false
866}
867
868// DecodeIfNotNullDescending decodes encodedNotNullDesc from the input buffer
869// and returns the remaining buffer without the sentinel if encodedNotNullDesc

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…