diff --git a/libstuff/SLog.cpp b/libstuff/SLog.cpp index 0249784ee..4cc571bef 100644 --- a/libstuff/SLog.cpp +++ b/libstuff/SLog.cpp @@ -61,7 +61,9 @@ static const set PARAMS_WHITELIST = { "transactionID", "type", "bankAccountID", - "step" + "status", + "step", + "cardData" }; string addLogParams(string&& message, const map& params) { diff --git a/libstuff/sqlite3.c b/libstuff/sqlite3.c index 3cf1aa995..b4403e43e 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 -** 7dbb43bd307b5e297e6b2deac4e1d73d8cd6. +** 492a0a85438586a8ccd9629239304f4df3f2. */ #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-30 18:24:33 7dbb43bd307b5e297e6b2deac4e1d73d8cd68e37d880a5ecf5a3918a53e99d9d" +#define SQLITE_SOURCE_ID "2024-11-01 15:25:34 492a0a85438586a8ccd9629239304f4df3f2c6391ec05dd9837b7a553313d632" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -17451,20 +17451,34 @@ SQLITE_PRIVATE int sqlite3CursorRangeHintExprCheck(Walker *pWalker, Expr *pExpr) #define COMMIT_TIME_AFTER_FIXUNLOCKED 10 -#define COMMIT_TIME_OSWRITE 11 -#define COMMIT_TIME_AFTER_WALFRAMES 12 +#define COMMIT_TIME_BEFORE_WALFRAMES 11 +#define COMMIT_TIME_AFTER_CHANGECOUNTER 13 +#define COMMIT_TIME_AFTER_RESTARTLOG 14 +#define COMMIT_TIME_AFTER_WRITEHDR 15 -#define COMMIT_TIME_BEFORE_PHASETWO 13 -#define COMMIT_TIME_AFTER_PHASETWO 14 +#define COMMIT_TIME_OSWRITE 16 -#define COMMIT_TIME_AFTER_VDBECOMMIT 15 -#define COMMIT_TIME_AFTER_HALT 16 -#define COMMIT_TIME_FINISH 17 +#define COMMIT_TIME_AFTER_WRITEFRAMES 17 -#define COMMIT_TIME_N 18 +#define COMMIT_TIME_BEFORE_WALINDEX 18 +#define COMMIT_TIME_AFTER_WALINDEX 19 +#define COMMIT_TIME_AFTER_WALINDEXHDR 20 + +#define COMMIT_TIME_WALFRAMESFLAGS 21 + +#define COMMIT_TIME_AFTER_WALFRAMES 22 + +#define COMMIT_TIME_BEFORE_PHASETWO 23 +#define COMMIT_TIME_AFTER_PHASETWO 24 + +#define COMMIT_TIME_AFTER_VDBECOMMIT 25 +#define COMMIT_TIME_AFTER_HALT 26 +#define COMMIT_TIME_FINISH 27 + +#define COMMIT_TIME_N 28 /* #define COMMIT_TIME_TIMEOUT (2*1000*1000) */ -#define COMMIT_TIME_TIMEOUT (0*1000) /* 10ms threshold */ +#define COMMIT_TIME_TIMEOUT (10*1000) /* 10ms threshold */ SQLITE_PRIVATE void sqlite3CommitTimeLog(u64*); SQLITE_PRIVATE u64 sqlite3STimeNow(); @@ -61156,6 +61170,7 @@ static int pagerWalFrames( pPager->aStat[PAGER_STAT_WRITE] += nList; if( pList->pgno==1 ) pager_write_changecounter(pList); + sqlite3CommitTimeSet(pPager->aCommitTime, COMMIT_TIME_AFTER_CHANGECOUNTER); rc = sqlite3WalFrames(pPager->pWal, pPager->pageSize, pList, nTruncate, isCommit, pPager->walSyncFlags ); @@ -64546,6 +64561,7 @@ SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne( } assert( rc==SQLITE_OK ); if( ALWAYS(pList) ){ + sqlite3CommitTimeSet(pPager->aCommitTime, COMMIT_TIME_BEFORE_WALFRAMES); rc = pagerWalFrames(pPager, pList, pPager->dbSize, 1); sqlite3CommitTimeSet(pPager->aCommitTime, COMMIT_TIME_AFTER_WALFRAMES); } @@ -71067,6 +71083,8 @@ static int walFrames( int iApp; int bWal2 = isWalMode2(pWal); + int logFlags = 0; + assert( pList ); assert( pWal->writeLock ); @@ -71087,6 +71105,8 @@ static int walFrames( return rc; } + sqlite3CommitTimeSet(pWal->aCommitTime, COMMIT_TIME_AFTER_RESTARTLOG); + /* If this is the first frame written into the log, write the WAL ** header to the start of the WAL file. See comments at the top of ** this source file for a description of the WAL header format. @@ -71102,6 +71122,7 @@ static int walFrames( } #endif + logFlags |= (iFrame==0 ? 0x01 : 0x00); if( iFrame==0 ){ u32 iCkpt = 0; u8 aWalHdr[WAL_HDRSIZE]; /* Buffer to assemble wal-header in */ @@ -71155,6 +71176,7 @@ static int walFrames( if( (int)pWal->szPage!=szPage ){ return SQLITE_CORRUPT_BKPT; /* TH3 test case: cov1/corrupt155.test */ } + sqlite3CommitTimeSet(pWal->aCommitTime, COMMIT_TIME_AFTER_WRITEHDR); /* Setup information needed to write frames into the WAL */ w.pWal = pWal; @@ -71166,6 +71188,7 @@ static int walFrames( szFrame = szPage + WAL_FRAME_HDRSIZE; /* Write all frames into the log file exactly once */ + logFlags |= (iFirst==0 ? 0x00 : 0x02); for(p=pList; p; p=p->pDirty){ int nDbSize; /* 0 normally. Positive == commit flag */ @@ -71204,8 +71227,10 @@ static int walFrames( p->flags |= PGHDR_WAL_APPEND; } + sqlite3CommitTimeSet(pWal->aCommitTime, COMMIT_TIME_AFTER_WRITEFRAMES); /* Recalculate checksums within the wal file if required. */ + logFlags |= (pWal->iReCksum==0 ? 0x00 : 0x04); if( isCommit && pWal->iReCksum ){ rc = walRewriteChecksums(pWal, iFrame); if( rc ) return rc; @@ -71225,6 +71250,7 @@ static int walFrames( ** sector boundary is synced; the part of the last frame that extends ** past the sector boundary is written after the sync. */ + logFlags |= (WAL_SYNC_FLAGS(sync_flags)==0 ? 0x00 : 0x08); if( isCommit && WAL_SYNC_FLAGS(sync_flags)!=0 ){ int bSync = 1; if( pWal->padToSectorBoundary ){ @@ -71259,6 +71285,8 @@ static int walFrames( pWal->truncateOnCommit = 0; } + sqlite3CommitTimeSet(pWal->aCommitTime, COMMIT_TIME_BEFORE_WALINDEX); + /* Append data to the wal-index. It is not necessary to lock the ** wal-index to do this as the SQLITE_SHM_WRITE lock held on the wal-index ** guarantees that there are no other writers, and no data that may @@ -71277,6 +71305,8 @@ static int walFrames( rc = walIndexAppend(pWal, iApp, iFrame, pLast->pgno); } + sqlite3CommitTimeSet(pWal->aCommitTime, COMMIT_TIME_AFTER_WALINDEX); + if( rc==SQLITE_OK ){ /* Update the private copy of the header. */ pWal->hdr.szPage = (u16)((szPage&0xff00) | (szPage>>16)); @@ -71304,6 +71334,11 @@ static int walFrames( } } + sqlite3CommitTimeSet(pWal->aCommitTime, COMMIT_TIME_AFTER_WALINDEXHDR); + if( pWal->aCommitTime ){ + pWal->aCommitTime[COMMIT_TIME_WALFRAMESFLAGS] = logFlags; + } + WALTRACE(("WAL%p: frame write %s\n", pWal, rc ? "failed" : "ok")); return rc; } @@ -93240,12 +93275,15 @@ SQLITE_PRIVATE void sqlite3CommitTimeLog(u64 *aCommit){ }else if( ii==COMMIT_TIME_OSWRITE ){ iVal = (int)aCommit[ii]; zU = "us"; + }else if( ii==COMMIT_TIME_WALFRAMESFLAGS ){ + iVal = (int)aCommit[ii]; + zHash = "flags="; }else{ iVal = (aCommit[ii]==0 ? 0 : (int)(aCommit[ii] - i1)); } zStr = sqlite3_mprintf("%z%s%s%d%s", zStr, (zStr?", ":""),zHash,iVal,zU); } - sqlite3_log(SQLITE_WARNING, "slow commit (v=7): (%s)", zStr); + sqlite3_log(SQLITE_WARNING, "slow commit (v=8): (%s)", zStr); sqlite3_free(zStr); } } @@ -93273,7 +93311,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=7): (%s) [%.*s]", zStr, nByte, zSql + "slow prepare (v=8): (%s) [%.*s]", zStr, nByte, zSql ); sqlite3_free(zStr); } @@ -93289,7 +93327,7 @@ SQLITE_PRIVATE void sqlite3SchemaTimeLog(u64 *aSchema){ (aSchema[ii]==0 ? 0 : (int)(aSchema[ii] - i1)) ); } - sqlite3_log(SQLITE_WARNING, "slow schema (v=7): (%s)", zStr); + sqlite3_log(SQLITE_WARNING, "slow schema (v=8): (%s)", zStr); sqlite3_free(zStr); } } @@ -257667,7 +257705,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2024-10-30 18:24:33 7dbb43bd307b5e297e6b2deac4e1d73d8cd68e37d880a5ecf5a3918a53e99d9d", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2024-11-01 15:25:34 492a0a85438586a8ccd9629239304f4df3f2c6391ec05dd9837b7a553313d632", -1, SQLITE_TRANSIENT); } /* diff --git a/libstuff/sqlite3.h b/libstuff/sqlite3.h index 2ec68bf2a..90d0bd332 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-30 18:24:33 7dbb43bd307b5e297e6b2deac4e1d73d8cd68e37d880a5ecf5a3918a53e99d9d" +#define SQLITE_SOURCE_ID "2024-11-01 15:25:34 492a0a85438586a8ccd9629239304f4df3f2c6391ec05dd9837b7a553313d632" /* ** CAPI3REF: Run-Time Library Version Numbers