-C Changes\sto\scomments\sand\sfunctions/procedure\snames\sfor\sclarification.\s\sNo\nchanges\sto\slogic.\s(CVS\s6322)
-D 2009-02-24T18:57:32
+C Additional\scommands\sand\sanother\sprocedure\sname\schanges\sfor\sclarity\sof\npresentation.\sNo\slogic\schanges.\s(CVS\s6323)
+D 2009-02-24T19:21:41
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in d64baddbf55cdf33ff030e14da837324711a4ef7
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F src/backup.c 2d3f31148d7b086c5c72d9edcd04fc2751b0aa6e
F src/bitvec.c 44f7059ac1f874d364b34af31b9617e52223ba75
F src/btmutex.c 63c5cc4ad5715690767ffcb741e185d7bc35ec1a
-F src/btree.c 10c415effaf89b047a7c4178d10b5ee93a480106
+F src/btree.c c219cd5d46fc39540c44e15bf7e9e36c06496f51
F src/btree.h 96a019c9f28da38e79940512d7800e419cd8c702
F src/btreeInt.h 0a4884e6152d7cae9c741e91b830064c19fd2c05
F src/build.c a1db48aec62c95049d783f231195812ff97ae268
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 44f0162ebb760dd6926ee5691752b6798e3aacb9
-R 94eaff1a860808fd91188cf96085c1fc
+P b99c1815fe270decf1ac3d714acc7e945d1e728a
+R 52f851adc25a6b49b81feac1c5feb754
U drh
-Z b49eeab63aacbd5e3c0381ee3e34c6a7
+Z 7a0daf7b4a8f562b34bdae9981a338a7
** May you share freely, never taking more than you give.
**
*************************************************************************
-** $Id: btree.c,v 1.569 2009/02/24 18:57:32 drh Exp $
+** $Id: btree.c,v 1.570 2009/02/24 19:21:41 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
/*
** Forward declaration
*/
-static int checkReadLocks(Btree*, Pgno, BtCursor*, i64);
+static int checkForReadConflicts(Btree*, Pgno, BtCursor*, i64);
#ifdef SQLITE_OMIT_SHARED_CACHE
if( NEVER(pBt->readOnly) ){
return SQLITE_READONLY;
}
- if( checkReadLocks(p, iTable, 0, 0) ){
+ if( checkForReadConflicts(p, iTable, 0, 0) ){
return SQLITE_LOCKED;
}
}
** is not in the ReadUncommmitted state, then this routine returns
** SQLITE_LOCKED.
**
-** As well as cursors with wrFlag==0, cursors with wrFlag==1 and
-** isIncrblobHandle==1 are also considered 'read' cursors. Incremental
-** blob cursors are used for both reading and writing.
+** As well as cursors with wrFlag==0, cursors with
+** isIncrblobHandle==1 are also considered 'read' cursors because
+** incremental blob cursors are used for both reading and writing.
**
** When pgnoRoot is the root page of an intkey table, this function is also
** responsible for invalidating incremental blob cursors when the table row
** 3) If both pExclude and iRow are set to zero, no incremental blob
** cursors are invalidated.
*/
-static int checkReadLocks(
- Btree *pBtree,
- Pgno pgnoRoot,
- BtCursor *pExclude,
- i64 iRow
+static int checkForReadConflicts(
+ Btree *pBtree, /* The database file to check */
+ Pgno pgnoRoot, /* Look for read cursors on this btree */
+ BtCursor *pExclude, /* Ignore this cursor */
+ i64 iRow /* The rowid that might be changing */
){
BtCursor *p;
BtShared *pBt = pBtree->pBt;
assert( pBt->inTransaction==TRANS_WRITE );
assert( !pBt->readOnly );
assert( pCur->wrFlag );
- if( checkReadLocks(pCur->pBtree, pCur->pgnoRoot, pCur, nKey) ){
+ if( checkForReadConflicts(pCur->pBtree, pCur->pgnoRoot, pCur, nKey) ){
return SQLITE_LOCKED; /* The table pCur points to has a read lock */
}
if( pCur->eState==CURSOR_FAULT ){
return SQLITE_ERROR; /* The cursor is not pointing to anything */
}
assert( pCur->wrFlag );
- if( checkReadLocks(pCur->pBtree, pCur->pgnoRoot, pCur, pCur->info.nKey) ){
+ if( checkForReadConflicts(pCur->pBtree, pCur->pgnoRoot,
+ pCur, pCur->info.nKey)
+ ){
return SQLITE_LOCKED; /* The table pCur points to has a read lock */
}
sqlite3BtreeEnter(p);
pBt->db = p->db;
assert( p->inTrans==TRANS_WRITE );
- if( (rc = checkReadLocks(p, iTable, 0, 1))!=SQLITE_OK ){
+ if( (rc = checkForReadConflicts(p, iTable, 0, 1))!=SQLITE_OK ){
/* nothing to do */
}else if( SQLITE_OK!=(rc = saveAllCursors(pBt, iTable, 0)) ){
/* nothing to do */
}
assert( !pCsr->pBt->readOnly
&& pCsr->pBt->inTransaction==TRANS_WRITE );
- if( checkReadLocks(pCsr->pBtree, pCsr->pgnoRoot, pCsr, 0) ){
+ if( checkForReadConflicts(pCsr->pBtree, pCsr->pgnoRoot, pCsr, 0) ){
return SQLITE_LOCKED; /* The table pCur points to has a read lock */
}
if( pCsr->eState==CURSOR_INVALID || !pCsr->apPage[pCsr->iPage]->intKey ){