mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
In shared-cache mode, do not allow one connection to checkpoint a database while a second connection is reading or writing the same shared-cache.
FossilOrigin-Name: e75b52d156905ce16bedb94f65c01a4640bdfa75
This commit is contained in:
11
src/main.c
11
src/main.c
@@ -1308,16 +1308,7 @@ int sqlite3Checkpoint(sqlite3 *db, int iDb){
|
||||
|
||||
for(i=0; i<db->nDb && rc==SQLITE_OK; i++){
|
||||
if( i==iDb || iDb==SQLITE_MAX_ATTACHED ){
|
||||
Btree *pBt = db->aDb[i].pBt;
|
||||
if( pBt ){
|
||||
if( sqlite3BtreeIsInReadTrans(pBt) ){
|
||||
rc = SQLITE_LOCKED;
|
||||
}else{
|
||||
sqlite3BtreeEnter(pBt);
|
||||
rc = sqlite3PagerCheckpoint(sqlite3BtreePager(pBt));
|
||||
sqlite3BtreeLeave(pBt);
|
||||
}
|
||||
}
|
||||
rc = sqlite3BtreeCheckpoint(db->aDb[i].pBt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user