@@ -123,7 +123,7 @@ SQLITE_API LPWSTR sqlite3_win32_utf8_to_unicode(const char*);
123123/*** Begin of #include "sqlite3patched.c" ***/
124124/******************************************************************************
125125** This file is an amalgamation of many separate C source files from SQLite
126- ** version 3.51.0 . By combining all the individual C code files into this
126+ ** version 3.51.1 . By combining all the individual C code files into this
127127** single large file, the entire code can be compiled as a single translation
128128** unit. This allows many compilers to do optimizations that would not be
129129** possible if the files were compiled separately. Performance improvements
@@ -141,7 +141,7 @@ SQLITE_API LPWSTR sqlite3_win32_utf8_to_unicode(const char*);
141141** separate file. This file contains only code for the core SQLite library.
142142**
143143** The content in this amalgamation comes from Fossil check-in
144- ** fb2c931ae597f8d00a37574ff67aeed3eced with changes in files:
144+ ** 281fc0e9afc38674b9b0991943b9e9d1e64c with changes in files:
145145**
146146**
147147*/
@@ -591,12 +591,12 @@ extern "C" {
591591** [sqlite3_libversion_number()], [sqlite3_sourceid()],
592592** [sqlite_version()] and [sqlite_source_id()].
593593*/
594- #define SQLITE_VERSION "3.51.0 "
595- #define SQLITE_VERSION_NUMBER 3051000
596- #define SQLITE_SOURCE_ID "2025-11-04 19:38:17 fb2c931ae597f8d00a37574ff67aeed3eced4e5547f9120744a-experimental "
597- #define SQLITE_SCM_BRANCH "unknown "
598- #define SQLITE_SCM_TAGS "unknown "
599- #define SQLITE_SCM_DATETIME "2025-11-04T19:38:17.314Z "
594+ #define SQLITE_VERSION "3.51.1 "
595+ #define SQLITE_VERSION_NUMBER 3051001
596+ #define SQLITE_SOURCE_ID "2025-11-28 17:28:25 281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88 "
597+ #define SQLITE_SCM_BRANCH "branch-3.51 "
598+ #define SQLITE_SCM_TAGS "release version-3.51.1 "
599+ #define SQLITE_SCM_DATETIME "2025-11-28T17:28:25.933Z "
600600
601601/*
602602** CAPI3REF: Run-Time Library Version Numbers
@@ -10871,7 +10871,7 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle);
1087110871** ){
1087210872** // do something with pVal
1087310873** }
10874- ** if( rc!=SQLITE_OK ){
10874+ ** if( rc!=SQLITE_DONE ){
1087510875** // an error has occurred
1087610876** }
1087710877** </pre></blockquote>)^
@@ -38148,6 +38148,7 @@ SQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const char *pKey, void *data){
3814838148 return 0;
3814938149}
3815038150
38151+
3815138152/************** End of hash.c ************************************************/
3815238153/************** Begin file opcodes.c *****************************************/
3815338154/* Automatically generated. Do not edit */
@@ -130815,6 +130816,7 @@ SQLITE_PRIVATE void sqlite3SchemaClear(void *p){
130815130816 for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){
130816130817 sqlite3DeleteTrigger(&xdb, (Trigger*)sqliteHashData(pElem));
130817130818 }
130819+
130818130820 sqlite3HashClear(&temp2);
130819130821 sqlite3HashInit(&pSchema->tblHash);
130820130822 for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){
@@ -161145,9 +161147,12 @@ SQLITE_PRIVATE int sqlite3VtabEponymousTableInit(Parse *pParse, Module *pMod){
161145161147 addModuleArgument(pParse, pTab, sqlite3DbStrDup(db, pTab->zName));
161146161148 addModuleArgument(pParse, pTab, 0);
161147161149 addModuleArgument(pParse, pTab, sqlite3DbStrDup(db, pTab->zName));
161150+ db->nSchemaLock++;
161148161151 rc = vtabCallConstructor(db, pTab, pMod, pModule->xConnect, &zErr);
161152+ db->nSchemaLock--;
161149161153 if( rc ){
161150161154 sqlite3ErrorMsg(pParse, "%s", zErr);
161155+ pParse->rc = rc;
161151161156 sqlite3DbFree(db, zErr);
161152161157 sqlite3VtabEponymousTableClear(db, pMod);
161153161158 }
@@ -174209,8 +174214,22 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){
174209174214 sqlite3VdbeAddOp2(v, OP_Goto, 1, pLevel->p2);
174210174215 }
174211174216#endif /* SQLITE_DISABLE_SKIPAHEAD_DISTINCT */
174212- if( pTabList->a[pLevel->iFrom].fg.fromExists ){
174213- sqlite3VdbeAddOp2(v, OP_Goto, 0, sqlite3VdbeCurrentAddr(v)+2);
174217+ if( pTabList->a[pLevel->iFrom].fg.fromExists && i==pWInfo->nLevel-1 ){
174218+ /* If the EXISTS-to-JOIN optimization was applied, then the EXISTS
174219+ ** loop(s) will be the inner-most loops of the join. There might be
174220+ ** multiple EXISTS loops, but they will all be nested, and the join
174221+ ** order will not have been changed by the query planner. If the
174222+ ** inner-most EXISTS loop sees a single successful row, it should
174223+ ** break out of *all* EXISTS loops. But only the inner-most of the
174224+ ** nested EXISTS loops should do this breakout. */
174225+ int nOuter = 0; /* Nr of outer EXISTS that this one is nested within */
174226+ while( nOuter<i ){
174227+ if( !pTabList->a[pLevel[-nOuter-1].iFrom].fg.fromExists ) break;
174228+ nOuter++;
174229+ }
174230+ testcase( nOuter>0 );
174231+ sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel[-nOuter].addrBrk);
174232+ VdbeComment((v, "EXISTS break"));
174214174233 }
174215174234 /* The common case: Advance to the next row */
174216174235 if( pLevel->addrCont ) sqlite3VdbeResolveLabel(v, pLevel->addrCont);
@@ -186415,6 +186434,7 @@ SQLITE_PRIVATE void sqlite3LeaveMutexAndCloseZombie(sqlite3 *db){
186415186434 /* Clear the TEMP schema separately and last */
186416186435 if( db->aDb[1].pSchema ){
186417186436 sqlite3SchemaClear(db->aDb[1].pSchema);
186437+ assert( db->aDb[1].pSchema->trigHash.count==0 );
186418186438 }
186419186439 sqlite3VtabUnlockList(db);
186420186440
@@ -187743,7 +187763,7 @@ SQLITE_API const char *sqlite3_errmsg(sqlite3 *db){
187743187763*/
187744187764SQLITE_API int sqlite3_set_errmsg(sqlite3 *db, int errcode, const char *zMsg){
187745187765 int rc = SQLITE_OK;
187746- if( !sqlite3SafetyCheckSickOrOk (db) ){
187766+ if( !sqlite3SafetyCheckOk (db) ){
187747187767 return SQLITE_MISUSE_BKPT;
187748187768 }
187749187769 sqlite3_mutex_enter(db->mutex);
@@ -249418,6 +249438,7 @@ static void fts5SegIterReverseInitPage(Fts5Index *p, Fts5SegIter *pIter){
249418249438 while( 1 ){
249419249439 u64 iDelta = 0;
249420249440
249441+ if( i>=n ) break;
249421249442 if( eDetail==FTS5_DETAIL_NONE ){
249422249443 /* todo */
249423249444 if( i<n && a[i]==0 ){
@@ -260481,7 +260502,7 @@ static void fts5SourceIdFunc(
260481260502){
260482260503 assert( nArg==0 );
260483260504 UNUSED_PARAM2(nArg, apUnused);
260484- sqlite3_result_text(pCtx, "fts5: 2025-11-04 19:38:17 fb2c931ae597f8d00a37574ff67aeed3eced4e5547f9120744ae4bfa8e74527b ", -1, SQLITE_TRANSIENT);
260505+ sqlite3_result_text(pCtx, "fts5: 2025-11-28 17:28:25 281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88 ", -1, SQLITE_TRANSIENT);
260485260506}
260486260507
260487260508/*
@@ -265302,7 +265323,12 @@ static int fts5VocabOpenMethod(
265302265323 return rc;
265303265324}
265304265325
265326+ /*
265327+ ** Restore cursor pCsr to the state it was in immediately after being
265328+ ** created by the xOpen() method.
265329+ */
265305265330static void fts5VocabResetCursor(Fts5VocabCursor *pCsr){
265331+ int nCol = pCsr->pFts5->pConfig->nCol;
265306265332 pCsr->rowid = 0;
265307265333 sqlite3Fts5IterClose(pCsr->pIter);
265308265334 sqlite3Fts5StructureRelease(pCsr->pStruct);
@@ -265312,6 +265338,12 @@ static void fts5VocabResetCursor(Fts5VocabCursor *pCsr){
265312265338 pCsr->nLeTerm = -1;
265313265339 pCsr->zLeTerm = 0;
265314265340 pCsr->bEof = 0;
265341+ pCsr->iCol = 0;
265342+ pCsr->iInstPos = 0;
265343+ pCsr->iInstOff = 0;
265344+ pCsr->colUsed = 0;
265345+ memset(pCsr->aCnt, 0, sizeof(i64)*nCol);
265346+ memset(pCsr->aDoc, 0, sizeof(i64)*nCol);
265315265347}
265316265348
265317265349/*
@@ -266321,9 +266353,9 @@ SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
266321266353
266322266354#define SQLITE3MC_VERSION_MAJOR 2
266323266355#define SQLITE3MC_VERSION_MINOR 2
266324- #define SQLITE3MC_VERSION_RELEASE 5
266356+ #define SQLITE3MC_VERSION_RELEASE 6
266325266357#define SQLITE3MC_VERSION_SUBRELEASE 0
266326- #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 2.2.5 "
266358+ #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 2.2.6 "
266327266359
266328266360#endif /* SQLITE3MC_VERSION_H_ */
266329266361/*** End of #include "sqlite3mc_version.h" ***/
@@ -266482,12 +266514,12 @@ extern "C" {
266482266514** [sqlite3_libversion_number()], [sqlite3_sourceid()],
266483266515** [sqlite_version()] and [sqlite_source_id()].
266484266516*/
266485- #define SQLITE_VERSION "3.51.0 "
266486- #define SQLITE_VERSION_NUMBER 3051000
266487- #define SQLITE_SOURCE_ID "2025-11-04 19:38:17 fb2c931ae597f8d00a37574ff67aeed3eced4e5547f9120744a-experimental "
266488- #define SQLITE_SCM_BRANCH "unknown "
266489- #define SQLITE_SCM_TAGS "unknown "
266490- #define SQLITE_SCM_DATETIME "2025-11-04T19:38:17.314Z "
266517+ #define SQLITE_VERSION "3.51.1 "
266518+ #define SQLITE_VERSION_NUMBER 3051001
266519+ #define SQLITE_SOURCE_ID "2025-11-28 17:28:25 281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88 "
266520+ #define SQLITE_SCM_BRANCH "branch-3.51 "
266521+ #define SQLITE_SCM_TAGS "release version-3.51.1 "
266522+ #define SQLITE_SCM_DATETIME "2025-11-28T17:28:25.933Z "
266491266523
266492266524/*
266493266525** CAPI3REF: Run-Time Library Version Numbers
@@ -276762,7 +276794,7 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle);
276762276794** ){
276763276795** // do something with pVal
276764276796** }
276765- ** if( rc!=SQLITE_OK ){
276797+ ** if( rc!=SQLITE_DONE ){
276766276798** // an error has occurred
276767276799** }
276768276800** </pre></blockquote>)^
@@ -334508,7 +334540,7 @@ sqlite3mcBtreeSetPageSize(Btree* p, int pageSize, int nReserve, int iFix)
334508334540** Change 4: Call sqlite3mcBtreeSetPageSize instead of sqlite3BtreeSetPageSize for main database
334509334541** (sqlite3mcBtreeSetPageSize allows to reduce the number of reserved bytes)
334510334542**
334511- ** This code is generated by the script rekeyvacuum.sh from SQLite version 3.51.0 amalgamation.
334543+ ** This code is generated by the script rekeyvacuum.sh from SQLite version 3.51.1 amalgamation.
334512334544*/
334513334545SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3mcRunVacuumForRekey(
334514334546 char **pzErrMsg, /* Write error message here */
0 commit comments