]> Cypherpunks repositories - gostls13.git/commit
database/sql: fix double decrement of numOpen count; test for connection leaks
authorAlberto GarcĂ­a Hierro <alberto@garciahierro.com>
Wed, 16 Oct 2013 16:17:25 +0000 (09:17 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 16 Oct 2013 16:17:25 +0000 (09:17 -0700)
commit478f4b67543824c039d2f7afec6af88a59148db2
tree07736fd96a637833734b7333ab3d83f65b5b4333
parent4d38d1260e40336008a491033146157bcaa5ef90
database/sql: fix double decrement of numOpen count; test for connection leaks

Add a check at the end of every test to make sure
there are no leaked connections after running a test.

Avoid incorrectly decrementing the number of open connections
when the driver connection ends up it a bad state (numOpen was
decremented twice).

Prevent leaking a Rows struct (which ends up leaking a
connection) in Row.Scan() when a *RawBytes destination is
improperly used.

Close the Rows struct in TestRowsColumns.

Update #6593

R=golang-dev, bradfitz, dave
CC=golang-dev
https://golang.org/cl/14642044
src/pkg/database/sql/sql.go
src/pkg/database/sql/sql_test.go