OLD | NEW |
1 /* | 1 /* |
2 ** 2009 Nov 12 | 2 ** 2009 Nov 12 |
3 ** | 3 ** |
4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
6 ** | 6 ** |
7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
10 ** | 10 ** |
11 ****************************************************************************** | 11 ****************************************************************************** |
12 ** | 12 ** |
13 */ | 13 */ |
14 #ifndef _FTSINT_H | 14 #ifndef _FTSINT_H |
15 #define _FTSINT_H | 15 #define _FTSINT_H |
16 | 16 |
17 #if !defined(NDEBUG) && !defined(SQLITE_DEBUG) | 17 #if !defined(NDEBUG) && !defined(SQLITE_DEBUG) |
18 # define NDEBUG 1 | 18 # define NDEBUG 1 |
19 #endif | 19 #endif |
20 | 20 |
| 21 /* FTS3/FTS4 require virtual tables */ |
| 22 #ifdef SQLITE_OMIT_VIRTUALTABLE |
| 23 # undef SQLITE_ENABLE_FTS3 |
| 24 # undef SQLITE_ENABLE_FTS4 |
| 25 #endif |
| 26 |
21 /* | 27 /* |
22 ** FTS4 is really an extension for FTS3. It is enabled using the | 28 ** FTS4 is really an extension for FTS3. It is enabled using the |
23 ** SQLITE_ENABLE_FTS3 macro. But to avoid confusion we also all | 29 ** SQLITE_ENABLE_FTS3 macro. But to avoid confusion we also all |
24 ** the SQLITE_ENABLE_FTS4 macro to serve as an alisse for SQLITE_ENABLE_FTS3. | 30 ** the SQLITE_ENABLE_FTS4 macro to serve as an alisse for SQLITE_ENABLE_FTS3. |
25 */ | 31 */ |
26 #if defined(SQLITE_ENABLE_FTS4) && !defined(SQLITE_ENABLE_FTS3) | 32 #if defined(SQLITE_ENABLE_FTS4) && !defined(SQLITE_ENABLE_FTS3) |
27 # define SQLITE_ENABLE_FTS3 | 33 # define SQLITE_ENABLE_FTS3 |
28 #endif | 34 #endif |
29 | 35 |
30 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) | 36 #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 sqlite3_tokenizer *pTokenizer; /* tokenizer for inserts and queries */ | 223 sqlite3_tokenizer *pTokenizer; /* tokenizer for inserts and queries */ |
218 char *zContentTbl; /* content=xxx option, or NULL */ | 224 char *zContentTbl; /* content=xxx option, or NULL */ |
219 char *zLanguageid; /* languageid=xxx option, or NULL */ | 225 char *zLanguageid; /* languageid=xxx option, or NULL */ |
220 int nAutoincrmerge; /* Value configured by 'automerge' */ | 226 int nAutoincrmerge; /* Value configured by 'automerge' */ |
221 u32 nLeafAdd; /* Number of leaf blocks added this trans */ | 227 u32 nLeafAdd; /* Number of leaf blocks added this trans */ |
222 | 228 |
223 /* Precompiled statements used by the implementation. Each of these | 229 /* Precompiled statements used by the implementation. Each of these |
224 ** statements is run and reset within a single virtual table API call. | 230 ** statements is run and reset within a single virtual table API call. |
225 */ | 231 */ |
226 sqlite3_stmt *aStmt[40]; | 232 sqlite3_stmt *aStmt[40]; |
| 233 sqlite3_stmt *pSeekStmt; /* Cache for fts3CursorSeekStmt() */ |
227 | 234 |
228 char *zReadExprlist; | 235 char *zReadExprlist; |
229 char *zWriteExprlist; | 236 char *zWriteExprlist; |
230 | 237 |
231 int nNodeSize; /* Soft limit for node size */ | 238 int nNodeSize; /* Soft limit for node size */ |
232 u8 bFts4; /* True for FTS4, false for FTS3 */ | 239 u8 bFts4; /* True for FTS4, false for FTS3 */ |
233 u8 bHasStat; /* True if %_stat table exists (2==unknown) */ | 240 u8 bHasStat; /* True if %_stat table exists (2==unknown) */ |
234 u8 bHasDocsize; /* True if %_docsize table exists */ | 241 u8 bHasDocsize; /* True if %_docsize table exists */ |
235 u8 bDescIdx; /* True if doclists are in reverse order */ | 242 u8 bDescIdx; /* True if doclists are in reverse order */ |
236 u8 bIgnoreSavepoint; /* True to ignore xSavepoint invocations */ | 243 u8 bIgnoreSavepoint; /* True to ignore xSavepoint invocations */ |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 /* | 293 /* |
287 ** When the core wants to read from the virtual table, it creates a | 294 ** When the core wants to read from the virtual table, it creates a |
288 ** virtual table cursor (an instance of the following structure) using | 295 ** virtual table cursor (an instance of the following structure) using |
289 ** the xOpen method. Cursors are destroyed using the xClose method. | 296 ** the xOpen method. Cursors are destroyed using the xClose method. |
290 */ | 297 */ |
291 struct Fts3Cursor { | 298 struct Fts3Cursor { |
292 sqlite3_vtab_cursor base; /* Base class used by SQLite core */ | 299 sqlite3_vtab_cursor base; /* Base class used by SQLite core */ |
293 i16 eSearch; /* Search strategy (see below) */ | 300 i16 eSearch; /* Search strategy (see below) */ |
294 u8 isEof; /* True if at End Of Results */ | 301 u8 isEof; /* True if at End Of Results */ |
295 u8 isRequireSeek; /* True if must seek pStmt to %_content row */ | 302 u8 isRequireSeek; /* True if must seek pStmt to %_content row */ |
| 303 u8 bSeekStmt; /* True if pStmt is a seek */ |
296 sqlite3_stmt *pStmt; /* Prepared statement in use by the cursor */ | 304 sqlite3_stmt *pStmt; /* Prepared statement in use by the cursor */ |
297 Fts3Expr *pExpr; /* Parsed MATCH query string */ | 305 Fts3Expr *pExpr; /* Parsed MATCH query string */ |
298 int iLangid; /* Language being queried for */ | 306 int iLangid; /* Language being queried for */ |
299 int nPhrase; /* Number of matchable phrases in query */ | 307 int nPhrase; /* Number of matchable phrases in query */ |
300 Fts3DeferredToken *pDeferred; /* Deferred search tokens, if any */ | 308 Fts3DeferredToken *pDeferred; /* Deferred search tokens, if any */ |
301 sqlite3_int64 iPrevId; /* Previous id read from aDoclist */ | 309 sqlite3_int64 iPrevId; /* Previous id read from aDoclist */ |
302 char *pNextId; /* Pointer into the body of aDoclist */ | 310 char *pNextId; /* Pointer into the body of aDoclist */ |
303 char *aDoclist; /* List of docids for full-text queries */ | 311 char *aDoclist; /* List of docids for full-text queries */ |
304 int nDoclist; /* Size of buffer at aDoclist */ | 312 int nDoclist; /* Size of buffer at aDoclist */ |
305 u8 bDesc; /* True to sort in descending order */ | 313 u8 bDesc; /* True to sort in descending order */ |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 | 610 |
603 /* fts3_unicode2.c (functions generated by parsing unicode text files) */ | 611 /* fts3_unicode2.c (functions generated by parsing unicode text files) */ |
604 #ifndef SQLITE_DISABLE_FTS3_UNICODE | 612 #ifndef SQLITE_DISABLE_FTS3_UNICODE |
605 int sqlite3FtsUnicodeFold(int, int); | 613 int sqlite3FtsUnicodeFold(int, int); |
606 int sqlite3FtsUnicodeIsalnum(int); | 614 int sqlite3FtsUnicodeIsalnum(int); |
607 int sqlite3FtsUnicodeIsdiacritic(int); | 615 int sqlite3FtsUnicodeIsdiacritic(int); |
608 #endif | 616 #endif |
609 | 617 |
610 #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */ | 618 #endif /* !SQLITE_CORE || SQLITE_ENABLE_FTS3 */ |
611 #endif /* _FTSINT_H */ | 619 #endif /* _FTSINT_H */ |
OLD | NEW |