]> git.ipfire.org Git - thirdparty/sqlite.git/log
thirdparty/sqlite.git
5 hours agoLimit VIEW recursion depth to SQLITE_LIMIT_EXPR_DEPTH to prevent master
drh [Tue, 16 Jun 2026 13:43:08 +0000 (13:43 +0000)] 
Limit VIEW recursion depth to SQLITE_LIMIT_EXPR_DEPTH to prevent
static overflow in malicious schemas with tens of thousands of
levels of recursive views.
[bugs:/info/2026-06-16T04:21:51Z|Bug 2026-06-16T04:21:51Z]

FossilOrigin-Name: 3f3fb9b638f59ad982beafb7c117f24ddd3da612e62c862510805fa672ffae06

6 hours agoFix instances of potential buffer overflow caused by loading the contents of a stat4...
dan [Tue, 16 Jun 2026 11:53:19 +0000 (11:53 +0000)] 
Fix instances of potential buffer overflow caused by loading the contents of a stat4 table with an absurd number of samples in a 32-bit build. Bug [bugs:/info/2026-06-16T11:30:52Z | 2026-06-16T11:30:52Z].

FossilOrigin-Name: 0b72246732fecd7909add28f2d95f1727e1c4dc6c8f3b8e6e3482f6d17c92d34

8 hours agoFix a possible call to memcpy() with a NULL source pointer when the size
drh [Tue, 16 Jun 2026 09:53:23 +0000 (09:53 +0000)] 
Fix a possible call to memcpy() with a NULL source pointer when the size
parameter is zero (which is technically undefined behavior but in practice
is completely harmless) in the sha1_query() extension function.
[bugs:/info/2026-06-16T07:42:23Z|Bug 2026-06-16T07:42:23Z].

FossilOrigin-Name: 2063926473adaf9619ca10fd47b273ef59b1f77136836d575e5db3cfd68987da

25 hours agoConsistent error messages for excess trigger nesting.
drh [Mon, 15 Jun 2026 17:39:46 +0000 (17:39 +0000)] 
Consistent error messages for excess trigger nesting.

FossilOrigin-Name: 4fb9f2ffb4b45d81c70f561f45cf29a0d5872a612b948882c4a2a14629bcbe28

25 hours agoSpeed up SQL aggregate functions percentile() and median() by using quickselect to...
dan [Mon, 15 Jun 2026 17:27:05 +0000 (17:27 +0000)] 
Speed up SQL aggregate functions percentile() and median() by using quickselect to find the required values instead of fully sorting the array of values with quicksort.

FossilOrigin-Name: 0796d337f6a0ef02a460a24eadda20e33e8fb9ec64b696ae1addee69c1bfddeb

25 hours agoNew Windows makefile targets for common EXEs that omit the ".exe" suffix, so
drh [Mon, 15 Jun 2026 17:14:12 +0000 (17:14 +0000)] 
New Windows makefile targets for common EXEs that omit the ".exe" suffix, so
that when muscle memory kicks in and we type "make sqlite3" on windows, it
still works.

FossilOrigin-Name: 1152463a66b47eed27b71e87533e8361b6077dc54ff55b8cd2ccde5cfa8199bd

25 hours agoImprove comments in percentSort(). pecentile-partial-sort
dan [Mon, 15 Jun 2026 17:13:40 +0000 (17:13 +0000)] 
Improve comments in percentSort().

FossilOrigin-Name: 9b43500f51ae7b43f0e2cc805bb8c93907eddbd8caf21ee5b5a3d2e795962088

26 hours agoEnhance SQLITE_LIMIT_TRIGGER_DEPTH so that it also limits a chain of
drh [Mon, 15 Jun 2026 16:45:35 +0000 (16:45 +0000)] 
Enhance SQLITE_LIMIT_TRIGGER_DEPTH so that it also limits a chain of
distinct triggers during code generation.
[bugs:/info/2026-06-15T06:44:07Z|Bug 2026-06-15T06:44:07Z].

FossilOrigin-Name: 0b5378678e3d095ef982bb3b5d5ad05dfb15ce4ee12170b8d0a83fa4b75404c0

27 hours agoChange the PACKAGE_BUGREPORT config option point to /bugs instead of /forum.
stephan [Mon, 15 Jun 2026 15:48:40 +0000 (15:48 +0000)] 
Change the PACKAGE_BUGREPORT config option point to /bugs instead of /forum.

FossilOrigin-Name: ca15fedede9873b5f72f29f7cd33cba294cd49593999fc952670e2d5ce7ec86e

27 hours agoFix a problem sometimes causing an UPSERT to incorrectly convert an excluded.* column...
dan [Mon, 15 Jun 2026 15:38:16 +0000 (15:38 +0000)] 
Fix a problem sometimes causing an UPSERT to incorrectly convert an excluded.* column from type REAL to INT in cases where doing so does not cause data loss. Bug [bugs:/info/2026-06-15T09:08:12Z | 2026-06-15T09:08:12Z].

FossilOrigin-Name: 71334f7ec95edc91138b51ef6fe455a4a8c1db130484237eb241956bc549aa5c

27 hours agoImprovements to handling of inequality constraints on generate_series().value
drh [Mon, 15 Jun 2026 15:27:26 +0000 (15:27 +0000)] 
Improvements to handling of inequality constraints on generate_series().value
against very large floating-point values.
[bugs:/info/2026-06-15T04:37:48Z|Bug 2026-06-15T04:37:48Z].

FossilOrigin-Name: 5aab8c2cde63f9db6b2346c86512efd6297937cad4e1306759b0f448815ad2e0

27 hours agoAdditional tweaks and test cases for generate_series() constraints series-boundry-cases
drh [Mon, 15 Jun 2026 15:24:37 +0000 (15:24 +0000)] 
Additional tweaks and test cases for generate_series() constraints
using very large floating-point numbers.

FossilOrigin-Name: 50d611404a444f23368c684dfa6dc34b057f8adb45aa058bcf3b2768e908eb3e

28 hours agoBetter behavior for generate_series() in cases where constraints involve
drh [Mon, 15 Jun 2026 14:16:13 +0000 (14:16 +0000)] 
Better behavior for generate_series() in cases where constraints involve
floating point number that are near the minimum and maximum 64-bit integer
values.

FossilOrigin-Name: 236ef21789c4ebb67a8cf0a841341fab1477a6fe8e88b575e9f450a8f868e618

29 hours agoAvoid a possible buffer overrun in 32-bit builds of fts5 that could occur when proces...
dan [Mon, 15 Jun 2026 13:39:20 +0000 (13:39 +0000)] 
Avoid a possible buffer overrun in 32-bit builds of fts5 that could occur when processing corrupt records. Bug [bugs:/info/2026-06-14T12:21:15Z | 2026-06-14T12:21:15Z].

FossilOrigin-Name: 0fa3345fe4464804f6846c2598774b9e700df39570e81e020de21e06e2ff044d

30 hours agoRevert the native impl of kvvfs's xOpen() (as distinct from the JS impl which the...
stephan [Mon, 15 Jun 2026 12:36:24 +0000 (12:36 +0000)] 
Revert the native impl of kvvfs's xOpen() (as distinct from the JS impl which the wasm build uses) to the historical db name restrictions of 'local' or 'session', failing with SQLITE_CANTOPEN if passed another name. [ec866b04d088e53b] overhauled support for kvvfs db names in JS but it turns out that the native impl still relies on those names in order to match journals to databases. Correct a related too-lenient assert() in the WASM pieces.

FossilOrigin-Name: 4b3ec30c63e3824163a2e6cacceb9630301b61f3ffd2b80f8a7b234f09bc251b

31 hours agoFix a problem that could cause fts5 to return incorrect answers when performing prefi...
dan [Mon, 15 Jun 2026 11:47:52 +0000 (11:47 +0000)] 
Fix a problem that could cause fts5 to return incorrect answers when performing prefix queries on tokens with synonyms. Bug [bugs:/info/2026-06-14T11:11:06Z | 2026-06-14T11:11:06Z].

FossilOrigin-Name: 323d87541a63f0b2c64271c78ad6ebd5d04220da59aebfdfbc07caa691af816a

31 hours agoRegardless of whether the platform is 32 or 64-bits, Use 64-bit arithmetic to calcula...
dan [Mon, 15 Jun 2026 11:03:13 +0000 (11:03 +0000)] 
Regardless of whether the platform is 32 or 64-bits, Use 64-bit arithmetic to calculate buffer sizes in the fts3_snippet(). Bug [bugs:/info/2026-06-14T09:19:52Z | 2026-06-14T09:19:52Z].

FossilOrigin-Name: 79dc1949b2171c46f6649743ed7dbbf6b83046901ec18ffcbc37a2a47544b100

32 hours agoFix rounding behavior in the decimal extension when all leading digits
drh [Mon, 15 Jun 2026 10:13:31 +0000 (10:13 +0000)] 
Fix rounding behavior in the decimal extension when all leading digits
are 9 and there is not fractional component.
[bugs:/info/2026-06-15T03:49:42Z|Bug 2026-06-15T03:49:42Z].

FossilOrigin-Name: c6a3b18ee9eb4b8dda57fab94aea9c61aed5e1ffe600f0bcf2c90ca752f2512b

41 hours agoPrevent array overflow when decoding a corrupted value from the
drh [Mon, 15 Jun 2026 01:24:06 +0000 (01:24 +0000)] 
Prevent array overflow when decoding a corrupted value from the
underlying key/value store.
[bugs:/info/2026-06-14T21:58:12Z|Bug 2026-06-14T21:58:12Z]

FossilOrigin-Name: 732c8f81b5a914831c36610ddaed3da15a7f9fdbf54f44872e181b941368d702

44 hours agoRemove the unused, untested, experiemental "blobio.c" extension, to
drh [Sun, 14 Jun 2026 22:01:56 +0000 (22:01 +0000)] 
Remove the unused, untested, experiemental "blobio.c" extension, to
avoid confusing AIs.
[bugs:/info/2026-06-14T15:12:50Z|Bug 2026-06-14T15:12:50Z]

FossilOrigin-Name: 45918d5e97a0c29c6fa03d09ac8e131dcca3bf4268bf4f5c46c221b1f900651a

46 hours agoDo not allow ridiculous "columns=N" values in the (unused) csv virtual
drh [Sun, 14 Jun 2026 20:10:28 +0000 (20:10 +0000)] 
Do not allow ridiculous "columns=N" values in the (unused) csv virtual
table in the extensions folder.
[bugs:/info/2026-06-14T15:22:47Z|Bug 2026-06-14T15:22:47Z]

FossilOrigin-Name: ecae4a2ddf103fe575c6864d201e83a9bb084b511685397db41b3349c91b38e6

2 days agoSpeed up SQL aggregate functions percentile() and median() by avoiding a full sort...
dan [Sat, 13 Jun 2026 20:16:54 +0000 (20:16 +0000)] 
Speed up SQL aggregate functions percentile() and median() by avoiding a full sort of the array of arguments.

FossilOrigin-Name: 9232b5f21d76dc702ccda5c689d61bcd0057fb1f2a4db6a70c607c25ad03a027

3 days agoMake the --header option to the CLI sticky, so that it does not get
drh [Sat, 13 Jun 2026 18:04:18 +0000 (18:04 +0000)] 
Make the --header option to the CLI sticky, so that it does not get
turned off by subsequence --csv or similar mode change options.
[bugs:/info/2026-06-13T11:49:18Z|Bug 2026-06-13T11:49:18Z]

FossilOrigin-Name: b19cef1862444ee694eeea2254aa9a8d74d2343da5a8257c22e3068f388aa2fd

4 days agoWhen reading a super-journal name from a journal file, allocate a new buffer rather...
dan [Fri, 12 Jun 2026 18:35:24 +0000 (18:35 +0000)] 
When reading a super-journal name from a journal file, allocate a new buffer rather than using Pager.pTmpSpace. This prevents a buffer overrun that could occur when using a VFS with a large sqlite3_vfs.mxPathname value with a database with a small page size.

FossilOrigin-Name: 7f71859841af7cb0806f58e9c8013a990fcca72b807a0513156d7127ce5c7b62

4 days agoFix errors in comments on this branch. Also prefer SQLITE_NOMEM_BKPT to SQLITE_NOMEM. super-journal-malloc
dan [Fri, 12 Jun 2026 17:32:44 +0000 (17:32 +0000)] 
Fix errors in comments on this branch. Also prefer SQLITE_NOMEM_BKPT to SQLITE_NOMEM.

FossilOrigin-Name: ac17669e840dbac5c7c75e9b6014cca2d289aba8de36f9d1d0d61186e8cc6207

4 days agoFix a memory leak that could follow an OOM error in the new code on this branch.
dan [Fri, 12 Jun 2026 17:16:12 +0000 (17:16 +0000)] 
Fix a memory leak that could follow an OOM error in the new code on this branch.

FossilOrigin-Name: d4774a898730d9ef7564bba0a8531748e31e6517ab29564c2f5a0196c1584451

4 days agoImproved documentation for sqlite3_deserialize().
drh [Fri, 12 Jun 2026 16:47:45 +0000 (16:47 +0000)] 
Improved documentation for sqlite3_deserialize().

FossilOrigin-Name: f15d076820f4a0d9e7fa32d99575bce27bde5e987bb415e6cfb69b06f0da7e1e

4 days agoDo not use shared locks on SHM files when the filename is a long DOS-device
drh [Fri, 12 Jun 2026 16:26:39 +0000 (16:26 +0000)] 
Do not use shared locks on SHM files when the filename is a long DOS-device
path.  Only used shared locks for UNC paths.  Do not confuse the
long-DOS-device syntax with UNC paths.

FossilOrigin-Name: a4691489f21bb1645bb8de649268dd457af53c5f613f2a7fd2e5569f029efa87

4 days agoFix a buffer overwrite in fts3 that could occur while processing NEAR queries against...
dan [Fri, 12 Jun 2026 15:36:26 +0000 (15:36 +0000)] 
Fix a buffer overwrite in fts3 that could occur while processing NEAR queries against corrupt records. Bug [bugs:/info/2026-06-11T23:11:26Z | 2026-06-11T23:11:26Z].

FossilOrigin-Name: b0f773e99eb45cde0953e4870a0a7436c35277c95146fdab3aa06ebbc076c79e

4 days agoWhen using a read-only WAL/SHM, handle a corrupt page size in the WAL
drh [Fri, 12 Jun 2026 12:15:42 +0000 (12:15 +0000)] 
When using a read-only WAL/SHM, handle a corrupt page size in the WAL
file correctly.
[bugs:/info/2026-06-11T22:20:03Z|Bug 2026-06-11T22:20:03Z].

FossilOrigin-Name: 09ab0a1bac4eb7de651f78cfd3027b452308da7e04c4ccd7f46c402c82fd6ca5

4 days agoAdd the --raw option to the dbtotxt command-line tool, for debugging.
drh [Fri, 12 Jun 2026 11:55:39 +0000 (11:55 +0000)] 
Add the --raw option to the dbtotxt command-line tool, for debugging.

FossilOrigin-Name: abfecc08209c9377b6762125b2372e4eb1ab56b4d0399467c8fbe5cfc11c806e

4 days agoFix a signed integer overflow that could occur in fts3 when processing corrupt databa...
dan [Fri, 12 Jun 2026 11:24:30 +0000 (11:24 +0000)] 
Fix a signed integer overflow that could occur in fts3 when processing corrupt database records. Bug [bugs:/info/2026-06-11T23:12:25Z | 2026-06-11T23:12:25Z].

FossilOrigin-Name: 978d04f051c06aff798f915b0774da19a0b4f89f9daee124f7e62b12afaaced8

4 days agoComment improvements on the ".ar -x" command of the CLI. No changes to code.
drh [Thu, 11 Jun 2026 23:11:14 +0000 (23:11 +0000)] 
Comment improvements on the ".ar -x" command of the CLI.  No changes to code.

FossilOrigin-Name: 5b939fb1a284088c4bd46adf517cf598816e2262cd77ee2d9caaab1cef2ce9a1

4 days agoFix harmless compiler warnings.
drh [Thu, 11 Jun 2026 22:48:16 +0000 (22:48 +0000)] 
Fix harmless compiler warnings.

FossilOrigin-Name: dd0c161fcd1619518cd4671d64afb6afeec44c140ec176ccb8616d381a88f42f

5 days agoFurther improvements to the ".ar" command of the CLI.
drh [Thu, 11 Jun 2026 16:39:41 +0000 (16:39 +0000)] 
Further improvements to the ".ar" command of the CLI.

FossilOrigin-Name: 6149b938c7a1e95a0fb8600a81557dd0e3efb7b312f3806e2c09d03acf9f4b17

5 days agoThree-pass algorithm for the ".ar x" command in the CLI, so that symlinks
drh [Thu, 11 Jun 2026 14:28:48 +0000 (14:28 +0000)] 
Three-pass algorithm for the ".ar x" command in the CLI, so that symlinks
are created after all regular files are created.

FossilOrigin-Name: 37a80d20fe1948db15ac72432ed7bf3d573c80807fe0a58c58440647e3c34ab8

5 days agoAdd the (undocumented) --debug option to the ".ar" command in the CLI
drh [Thu, 11 Jun 2026 14:14:37 +0000 (14:14 +0000)] 
Add the (undocumented) --debug option to the ".ar" command in the CLI

FossilOrigin-Name: 3a040ffc47fa3e38b36716587c56d9b071d9c69d9daaa9cf0ef6baa654419ab5

5 days agoImproved detection of corrupt node IDs in RTree shadow tables.
drh [Thu, 11 Jun 2026 01:31:19 +0000 (01:31 +0000)] 
Improved detection of corrupt node IDs in RTree shadow tables.
Test case in TH3.

FossilOrigin-Name: e01a185a699d0c4ad2341ce2114bc826f02768735cef67179a1127229a073d03

5 days agoWhen reading a super-journal name from a journal file, allocate a new buffer rather...
dan [Wed, 10 Jun 2026 20:10:19 +0000 (20:10 +0000)] 
When reading a super-journal name from a journal file, allocate a new buffer rather than using Pager.pTmpSpace. This prevents a buffer overrun that could occur when using a VFS with a large sqlite3_vfs.mxPathname value with a database with a small page size.

FossilOrigin-Name: 37aa82a50a0a1c5edb4c4f2de1cb00fa009ebbfeb420df3de72231c5d883518a

6 days agoFix a signed-integer overflow in fts5 that might occur when dealing with strategicly...
dan [Wed, 10 Jun 2026 16:51:20 +0000 (16:51 +0000)] 
Fix a signed-integer overflow in fts5 that might occur when dealing with strategicly corrupted records. Bug [bugs:/info/2026-06-10T03:56:42Z | 2026-06-10T03:56:42Z].

FossilOrigin-Name: fc6442ee54795fbeb746539193716238aa653d80170523bc327ae3ce0d945ebf

6 days agoDetect an OOM condition in the realpath() function of the fileio.c extension
drh [Wed, 10 Jun 2026 10:40:29 +0000 (10:40 +0000)] 
Detect an OOM condition in the realpath() function of the fileio.c extension
and cause that function to return NULL.  To Do:  we should go back in and
fix realpath() to raise an SQLITE_NOMEM error on OOM rather than returning
NULL.  But we will delay that, in as much as OOMs are all but impossible
on modern OSes.
[bug:/info/2026-06-10T07:46:32Z|Bug 2026-06-10T07:46:32Z].

FossilOrigin-Name: 8b961dc3d27c5aa62a5dc7c2e44f8b505817e184f8499f3bb903e06b5aec1b72

6 days agoFix a possible signed integer overflow in the RBU extension given a
drh [Wed, 10 Jun 2026 10:13:11 +0000 (10:13 +0000)] 
Fix a possible signed integer overflow in the RBU extension given a
maliciously crafted delta.
[bugs:/info/2026-06-10T06:41:54Z|Bug 2026-06-10T06:41:54Z].

FossilOrigin-Name: 8531c0c3b61771592b055b0c22e903b8301a4161c7bcb7f9fc54d730b080d095

6 days agoHarden code that processes Fossil Deltas against OOM and maliciously
drh [Wed, 10 Jun 2026 09:51:33 +0000 (09:51 +0000)] 
Harden code that processes Fossil Deltas against OOM and maliciously
malformed delta blobs.
[bugs:/info/2026-06-10T07:01:00Z|Bug 2026-06-10T07:01:00Z] and
[bugs:/info/2026-06-10T07:06:43Z|Bug 2026-06-10T07:06:43Z].

FossilOrigin-Name: 67271c31292bc1bddbb5e144c881c85c9f91b3963a1db4bae1f738adab50f7c0

7 days agoAvoid a possible integer overflow when fts5 tokenizes a very large document. Only...
dan [Tue, 9 Jun 2026 10:43:37 +0000 (10:43 +0000)] 
Avoid a possible integer overflow when fts5 tokenizes a very large document. Only possible with non-standard builds that use large values of SQLITE_MAX_LENGTH. Bug [bugs:/info/2026-06-09T05:27:16Z | 2026-06-09T05:27:16Z].

FossilOrigin-Name: d562e91374e2bebcf75a00776b4def532bb71914a07e37c8507f7a5918db1d3b

7 days agoChange loop counter variables from int to i64 to avoid a potential
drh [Tue, 9 Jun 2026 10:16:40 +0000 (10:16 +0000)] 
Change loop counter variables from int to i64 to avoid a potential
integer overflow inside an assert() statement when SQLite is compiled
with SQLITE_DEBUG and an extra-large SQLITE_MAX_LENGTH.  Does not
affect production builds.
[bugs:/info/2026-06-09T08:53:14Z|Bug 2026-06-09T08:53:14Z].

FossilOrigin-Name: 77f615d9833b1f5eaabcb1a6b59af3a6698752abcd16592091f1630beec5969e

8 days agoFix builds on i486 CPUs. [forum:/info/2025-01-25T12:58:44Z|Forum 2025-01-25T12:58...
drh [Mon, 8 Jun 2026 18:15:27 +0000 (18:15 +0000)] 
Fix builds on i486 CPUs.  [forum:/info/2025-01-25T12:58:44Z|Forum 2025-01-25T12:58:44Z].

FossilOrigin-Name: 4cb349370daab17123770c814c71872a3e4c616a3f984569b3d7f97f9c3f5ea0

8 days agoFix another buffer overread in fts5 when processing corrupt records. Bug [bugs:/info...
dan [Mon, 8 Jun 2026 17:48:00 +0000 (17:48 +0000)] 
Fix another buffer overread in fts5 when processing corrupt records. Bug [bugs:/info/2026-06-08T16:03:39Z | 2026-06-08T16:03:39Z ].

FossilOrigin-Name: 8ba5acabf9a0273ffbc2ba0bacc7f0b000690db91081858e4e563d6cbeeb4e7a

8 days agoFix a buffer overread that could occur in fts5 when processing corrupt records. Bug...
dan [Mon, 8 Jun 2026 15:20:49 +0000 (15:20 +0000)] 
Fix a buffer overread that could occur in fts5 when processing corrupt records. Bug [bugs:/info/2026-06-08T11:15:52Z | 2026-06-08T11:15:52Z]

FossilOrigin-Name: b07441cfc06b8e6b47a4f4a6e0f5c261da580d5afe82444cc7f42a9f39ea7026

8 days agoAvoid a potential use-after-free in fts5. Report [bugs:/info/2026-06-08T08:45:27Z...
dan [Mon, 8 Jun 2026 12:03:52 +0000 (12:03 +0000)] 
Avoid a potential use-after-free in fts5. Report [bugs:/info/2026-06-08T08:45:27Z | 2026-06-08T08:45:27Z].

FossilOrigin-Name: 9c018b02dbfb071c748d540ad679a4dbdc0fb88a62988e02cb51a3403509febe

8 days agoClamp the nToken parameter to the fts5 snippet() function between 0 and 64. It has...
dan [Mon, 8 Jun 2026 11:24:05 +0000 (11:24 +0000)] 
Clamp the nToken parameter to the fts5 snippet() function between 0 and 64. It has always been documented this way, but not previously implemented. Report [bugs:/info/2026-06-08T08:29:00Z | 2026-06-08T08:29:00Z].

FossilOrigin-Name: 4af1d9b3e54a7c42552e61284456bbd7089e525d4aa55e580f7518956d8521bb

8 days agoAdd extra tests to check that non-deterministic functions may not be used in indexes.
dan [Mon, 8 Jun 2026 10:47:55 +0000 (10:47 +0000)] 
Add extra tests to check that non-deterministic functions may not be used in indexes.

FossilOrigin-Name: beeef9dc2b1d778ca628c5e3adc097778646933233ea5ea4f03d2cace0199c17

10 days agoImprovements to the GCC compiler bug work-around of check-in [7fae321095ebec77].
drh [Sat, 6 Jun 2026 18:32:53 +0000 (18:32 +0000)] 
Improvements to the GCC compiler bug work-around of check-in [7fae321095ebec77].

FossilOrigin-Name: 247894f70d8616cb16468025809513a7db70086d24d2a289b50b4e8d9e073eb4

10 days agoMinor performance enhancement and improved comments on the quicksort
drh [Sat, 6 Jun 2026 17:20:35 +0000 (17:20 +0000)] 
Minor performance enhancement and improved comments on the quicksort
algorithm used by the median() implementation in func.c.

FossilOrigin-Name: 2800f6a75bbb6ddc86f2e029a7d36ff08febe03812302fb7931eb68da316f74d

11 days agoA new approach to working around the GCC bug. gcc-bug-114659
drh [Fri, 5 Jun 2026 00:11:56 +0000 (00:11 +0000)] 
A new approach to working around the GCC bug.

FossilOrigin-Name: 2f95186ea568b27d45bd19fca1e03b878afb0b1ea0938875897c7323bdeab8a2

12 days agoDisable the vector-IN-SELECT optimization if the number of columns is so
drh [Thu, 4 Jun 2026 16:56:11 +0000 (16:56 +0000)] 
Disable the vector-IN-SELECT optimization if the number of columns is so
large that it would cause the WhereTerm.nChild column to wrap.
[bugs:/info/2026-06-04T10:00:49Z|Bug 2026-06-04T10:00:49Z].

FossilOrigin-Name: bb49dfc948048779a30deff9a3d1bb39846f6f72c26a2bdcdd0e386251720fe6

12 days agoFix a crash that could be caused by configuring the pager-cache with a bulk allocatio...
dan [Thu, 4 Jun 2026 11:48:18 +0000 (11:48 +0000)] 
Fix a crash that could be caused by configuring the pager-cache with a bulk allocation too small to fit even one page. Bug [bugs:/info/2026-06-04T07:03:12Z | 2026-06-04T07:03:12Z].

FossilOrigin-Name: b4b9dc632b06f932759bc2fceeb6fa1dd6e0de329106ae1d34be874ea1695859

12 days agoFix a possible NULL pointer derefence in the (experimental and untested)
drh [Thu, 4 Jun 2026 11:42:23 +0000 (11:42 +0000)] 
Fix a possible NULL pointer derefence in the (experimental and untested)
uuid.c extension.
[bugs:/info/2026-06-04T09:50:59Z|Bug 2026-06-04T09:50:59Z].

FossilOrigin-Name: fa6374fe3ae1530f0b5ba10b7e6fb703ffe5dd592c532a965e7d50b7d2d70a5f

12 days agoExtra testcase() macros to ensure adequate testing of the previous
drh [Thu, 4 Jun 2026 11:39:13 +0000 (11:39 +0000)] 
Extra testcase() macros to ensure adequate testing of the previous
check-in.

FossilOrigin-Name: 003013ccabaaa7aea1e78844474ed5032ee9c9824f98c5d36687ac5256a5e128

12 days agoFix problems with expressions like "(?,?,?) IN (SELECT c,b,a FROM ...)" when there...
dan [Thu, 4 Jun 2026 11:19:43 +0000 (11:19 +0000)] 
Fix problems with expressions like "(?,?,?) IN (SELECT c,b,a FROM ...)" when there is an index on columns "c", "b" and "a", but not in that order. Bug [bugs:/info/2026-06-04T07:02:53Z | 2026-06-04T07:02:53Z].

FossilOrigin-Name: 07667afd0f17b73b58df8ace6a2a5c3a593276f9b7804cb14d4705051258dd75

12 days agoClearly mark the ext/misc/wholenumber.c extension as "testing and
drh [Thu, 4 Jun 2026 11:18:11 +0000 (11:18 +0000)] 
Clearly mark the ext/misc/wholenumber.c extension as "testing and
debugging use only".  Fix a potential integer overflow that can occur
if the above warning is ignored.
[bugs:/info/2026-06-04T09:40:28Z|Bug 2026-06-04T09:40:28Z].

FossilOrigin-Name: 44154ea9ae99d532d5c7268d70bd8b32751f7a82c367c7bd1ec0e6948d71d1b8

13 days agoUpdate the utf-8 decoder in the ICU extension to treat invalid sequences as codepoint...
dan [Wed, 3 Jun 2026 17:21:12 +0000 (17:21 +0000)] 
Update the utf-8 decoder in the ICU extension to treat invalid sequences as codepoint 0xFFFD, matching the core. Report [bugs:/info/2026-06-03T04:04:46Z | 2026-06-03T04:04:46Z].

FossilOrigin-Name: 840be0ee62c0ba34f4916c382e2d07071bebd8ce7bca31deb1616869722bfa4d

13 days agoFix a faulty assert() in rtree that could fire when processing an unusually large...
dan [Wed, 3 Jun 2026 16:46:15 +0000 (16:46 +0000)] 
Fix a faulty assert() in rtree that could fire when processing an unusually large record. Bug [bugs:/info/2026-06-03T14:44:46Z | 2026-06-03T14:44:46Z].

FossilOrigin-Name: e7335dd377a73fc2b913076ee659ed2b0c4a131b16e04b1b55fae677d6b56e8a

13 days agoUse tail recursion on the larger of the two partitions when doing a
drh [Wed, 3 Jun 2026 16:21:17 +0000 (16:21 +0000)] 
Use tail recursion on the larger of the two partitions when doing a
quicksort as part of the implementation of the median() function,
to avoid excess stack usage on pathological inputs.
[bugs:/info/2026-06-03T07:26:42Z|Bug 2026-06-03T07:26:42Z].

FossilOrigin-Name: 7dc987165c030c260ba90a8878291b5ceb037c48c2f437a8fb3f05b6c4f84fde

13 days agoFix an integer overflow problem in fts3 that could lead to a buffer overwrite on...
dan [Wed, 3 Jun 2026 15:29:59 +0000 (15:29 +0000)] 
Fix an integer overflow problem in fts3 that could lead to a buffer overwrite on platforms where size_t is 32-bits. Bug [bugs:/info/2026-06-03T04:28:51Z | 2026-06-03T04:28:51Z].

FossilOrigin-Name: ef0c66d2a2e0b8f523633efca66a97236bb5a502525eb6a00a28a350ec7c76e6

13 days agoFix another buffer overread in fts5 that could occur when processing corrupt records...
dan [Wed, 3 Jun 2026 14:58:13 +0000 (14:58 +0000)] 
Fix another buffer overread in fts5 that could occur when processing corrupt records. Bug [bugs:/info/2026-06-03T03:54:40Z | 2026-06-03T03:54:40Z].

FossilOrigin-Name: b5337c87cc314e6830615e4efe2d4723fa7cedf87ce404f60d6e520aeab77cbc

13 days agoFix another potential buffer overrun that could occur in fts5 when processing corrupt...
dan [Wed, 3 Jun 2026 13:49:33 +0000 (13:49 +0000)] 
Fix another potential buffer overrun that could occur in fts5 when processing corrupt records.

FossilOrigin-Name: 6ee44b199512b8cac604bf062f893a9047af4b5bfc881bb7cb69ae42d0a0adb4

13 days agoFix a potential UAF bug in the zipfile extension.
drh [Wed, 3 Jun 2026 13:12:20 +0000 (13:12 +0000)] 
Fix a potential UAF bug in the zipfile extension.
[bugs:/info/2026-06-03T10:58:51Z|Bug 2026-06-03T10:58:51Z].

FossilOrigin-Name: 1fb5e9169ace6bea2bdf9013f39002c1ce5dc9ce51d6007bec22d91f456c15f0

13 days agoFix negative array index in "testing and debugging uses only" extension
drh [Wed, 3 Jun 2026 12:43:50 +0000 (12:43 +0000)] 
Fix negative array index in "testing and debugging uses only" extension
qpvtab.c.
[bugs:/info/2026-06-03T07:26:26Z|Bug 2026-06-03T07:26:26Z].

FossilOrigin-Name: d066699fcacd87496645f3aa3c4049935410ae2451879a033102304c80273deb

13 days agoAvoid excessive recursion and stack overflow in fts3 when processing a corrupt
dan [Wed, 3 Jun 2026 11:37:45 +0000 (11:37 +0000)] 
Avoid excessive recursion and stack overflow in fts3 when processing a corrupt
database.

FossilOrigin-Name: 21369378769195f20f839231f625582552eaa3f79044ca3e3efb7f9476b515a8

13 days agoThe prefix_length() function should stop at the first NUL terminator.
drh [Wed, 3 Jun 2026 11:07:47 +0000 (11:07 +0000)] 
The prefix_length() function should stop at the first NUL terminator.
[bugs:/info/2026-06-03T07:42:00Z|Bug 2026-06-03T07:42:00Z].

FossilOrigin-Name: a9b8bdea0683bb03015ea1ee38f75636c80c189eed4b786b6d3d654a831cfdfb

13 days agoMake the (unused, untested, and unsupported) ext/misc/compress.c routines
drh [Wed, 3 Jun 2026 10:55:08 +0000 (10:55 +0000)] 
Make the (unused, untested, and unsupported) ext/misc/compress.c routines
responsive to OOM conditions.
[bugs:/info/2026-06-03T08:28:36Z|Bug 2026-06-03T08:28:36Z].

FossilOrigin-Name: e3120e2a4339d51210645b14d075abba27dd97bd6bd6d42f445dd5baf3d337e3

2 weeks agoFix a case where sqlite3expert could be tricked into executing arbitrary SQL by a...
dan [Tue, 2 Jun 2026 15:20:37 +0000 (15:20 +0000)] 
Fix a case where sqlite3expert could be tricked into executing arbitrary SQL by a corrupt database schema.

FossilOrigin-Name: 8a633070e62bdc83a7cf895fd1a22c04b13579659df7cee9584d95096bfffab1

2 weeks agoAdd extra test case to zipfile.test. No code changes.
dan [Tue, 2 Jun 2026 11:11:02 +0000 (11:11 +0000)] 
Add extra test case to zipfile.test. No code changes.

FossilOrigin-Name: 83fe72bcdf866bdaf3043ae5b0c1eb45a9d50a01b24b7a531858271dd746baab

2 weeks agoFix the CLI so that it works when compiled using STDCALL on
drh [Tue, 2 Jun 2026 10:08:30 +0000 (10:08 +0000)] 
Fix the CLI so that it works when compiled using STDCALL on
Microsoft x86.  Change should not affect other platforms.
[forum:/info/2026-06-02T09:44:12Z|Forum 2026-06-02T09:44:12Z].

FossilOrigin-Name: 83adece349aed73b8d0a3aec141213ea329150eb529f4fd9774ca157b49d02fc

2 weeks agoEnhance PRAGMA integrity_check so that it better detects incorrect
drh [Mon, 1 Jun 2026 20:02:17 +0000 (20:02 +0000)] 
Enhance PRAGMA integrity_check so that it better detects incorrect
header sizes at the beginning of cells.

FossilOrigin-Name: 08bb2878e7575ab069f8f132537880a47a4d4543a1ac8bffc55e32488223245c

2 weeks agoDisable transitive WHERE constraints when there are explicit COLLATE operators. Fix...
dan [Mon, 1 Jun 2026 18:01:13 +0000 (18:01 +0000)] 
Disable transitive WHERE constraints when there are explicit COLLATE operators. Fix for report [bugs:/info/ffddcd3617 | 2026-05-31T08:33:10Z].

FossilOrigin-Name: 18ee3a17c589cfd34500b6a6547d0cb51aea4dd14b4e1e4b2d0cf0dbfb32378e

2 weeks agoMinor performance improvement for the patch on this branch. transitive-where-collate-bugs
dan [Mon, 1 Jun 2026 17:56:11 +0000 (17:56 +0000)] 
Minor performance improvement for the patch on this branch.

FossilOrigin-Name: 2702fecc5c47704bdae535459e59260b55c571ff3b7d09617541e36829d4cf9c

2 weeks agoFix minor problems surrounding transitive WHERE constraints and explicit COLLATE...
dan [Mon, 1 Jun 2026 17:40:23 +0000 (17:40 +0000)] 
Fix minor problems surrounding transitive WHERE constraints and explicit COLLATE terms.

FossilOrigin-Name: 9500238a1d603a3f08a8fc0954725d5d217aab339720146ea0bc700e47b81c3c

2 weeks agoMake sure the authenticator is called for columns that are part of
drh [Mon, 1 Jun 2026 16:49:39 +0000 (16:49 +0000)] 
Make sure the authenticator is called for columns that are part of
a USING in a FULL JOIN.
[bugs:/info/2026-05-31T02:00:37Z|Bug 2026-05-31T02:00:37Z].

FossilOrigin-Name: 4ef88a36f9d9669b0d74c58f79ad497803885ff6078e5f9685f13c96eab397cc

2 weeks agoFor expressions of the form "(x, y...) IN (SELECT a, b ...)" where the result is...
dan [Mon, 1 Jun 2026 16:20:40 +0000 (16:20 +0000)] 
For expressions of the form "(x, y...) IN (SELECT a, b ...)" where the result is not true, consider the collation sequences of columns "a" and "b" when determinining if the result should be false or NULL. Bug report [bugs:/info/0785f45e67 | 2026-05-31T02:10:44Z].

FossilOrigin-Name: 04d7a9d788cf0bb811483baceb9142f67d4a2380d4af409d5300a92f7972472e

2 weeks agoBetter handle a (possibly) potential buffer overrun in fts5. Based on the report...
dan [Mon, 1 Jun 2026 15:03:53 +0000 (15:03 +0000)] 
Better handle a (possibly) potential buffer overrun in fts5. Based on the report in [bugs:/info/38e75aa4f9 | 2026-05-31T09:06:13Z].

FossilOrigin-Name: 9d0e39408075f22dd56ad5fb50ef458c0cd6a4ec234dd43b3a5f5e0ac4447b61

2 weeks agoRemove the data type ANY added to the shell's CSV exports in [aff74e71ea734e1a],...
stephan [Mon, 1 Jun 2026 13:14:48 +0000 (13:14 +0000)] 
Remove the data type ANY added to the shell's CSV exports in [aff74e71ea734e1a], as discussed in [forum:2ea4c50f69fc9829|forum post 2026-06-01T12:01:59Z].

FossilOrigin-Name: a6a347aec5ff33b24d877ac0f04018f4e93748361da62ed27b1abec77840963e

2 weeks agoDo not allow the argument to a table-valued function to reference a table
drh [Mon, 1 Jun 2026 12:36:28 +0000 (12:36 +0000)] 
Do not allow the argument to a table-valued function to reference a table
to its right, even if the SELECT is inside a common table expression.
This is a replacement for the fix at [3c0a277e6741c722].  Fix
for multiple dbsqlfuzz reports and probably also a fix
for [bugs:/info/b6c6fad96c|Bug 2026-06-01T07:23:11Z].

FossilOrigin-Name: d96271db6a3a44e50d1a977250c4cc14178612a6c838e7c51c5f79fda45ae19f

2 weeks agoTest case to show that the change fixes the original carray problem. right-ref-cte
drh [Mon, 1 Jun 2026 12:30:13 +0000 (12:30 +0000)] 
Test case to show that the change fixes the original carray problem.

FossilOrigin-Name: 8df6671ae8211b706b7d4f073c5166f0f41f3c11339bc4d28997e8a205a39545

2 weeks agoImprovements to sqlite3SelectCheckOnClauses() to be more accurate in
drh [Mon, 1 Jun 2026 12:19:30 +0000 (12:19 +0000)] 
Improvements to sqlite3SelectCheckOnClauses() to be more accurate in
identifying table-valued functions that references tables to the right.

FossilOrigin-Name: e5bae3687dbb470ead7e8d6bf428b1fbb1e9f10c214bc2a91e93e68fb2ae6ff7

2 weeks agoBack out the recent change to carray. The intent is to fix this problem
drh [Mon, 1 Jun 2026 12:07:21 +0000 (12:07 +0000)] 
Back out the recent change to carray.  The intent is to fix this problem
in a different way so that it works for all table-valued functions.

FossilOrigin-Name: 43e02dbb0dbe7192304125cd3298b3f4bbac02395d4d03f7f8d5f96b465eb43e

2 weeks agoFix an integer overflow that could lead to a buffer overrun in the zipfile extension...
dan [Mon, 1 Jun 2026 11:52:23 +0000 (11:52 +0000)] 
Fix an integer overflow that could lead to a buffer overrun in the zipfile extension. Bug [bugs:/info/2026-06-01T10:16:47Z | 2026-06-01T10:16:47Z].

FossilOrigin-Name: a8dac6af353c02aed8eaaba5921e036d3f3a6639367ae70e8c75d759c7b4ab52

2 weeks agoUpdate new test in zipfile.test so that it does not run if SQLITE_MAX_LENGTH is too... zipfile-buffer-overrun
dan [Mon, 1 Jun 2026 11:50:55 +0000 (11:50 +0000)] 
Update new test in zipfile.test so that it does not run if SQLITE_MAX_LENGTH is too small.

FossilOrigin-Name: cc86820e198db6ee4e62f455d3dd9877d73873aaccad6ceffd0b34452d35c89c

2 weeks agoFix an integer overflow that could lead to a buffer overrun in the zipfile extension...
dan [Mon, 1 Jun 2026 10:56:11 +0000 (10:56 +0000)] 
Fix an integer overflow that could lead to a buffer overrun in the zipfile extension. Bug [bugs:/info/2026-06-01T10:16:47Z | 2026-06-01T10:16:47Z].

FossilOrigin-Name: 7c740d2cfd22a89258be2221860ca10985f0fc16dc7a17a99fc282d7105dc38e

2 weeks agoExtra defenses against integer overflows in the untested, unused, and
drh [Mon, 1 Jun 2026 10:53:28 +0000 (10:53 +0000)] 
Extra defenses against integer overflows in the untested, unused, and
unsupported transliterate() SQL extension function found in the
ext/misc/spellfix.c extension.
[bugs:/info/2026-06-01T10:34:57Z|Bug 2026-06-01T10:34:57Z].

FossilOrigin-Name: 2b073519b6080abc8872b0728c64827cc088d1b43f132cd2aeb396f06de3d36f

2 weeks agoFix the carray virtual table so that it gives no solution if it cannot
drh [Sun, 31 May 2026 19:41:16 +0000 (19:41 +0000)] 
Fix the carray virtual table so that it gives no solution if it cannot
find a usable first parameter.  dbsqlfuzz find.

FossilOrigin-Name: 3c0a277e6741c72281e12c44d85902aa6780890a7f59bacc3ac2b35ba27f7211

2 weeks agoTest case to cover the bug fix in the previous check-in.
drh [Sun, 31 May 2026 17:01:44 +0000 (17:01 +0000)] 
Test case to cover the bug fix in the previous check-in.

FossilOrigin-Name: 5b28d49b61d5edc9fef896e685bf227b7e1716c0cc666fd2ebe0d5ea0d11af06

2 weeks agoFix the zipfile extension so that ZIP archives containing files whose names
drh [Sun, 31 May 2026 15:49:57 +0000 (15:49 +0000)] 
Fix the zipfile extension so that ZIP archives containing files whose names
contain embedded \000 bytes do not cause problems.
[bugs:/info/2026-05-31T11:43:05Z|Bug 2026-05-31T11:43:05Z].

FossilOrigin-Name: c12ff342a90c61a0a82c8e63d2d94fecec10dff498da666873ff6aaa15c23dfd

2 weeks agoFiddle should default to using NO_COLOR since the JS console does not
drh [Sun, 31 May 2026 09:38:28 +0000 (09:38 +0000)] 
Fiddle should default to using NO_COLOR since the JS console does not
support ANSI X3.64.

FossilOrigin-Name: bde6190fdeb530bfb92524ab5542f3f4b64adf31c31de1e00fe4430a8e00411f

2 weeks agoFix the format() SQL function so that it reports TOOBIG and NOMEM errors.
drh [Sun, 31 May 2026 09:18:31 +0000 (09:18 +0000)] 
Fix the format() SQL function so that it reports TOOBIG and NOMEM errors.
Fix a possible integer overflow on %#Q formatting.
[bugs:/info/2026-05-31T02:00:07Z|Bug 2026-05-31T02:00:07Z].

FossilOrigin-Name: 3bfe0510aecccf113b9d008c308fca3096e9c45c59b919c0b91bb4703415988f

2 weeks agoAdd a test to ensure an application does not try to create a geopoly
drh [Sat, 30 May 2026 13:23:25 +0000 (13:23 +0000)] 
Add a test to ensure an application does not try to create a geopoly
virtual table with too many columns.
[bugs:/info/2026-05-30T12:47:27Z|Bug 2026-05-30T12:47:27Z].

FossilOrigin-Name: 2c605bfb1562d7a3609ad6ffd7446def12f1ac7084e41b9c6723e998c156501d

2 weeks agoHarden the diskused.c extension against NULL pointer deferences that
drh [Sat, 30 May 2026 10:24:03 +0000 (10:24 +0000)] 
Harden the diskused.c extension against NULL pointer deferences that
might have previously occurred when given a corrupt database file.
[bug:/info/2026-05-30T07:08:55Z|Bug 2026-05-30T07:08:55Z].

FossilOrigin-Name: 7487a1c59d3aaea9f8b2569dca76bbccf21948b1e7bd8a1d841e04382db696f4

2 weeks agoRemove the untested and undocumented "scrub" utility program. It was written
drh [Sat, 30 May 2026 10:09:33 +0000 (10:09 +0000)] 
Remove the untested and undocumented "scrub" utility program.  It was written
in 2016, but made obsolete by the [VACUUM INTO] command in 2019.

FossilOrigin-Name: 27d67fb175e839f6e7450f54166b52e0a6137c075758511da32fd82c57c310c4

2 weeks agoBe sure to do floating-point to text conversions in JSON to the full
drh [Fri, 29 May 2026 23:14:22 +0000 (23:14 +0000)] 
Be sure to do floating-point to text conversions in JSON to the full
17-digits.

FossilOrigin-Name: 61a776650cdc3fe632bdb1dc39f50f542b00a9e5b468180eb54b69750d0cd70c

2 weeks agoRename the ext/misc/analyze.c extension to ext/misc/diskused.c, to avoid
drh [Fri, 29 May 2026 14:57:38 +0000 (14:57 +0000)] 
Rename the ext/misc/analyze.c extension to ext/misc/diskused.c, to avoid
confusion with the src/analyze.c file.  The function is now called
"diskused(X)" instead of "analyze(X)".  The CLI command is renamed
from ".dbstat" to ".diskused".

FossilOrigin-Name: c7839f7a1749b38f8a36c06d93a7b59095e91ce753e8dd020de273ca8f73a239