-
Notifications
You must be signed in to change notification settings - Fork 18k
database/sql: include SQL column name in Scan() error message #23362
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
Labels
Comments
HaraldNordgren
added a commit
to HaraldNordgren/go
that referenced
this issue
Jan 7, 2018
When 'convertAssign' gives an error, instead of giving just the index of the failing column -- which is not always helpful, especially when there are lots of columns in the query -- utilize 'rs.rowsi.Columns()' to extract the underlying column name and include that in the error string: sql: Scan error on column 'name': ... Fixes golang#23362 Change-Id: I0fe71ff3c25f4c0dd9fc6aa2c2da2360dd93e3e0
Change https://golang.org/cl/86537 mentions this issue: |
HaraldNordgren
added a commit
to HaraldNordgren/go
that referenced
this issue
Jan 7, 2018
When 'convertAssign' gives an error, instead of giving just the index of the failing column -- which is not always helpful, especially when there are lots of columns in the query -- utilize 'rs.rowsi.Columns()' to extract the underlying column name and include that in the error string: sql: Scan error on column 'name': ... Fixes golang#23362 Change-Id: I0fe71ff3c25f4c0dd9fc6aa2c2da2360dd93e3e0
HaraldNordgren
added a commit
to HaraldNordgren/go
that referenced
this issue
Jan 7, 2018
When 'convertAssign' gives an error, instead of giving just the index of the failing column -- which is not always helpful, especially when there are lots of columns in the query -- utilize 'rs.rowsi.Columns()' to extract the underlying column name and include that in the error string: sql: Scan error on column 'name': ... Fixes golang#23362 Change-Id: I0fe71ff3c25f4c0dd9fc6aa2c2da2360dd93e3e0
HaraldNordgren
added a commit
to HaraldNordgren/go
that referenced
this issue
Jan 7, 2018
When 'convertAssign' gives an error, instead of giving just the index of the failing column -- which is not always helpful, especially when there are lots of columns in the query -- utilize 'rs.rowsi.Columns()' to extract the underlying column name and include that in the error string: sql: Scan error on column "name": ... Fixes golang#23362 Change-Id: I0fe71ff3c25f4c0dd9fc6aa2c2da2360dd93e3e0
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?My local installation is 1.8.3, but I verified that the behavior exists on
master
on https://go.googlesource.com/go as well.Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?Darwin 64-bit
What did you expect to see?
I want the Scan() error message to include the SQL column name, instead of just the numerical index.
The index is not always helpful -- especially when there are lots of columns in the query -- so extract the underlying column name and include that in the error string instead.
The text was updated successfully, but these errors were encountered: