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

If an error occurs in PagerBegin(), call pager_end_transaction() to reset the internal state of the pager object. (CVS 6855)

FossilOrigin-Name: ea7ed16628da29cf4a127a25cbac8ae553e2ac1f
This commit is contained in:
danielk1977
2009-07-07 13:56:24 +00:00
parent 4925a55d14
commit 75a4012765
3 changed files with 18 additions and 9 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.604 2009/07/06 21:54:41 drh Exp $
** @(#) $Id: pager.c,v 1.605 2009/07/07 13:56:24 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
@@ -4166,6 +4166,15 @@ int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){
PAGERTRACE(("TRANSACTION %d\n", PAGERID(pPager)));
assert( !isOpen(pPager->jfd) || pPager->journalOff>0 || rc!=SQLITE_OK );
if( rc!=SQLITE_OK ){
assert( !pPager->dbModified );
/* Ignore any IO error that occurs within pager_end_transaction(). The
** purpose of this call is to reset the internal state of the pager
** sub-system. It doesn't matter if the journal-file is not properly
** finalized at this point (since it is not a valid journal file anyway).
*/
pager_end_transaction(pPager, 0);
}
return rc;
}