Commit Graph

3346 Commits

Author SHA1 Message Date
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
drh
aa29c13579 Automatically register the FTS module if it is compiled into the build. (CVS 3384)
FossilOrigin-Name: 8a96bdb72439c0b337cbaa2d07897d0896ea3024
2006-09-02 13:58:06 +00:00
drh
37b9056ad8 Construct the .def files before calling dllwrap to build the .dll files.
Ticket #1951. (CVS 3383)

FossilOrigin-Name: e6e49a3811d4b26518026cc1692c654e8edbf741
2006-09-02 13:22:28 +00:00
adamd
9eb3997b02 Miscellaneous restructuring and cleanup based on suggestions from shess. (CVS 3382)
FossilOrigin-Name: e98b0cf292f6dc9deb6ae9b773c52b16867f7556
2006-09-02 00:23:01 +00:00
drh
3957781b1f Automatically compute the sqlite3.def and tclsqlite3.def files when
building windows DLLs.  This will (hopefully) keep the .def files in
perfect synchronization with the DLLs.  Ticket #1951. (CVS 3381)

FossilOrigin-Name: 1f6d79266a7f8d0e909e47d9858557e3f95407db
2006-09-01 17:06:20 +00:00
drh
9645d8d4b3 Remove use of the "clock" command in the test suite so that the tests
will run in Tcl8.5.  Ticket #1445. (CVS 3380)

FossilOrigin-Name: bedbac54db173ceb74bd78acd021209f28aa30a8
2006-09-01 15:49:05 +00:00
shess
b2f4d0173a Make fts1.c not rely on nul-terminated strings. Mostly a matter of
making sure we always pass around ptr/len, but there were a few places
where we actually relied on nul-termination.

An earlier change had additionally changed appropriate
sqlite3_bind_text() calls to sqlite3_bind_blob().  I've found that
this changes what's actually stored in the database, so backed those
changes out.  Also (and this is weird), I found that I could no longer
do straight-forward = queries against %_term.term at a command-line. (CVS 3379)

FossilOrigin-Name: 5844db1aa9c23a005c88104b084f68afb21891c7
2006-09-01 00:33:44 +00:00
shess
c0beb14f23 Make tokenizer not rely on nul-terminated text. Instead of using
strcspn() and a nul-terminated delimiter list, I just flagged
delimiters in an array and wrote things inline.  Submitting this for
review separately because it's pretty standalone. (CVS 3378)

FossilOrigin-Name: 2631ceaeefaca3aa837e3b439399f13c51456914
2006-09-01 00:05:17 +00:00
drh
5db455e7b5 Refactor the FTS1 module so that its name is "fts1" instead of "fulltext",
so that all symbols with external linkage begin with "sqlite3Fts1", and
so that all filenames begin with "fts1". (CVS 3377)

FossilOrigin-Name: e1891f0dc58e5498a8845d8b9b5b092d7f9c7003
2006-08-31 15:07:14 +00:00
shess
2b85d5f46e Just don't run tolower() on hi-bit characters. This shouldn't cause
us to break any UTF-8 code points, unless they were already broken in
the input. (CVS 3376)

FossilOrigin-Name: 6c77c2d5e15e9d3efed3e274bc93cd5a4868f574
2006-08-30 21:40:30 +00:00
drh
6fb1d6492e Bug fix: Get INSERT INTO ... SELECT working when the target is a virtual
table. (CVS 3375)

FossilOrigin-Name: 7cdc41e748c2d8f9e3d85c07143b8bc343bf2426
2006-08-29 18:46:14 +00:00
drh
16ed8a64f6 Bug fix: Get INSERT INTO ... SELECT working when the target is a virtual
table. (CVS 3374)

FossilOrigin-Name: 7912485705c96e365a942932bb12d5b9113c9885
2006-08-29 18:46:14 +00:00
drh
e07b862e71 Document the fact that SQLite allows NULL values in PRIMARY KEY columns
and the fact that we might design to change this in the future.
Ticket #518. (CVS 3373)

FossilOrigin-Name: b99d845ef4776595022c6fb855e582cfe6ef2f9f
2006-08-29 13:08:37 +00:00
drh
80e8be9337 Improved built-in help in the command-line shell. Enable the
fulltext search extension in the TCL interface. (CVS 3372)

FossilOrigin-Name: 9763b4bfd5f0579f9fb821899ffa8bfe650054d7
2006-08-29 12:04:19 +00:00
shess
c9e0a9057e Make static some symbols which shouldn't have been exported. (CVS 3371)
FossilOrigin-Name: 58006e38af760b53cf72bf127d7c7b8a619a1282
2006-08-28 23:46:01 +00:00
shess
4f4897e80d Make hi-bit characters delimiters. This is a stopgap until the tokenizer
and fulltext.c recognize UTF-8 correctly. (CVS 3370)

FossilOrigin-Name: ca850d3d80f67672172d11392fcdf60bfbb94c02
2006-08-28 20:08:56 +00:00
drh
aa5ac05b5f Add sqlite3_malloc and sqlite3_realloc to the sqlite3.def file. Ticket #1943. (CVS 3369)
FossilOrigin-Name: 4a74838eac5b939058c8aebef30113c5bdb354e5
2006-08-27 14:10:39 +00:00
drh
147d0ccc15 Add support for INSERT INTO ... DEFAULT VALUES. Tickets #299, #1940. (CVS 3368)
FossilOrigin-Name: bc84cb54b0df09738fd90e48820dc3cdfa7828c2
2006-08-25 23:42:53 +00:00
shess
0de250e46f Fix gcc gripe about parens in a ||/&& in mergePosList().
Drop unused pBlob/nBlob in index_insert_term().
Fix NULL deref in an assertion in docListUpdate() delete case.
Minor code tightening in docListUpdate(). (CVS 3367)

FossilOrigin-Name: a6fcf9101a831bf5f129c6045eabf30376d365dc
2006-08-25 19:20:26 +00:00
drh
b8b1421963 Documentation updates for the new SQLITE_FUNCTION authorization. (CVS 3366)
FossilOrigin-Name: e029637e54e190c89206725a99e1ee7db6c23804
2006-08-24 15:18:25 +00:00
drh
5169bbc6a3 Enhance the sqlite3_set_authorizer() callback so that it provides callbacks
on each SQL function that is invoked. (CVS 3365)

FossilOrigin-Name: 4547c81f7da29b1490c6eba8d9c333218c5cb88f
2006-08-24 14:59:45 +00:00
drh
882e8e4df2 Tcl interface does filename translation prior to calling sqlite3_open().
Ticket #1937. (CVS 3364)

FossilOrigin-Name: 5696e0cb771ea62df6f91cb03dfc428af1441e9e
2006-08-24 02:42:27 +00:00
adamd
1717edd157 A first implementation of a full-text search module for SQLite. (CVS 3363)
FossilOrigin-Name: b0d8e0d314d6f77b7d4b5dd00c694a1323f7a8e4
2006-08-23 23:58:50 +00:00
drh
1409be69aa Add the new experimental sqlite3_auto_extension() API. (CVS 3362)
FossilOrigin-Name: a85fc877eb8c92bbb79ac9b7fa91fb362f37cdf7
2006-08-23 20:07:20 +00:00
shess
ad42c3a352 Add argc as a default global to match standard tcl environment. (CVS 3361)
FossilOrigin-Name: 533154099c9fe1238705eea03aba388dd71dc35e
2006-08-22 23:53:46 +00:00