This commit is contained in:
mattn
2014-09-03 09:21:35 +09:00
2 changed files with 4 additions and 1 deletions

View File

@@ -164,6 +164,9 @@ func (c *SQLiteConn) Exec(query string, args []driver.Value) (driver.Result, err
var res driver.Result
if s.(*SQLiteStmt).s != nil {
na := s.NumInput()
if len(args) < na {
return nil, errors.New("args is not enough to execute query")
}
res, err = s.Exec(args[:na])
if err != nil && err != driver.ErrSkip {
s.Close()