diff --git a/src/sqlite3mc.c b/src/sqlite3mc.c index a365e2e..e0dbfae 100644 --- a/src/sqlite3mc.c +++ b/src/sqlite3mc.c @@ -437,27 +437,27 @@ mcRegisterCodecExtensions(sqlite3* db, char** pzErrMsg, const sqlite3_api_routin rc = (codecParameterTable != NULL) ? SQLITE_OK : SQLITE_NOMEM; if (rc == SQLITE_OK) { - rc = sqlite3_create_function(db, "sqlite3mc_config", 1, SQLITE_UTF8 | SQLITE_DETERMINISTIC, + rc = sqlite3_create_function(db, "sqlite3mc_config", 1, SQLITE_UTF8 | SQLITE_DIRECTONLY, codecParameterTable, sqlite3mcConfigParams, 0, 0); } if (rc == SQLITE_OK) { - rc = sqlite3_create_function(db, "sqlite3mc_config", 2, SQLITE_UTF8 | SQLITE_DETERMINISTIC, + rc = sqlite3_create_function(db, "sqlite3mc_config", 2, SQLITE_UTF8 | SQLITE_DIRECTONLY, codecParameterTable, sqlite3mcConfigParams, 0, 0); } if (rc == SQLITE_OK) { - rc = sqlite3_create_function(db, "sqlite3mc_config", 3, SQLITE_UTF8 | SQLITE_DETERMINISTIC, + rc = sqlite3_create_function(db, "sqlite3mc_config", 3, SQLITE_UTF8 | SQLITE_DIRECTONLY, codecParameterTable, sqlite3mcConfigParams, 0, 0); } if (rc == SQLITE_OK) { - rc = sqlite3_create_function(db, "sqlite3mc_codec_data", 1, SQLITE_UTF8 | SQLITE_DETERMINISTIC, + rc = sqlite3_create_function(db, "sqlite3mc_codec_data", 1, SQLITE_UTF8 | SQLITE_DIRECTONLY, NULL, sqlite3mcCodecDataSql, 0, 0); } if (rc == SQLITE_OK) { - rc = sqlite3_create_function(db, "sqlite3mc_codec_data", 2, SQLITE_UTF8 | SQLITE_DETERMINISTIC, + rc = sqlite3_create_function(db, "sqlite3mc_codec_data", 2, SQLITE_UTF8 | SQLITE_DIRECTONLY, NULL, sqlite3mcCodecDataSql, 0, 0); } if (rc == SQLITE_OK) @@ -931,8 +931,8 @@ static const sqlite3mc_core_routines sqlite3mcCoreApis = sqlite3_preupdate_count, sqlite3_preupdate_depth, sqlite3_preupdate_hook, - sqlite3_preupdate_new, sqlite3_preupdate_old, + sqlite3_preupdate_new, #else 0, 0, @@ -965,8 +965,8 @@ static const sqlite3mc_core_routines sqlite3mcCoreApis = #endif #if SQLITE_OS_WIN == 1 sqlite3_win32_set_directory, - sqlite3_win32_set_directory16, sqlite3_win32_set_directory8, + sqlite3_win32_set_directory16, #else 0, 0, diff --git a/src/sqlite3mc_vfs.c b/src/sqlite3mc_vfs.c index 683d50f..a415217 100644 --- a/src/sqlite3mc_vfs.c +++ b/src/sqlite3mc_vfs.c @@ -1680,7 +1680,7 @@ static int mcWriteMainJournal(sqlite3_file* pFile, const void* buffer, int count ** Encrypt the page buffer, but only if the page number is valid */ void* bufferEncrypted = sqlite3mcCodec(codec, (char*) buffer, pageNo, 7); - rc = sqlite3mcGetCodecLastError(mcFile->codec); + rc = sqlite3mcGetCodecLastError(codec); if (rc == SQLITE_OK) { rc = REALFILE(pFile)->pMethods->xWrite(REALFILE(pFile), bufferEncrypted, pageSize, offset); @@ -1741,7 +1741,7 @@ static int mcWriteSubJournal(sqlite3_file* pFile, const void* buffer, int count, ** Encrypt the page buffer, but only if the page number is valid */ void* bufferEncrypted = sqlite3mcCodec(codec, (char*) buffer, pageNo, 7); - rc = sqlite3mcGetCodecLastError(mcFile->codec); + rc = sqlite3mcGetCodecLastError(codec); if (rc == SQLITE_OK) { rc = REALFILE(pFile)->pMethods->xWrite(REALFILE(pFile), bufferEncrypted, pageSize, offset);