From 90b8a0ca2d0b565c7c7199ffcf77b15ea6b6db3a Mon Sep 17 00:00:00 2001 From: Daniel Theophanes Date: Thu, 17 Nov 2016 09:33:31 -0800 Subject: database/sql: ensure all driver Stmt are closed once Previously driver.Stmt could could be closed multiple times in edge cases that drivers may not test for initially. Make their job easier by ensuring the driver is only closed a single time. Fixes #16019 Change-Id: I1e4777ef70697a849602e6ef9da73054a8feb4cd Reviewed-on: https://go-review.googlesource.com/33352 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/database/sql/sql_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/database/sql/sql_test.go') diff --git a/src/database/sql/sql_test.go b/src/database/sql/sql_test.go index ea86264ae6..c46aaf60f8 100644 --- a/src/database/sql/sql_test.go +++ b/src/database/sql/sql_test.go @@ -672,7 +672,7 @@ func TestStatementClose(t *testing.T) { msg string }{ {&Stmt{stickyErr: want}, "stickyErr not propagated"}, - {&Stmt{tx: &Tx{}, txsi: &driverStmt{&sync.Mutex{}, stubDriverStmt{want}}}, "driverStmt.Close() error not propagated"}, + {&Stmt{tx: &Tx{}, txds: &driverStmt{Locker: &sync.Mutex{}, si: stubDriverStmt{want}}}, "driverStmt.Close() error not propagated"}, } for _, test := range tests { if err := test.stmt.Close(); err != want { -- cgit v1.3