Merge pull request #169 from mdevan/master

Return error code of sqlite3_step, not sqlite3_reset
This commit is contained in:
mattn 2015-01-26 17:49:40 +09:00
commit 9c64e666d6
1 changed files with 2 additions and 1 deletions

View File

@ -441,8 +441,9 @@ func (s *SQLiteStmt) Exec(args []driver.Value) (driver.Result, error) {
}
rv := C.sqlite3_step(s.s)
if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE {
err := s.c.lastError()
C.sqlite3_reset(s.s)
return nil, s.c.lastError()
return nil, err
}
res := &SQLiteResult{