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

Function MakeCollatedType

pkg/sql/types/types.go:1000–1008  ·  view source on GitHub ↗

MakeCollatedType is like MakeCollatedString but also handles NULL and arrays of string types that need to become arrays of collated string types. UNKNOWN => STRING COLLATE EN []STRING => []STRING COLLATE EN

(typ *T, locale string)

Source from the content-addressed store, hash-verified

998// UNKNOWN => STRING COLLATE EN
999// []STRING => []STRING COLLATE EN
1000func MakeCollatedType(typ *T, locale string) *T {
1001 if typ.Family() == ArrayFamily {
1002 return MakeArray(MakeCollatedType(typ.ArrayContents(), locale))
1003 }
1004 if typ.Family() == UnknownFamily {
1005 return MakeCollatedType(String, locale)
1006 }
1007 return MakeCollatedString(typ, locale)
1008}
1009
1010// MakeDecimal constructs a new instance of a DECIMAL type (oid = T_numeric)
1011// that has at most "precision" # of decimal digits (0 = unspecified number of

Callers 1

NewTypedCollateExprFunction · 0.92

Calls 4

MakeArrayFunction · 0.85
MakeCollatedStringFunction · 0.85
FamilyMethod · 0.80
ArrayContentsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…