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

Function IgnoreMessageParameters

testing/go/wire_test.go:7441–7455  ·  view source on GitHub ↗

IgnoreMessageParameters is used to ignore certain fields within a backend message, as they may not yet be implemented and therefore will return incorrect results (or variable results, such as with non-stable OIDs).

(message pgproto3.BackendMessage)

Source from the content-addressed store, hash-verified

7439// IgnoreMessageParameters is used to ignore certain fields within a backend message, as they may not yet be implemented
7440// and therefore will return incorrect results (or variable results, such as with non-stable OIDs).
7441func IgnoreMessageParameters(message pgproto3.BackendMessage) pgproto3.BackendMessage {
7442 switch message := message.(type) {
7443 case *pgproto3.RowDescription:
7444 for i := range message.Fields {
7445 message.Fields[i].TableOID = 0
7446 // User-defined types will have an OID outside the reserved range, so we set those to zero
7447 if message.Fields[i].DataTypeOID > 16383 {
7448 message.Fields[i].DataTypeOID = 0
7449 }
7450 }
7451 return message
7452 default:
7453 return message
7454 }
7455}
7456
7457// WireScriptTest is used to test wire messages, ensuring that our wire protocol behaves as expected.
7458type WireScriptTest struct {

Callers 1

RunWireScriptsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected