Add some missing comments to fts3 files. No source code changes.

FossilOrigin-Name: b6402b2065b844acb3f1bb94ad964568706bcb86
This commit is contained in:
dan 2009-11-21 03:03:21 +00:00
parent bfcb4adaf8
commit 7eee299243
4 changed files with 55 additions and 27 deletions

View File

@ -1260,10 +1260,20 @@ static int fts3PoslistNearMerge(
#define MERGE_NEAR 8 /* P + P -> D */
#define MERGE_POS_NEAR 9 /* P + P -> P */
/*
** Merge the two doclists passed in buffer a1 (size n1 bytes) and a2
** (size n2 bytes). The output is written to pre-allocated buffer aBuffer,
** which is guaranteed to be large enough to hold the results. The number
** of bytes written to aBuffer is stored in *pnBuffer before returning.
**
** If successful, SQLITE_OK is returned. Otherwise, if a malloc error
** occurs while allocating a temporary buffer as part of the merge operation,
** SQLITE_NOMEM is returned.
*/
static int fts3DoclistMerge(
int mergetype, /* One of the MERGE_XXX constants */
int nParam1,
int nParam2,
int nParam1, /* Used by MERGE_NEAR and MERGE_POS_NEAR */
int nParam2, /* Used by MERGE_NEAR and MERGE_POS_NEAR */
char *aBuffer, /* Pre-allocated output buffer */
int *pnBuffer, /* OUT: Bytes written to aBuffer */
char *a1, /* Buffer containing first doclist */
@ -1425,6 +1435,11 @@ struct TermSelect {
int nOutput; /* Size of output in bytes */
};
/*
** This function is used as the sqlite3Fts3SegReaderIterate() callback when
** querying the full-text index for a doclist associated with a term or
** term-prefix.
*/
static int fts3TermSelectCb(
Fts3Table *p, /* Virtual table object */
void *pContext, /* Pointer to TermSelect structure */
@ -1584,9 +1599,6 @@ finished:
/*
** Return a DocList corresponding to the phrase *pPhrase.
**
** The resulting DL_DOCIDS doclist is stored in pResult, which is
** overwritten.
*/
static int fts3PhraseSelect(
Fts3Table *p, /* Virtual table handle */
@ -1647,8 +1659,8 @@ static int fts3PhraseSelect(
}
/*
** Evaluate the full-text expression pExpr against fts3 table pTab. Write
** the results into pRes.
** Evaluate the full-text expression pExpr against fts3 table pTab. Store
** the resulting doclist in *paOut and *pnOut.
*/
static int evalFts3Expr(
Fts3Table *p, /* Virtual table handle */
@ -1835,7 +1847,8 @@ static int fts3EofMethod(sqlite3_vtab_cursor *pCursor){
return ((Fts3Cursor *)pCursor)->isEof;
}
/* This is the xColumn method of the virtual table. The SQLite
/*
** This is the xColumn method of the virtual table. The SQLite
** core calls this method during a query when it needs the value
** of a column from the virtual table. This method needs to use
** one of the sqlite3_result_*() routines to store the requested

View File

@ -1722,6 +1722,31 @@ static int fts3MergeCallback(
return fts3SegWriterAdd(p, ppW, 1, zTerm, nTerm, aDoclist, nDoclist);
}
/*
** This function is used to iterate through a contiguous set of terms
** stored in the full-text index. It merges data contained in one or
** more segments to support this.
**
** The second argument is passed an array of pointers to SegReader objects
** allocated with sqlite3Fts3SegReaderNew(). This function merges the range
** of terms selected by each SegReader. If a single term is present in
** more than one segment, the associated doclists are merged. For each
** term and (possibly merged) doclist in the merged range, the callback
** function xFunc is invoked with its arguments set as follows.
**
** arg 0: Copy of 'p' parameter passed to this function
** arg 1: Copy of 'pContext' parameter passed to this function
** arg 2: Pointer to buffer containing term
** arg 3: Size of arg 2 buffer in bytes
** arg 4: Pointer to buffer containing doclist
** arg 5: Size of arg 2 buffer in bytes
**
** The 4th argument to this function is a pointer to a structure of type
** Fts3SegFilter, defined in fts3Int.h. The contents of this structure
** further restrict the range of terms that callbacks are made for and
** modify the behaviour of this function. See comments above structure
** definition for details.
*/
int sqlite3Fts3SegReaderIterate(
Fts3Table *p, /* Virtual table handle */
Fts3SegReader **apSegment, /* Array of Fts3SegReader objects */

View File

@ -1,8 +1,5 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
C Fix\sa\sbug\sin\stransaction\srollback\sduring\sbackup\swhen\sthe\sCODEC\sis\senabled\nthat\scan\sresult\sin\sa\scorrupt\sbackup\sfile.\s\sThis\sis\sonly\sa\sproblem\swhen\nSQLITE_HAS_CODEC\sis\sdefined.
D 2009-11-21T01:33:51
C Add\ssome\smissing\scomments\sto\sfts3\sfiles.\sNo\ssource\scode\schanges.
D 2009-11-21T03:03:22
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 7f6c6aa7feeeb5e26e01b344161d9aa1b5d64177
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -59,7 +56,7 @@ F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
F ext/fts3/fts3.c 4990e02c64ea19515b06b1300340bdf9a6f0eaa6
F ext/fts3/fts3.c 6396a59d3fbe8e2ef0b6afe5d5a1f575943f3d22
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
F ext/fts3/fts3Int.h 74b21db1c4479c220e803ecf45a78de3b5ac9480
F ext/fts3/fts3_expr.c bdf11f3602f62f36f0e42823680bf22033dae0de
@ -71,7 +68,7 @@ F ext/fts3/fts3_snippet.c 082f2906deaaa2656f19b88834e89d099352af6e
F ext/fts3/fts3_tokenizer.c 36f78d1a43a29b0feaec1ced6da9e56b9c653d1f
F ext/fts3/fts3_tokenizer.h 7ff73caa3327589bf6550f60d93ebdd1f6a0fb5c
F ext/fts3/fts3_tokenizer1.c 0a5bcc579f35de5d24a9345d7908dc25ae403ee7
F ext/fts3/fts3_write.c 69e6fb5a387aa7eb1f9d89e5bce35d21b879602e
F ext/fts3/fts3_write.c ac1c03d0df946031062324ce89d8e65cb48031b5
F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100
F ext/icu/README.txt 3b130aa66e7a681136f6add198b076a2f90d1e33
F ext/icu/icu.c 12e763d288d23b5a49de37caa30737b971a2f1e2
@ -775,14 +772,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P 2f42f91fe65b0b21671936013df08037091f0cc6
R f31a7b27b605d7a26aa89eb1b256db48
U drh
Z 06dbdf8ffebc750a1009c3d1910ae035
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFLB0OCoxKgR168RlERAkJZAJ9mG+901dHWGrJ3Ve4ChzrzuDAunwCfSxd3
dv/JktoI/j9ez9dQLHX5Ffs=
=dGQd
-----END PGP SIGNATURE-----
P f3398fc4db765e2c63d425d570c4469a84b3328c
R 7d091a5cc3fdeb10834447e4b7fead9f
U dan
Z 2dfed66936aa5f392e1458f1e1c469a6

View File

@ -1 +1 @@
f3398fc4db765e2c63d425d570c4469a84b3328c
b6402b2065b844acb3f1bb94ad964568706bcb86