diff options
| author | Daniel Theophanes <kardianos@gmail.com> | 2017-10-17 22:04:17 +0000 |
|---|---|---|
| committer | Daniel Theophanes <kardianos@gmail.com> | 2017-10-17 23:02:14 +0000 |
| commit | 292366e7162a030cade7b177eb4ad55bd887d25f (patch) | |
| tree | 496777946cb512f56dfd18d6a57dbb5e73b9b033 /src/database/sql/sql.go | |
| parent | 94e3a304524b6090686ace233a8bba97aa4f306a (diff) | |
| download | go-292366e7162a030cade7b177eb4ad55bd887d25f.tar.xz | |
Revert "database/sql: prevent race in driver by locking dc in Next"
This reverts commit 897080d5cbb1793f8ad3ef5fb7c6fafba2e97d42.
Reason for revert: Fails to fix all the locking issues.
Updates #21117
Change-Id: I6fc9cb7897244d6e1af78c089a2bf383258ec049
Reviewed-on: https://go-review.googlesource.com/71450
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/database/sql/sql.go')
| -rw-r--r-- | src/database/sql/sql.go | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/database/sql/sql.go b/src/database/sql/sql.go index 9a3957b267..17910904f6 100644 --- a/src/database/sql/sql.go +++ b/src/database/sql/sql.go @@ -2491,12 +2491,6 @@ func (rs *Rows) nextLocked() (doClose, ok bool) { if rs.lastcols == nil { rs.lastcols = make([]driver.Value, len(rs.rowsi.Columns())) } - - // Lock the driver connection before calling the driver interface - // rowsi to prevent a Tx from rolling back the connection at the same time. - rs.dc.Lock() - defer rs.dc.Unlock() - rs.lasterr = rs.rowsi.Next(rs.lastcols) if rs.lasterr != nil { // Close the connection if there is a driver error. @@ -2546,12 +2540,6 @@ func (rs *Rows) NextResultSet() bool { doClose = true return false } - - // Lock the driver connection before calling the driver interface - // rowsi to prevent a Tx from rolling back the connection at the same time. - rs.dc.Lock() - defer rs.dc.Unlock() - rs.lasterr = nextResultSet.NextResultSet() if rs.lasterr != nil { doClose = true |
