Add some assert() statements to pager.c. (CVS 3811)

FossilOrigin-Name: 973b2a5fb56a1ed1fd10d062edcb6e6dad13f001
This commit is contained in:
danielk1977 2007-04-05 11:54:42 +00:00
parent 7c4ac0c555
commit 5bb16fe41b
3 changed files with 16 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Improvements\sto\scoverage\stesting.\s(CVS\s3810)
D 2007-04-05T11:25:58
C Add\ssome\sassert()\sstatements\sto\spager.c.\s(CVS\s3811)
D 2007-04-05T11:54:43
F Makefile.in 29fbf08ce0989973bfed0b5a052a6bdf3e60fd0a
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -86,7 +86,7 @@ F src/os_unix.c 13c6f73a7b0c2c6c131c97ea26274db101b594cd
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c c9a99524d6b2bdec636264cad1b67553925e3309
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
F src/pager.c c92f45c8784976c058f5508a6fba0c623518206a
F src/pager.c 52f2212429310cb4d2080d36b63d16cc42161a6f
F src/pager.h e79a24cf200b8771366217f5bca414f5b7823f42
F src/parse.y 207ab04273ae13aa4a729b96008d294d5f334ab3
F src/pragma.c 3b992b5b2640d6ae25cef05aa6a42cd1d6c43234
@ -450,7 +450,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P 383a08e26083964e79bfe22156f5f554522fa1fb
R 9a30b7d0568abab990c82d63357a749d
U drh
Z 5b2c71c22b4f98fd786d0cd9d3848570
P 38af156da83a8469080ddb75a9a286be33ff6bef
R 28d04fcd2d61aa62015dffc325fe3e28
U danielk1977
Z df28133608de4a90d3e36cfb35940c5f

View File

@ -1 +1 @@
38af156da83a8469080ddb75a9a286be33ff6bef
973b2a5fb56a1ed1fd10d062edcb6e6dad13f001

View File

@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while
** another is writing.
**
** @(#) $Id: pager.c,v 1.319 2007/04/05 11:25:58 drh Exp $
** @(#) $Id: pager.c,v 1.320 2007/04/05 11:54:43 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
@ -1153,6 +1153,7 @@ static int pager_delmaster(const char *zMaster){
** is running this routine also. Not that it makes too much difference.
*/
rc = sqlite3OsOpenReadOnly(zMaster, &master);
assert( rc!=SQLITE_OK || master );
if( rc!=SQLITE_OK ) goto delmaster_out;
master_open = 1;
rc = sqlite3OsFileSize(master, &nMasterJournal);
@ -1184,6 +1185,7 @@ static int pager_delmaster(const char *zMaster){
int c;
rc = sqlite3OsOpenReadOnly(zJournal, &journal);
assert( rc!=SQLITE_OK || journal );
if( rc!=SQLITE_OK ){
goto delmaster_out;
}
@ -1637,6 +1639,7 @@ static int sqlite3PagerOpentemp(OsFile **pFd){
cnt--;
sqlite3OsTempFileName(zFile);
rc = sqlite3OsOpenExclusive(zFile, pFd, 1);
assert( rc!=SQLITE_OK || *pFd );
}while( cnt>0 && rc!=SQLITE_OK && rc!=SQLITE_NOMEM );
return rc;
}
@ -1707,6 +1710,7 @@ int sqlite3PagerOpen(
zFullPathname = sqlite3OsFullPathname(zFilename);
if( zFullPathname ){
rc = sqlite3OsOpenReadWrite(zFullPathname, &fd, &readOnly);
assert( rc!=SQLITE_OK || fd );
}
}
}else{
@ -2564,6 +2568,7 @@ static int pager_recycle(Pager *pPager, int syncOk, PgHdr **ppPg){
if( pPg->dirty ){
int rc;
assert( pPg->needSync==0 );
assert( !MEMDB );
makeClean(pPg);
pPg->dirty = 1;
pPg->pDirty = 0;
@ -2743,6 +2748,7 @@ static int pagerSharedLock(Pager *pPager){
int ro;
assert( !pPager->tempFile );
rc = sqlite3OsOpenReadWrite(pPager->zJournal, &pPager->jfd, &ro);
assert( rc!=SQLITE_OK || pPager->jfd );
if( ro ){
rc = SQLITE_BUSY;
sqlite3OsClose(&pPager->jfd);
@ -3148,6 +3154,7 @@ static int pager_open_journal(Pager *pPager){
}
rc = sqlite3OsOpenExclusive(pPager->zJournal, &pPager->jfd,
pPager->tempFile);
assert( rc!=SQLITE_OK || pPager->jfd );
pPager->journalOff = 0;
pPager->setMaster = 0;
pPager->journalHdr = 0;