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

10235 Commits

Author SHA1 Message Date
drh
bfbeb641de Fix parsing of quoted instantiation arguments in the spellfix extension.
[bugs:/info/2026-06-26T10:52:36Z|Bug 2026-06-26T10:52:36Z]

FossilOrigin-Name: c2e963ad948e0c244d6b883b919ec0815c20018282e04e5649c00e70f5a1d2ed
2026-06-26 13:51:48 +00:00
drh
0a54af99a1 Fix unbounded whitespace skip in the decimal extension.
[bugs:/info/2026-06-26T10:06:54Z|Bugs 2026-06-26T10:06:54Z]

FossilOrigin-Name: 71d4cfe5a34cf8485ab2e5abe670381cd068f013233d98c44355a6bcdfcbbbb0
2026-06-26 13:41:07 +00:00
drh
8cb5703867 Fix the (non-deliverable, testing-use-only) closure extension so that it
parses quoted instantiation arguments correctly.
[bugs:/info/2026-06-26T10:06:27Z|Bug 2026-06-26T10:06:27Z]

FossilOrigin-Name: 11ffa3bfba77b9f3a8c4903d496f63ee26c9873f735d254f35111eecf91228be
2026-06-26 13:00:38 +00:00
dan
5ef70c142e Fix the size of an allocation in fts3 to take into account that when merging a phrase doclist, each entry may grow by up to 1 byte if the rhs position of the merged lists is stored. Bug [bugs:/info/2026-06-26T08:08:39Z | 2026-06-26T08:08:39Z].
FossilOrigin-Name: df5728d79ff09235041cf01267104f29f482af3473f5a4c849133b6048565725
2026-06-26 11:36:54 +00:00
drh
e28c7bfec9 Improved detection of corrupt freelist chains on btree pages.
Plus, add assert()s to verify that the min-heap does not overflow
inside of PRAGMA integrity_check.

FossilOrigin-Name: 942498724f5bb83b9a7d9bbbea662d152a46a0ccaee26e4b291f090cc6e7d178
2026-06-26 09:55:59 +00:00
dan
a3e4156745 Add test case to backup5.test to verify that detaching the destination database from its handle is handled correctly.
FossilOrigin-Name: 50cce4758361379f1585b30c619f2c9f7f8873dbfaeaec3ff357e26c1034546c
2026-06-25 10:36:51 +00:00
dan
57312eb362 Update mjournal.test so that it works on windows.
FossilOrigin-Name: 6007b5c2d3c27a4597631914d4114b626ba647954ecfb381de67d4cf27d31ccd
2026-06-24 19:07:30 +00:00
dan
171b1cfb9b Only delete a super-journal if it contains a pointer to the current database's journal. Test cases in this commit might be broken on some platforms.
FossilOrigin-Name: c768be03d4885557c9520c37e3cecbf5647d358a87cd34948578a4a0a8a59a5e
2026-06-24 18:51:36 +00:00
dan
c0121a43ac Do not delete super-journal files named "xyz.9hh" unless the library is built with SQLITE_ENABLE_8_3_FILENAMES.
FossilOrigin-Name: 3973e37a1ef528676de44ddb1b1f18d55b90fca1f6b43c51c3f3ba613267bb92
2026-06-24 18:03:20 +00:00
dan
e21a8d7d1e When rolling back a journal that contains a super-journal pointer, only attempt to unlink the super-journal if the filename looks like one that SQLite might have generated. This is to limit the extent to which SQLite can be caused to delete arbitrary files by supplying it with a crafted hot-journal. Bug [bugs:/info/2026-06-24T14:18:00Z | 2026-06-24T14:18:00Z].
FossilOrigin-Name: 0cdde6755837935e4feaa4367a0b107e363582adc8112a91dc7416f1100ae3aa
2026-06-24 17:14:57 +00:00
dan
1968870813 Avoid trying to delete a database file while it is still open in backup5.test.
FossilOrigin-Name: 395cbed103af08e3a4fafd9a3041205535e019d4aeb58b46c4a7e4f3bca545c9
2026-06-24 14:17:52 +00:00
dan
ade8954c40 Revert the fixes to backup in [1f940357f7] and [e5db80350c] and instead fix the problem reported by forum post [forum:15d82885e2 | 15d82885e2] (that a call to sqlite3_deserialize() after sqlite3_backup_init() but before the first call to sqlite3_backup_step() on the destination db of a backup could cause a crash) by deferring caching the pointer to the destination Btree until after it is locked. This addresses bug [bugs:/info/2026-06-24T08:41:13Z | 2026-06-24T08:41:13Z].
FossilOrigin-Name: 44a0f396daa13f382fd839cd8be49148aa24114968b97fed7f365307d1f8280a
2026-06-24 11:50:08 +00:00
drh
ce512d4229 Fix an OOB read on the unused spellfix1 extension. The OOB read is
one byte prior to the start of an allocation, which is almost always
harmless.  [bugs:/info/2026-06-23T18:48:40Z|Bug 2026-06-23T18:48:40Z].

FossilOrigin-Name: e58d5efc7b3387566661475e1a9afb6b94388a835cfb178999603135d57280fa
2026-06-23 19:28:14 +00:00
dan
764881119d Avoid a use-after-free problem that could occur if ATTACH statements are executed while a backup operation is active. Bug [bugs:/info/2026-06-23T15:46:48Z | 2026-06-23T15:46:48Z].
FossilOrigin-Name: 9454592878b5732d37d61f4541bd6f0c1f893c20fc833ce4c600f9470e62d6f2
2026-06-23 19:14:44 +00:00
dan
db6eeee50e Fix a NULL pointer dereference that could occur in the unionvtab virtual table if the configuration SQL returned an SQL NULL value in place of a table name. Bug [bugs:/info/2026-06-23T05:32:49Z | 2026-06-23T05:32:49Z].
FossilOrigin-Name: 3a2163f9693086bc494ac899647f09467b1aba905f4db147910f203aaab724f0
2026-06-23 11:14:45 +00:00
drh
dd9b3e37e1 Fix a NULL pointer dereference that can occur when misusing a extension
virtual table that was created for testing purposes.
[bugs:/info/2026-06-23T05:32:49Z|Bug 2026-06-23T05:32:49Z]

FossilOrigin-Name: 256d5cd478b83b1371ce24c9702f732cddb4dd4e06c238fc1a1b853b02ffc1f1
2026-06-23 11:09:55 +00:00
drh
987675a440 Fix an OOB read in the next_char() function of the
"spellfix" extension.  The spellfix extension is not a deliverable.
[bugs:/info/2026-06-23T05:41:00Z|Bug 2026-06-23T05:41:00Z]

FossilOrigin-Name: 6ede22e13f8e85c1a341c9a80a3be2f2677baee897c659af4ca43a04698e29a5
2026-06-23 10:51:24 +00:00
drh
b7862a55ef Fix dequoting error on the instantiation parameters of the
non-deliverable extension virtual table "fuzzer.
[bugs:/info/2026-06-23T05:51:36Z|Bug 2026-06-23T05:51:36Z].

FossilOrigin-Name: 410045796b4486fc2d301e661bf9fce3ca3a1ba61c72fe5d6c5d59a330443dd5
2026-06-23 10:23:08 +00:00
drh
3c0d684044 Fix rounding behavior for all-9s decimals in the decimal extension.
[bugs:/info/2026-06-23T05:07:48Z|Bug 2026-06-23T05:07:48Z]

FossilOrigin-Name: 21b2692c8363f2c0629beef4860400a1d27f499a3f27745c23391bcfa09da898
2026-06-23 10:07:50 +00:00
dan
eb6eac655e Add the BTREE_HINT_TABLECURSOR cursor-hint. This is not currently used by stock SQLite.
FossilOrigin-Name: 35b3ff4007fc1abd36233a6b3b75bb6a123edc062f36437247c3dfe779868b70
2026-06-22 11:02:28 +00:00
drh
fb41f57de4 Fix an incorrect assert() in check-in [984c9b181801c1de]
FossilOrigin-Name: 1d41c93b3636de63cc4b9ee49f73319429944f2255ab56d7556595f56434c17c
2026-06-20 21:54:18 +00:00
dan
593b55cb78 Fix a cast in fts3_write so that it is applied as intended. Bug [bugs:/info/2026-06-19T07:56:23Z | 2026-06-19T07:56:23Z].
FossilOrigin-Name: d6a3272e5592bcfeecf8a06dd8330cce57ff6603b24994b533d1fdcd48b5dc66
2026-06-19 11:46:05 +00:00
drh
ffc14a20ad Fix CLI CSV test cases so that they suppress the CR on windows and thus
work cross-platform.

FossilOrigin-Name: 7a2c96405e365dd2efb3593e0973536d1f87f7183d5442f3bc98ca23310e5530
2026-06-17 13:52:55 +00:00
drh
aa1579de80 Fix the OR-to-IN optimization so that it works in cases where there are
conflicting collation sequences on the equality constraints within the OR.
[bugs:/info/2026-06-17T05:04:48Z|Bug 2026-06-17T05:04:48Z].

FossilOrigin-Name: 984c9b181801c1de06782335eb049f32d1dc1d5739a7fb9c94630c22159a4f8c
2026-06-17 13:31:01 +00:00
dan
544b208113 After opening a non-covering index cursor, pass the corresponding table cursor to the implementation via sqlite3BtreeCursorHint().
FossilOrigin-Name: d48c6d2dcd50128f35bba8931371e708d24b63f2ea7a5988af8864d18ef5d14e
2026-06-16 18:06:46 +00:00
drh
9fb225190c 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
2026-06-16 13:43:08 +00:00
drh
9a5801af3a Consistent error messages for excess trigger nesting.
FossilOrigin-Name: 4fb9f2ffb4b45d81c70f561f45cf29a0d5872a612b948882c4a2a14629bcbe28
2026-06-15 17:39:46 +00:00
drh
458dfb94d0 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
2026-06-15 16:45:35 +00:00
dan
1b5bd0edf1 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
2026-06-15 15:38:16 +00:00
drh
53f419e2c8 Additional tweaks and test cases for generate_series() constraints
using very large floating-point numbers.

FossilOrigin-Name: 50d611404a444f23368c684dfa6dc34b057f8adb45aa058bcf3b2768e908eb3e
2026-06-15 15:24:37 +00:00
drh
0cdc6432f7 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
2026-06-15 14:16:13 +00:00
drh
9c2ac0b6e3 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
2026-06-15 10:13:31 +00:00
drh
1b828b8770 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
2026-06-14 20:10:28 +00:00
drh
d8f6cc7ea4 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
2026-06-13 18:04:18 +00:00
dan
865a8f3072 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
2026-06-12 15:36:26 +00:00
dan
23d0a08176 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
2026-06-12 11:24:30 +00:00
dan
2cb57d9d4a 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
2026-06-09 10:43:37 +00:00
dan
2bc3763ec5 Add extra tests to check that non-deterministic functions may not be used in indexes.
FossilOrigin-Name: beeef9dc2b1d778ca628c5e3adc097778646933233ea5ea4f03d2cace0199c17
2026-06-08 10:47:55 +00:00
dan
ee181f479a 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
2026-06-04 11:48:18 +00:00
dan
62a3734e78 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
2026-06-04 11:19:43 +00:00
dan
0120735de1 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
2026-06-03 17:21:12 +00:00
drh
c2d29194a8 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
2026-06-03 16:21:17 +00:00
dan
61523e22f9 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
2026-06-03 15:29:59 +00:00
drh
a735462db6 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
2026-06-03 13:12:20 +00:00
dan
942b7c555a Avoid excessive recursion and stack overflow in fts3 when processing a corrupt
database.

FossilOrigin-Name: 21369378769195f20f839231f625582552eaa3f79044ca3e3efb7f9476b515a8
2026-06-03 11:37:45 +00:00
drh
069e5acd63 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
2026-06-03 11:07:47 +00:00
dan
2a28b15748 Add extra test case to zipfile.test. No code changes.
FossilOrigin-Name: 83fe72bcdf866bdaf3043ae5b0c1eb45a9d50a01b24b7a531858271dd746baab
2026-06-02 11:11:02 +00:00
dan
2c351bbf82 Fix minor problems surrounding transitive WHERE constraints and explicit COLLATE terms.
FossilOrigin-Name: 9500238a1d603a3f08a8fc0954725d5d217aab339720146ea0bc700e47b81c3c
2026-06-01 17:40:23 +00:00
dan
03aa9a7b50 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
2026-06-01 16:20:40 +00:00
stephan
f55434ab30 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
2026-06-01 13:14:48 +00:00