forked from mirror/go-sqlcipher
return nil when last error is SQLITE_OK
This commit is contained in:
parent
eac1dfa2a6
commit
53900fb4f0
|
@ -400,8 +400,12 @@ func (c *SQLiteConn) AutoCommit() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *SQLiteConn) lastError() Error {
|
func (c *SQLiteConn) lastError() Error {
|
||||||
|
rv := C.sqlite3_errcode(c.db)
|
||||||
|
if rv == C.SQLITE_OK {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return Error{
|
return Error{
|
||||||
Code: ErrNo(C.sqlite3_errcode(c.db)),
|
Code: ErrNo(rv),
|
||||||
ExtendedCode: ErrNoExtended(C.sqlite3_extended_errcode(c.db)),
|
ExtendedCode: ErrNoExtended(C.sqlite3_extended_errcode(c.db)),
|
||||||
err: C.GoString(C.sqlite3_errmsg(c.db)),
|
err: C.GoString(C.sqlite3_errmsg(c.db)),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue