mirror of
https://github.com/golang/go
synced 2024-11-17 05:24:53 -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 {
|
if doClose {
|
||||||
err := rs.Close()
|
err := rs.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
withLock(rs.closemu.RLocker(), func() {
|
rs.Close()
|
||||||
rs.lasterr = rs.lasterrOrErrLocked(err)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ok
|
return ok
|
||||||
@ -3337,6 +3335,8 @@ func (rs *Rows) close(err error) error {
|
|||||||
rs.closeStmt.Close()
|
rs.closeStmt.Close()
|
||||||
}
|
}
|
||||||
rs.releaseConn(err)
|
rs.releaseConn(err)
|
||||||
|
|
||||||
|
rs.lasterr = rs.lasterrOrErrLocked(err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user