1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Enhance WAL mode so that the WAL file honors the journal size limit set

by PRAGMA journal_size_limit.

FossilOrigin-Name: db7e500f69faf1906a84991ba67d26a195f02ae5
This commit is contained in:
drh
2011-05-16 21:00:27 +00:00
parent 99a66928c2
commit 85a8375580
6 changed files with 162 additions and 11 deletions

View File

@@ -6607,6 +6607,7 @@ int sqlite3PagerOkToChangeJournalMode(Pager *pPager){
i64 sqlite3PagerJournalSizeLimit(Pager *pPager, i64 iLimit){
if( iLimit>=-1 ){
pPager->journalSizeLimit = iLimit;
sqlite3WalLimit(pPager->pWal, iLimit);
}
return pPager->journalSizeLimit;
}
@@ -6698,7 +6699,8 @@ static int pagerOpenWal(Pager *pPager){
*/
if( rc==SQLITE_OK ){
rc = sqlite3WalOpen(pPager->pVfs,
pPager->fd, pPager->zWal, pPager->exclusiveMode, &pPager->pWal
pPager->fd, pPager->zWal, pPager->exclusiveMode,
pPager->journalSizeLimit, &pPager->pWal
);
}