Skip to content

Persistent queries can be returned to two callers #73

@andrew-d

Description

@andrew-d

This code doesn't check whether we've already returned the *stmt to a caller, so it's possible that calling conn.PrepareContext twice in a row can return the same *stmt to two different callers:
https://github.com/tailscale/sqlite/blob/main/sqlite.go#L193-L196

This means that e.g. running a query from each of the two not-actually-different stmts, getting rows1 and rows2, and then calling rows1.Next will also step rows2.

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