1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Minor changes so that OMIT_SHARED_CACHE works. (CVS 2892)

FossilOrigin-Name: cc963f8cfc6c704c645c627bffb8df21dfebffc6
This commit is contained in:
danielk1977
2006-01-09 05:36:27 +00:00
parent 5739103e98
commit 2e94d4dea5
4 changed files with 28 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
C Fix\stimezone\sparsing\sin\sthe\sdate/time\sfunctions.\s\sTicket\s#1587.\s(CVS\s2891) C Minor\schanges\sso\sthat\sOMIT_SHARED_CACHE\sworks.\s(CVS\s2892)
D 2006-01-09T00:18:03 D 2006-01-09T05:36:27
F Makefile.in c79fbdaa264c6afcd435f2fb492551de5a8cf80d F Makefile.in c79fbdaa264c6afcd435f2fb492551de5a8cf80d
F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -34,9 +34,9 @@ F src/alter.c e9deb3f4fd7c663a0d1f235d541bc5ea1f2cfa8b
F src/analyze.c fd2fe03b10dd5058747083362e56dec5bd9c4e5c F src/analyze.c fd2fe03b10dd5058747083362e56dec5bd9c4e5c
F src/attach.c 4a04ffcd17357a7848aa17c12c955d109f533bd0 F src/attach.c 4a04ffcd17357a7848aa17c12c955d109f533bd0
F src/auth.c cdec356a5cd8b217c346f816c5912221537fe87f F src/auth.c cdec356a5cd8b217c346f816c5912221537fe87f
F src/btree.c 902d0d3f5c32b665a2184be5997ae0597bd47d56 F src/btree.c 5c2d7f7482049006fd03b6661e6187fecaefa7cb
F src/btree.h 5663c4f43e8521546ccebc8fc95acb013b8f3184 F src/btree.h 5663c4f43e8521546ccebc8fc95acb013b8f3184
F src/build.c 0cf9f744911826ded1c8ee8adbf881ed5a2ef70a F src/build.c 8f0b1da79b7a5845fde0f831b065b42077ac124f
F src/callback.c 62066afd516f220575e81b1a1239ab92a2eae252 F src/callback.c 62066afd516f220575e81b1a1239ab92a2eae252
F src/complete.c df1681cef40dec33a286006981845f87b194e7a4 F src/complete.c df1681cef40dec33a286006981845f87b194e7a4
F src/date.c a927bdbb51296ac398d2f667086a7072c099e5ab F src/date.c a927bdbb51296ac398d2f667086a7072c099e5ab
@@ -335,7 +335,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P 32998fe8ed38a79eb79d8b13051b47bf74661e3c P 94c87b70161d4d44fbf1602fc2baae22dca08759
R 05890fde3a3c853b296df6bd6670d3bd R a0a8036ba73e85a05dbaa2966904d0a4
U drh U danielk1977
Z d4023a6da63972dce3bf97acfc91ffae Z 10b9ce228823f887832ae0fa03cba38b

View File

@@ -1 +1 @@
94c87b70161d4d44fbf1602fc2baae22dca08759 cc963f8cfc6c704c645c627bffb8df21dfebffc6

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give. ** 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. ** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to ** For a detailed discussion of BTrees, refer to
@@ -348,9 +348,11 @@ struct BtShared {
BtShared *pNext; /* Next in SqliteTsd.pBtree linked list */ BtShared *pNext; /* Next in SqliteTsd.pBtree linked list */
int nRef; /* Number of references to this structure */ int nRef; /* Number of references to this structure */
int nTransaction; /* Number of open transactions (read + write) */ 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 */ BtLock *pLock; /* List of locks held on this shared-btree struct */
void *pSchema; #endif
void (*xFreeSchema)(void*);
}; };
/* /*
@@ -3157,9 +3159,10 @@ static int moveToRoot(BtCursor *pCur){
int rc; int rc;
BtShared *pBt = pCur->pBtree->pBt; BtShared *pBt = pCur->pBtree->pBt;
restoreCursorPosition(pCur, 0); if(
rc = getAndInitPage(pBt, pCur->pgnoRoot, &pRoot, 0); SQLITE_OK!=(rc = restoreCursorPosition(pCur, 0)) ||
if( rc ){ SQLITE_OK!=(rc = getAndInitPage(pBt, pCur->pgnoRoot, &pRoot, 0))
){
pCur->eState = CURSOR_INVALID; pCur->eState = CURSOR_INVALID;
return rc; return rc;
} }
@@ -5141,14 +5144,14 @@ int sqlite3BtreeInsert(
} }
/* Save the positions of any other cursors open on this table */ /* Save the positions of any other cursors open on this table */
restoreCursorPosition(pCur, 0); if(
rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur); SQLITE_OK!=(rc = restoreCursorPosition(pCur, 0)) ||
if( rc ){ SQLITE_OK!=(rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur)) ||
SQLITE_OK!=(rc = sqlite3BtreeMoveto(pCur, pKey, nKey, &loc))
){
return rc; return rc;
} }
rc = sqlite3BtreeMoveto(pCur, pKey, nKey, &loc);
if( rc ) return rc;
pPage = pCur->pPage; pPage = pCur->pPage;
assert( pPage->intKey || nKey>=0 ); assert( pPage->intKey || nKey>=0 );
assert( pPage->leaf || !pPage->leafData ); assert( pPage->leaf || !pPage->leafData );
@@ -6479,11 +6482,14 @@ int sqlite3BtreeSchemaLocked(Btree *p){
} }
int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){ int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){
int rc = SQLITE_OK;
#ifndef SQLITE_OMIT_SHARED_CACHE
u8 lockType = (isWriteLock?WRITE_LOCK:READ_LOCK); u8 lockType = (isWriteLock?WRITE_LOCK:READ_LOCK);
int rc = queryTableLock(p, iTab, lockType); rc = queryTableLock(p, iTab, lockType);
if( rc==SQLITE_OK ){ if( rc==SQLITE_OK ){
rc = lockTable(p, iTab, lockType); rc = lockTable(p, iTab, lockType);
} }
#endif
return rc; return rc;
} }

View File

@@ -22,7 +22,7 @@
** COMMIT ** COMMIT
** ROLLBACK ** 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 "sqliteInt.h"
#include <ctype.h> #include <ctype.h>
@@ -154,7 +154,6 @@ void sqlite3FinishCoding(Parse *pParse){
** transaction on each used database and to verify the schema cookie ** transaction on each used database and to verify the schema cookie
** on each used database. ** on each used database.
*/ */
assert( pParse->cookieGoto>0 || pParse->nTableLock==0 );
if( pParse->cookieGoto>0 ){ if( pParse->cookieGoto>0 ){
u32 mask; u32 mask;
int iDb; int iDb;