-C When\san\sOOM\sfault\soccurs\swhile\smoving\sa\spage\sfor\sautovacuum\sin\san\sin-memory\ndatabase,\sbe\ssure\sto\sundo\sthe\spage\smove\sprior\sto\sreturning\sthe\serror,\sto\navoid\scorrupting\sthe\sin-memory\sdatabase\sfile.\s(CVS\s6883)
-D 2009-07-12T02:31:37
+C Simplifications\sto\sbtree.c\sto\shelp\sfacilitate\scoverage\stesting.\s(CVS\s6884)
+D 2009-07-12T02:32:22
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/backup.c 6f1c2d9862c8a3feb7739dfcca02c1f5352e37f3
F src/bitvec.c 0ef0651714728055d43de7a4cdd95e703fac0119
F src/btmutex.c 9b899c0d8df3bd68f527b0afe03088321b696d3c
-F src/btree.c e1ad67c98aeaafdeba37aef45ce1fbbe9416dacf
+F src/btree.c 46f5eb09a9dc3af84d04c18f0feea3384fecca58
F src/btree.h e53a10fd31d16c60a86f03c9467a6f470aa3683b
F src/btreeInt.h a568bf057aa249eb06fd31358b4393a5ac88c118
F src/build.c 867028ee9f63f7bc8eb8d4a720bb98cf9b9a12b4
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
-P 7deb6568d89335926b77336756837c6dc3985529
-R 186b1819a0d45400cca179251342930e
+P d0964b93669123e228e7ce1890167447c56753b5
+R d0eba16ee5dd731fa989e1879da4fe61
U drh
-Z 012114440579d3a3fa4fe565db859264
+Z 9f7075b3d43334c92c2eb775093c9546
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btree.c,v 1.681 2009/07/11 18:26:29 drh Exp $
+** $Id: btree.c,v 1.682 2009/07/12 02:32:22 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
** A total of "amt" bytes are read or written beginning at "offset".
** Data is read to or from the buffer pBuf.
**
-** This routine does not make a distinction between key and data.
-** It just reads or writes bytes from the payload area. Data might
-** appear on the main page or be scattered out on multiple overflow
-** pages.
+** The content being read or written might appear on the main page
+** or be scattered out on multiple overflow pages.
**
** If the BtCursor.isIncrblobHandle flag is set, and the current
** cursor entry uses one or more overflow pages, this function
aPayload = pCur->info.pCell + pCur->info.nHeader;
nKey = (pPage->intKey ? 0 : (int)pCur->info.nKey);
- if( offset+amt > nKey+pCur->info.nData
+ if( NEVER(offset+amt > nKey+pCur->info.nData)
|| &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize]
){
/* Trying to read or write past the end of the data is an error */
if( pCur->isIncrblobHandle && !pCur->aOverflow ){
int nOvfl = (pCur->info.nPayload-pCur->info.nLocal+ovflSize-1)/ovflSize;
pCur->aOverflow = (Pgno *)sqlite3MallocZero(sizeof(Pgno)*nOvfl);
- if( nOvfl && !pCur->aOverflow ){
+ /* nOvfl is always positive. If it were zero, fetchPayload would have
+ ** been used instead of this routine. */
+ if( ALWAYS(nOvfl) && !pCur->aOverflow ){
rc = SQLITE_NOMEM;
}
}