Skip to content

typedesc: consider adding an error to typedesc.UserDefinedTypeOIDToID #58414

@ajwerner

Description

@ajwerner

Describe the problem

We have code to convert an OID to a descpb.ID that assumes that the OID is larger than a constant. When it isn't we wrap around and end up producing and bogus descriptor ID. This is bug prone. We should return an error.

// UserDefinedTypeOIDToID converts a user defined type OID into a
// descriptor ID.
func UserDefinedTypeOIDToID(oid oid.Oid) descpb.ID {

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions