1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Changes to the TCL interface header to allow it to be compiled independently

from the amalgamation.

FossilOrigin-Name: 58113932d93926b4aa037a7487105a55f883cd0a
This commit is contained in:
drh
2009-12-01 13:57:48 +00:00
parent 3acb07d6c3
commit 65e8c82e1a
6 changed files with 55 additions and 30 deletions

View File

@@ -474,13 +474,6 @@ static void fts3GetDeltaVarint2(char **pp, char *pEnd, sqlite3_int64 *pVal){
} }
/*
** The Fts3Cursor.eType member is always set to one of the following.
*/
#define FTS3_FULLSCAN_SEARCH 0 /* Linear scan of %_content table */
#define FTS3_DOCID_SEARCH 1 /* Lookup by rowid on %_content table */
#define FTS3_FULLTEXT_SEARCH 2 /* Full-text index search */
static Fts3Table *cursor_vtab(Fts3Cursor *c){ static Fts3Table *cursor_vtab(Fts3Cursor *c){
return (Fts3Table *) c->base.pVtab; return (Fts3Table *) c->base.pVtab;
} }
@@ -1827,7 +1820,7 @@ static int fts3FilterMethod(
sqlite3_free(zSql); sqlite3_free(zSql);
} }
if( rc!=SQLITE_OK ) return rc; if( rc!=SQLITE_OK ) return rc;
pCsr->eType = idxNum; pCsr->eSearch = idxNum;
if( idxNum==FTS3_DOCID_SEARCH ){ if( idxNum==FTS3_DOCID_SEARCH ){
rc = sqlite3_bind_value(pCsr->pStmt, 1, apVal[0]); rc = sqlite3_bind_value(pCsr->pStmt, 1, apVal[0]);

View File

@@ -81,7 +81,7 @@ struct Fts3Table {
sqlite3 *db; /* The database connection */ sqlite3 *db; /* The database connection */
const char *zDb; /* logical database name */ const char *zDb; /* logical database name */
const char *zName; /* virtual table name */ const char *zName; /* virtual table name */
int nColumn; /* number of columns in virtual table */ int nColumn; /* number of named columns in virtual table */
char **azColumn; /* column names. malloced */ char **azColumn; /* column names. malloced */
sqlite3_tokenizer *pTokenizer; /* tokenizer for inserts and queries */ sqlite3_tokenizer *pTokenizer; /* tokenizer for inserts and queries */
@@ -120,10 +120,10 @@ struct Fts3Table {
*/ */
struct Fts3Cursor { struct Fts3Cursor {
sqlite3_vtab_cursor base; /* Base class used by SQLite core */ sqlite3_vtab_cursor base; /* Base class used by SQLite core */
int eType; /* Search strategy (see below) */ i16 eSearch; /* Search strategy (see below) */
u8 isEof; /* True if at End Of Results */
u8 isRequireSeek; /* True if must seek pStmt to %_content row */
sqlite3_stmt *pStmt; /* Prepared statement in use by the cursor */ sqlite3_stmt *pStmt; /* Prepared statement in use by the cursor */
int isEof; /* True if at End Of Results */
int isRequireSeek; /* True if must seek pStmt to %_content row */
Fts3Expr *pExpr; /* Parsed MATCH query string */ Fts3Expr *pExpr; /* Parsed MATCH query string */
sqlite3_int64 iPrevId; /* Previous id read from aDoclist */ sqlite3_int64 iPrevId; /* Previous id read from aDoclist */
char *pNextId; /* Pointer into the body of aDoclist */ char *pNextId; /* Pointer into the body of aDoclist */
@@ -131,6 +131,25 @@ struct Fts3Cursor {
int nDoclist; /* Size of buffer at aDoclist */ int nDoclist; /* Size of buffer at aDoclist */
}; };
/*
** The Fts3Cursor.eSearch member is always set to one of the following.
** Actualy, Fts3Cursor.eSearch can be greater than or equal to
** FTS3_FULLTEXT_SEARCH. If so, then Fts3Cursor.eSearch - 2 is the index
** of the column to be searched. For example, in
**
** CREATE VIRTUAL TABLE ex1 USING fts3(a,b,c,d);
** SELECT docid FROM ex1 WHERE b MATCH 'one two three';
**
** Because the LHS of the MATCH operator is 2nd column "b",
** Fts3Cursor.eSearch will be set to FTS3_FULLTEXT_SEARCH+1. (+0 for a,
** +1 for b, +2 for c, +3 for d.) If the LHS of MATCH were "ex1"
** indicating that all columns should be searched,
** then eSearch would be set to FTS3_FULLTEXT_SEARCH+4.
*/
#define FTS3_FULLSCAN_SEARCH 0 /* Linear scan of %_content table */
#define FTS3_DOCID_SEARCH 1 /* Lookup by rowid on %_content table */
#define FTS3_FULLTEXT_SEARCH 2 /* Full-text index search */
/* /*
** A "phrase" is a sequence of one or more tokens that must match in ** A "phrase" is a sequence of one or more tokens that must match in
** sequence. A single token is the base case and the most common case. ** sequence. A single token is the base case and the most common case.

View File

@@ -29,10 +29,10 @@ struct Snippet {
int nAlloc; /* Space allocated for aMatch[] */ int nAlloc; /* Space allocated for aMatch[] */
struct snippetMatch { /* One entry for each matching term */ struct snippetMatch { /* One entry for each matching term */
char snStatus; /* Status flag for use while constructing snippets */ char snStatus; /* Status flag for use while constructing snippets */
short int nByte; /* Number of bytes in the term */
short int iCol; /* The column that contains the match */ short int iCol; /* The column that contains the match */
short int iTerm; /* The index in Query.pTerms[] of the matching term */ short int iTerm; /* The index in Query.pTerms[] of the matching term */
int iToken; /* The index of the matching document token */ int iToken; /* The index of the matching document token */
short int nByte; /* Number of bytes in the term */
int iStart; /* The offset to the first character of the term */ int iStart; /* The offset to the first character of the term */
} *aMatch; /* Points to space obtained from malloc */ } *aMatch; /* Points to space obtained from malloc */
char *zOffset; /* Text rendering of aMatch[] */ char *zOffset; /* Text rendering of aMatch[] */
@@ -441,10 +441,12 @@ static int trimSnippetOffsets(
** If the offsets have already been computed, this routine is a no-op. ** If the offsets have already been computed, this routine is a no-op.
*/ */
static int snippetAllOffsets(Fts3Cursor *pCsr, Snippet **ppSnippet){ static int snippetAllOffsets(Fts3Cursor *pCsr, Snippet **ppSnippet){
Fts3Table *p = (Fts3Table *)pCsr->base.pVtab; Fts3Table *p = (Fts3Table *)pCsr->base.pVtab; /* The FTS3 virtual table */
int nColumn; int nColumn; /* Number of columns. Docid does count */
int iColumn, i; int iColumn; /* Index of of a column */
int iFirst, iLast; int i; /* Loop index */
int iFirst; /* First column to search */
int iLast; /* Last coumn to search */
int iTerm = 0; int iTerm = 0;
Snippet *pSnippet; Snippet *pSnippet;
int rc = SQLITE_OK; int rc = SQLITE_OK;
@@ -461,7 +463,7 @@ static int snippetAllOffsets(Fts3Cursor *pCsr, Snippet **ppSnippet){
memset(pSnippet, 0, sizeof(Snippet)); memset(pSnippet, 0, sizeof(Snippet));
nColumn = p->nColumn; nColumn = p->nColumn;
iColumn = (pCsr->eType - 2); iColumn = (pCsr->eSearch - 2);
if( iColumn<0 || iColumn>=nColumn ){ if( iColumn<0 || iColumn>=nColumn ){
/* Look for matches over all columns of the full-text index */ /* Look for matches over all columns of the full-text index */
iFirst = 0; iFirst = 0;

View File

@@ -1,5 +1,8 @@
C Open\sa\ssavepoint\swithin\sthe\sFTS3\soptimize()\sfunction. -----BEGIN PGP SIGNED MESSAGE-----
D 2009-12-01T13:48:14 Hash: SHA1
C Changes\sto\sthe\sTCL\sinterface\sheader\sto\sallow\sit\sto\sbe\scompiled\sindependently\nfrom\sthe\samalgamation.
D 2009-12-01T13:57:49
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3 F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -56,15 +59,15 @@ F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9 F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
F ext/fts3/fts3.c 8e966349c954cea27d8acf468d77c0d113c52449 F ext/fts3/fts3.c eca3828c5ef6efd4297c8b917d69ec11b9d223a9
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
F ext/fts3/fts3Int.h cc08454bc85cfe86d5205532178b0af5501eec9f F ext/fts3/fts3Int.h 58698ec42ac69a31bb0fcfcf6692fdbbde84d73b
F ext/fts3/fts3_expr.c bdf11f3602f62f36f0e42823680bf22033dae0de F ext/fts3/fts3_expr.c bdf11f3602f62f36f0e42823680bf22033dae0de
F ext/fts3/fts3_hash.c 29fba5a01e51c53e37040e53821e6b2cec18c8fb F ext/fts3/fts3_hash.c 29fba5a01e51c53e37040e53821e6b2cec18c8fb
F ext/fts3/fts3_hash.h 39524725425078bf9e814e9569c74a8e5a21b9fb F ext/fts3/fts3_hash.h 39524725425078bf9e814e9569c74a8e5a21b9fb
F ext/fts3/fts3_icu.c ac494aed69835008185299315403044664bda295 F ext/fts3/fts3_icu.c ac494aed69835008185299315403044664bda295
F ext/fts3/fts3_porter.c 4248815484f9c7e9d4f3c72c1149464485c08abe F ext/fts3/fts3_porter.c 4248815484f9c7e9d4f3c72c1149464485c08abe
F ext/fts3/fts3_snippet.c 39cf30a7916b2562867d52176e87b6d7de02aea0 F ext/fts3/fts3_snippet.c 84ba2fad73aa12628f1950aed74babbf3975e73a
F ext/fts3/fts3_tokenizer.c 36f78d1a43a29b0feaec1ced6da9e56b9c653d1f F ext/fts3/fts3_tokenizer.c 36f78d1a43a29b0feaec1ced6da9e56b9c653d1f
F ext/fts3/fts3_tokenizer.h 7ff73caa3327589bf6550f60d93ebdd1f6a0fb5c F ext/fts3/fts3_tokenizer.h 7ff73caa3327589bf6550f60d93ebdd1f6a0fb5c
F ext/fts3/fts3_tokenizer1.c 0a5bcc579f35de5d24a9345d7908dc25ae403ee7 F ext/fts3/fts3_tokenizer1.c 0a5bcc579f35de5d24a9345d7908dc25ae403ee7
@@ -170,7 +173,7 @@ F src/sqliteInt.h f09be5c67f95f3d28d44e5b608b18cab28758ba4
F src/sqliteLimit.h 3afab2291762b5d09ae20c18feb8e9fa935a60a6 F src/sqliteLimit.h 3afab2291762b5d09ae20c18feb8e9fa935a60a6
F src/status.c e651be6b30d397d86384c6867bc016e4913bcac7 F src/status.c e651be6b30d397d86384c6867bc016e4913bcac7
F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
F src/tclsqlite.c 223746524139e1e02b7a2b61c05b5a690f91a0ff F src/tclsqlite.c bad6570a005b234ea670b9f7b48256da19a032d3
F src/test1.c db4d8fd2849ab9aca0f27fd3773b8d68d078cf86 F src/test1.c db4d8fd2849ab9aca0f27fd3773b8d68d078cf86
F src/test2.c b6b43413d495addd039a88b87d65c839f86b18cb F src/test2.c b6b43413d495addd039a88b87d65c839f86b18cb
F src/test3.c f17eeaf8114205844d76f4e69bab27ea341087af F src/test3.c f17eeaf8114205844d76f4e69bab27ea341087af
@@ -775,7 +778,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P c022f66b5a65aa54d5ebd55cfe941118a2042280 P 4924fbb244bd1b7103e29e045812cb1c4d2d81c8
R 485d559dfdae9a83053e9af2113a2fa7 R 42f8b015db748b4bafad9aa12897ca9c
U dan U drh
Z 93dd7c80e5edb7b19676b5d0865cea7e Z d0f2f45728e358cd980fa1a3c65f892f
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFLFSDhoxKgR168RlERAi8IAJ0UgMelzc/hXfHu2CiGtY3Mjg/bZgCbBthD
PKncL0iuiXbbriX6qEmRkxQ=
=6DZZ
-----END PGP SIGNATURE-----

View File

@@ -1 +1 @@
4924fbb244bd1b7103e29e045812cb1c4d2d81c8 58113932d93926b4aa037a7487105a55f883cd0a

View File

@@ -33,10 +33,11 @@
** appended to the amalgamation. ** appended to the amalgamation.
*/ */
#ifndef SQLITE_AMALGAMATION #ifndef SQLITE_AMALGAMATION
# include "sqliteInt.h" # include "sqlite3.h"
# include <stdlib.h> # include <stdlib.h>
# include <string.h> # include <string.h>
# include <assert.h> # include <assert.h>
typedef unsigned char u8;
#endif #endif
#include <ctype.h> #include <ctype.h>