mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
In the btree.c, when releasing the page1 lock, first make sure the
pager has not reset and released the lock already. This fixes a bug introduced by (3549). (CVS 3563) FossilOrigin-Name: 36a2db96efa7f227c0a39e58fd83d56cc491472b
This commit is contained in:
14
manifest
14
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Get\sthreadtest2.c\sworking\sagain\safter\sbeing\slong\sneglected.\s(CVS\s3562)
|
C In\sthe\sbtree.c,\swhen\sreleasing\sthe\spage1\slock,\sfirst\smake\ssure\sthe\npager\shas\snot\sreset\sand\sreleased\sthe\slock\salready.\s\sThis\sfixes\sa\sbug\nintroduced\sby\s(3549).\s(CVS\s3563)
|
||||||
D 2007-01-05T01:58:27
|
D 2007-01-05T02:00:47
|
||||||
F Makefile.in 63a71177ed4355c829229affe11167bd28c85884
|
F Makefile.in 63a71177ed4355c829229affe11167bd28c85884
|
||||||
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
|
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
|
||||||
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
|
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
|
||||||
@@ -57,7 +57,7 @@ F src/alter.c 2c79ec40f65e33deaf90ca493422c74586e481a3
|
|||||||
F src/analyze.c 7d2b7ab9a9c2fd6e55700f69064dfdd3e36d7a8a
|
F src/analyze.c 7d2b7ab9a9c2fd6e55700f69064dfdd3e36d7a8a
|
||||||
F src/attach.c b11eb4d5d3fb99a10a626956bccc7215f6b68b16
|
F src/attach.c b11eb4d5d3fb99a10a626956bccc7215f6b68b16
|
||||||
F src/auth.c 902f4722661c796b97f007d9606bd7529c02597f
|
F src/auth.c 902f4722661c796b97f007d9606bd7529c02597f
|
||||||
F src/btree.c e7d1694ad0844918e20b802a249533789bf811dc
|
F src/btree.c 6837dcc4da8677e695a49fcc4505418ff1e0fc54
|
||||||
F src/btree.h 061c50e37de7f50b58528e352d400cf33ead7418
|
F src/btree.h 061c50e37de7f50b58528e352d400cf33ead7418
|
||||||
F src/build.c 02aedde724dc73295d6e9b8dc29afb5dd38de507
|
F src/build.c 02aedde724dc73295d6e9b8dc29afb5dd38de507
|
||||||
F src/callback.c fd9bb39f7ff6b52bad8365617abc61c720640429
|
F src/callback.c fd9bb39f7ff6b52bad8365617abc61c720640429
|
||||||
@@ -85,7 +85,7 @@ F src/os_unix.c 9fbbd8ab0a6b3992370ba0f3aae11feff2a78c96
|
|||||||
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
|
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
|
||||||
F src/os_win.c 92df146ed964401969831a19bb490d76ce4de4c0
|
F src/os_win.c 92df146ed964401969831a19bb490d76ce4de4c0
|
||||||
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
|
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
|
||||||
F src/pager.c 48296c371c44bf43f1c02e221142149797f33072
|
F src/pager.c d6ad66eb119602cb2e6a097f8f635372ba677d23
|
||||||
F src/pager.h 2e6d42f4ae004ae748a037b8468112b851c447a7
|
F src/pager.h 2e6d42f4ae004ae748a037b8468112b851c447a7
|
||||||
F src/parse.y 2f571c5f6219428d7fb08737db3d113742b1cceb
|
F src/parse.y 2f571c5f6219428d7fb08737db3d113742b1cceb
|
||||||
F src/pragma.c fd4df6cf0857dd78a7cb5be5f9805419b53ae7a0
|
F src/pragma.c fd4df6cf0857dd78a7cb5be5f9805419b53ae7a0
|
||||||
@@ -424,7 +424,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
|
|||||||
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
||||||
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
|
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
|
||||||
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
|
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
|
||||||
P c28664d314b8caa2844072ee9e5a50901996dc1e
|
P 06216d0d3be38bfabda9f5f450a5eaccd20b52b9
|
||||||
R d3860e79b5446a0a1dfcf30d4a72043d
|
R 88a6682f27b71c9c3c9099b414f32bc9
|
||||||
U drh
|
U drh
|
||||||
Z c3e34cb4afa4398fa1c661a71381ed9d
|
Z 6815214498fce035470cac08b531711b
|
||||||
|
@@ -1 +1 @@
|
|||||||
06216d0d3be38bfabda9f5f450a5eaccd20b52b9
|
36a2db96efa7f227c0a39e58fd83d56cc491472b
|
17
src/btree.c
17
src/btree.c
@@ -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.332 2006/12/18 18:34:51 drh Exp $
|
** $Id: btree.c,v 1.333 2007/01/05 02:00:47 drh 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
|
||||||
@@ -1931,13 +1931,15 @@ static int lockBtreeWithRetry(Btree *pRef){
|
|||||||
*/
|
*/
|
||||||
static void unlockBtreeIfUnused(BtShared *pBt){
|
static void unlockBtreeIfUnused(BtShared *pBt){
|
||||||
if( pBt->inTransaction==TRANS_NONE && pBt->pCursor==0 && pBt->pPage1!=0 ){
|
if( pBt->inTransaction==TRANS_NONE && pBt->pCursor==0 && pBt->pPage1!=0 ){
|
||||||
if( pBt->pPage1->aData==0 ){
|
if( sqlite3pager_refcount(pBt->pPager)>=1 ){
|
||||||
MemPage *pPage = pBt->pPage1;
|
if( pBt->pPage1->aData==0 ){
|
||||||
pPage->aData = &((u8*)pPage)[-pBt->pageSize];
|
MemPage *pPage = pBt->pPage1;
|
||||||
pPage->pBt = pBt;
|
pPage->aData = &((u8*)pPage)[-pBt->pageSize];
|
||||||
pPage->pgno = 1;
|
pPage->pBt = pBt;
|
||||||
|
pPage->pgno = 1;
|
||||||
|
}
|
||||||
|
releasePage(pBt->pPage1);
|
||||||
}
|
}
|
||||||
releasePage(pBt->pPage1);
|
|
||||||
pBt->pPage1 = 0;
|
pBt->pPage1 = 0;
|
||||||
pBt->inStmt = 0;
|
pBt->inStmt = 0;
|
||||||
}
|
}
|
||||||
@@ -6424,7 +6426,6 @@ int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){
|
|||||||
rc = sqlite3pager_get(pBtFrom->pPager, i, &pPage);
|
rc = sqlite3pager_get(pBtFrom->pPager, i, &pPage);
|
||||||
if( rc ) break;
|
if( rc ) break;
|
||||||
rc = sqlite3pager_overwrite(pBtTo->pPager, i, pPage);
|
rc = sqlite3pager_overwrite(pBtTo->pPager, i, pPage);
|
||||||
if( rc ) break;
|
|
||||||
sqlite3pager_unref(pPage);
|
sqlite3pager_unref(pPage);
|
||||||
}
|
}
|
||||||
for(i=nPage+1; rc==SQLITE_OK && i<=nToPage; i++){
|
for(i=nPage+1; rc==SQLITE_OK && i<=nToPage; i++){
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
** file simultaneously, or one process from reading the database while
|
** file simultaneously, or one process from reading the database while
|
||||||
** another is writing.
|
** another is writing.
|
||||||
**
|
**
|
||||||
** @(#) $Id: pager.c,v 1.281 2007/01/04 14:58:14 drh Exp $
|
** @(#) $Id: pager.c,v 1.282 2007/01/05 02:00:47 drh Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef SQLITE_OMIT_DISKIO
|
#ifndef SQLITE_OMIT_DISKIO
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
@@ -379,8 +379,8 @@ static const unsigned char aJournalMagic[] = {
|
|||||||
static int cnt = 0;
|
static int cnt = 0;
|
||||||
if( !pager3_refinfo_enable ) return;
|
if( !pager3_refinfo_enable ) return;
|
||||||
sqlite3DebugPrintf(
|
sqlite3DebugPrintf(
|
||||||
"REFCNT: %4d addr=%p nRef=%d\n",
|
"REFCNT: %4d addr=%p nRef=%-3d total=%d\n",
|
||||||
p->pgno, PGHDR_TO_DATA(p), p->nRef
|
p->pgno, PGHDR_TO_DATA(p), p->nRef, p->pPager->nRef
|
||||||
);
|
);
|
||||||
cnt++; /* Something to set a breakpoint on */
|
cnt++; /* Something to set a breakpoint on */
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user