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

database/sql: Stmt.Close discards error #12798

iangudger opened this issue Sep 30, 2015 · 2 comments

database/sql: Stmt.Close discards error #12798

iangudger opened this issue Sep 30, 2015 · 2 comments


Copy link

@iangudger iangudger commented Sep 30, 2015

The Stmt.Close() function in database/sql discards any error generated by the Close() function of the contained driverStmt. I think this error should be propagated.

This is preventing from functioning:

@ianlancetaylor ianlancetaylor changed the title database/sql/Stmt.Close() discards error database/sql: Stmt.Close discards error Sep 30, 2015
@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Sep 30, 2015
Copy link
Contributor Author

@iangudger iangudger commented Oct 1, 2015

I have sent a change that addresses this issue. Please take a look.

Copy link

@gopherbot gopherbot commented Oct 1, 2015

CL mentions this issue.

@bradfitz bradfitz closed this in 73fe612 Oct 2, 2015
freeformz added a commit to lib/pq that referenced this issue Oct 15, 2015
This change is causing breakage on tip:

I think it's a reasonable upstream change.

Looking at the commit that added the code that is failing on our side
the lack of error propagation is called out and is the reason we're now

This change attempts to preserve old behavior while supporting the fact
that errors are now propagated properly by Stmt.Close().

Open to better ways to do this though.
@golang golang locked and limited conversation to collaborators Oct 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.