Commit Graph

524 Commits

Author SHA1 Message Date
drh
cbf9450404 Fix FTS3 so that it works even without SQLITE_DEBUG.
FossilOrigin-Name: a18c103121529c2e3c6a8ada16a4c40d14080670
2012-03-26 14:36:42 +00:00
dan
6f4df8ac83 Modify the FTS integrity-check so that the checksums do not depend on the results of signed integer overflow, which is undefined in C.
FossilOrigin-Name: f907fc3fb387e74bb66babcbf050748cb253a6fa
2012-03-26 10:57:31 +00:00
dan
84bce14f77 Add a comment to explain how the FTS integrity-check works.
FossilOrigin-Name: 64e8a116f39434a3b7347f01a47f88eef3276742
2012-03-26 10:47:03 +00:00
dan
cbcd9f5357 Add an experimental integrity-check function to FTS.
FossilOrigin-Name: 40fc8804743dfb005991e9c5ef7b0ebcb3c2e731
2012-03-26 10:36:55 +00:00
drh
6c2e7e19fa Enable fts3 tables to use incremental merge by automatically creating the
%_stat table when it is needed.

FossilOrigin-Name: cc051fc0b2d89603b27b94cf2afdbda417ee9d94
2012-03-24 17:29:05 +00:00
dan
61fa09dbf2 Fix a failing assert() in the FTS3_LOG_MERGES related code.
FossilOrigin-Name: 4220d52cb3426f1680b72d57ecc9f4ade029357d
2012-03-24 17:09:11 +00:00
dan
0dfcdeb4f0 Add a comment to fts3SyncMethod() to justify the nMinMerge=64 constant.
FossilOrigin-Name: af55ca5fc6778cb6d1a79a17dfa2d4e567ea1ccc
2012-03-24 16:43:55 +00:00
drh
790964ebc4 Fix a bug in debugging code enabled when FTS3_LOG_MERGES is defined.
FossilOrigin-Name: 2e06babf49de844d0e878d68114dbcc5ad4d6e54
2012-03-24 16:18:08 +00:00
dan
45eddd6855 Remove the Fts3Table.mxLevel variable.
FossilOrigin-Name: 67a0cffc9d07be7f09dad9d019a18160711295cd
2012-03-24 16:11:21 +00:00
dan
4b1e4dabc3 Modify the way the number of leaves written and the maximum relative level are calculated in the auto-incr-merge code.
FossilOrigin-Name: 0d841c957c6ec4afecb49504177c6279e09d7012
2012-03-24 14:45:19 +00:00
drh
4ef9dfff97 An attempt at automatic incremental merging for FTS4.
FossilOrigin-Name: ed69434cd89084f4b57bd2cc4f5cc558904af565
2012-03-24 02:20:43 +00:00
dan
d59de73e27 Fix a spurious SQLITE_CONSTRAINT error that may be returned by an incr-merge operation.
FossilOrigin-Name: ed7c17ea165f6348506bd23ebc58c427bb65d697
2012-03-23 18:26:11 +00:00
dan
3501a91677 Remove an incorrect assert() statement. Fix a const-related warning.
FossilOrigin-Name: 96ed47493b3d46344fd2105642f31690aee06674
2012-03-23 14:38:49 +00:00
dan
e81eaec754 Following an incr-merge operation that does not completely consume its input segments, store context in the rowid==1 row of the %_stat table that allows the next incr-merge to pick up where the previous left off.
FossilOrigin-Name: ab0a4f44fb67e9f0cb82297b80e728ca58cdb0fb
2012-03-22 16:48:12 +00:00
drh
e239233982 Merge trunk changes into the fts4-incr-merge branch.
FossilOrigin-Name: f61d5fb0281381228eb1a12a233bacaeb26b12a3
2012-03-20 17:04:17 +00:00
drh
d13a3bc772 Fix one more compiler warning missed by the previous check-in.
FossilOrigin-Name: bc03d99a78e90c02b69037e5f5f81537b5a3ac60
2012-03-19 14:57:49 +00:00
drh
01ea399a84 Suppress harmless compiler warnings on windows in FTS4 and RTREE.
FossilOrigin-Name: 4fd68647c8d4b120e04d054617cef31001f44c6f
2012-03-19 14:51:19 +00:00
drh
bbe0520329 Avoid a compiler warning (an incorrect compiler warning, at that) in vs2010.
FossilOrigin-Name: 7dd97f12cd268cac1241f0f3e8de94bb629b97c7
2012-03-19 14:28:43 +00:00
dan
d1ab097d45 Fix various incorrect and missing comments and other style issues in and around the FTS incremental merge code.
FossilOrigin-Name: 7aabb62c8ccbd2b8d216e25226f06e5820dec38a
2012-03-17 16:56:57 +00:00
drh
c8d7b24e93 Cherrypick the [3475092cff] fix for 32-bit overflow with large language-ids
into trunk.

FossilOrigin-Name: 2755edc7f1186ba8955f2c3550a90f40a55ddae2
2012-03-16 16:52:54 +00:00
dan
81b35dc66c Fix some integer overflow problems that can occur when using large langauge id values.
FossilOrigin-Name: 3475092cff862080a020d386076d739f0d22c9b2
2012-03-16 15:54:19 +00:00
dan
e931b7f45f Add a comment to the FTS getAbsoluteLevel() function. No actual code changes.
FossilOrigin-Name: 7e0f861beda4d74d0c3c9fb4abb3ddb5fee346bd
2012-03-16 14:54:07 +00:00
drh
7a48480d07 Fix harmless compiler warnings.
FossilOrigin-Name: 74eadeec34c4b19cf5f8b7f648db3b7ad601a00e
2012-03-16 00:28:11 +00:00
dan
4ab6f2b9c1 Modify incremental merge code to merge nMin segments at a time.
FossilOrigin-Name: cd34bc1af4ba608ea3b52bab55bcfe0086711900
2012-03-15 17:45:50 +00:00
dan
5730ef599c Add tests for incremental merge code.
FossilOrigin-Name: 570473729d6561d81e6e5f8884fd18487008636e
2012-03-14 20:01:52 +00:00
dan
a2af0aecdb Avoid allocating a large object on the stack in the incremental merge code. Use sqlite3_malloc() instead.
FossilOrigin-Name: 36ae510de45be44efd34cff242d02fb21b7419ac
2012-03-14 12:17:40 +00:00
dan
8af1fc721e Fix another bug in the incremental merge code.
FossilOrigin-Name: f97b12e0955c4c29f9c31a186d72d87f7407782e
2012-03-14 11:51:31 +00:00
dan
604f58a686 Fix some bugs in the incremental merge code. Some remain.
FossilOrigin-Name: bff21683705a61b8b8672e0b44c287d1dc7c32a9
2012-03-13 19:56:34 +00:00
drh
ab4f6385de Minor commenting and stylistic changes only.
FossilOrigin-Name: a1747086c5e0c152fcf4bd9fa80a61b6f03f4a94
2012-03-09 12:52:43 +00:00
dan
593c9824bc Add the 'merge=?,?' command to fts4. This still needs some work.
FossilOrigin-Name: 741b8f897750eac3c9774fd65de7e40bb89781b1
2012-03-08 18:39:03 +00:00
dan
fd6ddf91b0 Fix a problem compiling the test code in fts3_test.c when SQLITE_ENABLE_FTS3 is not defined.
FossilOrigin-Name: b00ccda307caae597c143ab0586f90acb77f79cf
2012-03-05 16:24:26 +00:00
dan
3a1abde7c8 Merge the fts4-languageid branch with the trunk.
FossilOrigin-Name: 99a9073b5e411ce94f38ce49608baaa15de8b850
2012-03-05 15:33:32 +00:00
dan
996073b3ae Add the xLanguageid method to sqlite3_fts3_tokenizer versions 1 and greater.
FossilOrigin-Name: f8e9c445dd358c40e5a7bf3756b9f291909dbea7
2012-03-03 18:46:41 +00:00
drh
9db1d56f02 Remove an obsolete comment from FTS3. No code changes.
FossilOrigin-Name: 74d224b14467d8a6915d3cf372f45e0d28708fa2
2012-03-02 20:34:57 +00:00
dan
7395599031 Fix problems with combining content= and languageid= in a single fts4 table.
FossilOrigin-Name: 22491e7bc38aee43819b888e04241cb6a6ef73a3
2012-03-02 19:53:02 +00:00
dan
8fb662b0be Fix the FTS 'optimize' command on multi-lingual databases.
FossilOrigin-Name: 65fa693729a336e4d905ce72e6b9ccf4faa772bd
2012-03-02 12:26:19 +00:00
dan
e3ddd1ac42 Fix a bug in merging FTS language tables for languages other than language 0.
FossilOrigin-Name: d281cb8984c911a4c0cce2ec299e1351d8e580e4
2012-03-02 11:48:50 +00:00
dan
7fcb214b93 Add the "languageid=" option to fts4. This code is still largely untested and alsmost certainly buggy.
FossilOrigin-Name: bea257f70f10dd1111d79cabd1e1462dc651704d
2012-03-01 19:44:20 +00:00
drh
548af8b69e Fix a compiler warning in FTS4.
FossilOrigin-Name: b4cad1ce78e6bb967c472bec5c562a24b4dfebaf
2012-01-31 23:34:21 +00:00
dan
585db0e23a Fix an FTS problem triggered by querying for an N character prefix using an N+1 character prefix index after rows have been deleted from the FTS table.
FossilOrigin-Name: c05c3fd20d93f430140d762ead23bacd337ffb4d
2012-01-25 16:29:45 +00:00
dan
42829635a2 Changes to the async-io module so that the xFileControl method returns SQLITE_NOTFOUND when a file-control is not recognized and so that it adds the second nul-terminator byte to filenames passed to the xOpen method of the underlying VFS.
FossilOrigin-Name: 7036886e83fccad32187668306ee2ae3f950dfce
2012-01-24 10:08:26 +00:00
drh
45d29309a7 Fix typos in commands. Combine the ExpandBlob and expandBlob macros into one.
FossilOrigin-Name: fc9179e154751b51ddef429600d30a89d4a098bd
2012-01-08 22:18:33 +00:00
drh
64803bd2fa Fix minor issues with FTS and RTREE discovered by coverity.
FossilOrigin-Name: 1c27d842163e27c39bbe9409f50657b9de9ade6e
2011-12-22 17:31:17 +00:00
dan
0c8cda6e0d Fix a problem in fts3_write.c causing stack memory to be referenced after it is out of scope.
FossilOrigin-Name: f9c4a7c8f4e5821b47c1393d6272e32416d8886c
2011-12-22 15:30:46 +00:00
dan
689e38f7cf Add a missing va_end() macro to fts3.c.
FossilOrigin-Name: e6f825748a1d510c8f5529c79656bb5db9216231
2011-11-04 10:37:21 +00:00
dan
042f88e5b4 Add new file ext/fts3/README.content, describing the experimental FTS4 content option.
FossilOrigin-Name: 13a9d085e1a5654a97b8d26bae7182ca6c0c237b
2011-10-31 11:36:29 +00:00
drh
6ed18b7110 Fix harmless compiler warnings in FTS4.
FossilOrigin-Name: 1af4a25631c4077a9bfc64e15eb92fbf5146c89c
2011-10-19 18:21:47 +00:00
dan
e459b07601 Merge the fts4-content branch with the trunk.
FossilOrigin-Name: 8a4077057ddeb08e8edc5f20a75abaaba7a278ba
2011-10-19 16:20:40 +00:00
dan
9743948386 Have FTS3 ignore ^ prefixes. The ^ syntax is only supported on FTS4 tables.
FossilOrigin-Name: df36ac948179f37b432a88701b6c79299e073ce8
2011-10-19 15:52:48 +00:00
dan
d17f70a624 Change the way ^ tokens work in FTS so that the filtering is done as part of reading the FTS index instead of waiting until an entire doclist has been retrieved and then filtering it.
FossilOrigin-Name: 9b58c59eb4efaa38ce50a3ce1b52f9ba578c71d6
2011-10-19 11:57:13 +00:00
dan
50a7544d6f Fix a problem in FTS to do with ^ tokens and the snippet() function.
FossilOrigin-Name: 2c03b24f4cc6f2c28c9d5b9984320d41b8486c32
2011-10-19 09:40:49 +00:00
dan
3f1ea8d114 If a token within an FTS query is prefixed with a '^' character, it must be the first token in a column of data to match.
FossilOrigin-Name: 63ac33c860eb32ce96699f06bf83121cec2ffaca
2011-10-18 19:39:41 +00:00
dan
a986d33fd3 Cherrypick patch [3126754c72] from the trunk into the content= branch.
FossilOrigin-Name: f9b5b217088a6aeb25eba184ab92d1a842a680a6
2011-10-18 12:49:59 +00:00
dan
42495cd46f Fix a floating-point exception that can occur when an FTS4 query contains a large number of tokens connected by AND or NEAR operators.
FossilOrigin-Name: 3126754c72351c724be29d75a194bfc3e7b67205
2011-10-18 12:44:04 +00:00
drh
30ddce6ff4 Added the tool/warnings-clang.sh script. Changes so that there are no
warnings with either gcc or clang even including FTS4 and RTREE and
both with and without SQLITE_THREADSAFE=0.

FossilOrigin-Name: 39408702a989f907261c298bf0947f3e68bd10fe
2011-10-15 00:16:30 +00:00
drh
086e4913b5 Fix a few minor and harmless clang warnings in FTS3 and RTREE.
FossilOrigin-Name: b3324f6cc27c3bfb32b12eacace2fc731c2dd644
2011-10-14 22:57:03 +00:00
dan
8dab211632 Handle updating the only row of an FTS table correctly. Fix for [9fd058691].
FossilOrigin-Name: 7e24645be2fe0ffe092212e7bcfa5b4500305811
2011-10-13 17:16:45 +00:00
dan
deb9473250 Change FTS4 so that if both the content=xxx option and column names are specified, the virtual table assumes that the named columns correspond to columns of table xxx.
FossilOrigin-Name: 289ee43179369fce2fde50870d72c445e184e896
2011-10-05 15:11:30 +00:00
dan
8361b189c9 Fix a problem with IO error handling in the rebuild-index code.
FossilOrigin-Name: c6ba81fcad32192674bd510e607f787adc1f7038
2011-10-05 06:07:00 +00:00
dan
49fc336438 Improve test coverage of fts3.c.
FossilOrigin-Name: 0f439944ab49a5691615bc170fdcf652055573df
2011-10-04 19:41:50 +00:00
dan
cc5b81464a Add tests to check that modifying the schema of an FTS content table does not cause a crash in the FTS module. Also disable the deferred token optimization for content=xxx FTS tables.
FossilOrigin-Name: be86c7061b68f403730bf63ea1f7dc0d9ceb0a3b
2011-10-04 16:37:35 +00:00
dan
d8e454e19a Add experimental 'content' option to FTS4.
FossilOrigin-Name: 1d27ea741f61c624e18bdc6a3b1c2d8574a64ddc
2011-10-04 11:22:59 +00:00
dan
f9556a1a3d Allocate the correct size for the output buffer in fts3DoclistOrMerge(). Fix for [56be976859].
FossilOrigin-Name: 07788c0f7f3740c1c280f6ce4dc68401c30bae6e
2011-09-13 19:08:43 +00:00
drh
ec661058dd Fix harmless compiler warnings on unix.
FossilOrigin-Name: 90b1aea17400bbda5ebc8ae4eb4e12127519e42e
2011-07-09 16:17:18 +00:00
dan
f443e317f7 Remove accidental global variable "doclist" from fts3Int.h.
FossilOrigin-Name: f244b2f3959e86fac555b91438cfe90528ab1648
2011-07-07 07:37:53 +00:00
dan
da7b45615d Add a fix and tests for the FTS deferred token logic.
FossilOrigin-Name: 91daea7d2ec41f014fb30c6371aae447cc07f287
2011-06-28 11:58:09 +00:00
dan
b8ae1afba1 Merge latest trunk changes with fts3-changes branch.
FossilOrigin-Name: 226686475c28cdc87e86d2d3f10014436a9a2b8f
2011-06-28 09:51:22 +00:00
dan
0ea2517c4e Changes to allow FTS to be compiled as a loadable module again.
FossilOrigin-Name: 29e69f389cb0078e125ba5814a68b3fe8cf634c6
2011-06-28 07:15:43 +00:00
dan
5b217c308f Changes to improve the selection of deferred tokens within phrases.
FossilOrigin-Name: 2c4bbd90e2fca593c186bf412b608aff8c9f9061
2011-06-27 11:15:53 +00:00
dan
17fb042578 Fix some of the code issues (missing comments etc.) in the new FTS code.
FossilOrigin-Name: 8230d83120e0f4d217fde56e22c6f05aa5adee09
2011-06-23 17:09:51 +00:00
drh
45de8d5f0f If "PRAGMA page_size" commands are not authorized, the FTS module will assume
a page size of 1024.

FossilOrigin-Name: ba39382ef546b4c4ae15ed90ef0b6c87762bffef
2011-06-23 00:59:41 +00:00
shaneh
2e2f36b4ed Fix a couple of compiler issues on Windows due to warning clean up.
FossilOrigin-Name: 81e6f151d384fa1f1474175b39ad6dfa64f8da0d
2011-06-20 20:50:49 +00:00
drh
7fd3392981 More compiler warning fixes.
FossilOrigin-Name: ed2dda9329ca42e9c0be1986c78b091051e7598f
2011-06-20 19:00:30 +00:00
drh
051eb38a26 Fix various harmless compiler warnings in FTS3 and RTREE.
FossilOrigin-Name: fe62179efdea40887e23a16f898060b879013824
2011-06-20 17:24:29 +00:00
dan
6764a70086 Fix a problem where FTS test code was not being included in the testfixture build when SQLITE_ENABLE_FTS4 was defined.
FossilOrigin-Name: e539d08a4dda073dc67dc39a104f89374d3bd8e9
2011-06-20 11:15:06 +00:00
dan
c5f21892a8 Avoid loading doclists for infrequent terms that are part of phrases twice.
FossilOrigin-Name: 8f939723f742329cedba8930f71dff42004f3d0d
2011-06-17 17:37:31 +00:00
dan
10fc4d8c45 Add a missing declaration to fts3Int.h.
FossilOrigin-Name: 3bfd4466f50711eb71d1a13231025ff4e1e76246
2011-06-17 16:04:39 +00:00
dan
d4d21fea8e Fix a problem with NEAR queries executed inside a transaction that writes the FTS table.
FossilOrigin-Name: 051c756c367837908f6691c0a36108e088c94f99
2011-06-16 16:06:05 +00:00
drh
6b96771b82 Changes to #ifdefs so that the build goes correctly if the only FTS macro
defined is SQLITE_ENABLE_FTS4.

FossilOrigin-Name: a0b43a320e6491de7070966ed7c3ec55fd660a85
2011-06-16 00:54:45 +00:00
drh
bf4bc8c254 Fix so that the TCL test harness works even if SQLITE_ENABLE_FTS is omitted.
FossilOrigin-Name: 63ebcb52a1909aca80f2fef3e982f8fb5929b73b
2011-06-15 13:02:21 +00:00
drh
1aa4f3e529 Fix a couple of compiler warnings.
FossilOrigin-Name: 3899f3b95ed50773a72d907b39b451fefce69c9e
2011-06-15 12:43:36 +00:00
dan
376d1e5c4f Add an interface to better test incremental loading of doclists by FTS4. Also some tests for this and term prefix queries.
FossilOrigin-Name: 7a3813138d1a5c5d99f4756c79998831d779774f
2011-06-15 08:30:29 +00:00
dan
2cf1a1de4b Fix another bug caused by NEAR/matchinfo/order=DESC interaction.
FossilOrigin-Name: 04907fbadeb743c95cc9f3529e63ef388684799f
2011-06-14 09:00:27 +00:00
dan
c72f9d98cb Merge recent trunk changes into fts3-prefix-search branch.
FossilOrigin-Name: 135ce30f62ebd6a1b239c18dbbd9c926ea507db4
2011-06-14 07:22:30 +00:00
dan
806cbfc214 Remove unused parameters from internal fts3 function.
FossilOrigin-Name: 06de3f2cbc27cdfd9f83218c9ea576f74f60d07b
2011-06-14 07:14:43 +00:00
dan
2f77934385 Add tests for deferred tokens to fts3auto.test. Fix a problem with OR queries and deferred tokens.
FossilOrigin-Name: b9fb69e55bb05a8819688ee63987f2a05c33d59b
2011-06-13 17:00:12 +00:00
dan
99ebad90e3 Fix a bug exposed by combining matchinfo(), NEAR and "ORDER BY rowid DESC".
FossilOrigin-Name: 5f6b87f420f21749aa7c72e020c50aca74890086
2011-06-13 09:11:01 +00:00
dan
786b068967 Fix problems to do with using both OR and NEAR operators in a single expression.
FossilOrigin-Name: 4e8dd19eef04777d800977faf1859a405e396f30
2011-06-09 10:48:02 +00:00
dan
abf2545ed9 Fix various issues to do with deferred tokens, NEAR expressions and matchinfo().
FossilOrigin-Name: 3972a787df5ec253b99b148385655e7b68d851fa
2011-06-08 18:39:07 +00:00
dan
3eabcf5f46 Have NEAR queries use incremental merging. Fix issues surrounding the deferred token optimization.
FossilOrigin-Name: 9d10a6846b12a9cc8fd4fdc3affd931a27218b5a
2011-06-07 18:35:45 +00:00
drh
ebcdc73f53 Merge the latest trunk changes into the fts3-prefix-search branch.
FossilOrigin-Name: 567dd84359218245d4e6887547e2a48881f2c8e0
2011-06-06 18:14:25 +00:00
dan
5289b01524 Modify fts3rnd.test to run tests for both "ORDER BY docid ASC" and "ORDER BY docid DESC" with both order=ASC and order=DESC FTS tables. Fixes for some bugs found.
FossilOrigin-Name: 89f2f482e077241ac29a58eadf44a72a9c01f98c
2011-06-06 14:51:50 +00:00
dan
9aab071780 Clean up the code for processing FTS4 options a bit.
FossilOrigin-Name: 0425138a2365d23b07d88fda2b1f458f112f389d
2011-06-06 06:55:38 +00:00
dan
76e04431ef Remove some unreachable code.
FossilOrigin-Name: 650e1a79eda5a2134a1fbd305ab1f205a57c0892
2011-06-04 20:13:24 +00:00
dan
b46ee91729 Allow the "order=DESC" and "order=ASC" parameters in FTS4 "CREATE VIRTUAL TABLE" statements. Tables created with "order=DESC" store all doclists in descending order, which allows optimizations normally applied to "ORDER BY docid ASC" queries to be used with "ORDER BY docid DESC" queries instead.
FossilOrigin-Name: f6a0193f5a32603eb48bddc6297042dbd2ffe96e
2011-06-04 20:04:35 +00:00
dan
126ba6c0ac FTS changes: Remove unreachable code. Fix bugs. When processing a large doclist incrementally, read from disk incrementally too.
FossilOrigin-Name: a4c7e2820824e82580730c36f85aede2efa66754
2011-06-03 18:00:19 +00:00
dan
e414854800 Changes to improve performance and support LIMIT clauses on fts3 tables. This branch is unstable for now.
FossilOrigin-Name: 28149a7882a1e9dfe4a75ec5b91d176ebe6284e9
2011-06-02 19:57:24 +00:00
dan
382874fc5c Minor changes made while planning a larger change.
FossilOrigin-Name: 84097a4c759b1d65890af885f137d3cb16eef584
2011-05-28 15:57:40 +00:00
drh
7ee4fdd7ba Fix some minor and harmless compiler warnings.
FossilOrigin-Name: a4755e7088c3cc7c5ea191ce37f3950472f523ec
2011-05-25 23:18:02 +00:00
dan
98b08e71f2 If a prefix index of size N is not present, use a prefix index of size N+1 along with the terms index for queries for prefixes of length N.
FossilOrigin-Name: cc83991caae7c7d647432d5711b6cd80228c3002
2011-05-25 19:17:32 +00:00