Commit Graph

  • 6276637075 wasm: add a few tests demonstrating that oo1.Stmt.paramaterCount's new impl does not change visible behaviors. Add the c-pp-filtered files to 'make clean'. stephan 2025-07-09 13:13:01 +00:00
  • 8663a78ec9 Fix a possible user-after free following OOM in the EXISTS-to-JOIN optimization. drh 2025-07-08 22:11:39 +00:00
  • aa12f0027b 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. drh 2025-07-08 20:28:35 +00:00
  • 9a13a21223 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. drh 2025-07-08 19:53:36 +00:00
  • 9b91aac83b Fix a problem with the fix in [5cb8e342e1]. dan 2025-07-08 19:02:26 +00:00
  • acd1d93497 Fix another problem with running fts5 integrity-check in SQLITE_DEBUG builds, this one causing an assert() failure. dan 2025-07-08 18:44:56 +00:00
  • 449b34571e Enable the EXISTS-to-JOIN optimization if the outer query has no FROM clause. empty-table-optimizations drh 2025-07-08 17:28:09 +00:00
  • 9615cf93c8 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. dan 2025-07-08 14:54:20 +00:00
  • 925b79039c Fix test case results in FTS5 that were changed error message improvements in [48044a6b57c0a16c] but which were omitted from that check-in. drh 2025-07-08 12:37:25 +00:00
  • 7fc6e6a272 Only run preupdate-hook tests in incrblob4.test if the preupdate-hook is enabled in the build. dan 2025-07-07 20:47:23 +00:00
  • 8c8443a38a Small performance optimization in the resolver. drh 2025-07-07 19:03:50 +00:00
  • 44a03671c4 Merge the latest trunk enhancements and fixes into the empty-table-optimizations branch. drh 2025-07-07 18:35:51 +00:00
  • 65ffbcd7c0 Rework the fix to the problem described by 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. drh 2025-07-07 16:28:59 +00:00
  • 0a5508aeb4 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. drh 2025-07-07 16:19:44 +00:00
  • 4fe1ac8fe1 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. redundant-idx-columns drh 2025-07-07 15:40:53 +00:00
  • 1587604c6b Work around the Emscripten 4.10 regression described in [https://github.com/emscripten-core/emscripten/issues/24656 | Emscripten ticket #24656]. stephan 2025-07-07 14:42:30 +00:00
  • 24d290e7b0 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. stephan 2025-07-07 12:11:26 +00:00
  • 8504d37b99 Avoid invoking the preupdate hook from within sqlite3_blob_write() if the cursor is already invalid. dan 2025-07-07 11:37:55 +00:00
  • 4aacd1ef8e 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. drh 2025-07-07 10:54:00 +00:00
  • 8bf6452870 Fix a parsing error introduced by the addition of the ability to disable comments. drh 2025-07-07 02:23:40 +00:00
  • 0840460689 Fix parser error introduced by [325e547a2195571e]. See [forum:/forumpost/095dbfc06e5b1f7e|forum post 095dbfc06e5]. drh 2025-07-07 02:18:27 +00:00
  • 240319decd Remove some dead JS code and some extraneous debug output from test code. stephan 2025-07-06 15:36:28 +00:00
  • 787f4c3f09 JS doc additions. stephan 2025-07-06 15:13:06 +00:00
  • 4d453cc2ed Experimentally add sqlite3.oo1.DB/Stmt.wrapHandle(), which allow DB/Stmt instances to wrap a (sqlite3*)/(sqlite3_stmt*) optionally with or without taking ownership of it. The intent is to enable mix-and-match use of the C API, the oo1 API, and any other hypothetical API which exposes those pointers. oo1.Stmt.parameterCount is now a property access interceptor like Stmt.columnCount is, but that doesn't change how it's used. stephan 2025-07-06 15:01:44 +00:00
  • c701d17366 Improvements to the EXPLAIN QUERY PLAN output for EXISTS-to-JOIN. drh 2025-07-06 01:19:09 +00:00
  • 8bc112e3e4 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. drh 2025-07-05 23:33:21 +00:00
  • 7a6ff62658 Propagate the -ldl and -lpthread flags, if needed, into sqlite3.pc, per request in [forum:44a58c807353162f | forum post 44a58c807353162f]. This resolves usage of that pkgconf file on some OSes. stephan 2025-07-04 18:38:23 +00:00
  • 27408ab9c9 Add 'reconfigure' target to Makefile.in to re-run the configure script with the same flags it was generated with. stephan 2025-07-04 18:32:18 +00:00
  • d9eae6b75a Propagate the -ldl and -lpthread flags, if needed, into sqlite3.pc, per request in [forum:44a58c807353162f | forum post 44a58c807353162f]. stephan 2025-07-04 17:20:37 +00:00
  • 45bc9b9f97 Merge fixes from trunk into the empty-table-optimizations branch drh 2025-07-04 14:24:18 +00:00
  • e33ea17d24 Fix harmless compiler warnings. drh 2025-07-04 12:25:24 +00:00
  • a12e92d2f7 Remove an ALWAYS() added by [960a8e6fc91f4] that turns out to be false in some cases of malformed SQL. drh 2025-07-04 11:48:11 +00:00
  • 478dfc7e74 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. drh 2025-07-04 11:06:34 +00:00
  • 1b62720fa8 Improve the early-termination optimization so that it works in queries which use the LIKE optimization in the outer loop. drh 2025-07-04 10:26:55 +00:00
  • a1a2269ab0 Merge trunk into column-text-blob-v2 branch. stephan 2025-07-04 10:17:25 +00:00
  • 67090e987b 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). stephan 2025-07-04 10:10:32 +00:00
  • 1e3a862b79 Merge the latest trunk fixes and enhancements into the empty-table-optimizations branch drh 2025-07-03 20:51:08 +00:00
  • bd05edd98f 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. dan 2025-07-03 16:05:41 +00:00
  • a24a397b8b Improvements to sqlite3_vtab_rhs_value() logging in the ext/misc/vtablog.c extension. vtab-limit-fixes drh 2025-07-03 15:50:18 +00:00
  • 0e6e05d4d5 Make the value of an explicit LIMIT clause on a scalar sub-query available to xBestIndex for simple "LIMIT 0" and "LIMIT 1" queries. dan 2025-07-03 15:32:27 +00:00
  • c525e6e817 Make handling of LIMIT clauses in correlated sub-queries on virtual tables more efficient. dan 2025-07-03 14:28:47 +00:00
  • 1ff6f19d8b Enhancements to the xBestIndex output from the ext/misc/vtablog.c extension. drh 2025-07-03 14:10:03 +00:00
  • bfb4993364 Fix an uninitialized variable added yesterday by [d27d34fb746280e7]. This problem was discovered overnight by [https://github.com/google/oss-fuzz|OSSFuzz]. drh 2025-07-03 11:52:17 +00:00
  • debc8f7bb7 Minor tweaks to the exists-to-join optimization. drh 2025-07-03 00:17:27 +00:00
  • aa54d7a0ca Merge in the exists-to-join optimization that has been modified to relax the requirement of having an indexed join constraint. drh 2025-07-02 20:46:02 +00:00
  • eb27359e5e Fix VDBE coverage drh 2025-07-02 17:43:59 +00:00
  • f82589bd89 Correct mis-placed OOM checks in valueToTextV2(). stephan 2025-07-02 15:29:11 +00:00
  • 33f3273705 Early exit if one of the inner loops of a 3-way or larger join is an empty table. drh 2025-07-02 14:53:48 +00:00
  • a90c872692 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 2025-07-02 13:24:50 +00:00
  • 216676664d If the LHS for an EXCEPT or INTERSECT operator is empty, skip over the computation of the RHS. drh 2025-07-02 13:19:24 +00:00
  • 6245e5a46b Improve the bytecode for joins such that it exits earlier if it determines that no output is possible. drh 2025-07-02 11:47:54 +00:00
  • 69e5993280 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 2025-07-02 07:52:30 +00:00
  • caf0473652 Ensure that Expr.op2 values for TK_AGG_FUNCTION nodes are adjusted when query flattening. drh 2025-07-02 02:03:43 +00:00
  • 2427ce16d9 Improved comments on bytecode used to implement aggregate queries, to aid in debugging. drh 2025-07-01 23:17:36 +00:00
  • 69e123fd25 Remove an #if 0 block. stephan 2025-07-01 21:33:26 +00:00
  • 7f030542c3 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 2025-07-01 21:06:58 +00:00
  • 768714c136 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 2025-07-01 20:56:49 +00:00
  • 46bfcc1a21 Improved byte-code comments for the short-circuit optimization of [0083d5169a46104a], to aid in debugging. drh 2025-07-01 20:32:45 +00:00
  • 417876bd8b Parameter number doc corrections for the previous check-in. stephan 2025-07-01 18:38:02 +00:00
  • 92a54853d9 Add API docs for sqlite3_column_text_v2() and sqlite3_column_blob_v2(). stephan 2025-07-01 18:36:11 +00:00
  • 3515783d55 Random JS cleanups and docs. stephan 2025-07-01 17:38:08 +00:00
  • 5e71497404 Cache and reuse virtual table cursors in the bytecode engine. drh 2025-07-01 17:36:55 +00:00
  • c5e9645e1b 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. stephan 2025-07-01 16:38:58 +00:00
  • 526399b0fd Avoid an assert() failure in fts5 that may occur when processing corrupt records. dan 2025-07-01 16:21:47 +00:00
  • e1910ed1d2 Merge trunk fixes into the empty-table-optimizations branch. drh 2025-07-01 15:13:37 +00:00
  • 3daba35147 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. stephan 2025-07-01 14:44:12 +00:00
  • 35237b91b7 Initial implementations of sqlite3_column_text_v2(), sqlite3_column_blob_v2(), and their JS/WASM bindings/tests. stephan 2025-07-01 13:01:07 +00:00
  • 52c70825b1 Increment the patch level to 3. drh 2025-07-01 12:56:17 +00:00
  • 993c1b4872 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. drh 2025-07-01 12:49:32 +00:00
  • d82c6a2cf7 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]. drh 2025-07-01 12:43:13 +00:00
  • c4c7d9ac89 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 2025-07-01 09:02:27 +00:00
  • 19bad512e5 Add JS tests for SQLITE_ENABLE_API_ARMOR-shielded sqlite3_value_blob/text_v2() misuse. stephan 2025-07-01 00:34:15 +00:00
  • 72f2dd0673 Add JS basic tests for sqlite3_value_blob_v2(). Simplify the sqlite3_value_text_v2() tests a bit. stephan 2025-07-01 00:17:30 +00:00
  • 3cd904cc97 Add JS bindings for sqlite3_value_text/blob_v2() and add basic JS tests for text_v2(). stephan 2025-06-30 23:49:21 +00:00
  • 59890ab8c7 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. stephan 2025-06-30 23:17:57 +00:00
  • 3d21dcc924 More aggressive optimization of addrHalt for RIGHT JOIN. drh 2025-06-30 21:07:08 +00:00
  • ba56f7020d 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 2025-06-30 20:19:19 +00:00
  • 99f1aa03fb 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 2025-06-30 16:41:40 +00:00
  • 1bd6b415e9 Correct ~/.local/config/... to ~/.config/... when looking for sqliterc when XDG_CONFIG_HOME is not set. Internal doc touchups. stephan 2025-06-30 15:56:10 +00:00
  • 2752d1331d Add support for using $XDG_STATE_HOME/sqlite_history or ~/.local/state/sqlite_history before fallback back to the historical default of ~/.sqlite_history. Update sqlite3.1 (man page) with the new semantics. stephan 2025-06-30 15:21:46 +00:00
  • 280559b446 For all binary operators, try to avoid computing subquery operands if the other operand is NULL. optimize-null-values drh 2025-06-30 12:14:47 +00:00
  • bbcf035954 Preliminary refactoring of the XDG_CONFIG_HOME support to support the pending addition of other XDG-configurable options. In response to [forum:31db1a23f9 | forum post 31db1a23f9]. stephan 2025-06-30 11:46:10 +00:00
  • e2e81e6983 Slightly smaller and faster version of the previous check-in. drh 2025-06-30 11:04:55 +00:00
  • 11422669a3 Minor API doc typo fixes from brickviking. stephan 2025-06-30 11:01:42 +00:00
  • b8c81790b2 Minor API doc typo fixes from brickviking. stephan 2025-06-30 11:00:59 +00:00
  • e24f20a4f5 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 2025-06-30 10:30:47 +00:00
  • 972838facf Minor API doc typo fixes from brickviking. stephan 2025-06-29 07:32:57 +00:00
  • f0991c416b Minor API doc typo fixes from brickviking. stephan 2025-06-29 07:32:20 +00:00
  • 311d73efc2 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 2025-06-28 17:59:15 +00:00
  • 8c01ccfd66 Merge all the latest trunk fixes and enhancements into the reuse-schema branch. drh 2025-06-28 14:36:38 +00:00
  • dd7f0c0ef7 Merge the 3.50.2 changes into the reuse-schema-3.50 branch. drh 2025-06-28 14:35:51 +00:00
  • 98c84bec51 Merge the latest trunk fixes and enhancements into the bedrock branch. drh 2025-06-28 14:30:07 +00:00
  • 67b28465fc Merge the latest trunk enhancements into the wal2 branch. drh 2025-06-28 14:24:43 +00:00
  • ff7a9f7b83 Merge the latest trunk enhancements into the begin-concurrent branch. drh 2025-06-28 14:16:26 +00:00
  • 9d7c5df7f0 Version 3.50.2 version-3.50.2 drh 2025-06-28 14:00:48 +00:00
  • ffedaa7278 Raise an error right away if the number of aggregate terms in a query exceeds the maximum number of columns. drh 2025-06-27 19:56:00 +00:00
  • c52e9d97d4 Raise an error right away if the number of aggregate terms in a query exceeds the maximum number of columns. drh 2025-06-27 19:02:21 +00:00
  • d1b5b50088 API doc typo fixes and closing DD element tags from brickviking. drh 2025-06-27 12:51:40 +00:00
  • fbf1c0526e API doc typo fixes and closing DD element tags from brickviking. stephan 2025-06-27 12:46:50 +00:00
  • e77e589a35 Work around an apparent GCC UBSAN bug. See [forum:/forumpost/1d7c25d4a2d6f5e2|forum thread 1d7c25d4a2d] for details. drh 2025-06-26 18:57:20 +00:00