<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/pkg/database/sql/sql.go, branch go1.3beta2</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=go1.3beta2</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=go1.3beta2'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2014-05-19T16:54:47Z</updated>
<entry>
<title>database/sql: more docs explaining that DB is a pool</title>
<updated>2014-05-19T16:54:47Z</updated>
<author>
<name>Brad Fitzpatrick</name>
<email>bradfitz@golang.org</email>
</author>
<published>2014-05-19T16:54:47Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=7b103c555f9200eed9329f433378e72c7909e398'/>
<id>urn:sha1:7b103c555f9200eed9329f433378e72c7909e398</id>
<content type='text'>
This is the main point of confusion and the emphasis of
a recent Gophercon talk.

Fixes #5886. (mostly fixed in previous commits)

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/100560043
</content>
</entry>
<entry>
<title>database/sql: fix accounting of open connections</title>
<updated>2014-05-07T18:54:29Z</updated>
<author>
<name>Brad Fitzpatrick</name>
<email>bradfitz@golang.org</email>
</author>
<published>2014-05-07T18:54:29Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=ce6b75dab634e272e0449f85853fca7f1850da8b'/>
<id>urn:sha1:ce6b75dab634e272e0449f85853fca7f1850da8b</id>
<content type='text'>
Existing test TestMaxOpenConns was failing occasionally, especially
with higher values of GOMAXPROCS.

Fixes #7532

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/95130043
</content>
</entry>
<entry>
<title>all: spelling tweaks, A-G</title>
<updated>2014-04-29T16:44:40Z</updated>
<author>
<name>Robert Hencke</name>
<email>robert.hencke@gmail.com</email>
</author>
<published>2014-04-29T16:44:40Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=f999e14f025b69516dd3e126d04dd309adb2fce0'/>
<id>urn:sha1:f999e14f025b69516dd3e126d04dd309adb2fce0</id>
<content type='text'>
LGTM=ruiu, bradfitz
R=golang-codereviews, bradfitz, ruiu
CC=golang-codereviews
https://golang.org/cl/91840044
</content>
</entry>
<entry>
<title>database/sql: add "defer rows.Close()" to the example code.</title>
<updated>2014-03-25T02:32:18Z</updated>
<author>
<name>Nigel Tao</name>
<email>nigeltao@golang.org</email>
</author>
<published>2014-03-25T02:32:18Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=50ca1a52ca39bdd76bb5f999a67450f5984ebba2'/>
<id>urn:sha1:50ca1a52ca39bdd76bb5f999a67450f5984ebba2</id>
<content type='text'>
Strictly speaking, it's not necessary in example_test.go, as the
Rows.Close docs say that "If Next returns false, the Rows are closed
automatically". However, if the for loop breaks or returns early, it's
not obvious that you'll leak unless you explicitly call Rows.Close.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews, rsc
https://golang.org/cl/79330043
</content>
</entry>
<entry>
<title>all: fix a few spelling errors in source comments</title>
<updated>2013-12-27T16:59:02Z</updated>
<author>
<name>Martin Olsson</name>
<email>martin@minimum.se</email>
</author>
<published>2013-12-27T16:59:02Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=5499034a7143d631e31b108b0c14c86c2345d458'/>
<id>urn:sha1:5499034a7143d631e31b108b0c14c86c2345d458</id>
<content type='text'>
R=golang-codereviews, dave, iant
CC=golang-codereviews
https://golang.org/cl/45750044
</content>
</entry>
<entry>
<title>database/sql: Use all connections in pool</title>
<updated>2013-12-26T19:27:18Z</updated>
<author>
<name>Marko Tiikkaja</name>
<email>marko@joh.to</email>
</author>
<published>2013-12-26T19:27:18Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=0d12e24ebb037202c3324c230e075f1e448f6f34'/>
<id>urn:sha1:0d12e24ebb037202c3324c230e075f1e448f6f34</id>
<content type='text'>
The last connection in the pool was not being handed out correctly.

R=golang-codereviews, gobot, bradfitz
CC=golang-codereviews
https://golang.org/cl/40410043
</content>
</entry>
<entry>
<title>database/sql: Fix inaccurate comment</title>
<updated>2013-12-17T22:53:31Z</updated>
<author>
<name>Marko Tiikkaja</name>
<email>marko@joh.to</email>
</author>
<published>2013-12-17T22:53:31Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=ab05a855c6d5122dfe996b6b36bd39ee85a30b10'/>
<id>urn:sha1:ab05a855c6d5122dfe996b6b36bd39ee85a30b10</id>
<content type='text'>
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/40370051
</content>
</entry>
<entry>
<title>database/sql: fix auto-reconnect in prepared statements</title>
<updated>2013-12-17T19:57:30Z</updated>
<author>
<name>Julien Schmidt</name>
<email>google@julienschmidt.com</email>
</author>
<published>2013-12-17T19:57:30Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=762a9d934eab267418595df7a220eec50919b77d'/>
<id>urn:sha1:762a9d934eab267418595df7a220eec50919b77d</id>
<content type='text'>
This also fixes several connection leaks.
Fixes #5718

R=bradfitz, adg
CC=alberto.garcia.hierro, golang-dev
https://golang.org/cl/14920046
</content>
</entry>
<entry>
<title>database/sql: Check errors in QueryRow.Scan</title>
<updated>2013-12-16T20:48:35Z</updated>
<author>
<name>Marko Tiikkaja</name>
<email>marko@joh.to</email>
</author>
<published>2013-12-16T20:48:35Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=1f20ab1116ab6cb0b77e22ffba3de9919e9def50'/>
<id>urn:sha1:1f20ab1116ab6cb0b77e22ffba3de9919e9def50</id>
<content type='text'>
The previous coding did not correctly check for errors from the driver's
Next() or Close(), which could mask genuine errors from the database, as
witnessed in issue #6651.

Even after this change errors from Close() will be ignored if the query
returned no rows (as Rows.Next will have closed the handle already), but it
is a lot easier for the drivers to guard against that.

Fixes #6651.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/41590043
</content>
</entry>
<entry>
<title>database/sql: Remove redundant condition in if</title>
<updated>2013-12-10T12:10:09Z</updated>
<author>
<name>Alberto García Hierro</name>
<email>alberto@garciahierro.com</email>
</author>
<published>2013-12-10T12:10:09Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=c8869e9caf17c0b993b515924b163a6c8286be77'/>
<id>urn:sha1:c8869e9caf17c0b993b515924b163a6c8286be77</id>
<content type='text'>
The final condition (db.maxIdleConnsLocked() &gt; db.freeConn.Len()) can
only be true iff db.maxIdleConnsLocked() is greater than 0, so previously
checking if it's greater than 0 is a waste, specially when that involves
a method call which (ATM) can't be inlined and includes a switch.

Dissasembly follows (test for err == nil has been omitted for clarity):

Before:
43c357: cmp    $0x0,%bl
43c35a: jne    43c3ce &lt;database/sql.(*DB).putConnDBLocked+0x1ce&gt;
43c35c: mov    %rax,(%rsp)
43c360: callq  43aec0 &lt;database/sql.(*DB).maxIdleConnsLocked&gt;
43c365: mov    0x8(%rsp),%rbx
43c36a: cmp    $0x0,%rbx
43c36e: jle    43c3ce &lt;database/sql.(*DB).putConnDBLocked+0x1ce&gt;
43c370: mov    0x30(%rsp),%rbx
43c375: mov    %rbx,(%rsp)
43c379: callq  43aec0 &lt;database/sql.(*DB).maxIdleConnsLocked&gt;
43c37e: mov    0x30(%rsp),%rdx
43c383: mov    0x8(%rsp),%rcx
43c388: mov    0x28(%rdx),%rbp
43c38c: mov    0x28(%rbp),%rbx
43c390: cmp    %rcx,%rbx
43c393: jge    43c3ce &lt;database/sql.(*DB).putConnDBLocked+0x1ce&gt;
43c395: mov    0x28(%rdx),%rbp
43c399: mov    %rbp,(%rsp)
43c39d: mov    0x38(%rsp),%rcx
43c3a2: mov    $0x556c60,%eax
43c3a7: mov    %rax,0x8(%rsp)
43c3ac: mov    %rcx,0x10(%rsp)
43c3b1: callq  4db5b0 &lt;container/list.(*List).PushFront&gt;

After:
43c357: cmp    $0x0,%bl
43c35a: jne    43c3b5 &lt;database/sql.(*DB).putConnDBLocked+0x1b5&gt;
43c35c: mov    %rax,(%rsp)
43c360: callq  43aec0 &lt;database/sql.(*DB).maxIdleConnsLocked&gt;
43c365: mov    0x30(%rsp),%rdx
43c36a: mov    0x8(%rsp),%rcx
43c36f: mov    0x28(%rdx),%rbp
43c373: mov    0x28(%rbp),%rbx
43c377: cmp    %rcx,%rbx
43c37a: jge    43c3b5 &lt;database/sql.(*DB).putConnDBLocked+0x1b5&gt;
43c37c: mov    0x28(%rdx),%rbp
43c380: mov    %rbp,(%rsp)
43c384: mov    0x38(%rsp),%rcx
43c389: mov    $0x556c60,%eax
43c38e: mov    %rax,0x8(%rsp)
43c393: mov    %rcx,0x10(%rsp)
43c398: callq  4db590 &lt;container/list.(*List).PushFront&gt;

R=golang-dev, bradfitz, iant
CC=golang-dev
https://golang.org/cl/14656044
</content>
</entry>
</feed>
