disable extension when loading failed

This commit is contained in:
Yasuhiro Matsumoto 2017-03-21 00:47:07 +09:00
parent 796dcab06d
commit 1d0b0f0e72
1 changed files with 1 additions and 0 deletions

View File

@ -31,6 +31,7 @@ func (c *SQLiteConn) loadExtensions(extensions []string) error {
defer C.free(unsafe.Pointer(cext)) defer C.free(unsafe.Pointer(cext))
rv = C.sqlite3_load_extension(c.db, cext, nil, nil) rv = C.sqlite3_load_extension(c.db, cext, nil, nil)
if rv != C.SQLITE_OK { if rv != C.SQLITE_OK {
C.sqlite3_enable_load_extension(c.db, 0)
return errors.New(C.GoString(C.sqlite3_errmsg(c.db))) return errors.New(C.GoString(C.sqlite3_errmsg(c.db)))
} }
} }