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

Change the BTree so that it uses the Pagers temporary page space when

reorganizing the rows on a page, rather than mallocing for space of
its own.  In this way, we avoid having to deal with a malloc failure
deep down inside the page reorganizer.  Ticket #2806 (CVS 4577)

FossilOrigin-Name: 98960132dc082da61652201f4bd2b559725350c0
This commit is contained in:
drh
2007-11-28 16:19:56 +00:00
parent 0167f28508
commit 26b7994a97
5 changed files with 26 additions and 15 deletions

View File

@@ -18,7 +18,7 @@
** file simultaneously, or one process from reading the database while
** another is writing.
**
** @(#) $Id: pager.c,v 1.395 2007/11/27 16:55:08 drh Exp $
** @(#) $Id: pager.c,v 1.396 2007/11/28 16:19:56 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
@@ -2332,6 +2332,18 @@ int sqlite3PagerSetPagesize(Pager *pPager, u16 *pPageSize){
return rc;
}
/*
** Return a pointer to the "temporary page" buffer held internally
** by the pager. This is a buffer that is big enough to hold the
** entire content of a database page. This buffer is used internally
** during rollback and will be overwritten whenever a rollback
** occurs. But other modules are free to use it too, as long as
** no rollbacks are happening.
*/
void *sqlite3PagerTempSpace(Pager *pPager){
return pPager->pTmpSpace;
}
/*
** Attempt to set the maximum database page count if mxPage is positive.
** Make no changes if mxPage is zero or negative. And never reduce the