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

Bug fix in BTree shared cache locking code. (CVS 4246)

FossilOrigin-Name: 399d3e755253a7b4604a62b9f171e0f1154134e2
This commit is contained in:
drh
2007-08-20 13:14:28 +00:00
parent 482ea18fde
commit abddb0c8c4
4 changed files with 25 additions and 15 deletions

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.401 2007/08/17 16:50:38 danielk1977 Exp $
** $Id: btree.c,v 1.402 2007/08/20 13:14:29 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
@@ -1207,7 +1207,7 @@ int sqlite3BtreeOpen(
#if !defined(SQLITE_OMIT_SHARED_CACHE) && !defined(SQLITE_OMIT_DISKIO)
/* If the new Btree uses a sharable pBtShared, then link the new
** Btree into the list of all sharable Btrees for the same connection.
** The list is kept in ascending order by pBtShared address.
** The list is kept in ascending order by pBt address.
*/
if( p->sharable ){
int i;
@@ -1220,7 +1220,7 @@ int sqlite3BtreeOpen(
p->pPrev = 0;
pSib->pPrev = p;
}else{
while( pSib->pNext && pSib->pNext->pBt>p->pBt ){
while( pSib->pNext && pSib->pNext->pBt<p->pBt ){
pSib = pSib->pNext;
}
p->pNext = pSib->pNext;
@@ -1323,7 +1323,6 @@ int sqlite3BtreeClose(Btree *p){
** Clean out and delete the BtShared object.
*/
assert( !pBt->pCursor );
assert( pBt->nRef==0 );
sqlite3PagerClose(pBt->pPager);
if( pBt->xFreeSchema && pBt->pSchema ){
pBt->xFreeSchema(pBt->pSchema);