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

1053 Commits

Author SHA1 Message Date
drh
bc766d966a Merge branch-3.54 fixes into trunk
FossilOrigin-Name: fdf339d965aba5e35feaf3ef613e2e2ce0795338591f261998141a6d080bb0da
2026-10-22 11:41:16 +00:00
dan
4f6dc901fe Do not synthesize position-lists for UNINDEXED fts5 columns in detail=none mode. Report [bugs:/info/2026-10-20T20:40:52Z | 2026-10-20T20:40:52Z].
FossilOrigin-Name: 64e37575ca1531ebea52402e6fa9ee1de399f1767f5baedc12ffde03a995b477
2026-10-21 17:23:01 +00:00
dan
4259cf5264 Avoid orphaning an fts5 %_content table when dropping or renaming an fts5 table that uses contentless_unindexed=1. Report [bugs:/info/2026-10-21T02:51:01Z | 2026-10-21T02:51:01Z].
FossilOrigin-Name: fa0247a431bd99a9442c61028dc85ad1ffd2c5ea5b76ab68c394eaeda9af9409
2026-10-21 16:56:58 +00:00
dan
0b73214725 Improve usage of fts5 doclist-indexes in tokendata=1 tables.
FossilOrigin-Name: 3e4c42ea20573a02fde30c25f0b11d0d0cace6f4a65849ca817d238d5315a8ee
2026-10-21 16:48:04 +00:00
dan
d08513bcbc When querying an fts5 table in tokendata mode, avoid using the "has-doclist" flag from the previous leaf page when querying for a non-existent term larger than all terms on that page. Report [bugs:/info/2026-10-21T02:52:01Z | 2026-10-21T02:52:01Z].
FossilOrigin-Name: 3769f60be38ba67efce022d4cb72a1db89b36641b2f132698d4d85b0f6b30775
2026-10-21 16:05:34 +00:00
dan
0269dadc3d Avoid returning extra rows when the RHS of a "rowid = " constraint on an fts5 table is not an integer value. Report [bugs:/info/2026-10-20T20:31:49Z | 2026-10-20T20:31:49Z].
FossilOrigin-Name: 5a09fc807377b4cfa37b06d69101530611df143bd64f3384db480797d8795fea
2026-10-21 15:25:33 +00:00
drh
1113952d2a Allow the origin counter in FTS5 to grow beyond 32 bits.
[bugs:/info/2026-10-21T10:56:15Z|Bug 2026-10-21T10:56:15Z]

FossilOrigin-Name: a0fed3f26e969ae47834ab9f34deaee42c6b51da3151af836ca5b299ed79a5f3
2026-10-21 14:35:08 +00:00
drh
078f7c4c45 Test cases added
FossilOrigin-Name: 2ec6c0ff491454f25103f368a5885a6bcd0177fa1eb0bfb2060cd5a6f8c60a72
2026-10-21 10:27:51 +00:00
drh
03c38c992a Merge branch-3.54 fixes into trunk
FossilOrigin-Name: 8efb0acad85f6220f576c71530256d62f92dfba5673cdc5e0371f480753f1034
2026-10-20 17:53:47 +00:00
dan
d89373dc10 Fix a problem causing queries on secure-delete fts5 databases to occasionally return extra, non-matching, rows. Report [bugs:/info/2026-10-18T20:40:47Z | 2026-10-18T20:40:47Z].
FossilOrigin-Name: 10b8f4166da26908aef9182824b0c967af7d861ff6c83daed7cd50321ee563b3
2026-10-20 11:13:15 +00:00
drh
623bc0b1d5 Fix harmless compiler warnings.
FossilOrigin-Name: a68c9f3e98a7be2e7ac020fcbdf3b39cd9015e1d2fa07d30619c47a05cf7aab4
2026-10-18 21:36:55 +00:00
dan
fff257d3ed Improve the error messages emitted by fts5 in some cases. Report [forum:2026-10-13T21:57:58Z | 2026-10-13T21:57:58Z].
FossilOrigin-Name: dabff5c1cde60883f23d41f713f44a5942ae229c3abe280778dc2df41c894907
2026-10-14 16:11:09 +00:00
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