mirror of
https://github.com/golang/go
synced 2024-11-17 03:24:49 -07:00
database/sql: save Close error into lasterr
This commit is contained in:
parent
47c80b1e56
commit
59a1fb6d18
@ -2989,9 +2989,7 @@ func (rs *Rows) Next() bool {
|
||||
if doClose {
|
||||
err := rs.Close()
|
||||
if err != nil {
|
||||
withLock(rs.closemu.RLocker(), func() {
|
||||
rs.lasterr = rs.lasterrOrErrLocked(err)
|
||||
})
|
||||
rs.Close()
|
||||
}
|
||||
}
|
||||
return ok
|
||||
@ -3337,6 +3335,8 @@ func (rs *Rows) close(err error) error {
|
||||
rs.closeStmt.Close()
|
||||
}
|
||||
rs.releaseConn(err)
|
||||
|
||||
rs.lasterr = rs.lasterrOrErrLocked(err)
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user