Skip to content

RowsAffected panic #1733

@minitr

Description

@minitr

When I tried to use the update method, a panic occurred at go-sql-driver/[email protected]/result.go:41 +0x2fdatabase/sql.driverResult.RowsAffected. The panic was caused by the following line of code:

res.affectedRows[len(res.affectedRows)-1], nil

Is it possible to add a length check before accessing the slice to prevent this panic?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions