Additional commands and another procedure name changes for clarity of

presentation. No logic changes. (CVS 6323)

FossilOrigin-Name: 91d9d51e03657e7492dd7b93e66c82b152abec3b
This commit is contained in:
drh 2009-02-24 19:21:41 +00:00
parent c25eabedef
commit 11b57d6929
3 changed files with 24 additions and 22 deletions

View File

@ -1,5 +1,5 @@
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
@ -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 10c415effaf89b047a7c4178d10b5ee93a480106
F src/btree.c c219cd5d46fc39540c44e15bf7e9e36c06496f51
F src/btree.h 96a019c9f28da38e79940512d7800e419cd8c702
F src/btreeInt.h 0a4884e6152d7cae9c741e91b830064c19fd2c05
F src/build.c a1db48aec62c95049d783f231195812ff97ae268
@ -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 44f0162ebb760dd6926ee5691752b6798e3aacb9
R 94eaff1a860808fd91188cf96085c1fc
P b99c1815fe270decf1ac3d714acc7e945d1e728a
R 52f851adc25a6b49b81feac1c5feb754
U drh
Z b49eeab63aacbd5e3c0381ee3e34c6a7
Z 7a0daf7b4a8f562b34bdae9981a338a7

View File

@ -1 +1 @@
b99c1815fe270decf1ac3d714acc7e945d1e728a
91d9d51e03657e7492dd7b93e66c82b152abec3b

View File

@ -9,7 +9,7 @@
** 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.
@ -68,7 +68,7 @@ int sqlite3_enable_shared_cache(int enable){
/*
** Forward declaration
*/
static int checkReadLocks(Btree*, Pgno, BtCursor*, i64);
static int checkForReadConflicts(Btree*, Pgno, BtCursor*, i64);
#ifdef SQLITE_OMIT_SHARED_CACHE
@ -2942,7 +2942,7 @@ static int btreeCursor(
if( NEVER(pBt->readOnly) ){
return SQLITE_READONLY;
}
if( checkReadLocks(p, iTable, 0, 0) ){
if( checkForReadConflicts(p, iTable, 0, 0) ){
return SQLITE_LOCKED;
}
}
@ -5918,9 +5918,9 @@ static int balance(BtCursor *pCur, int isInsert){
** 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
@ -5942,11 +5942,11 @@ static int balance(BtCursor *pCur, int isInsert){
** 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;
@ -6009,7 +6009,7 @@ int sqlite3BtreeInsert(
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 ){
@ -6106,7 +6106,9 @@ int sqlite3BtreeDelete(BtCursor *pCur){
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 */
}
@ -6492,7 +6494,7 @@ int sqlite3BtreeClearTable(Btree *p, int iTable, int *pnChange){
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 */
@ -7443,7 +7445,7 @@ int sqlite3BtreePutData(BtCursor *pCsr, u32 offset, u32 amt, void *z){
}
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 ){