Go to the source code of this file.
Classes | |
struct | DataBuffer |
struct | StringBuffer |
struct | DLReader |
struct | DLWriter |
struct | PLReader |
struct | PLWriter |
struct | DLCollector |
struct | OrderedDLReader |
struct | QueryTerm |
struct | Query |
struct | Snippet |
struct | Snippet::snippetMatch |
struct | fulltext_vtab |
struct | fulltext_cursor |
struct | Token |
struct | TableSpec |
struct | InteriorBlock |
struct | InteriorWriter |
struct | InteriorReader |
struct | LeafWriter |
struct | LeafReader |
struct | LeavesReader |
struct | TermData |
struct | OptLeavesReader |
Defines | |
#define | TRACE(A) |
#define | MERGE_COUNT 16 |
#define | CLEAR(b) memset(b, '\0', sizeof(*(b))) |
#define | SCRAMBLE(b) |
#define | VARINT_MAX 10 |
#define | ASSERT_VALID_DOCLIST(i, p, n, o) assert( 1 ) |
#define | LEAF_SELECT "select block from %_segments where rowid between ? and ? order by rowid" |
#define | kPendingThreshold (1*1024*1024) |
#define | TOKEN_EOF 0 |
#define | TOKEN_SPACE 1 |
#define | TOKEN_ID 2 |
#define | TOKEN_STRING 3 |
#define | TOKEN_PUNCT 4 |
#define | IdChar(C) (((c=C)&0x80)!=0 || (c>0x1f && isIdChar[c-0x20])) |
#define | FTS2_ROTOR_SZ (32) |
#define | FTS2_ROTOR_MASK (FTS2_ROTOR_SZ-1) |
#define | SNIPPET_IGNORE 0 |
#define | SNIPPET_DESIRED 1 |
#define | INTERIOR_MAX 2048 |
#define | INTERIOR_MIN_TERMS 7 |
#define | ROOT_MAX 1024 |
#define | ASSERT_VALID_INTERIOR_BLOCK(x) assert( 1 ) |
#define | STANDALONE_MIN 1024 |
#define | LEAF_MAX 2048 |
#define | ASSERT_VALID_LEAF_NODE(p, n) assert( 1 ) |
Typedefs | |
typedef struct fulltext_vtab | fulltext_vtab |
Enumerations | |
enum | DocListType { DL_DOCIDS, DL_POSITIONS, DL_POSITIONS_OFFSETS, DL_DOCIDS, DL_POSITIONS, DL_POSITIONS_OFFSETS, DL_DOCIDS, DL_POSITIONS, DL_POSITIONS_OFFSETS } |
enum | { POS_END = 0, POS_COLUMN, POS_BASE } |
enum | QueryType { QUERY_GENERIC, QUERY_ROWID, QUERY_FULLTEXT, QUERY_GENERIC, QUERY_ROWID, QUERY_FULLTEXT, QUERY_GENERIC, QUERY_DOCID, QUERY_FULLTEXT } |
enum | fulltext_statement { CONTENT_INSERT_STMT, CONTENT_SELECT_STMT, CONTENT_UPDATE_STMT, CONTENT_DELETE_STMT, TERM_SELECT_STMT, TERM_SELECT_ALL_STMT, TERM_INSERT_STMT, TERM_UPDATE_STMT, TERM_DELETE_STMT, MAX_STMT, CONTENT_INSERT_STMT, CONTENT_SELECT_STMT, CONTENT_UPDATE_STMT, CONTENT_DELETE_STMT, CONTENT_EXISTS_STMT, BLOCK_INSERT_STMT, BLOCK_SELECT_STMT, BLOCK_DELETE_STMT, BLOCK_DELETE_ALL_STMT, SEGDIR_MAX_INDEX_STMT, SEGDIR_SET_STMT, SEGDIR_SELECT_LEVEL_STMT, SEGDIR_SPAN_STMT, SEGDIR_DELETE_STMT, SEGDIR_SELECT_SEGMENT_STMT, SEGDIR_SELECT_ALL_STMT, SEGDIR_DELETE_ALL_STMT, SEGDIR_COUNT_STMT, MAX_STMT, CONTENT_INSERT_STMT, CONTENT_SELECT_STMT, CONTENT_UPDATE_STMT, CONTENT_DELETE_STMT, CONTENT_EXISTS_STMT, BLOCK_INSERT_STMT, BLOCK_SELECT_STMT, BLOCK_DELETE_STMT, BLOCK_DELETE_ALL_STMT, SEGDIR_MAX_INDEX_STMT, SEGDIR_SET_STMT, SEGDIR_SELECT_LEVEL_STMT, SEGDIR_SPAN_STMT, SEGDIR_DELETE_STMT, SEGDIR_SELECT_SEGMENT_STMT, SEGDIR_SELECT_ALL_STMT, SEGDIR_DELETE_ALL_STMT, SEGDIR_COUNT_STMT, MAX_STMT } |
Functions | |
static int | safe_isspace (char c) |
static int | safe_tolower (char c) |
static int | safe_isalnum (char c) |
static int | putVarint (char *p, sqlite_int64 v) |
static int | getVarint (const char *p, sqlite_int64 *v) |
static int | getVarint32 (const char *p, int *pi) |
static void | dataBufferInit (DataBuffer *pBuffer, int nCapacity) |
static void | dataBufferReset (DataBuffer *pBuffer) |
static void | dataBufferDestroy (DataBuffer *pBuffer) |
static void | dataBufferSwap (DataBuffer *pBuffer1, DataBuffer *pBuffer2) |
static void | dataBufferExpand (DataBuffer *pBuffer, int nAddCapacity) |
static void | dataBufferAppend (DataBuffer *pBuffer, const char *pSource, int nSource) |
static void | dataBufferAppend2 (DataBuffer *pBuffer, const char *pSource1, int nSource1, const char *pSource2, int nSource2) |
static void | dataBufferReplace (DataBuffer *pBuffer, const char *pSource, int nSource) |
static void | initStringBuffer (StringBuffer *sb) |
static int | stringBufferLength (StringBuffer *sb) |
static char * | stringBufferData (StringBuffer *sb) |
static void | stringBufferDestroy (StringBuffer *sb) |
static void | nappend (StringBuffer *sb, const char *zFrom, int nFrom) |
static void | append (StringBuffer *sb, const char *zFrom) |
static void | appendList (StringBuffer *sb, int nString, char **azString) |
static int | endsInWhiteSpace (StringBuffer *p) |
static void | appendWhiteSpace (StringBuffer *p) |
static void | trimWhiteSpace (StringBuffer *p) |
static int | dlrAtEnd (DLReader *pReader) |
static sqlite_int64 | dlrDocid (DLReader *pReader) |
static const char * | dlrDocData (DLReader *pReader) |
static int | dlrDocDataBytes (DLReader *pReader) |
static int | dlrAllDataBytes (DLReader *pReader) |
static const char * | dlrPosData (DLReader *pReader) |
static int | dlrPosDataLen (DLReader *pReader) |
static void | dlrStep (DLReader *pReader) |
static void | dlrInit (DLReader *pReader, DocListType iType, const char *pData, int nData) |
static void | dlrDestroy (DLReader *pReader) |
static void | dlwInit (DLWriter *pWriter, DocListType iType, DataBuffer *b) |
static void | dlwDestroy (DLWriter *pWriter) |
static void | dlwAppend (DLWriter *pWriter, const char *pData, int nData, sqlite_int64 iFirstDocid, sqlite_int64 iLastDocid) |
static void | dlwCopy (DLWriter *pWriter, DLReader *pReader) |
static void | dlwAdd (DLWriter *pWriter, sqlite_int64 iDocid) |
static int | plrAtEnd (PLReader *pReader) |
static int | plrColumn (PLReader *pReader) |
static int | plrPosition (PLReader *pReader) |
static int | plrStartOffset (PLReader *pReader) |
static int | plrEndOffset (PLReader *pReader) |
static void | plrStep (PLReader *pReader) |
static void | plrInit (PLReader *pReader, DLReader *pDLReader) |
static void | plrDestroy (PLReader *pReader) |
static void | plwAdd (PLWriter *pWriter, int iColumn, int iPos, int iStartOffset, int iEndOffset) |
static void | plwCopy (PLWriter *pWriter, PLReader *pReader) |
static void | plwInit (PLWriter *pWriter, DLWriter *dlw, sqlite_int64 iDocid) |
static void | plwTerminate (PLWriter *pWriter) |
static void | plwDestroy (PLWriter *pWriter) |
static void | dlcAddDoclist (DLCollector *pCollector, DataBuffer *b) |
static void | dlcNext (DLCollector *pCollector, sqlite_int64 iDocid) |
static void | dlcAddPos (DLCollector *pCollector, int iColumn, int iPos, int iStartOffset, int iEndOffset) |
static DLCollector * | dlcNew (sqlite_int64 iDocid, DocListType iType) |
static void | dlcDelete (DLCollector *pCollector) |
static void | docListTrim (DocListType iType, const char *pData, int nData, int iColumn, DocListType iOutType, DataBuffer *out) |
static int | orderedDLReaderCmp (OrderedDLReader *r1, OrderedDLReader *r2) |
static void | orderedDLReaderReorder (OrderedDLReader *p, int n) |
static void | docListMerge (DataBuffer *out, DLReader *pReaders, int nReaders) |
static int | posListCmp (PLReader *pLeft, PLReader *pRight) |
static void | posListUnion (DLReader *pLeft, DLReader *pRight, DLWriter *pOut) |
static void | docListUnion (const char *pLeft, int nLeft, const char *pRight, int nRight, DataBuffer *pOut) |
static void | posListPhraseMerge (DLReader *pLeft, DLReader *pRight, DLWriter *pOut) |
static void | docListPhraseMerge (const char *pLeft, int nLeft, const char *pRight, int nRight, DocListType iType, DataBuffer *pOut) |
static void | docListAndMerge (const char *pLeft, int nLeft, const char *pRight, int nRight, DataBuffer *pOut) |
static void | docListOrMerge (const char *pLeft, int nLeft, const char *pRight, int nRight, DataBuffer *pOut) |
static void | docListExceptMerge (const char *pLeft, int nLeft, const char *pRight, int nRight, DataBuffer *pOut) |
static char * | string_dup_n (const char *s, int n) |
static char * | string_dup (const char *s) |
static char * | string_format (const char *zFormat, const char *zDb, const char *zName) |
static int | sql_exec (sqlite3 *db, const char *zDb, const char *zName, const char *zFormat) |
static int | sql_prepare (sqlite3 *db, const char *zDb, const char *zName, sqlite3_stmt **ppStmt, const char *zFormat) |
static struct fulltext_vtab * | cursor_vtab (fulltext_cursor *c) |
static const char * | contentInsertStatement (fulltext_vtab *v) |
static const char * | contentUpdateStatement (fulltext_vtab *v) |
static int | sql_get_statement (fulltext_vtab *v, fulltext_statement iStmt, sqlite3_stmt **ppStmt) |
static int | sql_single_step (sqlite3_stmt *s) |
static int | sql_get_leaf_statement (fulltext_vtab *v, int idx, sqlite3_stmt **ppStmt) |
static int | content_insert (fulltext_vtab *v, sqlite3_value *rowid, sqlite3_value **pValues) |
static int | content_update (fulltext_vtab *v, sqlite3_value **pValues, sqlite_int64 iRowid) |
static void | freeStringArray (int nString, const char **pString) |
static int | content_select (fulltext_vtab *v, sqlite_int64 iRow, const char ***pValues) |
static int | content_delete (fulltext_vtab *v, sqlite_int64 iRow) |
static int | content_exists (fulltext_vtab *v) |
static int | block_insert (fulltext_vtab *v, const char *pData, int nData, sqlite_int64 *piBlockid) |
static int | block_delete (fulltext_vtab *v, sqlite_int64 iStartBlockid, sqlite_int64 iEndBlockid) |
static int | segdir_max_index (fulltext_vtab *v, int iLevel, int *pidx) |
static int | segdir_set (fulltext_vtab *v, int iLevel, int idx, sqlite_int64 iStartBlockid, sqlite_int64 iLeavesEndBlockid, sqlite_int64 iEndBlockid, const char *pRootData, int nRootData) |
static int | segdir_span (fulltext_vtab *v, int iLevel, sqlite_int64 *piStartBlockid, sqlite_int64 *piEndBlockid) |
static int | segdir_delete (fulltext_vtab *v, int iLevel) |
static int | segdir_delete_all (fulltext_vtab *v) |
static int | segdir_count (fulltext_vtab *v, int *pnSegments, int *piMaxLevel) |
static int | clearPendingTerms (fulltext_vtab *v) |
static void | fulltext_vtab_destroy (fulltext_vtab *v) |
static int | getToken (const char *z, int *tokenType) |
static char ** | tokenizeString (const char *z, int *pnToken) |
static void | dequoteString (char *z) |
static void | tokenListToIdList (char **azIn) |
static char * | firstToken (char *zIn, char **pzTail) |
static int | startsWith (const char *s, const char *t) |
static void | clearTableSpec (TableSpec *p) |
static int | parseSpec (TableSpec *pSpec, int argc, const char *const *argv, char **pzErr) |
static char * | fulltextSchema (int nColumn, const char *const *azColumn, const char *zTableName) |
static int | constructVtab (sqlite3 *db, fts2Hash *pHash, TableSpec *spec, sqlite3_vtab **ppVTab, char **pzErr) |
static int | fulltextConnect (sqlite3 *db, void *pAux, int argc, const char *const *argv, sqlite3_vtab **ppVTab, char **pzErr) |
static int | fulltextCreate (sqlite3 *db, void *pAux, int argc, const char *const *argv, sqlite3_vtab **ppVTab, char **pzErr) |
static int | fulltextBestIndex (sqlite3_vtab *pVTab, sqlite3_index_info *pInfo) |
static int | fulltextDisconnect (sqlite3_vtab *pVTab) |
static int | fulltextDestroy (sqlite3_vtab *pVTab) |
static int | fulltextOpen (sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor) |
static void | queryClear (Query *q) |
static void | snippetClear (Snippet *p) |
static void | snippetAppendMatch (Snippet *p, int iCol, int iTerm, int iStart, int nByte) |
static void | snippetOffsetsOfColumn (Query *pQuery, Snippet *pSnippet, int iColumn, const char *zDoc, int nDoc) |
static void | snippetAllOffsets (fulltext_cursor *p) |
static void | snippetOffsetText (Snippet *p) |
static int | wordBoundary (int iBreak, const char *zDoc, int nDoc, struct snippetMatch *aMatch, int nMatch, int iCol) |
static void | snippetText (fulltext_cursor *pCursor, const char *zStartMark, const char *zEndMark, const char *zEllipsis) |
static int | fulltextClose (sqlite3_vtab_cursor *pCursor) |
static int | fulltextNext (sqlite3_vtab_cursor *pCursor) |
static int | termSelect (fulltext_vtab *v, int iColumn, const char *pTerm, int nTerm, int isPrefix, DocListType iType, DataBuffer *out) |
static int | docListOfTerm (fulltext_vtab *v, int iColumn, QueryTerm *pQTerm, DataBuffer *pResult) |
static void | queryAdd (Query *q, const char *pTerm, int nTerm) |
static int | checkColumnSpecifier (fulltext_vtab *pVtab, const char *zToken, int nToken) |
static int | tokenizeSegment (sqlite3_tokenizer *pTokenizer, const char *pSegment, int nSegment, int inPhrase, Query *pQuery) |
static int | parseQuery (fulltext_vtab *v, const char *zInput, int nInput, int dfltColumn, Query *pQuery) |
static int | flushPendingTerms (fulltext_vtab *v) |
static int | fulltextQuery (fulltext_vtab *v, int iColumn, const char *zInput, int nInput, DataBuffer *pResult, Query *pQuery) |
static int | fulltextFilter (sqlite3_vtab_cursor *pCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv) |
static int | fulltextEof (sqlite3_vtab_cursor *pCursor) |
static int | fulltextColumn (sqlite3_vtab_cursor *pCursor, sqlite3_context *pContext, int idxCol) |
static int | fulltextRowid (sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid) |
static int | buildTerms (fulltext_vtab *v, sqlite_int64 iDocid, const char *zText, int iColumn) |
static int | insertTerms (fulltext_vtab *v, sqlite_int64 iRowid, sqlite3_value **pValues) |
static int | deleteTerms (fulltext_vtab *v, sqlite_int64 iRowid) |
static int | initPendingTerms (fulltext_vtab *v, sqlite_int64 iDocid) |
static int | index_insert (fulltext_vtab *v, sqlite3_value *pRequestRowid, sqlite3_value **pValues, sqlite_int64 *piRowid) |
static int | index_delete (fulltext_vtab *v, sqlite_int64 iRow) |
static int | index_update (fulltext_vtab *v, sqlite_int64 iRow, sqlite3_value **pValues) |
static InteriorBlock * | interiorBlockNew (int iHeight, sqlite_int64 iChildBlock, const char *pTerm, int nTerm) |
static void | interiorWriterInit (int iHeight, const char *pTerm, int nTerm, sqlite_int64 iChildBlock, InteriorWriter *pWriter) |
static void | interiorWriterAppend (InteriorWriter *pWriter, const char *pTerm, int nTerm, sqlite_int64 iChildBlock) |
static int | interiorWriterDestroy (InteriorWriter *pWriter) |
static int | interiorWriterRootInfo (fulltext_vtab *v, InteriorWriter *pWriter, char **ppRootInfo, int *pnRootInfo, sqlite_int64 *piEndBlockid) |
static void | interiorReaderDestroy (InteriorReader *pReader) |
static void | interiorReaderInit (const char *pData, int nData, InteriorReader *pReader) |
static int | interiorReaderAtEnd (InteriorReader *pReader) |
static sqlite_int64 | interiorReaderCurrentBlockid (InteriorReader *pReader) |
static int | interiorReaderTermBytes (InteriorReader *pReader) |
static const char * | interiorReaderTerm (InteriorReader *pReader) |
static void | interiorReaderStep (InteriorReader *pReader) |
static int | interiorReaderTermCmp (InteriorReader *pReader, const char *pTerm, int nTerm, int isPrefix) |
static void | leafWriterInit (int iLevel, int idx, LeafWriter *pWriter) |
static int | leafWriterInternalFlush (fulltext_vtab *v, LeafWriter *pWriter, int iData, int nData) |
static int | leafWriterFlush (fulltext_vtab *v, LeafWriter *pWriter) |
static int | leafWriterRootInfo (fulltext_vtab *v, LeafWriter *pWriter, char **ppRootInfo, int *pnRootInfo, sqlite_int64 *piEndBlockid) |
static int | leafWriterFinalize (fulltext_vtab *v, LeafWriter *pWriter) |
static void | leafWriterDestroy (LeafWriter *pWriter) |
static int | leafWriterEncodeTerm (LeafWriter *pWriter, const char *pTerm, int nTerm) |
static int | leafWriterInlineFlush (fulltext_vtab *v, LeafWriter *pWriter, const char *pTerm, int nTerm, int iDoclistData) |
static int | leafWriterStepMerge (fulltext_vtab *v, LeafWriter *pWriter, const char *pTerm, int nTerm, DLReader *pReaders, int nReaders) |
static int | leafWriterStep (fulltext_vtab *v, LeafWriter *pWriter, const char *pTerm, int nTerm, const char *pData, int nData) |
static void | leafReaderDestroy (LeafReader *pReader) |
static int | leafReaderAtEnd (LeafReader *pReader) |
static int | leafReaderTermBytes (LeafReader *pReader) |
static const char * | leafReaderTerm (LeafReader *pReader) |
static int | leafReaderDataBytes (LeafReader *pReader) |
static const char * | leafReaderData (LeafReader *pReader) |
static void | leafReaderInit (const char *pData, int nData, LeafReader *pReader) |
static void | leafReaderStep (LeafReader *pReader) |
static int | leafReaderTermCmp (LeafReader *pReader, const char *pTerm, int nTerm, int isPrefix) |
static int | leavesReaderTermBytes (LeavesReader *pReader) |
static const char * | leavesReaderTerm (LeavesReader *pReader) |
static int | leavesReaderDataBytes (LeavesReader *pReader) |
static const char * | leavesReaderData (LeavesReader *pReader) |
static int | leavesReaderAtEnd (LeavesReader *pReader) |
static int | leavesReaderReset (LeavesReader *pReader) |
static void | leavesReaderDestroy (LeavesReader *pReader) |
static int | leavesReaderInit (fulltext_vtab *v, int idx, sqlite_int64 iStartBlockid, sqlite_int64 iEndBlockid, const char *pRootData, int nRootData, LeavesReader *pReader) |
static int | leavesReaderStep (fulltext_vtab *v, LeavesReader *pReader) |
static int | leavesReaderTermCmp (LeavesReader *lr1, LeavesReader *lr2) |
static int | leavesReaderCmp (LeavesReader *lr1, LeavesReader *lr2) |
static void | leavesReaderReorder (LeavesReader *pLr, int nLr) |
static int | leavesReadersInit (fulltext_vtab *v, int iLevel, LeavesReader *pReaders, int *piReaders) |
static int | leavesReadersMerge (fulltext_vtab *v, LeavesReader *pReaders, int nReaders, LeafWriter *pWriter) |
static int | segmentMerge (fulltext_vtab *v, int iLevel) |
static int | segdirNextIndex (fulltext_vtab *v, int iLevel, int *pidx) |
static void | docListAccumulateUnion (DataBuffer *acc, const char *pData, int nData) |
static int | loadSegmentLeavesInt (fulltext_vtab *v, LeavesReader *pReader, const char *pTerm, int nTerm, int isPrefix, DataBuffer *out) |
static int | loadSegmentLeaf (fulltext_vtab *v, const char *pData, int nData, const char *pTerm, int nTerm, int isPrefix, DataBuffer *out) |
static int | loadSegmentLeaves (fulltext_vtab *v, sqlite_int64 iStartLeaf, sqlite_int64 iEndLeaf, const char *pTerm, int nTerm, int isPrefix, DataBuffer *out) |
static void | getChildrenContaining (const char *pData, int nData, const char *pTerm, int nTerm, int isPrefix, sqlite_int64 *piStartChild, sqlite_int64 *piEndChild) |
static int | loadAndGetChildrenContaining (fulltext_vtab *v, sqlite_int64 iBlockid, const char *pTerm, int nTerm, int isPrefix, sqlite_int64 *piStartChild, sqlite_int64 *piEndChild) |
static int | loadSegmentInt (fulltext_vtab *v, const char *pData, int nData, sqlite_int64 iLeavesEnd, const char *pTerm, int nTerm, int isPrefix, DataBuffer *out) |
static int | loadSegment (fulltext_vtab *v, const char *pData, int nData, sqlite_int64 iLeavesEnd, const char *pTerm, int nTerm, int isPrefix, DataBuffer *out) |
static int | termDataCmp (const void *av, const void *bv) |
static int | writeZeroSegment (fulltext_vtab *v, fts2Hash *pTerms) |
static int | fulltextUpdate (sqlite3_vtab *pVtab, int nArg, sqlite3_value **ppArg, sqlite_int64 *pRowid) |
static int | fulltextSync (sqlite3_vtab *pVtab) |
static int | fulltextBegin (sqlite3_vtab *pVtab) |
static int | fulltextCommit (sqlite3_vtab *pVtab) |
static int | fulltextRollback (sqlite3_vtab *pVtab) |
static void | snippetFunc (sqlite3_context *pContext, int argc, sqlite3_value **argv) |
static void | snippetOffsetsFunc (sqlite3_context *pContext, int argc, sqlite3_value **argv) |
static int | optLeavesReaderAtEnd (OptLeavesReader *pReader) |
static int | optLeavesReaderTermBytes (OptLeavesReader *pReader) |
static const char * | optLeavesReaderData (OptLeavesReader *pReader) |
static int | optLeavesReaderDataBytes (OptLeavesReader *pReader) |
static const char * | optLeavesReaderTerm (OptLeavesReader *pReader) |
static int | optLeavesReaderStep (fulltext_vtab *v, OptLeavesReader *pReader) |
static int | optLeavesReaderTermCmp (OptLeavesReader *lr1, OptLeavesReader *lr2) |
static int | optLeavesReaderCmp (OptLeavesReader *lr1, OptLeavesReader *lr2) |
static void | optLeavesReaderReorder (OptLeavesReader *pLr, int nLr) |
static int | optimizeInternal (fulltext_vtab *v, OptLeavesReader *readers, int nReaders, LeafWriter *pWriter) |
static void | optimizeFunc (sqlite3_context *pContext, int argc, sqlite3_value **argv) |
static int | fulltextFindFunction (sqlite3_vtab *pVtab, int nArg, const char *zName, void(**pxFunc)(sqlite3_context *, int, sqlite3_value **), void **ppArg) |
static int | fulltextRename (sqlite3_vtab *pVtab, const char *zName) |
static void | hashDestroy (void *p) |
void | sqlite3Fts2SimpleTokenizerModule (sqlite3_tokenizer_module const **ppModule) |
void | sqlite3Fts2PorterTokenizerModule (sqlite3_tokenizer_module const **ppModule) |
void | sqlite3Fts2IcuTokenizerModule (sqlite3_tokenizer_module const **ppModule) |
int | sqlite3Fts2InitHashTable (sqlite3 *, fts2Hash *, const char *) |
int | sqlite3Fts2Init (sqlite3 *db) |
int | sqlite3_extension_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi) |
Variables | |
static const char *const | fulltext_zStatement [MAX_STMT] |
static const sqlite3_module | fts2Module |
static const char | isIdChar [] |
#define ASSERT_VALID_DOCLIST | ( | i, | |||
p, | |||||
n, | |||||
o | ) | assert( 1 ) |
Definition at line 738 of file fts2.c.
Referenced by dlwAppend(), and leafWriterStepMerge().
#define ASSERT_VALID_INTERIOR_BLOCK | ( | x | ) | assert( 1 ) |
Definition at line 4159 of file fts2.c.
Referenced by interiorWriterAppend(), interiorWriterInit(), and interiorWriterRootInfo().
#define ASSERT_VALID_LEAF_NODE | ( | p, | |||
n | ) | assert( 1 ) |
Definition at line 4562 of file fts2.c.
Referenced by leafWriterInternalFlush(), and leafWriterStepMerge().
#define CLEAR | ( | b | ) | memset(b, '\0', sizeof(*(b))) |
Definition at line 397 of file fts2.c.
Referenced by constructVtab(), interiorReaderInit(), interiorWriterInit(), leafReaderInit(), leafWriterInit(), leavesReaderInit(), parseSpec(), queryAdd(), queryClear(), and snippetClear().
#define FTS2_ROTOR_MASK (FTS2_ROTOR_SZ-1) |
Definition at line 3073 of file fts2.c.
Referenced by snippetOffsetsOfColumn().
#define FTS2_ROTOR_SZ (32) |
Definition at line 3072 of file fts2.c.
Referenced by snippetOffsetsOfColumn().
#define IdChar | ( | C | ) | (((c=C)&0x80)!=0 || (c>0x1f && isIdChar[c-0x20])) |
#define INTERIOR_MAX 2048 |
Definition at line 4045 of file fts2.c.
Referenced by interiorBlockNew(), and interiorWriterAppend().
#define INTERIOR_MIN_TERMS 7 |
Definition at line 4052 of file fts2.c.
Referenced by interiorWriterAppend().
#define kPendingThreshold (1*1024*1024) |
Definition at line 1878 of file fts2.c.
Referenced by initPendingTerms().
#define LEAF_MAX 2048 |
Definition at line 4466 of file fts2.c.
Referenced by leafWriterInit(), leafWriterStepMerge(), and optimizeInternal().
#define LEAF_SELECT "select block from %_segments where rowid between ? and ? order by rowid" |
Definition at line 1864 of file fts2.c.
Referenced by sql_get_leaf_statement().
#define MERGE_COUNT 16 |
Definition at line 385 of file fts2.c.
Referenced by docListMerge(), fulltext_vtab_destroy(), leavesReadersInit(), leavesReadersMerge(), optimizeInternal(), segdirNextIndex(), segmentMerge(), and sql_get_leaf_statement().
#define ROOT_MAX 1024 |
Definition at line 4065 of file fts2.c.
Referenced by interiorWriterRootInfo(), and leafWriterRootInfo().
#define SCRAMBLE | ( | b | ) |
Definition at line 402 of file fts2.c.
Referenced by dataBufferDestroy(), dlcDelete(), dlrDestroy(), dlwDestroy(), interiorReaderDestroy(), interiorWriterDestroy(), leafReaderDestroy(), leavesReaderDestroy(), plrDestroy(), and plwDestroy().
#define STANDALONE_MIN 1024 |
Definition at line 4463 of file fts2.c.
Referenced by leafWriterStepMerge().
typedef struct fulltext_vtab fulltext_vtab |
enum DocListType |
enum fulltext_statement |
enum QueryType |
static void append | ( | StringBuffer * | sb, | |
const char * | zFrom | |||
) | [static] |
Definition at line 548 of file fts2.c.
References nappend().
Referenced by appendList(), appendWhiteSpace(), contentInsertStatement(), contentUpdateStatement(), fulltextCreate(), snippetOffsetText(), and snippetText().
static void appendList | ( | StringBuffer * | sb, | |
int | nString, | |||
char ** | azString | |||
) | [static] |
Definition at line 553 of file fts2.c.
References append().
Referenced by contentInsertStatement(), and fulltextCreate().
static void appendWhiteSpace | ( | StringBuffer * | p | ) | [static] |
Definition at line 569 of file fts2.c.
References append(), endsInWhiteSpace(), and stringBufferLength().
Referenced by snippetText().
static int block_delete | ( | fulltext_vtab * | v, | |
sqlite_int64 | iStartBlockid, | |||
sqlite_int64 | iEndBlockid | |||
) | [static] |
Definition at line 2159 of file fts2.c.
References BLOCK_DELETE_STMT, sql_get_statement(), sql_single_step(), sqlite3_bind_int64(), and SQLITE_OK.
Referenced by segdir_delete().
static int block_insert | ( | fulltext_vtab * | v, | |
const char * | pData, | |||
int | nData, | |||
sqlite_int64 * | piBlockid | |||
) | [static] |
Definition at line 2136 of file fts2.c.
References BLOCK_INSERT_STMT, fulltext_vtab::db, sql_get_statement(), sqlite3_bind_blob(), sqlite3_last_insert_rowid(), sqlite3_step(), SQLITE_DONE, SQLITE_ERROR, SQLITE_OK, SQLITE_ROW, and SQLITE_STATIC.
Referenced by interiorWriterRootInfo(), and leafWriterInternalFlush().
static int buildTerms | ( | fulltext_vtab * | v, | |
sqlite_int64 | iDocid, | |||
const char * | zText, | |||
int | iColumn | |||
) | [static] |
Definition at line 3893 of file fts2.c.
References DLCollector::b, DL_DEFAULT, dlcAddPos(), dlcNew(), dlcNext(), DLCollector::dlw, fts2HashFind, fts2HashInsert, DLWriter::iPrevDocid, DataBuffer::nData, fulltext_vtab::nPendingData, fulltext_vtab::pendingTerms, sqlite3_tokenizer::pModule, sqlite3_tokenizer_cursor::pTokenizer, fulltext_vtab::pTokenizer, SQLITE_DONE, SQLITE_ERROR, SQLITE_OK, sqlite3_tokenizer_module::xClose, sqlite3_tokenizer_module::xNext, and sqlite3_tokenizer_module::xOpen.
Referenced by deleteTerms(), and insertTerms().
static int checkColumnSpecifier | ( | fulltext_vtab * | pVtab, | |
const char * | zToken, | |||
int | nToken | |||
) | [static] |
Definition at line 3511 of file fts2.c.
References fulltext_vtab::azColumn, and fulltext_vtab::nColumn.
Referenced by tokenizeSegment().
static int clearPendingTerms | ( | fulltext_vtab * | v | ) | [static] |
Definition at line 5827 of file fts2.c.
References dlcDelete(), fts2HashClear, fts2HashData, fts2HashFirst, fts2HashNext, fulltext_vtab::nPendingData, fulltext_vtab::pendingTerms, and SQLITE_OK.
Referenced by flushPendingTerms(), fulltext_vtab_destroy(), fulltextBegin(), fulltextCommit(), fulltextRollback(), and fulltextUpdate().
static void clearTableSpec | ( | TableSpec * | p | ) | [static] |
Definition at line 2670 of file fts2.c.
References TableSpec::azColumn, TableSpec::azContentColumn, TableSpec::azTokenizer, and sqlite3_free().
Referenced by fulltextConnect(), fulltextCreate(), and parseSpec().
static int constructVtab | ( | sqlite3 * | db, | |
fts2Hash * | pHash, | |||
TableSpec * | spec, | |||
sqlite3_vtab ** | ppVTab, | |||
char ** | pzErr | |||
) | [static] |
Definition at line 2806 of file fts2.c.
References TableSpec::azColumn, fulltext_vtab::azColumn, TableSpec::azContentColumn, fulltext_vtab::azContentColumn, TableSpec::azTokenizer, fulltext_vtab::base, CLEAR, fulltext_vtab::db, fulltext_vtab_destroy(), fulltextSchema(), TableSpec::nColumn, fulltext_vtab::nColumn, fulltext_vtab::nPendingData, fulltext_vtab::pFulltextStatements, sqlite3_tokenizer::pModule, fulltext_vtab::pTokenizer, sqlite3_declare_vtab(), sqlite3_free(), sqlite3_malloc(), sqlite3_mprintf(), sqlite3Fts2HashFind(), SQLITE_ERROR, SQLITE_NOMEM, SQLITE_OK, TRACE, sqlite3_tokenizer_module::xCreate, TableSpec::zDb, fulltext_vtab::zDb, TableSpec::zName, and fulltext_vtab::zName.
Referenced by fulltextConnect(), and fulltextCreate().
static int content_delete | ( | fulltext_vtab * | v, | |
sqlite_int64 | iRow | |||
) | [static] |
Definition at line 2103 of file fts2.c.
References CONTENT_DELETE_STMT, sql_get_statement(), sql_single_step(), sqlite3_bind_int64(), and SQLITE_OK.
Referenced by index_delete().
static int content_exists | ( | fulltext_vtab * | v | ) | [static] |
Definition at line 2117 of file fts2.c.
References CONTENT_EXISTS_STMT, sql_get_statement(), sqlite3_step(), SQLITE_DONE, SQLITE_ERROR, SQLITE_OK, and SQLITE_ROW.
Referenced by fulltextUpdate().
static int content_insert | ( | fulltext_vtab * | v, | |
sqlite3_value * | rowid, | |||
sqlite3_value ** | pValues | |||
) | [static] |
Definition at line 2010 of file fts2.c.
References CONTENT_INSERT_STMT, fulltext_vtab::nColumn, sql_get_statement(), sql_single_step(), sqlite3_bind_value(), and SQLITE_OK.
Referenced by index_insert().
static int content_select | ( | fulltext_vtab * | v, | |
sqlite_int64 | iRow, | |||
const char *** | pValues | |||
) | [static] |
Definition at line 2063 of file fts2.c.
References CONTENT_SELECT_STMT, freeStringArray(), fulltext_vtab::nColumn, sql_get_statement(), sqlite3_bind_int64(), sqlite3_column_text(), sqlite3_column_type(), sqlite3_malloc(), sqlite3_step(), SQLITE_DONE, SQLITE_NULL, SQLITE_OK, SQLITE_ROW, and string_dup().
Referenced by deleteTerms().
static int content_update | ( | fulltext_vtab * | v, | |
sqlite3_value ** | pValues, | |||
sqlite_int64 | iRowid | |||
) | [static] |
Definition at line 2030 of file fts2.c.
References CONTENT_UPDATE_STMT, fulltext_vtab::nColumn, sql_get_statement(), sql_single_step(), sqlite3_bind_int64(), sqlite3_bind_value(), and SQLITE_OK.
Referenced by index_update().
static const char* contentInsertStatement | ( | fulltext_vtab * | v | ) | [static] |
Definition at line 1909 of file fts2.c.
References append(), appendList(), fulltext_vtab::azContentColumn, initStringBuffer(), fulltext_vtab::nColumn, and stringBufferData().
Referenced by sql_get_statement().
static const char* contentUpdateStatement | ( | fulltext_vtab * | v | ) | [static] |
Definition at line 1927 of file fts2.c.
References append(), fulltext_vtab::azContentColumn, initStringBuffer(), fulltext_vtab::nColumn, and stringBufferData().
Referenced by sql_get_statement().
static struct fulltext_vtab* cursor_vtab | ( | fulltext_cursor * | c | ) | [static, read] |
Definition at line 1900 of file fts2.c.
References fulltext_cursor::base, and sqlite3_vtab_cursor::pVtab.
Referenced by fulltextColumn(), fulltextFilter(), and optimizeFunc().
static void dataBufferAppend | ( | DataBuffer * | pBuffer, | |
const char * | pSource, | |||
int | nSource | |||
) | [static] |
Definition at line 499 of file fts2.c.
References dataBufferExpand(), DataBuffer::nData, and DataBuffer::pData.
Referenced by dataBufferReplace(), dlcAddDoclist(), dlwAdd(), dlwAppend(), docListExceptMerge(), docListMerge(), docListOrMerge(), docListUnion(), interiorReaderStep(), leafReaderStep(), leafWriterStepMerge(), plwAdd(), plwInit(), and plwTerminate().
static void dataBufferAppend2 | ( | DataBuffer * | pBuffer, | |
const char * | pSource1, | |||
int | nSource1, | |||
const char * | pSource2, | |||
int | nSource2 | |||
) | [static] |
Definition at line 506 of file fts2.c.
References dataBufferExpand(), DataBuffer::nData, and DataBuffer::pData.
Referenced by dlcAddDoclist(), dlwAppend(), interiorWriterAppend(), leafWriterEncodeTerm(), and nappend().
static void dataBufferDestroy | ( | DataBuffer * | pBuffer | ) | [static] |
Definition at line 479 of file fts2.c.
References DataBuffer::pData, SCRAMBLE, and sqlite3_free().
Referenced by dlcDelete(), docListAccumulateUnion(), docListOfTerm(), fulltextClose(), fulltextQuery(), interiorReaderDestroy(), interiorWriterDestroy(), leafReaderDestroy(), leafWriterDestroy(), leavesReaderDestroy(), loadSegment(), loadSegmentLeavesInt(), optimizeInternal(), stringBufferDestroy(), termSelect(), and writeZeroSegment().
static void dataBufferExpand | ( | DataBuffer * | pBuffer, | |
int | nAddCapacity | |||
) | [static] |
Definition at line 488 of file fts2.c.
References DataBuffer::nCapacity, DataBuffer::nData, DataBuffer::pData, and sqlite3_realloc().
Referenced by dataBufferAppend(), dataBufferAppend2(), and docListMerge().
static void dataBufferInit | ( | DataBuffer * | pBuffer, | |
int | nCapacity | |||
) | [static] |
Definition at line 470 of file fts2.c.
References DataBuffer::nCapacity, DataBuffer::nData, DataBuffer::pData, and sqlite3_malloc().
Referenced by dlcNew(), docListAccumulateUnion(), docListOfTerm(), fulltextFilter(), fulltextQuery(), initStringBuffer(), interiorBlockNew(), interiorReaderInit(), interiorWriterInit(), leafReaderInit(), leafWriterInit(), leavesReaderInit(), loadSegment(), loadSegmentLeavesInt(), optimizeInternal(), termSelect(), and writeZeroSegment().
static void dataBufferReplace | ( | DataBuffer * | pBuffer, | |
const char * | pSource, | |||
int | nSource | |||
) | [static] |
Definition at line 516 of file fts2.c.
References dataBufferAppend(), and dataBufferReset().
Referenced by initStringBuffer(), interiorBlockNew(), interiorReaderInit(), interiorWriterAppend(), leafReaderInit(), leafWriterEncodeTerm(), leavesReaderInit(), and loadSegmentLeavesInt().
static void dataBufferReset | ( | DataBuffer * | pBuffer | ) | [static] |
Definition at line 476 of file fts2.c.
References DataBuffer::nData.
Referenced by dataBufferReplace(), fulltextFilter(), interiorReaderStep(), interiorWriterAppend(), leafWriterFlush(), leafWriterStepMerge(), loadSegmentLeavesInt(), optimizeInternal(), and writeZeroSegment().
static void dataBufferSwap | ( | DataBuffer * | pBuffer1, | |
DataBuffer * | pBuffer2 | |||
) | [static] |
Definition at line 483 of file fts2.c.
Referenced by loadSegmentLeavesInt().
static int deleteTerms | ( | fulltext_vtab * | v, | |
sqlite_int64 | iRowid | |||
) | [static] |
Definition at line 3965 of file fts2.c.
References buildTerms(), content_select(), DL_DEFAULT, DL_DOCIDS, freeStringArray(), fulltext_vtab::nColumn, SQLITE_ERROR, and SQLITE_OK.
Referenced by index_delete(), and index_update().
static void dequoteString | ( | char * | z | ) | [static] |
Definition at line 2551 of file fts2.c.
Referenced by firstToken(), and tokenListToIdList().
static void dlcAddDoclist | ( | DLCollector * | pCollector, | |
DataBuffer * | b | |||
) | [static] |
Definition at line 1071 of file fts2.c.
References DLCollector::b, dataBufferAppend(), dataBufferAppend2(), DL_DOCIDS, DLCollector::dlw, DLWriter::iType, DataBuffer::nData, DataBuffer::pData, POS_END, putVarint, and VARINT_MAX.
Referenced by writeZeroSegment().
static void dlcAddPos | ( | DLCollector * | pCollector, | |
int | iColumn, | |||
int | iPos, | |||
int | iStartOffset, | |||
int | iEndOffset | |||
) | [static] |
Definition at line 1085 of file fts2.c.
References DLCollector::plw, and plwAdd().
Referenced by buildTerms().
static void dlcDelete | ( | DLCollector * | pCollector | ) | [static] |
Definition at line 1097 of file fts2.c.
References DLCollector::b, dataBufferDestroy(), DLCollector::dlw, dlwDestroy(), DLCollector::plw, plwDestroy(), SCRAMBLE, and sqlite3_free().
Referenced by clearPendingTerms().
static DLCollector* dlcNew | ( | sqlite_int64 | iDocid, | |
DocListType | iType | |||
) | [static] |
Definition at line 1090 of file fts2.c.
References DLCollector::b, dataBufferInit(), DLCollector::dlw, dlwInit(), DLCollector::plw, plwInit(), and sqlite3_malloc().
Referenced by buildTerms().
static void dlcNext | ( | DLCollector * | pCollector, | |
sqlite_int64 | iDocid | |||
) | [static] |
Definition at line 1080 of file fts2.c.
References DLCollector::dlw, DLCollector::plw, plwDestroy(), plwInit(), and plwTerminate().
Referenced by buildTerms().
static int dlrAllDataBytes | ( | DLReader * | pReader | ) | [static] |
Definition at line 632 of file fts2.c.
References dlrAtEnd(), and DLReader::nData.
Referenced by docListMerge(), and leafWriterStepMerge().
static int dlrAtEnd | ( | DLReader * | pReader | ) | [static] |
Definition at line 616 of file fts2.c.
References DLReader::nData.
Referenced by dlrAllDataBytes(), dlrDocData(), dlrDocDataBytes(), dlrDocid(), dlrPosData(), dlrPosDataLen(), dlrStep(), docListAndMerge(), docListExceptMerge(), docListMerge(), docListOrMerge(), docListPhraseMerge(), docListTrim(), docListUnion(), fulltextNext(), and orderedDLReaderCmp().
static void dlrDestroy | ( | DLReader * | pReader | ) | [static] |
Definition at line 697 of file fts2.c.
References SCRAMBLE.
Referenced by docListAndMerge(), docListExceptMerge(), docListOrMerge(), docListPhraseMerge(), docListTrim(), docListUnion(), fulltextClose(), fulltextFilter(), leafWriterStep(), loadSegment(), and optimizeInternal().
static const char* dlrDocData | ( | DLReader * | pReader | ) | [static] |
Definition at line 624 of file fts2.c.
References dlrAtEnd(), and DLReader::pData.
Referenced by dlwCopy(), and docListMerge().
static int dlrDocDataBytes | ( | DLReader * | pReader | ) | [static] |
Definition at line 628 of file fts2.c.
References dlrAtEnd(), and DLReader::nElement.
Referenced by dlwCopy(), and docListMerge().
static sqlite_int64 dlrDocid | ( | DLReader * | pReader | ) | [static] |
Definition at line 620 of file fts2.c.
References dlrAtEnd(), and DLReader::iDocid.
Referenced by dlwCopy(), docListAndMerge(), docListExceptMerge(), docListMerge(), docListOrMerge(), docListPhraseMerge(), docListTrim(), docListUnion(), fulltextNext(), orderedDLReaderCmp(), posListPhraseMerge(), and posListUnion().
static void dlrInit | ( | DLReader * | pReader, | |
DocListType | iType, | |||
const char * | pData, | |||
int | nData | |||
) | [static] |
Definition at line 685 of file fts2.c.
References dlrStep(), DLReader::iDocid, DLReader::iType, DLReader::nData, DLReader::nElement, and DLReader::pData.
Referenced by docListAndMerge(), docListExceptMerge(), docListOrMerge(), docListPhraseMerge(), docListTrim(), docListUnion(), fulltextFilter(), leafWriterStep(), leavesReadersMerge(), loadSegment(), and optimizeInternal().
static const char* dlrPosData | ( | DLReader * | pReader | ) | [static] |
Definition at line 640 of file fts2.c.
References dlrAtEnd(), getVarint, and DLReader::pData.
Referenced by plrInit().
static int dlrPosDataLen | ( | DLReader * | pReader | ) | [static] |
Definition at line 646 of file fts2.c.
References dlrAtEnd(), getVarint, DLReader::nElement, and DLReader::pData.
Referenced by plrInit().
static void dlrStep | ( | DLReader * | pReader | ) | [static] |
Definition at line 652 of file fts2.c.
References DL_POSITIONS, DL_POSITIONS_OFFSETS, dlrAtEnd(), getVarint, getVarint32, DLReader::iDocid, DLReader::iType, DLReader::nData, DLReader::nElement, DLReader::pData, POS_COLUMN, and POS_END.
Referenced by dlrInit(), docListAndMerge(), docListExceptMerge(), docListMerge(), docListOrMerge(), docListPhraseMerge(), docListTrim(), docListUnion(), and fulltextNext().
static void dlwAdd | ( | DLWriter * | pWriter, | |
sqlite_int64 | iDocid | |||
) | [static] |
Definition at line 822 of file fts2.c.
References DLWriter::b, dataBufferAppend(), DL_DOCIDS, DLWriter::iPrevDocid, DLWriter::iType, putVarint, and VARINT_MAX.
Referenced by docListAndMerge(), docListExceptMerge(), and docListOrMerge().
static void dlwAppend | ( | DLWriter * | pWriter, | |
const char * | pData, | |||
int | nData, | |||
sqlite_int64 | iFirstDocid, | |||
sqlite_int64 | iLastDocid | |||
) | [static] |
Definition at line 785 of file fts2.c.
References ASSERT_VALID_DOCLIST, DLWriter::b, dataBufferAppend(), dataBufferAppend2(), DL_DOCIDS, getVarint, DLWriter::iPrevDocid, DLWriter::iType, putVarint, and VARINT_MAX.
Referenced by dlwCopy(), and docListMerge().
Definition at line 818 of file fts2.c.
References dlrDocData(), dlrDocDataBytes(), dlrDocid(), and dlwAppend().
Referenced by docListUnion().
static void dlwDestroy | ( | DLWriter * | pWriter | ) | [static] |
Definition at line 769 of file fts2.c.
References SCRAMBLE.
Referenced by dlcDelete(), docListAndMerge(), docListExceptMerge(), docListMerge(), docListOrMerge(), docListPhraseMerge(), docListTrim(), and docListUnion().
static void dlwInit | ( | DLWriter * | pWriter, | |
DocListType | iType, | |||
DataBuffer * | b | |||
) | [static] |
Definition at line 761 of file fts2.c.
References DLWriter::b, DLWriter::iPrevDocid, and DLWriter::iType.
Referenced by dlcNew(), docListAndMerge(), docListExceptMerge(), docListMerge(), docListOrMerge(), docListPhraseMerge(), docListTrim(), and docListUnion().
static void docListAccumulateUnion | ( | DataBuffer * | acc, | |
const char * | pData, | |||
int | nData | |||
) | [static] |
Definition at line 5344 of file fts2.c.
References dataBufferDestroy(), dataBufferInit(), docListUnion(), DataBuffer::nData, and DataBuffer::pData.
Referenced by loadSegmentLeavesInt().
static void docListAndMerge | ( | const char * | pLeft, | |
int | nLeft, | |||
const char * | pRight, | |||
int | nRight, | |||
DataBuffer * | pOut | |||
) | [static] |
Definition at line 1498 of file fts2.c.
References DL_DOCIDS, dlrAtEnd(), dlrDestroy(), dlrDocid(), dlrInit(), dlrStep(), dlwAdd(), dlwDestroy(), dlwInit(), left, right, and writer().
Referenced by fulltextQuery().
static void docListExceptMerge | ( | const char * | pLeft, | |
int | nLeft, | |||
const char * | pRight, | |||
int | nRight, | |||
DataBuffer * | pOut | |||
) | [static] |
Definition at line 1583 of file fts2.c.
References dataBufferAppend(), DL_DOCIDS, dlrAtEnd(), dlrDestroy(), dlrDocid(), dlrInit(), dlrStep(), dlwAdd(), dlwDestroy(), dlwInit(), left, right, and writer().
Referenced by fulltextQuery().
static void docListMerge | ( | DataBuffer * | out, | |
DLReader * | pReaders, | |||
int | nReaders | |||
) | [static] |
Definition at line 1210 of file fts2.c.
References dataBufferAppend(), dataBufferExpand(), dlrAllDataBytes(), dlrAtEnd(), dlrDocData(), dlrDocDataBytes(), dlrDocid(), dlrStep(), dlwAppend(), dlwDestroy(), dlwInit(), OrderedDLReader::idx, MERGE_COUNT, orderedDLReaderReorder(), OrderedDLReader::pReader, and writer().
Referenced by leafWriterStepMerge(), loadSegment(), and optimizeInternal().
static int docListOfTerm | ( | fulltext_vtab * | v, | |
int | iColumn, | |||
QueryTerm * | pQTerm, | |||
DataBuffer * | pResult | |||
) | [static] |
Definition at line 3445 of file fts2.c.
References dataBufferDestroy(), dataBufferInit(), DL_DEFAULT, DL_DOCIDS, DL_POSITIONS, docListPhraseMerge(), QueryTerm::isPrefix, left, DataBuffer::nData, fulltext_vtab::nPendingData, QueryTerm::nPhrase, QueryTerm::nTerm, DataBuffer::pData, QueryTerm::pTerm, right, SQLITE_OK, and termSelect().
Referenced by fulltextQuery().
static void docListOrMerge | ( | const char * | pLeft, | |
int | nLeft, | |||
const char * | pRight, | |||
int | nRight, | |||
DataBuffer * | pOut | |||
) | [static] |
Definition at line 1533 of file fts2.c.
References dataBufferAppend(), DL_DOCIDS, dlrAtEnd(), dlrDestroy(), dlrDocid(), dlrInit(), dlrStep(), dlwAdd(), dlwDestroy(), dlwInit(), left, right, and writer().
Referenced by fulltextQuery().
static void docListPhraseMerge | ( | const char * | pLeft, | |
int | nLeft, | |||
const char * | pRight, | |||
int | nRight, | |||
DocListType | iType, | |||
DataBuffer * | pOut | |||
) | [static] |
Definition at line 1460 of file fts2.c.
References DL_POSITIONS, DL_POSITIONS_OFFSETS, dlrAtEnd(), dlrDestroy(), dlrDocid(), dlrInit(), dlrStep(), dlwDestroy(), dlwInit(), left, posListPhraseMerge(), right, and writer().
Referenced by docListOfTerm().
static void docListTrim | ( | DocListType | iType, | |
const char * | pData, | |||
int | nData, | |||
int | iColumn, | |||
DocListType | iOutType, | |||
DataBuffer * | out | |||
) | [static] |
Definition at line 1116 of file fts2.c.
References dlrAtEnd(), dlrDestroy(), dlrDocid(), dlrInit(), dlrStep(), dlwDestroy(), dlwInit(), match(), plrAtEnd(), plrColumn(), plrDestroy(), plrEndOffset(), plrInit(), plrPosition(), plrStartOffset(), plrStep(), plwAdd(), plwDestroy(), plwInit(), and plwTerminate().
Referenced by optimizeInternal(), and termSelect().
static void docListUnion | ( | const char * | pLeft, | |
int | nLeft, | |||
const char * | pRight, | |||
int | nRight, | |||
DataBuffer * | pOut | |||
) | [static] |
Definition at line 1352 of file fts2.c.
References dataBufferAppend(), DL_DEFAULT, dlrAtEnd(), dlrDestroy(), dlrDocid(), dlrInit(), dlrStep(), dlwCopy(), dlwDestroy(), dlwInit(), left, posListUnion(), right, and writer().
Referenced by docListAccumulateUnion().
static int endsInWhiteSpace | ( | StringBuffer * | p | ) | [static] |
Definition at line 561 of file fts2.c.
References safe_isspace(), stringBufferData(), and stringBufferLength().
Referenced by appendWhiteSpace(), and trimWhiteSpace().
static char* firstToken | ( | char * | zIn, | |
char ** | pzTail | |||
) | [static] |
Definition at line 2615 of file fts2.c.
References dequoteString(), getToken(), TOKEN_EOF, TOKEN_SPACE, and ttype.
Referenced by parseSpec().
static int flushPendingTerms | ( | fulltext_vtab * | v | ) | [static] |
Definition at line 5842 of file fts2.c.
References clearPendingTerms(), fulltext_vtab::nPendingData, fulltext_vtab::pendingTerms, SQLITE_OK, and writeZeroSegment().
Referenced by fulltextQuery(), fulltextSync(), initPendingTerms(), and optimizeFunc().
static void freeStringArray | ( | int | nString, | |
const char ** | pString | |||
) | [static] |
Definition at line 2048 of file fts2.c.
References sqlite3_free().
Referenced by content_select(), and deleteTerms().
static void fulltext_vtab_destroy | ( | fulltext_vtab * | v | ) | [static] |
Definition at line 2365 of file fts2.c.
References fulltext_vtab::azColumn, fulltext_vtab::azContentColumn, clearPendingTerms(), MAX_STMT, MERGE_COUNT, fulltext_vtab::nColumn, fulltext_vtab::pFulltextStatements, fulltext_vtab::pLeafSelectStmts, sqlite3_tokenizer::pModule, fulltext_vtab::pTokenizer, sqlite3_finalize(), sqlite3_free(), TRACE, and sqlite3_tokenizer_module::xDestroy.
Referenced by constructVtab(), fulltextDestroy(), and fulltextDisconnect().
static int fulltextBegin | ( | sqlite3_vtab * | pVtab | ) | [static] |
Definition at line 5934 of file fts2.c.
References clearPendingTerms(), fulltext_vtab::nPendingData, and TRACE.
static int fulltextBestIndex | ( | sqlite3_vtab * | pVTab, | |
sqlite3_index_info * | pInfo | |||
) | [static] |
Definition at line 2950 of file fts2.c.
References sqlite3_index_info::aConstraint, sqlite3_index_info::aConstraintUsage, sqlite3_index_info::sqlite3_index_constraint_usage::argvIndex, sqlite3_index_info::estimatedCost, sqlite3_index_info::idxNum, sqlite3_index_info::nConstraint, sqlite3_index_info::sqlite3_index_constraint_usage::omit, QUERY_FULLTEXT, QUERY_GENERIC, QUERY_ROWID, SQLITE_INDEX_CONSTRAINT_EQ, SQLITE_INDEX_CONSTRAINT_MATCH, SQLITE_OK, and TRACE.
static int fulltextClose | ( | sqlite3_vtab_cursor * | pCursor | ) | [static] |
Definition at line 3375 of file fts2.c.
References dataBufferDestroy(), dlrDestroy(), fulltext_cursor::pStmt, fulltext_cursor::q, queryClear(), fulltext_cursor::reader, fulltext_cursor::result, fulltext_cursor::snippet, snippetClear(), sqlite3_finalize(), sqlite3_free(), SQLITE_OK, and TRACE.
static int fulltextColumn | ( | sqlite3_vtab_cursor * | pCursor, | |
sqlite3_context * | pContext, | |||
int | idxCol | |||
) | [static] |
Definition at line 3861 of file fts2.c.
References cursor_vtab(), fulltext_vtab::nColumn, fulltext_cursor::pStmt, sqlite3_column_value(), sqlite3_result_blob(), sqlite3_result_value(), SQLITE_OK, and SQLITE_TRANSIENT.
static int fulltextCommit | ( | sqlite3_vtab * | pVtab | ) | [static] |
Definition at line 5945 of file fts2.c.
References clearPendingTerms(), fulltext_vtab::nPendingData, and TRACE.
static int fulltextConnect | ( | sqlite3 * | db, | |
void * | pAux, | |||
int | argc, | |||
const char *const * | argv, | |||
sqlite3_vtab ** | ppVTab, | |||
char ** | pzErr | |||
) | [static] |
Definition at line 2885 of file fts2.c.
References clearTableSpec(), constructVtab(), parseSpec(), and SQLITE_OK.
static int fulltextCreate | ( | sqlite3 * | db, | |
void * | pAux, | |||
int | argc, | |||
const char *const * | argv, | |||
sqlite3_vtab ** | ppVTab, | |||
char ** | pzErr | |||
) | [static] |
Definition at line 2907 of file fts2.c.
References append(), appendList(), TableSpec::azContentColumn, clearTableSpec(), constructVtab(), initStringBuffer(), TableSpec::nColumn, parseSpec(), sql_exec(), SQLITE_OK, stringBufferData(), stringBufferDestroy(), TRACE, TableSpec::zDb, and TableSpec::zName.
static int fulltextDestroy | ( | sqlite3_vtab * | pVTab | ) | [static] |
Definition at line 2990 of file fts2.c.
References fulltext_vtab::db, fulltext_vtab_destroy(), sql_exec(), SQLITE_OK, TRACE, fulltext_vtab::zDb, and fulltext_vtab::zName.
static int fulltextDisconnect | ( | sqlite3_vtab * | pVTab | ) | [static] |
Definition at line 2984 of file fts2.c.
References fulltext_vtab_destroy(), SQLITE_OK, and TRACE.
static int fulltextEof | ( | sqlite3_vtab_cursor * | pCursor | ) | [static] |
Definition at line 3850 of file fts2.c.
References fulltext_cursor::eof.
static int fulltextFilter | ( | sqlite3_vtab_cursor * | pCursor, | |
int | idxNum, | |||
const char * | idxStr, | |||
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 3772 of file fts2.c.
References cursor_vtab(), dataBufferInit(), dataBufferReset(), fulltext_vtab::db, DL_DOCIDS, dlrDestroy(), dlrInit(), fulltextNext(), fulltextQuery(), fulltext_cursor::iCursorType, fulltext_cursor::pStmt, fulltext_cursor::q, QUERY_FULLTEXT, QUERY_GENERIC, QUERY_ROWID, queryClear(), fulltext_cursor::reader, fulltext_cursor::result, sql_prepare(), sqlite3_bind_int64(), sqlite3_finalize(), sqlite3_free(), sqlite3_mprintf(), sqlite3_reset(), sqlite3_value_int64(), sqlite3_value_text(), SQLITE_OK, TRACE, fulltext_vtab::zDb, and fulltext_vtab::zName.
static int fulltextFindFunction | ( | sqlite3_vtab * | pVtab, | |
int | nArg, | |||
const char * | zName, | |||
void(**)(sqlite3_context *, int, sqlite3_value **) | pxFunc, | |||
void ** | ppArg | |||
) | [static] |
Definition at line 6679 of file fts2.c.
References optimizeFunc(), snippetFunc(), and snippetOffsetsFunc().
static int fulltextNext | ( | sqlite3_vtab_cursor * | pCursor | ) | [static] |
Definition at line 3387 of file fts2.c.
References dlrAtEnd(), dlrDocid(), dlrStep(), fulltext_cursor::eof, fulltext_cursor::iCursorType, fulltext_cursor::pStmt, QUERY_FULLTEXT, fulltext_cursor::reader, fulltext_cursor::result, fulltext_cursor::snippet, snippetClear(), sqlite3_bind_int64(), sqlite3_reset(), sqlite3_step(), SQLITE_DONE, SQLITE_ERROR, SQLITE_OK, SQLITE_ROW, and TRACE.
Referenced by fulltextFilter().
static int fulltextOpen | ( | sqlite3_vtab * | pVTab, | |
sqlite3_vtab_cursor ** | ppCursor | |||
) | [static] |
Definition at line 3006 of file fts2.c.
References fulltext_cursor::base, sqlite3_malloc(), SQLITE_NOMEM, SQLITE_OK, and TRACE.
static int fulltextQuery | ( | fulltext_vtab * | v, | |
int | iColumn, | |||
const char * | zInput, | |||
int | nInput, | |||
DataBuffer * | pResult, | |||
Query * | pQuery | |||
) | [static] |
Definition at line 3646 of file fts2.c.
References dataBufferDestroy(), dataBufferInit(), docListAndMerge(), docListExceptMerge(), docListOfTerm(), docListOrMerge(), flushPendingTerms(), left, DataBuffer::nData, QueryTerm::nPhrase, Query::nTerms, parseQuery(), DataBuffer::pData, Query::pTerms, queryClear(), right, SQLITE_ERROR, and SQLITE_OK.
Referenced by fulltextFilter().
static int fulltextRename | ( | sqlite3_vtab * | pVtab, | |
const char * | zName | |||
) | [static] |
Definition at line 6716 of file fts2.c.
References fulltext_vtab::db, sqlite3_exec(), sqlite3_free(), sqlite3_mprintf(), SQLITE_NOMEM, fulltext_vtab::zDb, and fulltext_vtab::zName.
static int fulltextRollback | ( | sqlite3_vtab * | pVtab | ) | [static] |
Definition at line 5954 of file fts2.c.
References clearPendingTerms(), and TRACE.
static int fulltextRowid | ( | sqlite3_vtab_cursor * | pCursor, | |
sqlite_int64 * | pRowid | |||
) | [static] |
Definition at line 3882 of file fts2.c.
References fulltext_cursor::pStmt, sqlite3_column_int64(), and SQLITE_OK.
static char* fulltextSchema | ( | int | nColumn, | |
const char *const * | azColumn, | |||
const char * | zTableName | |||
) | [static] |
Definition at line 2782 of file fts2.c.
References sqlite3_free(), and sqlite3_mprintf().
Referenced by constructVtab().
static int fulltextSync | ( | sqlite3_vtab * | pVtab | ) | [static] |
Definition at line 5929 of file fts2.c.
References flushPendingTerms(), and TRACE.
static int fulltextUpdate | ( | sqlite3_vtab * | pVtab, | |
int | nArg, | |||
sqlite3_value ** | ppArg, | |||
sqlite_int64 * | pRowid | |||
) | [static] |
Definition at line 5875 of file fts2.c.
References clearPendingTerms(), content_exists(), index_delete(), index_insert(), index_update(), fulltext_vtab::nColumn, segdir_delete_all(), sqlite3_value_int64(), sqlite3_value_type(), SQLITE_DONE, SQLITE_ERROR, SQLITE_INTEGER, SQLITE_NULL, SQLITE_OK, SQLITE_ROW, and TRACE.
static void getChildrenContaining | ( | const char * | pData, | |
int | nData, | |||
const char * | pTerm, | |||
int | nTerm, | |||
int | isPrefix, | |||
sqlite_int64 * | piStartChild, | |||
sqlite_int64 * | piEndChild | |||
) | [static] |
Definition at line 5532 of file fts2.c.
References interiorReaderAtEnd(), interiorReaderCurrentBlockid(), interiorReaderDestroy(), interiorReaderInit(), interiorReaderStep(), and interiorReaderTermCmp().
Referenced by loadAndGetChildrenContaining(), and loadSegmentInt().
static int getToken | ( | const char * | z, | |
int * | tokenType | |||
) | [static] |
Definition at line 2436 of file fts2.c.
References IdChar, safe_isspace(), TOKEN_EOF, TOKEN_ID, TOKEN_PUNCT, TOKEN_SPACE, and TOKEN_STRING.
Referenced by firstToken(), and tokenizeString().
static int getVarint | ( | const char * | p, | |
sqlite_int64 * | v | |||
) | [static] |
Definition at line 426 of file fts2.c.
References VARINT_MAX.
static int getVarint32 | ( | const char * | p, | |
int * | pi | |||
) | [static] |
static void hashDestroy | ( | void * | p | ) | [static] |
Definition at line 6760 of file fts2.c.
References sqlite3_free(), and sqlite3Fts2HashClear().
Referenced by sqlite3Fts2Init().
static int index_delete | ( | fulltext_vtab * | v, | |
sqlite_int64 | iRow | |||
) | [static] |
Definition at line 4007 of file fts2.c.
References content_delete(), deleteTerms(), initPendingTerms(), and SQLITE_OK.
Referenced by fulltextUpdate().
static int index_insert | ( | fulltext_vtab * | v, | |
sqlite3_value * | pRequestRowid, | |||
sqlite3_value ** | pValues, | |||
sqlite_int64 * | piRowid | |||
) | [static] |
Definition at line 3990 of file fts2.c.
References content_insert(), fulltext_vtab::db, initPendingTerms(), insertTerms(), sqlite3_last_insert_rowid(), and SQLITE_OK.
Referenced by fulltextUpdate().
static int index_update | ( | fulltext_vtab * | v, | |
sqlite_int64 | iRow, | |||
sqlite3_value ** | pValues | |||
) | [static] |
Definition at line 4021 of file fts2.c.
References content_update(), deleteTerms(), initPendingTerms(), insertTerms(), and SQLITE_OK.
Referenced by fulltextUpdate().
static int initPendingTerms | ( | fulltext_vtab * | v, | |
sqlite_int64 | iDocid | |||
) | [static] |
Definition at line 5854 of file fts2.c.
References flushPendingTerms(), FTS2_HASH_STRING, fts2HashInit, fulltext_vtab::iPrevDocid, kPendingThreshold, fulltext_vtab::nPendingData, fulltext_vtab::pendingTerms, and SQLITE_OK.
Referenced by index_delete(), index_insert(), and index_update().
static void initStringBuffer | ( | StringBuffer * | sb | ) | [static] |
Definition at line 527 of file fts2.c.
References StringBuffer::b, dataBufferInit(), and dataBufferReplace().
Referenced by contentInsertStatement(), contentUpdateStatement(), fulltextCreate(), snippetOffsetText(), and snippetText().
static int insertTerms | ( | fulltext_vtab * | v, | |
sqlite_int64 | iRowid, | |||
sqlite3_value ** | pValues | |||
) | [static] |
Definition at line 3951 of file fts2.c.
References buildTerms(), fulltext_vtab::nColumn, sqlite3_value_text(), and SQLITE_OK.
Referenced by index_insert(), and index_update().
static InteriorBlock* interiorBlockNew | ( | int | iHeight, | |
sqlite_int64 | iChildBlock, | |||
const char * | pTerm, | |||
int | nTerm | |||
) | [static] |
Definition at line 4079 of file fts2.c.
References block(), InteriorBlock::data, dataBufferInit(), dataBufferReplace(), INTERIOR_MAX, putVarint, sqlite3_malloc(), InteriorBlock::term, and VARINT_MAX.
Referenced by interiorWriterAppend(), and interiorWriterInit().
static int interiorReaderAtEnd | ( | InteriorReader * | pReader | ) | [static] |
Definition at line 4373 of file fts2.c.
References DataBuffer::nData, and InteriorReader::term.
Referenced by getChildrenContaining(), interiorReaderStep(), interiorReaderTerm(), and interiorReaderTermBytes().
static sqlite_int64 interiorReaderCurrentBlockid | ( | InteriorReader * | pReader | ) | [static] |
Definition at line 4377 of file fts2.c.
References InteriorReader::iBlockid.
Referenced by getChildrenContaining().
static void interiorReaderDestroy | ( | InteriorReader * | pReader | ) | [static] |
Definition at line 4333 of file fts2.c.
References dataBufferDestroy(), SCRAMBLE, and InteriorReader::term.
Referenced by getChildrenContaining().
static void interiorReaderInit | ( | const char * | pData, | |
int | nData, | |||
InteriorReader * | pReader | |||
) | [static] |
Definition at line 4341 of file fts2.c.
References CLEAR, dataBufferInit(), dataBufferReplace(), getVarint, getVarint32, InteriorReader::iBlockid, InteriorReader::nData, InteriorReader::pData, and InteriorReader::term.
Referenced by getChildrenContaining().
static void interiorReaderStep | ( | InteriorReader * | pReader | ) | [static] |
Definition at line 4391 of file fts2.c.
References dataBufferAppend(), dataBufferReset(), getVarint32, InteriorReader::iBlockid, interiorReaderAtEnd(), DataBuffer::nData, InteriorReader::nData, InteriorReader::pData, and InteriorReader::term.
Referenced by getChildrenContaining().
static const char* interiorReaderTerm | ( | InteriorReader * | pReader | ) | [static] |
Definition at line 4385 of file fts2.c.
References interiorReaderAtEnd(), DataBuffer::pData, and InteriorReader::term.
Referenced by interiorReaderTermCmp().
static int interiorReaderTermBytes | ( | InteriorReader * | pReader | ) | [static] |
Definition at line 4381 of file fts2.c.
References interiorReaderAtEnd(), DataBuffer::nData, and InteriorReader::term.
Referenced by interiorReaderTermCmp().
static int interiorReaderTermCmp | ( | InteriorReader * | pReader, | |
const char * | pTerm, | |||
int | nTerm, | |||
int | isPrefix | |||
) | [static] |
Definition at line 4419 of file fts2.c.
References interiorReaderTerm(), and interiorReaderTermBytes().
Referenced by getChildrenContaining().
static void interiorWriterAppend | ( | InteriorWriter * | pWriter, | |
const char * | pTerm, | |||
int | nTerm, | |||
sqlite_int64 | iChildBlock | |||
) | [static] |
Definition at line 4199 of file fts2.c.
References ASSERT_VALID_INTERIOR_BLOCK, InteriorBlock::data, dataBufferAppend2(), dataBufferReplace(), dataBufferReset(), InteriorWriter::iHeight, INTERIOR_MAX, INTERIOR_MIN_TERMS, interiorBlockNew(), InteriorWriter::iOpeningChildBlock, InteriorWriter::last, DataBuffer::nData, InteriorBlock::next, DataBuffer::pData, putVarint, InteriorWriter::term, and VARINT_MAX.
Referenced by interiorWriterRootInfo(), and leafWriterInternalFlush().
static int interiorWriterDestroy | ( | InteriorWriter * | pWriter | ) | [static] |
Definition at line 4251 of file fts2.c.
References block(), InteriorBlock::data, dataBufferDestroy(), InteriorWriter::first, InteriorBlock::next, InteriorWriter::parentWriter, SCRAMBLE, sqlite3_free(), SQLITE_OK, InteriorWriter::term, and InteriorBlock::term.
Referenced by leafWriterDestroy().
static void interiorWriterInit | ( | int | iHeight, | |
const char * | pTerm, | |||
int | nTerm, | |||
sqlite_int64 | iChildBlock, | |||
InteriorWriter * | pWriter | |||
) | [static] |
Definition at line 4178 of file fts2.c.
References ASSERT_VALID_INTERIOR_BLOCK, block(), CLEAR, dataBufferInit(), InteriorWriter::first, InteriorWriter::iHeight, interiorBlockNew(), InteriorWriter::iOpeningChildBlock, InteriorWriter::last, and InteriorWriter::term.
Referenced by interiorWriterRootInfo(), and leafWriterInternalFlush().
static int interiorWriterRootInfo | ( | fulltext_vtab * | v, | |
InteriorWriter * | pWriter, | |||
char ** | ppRootInfo, | |||
int * | pnRootInfo, | |||
sqlite_int64 * | piEndBlockid | |||
) | [static] |
Definition at line 4275 of file fts2.c.
References ASSERT_VALID_INTERIOR_BLOCK, block(), block_insert(), InteriorBlock::data, InteriorWriter::first, InteriorWriter::iHeight, interiorWriterAppend(), interiorWriterInit(), InteriorWriter::last, DataBuffer::nData, InteriorBlock::next, InteriorWriter::parentWriter, DataBuffer::pData, ROOT_MAX, sqlite3_malloc(), SQLITE_OK, and InteriorBlock::term.
Referenced by leafWriterRootInfo().
static int leafReaderAtEnd | ( | LeafReader * | pReader | ) | [static] |
Definition at line 4917 of file fts2.c.
References LeafReader::nData.
Referenced by leafReaderStep(), and leavesReaderStep().
static const char* leafReaderData | ( | LeafReader * | pReader | ) | [static] |
Definition at line 4937 of file fts2.c.
References getVarint32, DataBuffer::nData, LeafReader::pData, and LeafReader::term.
Referenced by leavesReaderData().
static int leafReaderDataBytes | ( | LeafReader * | pReader | ) | [static] |
Definition at line 4931 of file fts2.c.
References getVarint32, DataBuffer::nData, LeafReader::pData, and LeafReader::term.
Referenced by leavesReaderDataBytes().
static void leafReaderDestroy | ( | LeafReader * | pReader | ) | [static] |
Definition at line 4912 of file fts2.c.
References dataBufferDestroy(), SCRAMBLE, and LeafReader::term.
Referenced by leavesReaderDestroy(), and leavesReaderStep().
static void leafReaderInit | ( | const char * | pData, | |
int | nData, | |||
LeafReader * | pReader | |||
) | [static] |
Definition at line 4944 of file fts2.c.
References CLEAR, dataBufferInit(), dataBufferReplace(), getVarint32, LeafReader::nData, LeafReader::pData, and LeafReader::term.
Referenced by leavesReaderInit(), and leavesReaderStep().
static void leafReaderStep | ( | LeafReader * | pReader | ) | [static] |
Definition at line 4965 of file fts2.c.
References dataBufferAppend(), getVarint32, leafReaderAtEnd(), DataBuffer::nData, LeafReader::nData, LeafReader::pData, and LeafReader::term.
Referenced by leavesReaderStep().
static const char* leafReaderTerm | ( | LeafReader * | pReader | ) | [static] |
Definition at line 4925 of file fts2.c.
References DataBuffer::nData, DataBuffer::pData, and LeafReader::term.
Referenced by leavesReaderTerm().
static int leafReaderTermBytes | ( | LeafReader * | pReader | ) | [static] |
Definition at line 4922 of file fts2.c.
References DataBuffer::nData, and LeafReader::term.
Referenced by leavesReaderTermBytes().
static int leafReaderTermCmp | ( | LeafReader * | pReader, | |
const char * | pTerm, | |||
int | nTerm, | |||
int | isPrefix | |||
) | [static] |
Definition at line 4993 of file fts2.c.
References DataBuffer::nData, DataBuffer::pData, and LeafReader::term.
Referenced by leavesReaderTermCmp(), and loadSegmentLeavesInt().
static void leafWriterDestroy | ( | LeafWriter * | pWriter | ) | [static] |
Definition at line 4684 of file fts2.c.
References LeafWriter::data, dataBufferDestroy(), LeafWriter::has_parent, interiorWriterDestroy(), LeafWriter::parentWriter, and LeafWriter::term.
Referenced by optimizeFunc(), segmentMerge(), and writeZeroSegment().
static int leafWriterEncodeTerm | ( | LeafWriter * | pWriter, | |
const char * | pTerm, | |||
int | nTerm | |||
) | [static] |
Definition at line 4695 of file fts2.c.
References LeafWriter::data, dataBufferAppend2(), dataBufferReplace(), DataBuffer::nData, DataBuffer::pData, putVarint, LeafWriter::term, and VARINT_MAX.
Referenced by leafWriterStepMerge().
static int leafWriterFinalize | ( | fulltext_vtab * | v, | |
LeafWriter * | pWriter | |||
) | [static] |
Definition at line 4668 of file fts2.c.
References LeafWriter::idx, LeafWriter::iEndBlockid, LeafWriter::iLevel, LeafWriter::iStartBlockid, leafWriterRootInfo(), segdir_set(), and SQLITE_OK.
Referenced by optimizeFunc(), segmentMerge(), and writeZeroSegment().
static int leafWriterFlush | ( | fulltext_vtab * | v, | |
LeafWriter * | pWriter | |||
) | [static] |
Definition at line 4616 of file fts2.c.
References LeafWriter::data, dataBufferReset(), leafWriterInternalFlush(), DataBuffer::nData, and SQLITE_OK.
Referenced by leafWriterRootInfo().
static void leafWriterInit | ( | int | iLevel, | |
int | idx, | |||
LeafWriter * | pWriter | |||
) | [static] |
Definition at line 4486 of file fts2.c.
References CLEAR, LeafWriter::data, dataBufferInit(), LeafWriter::idx, LeafWriter::iLevel, LEAF_MAX, and LeafWriter::term.
Referenced by optimizeFunc(), segmentMerge(), and writeZeroSegment().
static int leafWriterInlineFlush | ( | fulltext_vtab * | v, | |
LeafWriter * | pWriter, | |||
const char * | pTerm, | |||
int | nTerm, | |||
int | iDoclistData | |||
) | [static] |
Definition at line 4737 of file fts2.c.
References LeafWriter::data, leafWriterInternalFlush(), DataBuffer::nData, DataBuffer::pData, putVarint, and VARINT_MAX.
Referenced by leafWriterStepMerge().
static int leafWriterInternalFlush | ( | fulltext_vtab * | v, | |
LeafWriter * | pWriter, | |||
int | iData, | |||
int | nData | |||
) | [static] |
Definition at line 4569 of file fts2.c.
References ASSERT_VALID_LEAF_NODE, block_insert(), LeafWriter::data, getVarint32, LeafWriter::has_parent, LeafWriter::iEndBlockid, interiorWriterAppend(), interiorWriterInit(), LeafWriter::iStartBlockid, DataBuffer::nData, LeafWriter::nTermDistinct, LeafWriter::parentWriter, DataBuffer::pData, and SQLITE_OK.
Referenced by leafWriterFlush(), leafWriterInlineFlush(), and leafWriterStepMerge().
static int leafWriterRootInfo | ( | fulltext_vtab * | v, | |
LeafWriter * | pWriter, | |||
char ** | ppRootInfo, | |||
int * | pnRootInfo, | |||
sqlite_int64 * | piEndBlockid | |||
) | [static] |
Definition at line 4633 of file fts2.c.
References LeafWriter::data, LeafWriter::has_parent, LeafWriter::iEndBlockid, interiorWriterRootInfo(), leafWriterFlush(), DataBuffer::nData, LeafWriter::parentWriter, DataBuffer::pData, ROOT_MAX, and SQLITE_OK.
Referenced by leafWriterFinalize().
static int leafWriterStep | ( | fulltext_vtab * | v, | |
LeafWriter * | pWriter, | |||
const char * | pTerm, | |||
int | nTerm, | |||
const char * | pData, | |||
int | nData | |||
) | [static] |
Definition at line 4889 of file fts2.c.
References DL_DEFAULT, dlrDestroy(), dlrInit(), and leafWriterStepMerge().
Referenced by optimizeInternal(), and writeZeroSegment().
static int leafWriterStepMerge | ( | fulltext_vtab * | v, | |
LeafWriter * | pWriter, | |||
const char * | pTerm, | |||
int | nTerm, | |||
DLReader * | pReaders, | |||
int | nReaders | |||
) | [static] |
Definition at line 4761 of file fts2.c.
References ASSERT_VALID_DOCLIST, ASSERT_VALID_LEAF_NODE, LeafWriter::data, dataBufferAppend(), dataBufferReset(), DL_DEFAULT, dlrAllDataBytes(), docListMerge(), LEAF_MAX, leafWriterEncodeTerm(), leafWriterInlineFlush(), leafWriterInternalFlush(), DataBuffer::nData, LeafWriter::nTermDistinct, DataBuffer::pData, putVarint, SQLITE_OK, STANDALONE_MIN, and VARINT_MAX.
Referenced by leafWriterStep(), and leavesReadersMerge().
static int leavesReaderAtEnd | ( | LeavesReader * | pReader | ) | [static] |
Definition at line 5043 of file fts2.c.
References LeavesReader::eof.
Referenced by leavesReaderStep(), leavesReaderTermCmp(), loadSegmentLeavesInt(), optLeavesReaderAtEnd(), and segmentMerge().
static int leavesReaderCmp | ( | LeavesReader * | lr1, | |
LeavesReader * | lr2 | |||
) | [static] |
Definition at line 5165 of file fts2.c.
References LeavesReader::idx, and leavesReaderTermCmp().
Referenced by leavesReaderReorder().
static const char* leavesReaderData | ( | LeavesReader * | pReader | ) | [static] |
Definition at line 5038 of file fts2.c.
References LeavesReader::eof, LeavesReader::leafReader, and leafReaderData().
Referenced by leavesReadersMerge(), loadSegmentLeavesInt(), and optLeavesReaderData().
static int leavesReaderDataBytes | ( | LeavesReader * | pReader | ) | [static] |
Definition at line 5034 of file fts2.c.
References LeavesReader::eof, LeavesReader::leafReader, and leafReaderDataBytes().
Referenced by leavesReadersMerge(), loadSegmentLeavesInt(), and optLeavesReaderDataBytes().
static void leavesReaderDestroy | ( | LeavesReader * | pReader | ) | [static] |
Definition at line 5064 of file fts2.c.
References dataBufferDestroy(), LeavesReader::idx, LeavesReader::leafReader, leafReaderDestroy(), LeavesReader::pStmt, LeavesReader::rootData, SCRAMBLE, and sqlite3_finalize().
Referenced by leavesReadersInit(), loadSegmentLeaf(), loadSegmentLeaves(), optimizeFunc(), and segmentMerge().
static int leavesReaderInit | ( | fulltext_vtab * | v, | |
int | idx, | |||
sqlite_int64 | iStartBlockid, | |||
sqlite_int64 | iEndBlockid, | |||
const char * | pRootData, | |||
int | nRootData, | |||
LeavesReader * | pReader | |||
) | [static] |
Definition at line 5080 of file fts2.c.
References CLEAR, dataBufferInit(), dataBufferReplace(), LeavesReader::eof, LeavesReader::idx, LeavesReader::leafReader, leafReaderInit(), DataBuffer::nData, DataBuffer::pData, LeavesReader::pStmt, LeavesReader::rootData, sql_get_leaf_statement(), sqlite3_bind_int64(), sqlite3_column_blob(), sqlite3_column_bytes(), sqlite3_step(), SQLITE_DONE, SQLITE_OK, and SQLITE_ROW.
Referenced by leavesReadersInit(), loadSegmentLeaf(), loadSegmentLeaves(), and optimizeFunc().
static void leavesReaderReorder | ( | LeavesReader * | pLr, | |
int | nLr | |||
) | [static] |
Definition at line 5174 of file fts2.c.
References leavesReaderCmp().
Referenced by leavesReadersInit(), and segmentMerge().
static int leavesReaderReset | ( | LeavesReader * | pReader | ) | [static] |
Definition at line 5060 of file fts2.c.
References LeavesReader::pStmt, and sqlite3_reset().
Referenced by loadSegmentLeaf(), and loadSegmentLeaves().
static int leavesReadersInit | ( | fulltext_vtab * | v, | |
int | iLevel, | |||
LeavesReader * | pReaders, | |||
int * | piReaders | |||
) | [static] |
Definition at line 5188 of file fts2.c.
References leavesReaderDestroy(), leavesReaderInit(), leavesReaderReorder(), MERGE_COUNT, SEGDIR_SELECT_LEVEL_STMT, sql_get_statement(), sqlite3_bind_int(), sqlite3_column_blob(), sqlite3_column_bytes(), sqlite3_column_int64(), sqlite3_step(), SQLITE_DONE, SQLITE_OK, and SQLITE_ROW.
Referenced by segmentMerge().
static int leavesReadersMerge | ( | fulltext_vtab * | v, | |
LeavesReader * | pReaders, | |||
int | nReaders, | |||
LeafWriter * | pWriter | |||
) | [static] |
Definition at line 5232 of file fts2.c.
References DL_DEFAULT, dlrInit(), leafWriterStepMerge(), leavesReaderData(), leavesReaderDataBytes(), leavesReaderTerm(), leavesReaderTermBytes(), and MERGE_COUNT.
Referenced by segmentMerge().
static int leavesReaderStep | ( | fulltext_vtab * | v, | |
LeavesReader * | pReader | |||
) | [static] |
Definition at line 5124 of file fts2.c.
References LeavesReader::eof, LeavesReader::leafReader, leafReaderAtEnd(), leafReaderDestroy(), leafReaderInit(), leafReaderStep(), leavesReaderAtEnd(), DataBuffer::pData, LeavesReader::pStmt, LeavesReader::rootData, sqlite3_column_blob(), sqlite3_column_bytes(), sqlite3_step(), SQLITE_DONE, SQLITE_OK, and SQLITE_ROW.
Referenced by loadSegmentLeavesInt(), optLeavesReaderStep(), and segmentMerge().
static const char* leavesReaderTerm | ( | LeavesReader * | pReader | ) | [static] |
Definition at line 5028 of file fts2.c.
References LeavesReader::eof, LeavesReader::leafReader, and leafReaderTerm().
Referenced by leavesReadersMerge(), leavesReaderTermCmp(), and optLeavesReaderTerm().
static int leavesReaderTermBytes | ( | LeavesReader * | pReader | ) | [static] |
Definition at line 5024 of file fts2.c.
References LeavesReader::eof, LeavesReader::leafReader, and leafReaderTermBytes().
Referenced by leavesReadersMerge(), leavesReaderTermCmp(), and optLeavesReaderTermBytes().
static int leavesReaderTermCmp | ( | LeavesReader * | lr1, | |
LeavesReader * | lr2 | |||
) | [static] |
Definition at line 5150 of file fts2.c.
References LeavesReader::leafReader, leafReaderTermCmp(), leavesReaderAtEnd(), leavesReaderTerm(), and leavesReaderTermBytes().
Referenced by leavesReaderCmp(), optLeavesReaderTermCmp(), and segmentMerge().
static int loadAndGetChildrenContaining | ( | fulltext_vtab * | v, | |
sqlite_int64 | iBlockid, | |||
const char * | pTerm, | |||
int | nTerm, | |||
int | isPrefix, | |||
sqlite_int64 * | piStartChild, | |||
sqlite_int64 * | piEndChild | |||
) | [static] |
Definition at line 5569 of file fts2.c.
References BLOCK_SELECT_STMT, getChildrenContaining(), sql_get_statement(), sqlite3_bind_int64(), sqlite3_column_blob(), sqlite3_column_bytes(), sqlite3_step(), SQLITE_DONE, SQLITE_ERROR, SQLITE_OK, and SQLITE_ROW.
Referenced by loadSegmentInt().
static int loadSegment | ( | fulltext_vtab * | v, | |
const char * | pData, | |||
int | nData, | |||
sqlite_int64 | iLeavesEnd, | |||
const char * | pTerm, | |||
int | nTerm, | |||
int | isPrefix, | |||
DataBuffer * | out | |||
) | [static] |
Definition at line 5671 of file fts2.c.
References dataBufferDestroy(), dataBufferInit(), DL_DEFAULT, dlrDestroy(), dlrInit(), docListMerge(), loadSegmentInt(), DataBuffer::nData, fulltext_vtab::nPendingData, DataBuffer::pData, and SQLITE_OK.
Referenced by termSelect().
static int loadSegmentInt | ( | fulltext_vtab * | v, | |
const char * | pData, | |||
int | nData, | |||
sqlite_int64 | iLeavesEnd, | |||
const char * | pTerm, | |||
int | nTerm, | |||
int | isPrefix, | |||
DataBuffer * | out | |||
) | [static] |
Definition at line 5611 of file fts2.c.
References getChildrenContaining(), loadAndGetChildrenContaining(), loadSegmentLeaf(), loadSegmentLeaves(), and SQLITE_OK.
Referenced by loadSegment().
static int loadSegmentLeaf | ( | fulltext_vtab * | v, | |
const char * | pData, | |||
int | nData, | |||
const char * | pTerm, | |||
int | nTerm, | |||
int | isPrefix, | |||
DataBuffer * | out | |||
) | [static] |
Definition at line 5483 of file fts2.c.
References leavesReaderDestroy(), leavesReaderInit(), leavesReaderReset(), loadSegmentLeavesInt(), and SQLITE_OK.
Referenced by loadSegmentInt().
static int loadSegmentLeaves | ( | fulltext_vtab * | v, | |
sqlite_int64 | iStartLeaf, | |||
sqlite_int64 | iEndLeaf, | |||
const char * | pTerm, | |||
int | nTerm, | |||
int | isPrefix, | |||
DataBuffer * | out | |||
) | [static] |
Definition at line 5504 of file fts2.c.
References leavesReaderDestroy(), leavesReaderInit(), leavesReaderReset(), loadSegmentLeavesInt(), and SQLITE_OK.
Referenced by loadSegmentInt().
static int loadSegmentLeavesInt | ( | fulltext_vtab * | v, | |
LeavesReader * | pReader, | |||
const char * | pTerm, | |||
int | nTerm, | |||
int | isPrefix, | |||
DataBuffer * | out | |||
) | [static] |
Definition at line 5367 of file fts2.c.
References dataBufferDestroy(), dataBufferInit(), dataBufferReplace(), dataBufferReset(), dataBufferSwap(), docListAccumulateUnion(), LeavesReader::leafReader, leafReaderTermCmp(), leavesReaderAtEnd(), leavesReaderData(), leavesReaderDataBytes(), leavesReaderStep(), DataBuffer::nCapacity, DataBuffer::nData, DataBuffer::pData, sqlite3_free(), sqlite3_malloc(), SQLITE_NOMEM, and SQLITE_OK.
Referenced by loadSegmentLeaf(), and loadSegmentLeaves().
static void nappend | ( | StringBuffer * | sb, | |
const char * | zFrom, | |||
int | nFrom | |||
) | [static] |
Definition at line 541 of file fts2.c.
References StringBuffer::b, dataBufferAppend2(), and DataBuffer::nData.
Referenced by append(), and snippetText().
static void optimizeFunc | ( | sqlite3_context * | pContext, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 6194 of file fts2.c.
References cursor_vtab(), flushPendingTerms(), leafWriterDestroy(), leafWriterFinalize(), leafWriterInit(), leavesReaderDestroy(), leavesReaderInit(), optimizeInternal(), segdir_count(), segdir_delete(), SEGDIR_SELECT_ALL_STMT, OptLeavesReader::segment, sql_get_statement(), sqlite3_column_blob(), sqlite3_column_bytes(), sqlite3_column_int64(), sqlite3_context_db_handle(), sqlite3_errmsg(), sqlite3_free(), sqlite3_malloc(), sqlite3_result_error(), sqlite3_result_text(), sqlite3_snprintf(), sqlite3_step(), sqlite3_value_blob(), sqlite3_value_bytes(), sqlite3_value_type(), SQLITE_BLOB, SQLITE_DONE, SQLITE_OK, SQLITE_ROW, SQLITE_STATIC, and writer().
Referenced by fulltextFindFunction().
static int optimizeInternal | ( | fulltext_vtab * | v, | |
OptLeavesReader * | readers, | |||
int | nReaders, | |||
LeafWriter * | pWriter | |||
) | [static] |
Definition at line 6087 of file fts2.c.
References dataBufferDestroy(), dataBufferInit(), dataBufferReset(), DL_DEFAULT, dlrDestroy(), dlrInit(), docListMerge(), docListTrim(), LEAF_MAX, leafWriterStep(), MERGE_COUNT, DataBuffer::nData, optLeavesReaderAtEnd(), optLeavesReaderData(), optLeavesReaderDataBytes(), optLeavesReaderReorder(), optLeavesReaderStep(), optLeavesReaderTerm(), optLeavesReaderTermBytes(), optLeavesReaderTermCmp(), DataBuffer::pData, and SQLITE_OK.
Referenced by optimizeFunc().
static int optLeavesReaderAtEnd | ( | OptLeavesReader * | pReader | ) | [static] |
Definition at line 6040 of file fts2.c.
References leavesReaderAtEnd(), and OptLeavesReader::reader.
Referenced by optimizeInternal().
static int optLeavesReaderCmp | ( | OptLeavesReader * | lr1, | |
OptLeavesReader * | lr2 | |||
) | [static] |
Definition at line 6064 of file fts2.c.
References optLeavesReaderTermCmp(), and OptLeavesReader::segment.
Referenced by optLeavesReaderReorder().
static const char* optLeavesReaderData | ( | OptLeavesReader * | pReader | ) | [static] |
Definition at line 6046 of file fts2.c.
References leavesReaderData(), and OptLeavesReader::reader.
Referenced by optimizeInternal().
static int optLeavesReaderDataBytes | ( | OptLeavesReader * | pReader | ) | [static] |
Definition at line 6049 of file fts2.c.
References leavesReaderDataBytes(), and OptLeavesReader::reader.
Referenced by optimizeInternal().
static void optLeavesReaderReorder | ( | OptLeavesReader * | pLr, | |
int | nLr | |||
) | [static] |
Definition at line 6072 of file fts2.c.
References optLeavesReaderCmp().
Referenced by optimizeInternal().
static int optLeavesReaderStep | ( | fulltext_vtab * | v, | |
OptLeavesReader * | pReader | |||
) | [static] |
Definition at line 6055 of file fts2.c.
References leavesReaderStep(), and OptLeavesReader::reader.
Referenced by optimizeInternal().
static const char* optLeavesReaderTerm | ( | OptLeavesReader * | pReader | ) | [static] |
Definition at line 6052 of file fts2.c.
References leavesReaderTerm(), and OptLeavesReader::reader.
Referenced by optimizeInternal().
static int optLeavesReaderTermBytes | ( | OptLeavesReader * | pReader | ) | [static] |
Definition at line 6043 of file fts2.c.
References leavesReaderTermBytes(), and OptLeavesReader::reader.
Referenced by optimizeInternal().
static int optLeavesReaderTermCmp | ( | OptLeavesReader * | lr1, | |
OptLeavesReader * | lr2 | |||
) | [static] |
Definition at line 6058 of file fts2.c.
References leavesReaderTermCmp(), and OptLeavesReader::reader.
Referenced by optimizeInternal(), and optLeavesReaderCmp().
static int orderedDLReaderCmp | ( | OrderedDLReader * | r1, | |
OrderedDLReader * | r2 | |||
) | [static] |
Definition at line 1170 of file fts2.c.
References dlrAtEnd(), dlrDocid(), OrderedDLReader::idx, and OrderedDLReader::pReader.
Referenced by orderedDLReaderReorder().
static void orderedDLReaderReorder | ( | OrderedDLReader * | p, | |
int | n | |||
) | [static] |
Definition at line 1192 of file fts2.c.
References orderedDLReaderCmp().
Referenced by docListMerge().
static int parseQuery | ( | fulltext_vtab * | v, | |
const char * | zInput, | |||
int | nInput, | |||
int | dfltColumn, | |||
Query * | pQuery | |||
) | [static] |
Definition at line 3596 of file fts2.c.
References Query::dfltColumn, Query::nextColumn, Query::nextIsOr, Query::nTerms, Query::pFts, Query::pTerms, fulltext_vtab::pTokenizer, queryClear(), SQLITE_ERROR, SQLITE_OK, and tokenizeSegment().
Referenced by fulltextQuery().
static int parseSpec | ( | TableSpec * | pSpec, | |
int | argc, | |||
const char *const * | argv, | |||
char ** | pzErr | |||
) | [static] |
Definition at line 2684 of file fts2.c.
References TableSpec::azColumn, TableSpec::azContentColumn, TableSpec::azTokenizer, CLEAR, clearTableSpec(), firstToken(), TableSpec::nColumn, safe_isalnum(), sqlite3_malloc(), sqlite3_mprintf(), SQLITE_NOMEM, SQLITE_OK, startsWith(), tokenizeString(), tokenListToIdList(), TableSpec::zDb, and TableSpec::zName.
Referenced by fulltextConnect(), and fulltextCreate().
static int plrAtEnd | ( | PLReader * | pReader | ) | [static] |
Definition at line 862 of file fts2.c.
References PLReader::pData.
Referenced by docListTrim(), plrColumn(), plrEndOffset(), plrPosition(), plrStartOffset(), plrStep(), posListCmp(), posListPhraseMerge(), and posListUnion().
static int plrColumn | ( | PLReader * | pReader | ) | [static] |
Definition at line 865 of file fts2.c.
References PLReader::iColumn, and plrAtEnd().
Referenced by docListTrim(), plwCopy(), posListCmp(), and posListPhraseMerge().
static void plrDestroy | ( | PLReader * | pReader | ) | [static] |
Definition at line 929 of file fts2.c.
References SCRAMBLE.
Referenced by docListTrim(), posListPhraseMerge(), and posListUnion().
static int plrEndOffset | ( | PLReader * | pReader | ) | [static] |
Definition at line 877 of file fts2.c.
References PLReader::iEndOffset, and plrAtEnd().
Referenced by docListTrim(), plwCopy(), and posListCmp().
Definition at line 919 of file fts2.c.
References dlrPosData(), dlrPosDataLen(), PLReader::iColumn, PLReader::iEndOffset, PLReader::iPosition, PLReader::iStartOffset, DLReader::iType, PLReader::iType, PLReader::nData, PLReader::pData, and plrStep().
Referenced by docListTrim(), posListPhraseMerge(), and posListUnion().
static int plrPosition | ( | PLReader * | pReader | ) | [static] |
Definition at line 869 of file fts2.c.
References PLReader::iPosition, and plrAtEnd().
Referenced by docListTrim(), plwCopy(), posListCmp(), and posListPhraseMerge().
static int plrStartOffset | ( | PLReader * | pReader | ) | [static] |
Definition at line 873 of file fts2.c.
References PLReader::iStartOffset, and plrAtEnd().
Referenced by docListTrim(), plwCopy(), and posListCmp().
static void plrStep | ( | PLReader * | pReader | ) | [static] |
Definition at line 881 of file fts2.c.
References DL_POSITIONS_OFFSETS, getVarint32, PLReader::iColumn, PLReader::iEndOffset, PLReader::iPosition, PLReader::iStartOffset, PLReader::iType, PLReader::nData, PLReader::pData, plrAtEnd(), POS_BASE, POS_COLUMN, and POS_END.
Referenced by docListTrim(), plrInit(), posListPhraseMerge(), and posListUnion().
static void plwAdd | ( | PLWriter * | pWriter, | |
int | iColumn, | |||
int | iPos, | |||
int | iStartOffset, | |||
int | iEndOffset | |||
) | [static] |
Definition at line 969 of file fts2.c.
References DLWriter::b, dataBufferAppend(), DL_DOCIDS, DL_POSITIONS_OFFSETS, PLWriter::dlw, PLWriter::iColumn, PLWriter::iOffset, PLWriter::iPos, DLWriter::iType, POS_BASE, POS_COLUMN, putVarint, and VARINT_MAX.
Referenced by dlcAddPos(), docListTrim(), plwCopy(), and posListPhraseMerge().
Definition at line 1001 of file fts2.c.
References plrColumn(), plrEndOffset(), plrPosition(), plrStartOffset(), and plwAdd().
Referenced by posListUnion().
static void plwDestroy | ( | PLWriter * | pWriter | ) | [static] |
Definition at line 1043 of file fts2.c.
References SCRAMBLE.
Referenced by dlcDelete(), dlcNext(), docListTrim(), posListPhraseMerge(), and posListUnion().
static void plwInit | ( | PLWriter * | pWriter, | |
DLWriter * | dlw, | |||
sqlite_int64 | iDocid | |||
) | [static] |
Definition at line 1005 of file fts2.c.
References DLWriter::b, dataBufferAppend(), PLWriter::dlw, PLWriter::iColumn, PLWriter::iOffset, PLWriter::iPos, DLWriter::iPrevDocid, putVarint, and VARINT_MAX.
Referenced by dlcNew(), dlcNext(), docListTrim(), posListPhraseMerge(), and posListUnion().
static void plwTerminate | ( | PLWriter * | pWriter | ) | [static] |
Definition at line 1032 of file fts2.c.
References DLWriter::b, dataBufferAppend(), DL_DOCIDS, PLWriter::dlw, PLWriter::iPos, DLWriter::iType, POS_END, putVarint, and VARINT_MAX.
Referenced by dlcNext(), docListTrim(), posListPhraseMerge(), and posListUnion().
Definition at line 1287 of file fts2.c.
References DL_DOCIDS, DL_POSITIONS, PLReader::iType, plrAtEnd(), plrColumn(), plrEndOffset(), plrPosition(), and plrStartOffset().
Referenced by posListUnion().
Definition at line 1410 of file fts2.c.
References DL_POSITIONS_OFFSETS, dlrDocid(), DLWriter::iType, left, match(), plrAtEnd(), plrColumn(), plrDestroy(), plrInit(), plrPosition(), plrStep(), plwAdd(), plwDestroy(), plwInit(), plwTerminate(), right, and writer().
Referenced by docListPhraseMerge().
Definition at line 1315 of file fts2.c.
References dlrDocid(), DLWriter::iType, DLReader::iType, left, plrAtEnd(), plrDestroy(), plrInit(), plrStep(), plwCopy(), plwDestroy(), plwInit(), plwTerminate(), posListCmp(), right, and writer().
Referenced by docListUnion().
static int putVarint | ( | char * | p, | |
sqlite_int64 | v | |||
) | [static] |
Definition at line 411 of file fts2.c.
References VARINT_MAX.
static void queryAdd | ( | Query * | q, | |
const char * | pTerm, | |||
int | nTerm | |||
) | [static] |
Definition at line 3485 of file fts2.c.
References CLEAR, Query::dfltColumn, QueryTerm::iColumn, QueryTerm::isOr, QueryTerm::isPrefix, Query::nextColumn, Query::nextIsOr, QueryTerm::nTerm, Query::nTerms, QueryTerm::pTerm, Query::pTerms, sqlite3_malloc(), and sqlite3_realloc().
Referenced by tokenizeSegment().
static void queryClear | ( | Query * | q | ) | [static] |
Definition at line 3024 of file fts2.c.
References CLEAR, Query::nTerms, QueryTerm::pTerm, Query::pTerms, and sqlite3_free().
Referenced by fulltextClose(), fulltextFilter(), fulltextQuery(), and parseQuery().
static int safe_isalnum | ( | char | c | ) | [static] |
Definition at line 353 of file fts2.c.
Referenced by parseSpec(), startsWith(), and tokenListToIdList().
static int safe_isspace | ( | char | c | ) | [static] |
Definition at line 347 of file fts2.c.
Referenced by endsInWhiteSpace(), getToken(), startsWith(), and wordBoundary().
static int safe_tolower | ( | char | c | ) | [static] |
Definition at line 350 of file fts2.c.
Referenced by startsWith().
static int segdir_count | ( | fulltext_vtab * | v, | |
int * | pnSegments, | |||
int * | piMaxLevel | |||
) | [static] |
Definition at line 2327 of file fts2.c.
References SEGDIR_COUNT_STMT, sql_get_statement(), sqlite3_column_int(), sqlite3_step(), SQLITE_DONE, SQLITE_ERROR, SQLITE_OK, and SQLITE_ROW.
Referenced by optimizeFunc().
static int segdir_delete | ( | fulltext_vtab * | v, | |
int | iLevel | |||
) | [static] |
Definition at line 2285 of file fts2.c.
References block_delete(), SEGDIR_DELETE_STMT, segdir_span(), sql_get_statement(), sql_single_step(), sqlite3_bind_int64(), SQLITE_DONE, SQLITE_OK, and SQLITE_ROW.
Referenced by optimizeFunc(), and segmentMerge().
static int segdir_delete_all | ( | fulltext_vtab * | v | ) | [static] |
Definition at line 2309 of file fts2.c.
References BLOCK_DELETE_ALL_STMT, SEGDIR_DELETE_ALL_STMT, sql_get_statement(), sql_single_step(), and SQLITE_OK.
Referenced by fulltextUpdate().
static int segdir_max_index | ( | fulltext_vtab * | v, | |
int | iLevel, | |||
int * | pidx | |||
) | [static] |
Definition at line 2178 of file fts2.c.
References SEGDIR_MAX_INDEX_STMT, sql_get_statement(), sqlite3_bind_int(), sqlite3_column_int(), sqlite3_column_type(), sqlite3_step(), SQLITE_DONE, SQLITE_ERROR, SQLITE_NULL, SQLITE_OK, and SQLITE_ROW.
Referenced by segdirNextIndex().
static int segdir_set | ( | fulltext_vtab * | v, | |
int | iLevel, | |||
int | idx, | |||
sqlite_int64 | iStartBlockid, | |||
sqlite_int64 | iLeavesEndBlockid, | |||
sqlite_int64 | iEndBlockid, | |||
const char * | pRootData, | |||
int | nRootData | |||
) | [static] |
Definition at line 2214 of file fts2.c.
References SEGDIR_SET_STMT, sql_get_statement(), sql_single_step(), sqlite3_bind_blob(), sqlite3_bind_int(), sqlite3_bind_int64(), SQLITE_OK, and SQLITE_STATIC.
Referenced by leafWriterFinalize().
static int segdir_span | ( | fulltext_vtab * | v, | |
int | iLevel, | |||
sqlite_int64 * | piStartBlockid, | |||
sqlite_int64 * | piEndBlockid | |||
) | [static] |
Definition at line 2248 of file fts2.c.
References SEGDIR_SPAN_STMT, sql_get_statement(), sqlite3_bind_int(), sqlite3_column_int64(), sqlite3_column_type(), sqlite3_step(), SQLITE_DONE, SQLITE_ERROR, SQLITE_NULL, SQLITE_OK, and SQLITE_ROW.
Referenced by segdir_delete().
static int segdirNextIndex | ( | fulltext_vtab * | v, | |
int | iLevel, | |||
int * | pidx | |||
) | [static] |
Definition at line 5257 of file fts2.c.
References MERGE_COUNT, segdir_max_index(), segmentMerge(), SQLITE_DONE, SQLITE_OK, and SQLITE_ROW.
Referenced by segmentMerge(), and writeZeroSegment().
static int segmentMerge | ( | fulltext_vtab * | v, | |
int | iLevel | |||
) | [static] |
Definition at line 5279 of file fts2.c.
References leafWriterDestroy(), leafWriterFinalize(), leafWriterInit(), leavesReaderAtEnd(), leavesReaderDestroy(), leavesReaderReorder(), leavesReadersInit(), leavesReadersMerge(), leavesReaderStep(), leavesReaderTermCmp(), MERGE_COUNT, segdir_delete(), segdirNextIndex(), SQLITE_OK, and writer().
Referenced by segdirNextIndex().
static void snippetAllOffsets | ( | fulltext_cursor * | p | ) | [static] |
Definition at line 3154 of file fts2.c.
References fulltext_cursor::iCursorType, fulltext_vtab::nColumn, Snippet::nMatch, Query::nTerms, Query::pFts, fulltext_cursor::pStmt, fulltext_cursor::q, QUERY_FULLTEXT, fulltext_cursor::snippet, snippetOffsetsOfColumn(), sqlite3_column_bytes(), and sqlite3_column_text().
Referenced by snippetFunc(), and snippetOffsetsFunc().
static void snippetAppendMatch | ( | Snippet * | p, | |
int | iCol, | |||
int | iTerm, | |||
int | iStart, | |||
int | nByte | |||
) | [static] |
Definition at line 3045 of file fts2.c.
References Snippet::aMatch, Snippet::nAlloc, Snippet::nMatch, and sqlite3_realloc().
Referenced by snippetOffsetsOfColumn().
static void snippetClear | ( | Snippet * | p | ) | [static] |
Definition at line 3036 of file fts2.c.
References Snippet::aMatch, CLEAR, sqlite3_free(), Snippet::zOffset, and Snippet::zSnippet.
Referenced by fulltextClose(), and fulltextNext().
static void snippetFunc | ( | sqlite3_context * | pContext, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 5962 of file fts2.c.
References Snippet::nSnippet, fulltext_cursor::snippet, snippetAllOffsets(), snippetText(), sqlite3_result_error(), sqlite3_result_text(), sqlite3_value_blob(), sqlite3_value_bytes(), sqlite3_value_text(), sqlite3_value_type(), SQLITE_BLOB, SQLITE_STATIC, and Snippet::zSnippet.
Referenced by fulltextFindFunction().
static void snippetOffsetsFunc | ( | sqlite3_context * | pContext, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 5996 of file fts2.c.
References Snippet::nOffset, fulltext_cursor::snippet, snippetAllOffsets(), snippetOffsetText(), sqlite3_result_error(), sqlite3_result_text(), sqlite3_value_blob(), sqlite3_value_bytes(), sqlite3_value_type(), SQLITE_BLOB, SQLITE_STATIC, and Snippet::zOffset.
Referenced by fulltextFindFunction().
static void snippetOffsetsOfColumn | ( | Query * | pQuery, | |
Snippet * | pSnippet, | |||
int | iColumn, | |||
const char * | zDoc, | |||
int | nDoc | |||
) | [static] |
Definition at line 3079 of file fts2.c.
References FTS2_ROTOR_MASK, FTS2_ROTOR_SZ, QueryTerm::iColumn, match(), fulltext_vtab::nColumn, Query::nTerms, Query::pFts, sqlite3_tokenizer::pModule, Query::pTerms, sqlite3_tokenizer_cursor::pTokenizer, fulltext_vtab::pTokenizer, snippetAppendMatch(), sqlite3_tokenizer_module::xClose, sqlite3_tokenizer_module::xNext, and sqlite3_tokenizer_module::xOpen.
Referenced by snippetAllOffsets().
static void snippetOffsetText | ( | Snippet * | p | ) | [static] |
Definition at line 3185 of file fts2.c.
References Snippet::aMatch, append(), initStringBuffer(), Snippet::nMatch, Snippet::nOffset, sqlite3_snprintf(), stringBufferData(), stringBufferLength(), and Snippet::zOffset.
Referenced by snippetOffsetsFunc().
static void snippetText | ( | fulltext_cursor * | pCursor, | |
const char * | zStartMark, | |||
const char * | zEndMark, | |||
const char * | zEllipsis | |||
) | [static] |
Definition at line 3260 of file fts2.c.
References Snippet::aMatch, append(), appendWhiteSpace(), initStringBuffer(), nappend(), Snippet::nMatch, Snippet::nSnippet, Query::nTerms, fulltext_cursor::pStmt, fulltext_cursor::q, fulltext_cursor::snippet, SNIPPET_DESIRED, SNIPPET_IGNORE, sqlite3_column_bytes(), sqlite3_column_text(), sqlite3_free(), stringBufferData(), stringBufferLength(), trimWhiteSpace(), wordBoundary(), and Snippet::zSnippet.
Referenced by snippetFunc().
static int sql_exec | ( | sqlite3 * | db, | |
const char * | zDb, | |||
const char * | zName, | |||
const char * | zFormat | |||
) | [static] |
Definition at line 1667 of file fts2.c.
References sqlite3_exec(), sqlite3_free(), string_format(), and TRACE.
Referenced by fulltextCreate(), and fulltextDestroy().
static int sql_get_leaf_statement | ( | fulltext_vtab * | v, | |
int | idx, | |||
sqlite3_stmt ** | ppStmt | |||
) | [static] |
Definition at line 1991 of file fts2.c.
References fulltext_vtab::db, LEAF_SELECT, MERGE_COUNT, fulltext_vtab::pLeafSelectStmts, sql_prepare(), sqlite3_reset(), SQLITE_OK, fulltext_vtab::zDb, and fulltext_vtab::zName.
Referenced by leavesReaderInit().
static int sql_get_statement | ( | fulltext_vtab * | v, | |
fulltext_statement | iStmt, | |||
sqlite3_stmt ** | ppStmt | |||
) | [static] |
Definition at line 1948 of file fts2.c.
References CONTENT_INSERT_STMT, CONTENT_UPDATE_STMT, contentInsertStatement(), contentUpdateStatement(), fulltext_vtab::db, MAX_STMT, fulltext_vtab::pFulltextStatements, sql_prepare(), sqlite3_free(), sqlite3_reset(), SQLITE_OK, fulltext_vtab::zDb, and fulltext_vtab::zName.
Referenced by block_delete(), block_insert(), content_delete(), content_exists(), content_insert(), content_select(), content_update(), leavesReadersInit(), loadAndGetChildrenContaining(), optimizeFunc(), segdir_count(), segdir_delete(), segdir_delete_all(), segdir_max_index(), segdir_set(), segdir_span(), and termSelect().
static int sql_prepare | ( | sqlite3 * | db, | |
const char * | zDb, | |||
const char * | zName, | |||
sqlite3_stmt ** | ppStmt, | |||
const char * | zFormat | |||
) | [static] |
Definition at line 1677 of file fts2.c.
References sqlite3_free(), sqlite3_prepare_v2(), string_format(), and TRACE.
Referenced by fulltextFilter(), sql_get_leaf_statement(), and sql_get_statement().
static int sql_single_step | ( | sqlite3_stmt * | s | ) | [static] |
Definition at line 1979 of file fts2.c.
References sqlite3_step(), SQLITE_DONE, and SQLITE_OK.
Referenced by block_delete(), content_delete(), content_insert(), content_update(), segdir_delete(), segdir_delete_all(), and segdir_set().
int sqlite3_extension_init | ( | sqlite3 * | db, | |
char ** | pzErrMsg, | |||
const sqlite3_api_routines * | pApi | |||
) |
Definition at line 6849 of file fts2.c.
References sqlite3Fts2Init(), and SQLITE_EXTENSION_INIT2.
void sqlite3Fts2IcuTokenizerModule | ( | sqlite3_tokenizer_module const ** | ppModule | ) |
Referenced by sqlite3Fts2Init().
int sqlite3Fts2Init | ( | sqlite3 * | db | ) |
Definition at line 6789 of file fts2.c.
References FTS2_HASH_STRING, hashDestroy(), sqlite3_create_module_v2(), sqlite3_free(), sqlite3_malloc(), sqlite3_overload_function(), sqlite3Fts2HashClear(), sqlite3Fts2HashInit(), sqlite3Fts2HashInsert(), sqlite3Fts2IcuTokenizerModule(), sqlite3Fts2InitHashTable(), sqlite3Fts2PorterTokenizerModule(), sqlite3Fts2SimpleTokenizerModule(), SQLITE_NOMEM, and SQLITE_OK.
Referenced by openDatabase(), and sqlite3_extension_init().
Definition at line 336 of file fts2_tokenizer.c.
References scalarFunc(), sqlite3_create_function(), sqlite3_free(), sqlite3_mprintf(), SQLITE_ANY, SQLITE_NOMEM, and SQLITE_OK.
Referenced by sqlite3Fts2Init().
void sqlite3Fts2PorterTokenizerModule | ( | sqlite3_tokenizer_module const ** | ppModule | ) |
Definition at line 636 of file fts2_porter.c.
Referenced by sqlite3Fts2Init().
void sqlite3Fts2SimpleTokenizerModule | ( | sqlite3_tokenizer_module const ** | ppModule | ) |
Definition at line 224 of file fts2_tokenizer1.c.
Referenced by sqlite3Fts2Init().
static int startsWith | ( | const char * | s, | |
const char * | t | |||
) | [static] |
Definition at line 2645 of file fts2.c.
References safe_isalnum(), safe_isspace(), and safe_tolower().
Referenced by parseSpec().
static char* string_dup | ( | const char * | s | ) | [static] |
static char* string_dup_n | ( | const char * | s, | |
int | n | |||
) | [static] |
static char* string_format | ( | const char * | zFormat, | |
const char * | zDb, | |||
const char * | zName | |||
) | [static] |
Definition at line 1634 of file fts2.c.
References sqlite3_malloc().
Referenced by sql_exec(), and sql_prepare().
static char* stringBufferData | ( | StringBuffer * | sb | ) | [static] |
Definition at line 534 of file fts2.c.
References StringBuffer::b, and DataBuffer::pData.
Referenced by contentInsertStatement(), contentUpdateStatement(), endsInWhiteSpace(), fulltextCreate(), snippetOffsetText(), and snippetText().
static void stringBufferDestroy | ( | StringBuffer * | sb | ) | [static] |
Definition at line 537 of file fts2.c.
References StringBuffer::b, and dataBufferDestroy().
Referenced by fulltextCreate().
static int stringBufferLength | ( | StringBuffer * | sb | ) | [static] |
Definition at line 531 of file fts2.c.
References StringBuffer::b, and DataBuffer::nData.
Referenced by appendWhiteSpace(), endsInWhiteSpace(), snippetOffsetText(), and snippetText().
static int termDataCmp | ( | const void * | av, | |
const void * | bv | |||
) | [static] |
Definition at line 5766 of file fts2.c.
References TermData::nTerm, and TermData::pTerm.
Referenced by writeZeroSegment().
static int termSelect | ( | fulltext_vtab * | v, | |
int | iColumn, | |||
const char * | pTerm, | |||
int | nTerm, | |||
int | isPrefix, | |||
DocListType | iType, | |||
DataBuffer * | out | |||
) | [static] |
Definition at line 5712 of file fts2.c.
References dataBufferDestroy(), dataBufferInit(), DL_DEFAULT, docListTrim(), loadSegment(), fulltext_vtab::nColumn, DataBuffer::nData, fulltext_vtab::nPendingData, DataBuffer::pData, SEGDIR_SELECT_ALL_STMT, sql_get_statement(), sqlite3_column_blob(), sqlite3_column_bytes(), sqlite3_column_int64(), sqlite3_step(), SQLITE_DONE, SQLITE_OK, and SQLITE_ROW.
Referenced by docListOfTerm().
static int tokenizeSegment | ( | sqlite3_tokenizer * | pTokenizer, | |
const char * | pSegment, | |||
int | nSegment, | |||
int | inPhrase, | |||
Query * | pQuery | |||
) | [static] |
Definition at line 3536 of file fts2.c.
References checkColumnSpecifier(), QueryTerm::iPhrase, QueryTerm::isNot, QueryTerm::isPrefix, Query::nextColumn, Query::nextIsOr, QueryTerm::nPhrase, Query::nTerms, Query::pFts, sqlite3_tokenizer::pModule, Query::pTerms, sqlite3_tokenizer_cursor::pTokenizer, queryAdd(), SQLITE_OK, sqlite3_tokenizer_module::xClose, sqlite3_tokenizer_module::xNext, and sqlite3_tokenizer_module::xOpen.
Referenced by parseQuery().
static char** tokenizeString | ( | const char * | z, | |
int * | pnToken | |||
) | [static] |
Definition at line 2504 of file fts2.c.
References getToken(), Token::n, sqlite3_free(), sqlite3_malloc(), TOKEN_SPACE, and Token::z.
Referenced by parseSpec().
static void tokenListToIdList | ( | char ** | azIn | ) | [static] |
Definition at line 2593 of file fts2.c.
References dequoteString(), and safe_isalnum().
Referenced by parseSpec().
static void trimWhiteSpace | ( | StringBuffer * | p | ) | [static] |
Definition at line 575 of file fts2.c.
References StringBuffer::b, endsInWhiteSpace(), DataBuffer::nData, and DataBuffer::pData.
Referenced by snippetText().
static int wordBoundary | ( | int | iBreak, | |
const char * | zDoc, | |||
int | nDoc, | |||
struct snippetMatch * | aMatch, | |||
int | nMatch, | |||
int | iCol | |||
) | [static] |
static int writeZeroSegment | ( | fulltext_vtab * | v, | |
fts2Hash * | pTerms | |||
) | [static] |
Definition at line 5778 of file fts2.c.
References dataBufferDestroy(), dataBufferInit(), dataBufferReset(), dlcAddDoclist(), fts2HashCount, fts2HashData, fts2HashFirst, fts2HashKey, fts2HashKeysize, fts2HashNext, leafWriterDestroy(), leafWriterFinalize(), leafWriterInit(), leafWriterStep(), DataBuffer::nData, TermData::nTerm, TermData::pCollector, DataBuffer::pData, TermData::pTerm, segdirNextIndex(), sqlite3_free(), sqlite3_malloc(), SQLITE_OK, termDataCmp(), and writer().
Referenced by flushPendingTerms().
static const sqlite3_module fts2Module [static] |
{ 0, fulltextCreate, fulltextConnect, fulltextBestIndex, fulltextDisconnect, fulltextDestroy, fulltextOpen, fulltextClose, fulltextFilter, fulltextNext, fulltextEof, fulltextColumn, fulltextRowid, fulltextUpdate, fulltextBegin, fulltextSync, fulltextCommit, fulltextRollback, fulltextFindFunction, fulltextRename, }
const char* const fulltext_zStatement[MAX_STMT] [static] |
const char isIdChar[] [static] |
{ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, }
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:58 2011 by Doxygen 1.6.1