aboutsummaryrefslogtreecommitdiff
path: root/src/database/sql
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2018-01-31 11:58:03 -0500
committerDaniel Theophanes <kardianos@gmail.com>2018-02-13 21:25:13 +0000
commit1091b50cc0e4316588aeff5146f667c56296f658 (patch)
tree4bf850b173d81041714865eea268f94980670cdf /src/database/sql
parent8da7706bb4dc609689fd69e196ddaa800908c31f (diff)
downloadgo-1091b50cc0e4316588aeff5146f667c56296f658.tar.xz
database/sql: remove duplicate validation
Since https://golang.org/cl/38533, this validation is performed in driverArgs. Change-Id: I13a3ca46a1aa3197370de1095fb46ab83ea4628c Reviewed-on: https://go-review.googlesource.com/91115 Reviewed-by: Daniel Theophanes <kardianos@gmail.com> Run-TryBot: Daniel Theophanes <kardianos@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/database/sql')
-rw-r--r--src/database/sql/sql.go14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/database/sql/sql.go b/src/database/sql/sql.go
index a6fa153d94..5d62eb2b53 100644
--- a/src/database/sql/sql.go
+++ b/src/database/sql/sql.go
@@ -2262,13 +2262,6 @@ func resultFromStatement(ctx context.Context, ci driver.Conn, ds *driverStmt, ar
return nil, err
}
- // -1 means the driver doesn't know how to count the number of
- // placeholders, so we won't sanity check input here and instead let the
- // driver deal with errors.
- if want := ds.si.NumInput(); want >= 0 && want != len(dargs) {
- return nil, fmt.Errorf("sql: statement expects %d inputs; got %d", want, len(dargs))
- }
-
resi, err := ctxDriverStmtExec(ctx, ds.si, dargs)
if err != nil {
return nil, err
@@ -2440,13 +2433,6 @@ func rowsiFromStatement(ctx context.Context, ci driver.Conn, ds *driverStmt, arg
return nil, err
}
- // -1 means the driver doesn't know how to count the number of
- // placeholders, so we won't sanity check input here and instead let the
- // driver deal with errors.
- if want := ds.si.NumInput(); want >= 0 && want != len(dargs) {
- return nil, fmt.Errorf("sql: statement expects %d inputs; got %d", want, len(dargs))
- }
-
rowsi, err := ctxDriverStmtQuery(ctx, ds.si, dargs)
if err != nil {
return nil, err