Skip to content

unbound variable "v1" in query #1591

@hairyhenderson

Description

@hairyhenderson

I have a query like SELECT * FROM t WHERE last_seen > ?, and running db.QueryRowContext(ctx, query, time.Now()).Scan(...) gives me an error:

unbound variable "v1" in query

This looks similar to the issue #383, where it was suggested that this could be fixed by prefixing a "v" to the ordinal on unnamed bindings.

And indeed, stepping through the failure I see the binding is being named "1", and then the lookup for "v1" is missing.

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