]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
4 weeks agoMerge trunk into column-text-blob-v2 branch. column-text-blob-v2
stephan [Fri, 11 Jul 2025 14:18:19 +0000 (14:18 +0000)] 
Merge trunk into column-text-blob-v2 branch.

FossilOrigin-Name: a5369e67f76087e20498bcbd64f34186949a443bee716311d968d125f2ca962a

4 weeks agoAdd column/value_text/blob_v2() to the sqlite3_api object.
stephan [Fri, 11 Jul 2025 12:56:59 +0000 (12:56 +0000)] 
Add column/value_text/blob_v2() to the sqlite3_api object.

FossilOrigin-Name: ae29cc313565e62e18af6f742eebd91df02a9b5b8f9a746113c95802bb7c9f62

4 weeks agospeedtest1: in WASM builds, disable the "app" test set by default because that one...
stephan [Fri, 11 Jul 2025 11:06:25 +0000 (11:06 +0000)] 
speedtest1: in WASM builds, disable the "app" test set by default because that one set is triggering file-not-found errors for the db file for reasons not yet understood.

FossilOrigin-Name: 9d68971c58261bce72b49c574cf07ad31add62bee814c58840b927fed7eb87b1

4 weeks agoDo not export the numerous Emscripten HEAPxy symbols and remove the last remaining...
stephan [Fri, 11 Jul 2025 10:27:06 +0000 (10:27 +0000)] 
Do not export the numerous Emscripten HEAPxy symbols and remove the last remaining JS code which references them. They have long-since been replaced by internal equivalents and a specific feature check on one of them (which is also no longer needed) is triggering an exception from Emscripten. More details are in [https://github.com/emscripten-core/emscripten/issues/24656 | Emscripten ticket #24656], noting that this is not an Emscripten bug but an Emscripten behavior change brought it to light.

FossilOrigin-Name: b9462dc1461c830466f4e1de4a4d3bf249e3f81aea363f13462ea915769878d9

4 weeks agoImprove the accuracy of the ETC on both devtest and releasetest.
drh [Thu, 10 Jul 2025 20:45:00 +0000 (20:45 +0000)] 
Improve the accuracy of the ETC on both devtest and releasetest.

FossilOrigin-Name: a3f96cafdc0e1f2eeccc6509f1f9c26d2c48668953550f299cf2805a0a063014

4 weeks agoAdd the estkey column to the jobs table of testrunner.db. The plan is to
drh [Thu, 10 Jul 2025 17:19:08 +0000 (17:19 +0000)] 
Add the estkey column to the jobs table of testrunner.db.  The plan is to
use this to collect measurements that will help generate improved ETAs for
a test run.

FossilOrigin-Name: 9eccf5267c6423c9dd4da1d61b62bbb6fbba44fb8089da79f89c84e8b77ff0f0

4 weeks agoMinor internal doc correction in vdbeInt.h.
stephan [Thu, 10 Jul 2025 09:27:57 +0000 (09:27 +0000)] 
Minor internal doc correction in vdbeInt.h.

FossilOrigin-Name: c3a2ef639c22255a298cbccb7fd871ec9b24929f82bf95d6982b12daf5c963d6

4 weeks agoFix the empty-table optimization on INTERSECT so that it does not try to
drh [Wed, 9 Jul 2025 20:11:49 +0000 (20:11 +0000)] 
Fix the empty-table optimization on INTERSECT so that it does not try to
use an uninitialized register for LIMIT processing.

FossilOrigin-Name: 6918ada008507b4564ca0dc5f4f6818c49a42eb14a16285b2074e21dcc8f2c3f

4 weeks agoFix a possible user-after free following OOM in the EXISTS-to-JOIN
drh [Tue, 8 Jul 2025 22:11:39 +0000 (22:11 +0000)] 
Fix a possible user-after free following OOM in the EXISTS-to-JOIN
optimization.

FossilOrigin-Name: 498ee8d514e64cdc93a8d68e1971b6326c6132daf25067936bec921c42494caa

4 weeks agoAdjustments to test/incrblob4.test so that it works on both Linux and Mac
drh [Tue, 8 Jul 2025 20:28:35 +0000 (20:28 +0000)] 
Adjustments to test/incrblob4.test so that it works on both Linux and Mac
in spite of error message differences between those platforms.  Minor change
to termIsEquivalent() to provide 100% MC/DC.

FossilOrigin-Name: 720387f8604f7cd997f1850ed62ce6ab32608155d7f02a89c695041caafc4067

4 weeks agoNew optimizations to detect early when queries return no rows due to
drh [Tue, 8 Jul 2025 19:53:36 +0000 (19:53 +0000)] 
New optimizations to detect early when queries return no rows due to
tables being empty.  This includes the EXISTS-to-JOIN optimization that
tries to transform EXISTS constraints into additional terms of the FROM
clause.

FossilOrigin-Name: e33da6d5dc964db817d1bc63c9083aecd93d49ee14d5198600b47eaf7c5b9331

4 weeks agoFix a problem with the fix in [5cb8e342e1].
dan [Tue, 8 Jul 2025 19:02:26 +0000 (19:02 +0000)] 
Fix a problem with the fix in [5cb8e342e1].

FossilOrigin-Name: 043ff54fb746c54bc6cfa6aa8c8a32c876c09d36163125916ad01024b98d447b

4 weeks agoFix another problem with running fts5 integrity-check in SQLITE_DEBUG builds, this...
dan [Tue, 8 Jul 2025 18:44:56 +0000 (18:44 +0000)] 
Fix another problem with running fts5 integrity-check in SQLITE_DEBUG builds, this one causing an assert() failure.

FossilOrigin-Name: 5cb8e342e1d33a0fd04fd022900eeada46a2ee23f15c6abca1b37633e77429d6

4 weeks agoEnable the EXISTS-to-JOIN optimization if the outer query has no empty-table-optimizations
drh [Tue, 8 Jul 2025 17:28:09 +0000 (17:28 +0000)] 
Enable the EXISTS-to-JOIN optimization if the outer query has no
FROM clause.

FossilOrigin-Name: 1b9b124f9a35ebd1ac4ea70ef1ee08a4c82c11da690d4164f6b785a6fd9730d9

4 weeks agoIf SQLITE_DEBUG is defined, fts5 does extra checks as part of integrity-check. Ensure...
dan [Tue, 8 Jul 2025 14:54:20 +0000 (14:54 +0000)] 
If SQLITE_DEBUG is defined, fts5 does extra checks as part of integrity-check. Ensure that errors from these extra checks are only reported if the other, normal, tests all pass. This fixes a test case in fts5corrupt3.test that was failing if SQLITE_DEBUG was defined.

FossilOrigin-Name: 98a53fb276fa1fa733da2dd3255c35ce9f6af9b9feef6e76fb577b6d142167a2

4 weeks agoFix test case results in FTS5 that were changed error message improvements
drh [Tue, 8 Jul 2025 12:37:25 +0000 (12:37 +0000)] 
Fix test case results in FTS5 that were changed error message improvements
in [48044a6b57c0a16c] but which were omitted from that check-in.

FossilOrigin-Name: e1f8e0240b14f1338e947634e840af785e5042a09cd365975e922a13a562f4cd

4 weeks agoOnly run preupdate-hook tests in incrblob4.test if the preupdate-hook is enabled...
dan [Mon, 7 Jul 2025 20:47:23 +0000 (20:47 +0000)] 
Only run preupdate-hook tests in incrblob4.test if the preupdate-hook is enabled in the build.

FossilOrigin-Name: 56314b6b53c86ae131f780e20b62bdeabccba6d62dda41becc1c4b2e87cee07b

4 weeks agoSmall performance optimization in the resolver.
drh [Mon, 7 Jul 2025 19:03:50 +0000 (19:03 +0000)] 
Small performance optimization in the resolver.

FossilOrigin-Name: 840646df0696706bd4dd7a04dfc8b16ad80c24cbcbc57a22c9e65a93cc17af2b

4 weeks agoMerge the latest trunk enhancements and fixes into the empty-table-optimizations...
drh [Mon, 7 Jul 2025 18:35:51 +0000 (18:35 +0000)] 
Merge the latest trunk  enhancements and fixes into the empty-table-optimizations branch.

FossilOrigin-Name: f15cdf07573c05276a13885d74bae21a93544766344f19ef939b7a69edd1073b

4 weeks agoRework the fix to the problem described by
drh [Mon, 7 Jul 2025 16:19:44 +0000 (16:19 +0000)] 
Rework the fix to the problem described by
[forum:/forumpost/b9647a113b465950|forum post b9647a113b] so that it
provides a more complete fix that covers cases that were not resolved by
the original fix, and so that it does not cause performance regressions.

FossilOrigin-Name: 28db0d152d90fb5e62d03ea5caceabe8901be98522aef3dc2b54564fbc35355d

4 weeks agoSimplifications to the row-value IN operator logic. Do not let the query redundant-idx-columns
drh [Mon, 7 Jul 2025 15:40:53 +0000 (15:40 +0000)] 
Simplifications to the row-value IN operator logic.  Do not let the query
planner accept a WhereLoop for a row-value IN operator that uses the same
index column more than once.

FossilOrigin-Name: d2adf61f21a3ce901a2b08199ad0de191e88ef16e097c5f7a75c95ad958eff12

4 weeks agoWork around the Emscripten 4.10 regression described in [https://github.com/emscripte...
stephan [Mon, 7 Jul 2025 12:11:26 +0000 (12:11 +0000)] 
Work around the Emscripten 4.10 regression described in [https://github.com/emscripten-core/emscripten/issues/24656 | Emscripten ticket #24656]. Problem reported off-list by BrickViking.

FossilOrigin-Name: c385475b250f3364507a95c5832137098a9bb7c7fc12ab3bb116e1fad7bb7645

4 weeks agoAvoid invoking the preupdate hook from within sqlite3_blob_write() if the cursor...
dan [Mon, 7 Jul 2025 11:37:55 +0000 (11:37 +0000)] 
Avoid invoking the preupdate hook from within sqlite3_blob_write() if the cursor is already invalid.

FossilOrigin-Name: 9f335b9a4e9e761a0c6afd6dc69665a24506141bde88530bf59fcbdf957ae881

4 weeks agoBack out the fix at [ba7d5bad32ad6aac] because it does not always work and because
drh [Mon, 7 Jul 2025 10:54:00 +0000 (10:54 +0000)] 
Back out the fix at [ba7d5bad32ad6aac] because it does not always work and because
it causes a performance regression.  Add new test cases for row-value lookups of
indexes that contain redundant columns, three of which are currently failing.  This
branch is seeking an improved solution to the redundant index column problem for
row-value lookups.

FossilOrigin-Name: ad8ddcefab5cc526b1cd77731e00939c672e61ca83350d28961b67635d20da03

4 weeks agoFix parser error introduced by [325e547a2195571e]. See
drh [Mon, 7 Jul 2025 02:18:27 +0000 (02:18 +0000)] 
Fix parser error introduced by [325e547a2195571e].  See
[forum:/forumpost/095dbfc06e5b1f7e|forum post 095dbfc06e5].

FossilOrigin-Name: 4eefab44941fc6e17742fa49c8734e7f00a2177d82bc572e596228add53aad39

5 weeks agoImprovements to the EXPLAIN QUERY PLAN output for EXISTS-to-JOIN.
drh [Sun, 6 Jul 2025 01:19:09 +0000 (01:19 +0000)] 
Improvements to the EXPLAIN QUERY PLAN output for EXISTS-to-JOIN.

FossilOrigin-Name: 6b1ecbaa2ee405be040901dceac45d027d35c313622748ba4dbbd404e297a7fa

5 weeks agoEnhance the EXISTS-to-JOIN optimization so that it works on EXISTS subqueries
drh [Sat, 5 Jul 2025 23:33:21 +0000 (23:33 +0000)] 
Enhance the EXISTS-to-JOIN optimization so that it works on EXISTS subqueries
that do not have a WHERE clause, and so that it works on nested EXISTS
subqueries.

FossilOrigin-Name: c1d5295724f9cf7f49e0786d28016eff2d268a2b670f934d24c76787626089db

5 weeks agoAdd 'reconfigure' target to Makefile.in to re-run the configure script with the same...
stephan [Fri, 4 Jul 2025 18:32:18 +0000 (18:32 +0000)] 
Add 'reconfigure' target to Makefile.in to re-run the configure script with the same flags it was generated with.

FossilOrigin-Name: c60907e77b32824aaaf024d299cdaf161b5f64fc927ffe5d5455eeb5754e6b01

5 weeks agoPropagate the -ldl and -lpthread flags, if needed, into sqlite3.pc, per request in...
stephan [Fri, 4 Jul 2025 17:20:37 +0000 (17:20 +0000)] 
Propagate the -ldl and -lpthread flags, if needed, into sqlite3.pc, per request in [forum:44a58c807353162f | forum post 44a58c807353162f].

FossilOrigin-Name: 64f5f14322349b47451b8cac03bf8cd6f1ae45a8822e7f1ddee3d0b265047501

5 weeks agoMerge fixes from trunk into the empty-table-optimizations branch
drh [Fri, 4 Jul 2025 14:24:18 +0000 (14:24 +0000)] 
Merge fixes from trunk into the empty-table-optimizations branch

FossilOrigin-Name: 6f98b16d210a9f5b6ca4b4599e3dab3263eddbae7c70ddbcabf988f4a1014e8b

5 weeks agoFix harmless compiler warnings.
drh [Fri, 4 Jul 2025 12:25:24 +0000 (12:25 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: 13af4acebe09b047756c22b800136cffaba532e7fcaa448a4edf4fedb94e9bbc

5 weeks agoRemove an ALWAYS() added by [960a8e6fc91f4] that turns out to be false
drh [Fri, 4 Jul 2025 11:48:11 +0000 (11:48 +0000)] 
Remove an ALWAYS() added by [960a8e6fc91f4] that turns out to be false
in some cases of malformed SQL.

FossilOrigin-Name: cc8171461bf35f584888a24b844c8b79ad30155b19b61161e9f3abc276e8aae5

5 weeks agoDo not allow the EXISTS-to-JOIN optimization if the EXISTS clause is based
drh [Fri, 4 Jul 2025 11:06:34 +0000 (11:06 +0000)] 
Do not allow the EXISTS-to-JOIN optimization if the EXISTS clause is based
on a view, since that view might expand into a join.

FossilOrigin-Name: 872c41feddafcc21a02f1229ce017ceea9f8e309a4dd5b6e323477d67f975947

5 weeks agoImprove the early-termination optimization so that it works in queries
drh [Fri, 4 Jul 2025 10:26:55 +0000 (10:26 +0000)] 
Improve the early-termination optimization so that it works in queries
which use the LIKE optimization in the outer loop.

FossilOrigin-Name: b4e4d148243cfcb09aa0aaca30e83812b42e2780073e55c0e8c6e3da16243dfc

5 weeks agoMerge trunk into column-text-blob-v2 branch.
stephan [Fri, 4 Jul 2025 10:17:25 +0000 (10:17 +0000)] 
Merge trunk into column-text-blob-v2 branch.

FossilOrigin-Name: f73460d4f04729d5d660812ac969e3e02be9d0e44741773b29828252f9927e63

5 weeks agoTweak for coverage testing of valueToTextV2(). This changes passes through coverage...
stephan [Fri, 4 Jul 2025 10:10:32 +0000 (10:10 +0000)] 
Tweak for coverage testing of valueToTextV2(). This changes passes through coverage testing but doesn't look quite right to me, in that this part now differs from its counterpart in valueToText() (which doesn't need this to get coverage for what amounts to the same path).

FossilOrigin-Name: dae572912ff0e6acf14422caf5ceaab88878ee07eb9b3e9b2c8e878c36461707

5 weeks agoMerge the latest trunk fixes and enhancements into the empty-table-optimizations...
drh [Thu, 3 Jul 2025 20:51:08 +0000 (20:51 +0000)] 
Merge the latest trunk fixes and enhancements into the empty-table-optimizations branch

FossilOrigin-Name: d4f47e04f5880e99a53089e2dd5cde64a7ea44f059d9906b5d11324896546714

5 weeks agoFix a few cases where LIMIT clauses that were part of scalar sub-queries on virtual...
dan [Thu, 3 Jul 2025 16:05:41 +0000 (16:05 +0000)] 
Fix a few cases where LIMIT clauses that were part of scalar sub-queries on virtual tables were not being passed to xBestIndex methods correctly.

FossilOrigin-Name: 960a8e6fc91f47add3a089dc6cef013109deadf809994c5149ad3bdfb3884de0

5 weeks agoImprovements to sqlite3_vtab_rhs_value() logging in the vtab-limit-fixes
drh [Thu, 3 Jul 2025 15:50:18 +0000 (15:50 +0000)] 
Improvements to sqlite3_vtab_rhs_value() logging in the
ext/misc/vtablog.c extension.

FossilOrigin-Name: 25131ee84f53dab1191e02c19cefd256aed2828c7edea325fcc0ba3b0a668583

5 weeks agoMake the value of an explicit LIMIT clause on a scalar sub-query available to xBestIn...
dan [Thu, 3 Jul 2025 15:32:27 +0000 (15:32 +0000)] 
Make the value of an explicit LIMIT clause on a scalar sub-query available to xBestIndex for simple "LIMIT 0" and "LIMIT 1" queries.

FossilOrigin-Name: 33b6a63caafccc61b3193714911cd8b5dd9b7f1798054b8c7845b23688d531f2

5 weeks agoMake handling of LIMIT clauses in correlated sub-queries on virtual tables more effic...
dan [Thu, 3 Jul 2025 14:28:47 +0000 (14:28 +0000)] 
Make handling of LIMIT clauses in correlated sub-queries on virtual tables more efficient.

FossilOrigin-Name: 7214cb2a5b35190a06a1040cd4c54f325d347f8d8e36a07fd76c0a421e266522

5 weeks agoEnhancements to the xBestIndex output from the ext/misc/vtablog.c
drh [Thu, 3 Jul 2025 14:10:03 +0000 (14:10 +0000)] 
Enhancements to the xBestIndex output from the ext/misc/vtablog.c
extension.

FossilOrigin-Name: 8b31acc0b18f38eb4af6efebd1ea25cd65a146651101579aee20afd9ec6dc2de

5 weeks agoFix an uninitialized variable added yesterday by [d27d34fb746280e7].
drh [Thu, 3 Jul 2025 11:52:17 +0000 (11:52 +0000)] 
Fix an uninitialized variable added yesterday by [d27d34fb746280e7].
This problem was discovered overnight by
[https://github.com/google/oss-fuzz|OSSFuzz].

FossilOrigin-Name: 6db4703f1178fc808f3a75c355fb6638fb12c88f6e1ce7f579e200ced8089114

5 weeks agoMinor tweaks to the exists-to-join optimization.
drh [Thu, 3 Jul 2025 00:17:27 +0000 (00:17 +0000)] 
Minor tweaks to the exists-to-join optimization.

FossilOrigin-Name: 9cb600ad576c68647ed943a0773019312c5f01c9c1ca9ff0bf1214b03a531b48

5 weeks agoMerge in the exists-to-join optimization that has been modified
drh [Wed, 2 Jul 2025 20:46:02 +0000 (20:46 +0000)] 
Merge in the exists-to-join optimization that has been modified
to relax the requirement of having an indexed join constraint.

FossilOrigin-Name: 1c1aef2b7feae29066d0330699ab634ef41f5b60cdcd479a60cb1a5409553138

5 weeks agoFix VDBE coverage
drh [Wed, 2 Jul 2025 17:43:59 +0000 (17:43 +0000)] 
Fix VDBE coverage

FossilOrigin-Name: ff593a16d61cc5c588d1737deb822abb90b1759475a4cabfcf608978b1191487

5 weeks agoCorrect mis-placed OOM checks in valueToTextV2().
stephan [Wed, 2 Jul 2025 15:29:11 +0000 (15:29 +0000)] 
Correct mis-placed OOM checks in valueToTextV2().

FossilOrigin-Name: 9226a2a3c60a0f11fec9dd66cfa89ad8e625e9f0507e8d66ba2a06caafd65a9c

5 weeks agoEarly exit if one of the inner loops of a 3-way or larger join is an
drh [Wed, 2 Jul 2025 14:53:48 +0000 (14:53 +0000)] 
Early exit if one of the inner loops of a 3-way or larger join is an
empty table.

FossilOrigin-Name: eaad6ac707a5960d9518d4049b7b1759e7512727ce87be3c402408144bda0a97

5 weeks agoPer /chat and forum discussions: (A) Remove the value type output pointer from text...
stephan [Wed, 2 Jul 2025 13:24:50 +0000 (13:24 +0000)] 
Per /chat and forum discussions: (A) Remove the value type output pointer from text/blob_v2(). (B) Teach blob_v2() to return an opaque non-NULL pointer for length-0 blobs.

FossilOrigin-Name: c96539beb5ca3c6a467e5388b942767765a3f071e009c1767d3b4f1b0fb5da9c

5 weeks agoIf the LHS for an EXCEPT or INTERSECT operator is empty, skip over the
drh [Wed, 2 Jul 2025 13:19:24 +0000 (13:19 +0000)] 
If the LHS for an EXCEPT or INTERSECT operator is empty, skip over the
computation of the RHS.

FossilOrigin-Name: 13f096ae8a850a05d4a8684561066f11693ee66289e6568c44ef32822cca06f6

5 weeks agoImprove the bytecode for joins such that it exits earlier if it determines
drh [Wed, 2 Jul 2025 11:47:54 +0000 (11:47 +0000)] 
Improve the bytecode for joins such that it exits earlier if it determines
that no output is possible.

FossilOrigin-Name: 2d2b61cba44a756a3a41ef5c95bbb0c0b7111f4b679c578fec9bd0b214cca367

5 weeks agoAdd test1.c tcl bindings for sqlite3_column_text/blob_v2(). Replace, essentially...
stephan [Wed, 2 Jul 2025 07:52:30 +0000 (07:52 +0000)] 
Add test1.c tcl bindings for sqlite3_column_text/blob_v2(). Replace, essentially randomly, some of the v1 API calls in capi2.test and capi2.test with the v2 calls to ensure identical results. Add a couple new tests comparing results between v1 and v2.

FossilOrigin-Name: a3ca0adbaf7da8d79341fa88919b11d49a040e5125c67962b93a98ea43f539c9

5 weeks agoEnsure that Expr.op2 values for TK_AGG_FUNCTION nodes are adjusted when
drh [Wed, 2 Jul 2025 02:03:43 +0000 (02:03 +0000)] 
Ensure that Expr.op2 values for TK_AGG_FUNCTION nodes are adjusted when
query flattening.

FossilOrigin-Name: d27d34fb746280e7e81335db4e195914b15403ef0da7b2955550553dd78fbe9a

5 weeks agoImproved comments on bytecode used to implement aggregate queries, to aid
drh [Tue, 1 Jul 2025 23:17:36 +0000 (23:17 +0000)] 
Improved comments on bytecode used to implement aggregate queries, to aid
in debugging.

FossilOrigin-Name: a1a8b85cdba64a17dcdcd4e6b42b872957cec2dc05b0ac34dfcd82f59344034b

5 weeks agoRemove an #if 0 block.
stephan [Tue, 1 Jul 2025 21:33:26 +0000 (21:33 +0000)] 
Remove an #if 0 block.

FossilOrigin-Name: 0363c430b5ab8eb8cec526933da2b32263b1959c8a2210bb0e0b1529e72c6f63

5 weeks agoHave sqlite3_value/column_text/blob_v2() return MISUSE for a NULL input object or...
stephan [Tue, 1 Jul 2025 21:06:58 +0000 (21:06 +0000)] 
Have sqlite3_value/column_text/blob_v2() return MISUSE for a NULL input object or output target only if SQLITE_ENABLE_API_ARMOR is in effect, for consistency with their sibling APIs.

FossilOrigin-Name: 6290a8eaddd97acd02ee417e28c2815e5f3af67acdfc1d97a2cd88b0aee823c0

5 weeks agoHave sqlite3_value/column_text/blob_v2() unconditionally return MISUSE for a NULL...
stephan [Tue, 1 Jul 2025 20:56:49 +0000 (20:56 +0000)] 
Have sqlite3_value/column_text/blob_v2() unconditionally return MISUSE for a NULL input object or output target, rather than only when API_ARMOR is in effect. This is debatable.

FossilOrigin-Name: c8edbfc7e8b57e7b1c9a4a5cdfdc00cd7216b6ccc36ff983f85ad94865f6288f

5 weeks agoImproved byte-code comments for the short-circuit optimization of
drh [Tue, 1 Jul 2025 20:32:45 +0000 (20:32 +0000)] 
Improved byte-code comments for the short-circuit optimization of
[0083d5169a46104a], to aid in debugging.

FossilOrigin-Name: 113f9d10e347eeaa893ff8b47a461009e0b12589374b93cf3e0bddd19c702dea

5 weeks agoParameter number doc corrections for the previous check-in.
stephan [Tue, 1 Jul 2025 18:38:02 +0000 (18:38 +0000)] 
Parameter number doc corrections for the previous check-in.

FossilOrigin-Name: 97b06c4594dc3d056334dfba6f310fb6d058456adde6abacfef29f0244637d39

5 weeks agoAdd API docs for sqlite3_column_text_v2() and sqlite3_column_blob_v2().
stephan [Tue, 1 Jul 2025 18:36:11 +0000 (18:36 +0000)] 
Add API docs for sqlite3_column_text_v2() and sqlite3_column_blob_v2().

FossilOrigin-Name: 60614fed447270b8342f6ee04f4ed9d5c81393c5344a917820a0a7e571de19a9

5 weeks agoRandom JS cleanups and docs.
stephan [Tue, 1 Jul 2025 17:38:08 +0000 (17:38 +0000)] 
Random JS cleanups and docs.

FossilOrigin-Name: 5a2734bbf8b471fa27f8f4b687e4d24f64c7663b823908f1ee8cd21bb93beb98

5 weeks agoCache and reuse virtual table cursors in the bytecode engine.
drh [Tue, 1 Jul 2025 17:36:55 +0000 (17:36 +0000)] 
Cache and reuse virtual table cursors in the bytecode engine.

FossilOrigin-Name: 2d187d4232d750cb1840f1d89c8aed65962cb0883c1d7f91c554b451e475c514

5 weeks agoExperimentally add another output pointer to the text/blob_v2() family which gets...
stephan [Tue, 1 Jul 2025 16:38:58 +0000 (16:38 +0000)] 
Experimentally add another output pointer to the text/blob_v2() family which gets the sqlite3_value_type() assigned to it if it's not NULL, based on feedback in the forum.

FossilOrigin-Name: 4aab781d2abc64a39c53acd0faf6d60bb38afcce42f25bc8c0fa52b73df05312

5 weeks agoAvoid an assert() failure in fts5 that may occur when processing corrupt records.
dan [Tue, 1 Jul 2025 16:21:47 +0000 (16:21 +0000)] 
Avoid an assert() failure in fts5 that may occur when processing corrupt records.

FossilOrigin-Name: 8afd6ca85724a69970181042d6aac53742ea2b76ded5966b2541c3afe1121fb9

5 weeks agoMerge trunk fixes into the empty-table-optimizations branch.
drh [Tue, 1 Jul 2025 15:13:37 +0000 (15:13 +0000)] 
Merge trunk fixes into the empty-table-optimizations branch.

FossilOrigin-Name: 63306e447efb3ac17e789a331ed3bb65459eb8b79d66e9c185ba3bd852f34ce3

5 weeks agoSimplify the column_text/blob_v2() JS tests a bit and correct the text_v2() tests...
stephan [Tue, 1 Jul 2025 14:44:12 +0000 (14:44 +0000)] 
Simplify the column_text/blob_v2() JS tests a bit and correct the text_v2() tests to call into both the column and value variants.

FossilOrigin-Name: d5cb8080434bc13616d70aac516762ca8be622bf51a07f8c36d8657c410e03ce

5 weeks agoInitial implementations of sqlite3_column_text_v2(), sqlite3_column_blob_v2(), and...
stephan [Tue, 1 Jul 2025 13:01:07 +0000 (13:01 +0000)] 
Initial implementations of sqlite3_column_text_v2(), sqlite3_column_blob_v2(), and their JS/WASM bindings/tests.

FossilOrigin-Name: 1d065231aba8080ffd024497ad858eed22ece45fe82a749494a3efaa10f91389

5 weeks agoWhen attempting to optimize "expr AND false" to "false" and
drh [Tue, 1 Jul 2025 12:43:13 +0000 (12:43 +0000)] 
When attempting to optimize "expr AND false" to "false" and
"expr IN ()" to "false", take care not to delete aggregate functions
in the "expr" as doing so can change the meaning of the query.
See [forum:/forumpost/f4878de3e7dd4764|forum thread f4878de3e7].

FossilOrigin-Name: 77397bd67d918db57d5ac545d6d963194806fdabcdaa8f822b6b09e4cfe8b715

5 weeks agoAdd tests which demonstrate the difference in behavior for zero-length results in...
stephan [Tue, 1 Jul 2025 09:02:27 +0000 (09:02 +0000)] 
Add tests which demonstrate the difference in behavior for zero-length results in sqlite3_value_text_v2() (empty string) vs sqlite3_value_blob_v2() (NULL).

FossilOrigin-Name: 2e7cf00d161e151d49113928fd3ef05069ecbe0635eddd844e9220bd015fe6f9

5 weeks agoAdd JS tests for SQLITE_ENABLE_API_ARMOR-shielded sqlite3_value_blob/text_v2() misuse.
stephan [Tue, 1 Jul 2025 00:34:15 +0000 (00:34 +0000)] 
Add JS tests for SQLITE_ENABLE_API_ARMOR-shielded sqlite3_value_blob/text_v2() misuse.

FossilOrigin-Name: 3c0de5b33ce5c41363d004f8359ba41486d014bb04ec7806ba8eb8636fbbdd4c

5 weeks agoAdd JS basic tests for sqlite3_value_blob_v2(). Simplify the sqlite3_value_text_v2...
stephan [Tue, 1 Jul 2025 00:17:30 +0000 (00:17 +0000)] 
Add JS basic tests for sqlite3_value_blob_v2(). Simplify the sqlite3_value_text_v2() tests a bit.

FossilOrigin-Name: c371f92d5b42f2436d2dc92f244e11748fa8cf00e3818b613cce7ea0cfe09c87

5 weeks agoAdd JS bindings for sqlite3_value_text/blob_v2() and add basic JS tests for text_v2().
stephan [Mon, 30 Jun 2025 23:49:21 +0000 (23:49 +0000)] 
Add JS bindings for sqlite3_value_text/blob_v2() and add basic JS tests for text_v2().

FossilOrigin-Name: 096c745f38c487c29948e4578fea61085f4a324b187d5b6e9ab32d7b14e503c3

5 weeks agoRestart this branch using a different take: add new "v2" routines instead of refactor...
stephan [Mon, 30 Jun 2025 23:17:57 +0000 (23:17 +0000)] 
Restart this branch using a different take: add new "v2" routines instead of refactoring the old ones, which eliminating any performance impact or risk of behavior change for existing APIs. None of this code is actually called from anywhere yet.

FossilOrigin-Name: b0b1b4ccb9b135a6feab73113a31064bac0895464ae36e936fcdcffeaa0933d3

5 weeks agoMore aggressive optimization of addrHalt for RIGHT JOIN.
drh [Mon, 30 Jun 2025 21:07:08 +0000 (21:07 +0000)] 
More aggressive optimization of addrHalt for RIGHT JOIN.

FossilOrigin-Name: 5e51d1c0dfcafef9e71c99de3f626dee157c935724b84c6e0c630299a880446f

5 weeks agoCompute WhereLevel.addrBrk and .addrHalt early so that those labels can be
drh [Mon, 30 Jun 2025 20:19:19 +0000 (20:19 +0000)] 
Compute WhereLevel.addrBrk and .addrHalt early so that those labels can be
used to abort loops early.  Use this to improve performance on two more
of the cases described by [forum:/forumpost/52651713ac|forum post 52651713ac].

FossilOrigin-Name: 6fc0b9ac23be6840542982de4bb282ebca1db8b5ab3baefdde95a997c1506e81

5 weeks agoStrive to skip the evaluation of scalar subqueries that are part of a
drh [Mon, 30 Jun 2025 16:41:40 +0000 (16:41 +0000)] 
Strive to skip the evaluation of scalar subqueries that are part of a
larger expression if the result from the scalar subquery does not change the
result of the overall expression.

FossilOrigin-Name: 0083d5169a46104a25355bdd9d5a2f4027b049191ebda571dd228477ec217296

5 weeks agoFor all binary operators, try to avoid computing subquery operands if the optimize-null-values
drh [Mon, 30 Jun 2025 12:14:47 +0000 (12:14 +0000)] 
For all binary operators, try to avoid computing subquery operands if the
other operand is NULL.

FossilOrigin-Name: d86eb16283c4b573c506d4faa422d5d9aeb6abc279d8e6a8e2104737162d417f

5 weeks agoSlightly smaller and faster version of the previous check-in.
drh [Mon, 30 Jun 2025 11:04:55 +0000 (11:04 +0000)] 
Slightly smaller and faster version of the previous check-in.

FossilOrigin-Name: f6e6fd02f4ad49c390a2d3c9626d57f9b2fff1f67eb361b30074cc1f5121810e

5 weeks agoMinor API doc typo fixes from brickviking.
stephan [Mon, 30 Jun 2025 11:00:59 +0000 (11:00 +0000)] 
Minor API doc typo fixes from brickviking.

FossilOrigin-Name: b48d95191662e09659b5b55ae65cd462c9e1700c4f92dd9d40b59548f0797c02

5 weeks agoFactor out the code that tries to avoid evaluating subquery operands if the
drh [Mon, 30 Jun 2025 10:30:47 +0000 (10:30 +0000)] 
Factor out the code that tries to avoid evaluating subquery operands if the
other operand is NULL into a subroutine, so that it can be more easily reused
by other parts of the code generator.

FossilOrigin-Name: 3c6c71bcea16443b82234414137dfa1b59e2ee8fe5097906c738fc1228fec4e6

6 weeks agoMinor API doc typo fixes from brickviking.
stephan [Sun, 29 Jun 2025 07:32:20 +0000 (07:32 +0000)] 
Minor API doc typo fixes from brickviking.

FossilOrigin-Name: c7cf9dcb69ce558ba6b81b2787f92ed7383e37f08b199faeb14f7adb4e494532

6 weeks agoImprove the bytecode generated for comparisons so that if one operand is
drh [Sat, 28 Jun 2025 17:59:15 +0000 (17:59 +0000)] 
Improve the bytecode generated for comparisons so that if one operand is
a subquery and the other operand evaluates to NULL, the subquery operand
is not even computed.  This fixes 5 of the 12 slow queries described
in [forum:/forumpost/52651713ac|forum post 52651713ac].

FossilOrigin-Name: f147bc04776ac0056412f69dfc518016c0d5b4e9d964664e3d88f595fb29dbe0

6 weeks agoRaise an error right away if the number of aggregate terms in a query
drh [Fri, 27 Jun 2025 19:02:21 +0000 (19:02 +0000)] 
Raise an error right away if the number of aggregate terms in a query
exceeds the maximum number of columns.

FossilOrigin-Name: 5508b56fd24016c13981ec280ecdd833007c9d8dd595edb295b984c2b487b5c8

6 weeks agoAPI doc typo fixes and closing DD element tags from brickviking.
stephan [Fri, 27 Jun 2025 12:46:50 +0000 (12:46 +0000)] 
API doc typo fixes and closing DD element tags from brickviking.

FossilOrigin-Name: c9ddd15b0197e6e5c5a74581d94cf986523514ffdb28c66ba18de9a22aec97e9

6 weeks agoWork around an apparent GCC UBSAN bug. See
drh [Thu, 26 Jun 2025 18:57:20 +0000 (18:57 +0000)] 
Work around an apparent GCC UBSAN bug.  See
[forum:/forumpost/1d7c25d4a2d6f5e2|forum thread 1d7c25d4a2d] for details.

FossilOrigin-Name: 23056532e51abcff486e38a3319545e6663b4a855abe1bc443e2cd7e0473748c

6 weeks agoMinor API doc fixes sent off-list from brickviking.
stephan [Wed, 25 Jun 2025 20:42:40 +0000 (20:42 +0000)] 
Minor API doc fixes sent off-list from brickviking.

FossilOrigin-Name: cb4d05633a0c9cdf146f3108e1b4b10754cd79d72a425d8cc9cd21836037a01b

6 weeks agoSimilar fix to the previous check-in, but this time for
drh [Tue, 24 Jun 2025 18:27:59 +0000 (18:27 +0000)] 
Similar fix to the previous check-in, but this time for
sqlite3_preupdate_new().

FossilOrigin-Name: 9aaff764d508cbd9823f23cdf0c510255721bc5c09be481ebc60bd8902ceb8c5

6 weeks agoRange check the column index on the sqlite3_preupdate_old() interface
drh [Tue, 24 Jun 2025 15:58:32 +0000 (15:58 +0000)] 
Range check the column index on the sqlite3_preupdate_old() interface
and return SQLITE_MISUSE if too large.
[forum:/forumpost/b617e497287235d0|Forum post b617e49728].

FossilOrigin-Name: 6a5701e6c7be25cba93e55438f950966e1dacb32eb2b23a8acc8ac53da6f0a85

6 weeks agoAPI doc typo fixes and one rephrasing improvement from brickviking.
stephan [Tue, 24 Jun 2025 07:38:52 +0000 (07:38 +0000)] 
API doc typo fixes and one rephrasing improvement from brickviking.

FossilOrigin-Name: 85e8060c4701a601d4bc8a639acd268ee4f2736193820d55ecd9b8abf864132f

6 weeks agoImprove some of the error messages emitted by fts5 when it encounters corruption.
dan [Mon, 23 Jun 2025 19:38:22 +0000 (19:38 +0000)] 
Improve some of the error messages emitted by fts5 when it encounters corruption.

FossilOrigin-Name: 48044a6b57c0a16cb75139c103ad88ca4ab64d74f70a3dee0d8b817fbfbec3c6

6 weeks agoFix an SQL typo introduced by the previous check-in.
drh [Mon, 23 Jun 2025 19:00:30 +0000 (19:00 +0000)] 
Fix an SQL typo introduced by the previous check-in.

FossilOrigin-Name: 72a81d247bc74a21d077d311969ac585d0f26bffbd210ec60f03c38bf138790e

6 weeks agoEscape the "_" character in LIKE patterns in the CLI.
drh [Mon, 23 Jun 2025 16:51:33 +0000 (16:51 +0000)] 
Escape the "_" character in LIKE patterns in the CLI.
[forum:/forumpost/6a89702f5d|Forum post 6a89702f5d].

FossilOrigin-Name: cf61cd359e666c66b6bba4407a653c799f7f07e1f5ee6b837ad467029c461a6a

6 weeks agoFix a harmless compiler warning injected by [c978aed3b6f82b3d].
drh [Mon, 23 Jun 2025 13:42:59 +0000 (13:42 +0000)] 
Fix a harmless compiler warning injected by [c978aed3b6f82b3d].

FossilOrigin-Name: f46500247b3a2f8b4a2f0f032cc4066af9cb3918e38a09c59db0a1da5747a25c

6 weeks agoImproved "statement aborts at ..." log-file messages that identify the
drh [Mon, 23 Jun 2025 13:28:13 +0000 (13:28 +0000)] 
Improved "statement aborts at ..." log-file messages that identify the
trigger that caused the abort.

FossilOrigin-Name: 7691264fe37300c880d612c91cf093327841fbe85fb7ec67e777e911d2cfc9ee

6 weeks agoAdd the --disable-rpath configure script flag to address [forum:13cac3b56516f849...
stephan [Sun, 22 Jun 2025 22:48:11 +0000 (22:48 +0000)] 
Add the --disable-rpath configure script flag to address [forum:13cac3b56516f849 | forum post 13cac3b56516f849].

FossilOrigin-Name: a59d9bb25e518f5d79f654615b92f6c50cfb704b5abee0f820912644b89366c5

7 weeks agoAPI doc typo fixes from brickviking.
stephan [Sun, 22 Jun 2025 12:04:47 +0000 (12:04 +0000)] 
API doc typo fixes from brickviking.

FossilOrigin-Name: 18e07f8f53693d0dace3c4025a572c1a10582290a338aa7f0913c83842a69b05

7 weeks agoMinor JS test cleanups prompted by a linter.
stephan [Sat, 21 Jun 2025 16:33:05 +0000 (16:33 +0000)] 
Minor JS test cleanups prompted by a linter.

FossilOrigin-Name: 764235a3d15fda55af85ebe3b5885fa27336cc0e979f1be2f6770b66a84bbe87

7 weeks agoRemove some duplicated JS tests.
stephan [Sat, 21 Jun 2025 16:18:23 +0000 (16:18 +0000)] 
Remove some duplicated JS tests.

FossilOrigin-Name: d1cb9ed79d806f667c22f5ba9861451d4d0765aa3072e085831045cf3a39f8b4

7 weeks agoReduce the maximum --size flag for JS kvvfs speedtest1 from 4 to 2, as --size 3 and...
stephan [Sat, 21 Jun 2025 16:02:20 +0000 (16:02 +0000)] 
Reduce the maximum --size flag for JS kvvfs speedtest1 from 4 to 2, as --size 3 and 4 are overflowing the kvvfs storage limits.

FossilOrigin-Name: b77b3adc828ce543e880e230701edd5e0ccb681e4c3c724ea8ad5ecbd69c73a6

7 weeks agoGive oo1.Stmt.get() similar treatment to [8c187140a60b]. This is an internal change...
stephan [Sat, 21 Jun 2025 15:58:20 +0000 (15:58 +0000)] 
Give oo1.Stmt.get() similar treatment to [8c187140a60b]. This is an internal change only - the API is unaffected.

FossilOrigin-Name: f5a7abc0a447273de40dacc463d267d26d4b62be56ee15baf05825791c2a7a6e