1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-10-23 21:49:02 +03:00
Commit Graph

32669 Commits

Author SHA1 Message Date
dan
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.
FossilOrigin-Name: 05acfd4dc9a31b9437b44cd8ca13df9f0c54d53af05d601bde537303dff92435
2026-09-29 19:42:37 +00:00
drh
349d1438eb An early attempt to implement the tree-tracker optimization.
FossilOrigin-Name: ead82958b3edd02e3da8fc3dbec880215d2539d4e0e7b97d3a689793d4938d22
2026-09-29 18:49:51 +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
dan
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].
FossilOrigin-Name: 4f4ca57309c82d9e2e090cf3accb83d4ee2868de2a7626d7afc30ff4c8351695
2026-09-22 10:30:05 +00:00
stephan
fde3a84ddd Latest preprocessor for various cleanups and fixes. Duplicate the tester1 concurrency warning in the worker-based copy.
FossilOrigin-Name: c9b4695ffae5a3388a49643d6819355851a0fda362cdaf140c59fc934759dcac
2026-09-21 20:18:51 +00:00
dan
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].
FossilOrigin-Name: 90891e96c488ce0eca12e00d01231cd011587236d349f09d4fa979f781ccdafe
2026-09-21 17:12:55 +00:00
dan
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.
FossilOrigin-Name: e6fc087f5a302906a79fd111420d2df310c2db88401231349c0ea11987a380af
2026-09-21 15:52:34 +00:00
dan
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].
FossilOrigin-Name: c6b035ceffb7771e5fa9b1b1efc1544b0d7eea6d0576f257c836c82c4122d58d
2026-09-21 15:45:19 +00:00
stephan
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].
FossilOrigin-Name: e911d84b391bbb4859098f265ea5e507eb6fe21e55bc509ee23b66015dfc00db
2026-09-21 13:08:59 +00:00
dan
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].
FossilOrigin-Name: b0919c9687f01240c89171e1607816b603450e5bed37c468860298b2ccc11a81
2026-09-21 11:14:14 +00:00
stephan
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.
FossilOrigin-Name: 24bddf2aff01962a35c42422e322c12582ea77e2c7ddd5f8754d12c454ce8a1d
2026-09-21 07:29:41 +00:00
drh
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]

FossilOrigin-Name: aadf42e021fc55d457836c7cda68f3d22dcaae72a7bbc105c3c727b3eb5c4657
2026-09-20 20:17:58 +00:00
dan
5bd0f37f60 Add test cases to sessionchange2.test.
FossilOrigin-Name: e90a05f56f594da0af9c8af7aea91492fae5c66f3b16f5a12ca8db13eada5824
2026-09-19 17:20:43 +00:00