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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
Fix an uninitialized variable added yesterday by [d27d34fb746280e7].
This problem was discovered overnight by
[https://github.com/google/oss-fuzz|OSSFuzz].
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.
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.
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.
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.
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.
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].
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).
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.
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].
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.
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.
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].
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].