Commit Graph

  • 61978d90eb Do not allow surplus SQL text to come after the CREATE statement in the sqlite_schema.sql field. Any such text is flagged as an error. However, the schema will still work if PRAGMA writable_schema is engaged. drh 2026-10-02 19:56:59 +00:00
  • ac5f698ccb Fix the "sqldiff" utility so that when using the --primarykey option on a table that has a PRIMARY KEY with redundant columns, it does not overflow the array of PRIMARY KEY column names. Bug discovered by Anthropic as ANT-2026-Y36XS4M7. drh 2026-10-02 18:47:27 +00:00
  • cb5651e46d Fix integrity-check fails that would occur if the database contained a contentless fts4 table. Report [bugs:/info/2026-10-02T12:22:03Z | 2026-10-02T12:22:03Z]. dan 2026-10-02 14:33:50 +00:00
  • ea862dd6e1 Document the new behaviour on this branch in sqlite3session.h. session-apply-indirect dan 2026-10-01 18:37:44 +00:00
  • b692e5a3c3 Ensure the indirect flag is set when a session object records an indirect change made via sqlite3changeset_apply(). dan 2026-10-01 18:35:03 +00:00
  • 9696acb0c7 Change the way the session module applies changesets containing two or more UPDATE changes that form a dependency loop in order to avoid triggering ON DELETE CASCADE actions. dan 2026-10-01 16:48:03 +00:00
  • 39b3ae90df Merge the latest trunk enhancements into the bedrock branch via wal2. drh 2026-10-01 16:41:20 +00:00
  • adb979b5f6 Merge teh latest trunk enhancements into wal2 branch. dan 2026-10-01 16:32:23 +00:00
  • 09d7663212 Merge the latest trunk changes into the reuse-schema branch. drh 2026-10-01 16:22:00 +00:00
  • 8afd848817 Merge the latest trunk enhancements into the begin-concurrent branch. drh 2026-10-01 14:46:41 +00:00
  • 366a8f67a6 Merge the latest trunk enhancements into the tree-tracker branch drh 2026-10-01 11:51:11 +00:00
  • 277113a474 Import code for vec1 into ext/vec1/. dan 2026-10-01 11:21:02 +00:00
  • 0caf6b532d SAHPool VFS tweaks contributed off-list by Jure Rotar: hardening against malicious inputs and I/O errors. Truncate to the shorter length when overwriting a db file with a shorter one via importDb(). Correct xOpen() to honor the combination of CREATE/EXCLUSIVE flags. stephan 2026-10-01 08:13:58 +00:00
  • 58fddadb23 Remove an extraneous nearly-full-file level of indentation in ext/wasm/tester1.c-pp.js. stephan 2026-09-30 20:59:50 +00:00
  • 0e69e6be99 Improve locking support in the JS kvvfs. stephan 2026-09-30 19:29:13 +00:00
  • ca9a8adfa4 Add tests demonstrating kvvfs locking errors across multiple connections to the same storage. Add sqlite3.oo1.Stmt.resetNoThrow() for reasons described in its API docs. kvvfs-locking stephan 2026-09-30 19:26:14 +00:00
  • c15f5adadb Rework the JS kvvfs xLock(), xUnlock(), xCheckReserved(), and xSleep() analog to the recent opfs-sahpool changes to make it more robust when a given kvvfs store is accessed via multiple handles (all necessarily from the same thread). This does not break anything but also does not prove anything - tests are pending. stephan 2026-09-30 18:40:09 +00:00
  • 066a18e5c8 Fix a typo in the VERTICAL_SUM_GENERIC() macro in vec1.c. vec1 dan 2026-09-30 17:50:20 +00:00
  • 9559d8940c For msvc, __AVX2__ implies __FMA__. dan 2026-09-30 17:38:45 +00:00
  • 6ae81db9b8 Fix a faulty assert() that was failing when running vec1 OOM tests. dan 2026-09-30 17:07:42 +00:00
  • 23a0706663 Fix problems in vec1rollback.test preventing it from running on windows. dan 2026-09-30 16:41:58 +00:00
  • 806fd19e32 Fix definition of VEC1_META_4BYTEMIN so that it works with msvc. dan 2026-09-30 16:38:56 +00:00
  • 519e4c23a5 [fa44643f65d6] inadvertently removed its circular-cleanup protection by fixing the finalizer ordering. This check-in fixes that. Spotted in [forum:ba4cb328a7|forum post 2026-09-30T14:59:13Z]. stephan 2026-09-30 15:46:02 +00:00
  • 95e64f0e68 [fa44643f65d6] inadvertently removed its circular-cleanup protection by fixing the finalizer ordering. This check-in fixes that. Spotted in [forum:ba4cb328a7|forum post 2026-09-30T14:59:13Z]. stephan 2026-09-30 15:45:23 +00:00
  • e32fbe0c23 Import vec1 sources into directory ext/vec1/ of this project. dan 2026-09-30 14:49:16 +00:00
  • 16acbb7207 Cherry-pick fixes [c9dd4d88e44a] and [fa44643f65d] into branch-3.53. stephan 2026-09-30 13:32:02 +00:00
  • cdbfe6a938 Do not inherit the OPFS SAHPool's xSleep method from the default VFS, as doing so can cause the thread to freeze. This VFS only deals with contention originating in the same thread, so xSleep() needs to be a no-op. Addresses [forum:3f0794c5d8|bug report 2026-09-30T12:52:54Z]. stephan 2026-09-30 13:23:56 +00:00
  • f4786666d9 JS: when disposing of a C struct instance, do not unmap the 'pointer' property interceptor until after all client-added finalizers have been called. stephan 2026-09-30 13:18:14 +00:00
  • 7f13746e4c Fix the OPFS SAHPool VFS's xLock/xUnlock to properly deal with multiple handles to the same underlying file within the same JS thread. Addresses [forum:5e66a600ba6e57de|bug report 2026-09-30T10:49:15Z]. Also (unrelated but code-adjacent) make sure that the VFS releases all of its internal mappings when it's paused. stephan 2026-09-30 11:56:05 +00:00
  • 3b28aa1ce7 Fix the OPFS SAHPool VFS's xLock/xUnlock to properly deal with multiple handles to the same underlying file within the same JS thread. Addresses [forum:5e66a600ba6e57de|bug report 2026-09-30T10:49:15Z]. Also (unrelated but code-adjacent) make sure that the VFS releases all of its internal mappings when it's paused. stephan 2026-09-30 11:48:29 +00:00
  • de4b206f8b Incremental improvements. drh 2026-09-30 11:05:19 +00:00
  • a614ce42e4 Correct the xCheckReserveLock() impl of the OPFS SAHPool VFS to fix a corruption case involving multiple handles in the same JS thread to the same filename when one leaves a journal behind. Addresses [forum:b2fbb61642|bug report 2026-09-29T18:25:28Z]. stephan 2026-09-30 10:37:55 +00:00
  • 737c12a04c Minor JS doc correction. stephan 2026-09-30 10:36:27 +00:00
  • 9fd5a0bc55 Correct the xCheckReserveLock() impl of the OPFS SAHPool VFS to fix a corruption case involving multiple handles in the same JS thread to the same filename when one leaves a journal behind. Addresses [forum:b2fbb61642|bug report 2026-09-29T18:25:28Z]. stephan 2026-09-30 09:53:09 +00:00
  • 226a2c0d6a Generic internal JS cleanups. No functional changes. Update the preprocessor for the ability to use C-style comments in directive arguments. stephan 2026-09-30 09:17:12 +00:00
  • 3a11beb10e Change the way the session module applies changesets containing two or more UPDATE changes that form a dependency loop in order to avoid triggering ON DELETE CASCADE actions. session-update-to-update dan 2026-09-29 19:42:37 +00:00
  • 349d1438eb An early attempt to implement the tree-tracker optimization. drh 2026-09-29 18:49:51 +00:00
  • 1f7010d4ec Add the preserveOnInitFailure option to the opfs-sahpool VFS. stephan 2026-09-29 14:25:31 +00:00
  • a7d4cd04b5 Fix a harmless compiler warning in fts3ChecksumIndex(). drh 2026-09-29 12:02:34 +00:00
  • 34615b9c1f Reset the nullRow flag on the pseudo-cursor on each iteration of the loop when the RHS of a LEFT JOIN is a multi-row VALUES clause. Fix for [bugs:/info/2026-09-29T00:41:09Z|Bug 2026-09-29T00:41:09Z]. Problem introduced by check-in [a120c9235f125e05] with a missed opportunity to fix the problem at check-in [8c0f69e0e4ae0a44]. drh 2026-09-29 11:52:00 +00:00
  • ad1bbfc2bd OPFS SAHPool: more cleanly handle an init failure. Add an init option which tells it not to wipe the storage if initialization fails. Based on the discussion and patch in [forum:5664cd4baee50236|forum post 5664cd4b]. Minor doc updates in unrelated code. opfs-sahpool-forum-5664cd4b stephan 2026-09-29 08:31:55 +00:00
  • 1059bc8eac Fix a duplicate test case identifier label in speedtest1.c. drh 2026-09-28 16:30:59 +00:00
  • 86876d2f66 Enable the --column-metadata configuration flag in the 'autoconf' build. It was previously disabled with a comment that it changed how sqlite3.c was generated, but that's not the case. Addresses [bugs:2026-09-27T13:25:48Z|bug report 2026-09-27T13:25:48Z]. stephan 2026-09-27 15:54:38 +00:00
  • 2acb2ea908 Improvements to detection of invalid JSONB in the json_pretty() function. This is an enhancement, not a bug fix, as json_pretty() does not guarantee detection of invalid JSONB, as long as the invalid JSONB does not cause a memory error. [bugs:/info/2026-09-25T15:59:04Z|Bug 2026-09-25T15:59:04Z]. Test cases in TH3. drh 2026-09-26 11:21:43 +00:00
  • ac70487e12 New assert()s added to demonstrate that calls to sqlite3_aggregate_context() within an xInverse() callback never return NULL. drh 2026-09-26 11:01:47 +00:00
  • f237563192 Never let the SQLITE_FP_PRECISION_LIMIT exceed 100 million. [bugs:/info/2026-09-26T07:06:12Z|Bug 2026-09-26T07:06:12Z] drh 2026-09-26 09:51:41 +00:00
  • 998173efcd Update some long-dormant JS test code for refactoring-/renaming breakage induced since it was last used. Remove a separate long-dormant JS demo which cannot work with the current code. stephan 2026-09-26 06:23:08 +00:00
  • 7a5d84c684 Avoid dropping an error code in fts5 contentless-delete mode after parsing an %_docize record. Report [bugs:/info/2026-09-25T15:52:10Z | 2026-09-25T15:52:10Z]. dan 2026-09-25 17:42:10 +00:00
  • c62ea0ab7d Have RBU refuse to update any table with GENERATED columns. dan 2026-09-25 16:43:01 +00:00
  • 2c723787f9 Have RBU refuse to update any table with GENERATED columns. Bug report [bugs:/info/2026-09-25T10:43:02Z | 2026-09-25T10:43:02Z]. dan 2026-09-25 16:35:54 +00:00
  • e504c9592b Fix 8 byte buffer overwrite that could occur when applying RBU updates to databases containing indexes with more than 16 columns. dan 2026-09-25 15:16:37 +00:00
  • 078d71402f Fix 8 byte buffer overwrite that could occur when applying RBU updates to databases containing indexes with more than 16 columns. Report [bugs:/info/2026-09-25T11:18:49Z | 2026-09-25T11:18:49Z]. dan 2026-09-25 15:12:14 +00:00
  • 00830b2819 Fix some cases where fts3 integrity-check was not detecting corrupt databases. Report [bugs:/info/2026-09-25T11:18:11Z | 2026-09-25T11:18:11Z]. dan 2026-09-25 14:55:16 +00:00
  • 63b6d70525 Avoid a use-after-free problem in rtree triggered by an attacker manipulating the shadow table schema to ensure sqlite3_last_insert_rowid() returns 0 after certain INSERTs. Problem reported by Claude and Ada Logics. dan 2026-09-24 20:18:27 +00:00
  • d21bd37c7c Avoid a use-after-free problem in rtree triggered by an attacker manipulating the shadow table schema to ensure sqlite3_last_insert_rowid() returns 0 after certain INSERTs. Problem reported by Claude and Ada Logics. dan 2026-09-24 20:14:31 +00:00
  • 2503dc6182 Avoid marking little-known extension function next_char() as SQLITE_INNOCUOUS by default. dan 2026-09-24 17:09:56 +00:00
  • 6842d54eb2 Avoid potential buffer overwrite in debugging tool showwal when dealing with a wal file containing records with a very large number of fields. dan 2026-09-24 16:32:09 +00:00
  • f544d3599a Avoid leaving an fts3 porter tokenizer cursor in an inconsistent state following an OOM error. At the moment, this does not cause problems because fts3 always frees a tokenizer cursor following an OOM. But it might if some other code used the porter tokenizer implementation. dan 2026-09-24 15:53:23 +00:00
  • 4d577dfb33 Fix an off-by-one error in sqlite3GetUInt32(). The only user-visible effect of fixing this problem is that the error message emitted for a corrupt database has changed in one obscure case. dan 2026-09-24 15:34:05 +00:00
  • c62a4430f9 Work around quirks in MSVC associated with [d046d5f4c6855]. drh 2026-09-24 10:55:16 +00:00
  • 28c6f996b0 Fix test case inaccuracy introduced by [4f4ca57309c82d9e]. drh 2026-09-24 10:37:53 +00:00
  • e034ece5a3 In accordance with [https://www.unicode.org/versions/corrigendum9.html|Unicode Corrigendum #9], allow characters U+fffe and U+fffd to pass through unchanged. [bugs:/info/2026-09-23T02:39:21Z|Bug 2026-09-23T02:39:21Z]. drh 2026-09-24 10:04:45 +00:00
  • fb58e30657 Avoid truncating the argument of flag pragmas to 8 bits. [bugs:/info/2026-09-23T02:42:23Z|Bug 2026-09-23T02:42:23Z]. drh 2026-09-24 09:34:52 +00:00
  • 4b495f91a9 In date/time functions, the hour can be 24 as long as the minutes and seconds are zero. [bugs:/info/2026-09-23T02:44:48Z|Bug 2026-09-23T02:44:48Z] drh 2026-09-24 00:18:35 +00:00
  • 9da2d2374a The --escape mode for CSV should default to "off". [bugs:/info/2026-09-23T16:25:07Z|Bug 2026-09-23T16:25:07Z] drh 2026-09-23 21:04:57 +00:00
  • 1c9a10b2b4 Cherrypick JS kvvfs fixes from [ce09bfe406728312] (superfluous writes) and [c43287d8855b3f9a] (a potential buffer ovewwrite). stephan 2026-09-23 14:15:06 +00:00
  • a8d1f1ff12 Fix a small potential buffer overwrite in the JS impl of kvvfs to resolve [bugs:8d4fe4cc4c|bug report 2026-09-23T10:50:46Z]. Remove some adjacent dead code. stephan 2026-09-23 14:00:07 +00:00
  • 64c8a0f2e9 Minor adjustment to [987ba5a3dc5f2a22] to deal with a corner case involving the maximum integer. [bugs:/info/2026-09-23T03:07:00Z|Bug 2026-09-23T03:07:00Z]. drh 2026-09-23 12:27:03 +00:00
  • b72e66e839 Improved comment on the previous check-in. large-realint-keys drh 2026-09-23 12:15:13 +00:00
  • d884a3c7c9 An attempt to improve the handling of rowid lookups using very large floating point values. drh 2026-09-23 11:37:04 +00:00
  • 2fc31a37cb Avoid a potential crash by checking the arguments to sqlite_expert_rem() (part of the "expert" extension). This function was normally only called internally, but a sufficiently determined attacker could also find a way. Report [bugs:/info/2026-09-23T10:50:15Z | 2026-09-23T10:50:15Z]. dan 2026-09-23 11:31:44 +00:00
  • 681d217d49 Do not allow the arguments of table-valued-functions to the left of a LEFT JOIN to refer to tables to the right of the LEFT JOIN. Fix for [bugs:/info/2026-09-20T09:57:48Z | 2026-09-20T09:57:48Z]. dan 2026-09-23 11:12:41 +00:00
  • 95699469b7 Handle correctly very large (or small) out-of-range column indexes passed to various fts5 auxiliary functions. Report [bugs:/info/2026-09-23T02:40:15Z | 2026-09-23T02:40:15Z]. dan 2026-09-23 11:06:11 +00:00
  • 6ceffc33fe Preprocessor: remove more not-relevant-to-this-copy pieces and add support for C-style comments in directive arguments. stephan 2026-09-23 10:06:30 +00:00
  • 2923911f53 Change the behavior of rtree_i32 such that coordinate inputs that are outside the range of signed 32-bit integers are converted into the nearest representable signed 32-bit integer rather than just being truncated to 32-bits. The prior behavior of truncating is what programmers expected years ago, but apparently the new generation of programmers expects the values to be capped at the nearest representable value. We could argue about which is more "correct", but it seems easier to just do what the younglings expect. The documentation is ambiguous about what to do in this case, so this is not a breaking change. [bugs:/info/2026-09-23T02:37:39Z|Bug 2026-09-23T02:37:39Z]. drh 2026-09-23 09:34:08 +00:00
  • b943fa1288 Fix a possible double-free in the (unused) sqlite3_intck_test_sql() test interface to the intck extension. [bugs:/info/2026-09-22T22:05:25Z|Bug 2026-09-22T22:05:25Z] drh 2026-09-23 01:29:05 +00:00
  • fd5e4186e1 Improved output when errors occur during ".dump" in the CLI. drh 2026-09-22 19:39:43 +00:00
  • 5c5c986e92 Fix goofy condition in the previous check-in drh 2026-09-22 19:11:49 +00:00
  • c907770214 Improved capture and reporting of errors by the CLI. [bugs:/info/2026-09-21T02:55:55Z|Bug 2026-09-21T02:55:55Z] drh 2026-09-22 17:12:56 +00:00
  • 1062a89cac Add more precision limitations on width and precision in the printf() logic. Changes are not actually needed though, so they are parked on this branch. limit-printf-precision drh 2026-09-22 12:29:24 +00:00
  • 6c6d1c71eb Fix calculation of the virtual table dbstat.pgoffset field for overflow pages. Report [bugs:/info/2026-09-22T01:43:42Z | 2026-09-22T01:43:42Z]. dan 2026-09-22 10:30:05 +00:00
  • fde3a84ddd Latest preprocessor for various cleanups and fixes. Duplicate the tester1 concurrency warning in the worker-based copy. stephan 2026-09-21 20:18:51 +00:00
  • 5636f0f4a4 Fix potential buffer overreads in demo program ext/fts3/tool/fts3view.c. Bug [bugs:/info/2026-09-21T13:50:52Z | 2026-09-21T13:50:52Z]. dan 2026-09-21 17:12:55 +00:00
  • 9fe7e4dd31 Update sessionChangesetFindTable() so that it honors the contract defined in its header comment and always returns non-zero if the table is not found. dan 2026-09-21 15:52:34 +00:00
  • bed690d6f9 Do not allow the arguments of table-valued-functions to the left of a LEFT JOIN to refer to tables to the right of the LEFT JOIN. Fix for [bugs:/info/2026-09-20T09:57:48Z | 2026-09-20T09:57:48Z]. tvf-left-join-fix dan 2026-09-21 15:45:19 +00:00
  • 3a81fb9829 Teach 'make libtcl' to honor the --disable-rpath configure flag. Addresses [forum:2026-09-21T10:24:56Z|forum post 2026-09-21T10:24:56Z]. stephan 2026-09-21 13:08:59 +00:00
  • 5f8b6a782d Fix truncation of 64-bit integer values passed to the fts3 snippet() function. Report [bugs:/info/2026-09-21T02:41:49Z | 2026-09-21T02:41:49Z]. dan 2026-09-21 11:14:14 +00:00
  • c908175cbe Add new test cases for the sqlite3.oo1.Stmt.get() overloads which take both a client-specified type ID and an array or object target. stephan 2026-09-21 07:29:41 +00:00
  • 93d6a90fe9 Adjustments to the substr() function so that it can accommodate ridiculous values for the second argument. [bugs:/info/2026-09-20T18:42:27Z|Bug 2026-09-20T18:42:27Z] drh 2026-09-20 20:17:58 +00:00
  • 5bd0f37f60 Add test cases to sessionchange2.test. changeset-missing-table dan 2026-09-19 17:20:43 +00:00
  • 9e0959ca03 Fix test cases due to improved error messages from this branch. drh 2026-09-19 13:35:57 +00:00
  • b52b635a19 Merge test cases fixes from trunk drh 2026-09-19 11:10:12 +00:00
  • 30fbf300af Fix test cases added by [f847298c8d424071] so that they work on all configurations. drh 2026-09-19 11:07:26 +00:00
  • ac2685b071 Fix new test cases added by [c77ff6089de242d8] so that they work on all configurations. drh 2026-09-19 10:58:12 +00:00
  • 30bc31907d Update sessionChangesetFindTable() so that it honors the contract defined in its header comment and always returns non-zero if the table is not found. drh 2026-09-19 09:52:20 +00:00
  • b8c29c92a5 Ensure that the comments generated by the ".schema" command in the CLI are not terminated early by rogue SQL. drh 2026-09-19 09:24:10 +00:00
  • f20c1cc5c0 When binding blobs in tclsqlite3, use sqlite3_bind_blob64() because Tcl 9 allows byte arrays larger than 32-bits and the size argument being passed there is of type Tcl_Size. Discrepancy caught and patched by Jan Nijtmans. stephan 2026-09-19 08:28:15 +00:00
  • ae9c436852 User new, more compare JS syntax in a couple of places. No functional changes. stephan 2026-09-19 08:13:27 +00:00
  • c5b1623ec7 Simplification to the 32-bit float rounding routines from the previous check-in. Also fix a test case from that check-in. drh 2026-09-19 07:59:20 +00:00
  • af32e544ea Fix 32-bit floating point (float) rounding in rtree so that it works correctly for subnormal values and for values near infinity. [bugs:/info/2026-09-19T00:36:32Z|Bug 2026-09-19T00:36:32Z]. drh 2026-09-19 01:54:07 +00:00