1
0
mirror of https://github.com/golang/go synced 2024-11-20 02:34:42 -07:00

sql: Propagate error from subsetTypeArgs in Exec

Fixes #3449

R=golang-dev
CC=bradfitz, golang-dev
https://golang.org/cl/5970076
This commit is contained in:
Michael Lewis 2012-04-03 15:36:48 -07:00 committed by Brad Fitzpatrick
parent 7a33265ccd
commit 86092b3d45

View File

@ -327,6 +327,9 @@ func (db *DB) prepare(query string) (stmt *Stmt, err error) {
// Exec executes a query without returning any rows. // Exec executes a query without returning any rows.
func (db *DB) Exec(query string, args ...interface{}) (Result, error) { func (db *DB) Exec(query string, args ...interface{}) (Result, error) {
sargs, err := subsetTypeArgs(args) sargs, err := subsetTypeArgs(args)
if err != nil {
return nil, err
}
var res Result var res Result
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {
res, err = db.exec(query, sargs) res, err = db.exec(query, sargs)