]> granicus.if.org Git - php/commitdiff
Upgraded to 3.6.14.1
authorIlia Alshanetsky <iliaa@php.net>
Tue, 19 May 2009 18:32:46 +0000 (18:32 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 19 May 2009 18:32:46 +0000 (18:32 +0000)
NEWS
ext/sqlite3/libsqlite/sqlite3.c
ext/sqlite3/libsqlite/sqlite3.h

diff --git a/NEWS b/NEWS
index 43b93ae94bbd16a4b30fc00865b062760ea89091..f2509e8f538b1845ad983d7ec2886d1acae6100e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,7 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2009, PHP 5.3.0 RC 3
-- Upgraded bundled sqlite to version 3.6.14. (Scott)
+- Upgraded bundled sqlite to version 3.6.14.1. (Ilia)
 - Upgraded bundled libmagic to 5.03 in the fileinfo extension. (Scott)
 
 - Removed all zend_extension_* php.ini directives. Zend extensions are now
index 83bd8bf64014368f24b6c3102587e7030fc77f11..6e8745bd6af1a671da6ee1dacd3f3157400986cd 100644 (file)
@@ -4,7 +4,7 @@
 
 /******************************************************************************
 ** This file is an amalgamation of many separate C source files from SQLite
-** version 3.6.14.  By combining all the individual C code files into this 
+** version 3.6.14.1.  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
@@ -21,7 +21,7 @@
 ** is also in a separate file.  This file contains only code for the core
 ** SQLite library.
 **
-** This amalgamation was generated on 2009-05-07 01:56:00 UTC.
+** This amalgamation was generated on 2009-05-18 18:33:54 UTC.
 */
 #define SQLITE_CORE 1
 #define SQLITE_AMALGAMATION 1
@@ -601,7 +601,7 @@ extern "C" {
 **
 ** Requirements: [H10011] [H10014]
 */
-#define SQLITE_VERSION         "3.6.14"
+#define SQLITE_VERSION         "3.6.14.1"
 #define SQLITE_VERSION_NUMBER  3006014
 
 /*
@@ -7655,7 +7655,6 @@ SQLITE_PRIVATE void sqlite3PCacheSetDefault(void);
 # define SQLITE_OS_WINCE 0
 #endif
 
-#include <ctype.h>
 
 /*
 ** Define the maximum size of a temporary filename
@@ -29437,6 +29436,7 @@ static void pcache1TruncateUnsafe(
   PCache1 *pCache, 
   unsigned int iLimit 
 ){
+  TESTONLY( int nPage = 0; )      /* Used to assert pCache->nPage is correct */
   unsigned int h;
   assert( sqlite3_mutex_held(pcache1.mutex) );
   for(h=0; h<pCache->nHash; h++){
@@ -29444,14 +29444,17 @@ static void pcache1TruncateUnsafe(
     PgHdr1 *pPage;
     while( (pPage = *pp)!=0 ){
       if( pPage->iKey>=iLimit ){
-        pcache1PinPage(pPage);
+        pCache->nPage--;
         *pp = pPage->pNext;
+        pcache1PinPage(pPage);
         pcache1FreePage(pPage);
       }else{
         pp = &pPage->pNext;
+        TESTONLY( nPage++ );
       }
     }
   }
+  assert( pCache->nPage==nPage );
 }
 
 /******************************************************************************/
@@ -33879,7 +33882,7 @@ static int pagerSharedLock(Pager *pPager){
       );
     }
 
-    if( sqlite3PcachePagecount(pPager->pPCache)>0 ){
+    if( pPager->pBackup || sqlite3PcachePagecount(pPager->pPCache)>0 ){
       /* The shared-lock has just been acquired on the database file
       ** and there are already pages in the cache (from a previous
       ** read or write transaction).  Check to see if the database
@@ -44271,6 +44274,7 @@ struct sqlite3_backup {
   Pgno nRemaining;         /* Number of pages left to copy */
   Pgno nPagecount;         /* Total number of pages to copy */
 
+  int isAttached;          /* True once backup has been registered with pager */
   sqlite3_backup *pNext;   /* Next backup associated with source pager */
 };
 
@@ -44384,6 +44388,7 @@ SQLITE_API sqlite3_backup *sqlite3_backup_init(
     p->pDestDb = pDestDb;
     p->pSrcDb = pSrcDb;
     p->iNext = 1;
+    p->isAttached = 0;
 
     if( 0==p->pSrc || 0==p->pDest ){
       /* One (or both) of the named databases did not exist. An error has
@@ -44394,18 +44399,7 @@ SQLITE_API sqlite3_backup *sqlite3_backup_init(
       p = 0;
     }
   }
-
-  /* If everything has gone as planned, attach the backup object to the
-  ** source pager. The source pager calls BackupUpdate() and BackupRestart()
-  ** to notify this module if the source file is modified mid-backup.
-  */
   if( p ){
-    sqlite3_backup **pp;             /* Pointer to head of pagers backup list */
-    sqlite3BtreeEnter(p->pSrc);
-    pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
-    p->pNext = *pp;
-    *pp = p;
-    sqlite3BtreeLeave(p->pSrc);
     p->pSrc->nBackup++;
   }
 
@@ -44498,6 +44492,19 @@ static int backupTruncateFile(sqlite3_file *pFile, i64 iSize){
   return rc;
 }
 
+/*
+** Register this backup object with the associated source pager for
+** callbacks when pages are changed or the cache invalidated.
+*/
+static void attachBackupObject(sqlite3_backup *p){
+  sqlite3_backup **pp;
+  assert( sqlite3BtreeHoldsMutex(p->pSrc) );
+  pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
+  p->pNext = *pp;
+  *pp = p;
+  p->isAttached = 1;
+}
+
 /*
 ** Copy nPage pages from the source b-tree to the destination.
 */
@@ -44567,6 +44574,8 @@ SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){
       p->nRemaining = nSrcPage+1-p->iNext;
       if( p->iNext>(Pgno)nSrcPage ){
         rc = SQLITE_DONE;
+      }else if( !p->isAttached ){
+        attachBackupObject(p);
       }
     }
   
@@ -44699,12 +44708,14 @@ SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p){
 
   /* Detach this backup from the source pager. */
   if( p->pDestDb ){
+    p->pSrc->nBackup--;
+  }
+  if( p->isAttached ){
     pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc));
     while( *pp!=p ){
       pp = &(*pp)->pNext;
     }
     *pp = p->pNext;
-    p->pSrc->nBackup--;
   }
 
   /* If a transaction is still open on the Btree, roll it back. */
@@ -50709,6 +50720,7 @@ SQLITE_PRIVATE int sqlite3VdbeExec(
       pOut = &p->aMem[pOp->p2];
       sqlite3VdbeMemReleaseExternal(pOut);
       pOut->flags = MEM_Null;
+      pOut->n = 0;
     }else
  
     /* Do common setup for opcodes marked with one of the following
index d56dd07cb05cf80c98882981d8e631019f1fa083..bd2956fd2ee5fc11a4a13675620007ab1ba2d306 100644 (file)
@@ -99,7 +99,7 @@ extern "C" {
 **
 ** Requirements: [H10011] [H10014]
 */
-#define SQLITE_VERSION         "3.6.14"
+#define SQLITE_VERSION         "3.6.14.1"
 #define SQLITE_VERSION_NUMBER  3006014
 
 /*