mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Remove obsolete assert and testcase macros related to ticket #2565 (CVS 6943)
FossilOrigin-Name: f0024b3189245d608a0cb57fa7e472c6daa1406f
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Adjust\smemory\ssize\scomputations\sto\savoid\sa\sconditional\sthat\sis\salways\nfalse\son\s64-bit\ssystems.\s(CVS\s6942)
|
C Remove\sobsolete\sassert\sand\stestcase\smacros\srelated\sto\sticket\s#2565\s(CVS\s6943)
|
||||||
D 2009-07-25T17:42:22
|
D 2009-07-25T19:31:32
|
||||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||||
F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
|
F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
|
||||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||||
@@ -147,7 +147,7 @@ F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc
|
|||||||
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
|
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
|
||||||
F src/os_unix.c cdb2a08b9ce4aa13b3f7b91d4dd60fb48be9f56a
|
F src/os_unix.c cdb2a08b9ce4aa13b3f7b91d4dd60fb48be9f56a
|
||||||
F src/os_win.c 725c38a524d168ce280446ad8761d731bc516405
|
F src/os_win.c 725c38a524d168ce280446ad8761d731bc516405
|
||||||
F src/pager.c f050740b628e564d10b7269170f7c62e91286a84
|
F src/pager.c a9ce18aaeff8d0db8e3a1ce201403d24a88b5615
|
||||||
F src/pager.h 11852d044c86cf5a9d6e34171fb0c4fcf1f6265f
|
F src/pager.h 11852d044c86cf5a9d6e34171fb0c4fcf1f6265f
|
||||||
F src/parse.y bcd46d43fbd23a22b8c020a3eb1806b794794ed5
|
F src/parse.y bcd46d43fbd23a22b8c020a3eb1806b794794ed5
|
||||||
F src/pcache.c c92ffd4f3e1279b3766854c6d18b5bf4aac0d1fa
|
F src/pcache.c c92ffd4f3e1279b3766854c6d18b5bf4aac0d1fa
|
||||||
@@ -738,7 +738,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
|||||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||||
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
|
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
|
||||||
P 1d931f77519baf3586708c77cbd161c0e75bcbaf
|
P 04211e6af9cdd3e7f19b458c72b722f8f8584245
|
||||||
R 1a0264645a22cb518a2f7e53ba7c8b67
|
R 8adb748dfc821dbb88e17d8c87bfe5b8
|
||||||
U drh
|
U drh
|
||||||
Z 524f3fe5a603b07a7180f1e927937f4d
|
Z f21756b73703ef7299f117f5f2222357
|
||||||
|
@@ -1 +1 @@
|
|||||||
04211e6af9cdd3e7f19b458c72b722f8f8584245
|
f0024b3189245d608a0cb57fa7e472c6daa1406f
|
52
src/pager.c
52
src/pager.c
@@ -18,7 +18,7 @@
|
|||||||
** file simultaneously, or one process from reading the database while
|
** file simultaneously, or one process from reading the database while
|
||||||
** another is writing.
|
** another is writing.
|
||||||
**
|
**
|
||||||
** @(#) $Id: pager.c,v 1.625 2009/07/25 17:39:14 danielk1977 Exp $
|
** @(#) $Id: pager.c,v 1.626 2009/07/25 19:31:32 drh Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef SQLITE_OMIT_DISKIO
|
#ifndef SQLITE_OMIT_DISKIO
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
@@ -1598,46 +1598,6 @@ static int pager_playback_one_page(
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(NDEBUG) || defined(SQLITE_COVERAGE_TEST)
|
|
||||||
/*
|
|
||||||
** This routine looks ahead into the main journal file and determines
|
|
||||||
** whether or not the next record (the record that begins at file
|
|
||||||
** offset pPager->journalOff) is a well-formed page record consisting
|
|
||||||
** of a valid page number, pPage->pageSize bytes of content, followed
|
|
||||||
** by a valid checksum.
|
|
||||||
**
|
|
||||||
** The pager never needs to know this in order to do its job. This
|
|
||||||
** routine is only used from within assert() and testcase() macros.
|
|
||||||
*/
|
|
||||||
static int pagerNextJournalPageIsValid(Pager *pPager){
|
|
||||||
Pgno pgno; /* The page number of the page */
|
|
||||||
u32 cksum; /* The page checksum */
|
|
||||||
int rc; /* Return code from read operations */
|
|
||||||
sqlite3_file *fd; /* The file descriptor from which we are reading */
|
|
||||||
u8 *aData; /* Content of the page */
|
|
||||||
|
|
||||||
/* Read the page number header */
|
|
||||||
fd = pPager->jfd;
|
|
||||||
rc = read32bits(fd, pPager->journalOff, &pgno);
|
|
||||||
if( rc!=SQLITE_OK ){ return 0; } /*NO_TEST*/
|
|
||||||
if( pgno==0 || pgno==PAGER_MJ_PGNO(pPager) ){ return 0; } /*NO_TEST*/
|
|
||||||
if( pgno>(Pgno)pPager->dbSize ){ return 0; } /*NO_TEST*/
|
|
||||||
|
|
||||||
/* Read the checksum */
|
|
||||||
rc = read32bits(fd, pPager->journalOff+pPager->pageSize+4, &cksum);
|
|
||||||
if( rc!=SQLITE_OK ){ return 0; } /*NO_TEST*/
|
|
||||||
|
|
||||||
/* Read the data and verify the checksum */
|
|
||||||
aData = (u8*)pPager->pTmpSpace;
|
|
||||||
rc = sqlite3OsRead(fd, aData, pPager->pageSize, pPager->journalOff+4);
|
|
||||||
if( rc!=SQLITE_OK ){ return 0; } /*NO_TEST*/
|
|
||||||
if( pager_cksum(pPager, aData)!=cksum ){ return 0; } /*NO_TEST*/
|
|
||||||
|
|
||||||
/* Reach this point only if the page is valid */
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
#endif /* !defined(NDEBUG) || defined(SQLITE_COVERAGE_TEST) */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Parameter zMaster is the name of a master journal file. A single journal
|
** Parameter zMaster is the name of a master journal file. A single journal
|
||||||
** file that referred to the master journal file has just been rolled back.
|
** file that referred to the master journal file has just been rolled back.
|
||||||
@@ -1997,11 +1957,6 @@ static int pager_playback(Pager *pPager, int isHot){
|
|||||||
** pages that need to be rolled back and that the number of pages
|
** pages that need to be rolled back and that the number of pages
|
||||||
** should be computed based on the journal file size.
|
** should be computed based on the journal file size.
|
||||||
*/
|
*/
|
||||||
testcase( nRec==0 && !isHot
|
|
||||||
&& pPager->journalHdr+JOURNAL_HDR_SZ(pPager)!=pPager->journalOff
|
|
||||||
&& ((szJ - pPager->journalOff) / JOURNAL_PG_SZ(pPager))>0
|
|
||||||
&& pagerNextJournalPageIsValid(pPager)
|
|
||||||
);
|
|
||||||
if( nRec==0 && !isHot &&
|
if( nRec==0 && !isHot &&
|
||||||
pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff ){
|
pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff ){
|
||||||
nRec = (int)((szJ - pPager->journalOff) / JOURNAL_PG_SZ(pPager));
|
nRec = (int)((szJ - pPager->journalOff) / JOURNAL_PG_SZ(pPager));
|
||||||
@@ -2193,11 +2148,6 @@ static int pagerPlaybackSavepoint(Pager *pPager, PagerSavepoint *pSavepoint){
|
|||||||
** test is related to ticket #2565. See the discussion in the
|
** test is related to ticket #2565. See the discussion in the
|
||||||
** pager_playback() function for additional information.
|
** pager_playback() function for additional information.
|
||||||
*/
|
*/
|
||||||
assert( !(nJRec==0
|
|
||||||
&& pPager->journalHdr+JOURNAL_HDR_SZ(pPager)!=pPager->journalOff
|
|
||||||
&& ((szJ - pPager->journalOff) / JOURNAL_PG_SZ(pPager))>0
|
|
||||||
&& pagerNextJournalPageIsValid(pPager))
|
|
||||||
);
|
|
||||||
if( nJRec==0
|
if( nJRec==0
|
||||||
&& pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff
|
&& pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff
|
||||||
){
|
){
|
||||||
|
Reference in New Issue
Block a user