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

1041 Commits

Author SHA1 Message Date
dan
cb1bf41aaa Restore 3.53.0 handling of codepoints u+fffe and u+ffff (they are separator characters) in fts3 and fts5. See forum post [forum:/info/9c6ec90d24 | 2026-10-13T08:37:16Z].
FossilOrigin-Name: f5ed4850175263ef66fade0d54193dfa96935ae63e2516922b7aae816924726a
2026-10-13 15:51:29 +00:00
dan
ab1268f758 Fix test script errors causing problems on windows.
FossilOrigin-Name: 379c017e8f999c35e3b3de64fcc3923e45570ba20bee50a3dd00f6996990a033
2026-10-08 16:17:45 +00:00
dan
7a5d84c684 Avoid dropping an error code in fts5 contentless-delete mode after parsing an %_docize record. Report [bugs:/info/2026-09-25T15:52:10Z | 2026-09-25T15:52:10Z].
FossilOrigin-Name: 52f84cfcdb4ac2d959a2f7ee4bc832e7f49204c86e8762042c99e19488d34f5b
2026-09-25 17:42:10 +00:00
dan
95699469b7 Handle correctly very large (or small) out-of-range column indexes passed to various fts5 auxiliary functions. Report [bugs:/info/2026-09-23T02:40:15Z | 2026-09-23T02:40:15Z].
FossilOrigin-Name: 55c634d96d390ca52c38c58c66be680c1883d799427ddf23a2501d12e7be07d3
2026-09-23 11:06:11 +00:00
dan
b0d5cbda9c Fix a problem causing fts5 auxiliary function API methods xRowCount() and xColumnTotalSize() to return inaccurate values after rows had been deleted from a contentless_delete=1 table. Forum post [forum:/info/5e6f15753a | 5e6f15753a].
FossilOrigin-Name: 39ca0ac36596d37fd62316beb7c6341812624e6d3efea90d68ae0393f742163b
2026-09-16 13:58:43 +00:00
dan
42c45bd235 Fix a bug in fts5 test code function fts5TestUtf8(). Report [bugs:/info/2026-09-03T14:51:50Z | 2026-09-03T14:51:50Z].
FossilOrigin-Name: ac094ec69b9b726985d2fdb82062f098e77c427539cdf5b07ee15dd8427cba66
2026-09-03 16:37:55 +00:00
dan
492e7fc0a7 Fix a case in the fts5 matchinfo() demo function causing it to return the wrong error code.
FossilOrigin-Name: 5251f4d7071f86ad9d772d8b9309bc7191ca485c3db5cb658f689abf02de72c4
2026-08-27 18:07:23 +00:00
dan
8c43b6559f Avoid a technically undefined signed integer overflow in fts5. Report [bugs:/info/2026-08-23T16:25:44Z | 2026-08-23T16:25:44Z].
FossilOrigin-Name: cde23480be10e2da6acb357d39e129b314429640143034b9e2207719dcf18350
2026-08-24 18:55:06 +00:00
dan
c737eb289c Fix some fts5 cases where all columns are excluded by a column filter (so that no rows match). Report [bugs:/info/2026-08-23T16:25:44Z | 2026-08-23T16:25:44Z].
FossilOrigin-Name: 7c9b711fc8c2c714ff8709750773c49dba1c6e4f39700806ebf59e6a094bf32d
2026-08-24 18:24:44 +00:00
dan
b3db734685 Ensure that the fts5_vocab.term column behaves as if it has blob affinity for comparisons.
FossilOrigin-Name: a832bc1ef270365658b60aa4eece35bad1fe26725a45453b302cc7a06cc46cc6
2026-08-24 17:29:17 +00:00
dan
ca3e62724e Fix a problem with combining index=none and secure-delete modes causing full-text index entries to be sometimes lost when inserts and deletes on the same token are combined in the same transaction. Report [bugs:/info/2026-08-23T16:25:44Z | 2026-08-23T16:25:44Z].
FossilOrigin-Name: e1f939f473d6e478ceabcb10a4f5b96d1d538c4aec39e0e3cfeb3c5ff97ea2ec
2026-08-24 17:08:41 +00:00
drh
93f6407070 Detect and report FTS5 index corruption early enough to prevent CPU stack
overflow.
[bugs:/info/2026-08-19T01:42:02Z|Bug 2026-08-19T01:42:02Z].

FossilOrigin-Name: 663aa876b54ddf477bc31e286e2101726bc637fe4f4570fd3b47abc4dc9ba713
2026-08-19 14:27:45 +00:00
dan
7fa8cff00c Fix a buffer overread in the fts5vocab virtual table when processing "term < 123" constraints. Problem recently introduced by [db05b203f4].
FossilOrigin-Name: 08e5a730d4ccfba16e961550a232512a956f0f2f9116a2e59e4a2124c3277915
2026-08-18 15:06:31 +00:00
dan
5271f86cfa Declare fts5 structure records corrupt if they contain a page number greater than 0x7FFFFF00. Report [bugs:/info/2026-08-17T20:07:33Z | 2026-08-17T20:07:33Z].
FossilOrigin-Name: c97a940ceb4c21adc68123e084c8b8b688bcd309579a82951b2e160dc7bacf44
2026-08-17 21:26:44 +00:00
dan
0085ea1443 Have the fts5term and fts3aux virtual table modules only process constraints on the term column that use binary collation. Report [bugs:/info/2026-08-17T10:17:15Z | 2026-08-17T10:17:15Z].
FossilOrigin-Name: f26099b7fad1eab2791b574c9371021d4f05fbf824141e77cdff921a2819866a
2026-08-17 11:52:13 +00:00
dan
f17a2ee06b Fix the fts5vocab virtual table so that columns always behave as if they have blob affinity. Report [bugs:/info/2026-08-15T07:03:55Z | 2026-08-15T07:03:55Z].
FossilOrigin-Name: db05b203f47e6ed0792ac011b18e0da98275e900407436798ca28d5f7dd2e094
2026-08-15 14:24:18 +00:00
dan
d9de6eedbe Fix a problem in fts5 secure-delete code that could lead to a buffer overrun when dealing with a strategically corrupted database. Problem reported by YEONBA.
FossilOrigin-Name: 9cd4f9e9205c5a5096388397a39349db9ff5377d19095c6b20388ff799969c31
2026-08-11 14:16:12 +00:00
dan
4267bbf920 Update preprocessor logic in test file fts5_tcl.c to use intptr_t when available.
FossilOrigin-Name: fee71cd6f7294ffd02784d26811a9d11d80e83d4075e1233b8ec0289519bb891
2026-08-11 10:46:12 +00:00
dan
f45af6ac7e Add "include <stdint.h>" to test file fts5_tcl.c.
FossilOrigin-Name: 9cf3f0079a7f9a4f02a6a86bd50f4ffc5645625eaa6de8cd9d09dd6a40d11176
2026-08-10 19:49:25 +00:00
dan
7c8835dc0a Change the way fts5 test code casts between integers and pointers to avoid a ubsan error in some versions of gcc. Report [bugs:/info/2026-08-08T15:54:04Z | 2026-08-08T15:54:04Z].
FossilOrigin-Name: d275eb5b634afb85bf1f5fab4fd5243247ed06e03db3e2077192c01ff43713d0
2026-08-08 19:47:28 +00:00
dan
e1c9934f9f In fts5, account for the possibility of negative docids when allocating a buffer to store the results of merging detail=none prefix lists. Fix for report [bugs:/info/2026-08-04T08:49:27Z | 2026-08-04T08:49:27Z].
FossilOrigin-Name: a7f8c92f623e9cbe8a61266d949916acc9e5110c94dff4aa6fd1ad2ea8a60d4e
2026-08-04 11:04:17 +00:00
drh
b14505fc54 Remove harmless "breakpoint" command inserted by the previous check-in
FossilOrigin-Name: 5a4b0b81de1abf9c1b73f026b416b29b9bdddc7a1b73ae5b9aa02f3dde131731
2026-07-14 14:52:25 +00:00
dan
98da7d71ee Update some test cases in fts5corrupt3.test and fts5corruptB.test to account for recent updates to database and record corruption detection.
FossilOrigin-Name: a48f4cf312b8a1af03b1dc61d8475fc7448fb927e2573fa98882e7b14c065c65
2026-07-14 11:46:07 +00:00
dan
951de300af Ensure that the "leaf-size" field of an fts5 record is only read from records that are actually leaves and are large enough to contain it. Bug [bugs:/info/2026-07-09T20:15:55Z | 2026-07-09T20:15:55Z].
FossilOrigin-Name: fe52900694e045231e91047fbfd82577c7fa347d7352bd048867a9e95299a0d0
2026-07-09 20:56:29 +00:00
dan
2f7c4bbc19 Fix an OOB read caused by passing an out-of-range phrase number to fts5 auxiliary API xPhraseFirstColumn() in detail=columns mode.
FossilOrigin-Name: aeb85fdfca0a546cfd3ef26efd58b9ffc8d5fda15562558d8479dee55321596f
2026-07-06 16:04:51 +00:00
drh
c9a90ce1ec Improved data validation in fts5SecureDeleteOverflow().
[bugs:/info/2026-07-03T19:16:18Z|Bug 2026-07-03T19:16:18Z]

FossilOrigin-Name: bb1588f04a745ff130edf300f1216e0957c0de28734ccdba1b8a6a4a161dbddf
2026-07-03 20:26:45 +00:00
drh
2a108605a3 Check for oversized iTermOff in fs5SegIterNextInit() and trigger a
corruption error if detected.
[bugs:/info/2026-06-27T18:46:54Z|Bug 2026-06-27T18:46:54Z]

FossilOrigin-Name: 130d4d10dae5957c2be50696545157cd98b6a976affa0c887ff9e1c9e17e97ab
2026-06-28 00:21:50 +00:00
drh
8f384febcc Do not allow an integer overflow to bypass a leaf-term bound check
in the integrity-check function of FTS5.
[bugs:/info/2026-06-27T18:47:28Z|Bug 2026-06-27T18:47:28Z]

FossilOrigin-Name: 74ba971bfafae1eba5e4f4a36e3b31f603f37cdc2010ee09ac251d6e863ac8b0
2026-06-27 23:04:36 +00:00
dan
73975a8f31 Fix a buffer overread that could occur in fts5 within a memcmp() when doing an integrity-check on corrupted records.
FossilOrigin-Name: 062597f10a6d3f8c959a38e4ab6ee1a885499dd7018662e3e6268b2ee6c63c1b
2026-06-26 14:08:42 +00:00
dan
8c4a4acc02 Fix an fts5 problem causing attempts to create locale=1 tables with more than 115 columns to fail. Bug [bugs:/info/2026-06-19T05:19:08Z | 2026-06-19T05:19:08Z].
FossilOrigin-Name: 979229f720e63d0294be14dae3f9fad68f76e4126a0ad63e32573cdfecd0151e
2026-06-19 11:14:16 +00:00
dan
667d1b15c1 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
2026-06-15 13:39:20 +00:00
dan
23e50585eb 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
2026-06-15 11:47:52 +00:00
drh
0b9f4ee89c Fix harmless compiler warnings.
FossilOrigin-Name: dd0c161fcd1619518cd4671d64afb6afeec44c140ec176ccb8616d381a88f42f
2026-06-11 22:48:16 +00:00
dan
2bd7ac6716 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
2026-06-10 16:51:20 +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
082e41f17b 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
2026-06-08 17:48:00 +00:00
dan
19a2ba1f5b 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
2026-06-08 15:20:49 +00:00
dan
b677c5afd4 Avoid a potential use-after-free in fts5. Report [bugs:/info/2026-06-08T08:45:27Z | 2026-06-08T08:45:27Z].
FossilOrigin-Name: 9c018b02dbfb071c748d540ad679a4dbdc0fb88a62988e02cb51a3403509febe
2026-06-08 12:03:52 +00:00
dan
7340b032d1 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
2026-06-08 11:24:05 +00:00
dan
51b2c3863b 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
2026-06-03 14:58:13 +00:00
dan
6feeafc7de Fix another potential buffer overrun that could occur in fts5 when processing corrupt records.
FossilOrigin-Name: 6ee44b199512b8cac604bf062f893a9047af4b5bfc881bb7cb69ae42d0a0adb4
2026-06-03 13:49:33 +00:00
dan
62d17739bc 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
2026-06-01 15:03:53 +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
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
eb83e32cef Improve detection of corrupt database records in fts5.
FossilOrigin-Name: 87b653731171a26396f9796b0a5c436593571d39e991d8d040ef4473cf459b67
2026-05-11 11:53:07 +00:00
dan
79db323ce1 Fix potential buffer overwrite that could occur in fts5 when processing corrupt records.
FossilOrigin-Name: 4a5ad516ea93926c0d5206b4d72c3675905d2bf666b27a649256b93eb95c671b
2026-05-11 11:12:06 +00:00
dan
ec2ea68d1f Avoid a potentially undefined left-shift in the fts5 porter tokenizer.
FossilOrigin-Name: 46a288e43e4c48fca6610bce6a2db418aaa3c8a1dcb115b7a0bfad2063355e58
2026-04-15 11:23:30 +00:00
dan
0cb7603d4c Update fts5 scan costs to take into account that a prefix query combined with a rowid equality constraint is still quite expensive.
FossilOrigin-Name: 539769b63e4044018be2993894b1962df6a6ae58636682b7fb7a2dd5aaf4075c
2026-03-19 17:56:10 +00:00
drh
f6c8adf3a2 Omit explain_i calls from TCL test scripts.
FossilOrigin-Name: 204f25c882832058c3291d4d6a0a6ac2711c081cb91b19feb2cf94a25ed61ecf
2026-03-02 16:40:16 +00:00