]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoClean up some JS documentation.
stephan [Thu, 15 Sep 2022 02:27:48 +0000 (02:27 +0000)] 
Clean up some JS documentation.

FossilOrigin-Name: 925fdbfc6c1f9f06951346bc0d4fb81ffb5797d5f1123728931973f6cb1a0efa

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

FossilOrigin-Name: 0d78961870ee9f22f1ba16d423377d28dcc36e04b1e31ffd57f3e2fd51f8f0f2

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

FossilOrigin-Name: 333a45725d1708e0fefa559c33ce1c7eeb425cdb04f594b1f2b48166c1478c79

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

FossilOrigin-Name: 8b1608a9a37131121cb3a0cb1e8dbad5e39dc1fc2a341d056f09537f179b2e7a

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

FossilOrigin-Name: 878cc93e779c3857adc711f212520f007256274fcd3f6f3d72c754a937fcd198

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

FossilOrigin-Name: e393ed650ef124143f84e9d787fb996e308dd7af6b8f50df72a6f085b67bf9c3

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

FossilOrigin-Name: 6fc8d34c0ae1f8277544be741f2f0835fad8e475d35bd24573224ccc1699b8bd

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

FossilOrigin-Name: d845c6c22bd5d3fffc66e0566df346d690dd8bd1fc1688e312161b1a1edcfd79

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

FossilOrigin-Name: 3354a2edb762d70ccc31d4d25f81b70e644d76e01cb1e81d2e97b5414d809d30

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

FossilOrigin-Name: a7d8b26acd3c1ae344369e4d70804c0cab45272c0983cfd32d616a0a7b28acb9

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

FossilOrigin-Name: e49682c5eac91958f143e639c5656ca54560d14f5805d514bf4aa0c206e63844

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

FossilOrigin-Name: 250a935aeb94d3fadec0d3fe22de85de4e658e2fdb3be3aa9a8bbc8f7b7d8414

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

FossilOrigin-Name: 0adf158f4e5791339988185cc29347c75056b062e0db65b5999fdfa1f433c1ed

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

FossilOrigin-Name: 1a2f24a0bdfc6eaae478916b8f4f9c6b63ead9964534fc2951fb4e995ffe61f1

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

FossilOrigin-Name: 4e6ce329872eb733ba2f7f7879747c52761ae97790fd8ed169a25a79854cc3d9

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

FossilOrigin-Name: cdbf09fa1b0c93aeb3222a157de33a4688ae629c2b829ffff0f1f62364c5ae1c

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

FossilOrigin-Name: 53b7572e441be4b4b29b4228d0f95b24457d7faaf6c0b568ed5c970a55e21ffb

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

FossilOrigin-Name: 06610314fcf644f323c2f7ae11d7f4349b195e66d0ebbee590438dd99d97eb96

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

FossilOrigin-Name: a4bd96f5348e607d0fcb627b751f9d86a188173a4b3bfb2c95f92913a78bd31e

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

FossilOrigin-Name: 8e1652a3856765c9146cc2a7e3b598a2dc7dc84c556b35eab9a35184514384b9

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

FossilOrigin-Name: f6632e69c2ec1a7ddc4e51f3567e3bc082ee94a6dd51fdafdc0c3bf386a32d4c

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

FossilOrigin-Name: c8e41279294ea7c2f041c7d4cbbd85fce47d55f2f56180ca837316f7dfd75237

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

FossilOrigin-Name: 74fbf6c2a97729e481d5562344e960d0c237aeb1f07240262d32a24fb1f4b5a3

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

FossilOrigin-Name: 00845ac9ef2616e90f5f6a20da3dd040fa8bdcfe73f72fe9c06039561150a82d

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

FossilOrigin-Name: 757ad69607201a26802a304839b8454b1634712458539d6aa8cf999ab2447e59

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

FossilOrigin-Name: 02709ee2beab36d144b807fd9ffaee639e3c1bdd1908a34e05f3fd23dad2ef66

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

FossilOrigin-Name: f2846dcbcaac7880394fb14597c3a60ed310419128c4c5b863cd771a7e5cdeb5

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

FossilOrigin-Name: 51395c005da46b7fa5a5f28809dd8fea263a6bac2b1492759b3d5a5aa7d399ca

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

FossilOrigin-Name: 5240fb4d795dea826f23cf5d2152b519f5a46f49bb2499ea868fa7c7f4ce788b

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

FossilOrigin-Name: 45ef576b2ee6369ab1e3aa2ad284764bb334f92a69a33d88b7292bbc0a1b1fda

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

FossilOrigin-Name: 2e38726f46918b28b5c638967f960a20afd3fe84ad245f3bea39a1d64980435b

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

FossilOrigin-Name: a329939c32e33d8d00066ba3d4327f07cca1b4e67de0b8d85f1e7f98afe40954

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

FossilOrigin-Name: 51e267696d25f2f83b5bb847d5254ab15573ef1a16ea3d7dd8279c73c0bee539

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

FossilOrigin-Name: f16c68ee6d5ebb8dec2ab656dbab2ddb5f1d5133153ad553f986b31020adaa38

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

FossilOrigin-Name: f9c89ee8d5ef46342bea78fa8d4da058d9ea628183ec985642bbda1cdfeacd5f

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

FossilOrigin-Name: 5ea0623630d769a8f3f07a40cd119be86b631192cdb5178131876b01b40ee5e0

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

FossilOrigin-Name: 40e60f570d4f489d58d12e27c1c067b41d6c5a5e374c5fce0baa8881ef183216

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

FossilOrigin-Name: 4441535e3e54dc1881f700fa3878964eb8554a6790fd6aa32945f7cc104a8467

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

FossilOrigin-Name: 09796cc2bfce7bc4ce11db9673d20737259e9928f0484660cba3a9751f7d01c5

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

FossilOrigin-Name: 7f76eaec793720db87415a476ddf539bc4dea3e74c8e5406d6739206aebdacc2

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

FossilOrigin-Name: 6b00ecb59fd303f7985902c35a46db9e729201d4beaedea46596b728d9e4b1c8

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

FossilOrigin-Name: 82b89f8a074858a81d841dfc26436e8d39ce4907b8f989eba4d848db16758303

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

FossilOrigin-Name: b1e37a0bd31fa9f8e58c2859a80c23a682b4702eefab2c55b243f1e21d475d6c

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

FossilOrigin-Name: f74a5ea8c986dc33d3afcda169c38abbe55728c56716cf9991a5e2ef7fc4917a

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

FossilOrigin-Name: 4488cb5798f34cbba14eb8e2aa5da8420c14a85d37d278d357406aedd5c3a9e5

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

FossilOrigin-Name: 36ceef94e1935f5e85f79e489cd0ed265a77820fb68329c190794df5e076bf84

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

FossilOrigin-Name: da7af290960ab8a04a1f55cdc5eeac36b47fa194edf67f0a05daa4b7f2a4071c

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

FossilOrigin-Name: 54251f81ebc43839cc97f91d2df4c320c1b96b5690cc11ce45b60c087c9becd6

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

FossilOrigin-Name: 81cff9f1955874aade55daa94263f58f06d966bd51ad558755f92777069a7347

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

FossilOrigin-Name: aadd38f99a3e5abcf9bef49f4367752f163cc79500a28f812bb71969d7de419c

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

FossilOrigin-Name: 8e6ad3a3e942a326cf16432e16d6596c7206c05b6f45cd0ff3a9b836bcfc9deb

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

FossilOrigin-Name: ebbe9634d6dde9e097f61fb98a79111e46de422b7bbbd9ed3af7b6f22aacf5ec

2 years agoExperimental changes to put sqlite3_temp_directory behind a mutex.
drh [Fri, 2 Sep 2022 00:36:16 +0000 (00:36 +0000)] 
Experimental changes to put sqlite3_temp_directory behind a mutex.

FossilOrigin-Name: 5ee3515fbb88bf1ae5f8b507844f82dcc429380b6ebeab9b09b52b25ee60a60d

2 years agoDefer deleting a transient SELECT statement associated with a flattening
drh [Thu, 1 Sep 2022 13:51:09 +0000 (13:51 +0000)] 
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

2 years agoIn the query planner, add a heuristic that will reduce the cost of a full
drh [Thu, 1 Sep 2022 10:29:02 +0000 (10:29 +0000)] 
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

2 years agoEnhance the b-tree page sorting code to ensure that sqlite3PagerRekey() never
drh [Wed, 31 Aug 2022 15:04:42 +0000 (15:04 +0000)] 
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

2 years agobatch-runner.js: add rudimentary metrics export to CSV. Add a toggle to reverse the...
stephan [Tue, 30 Aug 2022 17:57:50 +0000 (17:57 +0000)] 
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

2 years agoImproved comments in pcache1.c. No changes to code.
drh [Tue, 30 Aug 2022 16:54:41 +0000 (16:54 +0000)] 
Improved comments in pcache1.c.  No changes to code.

FossilOrigin-Name: dd017bb1b3e31c7692d29dc4865d6bda871e429978c8738a39160d0114e5bf9b

2 years agobatch-runner.js: re-enable unlink-before-run so that OPFS speedtest1 batch can work.
stephan [Tue, 30 Aug 2022 10:26:33 +0000 (10:26 +0000)] 
batch-runner.js: re-enable unlink-before-run so that OPFS speedtest1 batch can work.

FossilOrigin-Name: ba08f7a7f12601aa580a8dc493b43cdd5ab65c87d5e4b3fd2f549343e45c2d2a

2 years agobatch-runner.js: move generated SQL files into ./sql and start adding hand-written...
stephan [Tue, 30 Aug 2022 10:04:08 +0000 (10:04 +0000)] 
batch-runner.js: move generated SQL files into ./sql and start adding hand-written ones (like the Mandelbrot) to that set.

FossilOrigin-Name: 06c106a7d23e4486dbed092757b7588688226ad35539ecc31378a8497f59d1ec

2 years agoRemove the .timer script entry from fiddle app because emscripten has removed getrusa...
stephan [Tue, 30 Aug 2022 09:51:24 +0000 (09:51 +0000)] 
Remove the .timer script entry from fiddle app because emscripten has removed getrusage(), which breaks the timer.

FossilOrigin-Name: 9034f19ae50f196cc2b94478edfcc8d765b08bcf383166f6212b3522dea63c01

2 years agowasm util: remove superfluous function.bind() calls to eliminate a level of call...
stephan [Tue, 30 Aug 2022 09:49:30 +0000 (09:49 +0000)] 
wasm util: remove superfluous function.bind() calls to eliminate a level of call() indirection.

FossilOrigin-Name: 1aab9627983ef0f016b01f78564e79cf815ed14d4b1b6dc04ec627b96f1b2f70

2 years agoAny function call can abort. Take this into account when deciding if a DML
drh [Tue, 30 Aug 2022 00:11:51 +0000 (00:11 +0000)] 
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

2 years agoLots of tweaking in batch-runner.js. Minor internal API update in OO #1 API.
stephan [Mon, 29 Aug 2022 18:58:38 +0000 (18:58 +0000)] 
Lots of tweaking in batch-runner.js. Minor internal API update in OO #1 API.

FossilOrigin-Name: 24b82b9504db3d8e1335c2300b133f897dc1a541026dc24be5b0ffd8be66d977

2 years agoAdd test descriptions to the speedtest1 '-- begin' markers for potential display...
stephan [Mon, 29 Aug 2022 17:41:16 +0000 (17:41 +0000)] 
Add test descriptions to the speedtest1 '-- begin' markers for potential display by the downstream JS code which uses those markers.

FossilOrigin-Name: e5b7006f0f57f10a490d7eaeb7df77251a2f684602fed8ff161d8ce60033e7bc

2 years agoAdd batch-runner.js for running batch SQL scripts with timing info.
stephan [Mon, 29 Aug 2022 12:39:34 +0000 (12:39 +0000)] 
Add batch-runner.js for running batch SQL scripts with timing info.

FossilOrigin-Name: 11f3ed61150c5940da6c157e5063e70c3aa0628dfd0023c47bb65b00af74ab1f

2 years agoAdd get/setPtrValue() to the common wasm utils.
stephan [Mon, 29 Aug 2022 12:31:57 +0000 (12:31 +0000)] 
Add get/setPtrValue() to the common wasm utils.

FossilOrigin-Name: 24d70fc458c6002d5ff3c9f8ce7c66bde299b32aca6417c2dd1236e1412b036d

2 years agoAdd begin/end comment markers to the test blocks in speedtest1 --script output to...
stephan [Mon, 29 Aug 2022 09:51:17 +0000 (09:51 +0000)] 
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

2 years agooo #1 api: correct a case where a null callback is called. Rename some vars for clari...
stephan [Mon, 29 Aug 2022 08:04:55 +0000 (08:04 +0000)] 
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

2 years agoMore assert() statements in the page cache.
drh [Sat, 27 Aug 2022 16:11:00 +0000 (16:11 +0000)] 
More assert() statements in the page cache.

FossilOrigin-Name: 7c96a56c0d1de966844da6c5a84c0cd6066130a10724797ce6f228a9182d9b85

2 years agoEnsure that every pcache page always has either the PGHDR_DIRTY or the
drh [Sat, 27 Aug 2022 14:43:34 +0000 (14:43 +0000)] 
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

2 years agoMerge changes from trunk into the fiddle-opfs branch.
stephan [Thu, 25 Aug 2022 19:38:54 +0000 (19:38 +0000)] 
Merge changes from trunk into the fiddle-opfs branch.

FossilOrigin-Name: 34279797be0922b9df05e0d4f327f8582ab25fb6fb21583f8441ddf5deded891

2 years agoEnsure that sqlite3_prepare() inputs always have a semicolon terminator in
drh [Thu, 25 Aug 2022 19:29:35 +0000 (19:29 +0000)] 
Ensure that sqlite3_prepare() inputs always have a semicolon terminator in
speedtest1.

FossilOrigin-Name: c72756b0f2db30c622f00f43be9245d50e36049bd7740ee6332164f0c48f9c3d

2 years agoAdd the --script option to speedtest1.
drh [Thu, 25 Aug 2022 19:19:25 +0000 (19:19 +0000)] 
Add the --script option to speedtest1.

FossilOrigin-Name: 1c87d7c58d5aec83f9e2ae3771a81aa17cfae0cf06169025a5db085e2d5749f9

2 years agoRemove a NEVER() macro for a condition that is actually reachable following an OOM...
dan [Thu, 25 Aug 2022 13:32:55 +0000 (13:32 +0000)] 
Remove a NEVER() macro for a condition that is actually reachable following an OOM. dbsqlfuzz crash-6ef3cd3b18ccc5de86120950a0498641acd90a33.txt.

FossilOrigin-Name: b573e2cffa5fedc893ed30e76e47022b3617ac5583e1eb486afa810b2514c419

2 years agoConsolidate oo1.DB.exec() and oo1.DB.execMulti() into oo1.DB.exec(). This is a bit...
stephan [Thu, 25 Aug 2022 13:27:52 +0000 (13:27 +0000)] 
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

2 years agoRefactor and expand the worker1 docs, consolidating them into the top of their file...
stephan [Thu, 25 Aug 2022 11:39:12 +0000 (11:39 +0000)] 
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

2 years agoChange DB.exec() rowMode default from 'stmt' to 'array', per /chat discussion. Add...
stephan [Wed, 24 Aug 2022 20:57:37 +0000 (20:57 +0000)] 
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

2 years agoExpand the worker1 'exec' op handling for per-row callbacks for API-level consistency...
stephan [Wed, 24 Aug 2022 18:39:46 +0000 (18:39 +0000)] 
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

2 years agoAdd a mutex to the sqlite3_db_config() interface so that it is threadsafe
drh [Wed, 24 Aug 2022 17:59:00 +0000 (17:59 +0000)] 
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

2 years agojs: resolve the mysterious "extra" unhandled exception notification, caused by inadve...
stephan [Wed, 24 Aug 2022 14:50:10 +0000 (14:50 +0000)] 
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

2 years agoFix an inefficiency in the ".dump" command when outputing large blob literals.
dan [Wed, 24 Aug 2022 11:51:31 +0000 (11:51 +0000)] 
Fix an inefficiency in the ".dump" command when outputing large blob literals.

FossilOrigin-Name: c055d05dbdfd4643d5052c6e6a736c78651fdfcd78f15f791af903df3814832d

2 years agoMore work on how to configure the sqlite3 JS API bootstrapping process from higher...
stephan [Wed, 24 Aug 2022 05:59:23 +0000 (05:59 +0000)] 
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

2 years agoThe very basics of a Promise-based proxy for the Worker #1 API. Still requires consid...
stephan [Wed, 24 Aug 2022 00:51:39 +0000 (00:51 +0000)] 
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

2 years agoSignificant restructuring of the Worker #1 request/response object structures to...
stephan [Wed, 24 Aug 2022 00:10:45 +0000 (00:10 +0000)] 
Significant restructuring of the Worker #1 request/response object structures to improve readability and clarity.

FossilOrigin-Name: 03b9db9b98cb36faa7de5a8a64d2e13c4aeaadfefb33ac92bb41056f6be3f121

2 years agoChange the names of the Vdbe.pVNext and Vdbe.ppVPrev fields to make them
drh [Tue, 23 Aug 2022 20:11:01 +0000 (20:11 +0000)] 
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

2 years agoEnhance assert() statements to enforce tighter bounds on the P5 operand of
drh [Tue, 23 Aug 2022 17:51:39 +0000 (17:51 +0000)] 
Enhance assert() statements to enforce tighter bounds on the P5 operand of
the OP_Next and OP_Prev opcodes.

FossilOrigin-Name: 4e0a07fc6f96e6e7726506b7a5ee942461c1381501f253893fa94d76023b634f

2 years agoWasm build flag tweaks and documentation.
stephan [Tue, 23 Aug 2022 17:02:46 +0000 (17:02 +0000)] 
Wasm build flag tweaks and documentation.

FossilOrigin-Name: c8eb3aa8e0f487f14791214caf70d1aa03866e01345c7fa1d5607c24c39dde1d

2 years agoAdd mksourceid binary to the clean rules and $(TESTPROGS) to distclean.
stephan [Tue, 23 Aug 2022 16:55:19 +0000 (16:55 +0000)] 
Add mksourceid binary to the clean rules and $(TESTPROGS) to distclean.

FossilOrigin-Name: ae3e82f5a3332bea261aca6a0dd02063cf7056c023204cc10f1ae18d75249f91

2 years agoMore experimentation with how client-side config state can be passed on to initialize...
stephan [Mon, 22 Aug 2022 21:37:17 +0000 (21:37 +0000)] 
More experimentation with how client-side config state can be passed on to initialize the JS-side sqlite3 API.

FossilOrigin-Name: ea2acc454c012a62556f6d0623d6eff60736d24aa214a64462b423623ef44d47

2 years agoPerformance enhancement for sqlite3DbFree().
drh [Mon, 22 Aug 2022 15:18:37 +0000 (15:18 +0000)] 
Performance enhancement for sqlite3DbFree().

FossilOrigin-Name: c296a9d958ec360fc8d217363348b4918d665bccb3c4f27503a2dcef7db49052

2 years agoMerge in trunk.
stephan [Mon, 22 Aug 2022 14:03:11 +0000 (14:03 +0000)] 
Merge in trunk.

FossilOrigin-Name: e215d55a97e1ccbca3101621374444d2381d87ef8e8fde5271e31c8b714e43e9

2 years agoRefactor JS API amalgamation such that the bootstrapping/configuration is deferred...
stephan [Mon, 22 Aug 2022 13:34:13 +0000 (13:34 +0000)] 
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

2 years agowasm: accommodated a JS API rename.
stephan [Mon, 22 Aug 2022 08:55:10 +0000 (08:55 +0000)] 
wasm: accommodated a JS API rename.

FossilOrigin-Name: 00991335c4dae56232e999398e5e82d8161903ba7d084b16a73a150e83f1f782

2 years agoAdd the new internal interface sqlite3DbNNFreeNN(db,ptr) where both the
drh [Mon, 22 Aug 2022 02:00:26 +0000 (02:00 +0000)] 
Add the new internal interface sqlite3DbNNFreeNN(db,ptr) where both the
db and ptr parameters are guaranteed to be non-NULL.  Use this where
appropriate to save more than 2 million CPU cycles on the standard
performance test.

FossilOrigin-Name: e5eaa80e81fdf86f2875a912b880272b8d099b82b08e945a7988c5dd0fe9d6b5

2 years agoMerge the test case for dbsqlfuzz 18fe4e257be7fa3ecfb0424ab7427e41e97ef9e3
drh [Sat, 20 Aug 2022 19:45:41 +0000 (19:45 +0000)] 
Merge the test case for dbsqlfuzz 18fe4e257be7fa3ecfb0424ab7427e41e97ef9e3
assertion fault, which is fixed with the previous check-in.

FossilOrigin-Name: 2d13ec086e96a5446462ce0f689c40c8196e740cd693f5967bfe9eb961f03463

2 years agoEnhance the enforcement of SQLITE_VTAB_DIRECTONLY so that it applies to
drh [Sat, 20 Aug 2022 19:33:04 +0000 (19:33 +0000)] 
Enhance the enforcement of SQLITE_VTAB_DIRECTONLY so that it applies to
DML statements within triggers.  Do not allow DML stratements against
virtual tables within triggers unless either the virtual table is
SQLITE_VTAB_INNOCUOUS or PRAGMA trusted_schema is ON.

FossilOrigin-Name: 9433ea4070f52135be64569057f439e7bdb4b3f425d87167c9ebda50011210c1

2 years agoAdd test case for fuzzer case crash-18fe4e. crash-18fe4e
dan [Fri, 19 Aug 2022 20:10:51 +0000 (20:10 +0000)] 
Add test case for fuzzer case crash-18fe4e.

FossilOrigin-Name: 8372468bb5d8922cf20b8bbee34cfd6044ceb09c26a4efa79a5e6df2c7c4b730

2 years agoAdd notes to ext/wasm/README.md explaining how to run tests on a remote
drh [Thu, 18 Aug 2022 15:53:27 +0000 (15:53 +0000)] 
Add notes to ext/wasm/README.md explaining how to run tests on a remote
machine.

FossilOrigin-Name: 7a3c444fb515413254b426908e4d3528ccc664a629628c23b7b85bd21c060d0e

2 years agojavascript: rename and simplify DB.callInTransaction() as DB.transaction(). Add DB...
stephan [Thu, 18 Aug 2022 12:21:58 +0000 (12:21 +0000)] 
javascript: rename and simplify DB.callInTransaction() as DB.transaction(). Add DB.savepoint(), which works the same as transaction() but uses savepoints. Correct concatenation of arguments to SQLite3Error to use spaces instead of commas. Test that demo-oo1.js works with persistent OPFS storage (output differs due to persistent rows, but the demo works).

FossilOrigin-Name: e8c323f12b6223bc9dcbbec40698969c7917128aa50cf599c247df23f607ae61