From: shearer Date: Tue, 27 Oct 2020 11:07:16 +0000 (+0000) Subject: Final commit in btree.h reorg. No more unknowns. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f311315ffdbd41e893ca2bdcaea82b107a20c5e5;p=thirdparty%2Fsqlite.git Final commit in btree.h reorg. No more unknowns. FossilOrigin-Name: ea06f1d1f9683b3299107f42912169de9d2bbc91386eb953520c2f44e309c715 --- diff --git a/manifest b/manifest index bb6e51e7ae..e1e66754cf 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C More\sadditions\sand\simprovements\sto\sbtree.h\sdocumentation -D 2020-10-06T15:48:59.677 +C Final\scommit\sin\sbtree.h\sreorg.\sNo\smore\sunknowns. +D 2020-10-27T11:07:16.082 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -479,7 +479,7 @@ F src/backup.c 3014889fa06e20e6adfa0d07b60097eec1f6e5b06671625f476a714d2356513d F src/bitvec.c 17ea48eff8ba979f1f5b04cc484c7bb2be632f33 F src/btmutex.c 8acc2f464ee76324bf13310df5692a262b801808984c1b79defb2503bbafadb6 F src/btree.c ad0a38e4d4a0b6b3e003b5478556dbe890c0d58c7a95362e02d1fa539631af19 -F src/btree.h 7018bfa00ddbc6e401286586e59982cd896e3e6d2a29816908bc6ee6a36ad3c7 +F src/btree.h 56dad8f951b0659e4221e63ff8f8d6625400d4695d2c75fe2fabef42dbaabaa4 F src/btreeInt.h ffd66480520d9d70222171b3a026d78b80833b5cea49c89867949f3e023d5f43 F src/build.c 55faabe78044063eae7d1cb3767afa1bafd6edc41d950b6e2228abf601f87912 F src/callback.c d0b853dd413255d2e337b34545e54d888ea02f20da5ad0e63585b389624c4a6c @@ -1882,7 +1882,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 14dba0f3b5defef148c78e7613fc33044598008df4dee834f752bd10891e3684 df12f097224ebc9473d9e2a8933bd7efed6490d09af2c012c9b59a7892369b7f 64782463be62b72b5cd0bfaa7c9b69aa487d807c5fe0e65a272080b7739fd21b -R 577a16b5de3c6fa134d1a328cc49e495 +P a49a7cdec7f50c27c2d5f9919ba71e41858a57e2eb0cfc7a13d53165f2f2ea9b +R e9cab023f226b7e1b429f157956f873b U shearer -Z d22433d6e93376a4473b989b5f649f7c +Z 8a2e4699b521ffa738da4c5938ef2333 diff --git a/manifest.uuid b/manifest.uuid index b3bf356916..a6f6f9aa45 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a49a7cdec7f50c27c2d5f9919ba71e41858a57e2eb0cfc7a13d53165f2f2ea9b \ No newline at end of file +ea06f1d1f9683b3299107f42912169de9d2bbc91386eb953520c2f44e309c715 \ No newline at end of file diff --git a/src/btree.h b/src/btree.h index a63c54ee78..1e8c3e0a64 100644 --- a/src/btree.h +++ b/src/btree.h @@ -54,8 +54,6 @@ ** ** Reading and Writing Metadata ** -** Hard to Classify / More research needed -** */ #ifndef SQLITE_BTREE_H @@ -82,6 +80,13 @@ int sqlite3BtreeOpen( int vfsFlags /* Flags passed through to VFS open */ ); +/* The flags parameter to sqlite3BtreeOpen can be the bitwise OR of the +** following values. +** +** NOTE: These values must match the corresponding PAGER_ values in +** pager.h. +*/ + #define BTREE_OMIT_JOURNAL 1 /* No create/use journal in temp databases */ #define BTREE_MEMORY 2 /* This is an in-memory DB */ #define BTREE_SINGLE 4 /* The file contains at most 1 b-tree */ @@ -121,17 +126,23 @@ int sqlite3BtreeSecureDelete(Btree*,int); int sqlite3BtreeGetRequestedReserve(Btree*); int sqlite3BtreeGetReserveNoMutex(Btree *p); +/* Implements PRAGMA integrity_check on a Btree and its associated file. + * Only called from vdbe.c/OP_IntegrityCk */ +char *sqlite3BtreeIntegrityCheck(sqlite3*,Btree*,Pgno*aRoot,int nRoot,int,int*);` + +/* A single step of an incremental vacuum. For PRAGMA incremental_vacuum(N) */ +/* Neither autovacuum mode nor the VACUUM SQLite command use this function. */ +int sqlite3BtreeIncrVacuum(Btree *); + +/* Copy a complete Btree into another Btree, ie from one file into another */ +/* Used only in the case of a backup and vacuum operations */ +int sqlite3BtreeCopyFile(Btree *, Btree *); + /* ** Btree Connection Configuration and Querying */ -/* The flags parameter to sqlite3BtreeOpen can be the bitwise or of the -** following values. -** -** NOTE: These values must match the corresponding PAGER_ values in -** pager.h. -*/ int sqlite3BtreeSetCacheSize(Btree*,int); Pgno sqlite3BtreeMaxPageCount(Btree*,Pgno); @@ -146,6 +157,9 @@ int sqlite3BtreeIsReadonly(Btree *pBt); */ i64 sqlite3BtreeRowCountEst(BtCursor*); +/* Return the pager associated with a BTree */ +struct Pager *sqlite3BtreePager(Btree*); + /* ** Mutex Function Wrappers @@ -227,7 +241,6 @@ int sqlite3BtreeBeginStmt(Btree*,int); int sqlite3BtreeTripAllCursors(Btree*, int, int); - /* ** Cursors and Cursor functions ** @@ -441,6 +454,14 @@ int sqlite3BtreePayload(BtCursor*, u32 offset, u32 amt, void*); const void *sqlite3BtreePayloadFetch(BtCursor*, u32 *pAmt); u32 sqlite3BtreePayloadSize(BtCursor*); +/* These functions deal with arbitary-sized binary blobs in a Btree */ +#ifndef SQLITE_OMIT_INCRBLOB +int sqlite3BtreePayloadChecked(BtCursor*, u32 offset, u32 amt, void*); +int sqlite3BtreePutData(BtCursor*, u32 offset, u32 amt, void*); +void sqlite3BtreeIncrblobCursor(BtCursor *); +#endif + + /* ** Table functions @@ -529,22 +550,4 @@ int sqlite3BtreeSetVersion(Btree *pBt, int iVersion); int sqlite3BtreeNewDb(Btree *p); -/* -** Hard to Classify / More research needed -*/ - -int sqlite3BtreeIncrVacuum(Btree *); - -int sqlite3BtreeCopyFile(Btree *, Btree *); - -char *sqlite3BtreeIntegrityCheck(sqlite3*,Btree*,Pgno*aRoot,int nRoot,int,int*); - -struct Pager *sqlite3BtreePager(Btree*); - -#ifndef SQLITE_OMIT_INCRBLOB -int sqlite3BtreePayloadChecked(BtCursor*, u32 offset, u32 amt, void*); -int sqlite3BtreePutData(BtCursor*, u32 offset, u32 amt, void*); -void sqlite3BtreeIncrblobCursor(BtCursor *); -#endif - #endif /* SQLITE_BTREE_H */