@@ -1,7 +1,7 @@
/******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite
-** version 3.6.6.1. By combining all the individual C code files into this
+** version 3.6.6.2. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a one translation
** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements
** of 5% are more are commonly seen when SQLite is compiled as a single
@@ -16,9 +16,9 @@
** programming language. The code for the "sqlite3" command-line shell
** is also in a separate file. This file contains only code for the core
** SQLite library.
**
-** This amalgamation was generated on 2008-11-22 14:31:32 UTC.
+** This amalgamation was generated on 2008-11-27 02:28:55 UTC.
*/
#define SQLITE_CORE 1
#define SQLITE_AMALGAMATION 1
#ifndef SQLITE_PRIVATE
@@ -563,9 +563,9 @@
** {H10014} The SQLITE_VERSION_NUMBER #define shall resolve to an integer
** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z
** are the major version, minor version, and release number.
*/
-#define SQLITE_VERSION "3.6.6.1"
+#define SQLITE_VERSION "3.6.6.2"
#define SQLITE_VERSION_NUMBER 3006006
/*
** CAPI3REF: Run-Time Library Version Numbers {H10020} <S60100>
@@ -28746,9 +28746,9 @@
** locking to prevent two processes from writing the same database
** file simultaneously, or one process from reading the database while
** another is writing.
**
-** @(#) $Id: pager.c,v 1.506 2008/11/19 18:30:29 drh Exp $
+** @(#) $Id: pager.c,v 1.506.2.1 2008/11/26 14:55:02 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
/*
@@ -29788,11 +29788,8 @@
}
return cksum;
}
-/* Forward declaration */
-static void makeClean(PgHdr*);
-
/*
** Read a single page from the journal file opened on file descriptor
** jfd. Playback this one page.
**
@@ -29900,9 +29897,11 @@
memcpy(pData, aData, pPager->pageSize);
if( pPager->xReiniter ){
pPager->xReiniter(pPg);
}
- if( isMainJrnl ) makeClean(pPg);
+ if( isMainJrnl ){
+ sqlite3PcacheMakeClean(pPg);
+ }
#ifdef SQLITE_CHECK_PAGES
pPg->pageHash = pager_pagehash(pPg);
#endif
/* If this was page 1, then restore the value of Pager.dbFileVers.
@@ -31822,25 +31821,8 @@
return rc;
}
/*
-** Make a page dirty. Set its dirty flag and add it to the dirty
-** page list.
-*/
-static void makeDirty(PgHdr *pPg){
- sqlite3PcacheMakeDirty(pPg);
-}
-
-/*
-** Make a page clean. Clear its dirty bit and remove it from the
-** dirty page list.
-*/
-static void makeClean(PgHdr *pPg){
- sqlite3PcacheMakeClean(pPg);
-}
-
-
-/*
** Mark a data page as writeable. The page is written into the journal
** if it is not there already. This routine must be called before making
** changes to a page.
**
@@ -31889,9 +31871,9 @@
/* Mark the page as dirty. If the page has already been written
** to the journal then we can return right away.
*/
- makeDirty(pPg);
+ sqlite3PcacheMakeDirty(pPg);
if( pageInJournal(pPg) && (pageInStatement(pPg) || pPager->stmtInUse==0) ){
pPager->dirtyCache = 1;
pPager->dbModified = 1;
}else{
@@ -32796,9 +32778,9 @@
** can be written to. The caller has already promised not to write to it.
*/
if( (pPg->flags&PGHDR_NEED_SYNC) && !isCommit ){
needSyncPgno = pPg->pgno;
- assert( pageInJournal(pPg) || pgno>pPager->origDbSize );
+ assert( pageInJournal(pPg) || pPg->pgno>pPager->origDbSize );
assert( pPg->flags&PGHDR_DIRTY );
assert( pPager->needSync );
}
@@ -32818,9 +32800,9 @@
if( pPgOld ){
sqlite3PcacheDrop(pPgOld);
}
- makeDirty(pPg);
+ sqlite3PcacheMakeDirty(pPg);
pPager->dirtyCache = 1;
pPager->dbModified = 1;
if( needSyncPgno ){
@@ -32853,9 +32835,9 @@
}
pPager->needSync = 1;
assert( pPager->noSync==0 && !MEMDB );
pPgHdr->flags |= PGHDR_NEED_SYNC;
- makeDirty(pPgHdr);
+ sqlite3PcacheMakeDirty(pPgHdr);
sqlite3PagerUnref(pPgHdr);
}
return SQLITE_OK;
@@ -33912,9 +33894,9 @@
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btree.c,v 1.539.2.1 2008/11/22 14:07:49 drh Exp $
+** $Id: btree.c,v 1.539.2.2 2008/11/26 14:55:02 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
** Including a description of file format and an overview of operation.
@@ -36829,8 +36811,9 @@
pTempCur->pPrev = 0;
for(i=0; i<=pTempCur->iPage; i++){
sqlite3PagerRef(pTempCur->apPage[i]->pDbPage);
}
+ assert( pTempCur->pKey==0 );
}
/*
** Delete a temporary cursor such as was made by the CreateTemporaryCursor()
@@ -36841,8 +36824,9 @@
assert( cursorHoldsMutex(pCur) );
for(i=0; i<=pCur->iPage; i++){
sqlite3PagerUnref(pCur->apPage[i]->pDbPage);
}
+ sqlite3_free(pCur->pKey);
}
/*
** Make sure the BtCursor* given in the argument has a valid
@@ -39960,8 +39944,11 @@
assert( pLeafPage->pgno==leafPgno );
assert( leafCur.aiIdx[leafCur.iPage]==0 );
}
+ if( rc==SQLITE_OK ){
+ rc = sqlite3PagerWrite(pLeafPage->pDbPage);
+ }
if( rc==SQLITE_OK ){
dropCell(pLeafPage, 0, szNext);
VVA_ONLY( leafCur.pagesShuffled = 0 );
rc = balance(&leafCur, 0);