<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/database/sql/sql.go, branch makepkg</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=makepkg</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=makepkg'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2025-12-11T19:57:52Z</updated>
<entry>
<title>Revert "database/sql: allow drivers to override Scan behavior"</title>
<updated>2025-12-11T19:57:52Z</updated>
<author>
<name>Austin Clements</name>
<email>austin@google.com</email>
</author>
<published>2025-12-11T18:55:33Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=ae62a1bd365fca4c41d8b29d62cca240ab45b212'/>
<id>urn:sha1:ae62a1bd365fca4c41d8b29d62cca240ab45b212</id>
<content type='text'>
This reverts CL 588435.

This new API is difficult to use correctly, and in many cases cannot
be used efficiently. We're going to work on this problem a bit more.

The release notes are removed by CL 729340, since they were moved to
the x/website repository since the original CL was made.

Reopens #67546.

Change-Id: I2a2bd25f2fce5f02e4d28cd33a9cc651bf35ab50
Reviewed-on: https://go-review.googlesource.com/c/go/+/729360
Reviewed-by: Damien Neil &lt;dneil@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Sean Liao &lt;sean@liao.dev&gt;
</content>
</entry>
<entry>
<title>database/sql: allow drivers to override Scan behavior</title>
<updated>2025-08-11T21:27:36Z</updated>
<author>
<name>Jack Christensen</name>
<email>jack@jackchristensen.com</email>
</author>
<published>2025-05-31T15:27:15Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=3dbef65bf37f1b7ccd1f884761341a5a15456ffa'/>
<id>urn:sha1:3dbef65bf37f1b7ccd1f884761341a5a15456ffa</id>
<content type='text'>
Implementing RowsColumnScanner allows the driver
to completely control how values are scanned.

Fixes #67546

Change-Id: Id8e7c3a973479c9665e4476fe2d29e1255aee687
GitHub-Last-Rev: ed0cacaec4a4feead56b09c0d6eee86ed58fe1ee
GitHub-Pull-Request: golang/go#67648
Reviewed-on: https://go-review.googlesource.com/c/go/+/588435
Reviewed-by: David Chase &lt;drchase@google.com&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
Reviewed-by: Sean Liao &lt;sean@liao.dev&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>database/sql: avoid closing Rows while scan is in progress</title>
<updated>2025-08-06T18:36:35Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2025-07-23T21:26:54Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=a3895fe9f18682d5055cb68283eba21d7255a67f'/>
<id>urn:sha1:a3895fe9f18682d5055cb68283eba21d7255a67f</id>
<content type='text'>
A database/sql/driver.Rows can return database-owned data
from Rows.Next. The driver.Rows documentation doesn't explicitly
document the lifetime guarantees for this data, but a reasonable
expectation is that the caller of Next should only access it
until the next call to Rows.Close or Rows.Next.

Avoid violating that constraint when a query is cancelled while
a call to database/sql.Rows.Scan (note the difference between
the two different Rows types!) is in progress. We previously
took care to avoid closing a driver.Rows while the user has
access to driver-owned memory via a RawData, but we could still
close a driver.Rows while a Scan call was in the process of
reading previously-returned driver-owned data.

Update the fake DB used in database/sql tests to invalidate
returned data to help catch other places we might be
incorrectly retaining it.

Fixes #74831.

Change-Id: Ice45b5fad51b679c38e3e1d21ef39156b56d6037
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/2540
Reviewed-by: Roland Shoemaker &lt;bracewell@google.com&gt;
Reviewed-by: Neal Patel &lt;nealpatel@google.com&gt;
Reviewed-on: https://go-review.googlesource.com/c/go/+/693735
Auto-Submit: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
Reviewed-by: Roland Shoemaker &lt;roland@golang.org&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
</content>
</entry>
<entry>
<title>database/sql: wake cleaner if maxIdleTime set to less than maxLifetime</title>
<updated>2025-04-17T05:57:52Z</updated>
<author>
<name>Philip Roberts</name>
<email>phil@latentflip.com</email>
</author>
<published>2023-03-09T11:16:56Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=7b263895f7dbe81ddd7c0fc399e6a9ae6fe2f5bf'/>
<id>urn:sha1:7b263895f7dbe81ddd7c0fc399e6a9ae6fe2f5bf</id>
<content type='text'>
The existing implementation wouldn't wake the connection cleaner if
maxIdleTime was set to a value less than maxLifetime while an existing
connection was open - resulting in idle connections not being discarded
until after the first maxLifetime had passed.

Fixes #45993

Change-Id: I074ed7ba9803354c8b3a41f2625ae0d8a7d5059b
GitHub-Last-Rev: 0d149d8d38bc9c2ad42a2a20dcfc73994d54fe23
GitHub-Pull-Request: golang/go#58490
Reviewed-on: https://go-review.googlesource.com/c/go/+/467655
Auto-Submit: Sean Liao &lt;sean@liao.dev&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Sean Liao &lt;sean@liao.dev&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
Reviewed-by: Daniel Theophanes &lt;kardianos@gmail.com&gt;
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
</content>
</entry>
<entry>
<title>database/sql: rewrite Null[T].Value method, update doc for Null[T]</title>
<updated>2024-10-21T18:42:47Z</updated>
<author>
<name>Jes Cok</name>
<email>xigua67damn@gmail.com</email>
</author>
<published>2024-10-21T04:42:51Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=971ab11ee2477cf81f7b7db520bb5c151440d298'/>
<id>urn:sha1:971ab11ee2477cf81f7b7db520bb5c151440d298</id>
<content type='text'>
Update doc for Null[T] to clarify that T should be one of the types
accepted by driver.Value.

Modify the Value() method of Null[T]:
1) recognize T implementing driver.Valuer interface and invoke it.
2) use the DefaultParameterConverter to convert native types that
are not directly supported as driver.Value types.

Fixes #69728
Fixes #69837

Change-Id: Iba782c878b2bde168125f5390abf319b88424149
GitHub-Last-Rev: 3df182d23dd57bd04828c3e9bd0c5222d8bef152
GitHub-Pull-Request: golang/go#69938
Reviewed-on: https://go-review.googlesource.com/c/go/+/620858
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
</content>
</entry>
<entry>
<title>all: use slices.Sorted(maps.Keys(m))</title>
<updated>2024-10-02T14:22:59Z</updated>
<author>
<name>Tobias Klauser</name>
<email>tklauser@distanz.ch</email>
</author>
<published>2024-10-02T11:00:17Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=bb5339196f86057ffa6042d31f52a44bf7f13752'/>
<id>urn:sha1:bb5339196f86057ffa6042d31f52a44bf7f13752</id>
<content type='text'>
Use slices.Sorted(maps.Keys(m)) to get a sorted slices of the keys in
a map.

Do not change packages built during bootstrap, as the bootstrap compiler
(currently 1.22.6) does not have the required maps and slices functions.

Change-Id: Ie35565d241fa14aca56b730a69af010127b659ab
Reviewed-on: https://go-review.googlesource.com/c/go/+/617356
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Michael Knyszek &lt;mknyszek@google.com&gt;
Auto-Submit: Tobias Klauser &lt;tobias.klauser@gmail.com&gt;
</content>
</entry>
<entry>
<title>database/sql: fix panic with concurrent Conn and Close</title>
<updated>2024-08-24T00:26:08Z</updated>
<author>
<name>Nic Klaassen</name>
<email>nic@nicklaassen.ca</email>
</author>
<published>2024-08-22T23:37:00Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=08707d66c350927560faa11b0c195d37d281ab89'/>
<id>urn:sha1:08707d66c350927560faa11b0c195d37d281ab89</id>
<content type='text'>
The current implementation has a panic when the database is closed
concurrently with a new connection attempt.

connRequestSet.CloseAndRemoveAll sets connRequestSet.s to a nil slice.
If this happens between calls to connRequestSet.Add and
connRequestSet.Delete, there is a panic when trying to write to the nil
slice. This is sequence is likely to occur in DB.conn, where the mutex
is released between calls to db.connRequests.Add and
db.connRequests.Delete

This change updates connRequestSet.CloseAndRemoveAll to set the curIdx
to -1 for all pending requests before setting its internal slice to nil.
CloseAndRemoveAll already iterates the full slice to close all the request
channels. It seems appropriate to set curIdx to -1 before deleting the
slice for 3 reasons:
1. connRequestSet.deleteIndex also sets curIdx to -1
2. curIdx will not be relevant to anything after the slice is set to nil
3. connRequestSet.Delete already checks for negative indices

Fixes #68949

Change-Id: I6b7ebc5a71b67322908271d13865fa12f2469b87
GitHub-Last-Rev: 7d2669155b24043dd9d276f915689511572f2e49
GitHub-Pull-Request: golang/go#68953
Reviewed-on: https://go-review.googlesource.com/c/go/+/607238
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Auto-Submit: Ian Lance Taylor &lt;iant@golang.org&gt;
Commit-Queue: Ian Lance Taylor &lt;iant@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
</content>
</entry>
<entry>
<title>all: document legacy //go:linkname for modules with ≥500 dependents</title>
<updated>2024-05-23T01:16:53Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2024-05-22T19:03:13Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=05cbbf985fed823a174bf95cc78a7d44f948fdab'/>
<id>urn:sha1:05cbbf985fed823a174bf95cc78a7d44f948fdab</id>
<content type='text'>
For #67401.

Change-Id: I7dd28c3b01a1a647f84929d15412aa43ab0089ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/587575
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
Auto-Submit: Russ Cox &lt;rsc@golang.org&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
<entry>
<title>database/sql: reordering fields to reduce struct sizes</title>
<updated>2024-05-14T20:18:21Z</updated>
<author>
<name>apocelipes</name>
<email>seve3r@outlook.com</email>
</author>
<published>2024-05-14T09:42:57Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=1f6a983baf4b9a636e9e4bbd827fcb4d6ef4ebe0'/>
<id>urn:sha1:1f6a983baf4b9a636e9e4bbd827fcb4d6ef4ebe0</id>
<content type='text'>
There are 16 bytes reduced.

Change-Id: I33ca96fd22002b3111f0462c3029d70df48adb6e
GitHub-Last-Rev: 8df56a9655ef261be3ff9403491cbbe1ebda1ec0
GitHub-Pull-Request: golang/go#67055
Reviewed-on: https://go-review.googlesource.com/c/go/+/581935
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Dmitri Shuralyov &lt;dmitshur@google.com&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@google.com&gt;
Auto-Submit: Ian Lance Taylor &lt;iant@google.com&gt;
</content>
</entry>
<entry>
<title>database/sql: avoid clobbering driver-owned memory in RawBytes</title>
<updated>2024-04-10T20:23:22Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2024-01-23T23:59:47Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=c23579f031ecd09bf37c644723b33736dffa8b92'/>
<id>urn:sha1:c23579f031ecd09bf37c644723b33736dffa8b92</id>
<content type='text'>
Depending on the query, a RawBytes can contain memory owned by the
driver or by database/sql:

If the driver provides the column as a []byte,
RawBytes aliases that []byte.

If the driver provides the column as any other type,
RawBytes contains memory allocated by database/sql.
Prior to this CL, Rows.Scan will reuse existing capacity in a
RawBytes to permit a single allocation to be reused across rows.

When a RawBytes is reused across queries, this can result
in database/sql writing to driver-owned memory.

Add a buffer to Rows to store RawBytes data, and reuse this
buffer across calls to Rows.Scan.

Fixes #65201

Change-Id: Iac640174c7afa97eeb39496f47dec202501b2483
Reviewed-on: https://go-review.googlesource.com/c/go/+/557917
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Reviewed-by: Roland Shoemaker &lt;roland@golang.org&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
</content>
</entry>
</feed>
