mirror of https://github.com/mattn/go-sqlite3.git
Return error code of sqlite3_step, not sqlite3_reset
This commit is contained in:
parent
d8029554b4
commit
a14f442f3e
|
@ -441,8 +441,9 @@ func (s *SQLiteStmt) Exec(args []driver.Value) (driver.Result, error) {
|
||||||
}
|
}
|
||||||
rv := C.sqlite3_step(s.s)
|
rv := C.sqlite3_step(s.s)
|
||||||
if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE {
|
if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE {
|
||||||
|
err := s.c.lastError()
|
||||||
C.sqlite3_reset(s.s)
|
C.sqlite3_reset(s.s)
|
||||||
return nil, s.c.lastError()
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
res := &SQLiteResult{
|
res := &SQLiteResult{
|
||||||
|
|
Loading…
Reference in New Issue