diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbe.c | 20 | ||||
-rw-r--r-- | src/vdbeaux.c | 13 |
2 files changed, 21 insertions, 12 deletions
diff --git a/src/vdbe.c b/src/vdbe.c index 47094e163..08c6bd2ef 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -43,7 +43,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.871 2009/07/14 02:33:02 drh Exp $ +** $Id: vdbe.c,v 1.872 2009/07/14 18:35:45 drh Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -2055,14 +2055,16 @@ case OP_Column: { payloadSize = pC->payloadSize; zRec = (char*)pC->aRow; }else if( pC->isIndex ){ - sqlite3BtreeKeySize(pCrsr, &payloadSize64); + rc = sqlite3BtreeKeySize(pCrsr, &payloadSize64); + assert( rc==SQLITE_OK ); /* True because of CursorMoveto() call above */ /* sqlite3BtreeParseCellPtr() uses getVarint32() to extract the ** payload size, so it is impossible for payloadSize64 to be ** larger than 32 bits. */ assert( (payloadSize64 & SQLITE_MAX_U32)==(u64)payloadSize64 ); payloadSize = (u32)payloadSize64; }else{ - sqlite3BtreeDataSize(pCrsr, &payloadSize); + rc = sqlite3BtreeDataSize(pCrsr, &payloadSize); + assert( rc==SQLITE_OK ); /* True because of CursorMoveto() call above */ } }else if( pC->pseudoTable ){ /* The record is the sole entry of a pseudo-table */ @@ -3591,7 +3593,8 @@ case OP_NewRowid: { /* out2-prerelease */ if( res ){ v = 1; }else{ - sqlite3BtreeKeySize(pC->pCursor, &v); + rc = sqlite3BtreeKeySize(pC->pCursor, &v); + assert( rc==SQLITE_OK ); /* Cannot fail following BtreeLast() */ if( v==MAX_ROWID ){ pC->useRandomRowid = 1; }else{ @@ -3888,13 +3891,15 @@ case OP_RowData: { if( pC->isIndex ){ assert( !pC->isTable ); - sqlite3BtreeKeySize(pCrsr, &n64); + rc = sqlite3BtreeKeySize(pCrsr, &n64); + assert( rc==SQLITE_OK ); /* True because of CursorMoveto() call above */ if( n64>db->aLimit[SQLITE_LIMIT_LENGTH] ){ goto too_big; } n = (u32)n64; }else{ - sqlite3BtreeDataSize(pCrsr, &n); + rc = sqlite3BtreeDataSize(pCrsr, &n); + assert( rc==SQLITE_OK ); /* True because of CursorMoveto() call above */ if( n>(u32)db->aLimit[SQLITE_LIMIT_LENGTH] ){ goto too_big; } @@ -3958,7 +3963,8 @@ case OP_Rowid: { /* out2-prerelease */ if( pC->rowidIsValid ){ v = pC->lastRowid; }else{ - sqlite3BtreeKeySize(pC->pCursor, &v); + rc = sqlite3BtreeKeySize(pC->pCursor, &v); + assert( rc==SQLITE_OK ); /* Always so because of CursorMoveto() above */ } } pOut->u.i = v; diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 9b2ee50cd..381906fa0 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -14,7 +14,7 @@ ** 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. ** -** $Id: vdbeaux.c,v 1.473 2009/07/14 14:15:27 drh Exp $ +** $Id: vdbeaux.c,v 1.474 2009/07/14 18:35:46 drh Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -2593,8 +2593,10 @@ int sqlite3VdbeIdxRowid(sqlite3 *db, BtCursor *pCur, i64 *rowid){ /* Get the size of the index entry. Only indices entries of less ** 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); + ** this code can safely assume that nCellKey is 32-bits + */ + rc = sqlite3BtreeKeySize(pCur, &nCellKey); + assert( rc==SQLITE_OK ); /* pCur is always valid so KeySize cannot fail */ assert( (nCellKey & SQLITE_MAX_U32)==(u64)nCellKey ); /* Read in the complete content of the index entry */ @@ -2669,10 +2671,11 @@ int sqlite3VdbeIdxKeyCompare( BtCursor *pCur = pC->pCursor; Mem m; - sqlite3BtreeKeySize(pCur, &nCellKey); + rc = sqlite3BtreeKeySize(pCur, &nCellKey); + assert( rc==SQLITE_OK ); /* pCur is always valid so KeySize cannot fail */ /* nCellKey will always be between 0 and 0xffffffff because of the say ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ - if( NEVER(nCellKey<=0) || nCellKey>0x7fffffff ){ + if( nCellKey<=0 || nCellKey>0x7fffffff ){ *res = 0; return SQLITE_CORRUPT; } |