]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoRemove an obsolete file. opfs-proxy-atomics
stephan [Tue, 20 Sep 2022 14:21:58 +0000 (14:21 +0000)] 
Remove an obsolete file.

FossilOrigin-Name: 1e43855498b4329f733bd6e0731841dc884e885de7d2d338d402d05d54309427

2 years agoSpeed up de/serialization of func args and return values in the OPFS VFS proxy.
stephan [Tue, 20 Sep 2022 13:25:39 +0000 (13:25 +0000)] 
Speed up de/serialization of func args and return values in the OPFS VFS proxy.

FossilOrigin-Name: 5bf235bbe035e4ace7a54851e190742528af6b4266328a1b8bbb9fb3dd7f2118

2 years agoOPFS proxy: remove one sanity-checking-only level of proxy function to shave off...
stephan [Tue, 20 Sep 2022 10:47:36 +0000 (10:47 +0000)] 
OPFS proxy: remove one sanity-checking-only level of proxy function to shave off a few microseconds.

FossilOrigin-Name: b534831f3efb8910a17e29956e3e87cc80055ea66e15dbef992b6a556ff042f8

2 years agoRemove extraneous result-code SAB slots. Doc additions.
stephan [Tue, 20 Sep 2022 10:11:52 +0000 (10:11 +0000)] 
Remove extraneous result-code SAB slots. Doc additions.

FossilOrigin-Name: 88de20712bbe3e11ea74af95edc34e9ab9f346f9aa0a30931e5a9e1f96ce57b0

2 years agoAn alternative messaging strategy for the OPFS VFS proxy which uses only SharedArrayB...
stephan [Tue, 20 Sep 2022 08:27:57 +0000 (08:27 +0000)] 
An alternative messaging strategy for the OPFS VFS proxy which uses only SharedArrayBuffer and Atomics, instead of worker messages, for communication (only the initial one-time handshake during initialization uses worker messages). It runs speedtest1 approx. 15-20% faster but still 20-ish% slower than WASMFS.

FossilOrigin-Name: a83ee3082d89439ea3ad5737e63e25bebb0f91895aca006ce5fecf5b93a2651a

2 years agoOPFS VFS: further internal refactoring towards experimenting with a new comms model.
stephan [Tue, 20 Sep 2022 03:31:02 +0000 (03:31 +0000)] 
OPFS VFS: further internal refactoring towards experimenting with a new comms model.

FossilOrigin-Name: 5ca412ced24b4e3af5f467e710a597ed440badf7b8335346aade11d3cad3d1a1

2 years agoOPFS VFS: moved i/o buffer from per-file to the VFS, and related refactoring, in...
stephan [Tue, 20 Sep 2022 01:28:47 +0000 (01:28 +0000)] 
OPFS VFS: moved i/o buffer from per-file to the VFS, and related refactoring, in prep for experimentation with a new inter-worker comms model.

FossilOrigin-Name: d4d63e4580ad8d497310608175308c03c517e051d7865cb66aa0b10356612d7d

2 years agoFurther metrics and buffer-copy optimizations in the OPFS proxy, but with little...
stephan [Mon, 19 Sep 2022 18:22:29 +0000 (18:22 +0000)] 
Further metrics and buffer-copy optimizations in the OPFS proxy, but with little effect.

FossilOrigin-Name: d1f1fe6f1c60640f7770dfb9245c459a09b8d24ec2ddf664dff77c810bd51f96

2 years agoCut the speedtest1 runtime of the OPFS VFS proxy by approximately 3/4ths via xRead...
stephan [Mon, 19 Sep 2022 17:09:09 +0000 (17:09 +0000)] 
Cut the speedtest1 runtime of the OPFS VFS proxy by approximately 3/4ths via xRead/xWrite buffer-copying optimizations. Still slower than the WASMFS impl by approx. 1/5th.

FossilOrigin-Name: fb7f287310d74a3e236125ae9c49b859f9263c29ae85161c1bcf9dd0778d8a51

2 years agoRemove an obsolete file. Update wasmfs build for today's changes. Fix the case that...
stephan [Mon, 19 Sep 2022 14:56:13 +0000 (14:56 +0000)] 
Remove an obsolete file. Update wasmfs build for today's changes. Fix the case that OPFS.xTruncate() is passed a BigInt instead of a Number.

FossilOrigin-Name: 976053925013bf1975f5f9222e28ba648af28e305bb6bdae600eb24d0e136bec

2 years agoAdd sqlite3_web_vfs_list() to JS API. Corrected OPFS VFS's registering itself as...
stephan [Mon, 19 Sep 2022 13:44:23 +0000 (13:44 +0000)] 
Add sqlite3_web_vfs_list() to JS API. Corrected OPFS VFS's registering itself as the default VFS. speedtest1-worker now uses the xDelete() of both the default VFS and OPFS, to avoid that it starts up with a persistent OPFS test db (the native app calls unlink(), but that unlink call operates on a different virtual filesystem than the OPFS VFS).

FossilOrigin-Name: 2ec7e09139a510b9fd29e4c97283b20740a00f369193c6fecbb734f187e81b48

2 years agoMerge kv-vfs branch into fiddle-opfs. Adjust various JS APIs and apps to deal with...
stephan [Mon, 19 Sep 2022 13:16:35 +0000 (13:16 +0000)] 
Merge kv-vfs branch into fiddle-opfs. Adjust various JS APIs and apps to deal with the new method of handling kvvfs. Adjust speedtest1 JS build to include sqlite3-api.js so that it can use kvvfs and opfs VFSes. Permit passing of the vfs as a URL parameter to certain demo/test apps. Milestone: speedtest-worker.html?vfs=opfs runs with the standalone OPFS impl.

FossilOrigin-Name: ec09f32f7ae2249aaf27388ad2062982afa8bbbb5f88d236d6d9068bf33ad93d

2 years agospeedtest1: add --vfs NAME flag and eliminate code duplication in argc size verificat...
stephan [Mon, 19 Sep 2022 11:47:38 +0000 (11:47 +0000)] 
speedtest1: add --vfs NAME flag and eliminate code duplication in argc size verification for all flags which take a value.

FossilOrigin-Name: 281d09867134e0a057cfadd9bfcbf0e21b8ac9737a278c41973d33a3101be7bc

2 years agoMinor doc improvements in demo-123.js.
stephan [Mon, 19 Sep 2022 10:13:01 +0000 (10:13 +0000)] 
Minor doc improvements in demo-123.js.

FossilOrigin-Name: 9370ce94780e974da03d5c74cf9a5983eed333e7b3bc54e605c5f30b3fa99287

2 years agoGeneric cleanups in the OPFS VFS proxies.
stephan [Mon, 19 Sep 2022 09:58:01 +0000 (09:58 +0000)] 
Generic cleanups in the OPFS VFS proxies.

FossilOrigin-Name: 7d5f6adc3b964413fc96ad8d2735312c3e58348024cabdd2099682cbf696eaf7

2 years agoCorrect OPFS VFS xRead() to copy the result buffer if the result code is SQLITE_IOERR...
stephan [Mon, 19 Sep 2022 09:25:25 +0000 (09:25 +0000)] 
Correct OPFS VFS xRead() to copy the result buffer if the result code is SQLITE_IOERR_SHORT_READ.

FossilOrigin-Name: 56668f9902c6e896b6c63621a444444c6f58ee20f88a5feae97f1699be35892d

2 years agoReplace OPFS VFS xSleep() impl with a more efficient one (no Worker round-trip needed).
stephan [Mon, 19 Sep 2022 05:19:04 +0000 (05:19 +0000)] 
Replace OPFS VFS xSleep() impl with a more efficient one (no Worker round-trip needed).

FossilOrigin-Name: b9773f164878b0a1b7c88cc7a6d1374ea95f64920065e8b2b178a1afffd82fe5

2 years agoRename demo-oo1.* to demo-123.* and add demo-123-worker.html, which runs the same...
stephan [Mon, 19 Sep 2022 03:57:31 +0000 (03:57 +0000)] 
Rename demo-oo1.* to demo-123.* and add demo-123-worker.html, which runs the same demo via a Worker. Doc typo fixes.

FossilOrigin-Name: 2e4a005bd35424caeaa99ace23162cf79e2ebdb159475ffad92b85dc864ad764

2 years agoDisable build of wasmfs-using components on aarch64 (ARM), as wasmfs won't build...
stephan [Mon, 19 Sep 2022 00:40:53 +0000 (00:40 +0000)] 
Disable build of wasmfs-using components on aarch64 (ARM), as wasmfs won't build there.

FossilOrigin-Name: 9a9eeebc2c27b734041089131b4952d7c0440df48ef32f355641aca61d4b30a0

2 years agoNumerous cleanups in the JS bits. Removed some now-defunct wasm test files. Expose...
stephan [Sun, 18 Sep 2022 17:32:35 +0000 (17:32 +0000)] 
Numerous cleanups in the JS bits. Removed some now-defunct wasm test files. Expose sqlite3.opfs object containing various OPFS-specific utilities.

FossilOrigin-Name: 26e625d05d9820033b23536f18ad3ddc59ed712ad507d4b0c7fe88abd15d2be8

2 years agoMove the OPFS VFS bits back into api/sqlite3-api-opfs.js. Refactor the OPFS VFS init...
stephan [Sun, 18 Sep 2022 03:05:55 +0000 (03:05 +0000)] 
Move the OPFS VFS bits back into api/sqlite3-api-opfs.js. Refactor the OPFS VFS init process to use a Promise-returning function which the client must call, as that eliminates any uncertainty about when the VFS (necessarily activated asynchronously) actually becomes available to the client. Rename x-sync-async.* to test-opfs-vfs.* Milestone: first successful test of OPFS without WASMFS.

FossilOrigin-Name: b2abf60dbfa6648f671a3932cb65feb28d05a0d5b7f792351d14f9c13d9798c5

2 years agoMove the OPFS VFS bits back into api/sqlite3-api-opfs.js. Refactor the OPFS VFS init...
stephan [Sun, 18 Sep 2022 02:35:30 +0000 (02:35 +0000)] 
Move the OPFS VFS bits back into api/sqlite3-api-opfs.js. Refactor the OPFS VFS init process to use a Promise-returning function which the client must call, as that eliminates any uncertainty about when the VFS (necessarily activated asynchronously) actually becomes available to the client.

FossilOrigin-Name: 1c660970d0f62bcfd6e698a72b050d99972a1e39f45a5ac24194a190f8f78ab3

2 years agoPlug OPFS methods in to their sqlite3_vfs/io_methods counterparts. Add URL args to...
stephan [Sun, 18 Sep 2022 00:16:12 +0000 (00:16 +0000)] 
Plug OPFS methods in to their sqlite3_vfs/io_methods counterparts. Add URL args to control debug output and running of sanity-checks in the OPFS init code.

FossilOrigin-Name: a0e93ed20b2463606a63b03ce8ca41ec1fb22886db5c5c898ace86ba24636f70

2 years agoCorrect OPFS xRead() and xWrite() impls and add a very basic sanity test for them.
stephan [Sat, 17 Sep 2022 23:47:20 +0000 (23:47 +0000)] 
Correct OPFS xRead() and xWrite() impls and add a very basic sanity test for them.

FossilOrigin-Name: cd06cc670029763955cf60ffcf944b36d41cb005b859d9b9fd0eea1b6741d0e9

2 years agoImplement OPFS xAccess(), albeit with more limited semantics than the VFS API calls...
stephan [Sat, 17 Sep 2022 23:29:27 +0000 (23:29 +0000)] 
Implement OPFS xAccess(), albeit with more limited semantics than the VFS API calls for. Add a way for OPFS xDelete() to optionally recursively remove empty dirs left over after deleting a file.

FossilOrigin-Name: c342b5d745f301104c59851c753287ebbbe95a69a56cb522d376d0f3e352c30f

2 years agoGeneric cleanups in the OPFS sync/async proxy.
stephan [Sat, 17 Sep 2022 21:13:26 +0000 (21:13 +0000)] 
Generic cleanups in the OPFS sync/async proxy.

FossilOrigin-Name: f36bddbe54c3acbfaa958042e4d24724f130bdca551401033f9bc63f3da73492

2 years agoAdd the remaining vfs/io_methods wrappers to the OPFS sync/async proxy, but most...
stephan [Sat, 17 Sep 2022 20:50:12 +0000 (20:50 +0000)] 
Add the remaining vfs/io_methods wrappers to the OPFS sync/async proxy, but most are not yet tested.

FossilOrigin-Name: 44db9132145b3072488ea91db53f6c06be74544beccad5fd07efd22c0f03dc04

2 years agoFix an uninitialized variable in the decoder kv-vfs.
drh [Sat, 17 Sep 2022 18:31:31 +0000 (18:31 +0000)] 
Fix an uninitialized variable in the decoder kv-vfs.

FossilOrigin-Name: 354726aa6c399053785f29104de15091629ce4bc275b9e2205cb3656a9e81cd7

2 years agoInclude the kv-vfs as an optional VFS on unix builds if the
drh [Sat, 17 Sep 2022 18:29:49 +0000 (18:29 +0000)] 
Include the kv-vfs as an optional VFS on unix builds if the
SQLITE_OS_KV_OPTIONAL compile-time option is present.

FossilOrigin-Name: 852812d1e2ec3c53ad7c6c64662b37d861fefcf1baeee3d58eba88bcb3f6d8df

2 years agoMerge the latest trunk enhancements into the kv-vfs branch.
drh [Sat, 17 Sep 2022 17:26:44 +0000 (17:26 +0000)] 
Merge the latest trunk enhancements into the kv-vfs branch.

FossilOrigin-Name: 37c7ca25a6e837e7f83b96a32e2b1a455730e48a48012c458ae2e734a3ccdd1f

2 years agoAdd initial bits of an experimental async-impl-via-synchronous-interface proxy intend...
stephan [Sat, 17 Sep 2022 15:08:22 +0000 (15:08 +0000)] 
Add initial bits of an experimental async-impl-via-synchronous-interface proxy intended to marshal OPFS via sqlite3_vfs API.

FossilOrigin-Name: 38da059b472415da52f57de7332fbeb8a91e3add1f4be3ff9c1924b52672f77c

2 years agoMerge kv-vfs branch into fiddle-opfs branch. Adjust speedtest1 --size flags to accoun...
stephan [Fri, 16 Sep 2022 20:16:50 +0000 (20:16 +0000)] 
Merge kv-vfs branch into fiddle-opfs branch. Adjust speedtest1 --size flags to account for new size limit.

FossilOrigin-Name: afb79050e635f3c698e51f06c346cbf23b096cfda7d0f1d8e68514ea0c25b7b7

2 years agoCorrections to the xRead method for databases in the os_kv.c VFS so that it
drh [Fri, 16 Sep 2022 15:19:04 +0000 (15:19 +0000)] 
Corrections to the xRead method for databases in the os_kv.c VFS so that it
correctly reads the header, and thus avoids unnecessary cache flushes.  This
changes also includes an optimization to the header read logic.

FossilOrigin-Name: ef54961ce69fddb4cfeeff0860288de2858a6f7a5aa396691e8e99933eb9af54

2 years agoWhen calculating kvvfs sessionStorage/localStorage size, multiply it by 2 to account...
stephan [Fri, 16 Sep 2022 12:49:45 +0000 (12:49 +0000)] 
When calculating kvvfs sessionStorage/localStorage size, multiply it by 2 to account for JS using 16-bit characters.

FossilOrigin-Name: 52d1b185b9f6cee1eb3dec436f47e0f52e4621a127abfad8c27f92fd78147889

2 years agoMerge kv-vfs branch into fiddle-opfs branch for [21915af560b1|synchronous=off fix...
stephan [Fri, 16 Sep 2022 11:45:09 +0000 (11:45 +0000)] 
Merge kv-vfs branch into fiddle-opfs branch for [21915af560b1|synchronous=off fix]. Remove some duplicate debug output in OPFS test code.

FossilOrigin-Name: 13899bb98c80525276d2484598b94e4206358f243f06d45c02700024f7e226fd

2 years agoFix os_kv.c so that it uses SQLITE_FCNTL_SYNC and hence
drh [Fri, 16 Sep 2022 11:37:01 +0000 (11:37 +0000)] 
Fix os_kv.c so that it uses SQLITE_FCNTL_SYNC and hence
works even with PRAGMA synchronous=OFF.

FossilOrigin-Name: 21915af560b111aeeaee751790356151a5f063c2fc703dd4b35b22dc393409fb

2 years agoAdd batch-runner-kvvfs.html, a kvvfs-specific build of batch-runner.html. Reduce...
stephan [Fri, 16 Sep 2022 02:30:49 +0000 (02:30 +0000)] 
Add batch-runner-kvvfs.html, a kvvfs-specific build of batch-runner.html. Reduce the speedtest1 --size X value for the batch list generation to 5 so that the kvvfs batch runner can handle it.

FossilOrigin-Name: d8df25920a047d5cf2093cc6233128c5e6057a9104d0c4397e643645bd646fe1

2 years agoRemove --nosync flag from speedtest1-kvvfs.html, as that seems to be the trigger...
stephan [Fri, 16 Sep 2022 02:28:03 +0000 (02:28 +0000)] 
Remove --nosync flag from speedtest1-kvvfs.html, as that seems to be the trigger for the 'no such table: z1' error. That app now warns if that flag is passed to it via URL args.

FossilOrigin-Name: ad0677e8abcc077636d1cf1d8485be4943506382581edf832e6b8a2021560040

2 years agoPull the src/os_kv.c part of [13839759f8f4] into the kv-vfs branch.
stephan [Fri, 16 Sep 2022 01:08:06 +0000 (01:08 +0000)] 
Pull the src/os_kv.c part of [13839759f8f4] into the kv-vfs branch.

FossilOrigin-Name: e334449912d5176e355d02024a07ed867741f71c9d10ce6744ca800414bf3eeb

2 years agoAdd return value checks to kvstorageWrite(), necessary for recognizing storage-full...
stephan [Fri, 16 Sep 2022 01:05:19 +0000 (01:05 +0000)] 
Add return value checks to kvstorageWrite(), necessary for recognizing storage-full errors in the JS binding. speedtest1-kvvfs.html runs successfully on localStorage with --size 1 to 6 and starts failing with storage shortage at --size 7.

FossilOrigin-Name: 13839759f8f45e4eb0aa6a5052801f3964d5b2dc2e427e5e91ee6692176381eb

2 years agoMore work on the synchronous OPFS experimentation. Numerous wasm/js build tweaks...
stephan [Thu, 15 Sep 2022 06:42:41 +0000 (06:42 +0000)] 
More work on the synchronous OPFS experimentation. Numerous wasm/js build tweaks. Add speeedtest-wasmfs.html, the wasmfs/opfs counterpart of speedtest1.html.

FossilOrigin-Name: 00ee49a3a2c148480f614e49a0ee5b35a255758c0a53693f0b464b31e7a4045b

2 years agoRemove some stale comments. Get scratchpad-opfs-worker2.js running again in prep...
stephan [Thu, 15 Sep 2022 03:16:49 +0000 (03:16 +0000)] 
Remove some stale comments. Get scratchpad-opfs-worker2.js running again in prep for reuse in experimenting with the OPFS all-synchronous API.

FossilOrigin-Name: 4cbbd370186f84e440f496e7f11c641d7dc1723acc46e4a31483392e0eb046e9

2 years agoSplit wasmfs-enabled build of sqlite3.js/wasm into sqlite3-wasmfs.js/wasm, as enablin...
stephan [Thu, 15 Sep 2022 03:09:00 +0000 (03:09 +0000)] 
Split wasmfs-enabled build of sqlite3.js/wasm into sqlite3-wasmfs.js/wasm, as enabling wasmfs breaks all tests/demos which run from a Worker thread.

FossilOrigin-Name: 08476f3c218d45846e7496bdae0b06e2122466111fdf2aa2aabb1805b15ef982

2 years agoClean up some JS documentation.
stephan [Thu, 15 Sep 2022 02:27:48 +0000 (02:27 +0000)] 
Clean up some JS documentation.

FossilOrigin-Name: 925fdbfc6c1f9f06951346bc0d4fb81ffb5797d5f1123728931973f6cb1a0efa

2 years agoAdd/apply various kvvfs-specific utility APIs to the JS layer to assist in testing...
stephan [Tue, 13 Sep 2022 19:27:03 +0000 (19:27 +0000)] 
Add/apply various kvvfs-specific utility APIs to the JS layer to assist in testing and analysis. Correct a backwards default arg check for sqlite3ApiBootstrap(). Add exports for sqlite3_db_handle(), sqlite3_file_control(), and the SQLITE_FCNTL_xxx enum.

FossilOrigin-Name: 0d78961870ee9f22f1ba16d423377d28dcc36e04b1e31ffd57f3e2fd51f8f0f2

2 years agoGet testing1.js working with a kvvfs build.
stephan [Mon, 12 Sep 2022 22:27:00 +0000 (22:27 +0000)] 
Get testing1.js working with a kvvfs build.

FossilOrigin-Name: 333a45725d1708e0fefa559c33ce1c7eeb425cdb04f594b1f2b48166c1478c79

2 years agoRemove an extraneous key-copy op in the EM_JS impl of kvstorageDelete().
stephan [Mon, 12 Sep 2022 20:21:34 +0000 (20:21 +0000)] 
Remove an extraneous key-copy op in the EM_JS impl of kvstorageDelete().

FossilOrigin-Name: 1c5aeee45564c14e7e2e7730f3f52106339ea3148fb5aa786fa767a35db46f51

2 years agoMerge kv-vfs branch into fiddle-opfs and add speedtest1-kvvfs.html test app (which...
stephan [Mon, 12 Sep 2022 20:18:28 +0000 (20:18 +0000)] 
Merge kv-vfs branch into fiddle-opfs and add speedtest1-kvvfs.html test app (which currently fails early on).

FossilOrigin-Name: 8b1608a9a37131121cb3a0cb1e8dbad5e39dc1fc2a341d056f09537f179b2e7a

2 years agoFix the <sys/time.h> include in os_kv.c.
drh [Mon, 12 Sep 2022 19:33:20 +0000 (19:33 +0000)] 
Fix the <sys/time.h> include in os_kv.c.

FossilOrigin-Name: 878cc93e779c3857adc711f212520f007256274fcd3f6f3d72c754a937fcd198

2 years agoAdd a gettimeofday()-based implementation of xCurrentTimeInt64() to os_kv.c.
drh [Mon, 12 Sep 2022 19:29:34 +0000 (19:29 +0000)] 
Add a gettimeofday()-based implementation of xCurrentTimeInt64() to os_kv.c.

FossilOrigin-Name: e393ed650ef124143f84e9d787fb996e308dd7af6b8f50df72a6f085b67bf9c3

2 years agoFix a debugging/testing edit in the previous check-in.
drh [Mon, 12 Sep 2022 18:10:41 +0000 (18:10 +0000)] 
Fix a debugging/testing edit in the previous check-in.

FossilOrigin-Name: 6fc8d34c0ae1f8277544be741f2f0835fad8e475d35bd24573224ccc1699b8bd

2 years agoAdd sqlite3.oo1.DB.clearKvvfsStorage(). Add controls to kvvfs1.js demo to reset and...
stephan [Mon, 12 Sep 2022 17:59:04 +0000 (17:59 +0000)] 
Add sqlite3.oo1.DB.clearKvvfsStorage(). Add controls to kvvfs1.js demo to reset and query the db without requiring the dev console.

FossilOrigin-Name: d845c6c22bd5d3fffc66e0566df346d690dd8bd1fc1688e312161b1a1edcfd79

2 years agoFaster text decoder for kv_os.c.
drh [Mon, 12 Sep 2022 17:44:35 +0000 (17:44 +0000)] 
Faster text decoder for kv_os.c.

FossilOrigin-Name: 3354a2edb762d70ccc31d4d25f81b70e644d76e01cb1e81d2e97b5414d809d30

2 years agoMerge kv-vfs branch into fiddle-opfs branch to add kvvfs-based wasm build and demo.
stephan [Mon, 12 Sep 2022 16:09:50 +0000 (16:09 +0000)] 
Merge kv-vfs branch into fiddle-opfs branch to add kvvfs-based wasm build and demo.

FossilOrigin-Name: a7d8b26acd3c1ae344369e4d70804c0cab45272c0983cfd32d616a0a7b28acb9

2 years agoNew run-time options to the speed-check.sh script.
drh [Mon, 12 Sep 2022 16:07:24 +0000 (16:07 +0000)] 
New run-time options to the speed-check.sh script.

FossilOrigin-Name: ff46bc9d2a844dde9dafa157114f4d9ee157205ca5c08ed9ee32f018de310e62

2 years agoFix uninitialized variable in rollback-journal processing in os_kv.c
drh [Mon, 12 Sep 2022 15:59:35 +0000 (15:59 +0000)] 
Fix uninitialized variable in rollback-journal processing in os_kv.c

FossilOrigin-Name: e49682c5eac91958f143e639c5656ca54560d14f5805d514bf4aa0c206e63844

2 years agoResolve missing kvvfs JS test: sqlite3_initialize() must be called by the client...
stephan [Mon, 12 Sep 2022 13:05:54 +0000 (13:05 +0000)] 
Resolve missing kvvfs JS test: sqlite3_initialize() must be called by the client in this build. Add basic sanity test of kvvfs using sessionStorage().

FossilOrigin-Name: 250a935aeb94d3fadec0d3fe22de85de4e658e2fdb3be3aa9a8bbc8f7b7d8414

2 years agoFix the amalgamation so that it builds with the standard unix backend again.
drh [Mon, 12 Sep 2022 12:41:07 +0000 (12:41 +0000)] 
Fix the amalgamation so that it builds with the standard unix backend again.

FossilOrigin-Name: 0adf158f4e5791339988185cc29347c75056b062e0db65b5999fdfa1f433c1ed

2 years agoInitial build of kvvfs in wasm. It loads but cannot find the VFS for as-yet-unknown...
stephan [Mon, 12 Sep 2022 12:39:28 +0000 (12:39 +0000)] 
Initial build of kvvfs in wasm. It loads but cannot find the VFS for as-yet-unknown reasons (sqlite3 shell works fine), and most APIs throw "null function or function signature mismatch" from deep within wasm, presumably as a side effect of the "missing" VFS.

FossilOrigin-Name: 1a2f24a0bdfc6eaae478916b8f4f9c6b63ead9964534fc2951fb4e995ffe61f1

2 years agoMinor cleanups and documentation in the wasm pieces.
stephan [Sun, 11 Sep 2022 16:59:40 +0000 (16:59 +0000)] 
Minor cleanups and documentation in the wasm pieces.

FossilOrigin-Name: 4e6ce329872eb733ba2f7f7879747c52761ae97790fd8ed169a25a79854cc3d9

2 years agoCorrect the result code from kvstorageRead() for the OOM case to be a negative value.
stephan [Sun, 11 Sep 2022 05:44:15 +0000 (05:44 +0000)] 
Correct the result code from kvstorageRead() for the OOM case to be a negative value.

FossilOrigin-Name: cdbf09fa1b0c93aeb3222a157de33a4688ae629c2b829ffff0f1f62364c5ae1c

2 years agoMinor cleanups and docs for the EM_JS() impls of the kvvfs read/write/delete ops.
stephan [Sun, 11 Sep 2022 05:38:39 +0000 (05:38 +0000)] 
Minor cleanups and docs for the EM_JS() impls of the kvvfs read/write/delete ops.

FossilOrigin-Name: 53b7572e441be4b4b29b4228d0f95b24457d7faaf6c0b568ed5c970a55e21ffb

2 years agoAdd EM_JS() impl for kvstorageRead().
stephan [Sun, 11 Sep 2022 04:49:29 +0000 (04:49 +0000)] 
Add EM_JS() impl for kvstorageRead().

FossilOrigin-Name: 06610314fcf644f323c2f7ae11d7f4349b195e66d0ebbee590438dd99d97eb96

2 years agoInitial prototype impls of write/delete-key ops for the pending kvvfs which use sessi...
stephan [Sun, 11 Sep 2022 02:43:08 +0000 (02:43 +0000)] 
Initial prototype impls of write/delete-key ops for the pending kvvfs which use sessionStorage or localStorage for db page storage. read-key op is pending.

FossilOrigin-Name: a4bd96f5348e607d0fcb627b751f9d86a188173a4b3bfb2c95f92913a78bd31e

2 years agoImproved comments in os_kv.c. Better names for the key/value name spaces.
drh [Sat, 10 Sep 2022 18:38:21 +0000 (18:38 +0000)] 
Improved comments in os_kv.c.  Better names for the key/value name spaces.

FossilOrigin-Name: 8e1652a3856765c9146cc2a7e3b598a2dc7dc84c556b35eab9a35184514384b9

2 years agoMove the vfskv.c extension to src/os_kv.c and make it part of the amalgamation,
drh [Sat, 10 Sep 2022 18:20:59 +0000 (18:20 +0000)] 
Move the vfskv.c extension to src/os_kv.c and make it part of the amalgamation,
activated if and only if SQLITE_OS_KV is true.

FossilOrigin-Name: f6632e69c2ec1a7ddc4e51f3567e3bc082ee94a6dd51fdafdc0c3bf386a32d4c

2 years agoFix harmless compiler warning seen with MSVC.
mistachkin [Fri, 9 Sep 2022 17:50:29 +0000 (17:50 +0000)] 
Fix harmless compiler warning seen with MSVC.

FossilOrigin-Name: 73c4c68d3b4c16caf8281dabddd7365d24691e5ee2da89b1783eca66bfbd9280

2 years agoDatabase must be named either "local" or "session". Each has a distinct
drh [Fri, 9 Sep 2022 16:16:33 +0000 (16:16 +0000)] 
Database must be named either "local" or "session".  Each has a distinct
namespace.

FossilOrigin-Name: c8e41279294ea7c2f041c7d4cbbd85fce47d55f2f56180ca837316f7dfd75237

2 years agoSeparate sqlite3_io_methods objects for database files and journals.
drh [Fri, 9 Sep 2022 14:22:41 +0000 (14:22 +0000)] 
Separate sqlite3_io_methods objects for database files and journals.

FossilOrigin-Name: 74fbf6c2a97729e481d5562344e960d0c237aeb1f07240262d32a24fb1f4b5a3

2 years agoSimple reading and writing now works.
drh [Fri, 9 Sep 2022 11:41:54 +0000 (11:41 +0000)] 
Simple reading and writing now works.

FossilOrigin-Name: 00845ac9ef2616e90f5f6a20da3dd040fa8bdcfe73f72fe9c06039561150a82d

2 years agoRemove a reference to a completed TODO.
stephan [Fri, 9 Sep 2022 05:39:36 +0000 (05:39 +0000)] 
Remove a reference to a completed TODO.

FossilOrigin-Name: 757ad69607201a26802a304839b8454b1634712458539d6aa8cf999ab2447e59

2 years agospeedtest1 wasm: add a link in the worker variant which launches the main-thread...
stephan [Fri, 9 Sep 2022 04:50:18 +0000 (04:50 +0000)] 
speedtest1 wasm: add a link in the worker variant which launches the main-thread variant with the selected CLI flags. Append collected stdout/stderr to the main-thread page after execution is finished to avoid having to open the dev tools (which inexplicably slows down wasm execution).

FossilOrigin-Name: 02709ee2beab36d144b807fd9ffaee639e3c1bdd1908a34e05f3fd23dad2ef66

2 years agoMake use of the --big-transactions flag in the speedtest1 JS apps.
stephan [Thu, 8 Sep 2022 21:33:50 +0000 (21:33 +0000)] 
Make use of the --big-transactions flag in the speedtest1 JS apps.

FossilOrigin-Name: f2846dcbcaac7880394fb14597c3a60ed310419128c4c5b863cd771a7e5cdeb5

2 years agoAdd speedtest1 --big-transactions flag to cause its large tests which rely on implici...
stephan [Thu, 8 Sep 2022 21:09:42 +0000 (21:09 +0000)] 
Add speedtest1 --big-transactions flag to cause its large tests which rely on implicit transactions to be wrapped in BEGIN/COMMIT, per /chat discussion. Added to support of the WASMFS build, which slows down significantly when thousands of implicit transactions are used.

FossilOrigin-Name: 51395c005da46b7fa5a5f28809dd8fea263a6bac2b1492759b3d5a5aa7d399ca

2 years agoMinor build cleanups and tweaks in the speedtest1 wasm apps.
stephan [Thu, 8 Sep 2022 20:04:52 +0000 (20:04 +0000)] 
Minor build cleanups and tweaks in the speedtest1 wasm apps.

FossilOrigin-Name: 5240fb4d795dea826f23cf5d2152b519f5a46f49bb2499ea868fa7c7f4ce788b

2 years agoExperimentally add --nomutex flag to speedtest1 to have it open db with the SQLITE_OP...
stephan [Thu, 8 Sep 2022 19:53:59 +0000 (19:53 +0000)] 
Experimentally add --nomutex flag to speedtest1 to have it open db with the SQLITE_OPEN_NOMUTEX flag.

FossilOrigin-Name: 45ef576b2ee6369ab1e3aa2ad284764bb334f92a69a33d88b7292bbc0a1b1fda

2 years agoCompiles and loads as an extension. Starts to run but quickly hits issues.
drh [Thu, 8 Sep 2022 17:12:12 +0000 (17:12 +0000)] 
Compiles and loads as an extension.  Starts to run but quickly hits issues.

FossilOrigin-Name: 2e38726f46918b28b5c638967f960a20afd3fe84ad245f3bea39a1d64980435b

2 years agoCompiles without error, but untested.
drh [Thu, 8 Sep 2022 16:27:50 +0000 (16:27 +0000)] 
Compiles without error, but untested.

FossilOrigin-Name: a329939c32e33d8d00066ba3d4327f07cca1b4e67de0b8d85f1e7f98afe40954

2 years agoCode snapshot. Completely untested. Probably does not compile.
drh [Thu, 8 Sep 2022 15:48:01 +0000 (15:48 +0000)] 
Code snapshot.  Completely untested.  Probably does not compile.

FossilOrigin-Name: 51e267696d25f2f83b5bb847d5254ab15573ef1a16ea3d7dd8279c73c0bee539

2 years agoAdd speedtest1-worker.html, an interactive Worker-thread variant of speedtest1.html...
stephan [Thu, 8 Sep 2022 15:30:59 +0000 (15:30 +0000)] 
Add speedtest1-worker.html, an interactive Worker-thread variant of speedtest1.html. Add ext/wasm/index.html to act as a gateway to the various test pages.

FossilOrigin-Name: f16c68ee6d5ebb8dec2ab656dbab2ddb5f1d5133153ad553f986b31020adaa38

2 years agoEnhance an assert() to impose for tighter constraints on the operation of pcache.
drh [Wed, 7 Sep 2022 20:11:22 +0000 (20:11 +0000)] 
Enhance an assert() to impose for tighter constraints on the operation of pcache.

FossilOrigin-Name: 42105eb43a916a7cd839fa6c582eaffaef17f50b23c3e05142400c379feb73c7

2 years agoAn improved technique for ensuring that the Rekey() operation does not
drh [Wed, 7 Sep 2022 19:28:18 +0000 (19:28 +0000)] 
An improved technique for ensuring that the Rekey() operation does not
overwrite an existing page number.  This approach does not change the
semantics of the underlying pluggable pcache and it is easier to prove
correct.  This replaces the changes at
[aadd38f99a3e5abc] and [81cff9f1955874aa].

FossilOrigin-Name: 7dbddde79e3ca1b81e00288616fc27434698ce6dcb47714728fce8602ae91f45

2 years agoNon-working code towards a VFS for text key/value storage.
drh [Wed, 7 Sep 2022 17:29:22 +0000 (17:29 +0000)] 
Non-working code towards a VFS for text key/value storage.

FossilOrigin-Name: f9c89ee8d5ef46342bea78fa8d4da058d9ea628183ec985642bbda1cdfeacd5f

2 years agoAdd a note about Emscripten's -sSINGLE_FILE flag, why it would be nice, and why we...
stephan [Tue, 6 Sep 2022 23:04:51 +0000 (23:04 +0000)] 
Add a note about Emscripten's -sSINGLE_FILE flag, why it would be nice, and why we can't use it.

FossilOrigin-Name: 5ea0623630d769a8f3f07a40cd119be86b631192cdb5178131876b01b40ee5e0

2 years agoGet speedtest1.js working with WASMFS/OPFS.
stephan [Tue, 6 Sep 2022 20:17:15 +0000 (20:17 +0000)] 
Get speedtest1.js working with WASMFS/OPFS.

FossilOrigin-Name: 40e60f570d4f489d58d12e27c1c067b41d6c5a5e374c5fce0baa8881ef183216

2 years agoInitial build of speedtest1.wasm and speedtest1.html with which to run it.
stephan [Tue, 6 Sep 2022 16:47:43 +0000 (16:47 +0000)] 
Initial build of speedtest1.wasm and speedtest1.html with which to run it.

FossilOrigin-Name: 4441535e3e54dc1881f700fa3878964eb8554a6790fd6aa32945f7cc104a8467

2 years agoMinor internal doc clarifications.
stephan [Tue, 6 Sep 2022 16:35:54 +0000 (16:35 +0000)] 
Minor internal doc clarifications.

FossilOrigin-Name: 09796cc2bfce7bc4ce11db9673d20737259e9928f0484660cba3a9751f7d01c5

2 years agoMerge trunk into fiddle-opfs branch.
stephan [Tue, 6 Sep 2022 09:59:06 +0000 (09:59 +0000)] 
Merge trunk into fiddle-opfs branch.

FossilOrigin-Name: 7f76eaec793720db87415a476ddf539bc4dea3e74c8e5406d6739206aebdacc2

2 years agoAdd the tool/omittest-msvc.tcl script that will try to build using MSVC
drh [Mon, 5 Sep 2022 22:54:36 +0000 (22:54 +0000)] 
Add the tool/omittest-msvc.tcl script that will try to build using MSVC
using various compile-time options, to ensure that the compile-time options
all build without errors.

FossilOrigin-Name: 6b00ecb59fd303f7985902c35a46db9e729201d4beaedea46596b728d9e4b1c8

2 years agoGet the tool/omittest-msvc.tcl script working. msvc-omit-test
drh [Mon, 5 Sep 2022 22:53:24 +0000 (22:53 +0000)] 
Get the tool/omittest-msvc.tcl script working.

FossilOrigin-Name: 82b89f8a074858a81d841dfc26436e8d39ce4907b8f989eba4d848db16758303

2 years agoAdd a prototype for a script, similar to tool/omittest.tcl, that is designed
drh [Mon, 5 Sep 2022 20:42:01 +0000 (20:42 +0000)] 
Add a prototype for a script, similar to tool/omittest.tcl, that is designed
to test builds using MSVC to ensure they work with various OMIT options.

FossilOrigin-Name: b1e37a0bd31fa9f8e58c2859a80c23a682b4702eefab2c55b243f1e21d475d6c

2 years agoFix the windows build so that it works with -DSQLITE_OMIT_AUTOINIT.
drh [Mon, 5 Sep 2022 18:17:03 +0000 (18:17 +0000)] 
Fix the windows build so that it works with -DSQLITE_OMIT_AUTOINIT.

FossilOrigin-Name: f74a5ea8c986dc33d3afcda169c38abbe55728c56716cf9991a5e2ef7fc4917a

2 years agoMinor cleanups in OO API #1. Add Sudoku SQL to batch-runner.js's list.
stephan [Mon, 5 Sep 2022 13:24:08 +0000 (13:24 +0000)] 
Minor cleanups in OO API #1. Add Sudoku SQL to batch-runner.js's list.

FossilOrigin-Name: 4488cb5798f34cbba14eb8e2aa5da8420c14a85d37d278d357406aedd5c3a9e5

2 years agowasm: minor text and build cleanups.
stephan [Sat, 3 Sep 2022 11:41:44 +0000 (11:41 +0000)] 
wasm: minor text and build cleanups.

FossilOrigin-Name: 36ceef94e1935f5e85f79e489cd0ed265a77820fb68329c190794df5e076bf84

2 years agoEnsure the Pager.journalOff variable is zeroed if an error occurs while writing the...
dan [Fri, 2 Sep 2022 21:19:24 +0000 (21:19 +0000)] 
Ensure the Pager.journalOff variable is zeroed if an error occurs while writing the initial header to the journal file.

FossilOrigin-Name: da7af290960ab8a04a1f55cdc5eeac36b47fa194edf67f0a05daa4b7f2a4071c

2 years agoFix an assert() associated with the dbsqlfuzz error at [8372468bb5d8922c].
drh [Fri, 2 Sep 2022 17:25:25 +0000 (17:25 +0000)] 
Fix an assert() associated with the dbsqlfuzz error at [8372468bb5d8922c].

FossilOrigin-Name: 54251f81ebc43839cc97f91d2df4c320c1b96b5690cc11ce45b60c087c9becd6

2 years agoIf sqlite3PcacheMove() really performs a swap, then be sure to renumber the
drh [Fri, 2 Sep 2022 15:09:55 +0000 (15:09 +0000)] 
If sqlite3PcacheMove() really performs a swap, then be sure to renumber the
second page.

FossilOrigin-Name: 81cff9f1955874aade55daa94263f58f06d966bd51ad558755f92777069a7347

2 years agoEnhance the pcache1 implementation so that during an xRekey operation if
drh [Fri, 2 Sep 2022 14:29:54 +0000 (14:29 +0000)] 
Enhance the pcache1 implementation so that during an xRekey operation if
another page already exists at the destination, that other page gets moved
to the source key.

FossilOrigin-Name: aadd38f99a3e5abcf9bef49f4367752f163cc79500a28f812bb71969d7de419c

2 years agoMutex protect access to the sqlite3_test_directory and sqlite3_data_directory
drh [Fri, 2 Sep 2022 11:45:26 +0000 (11:45 +0000)] 
Mutex protect access to the sqlite3_test_directory and sqlite3_data_directory
global variables.  See
[forum:/forumpost/719a11e1314d1c70|forum thread 719a11e1314d1c70].

FossilOrigin-Name: 8e6ad3a3e942a326cf16432e16d6596c7206c05b6f45cd0ff3a9b836bcfc9deb

2 years agoImproved mutex protection of the sqlite3_temp_directory and tempdir-mutex
drh [Fri, 2 Sep 2022 11:12:16 +0000 (11:12 +0000)] 
Improved mutex protection of the sqlite3_temp_directory and
sqlite3_data_directory global variables.

FossilOrigin-Name: ebbe9634d6dde9e097f61fb98a79111e46de422b7bbbd9ed3af7b6f22aacf5ec