]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoAdd -DSQLITE_OS_KV_OPTIONAL to speedtest1 flags for kvvfs testing purposes.
stephan [Sun, 9 Oct 2022 11:42:12 +0000 (11:42 +0000)] 
Add -DSQLITE_OS_KV_OPTIONAL to speedtest1 flags for kvvfs testing purposes.

FossilOrigin-Name: 92b500da70a3dc64e910c232a2cac7620b6609162c2a5058b269d3b83d763c02

2 years agoReplace time-based auto-unlock of opfs sync handles with lock acquisition/release...
stephan [Tue, 4 Oct 2022 17:06:51 +0000 (17:06 +0000)] 
Replace time-based auto-unlock of opfs sync handles with lock acquisition/release via sqlite3_io_methods::xLock/xUnlock().

FossilOrigin-Name: 2625b7cfe1640c1d7e779ec1f37db970541598c0dc3e22e5eecf3c772d95ad40

2 years agoTweaks to the opfs async wait/relinquish times.
stephan [Tue, 4 Oct 2022 11:14:23 +0000 (11:14 +0000)] 
Tweaks to the opfs async wait/relinquish times.

FossilOrigin-Name: 35f33c23e5849de1c43c4499ee0a7fa11d26ae34949c1e820c3fa8e8873f9c2b

2 years agoUpdate ext/wasm/api/README.md to account for recent changes.
stephan [Tue, 4 Oct 2022 09:12:43 +0000 (09:12 +0000)] 
Update ext/wasm/api/README.md to account for recent changes.

FossilOrigin-Name: 9d488081fc82a9abe3e81c7897fe6b29b6b337f62d0c62cb9cec7517bd54b53f

2 years agoOPFS async proxy: add a wait-and-retry policy to the get-sync-handle step to help...
stephan [Tue, 4 Oct 2022 09:12:05 +0000 (09:12 +0000)] 
OPFS async proxy: add a wait-and-retry policy to the get-sync-handle step to help account for cross-tab locking.

FossilOrigin-Name: 45c48c63d311052105d102189208495b2b53fa3c4174884ecf63b757aa4016e5

2 years agoUpdate the 'start in speedtest kvvfs' link in speedtest1-worker to account for recent...
stephan [Tue, 4 Oct 2022 08:58:22 +0000 (08:58 +0000)] 
Update the 'start in speedtest kvvfs' link in speedtest1-worker to account for recent changes.

FossilOrigin-Name: f4d5ba412e0c1a031430a32c9ed1e11a09af33f9883150e660cc05e49fe56e6a

2 years agoMinor pstack doc update.
stephan [Tue, 4 Oct 2022 01:21:34 +0000 (01:21 +0000)] 
Minor pstack doc update.

FossilOrigin-Name: 6b4fb7c4e399ecc948ad41f5fa3139a9293cc822cd7efa2b83dc5fb1660b3ec6

2 years agoMinor cleanups and additions in sqlite3.capi.wasm.pstack.
stephan [Tue, 4 Oct 2022 01:11:10 +0000 (01:11 +0000)] 
Minor cleanups and additions in sqlite3.capi.wasm.pstack.

FossilOrigin-Name: 97bd670d3859bd3f2e62c15065b238b85ef614f26479e56a14be42c5784aedf4

2 years agoAdd a test/debug mechanism to shut down the OPFS async listener so that it can be...
stephan [Tue, 4 Oct 2022 00:54:00 +0000 (00:54 +0000)] 
Add a test/debug mechanism to shut down the OPFS async listener so that it can be inspected (it normally can't be because its tight event-listening loop ties up the thread) and then restarted.

FossilOrigin-Name: 7d0bcff4e9b899cd25b393b9f0a02c5dcee2e229f0a0fa01719c7dcd7dcbe7c1

2 years agoSet default page cache size to 16mb in wasm builds. Fix an off-by-one counter in...
stephan [Mon, 3 Oct 2022 23:13:05 +0000 (23:13 +0000)] 
Set default page cache size to 16mb in wasm builds. Fix an off-by-one counter in sqlite3_wasm_enum_json(). Minor coding style conformance tweaks.

FossilOrigin-Name: 72a9e589cc318ec50941739e2edf2c0636284b316c3bf87b71fd363b37619da3

2 years agoAdd a --cachesize flag to the speedtest1-worker-opfs link in index.html because opfs...
stephan [Mon, 3 Oct 2022 22:51:24 +0000 (22:51 +0000)] 
Add a --cachesize flag to the speedtest1-worker-opfs link in index.html because opfs is much faster with that.

FossilOrigin-Name: 5b8f8e33afc47c9f0c64dbe34643d7d1c37a0a82afb4656e714a86ef54a9ce6f

2 years agoMinor JS doc updates and typo fixes.
stephan [Mon, 3 Oct 2022 22:38:00 +0000 (22:38 +0000)] 
Minor JS doc updates and typo fixes.

FossilOrigin-Name: 3cfcc14dfd220536141aeffb902fdc8db1cea055b2a0609b88e092fc3df94688

2 years agoAdd configurable cache_size to batch-runner and speedtest1-worker. Add SQL tracing...
stephan [Mon, 3 Oct 2022 18:07:25 +0000 (18:07 +0000)] 
Add configurable cache_size to batch-runner and speedtest1-worker. Add SQL tracing to demo-123.js just for demonstration's sake.

FossilOrigin-Name: 2ab065133bec19f71a1dc382946fdbd020920b2e38a526f4126a3a1e8df5de87

2 years agoOmit WAL mode from the wasm build.
stephan [Mon, 3 Oct 2022 18:05:27 +0000 (18:05 +0000)] 
Omit WAL mode from the wasm build.

FossilOrigin-Name: 88efe2a62b81e5ee9119f54204e397fda59666a327158c7b7c972e84a716869e

2 years agoResolve/remove a TODO.
stephan [Mon, 3 Oct 2022 13:46:20 +0000 (13:46 +0000)] 
Resolve/remove a TODO.

FossilOrigin-Name: 2ea35fea3bac2637e935643edfa7913b792e529de3a8980dbb8678d98ed5bcf9

2 years agoExport sqlite3_trace_v2() to wasm and use it to ensure that the new per-VFS post...
stephan [Mon, 3 Oct 2022 13:03:41 +0000 (13:03 +0000)] 
Export sqlite3_trace_v2() to wasm and use it to ensure that the new per-VFS post-open SQL support in the DB ctor works. Default opfs vfs to journal_mode=truncate, as it's faster in that mode. Add 't' DB open-mode flag to enable SQL tracing to console.log().

FossilOrigin-Name: 508f7f6d63e52f61fae5abe817579a4e130fa7fbd18733d741d521a5bdabb7ce

2 years agoReimplement fiddle_reset_db() so that it works with all VFSes.
stephan [Mon, 3 Oct 2022 11:42:45 +0000 (11:42 +0000)] 
Reimplement fiddle_reset_db() so that it works with all VFSes.

FossilOrigin-Name: 18462052903bfeb037dd9af3a1fe1898d141eff5d6f527721858120553de808d

2 years agoExperimentally relinquish the OPFS VFS sync access handle when the db is idle and...
stephan [Mon, 3 Oct 2022 11:33:35 +0000 (11:33 +0000)] 
Experimentally relinquish the OPFS VFS sync access handle when the db is idle and reacquire it on demand, the goal being to help alleviate cross-tab locking issues.

FossilOrigin-Name: 2703ac9842335962e488e597168d70b1389b95a6ad39edf70a211b95979b4708

2 years agoAdd journal=MODE to the list of supported URL flags for speedtest1-worker.html.
stephan [Mon, 3 Oct 2022 11:23:47 +0000 (11:23 +0000)] 
Add journal=MODE to the list of supported URL flags for speedtest1-worker.html.

FossilOrigin-Name: 5c43e8d2ec23f28fdce63874d9d4c8ccbb4a8f81030b19d65ff5711a7c32697e

2 years agoOPFS VFS now lazily opens its sync access handle, as a step towards experimenting...
stephan [Mon, 3 Oct 2022 09:21:37 +0000 (09:21 +0000)] 
OPFS VFS now lazily opens its sync access handle, as a step towards experimenting with relinquishing it during idle times to help avoid cross-tab and page-reload locking issues.

FossilOrigin-Name: a984e1ba435731413a541f86c50232bc7d6e33aff6ba4cca90f89188e7b82a2c

2 years agoPartial revert of [a82e6faaa642] to remove the 'I' alias for 'j' wasm function signat...
stephan [Mon, 3 Oct 2022 08:30:22 +0000 (08:30 +0000)] 
Partial revert of [a82e6faaa642] to remove the 'I' alias for 'j' wasm function signature letter. In hindsight, that change seems premature.

FossilOrigin-Name: dcd46af9141f4edf816010923941a76d0edd3f18cfe429c52f599ad2a0d52651

2 years agoMinor JS API tweaks prompted by documenting them.
stephan [Mon, 3 Oct 2022 08:21:06 +0000 (08:21 +0000)] 
Minor JS API tweaks prompted by documenting them.

FossilOrigin-Name: a82e6faaa642b09d241232c4daa67134d4dfa24bf3ca3725740346ca5269b381

2 years agoMore cleanups in the UDF argument and result handling, in particular int64. Consolida...
stephan [Sun, 2 Oct 2022 22:50:04 +0000 (22:50 +0000)] 
More cleanups in the UDF argument and result handling, in particular int64. Consolidate some duplicate int64/bigint range checking code. Expose the UDF low-level utilities (arg/result conversion) to client code. Add the sqlite3_context pointer to the JS-side UDF wrappers for API consistency.

FossilOrigin-Name: 10ab77af952abf09f93f342a9d07a3b133f2c4c0a3588df3390cd3a923cafae4

2 years agoJS: clean up create_function() wrapper and add support for create_window_function...
stephan [Sun, 2 Oct 2022 20:08:53 +0000 (20:08 +0000)] 
JS: clean up create_function() wrapper and add support for create_window_function(). Eliminate an extraneous blob copy when a UDF returns a blob. Make use of newfound JS-fu to clean up how sqlite3ApiBootstrap() config is initialized.

FossilOrigin-Name: d3bad9347c5423fa7f19ae729461636f1043c99a1f01f168efa10bebefb1cdd1

2 years agojs: implement a hand-written wrapper for sqlite3_create_function_v2() which converts...
stephan [Sun, 2 Oct 2022 18:47:39 +0000 (18:47 +0000)] 
js: implement a hand-written wrapper for sqlite3_create_function_v2() which converts, if necessary, JS-function-type args to WASM function wrappers. Replace DB.createFunction() impl with the new one.

FossilOrigin-Name: 435ab33384017967e46f52b70bee851a85a28808990a0e58dd5288f606b89c9c

2 years agoDoc typo fixes.
stephan [Sun, 2 Oct 2022 03:14:38 +0000 (03:14 +0000)] 
Doc typo fixes.

FossilOrigin-Name: e528675da3971907666c7d2d09763975a105ec585dc5122145f65905d535bed8

2 years agoMore fleshing out of sqlite3.capi.wasm.pstack.
stephan [Sun, 2 Oct 2022 03:11:13 +0000 (03:11 +0000)] 
More fleshing out of sqlite3.capi.wasm.pstack.

FossilOrigin-Name: eb5726677a727a958df11f1fba078d30c7c0ba2a9bdb158e8641b35b5f971af3

2 years agoDocument the roles of the new (this past week) JS files added to the build process.
stephan [Sun, 2 Oct 2022 01:48:14 +0000 (01:48 +0000)] 
Document the roles of the new (this past week) JS files added to the build process.

FossilOrigin-Name: 8b3bc7313aff551e5ee0b7aeb927095cf19b9b96abbdd922066c130656b8aa7d

2 years agoGeneral internal cleanups in the oo1 API.
stephan [Sun, 2 Oct 2022 00:09:40 +0000 (00:09 +0000)] 
General internal cleanups in the oo1 API.

FossilOrigin-Name: f9db664f756f3707afcb5dce87f6d946625848f27ea84337af68de72d4ad6c6b

2 years agoCorrect fiddle db export breakage caused by a post-testing API change made in [1fa019...
stephan [Sat, 1 Oct 2022 19:21:52 +0000 (19:21 +0000)] 
Correct fiddle db export breakage caused by a post-testing API change made in [1fa019c88dea].

FossilOrigin-Name: e73cc44ec36c7585ebb914bdeed5b39480fca7c7a8d3c4426bfe769c87b98d17

2 years agoPedantic constness tweak.
stephan [Sat, 1 Oct 2022 18:55:10 +0000 (18:55 +0000)] 
Pedantic constness tweak.

FossilOrigin-Name: c8a173cf16d2567bf9b13f52904077a2e7209776c76613c7bff59cd66e24bf11

2 years agowasm: correct a memleak caused by a shadowed var in the previous checkin. Add a stack...
stephan [Sat, 1 Oct 2022 18:47:42 +0000 (18:47 +0000)] 
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

2 years agoFiddle: fix makefile dependency issue and duplicate inclusion of post-js.js. Reimplem...
stephan [Sat, 1 Oct 2022 16:01:41 +0000 (16:01 +0000)] 
Fiddle: fix makefile dependency issue and duplicate inclusion of post-js.js. Reimplement db export using sqlite3_serialize().

FossilOrigin-Name: 29db7de79232c21d19b91bb0fc253114e02e21dd9bf90619453dbe72a4c8bf7f

2 years agoMerge trunk into fiddle-opfs branch.
stephan [Sat, 1 Oct 2022 13:45:14 +0000 (13:45 +0000)] 
Merge trunk into fiddle-opfs branch.

FossilOrigin-Name: 64ebcbe41615a6d7776597564105ea7638e4a9095a764ea558c2620640429cf8

2 years agoTweak sqlite3-worker1.js to be able to load either sqlite3.js or sqlite3-wasmfs.js...
stephan [Sat, 1 Oct 2022 13:38:27 +0000 (13:38 +0000)] 
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

2 years agoReplace the Parse.disableVtab field with Parse.prepFlags for increased
drh [Sat, 1 Oct 2022 13:17:53 +0000 (13:17 +0000)] 
Replace the Parse.disableVtab field with Parse.prepFlags for increased
generality, a small size reduction, and a small performance increase.

FossilOrigin-Name: b7da0bcdf70e53ab1ec00a0694e17c7429e23bc6eb3f39b622d06a930aa2f6a3

2 years agoNote two wasm-related potential TODOs.
stephan [Sat, 1 Oct 2022 12:04:49 +0000 (12:04 +0000)] 
Note two wasm-related potential TODOs.

FossilOrigin-Name: 5636e82864457d870754ee7125c307dc5d2195197a5c0266579da9f102938b89

2 years agoRemove a couple of weird quirks of the Worker1 and Promiser APIs. The Worker1 (now...
stephan [Fri, 30 Sep 2022 23:49:43 +0000 (23:49 +0000)] 
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

2 years agoTweaks to the Worker1 and Promiser APIs prompted by documenting them.
stephan [Fri, 30 Sep 2022 23:02:11 +0000 (23:02 +0000)] 
Tweaks to the Worker1 and Promiser APIs prompted by documenting them.

FossilOrigin-Name: c68b9aa160e2c1197ae7eb06a634017ac2b281393074afa4582762d5458c6889

2 years agoRemove one of the NEVER() macros added by [5166acf3f0040459] because it
drh [Fri, 30 Sep 2022 22:40:57 +0000 (22:40 +0000)] 
Remove one of the NEVER() macros added by [5166acf3f0040459] because it
is reachable after all.

FossilOrigin-Name: bd8ae5febbb8d3122f1e2e09b9fcdd6ac20c075ae1cf60bcdbd36080f3736417

2 years agoNew test cases in fuzzdata8.db
drh [Fri, 30 Sep 2022 20:59:09 +0000 (20:59 +0000)] 
New test cases in fuzzdata8.db

FossilOrigin-Name: aa367a3c974041323edb759855f0b83803439ceef2846da2d73eadd80efeaac4

2 years agoFix a bug in the demoDelete fix from [d76a301e22e05722].
drh [Fri, 30 Sep 2022 20:53:36 +0000 (20:53 +0000)] 
Fix a bug in the demoDelete fix from [d76a301e22e05722].

FossilOrigin-Name: 7e761a02530ffbb055a766eb6c995f11fc2adbabb9a52502124f672fdcff0d10

2 years agoAdd NEVER() to two error-detection tests that were made unreachable by
drh [Fri, 30 Sep 2022 20:48:22 +0000 (20:48 +0000)] 
Add NEVER() to two error-detection tests that were made unreachable by
the previous check-in.

FossilOrigin-Name: 5166acf3f00404597e77910aee88920ab833af8447766f50bf4f70525606cf95

2 years agoAdd JS wrapper for sqlite3_exec() which knows how to handle a JS callback. Add some...
stephan [Fri, 30 Sep 2022 20:35:37 +0000 (20:35 +0000)] 
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

2 years agoBetter handle a case of database corruption where a b-tree page is one of its own...
dan [Fri, 30 Sep 2022 20:15:21 +0000 (20:15 +0000)] 
Better handle a case of database corruption where a b-tree page is one of its own ancestor pages.

FossilOrigin-Name: a24e46804893a7e6e8f3130abca882f9a3aa3b7b2b82aa39a0a20856172766d5

2 years agoAdd sqlite3.version object. Add more state to the Worker #1 config-get response,...
stephan [Fri, 30 Sep 2022 16:49:03 +0000 (16:49 +0000)] 
Add sqlite3.version object. Add more state to the Worker #1 config-get response, including sqlite3.version.

FossilOrigin-Name: 711f458d188a0dbe6612069c856ade29323ab426dfa4f80e7b82757ccc474cb8

2 years agoAdd oo1.JsStorageDb.clearStorage/storageSize() methods, copies of capi.sqlite3_web_kv...
stephan [Fri, 30 Sep 2022 15:46:08 +0000 (15:46 +0000)] 
Add oo1.JsStorageDb.clearStorage/storageSize() methods, copies of capi.sqlite3_web_kvvfs_clear/size().

FossilOrigin-Name: 1e09efe7fa15b8908f8b8353164a8361de778e27ea6c0b11c402bf4e1c56333d

2 years agobatch-runner.js: force WebSQL batches to not abort for a failed statement (necessary...
stephan [Fri, 30 Sep 2022 15:24:58 +0000 (15:24 +0000)] 
batch-runner.js: force WebSQL batches to not abort for a failed statement (necessary for apples-to-apples-ish benchmark comparisons).

FossilOrigin-Name: 60f0c5cb04d2baf8431e523434d8753e39377f4b2c6bad225c2e5487a4be419b

2 years agoImprovements to the "demoDelete" method in the demovfs, suggested by
drh [Fri, 30 Sep 2022 14:35:18 +0000 (14:35 +0000)] 
Improvements to the "demoDelete" method in the demovfs, suggested by
[forum:/forumpost/cad18961c2|forum post cad18961c2].

FossilOrigin-Name: d76a301e22e0572262917dfe9557a5051339a65416a473dd2d9989a49975403e

2 years agoExpose sqlite3_msize() to wasm.
stephan [Fri, 30 Sep 2022 12:10:36 +0000 (12:10 +0000)] 
Expose sqlite3_msize() to wasm.

FossilOrigin-Name: aa6ad34f3b693b554be58ee2895f79397162c5b8877c709653c8508fc625e8f4

2 years agoAdd oo1.JsStorageDb() as a convenience wrapper for oo1.DB(...,'kvvfs'). Minor doc...
stephan [Fri, 30 Sep 2022 11:01:44 +0000 (11:01 +0000)] 
Add oo1.JsStorageDb() as a convenience wrapper for oo1.DB(...,'kvvfs'). Minor doc cleanups.

FossilOrigin-Name: 8a7998709f859a562cf6829485cb9921f8823af0efabe003741348ab1169fb89

2 years agowasm: expose sqlite3_de/serialize(), sqlite3_malloc/free() and friends, noting that...
stephan [Fri, 30 Sep 2022 10:55:28 +0000 (10:55 +0000)] 
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

2 years agoAdd JS infrastructure to ostensibly allow us to customize the wasm imports, which...
stephan [Thu, 29 Sep 2022 22:08:22 +0000 (22:08 +0000)] 
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

2 years agoEnsure that the wasm builds always, even when passing -Ox flags from the CLI, use...
stephan [Thu, 29 Sep 2022 17:35:25 +0000 (17:35 +0000)] 
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

2 years agoFinish eliminating explicit Emscripten module dependencies in test code and fiddle...
stephan [Thu, 29 Sep 2022 16:54:23 +0000 (16:54 +0000)] 
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

2 years agoRework the Emscripten-emitted module loader/init function such that it passes on...
stephan [Thu, 29 Sep 2022 13:17:50 +0000 (13:17 +0000)] 
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

2 years agoFix misuse of the sqlite3_set_auxdata() interface in the ICU extension.
drh [Wed, 28 Sep 2022 19:14:01 +0000 (19:14 +0000)] 
Fix misuse of the sqlite3_set_auxdata() interface in the ICU extension.

FossilOrigin-Name: f25cf63471cbed1edb27591e57fead62550d4046dbdcb61312288f0f6f24c646

2 years agoWasm: expose sqlite3_exec() and use it to simplify the db-reset logic in batch-runner...
stephan [Wed, 28 Sep 2022 18:10:50 +0000 (18:10 +0000)] 
Wasm: expose sqlite3_exec() and use it to simplify the db-reset logic in batch-runner.js a bit.

FossilOrigin-Name: 2e2821f782511b9d2274a89a5a922582aba18c7e9dc7ce01080e713942a56d7d

2 years agoMore work on batch-runner.html/js to facilitate speed comparisons between various...
stephan [Wed, 28 Sep 2022 17:52:52 +0000 (17:52 +0000)] 
More work on batch-runner.html/js to facilitate speed comparisons between various VFSes and WebSQL.

FossilOrigin-Name: 3bd1bc240676e56da87fc49f3c67a1edc4fafcf2a2416298d19ae4f80b676a72

2 years agoCorrect duplicate copies of sqlite3-api.js being embedded in the wasmfs-based builds.
stephan [Wed, 28 Sep 2022 13:01:49 +0000 (13:01 +0000)] 
Correct duplicate copies of sqlite3-api.js being embedded in the wasmfs-based builds.

FossilOrigin-Name: bbfcfba260f39a9c91e82d87e06b1c2cb297c03498b4530aa3e7e01ef9916012

2 years agoWork around broken -Os wasm builds by adding the -g3 flag. Unrelated documentation...
stephan [Wed, 28 Sep 2022 07:53:47 +0000 (07:53 +0000)] 
Work around broken -Os wasm builds by adding the -g3 flag. Unrelated documentation tweaks.

FossilOrigin-Name: f5d6bf8616341037fa3e229edf820d19acef3e0a6207a652b2b143de0a493214

2 years agoMinor doc correction.
stephan [Tue, 27 Sep 2022 17:03:01 +0000 (17:03 +0000)] 
Minor doc correction.

FossilOrigin-Name: 093f6e4b36db294e8e47df2fc75a4bc4fc101e2b6ff0201c912ccd1dcf394479

2 years agoProvide the SQLITE_MAX_ALLOCATION_SIZE compile-time option for limiting the
drh [Tue, 27 Sep 2022 16:35:06 +0000 (16:35 +0000)] 
Provide the SQLITE_MAX_ALLOCATION_SIZE compile-time option for limiting the
maximum memory allocation size.

FossilOrigin-Name: 584de6a996c78b8e41bdfcd05a8e2a3844664c6b4efedb5883c8b8af388462b5

2 years agoComment the -O2 wasm builds as being broken (mysteriously missing JS bits).
stephan [Tue, 27 Sep 2022 14:31:34 +0000 (14:31 +0000)] 
Comment the -O2 wasm builds as being broken (mysteriously missing JS bits).

FossilOrigin-Name: f61475ef8244fd1f6553eca9cc2317e5de2cc04443e24afb7b91ebd3fc1bd402

2 years agoWASM API renaming. Reworked JS API bootstrap's async post-init into a generic mechani...
stephan [Tue, 27 Sep 2022 13:40:12 +0000 (13:40 +0000)] 
WASM API renaming. Reworked JS API bootstrap's async post-init into a generic mechanism, no longer OPFS-specific.

FossilOrigin-Name: c42a8cb090cad1108dfd6be574202d744c59e053b505bc4c17252dc6b65d26bf

2 years agowasm/js: rename /persistent to /opfs to account for potential future persistent stora...
stephan [Tue, 27 Sep 2022 09:17:37 +0000 (09:17 +0000)] 
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

2 years agoMake the legacy FTS3 code more robust against integer overflow during
drh [Tue, 27 Sep 2022 01:53:05 +0000 (01:53 +0000)] 
Make the legacy FTS3 code more robust against integer overflow during
memory allocation.

FossilOrigin-Name: 5517bc50988b5339c2fd071b29de1b5ca03037b0b635c3b112cf7108fab54d5f

2 years agoEnhance defensive mode so that it disallows CREATE TRIGGER statements if the
drh [Tue, 27 Sep 2022 00:56:45 +0000 (00:56 +0000)] 
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

2 years agoFiddle: replace db export routine with a C-side one which works for both Emscripten...
stephan [Mon, 26 Sep 2022 13:55:10 +0000 (13:55 +0000)] 
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

2 years agoGet fiddle db export working for OPFS VFS. Add root dir handle to the main OPFS VFS...
stephan [Mon, 26 Sep 2022 11:38:58 +0000 (11:38 +0000)] 
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

2 years agowasm: change StructBinder signature for sqlite3_file::pMethods from 'P' to 'p' to...
stephan [Mon, 26 Sep 2022 11:34:31 +0000 (11:34 +0000)] 
wasm: change StructBinder signature for sqlite3_file::pMethods from 'P' to 'p' to eliminate an unnecessary and inconsistent level of magic.

FossilOrigin-Name: 85f2e877e53899860af4dc6630044b471a9c7c82faba1f4e1e60ae991460b943

2 years agoFiddle: move, rather than copy, data buffers between the threads. Fix the case of...
stephan [Sat, 24 Sep 2022 11:32:00 +0000 (11:32 +0000)] 
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

2 years agoResolve "already configured" warnings from shell's main() when starting it up in...
stephan [Sat, 24 Sep 2022 10:15:08 +0000 (10:15 +0000)] 
Resolve "already configured" warnings from shell's main() when starting it up in fiddle mode.

FossilOrigin-Name: 114ef3552af977b272a0baddeb9a2326484b60acfc75284e43c55530f86b413f

2 years agoReworked out the OPFS async proxy metrics are fetched so that they play more nicely...
stephan [Sat, 24 Sep 2022 10:12:19 +0000 (10:12 +0000)] 
Reworked out the OPFS async proxy metrics are fetched so that they play more nicely with the tight event-polling loop.

FossilOrigin-Name: ef503ced5c2ca842be9aea9ef13719a378ed3020e884032db09afee1b8eba0a1

2 years agoRefactoring towards getting fiddle to support OPFS as a first-class citizen. Certain...
stephan [Sat, 24 Sep 2022 07:36:45 +0000 (07:36 +0000)] 
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

2 years agoReformulate some JS to work around a buggy/broken code transformation in one of the...
stephan [Wed, 21 Sep 2022 20:24:12 +0000 (20:24 +0000)] 
Reformulate some JS to work around a buggy/broken code transformation in one of the Emscripten-driven code optimizers.

FossilOrigin-Name: e1249369d5ec1c582c280b1f578b35d53637fdf1cbd97c16d5ed95b136b83e56

2 years agoPut pieces in place for fiddle to support opfs, but more cleanup is required in the...
stephan [Wed, 21 Sep 2022 19:51:25 +0000 (19:51 +0000)] 
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

2 years agoReduced and improved comments on the constraintCompatibleWithOuterJoin()
drh [Wed, 21 Sep 2022 18:21:31 +0000 (18:21 +0000)] 
Reduced and improved comments on the constraintCompatibleWithOuterJoin()
function.

FossilOrigin-Name: 38aaf26e082bd95df6b64df43e1772fe6e20c4eb71307dcd97559cac7f11f8f1

2 years agoshell.c.in: when building in fiddle mode, define _POSIX_SOURCE (ifndef) so that emcc...
stephan [Wed, 21 Sep 2022 16:21:21 +0000 (16:21 +0000)] 
shell.c.in: when building in fiddle mode, define _POSIX_SOURCE (ifndef) so that emcc's string.h reveals strdup().

FossilOrigin-Name: fb85b269c43147f153977606dd8ede7b93744bf955e4c1a2b198907fd8a94620

2 years agoCorrect mistyped --shrink-memory flag in speedtest1-worker. Minor OPFS proxy cleanups.
stephan [Wed, 21 Sep 2022 14:02:47 +0000 (14:02 +0000)] 
Correct mistyped --shrink-memory flag in speedtest1-worker. Minor OPFS proxy cleanups.

FossilOrigin-Name: 86e2b55ec9483fa5add51a479c6509d73461f1ac6fca5d49e057b1c66f4314d2

2 years agoDoc cleanups and additions. Add a way for the OPFS async runner to propagate exceptio...
stephan [Wed, 21 Sep 2022 12:27:35 +0000 (12:27 +0000)] 
Doc cleanups and additions. Add a way for the OPFS async runner to propagate exception text to the calling thread.

FossilOrigin-Name: 5c5e80652825cf883e6c17809cb98f2bf17d5feac2d263f6f492479154730dab

2 years agoAdded some structure to the wasm demo link list.
stephan [Wed, 21 Sep 2022 12:25:40 +0000 (12:25 +0000)] 
Added some structure to the wasm demo link list.

FossilOrigin-Name: 777077c4c2249e1ec78390d4f65aaf281c1fbefcef4bcc7609199e995645ceb6

2 years agoThe RIGHT JOIN logic added to version 3.39.0 added a new restriction on the
drh [Wed, 21 Sep 2022 09:54:41 +0000 (09:54 +0000)] 
The RIGHT JOIN logic added to version 3.39.0 added a new restriction on the
query flattener which resulted in a performance regression for some queries,
as documented by [forum:/forumpost/96b9e5709cf47cda|forum post 96b9e5709cf47cda].
This change removes that restriction (thus restoring performance) and fixes the
problem that RIGHT JOIN was having in a different way.

FossilOrigin-Name: 501609eddf2a46d51e8cd56477a22d4df142a166e78fe4322c0db11d1eed6687

2 years agoAdd a link to fiddle.html in the wasm test app index.html.
stephan [Wed, 21 Sep 2022 08:41:40 +0000 (08:41 +0000)] 
Add a link to fiddle.html in the wasm test app index.html.

FossilOrigin-Name: 96c734c07acfbea153d9aaf293a28a2d49d78de19fec4fb90c4c08fb1fd0ddbd

2 years agoMove fiddle build rules into the wasm-centric build files. Add rule to push wasm...
stephan [Wed, 21 Sep 2022 08:39:03 +0000 (08:39 +0000)] 
Move fiddle build rules into the wasm-centric build files. Add rule to push wasm bits to the wasm test server.

FossilOrigin-Name: 113f8204dc4ac849d5632d3de1680b6e0da871e107ef484c8d7273799bee3d88

2 years agoBreak out the decision of whether or not a constraint term is usable by flattener-omit-restriction-29
drh [Wed, 21 Sep 2022 00:16:59 +0000 (00:16 +0000)] 
Break out the decision of whether or not a constraint term is usable by
an outer join into a subroutine: constraintCompatibleWithOuterJoin().

FossilOrigin-Name: c7fbc9b0453050e2746af27e3a11e0c3701bef8c56da8e19173242c6ea3aff8b

2 years agoDo not allow EP_InnerON terms to be used on a outer join.
drh [Tue, 20 Sep 2022 22:19:13 +0000 (22:19 +0000)] 
Do not allow EP_InnerON terms to be used on a outer join.

FossilOrigin-Name: f47aa745690c018800243bf76930b2499ff4537411c4e27b4b16ba3854cc2bf8

2 years agoAdd new test cases that (current) get an incorrect answer.
drh [Tue, 20 Sep 2022 21:07:52 +0000 (21:07 +0000)] 
Add new test cases that (current) get an incorrect answer.

FossilOrigin-Name: fe5c37736444e397ace387b761ec2491229785d7a437f3f60232aedf9d1f00ec

2 years agoNew test cases for query flattening when there are ON clauses and outer joins.
drh [Tue, 20 Sep 2022 19:45:04 +0000 (19:45 +0000)] 
New test cases for query flattening when there are ON clauses and outer joins.

FossilOrigin-Name: db55387b1972bc7bc6855bd3497af744a111e7d28d09893cd985fbb01be41bcc

2 years agoModify the OP_IfNotOpen opcode so that the jump is taken if the cursor is open
drh [Tue, 20 Sep 2022 19:22:17 +0000 (19:22 +0000)] 
Modify the OP_IfNotOpen opcode so that the jump is taken if the cursor is open
but was previously set to a NULL row using OP_NullRow.

FossilOrigin-Name: 1292d68caa7086610ddda343f3852e63de8da1eb66536ee4716b6529f5a31bc6

2 years agoRemove code that has been previously commented out.
drh [Tue, 20 Sep 2022 18:18:00 +0000 (18:18 +0000)] 
Remove code that has been previously commented out.

FossilOrigin-Name: 852b385a5de622aa32026824210d4bd23db52a4a8a697b83d22d6000edeba487

2 years agoMerge the fuzzcheck fix from trunk into the flattener improvement branch.
drh [Tue, 20 Sep 2022 17:43:40 +0000 (17:43 +0000)] 
Merge the fuzzcheck fix from trunk into the flattener improvement branch.

FossilOrigin-Name: 930a8c1561d0d5dc70dc5378edac77f79ac59ab6569b561de3dfb02f160c38c5

2 years agoUpdate the fuzz invariant checker to conform to the latest changes in
drh [Tue, 20 Sep 2022 17:21:54 +0000 (17:21 +0000)] 
Update the fuzz invariant checker to conform to the latest changes in
dbsqlfuzz.

FossilOrigin-Name: 8d8c124349d2a25200ace9a60d76751594b722468ad0c39d927a5d2c6e2464e0

2 years agoIs the query flattener restriction 29 (do not allow both EP_InnerON and
drh [Tue, 20 Sep 2022 16:57:49 +0000 (16:57 +0000)] 
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

2 years agoCorrect a too-strict is-opfs-available check.
stephan [Tue, 20 Sep 2022 16:20:35 +0000 (16:20 +0000)] 
Correct a too-strict is-opfs-available check.

FossilOrigin-Name: 1b5f1b4a6c1457f98c258459e23e321fc59793de298fecb84031b87f02156cd5

2 years agoMerge kv-vfs-magic-names branch into fiddle-opfs branch and make some kvvfs-relevant...
stephan [Tue, 20 Sep 2022 16:10:39 +0000 (16:10 +0000)] 
Merge kv-vfs-magic-names branch into fiddle-opfs branch and make some kvvfs-relevant tweaks.

FossilOrigin-Name: e3d36dcdd37e59f17a07d3611d08744eb86f439fab82a648490dd608bcaa3185

2 years agoExport the sqlite3_uri_...() family of functions to wasm.
stephan [Tue, 20 Sep 2022 14:52:26 +0000 (14:52 +0000)] 
Export the sqlite3_uri_...() family of functions to wasm.

FossilOrigin-Name: 72bebc848fce5c3b4766017d016ccb2360de2bd0cb3e47e710c80dbcb6b8b707

2 years agoMerge opfs-proxy-atomics branch into the fiddle-opfs branch.
stephan [Tue, 20 Sep 2022 14:39:54 +0000 (14:39 +0000)] 
Merge opfs-proxy-atomics branch into the fiddle-opfs branch.

FossilOrigin-Name: 25a36920d44544547a84161681cd41e292b4a70df60ac3630791873a79237d98

2 years agoWhen compiled with SQLITE_OS_KV_OPTIONAL, the magic names ":localStorage:" kv-vfs-magic-names
drh [Tue, 20 Sep 2022 14:36:53 +0000 (14:36 +0000)] 
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

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