use amalgamation 3.14.0

This commit is contained in:
Yasuhiro Matsumoto 2016-08-11 01:47:31 +09:00
parent 297d6f8d2d
commit ee996d6946
2 changed files with 287 additions and 372 deletions

View File

@ -1,6 +1,6 @@
/****************************************************************************** /******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite ** This file is an amalgamation of many separate C source files from SQLite
** version 3.15.0. By combining all the individual C code files into this ** version 3.14.0. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a single translation ** single large file, the entire code can be compiled as a single translation
** unit. This allows many compilers to do optimizations that would not be ** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements ** possible if the files were compiled separately. Performance improvements
@ -380,9 +380,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()]. ** [sqlite_version()] and [sqlite_source_id()].
*/ */
#define SQLITE_VERSION "3.15.0" #define SQLITE_VERSION "3.14.0"
#define SQLITE_VERSION_NUMBER 3015000 #define SQLITE_VERSION_NUMBER 3014000
#define SQLITE_SOURCE_ID "2016-08-10 15:02:49 059f4e2efefb7b9deaf539110c19bceaeb10c6ce" #define SQLITE_SOURCE_ID "2016-08-08 13:40:27 d5e98057028abcf7217d0d2b2e29bbbcdf09d6de"
/* /*
** CAPI3REF: Run-Time Library Version Numbers ** CAPI3REF: Run-Time Library Version Numbers
@ -44998,30 +44998,12 @@ static void pcache1TruncateUnsafe(
PCache1 *pCache, /* The cache to truncate */ PCache1 *pCache, /* The cache to truncate */
unsigned int iLimit /* Drop pages with this pgno or larger */ unsigned int iLimit /* Drop pages with this pgno or larger */
){ ){
TESTONLY( int nPage = 0; ) /* To assert pCache->nPage is correct */ TESTONLY( unsigned int nPage = 0; ) /* To assert pCache->nPage is correct */
unsigned int h, iStop; unsigned int h;
assert( sqlite3_mutex_held(pCache->pGroup->mutex) ); assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
assert( pCache->iMaxKey >= iLimit ); for(h=0; h<pCache->nHash; h++){
assert( pCache->nHash > 0 ); PgHdr1 **pp = &pCache->apHash[h];
if( pCache->iMaxKey - iLimit < pCache->nHash ){
/* If we are just shaving the last few pages off the end of the
** cache, then there is no point in scanning the entire hash table.
** Only scan those hash slots that might contain pages that need to
** be removed. */
h = iLimit % pCache->nHash;
iStop = pCache->iMaxKey % pCache->nHash;
TESTONLY( nPage = -10; ) /* Disable the pCache->nPage validity check */
}else{
/* This is the general case where many pages are being removed.
** It is necessary to scan the entire hash table */
h = pCache->nHash/2;
iStop = h - 1;
}
for(;;){
PgHdr1 **pp;
PgHdr1 *pPage; PgHdr1 *pPage;
assert( h<pCache->nHash );
pp = &pCache->apHash[h];
while( (pPage = *pp)!=0 ){ while( (pPage = *pp)!=0 ){
if( pPage->iKey>=iLimit ){ if( pPage->iKey>=iLimit ){
pCache->nPage--; pCache->nPage--;
@ -45030,13 +45012,11 @@ static void pcache1TruncateUnsafe(
pcache1FreePage(pPage); pcache1FreePage(pPage);
}else{ }else{
pp = &pPage->pNext; pp = &pPage->pNext;
TESTONLY( if( nPage>=0 ) nPage++; ) TESTONLY( nPage++; )
} }
} }
if( h==iStop ) break;
h = (h+1) % pCache->nHash;
} }
assert( nPage<0 || pCache->nPage==(unsigned)nPage ); assert( pCache->nPage==nPage );
} }
/******************************************************************************/ /******************************************************************************/
@ -45513,7 +45493,7 @@ static void pcache1Destroy(sqlite3_pcache *p){
PGroup *pGroup = pCache->pGroup; PGroup *pGroup = pCache->pGroup;
assert( pCache->bPurgeable || (pCache->nMax==0 && pCache->nMin==0) ); assert( pCache->bPurgeable || (pCache->nMax==0 && pCache->nMin==0) );
pcache1EnterMutex(pGroup); pcache1EnterMutex(pGroup);
if( pCache->nPage ) pcache1TruncateUnsafe(pCache, 0); pcache1TruncateUnsafe(pCache, 0);
assert( pGroup->nMaxPage >= pCache->nMax ); assert( pGroup->nMaxPage >= pCache->nMax );
pGroup->nMaxPage -= pCache->nMax; pGroup->nMaxPage -= pCache->nMax;
assert( pGroup->nMinPage >= pCache->nMin ); assert( pGroup->nMinPage >= pCache->nMin );
@ -131870,7 +131850,7 @@ typedef union {
** **
** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE ** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE
** and YY_MAX_REDUCE ** and YY_MAX_REDUCE
**
** N == YY_ERROR_ACTION A syntax error has occurred. ** N == YY_ERROR_ACTION A syntax error has occurred.
** **
** N == YY_ACCEPT_ACTION The parser accepts its input. ** N == YY_ACCEPT_ACTION The parser accepts its input.
@ -131879,20 +131859,16 @@ typedef union {
** slots in the yy_action[] table. ** slots in the yy_action[] table.
** **
** The action table is constructed as a single large table named yy_action[]. ** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as either: ** Given state S and lookahead X, the action is computed as
** **
** (A) N = yy_action[ yy_shift_ofst[S] + X ] ** yy_action[ yy_shift_ofst[S] + X ]
** (B) N = yy_default[S]
** **
** The (A) formula is preferred. The B formula is used instead if: ** If the index value yy_shift_ofst[S]+X is out of range or if the value
** (1) The yy_shift_ofst[S]+X value is out of range, or ** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
** (2) yy_lookahead[yy_shift_ofst[S]+X] is not equal to X, or ** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
** (3) yy_shift_ofst[S] equal YY_SHIFT_USE_DFLT. ** and that yy_default[S] should be used instead.
** (Implementation note: YY_SHIFT_USE_DFLT is chosen so that
** YY_SHIFT_USE_DFLT+X will be out of range for all possible lookaheads X.
** Hence only tests (1) and (2) need to be evaluated.)
** **
** The formulas above are for computing the action when the lookahead is ** The formula above is for computing the action when the lookahead is
** a terminal symbol. If the lookahead is a non-terminal (as occurs after ** a terminal symbol. If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of ** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of ** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
@ -132217,10 +132193,10 @@ static const YYCODETYPE yy_lookahead[] = {
/* 1490 */ 24, 1, 23, 22, 26, 122, 24, 23, 22, 122, /* 1490 */ 24, 1, 23, 22, 26, 122, 24, 23, 22, 122,
/* 1500 */ 23, 23, 22, 122, 122, 23, 15, /* 1500 */ 23, 23, 22, 122, 122, 23, 15,
}; };
#define YY_SHIFT_USE_DFLT (1507) #define YY_SHIFT_USE_DFLT (-95)
#define YY_SHIFT_COUNT (442) #define YY_SHIFT_COUNT (442)
#define YY_SHIFT_MIN (-94) #define YY_SHIFT_MIN (-94)
#define YY_SHIFT_MAX (1491) #define YY_SHIFT_MAX (1491)
static const short yy_shift_ofst[] = { static const short yy_shift_ofst[] = {
/* 0 */ 40, 564, 869, 577, 725, 725, 725, 725, 690, -19, /* 0 */ 40, 564, 869, 577, 725, 725, 725, 725, 690, -19,
/* 10 */ 16, 16, 100, 725, 725, 725, 725, 725, 725, 725, /* 10 */ 16, 16, 100, 725, 725, 725, 725, 725, 725, 725,
@ -132233,12 +132209,12 @@ static const short yy_shift_ofst[] = {
/* 80 */ 725, 725, 725, 725, 821, 725, 725, 725, 725, 725, /* 80 */ 725, 725, 725, 725, 821, 725, 725, 725, 725, 725,
/* 90 */ 725, 725, 725, 725, 725, 725, 725, 725, 952, 711, /* 90 */ 725, 725, 725, 725, 725, 725, 725, 725, 952, 711,
/* 100 */ 711, 711, 711, 711, 766, 23, 32, 924, 637, 825, /* 100 */ 711, 711, 711, 711, 766, 23, 32, 924, 637, 825,
/* 110 */ 837, 837, 924, 73, 183, -51, 1507, 1507, 1507, 501, /* 110 */ 837, 837, 924, 73, 183, -51, -95, -95, -95, 501,
/* 120 */ 501, 501, 903, 903, 632, 205, 241, 924, 924, 924, /* 120 */ 501, 501, 903, 903, 632, 205, 241, 924, 924, 924,
/* 130 */ 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, /* 130 */ 924, 924, 924, 924, 924, 924, 924, 924, 924, 924,
/* 140 */ 924, 924, 924, 924, 924, 924, 924, 192, 1027, 1106, /* 140 */ 924, 924, 924, 924, 924, 924, 924, 192, 1027, 1106,
/* 150 */ 1106, 183, 176, 176, 176, 176, 176, 176, 1507, 1507, /* 150 */ 1106, 183, 176, 176, 176, 176, 176, 176, -95, -95,
/* 160 */ 1507, 880, -94, -94, 578, 734, 99, 730, 769, 349, /* 160 */ -95, 880, -94, -94, 578, 734, 99, 730, 769, 349,
/* 170 */ 924, 924, 924, 924, 924, 924, 924, 924, 924, 924, /* 170 */ 924, 924, 924, 924, 924, 924, 924, 924, 924, 924,
/* 180 */ 924, 924, 924, 924, 924, 924, 924, 954, 954, 954, /* 180 */ 924, 924, 924, 924, 924, 924, 924, 954, 954, 954,
/* 190 */ 924, 924, 622, 924, 924, 924, -18, 924, 924, 914, /* 190 */ 924, 924, 622, 924, 924, 924, -18, 924, 924, 914,
@ -132252,8 +132228,8 @@ static const short yy_shift_ofst[] = {
/* 270 */ 1234, 1234, 1267, 1311, 1234, 1244, 1234, 1267, 1234, 1234, /* 270 */ 1234, 1234, 1267, 1311, 1234, 1244, 1234, 1267, 1234, 1234,
/* 280 */ 1232, 1247, 1232, 1247, 1232, 1247, 1232, 1247, 1176, 1334, /* 280 */ 1232, 1247, 1232, 1247, 1232, 1247, 1232, 1247, 1176, 1334,
/* 290 */ 1176, 1235, 1311, 1318, 1318, 1311, 1248, 1253, 1245, 1249, /* 290 */ 1176, 1235, 1311, 1318, 1318, 1311, 1248, 1253, 1245, 1249,
/* 300 */ 1183, 1355, 1357, 1368, 1368, 1378, 1378, 1378, 1378, 1507, /* 300 */ 1183, 1355, 1357, 1368, 1368, 1378, 1378, 1378, 1378, -95,
/* 310 */ 1507, 1507, 1507, 1507, 1507, 1507, 1507, 451, 936, 816, /* 310 */ -95, -95, -95, -95, -95, -95, -95, 451, 936, 816,
/* 320 */ 888, 1069, 799, 1111, 1197, 1193, 1201, 1202, 1203, 1213, /* 320 */ 888, 1069, 799, 1111, 1197, 1193, 1201, 1202, 1203, 1213,
/* 330 */ 1134, 1117, 1230, 497, 1218, 1219, 1154, 1223, 1115, 1120, /* 330 */ 1134, 1117, 1230, 497, 1218, 1219, 1154, 1223, 1115, 1120,
/* 340 */ 1231, 1164, 1160, 1392, 1394, 1376, 1257, 1385, 1307, 1386, /* 340 */ 1231, 1164, 1160, 1392, 1394, 1376, 1257, 1385, 1307, 1386,
@ -133206,47 +133182,50 @@ static unsigned int yy_find_shift_action(
assert( stateno <= YY_SHIFT_COUNT ); assert( stateno <= YY_SHIFT_COUNT );
do{ do{
i = yy_shift_ofst[stateno]; i = yy_shift_ofst[stateno];
if( i==YY_SHIFT_USE_DFLT ) return yy_default[stateno];
assert( iLookAhead!=YYNOCODE ); assert( iLookAhead!=YYNOCODE );
i += iLookAhead; i += iLookAhead;
if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){ if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
if( iLookAhead>0 ){
#ifdef YYFALLBACK #ifdef YYFALLBACK
YYCODETYPE iFallback; /* Fallback token */ YYCODETYPE iFallback; /* Fallback token */
if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
&& (iFallback = yyFallback[iLookAhead])!=0 ){ && (iFallback = yyFallback[iLookAhead])!=0 ){
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
}
#endif
assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
iLookAhead = iFallback;
continue;
}
#endif
#ifdef YYWILDCARD
{
int j = i - iLookAhead + YYWILDCARD;
if(
#if YY_SHIFT_MIN+YYWILDCARD<0
j>=0 &&
#endif
#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
j<YY_ACTTAB_COUNT &&
#endif
yy_lookahead[j]==YYWILDCARD && iLookAhead>0
){
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
yyTracePrompt, yyTokenName[iLookAhead], yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
yyTokenName[YYWILDCARD]); }
#endif
assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
iLookAhead = iFallback;
continue;
}
#endif
#ifdef YYWILDCARD
{
int j = i - iLookAhead + YYWILDCARD;
if(
#if YY_SHIFT_MIN+YYWILDCARD<0
j>=0 &&
#endif
#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
j<YY_ACTTAB_COUNT &&
#endif
yy_lookahead[j]==YYWILDCARD
){
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
yyTracePrompt, yyTokenName[iLookAhead],
yyTokenName[YYWILDCARD]);
}
#endif /* NDEBUG */
return yy_action[j];
} }
#endif /* NDEBUG */
return yy_action[j];
} }
}
#endif /* YYWILDCARD */ #endif /* YYWILDCARD */
}
return yy_default[stateno]; return yy_default[stateno];
}else{ }else{
return yy_action[i]; return yy_action[i];
@ -136009,26 +135988,14 @@ SQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzEr
assert( pParse->nVar==0 ); assert( pParse->nVar==0 );
assert( pParse->nzVar==0 ); assert( pParse->nzVar==0 );
assert( pParse->azVar==0 ); assert( pParse->azVar==0 );
while( 1 ){ while( zSql[i]!=0 ){
assert( i>=0 ); assert( i>=0 );
if( zSql[i]!=0 ){ pParse->sLastToken.z = &zSql[i];
pParse->sLastToken.z = &zSql[i]; pParse->sLastToken.n = sqlite3GetToken((unsigned char*)&zSql[i],&tokenType);
pParse->sLastToken.n = sqlite3GetToken((u8*)&zSql[i],&tokenType); i += pParse->sLastToken.n;
i += pParse->sLastToken.n; if( i>mxSqlLen ){
if( i>mxSqlLen ){ pParse->rc = SQLITE_TOOBIG;
pParse->rc = SQLITE_TOOBIG; break;
break;
}
}else{
/* Upon reaching the end of input, call the parser two more times
** with tokens TK_SEMI and 0, in that order. */
if( lastTokenParsed==TK_SEMI ){
tokenType = 0;
}else if( lastTokenParsed==0 ){
break;
}else{
tokenType = TK_SEMI;
}
} }
if( tokenType>=TK_SPACE ){ if( tokenType>=TK_SPACE ){
assert( tokenType==TK_SPACE || tokenType==TK_ILLEGAL ); assert( tokenType==TK_SPACE || tokenType==TK_ILLEGAL );
@ -136049,6 +136016,15 @@ SQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzEr
} }
assert( nErr==0 ); assert( nErr==0 );
pParse->zTail = &zSql[i]; pParse->zTail = &zSql[i];
if( pParse->rc==SQLITE_OK && db->mallocFailed==0 ){
assert( zSql[i]==0 );
if( lastTokenParsed!=TK_SEMI ){
sqlite3Parser(pEngine, TK_SEMI, pParse->sLastToken, pParse);
}
if( pParse->rc==SQLITE_OK && db->mallocFailed==0 ){
sqlite3Parser(pEngine, 0, pParse->sLastToken, pParse);
}
}
#ifdef YYTRACKMAXSTACKDEPTH #ifdef YYTRACKMAXSTACKDEPTH
sqlite3_mutex_enter(sqlite3MallocMutex()); sqlite3_mutex_enter(sqlite3MallocMutex());
sqlite3StatusHighwater(SQLITE_STATUS_PARSER_STACK, sqlite3StatusHighwater(SQLITE_STATUS_PARSER_STACK,
@ -178536,7 +178512,6 @@ static void sqlite3Fts5ParseNodeFree(Fts5ExprNode*);
static void sqlite3Fts5ParseSetDistance(Fts5Parse*, Fts5ExprNearset*, Fts5Token*); static void sqlite3Fts5ParseSetDistance(Fts5Parse*, Fts5ExprNearset*, Fts5Token*);
static void sqlite3Fts5ParseSetColset(Fts5Parse*, Fts5ExprNearset*, Fts5Colset*); static void sqlite3Fts5ParseSetColset(Fts5Parse*, Fts5ExprNearset*, Fts5Colset*);
static Fts5Colset *sqlite3Fts5ParseColsetInvert(Fts5Parse*, Fts5Colset*);
static void sqlite3Fts5ParseFinished(Fts5Parse *pParse, Fts5ExprNode *p); static void sqlite3Fts5ParseFinished(Fts5Parse *pParse, Fts5ExprNode *p);
static void sqlite3Fts5ParseNear(Fts5Parse *pParse, Fts5Token*); static void sqlite3Fts5ParseNear(Fts5Parse *pParse, Fts5Token*);
@ -178594,13 +178569,12 @@ static int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic);
#define FTS5_COLON 5 #define FTS5_COLON 5
#define FTS5_LP 6 #define FTS5_LP 6
#define FTS5_RP 7 #define FTS5_RP 7
#define FTS5_MINUS 8 #define FTS5_LCP 8
#define FTS5_LCP 9 #define FTS5_RCP 9
#define FTS5_RCP 10 #define FTS5_STRING 10
#define FTS5_STRING 11 #define FTS5_COMMA 11
#define FTS5_COMMA 12 #define FTS5_PLUS 12
#define FTS5_PLUS 13 #define FTS5_STAR 13
#define FTS5_STAR 14
/* /*
** 2000-05-29 ** 2000-05-29
@ -178714,17 +178688,17 @@ static int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic);
#endif #endif
/************* Begin control #defines *****************************************/ /************* Begin control #defines *****************************************/
#define fts5YYCODETYPE unsigned char #define fts5YYCODETYPE unsigned char
#define fts5YYNOCODE 28 #define fts5YYNOCODE 27
#define fts5YYACTIONTYPE unsigned char #define fts5YYACTIONTYPE unsigned char
#define sqlite3Fts5ParserFTS5TOKENTYPE Fts5Token #define sqlite3Fts5ParserFTS5TOKENTYPE Fts5Token
typedef union { typedef union {
int fts5yyinit; int fts5yyinit;
sqlite3Fts5ParserFTS5TOKENTYPE fts5yy0; sqlite3Fts5ParserFTS5TOKENTYPE fts5yy0;
int fts5yy4; Fts5Colset* fts5yy3;
Fts5Colset* fts5yy11; Fts5ExprPhrase* fts5yy11;
Fts5ExprNode* fts5yy24; Fts5ExprNode* fts5yy18;
Fts5ExprNearset* fts5yy46; int fts5yy20;
Fts5ExprPhrase* fts5yy53; Fts5ExprNearset* fts5yy26;
} fts5YYMINORTYPE; } fts5YYMINORTYPE;
#ifndef fts5YYSTACKDEPTH #ifndef fts5YYSTACKDEPTH
#define fts5YYSTACKDEPTH 100 #define fts5YYSTACKDEPTH 100
@ -178733,16 +178707,16 @@ typedef union {
#define sqlite3Fts5ParserARG_PDECL ,Fts5Parse *pParse #define sqlite3Fts5ParserARG_PDECL ,Fts5Parse *pParse
#define sqlite3Fts5ParserARG_FETCH Fts5Parse *pParse = fts5yypParser->pParse #define sqlite3Fts5ParserARG_FETCH Fts5Parse *pParse = fts5yypParser->pParse
#define sqlite3Fts5ParserARG_STORE fts5yypParser->pParse = pParse #define sqlite3Fts5ParserARG_STORE fts5yypParser->pParse = pParse
#define fts5YYNSTATE 29 #define fts5YYNSTATE 26
#define fts5YYNRULE 26 #define fts5YYNRULE 24
#define fts5YY_MAX_SHIFT 28 #define fts5YY_MAX_SHIFT 25
#define fts5YY_MIN_SHIFTREDUCE 45 #define fts5YY_MIN_SHIFTREDUCE 40
#define fts5YY_MAX_SHIFTREDUCE 70 #define fts5YY_MAX_SHIFTREDUCE 63
#define fts5YY_MIN_REDUCE 71 #define fts5YY_MIN_REDUCE 64
#define fts5YY_MAX_REDUCE 96 #define fts5YY_MAX_REDUCE 87
#define fts5YY_ERROR_ACTION 97 #define fts5YY_ERROR_ACTION 88
#define fts5YY_ACCEPT_ACTION 98 #define fts5YY_ACCEPT_ACTION 89
#define fts5YY_NO_ACTION 99 #define fts5YY_NO_ACTION 90
/************* End control #defines *******************************************/ /************* End control #defines *******************************************/
/* Define the fts5yytestcase() macro to be a no-op if is not already defined /* Define the fts5yytestcase() macro to be a no-op if is not already defined
@ -178774,7 +178748,7 @@ typedef union {
** **
** N between fts5YY_MIN_REDUCE Reduce by rule N-fts5YY_MIN_REDUCE ** N between fts5YY_MIN_REDUCE Reduce by rule N-fts5YY_MIN_REDUCE
** and fts5YY_MAX_REDUCE ** and fts5YY_MAX_REDUCE
**
** N == fts5YY_ERROR_ACTION A syntax error has occurred. ** N == fts5YY_ERROR_ACTION A syntax error has occurred.
** **
** N == fts5YY_ACCEPT_ACTION The parser accepts its input. ** N == fts5YY_ACCEPT_ACTION The parser accepts its input.
@ -178783,20 +178757,16 @@ typedef union {
** slots in the fts5yy_action[] table. ** slots in the fts5yy_action[] table.
** **
** The action table is constructed as a single large table named fts5yy_action[]. ** The action table is constructed as a single large table named fts5yy_action[].
** Given state S and lookahead X, the action is computed as either: ** Given state S and lookahead X, the action is computed as
** **
** (A) N = fts5yy_action[ fts5yy_shift_ofst[S] + X ] ** fts5yy_action[ fts5yy_shift_ofst[S] + X ]
** (B) N = fts5yy_default[S]
** **
** The (A) formula is preferred. The B formula is used instead if: ** If the index value fts5yy_shift_ofst[S]+X is out of range or if the value
** (1) The fts5yy_shift_ofst[S]+X value is out of range, or ** fts5yy_lookahead[fts5yy_shift_ofst[S]+X] is not equal to X or if fts5yy_shift_ofst[S]
** (2) fts5yy_lookahead[fts5yy_shift_ofst[S]+X] is not equal to X, or ** is equal to fts5YY_SHIFT_USE_DFLT, it means that the action is not in the table
** (3) fts5yy_shift_ofst[S] equal fts5YY_SHIFT_USE_DFLT. ** and that fts5yy_default[S] should be used instead.
** (Implementation note: fts5YY_SHIFT_USE_DFLT is chosen so that
** fts5YY_SHIFT_USE_DFLT+X will be out of range for all possible lookaheads X.
** Hence only tests (1) and (2) need to be evaluated.)
** **
** The formulas above are for computing the action when the lookahead is ** The formula above is for computing the action when the lookahead is
** a terminal symbol. If the lookahead is a non-terminal (as occurs after ** a terminal symbol. If the lookahead is a non-terminal (as occurs after
** a reduce action) then the fts5yy_reduce_ofst[] array is used in place of ** a reduce action) then the fts5yy_reduce_ofst[] array is used in place of
** the fts5yy_shift_ofst[] array and fts5YY_REDUCE_USE_DFLT is used in place of ** the fts5yy_shift_ofst[] array and fts5YY_REDUCE_USE_DFLT is used in place of
@ -178814,50 +178784,48 @@ typedef union {
** fts5yy_default[] Default action for each state. ** fts5yy_default[] Default action for each state.
** **
*********** Begin parsing tables **********************************************/ *********** Begin parsing tables **********************************************/
#define fts5YY_ACTTAB_COUNT (85) #define fts5YY_ACTTAB_COUNT (78)
static const fts5YYACTIONTYPE fts5yy_action[] = { static const fts5YYACTIONTYPE fts5yy_action[] = {
/* 0 */ 98, 16, 51, 5, 53, 27, 83, 7, 26, 15, /* 0 */ 89, 15, 46, 5, 48, 24, 12, 19, 23, 14,
/* 10 */ 51, 5, 53, 27, 13, 69, 26, 48, 51, 5, /* 10 */ 46, 5, 48, 24, 20, 21, 23, 43, 46, 5,
/* 20 */ 53, 27, 19, 11, 26, 9, 20, 51, 5, 53, /* 20 */ 48, 24, 6, 18, 23, 17, 46, 5, 48, 24,
/* 30 */ 27, 13, 22, 26, 28, 51, 5, 53, 27, 68, /* 30 */ 75, 7, 23, 25, 46, 5, 48, 24, 62, 47,
/* 40 */ 1, 26, 19, 11, 17, 9, 52, 10, 53, 27, /* 40 */ 23, 48, 24, 7, 11, 23, 9, 3, 4, 2,
/* 50 */ 23, 24, 26, 54, 3, 4, 2, 26, 6, 21, /* 50 */ 62, 50, 52, 44, 64, 3, 4, 2, 49, 4,
/* 60 */ 49, 71, 3, 4, 2, 7, 56, 59, 55, 59, /* 60 */ 2, 1, 23, 11, 16, 9, 12, 2, 10, 61,
/* 70 */ 4, 2, 12, 69, 58, 60, 18, 67, 62, 69, /* 70 */ 53, 59, 62, 60, 22, 13, 55, 8,
/* 80 */ 25, 66, 8, 14, 2,
}; };
static const fts5YYCODETYPE fts5yy_lookahead[] = { static const fts5YYCODETYPE fts5yy_lookahead[] = {
/* 0 */ 16, 17, 18, 19, 20, 21, 5, 6, 24, 17, /* 0 */ 15, 16, 17, 18, 19, 20, 10, 11, 23, 16,
/* 10 */ 18, 19, 20, 21, 11, 14, 24, 17, 18, 19, /* 10 */ 17, 18, 19, 20, 23, 24, 23, 16, 17, 18,
/* 20 */ 20, 21, 8, 9, 24, 11, 17, 18, 19, 20, /* 20 */ 19, 20, 22, 23, 23, 16, 17, 18, 19, 20,
/* 30 */ 21, 11, 12, 24, 17, 18, 19, 20, 21, 26, /* 30 */ 5, 6, 23, 16, 17, 18, 19, 20, 13, 17,
/* 40 */ 6, 24, 8, 9, 22, 11, 18, 11, 20, 21, /* 40 */ 23, 19, 20, 6, 8, 23, 10, 1, 2, 3,
/* 50 */ 24, 25, 24, 20, 1, 2, 3, 24, 23, 24, /* 50 */ 13, 9, 10, 7, 0, 1, 2, 3, 19, 2,
/* 60 */ 7, 0, 1, 2, 3, 6, 10, 11, 10, 11, /* 60 */ 3, 6, 23, 8, 21, 10, 10, 3, 10, 25,
/* 70 */ 2, 3, 9, 14, 11, 11, 22, 26, 7, 14, /* 70 */ 10, 10, 13, 25, 12, 10, 7, 5,
/* 80 */ 13, 11, 5, 11, 3,
}; };
#define fts5YY_SHIFT_USE_DFLT (85) #define fts5YY_SHIFT_USE_DFLT (-5)
#define fts5YY_SHIFT_COUNT (28) #define fts5YY_SHIFT_COUNT (25)
#define fts5YY_SHIFT_MIN (0) #define fts5YY_SHIFT_MIN (-4)
#define fts5YY_SHIFT_MAX (81) #define fts5YY_SHIFT_MAX (72)
static const unsigned char fts5yy_shift_ofst[] = { static const signed char fts5yy_shift_ofst[] = {
/* 0 */ 34, 34, 34, 34, 34, 14, 20, 3, 36, 1, /* 0 */ 55, 55, 55, 55, 55, 36, -4, 56, 58, 25,
/* 10 */ 59, 64, 64, 65, 65, 53, 61, 56, 58, 63, /* 10 */ 37, 60, 59, 59, 46, 54, 42, 57, 62, 61,
/* 20 */ 68, 67, 70, 67, 71, 72, 67, 77, 81, /* 20 */ 62, 69, 65, 62, 72, 64,
}; };
#define fts5YY_REDUCE_USE_DFLT (-17) #define fts5YY_REDUCE_USE_DFLT (-16)
#define fts5YY_REDUCE_COUNT (14) #define fts5YY_REDUCE_COUNT (13)
#define fts5YY_REDUCE_MIN (-16) #define fts5YY_REDUCE_MIN (-15)
#define fts5YY_REDUCE_MAX (54) #define fts5YY_REDUCE_MAX (48)
static const signed char fts5yy_reduce_ofst[] = { static const signed char fts5yy_reduce_ofst[] = {
/* 0 */ -16, -8, 0, 9, 17, 28, 26, 35, 33, 13, /* 0 */ -15, -7, 1, 9, 17, 22, -9, 0, 39, 44,
/* 10 */ 13, 22, 54, 13, 51, /* 10 */ 44, 43, 44, 48,
}; };
static const fts5YYACTIONTYPE fts5yy_default[] = { static const fts5YYACTIONTYPE fts5yy_default[] = {
/* 0 */ 97, 97, 97, 97, 97, 76, 91, 97, 97, 96, /* 0 */ 88, 88, 88, 88, 88, 69, 82, 88, 88, 87,
/* 10 */ 96, 97, 97, 96, 96, 97, 97, 97, 97, 97, /* 10 */ 87, 88, 87, 87, 88, 88, 88, 66, 80, 88,
/* 20 */ 73, 89, 97, 90, 97, 97, 87, 97, 72, /* 20 */ 81, 88, 88, 78, 88, 65,
}; };
/********** End of lemon-generated parsing tables *****************************/ /********** End of lemon-generated parsing tables *****************************/
@ -178964,11 +178932,11 @@ static void sqlite3Fts5ParserTrace(FILE *TraceFILE, char *zTracePrompt){
static const char *const fts5yyTokenName[] = { static const char *const fts5yyTokenName[] = {
"$", "OR", "AND", "NOT", "$", "OR", "AND", "NOT",
"TERM", "COLON", "LP", "RP", "TERM", "COLON", "LP", "RP",
"MINUS", "LCP", "RCP", "STRING", "LCP", "RCP", "STRING", "COMMA",
"COMMA", "PLUS", "STAR", "error", "PLUS", "STAR", "error", "input",
"input", "expr", "cnearset", "exprlist", "expr", "cnearset", "exprlist", "nearset",
"nearset", "colset", "colsetlist", "nearphrases", "colset", "colsetlist", "nearphrases", "phrase",
"phrase", "neardist_opt", "star_opt", "neardist_opt", "star_opt",
}; };
#endif /* NDEBUG */ #endif /* NDEBUG */
@ -178986,22 +178954,20 @@ static const char *const fts5yyRuleName[] = {
/* 7 */ "exprlist ::= exprlist cnearset", /* 7 */ "exprlist ::= exprlist cnearset",
/* 8 */ "cnearset ::= nearset", /* 8 */ "cnearset ::= nearset",
/* 9 */ "cnearset ::= colset COLON nearset", /* 9 */ "cnearset ::= colset COLON nearset",
/* 10 */ "colset ::= MINUS LCP colsetlist RCP", /* 10 */ "colset ::= LCP colsetlist RCP",
/* 11 */ "colset ::= LCP colsetlist RCP", /* 11 */ "colset ::= STRING",
/* 12 */ "colset ::= STRING", /* 12 */ "colsetlist ::= colsetlist STRING",
/* 13 */ "colset ::= MINUS STRING", /* 13 */ "colsetlist ::= STRING",
/* 14 */ "colsetlist ::= colsetlist STRING", /* 14 */ "nearset ::= phrase",
/* 15 */ "colsetlist ::= STRING", /* 15 */ "nearset ::= STRING LP nearphrases neardist_opt RP",
/* 16 */ "nearset ::= phrase", /* 16 */ "nearphrases ::= phrase",
/* 17 */ "nearset ::= STRING LP nearphrases neardist_opt RP", /* 17 */ "nearphrases ::= nearphrases phrase",
/* 18 */ "nearphrases ::= phrase", /* 18 */ "neardist_opt ::=",
/* 19 */ "nearphrases ::= nearphrases phrase", /* 19 */ "neardist_opt ::= COMMA STRING",
/* 20 */ "neardist_opt ::=", /* 20 */ "phrase ::= phrase PLUS STRING star_opt",
/* 21 */ "neardist_opt ::= COMMA STRING", /* 21 */ "phrase ::= STRING star_opt",
/* 22 */ "phrase ::= phrase PLUS STRING star_opt", /* 22 */ "star_opt ::= STAR",
/* 23 */ "phrase ::= STRING star_opt", /* 23 */ "star_opt ::=",
/* 24 */ "star_opt ::= STAR",
/* 25 */ "star_opt ::=",
}; };
#endif /* NDEBUG */ #endif /* NDEBUG */
@ -179111,33 +179077,33 @@ static void fts5yy_destructor(
** inside the C code. ** inside the C code.
*/ */
/********* Begin destructor definitions ***************************************/ /********* Begin destructor definitions ***************************************/
case 16: /* input */ case 15: /* input */
{ {
(void)pParse; (void)pParse;
} }
break; break;
case 17: /* expr */ case 16: /* expr */
case 18: /* cnearset */ case 17: /* cnearset */
case 19: /* exprlist */ case 18: /* exprlist */
{ {
sqlite3Fts5ParseNodeFree((fts5yypminor->fts5yy24)); sqlite3Fts5ParseNodeFree((fts5yypminor->fts5yy18));
} }
break; break;
case 20: /* nearset */ case 19: /* nearset */
case 23: /* nearphrases */ case 22: /* nearphrases */
{ {
sqlite3Fts5ParseNearsetFree((fts5yypminor->fts5yy46)); sqlite3Fts5ParseNearsetFree((fts5yypminor->fts5yy26));
} }
break; break;
case 21: /* colset */ case 20: /* colset */
case 22: /* colsetlist */ case 21: /* colsetlist */
{ {
sqlite3_free((fts5yypminor->fts5yy11)); sqlite3_free((fts5yypminor->fts5yy3));
} }
break; break;
case 24: /* phrase */ case 23: /* phrase */
{ {
sqlite3Fts5ParsePhraseFree((fts5yypminor->fts5yy53)); sqlite3Fts5ParsePhraseFree((fts5yypminor->fts5yy11));
} }
break; break;
/********* End destructor definitions *****************************************/ /********* End destructor definitions *****************************************/
@ -179214,47 +179180,50 @@ static unsigned int fts5yy_find_shift_action(
assert( stateno <= fts5YY_SHIFT_COUNT ); assert( stateno <= fts5YY_SHIFT_COUNT );
do{ do{
i = fts5yy_shift_ofst[stateno]; i = fts5yy_shift_ofst[stateno];
if( i==fts5YY_SHIFT_USE_DFLT ) return fts5yy_default[stateno];
assert( iLookAhead!=fts5YYNOCODE ); assert( iLookAhead!=fts5YYNOCODE );
i += iLookAhead; i += iLookAhead;
if( i<0 || i>=fts5YY_ACTTAB_COUNT || fts5yy_lookahead[i]!=iLookAhead ){ if( i<0 || i>=fts5YY_ACTTAB_COUNT || fts5yy_lookahead[i]!=iLookAhead ){
if( iLookAhead>0 ){
#ifdef fts5YYFALLBACK #ifdef fts5YYFALLBACK
fts5YYCODETYPE iFallback; /* Fallback token */ fts5YYCODETYPE iFallback; /* Fallback token */
if( iLookAhead<sizeof(fts5yyFallback)/sizeof(fts5yyFallback[0]) if( iLookAhead<sizeof(fts5yyFallback)/sizeof(fts5yyFallback[0])
&& (iFallback = fts5yyFallback[iLookAhead])!=0 ){ && (iFallback = fts5yyFallback[iLookAhead])!=0 ){
#ifndef NDEBUG
if( fts5yyTraceFILE ){
fprintf(fts5yyTraceFILE, "%sFALLBACK %s => %s\n",
fts5yyTracePrompt, fts5yyTokenName[iLookAhead], fts5yyTokenName[iFallback]);
}
#endif
assert( fts5yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
iLookAhead = iFallback;
continue;
}
#endif
#ifdef fts5YYWILDCARD
{
int j = i - iLookAhead + fts5YYWILDCARD;
if(
#if fts5YY_SHIFT_MIN+fts5YYWILDCARD<0
j>=0 &&
#endif
#if fts5YY_SHIFT_MAX+fts5YYWILDCARD>=fts5YY_ACTTAB_COUNT
j<fts5YY_ACTTAB_COUNT &&
#endif
fts5yy_lookahead[j]==fts5YYWILDCARD && iLookAhead>0
){
#ifndef NDEBUG #ifndef NDEBUG
if( fts5yyTraceFILE ){ if( fts5yyTraceFILE ){
fprintf(fts5yyTraceFILE, "%sWILDCARD %s => %s\n", fprintf(fts5yyTraceFILE, "%sFALLBACK %s => %s\n",
fts5yyTracePrompt, fts5yyTokenName[iLookAhead], fts5yyTracePrompt, fts5yyTokenName[iLookAhead], fts5yyTokenName[iFallback]);
fts5yyTokenName[fts5YYWILDCARD]); }
#endif
assert( fts5yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
iLookAhead = iFallback;
continue;
}
#endif
#ifdef fts5YYWILDCARD
{
int j = i - iLookAhead + fts5YYWILDCARD;
if(
#if fts5YY_SHIFT_MIN+fts5YYWILDCARD<0
j>=0 &&
#endif
#if fts5YY_SHIFT_MAX+fts5YYWILDCARD>=fts5YY_ACTTAB_COUNT
j<fts5YY_ACTTAB_COUNT &&
#endif
fts5yy_lookahead[j]==fts5YYWILDCARD
){
#ifndef NDEBUG
if( fts5yyTraceFILE ){
fprintf(fts5yyTraceFILE, "%sWILDCARD %s => %s\n",
fts5yyTracePrompt, fts5yyTokenName[iLookAhead],
fts5yyTokenName[fts5YYWILDCARD]);
}
#endif /* NDEBUG */
return fts5yy_action[j];
} }
#endif /* NDEBUG */
return fts5yy_action[j];
} }
}
#endif /* fts5YYWILDCARD */ #endif /* fts5YYWILDCARD */
}
return fts5yy_default[stateno]; return fts5yy_default[stateno];
}else{ }else{
return fts5yy_action[i]; return fts5yy_action[i];
@ -179381,32 +179350,30 @@ static const struct {
fts5YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ fts5YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
unsigned char nrhs; /* Number of right-hand side symbols in the rule */ unsigned char nrhs; /* Number of right-hand side symbols in the rule */
} fts5yyRuleInfo[] = { } fts5yyRuleInfo[] = {
{ 15, 1 },
{ 16, 3 },
{ 16, 3 },
{ 16, 3 },
{ 16, 3 },
{ 16, 1 }, { 16, 1 },
{ 17, 3 },
{ 17, 3 },
{ 17, 3 },
{ 17, 3 },
{ 17, 1 },
{ 19, 1 },
{ 19, 2 },
{ 18, 1 }, { 18, 1 },
{ 18, 3 }, { 18, 2 },
{ 21, 4 }, { 17, 1 },
{ 21, 3 }, { 17, 3 },
{ 21, 1 }, { 20, 3 },
{ 21, 2 },
{ 22, 2 },
{ 22, 1 },
{ 20, 1 }, { 20, 1 },
{ 20, 5 }, { 21, 2 },
{ 23, 1 }, { 21, 1 },
{ 23, 2 }, { 19, 1 },
{ 25, 0 }, { 19, 5 },
{ 25, 2 }, { 22, 1 },
{ 24, 4 }, { 22, 2 },
{ 24, 0 },
{ 24, 2 }, { 24, 2 },
{ 26, 1 }, { 23, 4 },
{ 26, 0 }, { 23, 2 },
{ 25, 1 },
{ 25, 0 },
}; };
static void fts5yy_accept(fts5yyParser*); /* Forward Declaration */ static void fts5yy_accept(fts5yyParser*); /* Forward Declaration */
@ -179471,131 +179438,120 @@ static void fts5yy_reduce(
/********** Begin reduce actions **********************************************/ /********** Begin reduce actions **********************************************/
fts5YYMINORTYPE fts5yylhsminor; fts5YYMINORTYPE fts5yylhsminor;
case 0: /* input ::= expr */ case 0: /* input ::= expr */
{ sqlite3Fts5ParseFinished(pParse, fts5yymsp[0].minor.fts5yy24); } { sqlite3Fts5ParseFinished(pParse, fts5yymsp[0].minor.fts5yy18); }
break; break;
case 1: /* expr ::= expr AND expr */ case 1: /* expr ::= expr AND expr */
{ {
fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_AND, fts5yymsp[-2].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24, 0); fts5yylhsminor.fts5yy18 = sqlite3Fts5ParseNode(pParse, FTS5_AND, fts5yymsp[-2].minor.fts5yy18, fts5yymsp[0].minor.fts5yy18, 0);
} }
fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24; fts5yymsp[-2].minor.fts5yy18 = fts5yylhsminor.fts5yy18;
break; break;
case 2: /* expr ::= expr OR expr */ case 2: /* expr ::= expr OR expr */
{ {
fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_OR, fts5yymsp[-2].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24, 0); fts5yylhsminor.fts5yy18 = sqlite3Fts5ParseNode(pParse, FTS5_OR, fts5yymsp[-2].minor.fts5yy18, fts5yymsp[0].minor.fts5yy18, 0);
} }
fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24; fts5yymsp[-2].minor.fts5yy18 = fts5yylhsminor.fts5yy18;
break; break;
case 3: /* expr ::= expr NOT expr */ case 3: /* expr ::= expr NOT expr */
{ {
fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_NOT, fts5yymsp[-2].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24, 0); fts5yylhsminor.fts5yy18 = sqlite3Fts5ParseNode(pParse, FTS5_NOT, fts5yymsp[-2].minor.fts5yy18, fts5yymsp[0].minor.fts5yy18, 0);
} }
fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24; fts5yymsp[-2].minor.fts5yy18 = fts5yylhsminor.fts5yy18;
break; break;
case 4: /* expr ::= LP expr RP */ case 4: /* expr ::= LP expr RP */
{fts5yymsp[-2].minor.fts5yy24 = fts5yymsp[-1].minor.fts5yy24;} {fts5yymsp[-2].minor.fts5yy18 = fts5yymsp[-1].minor.fts5yy18;}
break; break;
case 5: /* expr ::= exprlist */ case 5: /* expr ::= exprlist */
case 6: /* exprlist ::= cnearset */ fts5yytestcase(fts5yyruleno==6); case 6: /* exprlist ::= cnearset */ fts5yytestcase(fts5yyruleno==6);
{fts5yylhsminor.fts5yy24 = fts5yymsp[0].minor.fts5yy24;} {fts5yylhsminor.fts5yy18 = fts5yymsp[0].minor.fts5yy18;}
fts5yymsp[0].minor.fts5yy24 = fts5yylhsminor.fts5yy24; fts5yymsp[0].minor.fts5yy18 = fts5yylhsminor.fts5yy18;
break; break;
case 7: /* exprlist ::= exprlist cnearset */ case 7: /* exprlist ::= exprlist cnearset */
{ {
fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseImplicitAnd(pParse, fts5yymsp[-1].minor.fts5yy24, fts5yymsp[0].minor.fts5yy24); fts5yylhsminor.fts5yy18 = sqlite3Fts5ParseImplicitAnd(pParse, fts5yymsp[-1].minor.fts5yy18, fts5yymsp[0].minor.fts5yy18);
} }
fts5yymsp[-1].minor.fts5yy24 = fts5yylhsminor.fts5yy24; fts5yymsp[-1].minor.fts5yy18 = fts5yylhsminor.fts5yy18;
break; break;
case 8: /* cnearset ::= nearset */ case 8: /* cnearset ::= nearset */
{ {
fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy46); fts5yylhsminor.fts5yy18 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy26);
} }
fts5yymsp[0].minor.fts5yy24 = fts5yylhsminor.fts5yy24; fts5yymsp[0].minor.fts5yy18 = fts5yylhsminor.fts5yy18;
break; break;
case 9: /* cnearset ::= colset COLON nearset */ case 9: /* cnearset ::= colset COLON nearset */
{ {
sqlite3Fts5ParseSetColset(pParse, fts5yymsp[0].minor.fts5yy46, fts5yymsp[-2].minor.fts5yy11); sqlite3Fts5ParseSetColset(pParse, fts5yymsp[0].minor.fts5yy26, fts5yymsp[-2].minor.fts5yy3);
fts5yylhsminor.fts5yy24 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy46); fts5yylhsminor.fts5yy18 = sqlite3Fts5ParseNode(pParse, FTS5_STRING, 0, 0, fts5yymsp[0].minor.fts5yy26);
} }
fts5yymsp[-2].minor.fts5yy24 = fts5yylhsminor.fts5yy24; fts5yymsp[-2].minor.fts5yy18 = fts5yylhsminor.fts5yy18;
break; break;
case 10: /* colset ::= MINUS LCP colsetlist RCP */ case 10: /* colset ::= LCP colsetlist RCP */
{ fts5yymsp[-2].minor.fts5yy3 = fts5yymsp[-1].minor.fts5yy3; }
break;
case 11: /* colset ::= STRING */
{ {
fts5yymsp[-3].minor.fts5yy11 = sqlite3Fts5ParseColsetInvert(pParse, fts5yymsp[-1].minor.fts5yy11); fts5yylhsminor.fts5yy3 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0);
} }
fts5yymsp[0].minor.fts5yy3 = fts5yylhsminor.fts5yy3;
break; break;
case 11: /* colset ::= LCP colsetlist RCP */ case 12: /* colsetlist ::= colsetlist STRING */
{ fts5yymsp[-2].minor.fts5yy11 = fts5yymsp[-1].minor.fts5yy11; }
break;
case 12: /* colset ::= STRING */
{ {
fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0); fts5yylhsminor.fts5yy3 = sqlite3Fts5ParseColset(pParse, fts5yymsp[-1].minor.fts5yy3, &fts5yymsp[0].minor.fts5yy0); }
fts5yymsp[-1].minor.fts5yy3 = fts5yylhsminor.fts5yy3;
break;
case 13: /* colsetlist ::= STRING */
{
fts5yylhsminor.fts5yy3 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0);
} }
fts5yymsp[0].minor.fts5yy11 = fts5yylhsminor.fts5yy11; fts5yymsp[0].minor.fts5yy3 = fts5yylhsminor.fts5yy3;
break; break;
case 13: /* colset ::= MINUS STRING */ case 14: /* nearset ::= phrase */
{ { fts5yylhsminor.fts5yy26 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy11); }
fts5yymsp[-1].minor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0); fts5yymsp[0].minor.fts5yy26 = fts5yylhsminor.fts5yy26;
fts5yymsp[-1].minor.fts5yy11 = sqlite3Fts5ParseColsetInvert(pParse, fts5yymsp[-1].minor.fts5yy11);
}
break; break;
case 14: /* colsetlist ::= colsetlist STRING */ case 15: /* nearset ::= STRING LP nearphrases neardist_opt RP */
{
fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, fts5yymsp[-1].minor.fts5yy11, &fts5yymsp[0].minor.fts5yy0); }
fts5yymsp[-1].minor.fts5yy11 = fts5yylhsminor.fts5yy11;
break;
case 15: /* colsetlist ::= STRING */
{
fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseColset(pParse, 0, &fts5yymsp[0].minor.fts5yy0);
}
fts5yymsp[0].minor.fts5yy11 = fts5yylhsminor.fts5yy11;
break;
case 16: /* nearset ::= phrase */
{ fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53); }
fts5yymsp[0].minor.fts5yy46 = fts5yylhsminor.fts5yy46;
break;
case 17: /* nearset ::= STRING LP nearphrases neardist_opt RP */
{ {
sqlite3Fts5ParseNear(pParse, &fts5yymsp[-4].minor.fts5yy0); sqlite3Fts5ParseNear(pParse, &fts5yymsp[-4].minor.fts5yy0);
sqlite3Fts5ParseSetDistance(pParse, fts5yymsp[-2].minor.fts5yy46, &fts5yymsp[-1].minor.fts5yy0); sqlite3Fts5ParseSetDistance(pParse, fts5yymsp[-2].minor.fts5yy26, &fts5yymsp[-1].minor.fts5yy0);
fts5yylhsminor.fts5yy46 = fts5yymsp[-2].minor.fts5yy46; fts5yylhsminor.fts5yy26 = fts5yymsp[-2].minor.fts5yy26;
} }
fts5yymsp[-4].minor.fts5yy46 = fts5yylhsminor.fts5yy46; fts5yymsp[-4].minor.fts5yy26 = fts5yylhsminor.fts5yy26;
break; break;
case 18: /* nearphrases ::= phrase */ case 16: /* nearphrases ::= phrase */
{ {
fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy53); fts5yylhsminor.fts5yy26 = sqlite3Fts5ParseNearset(pParse, 0, fts5yymsp[0].minor.fts5yy11);
} }
fts5yymsp[0].minor.fts5yy46 = fts5yylhsminor.fts5yy46; fts5yymsp[0].minor.fts5yy26 = fts5yylhsminor.fts5yy26;
break; break;
case 19: /* nearphrases ::= nearphrases phrase */ case 17: /* nearphrases ::= nearphrases phrase */
{ {
fts5yylhsminor.fts5yy46 = sqlite3Fts5ParseNearset(pParse, fts5yymsp[-1].minor.fts5yy46, fts5yymsp[0].minor.fts5yy53); fts5yylhsminor.fts5yy26 = sqlite3Fts5ParseNearset(pParse, fts5yymsp[-1].minor.fts5yy26, fts5yymsp[0].minor.fts5yy11);
} }
fts5yymsp[-1].minor.fts5yy46 = fts5yylhsminor.fts5yy46; fts5yymsp[-1].minor.fts5yy26 = fts5yylhsminor.fts5yy26;
break; break;
case 20: /* neardist_opt ::= */ case 18: /* neardist_opt ::= */
{ fts5yymsp[1].minor.fts5yy0.p = 0; fts5yymsp[1].minor.fts5yy0.n = 0; } { fts5yymsp[1].minor.fts5yy0.p = 0; fts5yymsp[1].minor.fts5yy0.n = 0; }
break; break;
case 21: /* neardist_opt ::= COMMA STRING */ case 19: /* neardist_opt ::= COMMA STRING */
{ fts5yymsp[-1].minor.fts5yy0 = fts5yymsp[0].minor.fts5yy0; } { fts5yymsp[-1].minor.fts5yy0 = fts5yymsp[0].minor.fts5yy0; }
break; break;
case 22: /* phrase ::= phrase PLUS STRING star_opt */ case 20: /* phrase ::= phrase PLUS STRING star_opt */
{ {
fts5yylhsminor.fts5yy53 = sqlite3Fts5ParseTerm(pParse, fts5yymsp[-3].minor.fts5yy53, &fts5yymsp[-1].minor.fts5yy0, fts5yymsp[0].minor.fts5yy4); fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseTerm(pParse, fts5yymsp[-3].minor.fts5yy11, &fts5yymsp[-1].minor.fts5yy0, fts5yymsp[0].minor.fts5yy20);
} }
fts5yymsp[-3].minor.fts5yy53 = fts5yylhsminor.fts5yy53; fts5yymsp[-3].minor.fts5yy11 = fts5yylhsminor.fts5yy11;
break; break;
case 23: /* phrase ::= STRING star_opt */ case 21: /* phrase ::= STRING star_opt */
{ {
fts5yylhsminor.fts5yy53 = sqlite3Fts5ParseTerm(pParse, 0, &fts5yymsp[-1].minor.fts5yy0, fts5yymsp[0].minor.fts5yy4); fts5yylhsminor.fts5yy11 = sqlite3Fts5ParseTerm(pParse, 0, &fts5yymsp[-1].minor.fts5yy0, fts5yymsp[0].minor.fts5yy20);
} }
fts5yymsp[-1].minor.fts5yy53 = fts5yylhsminor.fts5yy53; fts5yymsp[-1].minor.fts5yy11 = fts5yylhsminor.fts5yy11;
break; break;
case 24: /* star_opt ::= STAR */ case 22: /* star_opt ::= STAR */
{ fts5yymsp[0].minor.fts5yy4 = 1; } { fts5yymsp[0].minor.fts5yy20 = 1; }
break; break;
case 25: /* star_opt ::= */ case 23: /* star_opt ::= */
{ fts5yymsp[1].minor.fts5yy4 = 0; } { fts5yymsp[1].minor.fts5yy20 = 0; }
break; break;
default: default:
break; break;
@ -181949,7 +181905,6 @@ static int fts5ExprGetToken(
case ',': tok = FTS5_COMMA; break; case ',': tok = FTS5_COMMA; break;
case '+': tok = FTS5_PLUS; break; case '+': tok = FTS5_PLUS; break;
case '*': tok = FTS5_STAR; break; case '*': tok = FTS5_STAR; break;
case '-': tok = FTS5_MINUS; break;
case '\0': tok = FTS5_EOF; break; case '\0': tok = FTS5_EOF; break;
case '"': { case '"': {
@ -183576,34 +183531,6 @@ static Fts5Colset *fts5ParseColset(
return pNew; return pNew;
} }
/*
** Allocate and return an Fts5Colset object specifying the inverse of
** the colset passed as the second argument. Free the colset passed
** as the second argument before returning.
*/
static Fts5Colset *sqlite3Fts5ParseColsetInvert(Fts5Parse *pParse, Fts5Colset *p){
Fts5Colset *pRet;
int nCol = pParse->pConfig->nCol;
pRet = (Fts5Colset*)sqlite3Fts5MallocZero(&pParse->rc,
sizeof(Fts5Colset) + sizeof(int)*nCol
);
if( pRet ){
int i;
int iOld = 0;
for(i=0; i<nCol; i++){
if( iOld>=p->nCol || p->aiCol[iOld]!=i ){
pRet->aiCol[pRet->nCol++] = i;
}else{
iOld++;
}
}
}
sqlite3_free(p);
return pRet;
}
static Fts5Colset *sqlite3Fts5ParseColset( static Fts5Colset *sqlite3Fts5ParseColset(
Fts5Parse *pParse, /* Store SQLITE_NOMEM here if required */ Fts5Parse *pParse, /* Store SQLITE_NOMEM here if required */
Fts5Colset *pColset, /* Existing colset object */ Fts5Colset *pColset, /* Existing colset object */
@ -188192,14 +188119,6 @@ static void fts5IterSetOutputs_Nocolset(Fts5Iter *pIter, Fts5SegIter *pSeg){
} }
} }
/*
** xSetOutputs callback used when the Fts5Colset object has nCol==0 (match
** against no columns at all).
*/
static void fts5IterSetOutputs_ZeroColset(Fts5Iter *pIter, Fts5SegIter *pSeg){
pIter->base.nData = 0;
}
/* /*
** xSetOutputs callback used by detail=col when there is a column filter ** xSetOutputs callback used by detail=col when there is a column filter
** and there are 100 or more columns. Also called as a fallback from ** and there are 100 or more columns. Also called as a fallback from
@ -188305,10 +188224,6 @@ static void fts5IterSetOutputCb(int *pRc, Fts5Iter *pIter){
pIter->xSetOutputs = fts5IterSetOutputs_Nocolset; pIter->xSetOutputs = fts5IterSetOutputs_Nocolset;
} }
else if( pIter->pColset->nCol==0 ){
pIter->xSetOutputs = fts5IterSetOutputs_ZeroColset;
}
else if( pConfig->eDetail==FTS5_DETAIL_FULL ){ else if( pConfig->eDetail==FTS5_DETAIL_FULL ){
pIter->xSetOutputs = fts5IterSetOutputs_Full; pIter->xSetOutputs = fts5IterSetOutputs_Full;
} }
@ -194085,7 +194000,7 @@ static void fts5SourceIdFunc(
){ ){
assert( nArg==0 ); assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused); UNUSED_PARAM2(nArg, apUnused);
sqlite3_result_text(pCtx, "fts5: 2016-08-10 11:50:12 b07a26df06a2ffb946ff8a1cc7f43eaf701a94b5", -1, SQLITE_TRANSIENT); sqlite3_result_text(pCtx, "fts5: 2016-08-08 13:40:27 d5e98057028abcf7217d0d2b2e29bbbcdf09d6de", -1, SQLITE_TRANSIENT);
} }
static int fts5Init(sqlite3 *db){ static int fts5Init(sqlite3 *db){

View File

@ -120,9 +120,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()]. ** [sqlite_version()] and [sqlite_source_id()].
*/ */
#define SQLITE_VERSION "3.15.0" #define SQLITE_VERSION "3.14.0"
#define SQLITE_VERSION_NUMBER 3015000 #define SQLITE_VERSION_NUMBER 3014000
#define SQLITE_SOURCE_ID "2016-08-10 15:02:49 059f4e2efefb7b9deaf539110c19bceaeb10c6ce" #define SQLITE_SOURCE_ID "2016-08-08 13:40:27 d5e98057028abcf7217d0d2b2e29bbbcdf09d6de"
/* /*
** CAPI3REF: Run-Time Library Version Numbers ** CAPI3REF: Run-Time Library Version Numbers