diff --git a/libstuff/sqlite3.c b/libstuff/sqlite3.c index 10098ae7b..fd4a470d0 100644 --- a/libstuff/sqlite3.c +++ b/libstuff/sqlite3.c @@ -18,7 +18,7 @@ ** separate file. This file contains only code for the core SQLite library. ** ** The content in this amalgamation comes from Fossil check-in -** ed11ce7ea423bd7aaa3afc6542ba8463745c with changes in files: +** 7064b22a25a819f70ab54377d2e6ff3b09d2 with changes in files: ** ** */ @@ -479,7 +479,7 @@ extern "C" { */ #define SQLITE_VERSION "3.48.0" #define SQLITE_VERSION_NUMBER 3048000 -#define SQLITE_SOURCE_ID "2025-02-04 14:03:08 ed11ce7ea423bd7aaa3afc6542ba8463745c430bab7b704f326752501f0961a0" +#define SQLITE_SOURCE_ID "2025-02-06 19:19:14 7064b22a25a819f70ab54377d2e6ff3b09d24eb67618e477d5234e7a16b3bfe2" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -259425,7 +259425,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2025-02-04 14:03:08 ed11ce7ea423bd7aaa3afc6542ba8463745c430bab7b704f326752501f0961a0", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2025-02-06 19:19:14 7064b22a25a819f70ab54377d2e6ff3b09d24eb67618e477d5234e7a16b3bfe2", -1, SQLITE_TRANSIENT); } /* @@ -269889,7 +269889,7 @@ SQLITE_PRIVATE int sqlite3HctBtreeInsert( if( pCur->isLast && seekResult<0 ){ rc = sqlite3HctTreeAppend( pTreeCsr, pCur->pKeyInfo, iKey, nData, aData, nZero - ); + ); }else{ rc = sqlite3HctTreeInsert(pTreeCsr, pRec, iKey, nData, aData, nZero); pCur->isLast = 0; @@ -269946,9 +269946,9 @@ SQLITE_PRIVATE int sqlite3HctBtreeDelete(BtCursor *pCursor, u8 flags){ HBtCursor *const pCur = (HBtCursor*)pCursor; int rc = SQLITE_OK; - /* TODO: If this happens, switch the cursor out of direct write mode - ** before proceeding with the rest of this function. */ - assert( pCur->isDirectWrite==0 ); + /* Switch the cursor out of direct write mode before proceeding with + ** the rest of this function. */ + pCur->isDirectWrite = 0; hctBtreeClearIsLast(pCur->pBtree, 0); if( pCur->pHctDbCsr==0 ){ @@ -269976,9 +269976,9 @@ SQLITE_PRIVATE int sqlite3HctBtreeIdxDelete(BtCursor *pCursor, UnpackedRecord *p HBtCursor *const pCur = (HBtCursor*)pCursor; int rc = SQLITE_OK; - /* TODO: If this happens, switch the cursor out of direct write mode - ** before proceeding with the rest of this function. */ - assert( pCur->isDirectWrite==0 ); + /* Switch the cursor out of direct write mode before proceeding with + ** the rest of this function. */ + pCur->isDirectWrite = 0; hctBtreeClearIsLast(pCur->pBtree, 0); if( pCur->pHctDbCsr ){ @@ -276900,8 +276900,10 @@ static int hctDbCompareKey2( } if( ret==0 ){ /* default_rc==1 if the key has been passed to hctDbDecrementKey() */ +#if 0 assert( pKey1->default_rc==0 || pKey1->default_rc==1 ); assert( p2->pKey->default_rc==0 || p2->pKey->default_rc==1 ); +#endif ret = p2->pKey->default_rc - pKey1->default_rc; } if( ret==0 ){ @@ -277688,7 +277690,6 @@ static void hctDbWriterCleanup(HctDatabase *pDb, HctDbWriter *p, int bRevert){ /* Free/zero various buffers and caches */ hctDbCsrCleanup(&p->writecsr); - hctDbCsrCleanup(&pDb->rbackcsr); p->bDoCleanup = 0; } } @@ -280294,6 +280295,9 @@ SQLITE_PRIVATE int sqlite3HctDbInsert( } insert_done: + if( pDb->eMode==HCT_MODE_ROLLBACK ){ + hctDbCsrCleanup(&pDb->rbackcsr); + } if( pRec ) pRec->nField = nRecField; return rc; } diff --git a/libstuff/sqlite3.h b/libstuff/sqlite3.h index 4e20b7304..8d833b7d3 100644 --- a/libstuff/sqlite3.h +++ b/libstuff/sqlite3.h @@ -148,7 +148,7 @@ extern "C" { */ #define SQLITE_VERSION "3.48.0" #define SQLITE_VERSION_NUMBER 3048000 -#define SQLITE_SOURCE_ID "2025-02-04 14:03:08 ed11ce7ea423bd7aaa3afc6542ba8463745c430bab7b704f326752501f0961a0" +#define SQLITE_SOURCE_ID "2025-02-06 19:19:14 7064b22a25a819f70ab54377d2e6ff3b09d24eb67618e477d5234e7a16b3bfe2" /* ** CAPI3REF: Run-Time Library Version Numbers