forked from mirror/go-sqlite3
Fixed checking parameter count
This commit is contained in:
parent
b718c29aea
commit
72cb8db627
|
@ -164,7 +164,7 @@ func (c *SQLiteConn) Exec(query string, args []driver.Value) (driver.Result, err
|
||||||
var res driver.Result
|
var res driver.Result
|
||||||
if s.(*SQLiteStmt).s != nil {
|
if s.(*SQLiteStmt).s != nil {
|
||||||
na := s.NumInput()
|
na := s.NumInput()
|
||||||
if na < len(args) {
|
if len(args) < na {
|
||||||
return nil, errors.New("args is not enough to execute query")
|
return nil, errors.New("args is not enough to execute query")
|
||||||
}
|
}
|
||||||
res, err = s.Exec(args[:na])
|
res, err = s.Exec(args[:na])
|
||||||
|
|
Loading…
Reference in New Issue