1
0
mirror of https://github.com/golang/go synced 2024-11-18 15:04:44 -07:00

database/sql: Alter *DB.begin to return driver.ErrBadConn when driver.Conn.Begin returns driver.ErrBadConn

Fixes #4433

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6845094
This commit is contained in:
James David Chalfant 2012-12-12 22:04:55 -08:00 committed by Brad Fitzpatrick
parent 7571d23c19
commit 309eae1923

View File

@ -426,7 +426,7 @@ func (db *DB) begin() (tx *Tx, err error) {
txi, err := ci.Begin()
if err != nil {
db.putConn(ci, err)
return nil, fmt.Errorf("sql: failed to Begin transaction: %v", err)
return nil, err
}
return &Tx{
db: db,