mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
database/sql: fix case where Stmt.Close discards error
Fixes a case where the Stmt.Close() function in database/sql discards any error generated by the Close() function of the contained driverStmt. Fixes #12798 Change-Id: I40384d6165856665b062d15a643e4ecc09d63fda Reviewed-on: https://go-review.googlesource.com/15178 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
f80ff56a7d
commit
73fe61233b
2 changed files with 40 additions and 2 deletions
|
|
@ -1576,9 +1576,9 @@ func (s *Stmt) Close() error {
|
|||
s.closed = true
|
||||
|
||||
if s.tx != nil {
|
||||
s.txsi.Close()
|
||||
err := s.txsi.Close()
|
||||
s.mu.Unlock()
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
s.mu.Unlock()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue