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

The OP_Checkpoint opcode is now a no-op if invoked on a database that already

has an active checkpoint journal.  Ticket #333. (CVS 997)

FossilOrigin-Name: daf7b94017f03638da1ef65830f3762be030b93c
This commit is contained in:
drh
2003-06-02 23:14:13 +00:00
parent 2394e376d6
commit 1aa4965ae3
4 changed files with 15 additions and 13 deletions

View File

@@ -36,7 +36,7 @@
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
** $Id: vdbe.c,v 1.224 2003/06/02 06:15:59 jplyon Exp $
** $Id: vdbe.c,v 1.225 2003/06/02 23:14:13 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -3168,8 +3168,9 @@ case OP_IncrKey: {
*/
case OP_Checkpoint: {
int i = pOp->p1;
if( i>=0 && i<db->nDb && db->aDb[i].pBt ){
if( i>=0 && i<db->nDb && db->aDb[i].pBt && db->aDb[i].inTrans==1 ){
rc = sqliteBtreeBeginCkpt(db->aDb[i].pBt);
if( rc==SQLITE_OK ) db->aDb[i].inTrans = 2;
}
break;
}
@@ -5826,8 +5827,9 @@ int sqliteVdbeFinalize(Vdbe *p, char **pzErrMsg){
sqliteRollbackInternalChanges(db);
}
for(i=0; i<db->nDb; i++){
if( db->aDb[i].pBt ){
if( db->aDb[i].pBt && db->aDb[i].inTrans==2 ){
sqliteBtreeCommitCkpt(db->aDb[i].pBt);
db->aDb[i].inTrans = 1;
}
}
assert( p->tos<p->pc || sqlite_malloc_failed==1 );