Commit Graph
33278 Commits
Author SHA1 Message Date
drh 71f1e0e738 Merge all the latest trunk enhancements and fixes into the begin-concurrent branch
FossilOrigin-Name: b90061a0cc1af53b6026a8282fc404eb8e2cf6ea428d844eba05cf332c5e3e7e
2026-10-27 18:44:22 +00:00
drh 7721051f69 Fix a problem introduced by [08e979525ff1eef8] and reported by
[bugs:/forumpost/70e3174f54|a follow-up comment] to the original bug report.

FossilOrigin-Name: 6be81afa66f131d7efe59a24a693e738b0d48f82831ce2e0003dc4e4186fa980
2026-10-27 18:26:34 +00:00
drh ab6b5f2290 Remove an ALWAYS() in the query planner that can be false for a truly
ridiculous 350K+ character input query.
[bugs:/info/2026-10-26T18:22:15Z|Bug 2026-10-26T18:22:15Z].

FossilOrigin-Name: c5f98a311e26856611f841a7938f92a327c21cc9d89661c6e894d6e77fe98629
2026-10-27 16:24:38 +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
dan fb6bc2334f Disable the "<expr> IN ('const')" to "expr = 'const'" optimization when 'const' has a collation sequence. Bug [bugs:/info/2026-10-26T04:25:22Z | 2026-10-26T04:25:22Z].
FossilOrigin-Name: 46da9e0212d2d3f3108b1985ebbabe637970d7329ed8c9c1ccb2bfb18a14acac
2026-10-27 11:08:15 +00:00
drh aa20b91788 Expire every prepared statement that uses a schema when that schema is
cleared.  In the VDBE, do not access p4.pTab or p4.pIdx fields if the
prepared statement is expired.

FossilOrigin-Name: 6ca068cdcef197ffe137d77d445b17a9d6b7f25d120acb55fb719b6842aef638
2026-10-27 10:07:10 +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
drh 2cc8623f54 New test cases for schema resets.
FossilOrigin-Name: b694f96bf89937f8d81fe885b08bc0a9e84ec97d37cb27dda5cbd37719d9e358
2026-10-26 23:21:29 +00:00
drh 4bb628d92d Fix missing prototype for sqlite3DbMaskUnion()
FossilOrigin-Name: 7c2ea69839322d113377122e87250e746712dd7e8920ff867a95cf68c2de3917
2026-10-26 22:53:00 +00:00
drh 51dcf20a61 A more accurate approach to resetting schemas on active statements.
FossilOrigin-Name: 031a3911c352c7d1a70dc9d3b6fa32438ac585ae13e2558759b0b90580784ecf
2026-10-26 21:07:46 +00:00
drh 06e89d6616 Be very permissive for schema resets following a schema cookie mismatch.
FossilOrigin-Name: bfb2c110a9b72d6e6df17c6f4cc50d36e834e290eb95ef990dd941c29a8f305c
2026-10-26 20:07:13 +00:00
dan 116c504057 Fix test script error causing failures in sessionfault2.test for SQLITE_DEBUG builds.
FossilOrigin-Name: 5146cf4b3ec0aa8310e65fbc9add563b497733933cf0d8e750d816f358a42161
2026-10-26 20:05:07 +00:00
drh 37623e85f8 More precision in controlling when to reset schemas.
FossilOrigin-Name: 717b1b90c52d94c54615ef954288695adb8e1647fb2259a906641b6279af8d96
2026-10-26 19:51:23 +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
drh 9b3f957fe1 Where possible delete the table root page prior to updating the schema
cookie, and that avoids the need to early-out the reprepare loop.

FossilOrigin-Name: 258891bee056c57cf0459bfcfc0e34bb736866a3ea81fc9d8a1117c572e6f48e
2026-10-26 17:21:24 +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 f7564c540b Do not be as aggressive at blocking automatic reprepares due to
a pending schema reset.

FossilOrigin-Name: c1a6ef0daa09fdad2ef807dd9defde3e5c7ceb11646f5129b3db19559398fe64
2026-10-26 15:44:25 +00:00
drh 9a7e5d2e43 Update to include the latest trunk enhancements.
FossilOrigin-Name: 95da88756c843bedc858c6e973170770459032340c109bdacb1efc81fc27af8a
2026-10-26 15:26:25 +00:00
drh 0b97f1b101 Test case tweaks to account for different configurations.
FossilOrigin-Name: 46476df942c3684665e66f9e2cb7e7fa6a1822d1f059969cca91a6b665c4eea0
2026-10-26 15:18:19 +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 a74857a26a Fix the ext/recover/recovercorrupt4.test script so that works even
if cell_size_check is turned on by default.

FossilOrigin-Name: a2b7dcba6bbca6fea1cc6aecb88ef6941c5ea00f0e3e6861d52619632b2b3ee1
2026-10-26 13:55:24 +00:00
drh d07e02e1ed Test case changes to account for various configurations.
FossilOrigin-Name: a207774a85f31cdc957857b7b0af161edcfd5e83e4f48ce64e6086fddfb2ebe8
2026-10-26 13:21:51 +00:00
drh 4303eaf221 Reorganize OP_MakeRecord slightly to avoid signed 32-bit integer overflow
prior to discovering an oversize error.

FossilOrigin-Name: 8575e97c30c076d886ca8ce901a8e413d11a41308ca3494b2e196f49160c36fb
2026-10-26 12:46:03 +00:00
drh ac308db785 Back out the tSerial type definition change. It was a mistake.
FossilOrigin-Name: fc56735f1c34ee0d8605d4f79ed2e13e5f54017898178c8d20a79d34fea6597c
2026-10-26 12:37:49 +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 005a5862a5 Experimental fix to [bugs:/info/2026-10-25T19:26:00Z|Bug 2026-10-25T19:26:00Z]
FossilOrigin-Name: efdff276d2c19f77be5b5b600084996126ec2ae3e2a7ed91f2e7d7e1916043ba
2026-10-26 01:20:04 +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 3ba6a65bbb Fix another problem with OS_VXWORKS
FossilOrigin-Name: 5eb1662fbb3af945017821094522cf05dd30df3e7b5e780a96e627c5549a5ce0
2026-10-25 20:15:12 +00:00
drh 5a7949b088 Avoid a small memory leak that might occurs if SQLite is compiled using
-DOS_VXWORKS=1 and a call to sem_open() in the unix-namedsem VFS fails.

FossilOrigin-Name: f0a3729e3835cf27f8ffc0b40239ec722eb0f97543ae3a6026ec2e64baf6cb54
2026-10-25 19:29:06 +00:00
drh e5672e209e Better detection of database corruption in the clearCellOverflow() routine.
FossilOrigin-Name: b6c072240dfe4f5d075b1b505c98281f830579f48ff939cdb6e054bfb179efa3
2026-10-25 18:43:18 +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
drh 862625c9ae Use a 64-bit integer to measure expression chain size in
dupedExprSize(), in case of crazy expressions.

FossilOrigin-Name: ed78f5d2bf2042332637edf541c1295f5f5ca7b1cbb4f647492d3f2221afc781
2026-10-25 17:45:41 +00:00
drh 42c9401de2 Use a new typedef "tSerial" to determine the datatype for serial-type
value.  It is 32 bits for reasonable SQLITE_MAX_LENGTH but can be
64 bits if necessary.

FossilOrigin-Name: 8435c6f0b1ac3025f5af5da2a0f03898142c506e5981d55a2b633e611dcecb8f
2026-10-25 17:38:36 +00:00