]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
2 years agoRemove a redundant assert() statement. agg-with-indexed-expr
drh [Fri, 25 Nov 2022 13:26:51 +0000 (13:26 +0000)] 
Remove a redundant assert() statement.

FossilOrigin-Name: e3e1b453dc47884ddc9e51c4302fa2f4d40bca3d69ac7c13d8e2ae1adc81ac56

2 years agoImprove the robustness of the updateAccumulator() routine against OOM.
drh [Fri, 25 Nov 2022 13:15:48 +0000 (13:15 +0000)] 
Improve the robustness of the updateAccumulator() routine against OOM.

FossilOrigin-Name: d2844f577b69fdc16a0a2568c0958fc3d8aff33e9a0ef80e0f58e92f01097432

2 years agoImproved comments. Add assert()s to verify that the AggInfo structure
drh [Fri, 25 Nov 2022 13:08:20 +0000 (13:08 +0000)] 
Improved comments.  Add assert()s to verify that the AggInfo structure
is unchanged after registers have been assigned.

FossilOrigin-Name: 5200b84195ee1ccaa387f7032eae3d463724c48cb53ba0251bbc79e927dd9752

2 years agoCorrectly deal with IF-NULL-ROW operators when dealing with
drh [Thu, 24 Nov 2022 23:35:27 +0000 (23:35 +0000)] 
Correctly deal with IF-NULL-ROW operators when dealing with
indexed expressions in aggregates.

FossilOrigin-Name: 939cb47025354e2df047de7654c0b06f791957cfe4e904abe8892207cea90215

2 years agoTake care not to try to add comments to a TK_AGG_COLUMN opcode that does
drh [Thu, 24 Nov 2022 19:02:40 +0000 (19:02 +0000)] 
Take care not to try to add comments to a TK_AGG_COLUMN opcode that does
not have an associated Table object because it is a reference to an indexed
expression.

FossilOrigin-Name: 5fc23863e4a6388884ce061cd69546757b4c39d731bbb58a8121b92fd5144f7b

2 years agoChange a NEVER() into an assert().
drh [Thu, 24 Nov 2022 18:45:56 +0000 (18:45 +0000)] 
Change a NEVER() into an assert().

FossilOrigin-Name: a0fd44f4e5a0ec83465203a0009f307ca50223833575895a3ebf8a289515714f

2 years agoAdd NEVER() and ALWAYS() macros on branches that are believed to be
drh [Thu, 24 Nov 2022 15:04:23 +0000 (15:04 +0000)] 
Add NEVER() and ALWAYS() macros on branches that are believed to be
unreachable.

FossilOrigin-Name: 3a901e88c87fc76c7fe42e47a976a5706830f0dbd6027605663e4d55f4f33590

2 years agoNew test cases. Fix the logic so that it works for GROUP BY aggregates
drh [Thu, 24 Nov 2022 13:19:25 +0000 (13:19 +0000)] 
New test cases.  Fix the logic so that it works for GROUP BY aggregates
that do not require sorting.

FossilOrigin-Name: ef6ebe7922f56c1584a005deedc85ca1070b4fe5082ada8bbf8d06df54f1c9ef

2 years agoMerge the latest trunk changes into the agg-with-indexed-expr branch to
drh [Thu, 24 Nov 2022 01:41:44 +0000 (01:41 +0000)] 
Merge the latest trunk changes into the agg-with-indexed-expr branch to
simplify diffs.

FossilOrigin-Name: 38c3d3f1ed0fd2bb62aa8a7e5a27f2b247123e094e2fdb0a2475d788c3dfbc04

2 years agoAdd explanatory comment to the new optimization. And add a test case.
drh [Thu, 24 Nov 2022 01:40:20 +0000 (01:40 +0000)] 
Add explanatory comment to the new optimization.  And add a test case.

FossilOrigin-Name: e6c20f61de7d048eee65c8e74a3eb36760ab9747ebd1ab50e49642b777c10306

2 years agoMinor JS doc updates.
stephan [Wed, 23 Nov 2022 21:09:51 +0000 (21:09 +0000)] 
Minor JS doc updates.

FossilOrigin-Name: 27efd63ad7fb3bf8d0d07f2c9f48652c8cacc4e697c229c8085120a8e6b50a39

2 years agoAdd optional zSchema argument to sqlite3_js_db_export().
stephan [Wed, 23 Nov 2022 21:03:22 +0000 (21:03 +0000)] 
Add optional zSchema argument to sqlite3_js_db_export().

FossilOrigin-Name: 9c23644b1e5bf44bfb431a35fd1674c11ccb99e9eb0989f10175b0cb2a858eaa

2 years agoAggregates with GROUP BY now make use of expressions on indexes. This code
drh [Wed, 23 Nov 2022 18:51:04 +0000 (18:51 +0000)] 
Aggregates with GROUP BY now make use of expressions on indexes.  This code
works and gets the correct answer for the test case in the ticket.  Lots more
testing and documentation is needed, however.

FossilOrigin-Name: 8dcf9f2031c16f296d187fe876d4204c71fc96fec120984ff11b6d8b03d58a5f

2 years agoThis attempt at modifying AggInfo to make use of indexed expressions does not
drh [Wed, 23 Nov 2022 17:56:00 +0000 (17:56 +0000)] 
This attempt at modifying AggInfo to make use of indexed expressions does not
work.  It gets an incorrect answer for the test case shown in the ticket.

FossilOrigin-Name: 84c06023f4a1606664fdb9811312603b31f7c94a43d0e443ba7dde7fdba029e3

2 years agoUpdate Makefile.in to include new target "sqlite3r.c". For generating "sqlite3r.c...
dan [Wed, 23 Nov 2022 16:08:49 +0000 (16:08 +0000)] 
Update Makefile.in to include new target "sqlite3r.c". For generating "sqlite3r.c" and "sqlite3r.h", versions of the amalgamation that include the recover extension. To build the shell tool against these files, add -DSQLITE_HAVE_SQLITE3R.

FossilOrigin-Name: 5f135575b923cb59947667071c6af9ff14063c933cedf37d6c2a0a1b86c85032

2 years agoRemove a bit of over-cleverness which breaks loading of sqlite3.js in some main-threa...
stephan [Wed, 23 Nov 2022 15:52:52 +0000 (15:52 +0000)] 
Remove a bit of over-cleverness which breaks loading of sqlite3.js in some main-thread cases.

FossilOrigin-Name: 220cc4c6399b772b4ece03305a41b437ef0654d586a8a1c3dc5e7606fd36d655

2 years agoOPFS concurrency tester: ensure that the work interval timer does not overlap with...
stephan [Wed, 23 Nov 2022 15:33:49 +0000 (15:33 +0000)] 
OPFS concurrency tester: ensure that the work interval timer does not overlap with the work time.

FossilOrigin-Name: 8f2076553bc486ea6a17934695ecc02217461af2082d891697b62aab89bd1b43

2 years agoFurther foundation prep work prior to starting to flesh-out the
drh [Wed, 23 Nov 2022 14:13:39 +0000 (14:13 +0000)] 
Further foundation prep work prior to starting to flesh-out the
optimizeAggregateUseOfIndexedExpr() routine.

FossilOrigin-Name: 23145fe999ff74d787a3999baedd4ffe755c5f1f1275082ed0338ba637ecc56e

2 years agoMerge enhancements and fixes from trunk.
drh [Tue, 22 Nov 2022 20:58:18 +0000 (20:58 +0000)] 
Merge enhancements and fixes from trunk.

FossilOrigin-Name: f8932e04d4d18eb9d71edda15aa08af2eb139ff14d77ca147ea6e9b173e0f5e0

2 years agoAdd the stub function: optimizeAggregateUsingIndexedExpr(). The hope is that
drh [Tue, 22 Nov 2022 20:37:41 +0000 (20:37 +0000)] 
Add the stub function: optimizeAggregateUsingIndexedExpr().  The hope is that
we can fill this in with a routine that does useful optimizations.

FossilOrigin-Name: d85bb724fdd6fbad2b88ed7f60e4174e3f65182356f404d04620c5cf6b17f77e

2 years agoAvoid naming collision between the sha1 and shathree extensions.
mistachkin [Tue, 22 Nov 2022 20:04:00 +0000 (20:04 +0000)] 
Avoid naming collision between the sha1 and shathree extensions.

FossilOrigin-Name: 9ec923b5dc24d6082da8d42bc0ee8ab1c418912625c0c56de9627be2c818ef98

2 years agoInclude the treetrace bitmap comment accidentally omitted from the previous
drh [Tue, 22 Nov 2022 19:56:54 +0000 (19:56 +0000)] 
Include the treetrace bitmap comment accidentally omitted from the previous
check-in.

FossilOrigin-Name: db07471c531766a8eec1d5b41c9fd0283b5e64ee13166dc3391f70a1e1946121

2 years agoMerge trunk fixes and enhancements into the agg-with-indexed-expr branch.
drh [Tue, 22 Nov 2022 19:51:16 +0000 (19:51 +0000)] 
Merge trunk fixes and enhancements into the agg-with-indexed-expr branch.

FossilOrigin-Name: 070634781a5eb41f96b001e48b064e3cd8c82314f576335eb1fcd43792179291

2 years agoRename the SELECTTRACE macro to TREETRACE, so that is corresponds to the new
drh [Tue, 22 Nov 2022 19:49:16 +0000 (19:49 +0000)] 
Rename the SELECTTRACE macro to TREETRACE, so that is corresponds to the new
CLI command.  Renumber all of the bits in the bitmask used to enable
various kinds of tracing, and add a trace bitmap decoder in sqliteInt.h.
Changes to debugging logic only.  No (intentional) changes to production code.

FossilOrigin-Name: 8036445a36d9d982c1305935e7e37367bdf9e466b923eb6286b52524802e3ccd

2 years agoFix the error message in the CLI for "no such VFS".
drh [Tue, 22 Nov 2022 18:24:07 +0000 (18:24 +0000)] 
Fix the error message in the CLI for "no such VFS".
[forum:/info/1217fdd6b3|Forum post 1217fdd6b3].

FossilOrigin-Name: 861af465fda8485dfff143dc45c659b884d826aaec2ebaa941566404d1fe427b

2 years agoAdd Makefile.in targets for sqlite3r.c and sqlite3r.h, versions of the amalgamation... make-sqlite3r.c
dan [Tue, 22 Nov 2022 16:12:53 +0000 (16:12 +0000)] 
Add Makefile.in targets for sqlite3r.c and sqlite3r.h, versions of the amalgamation that include the recover extension.

FossilOrigin-Name: 59a837cfc7f9f96509491c8fc45355d2e8892af25246955e22adec1cbf37327b

2 years agoSince the memory registers used by the columns and functions of an
drh [Tue, 22 Nov 2022 15:43:16 +0000 (15:43 +0000)] 
Since the memory registers used by the columns and functions of an
AggInfo object are sequential, it is not neecessary to remember each register
separately.  We can simply remember the first one and do the math when
others are needed.

FossilOrigin-Name: dc5bd34963b761c819c565653156d0befbf65cc2cc5dc4113b0ce952450f0352

2 years agoFix last function pointer in sqlite3Apis init. Reported at https://sqlite.org/forum...
larrybr [Tue, 22 Nov 2022 15:41:32 +0000 (15:41 +0000)] 
Fix last function pointer in sqlite3Apis init. Reported at https://sqlite.org/forum/info/eba0faa96d

FossilOrigin-Name: 6d5dc9eed54b7d883aa7dbe2eb5ff17d2a703eabdb7d548a27cccc1fe5addb4a

2 years agoOmit the unnecessary AggInfo.mnReg field.
drh [Tue, 22 Nov 2022 14:31:13 +0000 (14:31 +0000)] 
Omit the unnecessary AggInfo.mnReg field.

FossilOrigin-Name: d79c58ef08b917bacc0f24d210d8eb23f659f955c219b4757af42eee8f17099b

2 years agoFactor out the allocation of registers for aggregates into a separate
drh [Tue, 22 Nov 2022 14:10:22 +0000 (14:10 +0000)] 
Factor out the allocation of registers for aggregates into a separate
subroutine.

FossilOrigin-Name: 4475799d5b41e93eabc32fac502ac2de240642b3b64739216e32e9af92ee191d

2 years agoThis is the first in what is anticipated to be a long sequence of incremental
drh [Tue, 22 Nov 2022 13:33:58 +0000 (13:33 +0000)] 
This is the first in what is anticipated to be a long sequence of incremental
changes aimed at improving aggregate query processing, and in particular
helping aggregate queries take better advantage of indexes on expression.
The end goal is to resolve ticket [99378177930f87bd], though it remains to
be seen whether or not I can get there with this approach.

FossilOrigin-Name: cba837eae93f6b842d4e78ef00661a4f09deb99c53f12b3e8f46763749602597

2 years agoConvert an ALWAYS() in sqlite3DbSpanDup() into an assert(), for a performance
drh [Tue, 22 Nov 2022 12:47:32 +0000 (12:47 +0000)] 
Convert an ALWAYS() in sqlite3DbSpanDup() into an assert(), for a performance
increase and size reduction.

FossilOrigin-Name: 21e80a29737c367babcc0cf2533eed61b5d0fcf3cc3c33ab88761899e394eaf3

2 years agoSplit out the debugging code that dumps an AggInfo object into a separate
drh [Mon, 21 Nov 2022 17:40:23 +0000 (17:40 +0000)] 
Split out the debugging code that dumps an AggInfo object into a separate
subroutine called printAggInfo() so that it can be invoked interactively
during debugging.  No changes to production code.

FossilOrigin-Name: dc33cfbedef4b444adeadea17f8183b7c4ce5b87432d0c712f986b34c7374ff1

2 years agoChange the name of the Parse.pIdxExpr field to pIdxEpr so that the name is
drh [Mon, 21 Nov 2022 16:40:12 +0000 (16:40 +0000)] 
Change the name of the Parse.pIdxExpr field to pIdxEpr so that the name is
distinct from all other identifiers in the code and thus less confusing.

FossilOrigin-Name: a2962d0187534f3496282b48efbf38dabcd226bf8972be925c8433c55a8853fe

2 years agoOPFS contention test: give each worker a distinct recognizable name instead of a...
stephan [Mon, 21 Nov 2022 16:00:26 +0000 (16:00 +0000)] 
OPFS contention test: give each worker a distinct recognizable name instead of a random one.

FossilOrigin-Name: 5f564bf7de7ce3ad7bedb5f06b3086ceaec55da768a60d74059fa4fba4328567

2 years agoPerformance optimization and size reduction in insertCell() by omitting
drh [Mon, 21 Nov 2022 15:55:57 +0000 (15:55 +0000)] 
Performance optimization and size reduction in insertCell() by omitting
the "pRC" argument and instead returning the result code as an integer.

FossilOrigin-Name: bee94d1bb0daade023cc1e274339daafc249e1978c0765fc45042b5f9060e478

2 years agoPerformance optimization to sqlite3BtreeInsert().
drh [Mon, 21 Nov 2022 14:13:10 +0000 (14:13 +0000)] 
Performance optimization to sqlite3BtreeInsert().

FossilOrigin-Name: b8976ebfe03fbc1e09a38d598a62493a7f19ff7a2a3acd1ec54d0dee190471e9

2 years agoSmall performance improvement in sqlite3BtreeTransferRow().
drh [Mon, 21 Nov 2022 13:35:00 +0000 (13:35 +0000)] 
Small performance improvement in sqlite3BtreeTransferRow().

FossilOrigin-Name: dab959ea3edf99788bfd76352cd46a3e56876b0e7d7008c6927aa14534853c50

2 years agoAdd new JS tests dir to those pushed to the test server.
stephan [Mon, 21 Nov 2022 06:07:22 +0000 (06:07 +0000)] 
Add new JS tests dir to those pushed to the test server.

FossilOrigin-Name: 07182dca9f2a4ffea1af0684c93e55e105465b2ee9820c70764e3e7bc1c28efc

2 years agoMore tweaking of OPFS concurrency measures and the related test app.
stephan [Mon, 21 Nov 2022 05:18:24 +0000 (05:18 +0000)] 
More tweaking of OPFS concurrency measures and the related test app.

FossilOrigin-Name: a8d4da1501d411085ec2fd48c4a056c8b1d97ef3c3203c5b403a854ac2864870

2 years agoResolve missing SQLITE_LOCKED result code which triggered a new (since last checkin...
stephan [Mon, 21 Nov 2022 04:12:38 +0000 (04:12 +0000)] 
Resolve missing SQLITE_LOCKED result code which triggered a new (since last checkin) exception in the OPFS VFS. Improve output of the OPFS contention tester app.

FossilOrigin-Name: 2debbbca33bd4170a1dc4dbb5eb3e68523e51d289b06c551e5560ac4e32e433b

2 years agoAdd test app for experimenting with multi-worker OPFS concurrency. Tweak OPFS VFS...
stephan [Mon, 21 Nov 2022 03:50:52 +0000 (03:50 +0000)] 
Add test app for experimenting with multi-worker OPFS concurrency. Tweak OPFS VFS to significantly improve the otherwise "unfortunate" concurrency situation.

FossilOrigin-Name: 96f76e7616f8157a342b9e1c42f7b1feab200d182268871a2b25f67d4ee2564c

2 years agojs dist: account for a file rename in the previous checkin.
stephan [Sun, 20 Nov 2022 05:47:17 +0000 (05:47 +0000)] 
js dist: account for a file rename in the previous checkin.

FossilOrigin-Name: 469f9011a885e19b99210c5e3e582afa140b8b5f0aa7a720334848df5ab6ae98

2 years agoFurther minor cleanups in the JS build related to vanilla vs ESM.
stephan [Sun, 20 Nov 2022 05:36:52 +0000 (05:36 +0000)] 
Further minor cleanups in the JS build related to vanilla vs ESM.

FossilOrigin-Name: 100a596800eca61477d9880092465d594c22be3707f2a11aaf6eb9e234fc6f2d

2 years agoRemove an obsolete reference to WASMFS from ext/wasm/index.html.
stephan [Sun, 20 Nov 2022 04:14:29 +0000 (04:14 +0000)] 
Remove an obsolete reference to WASMFS from ext/wasm/index.html.

FossilOrigin-Name: 51ff681864ec19844f8e7a46aef132e8a8601a1b64e1f5a243a53c6413f2a61a

2 years agoGeneric cleanups and doc additions in the wasm build files.
stephan [Sun, 20 Nov 2022 04:14:00 +0000 (04:14 +0000)] 
Generic cleanups and doc additions in the wasm build files.

FossilOrigin-Name: d10f385e36ee7fe3077d80d8d6e7ce55732d20ef73e2a63533d8d2932ec8bf62

2 years agoAdd 'snapshot' target to create distinctly-named snapshot builds of the wasm delivera...
stephan [Sun, 20 Nov 2022 04:13:16 +0000 (04:13 +0000)] 
Add 'snapshot' target to create distinctly-named snapshot builds of the wasm deliverables zip file.

FossilOrigin-Name: f7620aa09e4893971e00cdee5c6f1fe15c3bd21f985bec90fbd90fdfc457ac31

2 years agoMinor cleanups in the ESM-related preprocessor filtering.
stephan [Sun, 20 Nov 2022 01:15:22 +0000 (01:15 +0000)] 
Minor cleanups in the ESM-related preprocessor filtering.

FossilOrigin-Name: 205884a273128bb666b496b659b4fa9f031ebdbbc1aa704fdeb4b7e015740098

2 years agoNew assert()s confirm that BTREE_PREFORMAT must be the same value as
drh [Sat, 19 Nov 2022 20:10:55 +0000 (20:10 +0000)] 
New assert()s confirm that BTREE_PREFORMAT must be the same value as
OPFLAG_PREFORMAT.

FossilOrigin-Name: f40bf2c642643ae61d331e8d4815f601224fa258ab34344c6756966163a89f4a

2 years agoPerformance optimization in sqlite3BtreeInsert().
drh [Sat, 19 Nov 2022 19:37:26 +0000 (19:37 +0000)] 
Performance optimization in sqlite3BtreeInsert().

FossilOrigin-Name: 9776fa31758161970a50995a487b6543ed71e9610460b7324304ef21d9248707

2 years agoPerformance improvement and size reduction in balance_nonroot().
drh [Sat, 19 Nov 2022 18:43:32 +0000 (18:43 +0000)] 
Performance improvement and size reduction in balance_nonroot().

FossilOrigin-Name: 715bc81eb833ad4834d139a04085e0386c54c30d7395207e48972c4dfe5879c1

2 years agoSmall performance improvement and size reduction in btree.
drh [Sat, 19 Nov 2022 18:17:40 +0000 (18:17 +0000)] 
Small performance improvement and size reduction in btree.

FossilOrigin-Name: daa07149c0a0fcb6a6a1ace6020ca68802588ed309f5aaaf99c871088bc46908

2 years agoGet tester1.js working via an ES6 worker module and add that variant to the dist...
stephan [Sat, 19 Nov 2022 16:16:40 +0000 (16:16 +0000)] 
Get tester1.js working via an ES6 worker module and add that variant to the dist zipfile.

FossilOrigin-Name: 90480586f1b2ad82118e19536b095431b8457f294c0afaa9b4f883f184cc804c

2 years agoImproved comments on the pageFreeArray() routine of btree.c. No changes to
drh [Sat, 19 Nov 2022 14:18:48 +0000 (14:18 +0000)] 
Improved comments on the pageFreeArray() routine of btree.c.  No changes to
code.

FossilOrigin-Name: 0c2adc6d3547b07e950ae49f07f688f71a21b3ad5a51f16f0e8d49ab91564582

2 years agoStreamline the decodeFlags() routine in btree.c for a small performance
drh [Sat, 19 Nov 2022 13:09:03 +0000 (13:09 +0000)] 
Streamline the decodeFlags() routine in btree.c for a small performance
increase.

FossilOrigin-Name: 4cb285210b4a2b14c80962bf2ecb35be310d3444c329c15d86b3073096455704

2 years agoAdd build of sqlite3.mjs (ES6 module), add a test app for it, and include it in the...
stephan [Sat, 19 Nov 2022 05:26:45 +0000 (05:26 +0000)] 
Add build of sqlite3.mjs (ES6 module), add a test app for it, and include it in the dist build.

FossilOrigin-Name: 2e783670e10b59e67c14b0db7f4803b41790cc7730de221d54fa2d4483cfba33

2 years agoIntegrate a custom preprocessor to the JS build process to facilitate creation of...
stephan [Sat, 19 Nov 2022 02:58:03 +0000 (02:58 +0000)] 
Integrate a custom preprocessor to the JS build process to facilitate creation of both vanilla JS and ES6 Module builds from the same source files. There is still some build-level reworking pending to make an ESM build a first-class deliverable.

FossilOrigin-Name: 10c723d96d61d2e552ec1102563d58f1eb11bc3d30e03606fd8e0279c5a9043a

2 years agoMore work towards creation of a ES6 JS module. js-cpp
stephan [Sat, 19 Nov 2022 02:51:41 +0000 (02:51 +0000)] 
More work towards creation of a ES6 JS module.

FossilOrigin-Name: 6b826e700f6849eebfbba38e5948b96be245994e3e03ea30743114d3f5689c42

2 years agoSmall performance optimization in btree.c.
drh [Sat, 19 Nov 2022 00:22:12 +0000 (00:22 +0000)] 
Small performance optimization in btree.c.

FossilOrigin-Name: f710cce13577788cf3b95ed7089c3af2854271ff53f0a0b7b0619f315e331eff

2 years agoDatabases created using sqlite3_deserialize() should report their filename
drh [Sat, 19 Nov 2022 00:08:35 +0000 (00:08 +0000)] 
Databases created using sqlite3_deserialize() should report their filename
as an empty string, not as "x".  Fix for ticket [53043c9793715f08].

FossilOrigin-Name: ff494449efd475878c549728cc22ee9b12d13674068781747fc042a0c1bd09c8

2 years agoUpdate the version number to 3.41.0 to begin the next development cycle.
drh [Fri, 18 Nov 2022 17:57:19 +0000 (17:57 +0000)] 
Update the version number to 3.41.0 to begin the next development cycle.

FossilOrigin-Name: 5c669f5f399fe89998b9edba6486f2a6fe5fca789ed82e8711349c8736b293d9

2 years agoshell.c.in: on non-Windows platforms, check for $XDG_CONFIG_HOME/sqlite3/sqliterc...
stephan [Fri, 18 Nov 2022 15:22:45 +0000 (15:22 +0000)] 
shell.c.in: on non-Windows platforms, check for $XDG_CONFIG_HOME/sqlite3/sqliterc before ~/.sqliterc, per request in [forum:7a16582b1e403c81|forum post 7a16582b1e403c81].

FossilOrigin-Name: 17065d095d26a814acf1e13f5cc18b21fecc58eb8c9da100458029bb139fcd35

2 years agoReplace use of cpp with the fit-to-purpose c-pp to avoid cpp's C-centric/JS-unfriendl...
stephan [Fri, 18 Nov 2022 02:29:59 +0000 (02:29 +0000)] 
Replace use of cpp with the fit-to-purpose c-pp to avoid cpp's C-centric/JS-unfriendly quirks.

FossilOrigin-Name: 49d70f071e918d5d095c807575bb7ce2b287a123261e789e938521b3b409429a

2 years agoFix corner cases in UTF8 handling in the REGEXP extension.
drh [Thu, 17 Nov 2022 19:24:39 +0000 (19:24 +0000)] 
Fix corner cases in UTF8 handling in the REGEXP extension.
[forum:/forumpost/3ffe058b04|Forum post 3ffe058b04].

FossilOrigin-Name: abb18f61c5cec0f524acc41453b4c06b61c5af51ff46417588837fc0c3967288

2 years agoMerge trunk into js-cpp branch.
stephan [Thu, 17 Nov 2022 15:21:49 +0000 (15:21 +0000)] 
Merge trunk into js-cpp branch.

FossilOrigin-Name: e047b33d1fb7d6a32e967f03f9952249cd2da4d21dc301fe92bd7baa0da5d6a9

2 years agoUse the log10() and log2() functions from the standard C library to implement
drh [Thu, 17 Nov 2022 14:40:33 +0000 (14:40 +0000)] 
Use the log10() and log2() functions from the standard C library to implement
the equivalent SQL functions, in the hope that this will prevent reported
precision problems.
See [forum:/forumpost/cfceb1230bdcfd84|forum post cfceb1230bdcfd84] and the
surrounding thread.

FossilOrigin-Name: 7c572d02e60a83b36543ba4d9d45f61e9fc111b61fee085410c2d87558c732d6

2 years agoSplit out the documentation for sqlite3_value_encoding() into its own
drh [Thu, 17 Nov 2022 13:58:25 +0000 (13:58 +0000)] 
Split out the documentation for sqlite3_value_encoding() into its own
page and make it clear that this interface is intended for testing and
debugging only.
[forum:/forumpost/c9f445453da950ad|Forum thread c9f445453da950ad].
Comment changes only - no changes to code.

FossilOrigin-Name: 9048a766ff7dfa0cd91ea74092e462f4501cb3f719033ccb55700bf5e4dfd0d3

2 years agoRaise an error if an attempt is made to compile the CLI with the
drh [Thu, 17 Nov 2022 01:24:06 +0000 (01:24 +0000)] 
Raise an error if an attempt is made to compile the CLI with the
SQLITE_OMIT_COMPLETE option, since sqlite3_complete() really is necessary
for the CLI to operate sanely.

FossilOrigin-Name: a119a9e2ade4eac5feb1aa885c15b83e725f87386351de99d3abb49656219d50

2 years agoChange a self.X JS reference to X to account for a symbol resolution discrepancy...
stephan [Wed, 16 Nov 2022 21:52:29 +0000 (21:52 +0000)] 
Change a self.X JS reference to X to account for a symbol resolution discrepancy between vanilla JS and ES6 modules, as explained in [forum:801d8f77e5115141|forum post 801d8f77e5115141].

FossilOrigin-Name: 0590de4da1103d842b9f9f25bcd2e69223b2ea067ae2f320f58dd3763218b39d

2 years agowasm build: include FTS5 instead of FTS4, per /chat and HN discussions.
stephan [Wed, 16 Nov 2022 21:39:23 +0000 (21:39 +0000)] 
wasm build: include FTS5 instead of FTS4, per /chat and HN discussions.

FossilOrigin-Name: 85c3f2ac5a887ba809f236c8c9d3837b2fdb578d4beae61bc78ada7ce03b58e2

2 years agoFix harmless typo in comment, reported by Debian in Fossil
drh [Wed, 16 Nov 2022 19:57:21 +0000 (19:57 +0000)] 
Fix harmless typo in comment, reported by Debian in Fossil
[https://fossil-scm.org/forum/forumpost/15f7327318].

FossilOrigin-Name: 5689f0d9ad1be532b274508938b25ff0d63027b8cc31f796dfaa2cca71d53642

2 years agoAvoid returning SQLITE_SCHEMA if the first query run on a connection
drh [Wed, 16 Nov 2022 19:53:39 +0000 (19:53 +0000)] 
Avoid returning SQLITE_SCHEMA if the first query run on a connection
is "SELECT nosuchcolumn" or similar.
[forum:/forumpost/c1798f77ef|Forum post c1798f77ef]

FossilOrigin-Name: 3dc4f75d77417df1ef19be8e3191d246fb44ca7f7d1de7b161c5cb0f8aafeded

2 years agoVersion 3.40.0 version-3.40.0
drh [Wed, 16 Nov 2022 12:10:08 +0000 (12:10 +0000)] 
Version 3.40.0

FossilOrigin-Name: 89c459e766ea7e9165d0beeb124708b955a4950d0f4792f457465d71b158d318

2 years agoPrevious change to the fake_big_file command in the test harness was not
drh [Mon, 14 Nov 2022 19:42:01 +0000 (19:42 +0000)] 
Previous change to the fake_big_file command in the test harness was not
correct.  This one should fix the problem.

FossilOrigin-Name: 6ee57a2e4e3399481100c40da0229d2d33cbe3290016185c8a60839d14b209f6

2 years agoChange the fake_big_file test command so that it fails for files larger than
drh [Mon, 14 Nov 2022 18:57:21 +0000 (18:57 +0000)] 
Change the fake_big_file test command so that it fails for files larger than
2MB on Windows, as we have observed that Window10 will sometimes bluescreen
when operating on very large sparse files.

FossilOrigin-Name: d39ffd2abadcc85c46ba17612f9f575005b4818e18bf39362b8ee574837cfad9

2 years agoAvoid running bigsort.test with SQLITE_DEBUG builds. The assert() statements added...
dan [Mon, 14 Nov 2022 17:48:26 +0000 (17:48 +0000)] 
Avoid running bigsort.test with SQLITE_DEBUG builds. The assert() statements added in [7c96a56] make it too slow.

FossilOrigin-Name: fa68dd8928c76888d535e649794743eeefd3abe0f909792a128955710bfc948a

2 years agoRemove some outdated code comments. No code changes.
stephan [Sun, 13 Nov 2022 19:29:51 +0000 (19:29 +0000)] 
Remove some outdated code comments. No code changes.

FossilOrigin-Name: 80ff592a9d0157bfa8bd1f9959c3aa26cab0ec16fdccf7b58a7523b8912c1a8c

2 years agoDisable the ability to change the schema_version cookie when
drh [Sat, 12 Nov 2022 17:17:01 +0000 (17:17 +0000)] 
Disable the ability to change the schema_version cookie when
SQLITE_DBCONFIG_DEFENSIVE mode is enabled.  This is a security
enhancement inspired by the question in
[forum:/forumpost/2b9cc3dae1f1e5f6|forum post 2b9cc3dae1f1e5f6].

FossilOrigin-Name: 1d81381e8f5db5d7064cc313b8544ca3cb1ca9e8cd61e71368a2d2e598befc9c

2 years agoRemove unnecessary tabs in the ChaCha20 implementation.
drh [Thu, 10 Nov 2022 23:10:11 +0000 (23:10 +0000)] 
Remove unnecessary tabs in the ChaCha20 implementation.
[forum:/forumpost/0cdce5db8c|Forum post 0cdce5db8c].

FossilOrigin-Name: b7179efbdb2bdc878acec0abfe272821f7e0d7d9e5ef06cd7fd796ef295e54ab

2 years agoAvoid returning SQLITE_SCHEMA if the first query run on a connection is "SELECT nosuc... schema-error-fix
dan [Thu, 10 Nov 2022 19:19:52 +0000 (19:19 +0000)] 
Avoid returning SQLITE_SCHEMA if the first query run on a connection is "SELECT nosuchcolumn" or similar. Forum post <https://sqlite.org/forum/forumpost/c1798f77ef>.

FossilOrigin-Name: d31c019fd6849e4c3f8452e75c6cfefd613ade5355e896be368bd16fef28c627

2 years agoAutomatically relinquish implicitly-acquired OPFS file locks during VFS idle time...
stephan [Thu, 10 Nov 2022 13:22:35 +0000 (13:22 +0000)] 
Automatically relinquish implicitly-acquired OPFS file locks during VFS idle time in an attempt to help alleviate cross-tab locking contention like that described in [forum:58a377083cd24a|forum post 58a377083cd24a].

FossilOrigin-Name: 8daf24ff73dd9928057412e0e4c2e2b2e47e1dca66acfb6b07c846e8d97582cc

2 years agoRework automatically acquired OPFS locks to be released during idle time. This elimin... opfs-lock-without-xlock
stephan [Thu, 10 Nov 2022 13:14:30 +0000 (13:14 +0000)] 
Rework automatically acquired OPFS locks to be released during idle time. This eliminates the performance hit reported in [46304ba057707c].

FossilOrigin-Name: a7fe91afca473fe55c983bc81d214df4ef3699863c7423fa4b6b9cde23d6a3b4

2 years agoOPFS: if an op which needs a lock is called when no lock has been obtained, automatic...
stephan [Thu, 10 Nov 2022 11:35:10 +0000 (11:35 +0000)] 
OPFS: if an op which needs a lock is called when no lock has been obtained, automatically lock it at the start of the op and unlock it at the end of that op. This is an attempt to alleviate the cross-tab contention described in [forum post 58a377083cd24a|forum:58a377083cd24a] but it increases speedtest1 run time by approximately 4x. Perhaps auto-lock can be combined with the older idle-time-based auto-unlock to unlock such locks (but not those from xLock()) to improve this?

FossilOrigin-Name: 46304ba057707c3b072b6e7bb8c4af774f653aa5814099f0866cd87b2b73abeb

2 years agoBetter handle an error in the fts5 integrity-check code. dbsqlfuzz e87c62f9b67ea21aeb...
dan [Wed, 9 Nov 2022 11:17:57 +0000 (11:17 +0000)] 
Better handle an error in the fts5 integrity-check code. dbsqlfuzz e87c62f9b67ea21aebdc36ab71cab7cc3eda8dc3.

FossilOrigin-Name: ae43e97087a3207a5ca3ffae75fbe7a33c01f4a38ce0d1d7eed8591ae3083617

2 years agoAdditional defense against corrupt database files in dbdata.c.
drh [Wed, 9 Nov 2022 11:02:39 +0000 (11:02 +0000)] 
Additional defense against corrupt database files in dbdata.c.

FossilOrigin-Name: 2e70d1e5c9b2c9e068be3ccf8a6062edf7bdde2e46d60ba8ce54eda851af6008

2 years agoIncrease the precision of the nData parameter to the dbdataValue() routine
drh [Wed, 9 Nov 2022 10:17:25 +0000 (10:17 +0000)] 
Increase the precision of the nData parameter to the dbdataValue() routine
inside the sqlite_dbdata virtual table, to avoid the possibility of integer
overflow.

FossilOrigin-Name: 295447b44fc7658891352a9b3f792379b52a76ee5dcfd498b7028f5f87b40e9e

2 years agoFix a problem with URI formatting in calls to sqlite3rbu_vacuum(zDb, NULL) causing...
dan [Tue, 8 Nov 2022 20:04:05 +0000 (20:04 +0000)] 
Fix a problem with URI formatting in calls to sqlite3rbu_vacuum(zDb, NULL) causing problems on win32. First reported here <https://sqlite.org/forum/forumpost/a7ae915a9d>.

FossilOrigin-Name: 77ccc8ea8a901df64feabe08e1210087d060f0bc133242e87a94a71b68b5b5fa

2 years agoDo not attempt to run test script dbpagefault.test with SQLITE_OMIT_VIRTUALTABLE...
dan [Tue, 8 Nov 2022 19:36:26 +0000 (19:36 +0000)] 
Do not attempt to run test script dbpagefault.test with SQLITE_OMIT_VIRTUALTABLE builds.

FossilOrigin-Name: 901918c4867557e51160ef9c495e4e007de26cfe07c237addc00a388662957e8

2 years agoFix a problem in main.mk preventing the amalgamation-testfixture target from building.
dan [Tue, 8 Nov 2022 15:49:12 +0000 (15:49 +0000)] 
Fix a problem in main.mk preventing the amalgamation-testfixture target from building.

FossilOrigin-Name: ccf00a0e22a2a9815ff7db1c6c6457fce35aaf50843c1b5ff2adda22d6f70314

2 years agoFurther improvements to the handling of the u32 and u16 typedefs in the
drh [Mon, 7 Nov 2022 19:40:20 +0000 (19:40 +0000)] 
Further improvements to the handling of the u32 and u16 typedefs in the
shell.c source file.

FossilOrigin-Name: 55a19677d723147aeb2b4a86bbd01756ddeb2072cba72c3145ad32d335e203b0

2 years agoImprove the ability of mkshellc.tcl to remove redundant typedefs from the
drh [Mon, 7 Nov 2022 18:36:02 +0000 (18:36 +0000)] 
Improve the ability of mkshellc.tcl to remove redundant typedefs from the
generated shell.c code.  This is needed to get shell.c to build on older
C compilers.

FossilOrigin-Name: 3645585f37631d60cefab1d55cdb1ee060aae87317b9b158a01329ca8a4d3e1e

2 years agoAdd the sqlite3rbu_rename_handler() API. To override the default routine that RBU...
dan [Mon, 7 Nov 2022 18:00:18 +0000 (18:00 +0000)] 
Add the sqlite3rbu_rename_handler() API. To override the default routine that RBU uses to rename files.

FossilOrigin-Name: ebbb1f88e7b5d6cbe84d400f1a187acedb4c668d0b7e4c63bf1496e57da9b8ad

2 years agoMinor doc updates in speed-check.sh. No code changes.
stephan [Mon, 7 Nov 2022 17:21:53 +0000 (17:21 +0000)] 
Minor doc updates in speed-check.sh. No code changes.

FossilOrigin-Name: d2ed4116fbf1de3c840f84e05db6f29f7b489518ac07d56f61df153deab6bf6b

2 years agoFix an obsolete comment.
drh [Mon, 7 Nov 2022 15:23:51 +0000 (15:23 +0000)] 
Fix an obsolete comment.

FossilOrigin-Name: e377c0a1ef030395293c5f24d7cb8e5b36ce972e9fac31b99c8425075486a46a

2 years agoFix typo in comment.
drh [Mon, 7 Nov 2022 15:01:05 +0000 (15:01 +0000)] 
Fix typo in comment.

FossilOrigin-Name: c3b94d7d4697a5c3983253f6266c544d8037617778a09d491bc12eb13f08ac75

2 years agoAdd sqlite3.wasm.alloc.impl() as a "public back door" into the low-level non-throwing...
stephan [Mon, 7 Nov 2022 13:06:20 +0000 (13:06 +0000)] 
Add sqlite3.wasm.alloc.impl() as a "public back door" into the low-level non-throwing allocator. Correct sqlite3.WasmAllocError constructor to behave like its usages expect it to and add tests for that.

FossilOrigin-Name: cea8bf9a144d842c4755c3130273524926e8c4831d7f21c4e34d4e8c74109c8c

2 years agoFix requirements marks so that they match documentation corrections.
drh [Mon, 7 Nov 2022 12:21:06 +0000 (12:21 +0000)] 
Fix requirements marks so that they match documentation corrections.

FossilOrigin-Name: 10d6189d23133006b39ea230045a918483721dd48f5558f77e57e23693097d16

2 years agoMinor wasm doc touchups. No code changes.
stephan [Mon, 7 Nov 2022 12:12:27 +0000 (12:12 +0000)] 
Minor wasm doc touchups. No code changes.

FossilOrigin-Name: 2c448368913a844bdb5e69f8fa3bad91a2b6612ba3b7f3f650dd07b81db25a77

2 years agoFix the documentation regarding negative length parameters for
drh [Mon, 7 Nov 2022 11:19:28 +0000 (11:19 +0000)] 
Fix the documentation regarding negative length parameters for
sqlite3_result_text() interfaces, to point out that the length parameter
to sqlite3_result_text64() cannot be negative.
[forum:/forumpost/cf1d043b07|Forum post cf1d043b07].
Comment/documentation change only.

FossilOrigin-Name: 8016507651f377b08deb3a13cc559d56ce6e934c3073a8e63d05fd946b8403a4

2 years agoMake sure that the recoverStrlen() function (used internally by the new
drh [Mon, 7 Nov 2022 11:05:53 +0000 (11:05 +0000)] 
Make sure that the recoverStrlen() function (used internally by the new
recovery extension) is 64-bit safe.

FossilOrigin-Name: ea30a6bfc463acce26a4d710e7bf56519ad096ce2fe904ee7e199f5c55068034