]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Minor changes so that OMIT_SHARED_CACHE works. (CVS 2892)
authordanielk1977 <danielk1977@noemail.net>
Mon, 9 Jan 2006 05:36:27 +0000 (05:36 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Mon, 9 Jan 2006 05:36:27 +0000 (05:36 +0000)
FossilOrigin-Name: cc963f8cfc6c704c645c627bffb8df21dfebffc6

manifest
manifest.uuid
src/btree.c
src/build.c

index df21c1f599fc7d8dc588eff5db6d59a1193cc628..aa74ef4fd7ad08a5ee3cdcdb982fc49756967bd5 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\stimezone\sparsing\sin\sthe\sdate/time\sfunctions.\s\sTicket\s#1587.\s(CVS\s2891)
-D 2006-01-09T00:18:03
+C Minor\schanges\sso\sthat\sOMIT_SHARED_CACHE\sworks.\s(CVS\s2892)
+D 2006-01-09T05:36:27
 F Makefile.in c79fbdaa264c6afcd435f2fb492551de5a8cf80d
 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -34,9 +34,9 @@ F src/alter.c e9deb3f4fd7c663a0d1f235d541bc5ea1f2cfa8b
 F src/analyze.c fd2fe03b10dd5058747083362e56dec5bd9c4e5c
 F src/attach.c 4a04ffcd17357a7848aa17c12c955d109f533bd0
 F src/auth.c cdec356a5cd8b217c346f816c5912221537fe87f
-F src/btree.c 902d0d3f5c32b665a2184be5997ae0597bd47d56
+F src/btree.c 5c2d7f7482049006fd03b6661e6187fecaefa7cb
 F src/btree.h 5663c4f43e8521546ccebc8fc95acb013b8f3184
-F src/build.c 0cf9f744911826ded1c8ee8adbf881ed5a2ef70a
+F src/build.c 8f0b1da79b7a5845fde0f831b065b42077ac124f
 F src/callback.c 62066afd516f220575e81b1a1239ab92a2eae252
 F src/complete.c df1681cef40dec33a286006981845f87b194e7a4
 F src/date.c a927bdbb51296ac398d2f667086a7072c099e5ab
@@ -335,7 +335,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P 32998fe8ed38a79eb79d8b13051b47bf74661e3c
-R 05890fde3a3c853b296df6bd6670d3bd
-U drh
-Z d4023a6da63972dce3bf97acfc91ffae
+P 94c87b70161d4d44fbf1602fc2baae22dca08759
+R a0a8036ba73e85a05dbaa2966904d0a4
+U danielk1977
+Z 10b9ce228823f887832ae0fa03cba38b
index dd17fbde9e8d02ebfee711f893a20361a1976d84..a8dfdada0d088b8d199859b75d218d9895b325ff 100644 (file)
@@ -1 +1 @@
-94c87b70161d4d44fbf1602fc2baae22dca08759
\ No newline at end of file
+cc963f8cfc6c704c645c627bffb8df21dfebffc6
\ No newline at end of file
index 9f0a2e7f55223bbd6a2e75e19feda882df545ffd..9b206a3b9e9694cbe2334f3d6dc1ccdc834fd0b7 100644 (file)
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btree.c,v 1.285 2006/01/07 13:21:04 danielk1977 Exp $
+** $Id: btree.c,v 1.286 2006/01/09 05:36:27 danielk1977 Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** For a detailed discussion of BTrees, refer to
@@ -348,9 +348,11 @@ struct BtShared {
   BtShared *pNext;      /* Next in SqliteTsd.pBtree linked list */
   int nRef;             /* Number of references to this structure */
   int nTransaction;     /* Number of open transactions (read + write) */
+  void *pSchema;        /* Pointer to space allocated by sqlite3BtreeSchema() */
+  void (*xFreeSchema)(void*);  /* Destructor for BtShared.pSchema */
+#ifndef SQLITE_OMIT_SHARED_CACHE
   BtLock *pLock;        /* List of locks held on this shared-btree struct */
-  void *pSchema;
-  void (*xFreeSchema)(void*);
+#endif
 };
 
 /*
@@ -3157,9 +3159,10 @@ static int moveToRoot(BtCursor *pCur){
   int rc;
   BtShared *pBt = pCur->pBtree->pBt;
 
-  restoreCursorPosition(pCur, 0);
-  rc = getAndInitPage(pBt, pCur->pgnoRoot, &pRoot, 0);
-  if( rc ){
+  if( 
+    SQLITE_OK!=(rc = restoreCursorPosition(pCur, 0)) ||
+    SQLITE_OK!=(rc = getAndInitPage(pBt, pCur->pgnoRoot, &pRoot, 0))
+  ){
     pCur->eState = CURSOR_INVALID;
     return rc;
   }
@@ -5141,14 +5144,14 @@ int sqlite3BtreeInsert(
   }
 
   /* Save the positions of any other cursors open on this table */
-  restoreCursorPosition(pCur, 0);
-  rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur);
-  if( rc ){
+  if( 
+    SQLITE_OK!=(rc = restoreCursorPosition(pCur, 0)) ||
+    SQLITE_OK!=(rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur)) ||
+    SQLITE_OK!=(rc = sqlite3BtreeMoveto(pCur, pKey, nKey, &loc))
+  ){
     return rc;
   }
 
-  rc = sqlite3BtreeMoveto(pCur, pKey, nKey, &loc);
-  if( rc ) return rc;
   pPage = pCur->pPage;
   assert( pPage->intKey || nKey>=0 );
   assert( pPage->leaf || !pPage->leafData );
@@ -6479,11 +6482,14 @@ int sqlite3BtreeSchemaLocked(Btree *p){
 }
 
 int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){
+  int rc = SQLITE_OK;
+#ifndef SQLITE_OMIT_SHARED_CACHE
   u8 lockType = (isWriteLock?WRITE_LOCK:READ_LOCK);
-  int rc = queryTableLock(p, iTab, lockType);
+  rc = queryTableLock(p, iTab, lockType);
   if( rc==SQLITE_OK ){
     rc = lockTable(p, iTab, lockType);
   }
+#endif
   return rc;
 }
 
index 494972b4b8f13754ab8a3bf70511695e089c6fab..90774658460e20c3abe8cf2e0a475591a6435a56 100644 (file)
@@ -22,7 +22,7 @@
 **     COMMIT
 **     ROLLBACK
 **
-** $Id: build.c,v 1.369 2006/01/07 13:21:04 danielk1977 Exp $
+** $Id: build.c,v 1.370 2006/01/09 05:36:27 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include <ctype.h>
@@ -154,7 +154,6 @@ void sqlite3FinishCoding(Parse *pParse){
     ** transaction on each used database and to verify the schema cookie
     ** on each used database.
     */
-    assert( pParse->cookieGoto>0 || pParse->nTableLock==0 );
     if( pParse->cookieGoto>0 ){
       u32 mask;
       int iDb;