close statement

This commit is contained in:
Yasuhiro Matsumoto 2017-01-07 22:22:02 +09:00
parent 6f2749a3ca
commit a554cf198f
1 changed files with 1 additions and 0 deletions

View File

@ -429,6 +429,7 @@ func (c *SQLiteConn) exec(ctx context.Context, query string, args []namedValue)
if s.(*SQLiteStmt).s != nil {
na := s.NumInput()
if len(args) < na {
s.Close()
return nil, fmt.Errorf("Not enough args to execute query. Expected %d, got %d.", na, len(args))
}
for i := 0; i < na; i++ {