mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Avoid parsing the structure of b-tree pages (in sqlite3BtreeInitPage) more than is necessary. (CVS 5720)
FossilOrigin-Name: 6b998f3066754e219c266501327e5578c9406b63
This commit is contained in:
11
src/pcache.c
11
src/pcache.c
@@ -11,7 +11,7 @@
|
||||
*************************************************************************
|
||||
** This file implements that page cache.
|
||||
**
|
||||
** @(#) $Id: pcache.c,v 1.29 2008/09/17 20:06:26 drh Exp $
|
||||
** @(#) $Id: pcache.c,v 1.30 2008/09/18 17:34:44 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -1019,7 +1019,11 @@ void sqlite3PcacheCommit(PCache *pCache, int idJournal){
|
||||
/*
|
||||
** Rollback a change previously preserved.
|
||||
*/
|
||||
void sqlite3PcacheRollback(PCache *pCache, int idJournal){
|
||||
void sqlite3PcacheRollback(
|
||||
PCache *pCache, /* Pager cache */
|
||||
int idJournal, /* Which copy to rollback to */
|
||||
void (*xReiniter)(PgHdr*) /* Called on each rolled back page */
|
||||
){
|
||||
PgHdr *p;
|
||||
int sz;
|
||||
int mask = idJournal==0 ? ~PGHDR_IN_JOURNAL : 0xffffff;
|
||||
@@ -1030,6 +1034,9 @@ void sqlite3PcacheRollback(PCache *pCache, int idJournal){
|
||||
memcpy(p->pData, p->apSave[idJournal], sz);
|
||||
pcacheFree(p->apSave[idJournal]);
|
||||
p->apSave[idJournal] = 0;
|
||||
if( xReiniter ){
|
||||
xReiniter(p);
|
||||
}
|
||||
}
|
||||
p->flags &= mask;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user