Skip to content

Commit f2becd3

Browse files
committed
Revert previous commit
GH CI workflows failed with applied fix for issue #194.
1 parent 92449bb commit f2becd3

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

scripts/patchsqlite3.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,5 @@ sed 's/sqlite3_file_control\(.*SQLITE_FCNTL_PRAGMA\)/sqlite3mcFileControlPragma\
2727
| sed '/^ if( sqlite3PCacheIsDirty(pPager->pPCache) ) return 0;/a \ if( sqlite3mcPagerHasCodec(pPager) != 0 ) return 0;' \
2828
| sed '/^ }else if( USEFETCH(pPager) ){/c \ }else if( USEFETCH(pPager) && sqlite3mcPagerHasCodec(pPager) == 0 ){' \
2929
| sed '/^ if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0));/a \\n \/\* Initialize wrapper for memory management.\*\/\n if( rc==SQLITE_OK ) {\n sqlite3mcInitMemoryMethods();\n }\n' \
30-
| sed '/^ sqlite3GlobalConfig.isInit = 1;/i \ \n int sqlite3mc_initialize(const char*);\n rc = sqlite3mc_initialize(0);\n' \
31-
| sed '/^ sqlite3_os_end();/i \ \n void sqlite3mc_shutdown(void);\n sqlite3mc_shutdown();\n' \
3230
| sed '/Lock the source database handle./i \ \/\* Check whether databases are compatible with backup \*\/\n if (!sqlite3mcIsBackupSupported(pSrcDb, zSrcDb, pDestDb, zDestDb)){\n sqlite3ErrorWithMsg(pDestDb, SQLITE_ERROR, \"backup is not supported with incompatible source and target databases\");\n return NULL;\n }\n' \
3331
| sed '/nRes = sqlite3BtreeGetRequestedReserve(pMain)/a \\n \/\* A VACUUM cannot change the pagesize of an encrypted database. \*\/\n if( db->nextPagesize ){\n extern void sqlite3mcCodecGetKey(sqlite3*, int, void**, int*);\n int nKey;\n char *zKey;\n sqlite3mcCodecGetKey(db, iDb, (void**)&zKey, &nKey);\n if( nKey ) db->nextPagesize = 0;\n }' \

src/sqlite3mc.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@
3737
#endif
3838
#endif
3939

40+
/*
41+
** Define function for extra initialization and extra shutdown
42+
**
43+
** The extra initialization function registers an extension function
44+
** which will be automatically executed for each new database connection.
45+
**
46+
** The extra shutdown function will be executed on the invocation of sqlite3_shutdown.
47+
** All created multiple ciphers VFSs will be unregistered and destroyed.
48+
*/
49+
50+
#define SQLITE_EXTRA_INIT sqlite3mc_initialize
51+
#define SQLITE_EXTRA_SHUTDOWN sqlite3mc_shutdown
52+
4053
/*
4154
** Declare all internal functions as 'static' unless told otherwise
4255
*/

src/sqlite3patched.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181886,10 +181886,6 @@ SQLITE_API int sqlite3_initialize(void){
181886181886
sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage,
181887181887
sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage);
181888181888
sqlite3MemoryBarrier();
181889-
181890-
int sqlite3mc_initialize(const char*);
181891-
rc = sqlite3mc_initialize(0);
181892-
181893181889
sqlite3GlobalConfig.isInit = 1;
181894181890
#ifdef SQLITE_EXTRA_INIT
181895181891
bRunExtraInit = 1;
@@ -181963,10 +181959,6 @@ SQLITE_API int sqlite3_shutdown(void){
181963181959
void SQLITE_EXTRA_SHUTDOWN(void);
181964181960
SQLITE_EXTRA_SHUTDOWN();
181965181961
#endif
181966-
181967-
void sqlite3mc_shutdown(void);
181968-
sqlite3mc_shutdown();
181969-
181970181962
sqlite3_os_end();
181971181963
sqlite3_reset_auto_extension();
181972181964
sqlite3GlobalConfig.isInit = 0;

0 commit comments

Comments
 (0)