Skip to content

avoid index-of-bounds panics in SetAnnotation in production #155405

@bghal

Description

@bghal

This complementary issue was addressed on the GetAnnotation side in #151849.

If the AnnotatedNode.AnnIdx=NoAnnotation (0), the adjustment from 1-based indexing to 0-based indexing induces a panic. The upper-bound may also have the same issue the getter had.

tableName := tree.TableName{ObjectName: "foo"}
planner.ResolveExistingObjectEx(ctx, tableName.ToUnresolvedObjectName(), true /* required */, tree.ResolveRequireTableDesc)

Jira issue: CRDB-55425

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions