Fix the new pager.c changes so that they compile with IOTRACE defined.
Fix an out-of-order variable definition in vdbeaux.c. (CVS 6820) FossilOrigin-Name: ac1450285025e33fad81e2fb14a06eb85e8ed87a
This commit is contained in:
parent
8ca8255325
commit
7b746030bc
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
|||||||
C Another\schange\sto\stest_journal.c\sto\saccount\sfor\s(6817).\sAgain,\sonly\stest\scode\shas\schanged.\s(CVS\s6819)
|
C Fix\sthe\snew\spager.c\schanges\sso\sthat\sthey\scompile\swith\sIOTRACE\sdefined.\nFix\san\sout-of-order\svariable\sdefinition\sin\svdbeaux.c.\s(CVS\s6820)
|
||||||
D 2009-06-26T10:39:36
|
D 2009-06-26T12:15:23
|
||||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||||
F Makefile.in 8b8fb7823264331210cddf103831816c286ba446
|
F Makefile.in 8b8fb7823264331210cddf103831816c286ba446
|
||||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||||
@ -146,7 +146,7 @@ F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc
|
|||||||
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
|
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
|
||||||
F src/os_unix.c b64129c296e480c2827606e206ea51bb30904626
|
F src/os_unix.c b64129c296e480c2827606e206ea51bb30904626
|
||||||
F src/os_win.c 725c38a524d168ce280446ad8761d731bc516405
|
F src/os_win.c 725c38a524d168ce280446ad8761d731bc516405
|
||||||
F src/pager.c aff52317d450d0bdb93699f7213c09f51031c7e8
|
F src/pager.c 04fdbede529dc9f933637301d789dc7354df6e49
|
||||||
F src/pager.h 5aec418bf99f568b92ae82816a1463400513726d
|
F src/pager.h 5aec418bf99f568b92ae82816a1463400513726d
|
||||||
F src/parse.y b6e99f4208a34eb83c62f20dd67f8d9058e86768
|
F src/parse.y b6e99f4208a34eb83c62f20dd67f8d9058e86768
|
||||||
F src/pcache.c 395f752a13574120bd7513a400ba02a265aaa76d
|
F src/pcache.c 395f752a13574120bd7513a400ba02a265aaa76d
|
||||||
@ -207,7 +207,7 @@ F src/vdbe.c e7831536ddb11b14ce29f62a17e0e3860944d570
|
|||||||
F src/vdbe.h 35a648bc3279a120da24f34d9a25213ec15daf8a
|
F src/vdbe.h 35a648bc3279a120da24f34d9a25213ec15daf8a
|
||||||
F src/vdbeInt.h 831c254a6eef237ef4664c8381a0137586567007
|
F src/vdbeInt.h 831c254a6eef237ef4664c8381a0137586567007
|
||||||
F src/vdbeapi.c 0ab8ada7260b32031ca97f338caecf0812460624
|
F src/vdbeapi.c 0ab8ada7260b32031ca97f338caecf0812460624
|
||||||
F src/vdbeaux.c 2801d0183c52e3739abae28b861b4415418e999a
|
F src/vdbeaux.c 569653e18a29904e603542d1e5f8ea6a49ddc2f4
|
||||||
F src/vdbeblob.c c25d7e7bc6d5917feeb17270bd275fa771f26e5c
|
F src/vdbeblob.c c25d7e7bc6d5917feeb17270bd275fa771f26e5c
|
||||||
F src/vdbemem.c 1618f685d19b4bcc96e40b3c478487bafd2ae246
|
F src/vdbemem.c 1618f685d19b4bcc96e40b3c478487bafd2ae246
|
||||||
F src/vtab.c 98fbffc5efe68d8107511dec0a650efc7daa9446
|
F src/vtab.c 98fbffc5efe68d8107511dec0a650efc7daa9446
|
||||||
@ -737,7 +737,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 542ee8cced2a37095808d8baf5002dc66f4a64d6
|
P 58884b6c50f927c5606d857b2865d788a5147060
|
||||||
R c84107e8653fbec4d656c36416c49db0
|
R 9d423933262cfe2d16ec12c135577c04
|
||||||
U danielk1977
|
U drh
|
||||||
Z 3ae5a098ab66146aa838154cfa456687
|
Z 945b9bf3768118a01553819f7e0bb702
|
||||||
|
@ -1 +1 @@
|
|||||||
58884b6c50f927c5606d857b2865d788a5147060
|
ac1450285025e33fad81e2fb14a06eb85e8ed87a
|
20
src/pager.c
20
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.602 2009/06/26 07:12:07 danielk1977 Exp $
|
** @(#) $Id: pager.c,v 1.603 2009/06/26 12:15:23 drh Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef SQLITE_OMIT_DISKIO
|
#ifndef SQLITE_OMIT_DISKIO
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
@ -2764,14 +2764,6 @@ static int syncJournal(Pager *pPager){
|
|||||||
assert( isOpen(pPager->jfd) );
|
assert( isOpen(pPager->jfd) );
|
||||||
|
|
||||||
if( 0==(iDc&SQLITE_IOCAP_SAFE_APPEND) ){
|
if( 0==(iDc&SQLITE_IOCAP_SAFE_APPEND) ){
|
||||||
/* Variable iNRecOffset is set to the offset in the journal file
|
|
||||||
** of the nRec field of the most recently written journal header.
|
|
||||||
** This field will be updated following the xSync() operation
|
|
||||||
** on the journal file. */
|
|
||||||
u8 zHeader[sizeof(aJournalMagic)+4];
|
|
||||||
memcpy(zHeader, aJournalMagic, sizeof(aJournalMagic));
|
|
||||||
put32bits(&zHeader[sizeof(aJournalMagic)], pPager->nRec);
|
|
||||||
|
|
||||||
/* This block deals with an obscure problem. If the last connection
|
/* This block deals with an obscure problem. If the last connection
|
||||||
** that wrote to this database was operating in persistent-journal
|
** that wrote to this database was operating in persistent-journal
|
||||||
** mode, then the journal file may at this point actually be larger
|
** mode, then the journal file may at this point actually be larger
|
||||||
@ -2794,8 +2786,14 @@ static int syncJournal(Pager *pPager){
|
|||||||
** as a temporary buffer to inspect the first couple of bytes of
|
** as a temporary buffer to inspect the first couple of bytes of
|
||||||
** the potential journal header.
|
** the potential journal header.
|
||||||
*/
|
*/
|
||||||
i64 iNextHdrOffset = journalHdrOffset(pPager);
|
i64 iNextHdrOffset;
|
||||||
u8 aMagic[8];
|
u8 aMagic[8];
|
||||||
|
u8 zHeader[sizeof(aJournalMagic)+4];
|
||||||
|
|
||||||
|
memcpy(zHeader, aJournalMagic, sizeof(aJournalMagic));
|
||||||
|
put32bits(&zHeader[sizeof(aJournalMagic)], pPager->nRec);
|
||||||
|
|
||||||
|
iNextHdrOffset = journalHdrOffset(pPager);
|
||||||
rc = sqlite3OsRead(pPager->jfd, aMagic, 8, iNextHdrOffset);
|
rc = sqlite3OsRead(pPager->jfd, aMagic, 8, iNextHdrOffset);
|
||||||
if( rc==SQLITE_OK && 0==memcmp(aMagic, aJournalMagic, 8) ){
|
if( rc==SQLITE_OK && 0==memcmp(aMagic, aJournalMagic, 8) ){
|
||||||
static const u8 zerobyte = 0;
|
static const u8 zerobyte = 0;
|
||||||
@ -2822,7 +2820,7 @@ static int syncJournal(Pager *pPager){
|
|||||||
rc = sqlite3OsSync(pPager->jfd, pPager->sync_flags);
|
rc = sqlite3OsSync(pPager->jfd, pPager->sync_flags);
|
||||||
if( rc!=SQLITE_OK ) return rc;
|
if( rc!=SQLITE_OK ) return rc;
|
||||||
}
|
}
|
||||||
IOTRACE(("JHDR %p %lld %d\n", pPager, iNRecOffset, 4));
|
IOTRACE(("JHDR %p %lld\n", pPager, pPager->journalHdr));
|
||||||
rc = sqlite3OsWrite(
|
rc = sqlite3OsWrite(
|
||||||
pPager->jfd, zHeader, sizeof(zHeader), pPager->journalHdr
|
pPager->jfd, zHeader, sizeof(zHeader), pPager->journalHdr
|
||||||
);
|
);
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
** to version 2.8.7, all this code was combined into the vdbe.c source file.
|
** to version 2.8.7, all this code was combined into the vdbe.c source file.
|
||||||
** But that file was getting too big so this subroutines were split out.
|
** But that file was getting too big so this subroutines were split out.
|
||||||
**
|
**
|
||||||
** $Id: vdbeaux.c,v 1.464 2009/06/23 14:15:04 drh Exp $
|
** $Id: vdbeaux.c,v 1.465 2009/06/26 12:15:23 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include "vdbeInt.h"
|
#include "vdbeInt.h"
|
||||||
@ -350,7 +350,7 @@ int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp){
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
addr = p->nOp;
|
addr = p->nOp;
|
||||||
if( nOp>0 ){
|
if( ALWAYS(nOp>0) ){
|
||||||
int i;
|
int i;
|
||||||
VdbeOpList const *pIn = aOp;
|
VdbeOpList const *pIn = aOp;
|
||||||
for(i=0; i<nOp; i++, pIn++){
|
for(i=0; i<nOp; i++, pIn++){
|
||||||
@ -386,8 +386,9 @@ int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp){
|
|||||||
** few minor changes to the program.
|
** few minor changes to the program.
|
||||||
*/
|
*/
|
||||||
void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){
|
void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){
|
||||||
assert( p==0 || p->magic==VDBE_MAGIC_INIT );
|
assert( p!=0 );
|
||||||
if( p && addr>=0 && p->nOp>addr && p->aOp ){
|
assert( addr>=0 );
|
||||||
|
if( p->nOp>addr ){
|
||||||
p->aOp[addr].p1 = val;
|
p->aOp[addr].p1 = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -397,8 +398,9 @@ void sqlite3VdbeChangeP1(Vdbe *p, int addr, int val){
|
|||||||
** This routine is useful for setting a jump destination.
|
** This routine is useful for setting a jump destination.
|
||||||
*/
|
*/
|
||||||
void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){
|
void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){
|
||||||
assert( p==0 || p->magic==VDBE_MAGIC_INIT );
|
assert( p!=0 );
|
||||||
if( p && addr>=0 && p->nOp>addr && p->aOp ){
|
assert( addr>=0 );
|
||||||
|
if( p->nOp>addr ){
|
||||||
p->aOp[addr].p2 = val;
|
p->aOp[addr].p2 = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -407,8 +409,9 @@ void sqlite3VdbeChangeP2(Vdbe *p, int addr, int val){
|
|||||||
** Change the value of the P3 operand for a specific instruction.
|
** Change the value of the P3 operand for a specific instruction.
|
||||||
*/
|
*/
|
||||||
void sqlite3VdbeChangeP3(Vdbe *p, int addr, int val){
|
void sqlite3VdbeChangeP3(Vdbe *p, int addr, int val){
|
||||||
assert( p==0 || p->magic==VDBE_MAGIC_INIT );
|
assert( p!=0 );
|
||||||
if( p && addr>=0 && p->nOp>addr && p->aOp ){
|
assert( addr>=0 );
|
||||||
|
if( p->nOp>addr ){
|
||||||
p->aOp[addr].p3 = val;
|
p->aOp[addr].p3 = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -418,8 +421,8 @@ void sqlite3VdbeChangeP3(Vdbe *p, int addr, int val){
|
|||||||
** added operation.
|
** added operation.
|
||||||
*/
|
*/
|
||||||
void sqlite3VdbeChangeP5(Vdbe *p, u8 val){
|
void sqlite3VdbeChangeP5(Vdbe *p, u8 val){
|
||||||
assert( p==0 || p->magic==VDBE_MAGIC_INIT );
|
assert( p!=0 );
|
||||||
if( p && p->aOp ){
|
if( p->aOp ){
|
||||||
assert( p->nOp>0 );
|
assert( p->nOp>0 );
|
||||||
p->aOp[p->nOp-1].p5 = val;
|
p->aOp[p->nOp-1].p5 = val;
|
||||||
}
|
}
|
||||||
@ -439,7 +442,7 @@ void sqlite3VdbeJumpHere(Vdbe *p, int addr){
|
|||||||
** the FuncDef is not ephermal, then do nothing.
|
** the FuncDef is not ephermal, then do nothing.
|
||||||
*/
|
*/
|
||||||
static void freeEphemeralFunction(sqlite3 *db, FuncDef *pDef){
|
static void freeEphemeralFunction(sqlite3 *db, FuncDef *pDef){
|
||||||
if( pDef && (pDef->flags & SQLITE_FUNC_EPHEM)!=0 ){
|
if( ALWAYS(pDef) && (pDef->flags & SQLITE_FUNC_EPHEM)!=0 ){
|
||||||
sqlite3DbFree(db, pDef);
|
sqlite3DbFree(db, pDef);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -484,7 +487,7 @@ static void freeP4(sqlite3 *db, int p4type, void *p4){
|
|||||||
** Change N opcodes starting at addr to No-ops.
|
** Change N opcodes starting at addr to No-ops.
|
||||||
*/
|
*/
|
||||||
void sqlite3VdbeChangeToNoop(Vdbe *p, int addr, int N){
|
void sqlite3VdbeChangeToNoop(Vdbe *p, int addr, int N){
|
||||||
if( p && p->aOp ){
|
if( p->aOp ){
|
||||||
VdbeOp *pOp = &p->aOp[addr];
|
VdbeOp *pOp = &p->aOp[addr];
|
||||||
sqlite3 *db = p->db;
|
sqlite3 *db = p->db;
|
||||||
while( N-- ){
|
while( N-- ){
|
||||||
@ -533,10 +536,10 @@ void sqlite3VdbeChangeP4(Vdbe *p, int addr, const char *zP4, int n){
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
assert( p->nOp>0 );
|
||||||
assert( addr<p->nOp );
|
assert( addr<p->nOp );
|
||||||
if( addr<0 ){
|
if( addr<0 ){
|
||||||
addr = p->nOp - 1;
|
addr = p->nOp - 1;
|
||||||
if( addr<0 ) return;
|
|
||||||
}
|
}
|
||||||
pOp = &p->aOp[addr];
|
pOp = &p->aOp[addr];
|
||||||
freeP4(db, pOp->p4type, pOp->p4.p);
|
freeP4(db, pOp->p4type, pOp->p4.p);
|
||||||
@ -2438,23 +2441,22 @@ UnpackedRecord *sqlite3VdbeRecordUnpack(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** This routine destroys a UnpackedRecord object
|
** This routine destroys a UnpackedRecord object.
|
||||||
*/
|
*/
|
||||||
void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord *p){
|
void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord *p){
|
||||||
if( p ){
|
int i;
|
||||||
if( p->flags & UNPACKED_NEED_DESTROY ){
|
Mem *pMem;
|
||||||
int i;
|
|
||||||
Mem *pMem;
|
assert( p!=0 );
|
||||||
for(i=0, pMem=p->aMem; i<p->nField; i++, pMem++){
|
assert( p->flags & UNPACKED_NEED_DESTROY );
|
||||||
if( pMem->zMalloc ){
|
for(i=0, pMem=p->aMem; i<p->nField; i++, pMem++){
|
||||||
sqlite3VdbeMemRelease(pMem);
|
if( pMem->zMalloc ){
|
||||||
}
|
sqlite3VdbeMemRelease(pMem);
|
||||||
}
|
|
||||||
}
|
|
||||||
if( p->flags & UNPACKED_NEED_FREE ){
|
|
||||||
sqlite3DbFree(p->pKeyInfo->db, p);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if( p->flags & UNPACKED_NEED_FREE ){
|
||||||
|
sqlite3DbFree(p->pKeyInfo->db, p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2586,11 +2588,11 @@ int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){
|
|||||||
Mem m, v;
|
Mem m, v;
|
||||||
|
|
||||||
/* Get the size of the index entry. Only indices entries of less
|
/* Get the size of the index entry. Only indices entries of less
|
||||||
** than 2GiB are support - anything large must be database corruption */
|
** than 2GiB are support - anything large must be database corruption.
|
||||||
|
** Any corruption is detected in sqlite3BtreeParseCellPtr(), though, so
|
||||||
|
** this code can safely assume that nCellKey is 32-bits */
|
||||||
sqlite3BtreeKeySize(pCur, &nCellKey);
|
sqlite3BtreeKeySize(pCur, &nCellKey);
|
||||||
if( unlikely(nCellKey<=0 || nCellKey>0x7fffffff) ){
|
assert( (nCellKey & SQLITE_MAX_U32)==(u64)nCellKey );
|
||||||
return SQLITE_CORRUPT_BKPT;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Read in the complete content of the index entry */
|
/* Read in the complete content of the index entry */
|
||||||
m.flags = 0;
|
m.flags = 0;
|
||||||
@ -2603,9 +2605,9 @@ int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){
|
|||||||
|
|
||||||
/* The index entry must begin with a header size */
|
/* The index entry must begin with a header size */
|
||||||
(void)getVarint32((u8*)m.z, szHdr);
|
(void)getVarint32((u8*)m.z, szHdr);
|
||||||
testcase( szHdr==2 );
|
testcase( szHdr==3 );
|
||||||
testcase( szHdr==m.n );
|
testcase( szHdr==m.n );
|
||||||
if( unlikely(szHdr<2 || (int)szHdr>m.n) ){
|
if( unlikely(szHdr<3 || (int)szHdr>m.n) ){
|
||||||
goto idx_rowid_corruption;
|
goto idx_rowid_corruption;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user