mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Do not automatically rollback at the btree or pager level if a commit fails. (CVS 2999)
FossilOrigin-Name: 0f6329ef1fe0d5b225b6381fda1e8d800f65ea0f
This commit is contained in:
25
src/pager.c
25
src/pager.c
@@ -18,7 +18,7 @@
|
||||
** file simultaneously, or one process from reading the database while
|
||||
** another is writing.
|
||||
**
|
||||
** @(#) $Id: pager.c,v 1.250 2006/01/23 13:09:46 danielk1977 Exp $
|
||||
** @(#) $Id: pager.c,v 1.251 2006/01/23 13:47:47 danielk1977 Exp $
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_DISKIO
|
||||
#include "sqliteInt.h"
|
||||
@@ -3249,16 +3249,8 @@ int sqlite3pager_commit(Pager *pPager){
|
||||
int rc;
|
||||
PgHdr *pPg;
|
||||
|
||||
if( pPager->errCode==SQLITE_FULL ){
|
||||
rc = sqlite3pager_rollback(pPager);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = SQLITE_FULL;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
if( pPager->errCode ){
|
||||
rc = pPager->errCode;
|
||||
return rc;
|
||||
return pPager->errCode;
|
||||
}
|
||||
if( pPager->state<PAGER_RESERVED ){
|
||||
return SQLITE_ERROR;
|
||||
@@ -3296,17 +3288,10 @@ int sqlite3pager_commit(Pager *pPager){
|
||||
}
|
||||
assert( pPager->journalOpen );
|
||||
rc = sqlite3pager_sync(pPager, 0, 0);
|
||||
if( rc!=SQLITE_OK ){
|
||||
goto commit_abort;
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = pager_unwritelock(pPager);
|
||||
pPager->dbSize = -1;
|
||||
}
|
||||
rc = pager_unwritelock(pPager);
|
||||
pPager->dbSize = -1;
|
||||
return rc;
|
||||
|
||||
/* Jump here if anything goes wrong during the commit process.
|
||||
*/
|
||||
commit_abort:
|
||||
sqlite3pager_rollback(pPager);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user