1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Commit Graph

  • 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
  • fb76a024a3 Minor API doc fixes sent off-list from brickviking. drh 2025-06-26 15:41:43 +00:00
  • 981022b7ff Minor API doc fixes sent off-list from brickviking. stephan 2025-06-25 20:42:40 +00:00
  • a67c71224f Similar fix to the previous check-in, but this time for sqlite3_preupdate_new(). drh 2025-06-24 18:27:59 +00:00
  • 66cd200ede Range check the column index on the sqlite3_preupdate_old() interface and return SQLITE_MISUSE if too large. [forum:/forumpost/b617e497287235d0|Forum post b617e49728]. drh 2025-06-24 15:58:32 +00:00
  • 513fff88c4 API doc typo fixes and one rephrasing improvement from brickviking. stephan 2025-06-24 07:38:52 +00:00
  • fe182f74b2 Improve some of the error messages emitted by fts5 when it encounters corruption. dan 2025-06-23 19:38:22 +00:00
  • b1560be826 Fix an SQL typo introduced by the previous check-in. drh 2025-06-23 19:00:30 +00:00
  • 28789029ee Escape the "_" character in LIKE patterns in the CLI. [forum:/forumpost/6a89702f5d|Forum post 6a89702f5d]. drh 2025-06-23 16:51:33 +00:00
  • f453e8d84e Fix a harmless compiler warning injected by [c978aed3b6f82b3d]. drh 2025-06-23 13:42:59 +00:00
  • 4c1c400d64 Improved "statement aborts at ..." log-file messages that identify the trigger that caused the abort. drh 2025-06-23 13:28:13 +00:00
  • 87c807c6dd Add the --disable-rpath configure script flag to address [forum:13cac3b56516f849 | forum post 13cac3b56516f849]. stephan 2025-06-22 22:48:11 +00:00
  • b5aa9593ac API doc typo fixes from brickviking. stephan 2025-06-22 12:04:47 +00:00
  • 5806a922ba Minor JS test cleanups prompted by a linter. stephan 2025-06-21 16:33:05 +00:00
  • 427d2cd57d Remove some duplicated JS tests. stephan 2025-06-21 16:18:23 +00:00
  • db37e6097c Reduce the maximum --size flag for JS kvvfs speedtest1 from 4 to 2, as --size 3 and 4 are overflowing the kvvfs storage limits. stephan 2025-06-21 16:02:20 +00:00
  • 6fcb7f22a1 Give oo1.Stmt.get() similar treatment to [8c187140a60b]. This is an internal change only - the API is unaffected. stephan 2025-06-21 15:58:20 +00:00
  • 2f7f948fa7 Extend the SEE-via-kvvfs tests to include all three key types. stephan 2025-06-21 15:38:59 +00:00
  • 0cdde5b44f Rework how JS's oo1.DB.exec() flags its Stmt objects to make certain Stmt APIs illegal (i.e. throwing) if called while that Stmt is being step()ped by DB.exec() (which can happen via client-provided per-result-row callbacks). This is an internal change only - the API is unaffected. Remove some unrelated dead code. stephan 2025-06-21 14:38:53 +00:00
  • a0c6de56ba Numerous small doc typo from BrickViking. stephan 2025-06-21 06:07:13 +00:00
  • b68d63158a Enhance sqlite3BtreeSetPageSize() so that it detects early if no changes are needed and exists with SQLITE_OK. drh 2025-06-20 13:12:55 +00:00
  • 59de42763f Fix an out-of-order local variable declaration in ext/misc/fileio.c. drh 2025-06-19 20:19:12 +00:00
  • 37794b4ad0 Improve the accuracy of sqlite3BtreeRowCountEst(). drh 2025-06-19 20:00:37 +00:00
  • 397b82cf0f Generalize the indexCellCompare() so that works on any index page, not just the current page that a cursor is pointing to. drh 2025-06-19 19:33:06 +00:00
  • a231b5d192 Cherry-pick of documentation updates from trunk - no code changes. drh 2025-06-19 13:48:37 +00:00
  • 92d1bec584 A slight doc rephrasing for clarity, suggested in the forum. stephan 2025-06-19 12:35:30 +00:00
  • a5c484b432 Doc typo fixes from [forum:0bce273669 | forum post 0bce273669]. stephan 2025-06-19 10:46:39 +00:00
  • 64159096b8 Expose the column metadata APIs to WASM (which does not require a non-default sqlite3.c build, contrary to my prior mistaken claims). This adds only 424 bytes to sqlite3.wasm and 660 bytes to sqlite3.js. stephan 2025-06-19 10:25:50 +00:00
  • ab9c91ae82 Extend the pedantic enforcement of type to VIRTUAL columns. drh 2025-06-18 19:04:28 +00:00
  • bcf25e7129 Enforce judgmental typing on STORED generated columns for STRICT tables. [forum:/forumpost/6caf195248a849e4|Forum post 6caf195248]. drh 2025-06-18 16:17:00 +00:00