From 78b3a456af0340af1ae564b808c66988de6d0177 Mon Sep 17 00:00:00 2001 From: Florent De Neve Date: Mon, 28 Oct 2024 10:09:49 -0400 Subject: [PATCH] SQLite lib update: logging v6 and small COMMIT optimization --- libstuff/sqlite3.c | 20 +++++++++++++------- libstuff/sqlite3.h | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/libstuff/sqlite3.c b/libstuff/sqlite3.c index d1ea11202..6463af945 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 -** 9cafae1fff34ff45772910d6f2a19d08038e. +** af4e778bd3bdf30cac3d9a6266f105a8cd71. */ #define SQLITE_CORE 1 #define SQLITE_AMALGAMATION 1 @@ -465,7 +465,7 @@ extern "C" { */ #define SQLITE_VERSION "3.47.0" #define SQLITE_VERSION_NUMBER 3047000 -#define SQLITE_SOURCE_ID "2024-10-23 17:16:59 9cafae1fff34ff45772910d6f2a19d08038edea4327234f577f6da30e5baa558" +#define SQLITE_SOURCE_ID "2024-10-25 18:37:00 af4e778bd3bdf30cac3d9a6266f105a8cd71f947b8d71249ef74b8fdc0505dd7" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -56996,7 +56996,13 @@ static void pcache1Unpin( assert( PAGE_IS_PINNED(pPage) ); if( reuseUnlikely || pGroup->nPurgeable>pGroup->nMaxPage ){ + /* If pcache1.separateCache is set, temporarily set the isBulkLocal flag + ** so that pcache1RemoveFromHash() moves the page buffer to the pFree + ** list instead of sqlite3_free()ing it. */ + u16 isBulkLocal = pPage->isBulkLocal; + pPage->isBulkLocal = (u16)pcache1.separateCache; pcache1RemoveFromHash(pPage, 1); + pPage->isBulkLocal = isBulkLocal; }else{ /* Add the page to the PGroup LRU list. */ PgHdr1 **ppFirst = &pGroup->lru.pLruNext; @@ -77459,7 +77465,7 @@ static int btreeFixUnlocked(Btree *p){ if( p->pBt->aCommitTime ){ p->pBt->aCommitTime[COMMIT_TIME_OTHERWRITERS] = (1+nHPage-pMap->iFirst); p->pBt->aCommitTime[COMMIT_TIME_RELOCATE1COUNT] = (1+iLast-pMap->iFirst); - p->pBt->aCommitTime[COMMIT_TIME_RELOCATE2COUNT] = (nFin - nCurrent); + p->pBt->aCommitTime[COMMIT_TIME_RELOCATE2COUNT] = (nCurrent - nFin); } sqlite3CommitTimeSet( p->pBt->aCommitTime, COMMIT_TIME_START_RELOCATE2 @@ -93226,7 +93232,7 @@ SQLITE_PRIVATE void sqlite3CommitTimeLog(u64 *aCommit){ } zStr = sqlite3_mprintf("%z%s%s%d", zStr, (zStr?", ":""), zHash, iVal); } - sqlite3_log(SQLITE_WARNING, "slow commit (v=5): (%s)", zStr); + sqlite3_log(SQLITE_WARNING, "slow commit (v=6): (%s)", zStr); sqlite3_free(zStr); } } @@ -93254,7 +93260,7 @@ SQLITE_PRIVATE void sqlite3PrepareTimeLog(const char *zSql, int nSql, u64 *aPrep } if( nByte<0 ){ nByte = sqlite3Strlen30(zSql); } sqlite3_log(SQLITE_WARNING, - "slow prepare (v=5): (%s) [%.*s]", zStr, nByte, zSql + "slow prepare (v=6): (%s) [%.*s]", zStr, nByte, zSql ); sqlite3_free(zStr); } @@ -93270,7 +93276,7 @@ SQLITE_PRIVATE void sqlite3SchemaTimeLog(u64 *aSchema){ (aSchema[ii]==0 ? 0 : (int)(aSchema[ii] - i1)) ); } - sqlite3_log(SQLITE_WARNING, "slow schema (v=5): (%s)", zStr); + sqlite3_log(SQLITE_WARNING, "slow schema (v=6): (%s)", zStr); sqlite3_free(zStr); } } @@ -257648,7 +257654,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2024-10-23 17:16:59 9cafae1fff34ff45772910d6f2a19d08038edea4327234f577f6da30e5baa558", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2024-10-25 18:37:00 af4e778bd3bdf30cac3d9a6266f105a8cd71f947b8d71249ef74b8fdc0505dd7", -1, SQLITE_TRANSIENT); } /* diff --git a/libstuff/sqlite3.h b/libstuff/sqlite3.h index c885a5117..31cca2d6b 100644 --- a/libstuff/sqlite3.h +++ b/libstuff/sqlite3.h @@ -148,7 +148,7 @@ extern "C" { */ #define SQLITE_VERSION "3.47.0" #define SQLITE_VERSION_NUMBER 3047000 -#define SQLITE_SOURCE_ID "2024-10-23 17:16:59 9cafae1fff34ff45772910d6f2a19d08038edea4327234f577f6da30e5baa558" +#define SQLITE_SOURCE_ID "2024-10-25 18:37:00 af4e778bd3bdf30cac3d9a6266f105a8cd71f947b8d71249ef74b8fdc0505dd7" /* ** CAPI3REF: Run-Time Library Version Numbers