stephan
3afad4d432
wasm: correct a memleak caused by a shadowed var in the previous checkin. Add a stack-like allocator, sqlite3.capi.wasm.pstack, as a faster way of managing short-lived pointers (like the one which got shadowed).
...
FossilOrigin-Name: 1fa019c88deac6b6e5155b620bdab1d7145846290daafb9adbefcf4f0fe542cf
2022-10-01 18:47:42 +00:00
stephan
32781427d7
Fiddle: fix makefile dependency issue and duplicate inclusion of post-js.js. Reimplement db export using sqlite3_serialize().
...
FossilOrigin-Name: 29db7de79232c21d19b91bb0fc253114e02e21dd9bf90619453dbe72a4c8bf7f
2022-10-01 16:01:41 +00:00
stephan
be9d203665
Merge trunk into fiddle-opfs branch.
...
FossilOrigin-Name: 64ebcbe41615a6d7776597564105ea7638e4a9095a764ea558c2620640429cf8
2022-10-01 13:45:14 +00:00
stephan
c9099d2d73
Tweak sqlite3-worker1.js to be able to load either sqlite3.js or sqlite3-wasmfs.js, noting that the latter still does not load in a Worker because of an Emscripten loader bug.
...
FossilOrigin-Name: 000ef7059bfb54dc4f829b81a8d8c927c0382980218d8a3d60cd2c4d89151c90
2022-10-01 13:38:27 +00:00
drh
7424aeff41
Replace the Parse.disableVtab field with Parse.prepFlags for increased
...
generality, a small size reduction, and a small performance increase.
FossilOrigin-Name: b7da0bcdf70e53ab1ec00a0694e17c7429e23bc6eb3f39b622d06a930aa2f6a3
2022-10-01 13:17:53 +00:00
stephan
6167d5cf17
Note two wasm-related potential TODOs.
...
FossilOrigin-Name: 5636e82864457d870754ee7125c307dc5d2195197a5c0266579da9f102938b89
2022-10-01 12:04:49 +00:00
stephan
8c1a4b89af
Remove a couple of weird quirks of the Worker1 and Promiser APIs. The Worker1 (now undocumented) unlink capability needs to be reevaluated to work equivalently for all storage backends.
...
FossilOrigin-Name: 9f2b331a32cbaadfd20d04c9908171355322c1aa1d9d6df3628f3b2fb4391ec1
2022-09-30 23:49:43 +00:00
stephan
ae589b69db
Tweaks to the Worker1 and Promiser APIs prompted by documenting them.
...
FossilOrigin-Name: c68b9aa160e2c1197ae7eb06a634017ac2b281393074afa4582762d5458c6889
2022-09-30 23:02:11 +00:00
drh
7bc6a818f0
Remove one of the NEVER() macros added by [5166acf3f0040459] because it
...
is reachable after all.
FossilOrigin-Name: bd8ae5febbb8d3122f1e2e09b9fcdd6ac20c075ae1cf60bcdbd36080f3736417
2022-09-30 22:40:57 +00:00
drh
1337a2291d
New test cases in fuzzdata8.db
...
FossilOrigin-Name: aa367a3c974041323edb759855f0b83803439ceef2846da2d73eadd80efeaac4
2022-09-30 20:59:09 +00:00
drh
2d3261fe86
Fix a bug in the demoDelete fix from [d76a301e22e05722].
...
FossilOrigin-Name: 7e761a02530ffbb055a766eb6c995f11fc2adbabb9a52502124f672fdcff0d10
2022-09-30 20:53:36 +00:00
drh
0a803bd984
Add NEVER() to two error-detection tests that were made unreachable by
...
the previous check-in.
FossilOrigin-Name: 5166acf3f00404597e77910aee88920ab833af8447766f50bf4f70525606cf95
2022-09-30 20:48:22 +00:00
stephan
e67a0f40e4
Add JS wrapper for sqlite3_exec() which knows how to handle a JS callback. Add some console.error() reporting of module-load failures, as they otherwise often get silently swallowed up by the loader's mechanisms. Add 'flexible-string' JS-to-WASM argument converter which performs more X-to-string conversions than the 'string' arg converter does.
...
FossilOrigin-Name: 96818aa83f4ccc574f558231249ecbdd39763b4351cf4cf6d33f53774a3ee5e6
2022-09-30 20:35:37 +00:00
dan
ad658b2d82
Better handle a case of database corruption where a b-tree page is one of its own ancestor pages.
...
FossilOrigin-Name: a24e46804893a7e6e8f3130abca882f9a3aa3b7b2b82aa39a0a20856172766d5
2022-09-30 20:15:21 +00:00
stephan
d18f1bbfe0
Add sqlite3.version object. Add more state to the Worker #1 config-get response, including sqlite3.version.
...
FossilOrigin-Name: 711f458d188a0dbe6612069c856ade29323ab426dfa4f80e7b82757ccc474cb8
2022-09-30 16:49:03 +00:00
stephan
07c0b72253
Add oo1.JsStorageDb.clearStorage/storageSize() methods, copies of capi.sqlite3_web_kvvfs_clear/size().
...
FossilOrigin-Name: 1e09efe7fa15b8908f8b8353164a8361de778e27ea6c0b11c402bf4e1c56333d
2022-09-30 15:46:08 +00:00
stephan
359d62395e
batch-runner.js: force WebSQL batches to not abort for a failed statement (necessary for apples-to-apples-ish benchmark comparisons).
...
FossilOrigin-Name: 60f0c5cb04d2baf8431e523434d8753e39377f4b2c6bad225c2e5487a4be419b
2022-09-30 15:24:58 +00:00
drh
cb57716c65
Improvements to the "demoDelete" method in the demovfs, suggested by
...
[forum:/forumpost/cad18961c2|forum post cad18961c2].
FossilOrigin-Name: d76a301e22e0572262917dfe9557a5051339a65416a473dd2d9989a49975403e
2022-09-30 14:35:18 +00:00
stephan
dc6ae60226
Expose sqlite3_msize() to wasm.
...
FossilOrigin-Name: aa6ad34f3b693b554be58ee2895f79397162c5b8877c709653c8508fc625e8f4
2022-09-30 12:10:36 +00:00
stephan
f6c686c9f4
Add oo1.JsStorageDb() as a convenience wrapper for oo1.DB(...,'kvvfs'). Minor doc cleanups.
...
FossilOrigin-Name: 8a7998709f859a562cf6829485cb9921f8823af0efabe003741348ab1169fb89
2022-09-30 11:01:44 +00:00
stephan
53d4e01d06
wasm: expose sqlite3_de/serialize(), sqlite3_malloc/free() and friends, noting that the former explicitly lies on use of the latter for memory management so is not generically safe for use in wasm.
...
FossilOrigin-Name: fbc0edb5d31aa0dea92460e853f15f08c642451a7878994116b530cf172325cc
2022-09-30 10:55:28 +00:00
stephan
f71c954cbc
Add JS infrastructure to ostensibly allow us to customize the wasm imports, which will hypothetically allow us to eliminate the dependency on EM_JS(), but the corresponding Emscripten glue-level feature currently breaks fatally with WASMFS builds so it's disabled.
...
FossilOrigin-Name: 88d9253b0db5494bf1c9b6d24f22524eeec856b89e64a66ffb30d945f0df21d3
2022-09-29 22:08:22 +00:00
stephan
b0ccf50cbd
Ensure that the wasm builds always, even when passing -Ox flags from the CLI, use -g3 to avoid problems caused by symbol minification with optimization levels -O2 and higher.
...
FossilOrigin-Name: 27d24d5d270e272af07d96cf07bdbe79ba07a9c69ba3c70beb76ebf4f90fc97a
2022-09-29 17:35:25 +00:00
stephan
eb97743cc7
Finish eliminating explicit Emscripten module dependencies in test code and fiddle. The only remnant in public code is the Emscripten-generated module load/init interface.
...
FossilOrigin-Name: 7be78dd4efc410f13ff1ceda1fad82b309cc24de2d5106c8bd6b2adeaa13b106
2022-09-29 16:54:23 +00:00
stephan
b94a98607a
Rework the Emscripten-emitted module loader/init function such that it passes on the sqlite3 module, instead of the Emscripten module, to the first then() of sqlite3InitModule()'s returned Promise. This eliminates any need to mention the Emscripten module object in client-side code unless they want to configure it in advance for loading-status reports.
...
FossilOrigin-Name: 0dbaa0e2b5abf5c23e2039ec90a3055ebb3c063aaf4e556c42546defe6fbb86d
2022-09-29 13:17:50 +00:00
drh
31474ce57e
Fix misuse of the sqlite3_set_auxdata() interface in the ICU extension.
...
FossilOrigin-Name: f25cf63471cbed1edb27591e57fead62550d4046dbdcb61312288f0f6f24c646
2022-09-28 19:14:01 +00:00
stephan
4b884bb4c7
Wasm: expose sqlite3_exec() and use it to simplify the db-reset logic in batch-runner.js a bit.
...
FossilOrigin-Name: 2e2821f782511b9d2274a89a5a922582aba18c7e9dc7ce01080e713942a56d7d
2022-09-28 18:10:50 +00:00
stephan
cb22bd80d2
More work on batch-runner.html/js to facilitate speed comparisons between various VFSes and WebSQL.
...
FossilOrigin-Name: 3bd1bc240676e56da87fc49f3c67a1edc4fafcf2a2416298d19ae4f80b676a72
2022-09-28 17:52:52 +00:00
stephan
5ad3631915
Correct duplicate copies of sqlite3-api.js being embedded in the wasmfs-based builds.
...
FossilOrigin-Name: bbfcfba260f39a9c91e82d87e06b1c2cb297c03498b4530aa3e7e01ef9916012
2022-09-28 13:01:49 +00:00
stephan
d98011852d
Work around broken -Os wasm builds by adding the -g3 flag. Unrelated documentation tweaks.
...
FossilOrigin-Name: f5d6bf8616341037fa3e229edf820d19acef3e0a6207a652b2b143de0a493214
2022-09-28 07:53:47 +00:00
stephan
489a8a9d3c
Minor doc correction.
...
FossilOrigin-Name: 093f6e4b36db294e8e47df2fc75a4bc4fc101e2b6ff0201c912ccd1dcf394479
2022-09-27 17:03:01 +00:00
drh
5d48e0cdc5
Provide the SQLITE_MAX_ALLOCATION_SIZE compile-time option for limiting the
...
maximum memory allocation size.
FossilOrigin-Name: 584de6a996c78b8e41bdfcd05a8e2a3844664c6b4efedb5883c8b8af388462b5
2022-09-27 16:35:06 +00:00
stephan
6559e0ab15
Comment the -O2 wasm builds as being broken (mysteriously missing JS bits).
...
FossilOrigin-Name: f61475ef8244fd1f6553eca9cc2317e5de2cc04443e24afb7b91ebd3fc1bd402
2022-09-27 14:31:34 +00:00
stephan
5b9973d898
WASM API renaming. Reworked JS API bootstrap's async post-init into a generic mechanism, no longer OPFS-specific.
...
FossilOrigin-Name: c42a8cb090cad1108dfd6be574202d744c59e053b505bc4c17252dc6b65d26bf
2022-09-27 13:40:12 +00:00
stephan
3d64548491
wasm/js: rename /persistent to /opfs to account for potential future persistent storage options. Minor flag-handling cleanups in the speedtest1 pages. Minor API tweaks in oo1.
...
FossilOrigin-Name: 4dc972a3656b2a9ec915bfb3f653136560c753ce4024c3f0d0d0c28f66db7a0a
2022-09-27 09:17:37 +00:00
drh
6319a8003c
Make the legacy FTS3 code more robust against integer overflow during
...
memory allocation.
FossilOrigin-Name: 5517bc50988b5339c2fd071b29de1b5ca03037b0b635c3b112cf7108fab54d5f
2022-09-27 01:53:05 +00:00
drh
80cf891792
Enhance defensive mode so that it disallows CREATE TRIGGER statements if the
...
statements within the trigger attempt to write on a shadow table.
FossilOrigin-Name: 3283bbd12a60f472ed03cb7c6209a605a3bf9f3d9083371e17840b56e8b3f559
2022-09-27 00:56:45 +00:00
stephan
278d3faf1f
Fiddle: replace db export routine with a C-side one which works for both Emscripten FS-hosted and OPFS-hosted db files. Minor code-adjacent cleanups.
...
FossilOrigin-Name: 3579a8d6f1f6cd3cd8aad9949536870c5fe7bae8c1778f700dd85d763e266b94
2022-09-26 13:55:10 +00:00
stephan
1f095d482d
Get fiddle db export working for OPFS VFS. Add root dir handle to the main OPFS VFS worker to enable creation of certain utility functions without delegating to the async worker. Add sqlite3.capi.sqlite3_wasm_rc_str() to map integer result codes back to their SQLITE_xxx counterparts. Minor doc touchups.
...
FossilOrigin-Name: 9b2244e1c8a40efe6547094a1b57acc8f2173145a8731abb0e36268ce0a8ef41
2022-09-26 11:38:58 +00:00
stephan
6a643e4bcd
wasm: change StructBinder signature for sqlite3_file::pMethods from 'P' to 'p' to eliminate an unnecessary and inconsistent level of magic.
...
FossilOrigin-Name: 85f2e877e53899860af4dc6630044b471a9c7c82faba1f4e1e60ae991460b943
2022-09-26 11:34:31 +00:00
stephan
395012e58e
Fiddle: move, rather than copy, data buffers between the threads. Fix the case of an uploaded db failing to install because its filename is the same as the opened db.
...
FossilOrigin-Name: bcec4f964a7b02f59be05286ff715bac654a32b19f05a743e402f4cdb207cab8
2022-09-24 11:32:00 +00:00
stephan
ef11fb915d
Resolve "already configured" warnings from shell's main() when starting it up in fiddle mode.
...
FossilOrigin-Name: 114ef3552af977b272a0baddeb9a2326484b60acfc75284e43c55530f86b413f
2022-09-24 10:15:08 +00:00
stephan
56fae744d4
Reworked out the OPFS async proxy metrics are fetched so that they play more nicely with the tight event-polling loop.
...
FossilOrigin-Name: ef503ced5c2ca842be9aea9ef13719a378ed3020e884032db09afee1b8eba0a1
2022-09-24 10:12:19 +00:00
stephan
60d9aa7c59
Refactoring towards getting fiddle to support OPFS as a first-class citizen. Certain operations, e.g. import, export, and unlink, are not OPFS-aware.
...
FossilOrigin-Name: 1b923ed6438d7fef4508936e0c4bc026a368721698b1539961e3fb3140a185cb
2022-09-24 07:36:45 +00:00
stephan
f75c0c7036
Reformulate some JS to work around a buggy/broken code transformation in one of the Emscripten-driven code optimizers.
...
FossilOrigin-Name: e1249369d5ec1c582c280b1f578b35d53637fdf1cbd97c16d5ed95b136b83e56
2022-09-21 20:24:12 +00:00
stephan
6110a5d0ab
Put pieces in place for fiddle to support opfs, but more cleanup is required in the sqlite3.js/fiddle connection. bigIntEnabled now defaults to whether the Emscripten's module has bigint enabled. Add wasm-sensible defaults for several SQLITE_ENABLE/OMIT flags in sqlite3-wasm.c.
...
FossilOrigin-Name: 7c7fb7535e86b3960eea7f29ab7e6d5197c166b4ee64ad4a9bc0749f2869badc
2022-09-21 19:51:25 +00:00
drh
f333370e1f
Reduced and improved comments on the constraintCompatibleWithOuterJoin()
...
function.
FossilOrigin-Name: 38aaf26e082bd95df6b64df43e1772fe6e20c4eb71307dcd97559cac7f11f8f1
2022-09-21 18:21:31 +00:00
stephan
65022716b3
shell.c.in: when building in fiddle mode, define _POSIX_SOURCE (ifndef) so that emcc's string.h reveals strdup().
...
FossilOrigin-Name: fb85b269c43147f153977606dd8ede7b93744bf955e4c1a2b198907fd8a94620
2022-09-21 16:21:21 +00:00
stephan
e8afca3f16
Correct mistyped --shrink-memory flag in speedtest1-worker. Minor OPFS proxy cleanups.
...
FossilOrigin-Name: 86e2b55ec9483fa5add51a479c6509d73461f1ac6fca5d49e057b1c66f4314d2
2022-09-21 14:02:47 +00:00
stephan
72ab400d4d
Doc cleanups and additions. Add a way for the OPFS async runner to propagate exception text to the calling thread.
...
FossilOrigin-Name: 5c5e80652825cf883e6c17809cb98f2bf17d5feac2d263f6f492479154730dab
2022-09-21 12:27:35 +00:00