1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-01 06:01:49 +03:00

955 Commits

Author SHA1 Message Date
drh
7b99cd6063 Prevent integer overflow when parsing NEAR queries in FTS5.
FossilOrigin-Name: 1a5283d7dab210badb8a33eac29f44dc8c1c210ffb5ef84f43e348170aa406a6
2025-03-17 15:13:47 +00:00
drh
bd0e3ed522 Use flexible arrays whereever appropriate in FTS5.
FossilOrigin-Name: 16dfc415b6e98a2acae79a24bb0afd401e60efc27cbdd1603a426fd33e17d427
2025-03-15 12:22:39 +00:00
drh
17abe9e251 Convert the Fts5Sorter.aIdx field to a flexible array.
FossilOrigin-Name: 28ac776a23da2753265a7fe2ee2ebb09964815fc9058e69c08275fc217842edc
2025-03-15 00:11:22 +00:00
drh
502b7a236e Turn Fts5Colset.aiCol into a flexible array.
FossilOrigin-Name: 0c4d9c74741794468adc444908f6024f016738aa2852d3a646f2c28d079d9446
2025-03-14 23:57:53 +00:00
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
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
dan
eb3a069fc8 Have SQLITE_FTS5_ENABLE_TEST_MI builds avoid reading the database schema from
within sqlite3_open().

FossilOrigin-Name: 15dc524fd4113026cc542140c39c1c8f9e052d36946f0c599f282d9ac27efdab
2025-02-18 15:11:30 +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
drh
c2b446f16a Fix for a potential UAF in FTS5.
FossilOrigin-Name: e33f2fedda17b4f3678fc23c438093c256b0c125da5f1ac42ecaf3d604d54b6a
2025-02-03 18:05:54 +00:00
dan
9e639d2490 Fix a use-after-free case in fts5 provoked by fuzzdata8.db. Tcl test case pending.
FossilOrigin-Name: a4962df665084e423e020be9a2834b6886a8e3feb461cff5358b61398a2a20d2
2025-02-03 17:54:55 +00:00
drh
e097db7210 Make two private routines in FTS "static" so that they are not callable from
outside of SQLite itself.

FossilOrigin-Name: 9b11bed0448b95319206b413c35f23bb80f3f4c0a4394d40f2e64066400a01ed
2025-01-26 23:34:49 +00:00
dan
b80d01a182 Have fts5 better handle OOM errors from sqlite3_blob_close().
FossilOrigin-Name: f418350f3f83147bc5817a885be6e39ff9ff5722742a88d17600729c53c65010
2025-01-21 14:34:59 +00:00
dan
467e20ad1d Fix an assert() that could fail if a virtual table called sqlite3_step() from within the xSync() method while committing a "PRAGMA defer_foreign_keys=1" transaction.
FossilOrigin-Name: 39bdbb3f6dd1d30d180526d35c11f789f5e9d45b99ead72fd4a3b136afab66b1
2025-01-20 18:26:58 +00:00
dan
b1cbae8bd6 When removing an fts5 in secure-delete mode, defer setting the table version to SECUREDELETE until flushing data to disk. This prevents problems that can occur if there is a rollback or statement rollback operation.
FossilOrigin-Name: c359e555ceafcaab2ae38074bc4f57cccdc5bc6080d17f82290c09b9e5dd80c2
2025-01-09 14:10:25 +00:00
dan
c1242d60d9 Fix another assert() failure in fts5.
FossilOrigin-Name: 6da37893f5b5729ea5fd632e8d98789e867488a67501d4a4dad92f8e7cb6bda0
2025-01-08 20:43:03 +00:00
dan
ad460db7eb Fix a crash in fts5 that could occur if shadow tables are modified or removed.
FossilOrigin-Name: c0b691095ae72fc07530777ef6d23688fb4196ce2e0feff14fc3c597c572252d
2025-01-08 15:54:44 +00:00
drh
4112a63b8f Four new assert() statements to help with static analysis.
FossilOrigin-Name: e7f7c9d22be8a17b9a4d8f954fcdd40591ba9da5fb674f1184f960bca5f3d30b
2024-12-29 11:54:12 +00:00
drh
92d252e06d Fix more harmless compiler warnings.
FossilOrigin-Name: f5b8fd77635e5e6d2d88a1ce74e1bd6c4311260a2b695e5055b898b880bf5718
2024-12-07 17:08:13 +00:00
dan
0bce1d6c9f Fix an inaccuracy in the documentation in fts5.h.
FossilOrigin-Name: ec3ca6f17972a9624018ae352e5a4be8dc34602a4569c80e827e09cd7fbed7f7
2024-11-27 18:01:25 +00:00
dan
3e4ccc3208 Update fts5 so that the xInstToken() extension API works with prefix queries.
FossilOrigin-Name: 41b79bde4a4b6510b41cc9175ff2527fbd3ca9209812361783754f24cf67ef9e
2024-11-26 20:46:18 +00:00
dan
e2a3c7232b Update documentation in fts5.h.
FossilOrigin-Name: f1e44f703acb415e2ff7d7f87fa05fc874ef1c432095bb3ccb45c6ad2fd085a9
2024-11-26 20:16:34 +00:00
dan
032bcf72fb Fix compiler warnings caused by variable shadowing.
FossilOrigin-Name: 211b305791980b24c4192ffc57a0471473de3fca32bfc146c0eeacedef7a88aa
2024-11-20 20:39:18 +00:00
dan
de8aa17eb5 Fix a "applying zero offset to null pointer" usan error in the fts5 trigram tokenizer.
FossilOrigin-Name: 9b79b999d4192a3a250bf343825f61e9cb83203e4d94dcfa20c320d5f1386d69
2024-11-18 14:08:42 +00:00
drh
92e9fa6fe8 Ensure that the sqlite3_index_info.idxStr string coming back from FTS5
is always zero-terminated, even if the xBestIndex call fails with an
SQLITE_CONSTRAINT error.

FossilOrigin-Name: a4e976a030851357049e672bbc0ff66d9cc152b3d5f8e03fff36a7c6f060a755
2024-11-12 13:37:00 +00:00
dan
0cd2ffffb7 Fix the fts5 trigram tokenizer so that it handles non-nul-terminated strings.
FossilOrigin-Name: 84f4e37178a65e3128ac0240d37ac40df08b4050ab070d10707e35d11dcbeb10
2024-11-11 19:49:26 +00:00
dan
67a3914e65 Merge latest trunk changes into this branch.
FossilOrigin-Name: edb842349320eda9550bdfcd5a327949c5512e02f4b993782587b2131a425746
2024-11-06 17:31:48 +00:00
dan
8acaa6d039 Add tests for xInstToken() and prefix queries with various fts5 configurations.
FossilOrigin-Name: 9cc04331a01760189d88697233009dbe8a60eda589792ad01b56300499e9f54d
2024-11-06 16:20:16 +00:00
drh
c6a6f1507c Fix harmless compiler warnings.
FossilOrigin-Name: bc93e17924f732468282c5e7a483811d27af573a47aec8ba806f4fe3c5919893
2024-11-04 19:18:19 +00:00
dan
090b8649be Allow an fts5 table or query to be configured to collect xInstToken data for any prefix terms as part of the first parse of the main index, if any.
FossilOrigin-Name: 46929ae92b26f02bc70de9931b21a8a7cf9a2453d5fb07f68b712f62e28e9152
2024-11-02 19:10:50 +00:00
dan
cd9b951e6b Merge latest trunk changes into this branch.
FossilOrigin-Name: bce9a524de6dda87daa90395cd55713d2d3ccfc090e53a947548e434db5eef5e
2024-10-28 10:39:14 +00:00
drh
6d05f9af81 Fix build errors in fts5_tcl.c on Mac.
FossilOrigin-Name: 133fff8bd79d46f74eeeee677a929b611f3af79cbc492864211e61e2a35846e9
2024-10-27 16:12:58 +00:00
dan
346f1e0ed9 Fix test code added by [ba358d26].
FossilOrigin-Name: b7da7980d33e2f2d5d0a4384a43eff39e1a2de4f53b8b4074eea48598a35b9d7
2024-10-27 15:58:28 +00:00
dan
b27a30c620 Merge latest trunk into this branch.
FossilOrigin-Name: 740a37c5d54b57befa86a6bb299ffa89ed4243d10db885a08ab5c63238460dad
2024-10-27 14:41:58 +00:00
dan
59b4f75e0f Add test case for fts5 trigram tokenizer.
FossilOrigin-Name: ba358d265b7ee360d62b5219faaa1010ea90dac4e20cc7adc3ebd46161a65f94
2024-10-26 18:09:13 +00:00
drh
542d1c923e Tweaks to help make jimsh0 usable to build using nmake. Does not quite work
yet, but getting closer.

FossilOrigin-Name: e911303b8d180897c256e5de6edaa6b99239f914b84de2d08b3410650cd52c6d
2024-10-24 13:27:25 +00:00
drh
2c264ad060 Add two new #include statements to the composite "fts5.c" file that
is constructed as part of the build process.  These #includes are no-ops
in the SQLite amalgamation (and are commented out automatically by the
amalgamation builder) but are needed if the FTS5 extension is built
separately, it seems.
[https://bugzilla.mozilla.org/show_bug.cgi?id=1926321#c3|Enhancement request].

FossilOrigin-Name: 1bf8daeb24142044e1b5d4b205317c42353004643fadb6b34f9ae6bfa4e3a6bc
2024-10-23 10:36:02 +00:00
drh
fe15ed4342 Fixes from code inspection:
(1) Extra paranoid defense against integer overflow.
(2) Remove a stray blank line in an FTS5 comment.

FossilOrigin-Name: 8563728deeb1d3ead9ff99a3ad2c7819b2223ead44e7374ecc7bbeda2d955ade
2024-10-17 18:12:03 +00:00
drh
4924847cb9 Avoid the possibility of buffer overrun in the READ_UTF8 macro by using
an less-than operator rather than not-equal-to.

FossilOrigin-Name: 20e60bf058c54bc818ea1b8ce54ace8bcd50699734713cef622bf79e49a9a279
2024-10-14 18:43:04 +00:00
dan
44b8c37017 Fix a typo in fts5delete.test.
FossilOrigin-Name: b1f001435eff72c2119ecee973194385f70fd1b66ef0be8a66c0b0ad02ae43df
2024-10-02 17:43:06 +00:00
dan
c5c3cbc026 Add the contentless_unindexed=1 option to fts5. This causes the values of any UNINDEXED columns of a contentless fts5 table to be stored persistently in the database.
FossilOrigin-Name: 58313ac59e0bd164f601d68a1474f658c5d1c038638e00f3dc15eb58202e661c
2024-10-02 17:04:30 +00:00
dan
d2a88e961a Rationalize code further. And add tests.
FossilOrigin-Name: 0ca002a4ab88f3e7ae1e6e518038157eaa20759f57888c2ed7e50cb92bd96348
2024-10-01 20:38:08 +00:00
dan
d5838eaa42 In fts5, avoid starting a new merge of level L if there exists already an ongoing merge of a level less than L.
FossilOrigin-Name: 350c6e75ce3c1e81458d1baa73045df489284206e8b279ab3c2f5e3d011c262a
2024-09-30 17:28:45 +00:00
dan
7d56669bc4 Rationalize some of the new code on this branch.
FossilOrigin-Name: 66f209ba40e7de49b304d7931ff38a4994038452aab08e9347286a234c6f7075
2024-09-28 20:45:11 +00:00
dan
54e35b543d Add tests for DELETE on contentless, contentless-delete and contentless-unindexed fts5 tables.
FossilOrigin-Name: 74832fffb61d5e09ff256622cc9aa1fd2c40d30324c410bd6a8c688f0506a536
2024-09-28 15:09:43 +00:00
dan
58b4a8f6e7 Extra test cases for UPDATEs of contentless tables.
FossilOrigin-Name: 4d11d844de3edd82f022c36381ca7f14a546a608293c329b91e7f041cec82ff5
2024-09-27 19:21:09 +00:00
dan
43eafb7b76 Fix a problem with UPDATE statements that modify the rowid of contentless_delete=1 tables.
FossilOrigin-Name: d69abca82145465c85241a12322986f22bf12ffe42f86c2c8e8e2f2a77d53bf8
2024-09-27 19:10:54 +00:00
dan
08f1ba0767 Fix a problem with UPDATEs that do not modify all UNINDEXED columns of a contentless_delete=1, contentless_unindexed=1 table.
FossilOrigin-Name: b6b1db8d343d3e55c3a5589af3ec629762e06c6b689b77defd445347198cb2e7
2024-09-27 18:32:52 +00:00
dan
bcd6d5d393 Allow UPDATEs of unindexed columns in fts5 contentless_unindexed=1 tables. Testing to come.
FossilOrigin-Name: cd36d66c88d7282eb0a3ccde5713253f72f5843e451b2693b71adfdae28b41fb
2024-09-27 10:57:41 +00:00
dan
2eff8f2252 Change the way tokendata indexes are collected for prefix queries.
FossilOrigin-Name: 204ddf4e726b695dd12ab4a945ec2461655aa0bcc38b74e970f07ed2ac43c6ff
2024-09-25 18:55:11 +00:00
dan
777c35dbe8 Prevent regular DELETE and UPDATE statements from running against contentless_unindexed=1 tables that are not also contentless_delete=1.
FossilOrigin-Name: 21539e9d0d57fdc762affbce9220d1bb1ca009d9dc751b4ccfe63eecbbe2f575
2024-09-25 12:03:08 +00:00