]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoRemove an undefined left-shift operation from the recover extension. recover-extension 7/head
dan [Wed, 26 Oct 2022 18:29:19 +0000 (18:29 +0000)] 
Remove an undefined left-shift operation from the recover extension.

FossilOrigin-Name: a67082357a2cc348faf8236aafa7f39eb5cb673b1d114a594c6d5bb257f85b73

2 years agoMerge further changes from trunk, including fix to dbdata.c.
dan [Wed, 26 Oct 2022 18:22:22 +0000 (18:22 +0000)] 
Merge further changes from trunk, including fix to dbdata.c.

FossilOrigin-Name: bcf6b48d52c1ce656899f50bd508c0920cae8cf2ef3c0758a7633981f0f0f484

2 years agoMake the shell .recover command and the dbdata.c module more robust in the face of...
dan [Wed, 26 Oct 2022 18:04:34 +0000 (18:04 +0000)] 
Make the shell .recover command and the dbdata.c module more robust in the face of corrupted databases.

FossilOrigin-Name: 4eef562a00ae988f2426c9af51f4165c0e4cbccd601061664a0c54c19b9cc70f

2 years agoCorrect misuse of localhost-mode-only symbol S in fiddle-worker.js, which should...
stephan [Wed, 26 Oct 2022 15:40:17 +0000 (15:40 +0000)] 
Correct misuse of localhost-mode-only symbol S in fiddle-worker.js, which should fix the outage reported in [forum:67d985ac0bbe407f|forum post 67d985ac0bbe407f].

FossilOrigin-Name: 3b5aa50c223ac35c7d73e4629420a01408cd74d19ae5b887f91b7a657d91e026

2 years agoCorrected link to fiddle in ext/wasm/index.html (broken by [3d7b4f36b7dd]).
stephan [Wed, 26 Oct 2022 15:34:51 +0000 (15:34 +0000)] 
Corrected link to fiddle in ext/wasm/index.html (broken by [3d7b4f36b7dd]).

FossilOrigin-Name: 6efa0bae1678bf719a0693feeceb4c1e252fc86502bee9ee2a6d8af9a91d9b20

2 years agoReplace the newly-removed oo1.DB.getFilename() with DB.dbFilename() with the hope...
stephan [Wed, 26 Oct 2022 11:27:33 +0000 (11:27 +0000)] 
Replace the newly-removed oo1.DB.getFilename() with DB.dbFilename() with the hope that the distinction from the dbInstance.filename property is clearer.

FossilOrigin-Name: 0b80543d75504c733b73b32f73b96074a4b0cebad64e47032926a3fefee41726

2 years agoRemove oo1.DB.hasFilename() and getFilename(), as they are unnecessary.
stephan [Wed, 26 Oct 2022 11:12:14 +0000 (11:12 +0000)] 
Remove oo1.DB.hasFilename() and getFilename(), as they are unnecessary.

FossilOrigin-Name: 75c546b982024bf2b527c85271111d54158cb010867f6e29fc89e86cc8457cc5

2 years agoRemove the sqlite3StdTypeMap global constant that was made
drh [Wed, 26 Oct 2022 11:11:31 +0000 (11:11 +0000)] 
Remove the sqlite3StdTypeMap global constant that was made
obsolete by [aa6e908619624867].

FossilOrigin-Name: 3dfdfb3f12edb3f4267942598efd05d573e13b7c5d6cdbc3404373f41b8993dd

2 years agoAdd --download-version flag to ext/wasm/version-info.c and correct dist target's...
stephan [Wed, 26 Oct 2022 06:05:44 +0000 (06:05 +0000)] 
Add --download-version flag to ext/wasm/version-info.c and correct dist target's output version format to match.

FossilOrigin-Name: 6f2a40d06dd9a56491d27928ed3785e08308c7dcea2b3f768097fc98ba91a910

2 years agoAdd doc page link to the wasm dist README.txt.
stephan [Tue, 25 Oct 2022 16:57:42 +0000 (16:57 +0000)] 
Add doc page link to the wasm dist README.txt.

FossilOrigin-Name: c2380668d9a2ad04f6f27ef052190bda17cdb112895e93b94ae1da70db6983c8

2 years agoCorrect -O level for fiddle build when built from the top-most directory (-Os instead...
stephan [Tue, 25 Oct 2022 16:04:44 +0000 (16:04 +0000)] 
Correct -O level for fiddle build when built from the top-most directory (-Os instead of -O0).

FossilOrigin-Name: ff4fc29c38b78dfd471e25942304cba352469d6018f1c09158172795dbdd438c

2 years agoRename fiddle.html to index.html and move fiddle push-to-server rules from GNUmakefil...
stephan [Tue, 25 Oct 2022 15:59:27 +0000 (15:59 +0000)] 
Rename fiddle.html to index.html and move fiddle push-to-server rules from GNUmakefile into fiddle.make.

FossilOrigin-Name: 3d7b4f36b7dd01058d57fc8ef7689d9bbf1a219166796ed427180cd59d2c189d

2 years agospeedtest1: use the current (or default) vfs->xDelete method to unlink the db. This...
stephan [Tue, 25 Oct 2022 15:38:38 +0000 (15:38 +0000)] 
speedtest1: use the current (or default) vfs->xDelete method to unlink the db. This is specifically necessary when running the opfs vfs in a wasm build of speedtest1. This worked without this fix until recently because the affected test code was performing similar acrobatics in its stead.

FossilOrigin-Name: d3c830bd37a402161b486d3631feceae5d00f89c2522aed65fcd2e666bd64238

2 years agoEnhance the sqlite3_strglob() and sqlite3_strlike() interfaces so that they
drh [Tue, 25 Oct 2022 13:44:18 +0000 (13:44 +0000)] 
Enhance the sqlite3_strglob() and sqlite3_strlike() interfaces so that they
will do sensible things with NULL string pointers.  This is an extra layer
of defense against bugs such as reported by
[forum:/forumpost/730b554179|forum post 730b554179].

FossilOrigin-Name: 8ba9c884bded52e3e044ff39c826c04838e7c31f05d802f4a14d9ce5a01ab721

2 years agoMake the ".dump" command of the CLI more robust against malformed databases.
drh [Tue, 25 Oct 2022 13:42:10 +0000 (13:42 +0000)] 
Make the ".dump" command of the CLI more robust against malformed databases.
See [forum:/forumpost/730b554179|forum post 730b554179].

FossilOrigin-Name: 0573edfb9e0b1fd51e8da20592c71b02040968c33fdec41c31a6b1b7d3e83262

2 years agoMerge latest trunk changes with this branch.
dan [Tue, 25 Oct 2022 11:05:31 +0000 (11:05 +0000)] 
Merge latest trunk changes with this branch.

FossilOrigin-Name: 757e3f585959f4f113fee48fe3d504f037604c53a95c8d47ce5c2bccfb2af8ff

2 years agoMinor doc tweaks in the JS GNUmakefile.
stephan [Tue, 25 Oct 2022 08:41:00 +0000 (08:41 +0000)] 
Minor doc tweaks in the JS GNUmakefile.

FossilOrigin-Name: 9c8df130b8137cb4705f805907d1ff754d7f4b07bf181e1d05f1798b7aa5f4f6

2 years agoRemove persistence from the 'reverse log order?' checkbox in tester1.js to eliminate...
stephan [Tue, 25 Oct 2022 08:15:57 +0000 (08:15 +0000)] 
Remove persistence from the 'reverse log order?' checkbox in tester1.js to eliminate an inconsistency between the main-thread and worker-thread modes (the latter having no option for persistence of that setting).

FossilOrigin-Name: ecf906b07f50b4fcc551d20326a1bb1189bd6c2274627fd293f9460658ebea07

2 years agoMinor cleanups and doc improvements in the OPFS sqlite3_vfs proxy.
stephan [Tue, 25 Oct 2022 08:06:17 +0000 (08:06 +0000)] 
Minor cleanups and doc improvements in the OPFS sqlite3_vfs proxy.

FossilOrigin-Name: 48645f7bcacf81c4149f26d20ee1752fbe93a02f96b85bd7e28bfa49322137e5

2 years agoFix typo in comment.
drh [Mon, 24 Oct 2022 18:42:45 +0000 (18:42 +0000)] 
Fix typo in comment.

FossilOrigin-Name: f65c95658fe4d30817da8de7eb88e823ea1cd8be40e347d626870bad3cc13359

2 years agoAdd a comment to a previously undescribed member of the Walker union.
drh [Mon, 24 Oct 2022 18:33:50 +0000 (18:33 +0000)] 
Add a comment to a previously undescribed member of the Walker union.

FossilOrigin-Name: 69d704224e9ed022fcec591beff2ffcc4daf3e7fc586debfdcf00b25c1fddd87

2 years agoUse the same "PRAGMA synchronous" setting for the output of a "VACUUM INTO" as are...
dan [Mon, 24 Oct 2022 15:51:24 +0000 (15:51 +0000)] 
Use the same "PRAGMA synchronous" setting for the output of a "VACUUM INTO" as are configured for the database being vacuumed.

FossilOrigin-Name: 86cb21ca12581cae9a29f42ba707bd9d789e667e5ddc0f64b24940d5d5c9a118

2 years agoImprove the ability of the query planner to recognize covering indexes even
drh [Mon, 24 Oct 2022 13:20:48 +0000 (13:20 +0000)] 
Improve the ability of the query planner to recognize covering indexes even
on tables with more than 63 columns and where the index is over columns
beyond the 63rd column.

FossilOrigin-Name: f058773e41495ddbae698f9e9a4f62b7003112ea8614dfad69471340058735e4

2 years agoUpdate the fuzzinvariant logic in fuzzcheck to the latest code from
drh [Mon, 24 Oct 2022 12:38:32 +0000 (12:38 +0000)] 
Update the fuzzinvariant logic in fuzzcheck to the latest code from
dbsqlfuzz.

FossilOrigin-Name: 739ad584765f1fc0eb196db870785da1726805cc2d9dd0a831a37a9e55a4afe9

2 years agoFix built-in documentation for the ".mode qbox" command in the CLI.
drh [Mon, 24 Oct 2022 11:10:40 +0000 (11:10 +0000)] 
Fix built-in documentation for the ".mode qbox" command in the CLI.

FossilOrigin-Name: 3d7ea33be1076fd21681bdcff0c489646c017594b42b4a21a74e9e2d3947890b

2 years agoTest cases for covering indexes on wide tables. covering-index-enh
drh [Mon, 24 Oct 2022 11:02:02 +0000 (11:02 +0000)] 
Test cases for covering indexes on wide tables.

FossilOrigin-Name: 64c3777eb356b15094a9e9fcc135499ba22f4d847fb117afa6ccf19986e33585

2 years agoThe wide-table covering index detection must take into account aggregate
drh [Sun, 23 Oct 2022 20:09:13 +0000 (20:09 +0000)] 
The wide-table covering index detection must take into account aggregate
queries.

FossilOrigin-Name: 9ac73f83c53b9fba10bb1b8bbfd1a8dc8a2dc4a655e811d5b96335dbf2b6fdac

2 years agoMore frequently send the complete SELECT statement into sqlite3WhereBegin()
drh [Sat, 22 Oct 2022 23:09:29 +0000 (23:09 +0000)] 
More frequently send the complete SELECT statement into sqlite3WhereBegin()
so that it can more accurately determine index coverage.

FossilOrigin-Name: f6d09c5a0df940dbaa716df70df28218985b83540b34c468989729a3421ef38c

2 years agoEnhance the query planner with the ability to discern when an index is
drh [Sat, 22 Oct 2022 20:13:46 +0000 (20:13 +0000)] 
Enhance the query planner with the ability to discern when an index is
covering even when it indexes columns well beyond the 63rd column.

FossilOrigin-Name: 1390417be45dd84e9118f6e761f23b8ff7476d26411e165bbaab678881e4eadd

2 years agoThis branch attempts to improve the detection of covering indexes. This
drh [Sat, 22 Oct 2022 14:16:02 +0000 (14:16 +0000)] 
This branch attempts to improve the detection of covering indexes.  This
first check-in merely improves a parameter name to sqlite3WhereBegin() to
be more descriptive of what it contains, and ensures that a subroutine is
not inlines so that sqlite3WhereBegin() runs slightly faster.

FossilOrigin-Name: cadf5f6bb1ce0492ef858ada476288e8057afd3609caa18b09c818d3845d7244

2 years agoClarification on the meaning of SrcList and SrcItem and especially the
drh [Sat, 22 Oct 2022 13:49:35 +0000 (13:49 +0000)] 
Clarification on the meaning of SrcList and SrcItem and especially the
SrcItem.colUsed and Index.colNotIdxed fields.  Comment changes only - no
changes to code.

FossilOrigin-Name: d96f6cc8475ae5509b8bff2db75e3c6f69a214d58d8979fbc0162ae488a040dc

2 years agoAdd SQLITE_DQS to the compileoptions_used list, per request in [forum post 8b1060122b...
stephan [Fri, 21 Oct 2022 17:48:49 +0000 (17:48 +0000)] 
Add SQLITE_DQS to the compileoptions_used list, per request in [forum post 8b1060122b|forum:8b1060122b]. Force DQS=0 in sqlite3-wasm.c.

FossilOrigin-Name: fcd9e0dbe3226f3f7ccc15b11fc3aa3b8058571bef274c25a33e9753e22f7551

2 years agoMacro name typo fix in OS_KV builds.
stephan [Fri, 21 Oct 2022 17:37:05 +0000 (17:37 +0000)] 
Macro name typo fix in OS_KV builds.

FossilOrigin-Name: 9cf1142b0cdb13347e3f551c862cb4714cadfe5ad637f049cf0a4b8bb6125b32

2 years agoEnsure that the RtreeCell object in rtreeUpdate has all bytes initialized.
drh [Fri, 21 Oct 2022 17:18:58 +0000 (17:18 +0000)] 
Ensure that the RtreeCell object in rtreeUpdate has all bytes initialized.

FossilOrigin-Name: 1e38742bde09cd879eb370bcf8604ed7ed00759209bcb4ed0374350e4b9e842d

2 years agoAdd kvvfs tests to tester1.js. Fix a scopedAlloc() misuse in oo1.DB ctor caused by...
stephan [Fri, 21 Oct 2022 06:58:27 +0000 (06:58 +0000)] 
Add kvvfs tests to tester1.js. Fix a scopedAlloc() misuse in oo1.DB ctor caused by refactoring earlier this morning (and caught by these new tests).

FossilOrigin-Name: 8e0f001ab76de6dbc17295b9085f7f61ce274c43f8c432ea4d2ec3153d248ff3

2 years agoAdd timing info and OPFS sanity tests to tester1.js
stephan [Fri, 21 Oct 2022 06:26:17 +0000 (06:26 +0000)] 
Add timing info and OPFS sanity tests to tester1.js

FossilOrigin-Name: 99915b0076422487cdd181a54e55694404fba13e4a540329b5ede9e2c9e12532

2 years agoExpose sqlite3_vfs_unregister() to WASM and unregister kvvfs in Worker threads to...
stephan [Fri, 21 Oct 2022 05:27:40 +0000 (05:27 +0000)] 
Expose sqlite3_vfs_unregister() to WASM and unregister kvvfs in Worker threads to avoid its unintended use there (in contexts other than local/sessionStorage). Correct registration of window functions, extend oo1.DB.createFunction() to support window functions, and add window function tests to tester1.js. Correct an incorrect 1-arg handling case for DB.exec(). Add per-test assertion counts to tester1.js.

FossilOrigin-Name: f07ce15479b7224b0d1ba9f147a433136e70c1461aa667d2737d4a918f778f55

2 years agoMake semantics for UDF xFinal() result handling and error reporting handling more...
stephan [Thu, 20 Oct 2022 23:48:38 +0000 (23:48 +0000)] 
Make semantics for UDF xFinal() result handling and error reporting handling more flexible.

FossilOrigin-Name: 89f3e1982ec32c010af67d15ef780847df20de568669e5c9d02f3cf084f51330

2 years agoAdd more JS tests. Flesh out the aggregate UDF tests to use sqlite3_aggregate_context...
stephan [Thu, 20 Oct 2022 21:28:31 +0000 (21:28 +0000)] 
Add more JS tests. Flesh out the aggregate UDF tests to use sqlite3_aggregate_context() so that they can each be used multiple times in the same statement. Add sqlite3_js_aggregate_context() convenience helper.

FossilOrigin-Name: 9d034ef5e1bab7c9651c2450dc85765fa6365d3f1414c711550de858ff8b3ece

2 years agoApply magic.txt correction and addition reported in [forum post 2d2366a04a0385|forum...
stephan [Thu, 20 Oct 2022 18:58:14 +0000 (18:58 +0000)] 
Apply magic.txt correction and addition reported in [forum post 2d2366a04a0385|forum:2d2366a04a0385].

FossilOrigin-Name: 9bf26e2aa3579f354ed2d314e1bf3e3ef117cbd71500ef5f76caa1de5cce1edc

2 years agoRename sqlite3_web_... to sqlite3_js_... Document the worker1.close.unlink option...
stephan [Thu, 20 Oct 2022 18:31:32 +0000 (18:31 +0000)] 
Rename sqlite3_web_... to sqlite3_js_... Document the worker1.close.unlink option. Fix unlink usage in speedtest1.html. Minor JS build cleanups.

FossilOrigin-Name: ac9af71b72a749b0a040273a88480d56f49570b569389a4ea20cc055f494d8ff

2 years agoAdd a bit to the optimization disabling mask for the indexed expression
drh [Thu, 20 Oct 2022 16:30:05 +0000 (16:30 +0000)] 
Add a bit to the optimization disabling mask for the indexed expression
optimization.

FossilOrigin-Name: 56df1482ab45d4d41f937b27c5a877b52fa082bfc6809ea682b62b47a51333de

2 years agoAdd test case for previous commit.
dan [Thu, 20 Oct 2022 16:22:39 +0000 (16:22 +0000)] 
Add test case for previous commit.

FossilOrigin-Name: 535867a9c8719358380f89fd80473c484def9bb72744dd2fd28ada65999ee901

2 years agoOnly enable the bMaybeNullRow flag on IndexedExpr for an index on an
drh [Thu, 20 Oct 2022 16:12:02 +0000 (16:12 +0000)] 
Only enable the bMaybeNullRow flag on IndexedExpr for an index on an
expression, not on a virtual column.  But do enable it for the right operand
of a right join.

FossilOrigin-Name: a9657c87c53c19228a42559c82c54b504a5ad729e407e9e2c7dabcc0c949b261

2 years agoThe generalized indexed expression optimization of [2435112867fbd7b6] makes
drh [Thu, 20 Oct 2022 13:36:32 +0000 (13:36 +0000)] 
The generalized indexed expression optimization of [2435112867fbd7b6] makes
the prior [a47efb7c8520a011] enhancement from 2017 obsolete.  This check-in
removes the older optimization.

FossilOrigin-Name: 56442c9bdd7844454c79acf83323380ea3509cb2e0b9a3d538a6b51726ae6d07

2 years agoFix minor problems in test1.c test code.
dan [Thu, 20 Oct 2022 10:46:17 +0000 (10:46 +0000)] 
Fix minor problems in test1.c test code.

FossilOrigin-Name: 6e545e2b846795fc67f8a90c04de284861a8a429ac686a7476b41c8ed7aabf75

2 years agoRework sqlite3_wasm_vfs_unlink(), add sqlite3_wasm_db_vfs(), update some docs.
stephan [Thu, 20 Oct 2022 05:14:37 +0000 (05:14 +0000)] 
Rework sqlite3_wasm_vfs_unlink(), add sqlite3_wasm_db_vfs(), update some docs.

FossilOrigin-Name: cdd46858f0e63bc7bfce8e339b3db9efdec43b6443ee76563a847f53d0176831

2 years agoMinor internal JS cleanups.
stephan [Thu, 20 Oct 2022 04:00:05 +0000 (04:00 +0000)] 
Minor internal JS cleanups.

FossilOrigin-Name: 818ef0b5c909e733b643455278f7cc45533178f1cc6617058c00ed64fa44896a

2 years agoIn the CLI, never use strcmp() or strncmp() directly. Instead use
drh [Wed, 19 Oct 2022 18:04:42 +0000 (18:04 +0000)] 
In the CLI, never use strcmp() or strncmp() directly.  Instead use
wrapper functions cli_strcmp() and cli_strncmp() that work correctly even
if the input is a NULL pointer.
[forum:/forumpost/142b868da7560d0b|Forum post 142b868da7560d0b].

FossilOrigin-Name: 7450a561f8577c3ee41f84074c6ef39e29e56876cab4fd763e6489c66f603223

2 years agoMove file /ext/misc/dbdata.c to the /ext/recover/ directory.
dan [Wed, 19 Oct 2022 18:03:39 +0000 (18:03 +0000)] 
Move file /ext/misc/dbdata.c to the /ext/recover/ directory.

FossilOrigin-Name: f6d5ac807efcf6140016a8b8f0c74566c0bfc98ad92bd8fca03c5cc80ebf3dec

2 years agoFix references to "SrcList_item" in comments as that object has since
drh [Wed, 19 Oct 2022 11:58:24 +0000 (11:58 +0000)] 
Fix references to "SrcList_item" in comments as that object has since
[bfd5bf2c73110fcb] (2021-02-21) been called "SrcItem".  Comment changes
only.  No changes to code.

FossilOrigin-Name: e3648a07f5607dbd4d6ad5b6e5a62a4a1d0b173d3f22aa36c74b768281fc86d8

2 years agoIf a query uses an index where one or more of the columns of the index is
drh [Wed, 19 Oct 2022 10:56:05 +0000 (10:56 +0000)] 
If a query uses an index where one or more of the columns of the index is
an expression or a virtual column, and if the corresponding expression is
used elsewhere in the query, then strive to read the value of the expression
out of the index, rather than recomputing it.  This is the
"Indexed Expression Optimizations".

FossilOrigin-Name: 2435112867fbd7b6ebb7f2c2b9da57cdf1e23fab6c2869870b66133a9f9faedc

2 years agoUpdate the wasm/js 'push' rule to account for this morning's changes.
stephan [Wed, 19 Oct 2022 07:51:12 +0000 (07:51 +0000)] 
Update the wasm/js 'push' rule to account for this morning's changes.

FossilOrigin-Name: c4a0f745fbaf6f950810f92765cbe66dde66e226b78ec5dd9017473bf4c9c268

2 years agoRename several demo/test files and include more of them in the end-user dist archive.
stephan [Wed, 19 Oct 2022 07:34:36 +0000 (07:34 +0000)] 
Rename several demo/test files and include more of them in the end-user dist archive.

FossilOrigin-Name: 9c85835f6f50eb3b1a2b89c817816335743f04440c48bfa05aa89ec519cc0d51

2 years agoMinor wasm/js build tweaks.
stephan [Wed, 19 Oct 2022 06:14:24 +0000 (06:14 +0000)] 
Minor wasm/js build tweaks.

FossilOrigin-Name: bcbee1ec010ae74f0749aa7fda008698198a8cd52a7aa12d6458d43d3e739eb0

2 years agoUpdate the dist rules for this evening's js/wasm build changes and include an index...
stephan [Wed, 19 Oct 2022 06:06:42 +0000 (06:06 +0000)] 
Update the dist rules for this evening's js/wasm build changes and include an index.html specifically for the subset of apps included in the dist archive.

FossilOrigin-Name: a0ef0f32e96638b502b3951e524d590bdfb09dd39be453686b075102da67b7db

2 years agoApply considerable acrobatics to get the JS/WASM deliverables building to and loadabl...
stephan [Wed, 19 Oct 2022 04:44:58 +0000 (04:44 +0000)] 
Apply considerable acrobatics to get the JS/WASM deliverables building to and loadable from a directory other than the one which contains the app-level code. Requires an only-slightly-leaky abstraction of passing a URL argument when loading sqlite3.js but provides much greater flexibility in where the JS/WASM files are located.

FossilOrigin-Name: 6d468dab9eb84d4548f68014959f02fe4f66455472ff24fe729382bb2972e3d1

2 years agoConsiderable wasm/js build cleanups and reworking. Remove wasmfs builds from the...
stephan [Wed, 19 Oct 2022 01:07:30 +0000 (01:07 +0000)] 
Considerable wasm/js build cleanups and reworking. Remove wasmfs builds from the end-user deliverables and disable the wasmfs build by default, per /chat discussion, as it doubles our deliverable count for only marginal gain. Attempt to move the sqlite3.js/wasm files into subdirectories but rediscovered that that breaks loading in Worker mode because URI resolution of the wasm files differs depending on whether the main script is loaded from a script tag or a Worker.

FossilOrigin-Name: 5b23e0675efdd2f1ea7b4f5836a579e8d6aa8a25b3f1a6a950520ad845ff01bb

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 agoMore work on the JS end-user deliverables. Add tool/stripccomments.c to support that.
stephan [Tue, 18 Oct 2022 20:36:50 +0000 (20:36 +0000)] 
More work on the JS end-user deliverables. Add tool/stripccomments.c to support that.

FossilOrigin-Name: 2156f0744acfe425457430a0f6a7e02de907de85edba81a6d4eef40293e561c8

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 agoExclude slow test recovercorrupt.test from veryquick.test.
dan [Sat, 15 Oct 2022 19:18:10 +0000 (19:18 +0000)] 
Exclude slow test recovercorrupt.test from veryquick.test.

FossilOrigin-Name: ff9a733532fe11bb253246b45a94681a174c976aafee5c780af571893e8ce694

2 years agoAdd missing comments and fix other code issues.
dan [Sat, 15 Oct 2022 18:26:30 +0000 (18:26 +0000)] 
Add missing comments and fix other code issues.

FossilOrigin-Name: 8ed4e4a80d8104d20b211a0b3e299abdb955cabdd36979bf6aae54266dc9778d

2 years agoMerge latest trunk changes.
dan [Sat, 15 Oct 2022 15:39:46 +0000 (15:39 +0000)] 
Merge latest trunk changes.

FossilOrigin-Name: 42255ead8e44b24a8abc04aca49f170c55f3b52f42366a0d8ef248ee65fcc7ce

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 agoHandle recovering databases with reserved bytes at the end of each page.
dan [Fri, 14 Oct 2022 15:46:19 +0000 (15:46 +0000)] 
Handle recovering databases with reserved bytes at the end of each page.

FossilOrigin-Name: 52d0235ef3f21683daadf2343514f7b95a67c3589266f75c1e00e04f11dc6214

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 agoAdd tests for detecting page size of databases.
dan [Thu, 13 Oct 2022 20:06:17 +0000 (20:06 +0000)] 
Add tests for detecting page size of databases.

FossilOrigin-Name: 31f9e2369fcf59032b7c4c9f5bfc85e7ef7c174003b0b9e2757dad5a4c79b370

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