1
0
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:
danielk1977
2006-01-23 13:47:47 +00:00
parent c93cc42df8
commit 7f7bc66ef2
4 changed files with 21 additions and 33 deletions

View File

@@ -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;
}