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

Method MaybeSetCustomOid

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

MaybeSetCustomOid checks whether t has a special oid that we want to set into d. Must be kept in sync with DArray.ResolvedType. Returns an error if t is not an array type.

(t *types.T)

Source from the content-addressed store, hash-verified

5020// d. Must be kept in sync with DArray.ResolvedType. Returns an error if t is
5021// not an array type.
5022func (d *DArray) MaybeSetCustomOid(t *types.T) error {
5023 if t.Family() != types.ArrayFamily {
5024 return errors.AssertionFailedf("expected array type, got %s", t.SQLStringForError())
5025 }
5026 switch t.Oid() {
5027 case oid.T_int2vector:
5028 d.customOid = oid.T_int2vector
5029 case oid.T_oidvector:
5030 d.customOid = oid.T_oidvector
5031 }
5032 return nil
5033}
5034
5035// ResolvedType implements the TypedExpr interface. Must be kept in sync with
5036// DArray.MaybeSetCustomOid.

Callers

nothing calls this directly

Calls 3

FamilyMethod · 0.80
SQLStringForErrorMethod · 0.80
OidMethod · 0.80

Tested by

no test coverage detected