1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Add the max_page_count pragma used to limit the maximum size of a database

file.  Untested. (CVS 3948)

FossilOrigin-Name: b1b74f06688fd90fcaf54cf95e2e7beeb5fc1040
This commit is contained in:
drh
2007-05-08 14:51:36 +00:00
parent 17374e8f94
commit f8e632b630
9 changed files with 90 additions and 27 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the PRAGMA command.
**
** $Id: pragma.c,v 1.135 2007/05/08 01:08:49 drh Exp $
** $Id: pragma.c,v 1.136 2007/05/08 14:51:37 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -344,6 +344,27 @@ void sqlite3Pragma(
}
}else
/*
** PRAGMA [database.]max_page_count
** PRAGMA [database.]max_page_count=N
**
** The first form reports the current setting for the
** maximum number of pages in the database file. The
** second form attempts to change this setting. Both
** forms return the current setting.
*/
if( sqlite3StrICmp(zLeft,"max_page_count")==0 ){
Btree *pBt = pDb->pBt;
int newMax = 0;
if( zRight ){
newMax = atoi(zRight);
}
if( pBt ){
newMax = sqlite3BtreeMaxPageCount(pBt, newMax);
}
returnSingleInt(pParse, "max_page_count", newMax);
}else
/*
** PRAGMA [database.]locking_mode
** PRAGMA [database.]locking_mode = (normal|exclusive)