aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/database/sql/driver
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2013-02-20 15:35:27 -0800
committerBrad Fitzpatrick <bradfitz@golang.org>2013-02-20 15:35:27 -0800
commitf7a7716317dede4687a7fed38aea8d256f4d09e5 (patch)
tree397d4ca06dabeece5a6883650c04704e14adb6ce /src/pkg/database/sql/driver
parent6c976393aea607e67f4d31e3a2ae7b3c0dc15ade (diff)
downloadgo-f7a7716317dede4687a7fed38aea8d256f4d09e5.tar.xz
database/sql: refcounting and lifetime fixes
Simplifies the contract for Driver.Stmt.Close in the process of fixing issue 3865. Fixes #3865 Update #4459 (maybe fixes it; uninvestigated) R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7363043
Diffstat (limited to 'src/pkg/database/sql/driver')
-rw-r--r--src/pkg/database/sql/driver/driver.go19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/pkg/database/sql/driver/driver.go b/src/pkg/database/sql/driver/driver.go
index 88c87eeea0..2434e419ba 100644
--- a/src/pkg/database/sql/driver/driver.go
+++ b/src/pkg/database/sql/driver/driver.go
@@ -115,23 +115,8 @@ type Result interface {
type Stmt interface {
// Close closes the statement.
//
- // Closing a statement should not interrupt any outstanding
- // query created from that statement. That is, the following
- // order of operations is valid:
- //
- // * create a driver statement
- // * call Query on statement, returning Rows
- // * close the statement
- // * read from Rows
- //
- // If closing a statement invalidates currently-running
- // queries, the final step above will incorrectly fail.
- //
- // TODO(bradfitz): possibly remove the restriction above, if
- // enough driver authors object and find it complicates their
- // code too much. The sql package could be smarter about
- // refcounting the statement and closing it at the appropriate
- // time.
+ // As of Go 1.1, a Stmt will not be closed if it's in use
+ // by any queries.
Close() error
// NumInput returns the number of placeholder parameters.