1
0
mirror of https://github.com/golang/go synced 2024-11-15 03:30:37 -07:00
Commit Graph

17854 Commits

Author SHA1 Message Date
Andrew Gerrand
63ff715a55 [release-branch.go1.2] database/sql: document Result methods
««« CL 19280046 / 2ad8ac71220d
database/sql: document Result methods

Fixes #5110

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/19280046
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20650043
2013-11-01 11:31:18 +11:00
Andrew Gerrand
6d10afd9e5 [release-branch.go1.2] database/sql: Fix typos in doc
««« CL 17590043 / fb5224487f1b
database/sql: Fix typos in doc

R=golang-dev
CC=bradfitz, golang-dev
https://golang.org/cl/17590043

»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20150046
2013-11-01 11:30:30 +11:00
Andrew Gerrand
89f0148955 [release-branch.go1.2] A+C: Jakob Borg (individual CLA).
««« CL 19510043 / ae106f792e5d
A+C: Jakob Borg (individual CLA).

R=golang-dev
CC=golang-dev
https://golang.org/cl/19510043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20570045
2013-11-01 11:29:41 +11:00
Andrew Gerrand
842a18c28f [release-branch.go1.2] time: correct path to time zone zip file on Unix
««« CL 19280043 / 9d199c7582d6
time: correct path to time zone zip file on Unix

Most Unix systems have their own time zone data,
so we almost never get far enough in the list to
discover that we cannot fall back to the zip file.
Adjust testing to exercise the final fallback.

Plan 9 and Windows were already correct
(and are the main users of the zip file).

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/19280043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20640043
2013-11-01 11:28:57 +11:00
Andrew Gerrand
6ab0f588a8 [release-branch.go1.2] encoding/xml: fix doc comment
««« CL 19300046 / 5ac568b9d67b
encoding/xml: fix doc comment

The tag is ",chardata" not "chardata".

Fixes #6631.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/19300046
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20060045
2013-11-01 11:28:07 +11:00
Andrew Gerrand
71b3aca9fa [release-branch.go1.2] net/http/httputil: fix DumpRequestOut with ContentLength & false body param
««« CL 14920050 / 5ed8c82778ae
net/http/httputil: fix DumpRequestOut with ContentLength & false body param

Fixes #6471

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/14920050
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20590044
2013-11-01 11:27:19 +11:00
Andrew Gerrand
a4085fdf10 [release-branch.go1.2] os: do not return Lstat errors from Readdir
««« CL 18870043 / eca0ca43a863
os: do not return Lstat errors from Readdir

This CL restores the Go 1.1.2 semantics for os.File's Readdir method.

The code in Go 1.1.2 was rewritten mainly because it looked buggy.
This new version attempts to be clearer but still provide the 1.1.2 results.

The important diff is not this CL's version against tip but this CL's version
against Go 1.1.2.

Go 1.1.2:

        names, err := f.Readdirnames(n)
        fi = make([]FileInfo, len(names))
        for i, filename := range names {
                fip, err := Lstat(dirname + filename)
                if err == nil {
                        fi[i] = fip
                } else {
                        fi[i] = &fileStat{name: filename}
                }
        }
        return fi, err

This CL:

        names, err := f.Readdirnames(n)
        fi = make([]FileInfo, len(names))
        for i, filename := range names {
                fip, lerr := lstat(dirname + filename)
                if lerr != nil {
                        fi[i] = &fileStat{name: filename}
                        continue
                }
                fi[i] = fip
        }
        return fi, err

The changes from Go 1.1.2 are stylistic, not semantic:
1. Use lstat instead of Lstat, for testing (done before this CL).
2. Make error handling in loop body look more like an error case.
3. Use separate error variable name in loop body, to be clear
   we are not trying to influence the final return result.

Fixes #6656.
Fixes #6680.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/18870043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20110045
2013-11-01 11:26:31 +11:00
Andrew Gerrand
d4bc355c56 [release-branch.go1.2] cmd/gc: silence clang warning
««« CL 19160043 / 104d56b5d664
cmd/gc: silence clang warning

This code is only built when you run 'make' in cmd/gc,
not in all.bash.

R=golang-dev, jsing, iant
CC=golang-dev
https://golang.org/cl/19160043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20290046
2013-11-01 11:25:45 +11:00
Andrew Gerrand
2737f274f5 [release-branch.go1.2] misc/emacs: support godef-jump on import statements
««« CL 18230043 / f2b59b5163b0
misc/emacs: support godef-jump on import statements

The newest version of godef supports jumping to a package's source
directory if point is on an import statement.

R=adonovan
CC=golang-dev
https://golang.org/cl/18230043

»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20620043
2013-11-01 11:24:57 +11:00
Andrew Gerrand
744d53cdeb [release-branch.go1.2] debug/dwarf: add DWARF 4 form constants
««« CL 18460043 / 08e6655618f5
debug/dwarf: add DWARF 4 form constants

Some versions of clang generate DWARF 4-format attributes
even when using -gdwarf-2. We don't care much about the
values, but we do need to be able to parse past them.

This fixes a bug in Go 1.2 rc2 reported via private mail using
a near-tip version of clang.

R=golang-dev, iant, dvyukov
CC=golang-dev
https://golang.org/cl/18460043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20470045
2013-11-01 11:24:11 +11:00
Andrew Gerrand
2cce16c4a0 [release-branch.go1.2] doc: update front page summary text
««« CL 18080045 / 5ffdb9cc0bfe
doc: update front page summary text

R=rsc
CC=golang-dev
https://golang.org/cl/18080045
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20540044
2013-11-01 11:23:23 +11:00
Andrew Gerrand
153283b74b [release-branch.go1.2] cmd/cgo: stop using -fno-eliminate-unused-debug-types
««« CL 18850043 / 5ef4bf9eb256
cmd/cgo: stop using -fno-eliminate-unused-debug-types

This flag was added in January 2010, in CL 181102, to fix issue 497.
(Numbers were just shorter back then.) The fix was for OS X machines
and the llvm-gcc frontend.

In July 2011 we had to change the way we get enum values, because
there were no flags available to force Xcode's llvm-gcc to include the
enum names and values in DWARF debug output.

We now use clang, not llvm-gcc, on OS X machines.
Earlier versions of clang printed a warning about not knowing the flag.
Newer versions of clang now make that an error.

That is:
 - The flag was added for OS X machines.
 - The flag is no longer necessary on OS X machines.
 - The flag now breaks some OS X machines.

Remove it.

I have run the original program from issue 497 successfully
without the flag on both OS X and Linux machines.

Fixes #6678.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/18850043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/19850048
2013-11-01 11:22:39 +11:00
Andrew Gerrand
038ff9dca1 [release-branch.go1.2] runtime: relax preemption assertion during stack split
««« CL 18740044 / 1a8903f0a577
runtime: relax preemption assertion during stack split

The case can happen when starttheworld is calling acquirep
to get things moving again and acquirep gets preempted.
The stack trace is in golang.org/issue/6644.

It is difficult to build a short test case for this, but
the person who reported issue 6644 confirms that this
solves the problem.

Fixes #6644.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/18740044
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20460044
2013-11-01 11:21:54 +11:00
Andrew Gerrand
724d28a03d [release-branch.go1.2] net: handle single-line non-\n-terminated files correctly in readLine
««« CL 15960047 / a0d4544cdb2a
net: handle single-line non-\n-terminated files correctly in readLine

Fixes #6646.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/15960047

»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20560044
2013-11-01 11:21:05 +11:00
Andrew Gerrand
7097ed7337 [release-branch.go1.2] net/url: fix Encode doc comment
««« CL 16430043 / f9af8b83c78c
net/url: fix Encode doc comment

Encoded query strings are always sorted by key; the example wasn't.

R=golang-dev, dsymonds, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/16430043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20480044
2013-11-01 11:20:21 +11:00
Andrew Gerrand
5962673984 [release-branch.go1.2] misc/linkcheck: better redirect handling, use meaningful exit code
««« CL 14425049 / 093d299d669e
misc/linkcheck: better redirect handling, use meaningful exit code

Prevent linkcheck from following redirects that lead beyond the outside
the root URL.

Return a non-zero exit code when there are problems.

Some minor refactoring for clarity.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/14425049
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20360044
2013-11-01 11:19:34 +11:00
Andrew Gerrand
efb3af3d5c [release-branch.go1.2] strings: fix Replacer bug with prefix matches
««« CL 16880043 / 0eb6508d3e88
strings: fix Replacer bug with prefix matches

singleStringReplacer had a bug where if a string was replaced
at the beginning and no output had yet been produced into the
temp buffer before matching ended, an invalid nil check (used
as a proxy for having matched anything) meant it always
returned its input.

Fixes #6659

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/16880043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20570044
2013-11-01 11:18:49 +11:00
Andrew Gerrand
7191e08599 [release-branch.go1.2] database/sql: link to wiki in package docs
««« CL 14087043 / 7ebbddd21330
database/sql: link to wiki in package docs

Update #5886

R=golang-dev, kamil.kisiel, adg, r, rsc, dave, arnehormann, bradfitz
CC=golang-dev
https://golang.org/cl/14087043

»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20610043
2013-11-01 11:18:03 +11:00
Andrew Gerrand
0911539937 [release-branch.go1.2] C+A: add Matthew Cottingham (Individual CLA)
««« CL 16650043 / afb8e00de04a
C+A: add Matthew Cottingham (Individual CLA)

Done by addca, but codereview failed with a Python stacktrace,
so submitting by hand.

R=golang-dev
CC=golang-dev
https://golang.org/cl/16650043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/19560046
2013-11-01 11:17:17 +11:00
Andrew Gerrand
ce1a9fcbf5 [release-branch.go1.2] plan9: correct create permissions with union directory
««« CL 15360045 / f257b02e7ffe
plan9: correct create permissions with union directory

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/15360045

»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/19960046
2013-11-01 11:16:32 +11:00
Andrew Gerrand
cc10ac750d [release-branch.go1.2] misc/dist: use go.tools release branch
««« CL 15450047 / 1f81a19c2ee2
misc/dist: use go.tools release branch

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/15450047
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/19850047
2013-11-01 11:15:47 +11:00
Andrew Gerrand
df3e05d37c [release-branch.go1.2] test/mapnan: use time.Now instead of syscall.Getrusage
««« CL 15570046 / 9169cb38c3e8
test/mapnan: use time.Now instead of syscall.Getrusage

Avoids a dependency on a somewhat nonstandard part of package syscall.

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/15570046
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/19960045
2013-11-01 11:15:02 +11:00
Andrew Gerrand
407b1130cd [release-branch.go1.2] cmd/cgo: use __typeof__, -w instead of typeof, -Wno-all
««« CL 14920052 / 98840b3349f4
cmd/cgo: use __typeof__, -w instead of typeof, -Wno-all

Suggested by iant in earlier CL.

R=golang-dev, bradfitz, iant
CC=golang-dev
https://golang.org/cl/14920052
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20600043
2013-11-01 11:14:19 +11:00
Andrew Gerrand
194b6a4bf2 [release-branch.go1.2] time: fix ParseDuration overflow when given more than 9 digits on 32-bit arch
««« CL 15080043 / fbf3b853e00b
time: fix ParseDuration overflow when given more than 9 digits on 32-bit arch
Fixes #6617.

R=golang-dev, rsc, r
CC=golang-dev
https://golang.org/cl/15080043

»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20050045
2013-11-01 11:13:30 +11:00
Andrew Gerrand
f17adc0765 [release-branch.go1.2] misc/emacs: handle empty "import ()" in go-goto-imports
««« CL 14454058 / 6b8f33ab7ca4
misc/emacs: handle empty "import ()" in go-goto-imports

R=adonovan
CC=golang-dev
https://golang.org/cl/14454058

»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20590043
2013-11-01 11:12:28 +11:00
Andrew Gerrand
645a023474 [release-branch.go1.2] math: remove unnecessary source file
««« CL 15750046 / 2d1e1adf8ece
math: remove unnecessary source file

The routines in this file are dregs from a very early copy of the math API.
There are no Go prototypes and no non-amd64 implementations.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/15750046
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/19560045
2013-11-01 11:11:36 +11:00
Andrew Gerrand
77ac7fdcc8 [release-branch.go1.2] go/build: document the go1.2 build tag
««« CL 14930046 / d4f6533fad0b
go/build: document the go1.2 build tag

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/14930046

»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/19960044
2013-11-01 11:10:46 +11:00
Andrew Gerrand
bf5d7c6713 [release-branch.go1.2] crypto/x509: name constraints should be a disjunction.
««« CL 15570044 / b4c37131e846
crypto/x509: name constraints should be a disjunction.

The code was requiring that all constraints be met, but it should be
satisfied by meeting *any* of them.

R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/15570044
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20580043
2013-11-01 11:09:56 +11:00
Andrew Gerrand
6cbfe8df5c [release-branch.go1.2] crypto/tls: advertise support for RSA+SHA1 in TLS 1.2 handshake.
««« CL 15650043 / 29d3ab5ced5a
crypto/tls: advertise support for RSA+SHA1 in TLS 1.2 handshake.

Despite SHA256 support being required for TLS 1.2 handshakes, some
servers are aborting handshakes that don't offer SHA1 support.

This change adds support for signing TLS 1.2 ServerKeyExchange messages
with SHA1. It does not add support for signing TLS 1.2 client
certificates with SHA1 as that would require the handshake to be
buffered.

Fixes #6618.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/15650043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20570043
2013-11-01 11:09:06 +11:00
Andrew Gerrand
34250ab212 [release-branch.go1.2] net/mail: fix minor doc typo.
««« CL 15510043 / 6752a7aad603
net/mail: fix minor doc typo.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/15510043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20560043
2013-11-01 11:08:05 +11:00
Andrew Gerrand
11f1f82b30 [release-branch.go1.2] cmd/yacc: fix stderr on Windows.
««« CL 15330043 / 69bf31787310
cmd/yacc: fix stderr on Windows.
Fixes #6620.

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/15330043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20550043
2013-11-01 11:07:06 +11:00
Andrew Gerrand
e3597e3920 [release-branch.go1.2] cmd/cgo: fix line number in an error message
««« CL 14870046 / b508daf6dae6
cmd/cgo: fix line number in an error message

Fixes #6563.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/14870046
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20150045
2013-11-01 11:06:07 +11:00
Andrew Gerrand
265ff83af6 [release-branch.go1.2] cmd/cgo: stop using compiler error message text to analyze C names
««« CL 15070043 / 90a628ac54ed
cmd/cgo: stop using compiler error message text to analyze C names

The old approach to determining whether "name" was a type, constant,
or expression was to compile the C program

        name;

and scan the errors and warnings generated by the compiler.
This requires looking for specific substrings in the errors and warnings,
which ties the implementation to specific compiler versions.
As compilers change their errors or drop warnings, cgo breaks.
This happens slowly but it does happen.
Clang in particular (now required on OS X) has a significant churn rate.

The new approach compiles a slightly more complex program
that is either valid C or not valid C depending on what kind of
thing "name" is. It uses only the presence or absence of an error
message on a particular line, not the error text itself. The program is:

        // error if and only if name is undeclared
        void f1(void) { typeof(name) *x; }

        // error if and only if name is not a type
        void f2(void) { name *x; }

        // error if and only if name is not an integer constant
        void f3(void) { enum { x = (name)*1 }; }

I had not been planning to do this until Go 1.3, because it is a
non-trivial change, but it fixes a real Xcode 5 problem in Go 1.2,
and the new code is easier to understand than the old code.
It should be significantly more robust.

Fixes #6596.
Fixes #6612.

R=golang-dev, r, james, iant
CC=golang-dev
https://golang.org/cl/15070043
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20060044
2013-11-01 11:05:17 +11:00
Andrew Gerrand
c57029d43d [release-branch.go1.2] cmd/gc: shorten name used for map bucket type
««« CL 15110044 / 95336afd420c
cmd/gc: shorten name used for map bucket type

Before:
type.struct { buckets *struct { overflow *struct { overflow *struct { overflow *struct { overflow *struct { overflow *<...>; keys [8]string; values [8]*"".RangeTable }; keys [8]string; values [8]*"".RangeTable }; keys [8]string; values [8]*"".RangeTable }; keys [8]string; values [8]*"".RangeTable }; keys [8]string; values [8]*"".RangeTable }; oldbuckets *struct { overflow *struct { overflow *struct { overflow *struct { overflow *struct { overflow *<...>; keys [8]string; values [8]*"".RangeTable }; keys [8]string; values [8]*"".RangeTable }; keys [8]string; values [8]*"".RangeTable }; keys [8]string; values [8]*"".RangeTable }; keys [8]string; values [8]*"".RangeTable } }

After:
type.map.bucket[string]*"".RangeTable

This makes debugging maps a little nicer, and it takes up less space in the binary.

R=golang-dev, r
CC=golang-dev, khr
https://golang.org/cl/15110044
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20050044
2013-11-01 11:00:12 +11:00
Andrew Gerrand
287fa600ed [release-branch.go1.2] net: make sure failed Dial returns nil Conn
««« CL 14950045 / 1e60ffd5933d
net: make sure failed Dial returns nil Conn

Fixes #6614.

R=golang-dev, bradfitz, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/14950045
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20170047
2013-11-01 10:58:25 +11:00
Andrew Gerrand
000c1c5127 [release-branch.go1.2] runtime: remove nomemprof
««« CL 14695044 / 35d5bae6aac8
runtime: remove nomemprof
Nomemprof seems to be unneeded now, there is no recursion.
If the recursion will be re-introduced, it will break loudly by deadlocking.
Fixes #6566.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/14695044
»»»

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/20540043
2013-11-01 10:51:42 +11:00
Andrew Gerrand
c1792398d4 [release-branch.go1.2] misc/dist: build race packages when os suffix present
««« CL 14930043 / 5746e3a5443b
misc/dist: build race packages when os suffix present

The "darwin-amd64-osx10.8" target was not matching "darwin-amd64".

R=golang-dev
CC=golang-dev
https://golang.org/cl/14930043
»»»

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/20290045
2013-11-01 10:50:00 +11:00
Andrew Gerrand
309e16554a go1.2rc2 2013-10-18 13:53:33 +09:00
Andrew Gerrand
04e95a1a56 api: add go1.2.txt, use in tests
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/14860043
2013-10-18 13:36:59 +09:00
Andrew Gerrand
73d7d12ea6 misc/dist: set default go.tools tag
Fixes #6607.

R=dsymonds
CC=golang-dev
https://golang.org/cl/14830043
2013-10-18 10:51:21 +09:00
Brad Fitzpatrick
f41b43a024 net/url: fix regression when serializing relative URLs
Only add a slash to path if it's a separator between
a host and path.

Fixes #6609

R=golang-dev, dsymonds, r
CC=golang-dev
https://golang.org/cl/14815043
2013-10-17 16:06:40 -07:00
Ian Lance Taylor
88c448ba40 runtime: correct test for when to poll network
Fixes #6610.

R=golang-dev, khr
CC=golang-dev
https://golang.org/cl/14793043
2013-10-17 11:57:48 -07:00
Ian Lance Taylor
667303f158 runtime: correct parameter name in MCentral_AllocList comment
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/14792043
2013-10-17 11:57:00 -07:00
Russ Cox
4dce7f8575 encoding/xml: accept chains of interfaces and pointers
Fixes #6556.

R=golang-dev, iant, adg
CC=golang-dev
https://golang.org/cl/14747043
2013-10-17 12:13:33 -04:00
Alberto García Hierro
e39eda1366 database/sql: make tests repeatable with -cpu=n,n
New test added in CL 14611045 causes a deadlock when
running the tests with -cpu=n,n because the fakedb
driver always waits when opening a new connection after
running TestConnectionLeak.  Reset its state after.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/14780043
2013-10-17 09:02:32 -07:00
David Symonds
078bcffcb8 A+C: add Jamie Turner (Dropbox corporate CLA).
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/14765043
2013-10-17 11:48:27 +11:00
Brad Fitzpatrick
e5babeff8a database/sql: fix some test fmt verbs
Found by vet.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/14762044
2013-10-16 16:30:39 -07:00
Robert Griesemer
15da997c7e spec: clarify re-use of underlying arrays in slice operations
Please note the slight rewording for append: The spec now
requires that append reuses the underlying array if it is
sufficiently large. Per majority sentiment.

This is technically a language change but the current
implementation always worked this way.

Fixes #5818.
Fixes #5180.

R=rsc, iant, r, ken, minux.ma, dan.kortschak, rogpeppe, go.peter.90
CC=golang-dev
https://golang.org/cl/14419054
2013-10-16 16:16:54 -07:00
Alberto García Hierro
37db880469 database/sql: Fix connection leak and potential deadlock
CL 10726044 introduced a race condition which causes connections
to be leaked under certain circumstances. If SetMaxOpenConns is
used, the application eventually deadlocks. Otherwise, the number
of open connections just keep growing indefinitely.

Fixes #6593

R=golang-dev, bradfitz, tad.glines, bketelsen
CC=golang-dev
https://golang.org/cl/14611045
2013-10-16 09:22:57 -07:00
Alberto García Hierro
478f4b6754 database/sql: fix double decrement of numOpen count; test for connection leaks
Add a check at the end of every test to make sure
there are no leaked connections after running a test.

Avoid incorrectly decrementing the number of open connections
when the driver connection ends up it a bad state (numOpen was
decremented twice).

Prevent leaking a Rows struct (which ends up leaking a
connection) in Row.Scan() when a *RawBytes destination is
improperly used.

Close the Rows struct in TestRowsColumns.

Update #6593

R=golang-dev, bradfitz, dave
CC=golang-dev
https://golang.org/cl/14642044
2013-10-16 09:17:25 -07:00