]> Cypherpunks repositories - gostls13.git/commit
database/sql: don't ignore ColumnConverter for unknown input count
authorJonathan Hall <flimzy@flimzy.com>
Mon, 8 Jul 2024 16:14:43 +0000 (18:14 +0200)
committert hepudds <thepudds1460@gmail.com>
Fri, 21 Nov 2025 21:25:48 +0000 (13:25 -0800)
commit6f16669e346038c983ae33025ca02dccd78b6f20
tree9ac7d7e3f75048e156c9ca45cac24107e2ef1d65
parent121bc3e464b901327a5c138d8a992bb85c440862
database/sql: don't ignore ColumnConverter for unknown input count

In the case a sql driver implements the ColumnConverter interface and also
returns -1 for NumInputs, indicating an unknown number of input arguments to
a query, the previous implementation would ignore the column converter would
not be called, leading to unexpected or invalid arguments passed to the driver.

Fixes #68342

Change-Id: Ib2ddaf040fa9be669d593eacdaa1e88ba66d7bc2
Reviewed-on: https://go-review.googlesource.com/c/go/+/597115
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/database/sql/convert.go
src/database/sql/sql_test.go