mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Improve comments and add new assert() statements in WAL to help document
how everything works. FossilOrigin-Name: 23b08fe9db24a953cc231b093cf74d140c9965d22964d0401ff8ab3d4ecba443
This commit is contained in:
12
manifest
12
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Remove\sALWAYS()\smacros\sthat\scan\sbe\strue\sif\sthe\sinternal\stest\sfunction\nimplies_nonnull_row()\sis\sused\sin\sthe\sresult\sset\sof\sa\squery\sand\scontains\ncomparison\soperator\sagainst\sa\scomputed\scolumn.\ndbsqlfuzz\s4c34db5bff6247f33ee49e341a1f3018e72be0a0.
|
C Improve\scomments\sand\sadd\snew\sassert()\sstatements\sin\sWAL\sto\shelp\sdocument\nhow\severything\sworks.
|
||||||
D 2021-07-29T00:33:20.860
|
D 2021-07-29T16:48:21.089
|
||||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||||
@@ -628,7 +628,7 @@ F src/vdbetrace.c 666c6fd9f1b62be6999e072a45b913e3c2c3518bc60dfd4d54fe304130acb7
|
|||||||
F src/vdbevtab.c f99b275366c5fc5e2d99f734729880994ab9500bdafde7fae3b02d562b9d323c
|
F src/vdbevtab.c f99b275366c5fc5e2d99f734729880994ab9500bdafde7fae3b02d562b9d323c
|
||||||
F src/vtab.c 3a9a6ae1fd14f7c00af184233cb9f3bced89ae277a75a312f85fb77297a3cdfa
|
F src/vtab.c 3a9a6ae1fd14f7c00af184233cb9f3bced89ae277a75a312f85fb77297a3cdfa
|
||||||
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
||||||
F src/wal.c c8ec20a1ca161d5635a4f19c2a4efec2e006e19a8a61f272bf6bce1c80ab7436
|
F src/wal.c 1b1e7311d3f12ab60c012734e49ebf048d6eeb4485b6f077bd79f340e9c36731
|
||||||
F src/wal.h c3aa7825bfa2fe0d85bef2db94655f99870a285778baa36307c0a16da32b226a
|
F src/wal.h c3aa7825bfa2fe0d85bef2db94655f99870a285778baa36307c0a16da32b226a
|
||||||
F src/walker.c 7342becedf3f8a26f9817f08436bdf8b56ad69af83705f6b9320a0ad3092c2ac
|
F src/walker.c 7342becedf3f8a26f9817f08436bdf8b56ad69af83705f6b9320a0ad3092c2ac
|
||||||
F src/where.c 07c63dde6ab72477b964f4c81bee61ef78a246ca149bb9a560784f2e85cd78d7
|
F src/where.c 07c63dde6ab72477b964f4c81bee61ef78a246ca149bb9a560784f2e85cd78d7
|
||||||
@@ -1920,7 +1920,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
|||||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||||
P a2fc531177c3a061f2881198bb711d502db7cd831351b6a5dd415936845b6625
|
P 4d1dbfa35c7dc0f09321b2e274a00e506f4ca65322454652d5891d815a6966d3
|
||||||
R 302893be0ad635d55b2ba074ef459057
|
R 7a7643ec86e1f4d8e14a77c61b23a38c
|
||||||
U drh
|
U drh
|
||||||
Z 214bc8f469ab254a07e1605231d14a09
|
Z faf097f1ce1cc5bd6964b75ff7d837f7
|
||||||
|
@@ -1 +1 @@
|
|||||||
4d1dbfa35c7dc0f09321b2e274a00e506f4ca65322454652d5891d815a6966d3
|
23b08fe9db24a953cc231b093cf74d140c9965d22964d0401ff8ab3d4ecba443
|
37
src/wal.c
37
src/wal.c
@@ -161,7 +161,10 @@
|
|||||||
** HASHTABLE_NPAGE_ONE frames. The values of HASHTABLE_NPAGE_ONE and
|
** HASHTABLE_NPAGE_ONE frames. The values of HASHTABLE_NPAGE_ONE and
|
||||||
** HASHTABLE_NPAGE are selected so that together the wal-index header and
|
** HASHTABLE_NPAGE are selected so that together the wal-index header and
|
||||||
** first index block are the same size as all other index blocks in the
|
** first index block are the same size as all other index blocks in the
|
||||||
** wal-index.
|
** wal-index. The values are:
|
||||||
|
**
|
||||||
|
** HASHTABLE_NPAGE 4096
|
||||||
|
** HASHTABLE_NPAGE_ONE 4062
|
||||||
**
|
**
|
||||||
** Each index block contains two sections, a page-mapping that contains the
|
** Each index block contains two sections, a page-mapping that contains the
|
||||||
** database page number associated with each wal frame, and a hash-table
|
** database page number associated with each wal frame, and a hash-table
|
||||||
@@ -1410,14 +1413,42 @@ int sqlite3WalOpen(
|
|||||||
assert( zWalName && zWalName[0] );
|
assert( zWalName && zWalName[0] );
|
||||||
assert( pDbFd );
|
assert( pDbFd );
|
||||||
|
|
||||||
|
/* Verify the values of various constants. Any changes to the values
|
||||||
|
** of these constants would result in an incompatible on-disk format
|
||||||
|
** for the -shm file. Any change that causes one of these asserts to
|
||||||
|
** fail is a backward compatibility problem, even if the change otherwise
|
||||||
|
** works.
|
||||||
|
**
|
||||||
|
** This table also serves as a helpful cross-reference when trying to
|
||||||
|
** interpret hex dumps of the -shm file.
|
||||||
|
*/
|
||||||
|
assert( 48 == sizeof(WalIndexHdr) );
|
||||||
|
assert( 40 == sizeof(WalCkptInfo) );
|
||||||
|
assert( 120 == WALINDEX_LOCK_OFFSET );
|
||||||
|
assert( 136 == WALINDEX_HDR_SIZE );
|
||||||
|
assert( 4096 == HASHTABLE_NPAGE );
|
||||||
|
assert( 4062 == HASHTABLE_NPAGE_ONE );
|
||||||
|
assert( 8192 == HASHTABLE_NSLOT );
|
||||||
|
assert( 383 == HASHTABLE_HASH_1 );
|
||||||
|
assert( 32768 == WALINDEX_PGSZ );
|
||||||
|
assert( 8 == SQLITE_SHM_NLOCK );
|
||||||
|
assert( 5 == WAL_NREADER );
|
||||||
|
assert( 24 == WAL_HDRSIZE );
|
||||||
|
assert( 120 == WALINDEX_LOCK_OFFSET + WAL_WRITE_LOCK );
|
||||||
|
assert( 121 == WALINDEX_LOCK_OFFSET + WAL_CKPT_LOCK );
|
||||||
|
assert( 122 == WALINDEX_LOCK_OFFSET + WAL_RECOVER_LOCK );
|
||||||
|
assert( 123 == WALINDEX_LOCK_OFFSET + WAL_READ_LOCK(0) );
|
||||||
|
assert( 124 == WALINDEX_LOCK_OFFSET + WAL_READ_LOCK(1) );
|
||||||
|
assert( 125 == WALINDEX_LOCK_OFFSET + WAL_READ_LOCK(2) );
|
||||||
|
assert( 126 == WALINDEX_LOCK_OFFSET + WAL_READ_LOCK(3) );
|
||||||
|
assert( 127 == WALINDEX_LOCK_OFFSET + WAL_READ_LOCK(4) );
|
||||||
|
|
||||||
/* In the amalgamation, the os_unix.c and os_win.c source files come before
|
/* In the amalgamation, the os_unix.c and os_win.c source files come before
|
||||||
** this source file. Verify that the #defines of the locking byte offsets
|
** this source file. Verify that the #defines of the locking byte offsets
|
||||||
** in os_unix.c and os_win.c agree with the WALINDEX_LOCK_OFFSET value.
|
** in os_unix.c and os_win.c agree with the WALINDEX_LOCK_OFFSET value.
|
||||||
** For that matter, if the lock offset ever changes from its initial design
|
** For that matter, if the lock offset ever changes from its initial design
|
||||||
** value of 120, we need to know that so there is an assert() to check it.
|
** value of 120, we need to know that so there is an assert() to check it.
|
||||||
*/
|
*/
|
||||||
assert( 120==WALINDEX_LOCK_OFFSET );
|
|
||||||
assert( 136==WALINDEX_HDR_SIZE );
|
|
||||||
#ifdef WIN_SHM_BASE
|
#ifdef WIN_SHM_BASE
|
||||||
assert( WIN_SHM_BASE==WALINDEX_LOCK_OFFSET );
|
assert( WIN_SHM_BASE==WALINDEX_LOCK_OFFSET );
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user