Commit Graph

3370 Commits

Author SHA1 Message Date
adamd
adf52ce14b Implemented UPDATE for full-text tables.
We handle an UPDATE to a row by performing an UPDATE on the content table and by building new position lists for each term which appears in either the old or new versions of the row.  We write these position lists all at once; this is presumably more efficient than a delete followed by an insert (which would first write empty position lists, then new position lists). (CVS 3434)

FossilOrigin-Name: 757fa22400b363212b4d5f648bdc9fcbd9a7f152
2006-09-22 00:06:39 +00:00
adamd
f40a504164 When gathering a doclist for querying, don't discard empty position lists until the end; this allows empty position lists to override non-empty lists encountered later in the gathering process. This fixes #1982, which was caused by the fact that for all-column queries we weren't discarding empty position lists at all. (CVS 3433)
FossilOrigin-Name: 111ca616713dd89b5d1e114de29c83256731c482
2006-09-21 20:56:52 +00:00
drh
154d4b2446 Be more aggressive with the SQLITE_OMIT_VACUUM macro. Saves about 150
bytes of code space. (CVS 3432)

FossilOrigin-Name: 7e618db4579d752cc6d775c664c93e141217948f
2006-09-21 11:02:16 +00:00
drh
8b62817797 Implementation of the snippet() function for FTS1. Includes a few
simple test cases but more testing is needed. (CVS 3431)

FossilOrigin-Name: c7ee60d00976efab25a830e7416538010c734129
2006-09-21 02:03:08 +00:00
adamd
d47522807e Fixed a build problem in sqlite3_extension_init(). (CVS 3430)
FossilOrigin-Name: bb2e1871cb10b470f96c793bb137c043ef30e1da
2006-09-18 21:14:40 +00:00
drh
c1daee8574 Convert all names to lower case before sending them to the xFindFunction
method of a virtual table.  In FTS1, use strcmp instead of strcasecmp.
Ticket #1981. (CVS 3429)

FossilOrigin-Name: cd4e1de896ef715c444071f758b74dbb607e0572
2006-09-18 20:24:02 +00:00
drh
a70034de7c Convert all names to lower case before sending them to the xFindFunction
method of a virtual table.  In FTS1, use strcmp instead of strcasecmp.
Ticket #1981. (CVS 3428)

FossilOrigin-Name: efa8fb32a596c7232bb1754b3231e4f2421df75b
2006-09-18 20:24:02 +00:00
drh
b08249ced3 Modify FTS1 so that the "magic" column has the same name as the virtual
table.  Offsets are retrieved using a special "offsets" function whose
first argument is the magic column.  Snippets will ultimately be retrieved
in the same way. (CVS 3427)

FossilOrigin-Name: 5e35dc1ffadfe7fa47673d052501ee79903eead9
2006-09-18 02:12:47 +00:00
drh
b7481e70c5 Add the sqlite3_overload_function() API - part of the virtual table
interface. (CVS 3426)

FossilOrigin-Name: aa7728f9f5b80dbb1b3db124f84b9166bf72bdd3
2006-09-16 21:45:14 +00:00
drh
572d11dc8f Add documentation for the sqlite3_extended_result_codes() API. (CVS 3425)
FossilOrigin-Name: a6b3f6bed209dc27d36cd4e159159f73266e9911
2006-09-15 16:58:48 +00:00
drh
ae2f2048df Fix an initialization problem in FTS1. Ticket #1977. (CVS 3424)
FossilOrigin-Name: 5a18dd88498ca35ca1333d88c4635868d0b61073
2006-09-15 16:08:59 +00:00
drh
e49f982792 Bug fix and better testing of the extended result codes. (CVS 3423)
FossilOrigin-Name: 78ae74db1cbf605cd421e7ea321e879d3638968e
2006-09-15 12:29:16 +00:00
drh
4ac285a1c2 Add support for extended result codes - additional result information
carried in the higher bits of the integer return codes.  This must be
enabled using the sqlite3_extended_result_code() API.  Only a few extra
result codes are currently defined. (CVS 3422)

FossilOrigin-Name: ba579ddc4361fc6e8ea66f9385770d70dfe94751
2006-09-15 07:28:50 +00:00
drh
8abc58e33b New FTS1 test data based on enron emails. (CVS 3421)
FossilOrigin-Name: 01651a32c6e67c4ac2cd23f1da7f3cc3adad1b33
2006-09-14 21:08:54 +00:00
drh
dddaf9ff86 Remove file containing real email addresses. Ticket #1978. (CVS 3420)
FossilOrigin-Name: 373a575f745dc2002090328f30539bbfef3119d5
2006-09-14 18:25:28 +00:00
adamd
4fc9308373 Minor build fixes. (CVS 3419)
FossilOrigin-Name: 3564b07c40ab4563482a9aa36850757963f44238
2006-09-14 16:57:19 +00:00
drh
5968593b51 Enhanced I/O error simulation. (CVS 3418)
FossilOrigin-Name: 86931854fc5a63571719639d9a23b1d6614a6153
2006-09-14 13:47:11 +00:00
drh
f800e3e63a The FTS1 tables have a new automatic column named "offset" that returns
a string containing byte offset information for all matching terms.
Also added a large test case based on SQLite mailing list entries. (CVS 3417)

FossilOrigin-Name: f25cfa1aec0e4c1fe07176039a1b7f4e6a2c66ec
2006-09-14 01:17:30 +00:00
drh
0b9a594ae1 Modify the ".dump" command in the command-line shell so that it works
with virtual tables. (CVS 3416)

FossilOrigin-Name: afd40184b752f641b423ceffac2476f2cfbdfd31
2006-09-13 20:22:02 +00:00
drh
235a818e61 Remove unused malloc failure test. (Ticket #1976)
Also include fixes for other problems
discovered while investigating ticket #1976. (CVS 3415)

FossilOrigin-Name: f4ab546b2e8105422fb1baa2b86e688b5d19f20e
2006-09-13 19:21:28 +00:00
drh
8f116cc15c In FTS1: Retain the Query structure as part of the cursor. It will be used
laster as part of snippet generation. (CVS 3414)

FossilOrigin-Name: 607d928ce91f3efa9c7019fc789a9cd3c41cfc92
2006-09-13 19:18:29 +00:00
shess
c48f2a10aa Earlier refactoring changed name in fts1.c but not fts1.h. (CVS 3413)
FossilOrigin-Name: d4edb8035c8abbdb301893557934dd644ef3c950
2006-09-13 18:40:25 +00:00
drh
1de6154d39 Minor code cleanup in FTS1. (CVS 3412)
FossilOrigin-Name: fca592816767de397fbaf22cccdf1028fc5dfc91
2006-09-13 17:17:48 +00:00
drh
a3baa963bc Implementation of "column:" modifiers in FTS1 queries. (CVS 3411)
FossilOrigin-Name: 820634f71e3a3499994f82b56b784d22a7e3cdcf
2006-09-13 16:02:43 +00:00
drh
cbaac514bc Module spec parser enhancements for FTS1. Now able to cope with column
names in the spec that are SQL keywords or have special characters, etc.
Also added support for additional control lines.  Column names can be
followed by a type specifier (which is ignored.) (CVS 3410)

FossilOrigin-Name: adb780e0dc8bc7dcd1102efbfa4bc17eefdf968e
2006-09-13 15:20:13 +00:00
drh
a6be0dc938 Fix the FTS1 test cases and add new tests. Comments added to the FTS1 code. (CVS 3409)
FossilOrigin-Name: 528036c828c93c78ca879bf89a52131b72e24067
2006-09-13 12:36:08 +00:00
adamd
4f1a424e72 Allow virtual tables to contain multiple full-text-indexed columns. Added a magic column "_all" which can be used for querying all columns in a table at once.
For now, each posting list stores position/offset information for multiple columns.  We may implement separate posting lists for separate columns at some future point. (CVS 3408)

FossilOrigin-Name: 366a70b086c817bddecd83053472ec76ef20f309
2006-09-13 02:18:20 +00:00
adamd
341d60838c Answer queries for a particular rowid in a full-text table by looking up
that rowid directly rather than by performing a table scan. (CVS 3407)

FossilOrigin-Name: 877d5558b1a6f65201b1825336935b146583bffa
2006-09-12 23:36:45 +00:00
drh
fdd48a76a6 Add support for IF EXISTS on CREATE/DROP TRIGGER/VIEW. Ticket #1899. (CVS 3406)
FossilOrigin-Name: e4fe736cfbbdc081581911a01690576034877b72
2006-09-11 23:45:48 +00:00
shess
4240240f12 Re-use deleted rowids for new segments. This has a somewhat
surprising impact on performance, I believe because it keeps the index
smaller (by keeping rowids smaller), and also because it improves
locality in the table (deleting a row means we've already touched the
pages leading to that rowid). (CVS 3405)

FossilOrigin-Name: 2f5f6290c9ef99c7b060aecc4d996c976c50c9d7
2006-09-11 21:39:21 +00:00
drh
66b224cbb0 Get VACUUM working with virtual tables. (CVS 3404)
FossilOrigin-Name: d5ffef3870f06d2dd744ce9470d3c0e68062e804
2006-09-11 11:13:26 +00:00
drh
e410296021 Add a rudimentary tokenizer and parser to FTS1 for parsing the module
arguments during initialization.   Recognized arguments include a
tokenizer selector and a list of virtual table columns. (CVS 3403)

FossilOrigin-Name: 227dc3feb537e6efd5b0c1d2dad40193db07d5aa
2006-09-11 00:34:22 +00:00
drh
4ca8aac2b4 Add pzErr parameters to the xConnect and xCreate methods of virtual tables
in order to provide better error reporting.  This is an interface change
for virtual tables.  Prior virtual table implementations will need to be
modified and recompiled. (CVS 3402)

FossilOrigin-Name: f44b8bae97b6872524580009c96d07391578c388
2006-09-10 17:31:58 +00:00
drh
fe1368ee08 Add a new zErrMsg field to the sqlite3_vtab structure to support returning
error messages from virtual table constructors.  This change means that
virtual table implementations compiled as loadable extensions for version
3.3.7 will need to be recompile for version 3.3.8 and will not be usable
by both versions at one.  The virtual table mechanism is still considered
experimental so we feel justified in breaking backwards compatibility
in this way.  Additional interface changes might occurs in the future. (CVS 3401)

FossilOrigin-Name: 36693a5cb72b4363010f9ab0866e1f7865f65275
2006-09-10 17:08:29 +00:00
drh
a2a9d18869 Add some simple test cases for the OR and NOT logic of the fts1 module.
Fix lots of bugs discovered while developing these test cases. (CVS 3400)

FossilOrigin-Name: 70bcff024b44d1b40afac6eba959fa89fb993147
2006-09-10 03:34:06 +00:00
drh
a7e98f2a54 Add support for OR and NOT terms in fts1. (CVS 3399)
FossilOrigin-Name: ae50265791d1a7500aa3c405a78a9bca8ff0cc08
2006-09-09 23:11:51 +00:00
shess
fb6794360d Write doclists using a segmented technique to amortize costs better.
New items for a term are merged with the term's segment 0 doclist,
until that doclist exceeds CHUNK_MAX.  Then the segments are merged in
exponential fashion, so that segment 1 contains approximately
2*CHUNK_MAX data, segment 2 4*CHUNK_MAX, and so on. (CVS 3398)

FossilOrigin-Name: b6b93a3325d3e728ca36255c0ff6e1f63e03b0ac
2006-09-08 17:00:17 +00:00
drh
8759576540 Add HAVE_GMTIME_R and HAVE_LOCALTIME_R flags and use them if defined.
Unable to modify the configure script to test for gmtime_r and
localtime_r, however, because on my SuSE 10.2 system, autoconf generates
a configure script that does not work.  Bummer.  Ticket #1906 (CVS 3397)

FossilOrigin-Name: 862302eaae7bdad6f1b6431f08439c4ce7e0e4bb
2006-09-08 12:49:43 +00:00
drh
f11c34df74 Bug fix in date/time computations. Ticket #1964.
Some unrelated comment typos are also fixed and got accidently
checked in at the same time. (CVS 3396)

FossilOrigin-Name: c81eaa0dc9a327d222e066076c4a2da5e69d8c21
2006-09-08 12:27:36 +00:00
drh
b3556f3d71 Improvements to the documentation of the return codes for sqlite3_step().
Tickets #1633, #1366, #1178, #906, and probably others too. (CVS 3395)

FossilOrigin-Name: 508248e783dc1e3da3695b28467ca3b79629e582
2006-09-08 11:56:30 +00:00
adamd
2e8464afdb Include io.h on Windows to quell a build warning about access() having no prototype. (CVS 3394)
FossilOrigin-Name: b3eb1732bd529b14bef1872171a3c6429e209d31
2006-09-06 21:39:40 +00:00
adamd
338565ad4b A minor change to fts1.c to fix broken build. (CVS 3393)
FossilOrigin-Name: 55a03b96251515a4817a0eefb197219a460640e7
2006-09-05 18:21:31 +00:00
drh
b2b4996280 Fix a bug in the new misc6.test script. Fix error messages when not
compiled with memory debugging enabled.  Ticket #1957. (CVS 3392)

FossilOrigin-Name: 9fb92024bf5058bdc32066a0d07b93da575779fa
2006-09-04 18:54:14 +00:00
drh
f0313813ec Make sure strings returned by sqlite3_value_text() and sqlite3_value_text16()
are always '\000'-terminated. (CVS 3391)

FossilOrigin-Name: 2c63588b45f4e1ab9b9f1b72c901f3800433424a
2006-09-04 15:53:53 +00:00
drh
f80ad49f72 Fix bugs in test scripts so that fulltest will pass. (CVS 3390)
FossilOrigin-Name: 367bd8376f323beb3148eab86ada1a3cb379ba3b
2006-09-02 22:14:59 +00:00
drh
79dc6691de Changes to the Makefile.in so that MinGW users can build a DLL. Ticket #1955. (CVS 3389)
FossilOrigin-Name: 7279ddd08444d54712f738d997c5d11f6af064c1
2006-09-02 22:14:11 +00:00
drh
fb52cc95ff Add a TRACE macro to the FTS1 module for troubleshooting. Turned off by
default. (CVS 3388)

FossilOrigin-Name: d4923e98c66ae03d899f633e5e309471f5695abb
2006-09-02 20:58:25 +00:00
drh
189d4afaaf Do not call the xDisconnect method on a virtual table while xUpdate is
pending.  Instead, defer the xDisconnect until after xUpdate completes. (CVS 3387)

FossilOrigin-Name: 61148f4c36255c4ed3552f888fa75252b300589d
2006-09-02 20:57:52 +00:00
drh
80788d8b65 Test for busted TCL builds that do not support 64-bit integers and print
a warning message to users that test failures may be a result of the bad
TCL build and not some problem with SQLite.  Ticket #1953. (CVS 3386)

FossilOrigin-Name: ca864ee913ea5ae88761e617bcac300ffa339369
2006-09-02 14:50:23 +00:00
drh
7c2d87cd71 Convert static variables into constants in the FTS module. (CVS 3385)
FossilOrigin-Name: 098cbafcd6dcf57142b0417e796d27ffddcc0920
2006-09-02 14:16:59 +00:00