1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +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

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.377 2007/05/05 18:39:25 drh Exp $
** $Id: btree.c,v 1.378 2007/05/08 14:51:37 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
@@ -1332,6 +1332,15 @@ int sqlite3BtreeGetPageSize(Btree *p){
int sqlite3BtreeGetReserve(Btree *p){
return p->pBt->pageSize - p->pBt->usableSize;
}
/*
** Set the maximum page count for a database if mxPage is positive.
** No changes are made if mxPage is 0 or negative.
** Regardless of the value of mxPage, return the maximum page count.
*/
int sqlite3BtreeMaxPageCount(Btree *p, int mxPage){
return sqlite3PagerMaxPageCount(p->pBt->pPager, mxPage);
}
#endif /* !defined(SQLITE_OMIT_PAGER_PRAGMAS) || !defined(SQLITE_OMIT_VACUUM) */
/*