MCPcopy Create free account
hub / github.com/dolthub/doltgresql / DebugString

Method DebugString

postgres/parser/types/types.go:2288–2303  ·  view source on GitHub ↗

DebugString returns a detailed dump of the type protobuf struct, suitable for debugging scenarios.

()

Source from the content-addressed store, hash-verified

2286// DebugString returns a detailed dump of the type protobuf struct, suitable for
2287// debugging scenarios.
2288func (t *T) DebugString() string {
2289 if t.Family() == ArrayFamily && t.ArrayContents().UserDefined() {
2290 // In the case that this type is an array that contains a user defined
2291 // type, the introspection that protobuf performs to generate a string
2292 // representation will panic if the UserDefinedTypeMetadata field of the
2293 // type is populated. It seems to not understand that fields in the element
2294 // T could be not generated by proto, and panics trying to operate on the
2295 // TypeMeta field of the T. To get around this, we just deep copy the T and
2296 // zero out the type metadata to placate proto. See the following issue for
2297 // details: https://github.com/gogo/protobuf/issues/693.
2298 internalTypeCopy := protoutil.Clone(&t.InternalType).(*InternalType)
2299 internalTypeCopy.ArrayContents.TypeMeta = UserDefinedTypeMetadata{}
2300 return internalTypeCopy.String()
2301 }
2302 return t.InternalType.String()
2303}
2304
2305// IsAmbiguous returns true if this type is in UnknownFamily or AnyFamily.
2306// Instances of ambiguous types can be NULL or be in one of several different

Callers

nothing calls this directly

Calls 5

FamilyMethod · 0.95
ArrayContentsMethod · 0.95
CloneFunction · 0.92
UserDefinedMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected