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

Function combineCodes

pkg/sql/pgwire/pgerror/pgcode.go:124–135  ·  view source on GitHub ↗

combineCodes combines the inner and outer codes.

(innerCode, outerCode pgcode.Code)

Source from the content-addressed store, hash-verified

122
123// combineCodes combines the inner and outer codes.
124func combineCodes(innerCode, outerCode pgcode.Code) pgcode.Code {
125 if outerCode == pgcode.Uncategorized {
126 return innerCode
127 }
128 if strings.HasPrefix(outerCode.String(), "XX") {
129 return outerCode
130 }
131 if innerCode != pgcode.Uncategorized {
132 return innerCode
133 }
134 return outerCode
135}

Callers 1

GetPGCodeInternalFunction · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…