diff --git a/manifest b/manifest index 6ae72a395f..d87ecf04e0 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sold\sdeclaration\sof\ssqlite3_pending_byte\s(which\swas\sused\sby\stest\scode).\sIt\shas\sbeen\sreplaced\sby\ssqlite3PendingByte.\sTicket\s#3677.\s(CVS\s6321) -D 2009-02-24T18:40:50 +C Changes\sto\scomments\sand\sfunctions/procedure\snames\sfor\sclarification.\s\sNo\nchanges\sto\slogic.\s(CVS\s6322) +D 2009-02-24T18:57:32 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in d64baddbf55cdf33ff030e14da837324711a4ef7 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -103,7 +103,7 @@ F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627 F src/backup.c 2d3f31148d7b086c5c72d9edcd04fc2751b0aa6e F src/bitvec.c 44f7059ac1f874d364b34af31b9617e52223ba75 F src/btmutex.c 63c5cc4ad5715690767ffcb741e185d7bc35ec1a -F src/btree.c 8b8697ab5e8ca9aad12221bb9abfee1aed7a5cd1 +F src/btree.c 10c415effaf89b047a7c4178d10b5ee93a480106 F src/btree.h 96a019c9f28da38e79940512d7800e419cd8c702 F src/btreeInt.h 0a4884e6152d7cae9c741e91b830064c19fd2c05 F src/build.c a1db48aec62c95049d783f231195812ff97ae268 @@ -199,7 +199,7 @@ F src/update.c 87158a2308173487f9f7e19ef877edc860def462 F src/utf.c 1da9c832dba0fa8f865b5b902d93f420a1ee4245 F src/util.c 1363f64351f3b544790f3c523439354c02f8c4e9 F src/vacuum.c 4929a585ef0fb1dfaf46302f8a9c4aa30c2d9cf5 -F src/vdbe.c 13194e2961ab92ec42016f05797f02a898d06729 +F src/vdbe.c e03512022ed2dd57bf2ea9ebe4f54cbc091adb0b F src/vdbe.h d70a68bee196ab228914a3902c79dbd24342a0f2 F src/vdbeInt.h d12bc259b34d3d610ebf05d648eb6346d48478c3 F src/vdbeapi.c f94fe2eb6f48687e918f0df7eed1409cff9dcf58 @@ -702,7 +702,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P 3f0baa1b63df31f7dc885fd39290ca12ad2be6df -R 1a2f353bd0baf8e9e632784c84221af5 -U danielk1977 -Z 680899f7e8365c47fe6ad6bbcc963a0b +P 44f0162ebb760dd6926ee5691752b6798e3aacb9 +R 94eaff1a860808fd91188cf96085c1fc +U drh +Z b49eeab63aacbd5e3c0381ee3e34c6a7 diff --git a/manifest.uuid b/manifest.uuid index cf38451300..1cf819bd94 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -44f0162ebb760dd6926ee5691752b6798e3aacb9 \ No newline at end of file +b99c1815fe270decf1ac3d714acc7e945d1e728a \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index 9843acb0ab..18529495c2 100644 --- a/src/btree.c +++ b/src/btree.c @@ -9,7 +9,7 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** $Id: btree.c,v 1.568 2009/02/24 16:18:05 drh Exp $ +** $Id: btree.c,v 1.569 2009/02/24 18:57:32 drh Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** See the header comment on "btreeInt.h" for additional information. @@ -73,26 +73,27 @@ static int checkReadLocks(Btree*, Pgno, BtCursor*, i64); #ifdef SQLITE_OMIT_SHARED_CACHE /* - ** The functions queryTableLock(), lockTable() and unlockAllTables() + ** The functions querySharedCacheTableLock(), setSharedCacheTableLock(), + ** and clearAllSharedCacheTableLocks() ** manipulate entries in the BtShared.pLock linked list used to store ** shared-cache table level locks. If the library is compiled with the ** shared-cache feature disabled, then there is only ever one user ** of each BtShared structure and so this locking is not necessary. ** So define the lock related functions as no-ops. */ - #define queryTableLock(a,b,c) SQLITE_OK - #define lockTable(a,b,c) SQLITE_OK - #define unlockAllTables(a) + #define querySharedCacheTableLock(a,b,c) SQLITE_OK + #define setSharedCacheTableLock(a,b,c) SQLITE_OK + #define clearAllSharedCacheTableLocks(a) #endif #ifndef SQLITE_OMIT_SHARED_CACHE /* ** Query to see if btree handle p may obtain a lock of type eLock ** (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return -** SQLITE_OK if the lock may be obtained (by calling lockTable()), or -** SQLITE_LOCKED if not. +** SQLITE_OK if the lock may be obtained (by calling +** setSharedCacheTableLock()), or SQLITE_LOCKED if not. */ -static int queryTableLock(Btree *p, Pgno iTab, u8 eLock){ +static int querySharedCacheTableLock(Btree *p, Pgno iTab, u8 eLock){ BtShared *pBt = p->pBt; BtLock *pIter; @@ -112,14 +113,15 @@ static int queryTableLock(Btree *p, Pgno iTab, u8 eLock){ return SQLITE_LOCKED; } - /* This (along with lockTable()) is where the ReadUncommitted flag is - ** dealt with. If the caller is querying for a read-lock on any table + /* This (along with setSharedCacheTableLock()) is where + ** the ReadUncommitted flag is dealt with. + ** If the caller is querying for a read-lock on any table ** other than the sqlite_master table (table 1) and if the ReadUncommitted ** flag is set, then the lock granted even if there are write-locks ** on the table. If a write-lock is requested, the ReadUncommitted flag ** is not considered. ** - ** In function lockTable(), if a read-lock is demanded and the + ** In function setSharedCacheTableLock(), if a read-lock is demanded and the ** ReadUncommitted flag is set, no entry is added to the locks list ** (BtShared.pLock). ** @@ -152,7 +154,7 @@ static int queryTableLock(Btree *p, Pgno iTab, u8 eLock){ ** SQLITE_OK is returned if the lock is added successfully. SQLITE_BUSY and ** SQLITE_NOMEM may also be returned. */ -static int lockTable(Btree *p, Pgno iTable, u8 eLock){ +static int setSharedCacheTableLock(Btree *p, Pgno iTable, u8 eLock){ BtShared *pBt = p->pBt; BtLock *pLock = 0; BtLock *pIter; @@ -166,13 +168,13 @@ static int lockTable(Btree *p, Pgno iTable, u8 eLock){ return SQLITE_OK; } - assert( SQLITE_OK==queryTableLock(p, iTable, eLock) ); + assert( SQLITE_OK==querySharedCacheTableLock(p, iTable, eLock) ); /* If the read-uncommitted flag is set and a read-lock is requested on ** a non-schema table, then the lock is always granted. Return early ** without adding an entry to the BtShared.pLock list. See - ** comment in function queryTableLock() for more info on handling - ** the ReadUncommitted flag. + ** comment in function querySharedCacheTableLock() for more info + ** on handling the ReadUncommitted flag. */ if( (p->db->flags&SQLITE_ReadUncommitted) && @@ -219,10 +221,10 @@ static int lockTable(Btree *p, Pgno iTable, u8 eLock){ #ifndef SQLITE_OMIT_SHARED_CACHE /* -** Release all the table locks (locks obtained via calls to the lockTable() -** procedure) held by Btree handle p. +** Release all the table locks (locks obtained via calls to +** the setSharedCacheTableLock() procedure) held by Btree handle p. */ -static void unlockAllTables(Btree *p){ +static void clearAllSharedCacheTableLocks(Btree *p){ BtShared *pBt = p->pBt; BtLock **ppIter = &pBt->pLock; @@ -2613,7 +2615,7 @@ int sqlite3BtreeCommitPhaseTwo(Btree *p){ pBt->inTransaction = TRANS_READ; pBt->inStmt = 0; } - unlockAllTables(p); + clearAllSharedCacheTableLocks(p); /* If the handle has any kind of transaction open, decrement the transaction ** count of the shared btree. If the transaction count reaches 0, set @@ -2737,7 +2739,7 @@ int sqlite3BtreeRollback(Btree *p){ } #endif btreeIntegrity(p); - unlockAllTables(p); + clearAllSharedCacheTableLocks(p); if( p->inTrans==TRANS_WRITE ){ int rc2; @@ -6658,9 +6660,10 @@ int sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){ /* Reading a meta-data value requires a read-lock on page 1 (and hence ** the sqlite_master table. We grab this lock regardless of whether or ** not the SQLITE_ReadUncommitted flag is set (the table rooted at page - ** 1 is treated as a special case by queryTableLock() and lockTable()). + ** 1 is treated as a special case by querySharedCacheTableLock() + ** and setSharedCacheTableLock()). */ - rc = queryTableLock(p, 1, READ_LOCK); + rc = querySharedCacheTableLock(p, 1, READ_LOCK); if( rc!=SQLITE_OK ){ sqlite3BtreeLeave(p); return rc; @@ -6702,7 +6705,7 @@ int sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){ #endif /* Grab the read-lock on page 1. */ - rc = lockTable(p, 1, READ_LOCK); + rc = setSharedCacheTableLock(p, 1, READ_LOCK); sqlite3BtreeLeave(p); return rc; } @@ -7382,7 +7385,7 @@ int sqlite3BtreeSchemaLocked(Btree *p){ int rc; assert( sqlite3_mutex_held(p->db->mutex) ); sqlite3BtreeEnter(p); - rc = (queryTableLock(p, MASTER_ROOT, READ_LOCK)!=SQLITE_OK); + rc = (querySharedCacheTableLock(p, MASTER_ROOT, READ_LOCK)!=SQLITE_OK); sqlite3BtreeLeave(p); return rc; } @@ -7401,9 +7404,9 @@ int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){ assert( READ_LOCK+1==WRITE_LOCK ); assert( isWriteLock==0 || isWriteLock==1 ); sqlite3BtreeEnter(p); - rc = queryTableLock(p, iTab, lockType); + rc = querySharedCacheTableLock(p, iTab, lockType); if( rc==SQLITE_OK ){ - rc = lockTable(p, iTab, lockType); + rc = setSharedCacheTableLock(p, iTab, lockType); } sqlite3BtreeLeave(p); } diff --git a/src/vdbe.c b/src/vdbe.c index 896c98073a..a8dafc4cb5 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -43,7 +43,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.822 2009/02/24 10:01:52 danielk1977 Exp $ +** $Id: vdbe.c,v 1.823 2009/02/24 18:57:32 drh Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -2532,7 +2532,8 @@ case OP_Savepoint: { ** ** Set the database auto-commit flag to P1 (1 or 0). If P2 is true, roll ** back any currently active btree transactions. If there are any active -** VMs (apart from this one), then the COMMIT or ROLLBACK statement fails. +** VMs (apart from this one), then a ROLLBACK fails. A COMMIT fails if +** there are active writing VMs or active VMs that use shared cache. ** ** This instruction causes the VM to halt. */