32527 Commits
Author SHA1 Message Date
dan 066a18e5c8 Fix a typo in the VERTICAL_SUM_GENERIC() macro in vec1.c.
FossilOrigin-Name: b55faf3253cd5d2fc69b4e025f4707bda3600c553f85aff152cfd4e71e54c81e
2026-09-30 17:50:20 +00:00
dan 9559d8940c For msvc, __AVX2__ implies __FMA__.
FossilOrigin-Name: 2196a779fbf1a3f174a24d29e14823f09de6b743f321ccc845e8782c7987edad
2026-09-30 17:38:45 +00:00
dan 6ae81db9b8 Fix a faulty assert() that was failing when running vec1 OOM tests.
FossilOrigin-Name: aae661526953196ae078b2fe52d73f8a02ee9aa8f190b3fcdc27b23e4a344475
2026-09-30 17:07:42 +00:00
dan 23a0706663 Fix problems in vec1rollback.test preventing it from running on windows.
FossilOrigin-Name: d15cf3890230d5a870e50448c69d640fedcbd15f32788b808cb1f212399e2796
2026-09-30 16:41:58 +00:00
dan 806fd19e32 Fix definition of VEC1_META_4BYTEMIN so that it works with msvc.
FossilOrigin-Name: c9b4c9c0aaf0c314312381558ed9cf60aac800dfb4f5701d4d2e1f5268b7f081
2026-09-30 16:38:56 +00:00
dan e32fbe0c23 Import vec1 sources into directory ext/vec1/ of this project.
FossilOrigin-Name: 3a0876d973868be7b6f4156a434cd09098c7ab1abdc7f0ef4f3d12a03de68b24
2026-09-30 14:49:16 +00:00
stephan 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].
FossilOrigin-Name: c9dd4d88e44a9eae4ea11d0ce5491c7ac2ac2d60a3bc83ed485812234be374da
2026-09-30 13:23:56 +00:00
stephan 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.
FossilOrigin-Name: fa44643f65d6815c8c21ec25e7aa6e39a00fdc818d1d058e03123042e45884e1
2026-09-30 13:18:14 +00:00
stephan 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.
FossilOrigin-Name: 9e2caaa382cee5d5df26ad3af7d727ab3f68a912e39655ffcc52f592d5a08a8d
2026-09-30 11:48:29 +00:00
stephan 737c12a04c Minor JS doc correction.
FossilOrigin-Name: 6b470917b2c9ab25d1e7fed56f19f37b5c2fc3f2a3d504a752a7bb2db14a3ee6
2026-09-30 10:36:27 +00:00
stephan 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].
FossilOrigin-Name: 9168a6f1bedba87117169d096f9a6fcadaac65249d707193e4bcbc25e59ccb54
2026-09-30 09:53:09 +00:00
stephan 226a2c0d6a Generic internal JS cleanups. No functional changes. Update the preprocessor for the ability to use C-style comments in directive arguments.
FossilOrigin-Name: b2699eb9676e6f5459b8279661c264ba2c803ae133f85c703984deb7afa4fe60
2026-09-30 09:17:12 +00:00
stephan 1f7010d4ec Add the preserveOnInitFailure option to the opfs-sahpool VFS.
FossilOrigin-Name: f2d34323203372a0bb58f94a7b2a43334bebf307ecc37443dcd6018a465f2118
2026-09-29 14:25:31 +00:00
drh a7d4cd04b5 Fix a harmless compiler warning in fts3ChecksumIndex().
FossilOrigin-Name: 44e0d3e2ad294afbcefdfac0e9a28a8bd432b14ba68b13b50fb0663e376f165a
2026-09-29 12:02:34 +00:00
drh 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].

FossilOrigin-Name: 8e59d3c0a428ff12ea852c7a9f15b6b7b4ca0da55708f3d303b2e88818a17476
2026-09-29 11:52:00 +00:00
stephan 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.
FossilOrigin-Name: 0560c3cc20f60caee42492e4d2063aed8d8d44b0a544a8c3aae56ee67da2e4a7
2026-09-29 08:31:55 +00:00
drh 1059bc8eac Fix a duplicate test case identifier label in speedtest1.c.
FossilOrigin-Name: 6f7db1d7313892260298aa78cfa1a3d91e5e55aebd16862d77835c5e070857c5
2026-09-28 16:30:59 +00:00
stephan 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].
FossilOrigin-Name: 03bb7acfe8af5dc22af698a73343cc5c003df2d57f321e3c1818826238e046b1
2026-09-27 15:54:38 +00:00
drh 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.

FossilOrigin-Name: c1027e6aee96b1997492a4bb434c814afc5244032bd88b2b4d330312f283b974
2026-09-26 11:21:43 +00:00
drh ac70487e12 New assert()s added to demonstrate that calls to sqlite3_aggregate_context()
within an xInverse() callback never return NULL.

FossilOrigin-Name: d28a4b4167c277e3e58d20dba7ec1880e235446ce99a959d2e9397707b621b1f
2026-09-26 11:01:47 +00:00
drh f237563192 Never let the SQLITE_FP_PRECISION_LIMIT exceed 100 million.
[bugs:/info/2026-09-26T07:06:12Z|Bug 2026-09-26T07:06:12Z]

FossilOrigin-Name: ba6f5fb7b8fa9b6862ef7bda64483942182e214a2fb13c6288c48762a0372fef
2026-09-26 09:51:41 +00:00
stephan 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.
FossilOrigin-Name: fc4e246dc26f3e3872dde42ceefcea70ba4158a92ba94361656b2ca0f4e3ef92
2026-09-26 06:23:08 +00:00
dan 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].
FossilOrigin-Name: 52f84cfcdb4ac2d959a2f7ee4bc832e7f49204c86e8762042c99e19488d34f5b
2026-09-25 17:42:10 +00:00
dan 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].
FossilOrigin-Name: 2cde8fd0a272170464912c62d42d9ca754a166fb0bba0ea57ea7a0c1a28fe6d4
2026-09-25 16:35:54 +00:00
dan 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].
FossilOrigin-Name: 7b4fa1d8cd8e43d858ed80549d653f412345468ac699c699a44e78435f59e8c3
2026-09-25 15:12:14 +00:00
dan 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].
FossilOrigin-Name: 9b23f99212f49587c5f0b025e90fdd2e844437fbb76fc11c26062df7bcff765c
2026-09-25 14:55:16 +00:00
dan 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.
FossilOrigin-Name: 6a9e1415659f9e75940b3c3a6f6e123f61c5e9e2a7a612693ee395d7b7567bef
2026-09-24 20:14:31 +00:00
dan 2503dc6182 Avoid marking little-known extension function next_char() as SQLITE_INNOCUOUS by default.
FossilOrigin-Name: 481a1df638aeef163022523f8de590c265f64d078eb070cf262995e8ecb0f690
2026-09-24 17:09:56 +00:00
dan 6842d54eb2 Avoid potential buffer overwrite in debugging tool showwal when dealing with a wal file containing records with a very large number of fields.
FossilOrigin-Name: bc7641d1f190e0dc76589a3b61d85968eb33fd7832a7b2838e38edae7e615b03
2026-09-24 16:32:09 +00:00
dan 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.
FossilOrigin-Name: 75c1ee9de670c6366200df65b3a2c7c8888f709e985b5eaf81d57e562ab65b93
2026-09-24 15:53:23 +00:00
dan 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.
FossilOrigin-Name: 7f0149c9696ed8c804fb1f6d4e78f4e887e465015795e03bae0f8ea648d515b4
2026-09-24 15:34:05 +00:00
drh c62a4430f9 Work around quirks in MSVC associated with [d046d5f4c6855].
FossilOrigin-Name: 18b6a43eb8c242e923a852c046a48fe8430d1596c286e114eb1383d6de9adafa
2026-09-24 10:55:16 +00:00
drh 28c6f996b0 Fix test case inaccuracy introduced by [4f4ca57309c82d9e].
FossilOrigin-Name: 1b097b30ac1009073bec72f67b3bcbe55478795149017ed3c72a32ab652bf4f7
2026-09-24 10:37:53 +00:00
drh 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].

FossilOrigin-Name: 0f5ddd0041208c6e1fdb399700bbd892f9d06b17d64d8b1a30c9fced7b574f55
2026-09-24 10:04:45 +00:00
drh fb58e30657 Avoid truncating the argument of flag pragmas to 8 bits.
[bugs:/info/2026-09-23T02:42:23Z|Bug 2026-09-23T02:42:23Z].

FossilOrigin-Name: 9400baf19286771314c886341a3665e8656dbc2b4a0c38b03541a1ee65b41659
2026-09-24 09:34:52 +00:00
drh 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]

FossilOrigin-Name: 52eec02592f9d0d2d4282c20cc0872215c8d88e17f1a3e34d2ccab48119f7c42
2026-09-24 00:18:35 +00:00
drh 9da2d2374a The --escape mode for CSV should default to "off".
[bugs:/info/2026-09-23T16:25:07Z|Bug 2026-09-23T16:25:07Z]

FossilOrigin-Name: c356641fadf591bcf312ae9657ddc84e483a06aa068eb2d3021467435cbad0c1
2026-09-23 21:04:57 +00:00
stephan 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.
FossilOrigin-Name: c43287d8855b3f9a4621545793ecb2a89ef456d563d8377f2b243812e6acb2b3
2026-09-23 14:00:07 +00:00
drh 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].

FossilOrigin-Name: 4a66e328a080b7719e5f76283ae0502f0aaed1b4fa35339c0160b91c3189de5b
2026-09-23 12:27:03 +00:00
drh b72e66e839 Improved comment on the previous check-in.
FossilOrigin-Name: 4ee6d72487e08f994b02340ec50eb53f7f7e54f698b32d4696b405499782a4c3
2026-09-23 12:15:13 +00:00
drh d884a3c7c9 An attempt to improve the handling of rowid lookups using very
large floating point values.

FossilOrigin-Name: 881da860d6048106a50cfec463bd64ee2773baa996129dab369939252f8fcf48
2026-09-23 11:37:04 +00:00
dan 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].
FossilOrigin-Name: 3529f81f53f4b6da6fde23b6d149c7874954f552a51a0c4009394b297a31c95f
2026-09-23 11:31:44 +00:00
dan 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].
FossilOrigin-Name: e9e341013f770a82a60ca947f1b3471370fc2ad9f7feb9dd5f86f61d9d8e3315
2026-09-23 11:12:41 +00:00
dan 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].
FossilOrigin-Name: 55c634d96d390ca52c38c58c66be680c1883d799427ddf23a2501d12e7be07d3
2026-09-23 11:06:11 +00:00
stephan 6ceffc33fe Preprocessor: remove more not-relevant-to-this-copy pieces and add support for C-style comments in directive arguments.
FossilOrigin-Name: 5c321483e07c09271e5a59209cdb7c6748e6525c351c5e7aeeb259eba4ea3e70
2026-09-23 10:06:30 +00:00
drh 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].

FossilOrigin-Name: d046d5f4c6855227f14349d60709a9dcbe27a909ebbb364b7c0ef55db0dbacdf
2026-09-23 09:34:08 +00:00
drh 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]

FossilOrigin-Name: 3b1e5538da0ec57ae456e3a5293746b8fb34451f57d0049cc51dd72eb2f89d6e
2026-09-23 01:29:05 +00:00
drh fd5e4186e1 Improved output when errors occur during ".dump" in the CLI.
FossilOrigin-Name: c49c3890bb4c993057186fa5294cd8c551f47d27cc4b4e73c96118a30462bb16
2026-09-22 19:39:43 +00:00
drh 5c5c986e92 Fix goofy condition in the previous check-in
FossilOrigin-Name: 03e14c500214f182d1bf37127aa0e0eea417115cd76d641c855f4156952da9d5
2026-09-22 19:11:49 +00:00
drh c907770214 Improved capture and reporting of errors by the CLI.
[bugs:/info/2026-09-21T02:55:55Z|Bug 2026-09-21T02:55:55Z]

FossilOrigin-Name: 6698a7e18727b08748eb875c08c93a23afa391d3642e7610a87e86f7528a04bc
2026-09-22 17:12:56 +00:00