]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoIf a virtual column whose value is constant gets indexed, do not include index-expr-opt
drh [Tue, 18 Oct 2022 22:37:07 +0000 (22:37 +0000)] 
If a virtual column whose value is constant gets indexed, do not include
that column in the IndexedExpr list.
dbsqlfuzz 59ac17a99b9a5c4930ee71cc153c9428a0c0e794

FossilOrigin-Name: c21eb903f06a16d4fafa5f895be08414fa58e6a91c148030aec8676b40c2d66d

2 years agoImproved byte-code comments for the OP_Column opcodes used by the
drh [Tue, 18 Oct 2022 20:27:02 +0000 (20:27 +0000)] 
Improved byte-code comments for the OP_Column opcodes used by the
indexed expression optimization.

FossilOrigin-Name: bf6d837fddbf74d5b3f40ad01ea4564edfac00b651d6f3f0e996cc5dc18bb06c

2 years agoFix the indexed expression resolver for generated columns so that it picks
drh [Tue, 18 Oct 2022 16:47:41 +0000 (16:47 +0000)] 
Fix the indexed expression resolver for generated columns so that it picks
the correct table in a self-join.

FossilOrigin-Name: 54c3eb085aca92da2b819f3532ee4750b377265f7e1e914600ea3c3d535efe51

2 years agoMerge recent trunk fixes into the index-expr-opt branch.
drh [Tue, 18 Oct 2022 16:32:22 +0000 (16:32 +0000)] 
Merge recent trunk fixes into the index-expr-opt branch.

FossilOrigin-Name: 6198ab4b871c464448ae303072bde0a810cac566a516cc29b1bf806fbd0a6c7b

2 years agoAdd new test file windowE.test, to test the window functions modules response to...
dan [Tue, 18 Oct 2022 15:02:08 +0000 (15:02 +0000)] 
Add new test file windowE.test, to test the window functions modules response to an inconsistent collation sequence.

FossilOrigin-Name: 740a2eb0928d54fdf735a8e573c6a61a34dbd295b46e5b6ef39e957fd2623293

2 years agoCorrect sort order for serial-type 10 entries in the database file. This
drh [Tue, 18 Oct 2022 13:27:31 +0000 (13:27 +0000)] 
Correct sort order for serial-type 10 entries in the database file.  This
is a continuation of [4fb77e96fa89a23a].

FossilOrigin-Name: 904b54625d985e742888e06ba792cab316b9ec9d6669d9cf509bac48030373ca

2 years agoMerge trunk fixes into the index-expr-opt branch.
drh [Tue, 18 Oct 2022 11:28:33 +0000 (11:28 +0000)] 
Merge trunk fixes into the index-expr-opt branch.

FossilOrigin-Name: c7b9cc645b394a1b638a9a13ca83d321215aaa78d69ca70c6baa0ee692ed21bf

2 years agoFix sqlite3VdbeRecordCompareWithSkip() so that it sorts the internal-use
drh [Tue, 18 Oct 2022 10:27:06 +0000 (10:27 +0000)] 
Fix sqlite3VdbeRecordCompareWithSkip() so that it sorts the internal-use
serial-type of 10 together with NULLs.
dbsqlfuzz 5ff35e9d49a5fcca5051e23960ff2f483a538bab

FossilOrigin-Name: 4fb77e96fa89a23a9365320c4190834edd6c09cfaf1ca30b34ce19b747ebbec0

2 years agoAdd ext/wasm/README-dist.txt, intended to have been in the previous checkin.
stephan [Mon, 17 Oct 2022 17:36:11 +0000 (17:36 +0000)] 
Add ext/wasm/README-dist.txt, intended to have been in the previous checkin.

FossilOrigin-Name: c9080b6505b839cc0bb5bd25ce7df0daa91a0a303d037ffe6e77888c8584b932

2 years agoInitial draft of archive generation for the wasm/js deliverables.
stephan [Mon, 17 Oct 2022 17:34:41 +0000 (17:34 +0000)] 
Initial draft of archive generation for the wasm/js deliverables.

FossilOrigin-Name: f6cee114c71e11ca1f508c8f60be5753871cbd4fd6c45ce397824bddbf00ffd9

2 years agoRepair version-info.c after a local mishap caused all of the intended edits from...
stephan [Mon, 17 Oct 2022 16:47:59 +0000 (16:47 +0000)] 
Repair version-info.c after a local mishap caused all of the intended edits from [36e197cb3d0c]/[e9b407a4d0a0] to get deleted before checkin. Simplify version-info build (only requires sqlite3.h, not the library).

FossilOrigin-Name: 6e511df500c63e27f932be9d601b641144562614dead99371477eca4594fb3fd

2 years agoMerge trunk changes into the index-expr-opt branch.
drh [Mon, 17 Oct 2022 16:31:55 +0000 (16:31 +0000)] 
Merge trunk changes into the index-expr-opt branch.

FossilOrigin-Name: a1485ce6c8374135290eb0a1e4eb4e225497ad7096847a4e2377c9c054946ca7

2 years agoFix a potential call to strlen() with a null argument in the command-line shell
drh [Mon, 17 Oct 2022 16:09:33 +0000 (16:09 +0000)] 
Fix a potential call to strlen() with a null argument in the command-line shell
following an OOM error. [forum:/forumpost/9c4f2ebe22|forum post 9c4f2ebe22].

FossilOrigin-Name: b6413a6dff8ac9b7088b1381afbbbf799e376455d11786530cc5fc825747ab53

2 years agoMissing file-rename for the previous checkin.
stephan [Mon, 17 Oct 2022 15:53:16 +0000 (15:53 +0000)] 
Missing file-rename for the previous checkin.

FossilOrigin-Name: e9b407a4d0a0fcd9f26d457beede19d41141327befe84be621681952be5d1e69

2 years agoRework ext/wasm/version-info.c to make it more useful for the upcoming dist build...
stephan [Mon, 17 Oct 2022 15:52:12 +0000 (15:52 +0000)] 
Rework ext/wasm/version-info.c to make it more useful for the upcoming dist build rules.

FossilOrigin-Name: 36e197cb3d0cbb76e4c1381d77f7d8856e7391f2ef6671c13b9b6b0133315814

2 years agoImproved comments and function names. No logic changes.
drh [Mon, 17 Oct 2022 14:46:39 +0000 (14:46 +0000)] 
Improved comments and function names.  No logic changes.

FossilOrigin-Name: 8f460b3b15bf4b88a224907d2f83e4ed6bf84d6b3f480008a1b187ea49c6ce1d

2 years agoGet the indexed expression optimization working for virtual generated columns.
drh [Mon, 17 Oct 2022 14:30:01 +0000 (14:30 +0000)] 
Get the indexed expression optimization working for virtual generated columns.

FossilOrigin-Name: 8a510cb0880349370ad19b0852f270ca072bff7871f0dc272964af31c32a7c37

2 years agoMerge trunk enhancements into index-expr-opt branch.
drh [Mon, 17 Oct 2022 14:29:04 +0000 (14:29 +0000)] 
Merge trunk enhancements into index-expr-opt branch.

FossilOrigin-Name: 56ef97e64efb84176df570819474901d492209ff80ce4355ff896dea9d2b8a51

2 years agoMake use of alloca() in wherePathSolver() when SQLITE_USE_ALLOCA is defined.
drh [Mon, 17 Oct 2022 10:15:41 +0000 (10:15 +0000)] 
Make use of alloca() in wherePathSolver() when SQLITE_USE_ALLOCA is defined.

FossilOrigin-Name: 45752471521f8d4a6cad4bce40f907018acd403ffd3b8170020c34e4e0b6b91b

2 years agoRemove a use of alloca() that does more harm than good.
drh [Mon, 17 Oct 2022 09:56:51 +0000 (09:56 +0000)] 
Remove a use of alloca() that does more harm than good.

FossilOrigin-Name: 2ab3cf4d71b23a4c0b69f977828d82df7bbc080c29ae189e0d78d38efee50c96

2 years agoTypo fix.
stephan [Sun, 16 Oct 2022 23:33:24 +0000 (23:33 +0000)] 
Typo fix.

FossilOrigin-Name: 650126c92aa191d6361a32ec90ca7def60a2df22ba6bec1d2354692fe3504423

2 years agoMinor tweak to get bring an edge case of oo1.DB.createFunction() into aggreement...
stephan [Sun, 16 Oct 2022 18:57:15 +0000 (18:57 +0000)] 
Minor tweak to get bring an edge case of oo1.DB.createFunction() into aggreement with its docs.

FossilOrigin-Name: 8d59ccd9f357fbed0b0790508ca9027194fc4b0131029f9f460c7b4bde806a5f

2 years agoAdd aggregate function support to sqlite3.oo1.DB.createFunction(). Change signature...
stephan [Sun, 16 Oct 2022 18:50:55 +0000 (18:50 +0000)] 
Add aggregate function support to sqlite3.oo1.DB.createFunction(). Change signature of the options object used by that function so that the callback property names match those of the corresponding C APIs.

FossilOrigin-Name: a7db6e4b50beebfb1c97e0c4de49538d8199c166b18a0b1b175736c593128a00

2 years agoJS: add build-time-generated version info to the sqlite3.version object. Remove some...
stephan [Sun, 16 Oct 2022 16:38:15 +0000 (16:38 +0000)] 
JS: add build-time-generated version info to the sqlite3.version object. Remove some stray debug output from tester1.js.

FossilOrigin-Name: b5f462c2d85d503f6492ec20580d57cb4c926712f6306a6be764bd09d1f5e8b8

2 years agoAdd a top-level license and build-time version info header to generated sqlite3*...
stephan [Sun, 16 Oct 2022 15:38:03 +0000 (15:38 +0000)] 
Add a top-level license and build-time version info header to generated sqlite3*.js. Correct a broken link in ext/wasm/index.html.

FossilOrigin-Name: 0f1a06e8e39a1fbc74f1aff9cc59787282dfbf847d6c5c7edb3f7d410db0e4b7

2 years agoEnable the index-on-expression optimization even when the expression is
drh [Sat, 15 Oct 2022 12:01:40 +0000 (12:01 +0000)] 
Enable the index-on-expression optimization even when the expression is
used as an argument to an aggregate function.

FossilOrigin-Name: 462b3c7f39724dc814f55e7a225e7d0c48f81c524cdda797a66e9e198c35ce58

2 years agoOnly extract an expression from an index when the index is not a null row
drh [Sat, 15 Oct 2022 11:27:01 +0000 (11:27 +0000)] 
Only extract an expression from an index when the index is not a null row
in an outer join.

FossilOrigin-Name: 08b033c737d1a84859291f50e2985c9dad8d660a50185d55d3171165a8e08d4c

2 years agoMerge fixes from trunk.
drh [Fri, 14 Oct 2022 19:56:58 +0000 (19:56 +0000)] 
Merge fixes from trunk.

FossilOrigin-Name: 1cb65f36c3539302767f551ed53082f054666a7cb2696cef0990ab6747edbc52

2 years agoFix a problem with using the push-down optimization on compound SELECTs where compone...
dan [Fri, 14 Oct 2022 19:30:34 +0000 (19:30 +0000)] 
Fix a problem with using the push-down optimization on compound SELECTs where component SELECTs use different collation sequences. dbsqlfuzz 11516f050100243e5a845f5a2b48a90ed2efaf2e.

FossilOrigin-Name: ed14863dd72e35fa3a23320c3d5a8166515faea39a555c28a27b2d35e701eac4

2 years agoAdd missing initializer from the extension loader. Fix for
drh [Fri, 14 Oct 2022 19:21:12 +0000 (19:21 +0000)] 
Add missing initializer from the extension loader.  Fix for
check-in [d6d449978245b4fa].

FossilOrigin-Name: 565d74c36f2dd4612860c7ee561682c50db28cfa5384346528292019dbfdf86c

2 years agoGeneric minor cleanups and docs in the OPFS async proxy.
stephan [Fri, 14 Oct 2022 15:52:29 +0000 (15:52 +0000)] 
Generic minor cleanups and docs in the OPFS async proxy.

FossilOrigin-Name: a4423ca234453c14eb40db7fe5943f63b30fd9dc2207388e8a2966733a004e9d

2 years agoFix a problem in the LIKE and GLOB operators that may occur when the character immedi...
dan [Fri, 14 Oct 2022 15:10:36 +0000 (15:10 +0000)] 
Fix a problem in the LIKE and GLOB operators that may occur when the character immediately following a "%" or "*" wildcard is U+80. Reported by [forum:61bf7ccbdf].

FossilOrigin-Name: 2da677c45b643482eec39e4db7079c772760bc966dc71bf6c01658cc468f5823

2 years agoRemove a resolved TODO comment.
stephan [Fri, 14 Oct 2022 13:26:18 +0000 (13:26 +0000)] 
Remove a resolved TODO comment.

FossilOrigin-Name: 32fd4ac382f774189ac34f6fff80e55e6e56dd2aa67b0db88d5a88324f17f6ff

2 years agoCancel IndexExpr objects when they go out of scope.
drh [Fri, 14 Oct 2022 02:00:54 +0000 (02:00 +0000)] 
Cancel IndexExpr objects when they go out of scope.

FossilOrigin-Name: 0963519371bb7ac02adb323430855760fb9b82a23745e47c504aaf393d22ac34

2 years agoThis experimental branch attempts to use columns for an index-on-expression
drh [Thu, 13 Oct 2022 21:08:34 +0000 (21:08 +0000)] 
This experimental branch attempts to use columns for an index-on-expression
in place of the expression that is being indexed.  This particular check-in
mostly works, but there are still issues.

FossilOrigin-Name: 2e8d4fd4cfd9e82f33c707ba246fe2bb3ca01762cf5ac5905058fbc7adf0abe7

2 years agoMove the rest of testing1.js into tester1.js and eliminate the dependency on jaccwaby...
stephan [Thu, 13 Oct 2022 16:48:35 +0000 (16:48 +0000)] 
Move the rest of testing1.js into tester1.js and eliminate the dependency on jaccwabyt_test.c. Extend the list of default config-related #defines in sqlite3-wasm.c and reorganize them for maintainability.

FossilOrigin-Name: 4e2a8aff2dd4b6e148f45184e2523ebe47815257eca97fa3d32bcbf9625f0def

2 years agoOptimize the IS NULL and IS NOT NULL operators so that they avoid loading
drh [Thu, 13 Oct 2022 15:09:44 +0000 (15:09 +0000)] 
Optimize the IS NULL and IS NOT NULL operators so that they avoid loading
large strings or blobs off of disk if all it needs to know is whether or
not the string or blob is NULL.

FossilOrigin-Name: cb94350185f555c333b628ee846c47bcc9df5f76bb82de569b8322f30dbbe1bc

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 agoFix a typo in the documentation of the OP_Column opcode.
drh [Thu, 13 Oct 2022 14:01:11 +0000 (14:01 +0000)] 
Fix a typo in the documentation of the OP_Column opcode.
[forum:/forumpost/a2b5bd6d43|Forum post a2b5bd6d43].

FossilOrigin-Name: 043e76e6166da5cf8e213cce46aaccb1f910e1fdbdb5556576eafb81b3bc5faa

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 agoPort the first 180-odd unit tests from testing1.* into the new tester1.*. Fix a stray...
stephan [Thu, 13 Oct 2022 08:03:31 +0000 (08:03 +0000)] 
Port the first 180-odd unit tests from testing1.* into the new tester1.*. Fix a stray-keystroke-induced typo which broke pstack.allocChunks().

FossilOrigin-Name: ef689e33e464829f5cbe4ca24a53d9dba59abe74d3d80a37a91b93a4eccccf2d

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