<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/database/sql/sql.go, branch go1.8.7</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=go1.8.7</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=go1.8.7'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2017-05-23T19:41:50Z</updated>
<entry>
<title>[release-branch.go1.8] database/sql: ensure releaseConn is defined before a possible close</title>
<updated>2017-05-23T19:41:50Z</updated>
<author>
<name>Daniel Theophanes</name>
<email>kardianos@gmail.com</email>
</author>
<published>2017-05-03T15:57:05Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=6efa2f22ac45e9f12eccdc0eafe1799b9eb78dd3'/>
<id>urn:sha1:6efa2f22ac45e9f12eccdc0eafe1799b9eb78dd3</id>
<content type='text'>
Applies https://golang.org/cl/42139 to the go1.8 release branch.

Also correct two minor issues detected with go vet.

Fixes #20217

Change-Id: I2c41af9497493598fbcfc140439b4e25b9bb7e72
Reviewed-on: https://go-review.googlesource.com/42532
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Chris Broadfoot &lt;cbro@golang.org&gt;
</content>
</entry>
<entry>
<title>[release-branch.go1.8] database/sql: ensure driverConns are closed if not returned to pool</title>
<updated>2017-02-10T17:53:36Z</updated>
<author>
<name>Daniel Theophanes</name>
<email>kardianos@gmail.com</email>
</author>
<published>2017-02-09T05:38:51Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=d84dee069a534bd7a35ec4062a92a04ce9c2806e'/>
<id>urn:sha1:d84dee069a534bd7a35ec4062a92a04ce9c2806e</id>
<content type='text'>
Previously if a connection was requested but timed out during the
request and when acquiring the db.Lock the connection request
is fulfilled and the request is unable to be returned to the
connection pool, then then driver connection would not be closed.

No tests were added or modified because I was unable to determine
how to trigger this situation without something invasive.

Change-Id: I9d4dc680e3fdcf63d79d212174a5b8b313f363f1
Reviewed-on: https://go-review.googlesource.com/36641
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
Reviewed-on: https://go-review.googlesource.com/36714
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
</entry>
<entry>
<title>[release-branch.go1.8] database/sql: do not exhaust connection pool on conn request timeout</title>
<updated>2017-02-10T17:53:29Z</updated>
<author>
<name>Daniel Theophanes</name>
<email>kardianos@gmail.com</email>
</author>
<published>2017-02-08T18:32:22Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=f1e44a4b7426e03bff7ed4f75a91e57c498d3463'/>
<id>urn:sha1:f1e44a4b7426e03bff7ed4f75a91e57c498d3463</id>
<content type='text'>
Previously if a context was canceled while it was waiting for a
connection request, that connection request would leak.

To prevent this remove the pending connection request if the
context is canceled and ensure no connection has been sent on the channel.
This requires a change to how the connection requests are represented in the DB.

Fixes #18995

Change-Id: I9a274b48b8f4f7ca46cdee166faa38f56d030852
Reviewed-on: https://go-review.googlesource.com/36563
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-on: https://go-review.googlesource.com/36613
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
</entry>
<entry>
<title>[release-branch.go1.8] database/sql: record the context error in Rows if canceled</title>
<updated>2017-02-09T03:47:26Z</updated>
<author>
<name>Daniel Theophanes</name>
<email>kardianos@gmail.com</email>
</author>
<published>2017-02-07T18:19:02Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=3ade54063e9a219e50e53a6a042013e2cafc1251'/>
<id>urn:sha1:3ade54063e9a219e50e53a6a042013e2cafc1251</id>
<content type='text'>
Previously it was intended that Rows.Scan would return
an error and Rows.Err would return nil. This was problematic
because drivers could not differentiate between a normal
Rows.Close or a context cancel close.

The alternative is to require drivers to return a Scan to return
an error if the driver is closed while there are still rows to be read.
This is currently not how several drivers currently work and may be
difficult to detect when there are additional rows.

At the same time guard the the Rows.lasterr and prevent a close
while a Rows operation is active.

For the drivers that do not have Context methods, do not check for
context cancelation after the operation, but before for any operation
that may modify the database state.

Fixes #18961

Change-Id: I49a25318ecd9f97a35d5b50540ecd850c01cfa5e
Reviewed-on: https://go-review.googlesource.com/36485
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-on: https://go-review.googlesource.com/36614
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
</entry>
<entry>
<title>database/sql: fix race when canceling queries immediately</title>
<updated>2017-01-26T06:25:37Z</updated>
<author>
<name>Daniel Theophanes</name>
<email>kardianos@gmail.com</email>
</author>
<published>2017-01-21T01:12:50Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=2b283cedef2a62e37b7422ef3badc7b758bd26c8'/>
<id>urn:sha1:2b283cedef2a62e37b7422ef3badc7b758bd26c8</id>
<content type='text'>
Previously the following could happen, though in practice it would
be rare.

Goroutine 1:
	(*Tx).QueryContext begins a query, passing in userContext

Goroutine 2:
	(*Tx).awaitDone starts to wait on the context derived from the passed in context

Goroutine 1:
	(*Tx).grabConn returns a valid (*driverConn)
	The (*driverConn) passes to (*DB).queryConn

Goroutine 3:
	userContext is canceled

Goroutine 2:
	(*Tx).awaitDone unblocks and calls (*Tx).rollback
	(*driverConn).finalClose obtains dc.Mutex
	(*driverConn).finalClose sets dc.ci = nil

Goroutine 1:
	(*DB).queryConn obtains dc.Mutex in withLock
	ctxDriverPrepare accepts dc.ci which is now nil
	ctxCriverPrepare panics on the nil ci

The fix for this is to guard the Tx methods with a RWLock
holding it exclusivly when closing the Tx and holding a read lock
when executing a query.

Fixes #18719

Change-Id: I37aa02c37083c9793dabd28f7f934a1c5cbc05ea
Reviewed-on: https://go-review.googlesource.com/35550
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
</entry>
<entry>
<title>all: fix misspellings</title>
<updated>2017-01-07T16:53:25Z</updated>
<author>
<name>shawnps</name>
<email>shawnpsmith@gmail.com</email>
</author>
<published>2017-01-07T16:23:11Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=067bab00a80e028f1d7ce553b27aba2aa3e9675f'/>
<id>urn:sha1:067bab00a80e028f1d7ce553b27aba2aa3e9675f</id>
<content type='text'>
Change-Id: I429637ca91f7db4144f17621de851a548dc1ce76
Reviewed-on: https://go-review.googlesource.com/34923
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Daniel Martí &lt;mvdan@mvdan.cc&gt;
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>database/sql: prevent Tx.rollback from racing Tx.close</title>
<updated>2017-01-02T20:21:02Z</updated>
<author>
<name>Daniel Theophanes</name>
<email>kardianos@gmail.com</email>
</author>
<published>2016-12-26T19:33:46Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=9def857072bb708a79c291bb88c4b2830f0a8376'/>
<id>urn:sha1:9def857072bb708a79c291bb88c4b2830f0a8376</id>
<content type='text'>
Previously Tx.done was being set in close, but in a Tx
rollback and Commit are the real closing methods,
and Tx.close is just a helper common to both. Prior to this
change a multiple rollback statements could be called, one
would enter close and begin closing it while the other was
still in rollback breaking it. Fix that by setting done
in rollback and Commit, not in Tx.close.

Fixes #18429

Change-Id: Ie274f60c2aa6a4a5aa38e55109c05ea9d4fe0223
Reviewed-on: https://go-review.googlesource.com/34716
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>database/sql: do not store Tx options in Context</title>
<updated>2016-12-14T18:13:13Z</updated>
<author>
<name>Daniel Theophanes</name>
<email>kardianos@gmail.com</email>
</author>
<published>2016-12-13T15:55:12Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=d0501f1da9c54a8053940feeb86e1644ffaae522'/>
<id>urn:sha1:d0501f1da9c54a8053940feeb86e1644ffaae522</id>
<content type='text'>
Drivers which previously supported tip will need to update to this
revision before release.

Fixes #18284

Change-Id: I70b8e7afff1558a8b5348885ce9f50e067c72ee9
Reviewed-on: https://go-review.googlesource.com/34330
Run-TryBot: Daniel Theophanes &lt;kardianos@gmail.com&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
</entry>
<entry>
<title>database/sql: use complete sentences in new docs</title>
<updated>2016-12-09T20:19:06Z</updated>
<author>
<name>Brad Fitzpatrick</name>
<email>bradfitz@golang.org</email>
</author>
<published>2016-12-09T19:58:11Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=454c2343979b8976f3f1ac50f8149b36a839d555'/>
<id>urn:sha1:454c2343979b8976f3f1ac50f8149b36a839d555</id>
<content type='text'>
Change-Id: Icb842a80cab2b07b9ace1e8e14c4a19c48a92c43
Reviewed-on: https://go-review.googlesource.com/34247
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Daniel Theophanes &lt;kardianos@gmail.com&gt;
</content>
</entry>
<entry>
<title>database/sql: document that drivers may not return right after cancel</title>
<updated>2016-12-09T03:15:22Z</updated>
<author>
<name>Daniel Theophanes</name>
<email>kardianos@gmail.com</email>
</author>
<published>2016-12-08T21:07:35Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=e12ce1e4005fcefd7a3537c433e6a60044160086'/>
<id>urn:sha1:e12ce1e4005fcefd7a3537c433e6a60044160086</id>
<content type='text'>
Fixes #18168

Change-Id: Idbfe3d4daedd93c7caf6f1770ecd988e9af39949
Reviewed-on: https://go-review.googlesource.com/34144
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
</entry>
</feed>
