mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Change incremental vacuum to be triggered by a pragma rather than a command.
We have a lot to learn about this yet and we do not want to paint ourselves into a corner by commiting to specific syntax too early. (CVS 3921) FossilOrigin-Name: b13e497a326697ab42b429993a1eee7df3c0c3eb
This commit is contained in:
23
src/pragma.c
23
src/pragma.c
@@ -11,7 +11,7 @@
|
||||
*************************************************************************
|
||||
** This file contains code used to implement the PRAGMA command.
|
||||
**
|
||||
** $Id: pragma.c,v 1.133 2007/04/26 14:42:36 danielk1977 Exp $
|
||||
** $Id: pragma.c,v 1.134 2007/05/04 18:30:41 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "os.h"
|
||||
@@ -414,6 +414,27 @@ void sqlite3Pragma(
|
||||
}else
|
||||
#endif
|
||||
|
||||
/*
|
||||
** PRAGMA [database.]incremental_vacuum(N)
|
||||
**
|
||||
** Do N steps of incremental vacuuming on a database.
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_AUTOVACUUM
|
||||
if( sqlite3StrICmp(zLeft,"incremental_vacuum")==0 ){
|
||||
int iLimit, addr;
|
||||
if( zRight==0 || !sqlite3GetInt32(zRight, &iLimit) || iLimit<=0 ){
|
||||
iLimit = 0x7fffffff;
|
||||
}
|
||||
sqlite3BeginWriteOperation(pParse, 0, iDb);
|
||||
sqlite3VdbeAddOp(v, OP_MemInt, iLimit, 0);
|
||||
addr = sqlite3VdbeAddOp(v, OP_IncrVacuum, iDb, 0);
|
||||
sqlite3VdbeAddOp(v, OP_Callback, 0, 0);
|
||||
sqlite3VdbeAddOp(v, OP_MemIncr, -1, 0);
|
||||
sqlite3VdbeAddOp(v, OP_IfMemPos, 0, addr);
|
||||
sqlite3VdbeJumpHere(v, addr);
|
||||
}else
|
||||
#endif
|
||||
|
||||
#ifndef SQLITE_OMIT_PAGER_PRAGMAS
|
||||
/*
|
||||
** PRAGMA [database.]cache_size
|
||||
|
||||
Reference in New Issue
Block a user