aboutsummaryrefslogtreecommitdiff
path: root/sqlite3.go
diff options
context:
space:
mode:
Diffstat (limited to 'sqlite3.go')
-rw-r--r--sqlite3.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/sqlite3.go b/sqlite3.go
index f363549..5df6c8b 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -400,8 +400,12 @@ func (c *SQLiteConn) AutoCommit() bool {
}
func (c *SQLiteConn) lastError() Error {
+ rv := C.sqlite3_errcode(c.db)
+ if rv == C.SQLITE_OK {
+ return nil
+ }
return Error{
- Code: ErrNo(C.sqlite3_errcode(c.db)),
+ Code: ErrNo(rv),
ExtendedCode: ErrNoExtended(C.sqlite3_extended_errcode(c.db)),
err: C.GoString(C.sqlite3_errmsg(c.db)),
}