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

Function IntToOid

pkg/sql/sem/tree/datum.go:5647–5654  ·  view source on GitHub ↗

IntToOid is a helper that turns a DInt into an oid.Oid and checks that the value is in range.

(i DInt)

Source from the content-addressed store, hash-verified

5645// IntToOid is a helper that turns a DInt into an oid.Oid and checks that the
5646// value is in range.
5647func IntToOid(i DInt) (oid.Oid, error) {
5648 if intIsOutOfOIDRange(i) {
5649 return 0, pgerror.Newf(
5650 pgcode.NumericValueOutOfRange, "OID out of range: %d", i,
5651 )
5652 }
5653 return oid.Oid(i), nil
5654}
5655
5656func intIsOutOfOIDRange(i DInt) bool {
5657 return i > math.MaxUint32 || i < math.MinInt32

Callers 4

CompareMethod · 0.85
CompareMethod · 0.85
ParseDOidAsIntFunction · 0.85
ResolveAsTypeMethod · 0.85

Calls 3

NewfFunction · 0.92
intIsOutOfOIDRangeFunction · 0.85
OidMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…