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

Add the OpenReadOnly() OS method to fix a bug in the pager. (CVS 257)

FossilOrigin-Name: 82db5456c9817283d725daf4e1081d32a71466ad
This commit is contained in:
drh
2001-09-19 13:58:43 +00:00
parent 8cfbf08ffa
commit 474d3d6156
5 changed files with 49 additions and 22 deletions

View File

@@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while
** another is writing.
**
** @(#) $Id: pager.c,v 1.22 2001/09/19 13:22:40 drh Exp $
** @(#) $Id: pager.c,v 1.23 2001/09/19 13:58:44 drh Exp $
*/
#include "sqliteInt.h"
#include "pager.h"
@@ -636,12 +636,12 @@ int sqlitepager_get(Pager *pPager, Pgno pgno, void **ppPage){
/* If a journal file exists, try to play it back.
*/
if( sqliteOsFileExists(pPager->zJournal) ){
int rc, readOnly;
int rc;
/* Open the journal for exclusive access. Return SQLITE_BUSY if
** we cannot get exclusive access to the journal file
*/
rc = sqliteOsOpenReadWrite(pPager->zJournal, &pPager->jfd, &readOnly);
rc = sqliteOsOpenReadOnly(pPager->zJournal, &pPager->jfd);
if( rc==SQLITE_OK ){
pPager->journalOpen = 1;
}