Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unbound variable "v1" in query #1591

Closed
hairyhenderson opened this issue Feb 10, 2023 · 3 comments · Fixed by #1592
Closed

unbound variable "v1" in query #1591

hairyhenderson opened this issue Feb 10, 2023 · 3 comments · Fixed by #1592

Comments

@hairyhenderson
Copy link
Contributor

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.

@hairyhenderson
Copy link
Contributor Author

@timsehn
Copy link
Sponsor Contributor

timsehn commented Feb 10, 2023

Submit a PR?

@hairyhenderson
Copy link
Contributor Author

I've issued #1592 - note that it's against the v0.14.0 tag - main wasn't working for me and I'm about to hop on a flight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants