diff options
Diffstat (limited to 'sqlite3.go')
-rw-r--r-- | sqlite3.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1,3 +1,8 @@ +// Copyright (C) 2014 Yasuhiro Matsumoto <mattn.jp@gmail.com>. +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file. + package sqlite3 /* @@ -162,6 +167,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() |