]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoImprovements to the description of the OPFLAG_TYPEOFARG option to OP_Column. isnull-opt
drh [Thu, 13 Oct 2022 14:54:32 +0000 (14:54 +0000)] 
Improvements to the description of the OPFLAG_TYPEOFARG option to OP_Column.

FossilOrigin-Name: 5e9c67ba18b701aabbb0546acdfc532c9e8f0d27fb0a2c899415a5c47096c90b

2 years agoAdjust the implementation of sqlite3VdbeTypeofColumn() to make it easier
drh [Thu, 13 Oct 2022 14:35:20 +0000 (14:35 +0000)] 
Adjust the implementation of sqlite3VdbeTypeofColumn() to make it easier
to test (and slightly smaller).

FossilOrigin-Name: 79fdd021df256c6a2b9973fd6bf8e52ffaaf4d369d40489b8395ac97880b1325

2 years agoProposed optimization to the IS NULL and NOT NULL operators that avoids
drh [Thu, 13 Oct 2022 12:47:33 +0000 (12:47 +0000)] 
Proposed optimization to the IS NULL and NOT NULL operators that avoids
loading the entire content of larges strings and BLOBs.  Response to
[forum:/info/3c08d4715dc05b00|forum post 3c08d4715dc05b00].

FossilOrigin-Name: 45f171565442f9fd6574fb93ae7abe83c168b20be68af42531bc55571450d3ab

2 years agoUpdates to the fuzzer query invariant checker - tracking changes made
drh [Wed, 12 Oct 2022 18:40:25 +0000 (18:40 +0000)] 
Updates to the fuzzer query invariant checker - tracking changes made
over in dbsqlfuzz.

FossilOrigin-Name: 4ca16a304ad10fbb48f78b4384b347fe883e1a4f222f113ac981e89845c3e113

2 years agoChanges to Makefile.msc to fix the build on Windows following the previous
drh [Wed, 12 Oct 2022 18:30:08 +0000 (18:30 +0000)] 
Changes to Makefile.msc to fix the build on Windows following the previous
merge.

FossilOrigin-Name: 368fa6b25bc803ded7c1a0184615980902657879370caec22ceea42496ec0566

2 years agoMerge fiddle-opfs branch into trunk.
stephan [Wed, 12 Oct 2022 18:13:52 +0000 (18:13 +0000)] 
Merge fiddle-opfs branch into trunk.

FossilOrigin-Name: 98f954942a8d4824b5c4bd1d27cfeff7a71a029dc5a54220b76d59e367996581

2 years agoMerge trunk into fiddle-opfs as a preliminary step for a clean merge in the other... fiddle-opfs
stephan [Wed, 12 Oct 2022 16:35:22 +0000 (16:35 +0000)] 
Merge trunk into fiddle-opfs as a preliminary step for a clean merge in the other direction.

FossilOrigin-Name: 5e1848ce384a78fe5dfa1b5c1b2acb9c2fac34a8f0ba6c652e0541dcf24e9027

2 years agoAdd initial infrastructure for setting up function/regression tests for the JS/WASM...
stephan [Wed, 12 Oct 2022 15:54:28 +0000 (15:54 +0000)] 
Add initial infrastructure for setting up function/regression tests for the JS/WASM APIs.

FossilOrigin-Name: 7f5db9829b6e60fadb756fea5442da1f4368c8428bb5cdaf14f97f0c3c8451d9

2 years agoMinor doc cleanups and corrections in sqlite3-wasm.c
stephan [Wed, 12 Oct 2022 15:40:16 +0000 (15:40 +0000)] 
Minor doc cleanups and corrections in sqlite3-wasm.c

FossilOrigin-Name: 5144c122a921e4240901cf4eb46347b92213273eec7cf0977952ab2b60722c27

2 years agoCorrect mismatched H1 tags in test code. Minor CSS tweaks.
stephan [Wed, 12 Oct 2022 14:39:15 +0000 (14:39 +0000)] 
Correct mismatched H1 tags in test code. Minor CSS tweaks.

FossilOrigin-Name: 4d8eb90a370054d4482c20637ab56f5e01f4d10215f2af4e35fb9a1f85ecb700

2 years agoAdd the sqlite3_value_encoding() interface.
drh [Wed, 12 Oct 2022 12:49:29 +0000 (12:49 +0000)] 
Add the sqlite3_value_encoding() interface.

FossilOrigin-Name: d6d449978245b4fa66c152132da468eea7977eab4d1fe53bb2fe3ef543d8030f

2 years agoEnhance the OP_IsType opcode so that it is slightly smaller and faster and
drh [Tue, 11 Oct 2022 13:57:55 +0000 (13:57 +0000)] 
Enhance the OP_IsType opcode so that it is slightly smaller and faster and
so that it works correctly with invalid serial-type codes 10 and 11.

FossilOrigin-Name: 846f863e0d55eb7e78c8d355bbbcd73e1946d0ba566c2cb31683cde5f4353d1b

2 years agoImproved the ability of the CLI to handle very long input lines.
drh [Tue, 11 Oct 2022 12:02:42 +0000 (12:02 +0000)] 
Improved the ability of the CLI to handle very long input lines.
Potentially a fix for the bug reported by
[forum:/forumpost/fa4bb2941a|forum post fa4bb2941a].

FossilOrigin-Name: d0e107ee00101f42b4c9bf372625311d04b83c96a4a9caacac866ea03d8e7fa4

2 years agoEnhance the "PRAGMA integrity_check" statement so that it verifies datatype
drh [Mon, 10 Oct 2022 23:54:17 +0000 (23:54 +0000)] 
Enhance the "PRAGMA integrity_check" statement so that it verifies datatype
constraints on non-STRICT tables:  (1) Columns with TEXT affinity should not
contain numeric values, and (2) columns with NUMERIC affinity should not
contain TEXT values that could be converted into numbers.

FossilOrigin-Name: aa6e9086196248675b9e33dbfaad9ef67097432535896790f80d2470002978b1

2 years agoCode clean-up for the integrity_check enhancement. integrity_check_datatypes
drh [Mon, 10 Oct 2022 21:21:04 +0000 (21:21 +0000)] 
Code clean-up for the integrity_check enhancement.

FossilOrigin-Name: a140173102febe9ef8064ee9b95bee489db54caba149e577d69e4d75161bf390

2 years agoFix corner-case bugs in the new integrity_check logic. All tests pass now.
drh [Mon, 10 Oct 2022 19:38:01 +0000 (19:38 +0000)] 
Fix corner-case bugs in the new integrity_check logic.  All tests pass now.

FossilOrigin-Name: dbab9d52a842085da67f5d0b8e96c665adc16331accf380b4c234e9b05bdb7fb

2 years agoAn attempt to enhance PRAGMA integrity check so that it does data type
drh [Mon, 10 Oct 2022 18:25:05 +0000 (18:25 +0000)] 
An attempt to enhance PRAGMA integrity check so that it does data type
checking on non-STRICT tables.  Specifically:  (1) Columns with TEXT affinity
should not contain numeric values, and (2) columns with numeric affinity should
not contain text values that can be converted to numeric.

FossilOrigin-Name: 8b1e7f0524637728cebe81c7d3ff8ad8a5a55782eac6409b425dad538024f596

2 years agoImproved detection of database corrupting when moving pages on an
drh [Mon, 10 Oct 2022 12:02:53 +0000 (12:02 +0000)] 
Improved detection of database corrupting when moving pages on an
autovacuumed database when creating a new btree.
dbsqlfuzz 9a55397eae13cec64aebf1fd35489c3a90bdaac5

FossilOrigin-Name: 327965bc71023d9380a9d6805062659108dab4bfcd386b7aba813754f270d33a

2 years agoRemove some extraneous debug output.
stephan [Sun, 9 Oct 2022 17:08:36 +0000 (17:08 +0000)] 
Remove some extraneous debug output.

FossilOrigin-Name: 56ff42053f7b73b380c103a84f29e285cfbfb6e18a25b3a50a6d78e32610914e

2 years agoRemove a now-unnecessary --cachesize flag for the OPFS sqlite3_vfs speedtest1-worker...
stephan [Sun, 9 Oct 2022 17:03:48 +0000 (17:03 +0000)] 
Remove a now-unnecessary --cachesize flag for the OPFS sqlite3_vfs speedtest1-worker.html invocation.

FossilOrigin-Name: 08b516d6953256cfb8792cfee9e6ed7450fd55d84196b66b77409cfaee3c8729

2 years agoMinor cleaups in the post-init async phase of sqlite3 module initialization.
stephan [Sun, 9 Oct 2022 15:12:37 +0000 (15:12 +0000)] 
Minor cleaups in the post-init async phase of sqlite3 module initialization.

FossilOrigin-Name: 2e024a6b533524b7732cea8aa27b16363e17b4c32731ddf31085e91fc728c1af

2 years agoRemove ext/wasm/kvvfs.make which was inadvertently resurrected in [92b500da70a3].
stephan [Sun, 9 Oct 2022 13:35:14 +0000 (13:35 +0000)] 
Remove ext/wasm/kvvfs.make which was inadvertently resurrected in [92b500da70a3].

FossilOrigin-Name: 2e7fa085fc0b1202c6502d89e2603ae76a93451754b07b32ab4f0211f213f980

2 years agoRefactor kvvfs JS bits to make use of [ea370b9b05f7ed7eaa]. At main-thread startup...
stephan [Sun, 9 Oct 2022 13:26:15 +0000 (13:26 +0000)] 
Refactor kvvfs JS bits to make use of [ea370b9b05f7ed7eaa]. At main-thread startup, if kvvfs is available, replace the kvvfs I/O methods with JS impls. Checkin part 2 of 2, to account for cherrypicking [ea370b9b05f7ed7eaa] into the kv-vfs branch.

FossilOrigin-Name: a9047e020a097b2259bc9935b63ca1c538a3a7f1d050e15f0d0a08cfb84acc7c

2 years agoRefactor os_kv.c so that the kvvfs read/write/delete methods can be swapped out at...
stephan [Sun, 9 Oct 2022 13:19:27 +0000 (13:19 +0000)] 
Refactor os_kv.c so that the kvvfs read/write/delete methods can be swapped out at runtime by JS implementations. This eliminates the kvvfs dependency on Emscripten. Checkin part 1 of 2, to account for cherrypicking.

FossilOrigin-Name: ea370b9b05f7ed7eaa154ba58019f6642217eabc18517e721567adf948d93980

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 agoWhen casting an odd-length BLOB into a TEXT with encoding UTF16, omit the
drh [Sat, 8 Oct 2022 17:27:05 +0000 (17:27 +0000)] 
When casting an odd-length BLOB into a TEXT with encoding UTF16, omit the
last byte.  dbsqlfuzz c5df68b5bbdf6c9f3c1851e41e88f49ac05c9969

FossilOrigin-Name: 1e2796b3741a4c0b966e6c01a7d62dea8de9d1f4bededea3d7ba7004dabc2ffe

2 years agoFix a problem causing the seek-scan optimization to skip over valid rows that could...
dan [Fri, 7 Oct 2022 18:57:15 +0000 (18:57 +0000)] 
Fix a problem causing the seek-scan optimization to skip over valid rows that could occur when it is used with expressions of the form (a IN (?,?..) AND b >= ?). dbsqlfuzz ab1db6dc0efb04cba1cd3431ee6da4894fdc4520.

FossilOrigin-Name: 63d9efe277759d4daa29794846b60c6f55491496618f423f61468df72d0a4633

2 years agoImproved tracing output for showing all registers used by the
drh [Fri, 7 Oct 2022 15:55:35 +0000 (15:55 +0000)] 
Improved tracing output for showing all registers used by the
OP_SeekGE opcode.  This applies to debugging builds only.

FossilOrigin-Name: 0aa6dee7f72279114a47cbb69fdbda0b916a2c365f7a147946869f167bd018b7

2 years agoFix a problem that occurred when using a bloom filter to optimize an (ipk = ?) lookup...
dan [Thu, 6 Oct 2022 14:10:11 +0000 (14:10 +0000)] 
Fix a problem that occurred when using a bloom filter to optimize an (ipk = ?) lookup in the case where the RHS of the expression is a TEXT value. First reported by [forum:/forumpost/f61a8b7053|forum post f61a8b7053].

FossilOrigin-Name: 8e14c351b29bb434ac4e2510681e95716424a73e340d39feff4919f0431c2e00

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 agoAttempt to clarify the operation of the xLock and xUnlock VFS I/O methods.
drh [Tue, 4 Oct 2022 14:50:46 +0000 (14:50 +0000)] 
Attempt to clarify the operation of the xLock and xUnlock VFS I/O methods.
Assert() statements added to prove that they behave as the documentation says.

FossilOrigin-Name: 3efa811251d4510a074231a1e0b667783cc5f90777466b9dcae675cd9892b423

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 agoChange the name of the autoconf-generated configuration file from "config.h"
drh [Tue, 4 Oct 2022 10:35:10 +0000 (10:35 +0000)] 
Change the name of the autoconf-generated configuration file from "config.h"
to "sqlite_cfg.h" to work around a bug in a dependency checker, reported
in [https://twitter.com/josecastillo/status/1577136108097314816|a tweet from Jose Castillo].

FossilOrigin-Name: 897e187cad981126fc5f6ea8e382e937825af10b0c9589b0a23b9fbaa4ca58b8

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 agoAdjust the --help output for speedtest1 to clarify that the argument to
drh [Mon, 3 Oct 2022 15:22:59 +0000 (15:22 +0000)] 
Adjust the --help output for speedtest1 to clarify that the argument to
the --cachesize option is in pages, not bytes.

FossilOrigin-Name: d7c2be6bdc3402e5a339d0f7b76d2c25f3a444dcbf54a77c1ccb790d1195a7cf

2 years agoCopy all of the fiddle-opfs changes to speedtest1 into trunk.
drh [Mon, 3 Oct 2022 13:56:52 +0000 (13:56 +0000)] 
Copy all of the fiddle-opfs changes to speedtest1 into trunk.

FossilOrigin-Name: f3d31c9982cab517a3907a28c571225cee614ee78375c70eb2efb9a2b6b4b042

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 agoAdd the --vfs option to speedtest1.
drh [Mon, 3 Oct 2022 13:45:03 +0000 (13:45 +0000)] 
Add the --vfs option to speedtest1.

FossilOrigin-Name: aeb884029ac1c68f0d7361dda0a545cff19ed265b608c1e329a1926397c5c8a3

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 agoMinor doc typo fix in sqlite.h.in.
stephan [Sun, 2 Oct 2022 20:13:46 +0000 (20:13 +0000)] 
Minor doc typo fix in sqlite.h.in.

FossilOrigin-Name: 372802aaa22a830bf498bb0d9561ae02b32e5e191c4d7d771ea152140f6685a1

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 agoPerformance optimization in sqlite3_prepare() (discovered while working
drh [Sat, 1 Oct 2022 20:27:29 +0000 (20:27 +0000)] 
Performance optimization in sqlite3_prepare() (discovered while working
on the stmt-cache branch).

FossilOrigin-Name: cd494240cc6184bb028d1f1049086f57c0a71a43d7ed1405fd4205240e1b9e61

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