From c8bf49ef8a92e2337b69c14b9b88396efe498600 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 3 Mar 2014 17:40:19 +0100 Subject: Imported Upstream version 1.2.1 --- src/pkg/database/sql/sql.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pkg/database/sql/sql.go') 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) -- cgit v1.2.3