]> Cypherpunks repositories - gostls13.git/commit
database/sql: close Rows when context is cancelled
authorDaniel Theophanes <kardianos@gmail.com>
Wed, 28 Sep 2016 19:51:39 +0000 (12:51 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 29 Sep 2016 22:26:42 +0000 (22:26 +0000)
commitd2df8498f366669acbae24f38e3683b3acdab102
tree7b6d45e6d9734ade0fb154c895cb7103d494544b
parent6dc356a76a405ff12c884ab0a4acb2296d1618b7
database/sql: close Rows when context is cancelled

To prevent leaking connections, close any open Rows when the
context is cancelled. Also enforce context cancel while reading
rows off of the wire.

Change-Id: I62237ecdb7d250d6734f6ce3d2b0bcb16dc6fda7
Reviewed-on: https://go-review.googlesource.com/29957
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/database/sql/ctxutil.go
src/database/sql/sql.go
src/database/sql/sql_test.go