From: drh Date: Sun, 13 Nov 2011 21:44:03 +0000 (+0000) Subject: Add a version number to the sqlite3_pcache_methods2 object. Other PCACHE2 X-Git-Tag: mountain-lion~9^2~19^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81ef0f97ef421c36852a3a7fd103e675fb706f52;p=thirdparty%2Fsqlite.git Add a version number to the sqlite3_pcache_methods2 object. Other PCACHE2 documentation improvements. FossilOrigin-Name: 9f839ac05a9f3cfe587d2ccdccd50dac41baedbe --- diff --git a/manifest b/manifest index f7e1882466..2988a3c3a3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Attempt\sto\smodify\sbtree.c\sso\sthat\sit\sassumes\sthat\scalls\sto\ssqlite3PagerWrite()\nwill\sreallocate\sthe\spage\sbuffer.\s\sAs\sthere\sis\snot\sgood\sway\sto\stest\sthis\nassumption\syet,\sprobably\sa\sfew\sspots\swere\smissed. -D 2011-11-12T23:10:13.436 +C Add\sa\sversion\snumber\sto\sthe\ssqlite3_pcache_methods2\sobject.\s\sOther\sPCACHE2\ndocumentation\simprovements. +D 2011-11-13T21:44:03.995 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5b4a3e12a850b021547e43daf886b25133b44c07 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -173,7 +173,7 @@ F src/pager.h 9f81b08efb06db4ba8be69446e10b005c351373d F src/parse.y 12b7ebd61ea54f0e1b1083ff69cc2c8ce9353d58 F src/pcache.c b9d52e9f844d91c27c161279234f273fc02abc71 F src/pcache.h c770382f9fae4ca5025c5523bd0aa13cd6ddc6f8 -F src/pcache1.c 7a3ce2dca0ef889be94b9cb0a2dfc7917ec83eba +F src/pcache1.c 0ac7b63db83a705787f4ababf1e4cff27b5f8064 F src/pragma.c 65d1d63d64f8b7350f28d5ee6d40f7985deccdfe F src/prepare.c ec4989f7f480544bdc4192fe663470d2a2d7d61e F src/printf.c 03104cbff6959ff45df69dc9060ba6212f60a869 @@ -182,7 +182,7 @@ F src/resolve.c 365ab1c870e38596d6869e76fb544fe6e4ffc809 F src/rowset.c 69afa95a97c524ba6faf3805e717b5b7ae85a697 F src/select.c 80f3ac44a8514b1d107b80f5df4a424ae059d2b6 F src/shell.c 29812a900a780eb0f835c4bc65e216272689def8 -F src/sqlite.h.in fa162d2a068b6c1c25896e8614be3c4f01897a95 +F src/sqlite.h.in 557f4113a649f15d13e566aaa85820509b4daa52 F src/sqlite3ext.h 6904f4aadf976f95241311fbffb00823075d9477 F src/sqliteInt.h f87f241b9821a9d466c2711b7345d30ef3624249 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d @@ -208,7 +208,7 @@ F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc F src/test_func.c cbdec5cededa0761daedde5baf06004a9bf416b5 F src/test_fuzzer.c f884f6f32e8513d34248d6e1ac8a32047fead254 F src/test_hexio.c c4773049603151704a6ab25ac5e936b5109caf5a -F src/test_init.c 1ff3a696ca45e3c4cd7639217ded5d9c41428fed +F src/test_init.c 3cbad7ce525aec925f8fda2192d576d47f0d478a F src/test_intarray.c d879bbf8e4ce085ab966d1f3c896a7c8b4f5fc99 F src/test_intarray.h 489edb9068bb926583445cb02589344961054207 F src/test_journal.c 03313c693cca72959dcaaf79f8d76f21c01e19ff @@ -219,7 +219,7 @@ F src/test_multiplex.h e99c571bc4968b7a9363b661481f3934bfead61d F src/test_mutex.c a6bd7b9cf6e19d989e31392b06ac8d189f0d573e F src/test_onefile.c 40cf9e212a377a6511469384a64b01e6e34b2eec F src/test_osinst.c 62b0b8ef21ce754cc94e17bb42377ed8795dba32 -F src/test_pcache.c 96f5ba93a34d844de596bebdfe1c09bab438a8bd +F src/test_pcache.c a07e9c1222e964ea20d49e6e0b6e23aa6ae8b6da F src/test_quota.c a391c866217e92986c6f523f05b08aa6956c8419 F src/test_rtree.c 6d06306e29946dc36f528a3a2cdc3add794656f1 F src/test_schema.c 8c06ef9ddb240c7a0fcd31bc221a6a2aade58bf0 @@ -974,7 +974,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 -P 1bbbf8574a820c5f787a937f02a8e2a91264ace0 -R 8fe5168196d72d713cb64bacae73a939 +P ceee03c79a55ea39866758aa76b78b10e5f4246d +R d08ae8acf53f2cb149aeb898f50b49c8 U drh -Z db5deb4d4c1ff85ac518999d30605134 +Z af6f24cf5b51e20dd59385851602a05e diff --git a/manifest.uuid b/manifest.uuid index a6ee8619eb..140730cf5c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ceee03c79a55ea39866758aa76b78b10e5f4246d \ No newline at end of file +9f839ac05a9f3cfe587d2ccdccd50dac41baedbe \ No newline at end of file diff --git a/src/pcache1.c b/src/pcache1.c index a026ed2fb5..35bdda8a9a 100644 --- a/src/pcache1.c +++ b/src/pcache1.c @@ -924,6 +924,7 @@ static void pcache1Destroy(sqlite3_pcache *p){ */ void sqlite3PCacheSetDefault(void){ static const sqlite3_pcache_methods2 defaultMethods = { + 1, /* iVersion */ 0, /* pArg */ pcache1Init, /* xInit */ pcache1Shutdown, /* xShutdown */ diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 50e95efe2c..27c2b75db3 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -5934,10 +5934,26 @@ int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** sqlite3_pcache object except by holding and passing pointers ** to the object. ** -** See [sqlite3_pcache_methods] for additional information. +** See [sqlite3_pcache_methods2] for additional information. */ typedef struct sqlite3_pcache sqlite3_pcache; +/* +** CAPI3REF: Custom Page Cache Object +** +** The sqlite3_pcache_page object represents a single page in the +** page cache. The page cache will allocate instances of this +** object. Various methods of the page cache use pointers to instances +** of this object as parameters or as their return value. +** +** See [sqlite3_pcache_methods2] for additional information. +*/ +typedef struct sqlite3_pcache_page sqlite3_pcache_page; +struct sqlite3_pcache_page { + void *pBuf; /* The content of the page */ + void *pExtra; /* Extra information associated with the page */ +}; + /* ** CAPI3REF: Application Defined Page Cache. ** KEYWORDS: {page cache} @@ -6092,12 +6108,8 @@ typedef struct sqlite3_pcache sqlite3_pcache; ** functions. */ typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; -typedef struct sqlite3_pcache_page sqlite3_pcache_page; -struct sqlite3_pcache_page { - void *pBuf; - void *pExtra; -}; struct sqlite3_pcache_methods2 { + int iVersion; void *pArg; int (*xInit)(void*); void (*xShutdown)(void*); diff --git a/src/test_init.c b/src/test_init.c index 7741cd19e7..e3724d8be3 100644 --- a/src/test_init.c +++ b/src/test_init.c @@ -160,7 +160,7 @@ static void installInitWrappers(void){ wrMutexLeave, wrMutexHeld, wrMutexNotheld }; sqlite3_pcache_methods2 pcachemethods = { - 0, + 1, 0, wrPCacheInit, wrPCacheShutdown, wrPCacheCreate, wrPCacheCachesize, wrPCachePagecount, wrPCacheFetch, wrPCacheUnpin, wrPCacheRekey, wrPCacheTruncate, diff --git a/src/test_pcache.c b/src/test_pcache.c index d2890a1660..2f25de14bf 100644 --- a/src/test_pcache.c +++ b/src/test_pcache.c @@ -432,6 +432,7 @@ void installTestPCache( unsigned highStress /* Call xStress agressively */ ){ static const sqlite3_pcache_methods2 testPcache = { + 1, (void*)&testpcacheGlobal, testpcacheInit, testpcacheShutdown,