[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/multimedia/amarok/src/sqlite
From:       Mark Kretschmann <markey () web ! de>
Date:       2007-05-04 9:06:55
Message-ID: 1178269615.965787.3202.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 660966 by markey:

SQLite 3.3.17


 M  +79 -73    sqlite3.c  
 M  +2 -2      sqlite3.h  


--- trunk/extragear/multimedia/amarok/src/sqlite/sqlite3.c #660965:660966
@@ -1,6 +1,6 @@
 /******************************************************************************
 ** This file is an amalgamation of many separate C source files from SQLite
-** version 3.3.16.  By combining all the individual C code files into this 
+** version 3.3.17.  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
@@ -17,7 +17,7 @@
 ** is also in a separate file.  This file contains only code for the core
 ** SQLite library.
 **
-** This amalgamation was generated on 2007-04-18 15:18:29 UTC.
+** This amalgamation was generated on 2007-04-25 12:08:23 UTC.
 */
 #define SQLITE_AMALGAMATION 1
 /************** Begin file sqlite3.h *****************************************/
@@ -54,7 +54,7 @@
 #ifdef SQLITE_VERSION
 # undef SQLITE_VERSION
 #endif
-#define SQLITE_VERSION         "3.3.16"
+#define SQLITE_VERSION         "3.3.17"
 
 /*
 ** The format of the version string is "X.Y.Z<trailing string>", where
@@ -71,7 +71,7 @@
 #ifdef SQLITE_VERSION_NUMBER
 # undef SQLITE_VERSION_NUMBER
 #endif
-#define SQLITE_VERSION_NUMBER 3003016
+#define SQLITE_VERSION_NUMBER 3003017
 
 /*
 ** The version string is also compiled into the library so that a program
@@ -21098,7 +21098,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btree.c,v 1.355 2007/04/13 02:14:30 drh Exp $
+** $Id: btree.c,v 1.358 2007/04/24 17:35:59 drh Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** For a detailed discussion of BTrees, refer to
@@ -22954,7 +22954,10 @@
     if( memcmp(page1, zMagicHeader, 16)!=0 ){
       goto page1_init_failed;
     }
-    if( page1[18]>1 || page1[19]>1 ){
+    if( page1[18]>1 ){
+      pBt->readOnly = 1;
+    }
+    if( page1[19]>1 ){
       goto page1_init_failed;
     }
     pageSize = get2byte(&page1[16]);
@@ -23152,11 +23155,15 @@
     if( pBt->pPage1==0 ){
       rc = lockBtree(pBt);
     }
-  
+
     if( rc==SQLITE_OK && wrflag ){
-      rc = sqlite3PagerBegin(pBt->pPage1->pDbPage, wrflag>1);
-      if( rc==SQLITE_OK ){
-        rc = newDatabase(pBt);
+      if( pBt->readOnly ){
+        rc = SQLITE_READONLY;
+      }else{
+        rc = sqlite3PagerBegin(pBt->pPage1->pDbPage, wrflag>1);
+        if( rc==SQLITE_OK ){
+          rc = newDatabase(pBt);
+        }
       }
     }
   
@@ -23866,6 +23873,9 @@
     if( rc!=SQLITE_OK ){
       return rc;
     }
+    if( pBt->readOnly && wrFlag ){
+      return SQLITE_READONLY;
+    }
   }
   pCur = sqliteMalloc( sizeof(*pCur) );
   if( pCur==0 ){
@@ -24603,26 +24613,22 @@
   int rc;
   MemPage *pPage;
 
-#ifndef SQLITE_OMIT_SHARED_CACHE
   rc = restoreOrClearCursorPosition(pCur);
   if( rc!=SQLITE_OK ){
     return rc;
   }
-#endif 
   assert( pRes!=0 );
   pPage = pCur->pPage;
   if( CURSOR_INVALID==pCur->eState ){
     *pRes = 1;
     return SQLITE_OK;
   }
-#ifndef SQLITE_OMIT_SHARED_CACHE
   if( pCur->skip>0 ){
     pCur->skip = 0;
     *pRes = 0;
     return SQLITE_OK;
   }
   pCur->skip = 0;
-#endif 
 
   assert( pPage->isInit );
   assert( pCur->idx<pPage->nCell );
@@ -24673,24 +24679,20 @@
   Pgno pgno;
   MemPage *pPage;
 
-#ifndef SQLITE_OMIT_SHARED_CACHE
   rc = restoreOrClearCursorPosition(pCur);
   if( rc!=SQLITE_OK ){
     return rc;
   }
-#endif
   if( CURSOR_INVALID==pCur->eState ){
     *pRes = 1;
     return SQLITE_OK;
   }
-#ifndef SQLITE_OMIT_SHARED_CACHE
   if( pCur->skip<0 ){
     pCur->skip = 0;
     *pRes = 0;
     return SQLITE_OK;
   }
   pCur->skip = 0;
-#endif
 
   pPage = pCur->pPage;
   assert( pPage->isInit );
@@ -31843,7 +31845,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.600 2007/04/17 08:32:34 danielk1977 Exp $
+** $Id: vdbe.c,v 1.601 2007/04/18 16:45:24 drh Exp $
 */
 
 /*
@@ -34165,7 +34167,11 @@
         return SQLITE_BUSY;
       }
     }
-    return SQLITE_DONE;
+    if( p->rc==SQLITE_OK ){
+      return SQLITE_DONE;
+    }else{
+      return SQLITE_ERROR;
+    }
   }else{
     sqlite3SetString(&p->zErrMsg,
         (!i)?"cannot start a transaction within a transaction":(
@@ -36846,7 +36852,7 @@
 ** This file contains routines used for analyzing expressions and
 ** for generating VDBE code that evaluates expressions in SQLite.
 **
-** $Id: expr.c,v 1.284 2007/04/13 16:06:33 drh Exp $
+** $Id: expr.c,v 1.285 2007/04/18 17:07:58 drh Exp $
 */
 
 /*
@@ -37069,12 +37075,12 @@
   }else if( pLeft ){
     if( pRight ){
       sqlite3ExprSpan(pNew, &pLeft->span, &pRight->span);
-      if( pRight->flags && EP_ExpCollate ){
+      if( pRight->flags & EP_ExpCollate ){
         pNew->flags |= EP_ExpCollate;
         pNew->pColl = pRight->pColl;
       }
     }
-    if( pLeft->flags && EP_ExpCollate ){
+    if( pLeft->flags & EP_ExpCollate ){
       pNew->flags |= EP_ExpCollate;
       pNew->pColl = pLeft->pColl;
     }
@@ -48403,7 +48409,7 @@
 ** other files are for internal use by SQLite and should not be
 ** accessed by users of the library.
 **
-** $Id: legacy.c,v 1.16 2006/09/15 07:28:50 drh Exp $
+** $Id: legacy.c,v 1.17 2007/04/25 11:28:17 drh Exp $
 */
 
 
@@ -48430,7 +48436,6 @@
   char **azCols = 0;
 
   int nRetry = 0;
-  int nChange = 0;
   int nCallback;
 
   if( zSql==0 ) return SQLITE_OK;
@@ -48450,7 +48455,6 @@
       continue;
     }
 
-    db->nChange += nChange;
     nCallback = 0;
 
     nCol = sqlite3_column_count(pStmt);
@@ -48487,9 +48491,6 @@
       if( rc!=SQLITE_ROW ){
         rc = sqlite3_finalize(pStmt);
         pStmt = 0;
-        if( db->pVdbe==0 ){
-          nChange = db->nChange;
-        }
         if( rc!=SQLITE_SCHEMA ){
           nRetry = 0;
           zSql = zLeftover;
@@ -48851,28 +48852,32 @@
 #endif
 
 #ifdef SQLITE_OMIT_AUTHORIZATION
-# define sqlite3_set_authorizer     0
+# define sqlite3_set_authorizer         0
 #endif
 
 #ifdef SQLITE_OMIT_UTF16
-# define sqlite3_bind_text16        0
-# define sqlite3_collation_needed16 0
-# define sqlite3_column_decltype16  0
-# define sqlite3_column_name16      0
-# define sqlite3_column_text16      0
-# define sqlite3_complete16         0
-# define sqlite3_create_collation16 0
-# define sqlite3_create_function16  0
-# define sqlite3_errmsg16           0
-# define sqlite3_open16             0
-# define sqlite3_prepare16          0
-# define sqlite3_result_error16     0
-# define sqlite3_result_text16      0
-# define sqlite3_result_text16be    0
-# define sqlite3_result_text16le    0
-# define sqlite3_value_text16       0
-# define sqlite3_value_text16be     0
-# define sqlite3_value_text16le     0
+# define sqlite3_bind_text16            0
+# define sqlite3_collation_needed16     0
+# define sqlite3_column_decltype16      0
+# define sqlite3_column_name16          0
+# define sqlite3_column_text16          0
+# define sqlite3_complete16             0
+# define sqlite3_create_collation16     0
+# define sqlite3_create_function16      0
+# define sqlite3_errmsg16               0
+# define sqlite3_open16                 0
+# define sqlite3_prepare16              0
+# define sqlite3_prepare16_v2           0
+# define sqlite3_result_error16         0
+# define sqlite3_result_text16          0
+# define sqlite3_result_text16be        0
+# define sqlite3_result_text16le        0
+# define sqlite3_value_text16           0
+# define sqlite3_value_text16be         0
+# define sqlite3_value_text16le         0
+# define sqlite3_column_database_name16 0
+# define sqlite3_column_table_name16    0
+# define sqlite3_column_origin_name16   0
 #endif
 
 #ifdef SQLITE_OMIT_COMPLETE
@@ -50326,7 +50331,7 @@
 ** interface, and routines that contribute to loading the database schema
 ** from disk.
 **
-** $Id: prepare.c,v 1.45 2007/03/26 22:05:02 drh Exp $
+** $Id: prepare.c,v 1.46 2007/04/19 11:09:01 danielk1977 Exp $
 */
 
 /*
@@ -50847,13 +50852,15 @@
   if( sqlite3SafetyOff(db) ){
     rc = SQLITE_MISUSE;
   }
-  if( rc==SQLITE_OK ){
-    if( saveSqlFlag ){
-      sqlite3VdbeSetSql(sParse.pVdbe, zSql, sParse.zTail - zSql);
-    }
+
+  if( saveSqlFlag ){
+    sqlite3VdbeSetSql(sParse.pVdbe, zSql, sParse.zTail - zSql);
+  }
+  if( rc!=SQLITE_OK || sqlite3MallocFailed() ){
+    sqlite3_finalize((sqlite3_stmt*)sParse.pVdbe);
+    assert(!(*ppStmt));
+  }else{
     *ppStmt = (sqlite3_stmt*)sParse.pVdbe;
-  }else if( sParse.pVdbe ){
-    sqlite3_finalize((sqlite3_stmt*)sParse.pVdbe);
   }
 
   if( zErrMsg ){
@@ -56334,7 +56341,7 @@
 *************************************************************************
 ** This file contains code used to help implement virtual tables.
 **
-** $Id: vtab.c,v 1.42 2007/04/18 14:24:34 danielk1977 Exp $
+** $Id: vtab.c,v 1.45 2007/04/19 14:48:37 danielk1977 Exp $
 */
 #ifndef SQLITE_OMIT_VIRTUALTABLE
 
@@ -56454,10 +56461,12 @@
   int iDb;              /* The database the table is being created in */
   Table *pTable;        /* The new virtual table */
 
+#ifndef SQLITE_OMIT_SHARED_CACHE
   if( sqlite3ThreadDataReadOnly()->useSharedData ){
     sqlite3ErrorMsg(pParse, "Cannot use virtual tables in shared-cache mode");
     return;
   }
+#endif
 
   sqlite3StartTable(pParse, pName1, pName2, 0, 0, 1, 0);
   pTable = pParse->pNewTable;
@@ -56853,16 +56862,18 @@
 */
 static void callFinaliser(sqlite3 *db, int offset){
   int i;
-  for(i=0; i<db->nVTrans && db->aVTrans[i]; i++){
-    sqlite3_vtab *pVtab = db->aVTrans[i];
-    int (*x)(sqlite3_vtab *);
-    x = *(int (**)(sqlite3_vtab *))((char *)pVtab->pModule + offset);
-    if( x ) x(pVtab);
-    sqlite3VtabUnlock(db, pVtab);
+  if( db->aVTrans ){
+    for(i=0; i<db->nVTrans && db->aVTrans[i]; i++){
+      sqlite3_vtab *pVtab = db->aVTrans[i];
+      int (*x)(sqlite3_vtab *);
+      x = *(int (**)(sqlite3_vtab *))((char *)pVtab->pModule + offset);
+      if( x ) x(pVtab);
+      sqlite3VtabUnlock(db, pVtab);
+    }
+    sqliteFree(db->aVTrans);
+    db->nVTrans = 0;
+    db->aVTrans = 0;
   }
-  sqliteFree(db->aVTrans);
-  db->nVTrans = 0;
-  db->aVTrans = 0;
 }
 
 /*
@@ -57052,7 +57063,7 @@
 ** so is applicable.  Because this module is responsible for selecting
 ** indices, you might also think of this module as the "query optimizer".
 **
-** $Id: where.c,v 1.246 2007/04/06 01:04:40 drh Exp $
+** $Id: where.c,v 1.247 2007/04/20 12:22:02 drh Exp $
 */
 
 /*
@@ -57061,11 +57072,6 @@
 #define BMS  (sizeof(Bitmask)*8)
 
 /*
-** Determine the number of elements in an array.
-*/
-#define ARRAYSIZE(X)  (sizeof(X)/sizeof(X[0]))
-
-/*
 ** Trace output macros
 */
 #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG)
@@ -57230,7 +57236,7 @@
   pWC->pParse = pParse;
   pWC->pMaskSet = pMaskSet;
   pWC->nTerm = 0;
-  pWC->nSlot = ARRAYSIZE(pWC->aStatic);
+  pWC->nSlot = ArraySize(pWC->aStatic);
   pWC->a = pWC->aStatic;
 }
 
@@ -57345,7 +57351,7 @@
 ** array will never overflow.
 */
 static void createMask(ExprMaskSet *pMaskSet, int iCursor){
-  assert( pMaskSet->n < ARRAYSIZE(pMaskSet->ix) );
+  assert( pMaskSet->n < ArraySize(pMaskSet->ix) );
   pMaskSet->ix[pMaskSet->n++] = iCursor;
 }
 
--- trunk/extragear/multimedia/amarok/src/sqlite/sqlite3.h #660965:660966
@@ -31,7 +31,7 @@
 #ifdef SQLITE_VERSION
 # undef SQLITE_VERSION
 #endif
-#define SQLITE_VERSION         "3.3.16"
+#define SQLITE_VERSION         "3.3.17"
 
 /*
 ** The format of the version string is "X.Y.Z<trailing string>", where
@@ -48,7 +48,7 @@
 #ifdef SQLITE_VERSION_NUMBER
 # undef SQLITE_VERSION_NUMBER
 #endif
-#define SQLITE_VERSION_NUMBER 3003016
+#define SQLITE_VERSION_NUMBER 3003017
 
 /*
 ** The version string is also compiled into the library so that a program
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic