Commit Graph

32251 Commits

Author SHA1 Message Date
drh 56363a8d07 Merge the latest trunk fixes and enhancements into the begin-concurrent branch.
FossilOrigin-Name: 330387a9c6a0ce6716e62f920d874bbea8b2e38f549fc03dd72d537284f1a01d
2026-05-28 20:11:47 +00:00
dan 6a8e887a64 Avoid a resource leak in an error path in the icu extension.
FossilOrigin-Name: 87c37dab7e53d1bd891f3fed624963b35ab15a785706d0964b5d07ab70421c10
2026-05-28 11:29:05 +00:00
drh 43ab3c2a84 Fix an infinite loop that can occur in the unused, untested, and
unsupported ext/misc/btreeinfo.c extension if it is presented with
a corrupt database file.
[bugs:/forumpost/b43c44cc1c|Bug 2026-05-28T05:41:01Z].

FossilOrigin-Name: 646e9b49153ebd7e09e3ef72cc4f64fb685d0cfd8b158ef7d11d37c50c3f0b7e
2026-05-28 11:16:55 +00:00
dan 9b7ea5700b Fix a problem with shell tool function analyze() and schema objects with name containing "%" characters.
FossilOrigin-Name: c6d5793d5d2212c979e2fe5eb12c3844bfc1f2029bd8d076fec030a04f6d4bb5
2026-05-28 11:12:29 +00:00
drh 720d3afa7e Fix potential integer overflow in btree overflow page cache computation,
reported by Project Fortify.  Test cases in TH3.

FossilOrigin-Name: dfa674d6e6bffdb930dbefa767831db7862c322b6d3c7a6322f0fa0f087aaaf9
2026-05-28 10:14:25 +00:00
stephan 4cc2dbd54d Patch test/indexexpr1.test to work when built with SQLITE_DQS=0. Addresses [forum:2026-05-26T18:08:20Z|forum post 2026-05-26T18:08:20Z].
FossilOrigin-Name: b470a5d69e70d3440467e7792231f8556111d2c1126cf62879bbfd214ac0a9e0
2026-05-26 19:25:36 +00:00
stephan b79ffe60b6 Fix an OOM check in shell.c.in. Addresses [forum:2026-05-26T15:02:35Z|forum post 2026-05-26T15:02:35Z].
FossilOrigin-Name: e78198e6aec57c28e33a5b1c5ae9943115a35d2fbfa04c8428318567f17eefbe
2026-05-26 17:15:54 +00:00
dan 6e3e557c81 Fix a potential 1-byte overread in sqlite3changeset_invert() when processing a corrupt buffer.
FossilOrigin-Name: 78eaa605cb6c14e5bd49a898b4c737957bd60c8714913cc2341f4ffe3bfe81fe
2026-05-26 15:03:30 +00:00
dan 18bee1617f Fix a 32-bit integer overflow in sqlite3changegroup_change_blob() that could lead to a buffer overwrite.
FossilOrigin-Name: 8a289158e2baeee8aa5e601bde46b0482361064ede09e4108f519270efdd5f69
2026-05-26 14:18:50 +00:00
drh 2315f282be Fix QRF so that it works sensibly with "--wrap 1"
FossilOrigin-Name: 48f950b2a1ef841d915ca733baf324a1af98e644b660f238dd5018015340a6c6
2026-05-26 13:54:57 +00:00
drh ce2f503c1c Strength the defense against malicious command-line arguments in the
sqlite3_rsync utility program.

FossilOrigin-Name: c84d596b6da22061627282d444913c88dc2f9bd82e86957183f7e732f2713b33
2026-05-26 11:23:00 +00:00
drh 5554aa27e6 Fix HTML ">" quoting in QRF.
[bugs:/forumpost/f72dfbdeff|Bug f72dfbdeff].

FossilOrigin-Name: 5cee1097b47d850989ebecdb9d2c814e6968240fe3bacb5598ca85067cb95692
2026-05-25 23:44:37 +00:00
drh 5cfa63e6c8 Fix a minor problem with test case mjournal-3.3.
FossilOrigin-Name: 80093dc0610438cd506d230eca12e699e05395aecb8048c5bc066379b927e8bb
2026-05-25 20:45:43 +00:00
drh 0ca827a590 Early malformed JSON errors in json_each() and json_tree() to prevent
excess output.

FossilOrigin-Name: eb4d7e1b86b1d1bece01f621c9991a11f4812bf515a973b5036b09a1392134e2
2026-05-25 19:47:58 +00:00
drh 7e20b624db Fix to testrunner.tcl so that it will run on FreeBSD.
[forum:/info/2026-05-25T18:50:36Z|Forum post 2026-05-25T18:50:36Z]

FossilOrigin-Name: 97b66687b3f772e225e1792194a7f54a2ae187c84de1d76227846503631b5c2f
2026-05-25 19:32:52 +00:00
drh 94c8755a95 Enhance the defenses against malformed JSONB in the jsonbPayloadSize()
routine.

FossilOrigin-Name: 32c9f71a989fa4c81a613398ca5c1e68eb88b2a90ac4a4a7bf39e755717f43b1
2026-05-25 18:46:42 +00:00
dan 8c9071ae4e Use "-encoding iso8859-1" instead of "-encoding binary" in mjournal.test so that the script works with both Tcl 8 and 9.
FossilOrigin-Name: 897b443fb35d550891315890a5af473d347af3b6ecea11fcafafb5b06a1b50a5
2026-05-25 18:14:58 +00:00
dan e1233bb609 Fix a potential 1 byte overwrite that could occur when processing a carefully crafted super-journal file.
FossilOrigin-Name: b3766c3afd0ac4d31f158ee5938f19d72a047872e422b5f19b1567c60640f54d
2026-05-25 17:58:07 +00:00
dan 00ba6a6635 Fix a potential buffer overwrite that could occur when in fts5 when handling corrupt records.
FossilOrigin-Name: de009593f692251c4a033742b1e79c4ddb5ddcb174209d58c4d1bea19ceb360c
2026-05-25 17:09:37 +00:00
drh 3020203708 Make the /A substitution in the CLI prompt expansion responsive to the
SQLITE_CLI_APPNAME compile-time option.

FossilOrigin-Name: 624dc12e9e6dece22f7d247b66f0889755295cb2154502ade6553c13b8fecd83
2026-05-23 12:14:05 +00:00
drh db7fe319ed Strengthen the statement about not accepting agentic code.
FossilOrigin-Name: 64b707f4b3177384b611df5f5e4ca7da44d86313f74ff943a00581a6dd924b08
2026-05-22 17:51:15 +00:00
dan 3eb6a5ee33 Update the session module so that it can apply changesets containing two or more UPDATE changes that form a dependency loop - so that no single UPDATE can be applied independently without violating a constraint.
FossilOrigin-Name: 32c762bbb187e3bc964dcaad0949ebeb4da21331be842a5868feeac6088790ca
2026-05-22 14:29:33 +00:00
dan f380599476 Add the SQLITE_CHANGESETAPPLY_NOUPDATELOOP option to the sqlite3_changeset_apply_v2/3() method. To disable the extra processing to commit changesets that swap two or more values subject to a UNIQUE constraint between rows.
FossilOrigin-Name: eba02092bcf1713a646ecf8febd53a83bc803cf1b17e2e4fc590c14d886a8d27
2026-05-22 14:22:14 +00:00
drh a1e5778889 Add a prototype AGENTS.md file
FossilOrigin-Name: 3dd1181120b9910a96090b5b3cad5f0829fadeffeb6ffaad17031540a5749513
2026-05-22 11:15:25 +00:00
drh 8f70ec615f Fix the VFSes so that there is no 32-bit integer overflow in the
xShmMap method if the WAL file size exceeds about 25 terabytes, or
if the header is corrupted to make SQLite think that the WAL file size
is that big.
[bugs:/info/2026-05-21T03:53:03Z|Bug 2026-05-21T03:53:03Z].

FossilOrigin-Name: 9ac4a33a2932d353c4871fd8e09c10addf827f1fc3fc9380037d738cf2cd0353
2026-05-21 15:14:35 +00:00
dan de739c3450 Merge latest trunk changes with this branch.
FossilOrigin-Name: c6226d508d6af28fcd42fecd482014c3e284923871d3d8f5177f728cbf3457c5
2026-05-21 15:13:17 +00:00
dan c597ed79d1 Fix a buffer overread in the session module that could occur when processing a corrupt changeset.
FossilOrigin-Name: 869a51ae84dfaaf824c872e4b3024f35eea7fa67bb584759a2d42ebf8404ef6e
2026-05-21 14:58:36 +00:00
drh f305e1921b Performance optimization to the sqlite3ExprCollSeqMatch() routine.
FossilOrigin-Name: 035f1d2f284a081e6aef01cc773a3784458ec8e6297f3fbf4063670a9e65278c
2026-05-21 14:48:43 +00:00
drh 3dbab77bf1 Remove dead code created by [20c2f8ce9242c3db].
FossilOrigin-Name: 68c5fd5fa0f986b782519472398b068ba7c295c56a0e0199b8e0509d0d1685fb
2026-05-21 14:16:47 +00:00
drh da18b56b25 Limit the length of inputs to the spellfix1_editdist() extension
function (not part of the standard SQLite build and rarely used)
to 99999 characters, to avoid any possibility of integer overflow.
[bugs:/forumpost/5da728247a|Bug 5da728247a].

FossilOrigin-Name: 51ebf0e04efcbe982e62f2228553700b8c1147a37c70fdfaa0e377184b3ac936
2026-05-21 13:37:15 +00:00
drh ecd9748590 A join constraint is not an equivalence unless both operands have the
same collation.
[bugs:/info/2026-05-21T03:39:28Z|Bug 2026-05-21T03:39:28Z].
Error goes back to version 3.7.17, 13 years ago.

FossilOrigin-Name: 20c2f8ce9242c3dbb8054f01c6c7338763c830b7c1491a99c8e1de98ce8f0a5b
2026-05-21 13:03:18 +00:00
drh 6ae9949399 Enhance the xfer-optimization to verify access to the source table using
the authorizer, if an authorizer is registered.
[bugs:/info/2026-05-21T03:31:22Z|Bug 2026-05-21T03:31:22Z].

FossilOrigin-Name: d1cdb817cafd03a4081b254a71672ba07e5b637994d3f2f925532f17af0a67dc
2026-05-21 12:04:20 +00:00
drh 37e253208f Improved entropy collection on Windows.
FossilOrigin-Name: b734b76af3f732e0db8a002781bae57aa7a01c4a7f5151605144a6aeef993a21
2026-05-20 20:03:07 +00:00
dan b869ed6b06 Fix a bug causing the session module to dereference a NULL pointer when applying a corrupt changeset.
FossilOrigin-Name: e807d4e3798efd532b3d78d1dfe513ed4fbd3cb793dd0ae5c30cae6031422b10
2026-05-20 15:06:34 +00:00
drh ccf23dadea Check-in [7cf841f3613c8302] was incomplete in that it did not remove
the incorrect assert() statement.  Fixed here.

FossilOrigin-Name: c19bacca13f699953bbf50afb867035a94080b8a48111cf3d87bced880a3e620
2026-05-20 11:53:15 +00:00
dan d3dc8e5ae5 Avoid returning an SQLITE_SCHEMA error from within sqlite3session_diff() if the schema has been recently modified. First <a href=https://sqlite.org/bugs/forumpost/269f1e9cef>reported here</a>.
FossilOrigin-Name: 20110547a117912be68d91bc006e92c45beffde16c6bcdf062bf8971c9a9a864
2026-05-20 11:41:24 +00:00
drh badc42fd74 Fix a test case added by [1249eeb1b9759038] that does not work for
the config=prepare permutation.

FossilOrigin-Name: 6aaeeffc2c7abbe32050da40bcbffc5f8d596e6df4603b8f8f23294f2465f25e
2026-05-20 01:32:30 +00:00
drh fd9eba554a Improvements to testrunner.tcl: Make C-program tests responsive to the
pattern list.  Do not remove build steps until the very end when we are
certain that the build step is not required.  The pattern list matches
the exact text of the displayname column of the jobs table.

FossilOrigin-Name: 3f409c0e1be6b71eca92eccf0b9de3ef5923a6a57be49540ebe190fc6a6d06d4
2026-05-20 00:16:20 +00:00
dan 8154476ff8 Fix a potential buffer overread in fts5 that could occur when handling corrupt records.
FossilOrigin-Name: 70021c3291b38192832c99fa4d8155249dd39f5b26334595c71f5cee66d13ebb
2026-05-19 20:27:54 +00:00
drh d258b93356 Silently ignore nested porter tokenizers in FTS5. Having nested porter
tokenizers is pointless, but it does use stack space unnecessarily.
[bugs:/forumpost/a7766198f1|Bug report a7766198f1].

FossilOrigin-Name: 0bdeedf56c9d7209d1ea8f950d0ef03c78cbf677528d9d30c5f4ec48c4e1a571
2026-05-19 19:33:49 +00:00
dan 3ef3ecdf8a Remove new unreachable code from this branch.
FossilOrigin-Name: 07f81e256fde5796c0d8bcedff8fad4368639386f40881c0844e9c86a69b6fad
2026-05-19 18:58:59 +00:00
drh 632b618063 Prevent integer overflow in the ICU extension.
[bugs:/forumpost/844bdd7d5c|Bug report 844bdd7d5c].

FossilOrigin-Name: c20cb75ca07d0553d7a847c65a40efb2e5c587579ec32b02121a8963c70db12f
2026-05-19 18:56:11 +00:00
drh d58b463ffb Fix an assertion fault that can occur in RTree given a carefully
corrupted database.
[bugs:/forumpost/2026-05-18T06:46:01Z|Bug report 2026-05-18T06:46:01Z].

FossilOrigin-Name: 7cf841f3613c8302a419638bdec83b1b9799f00cfedbfe40dca0a1a005c196b5
2026-05-19 18:45:05 +00:00
dan 1a0555610d Fix problems with error handling when applying changesets with update loops.
FossilOrigin-Name: f797925df05f1a53392dba416aa72067716bb6e38ebc679d313f8a98f89c5913
2026-05-19 18:28:03 +00:00
dan 079f8dc682 Merge trunk changes into this branch.
FossilOrigin-Name: e480e126fc1550948bd1a3635f0e3a862353dcd8b0f1921ab6e66d699110b477
2026-05-19 17:15:05 +00:00
dan 4da2ddf50e Avoid a potential 1 byte overread in sqlite3changegroup_add() when processing a corrupt changeset buffer.
FossilOrigin-Name: 4d8c3a2919dc942a0a044ec7582a688e0f93e91f4a465bb94390fbe3ad1b50b4
2026-05-19 17:12:39 +00:00
drh fdf746967c Add an sqlite3FaultSim() call to the changes at [6193e4105b6a58ea] to
make them testable.

FossilOrigin-Name: 0de3d95500b7ecd41a09d81f176c1510896e811b3e468e1cf50f752305fdb06f
2026-05-19 17:05:28 +00:00
dan c7ddaf2479 Merge latest trunk changes into this branch.
FossilOrigin-Name: 1f71b530c9e8ddce5b25ed0971447cd925f9194afc7a2f929429318a5fcb5a72
2026-05-19 16:07:22 +00:00
drh 45b4213160 Fix a incorrect assert() from [52dd437d51d3c1af] reported by OSSFuzz.
FossilOrigin-Name: 64b49e4d431d35db0920c7fc8a89d38ce2d2d2dbf42a7caf76aaa9685d66601b
2026-05-19 16:07:08 +00:00
drh cbbeddbd67 Add the "make" subcommand to testrunner.tcl
FossilOrigin-Name: 00d546812810252a4d51ff796931dc2ff5bdd5173ddb8f95fb5efccd897087ff
2026-05-19 15:13:03 +00:00