Index: third_party/sqlite/src/ext/fts3/fts3Int.h |
diff --git a/third_party/sqlite/src/ext/fts3/fts3Int.h b/third_party/sqlite/src/ext/fts3/fts3Int.h |
index b2827b7352fd9696980fd44c3618da9d3221d05a..06bcc7202e10092d0bfb3b303430b88bd5ba54e1 100644 |
--- a/third_party/sqlite/src/ext/fts3/fts3Int.h |
+++ b/third_party/sqlite/src/ext/fts3/fts3Int.h |
@@ -134,6 +134,11 @@ SQLITE_EXTENSION_INIT3 |
#ifdef SQLITE_COVERAGE_TEST |
# define ALWAYS(x) (1) |
# define NEVER(X) (0) |
+#elif defined(SQLITE_DEBUG) |
+# define ALWAYS(x) sqlite3Fts3Always((x)!=0) |
+# define NEVER(x) sqlite3Fts3Never((x)!=0) |
+int sqlite3Fts3Always(int b); |
+int sqlite3Fts3Never(int b); |
#else |
# define ALWAYS(x) (x) |
# define NEVER(x) (x) |
@@ -192,6 +197,8 @@ typedef struct Fts3DeferredToken Fts3DeferredToken; |
typedef struct Fts3SegReader Fts3SegReader; |
typedef struct Fts3MultiSegReader Fts3MultiSegReader; |
+typedef struct MatchinfoBuffer MatchinfoBuffer; |
+ |
/* |
** A connection to a fulltext index is an instance of the following |
** structure. The xCreate and xConnect methods create an instance |
@@ -257,6 +264,7 @@ struct Fts3Table { |
int nPendingData; /* Current bytes of pending data */ |
sqlite_int64 iPrevDocid; /* Docid of most recently inserted document */ |
int iPrevLangid; /* Langid of recently inserted document */ |
+ int bPrevDelete; /* True if last operation was a delete */ |
#if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) |
/* State variables used for validating that the transaction control |
@@ -301,9 +309,7 @@ struct Fts3Cursor { |
i64 iMinDocid; /* Minimum docid to return */ |
i64 iMaxDocid; /* Maximum docid to return */ |
int isMatchinfoNeeded; /* True when aMatchinfo[] needs filling in */ |
- u32 *aMatchinfo; /* Information about most recent match */ |
- int nMatchinfo; /* Number of elements in aMatchinfo[] */ |
- char *zMatchinfo; /* Matchinfo specification */ |
+ MatchinfoBuffer *pMIBuffer; /* Buffer for matchinfo data */ |
}; |
#define FTS3_EVAL_FILTER 0 |
@@ -375,6 +381,11 @@ struct Fts3Phrase { |
int bIncr; /* True if doclist is loaded incrementally */ |
int iDoclistToken; |
+ /* Used by sqlite3Fts3EvalPhrasePoslist() if this is a descendent of an |
+ ** OR condition. */ |
+ char *pOrPoslist; |
+ i64 iOrDocid; |
+ |
/* Variables below this point are populated by fts3_expr.c when parsing |
** a MATCH expression. Everything above is part of the evaluation phase. |
*/ |
@@ -418,7 +429,9 @@ struct Fts3Expr { |
u8 bStart; /* True if iDocid is valid */ |
u8 bDeferred; /* True if this expression is entirely deferred */ |
- u32 *aMI; |
+ /* The following are used by the fts3_snippet.c module. */ |
+ int iPhrase; /* Index of this phrase in matchinfo() results */ |
+ u32 *aMI; /* See above */ |
}; |
/* |
@@ -529,6 +542,7 @@ int sqlite3Fts3Incrmerge(Fts3Table*,int,int); |
) |
/* fts3.c */ |
+void sqlite3Fts3ErrMsg(char**,const char*,...); |
int sqlite3Fts3PutVarint(char *, sqlite3_int64); |
int sqlite3Fts3GetVarint(const char *, sqlite_int64 *); |
int sqlite3Fts3GetVarint32(const char *, int *); |
@@ -538,6 +552,7 @@ void sqlite3Fts3DoclistPrev(int,char*,int,char**,sqlite3_int64*,int*,u8*); |
int sqlite3Fts3EvalPhraseStats(Fts3Cursor *, Fts3Expr *, u32 *); |
int sqlite3Fts3FirstFilter(sqlite3_int64, char *, int, char *); |
void sqlite3Fts3CreateStatTable(int*, Fts3Table*); |
+int sqlite3Fts3EvalTestDeferred(Fts3Cursor *pCsr, int *pRc); |
/* fts3_tokenizer.c */ |
const char *sqlite3Fts3NextToken(const char *, int *); |
@@ -553,6 +568,7 @@ void sqlite3Fts3Snippet(sqlite3_context *, Fts3Cursor *, const char *, |
const char *, const char *, int, int |
); |
void sqlite3Fts3Matchinfo(sqlite3_context *, Fts3Cursor *, const char *); |
+void sqlite3Fts3MIBufferFree(MatchinfoBuffer *p); |
/* fts3_expr.c */ |
int sqlite3Fts3ExprParse(sqlite3_tokenizer *, int, |