aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/database
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-02-26 01:00:39 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-02-26 01:00:39 +0000
commit99e20ba51d5b0785c7e98244d2901853d9fb3b41 (patch)
treed86fa5d601b8bc3629b3820df4d5e7042853453f /libgo/go/database
parente5e9b91bc61da0bdb58c6577c319e61a3ed04b17 (diff)
downloadgcc-99e20ba51d5b0785c7e98244d2901853d9fb3b41.zip
gcc-99e20ba51d5b0785c7e98244d2901853d9fb3b41.tar.gz
gcc-99e20ba51d5b0785c7e98244d2901853d9fb3b41.tar.bz2
libgo: update to Go1.12rc1
Reviewed-on: https://go-review.googlesource.com/c/162881 From-SVN: r269202
Diffstat (limited to 'libgo/go/database')
-rw-r--r--libgo/go/database/sql/sql.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/libgo/go/database/sql/sql.go b/libgo/go/database/sql/sql.go
index b0353ab..8cdc903 100644
--- a/libgo/go/database/sql/sql.go
+++ b/libgo/go/database/sql/sql.go
@@ -1698,7 +1698,7 @@ func (db *DB) Conn(ctx context.Context) (*Conn, error) {
}
}
if err == driver.ErrBadConn {
- dc, err = db.conn(ctx, cachedOrNewConn)
+ dc, err = db.conn(ctx, alwaysNewConn)
}
if err != nil {
return nil, err
@@ -2256,6 +2256,13 @@ var (
// Stmt is a prepared statement.
// A Stmt is safe for concurrent use by multiple goroutines.
+//
+// If a Stmt is prepared on a Tx or Conn, it will be bound to a single
+// underlying connection forever. If the Tx or Conn closes, the Stmt will
+// become unusable and all operations will return an error.
+// If a Stmt is prepared on a DB, it will remain usable for the lifetime of the
+// DB. When the Stmt needs to execute on a new underlying connection, it will
+// prepare itself on the new connection automatically.
type Stmt struct {
// Immutable:
db *DB // where we came from