From a14f442f3e092344f46fe82dbb4c6c3247d61462 Mon Sep 17 00:00:00 2001 From: Mahadevan Date: Mon, 26 Jan 2015 14:10:18 +0530 Subject: [PATCH] Return error code of sqlite3_step, not sqlite3_reset --- sqlite3.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sqlite3.go b/sqlite3.go index 04f0edb..4712f19 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -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{