fix extension points

This commit is contained in:
Stephen Lombardo 2019-09-24 09:19:19 -04:00
parent d9ade80e4f
commit 8319ae0001
4 changed files with 17 additions and 5 deletions

View File

@ -1151,9 +1151,5 @@ end_of_export:
#endif
#ifdef SQLCIPHER_FUNCS
#include "sqlcipher_funcs_impl.h"
#endif
/* END SQLCIPHER */
#endif

View File

@ -43,6 +43,9 @@
#include <windows.h>
#endif
#endif
#ifdef SQLCIPHER_EXT
#include "sqlcipher_ext.h"
#endif
static volatile unsigned int default_flags = DEFAULT_CIPHER_FLAGS;
static volatile unsigned char hmac_salt_mask = HMAC_SALT_MASK;
@ -212,6 +215,9 @@ void sqlcipher_activate() {
#error "NO DEFAULT SQLCIPHER CRYPTO PROVIDER DEFINED"
#endif
CODEC_TRACE("sqlcipher_activate: calling sqlcipher_register_provider(%p)\n", p);
#ifdef SQLCIPHER_EXT
sqlcipher_ext_provider_setup(p);
#endif
sqlcipher_register_provider(p);
CODEC_TRACE("sqlcipher_activate: called sqlcipher_register_provider(%p)\n",p);
}
@ -252,6 +258,9 @@ void sqlcipher_deactivate() {
sqlcipher_provider_mutex = NULL;
sqlcipher_activate_count = 0; /* reset activation count */
#ifdef SQLCIPHER_EXT
sqlcipher_ext_provider_destroy();
#endif
}
CODEC_TRACE_MUTEX("sqlcipher_deactivate: leaving static master mutex\n");

View File

@ -1803,7 +1803,7 @@ void sqlite3RegisterPerConnectionBuiltinFunctions(sqlite3 *db){
sqlite3CreateFunc(db, "sqlcipher_export", -1, SQLITE_TEXT, 0, sqlcipher_exportFunc, 0, 0, 0, 0, 0);
}
#endif
#ifdef SQLCIPHER_FUNCS
#ifdef SQLCIPHER_EXT
#include "sqlcipher_funcs_init.h"
#endif
#endif

View File

@ -3282,6 +3282,13 @@ static int openDatabase(
}
#endif
#ifdef SQLCIPHER_EXT
if( !db->mallocFailed && rc==SQLITE_OK ){
extern int sqlcipherVtabInit(sqlite3 *);
rc = sqlcipherVtabInit(db);
}
#endif
/* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
** mode. -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking
** mode. Doing nothing at all also makes NORMAL the default.