-C Fix\ssome\sproblems\sin\sthe\scrash-test\sbackend.\s(CVS\s4256)
-D 2007-08-21T13:07:47
+C Avoid\sjournalling\san\sextra\spage\swhen\sa\sbtree\sinsert\soperation\suses\sthe\s'quick-balance'\strick.\s(CVS\s4257)
+D 2007-08-21T13:11:01
F Makefile.in 0c0e53720f658c7a551046442dd7afba0b72bfbe
F Makefile.linux-gcc 65241babba6faf1152bf86574477baab19190499
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
F src/analyze.c a14237d869c6bea0846493b59317e4097e81a0b6
F src/attach.c a52225c75b107be8c5bc144a2b6d20201be3f8f8
F src/auth.c 5ea90bc93dfea46e9fe4bf531e14c7cd98219ecb
-F src/btree.c 9460e9ad37b39f4d397b6207f25814e8dd4db6e9
+F src/btree.c 8e529f390d8d1d83acbaf13cb1c09da8361cf5b1
F src/btree.h 525105564c87111922412368f2e4301c36e74ac1
F src/btreeInt.h e93edf57832278138b98cf60cbc54241103c6988
F src/build.c add67be992307b4b11849a6611bfd3352aacde92
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P fbbd5bda544ffec4e1b43407b12e546235dc7873
-R 0ca0858c81f7f856c15261fd84ff79c4
+P 5bced2392ad77aff0aa1ddea83f2ff9e3ffe28a8
+R 62bf9d7ba713afd09c97220ab74284f7
U danielk1977
-Z d922b4212f9baf5077c8cc76317915f9
+Z b65c4a9665c9f568889e6d02dbdc7083
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btree.c,v 1.404 2007/08/20 23:50:25 drh Exp $
+** $Id: btree.c,v 1.405 2007/08/21 13:11:01 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
assert( i>=0 && i<=pPage->nCell+pPage->nOverflow );
assert( sz==cellSizePtr(pPage, pCell) );
- assert( sqlite3PagerIswriteable(pPage->pDbPage) );
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
if( pPage->nOverflow || sz+2>pPage->nFree ){
if( pTemp ){
pPage->aOvfl[j].idx = i;
pPage->nFree = 0;
}else{
+ int rc = sqlite3PagerWrite(pPage->pDbPage);
+ if( rc!=SQLITE_OK ){
+ return rc;
+ }
+ assert( sqlite3PagerIswriteable(pPage->pDbPage) );
data = pPage->aData;
hdr = pPage->hdrOffset;
top = get2byte(&data[hdr+5]);
end = cellOffset + 2*pPage->nCell + 2;
ins = cellOffset + 2*i;
if( end > top - sz ){
- int rc = defragmentPage(pPage);
+ rc = defragmentPage(pPage);
if( rc!=SQLITE_OK ) return rc;
top = get2byte(&data[hdr+5]);
assert( end + sz <= top );
assert( (info.nData+(pPage->intKey?0:info.nKey))==info.nPayload );
if( (info.nData+(pPage->intKey?0:info.nKey))>info.nLocal ){
Pgno pgnoOvfl = get4byte(&pCell[info.iOverflow]);
- int rc = ptrmapPut(pPage->pBt, pgnoOvfl, PTRMAP_OVERFLOW1, pPage->pgno);
+ rc = ptrmapPut(pPage->pBt, pgnoOvfl, PTRMAP_OVERFLOW1, pPage->pgno);
if( rc!=SQLITE_OK ) return rc;
}
}
** Find the parent page.
*/
assert( pPage->isInit );
- assert( sqlite3PagerIswriteable(pPage->pDbPage) );
+ assert( sqlite3PagerIswriteable(pPage->pDbPage) || pPage->nOverflow==1 );
pBt = pPage->pBt;
pParent = pPage->pParent;
assert( pParent );
}
#endif
+ if( SQLITE_OK!=(rc = sqlite3PagerWrite(pPage->pDbPage)) ){
+ return rc;
+ }
+
/*
** Find the cell in the parent page whose left child points back
** to pPage. The "idx" variable is the index of that cell. If pPage
int rc = SQLITE_OK;
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
if( pPage->pParent==0 ){
- if( pPage->nOverflow>0 ){
+ rc = sqlite3PagerWrite(pPage->pDbPage);
+ if( rc==SQLITE_OK && pPage->nOverflow>0 ){
rc = balance_deeper(pPage);
}
if( rc==SQLITE_OK && pPage->nCell==0 ){
pCur->pgnoRoot, nKey, nData, pPage->pgno,
loc==0 ? "overwrite" : "new entry"));
assert( pPage->isInit );
- rc = sqlite3PagerWrite(pPage->pDbPage);
- if( rc ){
- sqlite3BtreeLeave(p);
- return rc;
- }
newCell = sqlite3_malloc( MX_CELL_SIZE(pBt) );
if( newCell==0 ) return SQLITE_NOMEM;
rc = fillInCell(pPage, newCell, pKey, nKey, pData, nData, nZero, &szNew);
if( loc==0 && CURSOR_VALID==pCur->eState ){
int szOld;
assert( pCur->idx>=0 && pCur->idx<pPage->nCell );
+ rc = sqlite3PagerWrite(pPage->pDbPage);
+ if( rc ){
+ goto end_insert;
+ }
oldCell = findCell(pPage, pCur->idx);
if( !pPage->leaf ){
memcpy(newCell, oldCell, 4);