6252 Commits
Author SHA1 Message Date
drh e5796f671a Improve generate_series so that it handles constraints that compare
the "value" output against a string or blob.
[bugs:/info/2026-10-26T12:55:22Z|Bug 2026-10-26T12:55:22Z]

FossilOrigin-Name: 6b66b52ab29511e0e9d775892bad4eb0b29a5d25289feeaed2eafe004e1e920a
2026-10-27 18:46:26 +00:00
drh 814fd8ef4d Merge branch-3.54 fixes into trunk
FossilOrigin-Name: 11932649019188e1d8abd30c61dc88f0d9a425e659461bbb78056c86d4dab12d
2026-10-27 15:11:21 +00:00
drh 076ab6c286 Prevent application-defined functions that invoke DDL statement or
perform other mischief from deleting the schema out from under the
statement that called the function.
[bugs:/info/2026-10-25T19:26:00Z|Bug 2026-10-25T19:26:00Z]

FossilOrigin-Name: 5410f7696bcdfce19071ca3790fae10fd74001cfb472e162f0a7e6da0f3c962a
2026-10-27 14:58:34 +00:00
dan 495eef2d14 Fix a typo in sqlite3expert.c that could lead to a heap buffer overwrite in some cases. Report [bugs:/info/2026-10-27T14:08:33Z | 2026-10-27T14:08:33Z].
FossilOrigin-Name: 0273cbefd497f3c0f391b6a06fcc44da6f8497f564af2234f74ea44b0e359ecc
2026-10-27 14:37:55 +00:00
drh e86ed8bbbc Remove DIRECTONLY markings from the tryeval() and expire() functions.
FossilOrigin-Name: f4efdfa6ff4058a51a86a1614bdca40f77cde5963e9d2d975db2d78e0e495647
2026-10-27 14:28:17 +00:00
drh 2ec708af90 Add the SQLITE_FILECTRL_EXPIRE_STMTS file-control to facilitate testing.
FossilOrigin-Name: fc75988f7591ec24db06d03050e5f6c893fb328d99b6392ea6aab0ef0f31aa59
2026-10-27 12:18:02 +00:00
stephan c2069120e5 Revert the part of [341525ecfdd4] which throws for a short digest read, and simply treat that as a digest mismatch as we historically have.
FossilOrigin-Name: a4951df233333f1d20cd5276387fdeb3ef0810b253de2ee26e0d9faf068bb737
2026-10-27 09:55:56 +00:00
stephan 3a963c36af Rename an internal JS API for clarity. Replace a == from the previous checkin with ===.
FossilOrigin-Name: 77debe031492bef4fcfb29c525fd9d31696f7fb807a48a3b7846628390e9acbf
2026-10-27 09:49:44 +00:00
stephan 530c6d839b JS: teach the SAHPool VFS to be able to recover the data part of a handle when the JS context is killed between the two writes of its header part. [bugs:7418667df7|Bug report 2026-10-27T08:42:50Z].
FossilOrigin-Name: 341525ecfdd4f79347801d70023285568f413aa1691d0db33a59c0ff974d7730
2026-10-27 09:41:49 +00:00
dan 5d1ee88809 Avoid leaving a transaction open in the session module when a changeset applied in no-savepoint mode fails because an UPDATE hits a constraint. Report [bugs:/info/2026-10-21T02:23:36Z | 2026-10-21T02:23:36Z].
FossilOrigin-Name: 46d3df136172c29cd76ad980fe7d5ae0bda04d10980886b97cc5ae9fceef08cc
2026-10-26 19:43:48 +00:00
dan 3f490b14f7 Have vec1 discard its in-memory model cache when a savepoint is rolled back. Report [bugs:/info/2026-10-26T11:36:53Z | 2026-10-26T11:36:53Z].
FossilOrigin-Name: 46fb620071288fbc0d0d069e7bd29cc8cf5703b3fb6319f2bb0356bab75311fa
2026-10-26 17:49:10 +00:00
dan ec4c2a0152 Fix another fts5 problem with mixing writes in secure-delete and non-secure-delete mode on a single table. Report [bugs:/info/2026-10-22T16:23:31Z | 2026-10-22T16:23:31Z].
FossilOrigin-Name: 0b486e53a472908b625b74b16439b6a6cb1c57706f3e506a1994526bbd56ce2d
2026-10-26 17:21:22 +00:00
drh 9a7e5d2e43 Update to include the latest trunk enhancements.
FossilOrigin-Name: 95da88756c843bedc858c6e973170770459032340c109bdacb1efc81fc27af8a
2026-10-26 15:26:25 +00:00
dan c20c589111 Fix an fts5 problem with deleting a key in secure-delete mode on a detail=none table when the key being deleted is the last on its page and has a delete-marker attached to it. Report [bugs:/info/2026-10-21T17:14:08Z | 2026-10-21T17:14:08Z].
FossilOrigin-Name: 2d7df34b62c04da3d94382169acdb58f0942a0936504bf0deeb0993f72f879c7
2026-10-26 14:57:18 +00:00
drh 77f8caa273 Merge corrections from branch-3.54 into trunk
FossilOrigin-Name: c2c5f34f0f60d3f8b09976149d633b36754c0f139b41cb30fc27b478dee9fdd5
2026-10-26 14:43:56 +00:00
drh 8295706a8e Disable (at least temporarily) a test case associated with .recover that
shows different corruption recoveries based on compile-time options.

FossilOrigin-Name: 16dd7e5415c9145f1de492b64b0e2202e38ced64072c0f52e20cc9e8be05136d
2026-10-26 14:13:00 +00:00
drh d07e02e1ed Test case changes to account for various configurations.
FossilOrigin-Name: a207774a85f31cdc957857b7b0af161edcfd5e83e4f48ce64e6086fddfb2ebe8
2026-10-26 13:21:51 +00:00
drh 2692a5619b Improvements to handling of failed DDL statements from within an
application-defined function.

FossilOrigin-Name: 35cf7c1e811b2b5fa00fd3a2bb1918dd841bc1e950aa0ca00f5102c3b616f104
2026-10-26 11:46:18 +00:00
dan 9902ebadb8 Improve detection of corrupt changesets in session module function sqlite3changeset_next().
FossilOrigin-Name: 75cb77338bd7ed2d347c326b9fb4410543eeed59fc3c6cbed08316b0443fcddd
2026-10-26 08:23:03 +00:00
dan 6fd45c5ce9 Avoid a signed integer overflow in fts5 when processing a corrupt database.
FossilOrigin-Name: 888adfb93ac74cc79fd04baf1c1c75aef1a8e0f4fe73a6f853c31e009d2cc043
2026-10-26 06:39:08 +00:00
drh 1820defd76 Merge all recent branch-3.54 fixes into trunk
FossilOrigin-Name: 4fee54f1d687c2e2b4a760c59d1d29fceb81623494cf65b72c309f4922dc0a7e
2026-10-25 22:40:37 +00:00
drh 221ff059c3 Prevent a NULL pointer dereference in dbdump after an OOM
FossilOrigin-Name: 53da8bd2c32db0b8d744d9660737eec1a18adec67329e4bcfcfbe1827cc4381d
2026-10-25 22:12:07 +00:00
drh 8e72095ca8 Fix the sqlite3_db_dump() interface to the dbdump.c extension so that
it works even on an empty database with PRAGMA empty_result_callbacks
engaged.

FossilOrigin-Name: 8026e49181e8596750b89191c0d7eb6da3a34bc1976d573cc9fc826f054642ef
2026-10-25 22:05:29 +00:00
drh 8f72f50e27 Make sure memory allocations do not overflow in spellfix on i386 and similar
32-bit platforms.

FossilOrigin-Name: 65c545ab8d370ae6b288b985c1c8396b4f48ac360fbe799b446cbdb8852f3872
2026-10-25 22:00:07 +00:00
drh f99a038a08 Avoid an integer overflow in the spellfix extension when setting
a ridiculous values for the top= parameter.

FossilOrigin-Name: 3dfc7fa4c29741f530511ec9e5da4fd1b446cb2310ec00fb5c1b49124cd846d0
2026-10-25 21:51:58 +00:00
drh 50586b61d8 Use the new sqlite3_result_str() function to implement SQL functions
geopoly_json() and geopoly_svg() as part of the geopoly extension.

FossilOrigin-Name: 4fbce3be94ccdd4dea79db277b3097d2f2c0e995a05d6345c24988ad949e2f9f
2026-10-25 20:42:16 +00:00
drh 4546f13d17 Increase the size of the Fts3Table.nPendingData field to 64 bits to
avoid any chance of ridiculous inputs causing a signed integer overflow.

FossilOrigin-Name: 56f261a67626a26d509e9c5221cfae18320e2b8654ae700adedb204191673406
2026-10-25 20:29:47 +00:00
drh d16e78b4fb Fix two instances in test cases where there is an attempt to delete
a file that is still open, which does not work on windows.

FossilOrigin-Name: c6e22bceae0e2ba57c739d6349f07da2bb27e115131e4d867163e5a8958a78c9
2026-10-25 18:13:16 +00:00
stephan cc3cf98eec Reorder a sequence point violation. [bugs:d82d144d71|Bug report 2026-10-25T16:05:55Z].
FossilOrigin-Name: 78ad029d8fdcc1f52bb7c761ee7b7b5c02d3dd616b441a76421aed3fa7a91e01
2026-10-25 16:57:25 +00:00
drh 2d9389c494 Merge the improved .recover OOB write fix from branch-3.54
FossilOrigin-Name: 5c07d633cae924c1ef9a4165e9684e31c29738a49ddb3b024a0e1ab427957686
2026-10-25 13:52:08 +00:00
drh 45c3d6e297 An even better fix to the same problem as the previous two check-ins.
FossilOrigin-Name: 8f694d2a7de472eff8b3f6018085e03f8a1b68e6307e386e069c72b8af1b1f45
2026-10-25 13:46:07 +00:00
drh 7dcbdfa671 A better fix for the recover OOB write problem of the [37963c3869640f98]
FossilOrigin-Name: fbe2d9fb82582c06d6f2b137270a085b76d415d551a704db7ab517207cf129bb
2026-10-25 13:36:36 +00:00
drh 4012bdca5f Merge recent branch-3.54 fixes into trunk.
FossilOrigin-Name: 00a52a3da142ae3104dc3241c377276ccae3a04df57c629c2ad47b626a3c4fa0
2026-10-25 13:29:09 +00:00
drh 427b538f72 Fix a possible OOB write in the recover extension given a corrupt
schema.  [bugs:/info/2026-10-25T12:08:19Z|Bug 2026-10-25T12:08:19Z].

FossilOrigin-Name: 37963c3869640f9857dd4edf5e26fdca336ec71d8b1cf188507cab5fad91f681
2026-10-25 13:07:54 +00:00
dan 6de9972df6 Fix an fts5 problem causing auxiliary functions to see an incorrect list of matches in some cases when the query contains a NEAR expression. Report [bugs:/info/2026-10-22T16:41:04Z | 2026-10-22T16:41:04Z].
FossilOrigin-Name: fcddc5ab9ab46852de1500430e16e04739341266651703a868138d666ca45cd6
2026-10-24 19:50:13 +00:00
dan 01f9950f87 Fix some cases where the list of matches made available to auxilary fts5 functions was not correct. Report [bugs:/info/2026-10-23T02:22:13Z | 2026-10-23T02:22:13Z].
FossilOrigin-Name: 16ba33e6dffaf830f40cb13c1357dea33abf6de233e22e15f2caed42ee8ffe7f
2026-10-24 19:30:11 +00:00
drh d246ad4b9c The recover extension no longer drops the last column of a table with a
generated column, and other fixes.
[bugs:/info/2026-10-20T02:56:33Z|Bug 2026-10-20T02:56:33Z]

FossilOrigin-Name: 0ce909f57ad48cd1387785c7931a355954f4162396f19d364c5015095d91ef2f
2026-10-24 18:56:00 +00:00
dan e7dfb3cae9 Make the fts5_vocab virtual table WITHOUT ROWID, so that RIGHT JOIN and OR queries work properly with it. Report [bugs:/info/2026-10-23T03:07:25Z | 2026-10-23T03:07:25Z].
FossilOrigin-Name: 25d3a17413eed51c9fcb534374c9aca1bef5a3e72ab0680e5b46c8d9f4429b1e
2026-10-24 18:26:57 +00:00
drh f565c8efc4 Fix various minor problems in the CLI.
[bugs:/info/2026-10-24T04:43:44Z|Bug 2026-10-24T04:43:44Z]

FossilOrigin-Name: a7fd475c0d34d84232e721c724ccbc07729f594ab20aba9eb0631cf76a09ce23
2026-10-24 16:49:09 +00:00
dan c985864f08 Have vec1 check the vector size field is within range when loading a configuration. Report [bugs:/info/2026-10-24T09:06:20Z | 2026-10-24T09:06:20Z].
FossilOrigin-Name: d3325353c8326ba92f03b3bdd46dc4522cd7eb3da670adb073bb060927be58c6
2026-10-24 16:35:32 +00:00
dan fd277ecc04 Enforce the upper limit on vector size in vec1_train() as well as in the vec1 virtual table. This fixes integer overflow report [bugs:/info/2026-10-23T11:24:33Z | 2026-10-23T11:24:33Z].
FossilOrigin-Name: 25a81a8650505b08597947ec58ad6591ca62af4b40a92a910347ac61053865f7
2026-10-24 16:18:44 +00:00
drh c6536c6e60 For the "relaxed" quoting mode of QRF, tighten the restrictions on what
must be quoted to help prevent strings that actually look like numbers
from going unquoted.
[bugs:/info/2026-10-24T04:41:27Z|Bug 2026-10-24T04:41:27Z]

FossilOrigin-Name: 7c8c79a443e025f32035ec91d8c32e032996f1b798444b5b1b5ce98d759f1338
2026-10-24 15:10:50 +00:00
drh 598d9cf776 Fix a test case for geopoly that should have been inside of
"ifcapable geopoly".

FossilOrigin-Name: 0172c575ef99bc2b50bf4ff5588e180915f9fb7f8f6ad5d1582725652f72fba5
2026-10-24 01:23:56 +00:00
drh f879fb18cd FTS5: INSERT into a locale=1, contentless_unindexed=1 table with an UNINDEXED
column now works.
[bugs:/info/2026-10-21T02:49:37Z|Bug 2026-10-21T02:49:37Z]

FossilOrigin-Name: 055f90829c4094f9c78d95ce05662b9443c325cb16af50beabf56e7f8b72b9bf
2026-10-23 18:39:36 +00:00
drh 7b6afb441b Merge the FTS5 one-byte overread fix from branch-3.54
FossilOrigin-Name: b5271900464944afdbbc5de9fbed185ff6b6143bc6dca3984e8e6af5f5caa855
2026-10-23 16:01:12 +00:00
drh 1778ff4dab Merge BOM handling fixes.
FossilOrigin-Name: 5b0c5f63416a671ee15a2a2bae430d059ea9b664c0f2db41d033286d00d1a56b
2026-10-23 15:56:07 +00:00
drh a4b453a1e6 The .recover command should not remove BOMs that are already inside the
database.
[bugs:/info/2026-10-18T20:41:57Z|Bug 2026-10-18T20:41:57Z]

FossilOrigin-Name: 69f4d423fa5538a555f862da3a1896e2fa3009dc650286042cb0beabe4dd2114
2026-10-23 15:52:17 +00:00
drh 014644d8f2 FTS5: Fix false-positive corrupt FTS5 index report on an INSERT into
a contentless_unindexed table.
[bugs:/info/2026-10-21T02:49:37Z|Bug 2026-10-21T02:49:37Z]

FossilOrigin-Name: 887264cd9a2ad95d808f910b4d0be04e8435382eb7640b4d4769b648b266d3a8
2026-10-23 13:41:31 +00:00
drh b66207d732 Fix a one-byte buffer overread in FTS5 associated with LIKE processing.
[bugs:/info/2026-10-23T12:49:10Z|Bug 2026-10-23T12:49:10Z].

FossilOrigin-Name: 60222d023e889eb8c67c0a654637c3f3da741b37143f1b3351a7ac4ef09befc6
2026-10-23 13:22:05 +00:00
drh 47f34d87e3 Merge the FTS5 fix from branch-3.54
FossilOrigin-Name: 320cb1f51382868ed576d8fa52c75672a2c3e4cee99f868385645bd9a370457a
2026-10-23 12:51:22 +00:00