1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Ignore malloc failures within the WAL file truncation attempt for

journal_size_limit.

FossilOrigin-Name: dd19105aa9521ffc0edcf16b84c064d5ebad55d7
This commit is contained in:
drh
2011-05-25 20:25:10 +00:00
parent 2cac2078f6
commit ef05c39d12
3 changed files with 10 additions and 8 deletions

View File

@@ -2539,10 +2539,12 @@ static int walRestartLog(Wal *pWal){
if( pWal->mxWalSize>=0 ){
i64 sz;
int rx;
sqlite3BeginBenignMalloc();
rx = sqlite3OsFileSize(pWal->pWalFd, &sz);
if( rx==SQLITE_OK && (sz > pWal->mxWalSize) ){
rx = sqlite3OsTruncate(pWal->pWalFd, pWal->mxWalSize);
}
sqlite3EndBenignMalloc();
if( rx ){
sqlite3_log(rx, "cannot limit WAL size: %s", pWal->zWalName);
}