mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-19 21:43:15 +03:00
Fix a couple of problems in test file test_journal.c that were causing segfaults when running all.test. (CVS 6063)
FossilOrigin-Name: 416c9efb49ba207a9a79d06d0b13854695a8876c
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
** b) the page was not a free-list leaf page when the transaction was
|
||||
** first opened.
|
||||
**
|
||||
** $Id: test_journal.c,v 1.2 2008/12/22 10:58:46 danielk1977 Exp $
|
||||
** $Id: test_journal.c,v 1.3 2008/12/24 09:30:22 danielk1977 Exp $
|
||||
*/
|
||||
#if SQLITE_TEST /* This file is used for testing only */
|
||||
|
||||
@@ -327,7 +327,9 @@ static int readJournalFile(jt_file *p, jt_file *pMain){
|
||||
if( rc==SQLITE_OK ){
|
||||
pgno = decodeUint32(zBuf);
|
||||
iOff += (8 + pMain->nPagesize);
|
||||
sqlite3BitvecSet(pMain->pWritable, pgno);
|
||||
if( pgno>0 && pgno<=pMain->nPage ){
|
||||
sqlite3BitvecSet(pMain->pWritable, pgno);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,8 +448,10 @@ static int jtOpen(
|
||||
int rc;
|
||||
jt_file *p = (jt_file *)pFile;
|
||||
p->pReal = (sqlite3_file *)&p[1];
|
||||
p->pReal->pMethods = 0;
|
||||
rc = sqlite3OsOpen(g.pVfs, zName, p->pReal, flags, pOutFlags);
|
||||
if( p->pReal->pMethods ){
|
||||
assert( rc==SQLITE_OK || p->pReal->pMethods==0 );
|
||||
if( rc==SQLITE_OK ){
|
||||
pFile->pMethods = &jt_io_methods;
|
||||
p->eLock = 0;
|
||||
p->zName = zName;
|
||||
|
||||
Reference in New Issue
Block a user