• Brad Fitzpatrick's avatar
    database/sql: fix double connection free on Stmt.Query error · 3297fc63
    Brad Fitzpatrick authored
    In a transaction, on a Stmt.Query error, it was possible for a
    connection to be added to a db's freelist twice. Should use
    the local releaseConn function instead.
    
    Thanks to Gwenael Treguier for the failing test.
    
    Also in this CL: propagate driver errors through releaseConn
    into *DB.putConn, which conditionally ignores the freelist
    addition if the driver signaled ErrBadConn, introduced in a
    previous CL.
    
    R=golang-dev, gary.burd
    CC=golang-dev
    https://golang.org/cl/5798049
    3297fc63
fakedb_test.go 14.9 KB