diff --git a/sqlite3.go b/sqlite3.go index 38eb942..8757a75 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -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() diff --git a/sqlite3_test.go b/sqlite3_test.go index 581d289..9cc5a0e 100644 --- a/sqlite3_test.go +++ b/sqlite3_test.go @@ -14,7 +14,7 @@ import ( "testing" "time" - "./sqlite3_test" + "github.com/mattn/go-sqlite3/sqlite3_test" ) func TempFilename() string {