mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Further simplifications to pager.c in support of structural coverage testing. (CVS 6929)
FossilOrigin-Name: 866216c0b6ba23b66483046fb402ddbe4f9a7b14
This commit is contained in:
20
manifest
20
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Allow\svirtual\stables\sto\sbe\sused\sin\sshared-cache\smode.\s(CVS\s6928)
|
C Further\ssimplifications\sto\spager.c\sin\ssupport\sof\sstructural\scoverage\stesting.\s(CVS\s6929)
|
||||||
D 2009-07-24T17:58:53
|
D 2009-07-24T19:01:19
|
||||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||||
F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
|
F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
|
||||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||||
@@ -106,7 +106,7 @@ F src/auth.c 802a9439dfa0b8c208b10055cba400e82ef18025
|
|||||||
F src/backup.c 6f1c2d9862c8a3feb7739dfcca02c1f5352e37f3
|
F src/backup.c 6f1c2d9862c8a3feb7739dfcca02c1f5352e37f3
|
||||||
F src/bitvec.c cfbf6af5b0ababb4f06ed3e75c616dadaf47fcbd
|
F src/bitvec.c cfbf6af5b0ababb4f06ed3e75c616dadaf47fcbd
|
||||||
F src/btmutex.c 0f43a75bb5b8147b386e8e1c3e71ba734e3863b7
|
F src/btmutex.c 0f43a75bb5b8147b386e8e1c3e71ba734e3863b7
|
||||||
F src/btree.c c1d3d67007f2f49697b4204bf44f2a8f45f750df
|
F src/btree.c 46f24d0b659583bae13b7f22534e5f529ebc0684
|
||||||
F src/btree.h 577448a890c2ab9b21e6ab74f073526184bceebe
|
F src/btree.h 577448a890c2ab9b21e6ab74f073526184bceebe
|
||||||
F src/btreeInt.h 1c86297e69380f6577e7ae67452597dd8d5c2705
|
F src/btreeInt.h 1c86297e69380f6577e7ae67452597dd8d5c2705
|
||||||
F src/build.c a15de7c5d020a778b641fca0b2510126843f4b30
|
F src/build.c a15de7c5d020a778b641fca0b2510126843f4b30
|
||||||
@@ -147,8 +147,8 @@ F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc
|
|||||||
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
|
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
|
||||||
F src/os_unix.c cdb2a08b9ce4aa13b3f7b91d4dd60fb48be9f56a
|
F src/os_unix.c cdb2a08b9ce4aa13b3f7b91d4dd60fb48be9f56a
|
||||||
F src/os_win.c 725c38a524d168ce280446ad8761d731bc516405
|
F src/os_win.c 725c38a524d168ce280446ad8761d731bc516405
|
||||||
F src/pager.c 80910e68f6bde91dc96a3dcb5d8e5edf3505fa0d
|
F src/pager.c 1ad2dff309c92fbf0a7a2017ece5407d05b19937
|
||||||
F src/pager.h 5bd96ed838e4156e0effa5ffe746bce4c0112c24
|
F src/pager.h 11852d044c86cf5a9d6e34171fb0c4fcf1f6265f
|
||||||
F src/parse.y bcd46d43fbd23a22b8c020a3eb1806b794794ed5
|
F src/parse.y bcd46d43fbd23a22b8c020a3eb1806b794794ed5
|
||||||
F src/pcache.c 1dae135b70a029f81ed66f6e9b5d0db91480d5d0
|
F src/pcache.c 1dae135b70a029f81ed66f6e9b5d0db91480d5d0
|
||||||
F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324
|
F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324
|
||||||
@@ -169,7 +169,7 @@ F src/status.c 237b193efae0cf6ac3f0817a208de6c6c6ef6d76
|
|||||||
F src/table.c cc86ad3d6ad54df7c63a3e807b5783c90411a08d
|
F src/table.c cc86ad3d6ad54df7c63a3e807b5783c90411a08d
|
||||||
F src/tclsqlite.c e18e5013dc6bca9f25e6022fbe17ba3ccb821f95
|
F src/tclsqlite.c e18e5013dc6bca9f25e6022fbe17ba3ccb821f95
|
||||||
F src/test1.c c8f9358879876660b721369f576bf6e4ac5b9210
|
F src/test1.c c8f9358879876660b721369f576bf6e4ac5b9210
|
||||||
F src/test2.c ffb1649b7a33a0acd5bd1a98a376b9c104daa279
|
F src/test2.c 0de743ec8890ca4f09e0bce5d6d5a681f5957fec
|
||||||
F src/test3.c 2445c2beb5e7a0c91fd8136dc1339ec369a24898
|
F src/test3.c 2445c2beb5e7a0c91fd8136dc1339ec369a24898
|
||||||
F src/test4.c f79ab52d27ff49b784b631a42e2ccd52cfd5c84c
|
F src/test4.c f79ab52d27ff49b784b631a42e2ccd52cfd5c84c
|
||||||
F src/test5.c 162a1cea2105a2c460a3f39fa6919617b562a288
|
F src/test5.c 162a1cea2105a2c460a3f39fa6919617b562a288
|
||||||
@@ -741,7 +741,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
|||||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||||
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
|
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
|
||||||
P 7222ad2667b95d6021d9ae47f548b76b224f46aa
|
P 5d9e767a05e381235e064061043e30cc03a11a07
|
||||||
R 477ef377a502774f707ff161355dd337
|
R 22fe9f29fb6a7ee66218964085f3f2ec
|
||||||
U danielk1977
|
U drh
|
||||||
Z b547740a8551902f628dba2106d37250
|
Z 2136ce2091cca0331400af0c4f963123
|
||||||
|
@@ -1 +1 @@
|
|||||||
5d9e767a05e381235e064061043e30cc03a11a07
|
866216c0b6ba23b66483046fb402ddbe4f9a7b14
|
@@ -9,7 +9,7 @@
|
|||||||
** May you share freely, never taking more than you give.
|
** May you share freely, never taking more than you give.
|
||||||
**
|
**
|
||||||
*************************************************************************
|
*************************************************************************
|
||||||
** $Id: btree.c,v 1.702 2009/07/24 17:58:53 danielk1977 Exp $
|
** $Id: btree.c,v 1.703 2009/07/24 19:01:19 drh Exp $
|
||||||
**
|
**
|
||||||
** This file implements a external (disk-based) database using BTrees.
|
** This file implements a external (disk-based) database using BTrees.
|
||||||
** See the header comment on "btreeInt.h" for additional information.
|
** See the header comment on "btreeInt.h" for additional information.
|
||||||
@@ -1762,7 +1762,7 @@ int sqlite3BtreeOpen(
|
|||||||
goto btree_open_out;
|
goto btree_open_out;
|
||||||
}
|
}
|
||||||
rc = sqlite3PagerOpen(pVfs, &pBt->pPager, zFilename,
|
rc = sqlite3PagerOpen(pVfs, &pBt->pPager, zFilename,
|
||||||
EXTRA_SIZE, flags, vfsFlags);
|
EXTRA_SIZE, flags, vfsFlags, pageReinit);
|
||||||
if( rc==SQLITE_OK ){
|
if( rc==SQLITE_OK ){
|
||||||
rc = sqlite3PagerReadFileheader(pBt->pPager,sizeof(zDbHeader),zDbHeader);
|
rc = sqlite3PagerReadFileheader(pBt->pPager,sizeof(zDbHeader),zDbHeader);
|
||||||
}
|
}
|
||||||
@@ -1773,7 +1773,6 @@ int sqlite3BtreeOpen(
|
|||||||
sqlite3PagerSetBusyhandler(pBt->pPager, btreeInvokeBusyHandler, pBt);
|
sqlite3PagerSetBusyhandler(pBt->pPager, btreeInvokeBusyHandler, pBt);
|
||||||
p->pBt = pBt;
|
p->pBt = pBt;
|
||||||
|
|
||||||
sqlite3PagerSetReiniter(pBt->pPager, pageReinit);
|
|
||||||
pBt->pCursor = 0;
|
pBt->pCursor = 0;
|
||||||
pBt->pPage1 = 0;
|
pBt->pPage1 = 0;
|
||||||
pBt->readOnly = sqlite3PagerIsreadonly(pBt->pPager);
|
pBt->readOnly = sqlite3PagerIsreadonly(pBt->pPager);
|
||||||
|
49
src/pager.c
49
src/pager.c
@@ -18,7 +18,7 @@
|
|||||||
** file simultaneously, or one process from reading the database while
|
** file simultaneously, or one process from reading the database while
|
||||||
** another is writing.
|
** another is writing.
|
||||||
**
|
**
|
||||||
** @(#) $Id: pager.c,v 1.615 2009/07/24 16:32:01 drh Exp $
|
** @(#) $Id: pager.c,v 1.616 2009/07/24 19:01:19 drh Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef SQLITE_OMIT_DISKIO
|
#ifndef SQLITE_OMIT_DISKIO
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
@@ -1323,9 +1323,9 @@ static int pager_end_transaction(Pager *pPager, int hasMaster){
|
|||||||
pPager->journalOff = 0;
|
pPager->journalOff = 0;
|
||||||
pPager->journalStarted = 0;
|
pPager->journalStarted = 0;
|
||||||
}else{
|
}else{
|
||||||
assert( pPager->journalMode==PAGER_JOURNALMODE_DELETE || rc );
|
assert( pPager->journalMode==PAGER_JOURNALMODE_DELETE );
|
||||||
sqlite3OsClose(pPager->jfd);
|
sqlite3OsClose(pPager->jfd);
|
||||||
if( rc==SQLITE_OK && !pPager->tempFile ){
|
if( !pPager->tempFile ){
|
||||||
rc = sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0);
|
rc = sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1575,9 +1575,7 @@ static int pager_playback_one_page(
|
|||||||
void *pData;
|
void *pData;
|
||||||
pData = pPg->pData;
|
pData = pPg->pData;
|
||||||
memcpy(pData, aData, pPager->pageSize);
|
memcpy(pData, aData, pPager->pageSize);
|
||||||
if( pPager->xReiniter ){
|
pPager->xReiniter(pPg);
|
||||||
pPager->xReiniter(pPg);
|
|
||||||
}
|
|
||||||
if( isMainJrnl && (!isSavepnt || *pOffset<=pPager->journalHdr) ){
|
if( isMainJrnl && (!isSavepnt || *pOffset<=pPager->journalHdr) ){
|
||||||
/* If the contents of this page were just restored from the main
|
/* If the contents of this page were just restored from the main
|
||||||
** journal file, then its content must be as they were when the
|
** journal file, then its content must be as they were when the
|
||||||
@@ -2361,17 +2359,6 @@ void sqlite3PagerSetBusyhandler(
|
|||||||
pPager->pBusyHandlerArg = pBusyHandlerArg;
|
pPager->pBusyHandlerArg = pBusyHandlerArg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
** Set the reinitializer for this pager. If not NULL, the reinitializer
|
|
||||||
** is called when the content of a page in cache is modified (restored)
|
|
||||||
** as part of a transaction or savepoint rollback. The callback gives
|
|
||||||
** higher-level code an opportunity to restore the EXTRA section to
|
|
||||||
** agree with the restored page data.
|
|
||||||
*/
|
|
||||||
void sqlite3PagerSetReiniter(Pager *pPager, void (*xReinit)(DbPage*)){
|
|
||||||
pPager->xReiniter = xReinit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Report the current page size and number of reserved bytes back
|
** Report the current page size and number of reserved bytes back
|
||||||
** to the codec.
|
** to the codec.
|
||||||
@@ -3144,7 +3131,8 @@ int sqlite3PagerOpen(
|
|||||||
const char *zFilename, /* Name of the database file to open */
|
const char *zFilename, /* Name of the database file to open */
|
||||||
int nExtra, /* Extra bytes append to each in-memory page */
|
int nExtra, /* Extra bytes append to each in-memory page */
|
||||||
int flags, /* flags controlling this file */
|
int flags, /* flags controlling this file */
|
||||||
int vfsFlags /* flags passed through to sqlite3_vfs.xOpen() */
|
int vfsFlags, /* flags passed through to sqlite3_vfs.xOpen() */
|
||||||
|
void (*xReinit)(DbPage*) /* Function to reinitialize pages */
|
||||||
){
|
){
|
||||||
u8 *pPtr;
|
u8 *pPtr;
|
||||||
Pager *pPager = 0; /* Pager object to allocate and return */
|
Pager *pPager = 0; /* Pager object to allocate and return */
|
||||||
@@ -3363,7 +3351,8 @@ int sqlite3PagerOpen(
|
|||||||
pPager->memDb = (u8)memDb;
|
pPager->memDb = (u8)memDb;
|
||||||
pPager->readOnly = (u8)readOnly;
|
pPager->readOnly = (u8)readOnly;
|
||||||
/* pPager->needSync = 0; */
|
/* pPager->needSync = 0; */
|
||||||
pPager->noSync = (pPager->tempFile || !useJournal) ?1:0;
|
assert( useJournal || pPager->tempFile );
|
||||||
|
pPager->noSync = pPager->tempFile;
|
||||||
pPager->fullSync = pPager->noSync ?0:1;
|
pPager->fullSync = pPager->noSync ?0:1;
|
||||||
pPager->sync_flags = SQLITE_SYNC_NORMAL;
|
pPager->sync_flags = SQLITE_SYNC_NORMAL;
|
||||||
/* pPager->pFirst = 0; */
|
/* pPager->pFirst = 0; */
|
||||||
@@ -3373,11 +3362,14 @@ int sqlite3PagerOpen(
|
|||||||
pPager->journalSizeLimit = SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT;
|
pPager->journalSizeLimit = SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT;
|
||||||
assert( isOpen(pPager->fd) || tempFile );
|
assert( isOpen(pPager->fd) || tempFile );
|
||||||
setSectorSize(pPager);
|
setSectorSize(pPager);
|
||||||
if( memDb ){
|
if( !useJournal ){
|
||||||
|
pPager->journalMode = PAGER_JOURNALMODE_OFF;
|
||||||
|
}else if( memDb ){
|
||||||
pPager->journalMode = PAGER_JOURNALMODE_MEMORY;
|
pPager->journalMode = PAGER_JOURNALMODE_MEMORY;
|
||||||
}
|
}
|
||||||
/* pPager->xBusyHandler = 0; */
|
/* pPager->xBusyHandler = 0; */
|
||||||
/* pPager->pBusyHandlerArg = 0; */
|
/* pPager->pBusyHandlerArg = 0; */
|
||||||
|
pPager->xReiniter = xReinit;
|
||||||
/* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */
|
/* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */
|
||||||
*ppPager = pPager;
|
*ppPager = pPager;
|
||||||
return SQLITE_OK;
|
return SQLITE_OK;
|
||||||
@@ -3422,7 +3414,7 @@ static int hasHotJournal(Pager *pPager, int *pExists){
|
|||||||
int exists; /* True if a journal file is present */
|
int exists; /* True if a journal file is present */
|
||||||
|
|
||||||
assert( pPager!=0 );
|
assert( pPager!=0 );
|
||||||
assert( pPager->useJournal );
|
assert( useJournal );
|
||||||
assert( isOpen(pPager->fd) );
|
assert( isOpen(pPager->fd) );
|
||||||
assert( !isOpen(pPager->jfd) );
|
assert( !isOpen(pPager->jfd) );
|
||||||
|
|
||||||
@@ -3518,6 +3510,7 @@ static int readDbPage(PgHdr *pPg){
|
|||||||
i64 iOffset; /* Byte offset of file to read from */
|
i64 iOffset; /* Byte offset of file to read from */
|
||||||
|
|
||||||
assert( pPager->state>=PAGER_SHARED && !MEMDB );
|
assert( pPager->state>=PAGER_SHARED && !MEMDB );
|
||||||
|
assert( isOpen(pPager->fd) );
|
||||||
|
|
||||||
if( !isOpen(pPager->fd) ){
|
if( !isOpen(pPager->fd) ){
|
||||||
assert( pPager->tempFile );
|
assert( pPager->tempFile );
|
||||||
@@ -3897,7 +3890,7 @@ int sqlite3PagerAcquire(
|
|||||||
** a bit in a bit vector.
|
** a bit in a bit vector.
|
||||||
*/
|
*/
|
||||||
sqlite3BeginBenignMalloc();
|
sqlite3BeginBenignMalloc();
|
||||||
if( pgno<=pPager->dbOrigSize ){
|
if( ALWAYS(pgno<=pPager->dbOrigSize) ){
|
||||||
TESTONLY( rc = ) sqlite3BitvecSet(pPager->pInJournal, pgno);
|
TESTONLY( rc = ) sqlite3BitvecSet(pPager->pInJournal, pgno);
|
||||||
testcase( rc==SQLITE_NOMEM );
|
testcase( rc==SQLITE_NOMEM );
|
||||||
}
|
}
|
||||||
@@ -4021,6 +4014,7 @@ static int pager_open_journal(Pager *pPager){
|
|||||||
|
|
||||||
assert( pPager->state>=PAGER_RESERVED );
|
assert( pPager->state>=PAGER_RESERVED );
|
||||||
assert( pPager->useJournal );
|
assert( pPager->useJournal );
|
||||||
|
assert( pPager->journalMode!=PAGER_JOURNALMODE_OFF );
|
||||||
assert( pPager->pInJournal==0 );
|
assert( pPager->pInJournal==0 );
|
||||||
|
|
||||||
/* If already in the error state, this function is a no-op. But on
|
/* If already in the error state, this function is a no-op. But on
|
||||||
@@ -4115,6 +4109,7 @@ static int pager_open_journal(Pager *pPager){
|
|||||||
int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){
|
int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){
|
||||||
int rc = SQLITE_OK;
|
int rc = SQLITE_OK;
|
||||||
assert( pPager->state!=PAGER_UNLOCK );
|
assert( pPager->state!=PAGER_UNLOCK );
|
||||||
|
assert( pPager->useJournal );
|
||||||
pPager->subjInMemory = (u8)subjInMemory;
|
pPager->subjInMemory = (u8)subjInMemory;
|
||||||
if( pPager->state==PAGER_SHARED ){
|
if( pPager->state==PAGER_SHARED ){
|
||||||
assert( pPager->pInJournal==0 );
|
assert( pPager->pInJournal==0 );
|
||||||
@@ -4136,9 +4131,7 @@ int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){
|
|||||||
/* If the required locks were successfully obtained, open the journal
|
/* If the required locks were successfully obtained, open the journal
|
||||||
** file and write the first journal-header to it.
|
** file and write the first journal-header to it.
|
||||||
*/
|
*/
|
||||||
if( rc==SQLITE_OK && pPager->useJournal
|
if( rc==SQLITE_OK && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){
|
||||||
&& pPager->journalMode!=PAGER_JOURNALMODE_OFF
|
|
||||||
){
|
|
||||||
rc = pager_open_journal(pPager);
|
rc = pager_open_journal(pPager);
|
||||||
}
|
}
|
||||||
}else if( isOpen(pPager->jfd) && pPager->journalOff==0 ){
|
}else if( isOpen(pPager->jfd) && pPager->journalOff==0 ){
|
||||||
@@ -4214,8 +4207,8 @@ static int pager_write(PgHdr *pPg){
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
assert( pPager->state>=PAGER_RESERVED );
|
assert( pPager->state>=PAGER_RESERVED );
|
||||||
if( !isOpen(pPager->jfd) && pPager->useJournal
|
if( !isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){
|
||||||
&& pPager->journalMode!=PAGER_JOURNALMODE_OFF ){
|
assert( pPager->useJournal );
|
||||||
rc = pager_open_journal(pPager);
|
rc = pager_open_journal(pPager);
|
||||||
if( rc!=SQLITE_OK ) return rc;
|
if( rc!=SQLITE_OK ) return rc;
|
||||||
}
|
}
|
||||||
@@ -4489,7 +4482,7 @@ static int pager_incr_changecounter(Pager *pPager, int isDirectMode){
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
assert( pPager->state>=PAGER_RESERVED );
|
assert( pPager->state>=PAGER_RESERVED );
|
||||||
if( !pPager->changeCountDone && pPager->dbSize>0 ){
|
if( !pPager->changeCountDone && ALWAYS(pPager->dbSize>0) ){
|
||||||
PgHdr *pPgHdr; /* Reference to page 1 */
|
PgHdr *pPgHdr; /* Reference to page 1 */
|
||||||
u32 change_counter; /* Initial value of change-counter field */
|
u32 change_counter; /* Initial value of change-counter field */
|
||||||
|
|
||||||
|
13
src/pager.h
13
src/pager.h
@@ -13,7 +13,7 @@
|
|||||||
** subsystem. The page cache subsystem reads and writes a file a page
|
** subsystem. The page cache subsystem reads and writes a file a page
|
||||||
** at a time and provides a journal for rollback.
|
** at a time and provides a journal for rollback.
|
||||||
**
|
**
|
||||||
** @(#) $Id: pager.h,v 1.103 2009/07/21 19:25:24 danielk1977 Exp $
|
** @(#) $Id: pager.h,v 1.104 2009/07/24 19:01:19 drh Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _PAGER_H_
|
#ifndef _PAGER_H_
|
||||||
@@ -86,13 +86,20 @@ typedef struct PgHdr DbPage;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Open and close a Pager connection. */
|
/* Open and close a Pager connection. */
|
||||||
int sqlite3PagerOpen(sqlite3_vfs *, Pager **ppPager, const char*, int,int,int);
|
int sqlite3PagerOpen(
|
||||||
|
sqlite3_vfs*,
|
||||||
|
Pager **ppPager,
|
||||||
|
const char*,
|
||||||
|
int,
|
||||||
|
int,
|
||||||
|
int,
|
||||||
|
void(*)(DbPage*)
|
||||||
|
);
|
||||||
int sqlite3PagerClose(Pager *pPager);
|
int sqlite3PagerClose(Pager *pPager);
|
||||||
int sqlite3PagerReadFileheader(Pager*, int, unsigned char*);
|
int sqlite3PagerReadFileheader(Pager*, int, unsigned char*);
|
||||||
|
|
||||||
/* Functions used to configure a Pager object. */
|
/* Functions used to configure a Pager object. */
|
||||||
void sqlite3PagerSetBusyhandler(Pager*, int(*)(void *), void *);
|
void sqlite3PagerSetBusyhandler(Pager*, int(*)(void *), void *);
|
||||||
void sqlite3PagerSetReiniter(Pager*, void(*)(DbPage*));
|
|
||||||
int sqlite3PagerSetPagesize(Pager*, u16*, int);
|
int sqlite3PagerSetPagesize(Pager*, u16*, int);
|
||||||
int sqlite3PagerMaxPageCount(Pager*, int);
|
int sqlite3PagerMaxPageCount(Pager*, int);
|
||||||
void sqlite3PagerSetCachesize(Pager*, int);
|
void sqlite3PagerSetCachesize(Pager*, int);
|
||||||
|
12
src/test2.c
12
src/test2.c
@@ -13,7 +13,7 @@
|
|||||||
** is not included in the SQLite library. It is used for automated
|
** is not included in the SQLite library. It is used for automated
|
||||||
** testing of the SQLite library.
|
** testing of the SQLite library.
|
||||||
**
|
**
|
||||||
** $Id: test2.c,v 1.73 2009/07/21 19:25:24 danielk1977 Exp $
|
** $Id: test2.c,v 1.74 2009/07/24 19:01:20 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include "tcl.h"
|
#include "tcl.h"
|
||||||
@@ -56,6 +56,13 @@ static char *errorName(int rc){
|
|||||||
*/
|
*/
|
||||||
static int test_pagesize = 1024;
|
static int test_pagesize = 1024;
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Dummy page reinitializer
|
||||||
|
*/
|
||||||
|
static void pager_test_reiniter(DbPage *pNotUsed){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Usage: pager_open FILENAME N-PAGE
|
** Usage: pager_open FILENAME N-PAGE
|
||||||
**
|
**
|
||||||
@@ -79,7 +86,8 @@ static int pager_open(
|
|||||||
}
|
}
|
||||||
if( Tcl_GetInt(interp, argv[2], &nPage) ) return TCL_ERROR;
|
if( Tcl_GetInt(interp, argv[2], &nPage) ) return TCL_ERROR;
|
||||||
rc = sqlite3PagerOpen(sqlite3_vfs_find(0), &pPager, argv[1], 0, 0,
|
rc = sqlite3PagerOpen(sqlite3_vfs_find(0), &pPager, argv[1], 0, 0,
|
||||||
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_MAIN_DB);
|
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_MAIN_DB,
|
||||||
|
pager_test_reiniter);
|
||||||
if( rc!=SQLITE_OK ){
|
if( rc!=SQLITE_OK ){
|
||||||
Tcl_AppendResult(interp, errorName(rc), 0);
|
Tcl_AppendResult(interp, errorName(rc), 0);
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
Reference in New Issue
Block a user