mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
If SQLite is compiled with SQLITE_ENABLE_WAL_BIGHASH defined, use
hash tables large enough to fit 128K, instead of 4K, entries in the *-shm file. FossilOrigin-Name: 581efc34624c55832afbf7b691d768d6ddbf2b23d6a190d2fa0dde1b00251454
This commit is contained in:
@@ -89,6 +89,10 @@
|
|||||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU)
|
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RBU)
|
||||||
#include "sqlite3rbu.h"
|
#include "sqlite3rbu.h"
|
||||||
|
|
||||||
|
#ifdef SQLITE_ENABLE_WAL_BIGHASH
|
||||||
|
# error "may not use SQLITE_ENABLE_RBU with SQLITE_ENABLE_WAL_BIGHASH"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_WIN32_WCE)
|
#if defined(_WIN32_WCE)
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#endif
|
#endif
|
||||||
|
27
manifest
27
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Merge\sall\sthe\slatest\strunk\senhancements\sinto\sthe\sbedrock\sbranch.
|
C If\sSQLite\sis\scompiled\swith\sSQLITE_ENABLE_WAL_BIGHASH\sdefined,\suse\nhash\stables\slarge\senough\sto\sfit\s128K,\sinstead\sof\s4K,\sentries\sin\sthe\s*-shm\sfile.
|
||||||
D 2025-02-03T15:11:11.716
|
D 2025-02-05T17:52:13.273
|
||||||
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 e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
|
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
|
||||||
@@ -16,7 +16,7 @@ F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
|
|||||||
F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531
|
F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531
|
||||||
F auto.def e7e92090c98aeb0174d29988c259834eb1b71ae1ea927015c3ef300f6f9b68ae
|
F auto.def e7e92090c98aeb0174d29988c259834eb1b71ae1ea927015c3ef300f6f9b68ae
|
||||||
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
|
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
|
||||||
F autoconf/Makefile.in 56697ad25ecf23afa317148b06bdc14f85960b42e5ec434ac1ba87f63a3cb789 w autoconf/Makefile.am
|
F autoconf/Makefile.in 56697ad25ecf23afa317148b06bdc14f85960b42e5ec434ac1ba87f63a3cb789
|
||||||
F autoconf/Makefile.msc 0a071367537dc395285a5d624ac4f99f3a387b27cc5e89752423c0499e15aec4
|
F autoconf/Makefile.msc 0a071367537dc395285a5d624ac4f99f3a387b27cc5e89752423c0499e15aec4
|
||||||
F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136
|
F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136
|
||||||
F autoconf/README.txt 7f01dc3915e2d68f329011073662369e62a0938a2c69398807823c57591cb288
|
F autoconf/README.txt 7f01dc3915e2d68f329011073662369e62a0938a2c69398807823c57591cb288
|
||||||
@@ -508,7 +508,7 @@ F ext/rbu/rbuvacuum.test 542561741ff2b262e3694bc6012b44694ee62c545845319a06f3237
|
|||||||
F ext/rbu/rbuvacuum2.test ae097d04feb041446a74fac94b24bffeb3fdd60e32b848c5611e507ab702b81b
|
F ext/rbu/rbuvacuum2.test ae097d04feb041446a74fac94b24bffeb3fdd60e32b848c5611e507ab702b81b
|
||||||
F ext/rbu/rbuvacuum3.test 3ce42695fdf21aaa3499e857d7d4253bc499ad759bcd6c9362042c13cd37d8de
|
F ext/rbu/rbuvacuum3.test 3ce42695fdf21aaa3499e857d7d4253bc499ad759bcd6c9362042c13cd37d8de
|
||||||
F ext/rbu/rbuvacuum4.test ffccd22f67e2d0b380d2889685742159dfe0d19a3880ca3d2d1d69eefaebb205
|
F ext/rbu/rbuvacuum4.test ffccd22f67e2d0b380d2889685742159dfe0d19a3880ca3d2d1d69eefaebb205
|
||||||
F ext/rbu/sqlite3rbu.c c07817e89477b8fc286ab6ed87da5bc82fc3490bbbe9e9b22eb2d900e81ee5dc
|
F ext/rbu/sqlite3rbu.c 6b8ea18fec17cb9a2eb2a14eac98602a3ab9420cc102011be231b576c55542ed
|
||||||
F ext/rbu/sqlite3rbu.h 9d923eb135c5d04aa6afd7c39ca47b0d1d0707c100e02f19fdde6a494e414304
|
F ext/rbu/sqlite3rbu.h 9d923eb135c5d04aa6afd7c39ca47b0d1d0707c100e02f19fdde6a494e414304
|
||||||
F ext/rbu/test_rbu.c b9727c3394307d058e806c1da0f8bb7b24daf3c6bb94cb10cca88ea4d5c806c0
|
F ext/rbu/test_rbu.c b9727c3394307d058e806c1da0f8bb7b24daf3c6bb94cb10cca88ea4d5c806c0
|
||||||
F ext/recover/dbdata.c 5295f4f922b60d7035b6b9fd5846b13071b9d97ed7fad8496837bb7640d24771
|
F ext/recover/dbdata.c 5295f4f922b60d7035b6b9fd5846b13071b9d97ed7fad8496837bb7640d24771
|
||||||
@@ -812,7 +812,7 @@ F src/test_backup.c bd901e3c116c7f3b3bbbd4aae4ce87d99b400c9cbb0a9e7b4610af451d97
|
|||||||
F src/test_bestindex.c 3401bee51665cbf7f9ed2552b5795452a8b86365e4c9ece745b54155a55670c6
|
F src/test_bestindex.c 3401bee51665cbf7f9ed2552b5795452a8b86365e4c9ece745b54155a55670c6
|
||||||
F src/test_blob.c bcdf6a6c22d0bcc13c41479d63692ef413add2a4d30e1e26b9f74ab85b9fb4d5
|
F src/test_blob.c bcdf6a6c22d0bcc13c41479d63692ef413add2a4d30e1e26b9f74ab85b9fb4d5
|
||||||
F src/test_btree.c 28283787d32b8fa953eb77412ad0de2c9895260e4e5bd5a94b3c7411664f90d5
|
F src/test_btree.c 28283787d32b8fa953eb77412ad0de2c9895260e4e5bd5a94b3c7411664f90d5
|
||||||
F src/test_config.c a684b7c4b6fdf0da87dcd052bb93fa499e7859120b5963972923abd98f31a2e1
|
F src/test_config.c 39a37de458a3082ee194dd65e71f596889b4ff0d7b5018aa60f796b96068c0b6
|
||||||
F src/test_delete.c e2fe07646dff6300b48d49b2fee2fe192ed389e834dd635e3b3bac0ce0bf9f8f
|
F src/test_delete.c e2fe07646dff6300b48d49b2fee2fe192ed389e834dd635e3b3bac0ce0bf9f8f
|
||||||
F src/test_demovfs.c 3efa2adf4f21e10d95521721687d5ca047aea91fa62dd8cc22ac9e5a9c942383
|
F src/test_demovfs.c 3efa2adf4f21e10d95521721687d5ca047aea91fa62dd8cc22ac9e5a9c942383
|
||||||
F src/test_devsym.c 649434ed34d0b03fbd5a6b42df80f0f9a7e53f94dd1710aad5dd8831e91c4e86
|
F src/test_devsym.c 649434ed34d0b03fbd5a6b42df80f0f9a7e53f94dd1710aad5dd8831e91c4e86
|
||||||
@@ -869,7 +869,7 @@ F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf8
|
|||||||
F src/vdbevtab.c fc46b9cbd759dc013f0b3724549cc0d71379183c667df3a5988f7e2f1bd485f3
|
F src/vdbevtab.c fc46b9cbd759dc013f0b3724549cc0d71379183c667df3a5988f7e2f1bd485f3
|
||||||
F src/vtab.c bd4ab699ac4d1ee6da7339d3fbbb5edf23d9737c1fd322ccd75984329d070472
|
F src/vtab.c bd4ab699ac4d1ee6da7339d3fbbb5edf23d9737c1fd322ccd75984329d070472
|
||||||
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
||||||
F src/wal.c f552156ce5f8392b224d56fe99a49e1667cab8429c2b430eed9deaa23abd1542
|
F src/wal.c 91f94d61c250315161f1df8b1b0455e0899f98cd50597185a4c3421b7bb61d2f
|
||||||
F src/wal.h 8d02ab8c2a93a941f5898eb3345bf711c1d3f8f86f4be8d5428fb6c074962d8a
|
F src/wal.h 8d02ab8c2a93a941f5898eb3345bf711c1d3f8f86f4be8d5428fb6c074962d8a
|
||||||
F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
|
F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
|
||||||
F src/where.c 09dc313e7223ca1217c39c7026b00f16ff449a8323511a762fcba7863a00f4cd
|
F src/where.c 09dc313e7223ca1217c39c7026b00f16ff449a8323511a762fcba7863a00f4cd
|
||||||
@@ -1724,7 +1724,7 @@ F test/subquery2.test 90cf944b9de8204569cf656028391e4af1ccc8c0cc02d4ef38ee3be8de
|
|||||||
F test/subselect.test 0966aa8e720224dbd6a5e769a3ec2a723e332303
|
F test/subselect.test 0966aa8e720224dbd6a5e769a3ec2a723e332303
|
||||||
F test/substr.test a673e3763e247e9b5e497a6cacbaf3da2bd8ec8921c0677145c109f2e633f36b
|
F test/substr.test a673e3763e247e9b5e497a6cacbaf3da2bd8ec8921c0677145c109f2e633f36b
|
||||||
F test/subtype1.test 96fd2a59bfc845c955b5f339d23b37ef4d50de5f8a04acd1450a68605fa2e3e7
|
F test/subtype1.test 96fd2a59bfc845c955b5f339d23b37ef4d50de5f8a04acd1450a68605fa2e3e7
|
||||||
F test/superlock.test 85256830339a6871ce36a2ef591c3f67716a701b5497788fb2068b90159c2442
|
F test/superlock.test e47035e7fa127642781808ce4121c1e5df89b330f87116327d7f909342826f0e
|
||||||
F test/swarmvtab.test 250231404fcac88f61a6c147bb0e3a118ed879278cd3ccb0ae2d3a729e1e8e26
|
F test/swarmvtab.test 250231404fcac88f61a6c147bb0e3a118ed879278cd3ccb0ae2d3a729e1e8e26
|
||||||
F test/swarmvtab2.test c948cb2fdfc5b01d85e8f6d6504854202dc1a0782ab2a0ed61538f27cbd0aa5c
|
F test/swarmvtab2.test c948cb2fdfc5b01d85e8f6d6504854202dc1a0782ab2a0ed61538f27cbd0aa5c
|
||||||
F test/swarmvtab3.test 41a3ab47cb7a834d4e5336425103b617410a67bb95d335ef536f887587ece073
|
F test/swarmvtab3.test 41a3ab47cb7a834d4e5336425103b617410a67bb95d335ef536f887587ece073
|
||||||
@@ -2017,7 +2017,7 @@ F test/vtabdistinct.test 7688f0889358f849fd60bbfde1ded38b014b18066076d4bfbb75395
|
|||||||
F test/vtabdrop.test 65d4cf6722972e5499bdaf0c0d70ee3b8133944a4e4bc31862563f32a7edca12
|
F test/vtabdrop.test 65d4cf6722972e5499bdaf0c0d70ee3b8133944a4e4bc31862563f32a7edca12
|
||||||
F test/vtabrhs1.test 9b5ecbc74a689500c33a4b2b36761f9bcc22fcc4e3f9d21066ee0c9c74cf5f6c
|
F test/vtabrhs1.test 9b5ecbc74a689500c33a4b2b36761f9bcc22fcc4e3f9d21066ee0c9c74cf5f6c
|
||||||
F test/wal.test a5d6c7f4bd79251ed344229d96d44ecdfb896bdbd32b7e65f118756699c7e473
|
F test/wal.test a5d6c7f4bd79251ed344229d96d44ecdfb896bdbd32b7e65f118756699c7e473
|
||||||
F test/wal2.test e89ca97593b5e92849039f6b68ce1719a853ef20fa22c669ec1ac452fbc31cab
|
F test/wal2.test a6294b029ce3f1e48f7ad82260b09ed98fc44ab8349773f740d24681eed4a7d0
|
||||||
F test/wal2big.test 829141cbecdda4329db8fa38705424c4a73db72a06b9540b06811a825d330409
|
F test/wal2big.test 829141cbecdda4329db8fa38705424c4a73db72a06b9540b06811a825d330409
|
||||||
F test/wal2concurrent.test 7fc3e570073683a2a28f42bda46ecf516f5bc82afd703c1fbf4aa38e18fb3361
|
F test/wal2concurrent.test 7fc3e570073683a2a28f42bda46ecf516f5bc82afd703c1fbf4aa38e18fb3361
|
||||||
F test/wal2fault.test 2e8e60cacd5bcd451618aeffd05f676894d17202d3e2986e288d36e2c5993249
|
F test/wal2fault.test 2e8e60cacd5bcd451618aeffd05f676894d17202d3e2986e288d36e2c5993249
|
||||||
@@ -2035,7 +2035,7 @@ F test/wal3.test 5de023bb862fd1eb9d2ad26fa8d9c43abb5370582e5b08b2ae0d6f93661bc31
|
|||||||
F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c
|
F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c
|
||||||
F test/wal5.test 9c11da7aeccd83a46d79a556ad11a18d3cb15aa9
|
F test/wal5.test 9c11da7aeccd83a46d79a556ad11a18d3cb15aa9
|
||||||
F test/wal6.test b602704e4b066199bc89d91ca9000f335dcf4572
|
F test/wal6.test b602704e4b066199bc89d91ca9000f335dcf4572
|
||||||
F test/wal64k.test 2a525c0f45d709bae3765c71045ccec5df7d100ccbd3a7860fdba46c9addb965
|
F test/wal64k.test 165f227c8364533f144c993615f3066653fd279c40f3f4fb7bc2c89b5963c586
|
||||||
F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd
|
F test/wal7.test 2ae8f427d240099cc4b2dfef63cff44e2a68a1bd
|
||||||
F test/wal8.test d9df3fba4caad5854ed69ed673c68482514203c8
|
F test/wal8.test d9df3fba4caad5854ed69ed673c68482514203c8
|
||||||
F test/wal9.test 378e76a9ad09cd9bee06c172ad3547b0129a6750
|
F test/wal9.test 378e76a9ad09cd9bee06c172ad3547b0129a6750
|
||||||
@@ -2246,8 +2246,9 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
|
|||||||
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
|
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
|
||||||
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
|
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
|
||||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||||
P af65a902d10e50d827ff31f9ded7d05bc7ab0956a767366e1321b28fcb60b0bd e2d4c1890acfb97b6deda316d5308cea90d39f668319c3b42199b982d746e05c
|
P 1cef92de5059e468e0b1282425f50b089629c4f74671763bcefcb835798a9124
|
||||||
R 9532ba8fd6bbaaaca5d4ed5415ff2b96
|
Q +6e800b7035f55a211917d28cacf829b1681f37cbd2e6989c4cc20d4027a4192d
|
||||||
U drh
|
R c6b4176b37f2b5dbb7d04a0902a128c8
|
||||||
Z f4ef86ff9d0108204f2e920b48048359
|
U dan
|
||||||
|
Z e6bf5e2637d4942fcd140ab770336bc1
|
||||||
# Remove this line to create a well-formed Fossil manifest.
|
# Remove this line to create a well-formed Fossil manifest.
|
||||||
|
@@ -1 +1 @@
|
|||||||
1cef92de5059e468e0b1282425f50b089629c4f74671763bcefcb835798a9124
|
581efc34624c55832afbf7b691d768d6ddbf2b23d6a190d2fa0dde1b00251454
|
||||||
|
@@ -616,6 +616,12 @@ Tcl_SetVar2(interp, "sqlite_options", "mergesort", "1", TCL_GLOBAL_ONLY);
|
|||||||
Tcl_SetVar2(interp, "sqlite_options", "scanstatus", "0", TCL_GLOBAL_ONLY);
|
Tcl_SetVar2(interp, "sqlite_options", "scanstatus", "0", TCL_GLOBAL_ONLY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SQLITE_ENABLE_WAL_BIGHASH
|
||||||
|
Tcl_SetVar2(interp, "sqlite_options", "wal_bighash", "1", TCL_GLOBAL_ONLY);
|
||||||
|
#else
|
||||||
|
Tcl_SetVar2(interp, "sqlite_options", "wal_bighash", "0", TCL_GLOBAL_ONLY);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(SQLITE_ENABLE_LOCKING_STYLE)
|
#if !defined(SQLITE_ENABLE_LOCKING_STYLE)
|
||||||
# if defined(__APPLE__)
|
# if defined(__APPLE__)
|
||||||
# define SQLITE_ENABLE_LOCKING_STYLE 1
|
# define SQLITE_ENABLE_LOCKING_STYLE 1
|
||||||
|
37
src/wal.c
37
src/wal.c
@@ -458,13 +458,21 @@ int sqlite3WalTrace = 0;
|
|||||||
** version-2 ("journal_mode=wal2"). Legacy clients may support version-1
|
** version-2 ("journal_mode=wal2"). Legacy clients may support version-1
|
||||||
** only.
|
** only.
|
||||||
*/
|
*/
|
||||||
#define WAL_VERSION1 3007000 /* For "journal_mode=wal" */
|
#ifdef SQLITE_ENABLE_WAL_BIGHASH
|
||||||
#define WAL_VERSION2 3021000 /* For "journal_mode=wal2" */
|
# define WAL_VERSION1 3007001 /* For "journal_mode=wal" */
|
||||||
|
# define WAL_VERSION2 3021001 /* For "journal_mode=wal2" */
|
||||||
|
#else
|
||||||
|
# define WAL_VERSION1 3007000 /* For "journal_mode=wal" */
|
||||||
|
# define WAL_VERSION2 3021000 /* For "journal_mode=wal2" */
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef SQLITE_ENABLE_WAL2NOCKSUM
|
#ifdef SQLITE_ENABLE_WAL2NOCKSUM
|
||||||
# undef WAL_VERSION2
|
# undef WAL_VERSION2
|
||||||
# define WAL_VERSION2 3048000 /* For "journal_mode=wal2" sans checksums */
|
# ifdef SQLITE_ENABLE_WAL_BIGHASH
|
||||||
|
# define WAL_VERSION2 3048001 /* wal2, big-hash, checksums on frame hdrs */
|
||||||
|
# else
|
||||||
|
# define WAL_VERSION2 3048000 /* wal2, big-hash, full checksums */
|
||||||
|
# endif
|
||||||
# define isNocksum(pWal) isWalMode2(pWal)
|
# define isNocksum(pWal) isWalMode2(pWal)
|
||||||
#else
|
#else
|
||||||
# define isNocksum(pWal) 0
|
# define isNocksum(pWal) 0
|
||||||
@@ -842,7 +850,11 @@ struct Wal {
|
|||||||
** Each page of the wal-index mapping contains a hash-table made up of
|
** Each page of the wal-index mapping contains a hash-table made up of
|
||||||
** an array of HASHTABLE_NSLOT elements of the following type.
|
** an array of HASHTABLE_NSLOT elements of the following type.
|
||||||
*/
|
*/
|
||||||
typedef u16 ht_slot;
|
#ifdef SQLITE_ENABLE_WAL_BIGHASH
|
||||||
|
typedef u32 ht_slot;
|
||||||
|
#else
|
||||||
|
typedef u16 ht_slot;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** This structure is used to implement an iterator that loops through
|
** This structure is used to implement an iterator that loops through
|
||||||
@@ -879,9 +891,14 @@ struct WalIterator {
|
|||||||
** Changing any of these constants will alter the wal-index format and
|
** Changing any of these constants will alter the wal-index format and
|
||||||
** create incompatibilities.
|
** create incompatibilities.
|
||||||
*/
|
*/
|
||||||
#define HASHTABLE_NPAGE 4096 /* Must be power of 2 */
|
#ifdef SQLITE_ENABLE_WAL_BIGHASH
|
||||||
#define HASHTABLE_HASH_1 383 /* Should be prime */
|
# define HASHTABLE_BITS 17 /* 128K frames per hash */
|
||||||
#define HASHTABLE_NSLOT (HASHTABLE_NPAGE*2) /* Must be a power of 2 */
|
#else
|
||||||
|
# define HASHTABLE_BITS 12 /* 4K frames per hash */
|
||||||
|
#endif
|
||||||
|
# define HASHTABLE_NPAGE (1<<HASHTABLE_BITS) /* Must be power of 2 */
|
||||||
|
# define HASHTABLE_HASH_1 383 /* Should be prime */
|
||||||
|
# define HASHTABLE_NSLOT (HASHTABLE_NPAGE*2) /* Must be a power of 2 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** The block of page numbers associated with the first hash-table in a
|
** The block of page numbers associated with the first hash-table in a
|
||||||
@@ -2161,11 +2178,13 @@ int sqlite3WalOpen(
|
|||||||
assert( 40 == sizeof(WalCkptInfo) );
|
assert( 40 == sizeof(WalCkptInfo) );
|
||||||
assert( 120 == WALINDEX_LOCK_OFFSET );
|
assert( 120 == WALINDEX_LOCK_OFFSET );
|
||||||
assert( 136 == WALINDEX_HDR_SIZE );
|
assert( 136 == WALINDEX_HDR_SIZE );
|
||||||
|
#ifndef SQLITE_ENABLE_WAL_BIGHASH
|
||||||
assert( 4096 == HASHTABLE_NPAGE );
|
assert( 4096 == HASHTABLE_NPAGE );
|
||||||
assert( 4062 == HASHTABLE_NPAGE_ONE );
|
assert( 4062 == HASHTABLE_NPAGE_ONE );
|
||||||
assert( 8192 == HASHTABLE_NSLOT );
|
assert( 8192 == HASHTABLE_NSLOT );
|
||||||
assert( 383 == HASHTABLE_HASH_1 );
|
assert( 383 == HASHTABLE_HASH_1 );
|
||||||
assert( 32768 == WALINDEX_PGSZ );
|
assert( 32768 == WALINDEX_PGSZ );
|
||||||
|
#endif
|
||||||
assert( 8 == SQLITE_SHM_NLOCK );
|
assert( 8 == SQLITE_SHM_NLOCK );
|
||||||
assert( 5 == WAL_NREADER );
|
assert( 5 == WAL_NREADER );
|
||||||
assert( 24 == WAL_FRAME_HDRSIZE );
|
assert( 24 == WAL_FRAME_HDRSIZE );
|
||||||
@@ -2380,7 +2399,7 @@ static void walMergesort(
|
|||||||
ht_slot *aMerge = 0; /* List to be merged */
|
ht_slot *aMerge = 0; /* List to be merged */
|
||||||
int iList; /* Index into input list */
|
int iList; /* Index into input list */
|
||||||
u32 iSub = 0; /* Index into aSub array */
|
u32 iSub = 0; /* Index into aSub array */
|
||||||
struct Sublist aSub[13]; /* Array of sub-lists */
|
struct Sublist aSub[HASHTABLE_BITS+1]; /* Array of sub-lists */
|
||||||
|
|
||||||
memset(aSub, 0, sizeof(aSub));
|
memset(aSub, 0, sizeof(aSub));
|
||||||
assert( nList<=HASHTABLE_NPAGE && nList>0 );
|
assert( nList<=HASHTABLE_NPAGE && nList>0 );
|
||||||
|
@@ -14,6 +14,14 @@ set testdir [file dirname $argv0]
|
|||||||
source $testdir/tester.tcl
|
source $testdir/tester.tcl
|
||||||
source $testdir/lock_common.tcl
|
source $testdir/lock_common.tcl
|
||||||
|
|
||||||
|
# The superlock demo does not work with SQLITE_ENABLE_WAL_BIGHASH, as it
|
||||||
|
# assumes the *-shm page-size is 32KB.
|
||||||
|
#
|
||||||
|
ifcapable wal_bighash {
|
||||||
|
finish_test
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
set testprefix superlock
|
set testprefix superlock
|
||||||
do_not_use_codec
|
do_not_use_codec
|
||||||
|
|
||||||
|
@@ -931,6 +931,11 @@ db close
|
|||||||
# that exist are versions 3007000 (corresponding to SQLite version 3.7.0,
|
# that exist are versions 3007000 (corresponding to SQLite version 3.7.0,
|
||||||
# the first version of SQLite to feature wal mode).
|
# the first version of SQLite to feature wal mode).
|
||||||
#
|
#
|
||||||
|
set wal_version 3007000
|
||||||
|
ifcapable wal_bighash {
|
||||||
|
set wal_version 3007001
|
||||||
|
}
|
||||||
|
|
||||||
do_test wal2-10.1.1 {
|
do_test wal2-10.1.1 {
|
||||||
faultsim_delete_and_reopen
|
faultsim_delete_and_reopen
|
||||||
execsql {
|
execsql {
|
||||||
@@ -950,9 +955,9 @@ do_test wal2-10.1.3 {
|
|||||||
faultsim_restore_and_reopen
|
faultsim_restore_and_reopen
|
||||||
set hdr [wal_set_walhdr test.db-wal]
|
set hdr [wal_set_walhdr test.db-wal]
|
||||||
lindex $hdr 1
|
lindex $hdr 1
|
||||||
} {3007000}
|
} $wal_version
|
||||||
do_test wal2-10.1.4 {
|
do_test wal2-10.1.4 {
|
||||||
lset hdr 1 3007001
|
lset hdr 1 [expr $wal_version + 1]
|
||||||
wal_set_walhdr test.db-wal $hdr
|
wal_set_walhdr test.db-wal $hdr
|
||||||
catchsql { SELECT * FROM t1 }
|
catchsql { SELECT * FROM t1 }
|
||||||
} {1 {unable to open database file}}
|
} {1 {unable to open database file}}
|
||||||
@@ -965,9 +970,9 @@ do_test wal2-10.2.1 {
|
|||||||
do_test wal2-10.2.2 {
|
do_test wal2-10.2.2 {
|
||||||
set hdr [set_tvfs_hdr $::filename]
|
set hdr [set_tvfs_hdr $::filename]
|
||||||
lindex $hdr 0
|
lindex $hdr 0
|
||||||
} {3007000}
|
} $wal_version
|
||||||
do_test wal2-10.2.3 {
|
do_test wal2-10.2.3 {
|
||||||
lset hdr 0 3007001
|
lset hdr 0 [expr $wal_version + 1]
|
||||||
wal_fix_walindex_cksum hdr
|
wal_fix_walindex_cksum hdr
|
||||||
set_tvfs_hdr $::filename $hdr
|
set_tvfs_hdr $::filename $hdr
|
||||||
catchsql { SELECT * FROM t1 }
|
catchsql { SELECT * FROM t1 }
|
||||||
|
@@ -17,7 +17,7 @@ set testdir [file dirname $argv0]
|
|||||||
source $testdir/tester.tcl
|
source $testdir/tester.tcl
|
||||||
set testprefix wal64k
|
set testprefix wal64k
|
||||||
|
|
||||||
ifcapable !wal {finish_test ; return }
|
ifcapable !wal||wal_bighash {finish_test ; return }
|
||||||
|
|
||||||
if {$tcl_platform(platform) != "unix"} {
|
if {$tcl_platform(platform) != "unix"} {
|
||||||
finish_test
|
finish_test
|
||||||
|
Reference in New Issue
Block a user