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 does not return errors from driver.Stmt.Close #6734

Closed
olt opened this issue Nov 7, 2013 · 5 comments
Closed

database/sql: Stmt.Close does not return errors from driver.Stmt.Close #6734

olt opened this issue Nov 7, 2013 · 5 comments

Comments

@olt
Copy link
Contributor

olt commented Nov 7, 2013

sql.Stmt.Close does not return errors from driver.Stmt.Close

What steps will reproduce the problem?

Call sql.Stmt.Close with a driver that returns an error from driver.Stmt.Close(). See
http://play.golang.org/p/NxOcz1bT_-

What is the expected output?
The error from driver.Stmt.Close().

What do you see instead?
No error at all.

Actual use case?

1. I'm working on bulk imports with Postgres COPY FROM statement and I'm reading the
server responses in a separate goroutine (so the stmt.Exec() is asynchonous and will not
return errors immediately).
2. The error handling goroutine is closed when driver.Stmt.Close() is called and the
function returns any pending errors that the server sent back.
3. Calling sql.Stmt.Close() will not return any errors.


Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Mac OS X 10.7.5

Which version are you using?  (run 'go version')
go version devel +de159d1f10be Fri Nov 01 12:53:31 2013 +1100 darwin/amd64
@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 1:

Labels changed: added go1.3maybe.

@dsymonds
Copy link
Contributor

dsymonds commented Dec 2, 2013

Comment 2:

Labels changed: added priority-later, packagebug, removed priority-triage.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 3:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 4:

Labels changed: added repo-main.

@olt olt added new labels Dec 4, 2013
@bradfitz bradfitz removed the new label Dec 18, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@kardianos
Copy link
Contributor

kardianos commented Nov 28, 2016

All statements created by the user are now wrapped in a driverStmt that has a sticky error.
As far as I understand the stated issue this is resolved. Please open a new issue if I'm mistaken.

@golang golang locked and limited conversation to collaborators Nov 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants