summaryrefslogtreecommitdiff
path: root/src/pkg/database/sql/sql.go
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@debian.org>2014-03-03 17:40:19 +0100
committerMichael Stapelberg <stapelberg@debian.org>2014-03-03 17:40:19 +0100
commitc8bf49ef8a92e2337b69c14b9b88396efe498600 (patch)
tree79832126e4ea62c62aa4e23003864d706fa2e903 /src/pkg/database/sql/sql.go
parent64d2a7c8945ba05af859901f5e248f1befdd8621 (diff)
downloadgolang-c8bf49ef8a92e2337b69c14b9b88396efe498600.tar.gz
Imported Upstream version 1.2.1upstream/1.2.1
Diffstat (limited to 'src/pkg/database/sql/sql.go')
-rw-r--r--src/pkg/database/sql/sql.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/database/sql/sql.go b/src/pkg/database/sql/sql.go
index dddf5a3f2..84a096513 100644
--- a/src/pkg/database/sql/sql.go
+++ b/src/pkg/database/sql/sql.go
@@ -620,8 +620,8 @@ func (db *DB) conn() (*driverConn, error) {
}
// If db.maxOpen > 0 and the number of open connections is over the limit
- // or there are no free connection, then make a request and wait.
- if db.maxOpen > 0 && (db.numOpen >= db.maxOpen || db.freeConn.Len() == 0) {
+ // and there are no free connection, make a request and wait.
+ if db.maxOpen > 0 && db.numOpen >= db.maxOpen && db.freeConn.Len() == 0 {
// Make the connRequest channel. It's buffered so that the
// connectionOpener doesn't block while waiting for the req to be read.
ch := make(chan interface{}, 1)