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

Function NewDIntVectorFromDArray

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

NewDIntVectorFromDArray is a helper routine to create a new *DArray, initialized from an existing *DArray, with the special oid for IntVector.

(d *DArray)

Source from the content-addressed store, hash-verified

6014// NewDIntVectorFromDArray is a helper routine to create a new *DArray,
6015// initialized from an existing *DArray, with the special oid for IntVector.
6016func NewDIntVectorFromDArray(d *DArray) Datum {
6017 // Sanity: Validate the type of the array, since it should be int2.
6018 if !d.ParamTyp.Identical(types.Int2) {
6019 panic(errors.AssertionFailedf("int2vector can only be made from int2 not %s", d.ParamTyp.SQLStringForError()))
6020 }
6021 ret := new(DArray)
6022 *ret = *d
6023 ret.customOid = oid.T_int2vector
6024 return ret
6025}
6026
6027// NewDOidVectorFromDArray is a helper routine to create a new *DArray,
6028// initialized from an existing *DArray, with the special oid for OidVector.

Callers

nothing calls this directly

Calls 2

SQLStringForErrorMethod · 0.80
IdenticalMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…