Skip to content

Commit

Permalink
Merge pull request #1959 from Expensify/main
Browse files Browse the repository at this point in the history
Update expensify_prod branch
  • Loading branch information
chiragsalian authored Nov 13, 2024
2 parents 01705a8 + aacf147 commit c458866
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
33 changes: 24 additions & 9 deletions libstuff/sqlite3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
** 3a45387a09398db8efdb2b6ecd773fa30970.
** 35aa893d4537d0b3605084a1f2f5529794e8.
*/
#define SQLITE_CORE 1
#define SQLITE_AMALGAMATION 1
Expand Down Expand Up @@ -465,7 +465,7 @@ extern "C" {
*/
#define SQLITE_VERSION "3.47.0"
#define SQLITE_VERSION_NUMBER 3047000
#define SQLITE_SOURCE_ID "2024-11-08 17:09:34 3a45387a09398db8efdb2b6ecd773fa30970e61e5242823e04a2e968d1c93c10"
#define SQLITE_SOURCE_ID "2024-11-13 14:42:32 35aa893d4537d0b3605084a1f2f5529794e82af59b8893053815d3fcb4719a27"

/*
** CAPI3REF: Run-Time Library Version Numbers
Expand Down Expand Up @@ -32978,7 +32978,7 @@ SQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){
*/
static void renderLogMsg(int iErrCode, const char *zFormat, va_list ap){
StrAccum acc; /* String accumulator */
char zMsg[SQLITE_PRINT_BUF_SIZE*3]; /* Complete log message */
char zMsg[SQLITE_PRINT_BUF_SIZE*10]; /* Complete log message */

sqlite3StrAccumInit(&acc, 0, zMsg, sizeof(zMsg), 0);
sqlite3_str_vappendf(&acc, zFormat, ap);
Expand Down Expand Up @@ -66989,6 +66989,7 @@ static int walIndexPage(
if( pWal->aCommitTime ){
pWal->aCommitTime[COMMIT_TIME_HASHMAPUS] += sqlite3STimeNow() - t1;
}
return rc;
}
return SQLITE_OK;
}
Expand Down Expand Up @@ -77440,10 +77441,24 @@ static int btreeRelocateRange(
pBt->aCommitTime[COMMIT_TIME_RELOCATE2_RELOCATEUS] += (sqlite3STimeNow() - t1);
}
releasePageNotNull(pPg);
}else{
}else if( pEntry->eType!=0 ){
u64 t1;
if( pBt->aCommitTime ) t1 = sqlite3STimeNow();
rc = allocateBtreePage(pBt, &pFree, &iNew, iFirst-1, BTALLOC_LE);

/* Allocate a new page from the free-list to move page iPg to.
** Except - if the page allocated is within the range being relocated
** (i.e. pgno>=iFirst), then discard it and allocate another. */
do {
rc = allocateBtreePage(pBt, &pFree, &iNew, 0, 0);
if( iNew>=iFirst ){
assert( sqlite3PagerPageRefcount(pFree->pDbPage)==1 );
assert( iNew>iPg );
sqlite3PcacheDrop(pFree->pDbPage);
pMap->aPtr[iNew - pMap->iFirst].eType = 0;
pFree = 0;
}
}while( pFree==0 );

if( pBt->aCommitTime ){
pBt->aCommitTime[COMMIT_TIME_RELOCATE2_ALLOCATEUS] += (sqlite3STimeNow() - t1);
}
Expand Down Expand Up @@ -93336,7 +93351,7 @@ SQLITE_PRIVATE void sqlite3CommitTimeLog(u64 *aCommit){
}
zStr = sqlite3_mprintf("%z%s%s%d%s", zStr, (zStr?", ":""),zHash,iVal,zU);
}
sqlite3_log(SQLITE_WARNING, "slow commit (v=9): (%s)", zStr);
sqlite3_log(SQLITE_WARNING, "slow commit (v=10): (%s)", zStr);
sqlite3_free(zStr);
}
}
Expand Down Expand Up @@ -93364,7 +93379,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=9): (%s) [%.*s]", zStr, nByte, zSql
"slow prepare (v=10): (%s) [%.*s]", zStr, nByte, zSql
);
sqlite3_free(zStr);
}
Expand All @@ -93380,7 +93395,7 @@ SQLITE_PRIVATE void sqlite3SchemaTimeLog(u64 *aSchema){
(aSchema[ii]==0 ? 0 : (int)(aSchema[ii] - i1))
);
}
sqlite3_log(SQLITE_WARNING, "slow schema (v=9): (%s)", zStr);
sqlite3_log(SQLITE_WARNING, "slow schema (v=10): (%s)", zStr);
sqlite3_free(zStr);
}
}
Expand Down Expand Up @@ -257758,7 +257773,7 @@ static void fts5SourceIdFunc(
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
sqlite3_result_text(pCtx, "fts5: 2024-11-08 17:09:34 3a45387a09398db8efdb2b6ecd773fa30970e61e5242823e04a2e968d1c93c10", -1, SQLITE_TRANSIENT);
sqlite3_result_text(pCtx, "fts5: 2024-11-13 14:42:32 35aa893d4537d0b3605084a1f2f5529794e82af59b8893053815d3fcb4719a27", -1, SQLITE_TRANSIENT);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion libstuff/sqlite3.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ extern "C" {
*/
#define SQLITE_VERSION "3.47.0"
#define SQLITE_VERSION_NUMBER 3047000
#define SQLITE_SOURCE_ID "2024-11-08 17:09:34 3a45387a09398db8efdb2b6ecd773fa30970e61e5242823e04a2e968d1c93c10"
#define SQLITE_SOURCE_ID "2024-11-13 14:42:32 35aa893d4537d0b3605084a1f2f5529794e82af59b8893053815d3fcb4719a27"

/*
** CAPI3REF: Run-Time Library Version Numbers
Expand Down

0 comments on commit c458866

Please sign in to comment.