mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
When using a temporary file for a statement journal, store the first 64KiB in memory. If the file grows larger than that, flush it to disk and free the memory. Hardcoding to 64KiB is just an experiment to check that the memjournal.c code works.
FossilOrigin-Name: 44b2dc18e200e87cf062cb8f1659727c53fa36e9
This commit is contained in:
@@ -4355,11 +4355,14 @@ static int pager_write_pagelist(Pager *pPager, PgHdr *pList){
|
||||
static int openSubJournal(Pager *pPager){
|
||||
int rc = SQLITE_OK;
|
||||
if( !isOpen(pPager->sjfd) ){
|
||||
const int flags = SQLITE_OPEN_SUBJOURNAL | SQLITE_OPEN_READWRITE
|
||||
| SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE
|
||||
| SQLITE_OPEN_DELETEONCLOSE;
|
||||
int nBuf = 64*1024;
|
||||
if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){
|
||||
sqlite3MemJournalOpen(pPager->sjfd);
|
||||
}else{
|
||||
rc = pagerOpentemp(pPager, pPager->sjfd, SQLITE_OPEN_SUBJOURNAL);
|
||||
nBuf = -1;
|
||||
}
|
||||
rc = sqlite3JournalOpen(pPager->pVfs, 0, pPager->sjfd, flags, nBuf);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
Reference in New Issue
Block a user