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

722 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
cb5651e46d Fix integrity-check fails that would occur if the database contained a contentless fts4 table. Report [bugs:/info/2026-10-02T12:22:03Z | 2026-10-02T12:22:03Z].
FossilOrigin-Name: ca8de9a30484d26739a09c972c525a1ae6edcce41b0f3c612805836b894c7a26
2026-10-02 14:33:50 +00:00
drh
a7d4cd04b5 Fix a harmless compiler warning in fts3ChecksumIndex().
FossilOrigin-Name: 44e0d3e2ad294afbcefdfac0e9a28a8bd432b14ba68b13b50fb0663e376f165a
2026-09-29 12:02:34 +00:00
dan
00830b2819 Fix some cases where fts3 integrity-check was not detecting corrupt databases. Report [bugs:/info/2026-09-25T11:18:11Z | 2026-09-25T11:18:11Z].
FossilOrigin-Name: 9b23f99212f49587c5f0b025e90fdd2e844437fbb76fc11c26062df7bcff765c
2026-09-25 14:55:16 +00:00
dan
f544d3599a Avoid leaving an fts3 porter tokenizer cursor in an inconsistent state following an OOM error. At the moment, this does not cause problems because fts3 always frees a tokenizer cursor following an OOM. But it might if some other code used the porter tokenizer implementation.
FossilOrigin-Name: 75c1ee9de670c6366200df65b3a2c7c8888f709e985b5eaf81d57e562ab65b93
2026-09-24 15:53:23 +00:00
dan
5636f0f4a4 Fix potential buffer overreads in demo program ext/fts3/tool/fts3view.c. Bug [bugs:/info/2026-09-21T13:50:52Z | 2026-09-21T13:50:52Z].
FossilOrigin-Name: 90891e96c488ce0eca12e00d01231cd011587236d349f09d4fa979f781ccdafe
2026-09-21 17:12:55 +00:00
dan
5f8b6a782d Fix truncation of 64-bit integer values passed to the fts3 snippet() function. Report [bugs:/info/2026-09-21T02:41:49Z | 2026-09-21T02:41:49Z].
FossilOrigin-Name: b0919c9687f01240c89171e1607816b603450e5bed37c468860298b2ccc11a81
2026-09-21 11:14:14 +00:00
dan
39ccdd9314 Add assert() statements and comments to explain why the return value of sqlite3_column_name() does not need to be checked in fts3.c. Repor [bugs:/info/2026-08-25T17:08:22Z | 2026-08-25T17:08:22Z].
FossilOrigin-Name: 08b34b1656b7dec2328345bb8ea93d75193703aaff52546fc17844b7110b2741
2026-08-25 18:28:21 +00:00
dan
a87bd2471a Avoid a problem causing a use-after-free in the fts3 snippet() function. Report [bugs:/info/2026-08-17T09:18:24Z | 2026-08-17T09:18:24Z].
FossilOrigin-Name: e4635c41536a0b3620780c3f1c872de33121370bafb608fce9fe7e3113e2ae01
2026-08-17 13:55:38 +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
b1c41f40b0 Fix the fts4aux virtual table so that it consistently behaves as if its columns have blob affinity. Report [bugs:/info/2026-08-14T07:27:28Z | 2026-08-14T07:27:28Z].
FossilOrigin-Name: d5b57f76b63552b23ba3e5e372a3773118b929a4116f60f374a91cba87c1152e
2026-08-14 10:57:58 +00:00
dan
acc18b80ef Fix a problem in the fts4aux virtual table causing it to sometimes return spurious SQLITE_CORRUPT errors for fts4 tables with more than 1 column. Report [bugs:/info/2026-08-13T05:56:36Z | 2026-08-13T05:56:36Z].
FossilOrigin-Name: 06f3f9f93be17584982b5fbd84eb1f35b6e15e9271e8d128df5452226fb3b5b9
2026-08-13 11:29:33 +00:00
drh
1e7bd5531e Make the test-use-only SQL function fts3_exprtest() (available only if
compiled with SQLITE_TEST) more resistant to out-of-bounds inputs.
[bugs:/info/2026-08-02T12:28:28Z|Bug 2026-08-02T12:28:28Z] and
[bugs:/info/2026-08-02T12:31:40Z|bug 2026-08-02T12:31:40Z].

FossilOrigin-Name: 30a61347077f4b9996f6ea771c7fd27203ab05039d54cc4df3068e45faf4d2d4
2026-08-02 22:45:36 +00:00
dan
88a179e9eb Return an empty string if an fts3 snippet() is requested for an out-of-range column index. Bug [bugs:/info/2026-07-29T06:30:35Z | 2026-07-29T06:30:35Z].
FossilOrigin-Name: 5c645d5e241f6055c8dd45936a52245ecb2476a6603e06b793912bf897e42239
2026-07-29 16:55:36 +00:00
drh
4f670ff013 Avoid an integer overflow in the string allocator for the snippet()
function of FTS3/4, when SQLITE_MAX_LENGTH is unusually large.
[bugs:/info/2026-07-03T18:34:04Z|Bug 2026-07-03T18:34:04Z]

FossilOrigin-Name: b2816b4d6a2a526e50219aad6051627595ae3a02ef125b5026db6e33509efb0c
2026-07-03 19:13:27 +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
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
dan
b273dc8de1 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
2026-06-15 11:03:13 +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
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
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
1192d6f5b1 Fix an off-by-one error in matchinfo('b') for FTS3 when there are a large
number of columns.
[bugs:/forumpost/42d5f799d1|Bug report 42d5f799d1].

FossilOrigin-Name: c0f2cd6d292bb3554539a309a2ecfa0a12f0248cfcbb5594391607b107a62cd2
2026-05-18 21:45:06 +00:00
drh
a20f63e0ef Limit the NEAR span in FTS3 to 1 billion, to avoid integer overflow.
[bugs:/forumpost/4cfcf164d2|Bug report 4cfcf164d2].

FossilOrigin-Name: adcb44f9dcfd34df4cf4f5cc418ecac9f2ca09723442379dfedcba532c45de77
2026-05-18 20:43:15 +00:00
drh
a2d992a000 Prevent integer overflow due to database corruption in.
fts3auxNextMethod().
[bugs:/forumpost/bce19272cf|Bug report bce19272cf].

FossilOrigin-Name: d903795e3bdf91607f23dace5a15a070139b32e34aed8540a6c2e19c39e997be
2026-05-18 20:27:57 +00:00
stephan
9e572064f3 Replace several comment-based switch-fall-through notices with attribute based ones, as suggested in [forum:b6ab8dc547|forum post b6ab8dc547].
FossilOrigin-Name: 2b0209a3bd3fb19af424386dcd13ff49a0c86edfd5d283fd5e5c42c266872100
2026-03-11 15:17:14 +00:00
dan
add73c831b Add the SQLITE_PREPARE_FROM_DDL flag to sqlite3_prepare_v3(). Use this to prevent fts3/4 tables in non-trusted schemas from calling unsafe SQL functions.
FossilOrigin-Name: 26f39ac806a5582fab1497e38a4ce68dad2b79df8c8aade43c4e21eed7576931
2025-12-22 15:22:02 +00:00
drh
97b5c8c624 Fix a harmless compiler warning inside an assert() in FTS3.
FossilOrigin-Name: 005e176b4e5b3a28865b08c23d6ecd2c76c036b9c6b2075e6d7bfc584d3c433e
2025-12-06 18:40:14 +00:00
drh
e5d4e067d8 Fix two harmless compiler warnings in FTS3.
FossilOrigin-Name: fd9158e6359a85c509e29ddbb333e5ee5d20aae5dc38cd14425286e5f3764b06
2025-11-27 01:32:07 +00:00
dan
0e2d839f0e Fix a typo in fts3/4 debugging code allowing 'maxpendinXY' to act as a synonym for 'maxpending=' in special INSERT statements.
FossilOrigin-Name: 5af554337af3052a5fd734c05883700dd42d140d99d41154b60e1a0f559e5023
2025-11-25 15:11:34 +00:00
dan
e77e6bd0a0 Change some 32-bit integers in fts3_write.c to 64-bit to reduce the chances of integer overflow.
FossilOrigin-Name: 8f8a7224c1e0173764757d5022de60abec3babdc3d4131632805e0b04d1a65bf
2025-11-24 17:44:17 +00:00
drh
0f76b0a4d6 Fix various compiler warnings.
FossilOrigin-Name: 24ee6c25b4745c8fd671d845b48b9ab98a787ccb348d560ad70f19d035e7990e
2025-09-30 17:37:18 +00:00
stephan
656563cce9 Move the forced NDEBUG in fts3Int.h up above the #include of assert.h, as reported in [forum:8f16dd9480aad85f | forum post 8f16dd9480aad85f].
FossilOrigin-Name: 3b06d1c9b6c03f38029a8b98fef6253647878c0f8b05447ec0c8122f189c90dc
2025-08-13 17:58:47 +00:00
dan
9081b89720 Replace some 32-bit arithmetic in fts3_write.c with 64-bit to avoid the possibility of integer overflow.
FossilOrigin-Name: 6711110b1c7589311f012deee4d4dd5b771fa44ad328b471c9ef583960795199
2025-08-11 10:54:39 +00:00
drh
8ae57fab64 Use a more robust backup definition for offsetof().
FossilOrigin-Name: 22441955e03df07903b98832a60c05c53721cd67c667f6c83d5e97fcc62735ee
2025-05-30 15:43:04 +00:00
dan
136afcfcc1 Avoid a potential integer overflow in non-default builds of the fts3 matchinfo() function.
FossilOrigin-Name: aecc0100cef3ea83feed558dbe34dd6313721fa54052ee1ed529741cec8cacda
2025-04-15 11:06:37 +00:00
drh
2b918dbb01 Increase the size of a variable in FTS3 to help static analyzers
see that there are no integer overflow problems.

FossilOrigin-Name: a921a4682fba23e1e223c2e3ecebd22ec59321552bcc563c29ce501bfe70fa4e
2025-04-02 10:42:47 +00:00
drh
257e026de9 Merge cygwin and tclsqlite fixes into trunk.
FossilOrigin-Name: 121f4d97f9a855131859d342bc2ade5f8c34ba7732029ae156d02cec7cb6dd85
2025-03-27 23:29:25 +00:00
drh
460e4cb686 Rearrange #includes in FTS3 to avoid a harmless compiler warning.
FossilOrigin-Name: c5206cee83a4f1e59bfceda35cdfa528f9b4611eaf306da863ae83e9f93cdeb7
2025-03-27 18:22:11 +00:00
stephan
6e059d9dac Merge trunk into the cygwin-fixes branch.
FossilOrigin-Name: 34eadd374b3c0a8c9e1f5f4a1c60fda8f16b1c56213b8c4047f96390c676b695
2025-03-19 10:14:46 +00:00
drh
6e5d59e8ef Make use of the C99 flexible array feature, when available, so that
the -fsanitize=bounds-strict option can be used, when available.
[forum:/forumpost/311dbf9a1cadfae6|Forum thread 311dbf9a1c].

FossilOrigin-Name: d4307a0d43f42e96ec06ad2c1d8d0f5c8ecae759bae8231b1998633089809f49
2025-03-15 19:55:19 +00:00
dan
f212fb3362 Speed up parsing of very long fts3 query expressions.
FossilOrigin-Name: 2dd5b6895a3b23c2b9cbf0c1c1e802faf8f2b41ef60819eea25d609755266e64
2025-03-15 16:58:39 +00:00
drh
126541f8ac In FTS3, rename the MatchinfoBuffer.aMatchinfo field to aMI, to avoid confusing
it with MatchInfo.aMatchinfo.  Make aMI a flexiable array.

FossilOrigin-Name: bb00b973980d259ca85af84c054501cae78b3a9d33ccffa54d7034235dd8d50d
2025-03-14 23:20:12 +00:00
drh
dbd455a0fd Fix one of two flexible arrays in FTS3.
FossilOrigin-Name: ddfa87c17906ecf7fd5639a87bbfa9a87d17ab688159acd2fd80cc5b6f25f09b
2025-03-14 21:15:11 +00:00
stephan
908c0301d1 Merge trunk into the cygwin-fixes branch (which was inadvertently branched too early).
FossilOrigin-Name: a7863b2e2fbea0ea11c494016b99921f70aae09607868aa65af988cbd173b31a
2025-03-06 14:40:45 +00:00
stephan
b6503f1444 Cygwin-centric fixes from Jan Nijtmans.
FossilOrigin-Name: 205979813c7300debb5f1ba270583ef2f08e069d6d01865b5910702889a5c1ed
2025-03-06 13:38:07 +00:00
stephan
47991d973a Various typo fixes reported by Daniel Dumitriu. No functional changes.
FossilOrigin-Name: 37e6ec777445d8ef81acecbb66f86ae78f2ae67ef0bfd3fbd089da51fff35cc9
2025-03-06 09:08:38 +00:00
stephan
da5f813878 Approximately 100 typo corrections spanning the whole tree, submitted via [forum:0db9827f0464bc33|forum post 0db9827f0464bc33] and individually audited and verified. Affects only code comments, innocuous test strings, error message text in tool (not library) code, and configure-level help text.
FossilOrigin-Name: f50c21484d3cac73589da0376c423de39ae8b842218105786c5aa3726e4dcaed
2025-02-27 21:17:55 +00:00
stephan
5d60f47001 Approximately 50 typo fixes, spanning the whole tree, contributed via [forum:006c8fa165083ac3|forum post 006c8fa165083ac3] and individually checked for correctness. Affects only code comments, docs, and a single line of debug output in a test app.
FossilOrigin-Name: af928818a030924060ee0762431dae0f16d53a62f4e1132754d052eb9c621ac2
2025-02-25 20:55:14 +00:00
drh
7bfa4452a3 Additional changes making it easier to prove that integer overflow does not
occur.  No problems found.

FossilOrigin-Name: e846743a875430a5c51d41f00ac9532214f97d9925e6261113b63580f92369fc
2025-02-17 18:09:24 +00:00