Commit Graph

24773 Commits

Author SHA1 Message Date
drh
40c9becc81 Is the query flattener restriction 29 (do not allow both EP_InnerON and
EP_OuterON constraints on the same FROM clause term) really necessary?   This
branch explores what happens if we omit that restriction.  This is an effort
to address the performance regression reported by
[forum:/forumpost/96b9e5709cf47cda|forum post 96b9e5709cf47cda] that is caused
by flattener restriction 29.

FossilOrigin-Name: 19270577ad1d08c9e6e5f0600396b8a1ccda9df1e67a0df845aee6b60437f379
2022-09-20 16:57:49 +00:00
stephan
4cffb644c7 Correct a too-strict is-opfs-available check.
FossilOrigin-Name: 1b5f1b4a6c1457f98c258459e23e321fc59793de298fecb84031b87f02156cd5
2022-09-20 16:20:35 +00:00
stephan
fa5aac7475 Merge kv-vfs-magic-names branch into fiddle-opfs branch and make some kvvfs-relevant tweaks.
FossilOrigin-Name: e3d36dcdd37e59f17a07d3611d08744eb86f439fab82a648490dd608bcaa3185
2022-09-20 16:10:39 +00:00
stephan
89071030db Export the sqlite3_uri_...() family of functions to wasm.
FossilOrigin-Name: 72bebc848fce5c3b4766017d016ccb2360de2bd0cb3e47e710c80dbcb6b8b707
2022-09-20 14:52:26 +00:00
stephan
fea03bc0ca Merge opfs-proxy-atomics branch into the fiddle-opfs branch.
FossilOrigin-Name: 25a36920d44544547a84161681cd41e292b4a70df60ac3630791873a79237d98
2022-09-20 14:39:54 +00:00
drh
c3b6fdaead When compiled with SQLITE_OS_KV_OPTIONAL, the magic names ":localStorage:"
and ":sessionStorage:" are recognized and converted to use the kv-vfs.

FossilOrigin-Name: c5db9262d0388ccb0e84c6a4b4e2e786dd634f13874e4034ba7b175befa4ce90
2022-09-20 14:36:53 +00:00
stephan
0e0aafc698 Remove an obsolete file.
FossilOrigin-Name: 1e43855498b4329f733bd6e0731841dc884e885de7d2d338d402d05d54309427
2022-09-20 14:21:58 +00:00
stephan
b8c8d4e4a0 Speed up de/serialization of func args and return values in the OPFS VFS proxy.
FossilOrigin-Name: 5bf235bbe035e4ace7a54851e190742528af6b4266328a1b8bbb9fb3dd7f2118
2022-09-20 13:25:39 +00:00
stephan
c2ccd67689 OPFS proxy: remove one sanity-checking-only level of proxy function to shave off a few microseconds.
FossilOrigin-Name: b534831f3efb8910a17e29956e3e87cc80055ea66e15dbef992b6a556ff042f8
2022-09-20 10:47:36 +00:00
stephan
c9e2602e8f Remove extraneous result-code SAB slots. Doc additions.
FossilOrigin-Name: 88de20712bbe3e11ea74af95edc34e9ab9f346f9aa0a30931e5a9e1f96ce57b0
2022-09-20 10:11:52 +00:00
stephan
5e8bb0aa13 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
2022-09-20 08:27:57 +00:00
stephan
138647a552 OPFS VFS: further internal refactoring towards experimenting with a new comms model.
FossilOrigin-Name: 5ca412ced24b4e3af5f467e710a597ed440badf7b8335346aade11d3cad3d1a1
2022-09-20 03:31:02 +00:00
stephan
c4b87be3e8 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
2022-09-20 01:28:47 +00:00
drh
b22b493338 Clarify comments that describe query flattener restrictions associated with
outer joins.  No code changes.

FossilOrigin-Name: 2647d73bb1876d01851f52cb3fd6af08a962ab336b6d51c160d27b1baf94f75f
2022-09-19 19:25:15 +00:00
stephan
aec046a264 Further metrics and buffer-copy optimizations in the OPFS proxy, but with little effect.
FossilOrigin-Name: d1f1fe6f1c60640f7770dfb9245c459a09b8d24ec2ddf664dff77c810bd51f96
2022-09-19 18:22:29 +00:00
drh
316cd40122 Fix a minor comment typo. No changes to code or documentation.
FossilOrigin-Name: 8032db4ade66f70a102abb9d3a49e20620e204c45ad7a954a49d20403985bf07
2022-09-19 17:41:59 +00:00
stephan
f815011a08 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
2022-09-19 17:09:09 +00:00
stephan
61418d5a67 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
2022-09-19 14:56:13 +00:00
stephan
0e0687ccfc 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
2022-09-19 13:44:23 +00:00
stephan
b5ae85eca2 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
2022-09-19 13:16:35 +00:00
stephan
5ef7f04775 speedtest1: add --vfs NAME flag and eliminate code duplication in argc size verification for all flags which take a value.
FossilOrigin-Name: 281d09867134e0a057cfadd9bfcbf0e21b8ac9737a278c41973d33a3101be7bc
2022-09-19 11:47:38 +00:00
stephan
ba0b157583 Minor doc improvements in demo-123.js.
FossilOrigin-Name: 9370ce94780e974da03d5c74cf9a5983eed333e7b3bc54e605c5f30b3fa99287
2022-09-19 10:13:01 +00:00
stephan
509f40526e Generic cleanups in the OPFS VFS proxies.
FossilOrigin-Name: 7d5f6adc3b964413fc96ad8d2735312c3e58348024cabdd2099682cbf696eaf7
2022-09-19 09:58:01 +00:00
stephan
862281fc47 Correct OPFS VFS xRead() to copy the result buffer if the result code is SQLITE_IOERR_SHORT_READ.
FossilOrigin-Name: 56668f9902c6e896b6c63621a444444c6f58ee20f88a5feae97f1699be35892d
2022-09-19 09:25:25 +00:00
stephan
8766fd20d1 Replace OPFS VFS xSleep() impl with a more efficient one (no Worker round-trip needed).
FossilOrigin-Name: b9773f164878b0a1b7c88cc7a6d1374ea95f64920065e8b2b178a1afffd82fe5
2022-09-19 05:19:04 +00:00
stephan
ac51eb7754 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
2022-09-19 03:57:31 +00:00
stephan
ed85333977 Disable build of wasmfs-using components on aarch64 (ARM), as wasmfs won't build there.
FossilOrigin-Name: 9a9eeebc2c27b734041089131b4952d7c0440df48ef32f355641aca61d4b30a0
2022-09-19 00:40:53 +00:00
drh
bcdb4cc71b Remove a NEVER macro in defragmentPage() that dbsqlfuzz discovered can be
true.  crash-32d9312f145cdce41613573f6431d9a3e439e3d7

FossilOrigin-Name: 90403759e1cf30f7c11fa8170d6df59a0dd138e1de59d2b60bec7ba15d74f67c
2022-09-18 17:59:28 +00:00
stephan
f386012069 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
2022-09-18 17:32:35 +00:00
stephan
0db3089576 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
2022-09-18 03:05:55 +00:00
stephan
c5313afea7 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
2022-09-18 02:35:30 +00:00
stephan
3e2823cbb6 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
2022-09-18 00:16:12 +00:00
stephan
5f4ad92681 Correct OPFS xRead() and xWrite() impls and add a very basic sanity test for them.
FossilOrigin-Name: cd06cc670029763955cf60ffcf944b36d41cb005b859d9b9fd0eea1b6741d0e9
2022-09-17 23:47:20 +00:00
stephan
8200a6d8d7 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
2022-09-17 23:29:27 +00:00
stephan
e6f8a09532 Generic cleanups in the OPFS sync/async proxy.
FossilOrigin-Name: f36bddbe54c3acbfaa958042e4d24724f130bdca551401033f9bc63f3da73492
2022-09-17 21:13:26 +00:00
stephan
0731554629 Add the remaining vfs/io_methods wrappers to the OPFS sync/async proxy, but most are not yet tested.
FossilOrigin-Name: 44db9132145b3072488ea91db53f6c06be74544beccad5fd07efd22c0f03dc04
2022-09-17 20:50:12 +00:00
drh
a50d3b7a5d Fix an uninitialized variable in the decoder kv-vfs.
FossilOrigin-Name: 354726aa6c399053785f29104de15091629ce4bc275b9e2205cb3656a9e81cd7
2022-09-17 18:31:31 +00:00
drh
20a9ed1dc6 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
2022-09-17 18:29:49 +00:00
drh
b9fbc558f7 Merge the latest trunk enhancements into the kv-vfs branch.
FossilOrigin-Name: 37c7ca25a6e837e7f83b96a32e2b1a455730e48a48012c458ae2e734a3ccdd1f
2022-09-17 17:26:44 +00:00
stephan
132a87baa3 Add initial bits of an experimental async-impl-via-synchronous-interface proxy intended to marshal OPFS via sqlite3_vfs API.
FossilOrigin-Name: 38da059b472415da52f57de7332fbeb8a91e3add1f4be3ff9c1924b52672f77c
2022-09-17 15:08:22 +00:00
stephan
ce260f4e43 Merge kv-vfs branch into fiddle-opfs branch. Adjust speedtest1 --size flags to account for new size limit.
FossilOrigin-Name: afb79050e635f3c698e51f06c346cbf23b096cfda7d0f1d8e68514ea0c25b7b7
2022-09-16 20:16:50 +00:00
drh
756440febc 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
2022-09-16 15:19:04 +00:00
stephan
81439a07f0 When calculating kvvfs sessionStorage/localStorage size, multiply it by 2 to account for JS using 16-bit characters.
FossilOrigin-Name: 52d1b185b9f6cee1eb3dec436f47e0f52e4621a127abfad8c27f92fd78147889
2022-09-16 12:49:45 +00:00
stephan
4c72171b60 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
2022-09-16 11:45:09 +00:00
drh
84e5076787 Fix os_kv.c so that it uses SQLITE_FCNTL_SYNC and hence
works even with PRAGMA synchronous=OFF.

FossilOrigin-Name: 21915af560b111aeeaee751790356151a5f063c2fc703dd4b35b22dc393409fb
2022-09-16 11:37:01 +00:00
stephan
57db2174d5 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
2022-09-16 02:30:49 +00:00
stephan
58bcfe075d 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
2022-09-16 02:28:03 +00:00
stephan
d22cfa8c80 Pull the src/os_kv.c part of [13839759f8f4] into the kv-vfs branch.
FossilOrigin-Name: e334449912d5176e355d02024a07ed867741f71c9d10ce6744ca800414bf3eeb
2022-09-16 01:08:06 +00:00
stephan
0144a8482a 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
2022-09-16 01:05:19 +00:00
stephan
28ef9bddb3 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
2022-09-15 06:42:41 +00:00
stephan
dae7518ae4 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
2022-09-15 03:16:49 +00:00
stephan
0117693f62 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
2022-09-15 03:09:00 +00:00
stephan
409505c743 Clean up some JS documentation.
FossilOrigin-Name: 925fdbfc6c1f9f06951346bc0d4fb81ffb5797d5f1123728931973f6cb1a0efa
2022-09-15 02:27:48 +00:00
stephan
5b91500796 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
2022-09-13 19:27:03 +00:00
stephan
23d39ce54d Get testing1.js working with a kvvfs build.
FossilOrigin-Name: 333a45725d1708e0fefa559c33ce1c7eeb425cdb04f594b1f2b48166c1478c79
2022-09-12 22:27:00 +00:00
stephan
5fd8f27bfb Remove an extraneous key-copy op in the EM_JS impl of kvstorageDelete().
FossilOrigin-Name: 1c5aeee45564c14e7e2e7730f3f52106339ea3148fb5aa786fa767a35db46f51
2022-09-12 20:21:34 +00:00
stephan
0b769f5b4a Merge kv-vfs branch into fiddle-opfs and add speedtest1-kvvfs.html test app (which currently fails early on).
FossilOrigin-Name: 8b1608a9a37131121cb3a0cb1e8dbad5e39dc1fc2a341d056f09537f179b2e7a
2022-09-12 20:18:28 +00:00
drh
b126ec18b6 Fix the <sys/time.h> include in os_kv.c.
FossilOrigin-Name: 878cc93e779c3857adc711f212520f007256274fcd3f6f3d72c754a937fcd198
2022-09-12 19:33:20 +00:00
drh
d8bb0b5ae6 Add a gettimeofday()-based implementation of xCurrentTimeInt64() to os_kv.c.
FossilOrigin-Name: e393ed650ef124143f84e9d787fb996e308dd7af6b8f50df72a6f085b67bf9c3
2022-09-12 19:29:34 +00:00
drh
bb19512438 Fix a debugging/testing edit in the previous check-in.
FossilOrigin-Name: 6fc8d34c0ae1f8277544be741f2f0835fad8e475d35bd24573224ccc1699b8bd
2022-09-12 18:10:41 +00:00
stephan
a002cc174f 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
2022-09-12 17:59:04 +00:00
drh
6acd7b0a75 Faster text decoder for kv_os.c.
FossilOrigin-Name: 3354a2edb762d70ccc31d4d25f81b70e644d76e01cb1e81d2e97b5414d809d30
2022-09-12 17:44:35 +00:00
stephan
5360f5fcff Merge kv-vfs branch into fiddle-opfs branch to add kvvfs-based wasm build and demo.
FossilOrigin-Name: a7d8b26acd3c1ae344369e4d70804c0cab45272c0983cfd32d616a0a7b28acb9
2022-09-12 16:09:50 +00:00
drh
3e4e697d1c New run-time options to the speed-check.sh script.
FossilOrigin-Name: ff46bc9d2a844dde9dafa157114f4d9ee157205ca5c08ed9ee32f018de310e62
2022-09-12 16:07:24 +00:00
drh
1ad51ffe21 Fix uninitialized variable in rollback-journal processing in os_kv.c
FossilOrigin-Name: e49682c5eac91958f143e639c5656ca54560d14f5805d514bf4aa0c206e63844
2022-09-12 15:59:35 +00:00
stephan
2811759d5e 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
2022-09-12 13:05:54 +00:00
drh
6b013afb88 Fix the amalgamation so that it builds with the standard unix backend again.
FossilOrigin-Name: 0adf158f4e5791339988185cc29347c75056b062e0db65b5999fdfa1f433c1ed
2022-09-12 12:41:07 +00:00
stephan
ad5125a624 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
2022-09-12 12:39:28 +00:00
stephan
73079dba00 Minor cleanups and documentation in the wasm pieces.
FossilOrigin-Name: 4e6ce329872eb733ba2f7f7879747c52761ae97790fd8ed169a25a79854cc3d9
2022-09-11 16:59:40 +00:00
stephan
2a91126d76 Correct the result code from kvstorageRead() for the OOM case to be a negative value.
FossilOrigin-Name: cdbf09fa1b0c93aeb3222a157de33a4688ae629c2b829ffff0f1f62364c5ae1c
2022-09-11 05:44:15 +00:00
stephan
ade4f4d645 Minor cleanups and docs for the EM_JS() impls of the kvvfs read/write/delete ops.
FossilOrigin-Name: 53b7572e441be4b4b29b4228d0f95b24457d7faaf6c0b568ed5c970a55e21ffb
2022-09-11 05:38:39 +00:00
stephan
e99f742a32 Add EM_JS() impl for kvstorageRead().
FossilOrigin-Name: 06610314fcf644f323c2f7ae11d7f4349b195e66d0ebbee590438dd99d97eb96
2022-09-11 04:49:29 +00:00
stephan
d15822965b 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
2022-09-11 02:43:08 +00:00
drh
c6c9c6aad0 Improved comments in os_kv.c. Better names for the key/value name spaces.
FossilOrigin-Name: 8e1652a3856765c9146cc2a7e3b598a2dc7dc84c556b35eab9a35184514384b9
2022-09-10 18:38:21 +00:00
drh
7585f49a0a 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
2022-09-10 18:20:59 +00:00
mistachkin
bdb6368d72 Fix harmless compiler warning seen with MSVC.
FossilOrigin-Name: 73c4c68d3b4c16caf8281dabddd7365d24691e5ee2da89b1783eca66bfbd9280
2022-09-09 17:50:29 +00:00
drh
25f62508f5 Database must be named either "local" or "session". Each has a distinct
namespace.

FossilOrigin-Name: c8e41279294ea7c2f041c7d4cbbd85fce47d55f2f56180ca837316f7dfd75237
2022-09-09 16:16:33 +00:00
drh
f7377d5763 Separate sqlite3_io_methods objects for database files and journals.
FossilOrigin-Name: 74fbf6c2a97729e481d5562344e960d0c237aeb1f07240262d32a24fb1f4b5a3
2022-09-09 14:22:41 +00:00
drh
126976c9f8 Simple reading and writing now works.
FossilOrigin-Name: 00845ac9ef2616e90f5f6a20da3dd040fa8bdcfe73f72fe9c06039561150a82d
2022-09-09 11:41:54 +00:00
stephan
f5bf66c875 Remove a reference to a completed TODO.
FossilOrigin-Name: 757ad69607201a26802a304839b8454b1634712458539d6aa8cf999ab2447e59
2022-09-09 05:39:36 +00:00
stephan
e66b26818b 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
2022-09-09 04:50:18 +00:00
stephan
dd628ed58b Make use of the --big-transactions flag in the speedtest1 JS apps.
FossilOrigin-Name: f2846dcbcaac7880394fb14597c3a60ed310419128c4c5b863cd771a7e5cdeb5
2022-09-08 21:33:50 +00:00
stephan
e07ce18be5 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
2022-09-08 21:09:42 +00:00
stephan
1174c23e0d Minor build cleanups and tweaks in the speedtest1 wasm apps.
FossilOrigin-Name: 5240fb4d795dea826f23cf5d2152b519f5a46f49bb2499ea868fa7c7f4ce788b
2022-09-08 20:04:52 +00:00
stephan
fa7098d543 Experimentally add --nomutex flag to speedtest1 to have it open db with the SQLITE_OPEN_NOMUTEX flag.
FossilOrigin-Name: 45ef576b2ee6369ab1e3aa2ad284764bb334f92a69a33d88b7292bbc0a1b1fda
2022-09-08 19:53:59 +00:00
drh
7cd81af3a9 Compiles and loads as an extension. Starts to run but quickly hits issues.
FossilOrigin-Name: 2e38726f46918b28b5c638967f960a20afd3fe84ad245f3bea39a1d64980435b
2022-09-08 17:12:12 +00:00
drh
e3485ee996 Compiles without error, but untested.
FossilOrigin-Name: a329939c32e33d8d00066ba3d4327f07cca1b4e67de0b8d85f1e7f98afe40954
2022-09-08 16:27:50 +00:00
drh
cb94132d9f Code snapshot. Completely untested. Probably does not compile.
FossilOrigin-Name: 51e267696d25f2f83b5bb847d5254ab15573ef1a16ea3d7dd8279c73c0bee539
2022-09-08 15:48:01 +00:00
stephan
44a87f08ef 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
2022-09-08 15:30:59 +00:00
drh
b53e0992b2 Enhance an assert() to impose for tighter constraints on the operation of pcache.
FossilOrigin-Name: 42105eb43a916a7cd839fa6c582eaffaef17f50b23c3e05142400c379feb73c7
2022-09-07 20:11:22 +00:00
drh
8c983ddb67 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
2022-09-07 19:28:18 +00:00
drh
59ece7e106 Non-working code towards a VFS for text key/value storage.
FossilOrigin-Name: f9c89ee8d5ef46342bea78fa8d4da058d9ea628183ec985642bbda1cdfeacd5f
2022-09-07 17:29:22 +00:00
stephan
3a59dd12d2 Add a note about Emscripten's -sSINGLE_FILE flag, why it would be nice, and why we can't use it.
FossilOrigin-Name: 5ea0623630d769a8f3f07a40cd119be86b631192cdb5178131876b01b40ee5e0
2022-09-06 23:04:51 +00:00
stephan
8fc8b5b35f Get speedtest1.js working with WASMFS/OPFS.
FossilOrigin-Name: 40e60f570d4f489d58d12e27c1c067b41d6c5a5e374c5fce0baa8881ef183216
2022-09-06 20:17:15 +00:00
stephan
100b496dd2 Initial build of speedtest1.wasm and speedtest1.html with which to run it.
FossilOrigin-Name: 4441535e3e54dc1881f700fa3878964eb8554a6790fd6aa32945f7cc104a8467
2022-09-06 16:47:43 +00:00
stephan
09aa80d109 Minor internal doc clarifications.
FossilOrigin-Name: 09796cc2bfce7bc4ce11db9673d20737259e9928f0484660cba3a9751f7d01c5
2022-09-06 16:35:54 +00:00
stephan
ae1ed83831 Merge trunk into fiddle-opfs branch.
FossilOrigin-Name: 7f76eaec793720db87415a476ddf539bc4dea3e74c8e5406d6739206aebdacc2
2022-09-06 09:59:06 +00:00
drh
2e440a0801 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
2022-09-05 22:54:36 +00:00
drh
0c4517a61a Get the tool/omittest-msvc.tcl script working.
FossilOrigin-Name: 82b89f8a074858a81d841dfc26436e8d39ce4907b8f989eba4d848db16758303
2022-09-05 22:53:24 +00:00
drh
4c8404e555 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
2022-09-05 20:42:01 +00:00
drh
6e440ab3de Fix the windows build so that it works with -DSQLITE_OMIT_AUTOINIT.
FossilOrigin-Name: f74a5ea8c986dc33d3afcda169c38abbe55728c56716cf9991a5e2ef7fc4917a
2022-09-05 18:17:03 +00:00
stephan
49cb8d7314 Minor cleanups in OO API #1. Add Sudoku SQL to batch-runner.js's list.
FossilOrigin-Name: 4488cb5798f34cbba14eb8e2aa5da8420c14a85d37d278d357406aedd5c3a9e5
2022-09-05 13:24:08 +00:00
stephan
cdefd5d046 wasm: minor text and build cleanups.
FossilOrigin-Name: 36ceef94e1935f5e85f79e489cd0ed265a77820fb68329c190794df5e076bf84
2022-09-03 11:41:44 +00:00
dan
ad617b4d6d Ensure the Pager.journalOff variable is zeroed if an error occurs while writing the initial header to the journal file.
FossilOrigin-Name: da7af290960ab8a04a1f55cdc5eeac36b47fa194edf67f0a05daa4b7f2a4071c
2022-09-02 21:19:24 +00:00
drh
173b418e60 Fix an assert() associated with the dbsqlfuzz error at [8372468bb5d8922c].
FossilOrigin-Name: 54251f81ebc43839cc97f91d2df4c320c1b96b5690cc11ce45b60c087c9becd6
2022-09-02 17:25:25 +00:00
drh
5fc3a8a32f If sqlite3PcacheMove() really performs a swap, then be sure to renumber the
second page.

FossilOrigin-Name: 81cff9f1955874aade55daa94263f58f06d966bd51ad558755f92777069a7347
2022-09-02 15:09:55 +00:00
drh
4e9bf5ace3 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
2022-09-02 14:29:54 +00:00
drh
e04c9f4b33 Mutex protect access to the sqlite3_test_directory and sqlite3_data_directory
global variables.  See
[forum:/forumpost/719a11e1314d1c70|forum thread 719a11e1314d1c70].

FossilOrigin-Name: 8e6ad3a3e942a326cf16432e16d6596c7206c05b6f45cd0ff3a9b836bcfc9deb
2022-09-02 11:45:26 +00:00
drh
fee6431392 Improved mutex protection of the sqlite3_temp_directory and
sqlite3_data_directory global variables.

FossilOrigin-Name: ebbe9634d6dde9e097f61fb98a79111e46de422b7bbbd9ed3af7b6f22aacf5ec
2022-09-02 11:12:16 +00:00
drh
18a3a48db1 Experimental changes to put sqlite3_temp_directory behind a mutex.
FossilOrigin-Name: 5ee3515fbb88bf1ae5f8b507844f82dcc429380b6ebeab9b09b52b25ee60a60d
2022-09-02 00:36:16 +00:00
drh
44132244fa Defer deleting a transient SELECT statement associated with a flattening
of one arm of a compound SELECT until after the parse has completed.

FossilOrigin-Name: 1c4157c71cd1e062a9c2c79787d17e34e340f28ce1e40573851dfe174f5da7d7
2022-09-01 13:51:09 +00:00
drh
a3fc683c80 In the query planner, add a heuristic that will reduce the cost of a full
table scan for a materialized view or subquery if the full scan is the
outer-most loop.  This is shown to speed up some queries.

FossilOrigin-Name: 609fbb94b8f01d6792e5941ab23ce041313d359f6788c4dde6b1ca749ab49137
2022-09-01 10:29:02 +00:00
drh
9c3a114ca0 Enhance the b-tree page sorting code to ensure that sqlite3PagerRekey() never
overloads a page number and uses only the PENDING_BYTE page for temporary
storage.

FossilOrigin-Name: 5007742886bd20de20be3973737cf46b010359911615eb3da69cd262bd9a2435
2022-08-31 15:04:42 +00:00
stephan
53f635df55 batch-runner.js: add rudimentary metrics export to CSV. Add a toggle to reverse the log output mode (in normal order or most recent first).
FossilOrigin-Name: b26e2bc05537a1f451db1bdd36a824d71c3ea25a130b6285f31ff9799d65fa7a
2022-08-30 17:57:50 +00:00
drh
78d15f097a Improved comments in pcache1.c. No changes to code.
FossilOrigin-Name: dd017bb1b3e31c7692d29dc4865d6bda871e429978c8738a39160d0114e5bf9b
2022-08-30 16:54:41 +00:00
stephan
ffc0cbb024 batch-runner.js: re-enable unlink-before-run so that OPFS speedtest1 batch can work.
FossilOrigin-Name: ba08f7a7f12601aa580a8dc493b43cdd5ab65c87d5e4b3fd2f549343e45c2d2a
2022-08-30 10:26:33 +00:00
stephan
fbf0f488cf batch-runner.js: move generated SQL files into ./sql and start adding hand-written ones (like the Mandelbrot) to that set.
FossilOrigin-Name: 06c106a7d23e4486dbed092757b7588688226ad35539ecc31378a8497f59d1ec
2022-08-30 10:04:08 +00:00
stephan
429899ddad Remove the .timer script entry from fiddle app because emscripten has removed getrusage(), which breaks the timer.
FossilOrigin-Name: 9034f19ae50f196cc2b94478edfcc8d765b08bcf383166f6212b3522dea63c01
2022-08-30 09:51:24 +00:00
stephan
5bb5965710 wasm util: remove superfluous function.bind() calls to eliminate a level of call() indirection.
FossilOrigin-Name: 1aab9627983ef0f016b01f78564e79cf815ed14d4b1b6dc04ec627b96f1b2f70
2022-08-30 09:49:30 +00:00
drh
4d28830861 Any function call can abort. Take this into account when deciding if a DML
statement needs a statement journal.  See
[forum:/forumpost/9b9e4716c0d7bbd1|forum thread 9b9e4716c0d7bbd1] for more
information.

FossilOrigin-Name: 5c95ae6c9b93b9bcf698bb1cad93b2da2e28121b35e7c539b1ddc0ef2de33cfe
2022-08-30 00:11:51 +00:00
stephan
2f06bf2541 Lots of tweaking in batch-runner.js. Minor internal API update in OO #1 API.
FossilOrigin-Name: 24b82b9504db3d8e1335c2300b133f897dc1a541026dc24be5b0ffd8be66d977
2022-08-29 18:58:38 +00:00
stephan
49a785fa34 Add test descriptions to the speedtest1 '-- begin' markers for potential display by the downstream JS code which uses those markers.
FossilOrigin-Name: e5b7006f0f57f10a490d7eaeb7df77251a2f684602fed8ff161d8ce60033e7bc
2022-08-29 17:41:16 +00:00
stephan
2cae138fba Add batch-runner.js for running batch SQL scripts with timing info.
FossilOrigin-Name: 11f3ed61150c5940da6c157e5063e70c3aa0628dfd0023c47bb65b00af74ab1f
2022-08-29 12:39:34 +00:00
stephan
f2e624ea91 Add get/setPtrValue() to the common wasm utils.
FossilOrigin-Name: 24d70fc458c6002d5ff3c9f8ce7c66bde299b32aca6417c2dd1236e1412b036d
2022-08-29 12:31:57 +00:00
stephan
9a2efd8e1f Add begin/end comment markers to the test blocks in speedtest1 --script output to facilitate chopping up the output into chunks for JS-side processing.
FossilOrigin-Name: ef0b7ef2d2e19b1f9437fdd7e24f040f662d9907d1fa17c6a3892fcf091b849e
2022-08-29 09:51:17 +00:00
stephan
d7d1098baa oo #1 api: correct a case where a null callback is called. Rename some vars for clarity. Increase wasm-side memory in order to be able to load the speedtest1 output.
FossilOrigin-Name: b5058f14fadbc8a1886f27cff08593dd2c8e2b2cb6d7bed3b8733a55f031989f
2022-08-29 08:04:55 +00:00
drh
f0f025b340 More assert() statements in the page cache.
FossilOrigin-Name: 7c96a56c0d1de966844da6c5a84c0cd6066130a10724797ce6f228a9182d9b85
2022-08-27 16:11:00 +00:00
drh
f6e3e31625 Ensure that every pcache page always has either the PGHDR_DIRTY or the
PGHDR_CLEAN bit set, even during transient page reshuffling during btree
balancing.

FossilOrigin-Name: e67f03c166277951725c194674c84da61c152a5820aa6df55a726f7dda838e92
2022-08-27 14:43:34 +00:00
stephan
a3825e78bd Merge changes from trunk into the fiddle-opfs branch.
FossilOrigin-Name: 34279797be0922b9df05e0d4f327f8582ab25fb6fb21583f8441ddf5deded891
2022-08-25 19:38:54 +00:00
drh
23593f8e99 Ensure that sqlite3_prepare() inputs always have a semicolon terminator in
speedtest1.

FossilOrigin-Name: c72756b0f2db30c622f00f43be9245d50e36049bd7740ee6332164f0c48f9c3d
2022-08-25 19:29:35 +00:00
drh
09cb5eb5ac Add the --script option to speedtest1.
FossilOrigin-Name: 1c87d7c58d5aec83f9e2ae3771a81aa17cfae0cf06169025a5db085e2d5749f9
2022-08-25 19:19:25 +00:00
dan
aa07b36dd5 Remove a NEVER() macro for a condition that is actually reachable following an OOM. dbsqlfuzz crash-6ef3cd3b18ccc5de86120950a0498641acd90a33.txt.
FossilOrigin-Name: b573e2cffa5fedc893ed30e76e47022b3617ac5583e1eb486afa810b2514c419
2022-08-25 13:32:55 +00:00
stephan
335ad5264f Consolidate oo1.DB.exec() and oo1.DB.execMulti() into oo1.DB.exec(). This is a bit less efficient but certainly easier for a client to deal with and lightens the maintenance burden.
FossilOrigin-Name: 7eff7213dff553b76d7ce45063e3c4a19544716611a0b609593d704076b38d0b
2022-08-25 13:27:52 +00:00
stephan
9afff9f3c5 Refactor and expand the worker1 docs, consolidating them into the top of their file instead of scattered around the internals. Accommodate an API change from yesterday in demo-oo1.js.
FossilOrigin-Name: 0a65747047322b7b585e281ac275e437ce3f46e1d06105c19117213929a906ad
2022-08-25 11:39:12 +00:00
stephan
407f75378e Change DB.exec() rowMode default from 'stmt' to 'array', per /chat discussion. Add DB.exec() rowMode option for fetching a specific column by name. Add result column names to worker1 exec() callback interface, as there's otherwise no way to get that info from a worker.
FossilOrigin-Name: 1bb37e5c477b9eb098362f74a45a55be23d450fe45cdff58c1cbff08b5b3998f
2022-08-24 20:57:37 +00:00
stephan
3734401a95 Expand the worker1 'exec' op handling for per-row callbacks for API-level consistency and smooth some edges between worker1 core and worker1-promiser. Add worker1 'config-get' message to fetch the serializable parts of the sqlite3.config state. Improve the 'open' op's handling of the 'persistent' option (noting that we cannot yet test that case from a worker).
FossilOrigin-Name: 509f8839201ec1ea4863bd31493e6c29a0721ca6340755bb96656b828758fea7
2022-08-24 18:39:46 +00:00
drh
7383f5a7d9 Add a mutex to the sqlite3_db_config() interface so that it is threadsafe
when two or more threads call it on the same database connection at the same
time.

FossilOrigin-Name: 459ad8846ee1ee2d3b277a291c47121692bdf477e779b06e77be8338f62237a6
2022-08-24 17:59:00 +00:00
stephan
9c765e7945 js: resolve the mysterious "extra" unhandled exception notification, caused by inadvertently forking one promise into two separate ones (failing to properly reassign a then() result). Fix a typo in new Worker 1 code which caused the DB(filename) name to be incorrect.
FossilOrigin-Name: 7467ac88801224089b51c6ba7924f93283dd87beca602a186c83632df26cfc85
2022-08-24 14:50:10 +00:00
dan
2ce2b779bb Fix an inefficiency in the ".dump" command when outputing large blob literals.
FossilOrigin-Name: c055d05dbdfd4643d5052c6e6a736c78651fdfcd78f15f791af903df3814832d
2022-08-24 11:51:31 +00:00
stephan
9a34509a06 More work on how to configure the sqlite3 JS API bootstrapping process from higher-level code. Initial version of sqlite3-worker1-promiser, a Promise-based proxy for the Worker API #1.
FossilOrigin-Name: b030f321bd5a38cdd5d6f6735f201afa62d30d2b0ba02e67f055b4895553a878
2022-08-24 05:59:23 +00:00
stephan
efeee19a95 The very basics of a Promise-based proxy for the Worker #1 API. Still requires considerable cleanup, testing, and a solution for the exec-callback-via-event-type-name problem.
FossilOrigin-Name: 1e447849fb65887e806e3348a8a68f70ea6802bc0a1e56c385a279f27cc0cdda
2022-08-24 00:51:39 +00:00
stephan
a9ac2ed069 Significant restructuring of the Worker #1 request/response object structures to improve readability and clarity.
FossilOrigin-Name: 03b9db9b98cb36faa7de5a8a64d2e13c4aeaadfefb33ac92bb41056f6be3f121
2022-08-24 00:10:45 +00:00
drh
e5928b17ca Change the names of the Vdbe.pVNext and Vdbe.ppVPrev fields to make them
unique.  Change to ppVPrev to save a few bytes and a few CPU cycles.

FossilOrigin-Name: 34b8ea31877ae8b40729d37b3f51ae7e15f38be841881ea4a37c9c8f0a52896d
2022-08-23 20:11:01 +00:00
drh
35908b167f Enhance assert() statements to enforce tighter bounds on the P5 operand of
the OP_Next and OP_Prev opcodes.

FossilOrigin-Name: 4e0a07fc6f96e6e7726506b7a5ee942461c1381501f253893fa94d76023b634f
2022-08-23 17:51:39 +00:00
stephan
8c45a9f952 Wasm build flag tweaks and documentation.
FossilOrigin-Name: c8eb3aa8e0f487f14791214caf70d1aa03866e01345c7fa1d5607c24c39dde1d
2022-08-23 17:02:46 +00:00
stephan
f7415736d1 Add mksourceid binary to the clean rules and $(TESTPROGS) to distclean.
FossilOrigin-Name: ae3e82f5a3332bea261aca6a0dd02063cf7056c023204cc10f1ae18d75249f91
2022-08-23 16:55:19 +00:00
stephan
ae708b2b01 More experimentation with how client-side config state can be passed on to initialize the JS-side sqlite3 API.
FossilOrigin-Name: ea2acc454c012a62556f6d0623d6eff60736d24aa214a64462b423623ef44d47
2022-08-22 21:37:17 +00:00
drh
376860ba88 Performance enhancement for sqlite3DbFree().
FossilOrigin-Name: c296a9d958ec360fc8d217363348b4918d665bccb3c4f27503a2dcef7db49052
2022-08-22 15:18:37 +00:00
stephan
7a8a0fceec Merge in trunk.
FossilOrigin-Name: e215d55a97e1ccbca3101621374444d2381d87ef8e8fde5271e31c8b714e43e9
2022-08-22 14:03:11 +00:00
stephan
e3cd67603d Refactor JS API amalgamation such that the bootstrapping/configuration is deferred until the whole amalgamation is available, to facilitate providing clients with a way to initialize the API with their own config (noting that we're still one small level of refactoring away from being able to actually do that).
FossilOrigin-Name: 9dbe9a6aecec43b51057375ef1d2d632db0d17eac8b7552c20cc91fc2f1a55d1
2022-08-22 13:34:13 +00:00