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

@@ -1,5 +1,5 @@
C Fix\sa\sbug\sin\sthe\sCOPY\scommand\sintroduced\sby\scheck-in\s(991).\s(CVS\s996) C The\sOP_Checkpoint\sopcode\sis\snow\sa\sno-op\sif\sinvoked\son\sa\sdatabase\sthat\salready\nhas\san\sactive\scheckpoint\sjournal.\s\sTicket\s#333.\s(CVS\s997)
D 2003-06-02T22:50:26 D 2003-06-02T23:14:13
F Makefile.in 1ff85c27d4350c74118341024e8a4fb2a04a3a43 F Makefile.in 1ff85c27d4350c74118341024e8a4fb2a04a3a43
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@@ -47,7 +47,7 @@ F src/select.c 76b3a5cda76421cfe82d6a96c72308c2518cb2f9
F src/shell.c b63089a91d6584df06eaa2e53ea1150c68ab1e61 F src/shell.c b63089a91d6584df06eaa2e53ea1150c68ab1e61
F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
F src/sqlite.h.in eec06462cba262c0ee03f38462a18a4bc66dda4e F src/sqlite.h.in eec06462cba262c0ee03f38462a18a4bc66dda4e
F src/sqliteInt.h ad7895b4cd9ae7fed25d98ee6f91d7d4774fdc84 F src/sqliteInt.h 7562ea21beb84e4f90ea0e016b02945ac35350a9
F src/table.c 4301926464d88d2c2c7cd21c3360aa75bf068b95 F src/table.c 4301926464d88d2c2c7cd21c3360aa75bf068b95
F src/tclsqlite.c 9e25f98f1765afa0716144ef57abda75c88f688d F src/tclsqlite.c 9e25f98f1765afa0716144ef57abda75c88f688d
F src/test1.c 4596acd9d9f2a49fda0160a8a6dee5bfc7c6c325 F src/test1.c 4596acd9d9f2a49fda0160a8a6dee5bfc7c6c325
@@ -59,7 +59,7 @@ F src/trigger.c 5caf7697e6cd4cfaf38d55bff31580f4124d836f
F src/update.c 24260b4fda00c9726d27699a0561d53c0dccc397 F src/update.c 24260b4fda00c9726d27699a0561d53c0dccc397
F src/util.c 18d16fa3171e34b6f6f73ef0c61e7d9b73b78826 F src/util.c 18d16fa3171e34b6f6f73ef0c61e7d9b73b78826
F src/vacuum.c 0820984615786c9ccdaad8032a792309b354a8eb F src/vacuum.c 0820984615786c9ccdaad8032a792309b354a8eb
F src/vdbe.c 0f09d140c311a843676c0e9f9a8272ed47cad7a4 F src/vdbe.c 4170cba0a05da0a93dcd674859fc1ce18f3fb0a3
F src/vdbe.h 985c24f312d10f9ef8f9a8b8ea62fcdf68e82f21 F src/vdbe.h 985c24f312d10f9ef8f9a8b8ea62fcdf68e82f21
F src/where.c 1e645d430cb4b347159c28c6085e9801160f2099 F src/where.c 1e645d430cb4b347159c28c6085e9801160f2099
F test/all.test 569a92a8ee88f5300c057cc4a8f50fbbc69a3242 F test/all.test 569a92a8ee88f5300c057cc4a8f50fbbc69a3242
@@ -165,7 +165,7 @@ F www/speed.tcl cb4c10a722614aea76d2c51f32ee43400d5951be
F www/sqlite.tcl 4bd1729e320f5fa9125f0022b281fbe839192125 F www/sqlite.tcl 4bd1729e320f5fa9125f0022b281fbe839192125
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331 F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218 F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
P 89957b09ce746cf98d5d75cab2a23994e27c4937 P 77ec13dab85b70795ef06ff2c714cca0cd496837
R 19e4f618ecebcc891f9a6f0384dad1dd R d450e05d46a3501d91726056bd4029e5
U drh U drh
Z 2724cf1f234f4f3e53681523549e7156 Z ef7ae355ee25a92de1dd5e8db797cf3d

View File

@@ -1 +1 @@
77ec13dab85b70795ef06ff2c714cca0cd496837 daf7b94017f03638da1ef65830f3762be030b93c

View File

@@ -11,7 +11,7 @@
************************************************************************* *************************************************************************
** Internal interface definitions for SQLite. ** Internal interface definitions for SQLite.
** **
** @(#) $Id: sqliteInt.h,v 1.189 2003/05/31 16:21:13 drh Exp $ ** @(#) $Id: sqliteInt.h,v 1.190 2003/06/02 23:14:13 drh Exp $
*/ */
#include "config.h" #include "config.h"
#include "sqlite.h" #include "sqlite.h"
@@ -241,7 +241,7 @@ struct Db {
Hash idxHash; /* All (named) indices indexed by name */ Hash idxHash; /* All (named) indices indexed by name */
Hash trigHash; /* All triggers indexed by name */ Hash trigHash; /* All triggers indexed by name */
Hash aFKey; /* Foreign keys indexed by to-table */ Hash aFKey; /* Foreign keys indexed by to-table */
u8 inTrans; /* True if a transaction is underway for this backend */ u8 inTrans; /* 0: not writable. 1: Transaction. 2: Checkpoint */
u16 flags; /* Flags associated with this database */ u16 flags; /* Flags associated with this database */
}; };

View File

@@ -36,7 +36,7 @@
** in this file for details. If in doubt, do not deviate from existing ** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code. ** 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 "sqliteInt.h"
#include <ctype.h> #include <ctype.h>
@@ -3168,8 +3168,9 @@ case OP_IncrKey: {
*/ */
case OP_Checkpoint: { case OP_Checkpoint: {
int i = pOp->p1; 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); rc = sqliteBtreeBeginCkpt(db->aDb[i].pBt);
if( rc==SQLITE_OK ) db->aDb[i].inTrans = 2;
} }
break; break;
} }
@@ -5826,8 +5827,9 @@ int sqliteVdbeFinalize(Vdbe *p, char **pzErrMsg){
sqliteRollbackInternalChanges(db); sqliteRollbackInternalChanges(db);
} }
for(i=0; i<db->nDb; i++){ 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); sqliteBtreeCommitCkpt(db->aDb[i].pBt);
db->aDb[i].inTrans = 1;
} }
} }
assert( p->tos<p->pc || sqlite_malloc_failed==1 ); assert( p->tos<p->pc || sqlite_malloc_failed==1 );