line |
true |
false |
branch |
20027
|
63567 |
137309 |
if( wsdStat.nowValue[op]>wsdStat.mxValue[op] ){ |
20057
|
699 |
102007 |
if( newValue>wsdStat.mxValue[op] ){ |
20073
|
11 |
0 |
if( op<0 || op>=ArraySize(wsdStat.nowValue) ){ |
|
0 |
11 |
if( op<0 || op>=ArraySize(wsdStat.nowValue) ){ |
20079
|
3 |
8 |
pMutex = statMutex[op] ? sqlite3Pcache1Mutex() : sqlite3MallocMutex(); |
20083
|
0 |
11 |
if( resetFlag ){ |
20097
|
11 |
0 |
if( rc==0 ){ |
20109
|
198 |
528 |
while( p ){ |
20122
|
2 |
262 |
if( pHighwater ) *pHighwater = db->lookaside.nSlot - nInit; |
20146
|
0 |
2 |
if( resetFlag ){ |
20148
|
0 |
0 |
if( p ){ |
20149
|
0 |
0 |
while( p->pNext ) p = p->pNext; |
20168
|
0 |
6 |
if( resetFlag ){ |
20184
|
4 |
2 |
for(i=0; inDb; i++){ |
20186
|
2 |
2 |
if( pBt ){ |
20189
|
0 |
2 |
if( op==SQLITE_DBSTATUS_CACHE_USED_SHARED ){ |
20212
|
4 |
2 |
for(i=0; inDb; i++){ |
20214
|
4 |
0 |
if( ALWAYS(pSchema!=0) ){ |
20228
|
0 |
4 |
for(p=sqliteHashFirst(&pSchema->trigHash); p; p=sqliteHashNext(p)){ |
20231
|
6 |
4 |
for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){ |
20254
|
0 |
2 |
for(pVdbe=db->pVdbe; pVdbe; pVdbe=pVdbe->pNext){ |
20282
|
12 |
6 |
for(i=0; inDb; i++){ |
20283
|
6 |
6 |
if( db->aDb[i].pBt ){ |
20301
|
0 |
0 |
*pCurrent = db->nDeferredImmCons>0 || db->nDeferredCons>0; |
|
0 |
0 |
*pCurrent = db->nDeferredImmCons>0 || db->nDeferredCons>0; |
20442
|
0 |
0 |
while( N-- ){ |
20443
|
0 |
0 |
if( !sqlite3Isdigit(*zDate) ){ |
20449
|
0 |
0 |
if( val<(int)min || val>(int)max || (nextC!=0 && nextC!=*zDate) ){ |
|
0 |
0 |
if( val<(int)min || val>(int)max || (nextC!=0 && nextC!=*zDate) ){ |
|
0 |
0 |
if( val<(int)min || val>(int)max || (nextC!=0 && nextC!=*zDate) ){ |
|
0 |
0 |
if( val<(int)min || val>(int)max || (nextC!=0 && nextC!=*zDate) ){ |
20452
|
0 |
0 |
*va_arg(ap,int*) = val; |
20456
|
0 |
0 |
}while( nextC ); |
20482
|
0 |
0 |
while( sqlite3Isspace(*zDate) ){ zDate++; } |
20485
|
0 |
0 |
if( c=='-' ){ |
20487
|
0 |
0 |
}else if( c=='+' ){ |
20489
|
0 |
0 |
}else if( c=='Z' || c=='z' ){ |
|
0 |
0 |
}else if( c=='Z' || c=='z' ){ |
20496
|
0 |
0 |
if( getDigits(zDate, "20b:20e", &nHr, &nMn)!=2 ){ |
20502
|
0 |
0 |
while( sqlite3Isspace(*zDate) ){ zDate++; } |
20517
|
0 |
0 |
if( getDigits(zDate, "20c:20e", &h, &m)!=2 ){ |
20521
|
0 |
0 |
if( *zDate==':' ){ |
20523
|
0 |
0 |
if( getDigits(zDate, "20e", &s)!=1 ){ |
20527
|
0 |
0 |
if( *zDate=='.' && sqlite3Isdigit(zDate[1]) ){ |
|
0 |
0 |
if( *zDate=='.' && sqlite3Isdigit(zDate[1]) ){ |
20530
|
0 |
0 |
while( sqlite3Isdigit(*zDate) ){ |
20546
|
0 |
0 |
if( parseTimezone(zDate, p) ) return 1; |
20568
|
0 |
0 |
if( p->validJD ) return; |
20569
|
0 |
0 |
if( p->validYMD ){ |
20578
|
0 |
0 |
if( Y<-4713 || Y>9999 || p->rawS ){ |
|
0 |
0 |
if( Y<-4713 || Y>9999 || p->rawS ){ |
|
0 |
0 |
if( Y<-4713 || Y>9999 || p->rawS ){ |
20582
|
0 |
0 |
if( M<=2 ){ |
20592
|
0 |
0 |
if( p->validHMS ){ |
20594
|
0 |
0 |
if( p->validTZ ){ |
20618
|
0 |
0 |
if( zDate[0]=='-' ){ |
20624
|
0 |
0 |
if( getDigits(zDate, "40f-21a-21d", &Y, &M, &D)!=3 ){ |
20628
|
0 |
0 |
while( sqlite3Isspace(*zDate) || 'T'==*(u8*)zDate ){ zDate++; } |
|
0 |
0 |
while( sqlite3Isspace(*zDate) || 'T'==*(u8*)zDate ){ zDate++; } |
20629
|
0 |
0 |
if( parseHhMmSs(zDate, p)==0 ){ |
20631
|
0 |
0 |
}else if( *zDate==0 ){ |
20638
|
0 |
0 |
p->Y = neg ? -Y : Y; |
20641
|
0 |
0 |
if( p->validTZ ){ |
20654
|
0 |
0 |
if( p->iJD>0 ){ |
20671
|
0 |
0 |
if( r>=0.0 && r<5373484.5 ){ |
|
0 |
0 |
if( r>=0.0 && r<5373484.5 ){ |
20699
|
0 |
0 |
if( parseYyyyMmDd(zDate,p)==0 ){ |
20701
|
0 |
0 |
}else if( parseHhMmSs(zDate, p)==0 ){ |
20703
|
0 |
0 |
}else if( sqlite3StrICmp(zDate,"now")==0 && sqlite3NotPureFunc(context) ){ |
|
0 |
0 |
}else if( sqlite3StrICmp(zDate,"now")==0 && sqlite3NotPureFunc(context) ){ |
20705
|
0 |
0 |
}else if( sqlite3AtoF(zDate, &r, sqlite3Strlen30(zDate), SQLITE_UTF8) ){ |
20727
|
0 |
0 |
return iJD>=0 && iJD<=INT_464269060799999; |
|
0 |
0 |
return iJD>=0 && iJD<=INT_464269060799999; |
20735
|
0 |
0 |
if( p->validYMD ) return; |
20736
|
0 |
0 |
if( !p->validJD ){ |
20740
|
0 |
0 |
}else if( !validJulianDay(p->iJD) ){ |
20753
|
0 |
0 |
p->M = E<14 ? E-1 : E-13; |
20754
|
0 |
0 |
p->Y = p->M>2 ? C - 4716 : C - 4715; |
20764
|
0 |
0 |
if( p->validHMS ) return; |
20837
|
0 |
0 |
if( sqlite3GlobalConfig.bLocaltimeFault ) pX = 0; |
20839
|
0 |
0 |
if( pX ) *pTm = *pX; |
20880
|
0 |
0 |
if( x.Y<1971 || x.Y>=2038 ){ |
|
0 |
0 |
if( x.Y<1971 || x.Y>=2038 ){ |
20900
|
0 |
0 |
if( osLocaltime(&t, &sLocal) ){ |
20986
|
0 |
0 |
if( sqlite3_stricmp(z, "localtime")==0 && sqlite3NotPureFunc(pCtx) ){ |
|
0 |
0 |
if( sqlite3_stricmp(z, "localtime")==0 && sqlite3NotPureFunc(pCtx) ){ |
21001
|
0 |
0 |
if( sqlite3_stricmp(z, "unixepoch")==0 && p->rawS ){ |
|
0 |
0 |
if( sqlite3_stricmp(z, "unixepoch")==0 && p->rawS ){ |
21003
|
0 |
0 |
if( r>=0.0 && r<464269060800000.0 ){ |
|
0 |
0 |
if( r>=0.0 && r<464269060800000.0 ){ |
21012
|
0 |
0 |
else if( sqlite3_stricmp(z, "utc")==0 && sqlite3NotPureFunc(pCtx) ){ |
|
0 |
0 |
else if( sqlite3_stricmp(z, "utc")==0 && sqlite3NotPureFunc(pCtx) ){ |
21013
|
0 |
0 |
if( p->tzSet==0 ){ |
21017
|
0 |
0 |
if( rc==SQLITE_OK ){ |
21038
|
0 |
0 |
if( sqlite3_strnicmp(z, "weekday ", 8)==0 |
21039
|
0 |
0 |
&& sqlite3AtoF(&z[8], &r, sqlite3Strlen30(&z[8]), SQLITE_UTF8) |
21040
|
0 |
0 |
&& (n=(int)r)==r && n>=0 && r<7 ){ |
|
0 |
0 |
&& (n=(int)r)==r && n>=0 && r<7 ){ |
|
0 |
0 |
&& (n=(int)r)==r && n>=0 && r<7 ){ |
21047
|
0 |
0 |
if( Z>n ) Z -= 7; |
21061
|
0 |
0 |
if( sqlite3_strnicmp(z, "start of ", 9)!=0 ) break; |
21062
|
0 |
0 |
if( !p->validJD && !p->validYMD && !p->validHMS ) break; |
|
0 |
0 |
if( !p->validJD && !p->validYMD && !p->validHMS ) break; |
|
0 |
0 |
if( !p->validJD && !p->validYMD && !p->validHMS ) break; |
21071
|
0 |
0 |
if( sqlite3_stricmp(z,"month")==0 ){ |
21074
|
0 |
0 |
}else if( sqlite3_stricmp(z,"year")==0 ){ |
21078
|
0 |
0 |
}else if( sqlite3_stricmp(z,"day")==0 ){ |
21097
|
0 |
0 |
for(n=1; z[n] && z[n]!=':' && !sqlite3Isspace(z[n]); n++){} |
|
0 |
0 |
for(n=1; z[n] && z[n]!=':' && !sqlite3Isspace(z[n]); n++){} |
|
0 |
0 |
for(n=1; z[n] && z[n]!=':' && !sqlite3Isspace(z[n]); n++){} |
21098
|
0 |
0 |
if( !sqlite3AtoF(z, &r, n, SQLITE_UTF8) ){ |
21102
|
0 |
0 |
if( z[n]==':' ){ |
21111
|
0 |
0 |
if( !sqlite3Isdigit(*z2) ) z2++; |
21113
|
0 |
0 |
if( parseHhMmSs(z2, &tx) ) break; |
21118
|
0 |
0 |
if( z[0]=='-' ) tx.iJD = -tx.iJD; |
21129
|
0 |
0 |
while( sqlite3Isspace(*z) ) z++; |
21131
|
0 |
0 |
if( n>10 || n<3 ) break; |
|
0 |
0 |
if( n>10 || n<3 ) break; |
21132
|
0 |
0 |
if( sqlite3UpperToLower[(u8)z[n-1]]=='s' ) n--; |
21135
|
0 |
0 |
rRounder = r<0 ? -0.5 : +0.5; |
21136
|
0 |
0 |
for(i=0; i
|
21137
|
0 |
0 |
if( aXformType[i].nName==n |
21138
|
0 |
0 |
&& sqlite3_strnicmp(aXformType[i].zName, z, n)==0 |
21139
|
0 |
0 |
&& r>-aXformType[i].rLimit && r
|
|
0 |
0 |
&& r>-aXformType[i].rLimit && r
|
21146
|
0 |
0 |
x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12; |
21197
|
0 |
0 |
if( argc==0 ){ |
21200
|
0 |
0 |
if( (eType = sqlite3_value_type(argv[0]))==SQLITE_FLOAT |
21201
|
0 |
0 |
|| eType==SQLITE_INTEGER ){ |
21205
|
0 |
0 |
if( !z || parseDateOrTime(context, (char*)z, p) ){ |
|
0 |
0 |
if( !z || parseDateOrTime(context, (char*)z, p) ){ |
21209
|
0 |
0 |
for(i=1; i
|
21212
|
0 |
0 |
if( z==0 || parseModifier(context, (char*)z, n, p) ) return 1; |
|
0 |
0 |
if( z==0 || parseModifier(context, (char*)z, n, p) ) return 1; |
21215
|
0 |
0 |
if( p->isError || !validJulianDay(p->iJD) ) return 1; |
|
0 |
0 |
if( p->isError || !validJulianDay(p->iJD) ) return 1; |
21236
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){ |
21253
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){ |
21273
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){ |
21292
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){ |
21331
|
0 |
0 |
if( argc==0 ) return; |
21333
|
0 |
0 |
if( zFmt==0 || isDate(context, argc-1, argv+1, &x) ) return; |
|
0 |
0 |
if( zFmt==0 || isDate(context, argc-1, argv+1, &x) ) return; |
21335
|
0 |
0 |
for(i=0, n=1; zFmt[i]; i++, n++){ |
21336
|
0 |
0 |
if( zFmt[i]=='%' ){ |
21372
|
0 |
0 |
if( n
|
21374
|
0 |
0 |
}else if( n>(u64)db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
21379
|
0 |
0 |
if( z==0 ){ |
21386
|
0 |
0 |
for(i=j=0; zFmt[i]; i++){ |
21387
|
0 |
0 |
if( zFmt[i]!='%' ){ |
21395
|
0 |
0 |
if( s>59.999 ) s = 59.999; |
21410
|
0 |
0 |
if( zFmt[i]=='W' ){ |
21448
|
0 |
0 |
sqlite3_result_text(context, z, -1, |
21649
|
1101 |
1891 |
if( pId->pMethods ){ |
21667
|
267 |
0 |
return flags ? id->pMethods->xSync(id, flags) : SQLITE_OK; |
21694
|
1079 |
324 |
if( id->pMethods==0 ) return SQLITE_NOTFOUND; |
21715
|
558 |
201 |
if( id->pMethods ) (void)id->pMethods->xFileControl(id, op, pArg); |
21720
|
0 |
0 |
return (xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE); |
21833
|
6 |
0 |
return pVfs->xGetLastError ? pVfs->xGetLastError(pVfs, 0, 0) : 0; |
21843
|
12 |
0 |
if( pVfs->iVersion>=2 && pVfs->xCurrentTimeInt64 ){ |
|
12 |
0 |
if( pVfs->iVersion>=2 && pVfs->xCurrentTimeInt64 ){ |
21863
|
0 |
0 |
if( pFile ){ |
21865
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
21889
|
0 |
103 |
if( p==0 ) return SQLITE_NOMEM_BKPT; |
21911
|
0 |
367 |
if( rc ) return 0; |
21917
|
367 |
0 |
for(pVfs = vfsList; pVfs; pVfs=pVfs->pNext){ |
21918
|
362 |
5 |
if( zVfs==0 ) break; |
21919
|
5 |
0 |
if( strcmp(zVfs, pVfs->zName)==0 ) break; |
21930
|
412 |
0 |
if( pVfs==0 ){ |
21932
|
0 |
412 |
}else if( vfsList==pVfs ){ |
21934
|
309 |
103 |
}else if( vfsList ){ |
21936
|
309 |
309 |
while( p->pNext && p->pNext!=pVfs ){ |
|
309 |
0 |
while( p->pNext && p->pNext!=pVfs ){ |
21939
|
0 |
309 |
if( p->pNext==pVfs ){ |
21954
|
0 |
412 |
if( rc ) return rc; |
21963
|
309 |
103 |
if( makeDflt || vfsList==0 ){ |
|
0 |
309 |
if( makeDflt || vfsList==0 ){ |
22065
|
0 |
1885 |
if( wsdHooks.xBenignBegin ){ |
22071
|
0 |
1885 |
if( wsdHooks.xBenignEnd ){ |
22284
|
98170 |
0 |
if( p ){ |
22357
|
3579 |
0 |
if( p ){ |
25991
|
0 |
0 |
if( rc ) return -1; |
25995
|
0 |
0 |
if( n<0 ){ |
26001
|
0 |
0 |
mem0.nearlyFull = (n>0 && n<=nUsed); |
|
0 |
0 |
mem0.nearlyFull = (n>0 && n<=nUsed); |
26004
|
0 |
0 |
if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff)); |
26008
|
0 |
0 |
if( n<0 ) n = 0; |
26017
|
103 |
0 |
if( sqlite3GlobalConfig.m.xMalloc==0 ){ |
26022
|
0 |
103 |
if( sqlite3GlobalConfig.pPage==0 || sqlite3GlobalConfig.szPage<512 |
|
0 |
0 |
if( sqlite3GlobalConfig.pPage==0 || sqlite3GlobalConfig.szPage<512 |
26023
|
0 |
0 |
|| sqlite3GlobalConfig.nPage<=0 ){ |
26028
|
0 |
103 |
if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0)); |
26045
|
0 |
0 |
if( sqlite3GlobalConfig.m.xShutdown ){ |
26075
|
3574 |
0 |
if( mem0.alarmThreshold<=0 ) return; |
26106
|
0 |
98170 |
if( mem0.alarmThreshold>0 ){ |
26108
|
0 |
0 |
if( nUsed >= mem0.alarmThreshold - nFull ){ |
26122
|
98170 |
0 |
if( p ){ |
26136
|
98170 |
0 |
if( n==0 || n>=0x7fffff00 ){ |
|
0 |
98170 |
if( n==0 || n>=0x7fffff00 ){ |
26143
|
98170 |
0 |
}else if( sqlite3GlobalConfig.bMemstat ){ |
26161
|
0 |
24441 |
if( sqlite3_initialize() ) return 0; |
26163
|
24441 |
0 |
return n<=0 ? 0 : sqlite3Malloc(n); |
26167
|
0 |
482 |
if( sqlite3_initialize() ) return 0; |
26177
|
178994 |
13891 |
return SQLITE_WITHIN(p, db->lookaside.pStart, db->lookaside.pEnd); |
|
135694 |
43300 |
return SQLITE_WITHIN(p, db->lookaside.pStart, db->lookaside.pEnd); |
26193
|
33725 |
121 |
if( db==0 || !isLookaside(db,p) ){ |
|
5020 |
28705 |
if( db==0 || !isLookaside(db,p) ){ |
26212
|
0 |
16 |
return p ? sqlite3GlobalConfig.m.xSize(p) : 0; |
26219
|
26104 |
97799 |
if( p==0 ) return; /* IMP: R-49053-54554 */ |
26222
|
97799 |
0 |
if( sqlite3GlobalConfig.bMemstat ){ |
26249
|
147212 |
5498 |
if( db ){ |
26250
|
46 |
147166 |
if( db->pnBytesFreed ){ |
26254
|
101409 |
45757 |
if( isLookaside(db, p) ){ |
26273
|
67926 |
87506 |
if( p ) sqlite3DbFreeNN(db, p); |
26284
|
803 |
3656 |
if( pOld==0 ){ |
26287
|
0 |
3656 |
if( nBytes==0 ){ |
26291
|
0 |
3656 |
if( nBytes>=0x7fffff00 ){ |
26300
|
77 |
3579 |
if( nOld==nNew ){ |
26302
|
3579 |
0 |
}else if( sqlite3GlobalConfig.bMemstat ){ |
26306
|
3574 |
5 |
if( nDiff>0 && sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >= |
|
3574 |
0 |
if( nDiff>0 && sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >= |
26311
|
0 |
3579 |
if( pNew==0 && mem0.alarmThreshold>0 ){ |
|
0 |
0 |
if( pNew==0 && mem0.alarmThreshold>0 ){ |
26315
|
3579 |
0 |
if( pNew ){ |
26333
|
0 |
1113 |
if( sqlite3_initialize() ) return 0; |
26335
|
0 |
1113 |
if( n<0 ) n = 0; /* IMP: R-26507-47431 */ |
26340
|
0 |
3337 |
if( sqlite3_initialize() ) return 0; |
26351
|
3020 |
0 |
if( p ){ |
26365
|
19886 |
0 |
if( p ) memset(p, 0, (size_t)n); |
26377
|
0 |
40468 |
if( !p ) sqlite3OomFault(db); |
26407
|
50835 |
3728 |
if( db ) return sqlite3DbMallocRawNN(db, n); |
26418
|
116369 |
25510 |
if( db->lookaside.bDisable==0 ){ |
26420
|
12343 |
104026 |
if( n>db->lookaside.sz ){ |
26422
|
90158 |
13868 |
}else if( (pBuf = db->lookaside.pFree)!=0 ){ |
26426
|
11253 |
2615 |
}else if( (pBuf = db->lookaside.pInit)!=0 ){ |
26433
|
0 |
25510 |
}else if( db->mallocFailed ){ |
26456
|
14482 |
8773 |
if( p==0 ) return sqlite3DbMallocRawNN(db, n); |
26458
|
5566 |
3207 |
if( isLookaside(db,p) && n<=db->lookaside.sz ) return p; |
|
5552 |
14 |
if( isLookaside(db,p) && n<=db->lookaside.sz ) return p; |
26465
|
3221 |
0 |
if( db->mallocFailed==0 ){ |
26466
|
14 |
3207 |
if( isLookaside(db, p) ){ |
26468
|
14 |
0 |
if( pNew ){ |
26477
|
0 |
3207 |
if( !pNew ){ |
26494
|
0 |
8915 |
if( !pNew ){ |
26510
|
736 |
1649 |
if( z==0 ){ |
26515
|
1649 |
0 |
if( zNew ){ |
26523
|
134 |
22164 |
if( z==0 ){ |
26528
|
22164 |
0 |
if( zNew ){ |
26542
|
0 |
3091 |
while( sqlite3Isspace(zStart[0]) ) zStart++; |
26544
|
5460 |
0 |
while( ALWAYS(n>0) && sqlite3Isspace(zStart[n-1]) ) n--; |
|
2369 |
3091 |
while( ALWAYS(n>0) && sqlite3Isspace(zStart[n-1]) ) n--; |
26563
|
0 |
0 |
if( db->mallocFailed==0 && db->bBenignMalloc==0 ){ |
|
0 |
0 |
if( db->mallocFailed==0 && db->bBenignMalloc==0 ){ |
26565
|
0 |
0 |
if( db->nVdbeExec>0 ){ |
26580
|
0 |
0 |
if( db->mallocFailed && db->nVdbeExec==0 ){ |
|
0 |
0 |
if( db->mallocFailed && db->nVdbeExec==0 ){ |
26616
|
50396 |
0 |
if( db->mallocFailed || rc==SQLITE_IOERR_NOMEM ){ |
|
0 |
50396 |
if( db->mallocFailed || rc==SQLITE_IOERR_NOMEM ){ |
26746
|
0 |
30 |
if( (*cnt)<=0 ) return '0'; |
26769
|
0 |
0 |
if( p->nArg<=p->nUsed ) return 0; |
26773
|
0 |
0 |
if( p->nArg<=p->nUsed ) return 0.0; |
26777
|
0 |
0 |
if( p->nArg<=p->nUsed ) return 0; |
26838
|
0 |
4622 |
if( (pAccum->printfFlags & SQLITE_PRINTF_SQLFUNC)!=0 ){ |
26839
|
0 |
0 |
pArgList = va_arg(ap, PrintfArguments*); |
26844
|
9046 |
1453 |
for(; (c=(*fmt))!=0; ++fmt){ |
26845
|
8157 |
889 |
if( c!='%' ){ |
26850
|
80269 |
3169 |
do{ fmt++; }while( *fmt && *fmt != '%' ); |
|
75281 |
4988 |
do{ fmt++; }while( *fmt && *fmt != '%' ); |
26853
|
3169 |
4988 |
if( *fmt==0 ) break; |
26855
|
0 |
5877 |
if( (c=(*++fmt))==0 ){ |
26874
|
2 |
5877 |
}while( !done && (c=(*++fmt))!=0 ); |
|
2 |
0 |
}while( !done && (c=(*++fmt))!=0 ); |
26876
|
0 |
5877 |
if( c=='*' ){ |
26877
|
0 |
0 |
if( bArgList ){ |
26880
|
0 |
0 |
width = va_arg(ap,int); |
26882
|
0 |
0 |
if( width<0 ){ |
26884
|
0 |
0 |
width = width >= -2147483647 ? -width : 0; |
26889
|
5621 |
256 |
while( c>='0' && c<='9' ){ |
|
0 |
5621 |
while( c>='0' && c<='9' ){ |
26904
|
256 |
5621 |
if( c=='.' ){ |
26906
|
254 |
2 |
if( c=='*' ){ |
26907
|
0 |
254 |
if( bArgList ){ |
26910
|
254 |
0 |
precision = va_arg(ap,int); |
26913
|
0 |
254 |
if( precision<0 ){ |
26914
|
0 |
0 |
precision = precision >= -2147483647 ? -precision : -1; |
26918
|
6 |
0 |
while( c>='0' && c<='9' ){ |
|
4 |
2 |
while( c>='0' && c<='9' ){ |
26937
|
374 |
5503 |
if( c=='l' ){ |
26940
|
374 |
0 |
if( c=='l' ){ |
26950
|
20430 |
0 |
for(idx=0; idx
|
26951
|
5877 |
14553 |
if( c==fmtinfo[idx].fmttype ){ |
26985
|
1057 |
33 |
if( infop->flags & FLAG_SIGNED ){ |
26987
|
0 |
1057 |
if( bArgList ){ |
26989
|
374 |
683 |
}else if( flag_long ){ |
26990
|
374 |
0 |
if( flag_long==2 ){ |
26991
|
374 |
0 |
v = va_arg(ap,i64) ; |
26993
|
0 |
0 |
v = va_arg(ap,long int); |
26996
|
137 |
546 |
v = va_arg(ap,int); |
26998
|
0 |
1057 |
if( v<0 ){ |
26999
|
0 |
0 |
if( v==SMALLEST_INT64 ){ |
27010
|
0 |
33 |
if( bArgList ){ |
27012
|
33 |
0 |
}else if( flag_long ){ |
27013
|
33 |
0 |
if( flag_long==2 ){ |
27014
|
33 |
0 |
longvalue = va_arg(ap,u64); |
27016
|
0 |
0 |
longvalue = va_arg(ap,unsigned long int); |
27019
|
0 |
0 |
longvalue = va_arg(ap,unsigned int); |
27023
|
69 |
1021 |
if( longvalue==0 ) flag_alternateform = 0; |
27024
|
0 |
1090 |
if( flag_zeropad && precision
|
|
0 |
0 |
if( flag_zeropad && precision
|
27027
|
1090 |
0 |
if( precision
|
27033
|
0 |
0 |
if( zOut==0 ){ |
27040
|
0 |
1090 |
if( xtype==etORDINAL ){ |
27043
|
0 |
0 |
if( x>=4 || (longvalue/10)%10==1 ){ |
|
0 |
0 |
if( x>=4 || (longvalue/10)%10==1 ){ |
27055
|
247 |
1090 |
}while( longvalue>0 ); |
27058
|
0 |
1090 |
while( precision>length ){ |
27062
|
0 |
1090 |
if( cThousand ){ |
27066
|
0 |
0 |
for(idx=0; nn>0; idx++){ |
27069
|
0 |
0 |
if( ix==0 ){ |
27076
|
0 |
1090 |
if( prefix ) *(--bufpt) = prefix; /* Add sign */ |
27077
|
0 |
1090 |
if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */ |
|
0 |
0 |
if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */ |
27081
|
0 |
0 |
for(; (x=(*pre))!=0; pre++) *(--bufpt) = x; |
27088
|
0 |
2 |
if( bArgList ){ |
27091
|
2 |
0 |
realvalue = va_arg(ap,double); |
27096
|
0 |
2 |
if( precision<0 ) precision = 6; /* Set default precision */ |
27097
|
0 |
2 |
if( realvalue<0.0 ){ |
27103
|
2 |
0 |
if( xtype==etGENERIC && precision>0 ) precision--; |
|
2 |
0 |
if( xtype==etGENERIC && precision>0 ) precision--; |
27105
|
28 |
2 |
for(idx=precision&0xfff, rounder=0.5; idx>0; idx--, rounder*=0.1){} |
27106
|
0 |
2 |
if( xtype==etFLOAT ) realvalue += rounder; |
27109
|
0 |
2 |
if( sqlite3IsNaN((double)realvalue) ){ |
27114
|
2 |
0 |
if( realvalue>0.0 ){ |
27116
|
0 |
2 |
while( realvalue>=1e100*scale && exp<=350 ){ scale *= 1e100;exp+=100;} |
|
0 |
0 |
while( realvalue>=1e100*scale && exp<=350 ){ scale *= 1e100;exp+=100;} |
27117
|
0 |
2 |
while( realvalue>=1e10*scale && exp<=350 ){ scale *= 1e10; exp+=10; } |
|
0 |
0 |
while( realvalue>=1e10*scale && exp<=350 ){ scale *= 1e10; exp+=10; } |
27118
|
12 |
2 |
while( realvalue>=10.0*scale && exp<=350 ){ scale *= 10.0; exp++; } |
|
12 |
0 |
while( realvalue>=10.0*scale && exp<=350 ){ scale *= 10.0; exp++; } |
27120
|
0 |
2 |
while( realvalue<1e-8 ){ realvalue *= 1e8; exp-=8; } |
27121
|
0 |
2 |
while( realvalue<1.0 ){ realvalue *= 10.0; exp--; } |
27122
|
0 |
2 |
if( exp>350 ){ |
27126
|
0 |
0 |
length = 3+(prefix!=0); |
27135
|
2 |
0 |
if( xtype!=etFLOAT ){ |
27137
|
0 |
2 |
if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; } |
27139
|
2 |
0 |
if( xtype==etGENERIC ){ |
27141
|
2 |
0 |
if( exp<-4 || exp>precision ){ |
|
0 |
2 |
if( exp<-4 || exp>precision ){ |
27150
|
0 |
2 |
if( xtype==etEXP ){ |
27155
|
0 |
2 |
if( MAX(e2,0)+(i64)precision+(i64)width > etBUFSIZE - 15 ){ |
27158
|
0 |
0 |
if( bufpt==0 ){ |
27167
|
0 |
2 |
if( prefix ){ |
27171
|
0 |
2 |
if( e2<0 ){ |
27174
|
14 |
2 |
for(; e2>=0; e2--){ |
27179
|
2 |
0 |
if( flag_dp ){ |
27184
|
0 |
2 |
for(e2++; e2<0; precision--, e2++){ |
27189
|
16 |
2 |
while( (precision--)>0 ){ |
27193
|
2 |
0 |
if( flag_rtz && flag_dp ){ |
|
2 |
0 |
if( flag_rtz && flag_dp ){ |
27194
|
14 |
2 |
while( bufpt[-1]=='0' ) *(--bufpt) = 0; |
27196
|
0 |
2 |
if( bufpt[-1]=='.' ){ |
27197
|
0 |
0 |
if( flag_altform2 ){ |
27205
|
0 |
2 |
if( xtype==etEXP ){ |
27207
|
0 |
0 |
if( exp<0 ){ |
27212
|
0 |
0 |
if( exp>=100 ){ |
27229
|
0 |
2 |
if( flag_zeropad && !flag_leftjustify && length < width){ |
|
0 |
0 |
if( flag_zeropad && !flag_leftjustify && length < width){ |
|
0 |
0 |
if( flag_zeropad && !flag_leftjustify && length < width){ |
27232
|
0 |
0 |
for(i=width; i>=nPad; i--){ |
27236
|
0 |
0 |
while( nPad-- ) bufpt[i++] = '0'; |
27242
|
0 |
0 |
if( !bArgList ){ |
27243
|
0 |
0 |
*(va_arg(ap,int*)) = pAccum->nChar; |
27253
|
0 |
0 |
if( bArgList ){ |
27256
|
0 |
0 |
if( bufpt ){ |
27258
|
0 |
0 |
if( (c&0xc0)==0xc0 ){ |
27259
|
0 |
0 |
while( length<4 && (bufpt[0]&0xc0)==0x80 ){ |
|
0 |
0 |
while( length<4 && (bufpt[0]&0xc0)==0x80 ){ |
27267
|
0 |
0 |
unsigned int ch = va_arg(ap,unsigned int); |
27268
|
0 |
0 |
if( ch<0x00080 ){ |
27271
|
0 |
0 |
}else if( ch<0x00800 ){ |
27275
|
0 |
0 |
}else if( ch<0x10000 ){ |
27288
|
0 |
0 |
if( precision>1 ){ |
27290
|
0 |
0 |
if( width>1 && !flag_leftjustify ){ |
|
0 |
0 |
if( width>1 && !flag_leftjustify ){ |
27294
|
0 |
0 |
while( precision-- > 1 ){ |
27303
|
0 |
2487 |
if( bArgList ){ |
27307
|
2487 |
0 |
bufpt = va_arg(ap,char*); |
27309
|
1 |
2486 |
if( bufpt==0 ){ |
27311
|
16 |
2470 |
}else if( xtype==etDYNSTRING ){ |
27312
|
16 |
0 |
if( pAccum->nChar==0 && pAccum->mxAlloc && width==0 && precision<0 ){ |
|
16 |
0 |
if( pAccum->nChar==0 && pAccum->mxAlloc && width==0 && precision<0 ){ |
|
16 |
0 |
if( pAccum->nChar==0 && pAccum->mxAlloc && width==0 && precision<0 ){ |
|
16 |
0 |
if( pAccum->nChar==0 && pAccum->mxAlloc && width==0 && precision<0 ){ |
27326
|
244 |
2227 |
if( precision>=0 ){ |
27327
|
0 |
244 |
if( flag_altform2 ){ |
27331
|
0 |
0 |
while( precision-- > 0 && z[0] ){ |
|
0 |
0 |
while( precision-- > 0 && z[0] ){ |
27332
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
27336
|
11518 |
244 |
for(length=0; length
|
|
11518 |
0 |
for(length=0; length
|
27342
|
0 |
4743 |
if( flag_altform2 && width>0 ){ |
|
0 |
0 |
if( flag_altform2 && width>0 ){ |
27345
|
0 |
0 |
while( ii>=0 ) if( (bufpt[ii--] & 0xc0)==0x80 ) width++; |
|
0 |
0 |
while( ii>=0 ) if( (bufpt[ii--] & 0xc0)==0x80 ) width++; |
27354
|
204 |
2068 |
char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */ |
27357
|
0 |
2272 |
if( bArgList ){ |
27360
|
1731 |
541 |
escarg = va_arg(ap,char*); |
27363
|
34 |
2238 |
if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); |
|
34 |
0 |
if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); |
27370
|
30766 |
10 |
for(i=n=0; k!=0 && (ch=escarg[i])!=0; i++, k--){ |
|
28504 |
2262 |
for(i=n=0; k!=0 && (ch=escarg[i])!=0; i++, k--){ |
27371
|
158 |
28346 |
if( ch==q ) n++; |
27372
|
0 |
28504 |
if( flag_altform2 && (ch&0xc0)==0xc0 ){ |
|
0 |
0 |
if( flag_altform2 && (ch&0xc0)==0xc0 ){ |
27373
|
0 |
0 |
while( (escarg[i+1]&0xc0)==0x80 ){ i++; } |
27376
|
2238 |
34 |
needQuote = !isnull && xtype==etSQLESCAPE2; |
|
1353 |
885 |
needQuote = !isnull && xtype==etSQLESCAPE2; |
27378
|
98 |
2174 |
if( n>etBUFSIZE ){ |
27380
|
0 |
98 |
if( bufpt==0 ){ |
27388
|
1353 |
919 |
if( needQuote ) bufpt[j++] = q; |
27390
|
28504 |
2272 |
for(i=0; i
|
27392
|
158 |
28346 |
if( ch==q ) bufpt[j++] = ch; |
27394
|
1353 |
919 |
if( needQuote ) bufpt[j++] = q; |
27401
|
0 |
26 |
if( (pAccum->printfFlags & SQLITE_PRINTF_INTERNAL)==0 ) return; |
27402
|
26 |
0 |
pToken = va_arg(ap, Token*); |
27404
|
26 |
0 |
if( pToken && pToken->n ){ |
|
26 |
0 |
if( pToken && pToken->n ){ |
27414
|
0 |
0 |
if( (pAccum->printfFlags & SQLITE_PRINTF_INTERNAL)==0 ) return; |
27415
|
0 |
0 |
pSrc = va_arg(ap, SrcList*); |
27416
|
0 |
0 |
k = va_arg(ap, int); |
27420
|
0 |
0 |
if( pItem->zDatabase ){ |
27442
|
0 |
5877 |
if( width>0 ){ |
27443
|
0 |
0 |
if( !flag_leftjustify ) sqlite3_str_appendchar(pAccum, width, ' '); |
27445
|
0 |
0 |
if( flag_leftjustify ) sqlite3_str_appendchar(pAccum, width, ' '); |
27450
|
98 |
5779 |
if( zExtra ){ |
27467
|
0 |
1000 |
if( p->accError ){ |
27472
|
0 |
1000 |
if( p->mxAlloc==0 ){ |
27477
|
256 |
744 |
char *zOld = isMalloced(p) ? p->zText : 0; |
27480
|
1000 |
0 |
if( szNew+p->nChar<=p->mxAlloc ){ |
27485
|
0 |
1000 |
if( szNew > p->mxAlloc ){ |
27492
|
892 |
108 |
if( p->db ){ |
27497
|
1000 |
0 |
if( zNew ){ |
27499
|
744 |
256 |
if( !isMalloced(p) && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar); |
|
716 |
28 |
if( !isMalloced(p) && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar); |
27517
|
0 |
0 |
if( p->nChar+(i64)N >= p->nAlloc && (N = sqlite3StrAccumEnlarge(p, N))<=0 ){ |
|
0 |
0 |
if( p->nChar+(i64)N >= p->nAlloc && (N = sqlite3StrAccumEnlarge(p, N))<=0 ){ |
27520
|
0 |
0 |
while( (N--)>0 ) p->zText[p->nChar++] = c; |
27533
|
1000 |
0 |
if( N>0 ){ |
27548
|
1000 |
13206 |
if( p->nChar+N >= p->nAlloc ){ |
27550
|
13130 |
76 |
}else if( N ){ |
27574
|
3332 |
0 |
if( zText ){ |
27584
|
4092 |
0 |
if( p->zText ){ |
27586
|
4092 |
0 |
if( p->mxAlloc>0 && !isMalloced(p) ){ |
|
3332 |
760 |
if( p->mxAlloc>0 && !isMalloced(p) ){ |
27607
|
2 |
0 |
if( p!=0 && p!=&sqlite3OomStr ){ |
|
2 |
0 |
if( p!=0 && p!=&sqlite3OomStr ){ |
27618
|
0 |
0 |
return p ? p->accError : SQLITE_NOMEM; |
27623
|
0 |
0 |
return p ? p->nChar : 0; |
27628
|
0 |
0 |
if( p==0 || p->nChar==0 ) return 0; |
|
0 |
0 |
if( p==0 || p->nChar==0 ) return 0; |
27637
|
0 |
0 |
if( isMalloced(p) ){ |
27673
|
2 |
0 |
if( p ){ |
27674
|
2 |
0 |
sqlite3StrAccumInit(p, 0, 0, 0, |
27696
|
0 |
1587 |
if( acc.accError==SQLITE_NOMEM ){ |
27731
|
0 |
2463 |
if( sqlite3_initialize() ) return 0; |
27747
|
0 |
2375 |
if( sqlite3_initialize() ) return 0; |
27770
|
0 |
552 |
if( n<=0 ) return zBuf; |
27821
|
0 |
60 |
if( sqlite3GlobalConfig.xLog ){ |
28499
|
0 |
1020 |
if( sqlite3_initialize() ) return; |
28507
|
997 |
23 |
if( N<=0 || pBuf==0 ){ |
|
0 |
997 |
if( N<=0 || pBuf==0 ){ |
28522
|
94 |
903 |
if( !wsdPrng.isInit ){ |
28528
|
24064 |
94 |
for(i=0; i<256; i++){ |
28531
|
24064 |
94 |
for(i=0; i<256; i++){ |
28549
|
2991 |
997 |
}while( --N ); |
29033
|
84 |
9 |
if( c>=0xc0 ){ |
29035
|
126 |
84 |
while( (*(*pz) & 0xc0)==0x80 ){ |
29038
|
84 |
0 |
if( c<0x80 |
29039
|
84 |
0 |
|| (c&0xFFFFF800)==0xD800 |
29040
|
0 |
84 |
|| (c&0xFFFFFFFE)==0xFFFE ){ c = 0xFFFD; } |
29086
|
0 |
0 |
if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){ |
|
0 |
0 |
if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){ |
29090
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
29096
|
0 |
0 |
while( zIn
|
29107
|
0 |
0 |
if( desiredEnc==SQLITE_UTF8 ){ |
29133
|
0 |
0 |
if( !zOut ){ |
29138
|
0 |
0 |
if( pMem->enc==SQLITE_UTF8 ){ |
29139
|
0 |
0 |
if( desiredEnc==SQLITE_UTF16LE ){ |
29141
|
0 |
0 |
while( zIn
|
29142
|
0 |
0 |
READ_UTF8(zIn, zTerm, c); |
|
0 |
0 |
READ_UTF8(zIn, zTerm, c); |
|
0 |
0 |
READ_UTF8(zIn, zTerm, c); |
|
0 |
0 |
READ_UTF8(zIn, zTerm, c); |
|
0 |
0 |
READ_UTF8(zIn, zTerm, c); |
|
0 |
0 |
READ_UTF8(zIn, zTerm, c); |
29143
|
0 |
0 |
WRITE_UTF16LE(z, c); |
29148
|
0 |
0 |
while( zIn
|
29149
|
0 |
0 |
READ_UTF8(zIn, zTerm, c); |
|
0 |
0 |
READ_UTF8(zIn, zTerm, c); |
|
0 |
0 |
READ_UTF8(zIn, zTerm, c); |
|
0 |
0 |
READ_UTF8(zIn, zTerm, c); |
|
0 |
0 |
READ_UTF8(zIn, zTerm, c); |
|
0 |
0 |
READ_UTF8(zIn, zTerm, c); |
29150
|
0 |
0 |
WRITE_UTF16BE(z, c); |
29157
|
0 |
0 |
if( pMem->enc==SQLITE_UTF16LE ){ |
29159
|
0 |
0 |
while( zIn
|
29160
|
0 |
0 |
READ_UTF16LE(zIn, zIn
|
|
0 |
0 |
READ_UTF16LE(zIn, zIn
|
|
0 |
0 |
READ_UTF16LE(zIn, zIn
|
29161
|
0 |
0 |
WRITE_UTF8(z, c); |
|
0 |
0 |
WRITE_UTF8(z, c); |
|
0 |
0 |
WRITE_UTF8(z, c); |
29165
|
0 |
0 |
while( zIn
|
29166
|
0 |
0 |
READ_UTF16BE(zIn, zIn
|
|
0 |
0 |
READ_UTF16BE(zIn, zIn
|
|
0 |
0 |
READ_UTF16BE(zIn, zIn
|
29167
|
0 |
0 |
WRITE_UTF8(z, c); |
|
0 |
0 |
WRITE_UTF8(z, c); |
|
0 |
0 |
WRITE_UTF8(z, c); |
29210
|
0 |
0 |
if( pMem->n>1 ){ |
29213
|
0 |
0 |
if( b1==0xFE && b2==0xFF ){ |
|
0 |
0 |
if( b1==0xFE && b2==0xFF ){ |
29216
|
0 |
0 |
if( b1==0xFF && b2==0xFE ){ |
|
0 |
0 |
if( b1==0xFF && b2==0xFE ){ |
29221
|
0 |
0 |
if( bom ){ |
29223
|
0 |
0 |
if( rc==SQLITE_OK ){ |
29247
|
634 |
0 |
if( nByte>=0 ){ |
29253
|
33595 |
0 |
while( *z!=0 && z
|
|
32961 |
634 |
while( *z!=0 && z
|
29254
|
16 |
32945 |
SQLITE_SKIP_UTF8(z); |
|
24 |
16 |
SQLITE_SKIP_UTF8(z); |
29303
|
0 |
0 |
if( db->mallocFailed ){ |
29329
|
0 |
0 |
while( n
|
29330
|
0 |
0 |
READ_UTF16LE(z, 1, c); |
|
0 |
0 |
READ_UTF16LE(z, 1, c); |
29441
|
0 |
989 |
return xCallback ? xCallback(iTest) : SQLITE_OK; |
29501
|
233 |
75301 |
if( z==0 ) return 0; |
29513
|
245 |
2526 |
if( (pCol->colFlags & COLFLAG_HASTYPE)==0 ) return zDflt; |
29523
|
669 |
12 |
if( db->pErr ) sqlite3ValueSetNull(db->pErr); |
29535
|
13512 |
12 |
if( err_code || db->pErr ) sqlite3ErrorFinish(db, err_code); |
|
669 |
12843 |
if( err_code || db->pErr ) sqlite3ErrorFinish(db, err_code); |
29543
|
0 |
775 |
if( rc==SQLITE_IOERR_NOMEM ) return; |
29545
|
769 |
6 |
if( rc==SQLITE_CANTOPEN || rc==SQLITE_IOERR ){ |
|
0 |
769 |
if( rc==SQLITE_CANTOPEN || rc==SQLITE_IOERR ){ |
29575
|
35 |
26 |
if( zFormat==0 ){ |
29577
|
24 |
2 |
}else if( db->pErr || (db->pErr = sqlite3ValueNew(db))!=0 ){ |
|
24 |
0 |
}else if( db->pErr || (db->pErr = sqlite3ValueNew(db))!=0 ){ |
29611
|
1 |
10 |
if( db->suppressErr ){ |
29641
|
0 |
18315 |
if( z==0 ) return; |
29643
|
14543 |
3772 |
if( !sqlite3Isquote(quote) ) return; |
29644
|
6 |
3766 |
if( quote=='[' ) quote = ']'; |
29647
|
3936 |
38764 |
if( z[i]==quote ){ |
29648
|
164 |
3772 |
if( z[i+1]==quote ){ |
29683
|
0 |
6623 |
if( zLeft==0 ){ |
29684
|
0 |
0 |
return zRight ? -1 : 0; |
29685
|
0 |
6623 |
}else if( zRight==0 ){ |
29697
|
438512 |
168169 |
if( c || *a==0 ) break; |
|
409193 |
29319 |
if( c || *a==0 ) break; |
29705
|
35 |
1184 |
if( zLeft==0 ){ |
29706
|
35 |
0 |
return zRight ? -1 : 0; |
29707
|
0 |
1184 |
}else if( zRight==0 ){ |
29712
|
5395 |
710 |
while( N-- > 0 && *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } |
|
5395 |
0 |
while( N-- > 0 && *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } |
|
4921 |
474 |
while( N-- > 0 && *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } |
29713
|
474 |
710 |
return N<0 ? 0 : UpperToLower[*a] - UpperToLower[*b]; |
29746
|
7972 |
858 |
if( E & 1 ) r *= x; |
29748
|
2170 |
6660 |
if( E==0 ) break; |
29795
|
2578 |
0 |
if( enc==SQLITE_UTF8 ){ |
29801
|
0 |
0 |
for(i=3-enc; i
|
|
0 |
0 |
for(i=3-enc; i
|
29808
|
2578 |
0 |
while( z
|
|
0 |
2578 |
while( z
|
29809
|
0 |
2578 |
if( z>=zEnd ) return 0; |
29812
|
4 |
2574 |
if( *z=='-' ){ |
29815
|
0 |
2574 |
}else if( *z=='+' ){ |
29820
|
4914 |
378 |
while( z
|
|
2714 |
2200 |
while( z
|
|
2714 |
0 |
while( z
|
29827
|
2200 |
378 |
while( z
|
|
0 |
2200 |
while( z
|
29828
|
378 |
2200 |
if( z>=zEnd ) goto do_atof_calc; |
29831
|
2170 |
30 |
if( *z=='.' ){ |
29835
|
32399 |
2170 |
while( z
|
|
32399 |
0 |
while( z
|
29836
|
32399 |
0 |
if( s<((LARGEST_INT64-9)/10) ){ |
29843
|
2170 |
30 |
if( z>=zEnd ) goto do_atof_calc; |
29846
|
30 |
0 |
if( *z=='e' || *z=='E' ){ |
|
0 |
30 |
if( *z=='e' || *z=='E' ){ |
29853
|
0 |
0 |
if( z>=zEnd ) goto do_atof_calc; /*PREVENTS-HARMLESS-OVERREAD*/ |
29856
|
0 |
0 |
if( *z=='-' ){ |
29859
|
0 |
0 |
}else if( *z=='+' ){ |
29863
|
0 |
0 |
while( z
|
|
0 |
0 |
while( z
|
29864
|
0 |
0 |
e = e<10000 ? (e*10 + (*z - '0')) : 10000; |
29871
|
56 |
0 |
while( z
|
|
26 |
30 |
while( z
|
29876
|
2170 |
408 |
if( e<0 ) { |
29883
|
28 |
2550 |
if( s==0 ) { |
29885
|
0 |
28 |
result = sign<0 ? -(double)0 : (double)0; |
29893
|
2170 |
380 |
while( e>0 ){ /*OPTIMIZATION-IF-TRUE*/ |
29894
|
0 |
2170 |
if( esign>0 ){ |
29895
|
0 |
0 |
if( s>=(LARGEST_INT64/10) ) break; /*OPTIMIZATION-IF-FALSE*/ |
29898
|
2170 |
0 |
if( s%10!=0 ) break; /*OPTIMIZATION-IF-FALSE*/ |
29905
|
4 |
2546 |
s = sign<0 ? -s : s; |
29907
|
380 |
2170 |
if( e==0 ){ /*OPTIMIZATION-IF-TRUE*/ |
29911
|
0 |
2170 |
if( e>307 ){ /*OPTIMIZATION-IF-TRUE*/ |
29912
|
0 |
0 |
if( e<342 ){ /*OPTIMIZATION-IF-TRUE*/ |
29914
|
0 |
0 |
if( esign<0 ){ |
29922
|
0 |
0 |
if( esign<0 ){ |
29934
|
2170 |
0 |
if( esign<0 ){ |
29947
|
2548 |
30 |
return z==zEnd && nDigits>0 && eValid && nonNum==0; |
|
2548 |
0 |
return z==zEnd && nDigits>0 && eValid && nonNum==0; |
|
2548 |
0 |
return z==zEnd && nDigits>0 && eValid && nonNum==0; |
|
2548 |
0 |
return z==zEnd && nDigits>0 && eValid && nonNum==0; |
29972
|
0 |
0 |
for(i=0; c==0 && i<18; i++){ |
|
0 |
0 |
for(i=0; c==0 && i<18; i++){ |
29975
|
0 |
0 |
if( c==0 ){ |
30010
|
684 |
0 |
if( enc==SQLITE_UTF8 ){ |
30015
|
0 |
0 |
for(i=3-enc; i
|
|
0 |
0 |
for(i=3-enc; i
|
30020
|
684 |
0 |
while( zNum
|
|
0 |
684 |
while( zNum
|
30021
|
684 |
0 |
if( zNum
|
30022
|
4 |
680 |
if( *zNum=='-' ){ |
30025
|
0 |
680 |
}else if( *zNum=='+' ){ |
30030
|
915 |
0 |
while( zNum
|
|
231 |
684 |
while( zNum
|
30031
|
1037 |
404 |
for(i=0; &zNum[i]='0' && c<='9'; i+=incr){ |
|
757 |
280 |
for(i=0; &zNum[i]='0' && c<='9'; i+=incr){ |
|
757 |
0 |
for(i=0; &zNum[i]='0' && c<='9'; i+=incr){ |
30037
|
0 |
684 |
if( u>LARGEST_INT64 ){ |
30042
|
0 |
0 |
*pNum = neg ? SMALLEST_INT64 : LARGEST_INT64; |
30043
|
4 |
680 |
}else if( neg ){ |
30049
|
231 |
453 |
if( (i==0 && zStart==zNum) /* No digits */ |
|
231 |
0 |
if( (i==0 && zStart==zNum) /* No digits */ |
30050
|
0 |
684 |
|| nonNum /* UTF16 with high-order bytes non-zero */ |
30053
|
280 |
404 |
}else if( &zNum[i]
|
30056
|
280 |
276 |
if( !sqlite3Isspace(zNum[jj]) ){ |
30061
|
276 |
0 |
}while( &zNum[jj]
|
30063
|
684 |
0 |
if( i<19*incr ){ |
30069
|
0 |
0 |
c = i>19*incr ? 1 : compare2pow63(zNum, incr); |
30070
|
0 |
0 |
if( c<0 ){ |
30075
|
0 |
0 |
*pNum = neg ? SMALLEST_INT64 : LARGEST_INT64; |
30076
|
0 |
0 |
if( c>0 ){ |
30083
|
0 |
0 |
return neg ? rc : 3; |
30103
|
0 |
12 |
if( z[0]=='0' |
30104
|
0 |
0 |
&& (z[1]=='x' || z[1]=='X') |
|
0 |
0 |
&& (z[1]=='x' || z[1]=='X') |
30108
|
0 |
0 |
for(i=2; z[i]=='0'; i++){} |
30109
|
0 |
0 |
for(k=i; sqlite3Isxdigit(z[k]); k++){ |
30113
|
0 |
0 |
return (z[k]==0 && k-i<=16) ? 0 : 2; |
|
0 |
0 |
return (z[k]==0 && k-i<=16) ? 0 : 2; |
30135
|
0 |
1898 |
if( zNum[0]=='-' ){ |
30138
|
0 |
1898 |
}else if( zNum[0]=='+' ){ |
30142
|
61 |
1837 |
else if( zNum[0]=='0' |
30143
|
61 |
0 |
&& (zNum[1]=='x' || zNum[1]=='X') |
|
0 |
61 |
&& (zNum[1]=='x' || zNum[1]=='X') |
30144
|
0 |
0 |
&& sqlite3Isxdigit(zNum[2]) |
30148
|
0 |
0 |
while( zNum[0]=='0' ) zNum++; |
30149
|
0 |
0 |
for(i=0; sqlite3Isxdigit(zNum[i]) && i<8; i++){ |
|
0 |
0 |
for(i=0; sqlite3Isxdigit(zNum[i]) && i<8; i++){ |
30152
|
0 |
0 |
if( (u&0x80000000)==0 && sqlite3Isxdigit(zNum[i])==0 ){ |
|
0 |
0 |
if( (u&0x80000000)==0 && sqlite3Isxdigit(zNum[i])==0 ){ |
30160
|
0 |
1898 |
if( !sqlite3Isdigit(zNum[0]) ) return 0; |
30161
|
61 |
1898 |
while( zNum[0]=='0' ) zNum++; |
30162
|
4255 |
0 |
for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){ |
|
2357 |
1898 |
for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){ |
|
2357 |
0 |
for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){ |
30172
|
0 |
1898 |
if( i>10 ){ |
30176
|
12 |
1886 |
if( v-neg>2147483647 ){ |
30179
|
0 |
1886 |
if( neg ){ |
30192
|
669 |
0 |
if( z ) sqlite3GetInt32(z, &x); |
30228
|
0 |
19 |
if( v & (((u64)0xff000000)<<32) ){ |
30231
|
0 |
0 |
for(i=7; i>=0; i--){ |
30241
|
38 |
19 |
}while( v!=0 ); |
30244
|
57 |
19 |
for(i=0, j=n-1; j>=0; j--, i++){ |
30250
|
1915 |
2077 |
if( v<=0x7f ){ |
30254
|
2058 |
19 |
if( v<=0x3fff ){ |
30284
|
3342 |
380 |
if (!(a&0x80)) |
30293
|
380 |
0 |
if (!(b&0x80)) |
30310
|
0 |
0 |
if (!(a&0x80)) |
30326
|
0 |
0 |
if (!(b&0x80)) |
30350
|
0 |
0 |
if (!(a&0x80)) |
30372
|
0 |
0 |
if (!(b&0x80)) |
30388
|
0 |
0 |
if (!(a&0x80)) |
30405
|
0 |
0 |
if (!(b&0x80)) |
30470
|
351 |
13 |
if (!(b&0x80)) |
30484
|
13 |
0 |
if (!(a&0x80)) |
30511
|
0 |
0 |
if( (v64 & SQLITE_MAX_U32)!=v64 ){ |
30575
|
238 |
5306 |
for(i=1; (v >>= 7)!=0; i++){ assert( i<10 ); } |
30649
|
0 |
0 |
if( zBlob ){ |
30650
|
0 |
0 |
for(i=0; i
|
30687
|
0 |
9165 |
if( db==0 ){ |
30692
|
0 |
9165 |
if( magic!=SQLITE_MAGIC_OPEN ){ |
30693
|
0 |
0 |
if( sqlite3SafetyCheckSickOrOk(db) ){ |
30705
|
1168 |
12 |
if( magic!=SQLITE_MAGIC_SICK && |
|
6 |
1162 |
if( magic!=SQLITE_MAGIC_SICK && |
30706
|
0 |
6 |
magic!=SQLITE_MAGIC_OPEN && |
30784
|
196 |
0 |
if( x>=0 ) return x; |
30785
|
0 |
0 |
if( x==(int)0x80000000 ) return 0x7fffffff; |
30838
|
2401 |
1963 |
if( a>=b ){ |
30839
|
1634 |
767 |
if( a>b+49 ) return a; |
30840
|
3 |
764 |
if( a>b+31 ) return a+1; |
30843
|
1719 |
244 |
if( b>a+49 ) return b; |
30844
|
82 |
162 |
if( b>a+31 ) return b+1; |
30856
|
175 |
3338 |
if( x<8 ){ |
30857
|
104 |
71 |
if( x<2 ) return 0; |
30858
|
119 |
71 |
while( x<8 ){ y -= 10; x <<= 1; } |
30881
|
64 |
56 |
if( x<=1 ) return 0; |
30882
|
56 |
0 |
if( x<=2000000000 ) return sqlite3LogEst((u64)x); |
30965
|
8 |
22 |
if( pIn==0 || pIn[1]+nInt > pIn[0] ){ |
|
0 |
8 |
if( pIn==0 || pIn[1]+nInt > pIn[0] ){ |
30967
|
0 |
22 |
int nAlloc = (pIn ? pIn[0]*2 : 10) + nInt; |
30969
|
0 |
22 |
if( pOut==0 ) return pIn; |
30970
|
22 |
0 |
if( pIn==0 ) pOut[1] = 2; |
30992
|
3 |
32 |
if( pIn==0 ) return 0; |
30996
|
32 |
8 |
if( pIn[i]==iVal ) return (char*)&pIn[i+2]; |
30998
|
8 |
0 |
}while( i
|
31008
|
13 |
12 |
if( pIn==0 ) return 0; |
31013
|
7 |
7 |
if( strncmp(z,zName,nName)==0 && z[nName]==0 ) return pIn[i]; |
|
7 |
0 |
if( strncmp(z,zName,nName)==0 && z[nName]==0 ) return pIn[i]; |
31015
|
2 |
5 |
}while( i
|
31064
|
13707 |
3027 |
while( elem ){ |
31078
|
367727 |
36058 |
while( (c = (unsigned char)*z++)!=0 ){ /*OPTIMIZATION-IF-TRUE*/ |
31098
|
12653 |
6395 |
if( pEntry ){ |
31099
|
5954 |
6699 |
pHead = pEntry->count ? pEntry->chain : 0; |
31105
|
5954 |
13094 |
if( pHead ){ |
31108
|
5916 |
38 |
if( pHead->prev ){ pHead->prev->next = pNew; } |
31113
|
11298 |
1796 |
if( pH->first ){ pH->first->prev = pNew; } |
31131
|
12 |
526 |
if( new_size*sizeof(struct _ht)>SQLITE_MALLOC_SOFT_LIMIT ){ |
31134
|
0 |
538 |
if( new_size==pH->htsize ) return 0; |
31149
|
0 |
538 |
if( new_ht==0 ) return 0; |
31154
|
5214 |
538 |
for(elem=pH->first, pH->first=0; elem; elem = next_elem){ |
31177
|
30306 |
26647 |
if( pH->ht ){ /*OPTIMIZATION-IF-TRUE*/ |
31188
|
16027 |
40926 |
if( pHash ) *pHash = h; |
31189
|
116088 |
42957 |
while( count-- ){ |
31191
|
13996 |
102092 |
if( sqlite3StrICmp(elem->pKey,pKey)==0 ){ |
31208
|
2 |
21 |
if( elem->prev ){ |
31213
|
9 |
14 |
if( elem->next ){ |
31216
|
0 |
23 |
if( pH->ht ){ |
31218
|
0 |
0 |
if( pEntry->chain==elem ){ |
31226
|
14 |
9 |
if( pH->count==0 ){ |
31265
|
2119 |
13908 |
if( elem->data ){ |
31267
|
23 |
2096 |
if( data==0 ){ |
31275
|
74 |
13834 |
if( data==0 ) return 0; |
31277
|
0 |
13834 |
if( new_elem==0 ) return data; |
31281
|
7439 |
6395 |
if( pH->count>=10 && pH->count > 2*pH->htsize ){ |
|
538 |
6901 |
if( pH->count>=10 && pH->count > 2*pH->htsize ){ |
31282
|
538 |
0 |
if( rehash(pH, pH->count*2) ){ |
31287
|
7439 |
6395 |
insertElement(pH, pH->ht ? &pH->ht[h] : 0, new_elem); |
32221
|
91 |
0 |
return osGeteuid() ? 0 : osFchown(fd,uid,gid); |
32242
|
0 |
0 |
if( zName==0 ){ |
32247
|
0 |
0 |
for(i=0; i
|
32248
|
0 |
0 |
if( aSyscall[i].pDefault ){ |
32256
|
0 |
0 |
for(i=0; i
|
32257
|
0 |
0 |
if( strcmp(zName, aSyscall[i].zName)==0 ){ |
32258
|
0 |
0 |
if( aSyscall[i].pDefault==0 ){ |
32262
|
0 |
0 |
if( pNewFunc==0 ) pNewFunc = aSyscall[i].pDefault; |
32283
|
0 |
0 |
for(i=0; i
|
32284
|
0 |
0 |
if( strcmp(zName, aSyscall[i].zName)==0 ) return aSyscall[i].pCurrent; |
32299
|
0 |
0 |
if( zName ){ |
32300
|
0 |
0 |
for(i=0; i
|
32301
|
0 |
0 |
if( strcmp(zName, aSyscall[i].zName)==0 ) break; |
32304
|
0 |
0 |
for(i++; i
|
32305
|
0 |
0 |
if( aSyscall[i].pCurrent!=0 ) return aSyscall[i].zName; |
32338
|
91 |
297 |
mode_t m2 = m ? m : SQLITE_DEFAULT_FILE_PERMISSIONS; |
32345
|
9 |
379 |
if( fd<0 ){ |
32346
|
0 |
9 |
if( errno==EINTR ) continue; |
32349
|
379 |
0 |
if( fd>=SQLITE_MINIMUM_FILE_DESCRIPTOR ) break; |
32354
|
0 |
0 |
if( osOpen("/dev/null", f, m)<0 ) break; |
32356
|
379 |
9 |
if( fd>=0 ){ |
32357
|
91 |
288 |
if( m!=0 ){ |
32359
|
91 |
0 |
if( osFstat(fd, &statbuf)==0 |
32360
|
91 |
0 |
&& statbuf.st_size==0 |
32361
|
0 |
91 |
&& (statbuf.st_mode&0777)!=m |
32497
|
0 |
0 |
do{ rc = osFtruncate(h,sz); }while( rc<0 && errno==EINTR ); |
|
0 |
0 |
do{ rc = osFtruncate(h,sz); }while( rc<0 && errno==EINTR ); |
32879
|
0 |
6 |
if( zPath==0 ) zPath = ""; |
32902
|
0 |
377 |
if( osClose(h) ){ |
32903
|
0 |
0 |
unixLogErrorAtLine(SQLITE_IOERR_CLOSE, "close", |
32923
|
0 |
364 |
for(p=pInode->pUnused; p; p=pNext){ |
32941
|
103 |
0 |
if( ALWAYS(pInode) ){ |
32943
|
94 |
9 |
if( pInode->nRef==0 ){ |
32946
|
0 |
94 |
if( pInode->pPrev ){ |
32953
|
0 |
94 |
if( pInode->pNext ){ |
32990
|
0 |
105 |
if( rc!=0 ){ |
33032
|
9 |
96 |
while( pInode && memcmp(&fileId, &pInode->fileId, sizeof(fileId)) ){ |
|
0 |
9 |
while( pInode && memcmp(&fileId, &pInode->fileId, sizeof(fileId)) ){ |
33035
|
96 |
9 |
if( pInode==0 ){ |
33037
|
0 |
96 |
if( pInode==0 ){ |
33045
|
0 |
96 |
if( inodeList ) inodeList->pPrev = pInode; |
33064
|
0 |
331 |
|| (u64)buf.st_ino!=pFile->pInode->fileId.ino); |
33083
|
91 |
208 |
if( pFile->ctrlFlags & UNIXFILE_NOLOCK ) return; |
33086
|
0 |
208 |
if( rc!=0 ){ |
33090
|
0 |
208 |
if( buf.st_nlink==0 ){ |
33094
|
0 |
208 |
if( buf.st_nlink>1 ){ |
33098
|
0 |
208 |
if( fileHasMoved(pFile) ){ |
33123
|
65 |
87 |
if( pFile->pInode->eFileLock>SHARED_LOCK ){ |
33130
|
87 |
65 |
if( !reserved && !pFile->pInode->bProcessLock ){ |
|
87 |
0 |
if( !reserved && !pFile->pInode->bProcessLock ){ |
33136
|
0 |
87 |
if( osFcntl(pFile->h, F_GETLK, &lock) ){ |
33139
|
87 |
0 |
} else if( lock.l_type!=F_UNLCK ){ |
33213
|
0 |
1653 |
if( (pFile->ctrlFlags & (UNIXFILE_EXCL|UNIXFILE_RDONLY))==UNIXFILE_EXCL ){ |
33214
|
0 |
0 |
if( pInode->bProcessLock==0 ){ |
33222
|
0 |
0 |
if( rc<0 ) return rc; |
33314
|
0 |
707 |
if( pFile->eFileLock>=eFileLock ){ |
33337
|
156 |
551 |
if( (pFile->eFileLock!=pInode->eFileLock && |
|
130 |
26 |
if( (pFile->eFileLock!=pInode->eFileLock && |
33338
|
65 |
65 |
(pInode->eFileLock>=PENDING_LOCK || eFileLock>SHARED_LOCK)) |
33348
|
335 |
281 |
if( eFileLock==SHARED_LOCK && |
|
335 |
0 |
if( eFileLock==SHARED_LOCK && |
33349
|
65 |
270 |
(pInode->eFileLock==SHARED_LOCK || pInode->eFileLock==RESERVED_LOCK) ){ |
33366
|
281 |
270 |
if( eFileLock==SHARED_LOCK |
33367
|
96 |
185 |
|| (eFileLock==EXCLUSIVE_LOCK && pFile->eFileLock
|
|
96 |
0 |
|| (eFileLock==EXCLUSIVE_LOCK && pFile->eFileLock
|
33371
|
0 |
366 |
if( unixFileLock(pFile, &lock) ){ |
33374
|
0 |
0 |
if( rc!=SQLITE_BUSY ){ |
33385
|
270 |
281 |
if( eFileLock==SHARED_LOCK ){ |
33393
|
0 |
270 |
if( unixFileLock(pFile, &lock) ){ |
33402
|
0 |
270 |
if( unixFileLock(pFile, &lock) && rc==SQLITE_OK ){ |
|
0 |
0 |
if( unixFileLock(pFile, &lock) && rc==SQLITE_OK ){ |
33408
|
0 |
270 |
if( rc ){ |
33409
|
0 |
0 |
if( rc!=SQLITE_BUSY ){ |
33418
|
96 |
185 |
}else if( eFileLock==EXCLUSIVE_LOCK && pInode->nShared>1 ){ |
|
0 |
96 |
}else if( eFileLock==EXCLUSIVE_LOCK && pInode->nShared>1 ){ |
33431
|
185 |
96 |
if( eFileLock==RESERVED_LOCK ){ |
33439
|
87 |
194 |
if( unixFileLock(pFile, &lock) ){ |
33442
|
0 |
87 |
if( rc!=SQLITE_BUSY ){ |
33466
|
464 |
87 |
if( rc==SQLITE_OK ){ |
33469
|
0 |
87 |
}else if( eFileLock==EXCLUSIVE_LOCK ){ |
33520
|
208 |
433 |
if( pFile->eFileLock<=eFileLock ){ |
33526
|
98 |
335 |
if( pFile->eFileLock>SHARED_LOCK ){ |
33550
|
98 |
0 |
if( eFileLock==SHARED_LOCK ){ |
33599
|
0 |
98 |
if( unixFileLock(pFile, &lock) ){ |
33616
|
98 |
0 |
if( unixFileLock(pFile, &lock)==0 ){ |
33624
|
335 |
98 |
if( eFileLock==NO_LOCK ){ |
33630
|
270 |
65 |
if( pInode->nShared==0 ){ |
33634
|
270 |
0 |
if( unixFileLock(pFile, &lock)==0 ){ |
33650
|
270 |
65 |
if( pInode->nLock==0 ){ |
33657
|
433 |
0 |
if( rc==SQLITE_OK ) pFile->eFileLock = eFileLock; |
33695
|
194 |
0 |
if( pFile->h>=0 ){ |
33736
|
103 |
0 |
if( ALWAYS(pFile->pInode) && pFile->pInode->nLock ){ |
|
0 |
103 |
if( ALWAYS(pFile->pInode) && pFile->pInode->nLock ){ |
33882
|
0 |
0 |
if( pFile->eFileLock > NO_LOCK ){ |
33895
|
0 |
0 |
if( rc<0 ){ |
33898
|
0 |
0 |
if( EEXIST == tErrno ){ |
33902
|
0 |
0 |
if( rc!=SQLITE_BUSY ){ |
33934
|
0 |
0 |
if( pFile->eFileLock==eFileLock ){ |
33941
|
0 |
0 |
if( eFileLock==SHARED_LOCK ){ |
33949
|
0 |
0 |
if( rc<0 ){ |
33951
|
0 |
0 |
if( tErrno==ENOENT ){ |
34893
|
0 |
584 |
if( newOffset<0 ){ |
34899
|
405 |
179 |
if( got==cnt ) break; |
34900
|
0 |
179 |
if( got<0 ){ |
34901
|
0 |
0 |
if( errno==EINTR ){ got = 1; continue; } |
34905
|
0 |
179 |
}else if( got>0 ){ |
34911
|
0 |
179 |
}while( got>0 ); |
34947
|
0 |
584 |
if( offsetmmapSize ){ |
34948
|
0 |
0 |
if( offset+amt <= pFile->mmapSize ){ |
34962
|
405 |
179 |
if( got==amt ){ |
34964
|
0 |
179 |
}else if( got<0 ){ |
35005
|
0 |
824 |
if( iSeek<0 ){ |
35010
|
0 |
824 |
}while( rc<0 && errno==EINTR ); |
|
0 |
0 |
}while( rc<0 && errno==EINTR ); |
35016
|
0 |
824 |
if( rc<0 ) *piErrno = errno; |
35096
|
0 |
824 |
while( (wrote = seekAndWrite(pFile, offset, pBuf, amt))0 ){ |
|
0 |
0 |
while( (wrote = seekAndWrite(pFile, offset, pBuf, amt))0 ){ |
35104
|
0 |
824 |
if( amt>wrote ){ |
35105
|
0 |
0 |
if( wrote<0 && pFile->lastErrno!=ENOSPC ){ |
|
0 |
0 |
if( wrote<0 && pFile->lastErrno!=ENOSPC ){ |
35274
|
1543 |
0 |
for(ii=(int)strlen(zDirname); ii>0 && zDirname[ii]!='/'; ii--); |
|
1454 |
89 |
for(ii=(int)strlen(zDirname); ii>0 && zDirname[ii]!='/'; ii--); |
35275
|
89 |
0 |
if( ii>0 ){ |
35278
|
0 |
0 |
if( zDirname[0]!='/' ) zDirname[0] = '.'; |
35286
|
89 |
0 |
if( fd>=0 ) return SQLITE_OK; |
35326
|
0 |
267 |
if( rc ){ |
35335
|
89 |
178 |
if( pFile->ctrlFlags & UNIXFILE_DIRSYNC ){ |
35340
|
89 |
0 |
if( rc==SQLITE_OK ){ |
35366
|
0 |
0 |
if( pFile->szChunk>0 ){ |
35371
|
0 |
0 |
if( rc ){ |
35393
|
0 |
0 |
if( nBytemmapSize ){ |
35411
|
0 |
341 |
if( rc!=0 ){ |
35423
|
0 |
341 |
if( *pSize==1 ) *pSize = 0; |
35444
|
0 |
29 |
if( pFile->szChunk>0 ){ |
35448
|
0 |
0 |
if( osFstat(pFile->h, &buf) ){ |
35453
|
0 |
0 |
if( nSize>(i64)buf.st_size ){ |
35479
|
0 |
0 |
for(/*no-op*/; iWrite
|
35480
|
0 |
0 |
if( iWrite>=nSize ) iWrite = nSize - 1; |
35482
|
0 |
0 |
if( nWrite!=1 ) return SQLITE_IOERR_WRITE; |
35489
|
0 |
29 |
if( pFile->mmapSizeMax>0 && nByte>pFile->mmapSize ){ |
|
0 |
0 |
if( pFile->mmapSizeMax>0 && nByte>pFile->mmapSize ){ |
35491
|
0 |
0 |
if( pFile->szChunk<=0 ){ |
35492
|
0 |
0 |
if( robust_ftruncate(pFile->h, nByte) ){ |
35513
|
0 |
0 |
if( *pArg<0 ){ |
35515
|
0 |
0 |
}else if( (*pArg)==0 ){ |
35579
|
0 |
0 |
if( zTFile ){ |
35599
|
0 |
319 |
if( newLimit>sqlite3GlobalConfig.mxMmap ){ |
35611
|
319 |
0 |
if( newLimit>=0 && newLimit!=pFile->mmapSizeMax && pFile->nFetchOut==0 ){ |
|
0 |
319 |
if( newLimit>=0 && newLimit!=pFile->mmapSizeMax && pFile->nFetchOut==0 ){ |
|
0 |
0 |
if( newLimit>=0 && newLimit!=pFile->mmapSizeMax && pFile->nFetchOut==0 ){ |
35613
|
0 |
0 |
if( pFile->mmapSize>0 ){ |
35654
|
105 |
829 |
if( pFd->sectorSize==0 ){ |
35667
|
105 |
0 |
if( pFd->ctrlFlags & UNIXFILE_PSOW ){ |
35908
|
0 |
0 |
if( pShmNode->h>=0 ){ |
35915
|
0 |
0 |
rc = (rc!=(-1)) ? SQLITE_OK : SQLITE_BUSY; |
35969
|
0 |
0 |
if( pgsz
|
35982
|
0 |
0 |
if( p && ALWAYS(p->nRef==0) ){ |
|
0 |
0 |
if( p && ALWAYS(p->nRef==0) ){ |
35987
|
0 |
0 |
for(i=0; inRegion; i+=nShmPerMap){ |
35988
|
0 |
0 |
if( p->h>=0 ){ |
35995
|
0 |
0 |
if( p->h>=0 ){ |
36039
|
0 |
0 |
if( osFcntl(pShmNode->h, F_GETLK, &lock)!=0 ) { |
36041
|
0 |
0 |
}else if( lock.l_type==F_UNLCK ){ |
36042
|
0 |
0 |
if( pShmNode->isReadonly ){ |
36047
|
0 |
0 |
if( rc==SQLITE_OK && robust_ftruncate(pShmNode->h, 0) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && robust_ftruncate(pShmNode->h, 0) ){ |
36051
|
0 |
0 |
}else if( lock.l_type==F_WRLCK ){ |
36055
|
0 |
0 |
if( rc==SQLITE_OK ){ |
36107
|
0 |
0 |
if( p==0 ) return SQLITE_NOMEM_BKPT; |
36117
|
0 |
0 |
if( pShmNode==0 ){ |
36127
|
0 |
0 |
if( osFstat(pDbFd->h, &sStat) ){ |
36138
|
0 |
0 |
if( pShmNode==0 ){ |
36155
|
0 |
0 |
if( sqlite3GlobalConfig.bCoreMutex ){ |
36157
|
0 |
0 |
if( pShmNode->mutex==0 ){ |
36163
|
0 |
0 |
if( pInode->bProcessLock==0 ){ |
36164
|
0 |
0 |
if( 0==sqlite3_uri_boolean(pDbFd->zPath, "readonly_shm", 0) ){ |
36167
|
0 |
0 |
if( pShmNode->h<0 ){ |
36169
|
0 |
0 |
if( pShmNode->h<0 ){ |
36183
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_READONLY_CANTINIT ) goto shm_open_err; |
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_READONLY_CANTINIT ) goto shm_open_err; |
36251
|
0 |
0 |
if( pDbFd->pShm==0 ){ |
36253
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
36259
|
0 |
0 |
if( pShmNode->isUnlocked ){ |
36261
|
0 |
0 |
if( rc!=SQLITE_OK ) goto shmpage_out; |
36272
|
0 |
0 |
if( pShmNode->nRegion
|
36279
|
0 |
0 |
if( pShmNode->h>=0 ){ |
36284
|
0 |
0 |
if( osFstat(pShmNode->h, &sStat) ){ |
36289
|
0 |
0 |
if( sStat.st_size
|
36293
|
0 |
0 |
if( !bExtend ){ |
36310
|
0 |
0 |
for(iPg=(sStat.st_size/pgsz); iPg<(nByte/pgsz); iPg++){ |
36312
|
0 |
0 |
if( seekAndWriteFd(pShmNode->h, iPg*pgsz + pgsz-1, "", 1, &x)!=1 ){ |
36326
|
0 |
0 |
if( !apNew ){ |
36331
|
0 |
0 |
while( pShmNode->nRegion
|
36335
|
0 |
0 |
if( pShmNode->h>=0 ){ |
36336
|
0 |
0 |
pMem = osMmap(0, nMap, |
36340
|
0 |
0 |
if( pMem==MAP_FAILED ){ |
36346
|
0 |
0 |
if( pMem==0 ){ |
36353
|
0 |
0 |
for(i=0; i
|
36361
|
0 |
0 |
if( pShmNode->nRegion>iRegion ){ |
36366
|
0 |
0 |
if( pShmNode->isReadonly && rc==SQLITE_OK ) rc = SQLITE_READONLY; |
|
0 |
0 |
if( pShmNode->isReadonly && rc==SQLITE_OK ) rc = SQLITE_READONLY; |
36407
|
0 |
0 |
if( flags & SQLITE_SHM_UNLOCK ){ |
36411
|
0 |
0 |
for(pX=pShmNode->pFirst; pX; pX=pX->pNext){ |
36412
|
0 |
0 |
if( pX==p ) continue; |
36418
|
0 |
0 |
if( (mask & allMask)==0 ){ |
36425
|
0 |
0 |
if( rc==SQLITE_OK ){ |
36429
|
0 |
0 |
}else if( flags & SQLITE_SHM_SHARED ){ |
36436
|
0 |
0 |
for(pX=pShmNode->pFirst; pX; pX=pX->pNext){ |
36437
|
0 |
0 |
if( (pX->exclMask & mask)!=0 ){ |
36445
|
0 |
0 |
if( rc==SQLITE_OK ){ |
36446
|
0 |
0 |
if( (allShared & mask)==0 ){ |
36454
|
0 |
0 |
if( rc==SQLITE_OK ){ |
36461
|
0 |
0 |
for(pX=pShmNode->pFirst; pX; pX=pX->pNext){ |
36462
|
0 |
0 |
if( (pX->exclMask & mask)!=0 || (pX->sharedMask & mask)!=0 ){ |
|
0 |
0 |
if( (pX->exclMask & mask)!=0 || (pX->sharedMask & mask)!=0 ){ |
36471
|
0 |
0 |
if( rc==SQLITE_OK ){ |
36473
|
0 |
0 |
if( rc==SQLITE_OK ){ |
36518
|
0 |
0 |
if( p==0 ) return SQLITE_OK; |
36527
|
0 |
0 |
for(pp=&pShmNode->pFirst; (*pp)!=p; pp = &(*pp)->pNext){} |
36540
|
0 |
0 |
if( pShmNode->nRef==0 ){ |
36541
|
0 |
0 |
if( deleteFlag && pShmNode->h>=0 ){ |
|
0 |
0 |
if( deleteFlag && pShmNode->h>=0 ){ |
36565
|
0 |
194 |
if( pFd->pMapRegion ){ |
36610
|
0 |
0 |
if( pOrig ){ |
36620
|
0 |
0 |
if( nReuse!=nOrig ){ |
36640
|
0 |
0 |
if( pNew==MAP_FAILED || pNew==0 ){ |
|
0 |
0 |
if( pNew==MAP_FAILED || pNew==0 ){ |
36646
|
0 |
0 |
if( pNew==0 ){ |
36650
|
0 |
0 |
if( pNew==MAP_FAILED ){ |
36683
|
0 |
0 |
if( pFd->nFetchOut>0 ) return SQLITE_OK; |
36685
|
0 |
0 |
if( nMap<0 ){ |
36687
|
0 |
0 |
if( osFstat(pFd->h, &statbuf) ){ |
36692
|
0 |
0 |
if( nMap>pFd->mmapSizeMax ){ |
36697
|
0 |
0 |
if( nMap!=pFd->mmapSize ){ |
36724
|
0 |
0 |
if( pFd->mmapSizeMax>0 ){ |
36725
|
0 |
0 |
if( pFd->pMapRegion==0 ){ |
36727
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
36729
|
0 |
0 |
if( pFd->mmapSize >= iOff+nAmt ){ |
36761
|
0 |
0 |
if( p ){ |
37102
|
8 |
188 |
if( sqlite3_uri_boolean(((ctrlFlags & UNIXFILE_URI) ? zFilename : 0), |
|
196 |
0 |
if( sqlite3_uri_boolean(((ctrlFlags & UNIXFILE_URI) ? zFilename : 0), |
37106
|
0 |
196 |
if( strcmp(pVfs->zName,"unix-excl")==0 ){ |
37118
|
91 |
105 |
if( ctrlFlags & UNIXFILE_NOLOCK ){ |
37130
|
105 |
91 |
if( pLockingStyle == &posixIoMethods |
37137
|
0 |
105 |
if( rc!=SQLITE_OK ){ |
37190
|
0 |
91 |
else if( pLockingStyle == &dotlockIoMethods ){ |
37199
|
0 |
0 |
if( zLockFile==0 ){ |
37240
|
0 |
196 |
if( rc!=SQLITE_OK ){ |
37241
|
0 |
0 |
if( h>=0 ) robust_close(pNew, h, __LINE__); |
37267
|
0 |
0 |
if( !azDirs[0] ) azDirs[0] = getenv("SQLITE_TMPDIR"); |
37268
|
0 |
0 |
if( !azDirs[1] ) azDirs[1] = getenv("TMPDIR"); |
37270
|
0 |
0 |
if( zDir!=0 |
37271
|
0 |
0 |
&& osStat(zDir, &buf)==0 |
37272
|
0 |
0 |
&& S_ISDIR(buf.st_mode) |
37273
|
0 |
0 |
&& osAccess(zDir, 03)==0 |
37277
|
0 |
0 |
if( i>=sizeof(azDirs)/sizeof(azDirs[0]) ) break; |
37300
|
0 |
0 |
if( zDir==0 ) return SQLITE_IOERR_GETTEMPPATH; |
37308
|
0 |
0 |
if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ) return SQLITE_ERROR; |
|
0 |
0 |
if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ) return SQLITE_ERROR; |
37309
|
0 |
0 |
}while( osAccess(zBuf,0)==0 ); |
37359
|
0 |
111 |
if( nUnusedFd>0 && 0==osStat(zPath, &sStat) ){ |
|
0 |
0 |
if( nUnusedFd>0 && 0==osStat(zPath, &sStat) ){ |
37363
|
0 |
0 |
while( pInode && (pInode->fileId.dev!=sStat.st_dev |
|
0 |
0 |
while( pInode && (pInode->fileId.dev!=sStat.st_dev |
37364
|
0 |
0 |
|| pInode->fileId.ino!=(u64)sStat.st_ino) ){ |
37367
|
0 |
0 |
if( pInode ){ |
37369
|
0 |
0 |
for(pp=&pInode->pUnused; *pp && (*pp)->flags!=flags; pp=&((*pp)->pNext)); |
|
0 |
0 |
for(pp=&pInode->pUnused; *pp && (*pp)->flags!=flags; pp=&((*pp)->pNext)); |
37371
|
0 |
0 |
if( pUnused ){ |
37393
|
91 |
0 |
if( 0==osStat(zFile, &sStat) ){ |
37435
|
91 |
111 |
if( flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) ){ |
37452
|
637 |
91 |
while( zPath[nDb]!='-' ){ |
37457
|
637 |
0 |
if( nDb==0 || zPath[nDb]=='.' ) return SQLITE_OK; |
|
0 |
637 |
if( nDb==0 || zPath[nDb]=='.' ) return SQLITE_OK; |
37464
|
0 |
111 |
}else if( flags & SQLITE_OPEN_DELETEONCLOSE ){ |
37466
|
12 |
99 |
}else if( flags & SQLITE_OPEN_URI ){ |
37472
|
0 |
12 |
if( z ){ |
37532
|
190 |
12 |
int isNewJrnl = (isCreate && ( |
|
190 |
0 |
int isNewJrnl = (isCreate && ( |
37534
|
99 |
91 |
|| eType==SQLITE_OPEN_MAIN_JOURNAL |
37535
|
0 |
99 |
|| eType==SQLITE_OPEN_WAL |
37575
|
23 |
179 |
if( randomnessPid!=osGetpid(0) ){ |
37581
|
111 |
91 |
if( eType==SQLITE_OPEN_MAIN_DB ){ |
37584
|
0 |
111 |
if( pUnused ){ |
37588
|
0 |
111 |
if( !pUnused ){ |
37599
|
0 |
91 |
}else if( !zName ){ |
37603
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
37617
|
6 |
196 |
if( isReadonly ) openFlags |= O_RDONLY; |
37618
|
196 |
6 |
if( isReadWrite ) openFlags |= O_RDWR; |
37619
|
190 |
12 |
if( isCreate ) openFlags |= O_CREAT; |
37620
|
0 |
202 |
if( isExclusive ) openFlags |= (O_EXCL|O_NOFOLLOW); |
37623
|
202 |
0 |
if( fd<0 ){ |
37628
|
0 |
202 |
if( rc!=SQLITE_OK ){ |
37636
|
6 |
196 |
if( fd<0 ){ |
37637
|
0 |
6 |
if( isNewJrnl && errno==EACCES && osAccess(zName, F_OK) ){ |
|
0 |
0 |
if( isNewJrnl && errno==EACCES && osAccess(zName, F_OK) ){ |
|
0 |
0 |
if( isNewJrnl && errno==EACCES && osAccess(zName, F_OK) ){ |
37641
|
6 |
0 |
}else if( errno!=EISDIR && isReadWrite ){ |
|
3 |
3 |
}else if( errno!=EISDIR && isReadWrite ){ |
37651
|
6 |
196 |
if( fd<0 ){ |
37653
|
6 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
37661
|
91 |
105 |
if( flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) ){ |
37666
|
105 |
91 |
if( pOutFlags ){ |
37670
|
105 |
91 |
if( p->pPreallocatedUnused ){ |
37675
|
0 |
196 |
if( isDelete ){ |
37709
|
0 |
196 |
if( isDelete ) ctrlFlags |= UNIXFILE_DELETE; |
37710
|
3 |
193 |
if( isReadonly ) ctrlFlags |= UNIXFILE_RDONLY; |
37712
|
91 |
105 |
if( noLock ) ctrlFlags |= UNIXFILE_NOLOCK; |
37713
|
91 |
105 |
if( isNewJrnl ) ctrlFlags |= UNIXFILE_DIRSYNC; |
37714
|
8 |
188 |
if( flags & SQLITE_OPEN_URI ) ctrlFlags |= UNIXFILE_URI; |
37755
|
6 |
196 |
if( rc!=SQLITE_OK ){ |
37774
|
0 |
91 |
if( osUnlink(zPath)==(-1) ){ |
37775
|
0 |
0 |
if( errno==ENOENT |
37787
|
0 |
91 |
if( (dirSync & 1)!=0 ){ |
37790
|
0 |
0 |
if( rc==SQLITE_OK ){ |
37791
|
0 |
0 |
if( full_fsync(fd,0,0) ){ |
37828
|
670 |
0 |
if( flags==SQLITE_ACCESS_EXISTS ){ |
37830
|
152 |
518 |
*pResOut = (0==osStat(zPath, &buf) && buf.st_size>0); |
|
152 |
0 |
*pResOut = (0==osStat(zPath, &buf) && buf.st_size>0); |
37847
|
87 |
24 |
if( zPath[0]!='/' ){ |
37848
|
0 |
87 |
if( osGetcwd(zOut, nOut-2)==0 ){ |
37854
|
0 |
111 |
if( (iOff+nPath+1)>nOut ){ |
37904
|
59 |
52 |
if( osLstat(zIn, &buf)!=0 ){ |
37905
|
0 |
59 |
if( errno!=ENOENT ){ |
37912
|
0 |
111 |
if( bLink ){ |
37913
|
0 |
0 |
if( zDel==0 ){ |
37915
|
0 |
0 |
if( zDel==0 ) rc = SQLITE_NOMEM_BKPT; |
37916
|
0 |
0 |
}else if( ++nLink>SQLITE_MAX_SYMLINKS ){ |
37920
|
0 |
0 |
if( rc==SQLITE_OK ){ |
37922
|
0 |
0 |
if( nByte<0 ){ |
37925
|
0 |
0 |
if( zDel[0]!='/' ){ |
37927
|
0 |
0 |
for(n = sqlite3Strlen30(zIn); n>0 && zIn[n-1]!='/'; n--); |
|
0 |
0 |
for(n = sqlite3Strlen30(zIn); n>0 && zIn[n-1]!='/'; n--); |
37928
|
0 |
0 |
if( nByte+n+1>nOut ){ |
37944
|
111 |
0 |
if( rc==SQLITE_OK && zIn!=zOut ){ |
|
111 |
0 |
if( rc==SQLITE_OK && zIn!=zOut ){ |
37947
|
111 |
0 |
if( bLink==0 ) break; |
37949
|
0 |
0 |
}while( rc==SQLITE_OK ); |
37980
|
0 |
0 |
if( zErr ){ |
38044
|
0 |
94 |
if( fd<0 ){ |
38052
|
0 |
94 |
do{ got = osRead(fd, zBuf, nBuf); }while( got<0 && errno==EINTR ); |
|
0 |
0 |
do{ got = osRead(fd, zBuf, nBuf); }while( got<0 && errno==EINTR ); |
39450
|
412 |
103 |
for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){ |
46489
|
1000 |
0 |
if( p ){ |
46503
|
484 |
1208 |
if( i>=p->iSize ) return 0; |
46504
|
0 |
1208 |
while( p->iDivisor ){ |
46508
|
0 |
0 |
if (!p) { |
46512
|
1208 |
0 |
if( p->iSize<=BITVEC_NBIT ){ |
46516
|
0 |
0 |
while( p->u.aHash[h] ){ |
46517
|
0 |
0 |
if( p->u.aHash[h]==i ) return 1; |
46524
|
1 |
28 |
return p!=0 && sqlite3BitvecTestNotNull(p,i); |
|
0 |
1 |
return p!=0 && sqlite3BitvecTestNotNull(p,i); |
46541
|
0 |
1207 |
if( p==0 ) return SQLITE_OK; |
46545
|
0 |
1207 |
while((p->iSize > BITVEC_NBIT) && p->iDivisor) { |
|
0 |
0 |
while((p->iSize > BITVEC_NBIT) && p->iDivisor) { |
46548
|
0 |
0 |
if( p->u.apSub[bin]==0 ){ |
46550
|
0 |
0 |
if( p->u.apSub[bin]==0 ) return SQLITE_NOMEM_BKPT; |
46554
|
1207 |
0 |
if( p->iSize<=BITVEC_NBIT ){ |
46562
|
0 |
0 |
if( !p->u.aHash[h] ){ |
46563
|
0 |
0 |
if (p->nSet<(BITVEC_NINT-1)) { |
46572
|
0 |
0 |
if( p->u.aHash[h]==i ) return SQLITE_OK; |
46574
|
0 |
0 |
if( h>=BITVEC_NINT ) h = 0; |
46575
|
0 |
0 |
} while( p->u.aHash[h] ); |
46580
|
0 |
0 |
if( p->nSet>=BITVEC_MXHASH ){ |
46584
|
0 |
0 |
if( aiValues==0 ){ |
46591
|
0 |
0 |
for(j=0; j
|
46592
|
0 |
0 |
if( aiValues[j] ) rc |= sqlite3BitvecSet(p, aiValues[j]); |
46611
|
0 |
0 |
if( p==0 ) return; |
46614
|
0 |
0 |
while( p->iDivisor ){ |
46618
|
0 |
0 |
if (!p) { |
46622
|
0 |
0 |
if( p->iSize<=BITVEC_NBIT ){ |
46630
|
0 |
0 |
for(j=0; j
|
46631
|
0 |
0 |
if( aiValues[j] && aiValues[j]!=(i+1) ){ |
|
0 |
0 |
if( aiValues[j] && aiValues[j]!=(i+1) ){ |
46634
|
0 |
0 |
while( p->u.aHash[h] ){ |
46636
|
0 |
0 |
if( h>=BITVEC_NINT ) h = 0; |
46648
|
3579 |
1000 |
if( p==0 ) return; |
46649
|
0 |
1000 |
if( p->iDivisor ){ |
46651
|
0 |
0 |
for(i=0; i
|
46719
|
0 |
0 |
if( pBitvec==0 || pV==0 || pTmpSpace==0 ) goto bitvec_end; |
|
0 |
0 |
if( pBitvec==0 || pV==0 || pTmpSpace==0 ) goto bitvec_end; |
|
0 |
0 |
if( pBitvec==0 || pV==0 || pTmpSpace==0 ) goto bitvec_end; |
46727
|
0 |
0 |
while( (op = aOp[pc])!=0 ){ |
46728
|
0 |
0 |
switch( op ){ |
46745
|
0 |
0 |
if( (--aOp[pc+1]) > 0 ) nx = 0; |
46748
|
0 |
0 |
if( (op & 1)!=0 ){ |
46750
|
0 |
0 |
if( op!=5 ){ |
46751
|
0 |
0 |
if( sqlite3BitvecSet(pBitvec, i+1) ) goto bitvec_end; |
46767
|
0 |
0 |
for(i=1; i<=sz; i++){ |
46768
|
0 |
0 |
if( (TESTBIT(pV,i))!=sqlite3BitvecTest(pBitvec,i) ){ |
46948
|
6947 |
1704 |
if( addRemove & PCACHE_DIRTYLIST_REMOVE ){ |
46953
|
1354 |
5593 |
if( p->pSynced==pPage ){ |
46957
|
4392 |
2555 |
if( pPage->pDirtyNext ){ |
46963
|
3084 |
3863 |
if( pPage->pDirtyPrev ){ |
46973
|
2525 |
1338 |
if( p->pDirty==0 ){ /*OPTIMIZATION-IF-TRUE*/ |
46979
|
6947 |
1704 |
if( addRemove & PCACHE_DIRTYLIST_ADD ){ |
46982
|
4422 |
2525 |
if( pPage->pDirtyNext ){ |
46987
|
154 |
2371 |
if( p->bPurgeable ){ |
46999
|
3069 |
3878 |
if( !p->pSynced |
47000
|
1307 |
1762 |
&& 0==(pPage->flags&PGHDR_NEED_SYNC) /*OPTIMIZATION-IF-FALSE*/ |
47013
|
710 |
4071 |
if( p->pCache->bPurgeable ){ |
47025
|
306 |
501 |
if( p->szCache>=0 ){ |
47043
|
103 |
0 |
if( sqlite3GlobalConfig.pcache2.xInit==0 ){ |
47052
|
0 |
0 |
if( sqlite3GlobalConfig.pcache2.xShutdown ){ |
47103
|
306 |
306 |
if( pCache->szPage ){ |
47109
|
0 |
306 |
if( pNew==0 ) return SQLITE_NOMEM_BKPT; |
47111
|
0 |
306 |
if( pCache->pCache ){ |
47192
|
0 |
0 |
if( pCache->eCreate==2 ) return 0; |
47194
|
0 |
0 |
if( sqlite3PcachePagecount(pCache)>pCache->szSpill ){ |
47204
|
0 |
0 |
for(pPg=pCache->pSynced; |
47205
|
0 |
0 |
pPg && (pPg->nRef || (pPg->flags&PGHDR_NEED_SYNC)); |
|
0 |
0 |
pPg && (pPg->nRef || (pPg->flags&PGHDR_NEED_SYNC)); |
47209
|
0 |
0 |
if( !pPg ){ |
47210
|
0 |
0 |
for(pPg=pCache->pDirtyTail; pPg && pPg->nRef; pPg=pPg->pDirtyPrev); |
|
0 |
0 |
for(pPg=pCache->pDirtyTail; pPg && pPg->nRef; pPg=pPg->pDirtyPrev); |
47212
|
0 |
0 |
if( pPg ){ |
47224
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ |
47230
|
0 |
0 |
return *ppPage==0 ? SQLITE_NOMEM_BKPT : SQLITE_OK; |
47278
|
627 |
9673 |
if( !pPgHdr->pPage ){ |
47294
|
8600 |
1078 |
if( (--p->nRef)==0 ){ |
47295
|
3357 |
5243 |
if( p->flags&PGHDR_CLEAN ){ |
47321
|
0 |
0 |
if( p->flags&PGHDR_DIRTY ){ |
47335
|
1704 |
0 |
if( p->flags & (PGHDR_CLEAN|PGHDR_DONT_WRITE) ){ /*OPTIMIZATION-IF-FALSE*/ |
47337
|
1704 |
0 |
if( p->flags & PGHDR_CLEAN ){ |
47360
|
1424 |
280 |
if( p->nRef==0 ){ |
47371
|
1704 |
1130 |
while( (p = pCache->pDirty)!=0 ){ |
47382
|
0 |
0 |
for(p=pCache->pDirty; p; p=p->pDirtyNext){ |
47393
|
213 |
89 |
for(p=pCache->pDirty; p; p=p->pDirtyNext){ |
47410
|
0 |
0 |
if( (p->flags&PGHDR_DIRTY) && (p->flags&PGHDR_NEED_SYNC) ){ |
|
0 |
0 |
if( (p->flags&PGHDR_DIRTY) && (p->flags&PGHDR_NEED_SYNC) ){ |
47425
|
1356 |
306 |
if( pCache->pCache ){ |
47429
|
0 |
1356 |
for(p=pCache->pDirty; p; p=pNext){ |
47436
|
0 |
0 |
if( p->pgno>pgno ){ |
47441
|
320 |
1036 |
if( pgno==0 && pCache->nRefSum ){ |
|
5 |
315 |
if( pgno==0 && pCache->nRefSum ){ |
47444
|
5 |
0 |
if( ALWAYS(pPage1) ){ /* Page 1 is always available in cache, because |
47479
|
91 |
80 |
if( pA->pgnopgno ){ |
47483
|
73 |
18 |
if( pA==0 ){ |
47491
|
51 |
29 |
if( pB==0 ){ |
47515
|
213 |
89 |
while( pIn ){ |
47519
|
325 |
0 |
for(i=0; ALWAYS(i
|
47520
|
213 |
112 |
if( a[i]==0 ){ |
47528
|
0 |
213 |
if( NEVER(i==N_SORT_BUCKET-1) ){ |
47536
|
2759 |
89 |
for(i=1; i
|
47537
|
2671 |
88 |
if( a[i]==0 ) continue; |
47538
|
12 |
76 |
p = p ? pcacheMergeDirtyList(p, a[i]) : a[i]; |
47548
|
213 |
89 |
for(p=pCache->pDirty; p; p=p->pDirtyNext){ |
47606
|
0 |
0 |
if( mxPage ){ |
47607
|
0 |
0 |
if( mxPage<0 ){ |
47613
|
0 |
0 |
if( resszSpill ) res = p->szSpill; |
47639
|
0 |
0 |
for(pDirty=pCache->pDirty; pDirty; pDirty=pDirty->pDirtyNext) nDirty++; |
47640
|
0 |
0 |
return nCache ? (int)(((i64)nDirty * 100) / nCache) : 0; |
47910
|
103 |
0 |
if( pcache1.isInit ){ |
47912
|
103 |
0 |
if( pBuf==0 ) sz = n = 0; |
47913
|
103 |
0 |
if( n==0 ) sz = 0; |
47917
|
103 |
0 |
pcache1.nReserve = n>90 ? 10 : (n/10 + 1); |
47921
|
0 |
103 |
while( n-- ){ |
47938
|
0 |
240 |
if( pcache1.nInitPage==0 ) return 0; |
47940
|
187 |
53 |
if( pCache->nMax<3 ) return 0; |
47942
|
53 |
0 |
if( pcache1.nInitPage>0 ){ |
47947
|
0 |
53 |
if( szBulk > pCache->szAlloc*(i64)pCache->nMax ){ |
47952
|
53 |
0 |
if( zBulk ){ |
47963
|
1007 |
53 |
}while( --nBulk ); |
47980
|
0 |
957 |
if( nByte<=pcache1.szSlot ){ |
47983
|
0 |
0 |
if( p ){ |
47993
|
957 |
0 |
if( p==0 ){ |
47999
|
957 |
0 |
if( p ){ |
48016
|
312 |
953 |
if( p==0 ) return; |
48017
|
953 |
0 |
if( SQLITE_WITHIN(p, pcache1.pStart, pcache1.pEnd) ){ |
|
0 |
953 |
if( SQLITE_WITHIN(p, pcache1.pStart, pcache1.pEnd) ){ |
48070
|
527 |
100 |
if( pCache->pFree || (pCache->nPage==0 && pcache1InitBulk(pCache)) ){ |
|
240 |
287 |
if( pCache->pFree || (pCache->nPage==0 && pcache1InitBulk(pCache)) ){ |
|
53 |
187 |
if( pCache->pFree || (pCache->nPage==0 && pcache1InitBulk(pCache)) ){ |
48083
|
5 |
469 |
if( benignMalloc ){ sqlite3BeginBenignMalloc(); } |
48096
|
5 |
469 |
if( benignMalloc ){ sqlite3EndBenignMalloc(); } |
48100
|
0 |
474 |
if( pPg==0 ) return 0; |
48118
|
149 |
474 |
if( p->isBulkLocal ){ |
48164
|
0 |
97 |
if( pcache1.nSlot && (pCache->szPage+pCache->szExtra)<=pcache1.szSlot ){ |
|
0 |
0 |
if( pcache1.nSlot && (pCache->szPage+pCache->szExtra)<=pcache1.szSlot ){ |
48188
|
306 |
0 |
if( nNew<256 ){ |
48193
|
0 |
306 |
if( p->nHash ){ sqlite3BeginBenignMalloc(); } |
48195
|
0 |
306 |
if( p->nHash ){ sqlite3EndBenignMalloc(); } |
48197
|
306 |
0 |
if( apNew ){ |
48198
|
0 |
306 |
for(i=0; inHash; i++){ |
48201
|
0 |
0 |
while( (pPage = pNext)!=0 ){ |
48252
|
0 |
0 |
for(pp=&pCache->apHash[h]; (*pp)!=pPage; pp=&(*pp)->pNext); |
48256
|
0 |
0 |
if( freeFlag ) pcache1FreePage(pPage); |
48267
|
0 |
561 |
while( pGroup->nPurgeable>pGroup->nMaxPage |
48268
|
0 |
0 |
&& (p=pGroup->lru.pLruPrev)->isAnchor==0 |
48275
|
514 |
47 |
if( pCache->nPage==0 && pCache->pBulk ){ |
|
51 |
463 |
if( pCache->nPage==0 && pCache->pBulk ){ |
48297
|
254 |
0 |
if( pCache->iMaxKey - iLimit < pCache->nHash ){ |
48316
|
623 |
639 |
while( (pPage = *pp)!=0 ){ |
48317
|
623 |
0 |
if( pPage->iKey>=iLimit ){ |
48320
|
154 |
469 |
if( PAGE_IS_UNPINNED(pPage) ) pcache1PinPage(pPage); |
48327
|
254 |
385 |
if( h==iStop ) break; |
48374
|
103 |
0 |
if( pcache1.separateCache |
48375
|
103 |
0 |
&& sqlite3GlobalConfig.nPage!=0 |
48376
|
103 |
0 |
&& sqlite3GlobalConfig.pPage==0 |
48416
|
306 |
0 |
if( pCache ){ |
48417
|
306 |
0 |
if( pcache1.separateCache ){ |
48423
|
306 |
0 |
if( pGroup->lru.isAnchor==0 ){ |
48434
|
105 |
201 |
if( bPurgeable ){ |
48444
|
0 |
306 |
if( pCache->nHash==0 ){ |
48459
|
257 |
550 |
if( pCache->bPurgeable ){ |
48478
|
0 |
0 |
if( pCache->bPurgeable ){ |
48525
|
57 |
570 |
if( createFlag==1 && ( |
|
57 |
0 |
if( createFlag==1 && ( |
48527
|
57 |
0 |
|| nPinned>=pCache->n90pct |
48528
|
0 |
57 |
|| (pcache1UnderMemoryPressure(pCache) && pCache->nRecyclable
|
|
0 |
0 |
|| (pcache1UnderMemoryPressure(pCache) && pCache->nRecyclable
|
48533
|
0 |
627 |
if( pCache->nPage>=pCache->nHash ) pcache1ResizeHash(pCache); |
48537
|
158 |
469 |
if( pCache->bPurgeable |
48538
|
40 |
118 |
&& !pGroup->lru.pLruPrev->isAnchor |
48539
|
40 |
0 |
&& ((pCache->nPage+1>=pCache->nMax) || pcache1UnderMemoryPressure(pCache)) |
|
0 |
40 |
&& ((pCache->nPage+1>=pCache->nMax) || pcache1UnderMemoryPressure(pCache)) |
48547
|
0 |
0 |
if( pOther->szAlloc != pCache->szAlloc ){ |
48558
|
627 |
0 |
if( !pPage ){ |
48562
|
627 |
0 |
if( pPage ){ |
48572
|
619 |
8 |
if( iKey>pCache->iMaxKey ){ |
48648
|
9051 |
627 |
while( pPage && pPage->iKey!=iKey ){ pPage = pPage->pNext; } |
|
0 |
9051 |
while( pPage && pPage->iKey!=iKey ){ pPage = pPage->pNext; } |
48654
|
9051 |
627 |
if( pPage ){ |
48655
|
552 |
8499 |
if( PAGE_IS_UNPINNED(pPage) ){ |
48660
|
627 |
0 |
}else if( createFlag ){ |
48732
|
710 |
0 |
if( reuseUnlikely || pGroup->nPurgeable>pGroup->nMaxPage ){ |
|
0 |
710 |
if( reuseUnlikely || pGroup->nPurgeable>pGroup->nMaxPage ){ |
48766
|
0 |
0 |
while( (*pp)!=pPage ){ |
48775
|
0 |
0 |
if( iNew>pCache->iMaxKey ){ |
48792
|
254 |
1102 |
if( iLimit<=pCache->iMaxKey ){ |
48809
|
0 |
304 |
if( pCache->nPage ) pcache1TruncateUnsafe(pCache, 0); |
49080
|
0 |
13 |
for(pChunk=p->pChunk; pChunk; pChunk = pNextChunk){ |
49102
|
0 |
13 |
if( p->nFresh==0 ){ /*OPTIMIZATION-IF-FALSE*/ |
49107
|
0 |
0 |
if( pNew==0 ){ |
49133
|
0 |
13 |
if( pEntry==0 ) return; |
49137
|
6 |
7 |
if( pLast ){ |
49138
|
0 |
6 |
if( rowid<=pLast->v ){ /*OPTIMIZATION-IF-FALSE*/ |
49168
|
0 |
0 |
if( pA->v<=pB->v ){ |
49169
|
0 |
0 |
if( pA->vv ) pTail = pTail->pRight = pA; |
49171
|
0 |
0 |
if( pA==0 ){ |
49178
|
0 |
0 |
if( pB==0 ){ |
49196
|
0 |
0 |
while( pIn ){ |
49199
|
0 |
0 |
for(i=0; aBucket[i]; i++){ |
49207
|
0 |
0 |
for(i=1; i
|
49208
|
0 |
0 |
if( aBucket[i]==0 ) continue; |
49209
|
0 |
0 |
pIn = pIn ? rowSetEntryMerge(pIn, aBucket[i]) : aBucket[i]; |
49226
|
0 |
0 |
if( pIn->pLeft ){ |
49233
|
0 |
0 |
if( pIn->pRight ){ |
49261
|
0 |
0 |
if( *ppList==0 ){ /*OPTIMIZATION-IF-TRUE*/ |
49265
|
0 |
0 |
if( iDepth>1 ){ /*OPTIMIZATION-IF-TRUE*/ |
49271
|
0 |
0 |
if( p==0 ){ /*OPTIMIZATION-IF-FALSE*/ |
49300
|
0 |
0 |
for(iDepth=1; pList; iDepth++){ |
49328
|
6 |
0 |
if( (p->rsFlags & ROWSET_NEXT)==0 ){ /*OPTIMIZATION-IF-FALSE*/ |
49329
|
0 |
6 |
if( (p->rsFlags & ROWSET_SORTED)==0 ){ /*OPTIMIZATION-IF-FALSE*/ |
49336
|
3 |
3 |
if( p->pEntry ){ |
49339
|
3 |
0 |
if( p->pEntry==0 ){ /*OPTIMIZATION-IF-TRUE*/ |
49366
|
6 |
6 |
if( iBatch!=pRowSet->iBatch ){ /*OPTIMIZATION-IF-FALSE*/ |
49368
|
0 |
6 |
if( p ){ |
49370
|
0 |
0 |
if( (pRowSet->rsFlags & ROWSET_SORTED)==0 ){ /*OPTIMIZATION-IF-FALSE*/ |
49374
|
0 |
0 |
for(pTree = pRowSet->pForest; pTree; pTree=pTree->pRight){ |
49376
|
0 |
0 |
if( pTree->pLeft==0 ){ |
49386
|
0 |
0 |
if( pTree==0 ){ |
49388
|
0 |
0 |
if( pTree ){ |
49404
|
0 |
12 |
for(pTree = pRowSet->pForest; pTree; pTree=pTree->pRight){ |
49406
|
0 |
0 |
while( p ){ |
49407
|
0 |
0 |
if( p->v
|
49409
|
0 |
0 |
}else if( p->v>iRowid ){ |
50627
|
0 |
625 |
if( pPager->errCode ){ |
50630
|
0 |
625 |
}else if( USEFETCH(pPager) |
50632
|
0 |
0 |
&& pPager->xCodec==0 |
50656
|
3 |
2 |
for(i=0; inSavepoint; i++){ |
50658
|
3 |
0 |
if( p->nOrig>=pgno && 0==sqlite3BitvecTestNotNull(p->pInSavepoint, pgno) ){ |
|
1 |
2 |
if( p->nOrig>=pgno && 0==sqlite3BitvecTestNotNull(p->pInSavepoint, pgno) ){ |
50684
|
274 |
0 |
if( rc==SQLITE_OK ){ |
50721
|
538 |
201 |
if( isOpen(pPager->fd) ){ |
50723
|
538 |
0 |
rc = pPager->noLock ? SQLITE_OK : sqlite3OsUnlock(pPager->fd, eLock); |
50724
|
538 |
0 |
if( pPager->eLock!=UNKNOWN_LOCK ){ |
50746
|
1939 |
707 |
if( pPager->eLockeLock==UNKNOWN_LOCK ){ |
|
0 |
1939 |
if( pPager->eLockeLock==UNKNOWN_LOCK ){ |
50747
|
707 |
0 |
rc = pPager->noLock ? SQLITE_OK : sqlite3OsLock(pPager->fd, eLock); |
50748
|
529 |
178 |
if( rc==SQLITE_OK && (pPager->eLock!=UNKNOWN_LOCK||eLock==EXCLUSIVE_LOCK) ){ |
|
0 |
529 |
if( rc==SQLITE_OK && (pPager->eLock!=UNKNOWN_LOCK||eLock==EXCLUSIVE_LOCK) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && (pPager->eLock!=UNKNOWN_LOCK||eLock==EXCLUSIVE_LOCK) ){ |
50889
|
62 |
0 |
if( SQLITE_OK!=(rc = sqlite3OsFileSize(pJrnl, &szJ)) |
50890
|
62 |
0 |
|| szJ<16 |
50891
|
62 |
0 |
|| SQLITE_OK!=(rc = read32bits(pJrnl, szJ-16, &len)) |
50892
|
36 |
26 |
|| len>=nMaster |
50893
|
36 |
0 |
|| len>szJ-16 |
50894
|
0 |
36 |
|| len==0 |
50895
|
0 |
0 |
|| SQLITE_OK!=(rc = read32bits(pJrnl, szJ-12, &cksum)) |
50896
|
0 |
0 |
|| SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, aMagic, 8, szJ-8)) |
50897
|
0 |
0 |
|| memcmp(aMagic, aJournalMagic, 8) |
50898
|
0 |
0 |
|| SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, zMaster, len, szJ-16-len)) |
50904
|
0 |
0 |
for(u=0; u
|
50907
|
0 |
0 |
if( cksum ){ |
50938
|
120 |
1028 |
if( c ){ |
50972
|
0 |
0 |
if( pPager->journalOff ){ |
50976
|
0 |
0 |
if( doTruncate || iLimit==0 ){ |
|
0 |
0 |
if( doTruncate || iLimit==0 ){ |
50982
|
0 |
0 |
if( rc==SQLITE_OK && !pPager->noSync ){ |
|
0 |
0 |
if( rc==SQLITE_OK && !pPager->noSync ){ |
50992
|
0 |
0 |
if( rc==SQLITE_OK && iLimit>0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && iLimit>0 ){ |
50995
|
0 |
0 |
if( rc==SQLITE_OK && sz>iLimit ){ |
|
0 |
0 |
if( rc==SQLITE_OK && sz>iLimit ){ |
51027
|
997 |
0 |
if( nHeader>JOURNAL_HDR_SZ(pPager) ){ |
51035
|
0 |
997 |
for(ii=0; iinSavepoint; ii++){ |
51036
|
0 |
0 |
if( pPager->aSavepoint[ii].iHdrOffset==0 ){ |
51064
|
91 |
906 |
if( pPager->noSync || (pPager->journalMode==PAGER_JOURNALMODE_MEMORY) |
|
91 |
0 |
if( pPager->noSync || (pPager->journalMode==PAGER_JOURNALMODE_MEMORY) |
51065
|
0 |
91 |
|| (sqlite3OsDeviceCharacteristics(pPager->fd)&SQLITE_IOCAP_SAFE_APPEND) |
51109
|
1994 |
0 |
for(nWrite=0; rc==SQLITE_OK&&nWrite
|
|
997 |
997 |
for(nWrite=0; rc==SQLITE_OK&&nWrite
|
51154
|
31 |
31 |
if( pPager->journalOff+JOURNAL_HDR_SZ(pPager) > journalSize ){ |
51164
|
31 |
0 |
if( isHot || iHdrOff!=pPager->journalHdr ){ |
|
0 |
31 |
if( isHot || iHdrOff!=pPager->journalHdr ){ |
51166
|
0 |
0 |
if( rc ){ |
51169
|
0 |
0 |
if( memcmp(aMagic, aJournalMagic, sizeof(aMagic))!=0 ){ |
51178
|
31 |
0 |
if( SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+8, pNRec)) |
51179
|
31 |
0 |
|| SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+12, &pPager->cksumInit)) |
51180
|
0 |
31 |
|| SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+16, pDbSize)) |
51185
|
31 |
0 |
if( pPager->journalOff==0 ){ |
51190
|
31 |
0 |
if( SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+20, &iSectorSize)) |
51191
|
0 |
31 |
|| SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+24, &iPageSize)) |
51200
|
0 |
31 |
if( iPageSize==0 ){ |
51209
|
31 |
0 |
if( iPageSize<512 || iSectorSize<32 |
|
31 |
0 |
if( iPageSize<512 || iSectorSize<32 |
51210
|
31 |
0 |
|| iPageSize>SQLITE_MAX_PAGE_SIZE || iSectorSize>MAX_SECTOR_SIZE |
|
31 |
0 |
|| iPageSize>SQLITE_MAX_PAGE_SIZE || iSectorSize>MAX_SECTOR_SIZE |
51211
|
31 |
0 |
|| ((iPageSize-1)&iPageSize)!=0 || ((iSectorSize-1)&iSectorSize)!=0 |
|
0 |
31 |
|| ((iPageSize-1)&iPageSize)!=0 || ((iSectorSize-1)&iSectorSize)!=0 |
51271
|
0 |
89 |
if( !zMaster |
51272
|
0 |
0 |
|| pPager->journalMode==PAGER_JOURNALMODE_MEMORY |
51273
|
0 |
0 |
|| !isOpen(pPager->jfd) |
51281
|
0 |
0 |
for(nMaster=0; zMaster[nMaster]; nMaster++){ |
51289
|
0 |
0 |
if( pPager->fullSync ){ |
51297
|
0 |
0 |
if( (0 != (rc = write32bits(pPager->jfd, iHdrOff, PAGER_MJ_PGNO(pPager)))) |
51298
|
0 |
0 |
|| (0 != (rc = sqlite3OsWrite(pPager->jfd, zMaster, nMaster, iHdrOff+4))) |
51299
|
0 |
0 |
|| (0 != (rc = write32bits(pPager->jfd, iHdrOff+4+nMaster, nMaster))) |
51300
|
0 |
0 |
|| (0 != (rc = write32bits(pPager->jfd, iHdrOff+4+nMaster+4, cksum))) |
51301
|
0 |
0 |
|| (0 != (rc = sqlite3OsWrite(pPager->jfd, aJournalMagic, 8, |
51318
|
0 |
0 |
if( SQLITE_OK==(rc = sqlite3OsFileSize(pPager->jfd, &jrnlSize)) |
51319
|
0 |
0 |
&& jrnlSize>pPager->journalOff |
51350
|
1 |
3536 |
for(ii=0; iinSavepoint; ii++){ |
51353
|
2797 |
739 |
if( !pPager->exclusiveMode || sqlite3JournalIsInMemory(pPager->sjfd) ){ |
|
1 |
2796 |
if( !pPager->exclusiveMode || sqlite3JournalIsInMemory(pPager->sjfd) ){ |
51371
|
1 |
1534 |
for(ii=0; iinSavepoint; ii++){ |
51373
|
1 |
0 |
if( pgno<=p->nOrig ){ |
51410
|
0 |
2495 |
if( pagerUseWal(pPager) ){ |
51414
|
641 |
1854 |
}else if( !pPager->exclusiveMode ){ |
51416
|
440 |
201 |
int iDc = isOpen(pPager->fd)?sqlite3OsDeviceCharacteristics(pPager->fd):0; |
51429
|
0 |
641 |
if( 0==(iDc & SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN) |
51430
|
0 |
0 |
|| 1!=(pPager->journalMode & 5) |
51441
|
0 |
641 |
if( rc!=SQLITE_OK && pPager->eState==PAGER_ERROR ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && pPager->eState==PAGER_ERROR ){ |
51460
|
0 |
2495 |
if( pPager->errCode ){ |
51461
|
0 |
0 |
if( pPager->tempFile==0 ){ |
51468
|
0 |
0 |
if( USEFETCH(pPager) ) sqlite3OsUnfetch(pPager->fd, 0, 0); |
51505
|
1041 |
0 |
if( rc2==SQLITE_FULL || rc2==SQLITE_IOERR ){ |
|
0 |
1041 |
if( rc2==SQLITE_FULL || rc2==SQLITE_IOERR ){ |
51532
|
187 |
877 |
if( pPager->tempFile==0 ) return 1; |
51533
|
0 |
877 |
if( !bCommit ) return 0; |
51534
|
877 |
0 |
if( !isOpen(pPager->fd) ) return 0; |
51610
|
335 |
1041 |
if( pPager->eStateeLock
|
|
335 |
0 |
if( pPager->eStateeLock
|
51618
|
997 |
44 |
if( isOpen(pPager->jfd) ){ |
51622
|
906 |
91 |
if( sqlite3JournalIsInMemory(pPager->jfd) ){ |
51625
|
0 |
91 |
}else if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE ){ |
51626
|
0 |
0 |
if( pPager->journalOff==0 ){ |
51630
|
0 |
0 |
if( rc==SQLITE_OK && pPager->fullSync ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pPager->fullSync ){ |
51640
|
91 |
0 |
}else if( pPager->journalMode==PAGER_JOURNALMODE_PERSIST |
51641
|
0 |
91 |
|| (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL) |
|
0 |
0 |
|| (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL) |
51643
|
0 |
0 |
rc = zeroJournalHdr(pPager, hasMaster||pPager->tempFile); |
|
0 |
0 |
rc = zeroJournalHdr(pPager, hasMaster||pPager->tempFile); |
51658
|
91 |
0 |
if( bDelete ){ |
51678
|
1041 |
0 |
if( rc==SQLITE_OK ){ |
51679
|
98 |
943 |
if( MEMDB || pagerFlushOnCommit(pPager, bCommit) ){ |
|
98 |
0 |
if( MEMDB || pagerFlushOnCommit(pPager, bCommit) ){ |
51687
|
0 |
1041 |
if( pagerUseWal(pPager) ){ |
51694
|
1041 |
0 |
}else if( rc==SQLITE_OK && bCommit && pPager->dbFileSize>pPager->dbSize ){ |
|
989 |
52 |
}else if( rc==SQLITE_OK && bCommit && pPager->dbFileSize>pPager->dbSize ){ |
|
0 |
989 |
}else if( rc==SQLITE_OK && bCommit && pPager->dbFileSize>pPager->dbSize ){ |
51705
|
1041 |
0 |
if( rc==SQLITE_OK && bCommit ){ |
|
989 |
52 |
if( rc==SQLITE_OK && bCommit ){ |
51707
|
989 |
0 |
if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK; |
51710
|
98 |
943 |
if( !pPager->exclusiveMode |
51711
|
0 |
98 |
&& (!pagerUseWal(pPager) || sqlite3WalExclusiveMode(pPager->pWal, 0)) |
|
0 |
0 |
&& (!pagerUseWal(pPager) || sqlite3WalExclusiveMode(pPager->pWal, 0)) |
51719
|
1041 |
0 |
return (rc==SQLITE_OK?rc2:rc); |
51740
|
2292 |
0 |
if( pPager->eState!=PAGER_ERROR && pPager->eState!=PAGER_OPEN ){ |
|
2189 |
103 |
if( pPager->eState!=PAGER_ERROR && pPager->eState!=PAGER_OPEN ){ |
51742
|
0 |
2189 |
if( pPager->eState>=PAGER_WRITER_LOCKED ){ |
51746
|
335 |
1854 |
}else if( !pPager->exclusiveMode ){ |
51776
|
24620 |
1231 |
while( i>0 ){ |
51789
|
0 |
707 |
if( pPager->xCodecSizeChng ){ |
51805
|
0 |
0 |
if( pDest->nReserve!=pSrc->nReserve ){ |
51866
|
1 |
28 |
const int jrnlEnc = (isMainJrnl || pPager->subjInMemory==0); |
|
0 |
1 |
const int jrnlEnc = (isMainJrnl || pPager->subjInMemory==0); |
51892
|
28 |
1 |
jfd = isMainJrnl ? pPager->jfd : pPager->sjfd; |
51894
|
0 |
29 |
if( rc!=SQLITE_OK ) return rc; |
51896
|
0 |
29 |
if( rc!=SQLITE_OK ) return rc; |
51904
|
29 |
0 |
if( pgno==0 || pgno==PAGER_MJ_PGNO(pPager) ){ |
|
0 |
29 |
if( pgno==0 || pgno==PAGER_MJ_PGNO(pPager) ){ |
51908
|
29 |
0 |
if( pgno>(Pgno)pPager->dbSize || sqlite3BitvecTest(pDone, pgno) ){ |
|
0 |
29 |
if( pgno>(Pgno)pPager->dbSize || sqlite3BitvecTest(pDone, pgno) ){ |
51911
|
28 |
1 |
if( isMainJrnl ){ |
51913
|
0 |
28 |
if( rc ) return rc; |
51914
|
28 |
0 |
if( !isSavepnt && pager_cksum(pPager, (u8*)aData)!=cksum ){ |
|
0 |
28 |
if( !isSavepnt && pager_cksum(pPager, (u8*)aData)!=cksum ){ |
51922
|
1 |
28 |
if( pDone && (rc = sqlite3BitvecSet(pDone, pgno))!=SQLITE_OK ){ |
|
0 |
1 |
if( pDone && (rc = sqlite3BitvecSet(pDone, pgno))!=SQLITE_OK ){ |
51928
|
1 |
28 |
if( pgno==1 && pPager->nReserve!=((u8*)aData)[20] ){ |
|
0 |
1 |
if( pgno==1 && pPager->nReserve!=((u8*)aData)[20] ){ |
51968
|
0 |
29 |
if( pagerUseWal(pPager) ){ |
51979
|
28 |
1 |
if( isMainJrnl ){ |
51980
|
2 |
26 |
isSynced = pPager->noSync || (*pOffset <= pPager->journalHdr); |
|
0 |
2 |
isSynced = pPager->noSync || (*pOffset <= pPager->journalHdr); |
51982
|
1 |
0 |
isSynced = (pPg==0 || 0==(pPg->flags & PGHDR_NEED_SYNC)); |
|
0 |
1 |
isSynced = (pPg==0 || 0==(pPg->flags & PGHDR_NEED_SYNC)); |
51984
|
2 |
27 |
if( isOpen(pPager->fd) |
51985
|
2 |
0 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) |
|
0 |
2 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) |
51986
|
0 |
0 |
&& isSynced |
51999
|
0 |
0 |
if( !jrnlEnc ){ |
52000
|
0 |
0 |
CODEC2(pPager, aData, pgno, 7, rc=SQLITE_NOMEM_BKPT, aData); |
|
0 |
0 |
CODEC2(pPager, aData, pgno, 7, rc=SQLITE_NOMEM_BKPT, aData); |
52002
|
0 |
0 |
CODEC1(pPager, aData, pgno, 3, rc=SQLITE_NOMEM_BKPT); |
|
0 |
0 |
CODEC1(pPager, aData, pgno, 3, rc=SQLITE_NOMEM_BKPT); |
52007
|
0 |
0 |
if( pgno>pPager->dbFileSize ){ |
52010
|
0 |
0 |
if( pPager->pBackup ){ |
52012
|
0 |
0 |
if( jrnlEnc ){ |
52013
|
0 |
0 |
CODEC1(pPager, aData, pgno, 3, rc=SQLITE_NOMEM_BKPT); |
|
0 |
0 |
CODEC1(pPager, aData, pgno, 3, rc=SQLITE_NOMEM_BKPT); |
52015
|
0 |
0 |
CODEC2(pPager, aData, pgno, 7, rc=SQLITE_NOMEM_BKPT,aData); |
|
0 |
0 |
CODEC2(pPager, aData, pgno, 7, rc=SQLITE_NOMEM_BKPT,aData); |
52020
|
1 |
28 |
}else if( !isMainJrnl && pPg==0 ){ |
|
0 |
1 |
}else if( !isMainJrnl && pPg==0 ){ |
52043
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
52046
|
29 |
0 |
if( pPg ){ |
52065
|
1 |
28 |
if( pgno==1 ){ |
52071
|
28 |
1 |
if( jrnlEnc ){ CODEC1(pPager, pData, pPg->pgno, 3, rc=SQLITE_NOMEM_BKPT); } |
|
0 |
28 |
if( jrnlEnc ){ CODEC1(pPager, pData, pPg->pgno, 3, rc=SQLITE_NOMEM_BKPT); } |
|
0 |
0 |
if( jrnlEnc ){ CODEC1(pPager, pData, pPg->pgno, 3, rc=SQLITE_NOMEM_BKPT); } |
52137
|
0 |
0 |
if( !pMaster ){ |
52143
|
0 |
0 |
if( rc!=SQLITE_OK ) goto delmaster_out; |
52151
|
0 |
0 |
if( rc!=SQLITE_OK ) goto delmaster_out; |
52154
|
0 |
0 |
if( !zMasterJournal ){ |
52160
|
0 |
0 |
if( rc!=SQLITE_OK ) goto delmaster_out; |
52164
|
0 |
0 |
while( (zJournal-zMasterJournal)
|
52167
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
52170
|
0 |
0 |
if( exists ){ |
52178
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
52184
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
52188
|
0 |
0 |
c = zMasterPtr[0]!=0 && strcmp(zMasterPtr, zMaster)==0; |
|
0 |
0 |
c = zMasterPtr[0]!=0 && strcmp(zMasterPtr, zMaster)==0; |
52189
|
0 |
0 |
if( c ){ |
52202
|
0 |
0 |
if( pMaster ){ |
52236
|
2 |
29 |
if( isOpen(pPager->fd) |
52237
|
2 |
0 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) |
|
0 |
2 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) |
52245
|
0 |
0 |
if( rc==SQLITE_OK && currentSize!=newSize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && currentSize!=newSize ){ |
52246
|
0 |
0 |
if( currentSize>newSize ){ |
52248
|
0 |
0 |
}else if( (currentSize+szPage)<=newSize ){ |
52255
|
0 |
0 |
if( rc==SQLITE_OK ){ |
52269
|
0 |
0 |
if( iRet<32 ){ |
52271
|
0 |
0 |
}else if( iRet>MAX_SECTOR_SIZE ){ |
52304
|
209 |
230 |
if( pPager->tempFile |
52305
|
209 |
0 |
|| (sqlite3OsDeviceCharacteristics(pPager->fd) & |
52392
|
0 |
31 |
if( rc!=SQLITE_OK ){ |
52409
|
31 |
0 |
if( rc==SQLITE_OK && zMaster[0] ){ |
|
0 |
31 |
if( rc==SQLITE_OK && zMaster[0] ){ |
52413
|
31 |
0 |
if( rc!=SQLITE_OK || !res ){ |
|
31 |
0 |
if( rc!=SQLITE_OK || !res ){ |
52430
|
31 |
31 |
if( rc!=SQLITE_OK ){ |
52431
|
31 |
0 |
if( rc==SQLITE_DONE ){ |
52442
|
29 |
2 |
if( nRec==0xffffffff ){ |
52461
|
7 |
24 |
if( nRec==0 && !isHot && |
|
7 |
0 |
if( nRec==0 && !isHot && |
|
7 |
0 |
if( nRec==0 && !isHot && |
52469
|
31 |
0 |
if( pPager->journalOff==JOURNAL_HDR_SZ(pPager) ){ |
52471
|
0 |
31 |
if( rc!=SQLITE_OK ){ |
52480
|
28 |
31 |
for(u=0; u
|
52481
|
0 |
28 |
if( needPagerReset ){ |
52486
|
28 |
0 |
if( rc==SQLITE_OK ){ |
52489
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
52492
|
0 |
0 |
}else if( rc==SQLITE_IOERR_SHORT_READ ){ |
52515
|
31 |
0 |
if( rc==SQLITE_OK ){ |
52538
|
31 |
0 |
if( rc==SQLITE_OK ){ |
52543
|
31 |
0 |
if( rc==SQLITE_OK |
52544
|
31 |
0 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) |
|
0 |
31 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) |
52548
|
31 |
0 |
if( rc==SQLITE_OK ){ |
52552
|
31 |
0 |
if( rc==SQLITE_OK && zMaster[0] && res ){ |
|
0 |
31 |
if( rc==SQLITE_OK && zMaster[0] && res ){ |
|
0 |
0 |
if( rc==SQLITE_OK && zMaster[0] && res ){ |
52559
|
0 |
31 |
if( isHot && nPlayback ){ |
|
0 |
0 |
if( isHot && nPlayback ){ |
52595
|
0 |
88 |
if( pagerUseWal(pPager) ){ |
52597
|
0 |
0 |
if( rc ) return rc; |
52599
|
0 |
88 |
if( iFrame ){ |
52606
|
0 |
88 |
if( rc==SQLITE_IOERR_SHORT_READ ){ |
52611
|
45 |
43 |
if( pPg->pgno==1 ){ |
52612
|
0 |
45 |
if( rc ){ |
52631
|
0 |
88 |
CODEC1(pPager, pPg->pData, pPg->pgno, 3, rc = SQLITE_NOMEM_BKPT); |
|
0 |
0 |
CODEC1(pPager, pPg->pData, pPg->pgno, 3, rc = SQLITE_NOMEM_BKPT); |
52684
|
0 |
0 |
if( pPg ){ |
52685
|
0 |
0 |
if( sqlite3PcachePageRefcount(pPg)==1 ){ |
52689
|
0 |
0 |
if( rc==SQLITE_OK ){ |
52726
|
0 |
0 |
while( pList && rc==SQLITE_OK ){ |
|
0 |
0 |
while( pList && rc==SQLITE_OK ){ |
52764
|
0 |
0 |
if( isCommit ){ |
52771
|
0 |
0 |
for(p=pList; (*ppNext = p)!=0; p=p->pDirty){ |
52772
|
0 |
0 |
if( p->pgno<=nTruncate ){ |
52783
|
0 |
0 |
if( pList->pgno==1 ) pager_write_changecounter(pList); |
52787
|
0 |
0 |
if( rc==SQLITE_OK && pPager->pBackup ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pPager->pBackup ){ |
52788
|
0 |
0 |
for(p=pList; p; p=p->pDirty){ |
52826
|
0 |
0 |
if( rc!=SQLITE_OK || changed ){ |
|
0 |
0 |
if( rc!=SQLITE_OK || changed ){ |
52828
|
0 |
0 |
if( USEFETCH(pPager) ) sqlite3OsUnfetch(pPager->fd, 0, 0); |
52864
|
335 |
0 |
if( nPage==0 && ALWAYS(isOpen(pPager->fd)) ){ |
|
335 |
0 |
if( nPage==0 && ALWAYS(isOpen(pPager->fd)) ){ |
52867
|
0 |
335 |
if( rc!=SQLITE_OK ){ |
52877
|
0 |
335 |
if( nPage>pPager->mxPgno ){ |
52909
|
335 |
0 |
if( !pPager->tempFile ){ |
52914
|
335 |
0 |
if( rc==SQLITE_OK ){ |
52915
|
0 |
335 |
if( isWal ){ |
52919
|
0 |
0 |
if( rc ) return rc; |
52920
|
0 |
0 |
if( nPage==0 ){ |
52926
|
0 |
335 |
}else if( pPager->journalMode==PAGER_JOURNALMODE_WAL ){ |
52981
|
1 |
0 |
if( pSavepoint ){ |
52983
|
0 |
1 |
if( !pDone ){ |
52991
|
1 |
0 |
pPager->dbSize = pSavepoint ? pSavepoint->nOrig : pPager->dbOrigSize; |
52994
|
0 |
1 |
if( !pSavepoint && pagerUseWal(pPager) ){ |
|
0 |
0 |
if( !pSavepoint && pagerUseWal(pPager) ){ |
53013
|
1 |
0 |
if( pSavepoint && !pagerUseWal(pPager) ){ |
|
1 |
0 |
if( pSavepoint && !pagerUseWal(pPager) ){ |
53014
|
0 |
1 |
iHdrOff = pSavepoint->iHdrOffset ? pSavepoint->iHdrOffset : szJ; |
53016
|
1 |
0 |
while( rc==SQLITE_OK && pPager->journalOff
|
|
0 |
1 |
while( rc==SQLITE_OK && pPager->journalOff
|
53029
|
1 |
0 |
while( rc==SQLITE_OK && pPager->journalOff
|
|
0 |
1 |
while( rc==SQLITE_OK && pPager->journalOff
|
53041
|
0 |
0 |
if( nJRec==0 |
53042
|
0 |
0 |
&& pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff |
53046
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && iijournalOff
|
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && iijournalOff
|
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && iijournalOff
|
53057
|
1 |
0 |
if( pSavepoint ){ |
53061
|
0 |
1 |
if( pagerUseWal(pPager) ){ |
53064
|
2 |
0 |
for(ii=pSavepoint->iSubRec; rc==SQLITE_OK && iinSubRec; ii++){ |
|
1 |
1 |
for(ii=pSavepoint->iSubRec; rc==SQLITE_OK && iinSubRec; ii++){ |
53072
|
1 |
0 |
if( rc==SQLITE_OK ){ |
53101
|
319 |
694 |
if( isOpen(fd) && fd->pMethods->iVersion>=3 ){ |
|
319 |
0 |
if( isOpen(fd) && fd->pMethods->iVersion>=3 ){ |
53183
|
13 |
0 |
if( pPager->tempFile ){ |
53192
|
13 |
0 |
if( pPager->noSync ){ |
53194
|
0 |
0 |
}else if( pgFlags & PAGER_FULLFSYNC ){ |
53200
|
0 |
13 |
if( pPager->fullSync ){ |
53203
|
0 |
13 |
if( (pgFlags & PAGER_CKPT_FULLFSYNC) && !pPager->noSync ){ |
|
0 |
0 |
if( (pgFlags & PAGER_CKPT_FULLFSYNC) && !pPager->noSync ){ |
53206
|
13 |
0 |
if( pgFlags & PAGER_CACHESPILL ){ |
53336
|
292 |
415 |
if( (pPager->memDb==0 || pPager->dbSize==0) |
|
239 |
53 |
if( (pPager->memDb==0 || pPager->dbSize==0) |
53337
|
645 |
9 |
&& sqlite3PcacheRefCount(pPager->pPCache)==0 |
53338
|
366 |
279 |
&& pageSize && pageSize!=(u32)pPager->pageSize |
|
306 |
60 |
&& pageSize && pageSize!=(u32)pPager->pageSize |
53343
|
201 |
105 |
if( pPager->eState>PAGER_OPEN && isOpen(pPager->fd) ){ |
|
0 |
201 |
if( pPager->eState>PAGER_OPEN && isOpen(pPager->fd) ){ |
53346
|
306 |
0 |
if( rc==SQLITE_OK ){ |
53348
|
0 |
306 |
if( !pNew ) rc = SQLITE_NOMEM_BKPT; |
53351
|
306 |
0 |
if( rc==SQLITE_OK ){ |
53355
|
306 |
0 |
if( rc==SQLITE_OK ){ |
53366
|
707 |
0 |
if( rc==SQLITE_OK ){ |
53367
|
368 |
339 |
if( nReserve<0 ) nReserve = pPager->nReserve; |
53396
|
0 |
0 |
if( mxPage>0 ){ |
53453
|
105 |
201 |
if( isOpen(pPager->fd) ){ |
53456
|
78 |
27 |
if( rc==SQLITE_IOERR_SHORT_READ ){ |
53506
|
26 |
1427 |
}while( rc==SQLITE_BUSY && pPager->xBusyHandler(pPager->pBusyHandlerArg) ); |
|
24 |
2 |
}while( rc==SQLITE_BUSY && pPager->xBusyHandler(pPager->pBusyHandlerArg) ); |
53588
|
0 |
0 |
if( !pPager->noSync ){ |
53591
|
0 |
0 |
if( rc==SQLITE_OK ){ |
53616
|
0 |
0 |
if( pPager->pMmapFreelist ){ |
53624
|
0 |
0 |
if( p==0 ){ |
53668
|
0 |
304 |
for(p=pPager->pMmapFreelist; p; p=pNext){ |
53683
|
201 |
194 |
if( pPager->tempFile ) return SQLITE_OK; |
53684
|
71 |
123 |
if( pPager->dbSize==0 ) return SQLITE_OK; |
53687
|
0 |
123 |
if( rc==SQLITE_NOTFOUND ){ |
53692
|
123 |
0 |
}else if( rc==SQLITE_OK && bHasMoved ){ |
|
0 |
123 |
}else if( rc==SQLITE_OK && bHasMoved ){ |
53726
|
304 |
0 |
if( db && 0==(db->flags & SQLITE_NoCkptOnClose) |
|
304 |
0 |
if( db && 0==(db->flags & SQLITE_NoCkptOnClose) |
53727
|
304 |
0 |
&& SQLITE_OK==databaseIsUnmoved(pPager) |
53736
|
201 |
103 |
if( MEMDB ){ |
53750
|
0 |
103 |
if( isOpen(pPager->jfd) ){ |
53765
|
0 |
304 |
if( pPager->xCodecFree ) pPager->xCodecFree(pPager->pCodec); |
53836
|
0 |
89 |
if( rc!=SQLITE_OK ) return rc; |
53838
|
89 |
0 |
if( !pPager->noSync ){ |
53840
|
89 |
0 |
if( isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_MEMORY ){ |
|
89 |
0 |
if( isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_MEMORY ){ |
53844
|
89 |
0 |
if( 0==(iDc&SQLITE_IOCAP_SAFE_APPEND) ){ |
53876
|
0 |
89 |
if( rc==SQLITE_OK && 0==memcmp(aMagic, aJournalMagic, 8) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && 0==memcmp(aMagic, aJournalMagic, 8) ){ |
53880
|
89 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_IOERR_SHORT_READ ){ |
|
0 |
89 |
if( rc!=SQLITE_OK && rc!=SQLITE_IOERR_SHORT_READ ){ |
53895
|
89 |
0 |
if( pPager->fullSync && 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){ |
|
89 |
0 |
if( pPager->fullSync && 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){ |
53899
|
0 |
89 |
if( rc!=SQLITE_OK ) return rc; |
53905
|
0 |
89 |
if( rc!=SQLITE_OK ) return rc; |
53907
|
89 |
0 |
if( 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){ |
53911
|
0 |
89 |
(pPager->syncFlags==SQLITE_SYNC_FULL?SQLITE_SYNC_DATAONLY:0) |
53913
|
0 |
89 |
if( rc!=SQLITE_OK ) return rc; |
53917
|
0 |
89 |
if( newHdr && 0==(iDc&SQLITE_IOCAP_SAFE_APPEND) ){ |
|
0 |
0 |
if( newHdr && 0==(iDc&SQLITE_IOCAP_SAFE_APPEND) ){ |
53920
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
53982
|
0 |
89 |
if( !isOpen(pPager->fd) ){ |
53991
|
89 |
0 |
if( rc==SQLITE_OK |
53992
|
29 |
60 |
&& pPager->dbHintSizedbSize |
53993
|
1 |
28 |
&& (pList->pDirty || pList->pgno>pPager->dbHintSize) |
|
1 |
0 |
&& (pList->pDirty || pList->pgno>pPager->dbHintSize) |
54000
|
302 |
0 |
while( rc==SQLITE_OK && pList ){ |
|
213 |
89 |
while( rc==SQLITE_OK && pList ){ |
54011
|
213 |
0 |
if( pgno<=pPager->dbSize && 0==(pList->flags&PGHDR_DONT_WRITE) ){ |
|
212 |
1 |
if( pgno<=pPager->dbSize && 0==(pList->flags&PGHDR_DONT_WRITE) ){ |
54016
|
89 |
123 |
if( pList->pgno==1 ) pager_write_changecounter(pList); |
54019
|
212 |
0 |
CODEC2(pPager, pList->pData, pgno, 6, return SQLITE_NOMEM_BKPT, pData); |
|
0 |
0 |
CODEC2(pPager, pList->pData, pgno, 6, return SQLITE_NOMEM_BKPT, pData); |
54028
|
89 |
123 |
if( pgno==1 ){ |
54031
|
70 |
142 |
if( pgno>pPager->dbFileSize ){ |
54063
|
1 |
0 |
if( !isOpen(pPager->sjfd) ){ |
54068
|
0 |
1 |
if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){ |
|
0 |
0 |
if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){ |
54090
|
1 |
0 |
if( pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ |
54104
|
1 |
0 |
if( rc==SQLITE_OK ){ |
54110
|
0 |
1 |
if( !pPager->subjInMemory ){ |
54111
|
0 |
0 |
CODEC2(pPager, pData, pPg->pgno, 7, return SQLITE_NOMEM_BKPT, pData2); |
|
0 |
0 |
CODEC2(pPager, pData, pPg->pgno, 7, return SQLITE_NOMEM_BKPT, pData2); |
54117
|
1 |
0 |
if( rc==SQLITE_OK ){ |
54122
|
1 |
0 |
if( rc==SQLITE_OK ){ |
54130
|
1 |
2 |
if( subjRequiresPage(pPg) ){ |
54179
|
0 |
0 |
if( NEVER(pPager->errCode) ) return SQLITE_OK; |
54183
|
0 |
0 |
if( pPager->doNotSpill |
54184
|
0 |
0 |
&& ((pPager->doNotSpill & (SPILLFLAG_ROLLBACK|SPILLFLAG_OFF))!=0 |
54185
|
0 |
0 |
|| (pPg->flags & PGHDR_NEED_SYNC)!=0) |
54192
|
0 |
0 |
if( pagerUseWal(pPager) ){ |
54195
|
0 |
0 |
if( rc==SQLITE_OK ){ |
54208
|
0 |
0 |
if( pPg->flags&PGHDR_NEED_SYNC |
54209
|
0 |
0 |
|| pPager->eState==PAGER_WRITER_CACHEMOD |
54215
|
0 |
0 |
if( rc==SQLITE_OK ){ |
54222
|
0 |
0 |
if( rc==SQLITE_OK ){ |
54235
|
0 |
0 |
if( !MEMDB ){ |
54238
|
0 |
0 |
while( rc==SQLITE_OK && pList ){ |
|
0 |
0 |
while( rc==SQLITE_OK && pList ){ |
54240
|
0 |
0 |
if( pList->nRef==0 ){ |
54319
|
201 |
111 |
if( flags & PAGER_MEMORY ){ |
54321
|
162 |
39 |
if( zFilename && zFilename[0] ){ |
|
159 |
3 |
if( zFilename && zFilename[0] ){ |
54323
|
0 |
159 |
if( zPathname==0 ) return SQLITE_NOMEM_BKPT; |
54334
|
114 |
198 |
if( zFilename && zFilename[0] ){ |
|
111 |
3 |
if( zFilename && zFilename[0] ){ |
54338
|
0 |
111 |
if( zPathname==0 ){ |
54345
|
10 |
111 |
while( *z ){ |
54351
|
111 |
0 |
if( rc==SQLITE_OK && nPathname+8>pVfs->mxPathname ){ |
|
0 |
111 |
if( rc==SQLITE_OK && nPathname+8>pVfs->mxPathname ){ |
54360
|
0 |
111 |
if( rc!=SQLITE_OK ){ |
54390
|
0 |
312 |
if( !pPtr ){ |
54403
|
270 |
42 |
if( zPathname ){ |
54407
|
111 |
159 |
if( nUri ) memcpy(&pPager->zFilename[nPathname+1], zUri, nUri); |
54424
|
114 |
198 |
if( zFilename && zFilename[0] ){ |
|
111 |
3 |
if( zFilename && zFilename[0] ){ |
54441
|
105 |
6 |
if( rc==SQLITE_OK ){ |
54443
|
102 |
3 |
if( !readOnly ){ |
54446
|
0 |
102 |
if( szPageDfltsectorSize ){ |
54447
|
0 |
0 |
if( pPager->sectorSize>SQLITE_MAX_DEFAULT_PAGE_SIZE ){ |
54468
|
105 |
0 |
if( (iDc & SQLITE_IOCAP_IMMUTABLE)!=0 |
54469
|
0 |
105 |
|| sqlite3_uri_boolean(zFilename, "immutable", 0) ){ |
54496
|
306 |
6 |
if( rc==SQLITE_OK ){ |
54503
|
306 |
6 |
if( rc==SQLITE_OK ){ |
54506
|
105 |
201 |
rc = sqlite3PcacheOpen(szPageDflt, nExtra, !memDb, |
54512
|
6 |
306 |
if( rc!=SQLITE_OK ){ |
54542
|
105 |
201 |
if( pPager->noSync ){ |
54560
|
8 |
298 |
if( !useJournal ){ |
54562
|
193 |
105 |
}else if( memDb || memJM ){ |
54624
|
335 |
0 |
if( !jrnlOpen ){ |
54627
|
335 |
0 |
if( rc==SQLITE_OK && exists ){ |
|
152 |
183 |
if( rc==SQLITE_OK && exists ){ |
54639
|
152 |
0 |
if( rc==SQLITE_OK && !locked ){ |
|
0 |
152 |
if( rc==SQLITE_OK && !locked ){ |
54644
|
0 |
0 |
if( rc==SQLITE_OK ){ |
54653
|
0 |
0 |
if( nPage==0 && !jrnlOpen ){ |
|
0 |
0 |
if( nPage==0 && !jrnlOpen ){ |
54655
|
0 |
0 |
if( pagerLockDb(pPager, RESERVED_LOCK)==SQLITE_OK ){ |
54657
|
0 |
0 |
if( !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK); |
54667
|
0 |
0 |
if( !jrnlOpen ){ |
54671
|
0 |
0 |
if( rc==SQLITE_OK ){ |
54674
|
0 |
0 |
if( rc==SQLITE_IOERR_SHORT_READ ){ |
54677
|
0 |
0 |
if( !jrnlOpen ){ |
54681
|
0 |
0 |
}else if( rc==SQLITE_CANTOPEN ){ |
54741
|
2191 |
0 |
if( !pagerUseWal(pPager) && pPager->eState==PAGER_OPEN ){ |
|
337 |
1854 |
if( !pagerUseWal(pPager) && pPager->eState==PAGER_OPEN ){ |
54748
|
2 |
335 |
if( rc!=SQLITE_OK ){ |
54756
|
335 |
0 |
if( pPager->eLock<=SHARED_LOCK ){ |
54759
|
0 |
335 |
if( rc!=SQLITE_OK ){ |
54762
|
0 |
335 |
if( bHotJournal ){ |
54763
|
0 |
0 |
if( pPager->readOnly ){ |
54784
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
54801
|
0 |
0 |
if( !isOpen(pPager->jfd) ){ |
54806
|
0 |
0 |
if( rc==SQLITE_OK && bExists ){ |
|
0 |
0 |
if( rc==SQLITE_OK && bExists ){ |
54812
|
0 |
0 |
if( rc==SQLITE_OK && fout&SQLITE_OPEN_READONLY ){ |
|
0 |
0 |
if( rc==SQLITE_OK && fout&SQLITE_OPEN_READONLY ){ |
54827
|
0 |
0 |
if( isOpen(pPager->jfd) ){ |
54830
|
0 |
0 |
if( rc==SQLITE_OK ){ |
54834
|
0 |
0 |
}else if( !pPager->exclusiveMode ){ |
54838
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
54865
|
335 |
0 |
if( !pPager->tempFile && pPager->hasHeldSharedLock ){ |
|
282 |
53 |
if( !pPager->tempFile && pPager->hasHeldSharedLock ){ |
54886
|
12 |
270 |
if( rc!=SQLITE_OK ){ |
54887
|
0 |
12 |
if( rc!=SQLITE_IOERR_SHORT_READ ){ |
54893
|
11 |
271 |
if( memcmp(pPager->dbFileVers, dbFileVers, sizeof(dbFileVers))!=0 ){ |
54902
|
0 |
11 |
if( USEFETCH(pPager) ){ |
54917
|
0 |
2189 |
if( pagerUseWal(pPager) ){ |
54922
|
335 |
1854 |
if( pPager->tempFile==0 && pPager->eState==PAGER_OPEN && rc==SQLITE_OK ){ |
|
335 |
0 |
if( pPager->tempFile==0 && pPager->eState==PAGER_OPEN && rc==SQLITE_OK ){ |
|
335 |
0 |
if( pPager->tempFile==0 && pPager->eState==PAGER_OPEN && rc==SQLITE_OK ){ |
54927
|
2 |
2189 |
if( rc!=SQLITE_OK ){ |
54947
|
2189 |
52 |
if( sqlite3PcacheRefCount(pPager->pPCache)==0 ){ |
55026
|
0 |
9644 |
if( pgno==0 ) return SQLITE_CORRUPT_BKPT; |
55028
|
0 |
9644 |
if( pBase==0 ){ |
55031
|
0 |
0 |
if( rc!=SQLITE_OK ) goto pager_acquire_err; |
55032
|
0 |
0 |
if( pBase==0 ){ |
55043
|
9017 |
627 |
if( pPg->pPager && !noContent ){ |
|
9016 |
1 |
if( pPg->pPager && !noContent ){ |
55057
|
628 |
0 |
if( pgno>PAGER_MAX_PGNO || pgno==PAGER_MJ_PGNO(pPager) ){ |
|
0 |
628 |
if( pgno>PAGER_MAX_PGNO || pgno==PAGER_MJ_PGNO(pPager) ){ |
55065
|
159 |
469 |
if( !isOpen(pPager->fd) || pPager->dbSize
|
|
89 |
70 |
if( !isOpen(pPager->fd) || pPager->dbSize
|
|
1 |
88 |
if( !isOpen(pPager->fd) || pPager->dbSize
|
55066
|
0 |
540 |
if( pgno>pPager->mxPgno ){ |
55070
|
330 |
210 |
if( noContent ){ |
55078
|
1 |
329 |
if( pgno<=pPager->dbOrigSize ){ |
55092
|
0 |
88 |
if( rc!=SQLITE_OK ){ |
55102
|
0 |
0 |
if( pPg ){ |
55127
|
0 |
0 |
&& (pPager->eState==PAGER_READER || (flags & PAGER_GET_READONLY)) |
|
0 |
0 |
&& (pPager->eState==PAGER_READER || (flags & PAGER_GET_READONLY)) |
|
0 |
0 |
&& (pPager->eState==PAGER_READER || (flags & PAGER_GET_READONLY)) |
55139
|
0 |
0 |
if( pgno<=1 && pgno==0 ){ |
|
0 |
0 |
if( pgno<=1 && pgno==0 ){ |
55147
|
0 |
0 |
if( bMmapOk && pagerUseWal(pPager) ){ |
|
0 |
0 |
if( bMmapOk && pagerUseWal(pPager) ){ |
55149
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
55154
|
0 |
0 |
if( bMmapOk && iFrame==0 ){ |
|
0 |
0 |
if( bMmapOk && iFrame==0 ){ |
55159
|
0 |
0 |
if( rc==SQLITE_OK && pData ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pData ){ |
55160
|
0 |
0 |
if( pPager->eState>PAGER_READER || pPager->tempFile ){ |
|
0 |
0 |
if( pPager->eState>PAGER_READER || pPager->tempFile ){ |
55163
|
0 |
0 |
if( pPg==0 ){ |
55168
|
0 |
0 |
if( pPg ){ |
55174
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
55227
|
0 |
29 |
if( pPage==0 ) return 0; |
55246
|
0 |
7408 |
if( pPg->flags & PGHDR_MMAP ){ |
55256
|
418 |
0 |
if( pPg ) sqlite3PagerUnrefNotNull(pPg); |
55302
|
0 |
1005 |
if( NEVER(pPager->errCode) ) return pPager->errCode; |
55304
|
1005 |
0 |
if( !pagerUseWal(pPager) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ |
|
997 |
8 |
if( !pagerUseWal(pPager) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ |
55306
|
0 |
997 |
if( pPager->pInJournal==0 ){ |
55311
|
997 |
0 |
if( !isOpen(pPager->jfd) ){ |
55312
|
906 |
91 |
if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY ){ |
55318
|
0 |
91 |
if( pPager->tempFile ){ |
55329
|
91 |
0 |
if( rc==SQLITE_OK ){ |
55342
|
997 |
0 |
if( rc==SQLITE_OK ){ |
55352
|
0 |
1005 |
if( rc!=SQLITE_OK ){ |
55383
|
0 |
1193 |
if( pPager->errCode ) return pPager->errCode; |
55387
|
1193 |
0 |
if( ALWAYS(pPager->eState==PAGER_READER) ){ |
55390
|
0 |
1193 |
if( pagerUseWal(pPager) ){ |
55394
|
0 |
0 |
if( pPager->exclusiveMode && sqlite3WalExclusiveMode(pPager->pWal, -1) ){ |
|
0 |
0 |
if( pPager->exclusiveMode && sqlite3WalExclusiveMode(pPager->pWal, -1) ){ |
55396
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
55415
|
1041 |
152 |
if( rc==SQLITE_OK && exFlag ){ |
|
10 |
1031 |
if( rc==SQLITE_OK && exFlag ){ |
55420
|
1041 |
152 |
if( rc==SQLITE_OK ){ |
55462
|
1203 |
0 |
CODEC2(pPager, pPg->pData, pPg->pgno, 7, return SQLITE_NOMEM_BKPT, pData2); |
|
0 |
0 |
CODEC2(pPager, pPg->pData, pPg->pgno, 7, return SQLITE_NOMEM_BKPT, pData2); |
55475
|
0 |
1203 |
if( rc!=SQLITE_OK ) return rc; |
55477
|
0 |
1203 |
if( rc!=SQLITE_OK ) return rc; |
55479
|
0 |
1203 |
if( rc!=SQLITE_OK ) return rc; |
55532
|
1005 |
699 |
if( pPager->eState==PAGER_WRITER_LOCKED ){ |
55534
|
0 |
1005 |
if( rc!=SQLITE_OK ) return rc; |
55547
|
1688 |
16 |
if( pPager->pInJournal!=0 |
55548
|
1687 |
1 |
&& sqlite3BitvecTestNotNull(pPager->pInJournal, pPg->pgno)==0 |
55551
|
1203 |
484 |
if( pPg->pgno<=pPager->dbOrigSize ){ |
55553
|
0 |
1203 |
if( rc!=SQLITE_OK ){ |
55557
|
484 |
0 |
if( pPager->eState!=PAGER_WRITER_DBMOD ){ |
55576
|
0 |
1704 |
if( pPager->nSavepoint>0 ){ |
55581
|
500 |
1204 |
if( pPager->dbSizepgno ){ |
55623
|
0 |
0 |
if( pPg->pgno>nPageCount ){ |
55625
|
0 |
0 |
}else if( (pg1+nPagePerSector-1)>nPageCount ){ |
55634
|
0 |
0 |
for(ii=0; ii
|
|
0 |
0 |
for(ii=0; ii
|
55637
|
0 |
0 |
if( pg==pPg->pgno || !sqlite3BitvecTest(pPager->pInJournal, pg) ){ |
|
0 |
0 |
if( pg==pPg->pgno || !sqlite3BitvecTest(pPager->pInJournal, pg) ){ |
55638
|
0 |
0 |
if( pg!=PAGER_MJ_PGNO(pPager) ){ |
55640
|
0 |
0 |
if( rc==SQLITE_OK ){ |
55642
|
0 |
0 |
if( pPage->flags&PGHDR_NEED_SYNC ){ |
55648
|
0 |
0 |
}else if( (pPage = sqlite3PagerLookup(pPager, pg))!=0 ){ |
55649
|
0 |
0 |
if( pPage->flags&PGHDR_NEED_SYNC ){ |
55662
|
0 |
0 |
if( rc==SQLITE_OK && needSync ){ |
|
0 |
0 |
if( rc==SQLITE_OK && needSync ){ |
55664
|
0 |
0 |
for(ii=0; ii
|
55666
|
0 |
0 |
if( pPage ){ |
55697
|
3918 |
1704 |
if( (pPg->flags & PGHDR_WRITEABLE)!=0 && pPager->dbSize>=pPg->pgno ){ |
|
3918 |
0 |
if( (pPg->flags & PGHDR_WRITEABLE)!=0 && pPager->dbSize>=pPg->pgno ){ |
55698
|
3 |
3915 |
if( pPager->nSavepoint ) return subjournalPageIfRequired(pPg); |
55700
|
0 |
1704 |
}else if( pPager->errCode ){ |
55702
|
0 |
1704 |
}else if( pPager->sectorSize > (u32)pPager->pageSize ){ |
55743
|
1 |
0 |
if( !pPager->tempFile && (pPg->flags&PGHDR_DIRTY) && pPager->nSavepoint==0 ){ |
|
1 |
0 |
if( !pPager->tempFile && (pPg->flags&PGHDR_DIRTY) && pPager->nSavepoint==0 ){ |
|
1 |
0 |
if( !pPager->tempFile && (pPg->flags&PGHDR_DIRTY) && pPager->nSavepoint==0 ){ |
55801
|
89 |
0 |
if( !pPager->changeCountDone && ALWAYS(pPager->dbSize>0) ){ |
|
89 |
0 |
if( !pPager->changeCountDone && ALWAYS(pPager->dbSize>0) ){ |
55815
|
89 |
0 |
if( !DIRECT_MODE && ALWAYS(rc==SQLITE_OK) ){ |
55819
|
89 |
0 |
if( rc==SQLITE_OK ){ |
55862
|
89 |
0 |
if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK; |
55863
|
89 |
0 |
if( rc==SQLITE_OK && !pPager->noSync ){ |
|
89 |
0 |
if( rc==SQLITE_OK && !pPager->noSync ){ |
55884
|
1082 |
0 |
if( rc==SQLITE_OK ){ |
55890
|
1082 |
0 |
if( 0==pagerUseWal(pPager) ){ |
55938
|
0 |
989 |
if( NEVER(pPager->errCode) ) return pPager->errCode; |
55941
|
0 |
989 |
if( sqlite3FaultSim(400) ) return SQLITE_IOERR; |
55947
|
23 |
966 |
if( pPager->eState
|
55951
|
877 |
89 |
if( 0==pagerFlushOnCommit(pPager, 1) ){ |
55957
|
0 |
89 |
if( pagerUseWal(pPager) ){ |
55960
|
0 |
0 |
if( pList==0 ){ |
55968
|
0 |
0 |
if( ALWAYS(pList) ){ |
55972
|
0 |
0 |
if( rc==SQLITE_OK ){ |
56048
|
0 |
89 |
if( rc!=SQLITE_OK ) goto commit_phase_one_exit; |
56055
|
0 |
89 |
if( rc!=SQLITE_OK ) goto commit_phase_one_exit; |
56069
|
0 |
89 |
if( rc!=SQLITE_OK ) goto commit_phase_one_exit; |
56089
|
0 |
89 |
if( rc!=SQLITE_OK ){ |
56101
|
0 |
89 |
if( pPager->dbSize>pPager->dbFileSize ){ |
56105
|
0 |
0 |
if( rc!=SQLITE_OK ) goto commit_phase_one_exit; |
56109
|
89 |
0 |
if( !noSync ){ |
56117
|
966 |
0 |
if( rc==SQLITE_OK && !pagerUseWal(pPager) ){ |
|
966 |
0 |
if( rc==SQLITE_OK && !pagerUseWal(pPager) ){ |
56145
|
0 |
989 |
if( NEVER(pPager->errCode) ) return pPager->errCode; |
56164
|
23 |
966 |
if( pPager->eState==PAGER_WRITER_LOCKED |
56165
|
16 |
7 |
&& pPager->exclusiveMode |
56166
|
0 |
16 |
&& pPager->journalMode==PAGER_JOURNALMODE_PERSIST |
56214
|
0 |
52 |
if( pPager->eState==PAGER_ERROR ) return pPager->errCode; |
56215
|
0 |
52 |
if( pPager->eState<=PAGER_READER ) return SQLITE_OK; |
56217
|
0 |
52 |
if( pagerUseWal(pPager) ){ |
56221
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
56222
|
31 |
21 |
}else if( !isOpen(pPager->jfd) || pPager->eState==PAGER_WRITER_LOCKED ){ |
|
0 |
31 |
}else if( !isOpen(pPager->jfd) || pPager->eState==PAGER_WRITER_LOCKED ){ |
56225
|
0 |
21 |
if( !MEMDB && eState>PAGER_WRITER_LOCKED ){ |
|
0 |
0 |
if( !MEMDB && eState>PAGER_WRITER_LOCKED ){ |
56334
|
0 |
6 |
if( reset ){ |
56373
|
0 |
1 |
if( !aNew ){ |
56380
|
1 |
1 |
for(ii=nCurrent; ii
|
56382
|
1 |
0 |
if( isOpen(pPager->jfd) && pPager->journalOff>0 ){ |
|
1 |
0 |
if( isOpen(pPager->jfd) && pPager->journalOff>0 ){ |
56389
|
0 |
1 |
if( !aNew[ii].pInSavepoint ){ |
56392
|
0 |
1 |
if( pagerUseWal(pPager) ){ |
56405
|
1 |
3500 |
if( nSavepoint>pPager->nSavepoint && pPager->useJournal ){ |
|
1 |
0 |
if( nSavepoint>pPager->nSavepoint && pPager->useJournal ){ |
56453
|
1 |
0 |
if( rc==SQLITE_OK && iSavepointnSavepoint ){ |
|
1 |
0 |
if( rc==SQLITE_OK && iSavepointnSavepoint ){ |
56462
|
0 |
1 |
for(ii=nNew; iinSavepoint; ii++){ |
56469
|
0 |
1 |
if( op==SAVEPOINT_RELEASE ){ |
56470
|
0 |
0 |
if( nNew==0 && isOpen(pPager->sjfd) ){ |
|
0 |
0 |
if( nNew==0 && isOpen(pPager->sjfd) ){ |
56472
|
0 |
0 |
if( sqlite3JournalIsInMemory(pPager->sjfd) ){ |
56484
|
1 |
0 |
else if( pagerUseWal(pPager) || isOpen(pPager->jfd) ){ |
|
1 |
0 |
else if( pagerUseWal(pPager) || isOpen(pPager->jfd) ){ |
56485
|
1 |
0 |
PagerSavepoint *pSavepoint = (nNew==0)?0:&pPager->aSavepoint[nNew-1]; |
56520
|
2294 |
0 |
return (nullIfMemDb && pPager->memDb) ? "" : pPager->zFilename; |
|
323 |
1971 |
return (nullIfMemDb && pPager->memDb) ? "" : pPager->zFilename; |
56557
|
0 |
0 |
return pPager->pWal ? sqlite3WalFile(pPager->pWal) : pPager->jfd; |
56579
|
0 |
0 |
if( pPager->xCodecFree ) pPager->xCodecFree(pPager->pCodec); |
56580
|
0 |
0 |
pPager->xCodec = pPager->memDb ? 0 : xCodec; |
56600
|
0 |
0 |
CODEC2(pPg->pPager, pPg->pData, pPg->pgno, 6, return 0, aData); |
|
0 |
0 |
CODEC2(pPg->pPager, pPg->pData, pPg->pgno, 6, return 0, aData); |
56654
|
0 |
0 |
if( pPager->tempFile ){ |
56656
|
0 |
0 |
if( rc ) return rc; |
56677
|
0 |
0 |
if( (pPg->flags & PGHDR_DIRTY)!=0 |
56678
|
0 |
0 |
&& SQLITE_OK!=(rc = subjournalPageIfRequired(pPg)) |
56694
|
0 |
0 |
if( (pPg->flags&PGHDR_NEED_SYNC) && !isCommit ){ |
|
0 |
0 |
if( (pPg->flags&PGHDR_NEED_SYNC) && !isCommit ){ |
56709
|
0 |
0 |
if( pPgOld ){ |
56711
|
0 |
0 |
if( pPager->tempFile ){ |
56728
|
0 |
0 |
if( pPager->tempFile && pPgOld ){ |
|
0 |
0 |
if( pPager->tempFile && pPgOld ){ |
56733
|
0 |
0 |
if( needSyncPgno ){ |
56750
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
56751
|
0 |
0 |
if( needSyncPgno<=pPager->dbOrigSize ){ |
56811
|
5 |
0 |
if( eMode>=0 && !pPager->tempFile && !sqlite3WalHeapMemory(pPager->pWal) ){ |
|
0 |
5 |
if( eMode>=0 && !pPager->tempFile && !sqlite3WalHeapMemory(pPager->pWal) ){ |
|
0 |
0 |
if( eMode>=0 && !pPager->tempFile && !sqlite3WalHeapMemory(pPager->pWal) ){ |
56864
|
0 |
0 |
if( MEMDB ){ |
56866
|
0 |
0 |
if( eMode!=PAGER_JOURNALMODE_MEMORY && eMode!=PAGER_JOURNALMODE_OFF ){ |
|
0 |
0 |
if( eMode!=PAGER_JOURNALMODE_MEMORY && eMode!=PAGER_JOURNALMODE_OFF ){ |
56871
|
0 |
0 |
if( eMode!=eOld ){ |
56889
|
0 |
0 |
if( !pPager->exclusiveMode && (eOld & 5)==1 && (eMode & 1)==0 ){ |
|
0 |
0 |
if( !pPager->exclusiveMode && (eOld & 5)==1 && (eMode & 1)==0 ){ |
|
0 |
0 |
if( !pPager->exclusiveMode && (eOld & 5)==1 && (eMode & 1)==0 ){ |
56900
|
0 |
0 |
if( pPager->eLock>=RESERVED_LOCK ){ |
56906
|
0 |
0 |
if( state==PAGER_OPEN ){ |
56909
|
0 |
0 |
if( pPager->eState==PAGER_READER ){ |
56913
|
0 |
0 |
if( rc==SQLITE_OK ){ |
56916
|
0 |
0 |
if( rc==SQLITE_OK && state==PAGER_READER ){ |
|
0 |
0 |
if( rc==SQLITE_OK && state==PAGER_READER ){ |
56918
|
0 |
0 |
}else if( state==PAGER_OPEN ){ |
56923
|
0 |
0 |
}else if( eMode==PAGER_JOURNALMODE_OFF ){ |
56946
|
0 |
0 |
if( pPager->eState>=PAGER_WRITER_CACHEMOD ) return 0; |
56947
|
0 |
0 |
if( NEVER(isOpen(pPager->jfd) && pPager->journalOff>0) ) return 0; |
|
0 |
0 |
if( NEVER(isOpen(pPager->jfd) && pPager->journalOff>0) ) return 0; |
56958
|
0 |
0 |
if( iLimit>=-1 ){ |
56981
|
0 |
0 |
if( pPager->tempFile==0 ) pager_reset(pPager); |
57002
|
0 |
0 |
if( pPager->pWal ){ |
57003
|
0 |
0 |
rc = sqlite3WalCheckpoint(pPager->pWal, db, eMode, |
57024
|
0 |
0 |
if( pPager->noLock ) return 0; |
57025
|
0 |
0 |
return pPager->exclusiveMode || (pMethods->iVersion>=2 && pMethods->xShmMap); |
|
0 |
0 |
return pPager->exclusiveMode || (pMethods->iVersion>=2 && pMethods->xShmMap); |
|
0 |
0 |
return pPager->exclusiveMode || (pMethods->iVersion>=2 && pMethods->xShmMap); |
57037
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
57063
|
0 |
0 |
if( pPager->exclusiveMode ){ |
57070
|
0 |
0 |
if( rc==SQLITE_OK ){ |
57109
|
0 |
0 |
if( !pPager->tempFile && !pPager->pWal ){ |
|
0 |
0 |
if( !pPager->tempFile && !pPager->pWal ){ |
57110
|
0 |
0 |
if( !sqlite3PagerWalSupported(pPager) ) return SQLITE_CANTOPEN; |
57116
|
0 |
0 |
if( rc==SQLITE_OK ){ |
57145
|
0 |
0 |
if( !pPager->pWal ){ |
57148
|
0 |
0 |
if( rc==SQLITE_OK ){ |
57153
|
0 |
0 |
if( rc==SQLITE_OK && logexists ){ |
|
0 |
0 |
if( rc==SQLITE_OK && logexists ){ |
57161
|
0 |
0 |
if( rc==SQLITE_OK && pPager->pWal ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pPager->pWal ){ |
57163
|
0 |
0 |
if( rc==SQLITE_OK ){ |
57168
|
0 |
0 |
if( rc && !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK); |
|
0 |
0 |
if( rc && !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK); |
57800
|
0 |
0 |
if( pWal->nWiData<=iPage ){ |
57804
|
0 |
0 |
if( !apNew ){ |
57816
|
0 |
0 |
if( pWal->exclusiveMode==WAL_HEAPMEMORY_MODE ){ |
57818
|
0 |
0 |
if( !pWal->apWiData[iPage] ) rc = SQLITE_NOMEM_BKPT; |
57825
|
0 |
0 |
if( (rc&0xff)==SQLITE_READONLY ){ |
57827
|
0 |
0 |
if( rc==SQLITE_READONLY ){ |
57842
|
0 |
0 |
if( pWal->nWiData<=iPage || (*ppPage = pWal->apWiData[iPage])==0 ){ |
|
0 |
0 |
if( pWal->nWiData<=iPage || (*ppPage = pWal->apWiData[iPage])==0 ){ |
57896
|
0 |
0 |
if( aIn ){ |
57906
|
0 |
0 |
if( nativeCksum ){ |
57910
|
0 |
0 |
}while( aData
|
57916
|
0 |
0 |
}while( aData
|
57924
|
0 |
0 |
if( pWal->exclusiveMode!=WAL_HEAPMEMORY_MODE ){ |
57972
|
0 |
0 |
if( pWal->iReCksum==0 ){ |
58006
|
0 |
0 |
if( memcmp(&pWal->hdr.aSalt, &aFrame[8], 8)!=0 ){ |
58013
|
0 |
0 |
if( pgno==0 ){ |
58025
|
0 |
0 |
if( aCksum[0]!=sqlite3Get4byte(&aFrame[16]) |
58026
|
0 |
0 |
|| aCksum[1]!=sqlite3Get4byte(&aFrame[20]) |
58072
|
0 |
0 |
if( pWal->exclusiveMode ) return SQLITE_OK; |
58081
|
0 |
0 |
if( pWal->exclusiveMode ) return; |
58088
|
0 |
0 |
if( pWal->exclusiveMode ) return SQLITE_OK; |
58097
|
0 |
0 |
if( pWal->exclusiveMode ) return; |
58145
|
0 |
0 |
if( rc==SQLITE_OK ){ |
58150
|
0 |
0 |
if( iHash==0 ){ |
58186
|
0 |
0 |
if( iHash==0 ){ |
58217
|
0 |
0 |
if( pWal->hdr.mxFrame==0 ) return; |
58232
|
0 |
0 |
for(i=0; i
|
58233
|
0 |
0 |
if( aHash[i]>iLimit ){ |
58277
|
0 |
0 |
if( rc==SQLITE_OK ){ |
58288
|
0 |
0 |
if( idx==1 ){ |
58299
|
0 |
0 |
if( aPgno[idx] ){ |
58306
|
0 |
0 |
for(iKey=walHash(iPage); aHash[iKey]; iKey=walNextHash(iKey)){ |
58307
|
0 |
0 |
if( (nCollide--)==0 ) return SQLITE_CORRUPT_BKPT; |
58373
|
0 |
0 |
if( rc==SQLITE_OK ){ |
58375
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
58379
|
0 |
0 |
if( rc ){ |
58388
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
58392
|
0 |
0 |
if( nSize>WAL_HDRSIZE ){ |
58406
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
58417
|
0 |
0 |
if( (magic&0xFFFFFFFE)!=WAL_MAGIC |
58418
|
0 |
0 |
|| szPage&(szPage-1) |
58419
|
0 |
0 |
|| szPage>SQLITE_MAX_PAGE_SIZE |
58420
|
0 |
0 |
|| szPage<512 |
58433
|
0 |
0 |
if( pWal->hdr.aFrameCksum[0]!=sqlite3Get4byte(&aBuf[24]) |
58434
|
0 |
0 |
|| pWal->hdr.aFrameCksum[1]!=sqlite3Get4byte(&aBuf[28]) |
58442
|
0 |
0 |
if( version!=WAL_MAX_VERSION ){ |
58450
|
0 |
0 |
if( !aFrame ){ |
58458
|
0 |
0 |
for(iOffset=WAL_HDRSIZE; (iOffset+szFrame)<=nSize; iOffset+=szFrame){ |
58465
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
58467
|
0 |
0 |
if( !isValid ) break; |
58469
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
58472
|
0 |
0 |
if( nTruncate ){ |
58487
|
0 |
0 |
if( rc==SQLITE_OK ){ |
58502
|
0 |
0 |
for(i=1; iaReadMark[i] = READMARK_NOT_USED; |
58503
|
0 |
0 |
if( pWal->hdr.mxFrame ) pInfo->aReadMark[1] = pWal->hdr.mxFrame; |
58510
|
0 |
0 |
if( pWal->hdr.nPage ){ |
58529
|
0 |
0 |
if( pWal->exclusiveMode==WAL_HEAPMEMORY_MODE || pWal->bShmUnreliable ){ |
|
0 |
0 |
if( pWal->exclusiveMode==WAL_HEAPMEMORY_MODE || pWal->bShmUnreliable ){ |
58531
|
0 |
0 |
for(i=0; inWiData; i++){ |
58536
|
0 |
0 |
if( pWal->exclusiveMode!=WAL_HEAPMEMORY_MODE ){ |
58590
|
0 |
0 |
if( !pRet ){ |
58602
|
0 |
0 |
pRet->exclusiveMode = (bNoShm ? WAL_HEAPMEMORY_MODE: WAL_NORMAL_MODE); |
58607
|
0 |
0 |
if( rc==SQLITE_OK && flags&SQLITE_OPEN_READONLY ){ |
|
0 |
0 |
if( rc==SQLITE_OK && flags&SQLITE_OPEN_READONLY ){ |
58611
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
58617
|
0 |
0 |
if( iDC & SQLITE_IOCAP_SEQUENTIAL ){ pRet->syncHeader = 0; } |
58618
|
0 |
0 |
if( iDC & SQLITE_IOCAP_POWERSAFE_OVERWRITE ){ |
58631
|
0 |
0 |
if( pWal ) pWal->mxWalSize = iLimit; |
58655
|
0 |
0 |
for(i=p->nSegment-1; i>=0; i--){ |
58657
|
0 |
0 |
while( pSegment->iNextnEntry ){ |
58659
|
0 |
0 |
if( iPg>iMin ){ |
58660
|
0 |
0 |
if( iPg
|
58712
|
0 |
0 |
while( iRight
|
|
0 |
0 |
while( iRight
|
58716
|
0 |
0 |
if( (iLeft
|
58717
|
0 |
0 |
&& (iRight>=nRight || aContent[aLeft[iLeft]]
|
|
0 |
0 |
&& (iRight>=nRight || aContent[aLeft[iLeft]]
|
58726
|
0 |
0 |
if( iLeft
|
|
0 |
0 |
if( iLeft
|
58776
|
0 |
0 |
for(iList=0; iList
|
58779
|
0 |
0 |
for(iSub=0; iList & (1<
|
58791
|
0 |
0 |
for(iSub++; iSub
|
58792
|
0 |
0 |
if( nList & (1<
|
58855
|
0 |
0 |
if( !p ){ |
58864
|
0 |
0 |
aTmp = (ht_slot *)sqlite3_malloc64( |
58867
|
0 |
0 |
if( !aTmp ){ |
58871
|
0 |
0 |
for(i=walFramePage(nBackfill+1); rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=walFramePage(nBackfill+1); rc==SQLITE_OK && i
|
58877
|
0 |
0 |
if( rc==SQLITE_OK ){ |
58883
|
0 |
0 |
if( (i+1)==nSegment ){ |
58891
|
0 |
0 |
for(j=0; j
|
58903
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
58927
|
0 |
0 |
}while( xBusy && rc==SQLITE_BUSY && xBusy(pBusyArg) ); |
|
0 |
0 |
}while( xBusy && rc==SQLITE_BUSY && xBusy(pBusyArg) ); |
|
0 |
0 |
}while( xBusy && rc==SQLITE_BUSY && xBusy(pBusyArg) ); |
58968
|
0 |
0 |
for(i=2; iaReadMark[i] = READMARK_NOT_USED; |
59026
|
0 |
0 |
if( pInfo->nBackfillhdr.mxFrame ){ |
59039
|
0 |
0 |
for(i=1; i
|
59049
|
0 |
0 |
if( mxSafeFrame>y ){ |
59052
|
0 |
0 |
if( rc==SQLITE_OK ){ |
59053
|
0 |
0 |
pInfo->aReadMark[i] = (i==1 ? mxSafeFrame : READMARK_NOT_USED); |
59055
|
0 |
0 |
}else if( rc==SQLITE_BUSY ){ |
59065
|
0 |
0 |
if( pInfo->nBackfill
|
59070
|
0 |
0 |
if( pIter |
59071
|
0 |
0 |
&& (rc = walBusyLock(pWal, xBusy, pBusyArg, WAL_READ_LOCK(0),1))==SQLITE_OK |
59084
|
0 |
0 |
if( rc==SQLITE_OK ){ |
59087
|
0 |
0 |
if( rc==SQLITE_OK && nSize
|
|
0 |
0 |
if( rc==SQLITE_OK && nSize
|
59094
|
0 |
0 |
while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){ |
|
0 |
0 |
while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){ |
59097
|
0 |
0 |
if( db->u1.isInterrupted ){ |
59098
|
0 |
0 |
rc = db->mallocFailed ? SQLITE_NOMEM_BKPT : SQLITE_INTERRUPT; |
59101
|
0 |
0 |
if( iFrame<=nBackfill || iFrame>mxSafeFrame || iDbpage>mxPage ){ |
|
0 |
0 |
if( iFrame<=nBackfill || iFrame>mxSafeFrame || iDbpage>mxPage ){ |
|
0 |
0 |
if( iFrame<=nBackfill || iFrame>mxSafeFrame || iDbpage>mxPage ){ |
59107
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
59111
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
59115
|
0 |
0 |
if( rc==SQLITE_OK ){ |
59116
|
0 |
0 |
if( mxSafeFrame==walIndexHdr(pWal)->mxFrame ){ |
59120
|
0 |
0 |
if( rc==SQLITE_OK ){ |
59124
|
0 |
0 |
if( rc==SQLITE_OK ){ |
59133
|
0 |
0 |
if( rc==SQLITE_BUSY ){ |
59145
|
0 |
0 |
if( rc==SQLITE_OK && eMode!=SQLITE_CHECKPOINT_PASSIVE ){ |
|
0 |
0 |
if( rc==SQLITE_OK && eMode!=SQLITE_CHECKPOINT_PASSIVE ){ |
59147
|
0 |
0 |
if( pInfo->nBackfillhdr.mxFrame ){ |
59149
|
0 |
0 |
}else if( eMode>=SQLITE_CHECKPOINT_RESTART ){ |
59154
|
0 |
0 |
if( rc==SQLITE_OK ){ |
59155
|
0 |
0 |
if( eMode==SQLITE_CHECKPOINT_TRUNCATE ){ |
59191
|
0 |
0 |
if( rx==SQLITE_OK && (sz > nMax ) ){ |
|
0 |
0 |
if( rx==SQLITE_OK && (sz > nMax ) ){ |
59195
|
0 |
0 |
if( rx ){ |
59211
|
0 |
304 |
if( pWal ){ |
59222
|
0 |
0 |
if( zBuf!=0 |
59223
|
0 |
0 |
&& SQLITE_OK==(rc = sqlite3OsLock(pWal->pDbFd, SQLITE_LOCK_EXCLUSIVE)) |
59225
|
0 |
0 |
if( pWal->exclusiveMode==WAL_NORMAL_MODE ){ |
59231
|
0 |
0 |
if( rc==SQLITE_OK ){ |
59236
|
0 |
0 |
if( bPersist!=1 ){ |
59241
|
0 |
0 |
}else if( pWal->mxWalSize>=0 ){ |
59255
|
0 |
0 |
if( isDelete ){ |
59307
|
0 |
0 |
if( memcmp(&h1, &h2, sizeof(h1))!=0 ){ |
59310
|
0 |
0 |
if( h1.isInit==0 ){ |
59314
|
0 |
0 |
if( aCksum[0]!=h1.aCksum[0] || aCksum[1]!=h1.aCksum[1] ){ |
|
0 |
0 |
if( aCksum[0]!=h1.aCksum[0] || aCksum[1]!=h1.aCksum[1] ){ |
59318
|
0 |
0 |
if( memcmp(&pWal->hdr, &h1, sizeof(WalIndexHdr)) ){ |
59358
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
59360
|
0 |
0 |
if( rc==SQLITE_READONLY_CANTINIT ){ |
59388
|
0 |
0 |
badHdr = (page0 ? walIndexTryHdr(pWal, pChanged) : 1); |
59394
|
0 |
0 |
if( badHdr ){ |
59395
|
0 |
0 |
if( pWal->bShmUnreliable==0 && (pWal->readOnly & WAL_SHM_RDONLY) ){ |
|
0 |
0 |
if( pWal->bShmUnreliable==0 && (pWal->readOnly & WAL_SHM_RDONLY) ){ |
59396
|
0 |
0 |
if( SQLITE_OK==(rc = walLockShared(pWal, WAL_WRITE_LOCK)) ){ |
59400
|
0 |
0 |
}else if( SQLITE_OK==(rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1)) ){ |
59402
|
0 |
0 |
if( SQLITE_OK==(rc = walIndexPage(pWal, 0, &page0)) ){ |
59404
|
0 |
0 |
if( badHdr ){ |
59422
|
0 |
0 |
if( badHdr==0 && pWal->hdr.iVersion!=WALINDEX_MAX_VERSION ){ |
|
0 |
0 |
if( badHdr==0 && pWal->hdr.iVersion!=WALINDEX_MAX_VERSION ){ |
59425
|
0 |
0 |
if( pWal->bShmUnreliable ){ |
59426
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
59433
|
0 |
0 |
if( rc==SQLITE_IOERR_SHORT_READ ) rc = WAL_RETRY; |
59487
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
59488
|
0 |
0 |
if( rc==SQLITE_BUSY ) rc = WAL_RETRY; |
59517
|
0 |
0 |
if( rc!=SQLITE_READONLY_CANTINIT ){ |
59518
|
0 |
0 |
rc = (rc==SQLITE_READONLY ? WAL_RETRY : rc); |
59532
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
59535
|
0 |
0 |
if( szWal
|
59543
|
0 |
0 |
rc = (pWal->hdr.mxFrame==0 ? SQLITE_OK : WAL_RETRY); |
59549
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
59552
|
0 |
0 |
if( memcmp(&pWal->hdr.aSalt, &aBuf[16], 8) ){ |
59563
|
0 |
0 |
if( aFrame==0 ){ |
59575
|
0 |
0 |
for(iOffset=walFrameOffset(pWal->hdr.mxFrame+1, pWal->hdr.szPage); |
59584
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
59585
|
0 |
0 |
if( !walDecodeFrame(pWal, &pgno, &nTruncate, aData, aFrame) ) break; |
59590
|
0 |
0 |
if( nTruncate ){ |
59600
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
59602
|
0 |
0 |
for(i=0; inWiData; i++){ |
59693
|
0 |
0 |
if( cnt>5 ){ |
59695
|
0 |
0 |
if( cnt>100 ){ |
59699
|
0 |
0 |
if( cnt>=10 ) nDelay = (cnt-9)*(cnt-9)*39; |
59703
|
0 |
0 |
if( !useWal ){ |
59705
|
0 |
0 |
if( pWal->bShmUnreliable==0 ){ |
59708
|
0 |
0 |
if( rc==SQLITE_BUSY ){ |
59717
|
0 |
0 |
if( pWal->apWiData[0]==0 ){ |
59726
|
0 |
0 |
}else if( SQLITE_OK==(rc = walLockShared(pWal, WAL_RECOVER_LOCK)) ){ |
59729
|
0 |
0 |
}else if( rc==SQLITE_BUSY ){ |
59733
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
59736
|
0 |
0 |
else if( pWal->bShmUnreliable ){ |
59744
|
0 |
0 |
if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame |
|
0 |
0 |
if( !useWal && pInfo->nBackfill==pWal->hdr.mxFrame |
59754
|
0 |
0 |
if( rc==SQLITE_OK ){ |
59755
|
0 |
0 |
if( memcmp((void *)walIndexHdr(pWal), &pWal->hdr, sizeof(WalIndexHdr)) ){ |
59774
|
0 |
0 |
}else if( rc!=SQLITE_BUSY ){ |
59792
|
0 |
0 |
for(i=1; i
|
59794
|
0 |
0 |
if( mxReadMark<=thisMark && thisMark<=mxFrame ){ |
|
0 |
0 |
if( mxReadMark<=thisMark && thisMark<=mxFrame ){ |
59800
|
0 |
0 |
if( (pWal->readOnly & WAL_SHM_RDONLY)==0 |
59801
|
0 |
0 |
&& (mxReadMark
|
|
0 |
0 |
&& (mxReadMark
|
59803
|
0 |
0 |
for(i=1; i
|
59805
|
0 |
0 |
if( rc==SQLITE_OK ){ |
59810
|
0 |
0 |
}else if( rc!=SQLITE_BUSY ){ |
59815
|
0 |
0 |
if( mxI==0 ){ |
59817
|
0 |
0 |
return rc==SQLITE_BUSY ? WAL_RETRY : SQLITE_READONLY_CANTINIT; |
59821
|
0 |
0 |
if( rc ){ |
59822
|
0 |
0 |
return rc==SQLITE_BUSY ? WAL_RETRY : rc; |
59860
|
0 |
0 |
if( pInfo->aReadMark[mxI]!=mxReadMark |
59861
|
0 |
0 |
|| memcmp((void *)walIndexHdr(pWal), &pWal->hdr, sizeof(WalIndexHdr)) |
59978
|
0 |
0 |
}while( rc==WAL_RETRY ); |
60056
|
0 |
0 |
if( pWal->readLock>=0 ){ |
60089
|
0 |
0 |
if( iLast==0 || (pWal->readLock==0 && pWal->bShmUnreliable==0) ){ |
|
0 |
0 |
if( iLast==0 || (pWal->readLock==0 && pWal->bShmUnreliable==0) ){ |
|
0 |
0 |
if( iLast==0 || (pWal->readLock==0 && pWal->bShmUnreliable==0) ){ |
60120
|
0 |
0 |
for(iHash=walFramePage(iLast); iHash>=iMinHash; iHash--){ |
60129
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
60133
|
0 |
0 |
for(iKey=walHash(pgno); aHash[iKey]; iKey=walNextHash(iKey)){ |
60135
|
0 |
0 |
if( iFrame<=iLast && iFrame>=pWal->minFrame && aPgno[aHash[iKey]]==pgno ){ |
|
0 |
0 |
if( iFrame<=iLast && iFrame>=pWal->minFrame && aPgno[aHash[iKey]]==pgno ){ |
|
0 |
0 |
if( iFrame<=iLast && iFrame>=pWal->minFrame && aPgno[aHash[iKey]]==pgno ){ |
60139
|
0 |
0 |
if( (nCollide--)==0 ){ |
60143
|
0 |
0 |
if( iRead ) break; |
60194
|
0 |
335 |
if( pWal && ALWAYS(pWal->readLock>=0) ){ |
|
0 |
0 |
if( pWal && ALWAYS(pWal->readLock>=0) ){ |
60222
|
0 |
0 |
if( pWal->readOnly ){ |
60230
|
0 |
0 |
if( rc ){ |
60239
|
0 |
0 |
if( memcmp(&pWal->hdr, (void *)walIndexHdr(pWal), sizeof(WalIndexHdr))!=0 ){ |
60253
|
0 |
0 |
if( pWal->writeLock ){ |
60276
|
0 |
0 |
if( ALWAYS(pWal->writeLock) ){ |
60285
|
0 |
0 |
for(iFrame=pWal->hdr.mxFrame+1; |
60286
|
0 |
0 |
ALWAYS(rc==SQLITE_OK) && iFrame<=iMax; |
60303
|
0 |
0 |
if( iMax!=pWal->hdr.mxFrame ) walCleanupHash(pWal); |
60334
|
0 |
0 |
if( aWalData[3]!=pWal->nCkpt ){ |
60343
|
0 |
0 |
if( aWalData[0]hdr.mxFrame ){ |
60369
|
0 |
0 |
if( pWal->readLock==0 ){ |
60372
|
0 |
0 |
if( pInfo->nBackfill>0 ){ |
60376
|
0 |
0 |
if( rc==SQLITE_OK ){ |
60388
|
0 |
0 |
}else if( rc!=SQLITE_BUSY ){ |
60398
|
0 |
0 |
}while( rc==WAL_RETRY ); |
60435
|
0 |
0 |
if( iOffsetiSyncPoint && iOffset+iAmt>=p->iSyncPoint ){ |
|
0 |
0 |
if( iOffsetiSyncPoint && iOffset+iAmt>=p->iSyncPoint ){ |
60438
|
0 |
0 |
if( rc ) return rc; |
60444
|
0 |
0 |
if( iAmt==0 || rc ) return rc; |
|
0 |
0 |
if( iAmt==0 || rc ) return rc; |
60463
|
0 |
0 |
if( (pData = sqlite3PagerCodec(pPage))==0 ) return SQLITE_NOMEM_BKPT; |
60469
|
0 |
0 |
if( rc ) return rc; |
60492
|
0 |
0 |
if( aBuf==0 ) return SQLITE_NOMEM_BKPT; |
60500
|
0 |
0 |
if( pWal->iReCksum==1 ){ |
60511
|
0 |
0 |
for(; rc==SQLITE_OK && iRead<=iLast; iRead++){ |
|
0 |
0 |
for(; rc==SQLITE_OK && iRead<=iLast; iRead++){ |
60514
|
0 |
0 |
if( rc==SQLITE_OK ){ |
60566
|
0 |
0 |
if( memcmp(&pWal->hdr, (void *)pLive, sizeof(WalIndexHdr))!=0 ){ |
60573
|
0 |
0 |
if( SQLITE_OK!=(rc = walRestartLog(pWal)) ){ |
60582
|
0 |
0 |
if( iFrame==0 ){ |
60590
|
0 |
0 |
if( pWal->nCkpt==0 ) sqlite3_randomness(8, pWal->hdr.aSalt); |
60604
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
60615
|
0 |
0 |
if( pWal->syncHeader ){ |
60617
|
0 |
0 |
if( rc ) return rc; |
60632
|
0 |
0 |
for(p=pList; p; p=p->pDirty){ |
60639
|
0 |
0 |
if( iFirst && (p->pDirty || isCommit==0) ){ |
|
0 |
0 |
if( iFirst && (p->pDirty || isCommit==0) ){ |
|
0 |
0 |
if( iFirst && (p->pDirty || isCommit==0) ){ |
60643
|
0 |
0 |
if( iWrite>=iFirst ){ |
60646
|
0 |
0 |
if( pWal->iReCksum==0 || iWriteiReCksum ){ |
|
0 |
0 |
if( pWal->iReCksum==0 || iWriteiReCksum ){ |
60650
|
0 |
0 |
if( (pData = sqlite3PagerCodec(p))==0 ) return SQLITE_NOMEM; |
60655
|
0 |
0 |
if( rc ) return rc; |
60663
|
0 |
0 |
nDbSize = (isCommit && p->pDirty==0) ? nTruncate : 0; |
|
0 |
0 |
nDbSize = (isCommit && p->pDirty==0) ? nTruncate : 0; |
60665
|
0 |
0 |
if( rc ) return rc; |
60672
|
0 |
0 |
if( isCommit && pWal->iReCksum ){ |
|
0 |
0 |
if( isCommit && pWal->iReCksum ){ |
60674
|
0 |
0 |
if( rc ) return rc; |
60691
|
0 |
0 |
if( isCommit && WAL_SYNC_FLAGS(sync_flags)!=0 ){ |
|
0 |
0 |
if( isCommit && WAL_SYNC_FLAGS(sync_flags)!=0 ){ |
60693
|
0 |
0 |
if( pWal->padToSectorBoundary ){ |
60698
|
0 |
0 |
while( iOffset
|
60700
|
0 |
0 |
if( rc ) return rc; |
60705
|
0 |
0 |
if( bSync ){ |
60715
|
0 |
0 |
if( isCommit && pWal->truncateOnCommit && pWal->mxWalSize>=0 ){ |
|
0 |
0 |
if( isCommit && pWal->truncateOnCommit && pWal->mxWalSize>=0 ){ |
|
0 |
0 |
if( isCommit && pWal->truncateOnCommit && pWal->mxWalSize>=0 ){ |
60717
|
0 |
0 |
if( walFrameOffset(iFrame+nExtra+1, szPage)>pWal->mxWalSize ){ |
60730
|
0 |
0 |
for(p=pList; p && rc==SQLITE_OK; p=p->pDirty){ |
|
0 |
0 |
for(p=pList; p && rc==SQLITE_OK; p=p->pDirty){ |
60731
|
0 |
0 |
if( (p->flags & PGHDR_WAL_APPEND)==0 ) continue; |
60735
|
0 |
0 |
while( rc==SQLITE_OK && nExtra>0 ){ |
|
0 |
0 |
while( rc==SQLITE_OK && nExtra>0 ){ |
60741
|
0 |
0 |
if( rc==SQLITE_OK ){ |
60747
|
0 |
0 |
if( isCommit ){ |
60752
|
0 |
0 |
if( isCommit ){ |
60796
|
0 |
0 |
if( pWal->readOnly ) return SQLITE_READONLY; |
60802
|
0 |
0 |
if( rc ){ |
60824
|
0 |
0 |
if( eMode!=SQLITE_CHECKPOINT_PASSIVE ){ |
60826
|
0 |
0 |
if( rc==SQLITE_OK ){ |
60828
|
0 |
0 |
}else if( rc==SQLITE_BUSY ){ |
60836
|
0 |
0 |
if( rc==SQLITE_OK ){ |
60838
|
0 |
0 |
if( isChanged && pWal->pDbFd->pMethods->iVersion>=3 ){ |
|
0 |
0 |
if( isChanged && pWal->pDbFd->pMethods->iVersion>=3 ){ |
60844
|
0 |
0 |
if( rc==SQLITE_OK ){ |
60846
|
0 |
0 |
if( pWal->hdr.mxFrame && walPagesize(pWal)!=nBuf ){ |
|
0 |
0 |
if( pWal->hdr.mxFrame && walPagesize(pWal)!=nBuf ){ |
60853
|
0 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_BUSY ){ |
|
0 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_BUSY ){ |
60854
|
0 |
0 |
if( pnLog ) *pnLog = (int)pWal->hdr.mxFrame; |
60855
|
0 |
0 |
if( pnCkpt ) *pnCkpt = (int)(walCkptInfo(pWal)->nBackfill); |
60859
|
0 |
0 |
if( isChanged ){ |
60874
|
0 |
0 |
return (rc==SQLITE_OK && eMode!=eMode2 ? SQLITE_BUSY : rc); |
|
0 |
0 |
return (rc==SQLITE_OK && eMode!=eMode2 ? SQLITE_BUSY : rc); |
60884
|
0 |
3372 |
if( pWal ){ |
60929
|
0 |
0 |
if( op==0 ){ |
60930
|
0 |
0 |
if( pWal->exclusiveMode!=WAL_NORMAL_MODE ){ |
60932
|
0 |
0 |
if( walLockShared(pWal, WAL_READ_LOCK(pWal->readLock))!=SQLITE_OK ){ |
60940
|
0 |
0 |
}else if( op>0 ){ |
60958
|
0 |
0 |
return (pWal && pWal->exclusiveMode==WAL_HEAPMEMORY_MODE ); |
|
0 |
0 |
return (pWal && pWal->exclusiveMode==WAL_HEAPMEMORY_MODE ); |
62022
|
12965 |
6391 |
for(i=0; inDb; i++){ |
62024
|
9330 |
3635 |
if( p ){ |
62344
|
10650 |
0 |
if( !p->sharable ){ |
62351
|
0 |
0 |
if( pBt->pWriter!=p && (pBt->btsFlags & BTS_EXCLUSIVE)!=0 ){ |
|
0 |
0 |
if( pBt->pWriter!=p && (pBt->btsFlags & BTS_EXCLUSIVE)!=0 ){ |
62356
|
0 |
0 |
for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){ |
62368
|
0 |
0 |
if( pIter->pBtree!=p && pIter->iTable==iTab && pIter->eLock!=eLock ){ |
|
0 |
0 |
if( pIter->pBtree!=p && pIter->iTable==iTab && pIter->eLock!=eLock ){ |
|
0 |
0 |
if( pIter->pBtree!=p && pIter->iTable==iTab && pIter->eLock!=eLock ){ |
62370
|
0 |
0 |
if( eLock==WRITE_LOCK ){ |
62420
|
0 |
0 |
for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){ |
62421
|
0 |
0 |
if( pIter->iTable==iTable && pIter->pBtree==p ){ |
|
0 |
0 |
if( pIter->iTable==iTable && pIter->pBtree==p ){ |
62430
|
0 |
0 |
if( !pLock ){ |
62432
|
0 |
0 |
if( !pLock ){ |
62446
|
0 |
0 |
if( eLock>pLock->eLock ){ |
62471
|
0 |
2037 |
while( *ppIter ){ |
62475
|
0 |
0 |
if( pLock->pBtree==p ){ |
62478
|
0 |
0 |
if( pLock->iTable!=1 ){ |
62487
|
1041 |
996 |
if( pBt->pWriter==p ){ |
62490
|
0 |
996 |
}else if( pBt->nTransaction==2 ){ |
62509
|
0 |
236 |
if( pBt->pWriter==p ){ |
62513
|
0 |
0 |
for(pLock=pBt->pLock; pLock; pLock=pLock->pNext){ |
62563
|
0 |
0 |
for(p=pBt->pCursor; p; p=p->pNext){ |
62589
|
3770 |
15 |
if( pBtree->hasIncrblobCur==0 ) return; |
62592
|
29 |
15 |
for(p=pBtree->pBt->pCursor; p; p=p->pNext){ |
62593
|
14 |
15 |
if( (p->curFlags & BTCF_Incrblob)!=0 ){ |
62595
|
7 |
7 |
if( p->pgnoRoot==pgnoRoot && (isClearTable || p->info.nKey==iRow) ){ |
|
7 |
0 |
if( p->pgnoRoot==pgnoRoot && (isClearTable || p->info.nKey==iRow) ){ |
|
7 |
0 |
if( p->pgnoRoot==pgnoRoot && (isClearTable || p->info.nKey==iRow) ){ |
62644
|
1 |
0 |
if( !pBt->pHasContent ){ |
62647
|
0 |
1 |
if( !pBt->pHasContent ){ |
62651
|
1 |
0 |
if( rc==SQLITE_OK && pgno<=sqlite3BitvecSize(pBt->pHasContent) ){ |
|
1 |
0 |
if( rc==SQLITE_OK && pgno<=sqlite3BitvecSize(pBt->pHasContent) ){ |
62666
|
0 |
1 |
return (p && (pgno>sqlite3BitvecSize(p) || sqlite3BitvecTest(p, pgno))); |
|
0 |
0 |
return (p && (pgno>sqlite3BitvecSize(p) || sqlite3BitvecTest(p, pgno))); |
|
0 |
0 |
return (p && (pgno>sqlite3BitvecSize(p) || sqlite3BitvecTest(p, pgno))); |
62683
|
5313 |
408 |
if( pCur->iPage>=0 ){ |
62684
|
1446 |
5313 |
for(i=0; iiPage; i++){ |
62711
|
72 |
0 |
if( pCur->curIntKey ){ |
62719
|
0 |
0 |
if( pKey ){ |
62721
|
0 |
0 |
if( rc==SQLITE_OK ){ |
62748
|
0 |
54 |
if( pCur->eState==CURSOR_SKIPNEXT ){ |
62755
|
54 |
0 |
if( rc==SQLITE_OK ){ |
62792
|
243 |
670 |
for(p=pBt->pCursor; p; p=p->pNext){ |
62793
|
124 |
119 |
if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) ) break; |
|
124 |
0 |
if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) ) break; |
|
5 |
119 |
if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) ) break; |
62795
|
119 |
670 |
if( p ) return saveCursorsOnList(p, iRoot, pExcept); |
62796
|
0 |
670 |
if( pExcept ) pExcept->curFlags &= ~BTCF_Multiple; |
62811
|
132 |
0 |
if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) ){ |
|
132 |
0 |
if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) ){ |
|
132 |
0 |
if( p!=pExcept && (0==iRoot || p->pgnoRoot==iRoot) ){ |
62812
|
78 |
54 |
if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){ |
|
0 |
78 |
if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){ |
62814
|
0 |
54 |
if( SQLITE_OK!=rc ){ |
62823
|
13 |
119 |
}while( p ); |
62852
|
0 |
18 |
if( pKey ){ |
62855
|
0 |
0 |
if( pIdxKey==0 ) return SQLITE_NOMEM_BKPT; |
62857
|
0 |
0 |
if( pIdxKey->nField==0 ){ |
62866
|
0 |
18 |
if( pIdxKey ){ |
62884
|
0 |
18 |
if( pCur->eState==CURSOR_FAULT ){ |
62889
|
18 |
0 |
if( rc==SQLITE_OK ){ |
62894
|
18 |
0 |
if( pCur->skipNext && pCur->eState==CURSOR_VALID ){ |
|
10 |
8 |
if( pCur->skipNext && pCur->eState==CURSOR_VALID ){ |
62955
|
0 |
0 |
rc = restoreCursorPosition(pCur); |
62956
|
0 |
0 |
if( rc ){ |
62960
|
0 |
0 |
if( pCur->eState!=CURSOR_VALID ){ |
63003
|
0 |
0 |
if( pgno<2 ) return 0; |
63007
|
0 |
0 |
if( ret==PENDING_BYTE_PAGE(pBt) ){ |
63030
|
0 |
0 |
if( *pRC ) return; |
63037
|
0 |
0 |
if( key==0 ){ |
63043
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
63048
|
0 |
0 |
if( offset<0 ){ |
63055
|
0 |
0 |
if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){ |
|
0 |
0 |
if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){ |
63058
|
0 |
0 |
if( rc==SQLITE_OK ){ |
63086
|
0 |
0 |
if( rc!=0 ){ |
63092
|
0 |
0 |
if( offset<0 ){ |
63099
|
0 |
0 |
if( pPgno ) *pPgno = get4byte(&pPtrmap[offset+1]); |
63102
|
0 |
0 |
if( *pEType<1 || *pEType>5 ) return SQLITE_CORRUPT_PGNO(iPtrmap); |
|
0 |
0 |
if( *pEType<1 || *pEType>5 ) return SQLITE_CORRUPT_PGNO(iPtrmap); |
63157
|
0 |
39 |
if( surplus <= maxLocal ){ |
63218
|
229 |
10543 |
if( nPayload>=0x80 ){ |
63223
|
31 |
229 |
}while( (*pIter)>=0x80 && pIter
|
|
31 |
0 |
}while( (*pIter)>=0x80 && pIter
|
63234
|
5365 |
5407 |
if( iKey>=0x80 ){ |
63239
|
5365 |
0 |
if( (*pIter)<0x80 ) break; |
63240
|
0 |
0 |
if( pIter>=pEnd ){ |
63253
|
10733 |
39 |
if( nPayload<=pPage->maxLocal ){ |
63258
|
0 |
10733 |
if( pInfo->nSize<4 ) pInfo->nSize = 4; |
63277
|
0 |
365 |
if( nPayload>=0x80 ){ |
63282
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter
|
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter
|
63290
|
365 |
0 |
if( nPayload<=pPage->maxLocal ){ |
63295
|
1 |
364 |
if( pInfo->nSize<4 ) pInfo->nSize = 4; |
63336
|
15 |
24 |
if( nSize>=0x80 ){ |
63341
|
0 |
15 |
}while( *(pIter)>=0x80 && pIter
|
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter
|
63344
|
39 |
0 |
if( pPage->intKey ){ |
63349
|
6 |
39 |
while( (*pIter++)&0x80 && pIter
|
|
6 |
0 |
while( (*pIter++)&0x80 && pIter
|
63353
|
39 |
0 |
if( nSize<=pPage->maxLocal ){ |
63355
|
0 |
39 |
if( nSize<4 ) nSize = 4; |
63361
|
0 |
0 |
if( nSize>pPage->maxLocal ){ |
63386
|
0 |
0 |
while( (*pIter++)&0x80 && pIter
|
|
0 |
0 |
while( (*pIter++)&0x80 && pIter
|
63408
|
0 |
0 |
if( *pRC ) return; |
63411
|
0 |
0 |
if( info.nLocal
|
63465
|
0 |
0 |
if( (int)data[hdr+7]<=nMaxFrag ){ |
63467
|
0 |
0 |
if( iFree ){ |
63480
|
0 |
0 |
if( 0==iFree2 || (data[iFree2]==0 && data[iFree2+1]==0) ){ |
|
0 |
0 |
if( 0==iFree2 || (data[iFree2]==0 && data[iFree2+1]==0) ){ |
|
0 |
0 |
if( 0==iFree2 || (data[iFree2]==0 && data[iFree2+1]==0) ){ |
63486
|
0 |
0 |
if( top>=iFree ){ |
63489
|
0 |
0 |
if( iFree2 ){ |
63499
|
0 |
0 |
for(pAddr=&data[cellOffset]; pAddr
|
63501
|
0 |
0 |
if( pc
|
63502
|
0 |
0 |
else if( pc
|
63511
|
0 |
0 |
for(i=0; i
|
63520
|
0 |
0 |
if( pciCellLast ){ |
|
0 |
0 |
if( pciCellLast ){ |
63526
|
0 |
0 |
if( cbrkusableSize ){ |
|
0 |
0 |
if( cbrkusableSize ){ |
63533
|
0 |
0 |
if( temp==0 ){ |
63535
|
0 |
0 |
if( cbrk==pc ) continue; |
63546
|
0 |
0 |
if( data[hdr+7]+cbrk-iCellFirst!=pPage->nFree ){ |
63582
|
94 |
0 |
while( pc<=usableSize-4 ){ |
63587
|
32 |
62 |
if( (x = size - nByte)>=0 ){ |
63590
|
0 |
32 |
if( size+pc > usableSize ){ |
63593
|
32 |
0 |
}else if( x<4 ){ |
63596
|
0 |
32 |
if( aData[hdr+7]>57 ) return 0; |
63611
|
62 |
0 |
if( pc
|
63613
|
0 |
62 |
if( pc ){ |
63658
|
0 |
3594 |
if( gap>top ){ |
63659
|
0 |
0 |
if( top==0 && pPage->pBt->usableSize==65536 ){ |
|
0 |
0 |
if( top==0 && pPage->pBt->usableSize==65536 ){ |
63673
|
3500 |
94 |
if( (data[hdr+2] || data[hdr+1]) && gap+2<=top ){ |
|
0 |
3500 |
if( (data[hdr+2] || data[hdr+1]) && gap+2<=top ){ |
|
94 |
0 |
if( (data[hdr+2] || data[hdr+1]) && gap+2<=top ){ |
63675
|
32 |
62 |
if( pSpace ){ |
63679
|
0 |
62 |
}else if( rc ){ |
63688
|
0 |
3562 |
if( gap+2+nByte>top ){ |
63691
|
0 |
0 |
if( rc ) return rc; |
63746
|
258 |
2 |
if( data[iPtr+1]==0 && data[iPtr]==0 ){ |
|
258 |
0 |
if( data[iPtr+1]==0 && data[iPtr]==0 ){ |
63749
|
0 |
2 |
while( (iFreeBlk = get2byte(&data[iPtr]))
|
63750
|
0 |
0 |
if( iFreeBlk
|
63751
|
0 |
0 |
if( iFreeBlk==0 ) break; |
63756
|
0 |
2 |
if( iFreeBlk>pPage->pBt->usableSize-4 ){ |
63767
|
2 |
0 |
if( iFreeBlk && iEnd+3>=iFreeBlk ){ |
|
2 |
0 |
if( iFreeBlk && iEnd+3>=iFreeBlk ){ |
63769
|
0 |
2 |
if( iEnd>iFreeBlk ) return SQLITE_CORRUPT_PAGE(pPage); |
63771
|
0 |
2 |
if( iEnd > pPage->pBt->usableSize ){ |
63782
|
0 |
2 |
if( iPtr>hdr+1 ){ |
63784
|
0 |
0 |
if( iPtrEnd+3>=iStart ){ |
63785
|
0 |
0 |
if( iPtrEnd>iStart ) return SQLITE_CORRUPT_PAGE(pPage); |
63791
|
0 |
2 |
if( nFrag>data[hdr+7] ) return SQLITE_CORRUPT_PAGE(pPage); |
63795
|
196 |
64 |
if( iStart<=x ){ |
63799
|
196 |
0 |
if( iStart
|
|
0 |
196 |
if( iStart
|
63806
|
0 |
260 |
if( pPage->pBt->btsFlags & BTS_FAST_SECURE ){ |
63839
|
534 |
49 |
if( flagByte==(PTF_LEAFDATA | PTF_INTKEY) ){ |
63847
|
530 |
4 |
if( pPage->leaf ){ |
63857
|
49 |
0 |
}else if( flagByte==PTF_ZERODATA ){ |
63912
|
0 |
97 |
if( decodeFlags(pPage, data[hdr]) ){ |
63930
|
0 |
97 |
if( pPage->nCell>MX_CELL(pBt) ){ |
63950
|
0 |
97 |
if( pBt->db->flags & SQLITE_CellSizeCk ){ |
63954
|
0 |
0 |
if( !pPage->leaf ) iCellLast--; |
63955
|
0 |
0 |
for(i=0; inCell; i++){ |
63959
|
0 |
0 |
if( pciCellLast ){ |
|
0 |
0 |
if( pciCellLast ){ |
63964
|
0 |
0 |
if( pc+sz>usableSize ){ |
63968
|
0 |
0 |
if( !pPage->leaf ) iCellLast++; |
63977
|
2 |
95 |
if( pc>0 ){ |
63979
|
0 |
2 |
if( pc
|
63986
|
0 |
2 |
if( pc>iCellLast ){ |
63993
|
2 |
0 |
if( next<=pc+size+3 ) break; |
63996
|
0 |
2 |
if( next>0 ){ |
64000
|
0 |
2 |
if( pc+size>(unsigned int)usableSize ){ |
64013
|
0 |
97 |
if( nFree>usableSize ){ |
64036
|
0 |
486 |
if( pBt->btsFlags & BTS_FAST_SECURE ){ |
64040
|
3 |
483 |
first = hdr + ((flags&PTF_LEAF)==0 ? 12 : 8); |
64064
|
620 |
2052 |
if( pgno!=pPage->pgno ){ |
64069
|
251 |
369 |
pPage->hdrOffset = pgno==1 ? 100 : 0; |
64098
|
0 |
2579 |
if( rc ) return rc; |
64112
|
0 |
0 |
if( pDbPage ){ |
64158
|
0 |
6904 |
if( pgno>btreePagecount(pBt) ){ |
64163
|
0 |
6904 |
if( rc ){ |
64167
|
93 |
6811 |
if( (*ppPage)->isInit==0 ){ |
64170
|
0 |
93 |
if( rc!=SQLITE_OK ){ |
64180
|
1553 |
5351 |
if( pCur && ((*ppPage)->nCell<1 || (*ppPage)->intKey!=pCur->curIntKey) ){ |
|
1553 |
0 |
if( pCur && ((*ppPage)->nCell<1 || (*ppPage)->intKey!=pCur->curIntKey) ){ |
|
0 |
1553 |
if( pCur && ((*ppPage)->nCell<1 || (*ppPage)->intKey!=pCur->curIntKey) ){ |
64188
|
0 |
0 |
if( pCur ){ |
64213
|
142 |
675 |
if( pPage ) releasePageNotNull(pPage); |
64242
|
332 |
0 |
if( rc==SQLITE_OK ){ |
64243
|
0 |
332 |
if( sqlite3PagerPageRefcount((*ppPage)->pDbPage)>1 ){ |
64268
|
29 |
0 |
if( pPage->isInit ){ |
64271
|
1 |
28 |
if( sqlite3PagerPageRefcount(pData)>1 ){ |
64331
|
273 |
39 |
const int isTempDb = zFilename==0 || zFilename[0]==0; |
|
3 |
270 |
const int isTempDb = zFilename==0 || zFilename[0]==0; |
64339
|
114 |
159 |
const int isMemdb = (zFilename && strcmp(zFilename, ":memory:")==0) |
64340
|
42 |
111 |
|| (isTempDb && sqlite3TempInMemory(db)) |
|
0 |
42 |
|| (isTempDb && sqlite3TempInMemory(db)) |
64341
|
273 |
39 |
|| (vfsFlags & SQLITE_OPEN_MEMORY)!=0; |
|
0 |
111 |
|| (vfsFlags & SQLITE_OPEN_MEMORY)!=0; |
64355
|
201 |
111 |
if( isMemdb ){ |
64358
|
273 |
39 |
if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (isMemdb || isTempDb) ){ |
|
111 |
162 |
if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (isMemdb || isTempDb) ){ |
|
0 |
111 |
if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (isMemdb || isTempDb) ){ |
64362
|
0 |
312 |
if( !p ){ |
64377
|
270 |
42 |
if( isTempDb==0 && (isMemdb==0 || (vfsFlags&SQLITE_OPEN_URI)!=0) ){ |
|
159 |
111 |
if( isTempDb==0 && (isMemdb==0 || (vfsFlags&SQLITE_OPEN_URI)!=0) ){ |
|
0 |
159 |
if( isTempDb==0 && (isMemdb==0 || (vfsFlags&SQLITE_OPEN_URI)!=0) ){ |
64378
|
0 |
111 |
if( vfsFlags & SQLITE_OPEN_SHAREDCACHE ){ |
64385
|
0 |
0 |
if( !zFullPathname ){ |
64389
|
0 |
0 |
if( isMemdb ){ |
64394
|
0 |
0 |
if( rc ){ |
64406
|
0 |
0 |
for(pBt=GLOBAL(BtShared*,sqlite3SharedCacheList); pBt; pBt=pBt->pNext){ |
64408
|
0 |
0 |
if( 0==strcmp(zFullPathname, sqlite3PagerFilename(pBt->pPager, 0)) |
64409
|
0 |
0 |
&& sqlite3PagerVfs(pBt->pPager)==pVfs ){ |
64411
|
0 |
0 |
for(iDb=db->nDb-1; iDb>=0; iDb--){ |
64413
|
0 |
0 |
if( pExisting && pExisting->pBt==pBt ){ |
|
0 |
0 |
if( pExisting && pExisting->pBt==pBt ){ |
64441
|
312 |
0 |
if( pBt==0 ){ |
64454
|
0 |
312 |
if( pBt==0 ){ |
64460
|
306 |
6 |
if( rc==SQLITE_OK ){ |
64464
|
6 |
306 |
if( rc!=SQLITE_OK ){ |
64474
|
5 |
301 |
if( sqlite3PagerIsreadonly(pBt->pPager) ) pBt->btsFlags |= BTS_READ_ONLY; |
64484
|
27 |
279 |
if( pBt->pageSize<512 || pBt->pageSize>SQLITE_MAX_PAGE_SIZE |
|
27 |
0 |
if( pBt->pageSize<512 || pBt->pageSize>SQLITE_MAX_PAGE_SIZE |
64485
|
0 |
27 |
|| ((pBt->pageSize-1)&pBt->pageSize)!=0 ){ |
64494
|
240 |
39 |
if( zFilename && !isMemdb ){ |
|
78 |
162 |
if( zFilename && !isMemdb ){ |
64512
|
0 |
306 |
if( rc ) goto btree_open_out; |
64520
|
0 |
306 |
if( p->sharable ){ |
64543
|
0 |
306 |
if( p->sharable ){ |
64546
|
0 |
0 |
for(i=0; inDb; i++){ |
64547
|
0 |
0 |
if( (pSib = db->aDb[i].pBt)!=0 && pSib->sharable ){ |
|
0 |
0 |
if( (pSib = db->aDb[i].pBt)!=0 && pSib->sharable ){ |
64548
|
0 |
0 |
while( pSib->pPrev ){ pSib = pSib->pPrev; } |
64549
|
0 |
0 |
if( (uptr)p->pBt<(uptr)pSib->pBt ){ |
64554
|
0 |
0 |
while( pSib->pNext && (uptr)pSib->pNext->pBt<(uptr)p->pBt ){ |
|
0 |
0 |
while( pSib->pNext && (uptr)pSib->pNext->pBt<(uptr)p->pBt ){ |
64559
|
0 |
0 |
if( p->pNext ){ |
64572
|
6 |
306 |
if( rc!=SQLITE_OK ){ |
64573
|
6 |
0 |
if( pBt && pBt->pPager ){ |
|
0 |
6 |
if( pBt && pBt->pPager ){ |
64586
|
306 |
0 |
if( sqlite3BtreeSchema(p, 0, 0)==0 ){ |
64591
|
105 |
201 |
if( pFile->pMethods ){ |
64619
|
0 |
0 |
if( pBt->nRef<=0 ){ |
64620
|
0 |
0 |
if( GLOBAL(BtShared*,sqlite3SharedCacheList)==pBt ){ |
64624
|
0 |
0 |
while( ALWAYS(pList) && pList->pNext!=pBt ){ |
|
0 |
0 |
while( ALWAYS(pList) && pList->pNext!=pBt ){ |
64627
|
0 |
0 |
if( ALWAYS(pList) ){ |
64649
|
177 |
3692 |
if( !pBt->pTmpSpace ){ |
64667
|
177 |
0 |
if( pBt->pTmpSpace ){ |
64678
|
175 |
131 |
if( pBt->pTmpSpace ){ |
64696
|
8 |
304 |
while( pCur ){ |
64699
|
8 |
0 |
if( pTmp->pBtree==p ){ |
64716
|
0 |
304 |
if( !p->sharable || removeFromSharingList(pBt) ){ |
|
0 |
0 |
if( !p->sharable || removeFromSharingList(pBt) ){ |
64724
|
265 |
39 |
if( pBt->xFreeSchema && pBt->pSchema ){ |
|
265 |
0 |
if( pBt->xFreeSchema && pBt->pSchema ){ |
64735
|
0 |
304 |
if( p->pPrev ) p->pPrev->pNext = p->pNext; |
64736
|
0 |
304 |
if( p->pNext ) p->pNext->pPrev = p->pPrev; |
64842
|
0 |
35 |
if( nReserve>pBt->optimalReserve ) pBt->optimalReserve = (u8)nReserve; |
64844
|
2 |
33 |
if( pBt->btsFlags & BTS_PAGESIZE_FIXED ){ |
64848
|
33 |
0 |
if( nReserve<0 ){ |
64852
|
2 |
31 |
if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE && |
|
2 |
0 |
if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE && |
|
2 |
0 |
if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE && |
64861
|
0 |
33 |
if( iFix ) pBt->btsFlags |= BTS_PAGESIZE_FIXED; |
64905
|
0 |
15 |
if( npBt->optimalReserve ) n = p->pBt->optimalReserve; |
64945
|
0 |
10 |
if( p==0 ) return 0; |
64949
|
5 |
5 |
if( newFlag>=0 ){ |
64973
|
0 |
0 |
if( (pBt->btsFlags & BTS_PAGESIZE_FIXED)!=0 && (av ?1:0)!=pBt->autoVacuum ){ |
|
0 |
0 |
if( (pBt->btsFlags & BTS_PAGESIZE_FIXED)!=0 && (av ?1:0)!=pBt->autoVacuum ){ |
64995
|
0 |
0 |
(!p->pBt->autoVacuum)?BTREE_AUTOVACUUM_NONE: |
64996
|
0 |
0 |
(!p->pBt->incrVacuum)?BTREE_AUTOVACUUM_FULL: |
65054
|
2 |
2189 |
if( rc!=SQLITE_OK ) return rc; |
65056
|
0 |
2189 |
if( rc!=SQLITE_OK ) return rc; |
65063
|
1841 |
348 |
if( nPage==0 || memcmp(24+(u8*)pPage1->aData, 92+(u8*)pPage1->aData,4)!=0 ){ |
|
0 |
1841 |
if( nPage==0 || memcmp(24+(u8*)pPage1->aData, 92+(u8*)pPage1->aData,4)!=0 ){ |
65066
|
0 |
2189 |
if( (pBt->db->flags & SQLITE_ResetDatabase)!=0 ){ |
65069
|
1841 |
348 |
if( nPage>0 ){ |
65077
|
0 |
1841 |
if( memcmp(page1, zMagicHeader, 16)!=0 ){ |
65089
|
0 |
1841 |
if( page1[18]>2 ){ |
65092
|
0 |
1841 |
if( page1[19]>2 ){ |
65104
|
0 |
1841 |
if( page1[19]==2 && (pBt->btsFlags & BTS_NO_WAL)==0 ){ |
|
0 |
0 |
if( page1[19]==2 && (pBt->btsFlags & BTS_NO_WAL)==0 ){ |
65107
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65111
|
0 |
0 |
if( isOpen==0 ){ |
65128
|
0 |
1841 |
if( memcmp(&page1[21], "\100\040\040",3)!=0 ){ |
65137
|
1841 |
0 |
if( ((pageSize-1)&pageSize)!=0 |
65138
|
1841 |
0 |
|| pageSize>SQLITE_MAX_PAGE_SIZE |
65139
|
1841 |
0 |
|| pageSize<=256 |
65152
|
0 |
1841 |
if( (u32)pageSize!=pBt->pageSize ){ |
65167
|
1841 |
0 |
if( (pBt->db->flags & SQLITE_WriteSchema)==0 && nPage>nPageFile ){ |
|
0 |
1841 |
if( (pBt->db->flags & SQLITE_WriteSchema)==0 && nPage>nPageFile ){ |
65174
|
0 |
1841 |
if( usableSize<480 ){ |
65202
|
2189 |
0 |
if( pBt->maxLocal>127 ){ |
65253
|
2796 |
5571 |
if( pBt->inTransaction==TRANS_NONE && pBt->pPage1!=0 ){ |
|
2189 |
607 |
if( pBt->inTransaction==TRANS_NONE && pBt->pPage1!=0 ){ |
65273
|
875 |
167 |
if( pBt->nPage>0 ){ |
65280
|
0 |
167 |
if( rc ) return rc; |
65366
|
2440 |
2877 |
if( p->inTrans==TRANS_WRITE || (p->inTrans==TRANS_READ && !wrflag) ){ |
|
394 |
2046 |
if( p->inTrans==TRANS_WRITE || (p->inTrans==TRANS_READ && !wrflag) ){ |
|
0 |
394 |
if( p->inTrans==TRANS_WRITE || (p->inTrans==TRANS_READ && !wrflag) ){ |
65372
|
4 |
2042 |
if( (pBt->btsFlags & BTS_READ_ONLY)!=0 && wrflag ){ |
|
2 |
2 |
if( (pBt->btsFlags & BTS_READ_ONLY)!=0 && wrflag ){ |
65384
|
1048 |
996 |
if( (wrflag && pBt->inTransaction==TRANS_WRITE) |
|
1048 |
0 |
if( (wrflag && pBt->inTransaction==TRANS_WRITE) |
65385
|
0 |
2044 |
|| (pBt->btsFlags & BTS_PENDING)!=0 |
65388
|
10 |
2034 |
}else if( wrflag>1 ){ |
65390
|
0 |
10 |
for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){ |
65391
|
0 |
0 |
if( pIter->pBtree!=p ){ |
65397
|
0 |
2044 |
if( pBlock ){ |
65409
|
0 |
2044 |
if( SQLITE_OK!=rc ) goto trans_begun; |
65412
|
382 |
1662 |
if( pBt->nPage==0 ) pBt->btsFlags |= BTS_INITIALLY_EMPTY; |
65421
|
2191 |
2189 |
while( pBt->pPage1==0 && SQLITE_OK==(rc = lockBtree(pBt)) ); |
|
2189 |
2 |
while( pBt->pPage1==0 && SQLITE_OK==(rc = lockBtree(pBt)) ); |
65423
|
2189 |
2 |
if( rc==SQLITE_OK && wrflag ){ |
|
1193 |
996 |
if( rc==SQLITE_OK && wrflag ){ |
65424
|
0 |
1193 |
if( (pBt->btsFlags & BTS_READ_ONLY)!=0 ){ |
65428
|
1041 |
152 |
if( rc==SQLITE_OK ){ |
65434
|
154 |
2037 |
if( rc!=SQLITE_OK ){ |
65438
|
154 |
2037 |
btreeInvokeBusyHandler(pBt) ); |
65441
|
2037 |
7 |
if( rc==SQLITE_OK ){ |
65442
|
2037 |
0 |
if( p->inTrans==TRANS_NONE ){ |
65445
|
0 |
2037 |
if( p->sharable ){ |
65453
|
1041 |
996 |
p->inTrans = (wrflag?TRANS_WRITE:TRANS_READ); |
65454
|
2037 |
0 |
if( p->inTrans>pBt->inTransaction ){ |
65457
|
1041 |
996 |
if( wrflag ){ |
65463
|
10 |
1031 |
if( wrflag>1 ) pBt->btsFlags |= BTS_EXCLUSIVE; |
65472
|
0 |
1041 |
if( pBt->nPage!=get4byte(&pPage1->aData[28]) ){ |
65474
|
0 |
0 |
if( rc==SQLITE_OK ){ |
65483
|
5308 |
9 |
if( rc==SQLITE_OK && wrflag ){ |
|
3501 |
1807 |
if( rc==SQLITE_OK && wrflag ){ |
65511
|
0 |
0 |
rc = pPage->isInit ? SQLITE_OK : btreeInitPage(pPage); |
65512
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
65515
|
0 |
0 |
for(i=0; i
|
65520
|
0 |
0 |
if( !pPage->leaf ){ |
65526
|
0 |
0 |
if( !pPage->leaf ){ |
65551
|
0 |
0 |
if( eType==PTRMAP_OVERFLOW2 ){ |
65553
|
0 |
0 |
if( get4byte(pPage->aData)!=iFrom ){ |
65562
|
0 |
0 |
rc = pPage->isInit ? SQLITE_OK : btreeInitPage(pPage); |
65563
|
0 |
0 |
if( rc ) return rc; |
65566
|
0 |
0 |
for(i=0; i
|
65568
|
0 |
0 |
if( eType==PTRMAP_OVERFLOW1 ){ |
65571
|
0 |
0 |
if( info.nLocal
|
65572
|
0 |
0 |
if( pCell+info.nSize > pPage->aData+pPage->pBt->usableSize ){ |
65575
|
0 |
0 |
if( iFrom==get4byte(pCell+info.nSize-4) ){ |
65581
|
0 |
0 |
if( get4byte(pCell)==iFrom ){ |
65588
|
0 |
0 |
if( i==nCell ){ |
65631
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65644
|
0 |
0 |
if( eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE ){ |
|
0 |
0 |
if( eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE ){ |
65646
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65651
|
0 |
0 |
if( nextOvfl!=0 ){ |
65653
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65663
|
0 |
0 |
if( eType!=PTRMAP_ROOTPAGE ){ |
65665
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65669
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65675
|
0 |
0 |
if( rc==SQLITE_OK ){ |
65709
|
0 |
0 |
if( !PTRMAP_ISPAGE(pBt, iLastPg) && iLastPg!=PENDING_BYTE_PAGE(pBt) ){ |
|
0 |
0 |
if( !PTRMAP_ISPAGE(pBt, iLastPg) && iLastPg!=PENDING_BYTE_PAGE(pBt) ){ |
65714
|
0 |
0 |
if( nFreeList==0 ){ |
65719
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65722
|
0 |
0 |
if( eType==PTRMAP_ROOTPAGE ){ |
65726
|
0 |
0 |
if( eType==PTRMAP_FREEPAGE ){ |
65727
|
0 |
0 |
if( bCommit==0 ){ |
65736
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65749
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65760
|
0 |
0 |
if( bCommit==0 ){ |
65767
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65772
|
0 |
0 |
}while( bCommit && iFreePg>nFin ); |
|
0 |
0 |
}while( bCommit && iFreePg>nFin ); |
65777
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65783
|
0 |
0 |
if( bCommit==0 ){ |
65786
|
0 |
0 |
}while( iLastPg==PENDING_BYTE_PAGE(pBt) || PTRMAP_ISPAGE(pBt, iLastPg) ); |
|
0 |
0 |
}while( iLastPg==PENDING_BYTE_PAGE(pBt) || PTRMAP_ISPAGE(pBt, iLastPg) ); |
65806
|
0 |
0 |
if( nOrig>PENDING_BYTE_PAGE(pBt) && nFin
|
|
0 |
0 |
if( nOrig>PENDING_BYTE_PAGE(pBt) && nFin
|
65809
|
0 |
0 |
while( PTRMAP_ISPAGE(pBt, nFin) || nFin==PENDING_BYTE_PAGE(pBt) ){ |
|
0 |
0 |
while( PTRMAP_ISPAGE(pBt, nFin) || nFin==PENDING_BYTE_PAGE(pBt) ){ |
65830
|
0 |
0 |
if( !pBt->autoVacuum ){ |
65837
|
0 |
0 |
if( nOrig
|
65839
|
0 |
0 |
}else if( nFree>0 ){ |
65841
|
0 |
0 |
if( rc==SQLITE_OK ){ |
65845
|
0 |
0 |
if( rc==SQLITE_OK ){ |
65874
|
0 |
0 |
if( !pBt->incrVacuum ){ |
65881
|
0 |
0 |
if( PTRMAP_ISPAGE(pBt, nOrig) || nOrig==PENDING_BYTE_PAGE(pBt) ){ |
|
0 |
0 |
if( PTRMAP_ISPAGE(pBt, nOrig) || nOrig==PENDING_BYTE_PAGE(pBt) ){ |
65891
|
0 |
0 |
if( nFin>nOrig ) return SQLITE_CORRUPT_BKPT; |
65892
|
0 |
0 |
if( nFin
|
65895
|
0 |
0 |
for(iFree=nOrig; iFree>nFin && rc==SQLITE_OK; iFree--){ |
|
0 |
0 |
for(iFree=nOrig; iFree>nFin && rc==SQLITE_OK; iFree--){ |
65898
|
0 |
0 |
if( (rc==SQLITE_DONE || rc==SQLITE_OK) && nFree>0 ){ |
|
0 |
0 |
if( (rc==SQLITE_DONE || rc==SQLITE_OK) && nFree>0 ){ |
|
0 |
0 |
if( (rc==SQLITE_DONE || rc==SQLITE_OK) && nFree>0 ){ |
65906
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65947
|
985 |
1798 |
if( p->inTrans==TRANS_WRITE ){ |
65951
|
0 |
985 |
if( pBt->autoVacuum ){ |
65953
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65958
|
0 |
985 |
if( pBt->bDoTruncate ){ |
65980
|
2273 |
605 |
if( p->inTrans>TRANS_NONE && db->nVdbeRead>1 ){ |
|
236 |
2037 |
if( p->inTrans>TRANS_NONE && db->nVdbeRead>1 ){ |
65991
|
2037 |
605 |
if( p->inTrans!=TRANS_NONE ){ |
65994
|
2037 |
0 |
if( 0==pBt->nTransaction ){ |
66036
|
568 |
2219 |
if( p->inTrans==TRANS_NONE ) return SQLITE_OK; |
66043
|
989 |
1230 |
if( p->inTrans==TRANS_WRITE ){ |
66049
|
0 |
989 |
if( rc!=SQLITE_OK && bCleanup==0 ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && bCleanup==0 ){ |
66070
|
179 |
0 |
if( rc==SQLITE_OK ){ |
66108
|
29 |
1 |
if( pBtree ){ |
66110
|
0 |
29 |
for(p=pBtree->pBt->pCursor; p; p=p->pNext){ |
66111
|
0 |
0 |
if( writeOnly && (p->curFlags & BTCF_WriteFlag)==0 ){ |
|
0 |
0 |
if( writeOnly && (p->curFlags & BTCF_WriteFlag)==0 ){ |
66112
|
0 |
0 |
if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){ |
|
0 |
0 |
if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){ |
66114
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
66150
|
631 |
28 |
if( tripCode==SQLITE_OK ){ |
66152
|
0 |
631 |
if( rc ) writeOnly = 0; |
66156
|
28 |
631 |
if( tripCode ){ |
66159
|
0 |
28 |
if( rc2!=SQLITE_OK ) rc = rc2; |
66163
|
52 |
607 |
if( p->inTrans==TRANS_WRITE ){ |
66168
|
0 |
52 |
if( rc2!=SQLITE_OK ){ |
66175
|
52 |
0 |
if( btreeGetPage(pBt, 1, &pPage1, 0)==SQLITE_OK ){ |
66178
|
5 |
47 |
if( nPage==0 ) sqlite3PagerPagecount(pBt->pPager, &nPage); |
66244
|
3 |
3 |
if( p && p->inTrans==TRANS_WRITE ){ |
|
1 |
2 |
if( p && p->inTrans==TRANS_WRITE ){ |
66249
|
1 |
0 |
if( op==SAVEPOINT_ROLLBACK ){ |
66252
|
1 |
0 |
if( rc==SQLITE_OK ){ |
66255
|
1 |
0 |
if( rc==SQLITE_OK ){ |
66256
|
0 |
1 |
if( iSavepoint<0 && (pBt->btsFlags & BTS_INITIALLY_EMPTY)!=0 ){ |
|
0 |
0 |
if( iSavepoint<0 && (pBt->btsFlags & BTS_INITIALLY_EMPTY)!=0 ){ |
66343
|
3869 |
1702 |
if( wrFlag ){ |
66345
|
0 |
3869 |
if( pBt->pTmpSpace==0 ) return SQLITE_NOMEM_BKPT; |
66347
|
1081 |
4490 |
if( iTable==1 && btreePagecount(pBt)==0 ){ |
|
179 |
902 |
if( iTable==1 && btreePagecount(pBt)==0 ){ |
66360
|
3869 |
1702 |
pCur->curPagerFlags = wrFlag ? 0 : PAGER_GET_READONLY; |
66363
|
722 |
5571 |
for(pX=pBt->pCursor; pX; pX=pX->pNext){ |
66364
|
468 |
254 |
if( pX->pgnoRoot==(Pgno)iTable ){ |
66382
|
0 |
5571 |
if( iTable<1 ){ |
66422
|
5571 |
0 |
if( pBtree ){ |
66426
|
5317 |
254 |
if( pBt->pCursor==pCur ){ |
66431
|
254 |
6 |
if( pPrev->pNext==pCur ){ |
66436
|
6 |
0 |
}while( ALWAYS(pPrev) ); |
66474
|
10638 |
972 |
if( pCur->info.nSize==0 ){ |
66580
|
0 |
0 |
if( pBt->autoVacuum ){ |
66585
|
0 |
0 |
while( PTRMAP_ISPAGE(pBt, iGuess) || iGuess==PENDING_BYTE_PAGE(pBt) ){ |
|
0 |
0 |
while( PTRMAP_ISPAGE(pBt, iGuess) || iGuess==PENDING_BYTE_PAGE(pBt) ){ |
66589
|
0 |
0 |
if( iGuess<=btreePagecount(pBt) ){ |
66591
|
0 |
0 |
if( rc==SQLITE_OK && eType==PTRMAP_OVERFLOW2 && pgno==ovfl ){ |
|
0 |
0 |
if( rc==SQLITE_OK && eType==PTRMAP_OVERFLOW2 && pgno==ovfl ){ |
|
0 |
0 |
if( rc==SQLITE_OK && eType==PTRMAP_OVERFLOW2 && pgno==ovfl ){ |
66600
|
0 |
0 |
if( rc==SQLITE_OK ){ |
66601
|
0 |
0 |
rc = btreeGetPage(pBt, ovfl, &pPage, (ppPage==0) ? PAGER_GET_READONLY : 0); |
66603
|
0 |
0 |
if( rc==SQLITE_OK ){ |
66609
|
0 |
0 |
if( ppPage ){ |
66614
|
0 |
0 |
return (rc==SQLITE_DONE ? SQLITE_OK : rc); |
66635
|
0 |
118 |
if( eOp ){ |
66638
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
66705
|
0 |
66 |
if( (uptr)(aPayload - pPage->aData) > (pBt->usableSize - pCur->info.nLocal) ){ |
66715
|
66 |
0 |
if( offsetinfo.nLocal ){ |
66717
|
10 |
56 |
if( a+offset>pCur->info.nLocal ){ |
66729
|
66 |
0 |
if( rc==SQLITE_OK && amt>0 ){ |
|
10 |
56 |
if( rc==SQLITE_OK && amt>0 ){ |
66742
|
10 |
0 |
if( (pCur->curFlags & BTCF_ValidOvfl)==0 ){ |
66744
|
2 |
8 |
if( pCur->aOverflow==0 |
66745
|
0 |
2 |
|| nOvfl*(int)sizeof(Pgno) > sqlite3MallocSize(pCur->aOverflow) |
66750
|
0 |
8 |
if( aNew==0 ){ |
66763
|
0 |
0 |
if( pCur->aOverflow[offset/ovflSize] ){ |
66771
|
52 |
0 |
while( nextPage ){ |
66778
|
0 |
52 |
if( offset>=ovflSize ){ |
66787
|
0 |
0 |
if( pCur->aOverflow[iIdx+1] ){ |
66801
|
42 |
10 |
if( a + offset > ovflSize ){ |
66838
|
52 |
0 |
rc = sqlite3PagerGet(pBt->pPager, nextPage, &pDbPage, |
66841
|
52 |
0 |
if( rc==SQLITE_OK ){ |
66850
|
10 |
42 |
if( amt==0 ) return rc; |
66853
|
0 |
42 |
if( rc ) break; |
66858
|
56 |
0 |
if( rc==SQLITE_OK && amt>0 ){ |
|
0 |
56 |
if( rc==SQLITE_OK && amt>0 ){ |
66903
|
0 |
0 |
if ( pCur->eState==CURSOR_INVALID ){ |
66908
|
0 |
0 |
return rc ? rc : accessPayload(pCur, offset, amt, pBuf, 0); |
66911
|
60 |
0 |
if( pCur->eState==CURSOR_VALID ){ |
66953
|
0 |
8115 |
if( amt>(int)(pCur->pPage->aDataEnd - pCur->info.pPayload) ){ |
66999
|
0 |
1553 |
if( pCur->iPage>=(BTCURSOR_MAX_DEPTH-1) ){ |
67093
|
619 |
5492 |
if( pCur->iPage>=0 ){ |
67094
|
66 |
553 |
if( pCur->iPage ){ |
67096
|
0 |
66 |
while( --pCur->iPage ){ |
67102
|
179 |
5313 |
}else if( pCur->pgnoRoot==0 ){ |
67107
|
0 |
5313 |
if( pCur->eState>=CURSOR_REQUIRESEEK ){ |
67108
|
0 |
0 |
if( pCur->eState==CURSOR_FAULT ){ |
67116
|
0 |
5313 |
if( rc!=SQLITE_OK ){ |
67137
|
5866 |
0 |
if( pRoot->isInit==0 || (pCur->pKeyInfo==0)!=pRoot->intKey ){ |
|
0 |
5866 |
if( pRoot->isInit==0 || (pCur->pKeyInfo==0)!=pRoot->intKey ){ |
67147
|
5147 |
785 |
if( pRoot->nCell>0 ){ |
67149
|
0 |
785 |
}else if( !pRoot->leaf ){ |
67151
|
0 |
0 |
if( pRoot->pgno!=1 ) return SQLITE_CORRUPT_BKPT; |
67176
|
894 |
0 |
while( rc==SQLITE_OK && !(pPage = pCur->pPage)->leaf ){ |
|
17 |
877 |
while( rc==SQLITE_OK && !(pPage = pCur->pPage)->leaf ){ |
67201
|
1437 |
2803 |
while( !(pPage = pCur->pPage)->leaf ){ |
67205
|
0 |
1437 |
if( rc ) return rc; |
67223
|
858 |
251 |
if( rc==SQLITE_OK ){ |
67227
|
251 |
0 |
}else if( rc==SQLITE_EMPTY ){ |
67246
|
2 |
3125 |
if( CURSOR_VALID==pCur->eState && (pCur->curFlags & BTCF_AtLast)!=0 ){ |
|
1 |
1 |
if( CURSOR_VALID==pCur->eState && (pCur->curFlags & BTCF_AtLast)!=0 ){ |
67261
|
2803 |
323 |
if( rc==SQLITE_OK ){ |
67265
|
2803 |
0 |
if( rc==SQLITE_OK ){ |
67270
|
323 |
0 |
}else if( rc==SQLITE_EMPTY ){ |
67326
|
4416 |
229 |
if( pIdxKey==0 |
67327
|
3067 |
1349 |
&& pCur->eState==CURSOR_VALID && (pCur->curFlags & BTCF_ValidNKey)!=0 |
|
3061 |
6 |
&& pCur->eState==CURSOR_VALID && (pCur->curFlags & BTCF_ValidNKey)!=0 |
67329
|
0 |
3061 |
if( pCur->info.nKey==intKey ){ |
67333
|
2838 |
223 |
if( pCur->info.nKey
|
67334
|
2797 |
41 |
if( (pCur->curFlags & BTCF_AtLast)!=0 ){ |
67342
|
7 |
34 |
if( pCur->info.nKey+1==intKey && !pCur->skipNext ){ |
|
7 |
0 |
if( pCur->info.nKey+1==intKey && !pCur->skipNext ){ |
67345
|
7 |
0 |
if( rc==SQLITE_OK ){ |
67347
|
7 |
0 |
if( pCur->info.nKey==intKey ){ |
67350
|
0 |
0 |
}else if( rc==SQLITE_DONE ){ |
67359
|
229 |
1612 |
if( pIdxKey ){ |
67371
|
374 |
1467 |
if( rc ){ |
67372
|
374 |
0 |
if( rc==SQLITE_EMPTY ){ |
67404
|
1369 |
191 |
if( xRecordCompare==0 ){ |
67408
|
3395 |
327 |
if( pPage->intKeyLeaf ){ |
67409
|
145 |
3395 |
while( 0x80 <= *(pCell++) ){ |
67410
|
0 |
145 |
if( pCell>=pPage->aDataEnd ){ |
67416
|
2461 |
1261 |
if( nCellKey
|
67418
|
222 |
2239 |
if( lwr>upr ){ c = -1; break; } |
67419
|
123 |
1138 |
}else if( nCellKey>intKey ){ |
67421
|
9 |
114 |
if( lwr>upr ){ c = +1; break; } |
67425
|
45 |
1093 |
if( !pPage->leaf ){ |
67453
|
397 |
0 |
if( nCell<=pPage->max1bytePayload ){ |
67459
|
0 |
0 |
}else if( !(pCell[1] & 0x80) |
67460
|
0 |
0 |
&& (nCell = ((nCell&0x7f)<<7) + pCell[1])<=pPage->maxLocal |
67484
|
0 |
0 |
if( nCell<2 ){ |
67489
|
0 |
0 |
if( pCellKey==0 ){ |
67496
|
0 |
0 |
if( rc ){ |
67507
|
361 |
36 |
if( c<0 ){ |
67509
|
33 |
3 |
}else if( c>0 ){ |
67516
|
0 |
3 |
if( pIdxKey->errCode ) rc = SQLITE_CORRUPT_BKPT; |
67519
|
188 |
206 |
if( lwr>upr ) break; |
67526
|
371 |
48 |
if( pPage->leaf ){ |
67534
|
42 |
51 |
if( lwr>=pPage->nCell ){ |
67541
|
0 |
93 |
if( rc ) break; |
67580
|
0 |
0 |
if( NEVER(pCur->eState!=CURSOR_VALID) ) return -1; |
67581
|
0 |
0 |
if( NEVER(pCur->pPage->leaf==0) ) return -1; |
67584
|
0 |
0 |
for(i=0; iiPage; i++){ |
67617
|
18 |
667 |
if( pCur->eState!=CURSOR_VALID ){ |
67619
|
18 |
0 |
rc = restoreCursorPosition(pCur); |
67620
|
0 |
18 |
if( rc!=SQLITE_OK ){ |
67623
|
8 |
10 |
if( CURSOR_INVALID==pCur->eState ){ |
67626
|
10 |
0 |
if( pCur->skipNext ){ |
67629
|
3 |
7 |
if( pCur->skipNext>0 ){ |
67648
|
673 |
1 |
if( idx>=pPage->nCell ){ |
67649
|
6 |
667 |
if( !pPage->leaf ){ |
67651
|
0 |
6 |
if( rc ) return rc; |
67655
|
648 |
23 |
if( pCur->iPage==0 ){ |
67661
|
4 |
19 |
}while( pCur->ix>=pPage->nCell ); |
67662
|
19 |
0 |
if( pPage->intKey ){ |
67668
|
1 |
0 |
if( pPage->leaf ){ |
67682
|
18 |
6474 |
if( pCur->eState!=CURSOR_VALID ) return btreeNext(pCur); |
67684
|
667 |
5807 |
if( (++pCur->ix)>=pPage->nCell ){ |
67688
|
5794 |
13 |
if( pPage->leaf ){ |
67723
|
0 |
85 |
if( pCur->eState!=CURSOR_VALID ){ |
67724
|
0 |
0 |
rc = restoreCursorPosition(pCur); |
67725
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
67728
|
0 |
0 |
if( CURSOR_INVALID==pCur->eState ){ |
67731
|
0 |
0 |
if( pCur->skipNext ){ |
67734
|
0 |
0 |
if( pCur->skipNext<0 ){ |
67744
|
0 |
85 |
if( !pPage->leaf ){ |
67747
|
0 |
0 |
if( rc ) return rc; |
67750
|
85 |
0 |
while( pCur->ix==0 ){ |
67751
|
85 |
0 |
if( pCur->iPage==0 ){ |
67762
|
0 |
0 |
if( pPage->intKey && !pPage->leaf ){ |
|
0 |
0 |
if( pPage->intKey && !pPage->leaf ){ |
67777
|
276 |
0 |
if( pCur->eState!=CURSOR_VALID |
67778
|
191 |
85 |
|| pCur->ix==0 |
67779
|
0 |
191 |
|| pCur->pPage->leaf==0 |
67832
|
0 |
331 |
if( n>=mxPage ){ |
67835
|
2 |
329 |
if( n>0 ){ |
67846
|
0 |
2 |
if( eMode==BTALLOC_EXACT ){ |
67847
|
0 |
0 |
if( nearby<=mxPage ){ |
67852
|
0 |
0 |
if( rc ) return rc; |
67853
|
0 |
0 |
if( eType==PTRMAP_FREEPAGE ){ |
67857
|
0 |
2 |
}else if( eMode==BTALLOC_LE ){ |
67866
|
0 |
2 |
if( rc ) return rc; |
67876
|
0 |
2 |
if( pPrevTrunk ){ |
67888
|
2 |
0 |
if( iTrunk>mxPage || nSearch++ > n ){ |
|
0 |
2 |
if( iTrunk>mxPage || nSearch++ > n ){ |
67893
|
0 |
2 |
if( rc ){ |
67902
|
1 |
1 |
if( k==0 && !searchList ){ |
|
1 |
0 |
if( k==0 && !searchList ){ |
67908
|
0 |
1 |
if( rc ){ |
67916
|
0 |
1 |
}else if( k>(u32)(pBt->usableSize/4 - 2) ){ |
67921
|
0 |
1 |
}else if( searchList |
67922
|
0 |
0 |
&& (nearby==iTrunk || (iTrunk
|
|
0 |
0 |
&& (nearby==iTrunk || (iTrunk
|
|
0 |
0 |
&& (nearby==iTrunk || (iTrunk
|
67931
|
0 |
0 |
if( rc ){ |
67934
|
0 |
0 |
if( k==0 ){ |
67935
|
0 |
0 |
if( !pPrevTrunk ){ |
67939
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
67951
|
0 |
0 |
if( iNewTrunk>mxPage ){ |
67957
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
67961
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
67969
|
0 |
0 |
if( !pPrevTrunk ){ |
67974
|
0 |
0 |
if( rc ){ |
67983
|
1 |
0 |
}else if( k>0 ){ |
67988
|
1 |
0 |
if( nearby>0 ){ |
67991
|
0 |
1 |
if( eMode==BTALLOC_LE ){ |
67992
|
0 |
0 |
for(i=0; i
|
67994
|
0 |
0 |
if( iPage<=nearby ){ |
68002
|
0 |
1 |
for(i=1; i
|
68004
|
0 |
0 |
if( d2
|
68016
|
0 |
1 |
if( iPage>mxPage ){ |
68021
|
0 |
1 |
if( !searchList |
68022
|
0 |
0 |
|| (iPage==nearby || (iPage
|
|
0 |
0 |
|| (iPage==nearby || (iPage
|
|
0 |
0 |
|| (iPage==nearby || (iPage
|
68030
|
0 |
1 |
if( rc ) goto end_allocate_page; |
68031
|
0 |
1 |
if( closest
|
68037
|
1 |
0 |
if( rc==SQLITE_OK ){ |
68039
|
0 |
1 |
if( rc!=SQLITE_OK ){ |
68049
|
0 |
2 |
}while( searchList ); |
68072
|
0 |
329 |
if( rc ) return rc; |
68074
|
0 |
329 |
if( pBt->nPage==PENDING_BYTE_PAGE(pBt) ) pBt->nPage++; |
68077
|
0 |
329 |
if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt, pBt->nPage) ){ |
|
0 |
0 |
if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt, pBt->nPage) ){ |
68086
|
0 |
0 |
if( rc==SQLITE_OK ){ |
68090
|
0 |
0 |
if( rc ) return rc; |
68092
|
0 |
0 |
if( pBt->nPage==PENDING_BYTE_PAGE(pBt) ){ pBt->nPage++; } |
68100
|
0 |
329 |
if( rc ) return rc; |
68102
|
0 |
329 |
if( rc!=SQLITE_OK ){ |
68143
|
0 |
5 |
if( iPage<2 ) return SQLITE_CORRUPT_BKPT; |
68144
|
5 |
0 |
if( pMemPage ){ |
68153
|
0 |
5 |
if( rc ) goto freepage_out; |
68157
|
0 |
5 |
if( pBt->btsFlags & BTS_SECURE_DELETE ){ |
68161
|
0 |
0 |
if( (!pPage && ((rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0) ) |
|
0 |
0 |
if( (!pPage && ((rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0) ) |
68162
|
0 |
0 |
|| ((rc = sqlite3PagerWrite(pPage->pDbPage))!=0) |
68172
|
0 |
5 |
if( ISAUTOVACUUM ){ |
68174
|
0 |
0 |
if( rc ) goto freepage_out; |
68184
|
1 |
4 |
if( nFree!=0 ){ |
68189
|
0 |
1 |
if( rc!=SQLITE_OK ){ |
68195
|
0 |
1 |
if( nLeaf > (u32)pBt->usableSize/4 - 2 ){ |
68199
|
1 |
0 |
if( nLeaf < (u32)pBt->usableSize/4 - 8 ){ |
68220
|
1 |
0 |
if( rc==SQLITE_OK ){ |
68223
|
1 |
0 |
if( pPage && (pBt->btsFlags & BTS_SECURE_DELETE)==0 ){ |
|
1 |
0 |
if( pPage && (pBt->btsFlags & BTS_SECURE_DELETE)==0 ){ |
68239
|
0 |
4 |
if( pPage==0 && SQLITE_OK!=(rc = btreeGetPage(pBt, iPage, &pPage, 0)) ){ |
|
0 |
0 |
if( pPage==0 && SQLITE_OK!=(rc = btreeGetPage(pBt, iPage, &pPage, 0)) ){ |
68243
|
0 |
4 |
if( rc!=SQLITE_OK ){ |
68252
|
5 |
0 |
if( pPage ){ |
68260
|
5 |
0 |
if( (*pRC)==SQLITE_OK ){ |
68282
|
499 |
0 |
if( pInfo->nLocal==pInfo->nPayload ){ |
68287
|
0 |
0 |
if( pCell + pInfo->nSize > pPage->aDataEnd ){ |
68299
|
0 |
0 |
while( nOvfl-- ){ |
68302
|
0 |
0 |
if( ovflPgno<2 || ovflPgno>btreePagecount(pBt) ){ |
|
0 |
0 |
if( ovflPgno<2 || ovflPgno>btreePagecount(pBt) ){ |
68308
|
0 |
0 |
if( nOvfl ){ |
68310
|
0 |
0 |
if( rc ) return rc; |
68313
|
0 |
0 |
if( ( pOvfl || ((pOvfl = btreePageLookup(pBt, ovflPgno))!=0) ) |
|
0 |
0 |
if( ( pOvfl || ((pOvfl = btreePageLookup(pBt, ovflPgno))!=0) ) |
68314
|
0 |
0 |
&& sqlite3PagerPageRefcount(pOvfl->pDbPage)!=1 |
68331
|
0 |
0 |
if( pOvfl ){ |
68334
|
0 |
0 |
if( rc ) return rc; |
68378
|
3726 |
77 |
if( pPage->intKey ){ |
68383
|
3668 |
58 |
nHeader += putVarint32(&pCell[nHeader], nPayload); |
68389
|
77 |
0 |
nHeader += putVarint32(&pCell[nHeader], nPayload); |
68394
|
3795 |
8 |
if( nPayload<=pPage->maxLocal ){ |
68400
|
1 |
3794 |
if( n<4 ) n = 4; |
68416
|
8 |
0 |
if( n > pPage->maxLocal ) n = mn; |
68450
|
50 |
8 |
if( n>spaceLeft ) n = spaceLeft; |
68461
|
58 |
0 |
if( nSrc>=n ){ |
68463
|
0 |
0 |
}else if( nSrc>0 ){ |
68470
|
8 |
50 |
if( nPayload<=0 ) break; |
68475
|
50 |
0 |
if( spaceLeft==0 ){ |
68479
|
0 |
50 |
if( pBt->autoVacuum ){ |
68483
|
0 |
0 |
PTRMAP_ISPAGE(pBt, pgnoOvfl) || pgnoOvfl==PENDING_BYTE_PAGE(pBt) |
68484
|
0 |
0 |
); |
68499
|
0 |
50 |
if( pBt->autoVacuum && rc==SQLITE_OK ){ |
|
0 |
0 |
if( pBt->autoVacuum && rc==SQLITE_OK ){ |
68500
|
0 |
0 |
u8 eType = (pgnoPtrmap?PTRMAP_OVERFLOW2:PTRMAP_OVERFLOW1); |
68502
|
0 |
0 |
if( rc ){ |
68507
|
0 |
50 |
if( rc ){ |
68549
|
0 |
260 |
if( *pRC ) return; |
68560
|
0 |
260 |
if( pc+sz > pPage->pBt->usableSize ){ |
68565
|
0 |
260 |
if( rc ){ |
68570
|
148 |
112 |
if( pPage->nCell==0 ){ |
68624
|
3615 |
0 |
if( pPage->nOverflow || sz+2>pPage->nFree ){ |
|
21 |
3594 |
if( pPage->nOverflow || sz+2>pPage->nFree ){ |
68625
|
0 |
21 |
if( pTemp ){ |
68629
|
0 |
21 |
if( iChild ){ |
68649
|
0 |
3594 |
if( rc!=SQLITE_OK ){ |
68657
|
0 |
3594 |
if( rc ){ *pRC = rc; return; } |
68665
|
21 |
3573 |
if( iChild ){ |
68673
|
6 |
3588 |
if( (++data[pPage->hdrOffset+4])==0 ) data[pPage->hdrOffset+3]++; |
68676
|
0 |
3594 |
if( pPage->pBt->autoVacuum ){ |
68704
|
0 |
0 |
while( N>0 ){ |
68706
|
0 |
0 |
if( p->szCell[idx]==0 ){ |
68728
|
0 |
0 |
if( p->szCell[N] ) return p->szCell[N]; |
68764
|
21 |
21 |
for(i=0; i
|
68766
|
11 |
10 |
if( SQLITE_WITHIN(pCell,aData,pEnd) ){ |
|
0 |
11 |
if( SQLITE_WITHIN(pCell,aData,pEnd) ){ |
68772
|
0 |
21 |
if( pData < pCellptr ) return SQLITE_CORRUPT_BKPT; |
68828
|
0 |
0 |
for(i=iFirst; i
|
68832
|
0 |
0 |
if( (aData[1]==0 && aData[2]==0) || (pSlot = pageFindSlot(pPg,sz,&rc))==0 ){ |
|
0 |
0 |
if( (aData[1]==0 && aData[2]==0) || (pSlot = pageFindSlot(pPg,sz,&rc))==0 ){ |
|
0 |
0 |
if( (aData[1]==0 && aData[2]==0) || (pSlot = pageFindSlot(pPg,sz,&rc))==0 ){ |
68833
|
0 |
0 |
if( (pData - pBegin)
|
68875
|
0 |
0 |
for(i=iFirst; i
|
68877
|
0 |
0 |
if( SQLITE_WITHIN(pCell, pStart, pEnd) ){ |
|
0 |
0 |
if( SQLITE_WITHIN(pCell, pStart, pEnd) ){ |
68883
|
0 |
0 |
if( pFree!=(pCell + sz) ){ |
68884
|
0 |
0 |
if( pFree ){ |
68890
|
0 |
0 |
if( pFree+sz>pEnd ) return 0; |
68898
|
0 |
0 |
if( pFree ){ |
68940
|
0 |
0 |
if( iOld
|
68945
|
0 |
0 |
if( iNewEnd < iOldEnd ){ |
68950
|
0 |
0 |
if( pData
|
68953
|
0 |
0 |
if( iNew
|
68958
|
0 |
0 |
if( pageInsertArray( |
68966
|
0 |
0 |
for(i=0; inOverflow; i++){ |
68968
|
0 |
0 |
if( iCell>=0 && iCell
|
|
0 |
0 |
if( iCell>=0 && iCell
|
68972
|
0 |
0 |
if( pageInsertArray( |
68981
|
0 |
0 |
if( pageInsertArray( |
69062
|
0 |
21 |
if( NEVER(pPage->nCell==0) ) return SQLITE_CORRUPT_BKPT; |
69070
|
21 |
0 |
if( rc==SQLITE_OK ){ |
69081
|
0 |
21 |
if( NEVER(rc) ) return rc; |
69093
|
0 |
21 |
if( ISAUTOVACUUM ){ |
69095
|
0 |
0 |
if( szCell>pNew->minLocal ){ |
69115
|
15 |
21 |
while( (*(pCell++)&0x80) && pCell
|
|
15 |
0 |
while( (*(pCell++)&0x80) && pCell
|
69117
|
6 |
21 |
while( ((*(pOut++) = *(pCell++))&0x80) && pCell
|
|
6 |
0 |
while( ((*(pOut++) = *(pCell++))&0x80) && pCell
|
69120
|
21 |
0 |
if( rc==SQLITE_OK ){ |
69196
|
3 |
0 |
if( (*pRC)==SQLITE_OK ){ |
69201
|
0 |
3 |
int const iToHdr = ((pTo->pgno==1) ? 100 : 0); |
69222
|
0 |
3 |
if( rc!=SQLITE_OK ){ |
69230
|
0 |
3 |
if( ISAUTOVACUUM ){ |
69331
|
0 |
0 |
if( !aOvflSpace ){ |
69347
|
0 |
0 |
if( i<2 ){ |
69351
|
0 |
0 |
if( iParentIdx==0 ){ |
69353
|
0 |
0 |
}else if( iParentIdx==i ){ |
69361
|
0 |
0 |
if( (i+nxDiv-pParent->nOverflow)==pParent->nCell ){ |
69369
|
0 |
0 |
if( rc ){ |
69374
|
0 |
0 |
if( (i--)==0 ) break; |
69376
|
0 |
0 |
if( pParent->nOverflow && i+nxDiv==pParent->aiOvfl[0] ){ |
|
0 |
0 |
if( pParent->nOverflow && i+nxDiv==pParent->aiOvfl[0] ){ |
69398
|
0 |
0 |
if( pBt->btsFlags & BTS_FAST_SECURE ){ |
69402
|
0 |
0 |
if( (iOff+szNew[i])>(int)pBt->usableSize ){ |
69429
|
0 |
0 |
if( b.apCell==0 ){ |
69456
|
0 |
0 |
for(i=0; i
|
69467
|
0 |
0 |
if( pOld->aData[0]!=apOld[0]->aData[0] ){ |
69490
|
0 |
0 |
if( pOld->nOverflow>0 ){ |
69492
|
0 |
0 |
for(j=0; j
|
69497
|
0 |
0 |
for(k=0; knOverflow; k++){ |
69504
|
0 |
0 |
while( piCell
|
69512
|
0 |
0 |
if( i
|
|
0 |
0 |
if( i
|
69525
|
0 |
0 |
if( !pOld->leaf ){ |
69533
|
0 |
0 |
while( b.szCell[b.nCell]<4 ){ |
69563
|
0 |
0 |
for(i=0; i
|
69566
|
0 |
0 |
for(j=0; jnOverflow; j++){ |
69572
|
0 |
0 |
for(i=0; i
|
69574
|
0 |
0 |
while( szNew[i]>usableSpace ){ |
69575
|
0 |
0 |
if( i+1>=k ){ |
69577
|
0 |
0 |
if( k>NB+2 ){ rc = SQLITE_CORRUPT_BKPT; goto balance_cleanup; } |
69583
|
0 |
0 |
if( !leafData ){ |
69584
|
0 |
0 |
if( cntNew[i]
|
69593
|
0 |
0 |
while( cntNew[i]
|
69595
|
0 |
0 |
if( szNew[i]+sz>usableSpace ) break; |
69598
|
0 |
0 |
if( !leafData ){ |
69599
|
0 |
0 |
if( cntNew[i]
|
69607
|
0 |
0 |
if( cntNew[i]>=b.nCell ){ |
69609
|
0 |
0 |
}else if( cntNew[i] <= (i>0 ? cntNew[i-1] : 0) ){ |
|
0 |
0 |
}else if( cntNew[i] <= (i>0 ? cntNew[i-1] : 0) ){ |
69626
|
0 |
0 |
for(i=k-1; i>0; i--){ |
69639
|
0 |
0 |
if( szRight!=0 |
69640
|
0 |
0 |
&& (bBulk || szRight+b.szCell[d]+2 > szLeft-(b.szCell[r]+(i==k-1?0:2)))){ |
|
0 |
0 |
&& (bBulk || szRight+b.szCell[d]+2 > szLeft-(b.szCell[r]+(i==k-1?0:2)))){ |
|
0 |
0 |
&& (bBulk || szRight+b.szCell[d]+2 > szLeft-(b.szCell[r]+(i==k-1?0:2)))){ |
69648
|
0 |
0 |
}while( r>=0 ); |
69651
|
0 |
0 |
if( cntNew[i-1] <= (i>1 ? cntNew[i-2] : 0) ){ |
|
0 |
0 |
if( cntNew[i-1] <= (i>1 ? cntNew[i-2] : 0) ){ |
69675
|
0 |
0 |
for(i=0; i
|
69677
|
0 |
0 |
if( i
|
69682
|
0 |
0 |
if( rc ) goto balance_cleanup; |
69685
|
0 |
0 |
rc = allocateBtreePage(pBt, &pNew, &pgno, (bBulk ? 1 : pgno), 0); |
69686
|
0 |
0 |
if( rc ) goto balance_cleanup; |
69693
|
0 |
0 |
if( ISAUTOVACUUM ){ |
69695
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
69714
|
0 |
0 |
for(i=0; i
|
69717
|
0 |
0 |
for(j=0; j
|
69718
|
0 |
0 |
if( aPgno[j]==aPgno[i] ){ |
69731
|
0 |
0 |
for(i=0; i
|
69733
|
0 |
0 |
for(j=1; j
|
69734
|
0 |
0 |
if( aPgOrder[j]
|
69738
|
0 |
0 |
if( iBest!=i ){ |
69739
|
0 |
0 |
if( iBest>i ){ |
69766
|
0 |
0 |
if( (pageFlags & PTF_LEAF)==0 && nOld!=nNew ){ |
|
0 |
0 |
if( (pageFlags & PTF_LEAF)==0 && nOld!=nNew ){ |
69767
|
0 |
0 |
MemPage *pOld = (nNew>nOld ? apNew : apOld)[nOld-1]; |
69787
|
0 |
0 |
if( ISAUTOVACUUM ){ |
69795
|
0 |
0 |
for(i=0; i
|
69797
|
0 |
0 |
if( i==cntOldNext ){ |
69798
|
0 |
0 |
MemPage *pOld = (++iOld)
|
69802
|
0 |
0 |
if( i==cntNew[iNew] ){ |
69804
|
0 |
0 |
if( !leafData ) continue; |
69813
|
0 |
0 |
if( iOld>=nNew |
69814
|
0 |
0 |
|| pNew->pgno!=aPgno[iOld] |
69815
|
0 |
0 |
|| !SQLITE_WITHIN(pCell,aOld,&aOld[usableSize]) |
|
0 |
0 |
|| !SQLITE_WITHIN(pCell,aOld,&aOld[usableSize]) |
69817
|
0 |
0 |
if( !leafCorrection ){ |
69820
|
0 |
0 |
if( cachedCellSize(&b,i)>pNew->minLocal ){ |
69823
|
0 |
0 |
if( rc ) goto balance_cleanup; |
69829
|
0 |
0 |
for(i=0; i
|
69841
|
0 |
0 |
if( !pNew->leaf ){ |
69843
|
0 |
0 |
}else if( leafData ){ |
69868
|
0 |
0 |
if( b.szCell[j]==4 ){ |
69877
|
0 |
0 |
if( rc!=SQLITE_OK ) goto balance_cleanup; |
69903
|
0 |
0 |
for(i=1-nNew; i
|
69906
|
0 |
0 |
if( abDone[iPg] ) continue; /* Skip pages already processed */ |
69907
|
0 |
0 |
if( i>=0 /* On the upwards pass, or... */ |
69908
|
0 |
0 |
|| cntOld[iPg-1]>=cntNew[iPg-1] /* Condition (1) is true */ |
69922
|
0 |
0 |
if( iPg==0 ){ |
69926
|
0 |
0 |
iOld = iPg
|
69932
|
0 |
0 |
if( rc ) goto balance_cleanup; |
69946
|
0 |
0 |
if( isRoot && pParent->nCell==0 && pParent->hdrOffset<=apNew[0]->nFree ){ |
|
0 |
0 |
if( isRoot && pParent->nCell==0 && pParent->hdrOffset<=apNew[0]->nFree ){ |
|
0 |
0 |
if( isRoot && pParent->nCell==0 && pParent->hdrOffset<=apNew[0]->nFree ){ |
69971
|
0 |
0 |
}else if( ISAUTOVACUUM && !leafCorrection ){ |
|
0 |
0 |
}else if( ISAUTOVACUUM && !leafCorrection ){ |
69975
|
0 |
0 |
for(i=0; i
|
69987
|
0 |
0 |
for(i=nNew; i
|
70007
|
0 |
0 |
for(i=0; i
|
70010
|
0 |
0 |
for(i=0; i
|
70051
|
3 |
0 |
if( rc==SQLITE_OK ){ |
70054
|
0 |
3 |
if( ISAUTOVACUUM ){ |
70058
|
0 |
3 |
if( rc ){ |
70107
|
45 |
21 |
if( iPage==0 ){ |
70108
|
3 |
42 |
if( pPage->nOverflow ){ |
70117
|
3 |
0 |
if( rc==SQLITE_OK ){ |
70128
|
0 |
21 |
}else if( pPage->nOverflow==0 && pPage->nFree<=nMin ){ |
|
0 |
0 |
}else if( pPage->nOverflow==0 && pPage->nFree<=nMin ){ |
70135
|
21 |
0 |
if( rc==SQLITE_OK ){ |
70137
|
21 |
0 |
if( pPage->intKeyLeaf |
70138
|
21 |
0 |
&& pPage->nOverflow==1 |
70139
|
21 |
0 |
&& pPage->aiOvfl[0]==pPage->nCell |
70140
|
21 |
0 |
&& pParent->pgno!=1 |
70141
|
21 |
0 |
&& pParent->nCell==iIdx |
70182
|
0 |
0 |
if( pFree ){ |
70205
|
24 |
0 |
}while( rc==SQLITE_OK ); |
70207
|
0 |
42 |
if( pFree ){ |
70224
|
0 |
1 |
if( nData<=0 ){ |
70227
|
0 |
0 |
for(i=0; i
|
|
0 |
0 |
for(i=0; i
|
70228
|
0 |
0 |
if( i
|
70230
|
0 |
0 |
if( rc ) return rc; |
70234
|
0 |
1 |
if( nData
|
70239
|
0 |
0 |
if( rc ) return rc; |
70242
|
1 |
0 |
if( memcmp(pDest, ((u8*)pX->pData) + iOffset, iAmt)!=0 ){ |
70244
|
0 |
1 |
if( rc ) return rc; |
70264
|
0 |
1 |
if( pCur->info.pPayload + pCur->info.nLocal > pPage->aDataEnd ){ |
70270
|
0 |
1 |
if( rc ) return rc; |
70271
|
1 |
0 |
if( pCur->info.nLocal==nTotal ) return SQLITE_OK; |
70282
|
0 |
0 |
if( rc ) return rc; |
70283
|
0 |
0 |
if( sqlite3PagerPageRefcount(pPage->pDbPage)!=1 ){ |
70286
|
0 |
0 |
if( iOffset+ovflPageSize<(u32)nTotal ){ |
70295
|
0 |
0 |
if( rc ) return rc; |
70297
|
0 |
0 |
}while( iOffset
|
70350
|
0 |
3804 |
if( pCur->eState==CURSOR_FAULT ){ |
70379
|
119 |
3685 |
if( pCur->curFlags & BTCF_Multiple ){ |
70381
|
0 |
119 |
if( rc ) return rc; |
70384
|
3727 |
77 |
if( pCur->pKeyInfo==0 ){ |
70406
|
3055 |
672 |
if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey ){ |
|
258 |
2797 |
if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey ){ |
70410
|
238 |
20 |
if( pCur->info.nSize!=0 |
70411
|
1 |
237 |
&& pCur->info.nPayload==(u32)pX->nData+pX->nZero |
70417
|
3260 |
209 |
}else if( loc==0 ){ |
70423
|
0 |
3260 |
if( rc ) return rc; |
70438
|
26 |
51 |
if( loc==0 && (flags & BTREE_SAVEPOSITION)==0 ){ |
|
26 |
0 |
if( loc==0 && (flags & BTREE_SAVEPOSITION)==0 ){ |
70439
|
26 |
0 |
if( pX->nMem ){ |
70453
|
0 |
26 |
if( rc ) return rc; |
70460
|
0 |
77 |
if( loc==0 ){ |
70462
|
0 |
0 |
if( pCur->info.nKey==pX->nKey ){ |
70485
|
0 |
3803 |
if( rc ) goto end_insert; |
70489
|
448 |
3355 |
if( loc==0 ){ |
70493
|
0 |
448 |
if( rc ){ |
70497
|
0 |
448 |
if( !pPage->leaf ){ |
70501
|
209 |
239 |
if( info.nSize==szNew && info.nLocal==info.nPayload |
|
209 |
0 |
if( info.nSize==szNew && info.nLocal==info.nPayload |
70502
|
0 |
209 |
&& (!ISAUTOVACUUM || szNewminLocal) |
|
0 |
0 |
&& (!ISAUTOVACUUM || szNewminLocal) |
70514
|
0 |
209 |
if( oldCell+szNew > pPage->aDataEnd ) return SQLITE_CORRUPT_BKPT; |
70519
|
0 |
239 |
if( rc ) goto end_insert; |
70520
|
3341 |
14 |
}else if( loc<0 && pPage->nCell>0 ){ |
|
2989 |
352 |
}else if( loc<0 && pPage->nCell>0 ){ |
70552
|
21 |
3573 |
if( pPage->nOverflow ){ |
70563
|
0 |
21 |
if( (flags & BTREE_SAVEPOSITION) && rc==SQLITE_OK ){ |
|
0 |
0 |
if( (flags & BTREE_SAVEPOSITION) && rc==SQLITE_OK ){ |
70565
|
0 |
0 |
if( pCur->pKeyInfo ){ |
70568
|
0 |
0 |
if( pCur->pKey==0 ){ |
70637
|
18 |
3 |
if( bPreserve ){ |
70638
|
18 |
0 |
if( !pPage->leaf |
70639
|
18 |
0 |
|| (pPage->nFree+cellSizePtr(pPage,pCell)+2)>(int)(pBt->usableSize*2/3) |
70644
|
0 |
18 |
if( rc ) return rc; |
70657
|
0 |
21 |
if( !pPage->leaf ){ |
70660
|
0 |
0 |
if( rc ) return rc; |
70665
|
0 |
21 |
if( pCur->curFlags & BTCF_Multiple ){ |
70667
|
0 |
0 |
if( rc ) return rc; |
70672
|
20 |
1 |
if( pCur->pKeyInfo==0 ){ |
70680
|
0 |
21 |
if( rc ) return rc; |
70683
|
0 |
21 |
if( rc ) return rc; |
70690
|
0 |
21 |
if( !pPage->leaf ){ |
70696
|
0 |
0 |
if( iCellDepthiPage-1 ){ |
70702
|
0 |
0 |
if( pCell<&pLeaf->aData[4] ) return SQLITE_CORRUPT_BKPT; |
70708
|
0 |
0 |
if( rc==SQLITE_OK ){ |
70712
|
0 |
0 |
if( rc ) return rc; |
70731
|
21 |
0 |
if( rc==SQLITE_OK && pCur->iPage>iCellDepth ){ |
|
0 |
21 |
if( rc==SQLITE_OK && pCur->iPage>iCellDepth ){ |
70734
|
0 |
0 |
while( pCur->iPage>iCellDepth ){ |
70741
|
21 |
0 |
if( rc==SQLITE_OK ){ |
70742
|
0 |
21 |
if( bSkipnext ){ |
70747
|
0 |
0 |
if( iCellIdx>=pPage->nCell ){ |
70755
|
18 |
3 |
if( bPreserve ){ |
70759
|
10 |
11 |
if( rc==SQLITE_EMPTY ) rc = SQLITE_OK; |
70793
|
0 |
257 |
if( pBt->autoVacuum ){ |
70814
|
0 |
0 |
while( pgnoRoot==PTRMAP_PAGENO(pBt, pgnoRoot) || |
|
0 |
0 |
while( pgnoRoot==PTRMAP_PAGENO(pBt, pgnoRoot) || |
70826
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70830
|
0 |
0 |
if( pgnoMove!=pgnoRoot ){ |
70845
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70851
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70855
|
0 |
0 |
if( eType==PTRMAP_ROOTPAGE || eType==PTRMAP_FREEPAGE ){ |
|
0 |
0 |
if( eType==PTRMAP_ROOTPAGE || eType==PTRMAP_FREEPAGE ){ |
70858
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70868
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70872
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70876
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70886
|
0 |
0 |
if( rc ){ |
70897
|
0 |
0 |
if( NEVER(rc) ){ |
70904
|
0 |
257 |
if( rc ) return rc; |
70908
|
210 |
47 |
if( createTabFlags & BTREE_INTKEY ){ |
70945
|
0 |
38 |
if( pgno>btreePagecount(pBt) ){ |
70949
|
0 |
38 |
if( rc ) return rc; |
70950
|
0 |
38 |
if( pPage->bBusy ){ |
70956
|
30 |
38 |
for(i=0; inCell; i++){ |
70958
|
0 |
30 |
if( !pPage->leaf ){ |
70960
|
0 |
0 |
if( rc ) goto cleardatabasepage_out; |
70963
|
0 |
30 |
if( rc ) goto cleardatabasepage_out; |
70965
|
0 |
38 |
if( !pPage->leaf ){ |
70967
|
0 |
0 |
if( rc ) goto cleardatabasepage_out; |
70968
|
32 |
6 |
}else if( pnChange ){ |
70973
|
0 |
38 |
if( freePageFlag ){ |
70975
|
38 |
0 |
}else if( (rc = sqlite3PagerWrite(pPage->pDbPage))==0 ){ |
71006
|
38 |
0 |
if( SQLITE_OK==rc ){ |
71056
|
0 |
5 |
if( rc ) return rc; |
71058
|
0 |
5 |
if( rc ){ |
71069
|
0 |
5 |
if( pBt->autoVacuum ){ |
71073
|
0 |
0 |
if( iTable==maxRootPgno ){ |
71079
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
71090
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
71095
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
71102
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
71114
|
0 |
0 |
while( maxRootPgno==PENDING_BYTE_PAGE(pBt) |
71115
|
0 |
0 |
|| PTRMAP_ISPAGE(pBt, maxRootPgno) ){ |
71166
|
0 |
6338 |
if( idx==BTREE_DATA_VERSION ){ |
71197
|
557 |
0 |
if( rc==SQLITE_OK ){ |
71200
|
0 |
557 |
if( idx==BTREE_INCR_VACUUM ){ |
71225
|
6 |
4 |
if( rc==SQLITE_EMPTY ){ |
71233
|
4 |
0 |
while( rc==SQLITE_OK ){ |
71242
|
0 |
4 |
if( pPage->leaf || !pPage->intKey ){ |
|
0 |
0 |
if( pPage->leaf || !pPage->intKey ){ |
71256
|
4 |
0 |
if( pPage->leaf ){ |
71258
|
4 |
0 |
if( pCur->iPage==0 ){ |
71264
|
0 |
0 |
}while ( pCur->ix>=pCur->pPage->nCell ); |
71274
|
0 |
0 |
if( iIdx==pPage->nCell ){ |
71304
|
0 |
0 |
if( !pCheck->mxErr ) return; |
71308
|
0 |
0 |
if( pCheck->errMsg.nChar ){ |
71311
|
0 |
0 |
if( pCheck->zPfx ){ |
71316
|
0 |
0 |
if( pCheck->errMsg.accError==SQLITE_NOMEM ){ |
71351
|
0 |
0 |
if( iPage==0 ) return 1; |
71352
|
0 |
0 |
if( iPage>pCheck->nPage ){ |
71356
|
0 |
0 |
if( getPageReferenced(pCheck, iPage) ){ |
71381
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
71382
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ) pCheck->mallocFailed = 1; |
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ) pCheck->mallocFailed = 1; |
71387
|
0 |
0 |
if( ePtrmapType!=eType || iPtrmapParent!=iParent ){ |
|
0 |
0 |
if( ePtrmapType!=eType || iPtrmapParent!=iParent ){ |
71408
|
0 |
0 |
while( N-- > 0 && pCheck->mxErr ){ |
|
0 |
0 |
while( N-- > 0 && pCheck->mxErr ){ |
71411
|
0 |
0 |
if( iPage<1 ){ |
71417
|
0 |
0 |
if( checkRef(pCheck, iPage) ) break; |
71418
|
0 |
0 |
if( sqlite3PagerGet(pCheck->pPager, (Pgno)iPage, &pOvflPage, 0) ){ |
71423
|
0 |
0 |
if( isFreeList ){ |
71426
|
0 |
0 |
if( pCheck->pBt->autoVacuum ){ |
71430
|
0 |
0 |
if( n>(int)pCheck->pBt->usableSize/4-2 ){ |
71435
|
0 |
0 |
for(i=0; i
|
71438
|
0 |
0 |
if( pCheck->pBt->autoVacuum ){ |
71453
|
0 |
0 |
if( pCheck->pBt->autoVacuum && N>0 ){ |
|
0 |
0 |
if( pCheck->pBt->autoVacuum && N>0 ){ |
71462
|
0 |
0 |
if( isFreeList && N<(iPage!=0) ){ |
|
0 |
0 |
if( isFreeList && N<(iPage!=0) ){ |
71494
|
0 |
0 |
while( (j = i/2)>0 && aHeap[j]>aHeap[i] ){ |
|
0 |
0 |
while( (j = i/2)>0 && aHeap[j]>aHeap[i] ){ |
71503
|
0 |
0 |
if( (x = aHeap[0])==0 ) return 0; |
71509
|
0 |
0 |
while( (j = i*2)<=aHeap[0] ){ |
71510
|
0 |
0 |
if( aHeap[j]>aHeap[j+1] ) j++; |
71511
|
0 |
0 |
if( aHeap[i]
|
71571
|
0 |
0 |
if( iPage==0 ) return 0; |
71572
|
0 |
0 |
if( checkRef(pCheck, iPage) ) return 0; |
71575
|
0 |
0 |
if( (rc = btreeGetPage(pBt, (Pgno)iPage, &pPage, 0))!=0 ){ |
71585
|
0 |
0 |
if( (rc = btreeInitPage(pPage))!=0 ){ |
71610
|
0 |
0 |
if( !pPage->leaf ){ |
71614
|
0 |
0 |
if( pBt->autoVacuum ){ |
71630
|
0 |
0 |
for(i=nCell-1; i>=0 && pCheck->mxErr; i--){ |
|
0 |
0 |
for(i=nCell-1; i>=0 && pCheck->mxErr; i--){ |
71638
|
0 |
0 |
if( pcusableSize-4 ){ |
|
0 |
0 |
if( pcusableSize-4 ){ |
71646
|
0 |
0 |
if( pc+info.nSize>usableSize ){ |
71653
|
0 |
0 |
if( pPage->intKey ){ |
71654
|
0 |
0 |
if( keyCanBeEqual ? (info.nKey > maxKey) : (info.nKey >= maxKey) ){ |
|
0 |
0 |
if( keyCanBeEqual ? (info.nKey > maxKey) : (info.nKey >= maxKey) ){ |
71662
|
0 |
0 |
if( info.nPayload>info.nLocal ){ |
71669
|
0 |
0 |
if( pBt->autoVacuum ){ |
71676
|
0 |
0 |
if( !pPage->leaf ){ |
71680
|
0 |
0 |
if( pBt->autoVacuum ){ |
71686
|
0 |
0 |
if( d2!=depth ){ |
71700
|
0 |
0 |
if( doCoverageCheck && pCheck->mxErr>0 ){ |
|
0 |
0 |
if( doCoverageCheck && pCheck->mxErr>0 ){ |
71704
|
0 |
0 |
if( !pPage->leaf ){ |
71707
|
0 |
0 |
for(i=nCell-1; i>=0; i--){ |
71721
|
0 |
0 |
while( i>0 ){ |
71753
|
0 |
0 |
while( btreeHeapPull(heap,&x) ){ |
71754
|
0 |
0 |
if( (prev&0xffff)>=(x>>16) ){ |
71769
|
0 |
0 |
if( heap[0]==0 && nFrag!=data[hdr+7] ){ |
|
0 |
0 |
if( heap[0]==0 && nFrag!=data[hdr+7] ){ |
71777
|
0 |
0 |
if( !doCoverageCheck ) pPage->isInit = savedIsInit; |
71831
|
0 |
0 |
if( sCheck.nPage==0 ){ |
71836
|
0 |
0 |
if( !sCheck.aPgRef ){ |
71841
|
0 |
0 |
if( sCheck.heap==0 ){ |
71847
|
0 |
0 |
if( i<=sCheck.nPage ) setPageReferenced(&sCheck, i); |
71860
|
0 |
0 |
for(i=0; (int)i
|
|
0 |
0 |
for(i=0; (int)i
|
71862
|
0 |
0 |
if( aRoot[i]==0 ) continue; |
71864
|
0 |
0 |
if( pBt->autoVacuum && aRoot[i]>1 ){ |
|
0 |
0 |
if( pBt->autoVacuum && aRoot[i]>1 ){ |
71874
|
0 |
0 |
for(i=1; i<=sCheck.nPage && sCheck.mxErr; i++){ |
|
0 |
0 |
for(i=1; i<=sCheck.nPage && sCheck.mxErr; i++){ |
71884
|
0 |
0 |
(PTRMAP_PAGENO(pBt, i)!=i || !pBt->autoVacuum) ){ |
71888
|
0 |
0 |
(PTRMAP_PAGENO(pBt, i)==i && pBt->autoVacuum) ){ |
71899
|
0 |
0 |
if( sCheck.mallocFailed ){ |
71904
|
0 |
0 |
if( sCheck.nErr==0 ) sqlite3_str_reset(&sCheck.errMsg); |
71942
|
2959 |
1819 |
return (p && (p->inTrans==TRANS_WRITE)); |
|
1037 |
1922 |
return (p && (p->inTrans==TRANS_WRITE)); |
71956
|
0 |
0 |
if( p ){ |
71959
|
0 |
0 |
if( pBt->inTransaction!=TRANS_NONE ){ |
72008
|
573 |
0 |
if( !pBt->pSchema && nBytes ){ |
|
267 |
306 |
if( !pBt->pSchema && nBytes ){ |
72041
|
0 |
27 |
if( p->sharable ){ |
72048
|
0 |
0 |
if( rc==SQLITE_OK ){ |
72074
|
0 |
0 |
rc = restoreCursorPosition(pCsr); |
72075
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
72079
|
0 |
0 |
if( pCsr->eState!=CURSOR_VALID ){ |
72101
|
0 |
0 |
if( (pCsr->curFlags & BTCF_WriteFlag)==0 ){ |
72137
|
0 |
0 |
if( iVersion==1 ) pBt->btsFlags |= BTS_NO_WAL; |
72140
|
0 |
0 |
if( rc==SQLITE_OK ){ |
72142
|
0 |
0 |
if( aData[18]!=(u8)iVersion || aData[19]!=(u8)iVersion ){ |
|
0 |
0 |
if( aData[18]!=(u8)iVersion || aData[19]!=(u8)iVersion ){ |
72144
|
0 |
0 |
if( rc==SQLITE_OK ){ |
72146
|
0 |
0 |
if( rc==SQLITE_OK ){ |
72283
|
0 |
8 |
if( i==1 ){ |
72288
|
0 |
0 |
if( sqlite3OpenTempDatabase(&sParse) ){ |
72294
|
0 |
0 |
if( rc ){ |
72299
|
0 |
8 |
if( i<0 ){ |
72324
|
0 |
4 |
if( sqlite3BtreeIsInReadTrans(p) ){ |
72365
|
0 |
4 |
if( pSrcDb==pDestDb ){ |
72376
|
0 |
4 |
if( !p ){ |
72382
|
4 |
0 |
if( p ){ |
72390
|
4 |
0 |
if( 0==p->pSrc || 0==p->pDest |
|
4 |
0 |
if( 0==p->pSrc || 0==p->pDest |
72391
|
0 |
4 |
|| checkReadTransaction(pDestDb, p->pDest)!=SQLITE_OK |
72402
|
4 |
0 |
if( p ){ |
72417
|
0 |
4 |
return (rc!=SQLITE_OK && rc!=SQLITE_BUSY && ALWAYS(rc!=SQLITE_LOCKED)); |
|
0 |
0 |
return (rc!=SQLITE_OK && rc!=SQLITE_BUSY && ALWAYS(rc!=SQLITE_LOCKED)); |
|
0 |
0 |
return (rc!=SQLITE_OK && rc!=SQLITE_BUSY && ALWAYS(rc!=SQLITE_LOCKED)); |
72455
|
0 |
10 |
if( nSrcPgsz!=nDestPgsz && sqlite3PagerIsMemdb(pDestPager) ){ |
|
0 |
0 |
if( nSrcPgsz!=nDestPgsz && sqlite3PagerIsMemdb(pDestPager) ){ |
72463
|
0 |
10 |
if( nSrcPgsz!=nDestPgsz && sqlite3PagerGetCodec(pDestPager)!=0 ){ |
|
0 |
0 |
if( nSrcPgsz!=nDestPgsz && sqlite3PagerGetCodec(pDestPager)!=0 ){ |
72472
|
0 |
10 |
if( nSrcReserve!=nDestReserve ){ |
72475
|
0 |
0 |
if( rc==SQLITE_OK && newPgsz!=nSrcPgsz ) rc = SQLITE_READONLY; |
|
0 |
0 |
if( rc==SQLITE_OK && newPgsz!=nSrcPgsz ) rc = SQLITE_READONLY; |
72483
|
20 |
0 |
for(iOff=iEnd-(i64)nSrcPgsz; rc==SQLITE_OK && iOff
|
|
10 |
10 |
for(iOff=iEnd-(i64)nSrcPgsz; rc==SQLITE_OK && iOff
|
72486
|
0 |
10 |
if( iDest==PENDING_BYTE_PAGE(p->pDest->pBt) ) continue; |
72487
|
10 |
0 |
if( SQLITE_OK==(rc = sqlite3PagerGet(pDestPager, iDest, &pDestPg, 0)) |
72488
|
10 |
0 |
&& SQLITE_OK==(rc = sqlite3PagerWrite(pDestPg)) |
72503
|
4 |
6 |
if( iOff==0 && bUpdate==0 ){ |
|
4 |
0 |
if( iOff==0 && bUpdate==0 ){ |
72524
|
0 |
0 |
if( rc==SQLITE_OK && iCurrent>iSize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && iCurrent>iSize ){ |
72562
|
4 |
0 |
if( !isFatalError(rc) ){ |
72572
|
4 |
0 |
if( p->pDestDb && p->pSrc->pBt->inTransaction==TRANS_WRITE ){ |
|
0 |
4 |
if( p->pDestDb && p->pSrc->pBt->inTransaction==TRANS_WRITE ){ |
72582
|
4 |
0 |
if( rc==SQLITE_OK && 0==sqlite3BtreeIsInReadTrans(p->pSrc) ){ |
|
4 |
0 |
if( rc==SQLITE_OK && 0==sqlite3BtreeIsInReadTrans(p->pSrc) ){ |
72593
|
4 |
0 |
if( p->bDestLocked==0 && rc==SQLITE_OK && setDestPgsz(p)==SQLITE_NOMEM ){ |
|
4 |
0 |
if( p->bDestLocked==0 && rc==SQLITE_OK && setDestPgsz(p)==SQLITE_NOMEM ){ |
|
0 |
4 |
if( p->bDestLocked==0 && rc==SQLITE_OK && setDestPgsz(p)==SQLITE_NOMEM ){ |
72598
|
4 |
0 |
if( SQLITE_OK==rc && p->bDestLocked==0 |
|
4 |
0 |
if( SQLITE_OK==rc && p->bDestLocked==0 |
72599
|
4 |
0 |
&& SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2)) |
72610
|
4 |
0 |
if( SQLITE_OK==rc && destMode==PAGER_JOURNALMODE_WAL && pgszSrc!=pgszDest ){ |
|
0 |
4 |
if( SQLITE_OK==rc && destMode==PAGER_JOURNALMODE_WAL && pgszSrc!=pgszDest ){ |
|
0 |
0 |
if( SQLITE_OK==rc && destMode==PAGER_JOURNALMODE_WAL && pgszSrc!=pgszDest ){ |
72619
|
0 |
14 |
for(ii=0; (nPage<0 || iiiNext<=(Pgno)nSrcPage && !rc; ii++){ |
|
0 |
0 |
for(ii=0; (nPage<0 || iiiNext<=(Pgno)nSrcPage && !rc; ii++){ |
|
10 |
4 |
for(ii=0; (nPage<0 || iiiNext<=(Pgno)nSrcPage && !rc; ii++){ |
|
10 |
0 |
for(ii=0; (nPage<0 || iiiNext<=(Pgno)nSrcPage && !rc; ii++){ |
72621
|
10 |
0 |
if( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) ){ |
72624
|
10 |
0 |
if( rc==SQLITE_OK ){ |
72631
|
4 |
0 |
if( rc==SQLITE_OK ){ |
72634
|
4 |
0 |
if( p->iNext>(Pgno)nSrcPage ){ |
72636
|
0 |
0 |
}else if( !p->isAttached ){ |
72646
|
4 |
0 |
if( rc==SQLITE_DONE ){ |
72647
|
0 |
4 |
if( nSrcPage==0 ){ |
72651
|
4 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_DONE ){ |
|
4 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_DONE ){ |
72654
|
4 |
0 |
if( rc==SQLITE_OK ){ |
72655
|
4 |
0 |
if( p->pDestDb ){ |
72658
|
0 |
4 |
if( destMode==PAGER_JOURNALMODE_WAL ){ |
72662
|
4 |
0 |
if( rc==SQLITE_OK ){ |
72678
|
0 |
4 |
if( pgszSrc
|
72681
|
0 |
0 |
if( nDestTruncate==(int)PENDING_BYTE_PAGE(p->pDest->pBt) ){ |
72689
|
0 |
4 |
if( pgszSrc
|
72720
|
0 |
0 |
for(iPg=nDestTruncate; rc==SQLITE_OK && iPg<=(Pgno)nDstPage; iPg++){ |
|
0 |
0 |
for(iPg=nDestTruncate; rc==SQLITE_OK && iPg<=(Pgno)nDstPage; iPg++){ |
72721
|
0 |
0 |
if( iPg!=PENDING_BYTE_PAGE(p->pDest->pBt) ){ |
72724
|
0 |
0 |
if( rc==SQLITE_OK ){ |
72730
|
0 |
0 |
if( rc==SQLITE_OK ){ |
72736
|
0 |
0 |
for( |
72738
|
0 |
0 |
rc==SQLITE_OK && iOff
|
72744
|
0 |
0 |
if( rc==SQLITE_OK ){ |
72750
|
0 |
0 |
if( rc==SQLITE_OK ){ |
72755
|
0 |
0 |
if( rc==SQLITE_OK ){ |
72764
|
4 |
0 |
if( SQLITE_OK==rc |
72765
|
4 |
0 |
&& SQLITE_OK==(rc = sqlite3BtreeCommitPhaseTwo(p->pDest, 0)) |
72777
|
4 |
0 |
if( bCloseTrans ){ |
72784
|
0 |
4 |
if( rc==SQLITE_IOERR_NOMEM ){ |
72806
|
0 |
4 |
if( p==0 ) return SQLITE_OK; |
72815
|
4 |
0 |
if( p->pDestDb ){ |
72818
|
0 |
4 |
if( p->isAttached ){ |
72820
|
0 |
0 |
while( *pp!=p ){ |
72830
|
0 |
4 |
rc = (p->rc==SQLITE_DONE) ? SQLITE_OK : p->rc; |
72831
|
4 |
0 |
if( p->pDestDb ){ |
72838
|
4 |
0 |
if( p->pDestDb ){ |
72896
|
0 |
0 |
if( !isFatalError(p->rc) && iPageiNext ){ |
|
0 |
0 |
if( !isFatalError(p->rc) && iPageiNext ){ |
72907
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
72911
|
0 |
0 |
}while( (p = p->pNext)!=0 ); |
72914
|
0 |
212 |
if( pBackup ) backupUpdate(pBackup, iPage, aData); |
72930
|
0 |
1498 |
for(p=pBackup; p; p=p->pNext){ |
72954
|
0 |
0 |
if( pFd->pMethods ){ |
72957
|
0 |
0 |
if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK; |
72958
|
0 |
0 |
if( rc ) goto copy_finished; |
72986
|
0 |
0 |
if( rc==SQLITE_OK ){ |
73163
|
1984 |
610 |
if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){ |
|
1984 |
0 |
if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){ |
73203
|
5908 |
20290 |
if( n<32 ) n = 32; |
73204
|
740 |
25458 |
if( pMem->szMalloc>0 && bPreserve && pMem->z==pMem->zMalloc ){ |
|
730 |
10 |
if( pMem->szMalloc>0 && bPreserve && pMem->z==pMem->zMalloc ){ |
|
380 |
350 |
if( pMem->szMalloc>0 && bPreserve && pMem->z==pMem->zMalloc ){ |
73208
|
360 |
25458 |
if( pMem->szMalloc>0 ) sqlite3DbFreeNN(pMem->db, pMem->zMalloc); |
73211
|
0 |
26198 |
if( pMem->zMalloc==0 ){ |
73220
|
646 |
25552 |
if( bPreserve && pMem->z ){ |
|
646 |
0 |
if( bPreserve && pMem->z ){ |
73224
|
0 |
26198 |
if( (pMem->flags&MEM_Dyn)!=0 ){ |
73250
|
23044 |
9916 |
if( pMem->szMalloc
|
73264
|
0 |
1026 |
if( sqlite3VdbeMemGrow(pMem, pMem->n+2, 1) ){ |
73282
|
553 |
715 |
if( (pMem->flags & (MEM_Str|MEM_Blob))!=0 ){ |
73283
|
0 |
553 |
if( ExpandBlob(pMem) ) return SQLITE_NOMEM; |
|
0 |
0 |
if( ExpandBlob(pMem) ) return SQLITE_NOMEM; |
73284
|
350 |
203 |
if( pMem->szMalloc==0 || pMem->z!=pMem->zMalloc ){ |
|
350 |
0 |
if( pMem->szMalloc==0 || pMem->z!=pMem->zMalloc ){ |
73286
|
0 |
553 |
if( rc ) return rc; |
73311
|
0 |
0 |
if( nByte<=0 ){ |
73314
|
0 |
0 |
if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){ |
73332
|
10151 |
473 |
if( (pMem->flags & (MEM_Term|MEM_Str))!=MEM_Str ){ |
73365
|
0 |
324 |
if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){ |
73376
|
322 |
2 |
if( fg & MEM_Int ){ |
73385
|
4 |
320 |
if( bForce ) pMem->flags &= ~(MEM_Int|MEM_Real); |
73414
|
117 |
73 |
if( pMem->szMalloc>0 ) sqlite3DbFreeNN(pMem->db, pMem->zMalloc); |
73431
|
0 |
81 |
if( p->flags&MEM_Agg ){ |
73436
|
71 |
10 |
if( p->flags&MEM_Dyn ){ |
73440
|
10 |
0 |
}else if( p->flags&MEM_RowSet ){ |
73442
|
0 |
0 |
}else if( p->flags&MEM_Frame ){ |
73459
|
69 |
392 |
if( VdbeMemDynamic(p) ){ |
73462
|
392 |
69 |
if( p->szMalloc ){ |
73481
|
5449 |
69 |
if( VdbeMemDynamic(p) || p->szMalloc ){ |
|
392 |
5057 |
if( VdbeMemDynamic(p) || p->szMalloc ){ |
73506
|
0 |
4 |
if( r<=(double)minInt ){ |
73508
|
0 |
4 |
}else if( r>=(double)maxInt ){ |
73537
|
2941 |
378 |
if( flags & MEM_Int ){ |
73539
|
0 |
378 |
}else if( flags & MEM_Real ){ |
73541
|
314 |
64 |
}else if( flags & (MEM_Str|MEM_Blob) ){ |
73564
|
226 |
24 |
if( pMem->flags & MEM_Real ){ |
73566
|
0 |
24 |
}else if( pMem->flags & MEM_Int ){ |
73568
|
24 |
0 |
}else if( pMem->flags & (MEM_Str|MEM_Blob) ){ |
73581
|
410 |
340 |
if( pMem->flags & MEM_Int ) return pMem->u.i!=0; |
73582
|
128 |
212 |
if( pMem->flags & MEM_Null ) return ifNull; |
73609
|
0 |
4 |
if( pMem->u.r==ix && ix>SMALLEST_INT64 && ix
|
|
0 |
0 |
if( pMem->u.r==ix && ix>SMALLEST_INT64 && ix
|
|
0 |
0 |
if( pMem->u.r==ix && ix>SMALLEST_INT64 && ix
|
73662
|
0 |
0 |
if( (pMem->flags & (MEM_Int|MEM_Real|MEM_Null))==0 ){ |
73667
|
0 |
0 |
if( rc==0 ){ |
73672
|
0 |
0 |
if( rc==1 && sqlite3RealSameAsInt(pMem->u.r, i) ){ |
|
0 |
0 |
if( rc==1 && sqlite3RealSameAsInt(pMem->u.r, i) ){ |
73693
|
0 |
1 |
if( pMem->flags & MEM_Null ) return; |
73696
|
0 |
0 |
if( (pMem->flags & MEM_Blob)==0 ){ |
73699
|
0 |
0 |
if( pMem->flags & MEM_Str ) MemSetTypeFlag(pMem, MEM_Blob); |
73755
|
12 |
5074 |
if( VdbeMemDynamic(pMem) ){ |
73773
|
0 |
1 |
if( n<0 ) n = 0; |
73795
|
0 |
1330 |
if( VdbeMemDynamic(pMem) ){ |
73817
|
0 |
0 |
pMem->u.zPType = zPType ? zPType : ""; |
73821
|
0 |
0 |
pMem->xDel = xDestructor ? xDestructor : sqlite3NoopDestructor; |
73831
|
220 |
0 |
if( !sqlite3IsNaN(val) ){ |
73848
|
0 |
10 |
if( db->mallocFailed ){ |
73866
|
2279 |
1154 |
if( p->flags & (MEM_Str|MEM_Blob) ){ |
73868
|
1 |
2278 |
if( p->flags & MEM_Zero ){ |
73913
|
0 |
3710 |
if( VdbeMemDynamic(pTo) ){ vdbeClrCopy(pTo,pFrom,srcType); return; } |
73915
|
2944 |
766 |
if( (pFrom->flags&MEM_Static)==0 ){ |
73930
|
0 |
133 |
if( VdbeMemDynamic(pTo) ) vdbeMemClearExternAndSetNull(pTo); |
73933
|
95 |
38 |
if( pTo->flags&(MEM_Str|MEM_Blob) ){ |
73934
|
71 |
24 |
if( 0==(pFrom->flags&MEM_Static) ){ |
73990
|
2745 |
15602 |
if( !z ){ |
73995
|
15602 |
0 |
if( pMem->db ){ |
74000
|
855 |
14747 |
flags = (enc==0?MEM_Blob:MEM_Str); |
74001
|
13452 |
2150 |
if( nByte<0 ){ |
74003
|
13452 |
0 |
if( enc==SQLITE_UTF8 ){ |
74005
|
0 |
13452 |
if( nByte>iLimit ) nByte = iLimit+1; |
74007
|
0 |
0 |
for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){} |
|
0 |
0 |
for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){} |
74016
|
13307 |
2295 |
if( xDel==SQLITE_TRANSIENT ){ |
74018
|
11762 |
1545 |
if( flags&MEM_Term ){ |
74019
|
11762 |
0 |
nAlloc += (enc==SQLITE_UTF8?1:2); |
74021
|
0 |
13307 |
if( nByte>iLimit ){ |
74027
|
0 |
13307 |
if( sqlite3VdbeMemClearAndResize(pMem, MAX(nAlloc,32)) ){ |
74031
|
550 |
1745 |
}else if( xDel==SQLITE_DYNAMIC ){ |
74039
|
1674 |
71 |
flags |= ((xDel==SQLITE_STATIC)?MEM_Static:MEM_Dyn); |
74044
|
14747 |
855 |
pMem->enc = (enc==0 ? SQLITE_UTF8 : enc); |
74047
|
0 |
15602 |
if( pMem->enc!=SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){ |
|
0 |
0 |
if( pMem->enc!=SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){ |
74052
|
0 |
15602 |
if( nByte>iLimit ){ |
74082
|
6 |
0 |
if( SQLITE_OK==(rc = sqlite3VdbeMemClearAndResize(pMem, amt+1)) ){ |
74084
|
6 |
0 |
if( rc==SQLITE_OK ){ |
74113
|
621 |
6 |
if( offset+amt<=available ){ |
74135
|
101 |
320 |
if( pVal->flags & (MEM_Blob|MEM_Str) ){ |
74136
|
0 |
101 |
if( ExpandBlob(pVal) ) return 0; |
|
0 |
0 |
if( ExpandBlob(pVal) ) return 0; |
74138
|
0 |
101 |
if( pVal->enc != (enc & ~SQLITE_UTF16_ALIGNED) ){ |
74141
|
0 |
101 |
if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&SQLITE_PTR_TO_INT(pVal->z)) ){ |
|
0 |
0 |
if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&SQLITE_PTR_TO_INT(pVal->z)) ){ |
74143
|
0 |
0 |
if( sqlite3VdbeMemMakeWriteable(pVal)!=SQLITE_OK ){ |
74154
|
421 |
0 |
if( pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) ){ |
74173
|
17 |
7426 |
if( !pVal ) return 0; |
74177
|
6970 |
456 |
if( (pVal->flags&(MEM_Str|MEM_Term))==(MEM_Str|MEM_Term) && pVal->enc==enc ){ |
|
6970 |
0 |
if( (pVal->flags&(MEM_Str|MEM_Term))==(MEM_Str|MEM_Term) && pVal->enc==enc ){ |
74181
|
35 |
421 |
if( pVal->flags&MEM_Null ){ |
74192
|
38 |
0 |
if( p ){ |
74393
|
0 |
0 |
while( (op = pExpr->op)==TK_UPLUS || op==TK_SPAN ) pExpr = pExpr->pLeft; |
|
0 |
0 |
while( (op = pExpr->op)==TK_UPLUS || op==TK_SPAN ) pExpr = pExpr->pLeft; |
74397
|
0 |
0 |
if( NEVER(op==TK_REGISTER) ) op = pExpr->op2; |
74406
|
0 |
0 |
if( op==TK_CAST ){ |
74410
|
0 |
0 |
if( *ppVal ){ |
74420
|
0 |
0 |
if( op==TK_UMINUS |
74421
|
0 |
0 |
&& (pExpr->pLeft->op==TK_INTEGER || pExpr->pLeft->op==TK_FLOAT) ){ |
|
0 |
0 |
&& (pExpr->pLeft->op==TK_INTEGER || pExpr->pLeft->op==TK_FLOAT) ){ |
74428
|
0 |
0 |
if( op==TK_STRING || op==TK_FLOAT || op==TK_INTEGER ){ |
|
0 |
0 |
if( op==TK_STRING || op==TK_FLOAT || op==TK_INTEGER ){ |
|
0 |
0 |
if( op==TK_STRING || op==TK_FLOAT || op==TK_INTEGER ){ |
74430
|
0 |
0 |
if( pVal==0 ) goto no_mem; |
74431
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_IntValue) ){ |
74435
|
0 |
0 |
if( zVal==0 ) goto no_mem; |
74438
|
0 |
0 |
if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==SQLITE_AFF_BLOB ){ |
|
0 |
0 |
if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==SQLITE_AFF_BLOB ){ |
|
0 |
0 |
if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==SQLITE_AFF_BLOB ){ |
74443
|
0 |
0 |
if( pVal->flags & (MEM_Int|MEM_Real) ) pVal->flags &= ~MEM_Str; |
74444
|
0 |
0 |
if( enc!=SQLITE_UTF8 ){ |
74447
|
0 |
0 |
}else if( op==TK_UMINUS ) { |
74449
|
0 |
0 |
if( SQLITE_OK==valueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal,pCtx) |
74450
|
0 |
0 |
&& pVal!=0 |
74453
|
0 |
0 |
if( pVal->flags & MEM_Real ){ |
74455
|
0 |
0 |
}else if( pVal->u.i==SMALLEST_INT64 ){ |
74463
|
0 |
0 |
}else if( op==TK_NULL ){ |
74465
|
0 |
0 |
if( pVal==0 ) goto no_mem; |
74469
|
0 |
0 |
else if( op==TK_BLOB ){ |
74474
|
0 |
0 |
if( !pVal ) goto no_mem; |
74487
|
0 |
0 |
else if( op==TK_TRUEFALSE ){ |
74528
|
0 |
3245 |
return pExpr ? valueFromExpr(db, pExpr, enc, affinity, ppVal, 0) : 0; |
74806
|
102 |
0 |
if( v ) sqlite3VdbeMemSetStr((Mem *)v, z, n, enc, xDel); |
74813
|
347 |
38 |
if( !v ) return; |
74824
|
0 |
0 |
return valueToText(pVal, enc)!=0 ? pVal->n : 0; |
74829
|
3176 |
562 |
if( (p->flags & MEM_Str)!=0 && pVal->enc==enc ){ |
|
3176 |
0 |
if( (p->flags & MEM_Str)!=0 && pVal->enc==enc ){ |
74832
|
562 |
0 |
if( (p->flags & MEM_Blob)!=0 ){ |
74833
|
0 |
562 |
if( p->flags & MEM_Zero ){ |
74839
|
0 |
0 |
if( p->flags & MEM_Null ) return 0; |
74869
|
0 |
5773 |
if( p==0 ) return 0; |
74872
|
1422 |
4351 |
if( db->pVdbe ){ |
74904
|
18 |
4619 |
if( p==0 ) return; |
74906
|
11 |
4608 |
if( (prepFlags & SQLITE_PREPARE_SAVESQL)==0 ){ |
74962
|
45 |
5773 |
int nNew = (p->nOpAlloc ? p->nOpAlloc*2 : (int)(1024/sizeof(Op))); |
74967
|
0 |
5818 |
if( nNew > p->db->aLimit[SQLITE_LIMIT_VDBE_OP] ){ |
74975
|
5818 |
0 |
if( pNew ){ |
74980
|
5818 |
0 |
return (pNew ? SQLITE_OK : SQLITE_NOMEM_BKPT); |
75012
|
0 |
5818 |
if( growOpArray(p, 1) ) return 1; |
75023
|
5818 |
60578 |
if( p->pParse->nOpAlloc<=i ){ |
75100
|
1464 |
292 |
for(i=0; (c = zTypes[i])!=0; i++){ |
75101
|
806 |
658 |
if( c=='s' ){ |
75102
|
566 |
240 |
const char *z = va_arg(ap, const char*); |
75103
|
134 |
672 |
sqlite3VdbeAddOp4(p, z==0 ? OP_Null : OP_String8, 0, iDest+i, 0, z, 0); |
75104
|
642 |
16 |
}else if( c=='i' ){ |
75105
|
358 |
284 |
sqlite3VdbeAddOp2(p, OP_Integer, va_arg(ap, int), iDest+i); |
75146
|
2192 |
0 |
if( p4copy ) memcpy(p4copy, zP4, 8); |
75157
|
1803 |
0 |
if( pParse->addrExplain==0 ) return 0; |
75169
|
0 |
724 |
if( pParse->explain==2 ){ |
75181
|
0 |
0 |
if( bPush) pParse->addrExplain = iThis; |
75204
|
544 |
268 |
for(j=0; jdb->nDb; j++) sqlite3VdbeUsesBtree(p, j); |
75219
|
9063 |
0 |
if( p->db->mallocFailed==0 ){ |
75260
|
8499 |
2077 |
if( (i & (i-1))==0 ){ |
75264
|
10576 |
0 |
if( p->aLabel ){ |
75281
|
10576 |
0 |
if( p->aLabel ){ |
75513
|
20574 |
40202 |
if( pOp->opcode<=SQLITE_MX_JUMP_OPCODE ){ |
75518
|
3151 |
1411 |
if( pOp->p2!=0 ) p->readOnly = 0; |
75558
|
22 |
0 |
if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2; |
75566
|
101 |
19 |
if( n>nMaxArgs ) nMaxArgs = n; |
75571
|
3290 |
11334 |
if( pOp->p2<0 ){ |
75587
|
5773 |
55003 |
if( pOp==p->aOp ) break; |
75687
|
0 |
32 |
if( p->nOp + nOp > p->pParse->nOpAlloc && growOpArray(p, nOp) ){ |
|
0 |
0 |
if( p->nOp + nOp > p->pParse->nOpAlloc && growOpArray(p, nOp) ){ |
75691
|
198 |
32 |
for(i=0; i
|
75696
|
37 |
161 |
if( (sqlite3OpcodeProperty[aOp->opcode] & OPFLG_JUMP)!=0 && aOp->p2>0 ){ |
|
37 |
0 |
if( (sqlite3OpcodeProperty[aOp->opcode] & OPFLG_JUMP)!=0 && aOp->p2>0 ){ |
75767
|
11467 |
0 |
if( p->nOp>0 ) p->aOp[p->nOp-1].p5 = p5; |
75784
|
9 |
835 |
if( (pDef->funcFlags & SQLITE_FUNC_EPHEM)!=0 ){ |
75795
|
0 |
0 |
if( p->szMalloc ) sqlite3DbFree(db, p->zMalloc); |
75818
|
690 |
0 |
if( db->pnBytesFreed==0 ) sqlite3KeyInfoUnref((KeyInfo*)p4); |
75832
|
0 |
0 |
if( db->pnBytesFreed==0 ){ |
75840
|
164 |
0 |
if( db->pnBytesFreed==0 ) sqlite3VtabUnlock((VTable *)p4); |
75852
|
5773 |
0 |
if( aOp ){ |
75854
|
60776 |
5773 |
for(pOp=&aOp[nOp-1]; pOp>=aOp; pOp--){ |
75855
|
7738 |
53038 |
if( pOp->p4type <= P4_FREE_IF_LE ) freeP4(db, pOp->p4type, pOp->p4.p); |
75879
|
0 |
448 |
if( p->db->mallocFailed ) return 0; |
75894
|
14 |
0 |
if( p->nOp>0 && p->aOp[p->nOp-1].opcode==op ){ |
|
0 |
14 |
if( p->nOp>0 && p->aOp[p->nOp-1].opcode==op ){ |
75924
|
1168 |
3786 |
if( pOp->p4type ){ |
75929
|
1168 |
3786 |
if( n<0 ){ |
75932
|
3224 |
562 |
if( n==0 ) n = sqlite3Strlen30(zP4); |
75944
|
0 |
11204 |
if( db->mallocFailed ){ |
75945
|
0 |
0 |
if( n!=P4_VTAB ) freeP4(db, n, (void*)*(char**)&zP4); |
75950
|
1674 |
9530 |
if( addr<0 ){ |
75954
|
7418 |
3786 |
if( n>=0 || pOp->p4type ){ |
|
1168 |
6250 |
if( n>=0 || pOp->p4type ){ |
75958
|
1168 |
5082 |
if( n==P4_INT32 ){ |
75963
|
5005 |
77 |
}else if( zP4!=0 ){ |
75967
|
164 |
4841 |
if( n==P4_VTAB ) sqlite3VtabLock((VTable*)zP4); |
75984
|
0 |
3075 |
if( p->db->mallocFailed ){ |
76006
|
77 |
0 |
if( pKeyInfo ) sqlite3VdbeAppendP4(v, pKeyInfo, P4_KEYINFO); |
76071
|
438 |
5890 |
if( addr<0 ){ |
76075
|
0 |
6328 |
if( p->db->mallocFailed ){ |
76271
|
0 |
0 |
for(j=0; jnKeyField; j++){ |
76273
|
0 |
0 |
const char *zColl = pColl ? pColl->zName : ""; |
76274
|
0 |
0 |
if( strcmp(zColl, "BINARY")==0 ) zColl = "B"; |
76275
|
0 |
0 |
sqlite3_str_appendf(&x, ",%s%s", |
76318
|
0 |
0 |
if( pMem->flags & MEM_Str ){ |
76320
|
0 |
0 |
}else if( pMem->flags & MEM_Int ){ |
76322
|
0 |
0 |
}else if( pMem->flags & MEM_Real ){ |
76324
|
0 |
0 |
}else if( pMem->flags & MEM_Null ){ |
76344
|
0 |
0 |
for(i=1; i<=n; i++){ |
76366
|
0 |
0 |
if( zP4==0 ){ |
76390
|
2521 |
2848 |
if( i!=1 && sqlite3BtreeSharable(p->db->aDb[i].pBt) ){ |
|
0 |
2521 |
if( i!=1 && sqlite3BtreeSharable(p->db->aDb[i].pBt) ){ |
76422
|
17456 |
0 |
if( DbMaskAllZero(p->lockMask) ) return; /* The common case */ |
76426
|
0 |
0 |
for(i=0; i
|
76427
|
0 |
0 |
if( i!=1 && DbMaskTest(p->lockMask,i) && ALWAYS(aDb[i].pBt!=0) ){ |
|
0 |
0 |
if( i!=1 && DbMaskTest(p->lockMask,i) && ALWAYS(aDb[i].pBt!=0) ){ |
|
0 |
0 |
if( i!=1 && DbMaskTest(p->lockMask,i) && ALWAYS(aDb[i].pBt!=0) ){ |
76489
|
46161 |
13378 |
while( (N--)>0 ){ |
76504
|
15314 |
3945 |
if( p && N ){ |
|
9330 |
5984 |
if( p && N ){ |
76507
|
0 |
9330 |
if( db->pnBytesFreed ){ |
76509
|
0 |
0 |
if( p->szMalloc ) sqlite3DbFree(db, p->zMalloc); |
76510
|
0 |
0 |
}while( (++p)
|
76533
|
23 |
59310 |
if( p->flags&(MEM_Agg|MEM_Dyn|MEM_Frame|MEM_RowSet) ){ |
76535
|
25509 |
33801 |
}else if( p->szMalloc ){ |
76541
|
50003 |
9330 |
}while( (++p)
|
76553
|
0 |
0 |
for(i=0; inChildCsr; i++){ |
76591
|
0 |
0 |
int bListSubprogs = (p->explain==1 || (db->flags & SQLITE_TriggerEQP)!=0); |
|
0 |
0 |
int bListSubprogs = (p->explain==1 || (db->flags & SQLITE_TriggerEQP)!=0); |
76605
|
0 |
0 |
if( p->rc==SQLITE_NOMEM ){ |
76620
|
0 |
0 |
if( bListSubprogs ){ |
76627
|
0 |
0 |
if( pSub->flags&MEM_Blob ){ |
76633
|
0 |
0 |
for(i=0; i
|
76640
|
0 |
0 |
if( i>=nRow ){ |
76645
|
0 |
0 |
if( inOp ){ |
76654
|
0 |
0 |
for(j=0; i>=apSub[j]->nOp; j++){ |
76665
|
0 |
0 |
if( bListSubprogs && pOp->p4type==P4_SUBPROGRAM ){ |
|
0 |
0 |
if( bListSubprogs && pOp->p4type==P4_SUBPROGRAM ){ |
76668
|
0 |
0 |
for(j=0; j
|
76669
|
0 |
0 |
if( apSub[j]==pOp->p4.pProgram ) break; |
76671
|
0 |
0 |
if( j==nSub ){ |
76673
|
0 |
0 |
if( p->rc!=SQLITE_OK ){ |
76684
|
0 |
0 |
if( p->explain<2 ) break; |
76685
|
0 |
0 |
if( pOp->opcode==OP_Explain ) break; |
76686
|
0 |
0 |
if( pOp->opcode==OP_Init && p->pc>1 ) break; |
|
0 |
0 |
if( pOp->opcode==OP_Init && p->pc>1 ) break; |
76689
|
0 |
0 |
if( rc==SQLITE_OK ){ |
76690
|
0 |
0 |
if( db->u1.isInterrupted ){ |
76696
|
0 |
0 |
if( p->explain==1 ){ |
76721
|
0 |
0 |
if( sqlite3VdbeMemClearAndResize(pMem, 100) ){ /* P4 */ |
76727
|
0 |
0 |
if( zP4!=pMem->z ){ |
76737
|
0 |
0 |
if( p->explain==1 ){ |
76738
|
0 |
0 |
if( sqlite3VdbeMemClearAndResize(pMem, 4) ){ |
76850
|
23469 |
1067 |
if( pBuf==0 ){ |
76852
|
23092 |
377 |
if( nByte <= p->nFree ){ |
76950
|
1549 |
4224 |
if( nCursor==0 && nMem>0 ) nMem++; /* Space for aMem[0] even if not used */ |
|
603 |
946 |
if( nCursor==0 && nMem>0 ) nMem++; /* Space for aMem[0] even if not used */ |
76964
|
301 |
5472 |
p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort); |
|
14 |
287 |
p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort); |
76965
|
0 |
5773 |
if( pParse->explain && nMem<10 ){ |
|
0 |
0 |
if( pParse->explain && nMem<10 ){ |
76989
|
5773 |
361 |
if( x.nNeeded==0 ) break; |
76992
|
361 |
0 |
}while( !db->mallocFailed ); |
76997
|
0 |
5773 |
if( db->mallocFailed ){ |
77020
|
213 |
6161 |
if( pCx==0 ){ |
77030
|
8 |
5563 |
if( pCx->isEphemeral ){ |
77031
|
8 |
0 |
if( pCx->pBtx ) sqlite3BtreeClose(pCx->pBtx); |
77057
|
7709 |
0 |
if( p->apCsr ){ |
77059
|
7776 |
7709 |
for(i=0; inCursor; i++){ |
77061
|
5309 |
2467 |
if( pC ){ |
77104
|
0 |
7709 |
if( p->pFrame ){ |
77106
|
0 |
0 |
for(pFrame=p->pFrame; pFrame->pParent; pFrame=pFrame->pParent); |
77113
|
7709 |
0 |
if( p->aMem ){ |
77116
|
0 |
7709 |
while( p->pDelFrame ){ |
77123
|
0 |
7709 |
if( p->pAuxData ) sqlite3VdbeDeleteAuxData(p->db, &p->pAuxData, -1, 0); |
77137
|
4 |
1828 |
if( p->nResColumn ){ |
77144
|
0 |
1832 |
if( p->aColName==0 ) return; |
77169
|
0 |
15795 |
if( p->db->mallocFailed ){ |
77215
|
6592 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
|
4427 |
2165 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
77217
|
993 |
3434 |
if( sqlite3BtreeIsInTrans(pBt) ){ |
77233
|
797 |
196 |
if( db->aDb[i].safety_level!=PAGER_SYNCHRONOUS_OFF |
77234
|
94 |
703 |
&& aMJNeeded[sqlite3PagerGetJournalMode(pPager)] |
77235
|
94 |
0 |
&& sqlite3PagerIsMemdb(pPager)==0 |
77244
|
0 |
2165 |
if( rc!=SQLITE_OK ){ |
77249
|
975 |
1190 |
if( needXcommit && db->xCommitCallback ){ |
|
10 |
965 |
if( needXcommit && db->xCommitCallback ){ |
77251
|
4 |
6 |
if( rc ){ |
77265
|
316 |
1845 |
if( 0==sqlite3Strlen30(sqlite3BtreeGetFilename(db->aDb[0].pBt)) |
77266
|
316 |
0 |
|| nTrans<=1 |
77268
|
6580 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
|
4419 |
2161 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
77270
|
2600 |
1819 |
if( pBt ){ |
77280
|
6580 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
|
4419 |
2161 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
77282
|
2600 |
1819 |
if( pBt ){ |
77286
|
2161 |
0 |
if( rc==SQLITE_OK ){ |
77309
|
0 |
0 |
if( zMaster==0 ) return SQLITE_NOMEM_BKPT; |
77312
|
0 |
0 |
if( retryCount ){ |
77313
|
0 |
0 |
if( retryCount>100 ){ |
77317
|
0 |
0 |
}else if( retryCount==1 ){ |
77330
|
0 |
0 |
}while( rc==SQLITE_OK && res ); |
|
0 |
0 |
}while( rc==SQLITE_OK && res ); |
77331
|
0 |
0 |
if( rc==SQLITE_OK ){ |
77338
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
77349
|
0 |
0 |
for(i=0; inDb; i++){ |
77351
|
0 |
0 |
if( sqlite3BtreeIsInTrans(pBt) ){ |
77353
|
0 |
0 |
if( zFile==0 ){ |
77359
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
77371
|
0 |
0 |
if( 0==(sqlite3OsDeviceCharacteristics(pMaster)&SQLITE_IOCAP_SEQUENTIAL) |
77372
|
0 |
0 |
&& SQLITE_OK!=(rc = sqlite3OsSync(pMaster, SQLITE_SYNC_NORMAL)) |
77390
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
77392
|
0 |
0 |
if( pBt ){ |
77398
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
77410
|
0 |
0 |
if( rc ){ |
77423
|
0 |
0 |
for(i=0; inDb; i++){ |
77425
|
0 |
0 |
if( pBt ){ |
77491
|
0 |
0 |
for(i=0; inDb; i++){ |
77494
|
0 |
0 |
if( pBt ){ |
77495
|
0 |
0 |
if( eOp==SAVEPOINT_ROLLBACK ){ |
77498
|
0 |
0 |
if( rc2==SQLITE_OK ){ |
77501
|
0 |
0 |
if( rc==SQLITE_OK ){ |
77509
|
0 |
0 |
if( rc==SQLITE_OK ){ |
77510
|
0 |
0 |
if( eOp==SAVEPOINT_ROLLBACK ){ |
77513
|
0 |
0 |
if( rc==SQLITE_OK ){ |
77521
|
0 |
0 |
if( eOp==SAVEPOINT_ROLLBACK ){ |
77528
|
0 |
9966 |
if( p->db->nStatement && p->iStatement ){ |
|
0 |
0 |
if( p->db->nStatement && p->iStatement ){ |
77548
|
2362 |
12112 |
if( (deferred && (db->nDeferredCons+db->nDeferredImmCons)>0) |
|
2362 |
0 |
if( (deferred && (db->nDeferredCons+db->nDeferredImmCons)>0) |
77549
|
12112 |
2362 |
|| (!deferred && p->nFkConstraint>0) |
|
1 |
12111 |
|| (!deferred && p->nFkConstraint>0) |
77593
|
5306 |
7709 |
if( p->magic!=VDBE_MAGIC_RUN ){ |
77596
|
0 |
7709 |
if( db->mallocFailed ){ |
77604
|
5745 |
1964 |
if( p->pc>=0 && p->bIsReader ){ |
|
5256 |
489 |
if( p->pc>=0 && p->bIsReader ){ |
77614
|
5256 |
0 |
isSpecialError = mrc==SQLITE_NOMEM || mrc==SQLITE_IOERR |
77615
|
5256 |
0 |
|| mrc==SQLITE_INTERRUPT || mrc==SQLITE_FULL; |
|
5256 |
0 |
|| mrc==SQLITE_INTERRUPT || mrc==SQLITE_FULL; |
|
0 |
5256 |
|| mrc==SQLITE_INTERRUPT || mrc==SQLITE_FULL; |
77616
|
0 |
5256 |
if( isSpecialError ){ |
77629
|
0 |
0 |
if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){ |
|
0 |
0 |
if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){ |
77630
|
0 |
0 |
if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL) && p->usesStmtJournal ){ |
|
0 |
0 |
if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL) && p->usesStmtJournal ){ |
|
0 |
0 |
if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL) && p->usesStmtJournal ){ |
77645
|
5218 |
38 |
if( p->rc==SQLITE_OK ){ |
77655
|
350 |
4906 |
if( !sqlite3VtabInSync(db) |
|
217 |
133 |
if( !sqlite3VtabInSync(db) |
77656
|
2543 |
2580 |
&& db->autoCommit |
77657
|
2184 |
359 |
&& db->nVdbeWrite==(p->readOnly==0) |
77659
|
19 |
2165 |
if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){ |
|
0 |
19 |
if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){ |
77661
|
0 |
2165 |
if( rc!=SQLITE_OK ){ |
77662
|
0 |
0 |
if( NEVER(p->readOnly) ){ |
77674
|
0 |
2165 |
if( rc==SQLITE_BUSY && p->readOnly ){ |
|
0 |
0 |
if( rc==SQLITE_BUSY && p->readOnly ){ |
77677
|
4 |
2161 |
}else if( rc!=SQLITE_OK ){ |
77692
|
3072 |
0 |
}else if( eStatementOp==0 ){ |
77693
|
20 |
3052 |
if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){ |
|
0 |
20 |
if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){ |
77695
|
20 |
0 |
}else if( p->errorAction==OE_Abort ){ |
77711
|
3072 |
2184 |
if( eStatementOp ){ |
77713
|
0 |
3072 |
if( rc ){ |
77714
|
0 |
0 |
if( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_CONSTRAINT ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_CONSTRAINT ){ |
77729
|
3139 |
2117 |
if( p->changeCntOn ){ |
77730
|
3139 |
0 |
if( eStatementOp!=SAVEPOINT_ROLLBACK ){ |
77743
|
5745 |
1964 |
if( p->pc>=0 ){ |
77745
|
3480 |
2265 |
if( !p->readOnly ) db->nVdbeWrite--; |
77746
|
5256 |
489 |
if( p->bIsReader ) db->nVdbeRead--; |
77753
|
0 |
7709 |
if( db->mallocFailed ){ |
77766
|
7 |
7702 |
return (p->rc==SQLITE_BUSY ? SQLITE_BUSY : SQLITE_OK); |
77789
|
76 |
5719 |
if( p->zErrMsg ){ |
77792
|
14 |
62 |
if( db->pErr==0 ) db->pErr = sqlite3ValueNew(db); |
77796
|
335 |
5384 |
}else if( db->pErr ){ |
77854
|
5745 |
1964 |
if( p->pc>=0 ){ |
77857
|
202 |
5543 |
if( p->runOnlyOnce ) p->expired = 1; |
77858
|
0 |
1964 |
}else if( p->rc && p->expired ){ |
|
0 |
0 |
}else if( p->rc && p->expired ){ |
77863
|
0 |
0 |
sqlite3ErrorWithMsg(db, p->rc, p->zErrMsg ? "%s" : 0, p->zErrMsg); |
77928
|
3511 |
2262 |
if( p->magic==VDBE_MAGIC_RUN || p->magic==VDBE_MAGIC_HALT ){ |
|
3511 |
0 |
if( p->magic==VDBE_MAGIC_RUN || p->magic==VDBE_MAGIC_HALT ){ |
77953
|
0 |
6 |
while( *pp ){ |
77955
|
0 |
0 |
if( (iOp<0) |
77956
|
0 |
0 |
|| (pAux->iAuxOp==iOp |
77957
|
0 |
0 |
&& pAux->iAuxArg>=0 |
77958
|
0 |
0 |
&& (pAux->iAuxArg>31 || !(mask & MASKBIT32(pAux->iAuxArg)))) |
|
0 |
0 |
&& (pAux->iAuxArg>31 || !(mask & MASKBIT32(pAux->iAuxArg)))) |
77961
|
0 |
0 |
if( pAux->xDeleteAux ){ |
77984
|
0 |
5773 |
for(pSub=p->pProgram; pSub; pSub=pNext){ |
77989
|
5773 |
0 |
if( p->magic!=VDBE_MAGIC_INIT ){ |
78018
|
123 |
5650 |
if( p->pPrev ){ |
78024
|
1355 |
4418 |
if( p->pNext ){ |
78046
|
0 |
281 |
if( rc ) return rc; |
78047
|
0 |
281 |
if( res!=0 ) return SQLITE_CORRUPT_BKPT; |
78070
|
0 |
0 |
if( isDifferentRow ) p->nullRow = 1; |
78080
|
0 |
858 |
if( sqlite3BtreeCursorHasMoved(p->uc.pCursor) ){ |
78102
|
281 |
16370 |
if( p->deferredMoveto ){ |
78104
|
0 |
281 |
if( p->aAltMap && (iMap = p->aAltMap[1+*piCol])>0 ){ |
|
0 |
0 |
if( p->aAltMap && (iMap = p->aAltMap[1+*piCol])>0 ){ |
78111
|
0 |
16370 |
if( sqlite3BtreeCursorHasMoved(p->uc.pCursor) ){ |
78167
|
789 |
11509 |
if( flags&MEM_Null ){ |
78171
|
2110 |
9399 |
if( flags&MEM_Int ){ |
78176
|
101 |
2009 |
if( i<0 ){ |
78181
|
1878 |
232 |
if( u<=127 ){ |
78182
|
1037 |
841 |
if( (i&1)==i && file_format>=4 ){ |
|
1037 |
0 |
if( (i&1)==i && file_format>=4 ){ |
78190
|
70 |
162 |
if( u<=32767 ){ *pLen = 2; return 2; } |
78191
|
0 |
162 |
if( u<=8388607 ){ *pLen = 3; return 3; } |
78192
|
30 |
132 |
if( u<=2147483647 ){ *pLen = 4; return 4; } |
78193
|
48 |
84 |
if( u<=MAX_6BYTE ){ *pLen = 6; return 5; } |
78197
|
6162 |
3237 |
if( flags&MEM_Real ){ |
78204
|
1 |
3236 |
if( flags & MEM_Zero ){ |
78235
|
470 |
395 |
if( serial_type>=128 ){ |
78318
|
8024 |
4274 |
if( serial_type<=7 && serial_type>0 ){ |
|
7235 |
789 |
if( serial_type<=7 && serial_type>0 ){ |
78321
|
6162 |
1073 |
if( serial_type==7 ){ |
78333
|
44122 |
7235 |
}while( i ); |
78338
|
3237 |
1826 |
if( serial_type>=12 ){ |
78342
|
3234 |
3 |
if( len>0 ) memcpy(buf, pMem->z, len); |
78376
|
84 |
62989 |
if( serial_type==6 ){ |
78400
|
0 |
62989 |
pMem->flags = sqlite3IsNaN(pMem->u.r) ? MEM_Null : MEM_Real; |
78516
|
0 |
174 |
if( !p ) return 0; |
78544
|
20209 |
0 |
idx = getVarint32(aKey, szHdr); |
78547
|
20219 |
0 |
while( idx
|
|
20219 |
0 |
while( idx
|
78550
|
20219 |
0 |
idx += getVarint32(&aKey[idx], serial_type); |
78558
|
20209 |
10 |
if( (++u)>=p->nField ) break; |
78717
|
1863 |
0 |
if( pMem1->enc==pColl->enc ){ |
78732
|
0 |
0 |
if( (v1==0 || v2==0) ){ |
|
0 |
0 |
if( (v1==0 || v2==0) ){ |
78733
|
0 |
0 |
if( prcErr ) *prcErr = SQLITE_NOMEM_BKPT; |
78750
|
0 |
0 |
for(i=0; i
|
78751
|
0 |
0 |
if( z[i] ) return 0; |
78773
|
0 |
197 |
if( (pB1->flags|pB2->flags) & MEM_Zero ){ |
78774
|
0 |
0 |
if( pB1->flags & pB2->flags & MEM_Zero ){ |
78776
|
0 |
0 |
}else if( pB1->flags & MEM_Zero ){ |
78777
|
0 |
0 |
if( !isAllZero(pB2->z, pB2->n) ) return -1; |
78780
|
0 |
0 |
if( !isAllZero(pB1->z, pB1->n) ) return +1; |
78785
|
4 |
193 |
if( c ) return c; |
78797
|
0 |
0 |
if( x
|
78798
|
0 |
0 |
if( x>r ) return +1; |
78836
|
18 |
1880 |
if( combined_flags&MEM_Null ){ |
78842
|
541 |
1339 |
if( combined_flags&(MEM_Int|MEM_Real) ){ |
78843
|
405 |
136 |
if( (f1 & f2 & MEM_Int)!=0 ){ |
78844
|
4 |
401 |
if( pMem1->u.i < pMem2->u.i ) return -1; |
78845
|
208 |
193 |
if( pMem1->u.i > pMem2->u.i ) return +1; |
78848
|
0 |
136 |
if( (f1 & f2 & MEM_Real)!=0 ){ |
78849
|
0 |
0 |
if( pMem1->u.r < pMem2->u.r ) return -1; |
78850
|
0 |
0 |
if( pMem1->u.r > pMem2->u.r ) return +1; |
78853
|
16 |
120 |
if( (f1&MEM_Int)!=0 ){ |
78854
|
0 |
16 |
if( (f2&MEM_Real)!=0 ){ |
78860
|
120 |
0 |
if( (f1&MEM_Real)!=0 ){ |
78861
|
0 |
120 |
if( (f2&MEM_Int)!=0 ){ |
78873
|
1339 |
0 |
if( combined_flags&MEM_Str ){ |
78874
|
0 |
1339 |
if( (f1 & MEM_Str)==0 ){ |
78877
|
0 |
1339 |
if( (f2 & MEM_Str)==0 ){ |
78891
|
1142 |
197 |
if( pColl ){ |
78983
|
36 |
35989 |
if( bSkip ){ |
78985
|
36 |
0 |
idx1 = 1 + getVarint32(&aKey1[1], s1); |
78991
|
35989 |
0 |
idx1 = getVarint32(aKey1, szHdr1); |
78993
|
0 |
35989 |
if( d1>(unsigned)nKey1 ){ |
79010
|
363 |
35681 |
if( pRhs->flags & MEM_Int ){ |
79013
|
0 |
363 |
if( serial_type>=10 ){ |
79015
|
8 |
355 |
}else if( serial_type==0 ){ |
79017
|
0 |
355 |
}else if( serial_type==7 ){ |
79023
|
64 |
291 |
if( lhs
|
79025
|
4 |
287 |
}else if( lhs>rhs ){ |
79032
|
34912 |
769 |
else if( pRhs->flags & MEM_Real ){ |
79034
|
0 |
34912 |
if( serial_type>=10 ){ |
79040
|
0 |
34912 |
}else if( serial_type==0 ){ |
79044
|
34912 |
0 |
if( serial_type==7 ){ |
79045
|
17473 |
17439 |
if( mem1.u.ru.r ){ |
79047
|
17439 |
0 |
}else if( mem1.u.r>pRhs->u.r ){ |
79057
|
727 |
42 |
else if( pRhs->flags & MEM_Str ){ |
79058
|
727 |
0 |
getVarint32(&aKey1[idx1], serial_type); |
79060
|
6 |
721 |
if( serial_type<12 ){ |
79062
|
0 |
721 |
}else if( !(serial_type & 0x01) ){ |
79068
|
0 |
721 |
if( (d1+mem1.n) > (unsigned)nKey1 ){ |
79071
|
721 |
0 |
}else if( pKeyInfo->aColl[i] ){ |
79082
|
0 |
0 |
if( rc==0 ) rc = mem1.n - pRhs->n; |
79088
|
0 |
42 |
else if( pRhs->flags & MEM_Blob ){ |
79090
|
0 |
0 |
getVarint32(&aKey1[idx1], serial_type); |
79092
|
0 |
0 |
if( serial_type<12 || (serial_type & 0x01) ){ |
|
0 |
0 |
if( serial_type<12 || (serial_type & 0x01) ){ |
79098
|
0 |
0 |
if( (d1+nStr) > (unsigned)nKey1 ){ |
79101
|
0 |
0 |
}else if( pRhs->flags & MEM_Zero ){ |
79102
|
0 |
0 |
if( !isAllZero((const char*)&aKey1[d1],nStr) ){ |
79110
|
0 |
0 |
if( rc==0 ) rc = nStr - pRhs->n; |
79121
|
35685 |
359 |
if( rc!=0 ){ |
79122
|
17427 |
18258 |
if( pKeyInfo->aSortOrder[i] ){ |
79134
|
354 |
5 |
}while( idx1<(unsigned)szHdr1 && inField && d1<=(unsigned)nKey1 ); |
|
19 |
335 |
}while( idx1<(unsigned)szHdr1 && inField && d1<=(unsigned)nKey1 ); |
|
19 |
0 |
}while( idx1<(unsigned)szHdr1 && inField && d1<=(unsigned)nKey1 ); |
79237
|
270 |
65 |
if( v>lhs ){ |
79239
|
1 |
64 |
}else if( v
|
79241
|
31 |
33 |
}else if( pPKey2->nField>1 ){ |
79272
|
13 |
0 |
getVarint32(&aKey1[1], serial_type); |
79273
|
2 |
11 |
if( serial_type<12 ){ |
79275
|
0 |
11 |
}else if( !(serial_type & 0x01) ){ |
79283
|
0 |
11 |
if( (szHdr + nStr) > nKey1 ){ |
79290
|
10 |
1 |
if( res==0 ){ |
79292
|
4 |
6 |
if( res==0 ){ |
79293
|
0 |
4 |
if( pPKey2->nField>1 ){ |
79299
|
0 |
6 |
}else if( res>0 ){ |
79304
|
0 |
1 |
}else if( res>0 ){ |
79337
|
229 |
0 |
if( p->pKeyInfo->nAllField<=13 ){ |
79339
|
0 |
229 |
if( p->pKeyInfo->aSortOrder[0] ){ |
79346
|
182 |
47 |
if( (flags & MEM_Int) ){ |
79352
|
33 |
14 |
if( (flags & (MEM_Real|MEM_Null|MEM_Blob))==0 && p->pKeyInfo->aColl[0]==0 ){ |
|
15 |
18 |
if( (flags & (MEM_Real|MEM_Null|MEM_Blob))==0 && p->pKeyInfo->aColl[0]==0 ){ |
79389
|
0 |
302 |
if( rc ){ |
79394
|
302 |
0 |
(void)getVarint32((u8*)m.z, szHdr); |
79397
|
302 |
0 |
if( unlikely(szHdr<3 || (int)szHdr>m.n) ){ |
|
302 |
0 |
if( unlikely(szHdr<3 || (int)szHdr>m.n) ){ |
79403
|
302 |
0 |
(void)getVarint32((u8*)&m.z[szHdr-1], typeRowid); |
79412
|
302 |
0 |
if( unlikely(typeRowid<1 || typeRowid>9 || typeRowid==7) ){ |
|
302 |
0 |
if( unlikely(typeRowid<1 || typeRowid>9 || typeRowid==7) ){ |
|
302 |
0 |
if( unlikely(typeRowid<1 || typeRowid>9 || typeRowid==7) ){ |
79417
|
0 |
302 |
if( unlikely((u32)m.n
|
79463
|
319 |
0 |
if( nCellKey<=0 || nCellKey>0x7fffffff ){ |
|
0 |
319 |
if( nCellKey<=0 || nCellKey>0x7fffffff ){ |
79469
|
0 |
319 |
if( rc ){ |
79507
|
152 |
384 |
for(p = db->pVdbe; p; p=p->pNext){ |
79536
|
0 |
0 |
if( v ){ |
79539
|
0 |
0 |
if( 0==(pMem->flags & MEM_Null) ){ |
79541
|
0 |
0 |
if( pRet ){ |
79559
|
0 |
0 |
if( iVar>=32 ){ |
79579
|
0 |
0 |
if( pCtx->pVdbe->aOp[pCtx->iOp].opcode==OP_PureFunc ){ |
79595
|
0 |
1446 |
if( pVtab->zErrMsg ){ |
79725
|
0 |
0 |
return p==0 || p->expired; |
|
0 |
0 |
return p==0 || p->expired; |
79735
|
0 |
16826 |
if( p->db==0 ){ |
79743
|
0 |
14501 |
if( p==0 ){ |
79765
|
6 |
0 |
if( db->xProfile ){ |
79768
|
0 |
6 |
if( db->mTrace & SQLITE_TRACE_PROFILE ){ |
79794
|
477 |
2325 |
if( pStmt==0 ){ |
79801
|
0 |
2325 |
if( vdbeSafety(v) ) return SQLITE_MISUSE_BKPT; |
79803
|
0 |
2325 |
checkProfileCallback(db, v); |
79821
|
80 |
1936 |
if( pStmt==0 ){ |
79827
|
0 |
1936 |
checkProfileCallback(db, v); |
79848
|
0 |
0 |
for(i=0; inVar; i++){ |
79853
|
0 |
0 |
if( p->expmask ){ |
79867
|
569 |
0 |
if( p->flags & (MEM_Blob|MEM_Str) ){ |
79868
|
0 |
569 |
if( ExpandBlob(p)!=SQLITE_OK ){ |
|
0 |
0 |
if( ExpandBlob(p)!=SQLITE_OK ){ |
79873
|
568 |
1 |
return p->n ? p->z : 0; |
79895
|
0 |
0 |
return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0); |
79899
|
0 |
0 |
if( (p->flags&(MEM_TypeMask|MEM_Term|MEM_Subtype)) == |
79901
|
0 |
0 |
&& zPType!=0 |
79902
|
0 |
0 |
&& p->eSubtype=='p' |
79903
|
0 |
0 |
&& strcmp(p->u.zPType, zPType)==0 |
79975
|
0 |
0 |
if( pOrig==0 ) return 0; |
79977
|
0 |
0 |
if( pNew==0 ) return 0; |
79982
|
0 |
0 |
if( pNew->flags&(MEM_Str|MEM_Blob) ){ |
79985
|
0 |
0 |
if( sqlite3VdbeMemMakeWriteable(pNew)!=SQLITE_OK ){ |
80019
|
0 |
708 |
if( sqlite3VdbeMemSetStr(pCtx->pOut, z, n, enc, xDel)==SQLITE_TOOBIG ){ |
80029
|
0 |
0 |
if( xDel==0 ){ |
80031
|
0 |
0 |
}else if( xDel==SQLITE_TRANSIENT ){ |
80036
|
0 |
0 |
if( pCtx ) sqlite3_result_error_toobig(pCtx); |
80057
|
0 |
0 |
if( n>0x7fffffff ){ |
80127
|
0 |
0 |
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE; |
80128
|
0 |
0 |
if( n>0x7fffffff ){ |
80174
|
0 |
1 |
if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
80181
|
0 |
0 |
pCtx->isError = errCode ? errCode : -1; |
80185
|
0 |
0 |
if( pCtx->pOut->flags & MEM_Null ){ |
80215
|
5576 |
2708 |
for(i=0; inDb; i++){ |
80217
|
3372 |
2204 |
if( pBt ){ |
80222
|
0 |
3372 |
if( nEntry>0 && db->xWalCallback && rc==SQLITE_OK ){ |
|
0 |
0 |
if( nEntry>0 && db->xWalCallback && rc==SQLITE_OK ){ |
|
0 |
0 |
if( nEntry>0 && db->xWalCallback && rc==SQLITE_OK ){ |
80246
|
0 |
12128 |
if( p->magic!=VDBE_MAGIC_RUN ){ |
80276
|
0 |
12128 |
if( db->mallocFailed ){ |
80281
|
5746 |
6382 |
if( p->pc<=0 && p->expired ){ |
|
1 |
5745 |
if( p->pc<=0 && p->expired ){ |
80286
|
5745 |
6382 |
if( p->pc<0 ){ |
80291
|
4920 |
825 |
if( db->nVdbeActive==0 ){ |
80300
|
5737 |
8 |
if( (db->xProfile || (db->mTrace & SQLITE_TRACE_PROFILE)!=0) |
|
0 |
5737 |
if( (db->xProfile || (db->mTrace & SQLITE_TRACE_PROFILE)!=0) |
80301
|
6 |
2 |
&& !db->init.busy && p->zSql ){ |
|
6 |
0 |
&& !db->init.busy && p->zSql ){ |
80309
|
3480 |
2265 |
if( p->readOnly==0 ) db->nVdbeWrite++; |
80310
|
5256 |
489 |
if( p->bIsReader ) db->nVdbeRead++; |
80317
|
0 |
12127 |
if( p->explain ){ |
80329
|
5306 |
6821 |
if( rc!=SQLITE_ROW ) checkProfileCallback(db, p); |
|
6 |
5300 |
if( rc!=SQLITE_ROW ) checkProfileCallback(db, p); |
80332
|
5257 |
6870 |
if( rc==SQLITE_DONE && db->autoCommit ){ |
|
2708 |
2549 |
if( rc==SQLITE_DONE && db->autoCommit ){ |
80335
|
0 |
2708 |
if( p->rc!=SQLITE_OK ){ |
80341
|
0 |
12127 |
if( SQLITE_NOMEM==sqlite3ApiExit(p->db, p->rc) ){ |
80356
|
11343 |
785 |
if( (p->prepFlags & SQLITE_PREPARE_SAVESQL)!=0 |
80357
|
4872 |
6471 |
&& rc!=SQLITE_ROW |
80358
|
50 |
4822 |
&& rc!=SQLITE_DONE |
80380
|
0 |
12127 |
if( vdbeSafetyNotNull(v) ){ |
80386
|
1 |
12127 |
while( (rc = sqlite3Step(v))==SQLITE_SCHEMA |
80387
|
1 |
0 |
&& cnt++ < SQLITE_MAX_SCHEMA_RETRY ){ |
80390
|
0 |
1 |
if( rc!=SQLITE_OK ){ |
80401
|
0 |
0 |
if( !db->mallocFailed ){ |
80411
|
0 |
1 |
if( savedPc>=0 ) v->doingRerun = 1; |
80478
|
0 |
0 |
if( *piTime==0 ){ |
80480
|
0 |
0 |
if( rc ) *piTime = 0; |
80492
|
73 |
117 |
if( nByte<=0 ){ |
80499
|
117 |
0 |
if( pMem->z ){ |
80515
|
190 |
470 |
if( (p->pMem->flags & MEM_Agg)==0 ){ |
80541
|
0 |
0 |
for(pAuxData=pCtx->pVdbe->pAuxData; pAuxData; pAuxData=pAuxData->pNextAux){ |
80542
|
0 |
0 |
if( pAuxData->iAuxArg==iArg && (pAuxData->iAuxOp==pCtx->iOp || iArg<0) ){ |
|
0 |
0 |
if( pAuxData->iAuxArg==iArg && (pAuxData->iAuxOp==pCtx->iOp || iArg<0) ){ |
|
0 |
0 |
if( pAuxData->iAuxArg==iArg && (pAuxData->iAuxOp==pCtx->iOp || iArg<0) ){ |
80576
|
0 |
0 |
for(pAuxData=pVdbe->pAuxData; pAuxData; pAuxData=pAuxData->pNextAux){ |
80577
|
0 |
0 |
if( pAuxData->iAuxArg==iArg && (pAuxData->iAuxOp==pCtx->iOp || iArg<0) ){ |
|
0 |
0 |
if( pAuxData->iAuxArg==iArg && (pAuxData->iAuxOp==pCtx->iOp || iArg<0) ){ |
|
0 |
0 |
if( pAuxData->iAuxArg==iArg && (pAuxData->iAuxOp==pCtx->iOp || iArg<0) ){ |
80581
|
0 |
0 |
if( pAuxData==0 ){ |
80583
|
0 |
0 |
if( !pAuxData ) goto failed; |
80588
|
0 |
0 |
if( pCtx->isError==0 ) pCtx->isError = -1; |
80589
|
0 |
0 |
}else if( pAuxData->xDeleteAux ){ |
80598
|
0 |
0 |
if( xDelete ){ |
80624
|
7689 |
4 |
return pVm ? pVm->nResColumn : 0; |
80633
|
71 |
0 |
if( pVm==0 || pVm->pResultSet==0 ) return 0; |
|
0 |
71 |
if( pVm==0 || pVm->pResultSet==0 ) return 0; |
80685
|
0 |
11429 |
if( pVm==0 ) return (Mem*)columnNullValue(); |
80688
|
11423 |
6 |
if( pVm->pResultSet!=0 && inResColumn && i>=0 ){ |
|
11423 |
0 |
if( pVm->pResultSet!=0 && inResColumn && i>=0 ){ |
|
11423 |
0 |
if( pVm->pResultSet!=0 && inResColumn && i>=0 ){ |
80723
|
11429 |
0 |
if( p ){ |
80777
|
0 |
71 |
if( pOut->flags&MEM_Static ){ |
80834
|
2995 |
0 |
if( N=0 ){ |
|
2995 |
0 |
if( N=0 ){ |
80842
|
0 |
2995 |
if( db->mallocFailed ){ |
80960
|
0 |
2374 |
if( vdbeSafetyNotNull(p) ){ |
80964
|
2374 |
0 |
if( p->magic!=VDBE_MAGIC_RUN || p->pc>=0 ){ |
|
0 |
2374 |
if( p->magic!=VDBE_MAGIC_RUN || p->pc>=0 ){ |
80971
|
2374 |
0 |
if( i<1 || i>p->nVar ){ |
|
0 |
2374 |
if( i<1 || i>p->nVar ){ |
80992
|
0 |
2374 |
if( p->expmask!=0 && (p->expmask & (i>=31 ? 0x80000000 : (u32)1<
|
|
0 |
0 |
if( p->expmask!=0 && (p->expmask & (i>=31 ? 0x80000000 : (u32)1<
|
|
0 |
0 |
if( p->expmask!=0 && (p->expmask & (i>=31 ? 0x80000000 : (u32)1<
|
81014
|
1502 |
0 |
if( rc==SQLITE_OK ){ |
81015
|
1502 |
0 |
if( zData!=0 ){ |
81018
|
1502 |
0 |
if( rc==SQLITE_OK && encoding!=0 ){ |
|
1139 |
363 |
if( rc==SQLITE_OK && encoding!=0 ){ |
81021
|
0 |
1502 |
if( rc ){ |
81027
|
0 |
0 |
}else if( xDel!=SQLITE_STATIC && xDel!=SQLITE_TRANSIENT ){ |
|
0 |
0 |
}else if( xDel!=SQLITE_STATIC && xDel!=SQLITE_TRANSIENT ){ |
81057
|
0 |
0 |
if( nData>0x7fffffff ){ |
81067
|
2 |
0 |
if( rc==SQLITE_OK ){ |
81080
|
738 |
0 |
if( rc==SQLITE_OK ){ |
81105
|
0 |
0 |
if( rc==SQLITE_OK ){ |
81108
|
0 |
0 |
}else if( xDestructor ){ |
81131
|
0 |
0 |
if( nData>0x7fffffff ){ |
81134
|
0 |
0 |
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE; |
81161
|
0 |
0 |
if( pValue->flags & MEM_Zero ){ |
81184
|
0 |
0 |
if( rc==SQLITE_OK ){ |
81194
|
0 |
0 |
if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
81211
|
1419 |
7 |
return p ? p->nVar : 0; |
81222
|
0 |
4 |
if( p==0 ) return 0; |
81232
|
7 |
0 |
if( p==0 || zName==0 ) return 0; |
|
0 |
7 |
if( p==0 || zName==0 ) return 0; |
81249
|
0 |
1 |
for(i=0; inVar; i++){ |
81272
|
0 |
0 |
if( pFrom->nVar!=pTo->nVar ){ |
81276
|
0 |
0 |
if( pTo->expmask ){ |
81280
|
0 |
0 |
if( pFrom->expmask ){ |
81294
|
0 |
0 |
return pStmt ? ((Vdbe*)pStmt)->db : 0; |
81302
|
0 |
0 |
return pStmt ? ((Vdbe*)pStmt)->readOnly : 1; |
81310
|
0 |
0 |
return v!=0 && v->magic==VDBE_MAGIC_RUN && v->pc>=0; |
|
0 |
0 |
return v!=0 && v->magic==VDBE_MAGIC_RUN && v->pc>=0; |
|
0 |
0 |
return v!=0 && v->magic==VDBE_MAGIC_RUN && v->pc>=0; |
81328
|
0 |
0 |
if( pStmt==0 ){ |
81351
|
0 |
6 |
if( op==SQLITE_STMTSTATUS_MEMUSED ){ |
81362
|
0 |
6 |
if( resetFlag ) pVdbe->aCounter[op] = 0; |
81372
|
1565 |
0 |
return p ? p->zSql : 0; |
81390
|
0 |
0 |
if( zSql ){ |
81691
|
110 |
10 |
while( zSql[0] ){ |
81694
|
10 |
100 |
if( tokenType==TK_VARIABLE ){ |
81748
|
0 |
14 |
if( db->nVdbeExec>1 ){ |
81749
|
0 |
0 |
while( *zRawSql ){ |
81751
|
0 |
0 |
while( *(zRawSql++)!='\n' && *zRawSql ); |
|
0 |
0 |
while( *(zRawSql++)!='\n' && *zRawSql ); |
81756
|
4 |
10 |
}else if( p->nVar==0 ){ |
81759
|
20 |
0 |
while( zRawSql[0] ){ |
81765
|
10 |
10 |
if( nToken==0 ) break; |
81766
|
10 |
0 |
if( zRawSql[0]=='?' ){ |
81767
|
0 |
10 |
if( nToken>1 ){ |
81787
|
0 |
10 |
if( pVar->flags & MEM_Null ){ |
81789
|
0 |
10 |
}else if( pVar->flags & MEM_Int ){ |
81791
|
0 |
10 |
}else if( pVar->flags & MEM_Real ){ |
81793
|
10 |
0 |
}else if( pVar->flags & MEM_Str ){ |
81797
|
0 |
10 |
if( enc!=SQLITE_UTF8 ){ |
81801
|
0 |
0 |
if( SQLITE_NOMEM==sqlite3VdbeChangeEncoding(&utf8, SQLITE_UTF8) ){ |
81822
|
0 |
10 |
if( enc!=SQLITE_UTF8 ) sqlite3VdbeMemRelease(&utf8); |
81824
|
0 |
0 |
}else if( pVar->flags & MEM_Zero ){ |
81834
|
0 |
0 |
for(i=0; i
|
81846
|
0 |
14 |
if( out.accError ) sqlite3_str_reset(&out); |
82062
|
1017 |
5144 |
Mem *pMem = iCur>0 ? &p->aMem[p->nMem-iCur] : p->aMem; |
82066
|
5571 |
590 |
nByte = |
82071
|
202 |
5959 |
if( p->apCsr[iCur] ){ /*OPTIMIZATION-IF-FALSE*/ |
82075
|
6161 |
0 |
if( SQLITE_OK==sqlite3VdbeMemClearAndResize(pMem, nByte) ){ |
82082
|
5571 |
590 |
if( eCurType==CURTYPE_BTREE ){ |
82111
|
30 |
356 |
if( sqlite3AtoF(pRec->z, &rValue, pRec->n, enc)==0 ) return; |
82112
|
352 |
4 |
if( 0==sqlite3Atoi64(pRec->z, &iValue, pRec->n, enc) ){ |
82118
|
4 |
0 |
if( bTryForInt ) sqlite3VdbeIntegerAffinity(pRec); |
82150
|
1847 |
1236 |
if( affinity>=SQLITE_AFF_NUMERIC ){ |
82153
|
950 |
897 |
if( (pRec->flags & MEM_Int)==0 ){ /*OPTIMIZATION-IF-FALSE*/ |
82154
|
950 |
0 |
if( (pRec->flags & MEM_Real)==0 ){ |
82155
|
292 |
658 |
if( pRec->flags & MEM_Str ) applyNumericAffinity(pRec,1); |
82160
|
1226 |
10 |
}else if( affinity==SQLITE_AFF_TEXT ){ |
82166
|
41 |
1185 |
if( 0==(pRec->flags&MEM_Str) ){ /*OPTIMIZATION-IF-FALSE*/ |
82167
|
4 |
37 |
if( (pRec->flags&(MEM_Real|MEM_Int)) ){ |
82183
|
0 |
10 |
if( eType==SQLITE_TEXT ){ |
82212
|
0 |
2 |
if( sqlite3AtoF(pMem->z, &pMem->u.r, pMem->n, pMem->enc)==0 ){ |
82215
|
2 |
0 |
if( sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc)==0 ){ |
82229
|
73 |
35 |
if( pMem->flags & (MEM_Int|MEM_Real) ){ |
82232
|
2 |
33 |
if( pMem->flags & (MEM_Str|MEM_Blob) ){ |
82492
|
9 |
15631 |
if( VdbeMemDynamic(pOut) ){ /*OPTIMIZATION-IF-FALSE*/ |
82537
|
0 |
12200 |
if( p->rc==SQLITE_NOMEM ){ |
82548
|
0 |
12200 |
if( db->u1.isInterrupted ) goto abort_due_to_interrupt; |
82551
|
4014 |
8186 |
if( db->xProgress ){ |
82726
|
0 |
17440 |
if( db->u1.isInterrupted ) goto abort_due_to_interrupt; |
82734
|
240 |
17200 |
if( nVmStep>=nProgressLimit && db->xProgress!=0 ){ |
|
240 |
0 |
if( nVmStep>=nProgressLimit && db->xProgress!=0 ){ |
82737
|
0 |
240 |
if( db->xProgress(db->pProgressArg) ){ |
82800
|
26 |
22 |
if( pOp->p2 ) goto jump_to_p2; |
82863
|
81 |
0 |
if( (pIn3->flags & MEM_Null)==0 ) break; |
82905
|
5044 |
4 |
if( pOp->p1==SQLITE_OK && p->pFrame ){ |
|
0 |
5044 |
if( pOp->p1==SQLITE_OK && p->pFrame ){ |
82912
|
0 |
0 |
if( pOp->p2==OE_Ignore ){ |
82929
|
4 |
5044 |
if( p->rc ){ |
82930
|
4 |
0 |
if( pOp->p5 ){ |
82938
|
3 |
1 |
if( pOp->p4.z ){ |
82948
|
0 |
5048 |
if( rc==SQLITE_BUSY ){ |
82953
|
5 |
5043 |
rc = p->rc ? SQLITE_ERROR : SQLITE_DONE; |
83013
|
0 |
2805 |
if( encoding!=SQLITE_UTF8 ){ |
83016
|
0 |
0 |
if( SQLITE_OK!=sqlite3VdbeChangeEncoding(pOut, encoding) ) goto no_mem; |
83021
|
0 |
0 |
if( pOp->p4type==P4_DYNAMIC ){ |
83030
|
0 |
2805 |
if( pOp->p1>db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
83058
|
0 |
3000 |
if( pOp->p3>0 ){ |
83062
|
0 |
0 |
if( pIn3->u.i==pOp->p5 ) pOut->flags = MEM_Blob|MEM_Static|MEM_Term; |
83086
|
0 |
1432 |
pOut->flags = nullFlag = pOp->p1 ? (MEM_Null|MEM_Cleared) : MEM_Null; |
83088
|
743 |
1432 |
while( cnt>0 ){ |
83143
|
0 |
2302 |
if( sqlite3VdbeMemTooBig(pVar) ){ |
83185
|
0 |
113 |
Deephemeralize(pOut); |
|
0 |
0 |
Deephemeralize(pOut); |
83189
|
0 |
113 |
}while( --n ); |
83210
|
1197 |
109 |
Deephemeralize(pOut); |
|
0 |
1197 |
Deephemeralize(pOut); |
83215
|
1306 |
0 |
if( (n--)==0 ) break; |
83281
|
2002 |
4892 |
if( db->xProgress!=0 |
83282
|
80 |
1922 |
&& nVmStep>=nProgressLimit |
83283
|
0 |
80 |
&& db->xProgress(db->pProgressArg)!=0 |
83293
|
0 |
6894 |
if( SQLITE_OK!=(rc = sqlite3VdbeCheckFk(p, 0)) ){ |
83326
|
10523 |
6894 |
for(i=0; ip2; i++){ |
83328
|
0 |
10523 |
Deephemeralize(&pMem[i]); |
|
0 |
0 |
Deephemeralize(&pMem[i]); |
83334
|
0 |
6894 |
if( db->mallocFailed ) goto no_mem; |
83336
|
0 |
6894 |
if( db->mTrace & SQLITE_TRACE_ROW ){ |
83367
|
0 |
0 |
if( (pIn1->flags | pIn2->flags) & MEM_Null ){ |
83371
|
0 |
0 |
if( ExpandBlob(pIn1) || ExpandBlob(pIn2) ) goto no_mem; |
|
0 |
0 |
if( ExpandBlob(pIn1) || ExpandBlob(pIn2) ) goto no_mem; |
|
0 |
0 |
if( ExpandBlob(pIn1) || ExpandBlob(pIn2) ) goto no_mem; |
|
0 |
0 |
if( ExpandBlob(pIn1) || ExpandBlob(pIn2) ) goto no_mem; |
83372
|
0 |
0 |
Stringify(pIn1, encoding); |
|
0 |
0 |
Stringify(pIn1, encoding); |
83373
|
0 |
0 |
Stringify(pIn2, encoding); |
|
0 |
0 |
Stringify(pIn2, encoding); |
83375
|
0 |
0 |
if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
83378
|
0 |
0 |
if( sqlite3VdbeMemGrow(pOut, (int)nByte+2, pOut==pIn2) ){ |
83382
|
0 |
0 |
if( pOut!=pIn2 ){ |
83453
|
21 |
33 |
if( (type1 & type2 & MEM_Int)!=0 ){ |
83458
|
0 |
21 |
case OP_Add: if( sqlite3AddInt64(&iB,iA) ) goto fp_math; break; |
83459
|
0 |
0 |
case OP_Subtract: if( sqlite3SubInt64(&iB,iA) ) goto fp_math; break; |
83460
|
0 |
0 |
case OP_Multiply: if( sqlite3MulInt64(&iB,iA) ) goto fp_math; break; |
83462
|
0 |
0 |
if( iA==0 ) goto arithmetic_result_is_null; |
83463
|
0 |
0 |
if( iA==-1 && iB==SMALLEST_INT64 ) goto fp_math; |
|
0 |
0 |
if( iA==-1 && iB==SMALLEST_INT64 ) goto fp_math; |
83468
|
0 |
0 |
if( iA==0 ) goto arithmetic_result_is_null; |
83469
|
0 |
0 |
if( iA==-1 ) iA = 1; |
83476
|
33 |
0 |
}else if( (flags & MEM_Null)!=0 ){ |
83489
|
0 |
0 |
if( rA==(double)0 ) goto arithmetic_result_is_null; |
83496
|
0 |
0 |
if( iA==0 ) goto arithmetic_result_is_null; |
83497
|
0 |
0 |
if( iA==-1 ) iA = 1; |
83506
|
0 |
0 |
if( sqlite3IsNaN(rB) ){ |
83511
|
0 |
0 |
if( ((type1|type2)&MEM_Real)==0 && !bIntint ){ |
|
0 |
0 |
if( ((type1|type2)&MEM_Real)==0 && !bIntint ){ |
83540
|
0 |
19 |
if( pOp->p1 ){ |
83588
|
0 |
0 |
if( (pIn1->flags | pIn2->flags) & MEM_Null ){ |
83595
|
0 |
0 |
if( op==OP_BitAnd ){ |
83597
|
0 |
0 |
}else if( op==OP_BitOr ){ |
83599
|
0 |
0 |
}else if( iB!=0 ){ |
83603
|
0 |
0 |
if( iB<0 ){ |
83606
|
0 |
0 |
iB = iB>(-64) ? -iB : 64; |
83609
|
0 |
0 |
if( iB>=64 ){ |
83610
|
0 |
0 |
iA = (iA>=0 || op==OP_ShiftLeft) ? 0 : -1; |
|
0 |
0 |
iA = (iA>=0 || op==OP_ShiftLeft) ? 0 : -1; |
83613
|
0 |
0 |
if( op==OP_ShiftLeft ){ |
83618
|
0 |
0 |
if( iA<0 ) uA |= ((((u64)0xffffffff)<<32)|0xffffffff) << (64-iB); |
83653
|
121 |
120 |
if( (pIn1->flags & MEM_Int)==0 ){ |
83656
|
4 |
117 |
if( (pIn1->flags & MEM_Int)==0 ){ |
83657
|
4 |
0 |
if( pOp->p2==0 ){ |
83681
|
0 |
0 |
if( pIn1->flags & MEM_Int ){ |
83713
|
0 |
1 |
rc = ExpandBlob(pIn1); |
83716
|
0 |
1 |
if( rc ) goto abort_due_to_error; |
83832
|
48 |
1797 |
if( (flags1 | flags3)&MEM_Null ){ |
83834
|
12 |
36 |
if( pOp->p5 & SQLITE_NULLEQ ){ |
83842
|
2 |
10 |
if( (flags1&flags3&MEM_Null)!=0 |
83843
|
2 |
0 |
&& (flags3&MEM_Cleared)==0 |
83854
|
0 |
36 |
if( pOp->p5 & SQLITE_STOREP2 ){ |
83862
|
15 |
21 |
if( pOp->p5 & SQLITE_JUMPIFNULL ){ |
83871
|
144 |
1653 |
if( affinity>=SQLITE_AFF_NUMERIC ){ |
83872
|
94 |
50 |
if( (flags1 | flags3)&MEM_Str ){ |
83873
|
94 |
0 |
if( (flags1 & (MEM_Int|MEM_Real|MEM_Str))==MEM_Str ){ |
83878
|
0 |
94 |
if( (flags3 & (MEM_Int|MEM_Real|MEM_Str))==MEM_Str ){ |
83884
|
144 |
0 |
if( (pIn1->flags & pIn3->flags & MEM_Int)!=0 ){ |
83885
|
35 |
109 |
if( pIn3->u.i > pIn1->u.i ){ res = +1; goto compare_op; } |
83886
|
52 |
57 |
if( pIn3->u.i < pIn1->u.i ){ res = -1; goto compare_op; } |
83890
|
1041 |
612 |
}else if( affinity==SQLITE_AFF_TEXT ){ |
83891
|
0 |
1041 |
if( (flags1 & MEM_Str)==0 && (flags1 & (MEM_Int|MEM_Real))!=0 ){ |
|
0 |
0 |
if( (flags1 & MEM_Str)==0 && (flags1 & (MEM_Int|MEM_Real))!=0 ){ |
83899
|
0 |
1041 |
if( (flags3 & MEM_Str)==0 && (flags3 & (MEM_Int|MEM_Real))!=0 ){ |
|
0 |
0 |
if( (flags3 & MEM_Str)==0 && (flags3 & (MEM_Int|MEM_Real))!=0 ){ |
83919
|
718 |
1091 |
if( res<0 ){ /* ne, eq, gt, le, lt, ge */ |
83922
|
719 |
372 |
}else if( res==0 ){ |
83936
|
0 |
1809 |
if( pOp->p5 & SQLITE_STOREP2 ){ |
83939
|
0 |
0 |
if( (pOp->p5 & SQLITE_KEEPNULL)!=0 ){ |
83953
|
0 |
0 |
if( (pOp->opcode==OP_Eq)==res2 ) break; |
83961
|
632 |
1177 |
if( res2 ){ |
83981
|
0 |
0 |
if( iCompare!=0 ) goto jump_to_p2; |
84037
|
245 |
0 |
if( (pOp->p5 & OPFLAG_PERMUTE)==0 ){ |
84063
|
245 |
218 |
for(i=0; i
|
84064
|
0 |
245 |
idx = aPermute ? aPermute[i] : i; |
84073
|
27 |
218 |
if( iCompare ){ |
84074
|
0 |
27 |
if( bRev ) iCompare = -iCompare; |
84088
|
27 |
218 |
if( iCompare<0 ){ |
84090
|
218 |
0 |
}else if( iCompare==0 ){ |
84125
|
0 |
0 |
if( pOp->opcode==OP_And ){ |
84133
|
0 |
0 |
if( v1==2 ){ |
84181
|
0 |
0 |
if( (pIn1->flags & MEM_Null)==0 ){ |
84200
|
0 |
0 |
if( (pIn1->flags & MEM_Null)==0 ){ |
84227
|
0 |
186 |
if( p->pFrame ){ |
84229
|
0 |
0 |
if( (p->pFrame->aOnce[iAddr/8] & (1<<(iAddr & 7)))!=0 ){ |
84235
|
2 |
184 |
if( p->aOp[0].p1==pOp->p1 ){ |
84255
|
169 |
257 |
if( c ) goto jump_to_p2; |
84269
|
239 |
85 |
if( c ) goto jump_to_p2; |
84281
|
87 |
528 |
if( (pIn1->flags & MEM_Null)!=0 ){ |
84295
|
413 |
101 |
if( (pIn1->flags & MEM_Null)==0 ){ |
84312
|
0 |
0 |
if( p->apCsr[pOp->p1]->nullRow ){ |
84397
|
0 |
16651 |
if( rc ) goto abort_due_to_error; |
84410
|
12225 |
4426 |
if( pC->cacheStatus!=p->cacheCtr ){ /*OPTIMIZATION-IF-FALSE*/ |
84411
|
4737 |
7488 |
if( pC->nullRow ){ |
84412
|
4737 |
0 |
if( pC->eCurType==CURTYPE_PSEUDO ){ |
84434
|
0 |
7488 |
if( pC->payloadSize > (u32)db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
84439
|
12225 |
0 |
pC->iHdrOffset = getVarint32(pC->aRow, aOffset[0]); |
84443
|
0 |
12225 |
if( pC->szRow
|
84460
|
0 |
0 |
if( aOffset[0] > 98307 || aOffset[0] > pC->payloadSize ){ |
|
0 |
0 |
if( aOffset[0] > 98307 || aOffset[0] > pC->payloadSize ){ |
84487
|
2260 |
2166 |
if( pC->nHdrParsed<=p2 ){ |
84491
|
2260 |
0 |
if( pC->iHdrOffset
|
84493
|
0 |
2260 |
if( pC->aRow==0 ){ |
84496
|
0 |
0 |
if( rc!=SQLITE_OK ) goto abort_due_to_error; |
84510
|
18374 |
364 |
if( (t = zHdr[0])<0x80 ){ |
84519
|
4353 |
14385 |
}while( i<=p2 && zHdr
|
|
4253 |
100 |
}while( i<=p2 && zHdr
|
84526
|
11275 |
3210 |
if( (zHdr>=zEndHdr && (zHdr>zEndHdr || offset64!=pC->payloadSize)) |
|
11275 |
0 |
if( (zHdr>=zEndHdr && (zHdr>zEndHdr || offset64!=pC->payloadSize)) |
|
11275 |
0 |
if( (zHdr>=zEndHdr && (zHdr>zEndHdr || offset64!=pC->payloadSize)) |
84527
|
0 |
14485 |
|| (offset64 > pC->payloadSize) |
84529
|
0 |
0 |
if( aOffset[0]==0 ){ |
84533
|
0 |
0 |
if( pC->aRow==0 ) sqlite3VdbeMemRelease(&sMem); |
84540
|
0 |
14485 |
if( pC->aRow==0 ) sqlite3VdbeMemRelease(&sMem); |
84549
|
100 |
14385 |
if( pC->nHdrParsed<=p2 ){ |
84550
|
0 |
100 |
if( pOp->p4type==P4_MEM ){ |
84568
|
0 |
16551 |
if( VdbeMemDynamic(pDest) ){ |
84572
|
16545 |
6 |
if( pC->szRow>=aOffset[p2+1] ){ |
84576
|
11643 |
4902 |
if( t<12 ){ |
84586
|
2128 |
2774 |
if( pDest->szMalloc < len+2 ){ |
84588
|
0 |
2128 |
if( sqlite3VdbeMemGrow(pDest, len+2, 0) ) goto no_mem; |
84600
|
0 |
6 |
if( ((pOp->p5 & (OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG))!=0 |
84601
|
0 |
0 |
&& ((t>=12 && (t&1)==0) || (pOp->p5 & OPFLAG_TYPEOFARG)!=0)) |
|
0 |
0 |
&& ((t>=12 && (t&1)==0) || (pOp->p5 & OPFLAG_TYPEOFARG)!=0)) |
|
0 |
0 |
&& ((t>=12 && (t&1)==0) || (pOp->p5 & OPFLAG_TYPEOFARG)!=0)) |
84602
|
0 |
6 |
|| (len = sqlite3VdbeSerialTypeLen(t))==0 |
84619
|
0 |
6 |
if( rc!=SQLITE_OK ) goto abort_due_to_error; |
84631
|
0 |
0 |
if( aOp[0].p3>0 ){ |
84662
|
126 |
299 |
}while( zAffinity[0] ); |
84734
|
860 |
7450 |
if( zAffinity ){ |
84739
|
1628 |
860 |
}while( zAffinity[0] ); |
84763
|
1 |
12297 |
if( pRec->flags & MEM_Zero ){ |
84764
|
0 |
1 |
if( serial_type==0 ){ |
84773
|
0 |
1 |
}else if( nData ){ |
84774
|
0 |
0 |
if( sqlite3VdbeMemExpandBlob(pRec) ) goto no_mem; |
84783
|
208 |
12090 |
nHdr += serial_type<=127 ? 1 : sqlite3VarintLen(serial_type); |
84785
|
8310 |
3988 |
if( pRec==pData0 ) break; |
84795
|
8310 |
0 |
if( nHdr<=126 ){ |
84802
|
0 |
0 |
if( nVarint
|
84805
|
0 |
8310 |
if( nByte+nZero>db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
84814
|
0 |
8310 |
if( sqlite3VdbeMemClearAndResize(pOut, (int)nByte) ){ |
84820
|
8310 |
0 |
i = putVarint32(zNewRecord, nHdr); |
84828
|
12090 |
208 |
i += putVarint32(&zNewRecord[i], serial_type); /* serial type */ |
84832
|
3988 |
8310 |
}while( (++pRec)<=pLast ); |
84839
|
1 |
8309 |
if( nZero ){ |
84864
|
0 |
10 |
if( rc ) goto abort_due_to_error; |
84899
|
24 |
10 |
if( p1==SAVEPOINT_BEGIN ){ |
84900
|
0 |
24 |
if( db->nVdbeWrite>0 ){ |
84917
|
0 |
24 |
if( rc!=SQLITE_OK ) goto abort_due_to_error; |
84922
|
24 |
0 |
if( pNew ){ |
84928
|
13 |
11 |
if( db->autoCommit ){ |
84947
|
12 |
0 |
for( |
84949
|
2 |
10 |
pSavepoint && sqlite3StrICmp(pSavepoint->zName, zName); |
84954
|
0 |
10 |
if( !pSavepoint ){ |
84957
|
0 |
10 |
}else if( db->nVdbeWrite>0 && p1==SAVEPOINT_RELEASE ){ |
|
0 |
0 |
}else if( db->nVdbeWrite>0 && p1==SAVEPOINT_RELEASE ){ |
84970
|
8 |
2 |
int isTransaction = pSavepoint->pNext==0 && db->isTransactionSavepoint; |
|
7 |
1 |
int isTransaction = pSavepoint->pNext==0 && db->isTransactionSavepoint; |
84971
|
7 |
3 |
if( isTransaction && p1==SAVEPOINT_RELEASE ){ |
|
7 |
0 |
if( isTransaction && p1==SAVEPOINT_RELEASE ){ |
84972
|
0 |
7 |
if( (rc = sqlite3VdbeCheckFk(p, 1))!=SQLITE_OK ){ |
84976
|
0 |
7 |
if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){ |
84987
|
1 |
2 |
if( p1==SAVEPOINT_ROLLBACK ){ |
84989
|
2 |
1 |
for(ii=0; iinDb; ii++){ |
84993
|
0 |
2 |
if( rc!=SQLITE_OK ) goto abort_due_to_error; |
84998
|
6 |
3 |
for(ii=0; iinDb; ii++){ |
85000
|
0 |
6 |
if( rc!=SQLITE_OK ){ |
85004
|
1 |
2 |
if( isSchemaChange ){ |
85013
|
2 |
10 |
while( db->pSavepoint!=pSavepoint ){ |
85024
|
9 |
1 |
if( p1==SAVEPOINT_RELEASE ){ |
85028
|
2 |
7 |
if( !isTransaction ){ |
85036
|
7 |
3 |
if( !isTransaction || p1==SAVEPOINT_ROLLBACK ){ |
|
0 |
7 |
if( !isTransaction || p1==SAVEPOINT_ROLLBACK ){ |
85038
|
0 |
3 |
if( rc!=SQLITE_OK ) goto abort_due_to_error; |
85042
|
0 |
34 |
if( rc ) goto abort_due_to_error; |
85067
|
218 |
20 |
if( desiredAutoCommit!=db->autoCommit ){ |
85068
|
28 |
190 |
if( iRollback ){ |
85072
|
84 |
106 |
}else if( desiredAutoCommit && db->nVdbeWrite>0 ){ |
|
0 |
84 |
}else if( desiredAutoCommit && db->nVdbeWrite>0 ){ |
85080
|
0 |
190 |
}else if( (rc = sqlite3VdbeCheckFk(p, 1))!=SQLITE_OK ){ |
85085
|
0 |
218 |
if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){ |
85093
|
214 |
4 |
if( p->rc==SQLITE_OK ){ |
85100
|
0 |
20 |
sqlite3VdbeError(p, |
85101
|
0 |
0 |
(!desiredAutoCommit)?"cannot start a transaction within a transaction":( |
85154
|
3569 |
1624 |
if( pOp->p2 && (db->flags & SQLITE_QueryOnly)!=0 ){ |
|
0 |
3569 |
if( pOp->p2 && (db->flags & SQLITE_QueryOnly)!=0 ){ |
85160
|
5122 |
71 |
if( pBt ){ |
85164
|
9 |
5113 |
if( rc!=SQLITE_OK ){ |
85165
|
7 |
2 |
if( (rc&0xff)==SQLITE_BUSY ){ |
85173
|
3489 |
1624 |
if( pOp->p2 && p->usesStmtJournal |
|
14 |
3475 |
if( pOp->p2 && p->usesStmtJournal |
85174
|
14 |
0 |
&& (db->autoCommit==0 || db->nVdbeRead>1) |
|
0 |
14 |
&& (db->autoCommit==0 || db->nVdbeRead>1) |
85177
|
0 |
0 |
if( p->iStatement==0 ){ |
85184
|
0 |
0 |
if( rc==SQLITE_OK ){ |
85206
|
4570 |
614 |
if( pOp->p5 && (iMeta!=pOp->p3 || iGen!=pOp->p4.i) ){ |
|
4570 |
0 |
if( pOp->p5 && (iMeta!=pOp->p3 || iGen!=pOp->p4.i) ){ |
|
0 |
4570 |
if( pOp->p5 && (iMeta!=pOp->p3 || iGen!=pOp->p4.i) ){ |
85222
|
0 |
0 |
if( db->aDb[pOp->p1].pSchema->schema_cookie!=iMeta ){ |
85228
|
0 |
5184 |
if( rc ) goto abort_due_to_error; |
85286
|
246 |
307 |
if( pOp->p2==BTREE_SCHEMA_VERSION ){ |
85290
|
153 |
154 |
}else if( pOp->p2==BTREE_FILE_FORMAT ){ |
85294
|
78 |
475 |
if( pOp->p1==1 ){ |
85300
|
0 |
553 |
if( rc ) goto abort_due_to_error; |
85382
|
9 |
2 |
if( pCur && pCur->pgnoRoot==(u32)pOp->p2 ){ |
|
9 |
0 |
if( pCur && pCur->pgnoRoot==(u32)pOp->p2 ){ |
85396
|
0 |
5563 |
if( p->expired ){ |
85410
|
3861 |
1702 |
if( pOp->opcode==OP_OpenWrite ){ |
85414
|
3309 |
552 |
if( pDb->pSchema->file_format < p->minWriteFileFormat ){ |
85420
|
6 |
5557 |
if( pOp->p5 & OPFLAG_P2ISREG ){ |
85434
|
227 |
5336 |
if( pOp->p4type==P4_KEYINFO ){ |
85439
|
5336 |
0 |
}else if( pOp->p4type==P4_INT32 ){ |
85446
|
0 |
5563 |
if( pCur==0 ) goto no_mem; |
85470
|
0 |
5572 |
if( rc ) goto abort_due_to_error; |
85490
|
0 |
0 |
if( pCx==0 ) goto no_mem; |
85545
|
0 |
8 |
if( pCx==0 ) goto no_mem; |
85550
|
8 |
0 |
if( rc==SQLITE_OK ){ |
85553
|
8 |
0 |
if( rc==SQLITE_OK ){ |
85559
|
8 |
0 |
if( (pCx->pKeyInfo = pKeyInfo = pOp->p4.pKeyInfo)!=0 ){ |
85563
|
8 |
0 |
if( rc==SQLITE_OK ){ |
85577
|
0 |
8 |
if( rc ) goto abort_due_to_error; |
85598
|
0 |
216 |
if( pCx==0 ) goto no_mem; |
85603
|
0 |
216 |
if( rc ) goto abort_due_to_error; |
85619
|
86 |
192 |
if( (pC->seqCount++)==0 ){ |
85647
|
0 |
211 |
if( pCx==0 ) goto no_mem; |
85807
|
0 |
151 |
if( pC->isTable ){ |
85816
|
0 |
0 |
if( (pIn3->flags & (MEM_Int|MEM_Real|MEM_Str))==MEM_Str ){ |
85823
|
0 |
0 |
if( (pIn3->flags & MEM_Int)==0 ){ |
85824
|
0 |
0 |
if( (pIn3->flags & MEM_Real)==0 ){ |
85838
|
0 |
0 |
if( pIn3->u.r<(double)iKey ){ |
85842
|
0 |
0 |
if( (oc & 0x0001)==(OP_SeekGT & 0x0001) ) oc--; |
85847
|
0 |
0 |
else if( pIn3->u.r>(double)iKey ){ |
85851
|
0 |
0 |
if( (oc & 0x0001)==(OP_SeekLT & 0x0001) ) oc++; |
85856
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
85864
|
33 |
118 |
if( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ) ){ |
85887
|
144 |
7 |
r.default_rc = ((1 & (oc - OP_SeekLT)) ? -1 : +1); |
85899
|
0 |
151 |
if( rc!=SQLITE_OK ){ |
85902
|
33 |
118 |
if( eqOnly && r.eqSeen==0 ){ |
|
8 |
25 |
if( eqOnly && r.eqSeen==0 ){ |
85912
|
13 |
130 |
if( oc>=OP_SeekGE ){ assert( oc==OP_SeekGE || oc==OP_SeekGT ); |
85913
|
9 |
4 |
if( res<0 || (res==0 && oc==OP_SeekGT) ){ |
|
0 |
9 |
if( res<0 || (res==0 && oc==OP_SeekGT) ){ |
|
0 |
0 |
if( res<0 || (res==0 && oc==OP_SeekGT) ){ |
85916
|
1 |
3 |
if( rc!=SQLITE_OK ){ |
85917
|
1 |
0 |
if( rc==SQLITE_DONE ){ |
85929
|
130 |
0 |
if( res>0 || (res==0 && oc==OP_SeekLT) ){ |
|
0 |
130 |
if( res>0 || (res==0 && oc==OP_SeekLT) ){ |
|
0 |
0 |
if( res>0 || (res==0 && oc==OP_SeekLT) ){ |
85932
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
85933
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
85950
|
10 |
141 |
if( res ){ |
85952
|
25 |
116 |
}else if( eqOnly ){ |
86045
|
52 |
0 |
if( pOp->p4.i>0 ){ |
86060
|
0 |
0 |
rc = ExpandBlob(pIn3); |
86062
|
0 |
0 |
if( rc ) goto no_mem; |
86064
|
0 |
0 |
if( pIdxKey==0 ) goto no_mem; |
86069
|
50 |
2 |
if( pOp->opcode==OP_NoConflict ){ |
86073
|
86 |
46 |
for(ii=0; iinField; ii++){ |
86074
|
4 |
82 |
if( pIdxKey->aMem[ii].flags & MEM_Null ){ |
86081
|
0 |
52 |
if( pFree ) sqlite3DbFreeNN(db, pFree); |
86082
|
0 |
52 |
if( rc!=SQLITE_OK ){ |
86090
|
2 |
50 |
if( pOp->opcode==OP_Found ){ |
86092
|
0 |
2 |
if( alreadyExists ) goto jump_to_p2; |
86095
|
46 |
4 |
if( takeJump || !alreadyExists ) goto jump_to_p2; |
|
3 |
43 |
if( takeJump || !alreadyExists ) goto jump_to_p2; |
86154
|
49 |
468 |
if( (pIn3->flags & MEM_Int)==0 ){ |
86156
|
0 |
49 |
if( (pIn3->flags & MEM_Int)==0 ) goto jump_to_p2; |
86182
|
229 |
628 |
if( res!=0 ){ |
86184
|
0 |
229 |
if( pOp->p2==0 ){ |
86190
|
0 |
628 |
if( rc ) goto abort_due_to_error; |
86270
|
3097 |
0 |
if( !pC->useRandomRowid ){ |
86272
|
0 |
3097 |
if( rc!=SQLITE_OK ){ |
86275
|
297 |
2800 |
if( res ){ |
86280
|
0 |
2800 |
if( v>=MAX_ROWID ){ |
86289
|
192 |
2905 |
if( pOp->p3 ){ |
86292
|
0 |
192 |
if( p->pFrame ){ |
86293
|
0 |
0 |
for(pFrame=p->pFrame; pFrame->pParent; pFrame=pFrame->pParent); |
86308
|
192 |
0 |
if( pMem->u.i==MAX_ROWID || pC->useRandomRowid ){ |
|
0 |
192 |
if( pMem->u.i==MAX_ROWID || pC->useRandomRowid ){ |
86312
|
0 |
192 |
if( vu.i+1 ){ |
86318
|
0 |
3097 |
if( pC->useRandomRowid ){ |
86331
|
0 |
0 |
&& (res==0) |
86332
|
0 |
0 |
&& (++cnt<100)); |
|
0 |
0 |
&& (++cnt<100)); |
86333
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
86334
|
0 |
0 |
if( res==0 ){ |
86412
|
3727 |
0 |
if( pOp->opcode==OP_Insert ){ |
86423
|
3028 |
699 |
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){ |
|
60 |
2968 |
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){ |
86447
|
3028 |
699 |
if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++; |
86448
|
3024 |
703 |
if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = x.nKey; |
86452
|
3063 |
664 |
seekResult = ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0); |
86453
|
1 |
3726 |
if( pData->flags & MEM_Zero ){ |
86466
|
0 |
3727 |
if( rc ) goto abort_due_to_error; |
86467
|
60 |
3667 |
if( pTab ){ |
86470
|
0 |
60 |
db->xUpdateCallback(db->pUpdateArg, |
86542
|
13 |
8 |
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){ |
|
0 |
13 |
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){ |
86547
|
0 |
0 |
if( (pOp->p5 & OPFLAG_SAVEPOSITION)!=0 && pC->isTable ){ |
|
0 |
0 |
if( (pOp->p5 & OPFLAG_SAVEPOSITION)!=0 && pC->isTable ){ |
86593
|
0 |
21 |
if( rc ) goto abort_due_to_error; |
86596
|
13 |
8 |
if( opflags & OPFLAG_NCHANGE ){ |
86598
|
0 |
13 |
if( db->xUpdateCallback && HasRowid(pTab) ){ |
|
0 |
0 |
if( db->xUpdateCallback && HasRowid(pTab) ){ |
86648
|
0 |
1 |
if( rc ) goto abort_due_to_error; |
86649
|
1 |
0 |
if( res ) goto jump_to_p2; |
86674
|
0 |
4735 |
if( rc ) goto abort_due_to_error; |
86739
|
0 |
0 |
if( n>(u32)db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
86744
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
86745
|
0 |
0 |
if( !pOp->p3 ) Deephemeralize(pOut); |
|
0 |
0 |
if( !pOp->p3 ) Deephemeralize(pOut); |
|
0 |
0 |
if( !pOp->p3 ) Deephemeralize(pOut); |
86772
|
0 |
646 |
if( pC->nullRow ){ |
86775
|
6 |
640 |
}else if( pC->deferredMoveto ){ |
86778
|
84 |
556 |
}else if( pC->eCurType==CURTYPE_VTAB ){ |
86785
|
0 |
84 |
if( rc ) goto abort_due_to_error; |
86791
|
0 |
556 |
if( rc ) goto abort_due_to_error; |
86792
|
0 |
556 |
if( pC->nullRow ){ |
86816
|
0 |
0 |
if( pC->eCurType==CURTYPE_BTREE ){ |
86861
|
2 |
28 |
if( pOp->opcode==OP_SeekEnd ){ |
86864
|
0 |
2 |
if( sqlite3BtreeCursorIsValidNN(pCrsr) ){ |
86872
|
0 |
30 |
if( rc ) goto abort_due_to_error; |
86873
|
26 |
4 |
if( pOp->p2>0 ){ |
86875
|
25 |
1 |
if( res ) goto jump_to_p2; |
86897
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
86898
|
0 |
0 |
if( res==0 ){ |
86900
|
0 |
0 |
if( ALWAYS(sz>=0) && sqlite3LogEst((u64)sz)p3 ) res = 1; |
|
0 |
0 |
if( ALWAYS(sz>=0) && sqlite3LogEst((u64)sz)p3 ) res = 1; |
86903
|
0 |
0 |
if( res ) goto jump_to_p2; |
86963
|
216 |
1109 |
if( isSorter(pC) ){ |
86973
|
0 |
1325 |
if( rc ) goto abort_due_to_error; |
86977
|
294 |
1031 |
if( res ) goto jump_to_p2; |
87060
|
0 |
12 |
if( p->apCsr[pOp->p1]==0 ) break; |
87088
|
10560 |
907 |
if( rc==SQLITE_OK ){ |
87096
|
0 |
907 |
if( rc!=SQLITE_DONE ) goto abort_due_to_error; |
87149
|
0 |
4816 |
if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++; |
87152
|
0 |
4816 |
rc = ExpandBlob(pIn2); |
87153
|
0 |
4816 |
if( rc ) goto abort_due_to_error; |
87154
|
4739 |
77 |
if( pOp->opcode==OP_SorterInsert ){ |
87161
|
56 |
21 |
rc = sqlite3BtreeInsert(pC->uc.pCursor, &x, |
87168
|
0 |
4816 |
if( rc) goto abort_due_to_error; |
87200
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
87201
|
0 |
0 |
if( res==0 ){ |
87203
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
87261
|
0 |
302 |
if( NEVER(rc!=SQLITE_OK) ) goto abort_due_to_error; |
87263
|
302 |
0 |
if( !pC->nullRow ){ |
87266
|
0 |
302 |
if( rc!=SQLITE_OK ){ |
87269
|
291 |
11 |
if( pOp->opcode==OP_DeferredSeek ){ |
87356
|
16 |
303 |
if( pOp->opcode
|
87370
|
304 |
15 |
if( (pOp->opcode&1)==(OP_IdxLT&1) ){ |
87378
|
0 |
319 |
if( rc ) goto abort_due_to_error; |
87379
|
34 |
285 |
if( res>0 ) goto jump_to_p2; |
87419
|
0 |
5 |
if( db->nVdbeRead > db->nVDestroy+1 ){ |
87430
|
0 |
5 |
if( rc ) goto abort_due_to_error; |
87432
|
0 |
5 |
if( iMoved!=0 ){ |
87468
|
32 |
1 |
rc = sqlite3BtreeClearTable( |
87471
|
32 |
1 |
if( pOp->p3 ){ |
87473
|
0 |
32 |
if( pOp->p3>0 ){ |
87479
|
0 |
33 |
if( rc ) goto abort_due_to_error; |
87497
|
0 |
0 |
if( isSorter(pC) ){ |
87503
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
87531
|
0 |
249 |
if( rc ) goto abort_due_to_error; |
87545
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
87584
|
0 |
239 |
if( zSql==0 ){ |
87592
|
239 |
0 |
if( rc==SQLITE_OK ) rc = initData.rc; |
87597
|
0 |
239 |
if( rc ){ |
87599
|
0 |
0 |
if( rc==SQLITE_NOMEM ){ |
87617
|
0 |
1 |
if( rc ) goto abort_due_to_error; |
87707
|
0 |
0 |
if( nErr==0 ){ |
87709
|
0 |
0 |
}else if( z==0 ){ |
87733
|
3 |
0 |
if( (pIn1->flags & MEM_RowSet)==0 ){ |
87735
|
0 |
3 |
if( (pIn1->flags & MEM_RowSet)==0 ) goto no_mem; |
87753
|
6 |
5 |
if( (pIn1->flags & MEM_RowSet)==0 |
87754
|
3 |
3 |
|| sqlite3RowSetNext(pIn1->u.pRowSet, &val)==0 |
87803
|
7 |
9 |
if( (pIn1->flags & MEM_RowSet)==0 ){ |
87805
|
0 |
7 |
if( (pIn1->flags & MEM_RowSet)==0 ) goto no_mem; |
87810
|
12 |
4 |
if( iSet ){ |
87813
|
0 |
12 |
if( exists ) goto jump_to_p2; |
87815
|
10 |
6 |
if( iSet>=0 ){ |
87864
|
0 |
0 |
if( pOp->p5 ){ |
87866
|
0 |
0 |
for(pFrame=p->pFrame; pFrame && pFrame->token!=t; pFrame=pFrame->pParent); |
|
0 |
0 |
for(pFrame=p->pFrame; pFrame && pFrame->token!=t; pFrame=pFrame->pParent); |
87867
|
0 |
0 |
if( pFrame ) break; |
87870
|
0 |
0 |
if( p->nFrame>=db->aLimit[SQLITE_LIMIT_TRIGGER_DEPTH] ){ |
87880
|
0 |
0 |
if( (pRt->flags&MEM_Frame)==0 ){ |
87888
|
0 |
0 |
if( pProgram->nCsr==0 ) nMem++; |
87894
|
0 |
0 |
if( !pFrame ){ |
87917
|
0 |
0 |
for(pMem=VdbeFrameMem(pFrame); pMem!=pEnd; pMem++){ |
87989
|
0 |
1 |
if( db->flags & SQLITE_DeferFKs ){ |
87991
|
0 |
1 |
}else if( pOp->p1 ){ |
88012
|
0 |
2 |
if( pOp->p1 ){ |
88014
|
0 |
0 |
if( db->nDeferredCons==0 && db->nDeferredImmCons==0 ) goto jump_to_p2; |
|
0 |
0 |
if( db->nDeferredCons==0 && db->nDeferredImmCons==0 ) goto jump_to_p2; |
88017
|
2 |
0 |
if( p->nFkConstraint==0 && db->nDeferredImmCons==0 ) goto jump_to_p2; |
|
2 |
0 |
if( p->nFkConstraint==0 && db->nDeferredImmCons==0 ) goto jump_to_p2; |
88037
|
0 |
192 |
if( p->pFrame ){ |
88038
|
0 |
0 |
for(pFrame=p->pFrame; pFrame->pParent; pFrame=pFrame->pParent); |
88047
|
0 |
192 |
if( pIn1->u.iu.i){ |
88068
|
33 |
33 |
if( pIn1->u.i>0 ){ |
88101
|
0 |
0 |
if( x<=0 || sqlite3AddInt64(&x, pIn3->u.i>0?pIn3->u.i:0) ){ |
|
0 |
0 |
if( x<=0 || sqlite3AddInt64(&x, pIn3->u.i>0?pIn3->u.i:0) ){ |
88128
|
3 |
2 |
if( pIn1->u.i ){ |
88129
|
3 |
0 |
if( pIn1->u.i>0 ) pIn1->u.i--; |
88144
|
62 |
0 |
if( pIn1->u.i>SMALLEST_INT64 ) pIn1->u.i--; |
88146
|
62 |
0 |
if( pIn1->u.i==0 ) goto jump_to_p2; |
88190
|
0 |
79 |
if( pCtx==0 ) goto no_mem; |
88218
|
79 |
391 |
if( pCtx->pMem != pMem ){ |
88220
|
31 |
79 |
for(i=pCtx->argc-1; i>=0; i--) pCtx->argv[i] = &aMem[pOp->p2+i]; |
88235
|
0 |
470 |
if( pCtx->isError ){ |
88236
|
0 |
0 |
if( pCtx->isError>0 ){ |
88240
|
0 |
0 |
if( pCtx->skipFlag ){ |
88243
|
0 |
0 |
if( i ) sqlite3VdbeMemSetInt64(&aMem[i], 1); |
88249
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
88275
|
0 |
190 |
if( rc ){ |
88281
|
0 |
190 |
if( sqlite3VdbeMemTooBig(pMem) ){ |
88313
|
0 |
0 |
if( rc ){ |
88314
|
0 |
0 |
if( rc!=SQLITE_BUSY ) goto abort_due_to_error; |
88318
|
0 |
0 |
for(i=0, pMem = &aMem[pOp->p3]; i<3; i++, pMem++){ |
88362
|
0 |
0 |
if( eNew==PAGER_JOURNALMODE_QUERY ) eNew = eOld; |
88363
|
0 |
0 |
if( !sqlite3PagerOkToChangeJournalMode(pPager) ) eNew = eOld; |
88371
|
0 |
0 |
if( eNew==PAGER_JOURNALMODE_WAL |
88372
|
0 |
0 |
&& (sqlite3Strlen30(zFilename)==0 /* Temp file */ |
88373
|
0 |
0 |
|| !sqlite3PagerWalSupported(pPager)) /* No shared-memory support */ |
88378
|
0 |
0 |
if( (eNew!=eOld) |
88379
|
0 |
0 |
&& (eOld==PAGER_JOURNALMODE_WAL || eNew==PAGER_JOURNALMODE_WAL) |
|
0 |
0 |
&& (eOld==PAGER_JOURNALMODE_WAL || eNew==PAGER_JOURNALMODE_WAL) |
88381
|
0 |
0 |
if( !db->autoCommit || db->nVdbeRead>1 ){ |
|
0 |
0 |
if( !db->autoCommit || db->nVdbeRead>1 ){ |
88383
|
0 |
0 |
sqlite3VdbeError(p, |
88390
|
0 |
0 |
if( eOld==PAGER_JOURNALMODE_WAL ){ |
88397
|
0 |
0 |
if( rc==SQLITE_OK ){ |
88400
|
0 |
0 |
}else if( eOld==PAGER_JOURNALMODE_MEMORY ){ |
88410
|
0 |
0 |
if( rc==SQLITE_OK ){ |
88411
|
0 |
0 |
rc = sqlite3BtreeSetVersion(pBt, (eNew==PAGER_JOURNALMODE_WAL ? 2 : 1)); |
88417
|
0 |
0 |
if( rc ) eNew = eOld; |
88425
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
88439
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
88460
|
0 |
0 |
if( rc ){ |
88461
|
0 |
0 |
if( rc!=SQLITE_DONE ) goto abort_due_to_error; |
88480
|
38 |
5 |
if( !pOp->p1 ){ |
88506
|
27 |
0 |
if( isWriteLock || 0==(db->flags&SQLITE_ReadUncommit) ){ |
|
27 |
0 |
if( isWriteLock || 0==(db->flags&SQLITE_ReadUncommit) ){ |
88512
|
0 |
27 |
if( rc ){ |
88513
|
0 |
0 |
if( (rc&0xFF)==SQLITE_LOCKED ){ |
88538
|
40 |
26 |
if( pVTab ) sqlite3VtabImportErrmsg(p, pVTab->pVtab); |
88539
|
0 |
66 |
if( rc ) goto abort_due_to_error; |
88564
|
24 |
0 |
if( zTab ){ |
88568
|
1 |
23 |
if( rc ) goto abort_due_to_error; |
88583
|
0 |
2 |
if( rc ) goto abort_due_to_error; |
88605
|
163 |
0 |
if( pVtab==0 || NEVER(pVtab->pModule==0) ){ |
|
0 |
163 |
if( pVtab==0 || NEVER(pVtab->pModule==0) ){ |
88612
|
0 |
163 |
if( rc ) goto abort_due_to_error; |
88619
|
163 |
0 |
if( pCur ){ |
88682
|
180 |
172 |
for(i = 0; i
|
88687
|
0 |
172 |
if( rc ) goto abort_due_to_error; |
88691
|
27 |
145 |
if( res ) goto jump_to_p2; |
88721
|
0 |
614 |
if( pCur->nullRow ){ |
88730
|
0 |
614 |
if( pOp->p5 ){ |
88739
|
0 |
614 |
if( sContext.isError>0 ){ |
88747
|
0 |
614 |
if( sqlite3VdbeMemTooBig(pDest) ){ |
88750
|
0 |
614 |
if( rc ) goto abort_due_to_error; |
88771
|
0 |
274 |
if( pCur->nullRow ){ |
88786
|
0 |
274 |
if( rc ) goto abort_due_to_error; |
88789
|
181 |
93 |
if( !res ){ |
88819
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
88823
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
88871
|
42 |
0 |
if( pVtab==0 || NEVER(pVtab->pModule==0) ){ |
|
0 |
42 |
if( pVtab==0 || NEVER(pVtab->pModule==0) ){ |
88878
|
42 |
0 |
if( ALWAYS(pModule->xUpdate) ){ |
88882
|
254 |
42 |
for(i=0; i
|
88892
|
42 |
0 |
if( rc==SQLITE_OK && pOp->p1 ){ |
|
41 |
1 |
if( rc==SQLITE_OK && pOp->p1 ){ |
88896
|
0 |
42 |
if( (rc&0xff)==SQLITE_CONSTRAINT && pOp->p4.pVtab->bConstraint ){ |
|
0 |
0 |
if( (rc&0xff)==SQLITE_CONSTRAINT && pOp->p4.pVtab->bConstraint ){ |
88897
|
0 |
0 |
if( pOp->p5==OE_Ignore ){ |
88900
|
0 |
0 |
p->errorAction = ((pOp->p5==OE_Replace) ? OE_Abort : pOp->p5); |
88905
|
0 |
42 |
if( rc ) goto abort_due_to_error; |
88940
|
0 |
0 |
if( pOp->p3 ){ |
88942
|
0 |
0 |
if( newMax < (unsigned)pOp->p3 ) newMax = (unsigned)pOp->p3; |
89001
|
0 |
567 |
if( pCtx==0 ) goto no_mem; |
89028
|
567 |
411 |
if( pCtx->pOut != pOut ){ |
89030
|
992 |
567 |
for(i=pCtx->argc-1; i>=0; i--) pCtx->argv[i] = &aMem[pOp->p2+i]; |
89045
|
6 |
972 |
if( pCtx->isError ){ |
89046
|
6 |
0 |
if( pCtx->isError>0 ){ |
89052
|
6 |
0 |
if( rc ) goto abort_due_to_error; |
89056
|
327 |
645 |
if( pOut->flags & (MEM_Str|MEM_Blob) ){ |
89058
|
0 |
327 |
if( sqlite3VdbeMemTooBig(pOut) ) goto too_big; |
89113
|
20 |
5725 |
if( (db->mTrace & (SQLITE_TRACE_STMT|SQLITE_TRACE_LEGACY))!=0 |
89114
|
20 |
0 |
&& !p->doingRerun |
89115
|
0 |
20 |
&& (zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0 |
|
14 |
6 |
&& (zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0 |
89118
|
14 |
0 |
if( db->mTrace & SQLITE_TRACE_LEGACY ){ |
89125
|
0 |
0 |
if( db->nVdbeExec>1 ){ |
89152
|
0 |
5745 |
if( pOp->p1>=sqlite3GlobalConfig.iOnceResetThreshold ){ |
89153
|
0 |
0 |
if( pOp->opcode==OP_Trace ) break; |
89154
|
0 |
0 |
for(i=1; inOp; i++){ |
89155
|
0 |
0 |
if( p->aOp[i].opcode==OP_Once ) p->aOp[i].p1 = 0; |
89263
|
0 |
33 |
if( db->mallocFailed ) rc = SQLITE_NOMEM_BKPT; |
89265
|
6 |
27 |
if( p->zErrMsg==0 && rc!=SQLITE_IOERR_NOMEM ){ |
|
6 |
0 |
if( p->zErrMsg==0 && rc!=SQLITE_IOERR_NOMEM ){ |
89274
|
0 |
33 |
if( rc==SQLITE_IOERR_NOMEM ) sqlite3OomFault(db); |
89276
|
0 |
33 |
if( resetSchemaOnFault>0 ){ |
89313
|
0 |
0 |
rc = db->mallocFailed ? SQLITE_NOMEM_BKPT : SQLITE_INTERRUPT; |
89390
|
73 |
27 |
if( v->pc>4 ){ |
89397
|
100 |
0 |
if( rc==SQLITE_ROW ){ |
89399
|
100 |
0 |
u32 type = pC->nHdrParsed>p->iCol ? pC->aType[p->iCol] : 0; |
89402
|
0 |
100 |
if( type<12 ){ |
89403
|
0 |
0 |
zErr = sqlite3MPrintf(p->db, "cannot open value of type %s", |
89404
|
0 |
0 |
type==0?"null": type==7?"real": "integer" |
89417
|
100 |
0 |
if( rc==SQLITE_ROW ){ |
89419
|
0 |
0 |
}else if( p->pStmt ){ |
89422
|
0 |
0 |
if( rc==SQLITE_OK ){ |
89475
|
0 |
27 |
if( !pBlob ) goto blob_open_out; |
89482
|
27 |
0 |
if( pTab && IsVirtual(pTab) ){ |
|
0 |
27 |
if( pTab && IsVirtual(pTab) ){ |
89486
|
27 |
0 |
if( pTab && !HasRowid(pTab) ){ |
|
0 |
27 |
if( pTab && !HasRowid(pTab) ){ |
89491
|
27 |
0 |
if( pTab && pTab->pSelect ){ |
|
0 |
27 |
if( pTab && pTab->pSelect ){ |
89496
|
0 |
27 |
if( !pTab ){ |
89497
|
0 |
0 |
if( sParse.zErrMsg ){ |
89510
|
54 |
0 |
for(iCol=0; iColnCol; iCol++) { |
89511
|
27 |
27 |
if( sqlite3StrICmp(pTab->aCol[iCol].zName, zColumn)==0 ){ |
89515
|
0 |
27 |
if( iCol==pTab->nCol ){ |
89526
|
0 |
27 |
if( wrFlag ){ |
89530
|
0 |
0 |
if( db->flags&SQLITE_ForeignKeys ){ |
89536
|
0 |
0 |
for(pFKey=pTab->pFKey; pFKey; pFKey=pFKey->pNextFrom){ |
89538
|
0 |
0 |
for(j=0; jnCol; j++){ |
89539
|
0 |
0 |
if( pFKey->aCol[j].iFrom==iCol ){ |
89546
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
89548
|
0 |
0 |
for(j=0; jnKeyCol; j++){ |
89550
|
0 |
0 |
if( pIdx->aiColumn[j]==iCol || pIdx->aiColumn[j]==XN_EXPR ){ |
|
0 |
0 |
if( pIdx->aiColumn[j]==iCol || pIdx->aiColumn[j]==XN_EXPR ){ |
89555
|
0 |
0 |
if( zFault ){ |
89566
|
27 |
0 |
if( pBlob->pStmt ){ |
89607
|
27 |
0 |
if( db->mallocFailed==0 ){ |
89618
|
27 |
0 |
if( db->mallocFailed==0 ){ |
89623
|
0 |
27 |
if( wrFlag ) aOp[1].opcode = OP_OpenWrite; |
89648
|
0 |
27 |
if( db->mallocFailed ){ |
89652
|
27 |
0 |
} while( (++nAttempt)
|
|
0 |
27 |
} while( (++nAttempt)
|
89655
|
27 |
0 |
if( rc==SQLITE_OK && db->mallocFailed==0 ){ |
|
27 |
0 |
if( rc==SQLITE_OK && db->mallocFailed==0 ){ |
89658
|
0 |
0 |
if( pBlob && pBlob->pStmt ) sqlite3VdbeFinalize((Vdbe *)pBlob->pStmt); |
|
0 |
0 |
if( pBlob && pBlob->pStmt ) sqlite3VdbeFinalize((Vdbe *)pBlob->pStmt); |
89661
|
0 |
27 |
sqlite3ErrorWithMsg(db, rc, (zErr ? "%s" : 0), zErr); |
89678
|
27 |
448 |
if( p ){ |
89705
|
0 |
60 |
if( p==0 ) return SQLITE_MISUSE_BKPT; |
89710
|
60 |
0 |
if( n<0 || iOffset<0 || ((sqlite3_int64)iOffset+n)>p->nByte ){ |
|
60 |
0 |
if( n<0 || iOffset<0 || ((sqlite3_int64)iOffset+n)>p->nByte ){ |
|
0 |
60 |
if( n<0 || iOffset<0 || ((sqlite3_int64)iOffset+n)>p->nByte ){ |
89713
|
0 |
60 |
}else if( v==0 ){ |
89750
|
0 |
60 |
if( rc==SQLITE_ABORT ){ |
89785
|
100 |
0 |
return (p && p->pStmt) ? p->nByte : 0; |
|
100 |
0 |
return (p && p->pStmt) ? p->nByte : 0; |
89803
|
0 |
73 |
if( p==0 ) return SQLITE_MISUSE_BKPT; |
89807
|
0 |
73 |
if( p->pStmt==0 ){ |
89815
|
0 |
73 |
if( rc!=SQLITE_OK ){ |
89816
|
0 |
0 |
sqlite3ErrorWithMsg(db, rc, (zErr ? "%s" : 0), zErr); |
90303
|
0 |
0 |
if( pReadr->aMap ) sqlite3OsUnfetch(pReadr->pFd, 0, pReadr->aMap); |
90325
|
0 |
0 |
if( p->aMap ){ |
90337
|
0 |
0 |
if( iBuf==0 ){ |
90342
|
0 |
0 |
if( (p->iEof - p->iReadOff) > (i64)p->nBuffer ){ |
90352
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
90356
|
0 |
0 |
if( nByte<=nAvail ){ |
90369
|
0 |
0 |
if( p->nAlloc
|
90372
|
0 |
0 |
while( nByte>nNew ) nNew = nNew*2; |
90374
|
0 |
0 |
if( !aNew ) return SQLITE_NOMEM_BKPT; |
90387
|
0 |
0 |
while( nRem>0 ){ |
90393
|
0 |
0 |
if( nRem>p->nBuffer ) nCopy = p->nBuffer; |
90395
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
90414
|
0 |
0 |
if( p->aMap ){ |
90418
|
0 |
0 |
if( iBuf && (p->nBuffer-iBuf)>=9 ){ |
|
0 |
0 |
if( iBuf && (p->nBuffer-iBuf)>=9 ){ |
90425
|
0 |
0 |
if( rc ) return rc; |
90427
|
0 |
0 |
}while( (a[0]&0x80)!=0 ); |
90446
|
0 |
0 |
if( pFile->iEof<=(i64)(pTask->pSorter->db->nMaxSorterMmap) ){ |
90448
|
0 |
0 |
if( pFd->pMethods->iVersion>=3 ){ |
90471
|
0 |
0 |
if( sqlite3FaultSim(201) ) return SQLITE_IOERR_READ; |
90472
|
0 |
0 |
if( pReadr->aMap ){ |
90481
|
0 |
0 |
if( rc==SQLITE_OK && pReadr->aMap==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pReadr->aMap==0 ){ |
90484
|
0 |
0 |
if( pReadr->aBuffer==0 ){ |
90486
|
0 |
0 |
if( pReadr->aBuffer==0 ) rc = SQLITE_NOMEM_BKPT; |
90489
|
0 |
0 |
if( rc==SQLITE_OK && iBuf ){ |
|
0 |
0 |
if( rc==SQLITE_OK && iBuf ){ |
90491
|
0 |
0 |
if( (pReadr->iReadOff + nRead) > pReadr->iEof ){ |
90513
|
0 |
0 |
if( pReadr->iReadOff>=pReadr->iEof ){ |
90516
|
0 |
0 |
if( pIncr ){ |
90518
|
0 |
0 |
if( rc==SQLITE_OK && pIncr->bEof==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pIncr->bEof==0 ){ |
90526
|
0 |
0 |
if( bEof ){ |
90534
|
0 |
0 |
if( rc==SQLITE_OK ){ |
90537
|
0 |
0 |
if( rc==SQLITE_OK ){ |
90570
|
0 |
0 |
if( rc==SQLITE_OK ){ |
90577
|
0 |
0 |
if( rc==SQLITE_OK ){ |
90595
|
5 |
0 |
if( *pbKey2Cached==0 ){ |
90622
|
20203 |
15417 |
if( !*pbKey2Cached ){ |
90649
|
89 |
0 |
getVarint32(&p1[1], n1); |
90650
|
89 |
0 |
getVarint32(&p2[1], n2); |
90652
|
25 |
64 |
if( res==0 ){ |
90656
|
25 |
64 |
if( res==0 ){ |
90657
|
5 |
20 |
if( pTask->pSorter->pKeyInfo->nKeyField>1 ){ |
90663
|
0 |
64 |
if( pTask->pSorter->pKeyInfo->aSortOrder[0] ){ |
90692
|
122 |
222 |
if( s1==s2 ){ |
90698
|
122 |
0 |
for(i=0; i
|
90699
|
122 |
0 |
if( (res = v1[i] - v2[i])!=0 ){ |
90700
|
0 |
122 |
if( ((v1[0] ^ v2[0]) & 0x80)!=0 ){ |
90701
|
0 |
0 |
res = v1[0] & 0x80 ? -1 : +1; |
90706
|
106 |
116 |
}else if( s1>7 && s2>7 ){ |
|
76 |
30 |
}else if( s1>7 && s2>7 ){ |
90709
|
116 |
30 |
if( s2>7 ){ |
90711
|
30 |
0 |
}else if( s1>7 ){ |
90718
|
116 |
30 |
if( res>0 ){ |
90719
|
0 |
116 |
if( *v1 & 0x80 ) res = -1; |
90721
|
0 |
30 |
if( *v2 & 0x80 ) res = +1; |
90725
|
0 |
344 |
if( res==0 ){ |
90726
|
0 |
0 |
if( pTask->pSorter->pKeyInfo->nKeyField>1 ){ |
90731
|
2 |
342 |
}else if( pTask->pSorter->pKeyInfo->aSortOrder[0] ){ |
90799
|
0 |
216 |
if( pSorter==0 ){ |
90805
|
5 |
211 |
if( nField && nWorker==0 ){ |
90813
|
216 |
216 |
for(i=0; inTask; i++){ |
90818
|
0 |
216 |
if( !sqlite3TempInMemory(db) ){ |
90824
|
0 |
0 |
if( mxCache<0 ){ |
90836
|
0 |
0 |
if( sqlite3GlobalConfig.bSmallMalloc==0 ){ |
90840
|
0 |
0 |
if( !pSorter->list.aMemory ) rc = SQLITE_NOMEM_BKPT; |
90844
|
216 |
0 |
if( pKeyInfo->nAllField<13 |
90845
|
211 |
5 |
&& (pKeyInfo->aColl[0]==0 || pKeyInfo->aColl[0]==db->pDfltColl) |
|
195 |
16 |
&& (pKeyInfo->aColl[0]==0 || pKeyInfo->aColl[0]==db->pDfltColl) |
90861
|
4739 |
5161 |
for(p=pRecord; p; p=pNext){ |
90884
|
0 |
216 |
if( pTask->file.pFd ){ |
90887
|
0 |
216 |
if( pTask->file2.pFd ){ |
91007
|
0 |
0 |
while( N
|
91010
|
0 |
0 |
pNew = sqlite3FaultSim(100) ? 0 : (MergeEngine*)sqlite3MallocZero(nByte); |
91011
|
0 |
0 |
if( pNew ){ |
91025
|
0 |
216 |
if( pMerger ){ |
91026
|
0 |
0 |
for(i=0; inTree; i++){ |
91038
|
0 |
0 |
if( pIncr ){ |
91067
|
216 |
216 |
for(i=0; inTask; i++){ |
91072
|
216 |
0 |
if( pSorter->list.aMemory==0 ){ |
91091
|
216 |
0 |
if( pSorter ){ |
91110
|
0 |
0 |
if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){ |
|
0 |
0 |
if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){ |
91134
|
0 |
0 |
if( sqlite3FaultSim(202) ) return SQLITE_IOERR_ACCESS; |
91140
|
0 |
0 |
if( rc==SQLITE_OK ){ |
91143
|
0 |
0 |
if( nExtend>0 ){ |
91156
|
173 |
0 |
if( pTask->pUnpacked==0 ){ |
91158
|
0 |
173 |
if( pTask->pUnpacked==0 ) return SQLITE_NOMEM_BKPT; |
91185
|
17662 |
18391 |
if( res<=0 ){ |
91189
|
2209 |
15453 |
if( p1==0 ){ |
91198
|
2357 |
16034 |
if( p2==0 ){ |
91212
|
116 |
57 |
if( p->typeMask==SORTER_TYPE_INTEGER ){ |
91214
|
31 |
26 |
}else if( p->typeMask==SORTER_TYPE_TEXT ){ |
91232
|
0 |
173 |
if( rc!=SQLITE_OK ) return rc; |
91238
|
0 |
173 |
if( !aSlot ){ |
91242
|
4739 |
173 |
while( p ){ |
91244
|
0 |
4739 |
if( pList->aMemory ){ |
91245
|
0 |
0 |
if( (u8*)p==pList->aMemory ){ |
91256
|
4516 |
4739 |
for(i=0; aSlot[i]; i++){ |
91265
|
11072 |
173 |
for(i=0; i<64; i++){ |
91266
|
10849 |
223 |
if( aSlot[i]==0 ) continue; |
91267
|
50 |
173 |
p = p ? vdbeSorterMerge(pTask, p, aSlot[i]) : aSlot[i]; |
91289
|
0 |
0 |
if( !p->aBuffer ){ |
91305
|
0 |
0 |
while( nRem>0 && p->eFWErr==0 ){ |
|
0 |
0 |
while( nRem>0 && p->eFWErr==0 ){ |
91307
|
0 |
0 |
if( nCopy>(p->nBuffer - p->iBufEnd) ){ |
91313
|
0 |
0 |
if( p->iBufEnd==p->nBuffer ){ |
91338
|
0 |
0 |
if( p->eFWErr==0 && ALWAYS(p->aBuffer) && p->iBufEnd>p->iBufStart ){ |
|
0 |
0 |
if( p->eFWErr==0 && ALWAYS(p->aBuffer) && p->iBufEnd>p->iBufStart ){ |
|
0 |
0 |
if( p->eFWErr==0 && ALWAYS(p->aBuffer) && p->iBufEnd>p->iBufStart ){ |
91392
|
0 |
0 |
if( pTask->file.pFd==0 ){ |
91400
|
0 |
0 |
if( rc==SQLITE_OK ){ |
91405
|
0 |
0 |
if( rc==SQLITE_OK ){ |
91409
|
0 |
0 |
if( rc==SQLITE_OK ){ |
91417
|
0 |
0 |
for(p=pList->pList; p; p=pNext){ |
91421
|
0 |
0 |
if( pList->aMemory==0 ) sqlite3_free(p); |
91452
|
0 |
0 |
if( rc==SQLITE_OK ){ |
91463
|
0 |
0 |
for(i=(pMerger->nTree+iPrev)/2; i>0; i=i/2){ |
91466
|
0 |
0 |
if( pReadr1->pFd==0 ){ |
91468
|
0 |
0 |
}else if( pReadr2->pFd==0 ){ |
91491
|
0 |
0 |
if( iRes<0 || (iRes==0 && pReadr1
|
|
0 |
0 |
if( iRes<0 || (iRes==0 && pReadr1
|
|
0 |
0 |
if( iRes<0 || (iRes==0 && pReadr1
|
91496
|
0 |
0 |
if( pReadr1->pFd ) bCached = 0; |
91504
|
0 |
0 |
return (rc==SQLITE_OK ? pTask->pUnpacked->errCode : rc); |
91606
|
4739 |
0 |
getVarint32((const u8*)&pVal->z[1], t); |
91607
|
4733 |
6 |
if( t>0 && t<10 && t!=7 ){ |
|
4386 |
347 |
if( t>0 && t<10 && t!=7 ){ |
|
386 |
4000 |
if( t>0 && t<10 && t!=7 ){ |
91609
|
347 |
4006 |
}else if( t>10 && (t & 0x01) ){ |
|
347 |
0 |
}else if( t>10 && (t & 0x01) ){ |
91635
|
0 |
4739 |
if( pSorter->mxPmaSize ){ |
91636
|
0 |
0 |
if( pSorter->list.aMemory ){ |
91637
|
0 |
0 |
bFlush = pSorter->iMemory && (pSorter->iMemory+nReq) > pSorter->mxPmaSize; |
|
0 |
0 |
bFlush = pSorter->iMemory && (pSorter->iMemory+nReq) > pSorter->mxPmaSize; |
91641
|
0 |
0 |
|| (pSorter->list.szPMA > pSorter->mnPmaSize && sqlite3HeapNearlyFull()) |
|
0 |
0 |
|| (pSorter->list.szPMA > pSorter->mnPmaSize && sqlite3HeapNearlyFull()) |
|
0 |
0 |
|| (pSorter->list.szPMA > pSorter->mnPmaSize && sqlite3HeapNearlyFull()) |
91644
|
0 |
0 |
if( bFlush ){ |
91653
|
258 |
4481 |
if( nPMA>pSorter->mxKeysize ){ |
91657
|
0 |
4739 |
if( pSorter->list.aMemory ){ |
91660
|
0 |
0 |
if( nMin>pSorter->nMemory ){ |
91664
|
0 |
0 |
while( nNew < nMin ) nNew = nNew*2; |
91665
|
0 |
0 |
if( nNew > pSorter->mxPmaSize ) nNew = pSorter->mxPmaSize; |
91666
|
0 |
0 |
if( nNew < nMin ) nNew = nMin; |
91669
|
0 |
0 |
if( !aNew ) return SQLITE_NOMEM_BKPT; |
91677
|
0 |
0 |
if( pSorter->list.pList ){ |
91682
|
0 |
4739 |
if( pNew==0 ){ |
91713
|
0 |
0 |
while( rc==SQLITE_OK ){ |
91721
|
0 |
0 |
if( pReader->pFd==0 ) break; |
91722
|
0 |
0 |
if( (iEof + nKey + sqlite3VarintLen(nKey))>(iStart + pIncr->mxSz) ) break; |
91732
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
91801
|
0 |
0 |
if( pIncr->aFile[0].iEof==pIncr->iStartOff ){ |
91821
|
0 |
0 |
IncrMerger *pIncr = *ppOut = (IncrMerger*) |
91823
|
0 |
0 |
if( pIncr ){ |
91864
|
0 |
0 |
if( iOut>=(pMerger->nTree/2) ){ |
91875
|
0 |
0 |
if( p1->pFd==0 ){ |
91877
|
0 |
0 |
}else if( p2->pFd==0 ){ |
91887
|
0 |
0 |
if( res<=0 ){ |
91950
|
0 |
0 |
for(i=0; i
|
91963
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
91966
|
0 |
0 |
for(i=pMerger->nTree-1; i>0; i--){ |
92019
|
0 |
0 |
if( rc==SQLITE_OK ){ |
92030
|
0 |
0 |
if( pTask->file2.pFd==0 ){ |
92035
|
0 |
0 |
if( rc==SQLITE_OK ){ |
92060
|
0 |
0 |
if( rc==SQLITE_OK && (SQLITE_MAX_WORKER_THREADS==0 || eMode!=INCRINIT_TASK) ){ |
92096
|
0 |
0 |
if( pIncr ){ |
92135
|
0 |
0 |
if( pNew==0 ) rc = SQLITE_NOMEM_BKPT; |
92137
|
0 |
0 |
for(i=0; i
|
|
0 |
0 |
for(i=0; i
|
92144
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
92165
|
0 |
0 |
while( nDiv < (i64)nPMA ){ |
92195
|
0 |
0 |
for(i=1; i
|
92199
|
0 |
0 |
for(i=1; i
|
|
0 |
0 |
for(i=1; i
|
92203
|
0 |
0 |
if( pReadr->pIncr==0 ){ |
92205
|
0 |
0 |
if( pNew==0 ){ |
92211
|
0 |
0 |
if( rc==SQLITE_OK ){ |
92217
|
0 |
0 |
if( rc==SQLITE_OK ){ |
92255
|
0 |
0 |
for(iTask=0; rc==SQLITE_OK && iTasknTask; iTask++){ |
|
0 |
0 |
for(iTask=0; rc==SQLITE_OK && iTasknTask; iTask++){ |
92263
|
0 |
0 |
if( pTask->nPMA<=SORTER_MAX_MERGE_COUNT ){ |
92269
|
0 |
0 |
if( pRoot==0 ) rc = SQLITE_NOMEM_BKPT; |
92270
|
0 |
0 |
for(i=0; inPMA && rc==SQLITE_OK; i += SORTER_MAX_MERGE_COUNT){ |
|
0 |
0 |
for(i=0; inPMA && rc==SQLITE_OK; i += SORTER_MAX_MERGE_COUNT){ |
92276
|
0 |
0 |
if( rc==SQLITE_OK ){ |
92282
|
0 |
0 |
if( rc==SQLITE_OK ){ |
92298
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
92329
|
0 |
0 |
if( rc==SQLITE_OK ){ |
92385
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
92408
|
216 |
0 |
if( pSorter->bUsePMA==0 ){ |
92409
|
173 |
43 |
if( pSorter->list.pList ){ |
92433
|
0 |
0 |
if( rc==SQLITE_OK ){ |
92456
|
0 |
4729 |
if( pSorter->bUsePMA ){ |
92471
|
0 |
0 |
if( rc==SQLITE_OK && res ) rc = SQLITE_DONE; |
|
0 |
0 |
if( rc==SQLITE_OK && res ) rc = SQLITE_DONE; |
92477
|
4729 |
0 |
if( pSorter->list.aMemory==0 ) vdbeSorterRecordFree(db, pFree); |
92478
|
4562 |
167 |
rc = pSorter->list.pList ? SQLITE_OK : SQLITE_DONE; |
92492
|
0 |
4736 |
if( pSorter->bUsePMA ){ |
92521
|
0 |
4735 |
if( sqlite3VdbeMemClearAndResize(pOut, nKey) ){ |
92563
|
1 |
0 |
if( r2==0 ){ |
92565
|
0 |
1 |
if( r2==0 ) return SQLITE_NOMEM_BKPT; |
92572
|
1 |
1 |
for(i=0; i
|
92573
|
0 |
1 |
if( r2->aMem[i].flags & MEM_Null ){ |
92692
|
172 |
111 |
if( p->readpoint.iOffset!=iOfst || iOfst==0 ){ |
|
1 |
171 |
if( p->readpoint.iOffset!=iOfst || iOfst==0 ){ |
92694
|
320 |
0 |
for(pChunk=p->pFirst; |
92695
|
208 |
112 |
ALWAYS(pChunk) && (iOff+p->nChunkSize)<=iOfst; |
92713
|
108 |
283 |
} while( nRead>=0 && (pChunk=pChunk->pNext)!=0 && nRead>0 ); |
|
108 |
0 |
} while( nRead>=0 && (pChunk=pChunk->pNext)!=0 && nRead>0 ); |
|
108 |
0 |
} while( nRead>=0 && (pChunk=pChunk->pNext)!=0 && nRead>0 ); |
92714
|
283 |
0 |
p->readpoint.iOffset = pChunk ? iOfst+iAmt : 0; |
92726
|
5147 |
907 |
for(pIter=p->pFirst; pIter; pIter=pNext){ |
92743
|
0 |
0 |
if( rc==SQLITE_OK ){ |
92747
|
0 |
0 |
for(pIter=copy.pFirst; pIter; pIter=pIter->pNext){ |
92748
|
0 |
0 |
if( iOff + nChunk > copy.endpoint.iOffset ){ |
92752
|
0 |
0 |
if( rc ) break; |
92755
|
0 |
0 |
if( rc==SQLITE_OK ){ |
92760
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
92787
|
0 |
4085 |
if( p->nSpill>0 && (iAmt+iOfst)>p->nSpill ){ |
|
0 |
0 |
if( p->nSpill>0 && (iAmt+iOfst)>p->nSpill ){ |
92789
|
0 |
0 |
if( rc==SQLITE_OK ){ |
92813
|
8325 |
4085 |
while( nWrite>0 ){ |
92818
|
5147 |
3178 |
if( iChunkOffset==0 ){ |
92821
|
0 |
5147 |
if( !pNew ){ |
92825
|
4240 |
907 |
if( pChunk ){ |
92856
|
0 |
0 |
if( ALWAYS(size==0) ){ |
92947
|
91 |
907 |
if( nSpill==0 ){ |
92951
|
0 |
907 |
if( nSpill>0 ){ |
93066
|
7400 |
29354 |
if( rc ) return rc & WRC_Abort; |
93067
|
7575 |
21779 |
if( !ExprHasProperty(pExpr,(EP_TokenOnly|EP_Leaf)) ){ |
93068
|
4666 |
2909 |
if( pExpr->pLeft && walkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort; |
|
13 |
4653 |
if( pExpr->pLeft && walkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort; |
93070
|
4236 |
3326 |
if( pExpr->pRight ){ |
93073
|
89 |
3237 |
}else if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
93074
|
26 |
63 |
if( sqlite3WalkSelect(pWalker, pExpr->x.pSelect) ) return WRC_Abort; |
93075
|
1681 |
1556 |
}else if( pExpr->x.pList ){ |
93076
|
209 |
1472 |
if( sqlite3WalkExprList(pWalker, pExpr->x.pList) ) return WRC_Abort; |
93084
|
27852 |
9051 |
return pExpr ? walkExpr(pWalker,pExpr) : WRC_Continue; |
93094
|
7037 |
6189 |
if( p ){ |
93095
|
12107 |
6828 |
for(i=p->nExpr, pItem=p->a; i>0; i--, pItem++){ |
93096
|
209 |
11898 |
if( sqlite3WalkExpr(pWalker, pItem->pExpr) ) return WRC_Abort; |
93109
|
0 |
3568 |
if( sqlite3WalkExprList(pWalker, p->pEList) ) return WRC_Abort; |
93110
|
0 |
3568 |
if( sqlite3WalkExpr(pWalker, p->pWhere) ) return WRC_Abort; |
93111
|
0 |
3568 |
if( sqlite3WalkExprList(pWalker, p->pGroupBy) ) return WRC_Abort; |
93112
|
0 |
3568 |
if( sqlite3WalkExpr(pWalker, p->pHaving) ) return WRC_Abort; |
93113
|
0 |
3568 |
if( sqlite3WalkExprList(pWalker, p->pOrderBy) ) return WRC_Abort; |
93114
|
0 |
3568 |
if( sqlite3WalkExpr(pWalker, p->pLimit) ) return WRC_Abort; |
93132
|
2666 |
3568 |
for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){ |
93133
|
72 |
2594 |
if( pItem->pSelect && sqlite3WalkSelect(pWalker, pItem->pSelect) ){ |
|
0 |
72 |
if( pItem->pSelect && sqlite3WalkSelect(pWalker, pItem->pSelect) ){ |
93136
|
0 |
2666 |
if( pItem->fg.isTabFunc |
93137
|
0 |
0 |
&& sqlite3WalkExprList(pWalker, pItem->u1.pFuncArg) |
93164
|
119 |
5171 |
if( p==0 ) return WRC_Continue; |
93165
|
0 |
5171 |
if( pWalker->xSelectCallback==0 ) return WRC_Continue; |
93168
|
1777 |
3568 |
if( rc ) return rc & WRC_Abort; |
93169
|
3568 |
0 |
if( sqlite3WalkSelectExpr(pWalker, p) |
93170
|
0 |
3568 |
|| sqlite3WalkSelectFrom(pWalker, p) |
93174
|
3560 |
8 |
if( pWalker->xSelectCallback2 ){ |
93178
|
174 |
3394 |
}while( p!=0 ); |
93212
|
0 |
0 |
if( pExpr->op==TK_AGG_FUNCTION ) pExpr->op2 += pWalker->u.n; |
93216
|
0 |
146 |
if( N>0 ){ |
93261
|
153 |
0 |
if( pDup!=0 ){ |
93262
|
146 |
7 |
if( zType[0]!='G' ) incrAggFunctionDepth(pDup, nSubquery); |
93263
|
0 |
153 |
if( pExpr->op==TK_COLLATE ){ |
93278
|
153 |
0 |
if( !ExprHasProperty(pExpr, EP_IntValue) && pExpr->u.zToken!=0 ){ |
|
150 |
3 |
if( !ExprHasProperty(pExpr, EP_IntValue) && pExpr->u.zToken!=0 ){ |
93296
|
0 |
0 |
if( pUsing ){ |
93298
|
0 |
0 |
for(k=0; knId; k++){ |
93299
|
0 |
0 |
if( sqlite3StrICmp(pUsing->a[k].zName, zCol)==0 ) return 1; |
93319
|
0 |
0 |
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){} |
|
0 |
0 |
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){} |
93320
|
0 |
0 |
if( zDb && (sqlite3StrNICmp(zSpan, zDb, n)!=0 || zDb[n]!=0) ){ |
|
0 |
0 |
if( zDb && (sqlite3StrNICmp(zSpan, zDb, n)!=0 || zDb[n]!=0) ){ |
|
0 |
0 |
if( zDb && (sqlite3StrNICmp(zSpan, zDb, n)!=0 || zDb[n]!=0) ){ |
93324
|
0 |
0 |
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){} |
|
0 |
0 |
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){} |
93325
|
0 |
0 |
if( zTab && (sqlite3StrNICmp(zSpan, zTab, n)!=0 || zTab[n]!=0) ){ |
|
0 |
0 |
if( zTab && (sqlite3StrNICmp(zSpan, zTab, n)!=0 || zTab[n]!=0) ){ |
|
0 |
0 |
if( zTab && (sqlite3StrNICmp(zSpan, zTab, n)!=0 || zTab[n]!=0) ){ |
93329
|
0 |
0 |
if( zCol && sqlite3StrICmp(zSpan, zCol)!=0 ){ |
|
0 |
0 |
if( zCol && sqlite3StrICmp(zSpan, zCol)!=0 ){ |
93396
|
3 |
4836 |
if( zDb ){ |
93399
|
0 |
3 |
if( (pNC->ncFlags & (NC_PartIdx|NC_IsCheck))!=0 ){ |
93406
|
3 |
0 |
for(i=0; inDb; i++){ |
93408
|
3 |
0 |
if( sqlite3StrICmp(db->aDb[i].zDbSName,zDb)==0 ){ |
93422
|
4841 |
10 |
if( pSrcList ){ |
93423
|
4858 |
4841 |
for(i=0, pItem=pSrcList->a; inSrc; i++, pItem++){ |
93427
|
175 |
4683 |
if( pItem->pSelect && (pItem->pSelect->selFlags & SF_NestedFrom)!=0 ){ |
|
0 |
175 |
if( pItem->pSelect && (pItem->pSelect->selFlags & SF_NestedFrom)!=0 ){ |
93430
|
0 |
0 |
for(j=0; jnExpr; j++){ |
93431
|
0 |
0 |
if( sqlite3MatchSpanName(pEList->a[j].zSpan, zCol, zTab, zDb) ){ |
93439
|
0 |
0 |
if( hit || zTab==0 ) continue; |
|
0 |
0 |
if( hit || zTab==0 ) continue; |
93441
|
3 |
4855 |
if( zDb && pTab->pSchema!=pSchema ){ |
|
0 |
3 |
if( zDb && pTab->pSchema!=pSchema ){ |
93444
|
90 |
4768 |
if( zTab ){ |
93445
|
72 |
18 |
const char *zTabName = pItem->zAlias ? pItem->zAlias : pTab->zName; |
93447
|
28 |
62 |
if( sqlite3StrICmp(zTabName, zTab)!=0 ){ |
93451
|
4829 |
1 |
if( 0==(cntTab++) ){ |
93454
|
14002 |
829 |
for(j=0, pCol=pTab->aCol; jnCol; j++, pCol++){ |
93455
|
4001 |
10001 |
if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ |
93460
|
0 |
4001 |
if( cnt==1 ){ |
93461
|
0 |
0 |
if( pItem->fg.jointype & JT_NATURAL ) continue; |
93462
|
0 |
0 |
if( nameInUsingClause(pItem->pUsing, zCol) ) continue; |
93467
|
3754 |
247 |
pExpr->iColumn = j==pTab->iPKey ? -1 : (i16)j; |
93472
|
4829 |
12 |
if( pMatch ){ |
93477
|
0 |
4829 |
if( (pMatch->fg.jointype & JT_LEFT)!=0 ){ |
93489
|
4848 |
3 |
if( zDb==0 && zTab!=0 && cntTab==0 ){ |
|
71 |
4777 |
if( zDb==0 && zTab!=0 && cntTab==0 ){ |
|
12 |
59 |
if( zDb==0 && zTab!=0 && cntTab==0 ){ |
93492
|
0 |
12 |
if( pParse->pTriggerTab!=0 ){ |
93495
|
0 |
0 |
if( op!=TK_DELETE && sqlite3StrICmp("new",zTab) == 0 ){ |
|
0 |
0 |
if( op!=TK_DELETE && sqlite3StrICmp("new",zTab) == 0 ){ |
93498
|
0 |
0 |
}else if( op!=TK_INSERT && sqlite3StrICmp("old",zTab)==0 ){ |
|
0 |
0 |
}else if( op!=TK_INSERT && sqlite3StrICmp("old",zTab)==0 ){ |
93505
|
0 |
12 |
if( (pNC->ncFlags & NC_UUpsert)!=0 ){ |
93507
|
0 |
0 |
if( pUpsert && sqlite3StrICmp("excluded",zTab)==0 ){ |
|
0 |
0 |
if( pUpsert && sqlite3StrICmp("excluded",zTab)==0 ){ |
93514
|
0 |
12 |
if( pTab ){ |
93518
|
0 |
0 |
for(iCol=0, pCol=pTab->aCol; iColnCol; iCol++, pCol++){ |
93519
|
0 |
0 |
if( sqlite3StrICmp(pCol->zName, zCol)==0 ){ |
93520
|
0 |
0 |
if( iCol==pTab->iPKey ){ |
93526
|
0 |
0 |
if( iCol>=pTab->nCol && sqlite3IsRowid(zCol) && VisibleRowid(pTab) ){ |
|
0 |
0 |
if( iCol>=pTab->nCol && sqlite3IsRowid(zCol) && VisibleRowid(pTab) ){ |
|
0 |
0 |
if( iCol>=pTab->nCol && sqlite3IsRowid(zCol) && VisibleRowid(pTab) ){ |
93530
|
0 |
0 |
if( iColnCol ){ |
93533
|
0 |
0 |
if( pExpr->iTable==2 ){ |
93542
|
0 |
0 |
if( iCol<0 ){ |
93544
|
0 |
0 |
}else if( pExpr->iTable==0 ){ |
93547
|
0 |
0 |
pParse->oldmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<
|
93551
|
0 |
0 |
pParse->newmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<
|
93566
|
850 |
4001 |
if( cnt==0 |
93567
|
828 |
22 |
&& cntTab==1 |
93568
|
828 |
0 |
&& pMatch |
93569
|
828 |
0 |
&& (pNC->ncFlags & NC_IdxExpr)==0 |
93570
|
820 |
8 |
&& sqlite3IsRowid(zCol) |
93571
|
820 |
0 |
&& VisibleRowid(pMatch->pTab) |
93596
|
1692 |
3159 |
if( (pNC->ncFlags & NC_UEList)!=0 |
93597
|
20 |
1672 |
&& cnt==0 |
93598
|
8 |
12 |
&& zTab==0 |
93602
|
16 |
1 |
for(j=0; jnExpr; j++){ |
93604
|
9 |
7 |
if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){ |
|
7 |
2 |
if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){ |
93610
|
7 |
0 |
if( (pNC->ncFlags&NC_AllowAgg)==0 && ExprHasProperty(pOrig, EP_Agg) ){ |
|
0 |
7 |
if( (pNC->ncFlags&NC_AllowAgg)==0 && ExprHasProperty(pOrig, EP_Agg) ){ |
93614
|
0 |
7 |
if( sqlite3ExprVectorSize(pOrig)!=1 ){ |
93630
|
4821 |
23 |
if( cnt ) break; |
93633
|
12 |
11 |
}while( pNC ); |
93646
|
11 |
4821 |
if( cnt==0 && zTab==0 ){ |
|
11 |
0 |
if( cnt==0 && zTab==0 ){ |
93648
|
11 |
0 |
if( ExprHasProperty(pExpr,EP_DblQuoted) ){ |
93653
|
0 |
0 |
if( sqlite3ExprIdToTrueFalse(pExpr) ){ |
93662
|
0 |
4821 |
if( cnt!=1 ){ |
93664
|
0 |
0 |
zErr = cnt==0 ? "no such column" : "ambiguous column name"; |
93665
|
0 |
0 |
if( zDb ){ |
93667
|
0 |
0 |
}else if( zTab ){ |
93682
|
3754 |
1067 |
if( pExpr->iColumn>=0 && pMatch!=0 ){ |
|
3754 |
0 |
if( pExpr->iColumn>=0 && pMatch!=0 ){ |
93685
|
0 |
3754 |
if( n>=BMS ){ |
93701
|
4828 |
0 |
if( cnt==1 ){ |
93703
|
4821 |
7 |
if( !ExprHasProperty(pExpr, EP_Alias) ){ |
93711
|
4828 |
12 |
if( pTopNC==pNC ) break; |
93726
|
0 |
0 |
if( p ){ |
93730
|
0 |
0 |
if( p->pTab->iPKey==iCol ){ |
93753
|
0 |
1854 |
if( (pNC->ncFlags & validMask)!=0 ){ |
93755
|
0 |
0 |
if( pNC->ncFlags & NC_IdxExpr ) zIn = "index expressions"; |
93757
|
0 |
0 |
else if( pNC->ncFlags & NC_IsCheck ) zIn = "CHECK constraints"; |
93770
|
0 |
0 |
if( p->op!=TK_FLOAT ) return -1; |
93773
|
0 |
0 |
if( r>1.0 ) return -1; |
93844
|
4777 |
62 |
if( pExpr->op==TK_ID ){ |
93851
|
59 |
3 |
if( pRight->op==TK_ID ){ |
93869
|
605 |
101 |
int n = pList ? pList->nExpr : 0; /* Number of arguments */ |
93882
|
0 |
706 |
if( pDef==0 ){ |
93884
|
0 |
0 |
if( pDef==0 ){ |
93891
|
0 |
706 |
if( pDef->funcFlags & SQLITE_FUNC_UNLIKELY ){ |
93893
|
0 |
0 |
if( n==2 ){ |
93895
|
0 |
0 |
if( pExpr->iTable<0 ){ |
93911
|
0 |
0 |
pExpr->iTable = pDef->zName[0]=='u' ? 8388608 : 125829120; |
93917
|
0 |
706 |
if( auth!=SQLITE_OK ){ |
93918
|
0 |
0 |
if( auth==SQLITE_DENY ){ |
93928
|
166 |
540 |
if( pDef->funcFlags & (SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG) ){ |
93934
|
540 |
166 |
if( (pDef->funcFlags & SQLITE_FUNC_CONSTANT)==0 ){ |
93942
|
135 |
571 |
if( is_agg && (pNC->ncFlags & NC_AllowAgg)==0 ){ |
|
0 |
135 |
if( is_agg && (pNC->ncFlags & NC_AllowAgg)==0 ){ |
93946
|
0 |
706 |
}else if( no_such_func && pParse->db->init.busy==0 |
|
0 |
0 |
}else if( no_such_func && pParse->db->init.busy==0 |
93953
|
0 |
706 |
}else if( wrong_num_args ){ |
93958
|
135 |
571 |
if( is_agg ) pNC->ncFlags &= ~NC_AllowAgg; |
93960
|
135 |
571 |
if( is_agg ){ |
93964
|
135 |
0 |
while( pNC2 && !sqlite3FunctionUsesThisSrc(pExpr, pNC2->pSrcList) ){ |
|
0 |
135 |
while( pNC2 && !sqlite3FunctionUsesThisSrc(pExpr, pNC2->pSrcList) ){ |
93969
|
135 |
0 |
if( pNC2 ){ |
93988
|
21 |
16 |
if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
93993
|
2 |
19 |
if( nRef!=pNC->nRef ){ |
94010
|
0 |
5 |
if( (pRight = pExpr->pRight)->op==TK_ID ){ |
94012
|
0 |
0 |
if( rc==WRC_Abort ) return WRC_Abort; |
94013
|
0 |
0 |
if( pRight->op==TK_TRUEFALSE ){ |
94029
|
0 |
1296 |
if( pParse->db->mallocFailed ) break; |
94032
|
18 |
1278 |
if( pExpr->op==TK_BETWEEN ){ |
94034
|
18 |
0 |
if( nRight==nLeft ){ |
94041
|
0 |
1296 |
if( nLeft!=nRight ){ |
94056
|
8563 |
0 |
return (pParse->nErr || pParse->db->mallocFailed) ? WRC_Abort : WRC_Continue; |
|
0 |
8563 |
return (pParse->nErr || pParse->db->mallocFailed) ? WRC_Abort : WRC_Continue; |
94080
|
601 |
1 |
if( pE->op==TK_ID ){ |
94082
|
1682 |
526 |
for(i=0; inExpr; i++){ |
94084
|
173 |
1509 |
if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){ |
|
75 |
98 |
if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){ |
94138
|
0 |
0 |
if( rc ) return 0; |
94144
|
0 |
0 |
for(i=0; inExpr; i++){ |
94145
|
0 |
0 |
if( sqlite3ExprCompare(0, pEList->a[i].pExpr, pE, -1)<2 ){ |
94194
|
26 |
0 |
if( pOrderBy==0 ) return 0; |
94196
|
0 |
0 |
if( pOrderBy->nExpr>db->aLimit[SQLITE_LIMIT_COLUMN] ){ |
94200
|
0 |
0 |
for(i=0; inExpr; i++){ |
94204
|
0 |
0 |
while( pSelect->pPrior ){ |
94208
|
0 |
0 |
while( pSelect && moreToDo ){ |
|
0 |
0 |
while( pSelect && moreToDo ){ |
94213
|
0 |
0 |
for(i=0, pItem=pOrderBy->a; inExpr; i++, pItem++){ |
94216
|
0 |
0 |
if( pItem->done ) continue; |
94218
|
0 |
0 |
if( sqlite3ExprIsInteger(pE, &iCol) ){ |
94219
|
0 |
0 |
if( iCol<=0 || iCol>pEList->nExpr ){ |
|
0 |
0 |
if( iCol<=0 || iCol>pEList->nExpr ){ |
94225
|
0 |
0 |
if( iCol==0 ){ |
94227
|
0 |
0 |
if( !db->mallocFailed ){ |
94234
|
0 |
0 |
if( iCol>0 ){ |
94238
|
0 |
0 |
if( pNew==0 ) return 1; |
94241
|
0 |
0 |
if( pItem->pExpr==pE ){ |
94246
|
0 |
0 |
while( pParent->pLeft->op==TK_COLLATE ) pParent = pParent->pLeft; |
94259
|
0 |
0 |
for(i=0; inExpr; i++){ |
94260
|
0 |
0 |
if( pOrderBy->a[i].done==0 ){ |
94290
|
565 |
0 |
if( pOrderBy==0 || pParse->db->mallocFailed ) return 0; |
|
0 |
565 |
if( pOrderBy==0 || pParse->db->mallocFailed ) return 0; |
94291
|
0 |
565 |
if( pOrderBy->nExpr>db->aLimit[SQLITE_LIMIT_COLUMN] ){ |
94297
|
615 |
565 |
for(i=0, pItem=pOrderBy->a; inExpr; i++, pItem++){ |
94298
|
146 |
469 |
if( pItem->u.x.iOrderByCol ){ |
94299
|
0 |
146 |
if( pItem->u.x.iOrderByCol>pEList->nExpr ){ |
94340
|
1202 |
565 |
if( pOrderBy==0 ) return 0; |
94343
|
615 |
565 |
for(i=0, pItem=pOrderBy->a; inExpr; i++, pItem++){ |
94346
|
602 |
13 |
if( zType[0]!='G' ){ |
94348
|
75 |
527 |
if( iCol>0 ){ |
94357
|
0 |
540 |
if( sqlite3ExprIsInteger(pE2, &iCol) ){ |
94361
|
0 |
0 |
if( iCol<1 || iCol>0xffff ){ |
|
0 |
0 |
if( iCol<1 || iCol>0xffff ){ |
94371
|
0 |
540 |
if( sqlite3ResolveExprNames(pNC, pE) ){ |
94374
|
1531 |
540 |
for(j=0; jpEList->nExpr; j++){ |
94375
|
71 |
1460 |
if( sqlite3ExprCompare(0, pE, pSelect->pEList->a[j].pExpr, -1)==0 ){ |
94399
|
21 |
1695 |
if( p->selFlags & SF_Resolved ){ |
94414
|
0 |
1695 |
if( (p->selFlags & SF_Expanded)==0 ){ |
94416
|
0 |
0 |
return (pParse->nErr || db->mallocFailed) ? WRC_Abort : WRC_Prune; |
|
0 |
0 |
return (pParse->nErr || db->mallocFailed) ? WRC_Abort : WRC_Prune; |
94422
|
1780 |
1695 |
while( p ){ |
94432
|
0 |
1780 |
if( sqlite3ResolveExprNames(&sNC, p->pLimit) ){ |
94442
|
0 |
1780 |
if( p->selFlags & SF_Converted ){ |
94452
|
1332 |
1780 |
for(i=0; ipSrc->nSrc; i++){ |
94454
|
35 |
1297 |
if( pItem->pSelect ){ |
94464
|
0 |
35 |
for(pNC=pOuterNC; pNC; pNC=pNC->pNext) nRef += pNC->nRef; |
94466
|
0 |
35 |
if( pItem->zName ) pParse->zAuthContext = pItem->zName; |
94469
|
35 |
0 |
if( pParse->nErr || db->mallocFailed ) return WRC_Abort; |
|
0 |
35 |
if( pParse->nErr || db->mallocFailed ) return WRC_Abort; |
94471
|
0 |
35 |
for(pNC=pOuterNC; pNC; pNC=pNC->pNext) nRef -= pNC->nRef; |
94485
|
0 |
1780 |
if( sqlite3ResolveExprListNames(&sNC, p->pEList) ) return WRC_Abort; |
94492
|
1767 |
13 |
if( pGroupBy || (sNC.ncFlags & NC_HasAgg)!=0 ){ |
|
122 |
1645 |
if( pGroupBy || (sNC.ncFlags & NC_HasAgg)!=0 ){ |
94501
|
5 |
1775 |
if( p->pHaving && !pGroupBy ){ |
|
0 |
5 |
if( p->pHaving && !pGroupBy ){ |
94517
|
0 |
1780 |
if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort; |
94518
|
0 |
1780 |
if( sqlite3ResolveExprNames(&sNC, p->pWhere) ) return WRC_Abort; |
94521
|
1332 |
1780 |
for(i=0; ipSrc->nSrc; i++){ |
94523
|
0 |
1332 |
if( pItem->fg.isTabFunc |
94524
|
0 |
0 |
&& sqlite3ResolveExprListNames(&sNC, pItem->u1.pFuncArg) |
94541
|
0 |
1780 |
if( p->selFlags & SF_Converted ){ |
94557
|
1754 |
26 |
if( isCompound<=nCompound /* Defer right-most ORDER BY of a compound */ |
94558
|
0 |
1754 |
&& resolveOrderGroupBy(&sNC, p, p->pOrderBy, "ORDER") |
94562
|
0 |
1780 |
if( db->mallocFailed ){ |
94569
|
13 |
1767 |
if( pGroupBy ){ |
94572
|
13 |
0 |
if( resolveOrderGroupBy(&sNC, p, pGroupBy, "GROUP") || db->mallocFailed ){ |
|
0 |
13 |
if( resolveOrderGroupBy(&sNC, p, pGroupBy, "GROUP") || db->mallocFailed ){ |
94575
|
13 |
13 |
for(i=0, pItem=pGroupBy->a; inExpr; i++, pItem++){ |
94576
|
0 |
13 |
if( ExprHasProperty(pItem->pExpr, EP_Agg) ){ |
94586
|
85 |
1695 |
if( p->pNext && p->pEList->nExpr!=p->pNext->pEList->nExpr ){ |
|
0 |
85 |
if( p->pNext && p->pEList->nExpr!=p->pNext->pEList->nExpr ){ |
94600
|
26 |
1669 |
if( isCompound && resolveCompoundOrderBy(pParse, pLeftmost) ){ |
|
0 |
26 |
if( isCompound && resolveCompoundOrderBy(pParse, pLeftmost) ){ |
94662
|
4518 |
9681 |
if( pExpr==0 ) return SQLITE_OK; |
94672
|
0 |
9681 |
if( sqlite3ExprCheckHeight(w.pParse, w.pParse->nHeight) ){ |
94680
|
135 |
9546 |
if( pNC->ncFlags & NC_HasAgg ){ |
94684
|
9681 |
0 |
return pNC->nErr>0 || w.pParse->nErr>0; |
|
0 |
9681 |
return pNC->nErr>0 || w.pParse->nErr>0; |
94697
|
4439 |
0 |
if( pList ){ |
94698
|
6521 |
4439 |
for(i=0; inExpr; i++){ |
94699
|
0 |
6521 |
if( sqlite3ResolveExprNames(pNC, pList->a[i].pExpr) ) return WRC_Abort; |
94764
|
0 |
132 |
if( sqlite3ResolveExprNames(&sNC, pExpr) ) return; |
94765
|
0 |
132 |
if( pList ) sqlite3ResolveExprListNames(&sNC, pList); |
94795
|
1366 |
10 |
return iCol>=0 ? pTab->aCol[iCol].affinity : SQLITE_AFF_INTEGER; |
94817
|
7 |
2749 |
if( pExpr->flags & EP_Generic ) return 0; |
94819
|
2 |
2747 |
if( op==TK_SELECT ){ |
94823
|
10 |
2737 |
if( op==TK_REGISTER ) op = pExpr->op2; |
94825
|
0 |
2747 |
if( op==TK_CAST ){ |
94830
|
2747 |
0 |
if( (op==TK_AGG_COLUMN || op==TK_COLUMN) && pExpr->pTab ){ |
|
1376 |
1371 |
if( (op==TK_AGG_COLUMN || op==TK_COLUMN) && pExpr->pTab ){ |
|
1376 |
0 |
if( (op==TK_AGG_COLUMN || op==TK_COLUMN) && pExpr->pTab ){ |
94833
|
0 |
1371 |
if( op==TK_SELECT_COLUMN ){ |
94856
|
274 |
0 |
if( pCollName->n>0 ){ |
94858
|
274 |
0 |
if( pNew ){ |
94878
|
15627 |
866 |
while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){ |
|
362 |
15265 |
while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){ |
94879
|
0 |
362 |
if( ExprHasProperty(pExpr, EP_Unlikely) ){ |
94910
|
1752 |
0 |
while( p ){ |
94912
|
5 |
1747 |
if( p->flags & EP_Generic ) break; |
94913
|
1747 |
0 |
if( op==TK_CAST || op==TK_UPLUS ){ |
|
0 |
1747 |
if( op==TK_CAST || op==TK_UPLUS ){ |
94917
|
1731 |
16 |
if( op==TK_COLLATE || (op==TK_REGISTER && p->op2==TK_COLLATE) ){ |
|
0 |
1731 |
if( op==TK_COLLATE || (op==TK_REGISTER && p->op2==TK_COLLATE) ){ |
|
0 |
0 |
if( op==TK_COLLATE || (op==TK_REGISTER && p->op2==TK_COLLATE) ){ |
94921
|
1715 |
16 |
if( (op==TK_AGG_COLUMN || op==TK_COLUMN |
|
107 |
1608 |
if( (op==TK_AGG_COLUMN || op==TK_COLUMN |
94922
|
107 |
0 |
|| op==TK_REGISTER || op==TK_TRIGGER) |
|
0 |
107 |
|| op==TK_REGISTER || op==TK_TRIGGER) |
94923
|
1624 |
0 |
&& p->pTab!=0 |
94928
|
1153 |
471 |
if( j>=0 ){ |
94934
|
0 |
107 |
if( p->flags & EP_Collate ){ |
94935
|
0 |
0 |
if( p->pLeft && (p->pLeft->flags & EP_Collate)!=0 ){ |
|
0 |
0 |
if( p->pLeft && (p->pLeft->flags & EP_Collate)!=0 ){ |
94944
|
0 |
0 |
if( p->x.pList!=0 && ALWAYS(!ExprHasProperty(p, EP_xIsSelect)) ){ |
|
0 |
0 |
if( p->x.pList!=0 && ALWAYS(!ExprHasProperty(p, EP_xIsSelect)) ){ |
94946
|
0 |
0 |
for(i=0; ALWAYS(ix.pList->nExpr); i++){ |
94947
|
0 |
0 |
if( ExprHasProperty(p->x.pList->a[i].pExpr, EP_Collate) ){ |
94959
|
0 |
1752 |
if( sqlite3CheckCollSeq(pParse, pColl) ){ |
94977
|
457 |
277 |
if( p==0 ) p = pParse->db->pDfltColl; |
94998
|
687 |
635 |
if( aff1 && aff2 ){ |
|
24 |
663 |
if( aff1 && aff2 ){ |
95002
|
7 |
17 |
if( sqlite3IsNumericAffinity(aff1) || sqlite3IsNumericAffinity(aff2) ){ |
|
0 |
7 |
if( sqlite3IsNumericAffinity(aff1) || sqlite3IsNumericAffinity(aff2) ){ |
95007
|
635 |
663 |
}else if( !aff1 && !aff2 ){ |
|
19 |
616 |
}else if( !aff1 && !aff2 ){ |
95030
|
567 |
0 |
if( pExpr->pRight ){ |
95032
|
0 |
0 |
}else if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
95034
|
0 |
0 |
}else if( aff==0 ){ |
95087
|
1 |
796 |
if( pLeft->flags & EP_Collate ){ |
95089
|
796 |
0 |
}else if( pRight && (pRight->flags & EP_Collate)!=0 ){ |
|
5 |
791 |
}else if( pRight && (pRight->flags & EP_Collate)!=0 ){ |
95093
|
23 |
768 |
if( !pColl ){ |
95145
|
268 |
4734 |
if( op==TK_REGISTER ) op = pExpr->op2; |
95146
|
0 |
5002 |
if( op==TK_VECTOR ){ |
95148
|
2 |
5000 |
}else if( op==TK_SELECT ){ |
95172
|
0 |
59 |
if( sqlite3ExprIsVector(pVector) ){ |
95174
|
0 |
0 |
if( pVector->op==TK_SELECT || pVector->op2==TK_SELECT ){ |
|
0 |
0 |
if( pVector->op==TK_SELECT || pVector->op2==TK_SELECT ){ |
95210
|
0 |
0 |
if( pVector->op==TK_SELECT ){ |
95229
|
0 |
0 |
if( pRet ){ |
95235
|
0 |
0 |
if( pVector->op==TK_VECTOR ) pVector = pVector->x.pList->a[iField].pExpr; |
95252
|
0 |
0 |
if( pExpr->op==TK_SELECT ){ |
95287
|
0 |
0 |
if( op==TK_REGISTER ){ |
95291
|
0 |
0 |
if( op==TK_SELECT ){ |
95327
|
0 |
0 |
if( nLeft!=sqlite3ExprVectorSize(pRight) ){ |
95342
|
0 |
0 |
if( opx==TK_LE ) opx = TK_LT; |
95343
|
0 |
0 |
if( opx==TK_GE ) opx = TK_GT; |
95353
|
0 |
0 |
if( i>0 ) sqlite3ExprCachePush(pParse); |
95365
|
0 |
0 |
if( i>0 ) sqlite3ExprCachePop(pParse); |
95366
|
0 |
0 |
if( i==nLeft-1 ){ |
95369
|
0 |
0 |
if( opx==TK_EQ ){ |
95372
|
0 |
0 |
}else if( opx==TK_NE ){ |
95382
|
0 |
0 |
if( i==nLeft-2 ) opx = op; |
95397
|
0 |
13105 |
if( nHeight>mxHeight ){ |
95416
|
5608 |
2903 |
if( p ){ |
95417
|
2846 |
2762 |
if( p->nHeight>*pnHeight ){ |
95423
|
728 |
88 |
if( p ){ |
95425
|
1404 |
728 |
for(i=0; inExpr; i++){ |
95432
|
65 |
65 |
for(p=pSelect; p; p=p->pPrior){ |
95456
|
21 |
3435 |
if( ExprHasProperty(p, EP_xIsSelect) ){ |
95458
|
621 |
2814 |
}else if( p->x.pList ){ |
95474
|
0 |
743 |
if( pParse->nErr ) return; |
95532
|
2207 |
330 |
if( pToken ){ |
95533
|
544 |
1663 |
if( op!=TK_INTEGER || pToken->z==0 |
|
544 |
0 |
if( op!=TK_INTEGER || pToken->z==0 |
95534
|
12 |
532 |
|| sqlite3GetInt32(pToken->z, &iValue)==0 ){ |
95540
|
2537 |
0 |
if( pNew ){ |
95544
|
2207 |
330 |
if( pToken ){ |
95545
|
532 |
1675 |
if( nExtra==0 ){ |
95551
|
1576 |
99 |
if( pToken->n ) memcpy(pNew->u.zToken, pToken->z, pToken->n); |
95553
|
880 |
795 |
if( dequote && sqlite3Isquote(pNew->u.zToken[0]) ){ |
|
14 |
866 |
if( dequote && sqlite3Isquote(pNew->u.zToken[0]) ){ |
95554
|
0 |
14 |
if( pNew->u.zToken[0]=='"' ) pNew->flags |= EP_DblQuoted; |
95593
|
0 |
2713 |
if( pRoot==0 ){ |
95598
|
2068 |
645 |
if( pRight ){ |
95602
|
2068 |
645 |
if( pLeft ){ |
95624
|
299 |
2382 |
if( op==TK_AND && pParse->nErr==0 ){ |
|
299 |
0 |
if( op==TK_AND && pParse->nErr==0 ){ |
95629
|
2382 |
0 |
if( p ){ |
95636
|
2681 |
0 |
if( p ) { |
95647
|
21 |
0 |
if( pExpr ){ |
95674
|
0 |
151 |
if( ExprHasProperty(p, EP_FromJoin) ) return 0; |
95675
|
151 |
0 |
if( !sqlite3ExprIsInteger(p, &v) ) return 0; |
95680
|
0 |
811 |
if( ExprHasProperty(p, EP_FromJoin) ) return 0; |
95681
|
811 |
0 |
if( !sqlite3ExprIsInteger(p, &v) ) return 0; |
95694
|
84 |
330 |
if( pLeft==0 ){ |
95696
|
0 |
330 |
}else if( pRight==0 ){ |
95698
|
330 |
0 |
}else if( exprAlwaysFalse(pLeft) || exprAlwaysFalse(pRight) ){ |
|
0 |
330 |
}else if( exprAlwaysFalse(pLeft) || exprAlwaysFalse(pRight) ){ |
95718
|
0 |
706 |
if( pNew==0 ){ |
95750
|
0 |
1231 |
if( pExpr==0 ) return; |
95756
|
1200 |
31 |
if( z[1]==0 ){ |
95762
|
13 |
18 |
if( z[0]=='?' ){ |
95767
|
13 |
0 |
if( n==2 ){ /*OPTIMIZATION-IF-TRUE*/ |
95777
|
13 |
0 |
if( bOk==0 || i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){ |
|
13 |
0 |
if( bOk==0 || i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){ |
|
0 |
13 |
if( bOk==0 || i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){ |
95783
|
13 |
0 |
if( x>pParse->nVar ){ |
95786
|
0 |
0 |
}else if( sqlite3VListNumToName(pParse->pVList, x)==0 ){ |
95795
|
17 |
1 |
if( x==0 ){ |
95800
|
30 |
1 |
if( doAdd ){ |
95805
|
0 |
1231 |
if( x>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){ |
95824
|
4364 |
13794 |
if( !ExprHasProperty(p, (EP_TokenOnly|EP_Leaf)) ){ |
95827
|
2331 |
2033 |
if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft); |
|
2331 |
0 |
if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft); |
95828
|
2004 |
2360 |
if( p->pRight ){ |
95830
|
21 |
2339 |
}else if( ExprHasProperty(p, EP_xIsSelect) ){ |
95836
|
150 |
18008 |
if( ExprHasProperty(p, EP_MemToken) ) sqlite3DbFree(db, p->u.zToken); |
95837
|
18001 |
157 |
if( !ExprHasProperty(p, EP_Static) ){ |
95842
|
13823 |
29657 |
if( p ) sqlite3ExprDeleteNN(db, p); |
95851
|
0 |
2920 |
if( ExprHasProperty(p, EP_TokenOnly) ) return EXPR_TOKENONLYSIZE; |
95852
|
0 |
2920 |
if( ExprHasProperty(p, EP_Reduced) ) return EXPR_REDUCEDSIZE; |
95895
|
24 |
5840 |
if( 0==flags || p->op==TK_SELECT_COLUMN ){ |
|
0 |
24 |
if( 0==flags || p->op==TK_SELECT_COLUMN ){ |
95902
|
12 |
12 |
if( p->pLeft || p->x.pList ){ |
|
0 |
12 |
if( p->pLeft || p->x.pList ){ |
95919
|
2845 |
91 |
if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){ |
|
2787 |
58 |
if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){ |
95940
|
2928 |
12 |
if( p ){ |
95942
|
8 |
2920 |
if( flags&EXPRDUP_REDUCE ){ |
95968
|
4 |
2924 |
if( pzBuffer ){ |
95977
|
2928 |
0 |
if( pNew ){ |
95986
|
2839 |
89 |
if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){ |
|
2781 |
58 |
if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){ |
95991
|
8 |
2920 |
if( dupFlags ){ |
95997
|
0 |
2920 |
if( nSize
|
96008
|
2781 |
147 |
if( nToken ){ |
96013
|
375 |
2553 |
if( 0==((p->flags|pNew->flags) & (EP_TokenOnly|EP_Leaf)) ){ |
96015
|
0 |
375 |
if( ExprHasProperty(p, EP_xIsSelect) ){ |
96023
|
8 |
2920 |
if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly) ){ |
96025
|
4 |
4 |
if( !ExprHasProperty(pNew, EP_TokenOnly|EP_Leaf) ){ |
96027
|
4 |
0 |
exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc) : 0; |
96029
|
0 |
4 |
exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc) : 0; |
96031
|
4 |
4 |
if( pzBuffer ){ |
96035
|
371 |
2549 |
if( !ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){ |
96036
|
0 |
371 |
if( pNew->op==TK_SELECT_COLUMN ){ |
96058
|
0 |
0 |
if( p ){ |
96061
|
0 |
0 |
if( pRet ){ |
96064
|
0 |
0 |
for(i=0; inCte; i++){ |
96096
|
2924 |
742 |
return p ? exprDup(db, p, flags, 0) : 0; |
96104
|
186 |
205 |
if( p==0 ) return 0; |
96106
|
0 |
205 |
if( pNew==0 ) return 0; |
96110
|
368 |
205 |
for(i=0; inExpr; i++, pItem++, pOldItem++){ |
96114
|
368 |
0 |
if( pOldExpr |
96115
|
0 |
368 |
&& pOldExpr->op==TK_SELECT_COLUMN |
96116
|
0 |
0 |
&& (pNewExpr = pItem->pExpr)!=0 |
96119
|
0 |
0 |
if( pNewExpr->iColumn==0 ){ |
96154
|
0 |
0 |
if( p==0 ) return 0; |
96155
|
0 |
0 |
nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0); |
96157
|
0 |
0 |
if( pNew==0 ) return 0; |
96159
|
0 |
0 |
for(i=0; inSrc; i++){ |
96171
|
0 |
0 |
if( pNewItem->fg.isIndexedBy ){ |
96175
|
0 |
0 |
if( pNewItem->fg.isTabFunc ){ |
96180
|
0 |
0 |
if( pTab ){ |
96194
|
0 |
0 |
if( p==0 ) return 0; |
96196
|
0 |
0 |
if( pNew==0 ) return 0; |
96199
|
0 |
0 |
if( pNew->a==0 ){ |
96206
|
0 |
0 |
for(i=0; inId; i++){ |
96221
|
0 |
119 |
for(p=pDup; p; p=p->pPrior){ |
96223
|
0 |
0 |
if( pNew==0 ) break; |
96280
|
6999 |
4382 |
if( pList==0 ){ |
96282
|
0 |
6999 |
if( pList==0 ){ |
96286
|
3829 |
553 |
}else if( (pList->nExpr & (pList->nExpr-1))==0 ){ |
96290
|
0 |
3829 |
if( pNew==0 ){ |
96329
|
0 |
0 |
int iFirst = pList ? pList->nExpr : 0; |
96332
|
0 |
0 |
if( NEVER(pColumns==0) ) goto vector_append_error; |
96333
|
0 |
0 |
if( pExpr==0 ) goto vector_append_error; |
96340
|
0 |
0 |
if( pExpr->op!=TK_SELECT && pColumns->nId!=(n=sqlite3ExprVectorSize(pExpr)) ){ |
|
0 |
0 |
if( pExpr->op!=TK_SELECT && pColumns->nId!=(n=sqlite3ExprVectorSize(pExpr)) ){ |
96346
|
0 |
0 |
for(i=0; inId; i++){ |
96349
|
0 |
0 |
if( pList ){ |
96356
|
0 |
0 |
if( !db->mallocFailed && pExpr->op==TK_SELECT && ALWAYS(pList!=0) ){ |
|
0 |
0 |
if( !db->mallocFailed && pExpr->op==TK_SELECT && ALWAYS(pList!=0) ){ |
|
0 |
0 |
if( !db->mallocFailed && pExpr->op==TK_SELECT && ALWAYS(pList!=0) ){ |
96381
|
0 |
740 |
if( p==0 ) return; |
96384
|
690 |
50 |
if( iSortOrder<0 ){ |
96406
|
1978 |
0 |
if( pList ){ |
96412
|
1665 |
313 |
if( dequote ) sqlite3Dequote(pItem->zName); |
96432
|
3087 |
0 |
if( pList ){ |
96452
|
326 |
0 |
if( pEList && pEList->nExpr>mx ){ |
|
0 |
326 |
if( pEList && pEList->nExpr>mx ){ |
96469
|
4545 |
7204 |
}while( --i>0 ); |
96473
|
7204 |
20402 |
if( pList ) exprListDeleteNN(db, pList); |
96484
|
1071 |
621 |
for(i=0; inExpr; i++){ |
96512
|
0 |
0 |
if( sqlite3StrICmp(pExpr->u.zToken, "true")==0 |
96513
|
0 |
0 |
|| sqlite3StrICmp(pExpr->u.zToken, "false")==0 |
96563
|
2684 |
2055 |
if( pWalker->eCode==2 && ExprHasProperty(pExpr, EP_FromJoin) ){ |
|
0 |
2684 |
if( pWalker->eCode==2 && ExprHasProperty(pExpr, EP_FromJoin) ){ |
96573
|
740 |
0 |
if( pWalker->eCode>=4 || ExprHasProperty(pExpr,EP_ConstFunc) ){ |
|
334 |
406 |
if( pWalker->eCode>=4 || ExprHasProperty(pExpr,EP_ConstFunc) ){ |
96582
|
0 |
0 |
if( sqlite3ExprIdToTrueFalse(pExpr) ){ |
96593
|
22 |
1247 |
if( pWalker->eCode==3 && pExpr->iTable==pWalker->u.iCur ){ |
|
22 |
0 |
if( pWalker->eCode==3 && pExpr->iTable==pWalker->u.iCur ){ |
96604
|
0 |
1177 |
if( pWalker->eCode==5 ){ |
96609
|
0 |
1177 |
}else if( pWalker->eCode==4 ){ |
96677
|
10 |
10 |
for(i=0; inExpr; i++){ |
96679
|
0 |
10 |
if( sqlite3ExprCompare(0, pExpr, p, -1)<2 ){ |
96681
|
0 |
0 |
if( sqlite3_stricmp("BINARY", pColl->zName)==0 ){ |
96688
|
0 |
10 |
if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
96766
|
0 |
2008 |
if( p==0 ) return 0; /* Can only happen following on OOM */ |
96773
|
57 |
1951 |
if( p->flags & EP_IntValue ){ |
96784
|
0 |
0 |
if( sqlite3ExprIsInteger(p->pLeft, &v) ){ |
96812
|
0 |
66 |
while( p->op==TK_UPLUS || p->op==TK_UMINUS ){ p = p->pLeft; } |
|
0 |
66 |
while( p->op==TK_UPLUS || p->op==TK_UMINUS ){ p = p->pLeft; } |
96814
|
0 |
66 |
if( op==TK_REGISTER ) op = p->op2; |
96822
|
5 |
0 |
return ExprHasProperty(p, EP_CanBeNull) || |
96823
|
5 |
0 |
p->pTab==0 || /* Reference to column of index on expression */ |
|
3 |
2 |
p->pTab==0 || /* Reference to column of index on expression */ |
96824
|
3 |
0 |
(p->iColumn>=0 && p->pTab->aCol[p->iColumn].notNull==0); |
96842
|
5 |
61 |
if( aff==SQLITE_AFF_BLOB ) return 1; |
96843
|
0 |
61 |
while( p->op==TK_UPLUS || p->op==TK_UMINUS ){ p = p->pLeft; } |
|
0 |
61 |
while( p->op==TK_UPLUS || p->op==TK_UMINUS ){ p = p->pLeft; } |
96845
|
0 |
61 |
if( op==TK_REGISTER ) op = p->op2; |
96848
|
0 |
6 |
return aff==SQLITE_AFF_INTEGER || aff==SQLITE_AFF_NUMERIC; |
|
0 |
0 |
return aff==SQLITE_AFF_INTEGER || aff==SQLITE_AFF_NUMERIC; |
96851
|
0 |
0 |
return aff==SQLITE_AFF_REAL || aff==SQLITE_AFF_NUMERIC; |
|
0 |
0 |
return aff==SQLITE_AFF_REAL || aff==SQLITE_AFF_NUMERIC; |
96862
|
2 |
2 |
&& (aff==SQLITE_AFF_INTEGER || aff==SQLITE_AFF_NUMERIC); |
|
0 |
2 |
&& (aff==SQLITE_AFF_INTEGER || aff==SQLITE_AFF_NUMERIC); |
|
0 |
0 |
&& (aff==SQLITE_AFF_INTEGER || aff==SQLITE_AFF_NUMERIC); |
96874
|
0 |
830 |
if( sqlite3StrICmp(z, "_ROWID_")==0 ) return 1; |
96875
|
820 |
10 |
if( sqlite3StrICmp(z, "ROWID")==0 ) return 1; |
96876
|
0 |
10 |
if( sqlite3StrICmp(z, "OID")==0 ) return 1; |
96894
|
16 |
3 |
if( !ExprHasProperty(pX, EP_xIsSelect) ) return 0; /* Not a subquery */ |
96895
|
0 |
3 |
if( ExprHasProperty(pX, EP_VarSelect) ) return 0; /* Correlated subq */ |
96897
|
0 |
3 |
if( p->pPrior ) return 0; /* Not a compound SELECT */ |
96898
|
0 |
3 |
if( p->selFlags & (SF_Distinct|SF_Aggregate) ){ |
96904
|
0 |
3 |
if( p->pLimit ) return 0; /* Has no LIMIT clause */ |
96905
|
1 |
2 |
if( p->pWhere ) return 0; /* Has no WHERE clause */ |
96908
|
0 |
2 |
if( pSrc->nSrc!=1 ) return 0; /* Single term in FROM clause */ |
96909
|
0 |
2 |
if( pSrc->a[0].pSelect ) return 0; /* FROM is not a subquery or view */ |
96913
|
2 |
0 |
if( IsVirtual(pTab) ) return 0; /* FROM clause not a virtual table */ |
96917
|
0 |
0 |
for(i=0; inExpr; i++){ |
96919
|
0 |
0 |
if( pRes->op!=TK_COLUMN ) return 0; |
97064
|
0 |
19 |
if( prRhsHasNull && (pX->flags & EP_xIsSelect) ){ |
|
0 |
0 |
if( prRhsHasNull && (pX->flags & EP_xIsSelect) ){ |
97067
|
0 |
0 |
for(i=0; inExpr; i++){ |
97068
|
0 |
0 |
if( sqlite3ExprCanBeNull(pEList->a[i].pExpr) ) break; |
97070
|
0 |
0 |
if( i==pEList->nExpr ){ |
97078
|
19 |
0 |
if( pParse->nErr==0 && (p = isCandidateForInOpt(pX))!=0 ){ |
|
0 |
19 |
if( pParse->nErr==0 && (p = isCandidateForInOpt(pX))!=0 ){ |
97096
|
0 |
0 |
if( nExpr==1 && pEList->a[0].pExpr->iColumn<0 ){ |
|
0 |
0 |
if( nExpr==1 && pEList->a[0].pExpr->iColumn<0 ){ |
97114
|
0 |
0 |
for(i=0; i
|
|
0 |
0 |
for(i=0; i
|
97136
|
0 |
0 |
if( affinity_ok ){ |
97138
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx && eType==0; pIdx=pIdx->pNext){ |
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx && eType==0; pIdx=pIdx->pNext){ |
97141
|
0 |
0 |
if( pIdx->nColumn
|
97146
|
0 |
0 |
if( pIdx->nColumn>=BMS-1 ) continue; |
97147
|
0 |
0 |
if( mustBeUnique ){ |
97148
|
0 |
0 |
if( pIdx->nKeyCol>nExpr |
97149
|
0 |
0 |
||(pIdx->nColumn>nExpr && !IsUniqueIndex(pIdx)) |
|
0 |
0 |
||(pIdx->nColumn>nExpr && !IsUniqueIndex(pIdx)) |
97156
|
0 |
0 |
for(i=0; i
|
97163
|
0 |
0 |
for(j=0; j
|
97164
|
0 |
0 |
if( pIdx->aiColumn[j]!=pRhs->iColumn ) continue; |
97166
|
0 |
0 |
if( pReq!=0 && sqlite3StrICmp(pReq->zName, pIdx->azColl[j])!=0 ){ |
|
0 |
0 |
if( pReq!=0 && sqlite3StrICmp(pReq->zName, pIdx->azColl[j])!=0 ){ |
97171
|
0 |
0 |
if( j==nExpr ) break; |
97173
|
0 |
0 |
if( mCol & colUsed ) break; /* Each column used only once */ |
97175
|
0 |
0 |
if( aiMap ) aiMap[i] = j; |
97179
|
0 |
0 |
if( colUsed==(MASKBIT(nExpr)-1) ){ |
97190
|
0 |
0 |
if( prRhsHasNull ){ |
97197
|
0 |
0 |
if( nExpr==1 ){ |
97215
|
19 |
0 |
if( eType==0 |
97216
|
16 |
3 |
&& (inFlags & IN_INDEX_NOOP_OK) |
97217
|
16 |
0 |
&& !ExprHasProperty(pX, EP_xIsSelect) |
97218
|
16 |
0 |
&& (!sqlite3InRhsIsConstant(pX) || pX->x.pList->nExpr<=2) |
|
16 |
0 |
&& (!sqlite3InRhsIsConstant(pX) || pX->x.pList->nExpr<=2) |
97223
|
3 |
16 |
if( eType==0 ){ |
97230
|
3 |
0 |
if( inFlags & IN_INDEX_LOOP ){ |
97232
|
0 |
3 |
if( pX->pLeft->iColumn<0 && !ExprHasProperty(pX, EP_xIsSelect) ){ |
|
0 |
0 |
if( pX->pLeft->iColumn<0 && !ExprHasProperty(pX, EP_xIsSelect) ){ |
97235
|
0 |
0 |
}else if( prRhsHasNull ){ |
97244
|
16 |
3 |
if( aiMap && eType!=IN_INDEX_INDEX_ASC && eType!=IN_INDEX_INDEX_DESC ){ |
|
16 |
0 |
if( aiMap && eType!=IN_INDEX_INDEX_ASC && eType!=IN_INDEX_INDEX_DESC ){ |
|
16 |
0 |
if( aiMap && eType!=IN_INDEX_INDEX_ASC && eType!=IN_INDEX_INDEX_DESC ){ |
97247
|
16 |
16 |
for(i=0; i
|
97265
|
3 |
16 |
Select *pSelect = (pExpr->flags & EP_xIsSelect) ? pExpr->x.pSelect : 0; |
97270
|
19 |
0 |
if( zRet ){ |
97272
|
19 |
19 |
for(i=0; i
|
97275
|
3 |
16 |
if( pSelect ){ |
97313
|
0 |
0 |
if( pExpr->flags & EP_xIsSelect ){ |
97361
|
0 |
21 |
if( NEVER(v==0) ) return 0; |
97374
|
19 |
2 |
if( !ExprHasProperty(pExpr, EP_VarSelect) ){ |
97378
|
3 |
18 |
switch( pExpr->op ){ |
97402
|
3 |
0 |
addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, |
97404
|
3 |
0 |
pKeyInfo = isRowid ? 0 : sqlite3KeyInfoAlloc(pParse->db, nVal, 1); |
97406
|
3 |
0 |
if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
97415
|
3 |
0 |
ExplainQueryPlan((pParse, 1, "%sLIST SUBQUERY", |
97421
|
3 |
0 |
if( ALWAYS(pEList->nExpr==nVal) ){ |
97429
|
0 |
3 |
if( sqlite3Select(pParse, pSelect, &dest) ){ |
97439
|
3 |
3 |
for(i=0; i
|
97446
|
0 |
0 |
}else if( ALWAYS(pExpr->x.pList!=0) ){ |
97460
|
0 |
0 |
if( !affinity ){ |
97463
|
0 |
0 |
if( pKeyInfo ){ |
97471
|
0 |
0 |
if( isRowid ) sqlite3VdbeAddOp4(v, OP_Blob, 0, r2, 0, "", P4_STATIC); |
97472
|
0 |
0 |
for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){ |
97481
|
0 |
0 |
if( jmpIfDynamic>=0 && !sqlite3ExprIsConstant(pE2) ){ |
|
0 |
0 |
if( jmpIfDynamic>=0 && !sqlite3ExprIsConstant(pE2) ){ |
97487
|
0 |
0 |
if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){ |
|
0 |
0 |
if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){ |
97491
|
0 |
0 |
if( isRowid ){ |
97506
|
3 |
0 |
if( pKeyInfo ){ |
97539
|
16 |
2 |
ExplainQueryPlan((pParse, 1, "%sSCALAR SUBQUERY", |
97541
|
18 |
0 |
nReg = pExpr->op==TK_SELECT ? pSel->pEList->nExpr : 1; |
97544
|
18 |
0 |
if( pExpr->op==TK_SELECT ){ |
97556
|
0 |
18 |
if( pSel->pLimit ){ |
97563
|
0 |
18 |
if( sqlite3Select(pParse, pSel, &dest) ){ |
97572
|
0 |
21 |
if( rHasNullFlag ){ |
97576
|
19 |
2 |
if( jmpIfDynamic>=0 ){ |
97594
|
3 |
32 |
if( (pIn->flags & EP_xIsSelect) ){ |
97595
|
0 |
3 |
if( nVector!=pIn->x.pSelect->pEList->nExpr ){ |
97599
|
0 |
32 |
}else if( nVector!=1 ){ |
97657
|
0 |
16 |
if( sqlite3ExprCheckIN(pParse, pExpr) ) return; |
97663
|
0 |
16 |
if( pParse->db->mallocFailed ) goto sqlite3ExprCodeIN_oom_error; |
97672
|
0 |
16 |
eType = sqlite3FindInIndex(pParse, pExpr, |
97700
|
16 |
16 |
for(i=0; i
|
|
16 |
0 |
for(i=0; i
|
97701
|
16 |
0 |
if( i==nVector ){ |
97707
|
0 |
0 |
for(i=0; i
|
97718
|
16 |
0 |
if( eType==IN_INDEX_NOOP ){ |
97726
|
0 |
16 |
if( destIfNull!=destIfFalse ){ |
97730
|
32 |
16 |
for(ii=0; iinExpr; ii++){ |
97732
|
0 |
32 |
if( regCkNull && sqlite3ExprCanBeNull(pList->a[ii].pExpr) ){ |
|
0 |
0 |
if( regCkNull && sqlite3ExprCanBeNull(pList->a[ii].pExpr) ){ |
97735
|
16 |
16 |
if( iinExpr-1 || destIfNull!=destIfFalse ){ |
|
0 |
16 |
if( iinExpr-1 || destIfNull!=destIfFalse ){ |
97749
|
0 |
16 |
if( regCkNull ){ |
97762
|
0 |
0 |
if( destIfNull==destIfFalse ){ |
97767
|
0 |
0 |
for(i=0; i
|
97769
|
0 |
0 |
if( sqlite3ExprCanBeNull(p) ){ |
97779
|
0 |
0 |
if( eType==IN_INDEX_ROWID ){ |
97788
|
0 |
0 |
if( destIfFalse==destIfNull ){ |
97802
|
0 |
0 |
if( rRhsHasNull && nVector==1 ){ |
|
0 |
0 |
if( rRhsHasNull && nVector==1 ){ |
97810
|
0 |
0 |
if( destIfFalse==destIfNull ) sqlite3VdbeGoto(v, destIfFalse); |
97819
|
0 |
0 |
if( destStep6 ) sqlite3VdbeResolveLabel(v, destStep6); |
97822
|
0 |
0 |
if( nVector>1 ){ |
97829
|
0 |
0 |
for(i=0; i
|
97842
|
0 |
0 |
if( nVector>1 ){ |
97856
|
0 |
16 |
if( rLhs!=rLhsOrig ) sqlite3ReleaseTempReg(pParse, rLhs); |
97875
|
2166 |
0 |
if( ALWAYS(z!=0) ){ |
97879
|
0 |
2166 |
if( negateFlag ) value = -value; |
97894
|
510 |
12 |
if( pExpr->flags & EP_IntValue ){ |
97897
|
1 |
509 |
if( negFlag ) i = -i; |
97905
|
0 |
12 |
if( (c==3 && !negFlag) || (c==2) || (negFlag && value==SMALLEST_INT64)){ |
|
0 |
0 |
if( (c==3 && !negFlag) || (c==2) || (negFlag && value==SMALLEST_INT64)){ |
|
12 |
0 |
if( (c==3 && !negFlag) || (c==2) || (negFlag && value==SMALLEST_INT64)){ |
|
0 |
12 |
if( (c==3 && !negFlag) || (c==2) || (negFlag && value==SMALLEST_INT64)){ |
|
0 |
0 |
if( (c==3 && !negFlag) || (c==2) || (negFlag && value==SMALLEST_INT64)){ |
97910
|
0 |
0 |
if( sqlite3_strnicmp(z,"0x",2)==0 ){ |
97911
|
0 |
0 |
sqlite3ErrorMsg(pParse, "hex literal too big: %s%s", negFlag?"-":"",z); |
97919
|
0 |
12 |
if( negFlag ){ value = c==3 ? SMALLEST_INT64 : -value; } |
|
0 |
0 |
if( negFlag ){ value = c==3 ? SMALLEST_INT64 : -value; } |
97929
|
5 |
2267 |
if( pParse->aColCache[i].tempReg ){ |
97930
|
5 |
0 |
if( pParse->nTempRegaTempReg) ){ |
97935
|
1057 |
1215 |
if( inColCache ){ |
97959
|
0 |
3824 |
if( OptimizationDisabled(pParse->db, SQLITE_ColumnCache) ) return; |
97973
|
0 |
3824 |
if( pParse->nColCache>=SQLITE_N_COLCACHE ){ |
97976
|
0 |
0 |
for(i=0, p=pParse->aColCache; i
|
97977
|
0 |
0 |
if( p->lru
|
98002
|
3063 |
5366 |
while( inColCache ){ |
98004
|
2179 |
884 |
if( p->iReg >= iReg && p->iReg < iReg+nReg ){ |
|
2099 |
80 |
if( p->iReg >= iReg && p->iReg < iReg+nReg ){ |
98040
|
206 |
775 |
while( inColCache ){ |
98041
|
173 |
33 |
if( pParse->aColCache[i].iLevel>pParse->iCacheLevel ){ |
98058
|
346 |
229 |
for(i=0, p=pParse->aColCache; inColCache; i++, p++){ |
98059
|
229 |
117 |
if( p->iReg==iReg ){ |
98076
|
0 |
14 |
if( iTabCol==XN_EXPR ){ |
98098
|
0 |
3330 |
if( pTab==0 ){ |
98102
|
3245 |
85 |
if( iCol<0 || iCol==pTab->iPKey ){ |
|
2 |
3243 |
if( iCol<0 || iCol==pTab->iPKey ){ |
98105
|
177 |
3066 |
int op = IsVirtual(pTab) ? OP_VColumn : OP_Column; |
98107
|
0 |
3243 |
if( !HasRowid(pTab) && !IsVirtual(pTab) ){ |
|
0 |
0 |
if( !HasRowid(pTab) && !IsVirtual(pTab) ){ |
98112
|
3245 |
85 |
if( iCol>=0 ){ |
98141
|
4338 |
3312 |
for(i=0, p=pParse->aColCache; inColCache; i++, p++){ |
98142
|
4317 |
21 |
if( p->iTable==iTable && p->iColumn==iColumn ){ |
|
229 |
4088 |
if( p->iTable==iTable && p->iColumn==iColumn ){ |
98150
|
16 |
3296 |
if( p5 ){ |
98165
|
3 |
25 |
if( r1!=iReg ) sqlite3VdbeAddOp2(pParse->pVdbe, OP_SCopy, r1, iReg); |
98180
|
1552 |
4101 |
for(i=0; inColCache; i++){ |
98181
|
615 |
937 |
if( pParse->aColCache[i].tempReg |
98182
|
615 |
0 |
&& pParse->nTempRegaTempReg) |
98253
|
16 |
0 |
if( nResult==1 ){ |
98257
|
0 |
0 |
if( p->op==TK_SELECT ){ |
98267
|
0 |
0 |
for(i=0; i
|
98298
|
0 |
11055 |
if( v==0 ){ |
98304
|
64 |
11031 |
if( pExpr==0 ){ |
98313
|
8 |
60 |
if( !pAggInfo->directMode ){ |
98316
|
10 |
50 |
}else if( pAggInfo->useSortingIdx ){ |
98325
|
0 |
3475 |
if( iTab<0 ){ |
98326
|
0 |
0 |
if( pParse->iSelfTab<0 ){ |
98384
|
31 |
1200 |
if( pExpr->u.zToken[1]!=0 ){ |
98399
|
0 |
1 |
if( inReg!=target ){ |
98412
|
0 |
0 |
op = (op==TK_IS) ? TK_EQ : TK_NE; |
98422
|
0 |
0 |
if( sqlite3ExprIsVector(pLeft) ){ |
98473
|
1 |
0 |
if( pLeft->op==TK_INTEGER ){ |
98477
|
0 |
0 |
}else if( pLeft->op==TK_FLOAT ){ |
98531
|
0 |
135 |
if( pInfo==0 ){ |
98550
|
548 |
96 |
if( ConstFactorOk(pParse) && sqlite3ExprIsConstantNotJoin(pExpr) ){ |
|
49 |
499 |
if( ConstFactorOk(pParse) && sqlite3ExprIsConstantNotJoin(pExpr) ){ |
98556
|
0 |
595 |
if( ExprHasProperty(pExpr, EP_TokenOnly) ){ |
98561
|
577 |
18 |
nFarg = pFarg ? pFarg->nExpr : 0; |
98570
|
595 |
0 |
if( pDef==0 || pDef->xFinalize!=0 ){ |
|
0 |
595 |
if( pDef==0 || pDef->xFinalize!=0 ){ |
98579
|
8 |
587 |
if( pDef->funcFlags & SQLITE_FUNC_COALESCE ){ |
98583
|
8 |
8 |
for(i=1; i
|
98598
|
0 |
587 |
if( pDef->funcFlags & SQLITE_FUNC_UNLIKELY ){ |
98619
|
1017 |
587 |
for(i=0; i
|
98620
|
1017 |
0 |
if( i<32 && sqlite3ExprIsConstant(pFarg->a[i].pExpr) ){ |
|
846 |
171 |
if( i<32 && sqlite3ExprIsConstant(pFarg->a[i].pExpr) ){ |
98624
|
0 |
1017 |
if( (pDef->funcFlags & SQLITE_FUNC_NEEDCOLL)!=0 && !pColl ){ |
|
0 |
0 |
if( (pDef->funcFlags & SQLITE_FUNC_NEEDCOLL)!=0 && !pColl ){ |
98628
|
569 |
18 |
if( pFarg ){ |
98629
|
502 |
67 |
if( constMask ){ |
98641
|
22 |
547 |
if( (pDef->funcFlags & (SQLITE_FUNC_LENGTH|SQLITE_FUNC_TYPEOF))!=0 ){ |
98646
|
6 |
16 |
if( exprOp==TK_COLUMN || exprOp==TK_AGG_COLUMN ){ |
|
0 |
6 |
if( exprOp==TK_COLUMN || exprOp==TK_AGG_COLUMN ){ |
98675
|
433 |
154 |
if( nFarg>=2 && (pExpr->flags & EP_InfixFunc) ){ |
|
142 |
291 |
if( nFarg>=2 && (pExpr->flags & EP_InfixFunc) ){ |
98677
|
427 |
18 |
}else if( nFarg>0 ){ |
98681
|
0 |
587 |
if( pDef->funcFlags & SQLITE_FUNC_NEEDCOLL ){ |
98682
|
0 |
0 |
if( !pColl ) pColl = db->pDfltColl; |
98696
|
0 |
587 |
sqlite3VdbeAddOp4(v, pParse->iSelfTab ? OP_PureFunc0 : OP_Function0, |
98700
|
569 |
18 |
if( nFarg && constMask==0 ){ |
|
67 |
502 |
if( nFarg && constMask==0 ){ |
98711
|
18 |
0 |
if( op==TK_SELECT && (nCol = pExpr->x.pSelect->pEList->nExpr)!=1 ){ |
|
0 |
18 |
if( op==TK_SELECT && (nCol = pExpr->x.pSelect->pEList->nExpr)!=1 ){ |
98720
|
0 |
0 |
if( pExpr->pLeft->iTable==0 ){ |
98724
|
0 |
0 |
if( pExpr->iTable |
98725
|
0 |
0 |
&& pExpr->iTable!=(n = sqlite3ExprVectorSize(pExpr->pLeft)) |
98814
|
0 |
0 |
if( pExpr->iColumn>=0 |
98815
|
0 |
0 |
&& pTab->aCol[pExpr->iColumn].affinity==SQLITE_AFF_REAL |
98878
|
0 |
0 |
if( (pX = pExpr->pLeft)!=0 ){ |
98893
|
0 |
0 |
for(i=0; i
|
98895
|
0 |
0 |
if( pX ){ |
98910
|
0 |
0 |
if( (nExpr&1)!=0 ){ |
98929
|
0 |
0 |
if( !pParse->pTriggerTab ){ |
98934
|
0 |
0 |
if( pExpr->affinity==OE_Abort ){ |
98938
|
0 |
0 |
if( pExpr->affinity==OE_Ignore ){ |
98973
|
828 |
744 |
if( regDest<0 && p ){ |
|
330 |
498 |
if( regDest<0 && p ){ |
98976
|
475 |
299 |
for(pItem=p->a, i=p->nExpr; i>0; pItem++, i--){ |
98977
|
373 |
102 |
if( pItem->reusable && sqlite3ExprCompare(0,pItem->pExpr,pExpr,-1)==0 ){ |
|
31 |
342 |
if( pItem->reusable && sqlite3ExprCompare(0,pItem->pExpr,pExpr,-1)==0 ){ |
98984
|
1541 |
0 |
if( p ){ |
98987
|
797 |
744 |
if( regDest<0 ) regDest = ++pParse->nMem; |
99010
|
1622 |
4 |
if( ConstFactorOk(pParse) |
99011
|
1612 |
10 |
&& pExpr->op!=TK_REGISTER |
99012
|
779 |
833 |
&& sqlite3ExprIsConstantNotJoin(pExpr) |
99019
|
809 |
38 |
if( r2==r1 ){ |
99038
|
6097 |
64 |
if( pExpr && pExpr->op==TK_REGISTER ){ |
|
278 |
5819 |
if( pExpr && pExpr->op==TK_REGISTER ){ |
99043
|
2 |
5881 |
if( inReg!=target && pParse->pVdbe ){ |
|
2 |
0 |
if( inReg!=target && pParse->pVdbe ){ |
99057
|
0 |
0 |
if( !db->mallocFailed ) sqlite3ExprCode(pParse, pExpr, target); |
99068
|
55 |
0 |
if( pParse->okConstFactor && sqlite3ExprIsConstant(pExpr) ){ |
|
55 |
0 |
if( pParse->okConstFactor && sqlite3ExprIsConstant(pExpr) ){ |
99128
|
2483 |
22 |
u8 copyOp = (flags & SQLITE_ECEL_DUP) ? OP_Copy : OP_SCopy; |
99134
|
90 |
2415 |
if( !ConstFactorOk(pParse) ) flags &= ~SQLITE_ECEL_FACTOR; |
99135
|
4582 |
2505 |
for(pItem=pList->a, i=0; i
|
99143
|
275 |
4307 |
if( (flags & SQLITE_ECEL_REF)!=0 && (j = pItem->u.x.iOrderByCol)>0 ){ |
|
117 |
158 |
if( (flags & SQLITE_ECEL_REF)!=0 && (j = pItem->u.x.iOrderByCol)>0 ){ |
99144
|
117 |
0 |
if( flags & SQLITE_ECEL_OMITREF ){ |
99150
|
860 |
3605 |
}else if( (flags & SQLITE_ECEL_FACTOR)!=0 && sqlite3ExprIsConstant(pExpr) ){ |
|
689 |
171 |
}else if( (flags & SQLITE_ECEL_FACTOR)!=0 && sqlite3ExprIsConstant(pExpr) ){ |
99154
|
392 |
3384 |
if( inReg!=target+i ){ |
99156
|
392 |
0 |
if( copyOp==OP_Copy |
99157
|
2 |
390 |
&& (pOp=sqlite3VdbeGetOp(v, -1))->opcode==OP_Copy |
99158
|
1 |
1 |
&& pOp->p1+pOp->p3+1==inReg |
99159
|
1 |
0 |
&& pOp->p2+pOp->p3+1==target+i |
99221
|
0 |
0 |
if( xJump ){ |
99268
|
0 |
18 |
if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */ |
99269
|
0 |
18 |
if( NEVER(pExpr==0) ) return; /* No way this can happen */ |
99303
|
0 |
0 |
if( isTrue ^ isNot ){ |
99304
|
0 |
0 |
sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, |
99307
|
0 |
0 |
sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, |
99316
|
0 |
0 |
op = (op==TK_IS) ? TK_EQ : TK_NE; |
99325
|
0 |
2 |
if( sqlite3ExprIsVector(pExpr->pLeft) ) goto default_expr; |
99364
|
0 |
0 |
int destIfNull = jumpIfNull ? dest : destIfFalse; |
99373
|
0 |
12 |
if( exprAlwaysTrue(pExpr) ){ |
99375
|
12 |
0 |
}else if( exprAlwaysFalse(pExpr) ){ |
99408
|
0 |
1004 |
if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */ |
99409
|
130 |
874 |
if( pExpr==0 ) return; |
99474
|
0 |
0 |
if( isTrue ^ isNot ){ |
99476
|
0 |
0 |
sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, |
99481
|
0 |
0 |
sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, |
99490
|
1 |
2 |
op = (pExpr->op==TK_IS) ? TK_NE : TK_EQ; |
99499
|
0 |
684 |
if( sqlite3ExprIsVector(pExpr->pLeft) ) goto default_expr; |
99535
|
16 |
0 |
if( jumpIfNull ){ |
99547
|
0 |
139 |
if( exprAlwaysFalse(pExpr) ){ |
99549
|
139 |
0 |
}else if( exprAlwaysTrue(pExpr) ){ |
99573
|
0 |
0 |
if( db->mallocFailed==0 ){ |
99598
|
0 |
0 |
if( pR ){ |
99602
|
0 |
0 |
if( pL ){ |
99603
|
0 |
0 |
if( sqlite3_value_type(pL)==SQLITE_TEXT ){ |
99646
|
2023 |
3290 |
if( pA==0 || pB==0 ){ |
|
0 |
2023 |
if( pA==0 || pB==0 ){ |
99647
|
3290 |
0 |
return pB==pA ? 0 : 2; |
99649
|
0 |
2023 |
if( pParse && pA->op==TK_VARIABLE && exprCompareVariable(pParse, pA, pB) ){ |
|
0 |
0 |
if( pParse && pA->op==TK_VARIABLE && exprCompareVariable(pParse, pA, pB) ){ |
|
0 |
0 |
if( pParse && pA->op==TK_VARIABLE && exprCompareVariable(pParse, pA, pB) ){ |
99653
|
0 |
2023 |
if( combinedFlags & EP_IntValue ){ |
99654
|
0 |
0 |
if( (pA->flags&pB->flags&EP_IntValue)!=0 && pA->u.iValue==pB->u.iValue ){ |
|
0 |
0 |
if( (pA->flags&pB->flags&EP_IntValue)!=0 && pA->u.iValue==pB->u.iValue ){ |
99659
|
66 |
1957 |
if( pA->op!=pB->op ){ |
99660
|
16 |
50 |
if( pA->op==TK_COLLATE && sqlite3ExprCompare(pParse, pA->pLeft,pB,iTab)<2 ){ |
|
16 |
0 |
if( pA->op==TK_COLLATE && sqlite3ExprCompare(pParse, pA->pLeft,pB,iTab)<2 ){ |
99663
|
0 |
50 |
if( pB->op==TK_COLLATE && sqlite3ExprCompare(pParse, pA,pB->pLeft,iTab)<2 ){ |
|
0 |
0 |
if( pB->op==TK_COLLATE && sqlite3ExprCompare(pParse, pA,pB->pLeft,iTab)<2 ){ |
99668
|
436 |
1521 |
if( pA->op!=TK_COLUMN && pA->op!=TK_AGG_COLUMN && pA->u.zToken ){ |
|
436 |
0 |
if( pA->op!=TK_COLUMN && pA->op!=TK_AGG_COLUMN && pA->u.zToken ){ |
|
436 |
0 |
if( pA->op!=TK_COLUMN && pA->op!=TK_AGG_COLUMN && pA->u.zToken ){ |
99669
|
54 |
382 |
if( pA->op==TK_FUNCTION ){ |
99670
|
0 |
54 |
if( sqlite3StrICmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2; |
99671
|
0 |
382 |
}else if( pA->op==TK_COLLATE ){ |
99672
|
0 |
0 |
if( sqlite3_stricmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2; |
99673
|
312 |
70 |
}else if( strcmp(pA->u.zToken,pB->u.zToken)!=0 ){ |
99677
|
0 |
1645 |
if( (pA->flags & EP_Distinct)!=(pB->flags & EP_Distinct) ) return 2; |
99678
|
1645 |
0 |
if( ALWAYS((combinedFlags & EP_TokenOnly)==0) ){ |
99679
|
0 |
1645 |
if( combinedFlags & EP_xIsSelect ) return 2; |
99680
|
0 |
1645 |
if( sqlite3ExprCompare(pParse, pA->pLeft, pB->pLeft, iTab) ) return 2; |
99681
|
0 |
1645 |
if( sqlite3ExprCompare(pParse, pA->pRight, pB->pRight, iTab) ) return 2; |
99682
|
48 |
1597 |
if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList, iTab) ) return 2; |
99684
|
1530 |
67 |
if( pA->op!=TK_STRING && pA->op!=TK_TRUEFALSE ){ |
|
1530 |
0 |
if( pA->op!=TK_STRING && pA->op!=TK_TRUEFALSE ){ |
99685
|
1433 |
97 |
if( pA->iColumn!=pB->iColumn ) return 2; |
99686
|
2 |
95 |
if( pA->iTable!=pB->iTable |
99687
|
0 |
2 |
&& (pA->iTable!=iTab || NEVER(pB->iTable>=0)) ) return 2; |
|
0 |
0 |
&& (pA->iTable!=iTab || NEVER(pB->iTable>=0)) ) return 2; |
99710
|
1714 |
68 |
if( pA==0 && pB==0 ) return 0; |
|
1712 |
2 |
if( pA==0 && pB==0 ) return 0; |
99711
|
68 |
2 |
if( pA==0 || pB==0 ) return 1; |
|
11 |
57 |
if( pA==0 || pB==0 ) return 1; |
99712
|
0 |
57 |
if( pA->nExpr!=pB->nExpr ) return 1; |
99713
|
93 |
7 |
for(i=0; inExpr; i++){ |
99716
|
1 |
92 |
if( pA->a[i].sortOrder!=pB->a[i].sortOrder ) return 1; |
99717
|
49 |
43 |
if( sqlite3ExprCompare(0, pExprA, pExprB, iTab) ) return 1; |
99759
|
0 |
0 |
if( sqlite3ExprCompare(pParse, pE1, pE2, iTab)==0 ){ |
99762
|
0 |
0 |
if( pE2->op==TK_OR |
99763
|
0 |
0 |
&& (sqlite3ExprImpliesExpr(pParse, pE1, pE2->pLeft, iTab) |
99764
|
0 |
0 |
|| sqlite3ExprImpliesExpr(pParse, pE1, pE2->pRight, iTab) ) |
99768
|
0 |
0 |
if( pE2->op==TK_NOTNULL && pE1->op!=TK_ISNULL && pE1->op!=TK_IS ){ |
|
0 |
0 |
if( pE2->op==TK_NOTNULL && pE1->op!=TK_ISNULL && pE1->op!=TK_IS ){ |
|
0 |
0 |
if( pE2->op==TK_NOTNULL && pE1->op!=TK_ISNULL && pE1->op!=TK_IS ){ |
99771
|
0 |
0 |
if( sqlite3ExprCompare(pParse, pX, pE2->pLeft, iTab)==0 ) return 1; |
99791
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_FromJoin) ) return WRC_Prune; |
99811
|
0 |
0 |
if( pWalker->u.iCur==pExpr->iTable ){ |
99832
|
0 |
0 |
if( (pExpr->pLeft->op==TK_COLUMN && IsVirtual(pExpr->pLeft->pTab)) |
|
0 |
0 |
if( (pExpr->pLeft->op==TK_COLUMN && IsVirtual(pExpr->pLeft->pTab)) |
99833
|
0 |
0 |
|| (pExpr->pRight->op==TK_COLUMN && IsVirtual(pExpr->pRight->pTab)) |
|
0 |
0 |
|| (pExpr->pRight->op==TK_COLUMN && IsVirtual(pExpr->pRight->pTab)) |
99893
|
52 |
120 |
if( pExpr->op==TK_COLUMN |
99894
|
52 |
0 |
&& pExpr->iTable==pWalker->u.pIdxCover->iCur |
99895
|
0 |
52 |
&& sqlite3ColumnOfIndex(pWalker->u.pIdxCover->pIdx, pExpr->iColumn)<0 |
99951
|
0 |
52 |
if( pExpr->op==TK_COLUMN || NEVER(pExpr->op==TK_AGG_COLUMN) ){ |
|
0 |
0 |
if( pExpr->op==TK_COLUMN || NEVER(pExpr->op==TK_AGG_COLUMN) ){ |
99955
|
52 |
0 |
int nSrc = pSrc ? pSrc->nSrc : 0; |
99956
|
52 |
0 |
for(i=0; i
|
99957
|
52 |
0 |
if( pExpr->iTable==pSrc->a[i].iCursor ) break; |
99959
|
52 |
0 |
if( i
|
99985
|
83 |
52 |
return cnt.nThis>0 || cnt.nOther==0; |
|
83 |
0 |
return cnt.nThis>0 || cnt.nOther==0; |
100040
|
61 |
0 |
if( ALWAYS(pSrcList!=0) ){ |
100042
|
62 |
0 |
for(i=0; inSrc; i++, pItem++){ |
100045
|
61 |
1 |
if( pExpr->iTable==pItem->iCursor ){ |
100054
|
5 |
60 |
for(k=0; knColumn; k++, pCol++){ |
100055
|
3 |
2 |
if( pCol->iTable==pExpr->iTable && |
|
1 |
2 |
if( pCol->iTable==pExpr->iTable && |
100060
|
60 |
1 |
if( (k>=pAggInfo->nColumn) |
100061
|
60 |
0 |
&& (k = addAggInfoColumn(pParse->db, pAggInfo))>=0 |
100070
|
10 |
50 |
if( pAggInfo->pGroupBy ){ |
100075
|
10 |
3 |
for(j=0; j
|
100077
|
10 |
0 |
if( pE->op==TK_COLUMN && pE->iTable==pExpr->iTable && |
|
9 |
1 |
if( pE->op==TK_COLUMN && pE->iTable==pExpr->iTable && |
|
7 |
2 |
if( pE->op==TK_COLUMN && pE->iTable==pExpr->iTable && |
100084
|
53 |
7 |
if( pCol->iSorterColumn<0 ){ |
100104
|
136 |
0 |
if( (pNC->ncFlags & NC_InAggFunc)==0 |
100105
|
136 |
0 |
&& pWalker->walkerDepth==pExpr->op2 |
100111
|
1 |
135 |
for(i=0; inFunc; i++, pItem++){ |
100112
|
1 |
0 |
if( sqlite3ExprCompare(0, pItem->pExpr, pExpr, -1)==0 ){ |
100116
|
135 |
1 |
if( i>=pAggInfo->nFunc ){ |
100121
|
135 |
0 |
if( i>=0 ){ |
100127
|
52 |
83 |
pItem->pFunc = sqlite3FindFunction(pParse->db, |
100130
|
0 |
135 |
if( pExpr->flags & EP_Distinct ){ |
100190
|
189 |
216 |
if( pList ){ |
100191
|
192 |
189 |
for(pItem=pList->a, i=0; inExpr; i++, pItem++){ |
100201
|
3554 |
424 |
if( pParse->nTempReg==0 ){ |
100216
|
1297 |
1091 |
if( iReg && pParse->nTempRegaTempReg) ){ |
|
1297 |
0 |
if( iReg && pParse->nTempRegaTempReg) ){ |
100219
|
1028 |
601 |
for(i=0, p=pParse->aColCache; inColCache; i++, p++){ |
100220
|
696 |
332 |
if( p->iReg==iReg ){ |
100234
|
156 |
139 |
if( nReg==1 ) return sqlite3GetTempReg(pParse); |
100237
|
1 |
138 |
if( nReg<=n ){ |
100248
|
156 |
88 |
if( nReg==1 ){ |
100253
|
14 |
74 |
if( nReg>pParse->nRangeReg ){ |
100350
|
0 |
0 |
if( zSql ){ |
100352
|
0 |
0 |
if( !*zCsr ){ |
100367
|
0 |
0 |
} while( token==TK_SPACE ); |
100369
|
0 |
0 |
} while( token!=TK_LP && token!=TK_USING ); |
|
0 |
0 |
} while( token!=TK_LP && token!=TK_USING ); |
100410
|
0 |
0 |
if( zInput==0 || zOld==0 ) return; |
|
0 |
0 |
if( zInput==0 || zOld==0 ) return; |
100411
|
0 |
0 |
for(z=zInput; *z; z=z+n){ |
100413
|
0 |
0 |
if( token==TK_REFERENCES ){ |
100418
|
0 |
0 |
}while( token==TK_SPACE ); |
100420
|
0 |
0 |
if( token==TK_ILLEGAL ) break; |
100422
|
0 |
0 |
if( zParent==0 ) break; |
100424
|
0 |
0 |
if( 0==sqlite3StrICmp((const char *)zOld, zParent) ){ |
100425
|
0 |
0 |
char *zOut = sqlite3MPrintf(db, "%s%.*s\"%w\"", |
100436
|
0 |
0 |
zResult = sqlite3MPrintf(db, "%s%s", (zOutput?zOutput:""), zInput), |
100473
|
0 |
0 |
if( zSql ){ |
100476
|
0 |
0 |
if( !*zCsr ){ |
100491
|
0 |
0 |
}while( token==TK_SPACE ); |
100504
|
0 |
0 |
if( token==TK_DOT || token==TK_ON ){ |
|
0 |
0 |
if( token==TK_DOT || token==TK_ON ){ |
100507
|
0 |
0 |
} while( dist!=2 || (token!=TK_WHEN && token!=TK_FOR && token!=TK_BEGIN) ); |
|
0 |
0 |
} while( dist!=2 || (token!=TK_WHEN && token!=TK_FOR && token!=TK_BEGIN) ); |
|
0 |
0 |
} while( dist!=2 || (token!=TK_WHEN && token!=TK_FOR && token!=TK_BEGIN) ); |
|
0 |
0 |
} while( dist!=2 || (token!=TK_WHEN && token!=TK_FOR && token!=TK_BEGIN) ); |
100553
|
0 |
0 |
if( !zWhere ){ |
100572
|
0 |
0 |
for(p=sqlite3FkReferences(pTab); p; p=p->pNextTo){ |
100595
|
0 |
0 |
if( pTab->pSchema!=pTempSchema ){ |
100597
|
0 |
0 |
for(pTrig=sqlite3TriggerList(pParse, pTab); pTrig; pTrig=pTrig->pNext){ |
100598
|
0 |
0 |
if( pTrig->pSchema==pTempSchema ){ |
100603
|
0 |
0 |
if( zWhere ){ |
100628
|
0 |
0 |
if( NEVER(v==0) ) return; |
100635
|
0 |
0 |
for(pTrig=sqlite3TriggerList(pParse, pTab); pTrig; pTrig=pTrig->pNext){ |
100647
|
0 |
0 |
if( !zWhere ) return; |
100654
|
0 |
0 |
if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){ |
100669
|
0 |
0 |
if( 0==sqlite3StrNICmp(zName, "sqlite_", 7) ){ |
100700
|
0 |
0 |
if( NEVER(db->mallocFailed) ) goto exit_rename_table; |
100705
|
0 |
0 |
if( !pTab ) goto exit_rename_table; |
100712
|
0 |
0 |
if( !zName ) goto exit_rename_table; |
100717
|
0 |
0 |
if( sqlite3FindTable(db, zName, zDb) || sqlite3FindIndex(db, zName, zDb) ){ |
|
0 |
0 |
if( sqlite3FindTable(db, zName, zDb) || sqlite3FindIndex(db, zName, zDb) ){ |
100726
|
0 |
0 |
if( SQLITE_OK!=isSystemTable(pParse, pTab->zName) ){ |
100729
|
0 |
0 |
if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ goto |
100734
|
0 |
0 |
if( pTab->pSelect ){ |
100742
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){ |
100748
|
0 |
0 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ){ |
100751
|
0 |
0 |
if( IsVirtual(pTab) ){ |
100753
|
0 |
0 |
if( pVTab->pVtab->pModule->xRename==0 ){ |
100765
|
0 |
0 |
if( v==0 ){ |
100777
|
0 |
0 |
if( pVTab ){ |
100790
|
0 |
0 |
if( db->flags&SQLITE_ForeignKeys ){ |
100794
|
0 |
0 |
if( (zWhere=whereForeignKeys(pParse, pTab))!=0 ){ |
100833
|
0 |
0 |
if( sqlite3FindTable(db, "sqlite_sequence", zDb) ){ |
100845
|
0 |
0 |
if( (zWhere=whereTempTriggers(pParse, pTab))!=0 ){ |
100856
|
0 |
0 |
if( db->flags&SQLITE_ForeignKeys ){ |
100858
|
0 |
0 |
for(p=sqlite3FkReferences(pTab); p; p=p->pNextTo){ |
100860
|
0 |
0 |
if( pFrom!=pTab ){ |
100898
|
0 |
0 |
if( pParse->nErr || db->mallocFailed ) return; |
|
0 |
0 |
if( pParse->nErr || db->mallocFailed ) return; |
100914
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){ |
100924
|
0 |
0 |
if( pDflt && pDflt->pLeft->op==TK_NULL ){ |
|
0 |
0 |
if( pDflt && pDflt->pLeft->op==TK_NULL ){ |
100932
|
0 |
0 |
if( pCol->colFlags & COLFLAG_PRIMKEY ){ |
100936
|
0 |
0 |
if( pNew->pIndex ){ |
100940
|
0 |
0 |
if( (db->flags&SQLITE_ForeignKeys) && pNew->pFKey && pDflt ){ |
|
0 |
0 |
if( (db->flags&SQLITE_ForeignKeys) && pNew->pFKey && pDflt ){ |
|
0 |
0 |
if( (db->flags&SQLITE_ForeignKeys) && pNew->pFKey && pDflt ){ |
100945
|
0 |
0 |
if( pCol->notNull && !pDflt ){ |
|
0 |
0 |
if( pCol->notNull && !pDflt ){ |
100954
|
0 |
0 |
if( pDflt ){ |
100959
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
100963
|
0 |
0 |
if( !pVal ){ |
100972
|
0 |
0 |
if( zCol ){ |
100975
|
0 |
0 |
while( zEnd>zCol && (*zEnd==';' || sqlite3Isspace(*zEnd)) ){ |
|
0 |
0 |
while( zEnd>zCol && (*zEnd==';' || sqlite3Isspace(*zEnd)) ){ |
|
0 |
0 |
while( zEnd>zCol && (*zEnd==';' || sqlite3Isspace(*zEnd)) ){ |
101034
|
0 |
0 |
if( db->mallocFailed ) goto exit_begin_add_column; |
101036
|
0 |
0 |
if( !pTab ) goto exit_begin_add_column; |
101039
|
0 |
0 |
if( IsVirtual(pTab) ){ |
101046
|
0 |
0 |
if( pTab->pSelect ){ |
101050
|
0 |
0 |
if( SQLITE_OK!=isSystemTable(pParse, pTab->zName) ){ |
101065
|
0 |
0 |
if( !pNew ) goto exit_begin_add_column; |
101074
|
0 |
0 |
if( !pNew->aCol || !pNew->zName ){ |
|
0 |
0 |
if( !pNew->aCol || !pNew->zName ){ |
101079
|
0 |
0 |
for(i=0; inCol; i++){ |
101092
|
0 |
0 |
if( !v ) goto exit_begin_add_column; |
101304
|
0 |
1 |
if( v==0 ) return; |
101312
|
3 |
1 |
for(i=0; i
|
101315
|
3 |
0 |
if( (pStat = sqlite3FindTable(db, zTab, pDb->zDbSName))==0 ){ |
101316
|
1 |
2 |
if( aTable[i].zCols ){ |
101334
|
0 |
0 |
if( zWhere ){ |
101351
|
1 |
1 |
for(i=0; aTable[i].zCols; i++){ |
101537
|
0 |
0 |
if( p==0 ){ |
101846
|
0 |
0 |
if( p->nRow==0 ){ |
101848
|
0 |
0 |
for(i=0; inCol; i++) p->current.anEq[i] = 1; |
101855
|
0 |
0 |
for(i=0; i
|
101858
|
0 |
0 |
for(i=iChng; inCol; i++){ |
101979
|
0 |
0 |
if( zRet==0 ){ |
101986
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
102113
|
2 |
0 |
if( v==0 || NEVER(pTab==0) ){ |
|
0 |
2 |
if( v==0 || NEVER(pTab==0) ){ |
102116
|
0 |
2 |
if( pTab->tnum==0 ){ |
102120
|
1 |
1 |
if( sqlite3_strlike("sqlite\\_%", pTab->zName, '\\')==0 ){ |
102129
|
0 |
1 |
if( sqlite3AuthCheck(pParse, SQLITE_ANALYZE, pTab->zName, 0, |
102158
|
0 |
1 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
102165
|
0 |
0 |
if( pOnlyIdx && pOnlyIdx!=pIdx ) continue; |
|
0 |
0 |
if( pOnlyIdx && pOnlyIdx!=pIdx ) continue; |
102166
|
0 |
0 |
if( pIdx->pPartIdxWhere==0 ) needTableCnt = 0; |
102167
|
0 |
0 |
if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIdx) ){ |
|
0 |
0 |
if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIdx) ){ |
102174
|
0 |
0 |
nColTest = pIdx->uniqNotNull ? pIdx->nKeyCol-1 : nCol-1; |
102257
|
0 |
0 |
if( nColTest>0 ){ |
102261
|
0 |
0 |
if( aGotoChng==0 ) continue; |
102275
|
0 |
0 |
if( nColTest==1 && pIdx->nKeyCol==1 && IsUniqueIndex(pIdx) ){ |
|
0 |
0 |
if( nColTest==1 && pIdx->nKeyCol==1 && IsUniqueIndex(pIdx) ){ |
|
0 |
0 |
if( nColTest==1 && pIdx->nKeyCol==1 && IsUniqueIndex(pIdx) ){ |
102282
|
0 |
0 |
for(i=0; i
|
102303
|
0 |
0 |
for(i=0; i
|
102404
|
1 |
0 |
if( pOnlyIdx==0 && needTableCnt ){ |
|
1 |
0 |
if( pOnlyIdx==0 && needTableCnt ){ |
102428
|
1 |
0 |
if( v ){ |
102451
|
2 |
1 |
for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){ |
102473
|
0 |
0 |
if( pOnlyIdx ){ |
102507
|
0 |
1 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ |
102512
|
1 |
0 |
if( pName1==0 ){ |
102514
|
2 |
1 |
for(i=0; inDb; i++){ |
102515
|
1 |
1 |
if( i==1 ) continue; /* Do not analyze the TEMP database */ |
102518
|
0 |
0 |
}else if( pName2->n==0 && (iDb = sqlite3FindDb(db, pName1))>=0 ){ |
|
0 |
0 |
}else if( pName2->n==0 && (iDb = sqlite3FindDb(db, pName1))>=0 ){ |
102524
|
0 |
0 |
if( iDb>=0 ){ |
102525
|
0 |
0 |
zDb = pName2->n ? db->aDb[iDb].zDbSName : 0; |
102527
|
0 |
0 |
if( z ){ |
102528
|
0 |
0 |
if( (pIdx = sqlite3FindIndex(db, z, zDb))!=0 ){ |
102530
|
0 |
0 |
}else if( (pTab = sqlite3LocateTable(pParse, 0, z, zDb))!=0 ){ |
102537
|
1 |
0 |
if( db->nSqlExec==0 && (v = sqlite3GetVdbe(pParse))!=0 ){ |
|
1 |
0 |
if( db->nSqlExec==0 && (v = sqlite3GetVdbe(pParse))!=0 ){ |
102574
|
0 |
0 |
for(i=0; *z && i
|
|
0 |
0 |
for(i=0; *z && i
|
102576
|
0 |
0 |
while( (c=z[0])>='0' && c<='9' ){ |
|
0 |
0 |
while( (c=z[0])>='0' && c<='9' ){ |
102589
|
0 |
0 |
if( *z==' ' ) z++; |
102598
|
0 |
0 |
while( z[0] ){ |
102599
|
0 |
0 |
if( sqlite3_strglob("unordered*", z)==0 ){ |
102601
|
0 |
0 |
}else if( sqlite3_strglob("sz=[0-9]*", z)==0 ){ |
102603
|
0 |
0 |
}else if( sqlite3_strglob("noskipscan*", z)==0 ){ |
102611
|
0 |
0 |
while( z[0]!=0 && z[0]!=' ' ) z++; |
|
0 |
0 |
while( z[0]!=0 && z[0]!=' ' ) z++; |
102612
|
0 |
0 |
while( z[0]==' ' ) z++; |
102637
|
0 |
0 |
if( argv==0 || argv[0]==0 || argv[2]==0 ){ |
|
0 |
0 |
if( argv==0 || argv[0]==0 || argv[2]==0 ){ |
|
0 |
0 |
if( argv==0 || argv[0]==0 || argv[2]==0 ){ |
102641
|
0 |
0 |
if( pTable==0 ){ |
102644
|
0 |
0 |
if( argv[1]==0 ){ |
102646
|
0 |
0 |
}else if( sqlite3_stricmp(argv[0],argv[1])==0 ){ |
102653
|
0 |
0 |
if( pIndex ){ |
102669
|
0 |
0 |
if( pIndex->pPartIdxWhere==0 ){ |
102983
|
239 |
197 |
for(i=sqliteHashFirst(&pSchema->tblHash); i; i=sqliteHashNext(i)){ |
102987
|
1 |
197 |
for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){ |
102999
|
1 |
196 |
if( sqlite3FindTable(db, "sqlite_stat1", sInfo.zDatabase)!=0 ){ |
103002
|
0 |
1 |
if( zSql==0 ){ |
103012
|
1 |
197 |
for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){ |
103014
|
1 |
0 |
if( !pIdx->hasStat1 ) sqlite3DefaultRowEst(pIdx); |
103031
|
0 |
197 |
if( rc==SQLITE_NOMEM ){ |
103079
|
10 |
5 |
if( pExpr ){ |
103080
|
3 |
7 |
if( pExpr->op!=TK_ID ){ |
103125
|
0 |
5 |
if( zFile==0 ) zFile = ""; |
103126
|
0 |
5 |
if( zName==0 ) zName = ""; |
103154
|
0 |
5 |
if( db->nDb>=db->aLimit[SQLITE_LIMIT_ATTACHED]+2 ){ |
103160
|
10 |
5 |
for(i=0; inDb; i++){ |
103163
|
0 |
10 |
if( sqlite3StrICmp(z, zName)==0 ){ |
103172
|
5 |
0 |
if( db->aDb==db->aDbStatic ){ |
103174
|
0 |
5 |
if( aNew==0 ) return; |
103178
|
0 |
0 |
if( aNew==0 ) return; |
103190
|
0 |
5 |
if( rc!=SQLITE_OK ){ |
103191
|
0 |
0 |
if( rc==SQLITE_NOMEM ) sqlite3OomFault(db); |
103203
|
0 |
5 |
if( rc==SQLITE_CONSTRAINT ){ |
103206
|
5 |
0 |
}else if( rc==SQLITE_OK ){ |
103209
|
0 |
5 |
if( !pNew->pSchema ){ |
103211
|
0 |
5 |
}else if( pNew->pSchema->file_format && pNew->pSchema->enc!=ENC(db) ){ |
|
0 |
0 |
}else if( pNew->pSchema->file_format && pNew->pSchema->enc!=ENC(db) ){ |
103229
|
5 |
0 |
if( rc==SQLITE_OK && pNew->zDbSName==0 ){ |
|
0 |
5 |
if( rc==SQLITE_OK && pNew->zDbSName==0 ){ |
103235
|
5 |
0 |
if( rc==SQLITE_OK ){ |
103258
|
5 |
0 |
if( nKey || sqlite3BtreeGetOptimalReserve(db->aDb[0].pBt)>0 ){ |
|
0 |
5 |
if( nKey || sqlite3BtreeGetOptimalReserve(db->aDb[0].pBt)>0 ){ |
103271
|
5 |
0 |
if( rc==SQLITE_OK ){ |
103288
|
0 |
5 |
if( rc ){ |
103292
|
0 |
0 |
if( db->aDb[iDb].pBt ){ |
103299
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){ |
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){ |
103303
|
0 |
0 |
}else if( zErrDyn==0 ){ |
103314
|
0 |
0 |
if( zErrDyn ){ |
103318
|
0 |
0 |
if( rc ) sqlite3_result_error_code(context, rc); |
103342
|
0 |
0 |
if( zName==0 ) zName = ""; |
103343
|
0 |
0 |
for(i=0; inDb; i++){ |
103345
|
0 |
0 |
if( pDb->pBt==0 ) continue; |
103346
|
0 |
0 |
if( sqlite3StrICmp(pDb->zDbSName, zName)==0 ) break; |
103349
|
0 |
0 |
if( i>=db->nDb ){ |
103353
|
0 |
0 |
if( i<2 ){ |
103357
|
0 |
0 |
if( sqlite3BtreeIsInReadTrans(pDb->pBt) || sqlite3BtreeIsInBackup(pDb->pBt) ){ |
|
0 |
0 |
if( sqlite3BtreeIsInReadTrans(pDb->pBt) || sqlite3BtreeIsInBackup(pDb->pBt) ){ |
103391
|
0 |
5 |
if( pParse->nErr ) goto attach_end; |
103395
|
5 |
0 |
if( |
103396
|
5 |
0 |
SQLITE_OK!=(rc = resolveAttachExpr(&sName, pFilename)) || |
103397
|
5 |
0 |
SQLITE_OK!=(rc = resolveAttachExpr(&sName, pDbname)) || |
103404
|
5 |
0 |
if( pAuthArg ){ |
103406
|
5 |
0 |
if( pAuthArg->op==TK_STRING ){ |
103412
|
0 |
5 |
if(rc!=SQLITE_OK ){ |
103426
|
5 |
0 |
if( v ){ |
103529
|
0 |
10 |
if( NEVER(pList==0) ) return 0; |
103531
|
10 |
10 |
for(i=0, pItem=pList->a; inSrc; i++, pItem++){ |
103532
|
10 |
0 |
if( pFix->bVarOnly==0 ){ |
103533
|
0 |
10 |
if( pItem->zDatabase && sqlite3StrICmp(pItem->zDatabase, zDb) ){ |
|
0 |
0 |
if( pItem->zDatabase && sqlite3StrICmp(pItem->zDatabase, zDb) ){ |
103544
|
0 |
10 |
if( sqlite3FixSelect(pFix, pItem->pSelect) ) return 1; |
103545
|
0 |
10 |
if( sqlite3FixExpr(pFix, pItem->pOn) ) return 1; |
103547
|
0 |
10 |
if( pItem->fg.isTabFunc && sqlite3FixExprList(pFix, pItem->u1.pFuncArg) ){ |
|
0 |
0 |
if( pItem->fg.isTabFunc && sqlite3FixExprList(pFix, pItem->u1.pFuncArg) ){ |
103558
|
0 |
10 |
while( pSelect ){ |
103559
|
0 |
0 |
if( sqlite3FixExprList(pFix, pSelect->pEList) ){ |
103562
|
0 |
0 |
if( sqlite3FixSrcList(pFix, pSelect->pSrc) ){ |
103565
|
0 |
0 |
if( sqlite3FixExpr(pFix, pSelect->pWhere) ){ |
103568
|
0 |
0 |
if( sqlite3FixExprList(pFix, pSelect->pGroupBy) ){ |
103571
|
0 |
0 |
if( sqlite3FixExpr(pFix, pSelect->pHaving) ){ |
103574
|
0 |
0 |
if( sqlite3FixExprList(pFix, pSelect->pOrderBy) ){ |
103577
|
0 |
0 |
if( sqlite3FixExpr(pFix, pSelect->pLimit) ){ |
103580
|
0 |
0 |
if( pSelect->pWith ){ |
103582
|
0 |
0 |
for(i=0; ipWith->nCte; i++){ |
103583
|
0 |
0 |
if( sqlite3FixSelect(pFix, pSelect->pWith->a[i].pSelect) ){ |
103596
|
0 |
10 |
while( pExpr ){ |
103597
|
0 |
0 |
if( pExpr->op==TK_VARIABLE ){ |
103598
|
0 |
0 |
if( pFix->pParse->db->init.busy ){ |
103605
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_TokenOnly|EP_Leaf) ) break; |
103606
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
103607
|
0 |
0 |
if( sqlite3FixSelect(pFix, pExpr->x.pSelect) ) return 1; |
103609
|
0 |
0 |
if( sqlite3FixExprList(pFix, pExpr->x.pList) ) return 1; |
103611
|
0 |
0 |
if( sqlite3FixExpr(pFix, pExpr->pRight) ){ |
103624
|
0 |
0 |
if( pList==0 ) return 0; |
103625
|
0 |
0 |
for(i=0, pItem=pList->a; inExpr; i++, pItem++){ |
103626
|
0 |
0 |
if( sqlite3FixExpr(pFix, pItem->pExpr) ){ |
103639
|
0 |
0 |
while( pStep ){ |
103640
|
0 |
0 |
if( sqlite3FixSelect(pFix, pStep->pSelect) ){ |
103643
|
0 |
0 |
if( sqlite3FixExpr(pFix, pStep->pWhere) ){ |
103646
|
0 |
0 |
if( sqlite3FixExprList(pFix, pStep->pExprList) ){ |
103650
|
0 |
0 |
if( pStep->pUpsert ){ |
103652
|
0 |
0 |
if( sqlite3FixExprList(pFix, pUp->pUpsertTarget) |
103653
|
0 |
0 |
|| sqlite3FixExpr(pFix, pUp->pUpsertTargetWhere) |
103654
|
0 |
0 |
|| sqlite3FixExprList(pFix, pUp->pUpsertSet) |
103655
|
0 |
0 |
|| sqlite3FixExpr(pFix, pUp->pUpsertWhere) |
103782
|
0 |
0 |
if( db->init.busy ) return SQLITE_OK; |
103788
|
0 |
0 |
if( rc==SQLITE_DENY ){ |
103790
|
0 |
0 |
if( db->nDb>2 || iDb!=0 ) z = sqlite3_mprintf("%s.%z", zDb, z); |
|
0 |
0 |
if( db->nDb>2 || iDb!=0 ) z = sqlite3_mprintf("%s.%z", zDb, z); |
103793
|
0 |
0 |
}else if( rc!=SQLITE_IGNORE && rc!=SQLITE_OK ){ |
|
0 |
0 |
}else if( rc!=SQLITE_IGNORE && rc!=SQLITE_OK ){ |
103822
|
4821 |
0 |
if( db->xAuth==0 ) return; |
103824
|
0 |
0 |
if( iDb<0 ){ |
103830
|
0 |
0 |
if( pExpr->op==TK_TRIGGER ){ |
103834
|
0 |
0 |
for(iSrc=0; ALWAYS(iSrcnSrc); iSrc++){ |
103835
|
0 |
0 |
if( pExpr->iTable==pTabList->a[iSrc].iCursor ){ |
103842
|
0 |
0 |
if( NEVER(pTab==0) ) return; |
103844
|
0 |
0 |
if( iCol>=0 ){ |
103847
|
0 |
0 |
}else if( pTab->iPKey>=0 ){ |
103854
|
0 |
0 |
if( SQLITE_IGNORE==sqlite3AuthReadCol(pParse, pTab->zName, zCol, iDb) ){ |
103878
|
7369 |
1837 |
if( db->init.busy || IN_DECLARE_VTAB ){ |
|
52 |
7317 |
if( db->init.busy || IN_DECLARE_VTAB ){ |
103882
|
7313 |
4 |
if( db->xAuth==0 ){ |
103902
|
2 |
2 |
if( rc==SQLITE_DENY ){ |
103905
|
0 |
2 |
}else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){ |
|
0 |
0 |
}else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){ |
103933
|
0 |
340 |
if( pContext->pParse ){ |
103998
|
0 |
4766 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
104004
|
2509 |
2257 |
if( iDb==1 ) return; |
104005
|
2257 |
0 |
if( !sqlite3BtreeSharable(pParse->db->aDb[iDb].pBt) ) return; |
104006
|
0 |
0 |
for(i=0; inTableLock; i++){ |
104008
|
0 |
0 |
if( p->iDb==iDb && p->iTab==iTab ){ |
|
0 |
0 |
if( p->iDb==iDb && p->iTab==iTab ){ |
104009
|
0 |
0 |
p->isWriteLock = (p->isWriteLock || isWriteLock); |
|
0 |
0 |
p->isWriteLock = (p->isWriteLock || isWriteLock); |
104017
|
0 |
0 |
if( pToplevel->aTableLock ){ |
104040
|
0 |
4673 |
for(i=0; inTableLock; i++){ |
104080
|
319 |
5754 |
if( pParse->nested ) return; |
104081
|
5754 |
0 |
if( db->mallocFailed || pParse->nErr ){ |
|
8 |
5746 |
if( db->mallocFailed || pParse->nErr ){ |
104082
|
0 |
8 |
if( pParse->rc==SQLITE_OK ) pParse->rc = SQLITE_ERROR; |
104092
|
5746 |
0 |
if( v ){ |
104112
|
5746 |
0 |
if( db->mallocFailed==0 |
104113
|
1435 |
4311 |
&& (DbMaskNonZero(pParse->cookieMask) || pParse->pConstExpr) |
|
362 |
1073 |
&& (DbMaskNonZero(pParse->cookieMask) || pParse->pConstExpr) |
104118
|
9457 |
4673 |
for(iDb=0; iDbnDb; iDb++){ |
104120
|
5115 |
4342 |
if( DbMaskTest(pParse->cookieMask, iDb)==0 ) continue; |
104130
|
3907 |
435 |
if( db->init.busy==0 ) sqlite3VdbeChangeP5(v, 1); |
104135
|
22 |
4673 |
for(i=0; inVtabLock; i++){ |
104153
|
875 |
3798 |
if( pParse->pConstExpr ){ |
104156
|
1541 |
875 |
for(i=0; inExpr; i++){ |
104169
|
5746 |
0 |
if( v && pParse->nErr==0 && !db->mallocFailed ){ |
|
5746 |
0 |
if( v && pParse->nErr==0 && !db->mallocFailed ){ |
|
5746 |
0 |
if( v && pParse->nErr==0 && !db->mallocFailed ){ |
104173
|
2 |
5744 |
if( pParse->pAinc!=0 && pParse->nTab==0 ) pParse->nTab = 1; |
|
0 |
2 |
if( pParse->pAinc!=0 && pParse->nTab==0 ) pParse->nTab = 1; |
104200
|
0 |
319 |
if( pParse->nErr ) return; |
104205
|
0 |
319 |
if( zSql==0 ){ |
104254
|
8975 |
1195 |
for(i=OMIT_TEMPDB; inDb; i++){ |
104255
|
8889 |
86 |
int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ |
104256
|
4431 |
4544 |
if( zDatabase==0 || sqlite3StrICmp(zDatabase, db->aDb[j].zDbSName)==0 ){ |
|
2201 |
2230 |
if( zDatabase==0 || sqlite3StrICmp(zDatabase, db->aDb[j].zDbSName)==0 ){ |
104259
|
4481 |
2264 |
if( p ) return p; |
104264
|
946 |
249 |
if( sqlite3StrICmp(zName, MASTER_NAME)!=0 ) break; |
104265
|
196 |
53 |
if( sqlite3_stricmp(zDatabase, db->aDb[1].zDbSName)!=0 ) break; |
104292
|
4435 |
0 |
if( (db->mDbFlags & DBFLAG_SchemaKnownOk)==0 |
104293
|
0 |
4435 |
&& SQLITE_OK!=sqlite3ReadSchema(pParse) |
104299
|
9 |
4426 |
if( p==0 ){ |
104300
|
0 |
9 |
const char *zMsg = flags & LOCATE_VIEW ? "no such view" : "no such table"; |
104302
|
9 |
0 |
if( sqlite3FindDbName(db, zDbase)<1 ){ |
104307
|
9 |
0 |
if( pMod==0 && sqlite3_strnicmp(zName, "pragma_", 7)==0 ){ |
|
0 |
9 |
if( pMod==0 && sqlite3_strnicmp(zName, "pragma_", 7)==0 ){ |
104310
|
0 |
9 |
if( pMod && sqlite3VtabEponymousTableInit(pParse, pMod) ){ |
|
0 |
0 |
if( pMod && sqlite3VtabEponymousTableInit(pParse, pMod) ){ |
104315
|
7 |
2 |
if( (flags & LOCATE_NOERR)==0 ){ |
104316
|
0 |
7 |
if( zDbase ){ |
104344
|
10 |
4319 |
if( p->pSchema ){ |
104370
|
1969 |
920 |
for(i=OMIT_TEMPDB; inDb; i++){ |
104371
|
1933 |
36 |
int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ |
104374
|
1969 |
0 |
if( zDb && sqlite3StrICmp(zDb, db->aDb[j].zDbSName) ) continue; |
|
1002 |
967 |
if( zDb && sqlite3StrICmp(zDb, db->aDb[j].zDbSName) ) continue; |
104377
|
47 |
920 |
if( p ) break; |
104392
|
0 |
79 |
if( p->isResized ) sqlite3DbFree(db, (void *)p->azColl); |
104412
|
0 |
0 |
if( ALWAYS(pIndex) ){ |
104413
|
0 |
0 |
if( pIndex->pTable->pIndex==pIndex ){ |
104420
|
0 |
0 |
while( ALWAYS(p) && p->pNext!=pIndex ){ p = p->pNext; } |
|
0 |
0 |
while( ALWAYS(p) && p->pNext!=pIndex ){ p = p->pNext; } |
104421
|
0 |
0 |
if( ALWAYS(p && p->pNext==pIndex) ){ |
|
0 |
0 |
if( ALWAYS(p && p->pNext==pIndex) ){ |
104440
|
5 |
276 |
for(i=j=2; inDb; i++){ |
104442
|
5 |
0 |
if( pDb->pBt==0 ){ |
104447
|
0 |
0 |
if( j
|
104453
|
276 |
0 |
if( db->nDb<=2 && db->aDb!=db->aDbStatic ){ |
|
5 |
271 |
if( db->nDb<=2 && db->aDb!=db->aDbStatic ){ |
104469
|
0 |
0 |
if( iDb>=0 ){ |
104476
|
0 |
0 |
if( db->nSchemaLock==0 ){ |
104477
|
0 |
0 |
for(i=0; inDb; i++){ |
104478
|
0 |
0 |
if( DbHasProperty(db, i, DB_ResetWanted) ){ |
104493
|
20 |
10 |
for(i=0; inDb; i++){ |
104495
|
20 |
0 |
if( pDb->pSchema ){ |
104520
|
908 |
51 |
if( (pCol = pTable->aCol)!=0 ){ |
104521
|
3118 |
908 |
for(i=0; inCol; i++, pCol++){ |
104559
|
74 |
959 |
for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){ |
104563
|
34 |
40 |
if( (db==0 || db->pnBytesFreed==0) && !IsVirtual(pTable) ){ |
|
34 |
0 |
if( (db==0 || db->pnBytesFreed==0) && !IsVirtual(pTable) ){ |
|
74 |
0 |
if( (db==0 || db->pnBytesFreed==0) && !IsVirtual(pTable) ){ |
104594
|
8860 |
5264 |
if( !pTable ) return; |
104595
|
4616 |
648 |
if( ((!db || db->pnBytesFreed==0) && (--pTable->nTabRef)>0) ) return; |
|
4610 |
6 |
if( ((!db || db->pnBytesFreed==0) && (--pTable->nTabRef)>0) ) return; |
|
4305 |
953 |
if( ((!db || db->pnBytesFreed==0) && (--pTable->nTabRef)>0) ) return; |
104634
|
8690 |
117 |
if( pName ){ |
104651
|
258 |
5 |
if( p->nTab==0 ){ |
104664
|
288 |
7 |
if( zName ){ |
104666
|
595 |
0 |
for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){ |
104667
|
288 |
307 |
if( 0==sqlite3_stricmp(pDb->zDbSName, zName) ) break; |
104670
|
0 |
307 |
if( i==0 && 0==sqlite3_stricmp("main", zName) ) break; |
|
0 |
0 |
if( i==0 && 0==sqlite3_stricmp("main", zName) ) break; |
104717
|
156 |
593 |
if( pName2->n>0 ){ |
104718
|
0 |
156 |
if( db->init.busy ) { |
104724
|
0 |
156 |
if( iDb<0 ){ |
104745
|
268 |
666 |
if( !pParse->db->init.busy && pParse->nested==0 |
|
263 |
5 |
if( !pParse->db->init.busy && pParse->nested==0 |
104746
|
263 |
0 |
&& (pParse->db->flags & SQLITE_WriteSchema)==0 |
104747
|
0 |
263 |
&& 0==sqlite3StrNICmp(zName, "sqlite_", 7) ){ |
104759
|
30 |
41 |
for(p=pTab->pIndex; p && !IsPrimaryKeyIndex(p); p=p->pNext){} |
|
4 |
26 |
for(p=pTab->pIndex; p && !IsPrimaryKeyIndex(p); p=p->pNext){} |
104769
|
278 |
53 |
for(i=0; inColumn; i++){ |
104770
|
100 |
178 |
if( iCol==pIdx->aiColumn[i] ) return i; |
104807
|
661 |
263 |
if( db->init.busy && db->init.newTnum==1 ){ |
|
387 |
274 |
if( db->init.busy && db->init.newTnum==1 ){ |
104810
|
191 |
196 |
zName = sqlite3DbStrDup(db, SCHEMA_TABLE(iDb)); |
104815
|
0 |
537 |
if( iDb<0 ) return; |
104816
|
25 |
512 |
if( !OMIT_TEMPDB && isTemp && pName2->n>0 && iDb!=1 ){ |
|
0 |
25 |
if( !OMIT_TEMPDB && isTemp && pName2->n>0 && iDb!=1 ){ |
|
0 |
0 |
if( !OMIT_TEMPDB && isTemp && pName2->n>0 && iDb!=1 ){ |
104822
|
25 |
512 |
if( !OMIT_TEMPDB && isTemp ) iDb = 1; |
104826
|
0 |
924 |
if( zName==0 ) return; |
104827
|
0 |
924 |
if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ |
104830
|
217 |
707 |
if( db->init.iDb==1 ) isTemp = 1; |
104842
|
242 |
682 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ |
|
0 |
924 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ |
104845
|
873 |
51 |
if( !isVirtual && sqlite3AuthCheck(pParse, (int)aCode[isTemp+2*isView], |
|
0 |
873 |
if( !isVirtual && sqlite3AuthCheck(pParse, (int)aCode[isTemp+2*isView], |
104859
|
898 |
26 |
if( !IN_DECLARE_VTAB ){ |
104861
|
0 |
898 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ |
104865
|
0 |
898 |
if( pTable ){ |
104866
|
0 |
0 |
if( !noErr ){ |
104874
|
0 |
898 |
if( sqlite3FindIndex(db, zName, zDb)!=0 ){ |
104881
|
0 |
924 |
if( pTable==0 ){ |
104904
|
919 |
5 |
if( !pParse->nested && strcmp(zName, "sqlite_sequence")==0 ){ |
|
4 |
915 |
if( !pParse->nested && strcmp(zName, "sqlite_sequence")==0 ){ |
104918
|
263 |
661 |
if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){ |
|
263 |
0 |
if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){ |
104927
|
24 |
239 |
if( isVirtual ){ |
104942
|
0 |
263 |
1 : SQLITE_MAX_FILE_FORMAT; |
104957
|
263 |
0 |
if( isView || isVirtual ){ |
|
24 |
239 |
if( isView || isVirtual ){ |
105011
|
0 |
2972 |
if( (p = pParse->pNewTable)==0 ) return; |
105012
|
0 |
2972 |
if( p->nCol+1>db->aLimit[SQLITE_LIMIT_COLUMN] ){ |
105017
|
0 |
2972 |
if( z==0 ) return; |
105021
|
4797 |
2972 |
for(i=0; inCol; i++){ |
105022
|
0 |
4797 |
if( sqlite3_stricmp(z, p->aCol[i].zName)==0 ){ |
105028
|
873 |
2099 |
if( (p->nCol & 0x7)==0 ){ |
105031
|
0 |
873 |
if( aNew==0 ){ |
105042
|
297 |
2675 |
if( pType->n==0 ){ |
105074
|
173 |
0 |
if( p==0 || NEVER(p->nCol<1) ) return; |
|
0 |
173 |
if( p==0 || NEVER(p->nCol<1) ) return; |
105081
|
0 |
173 |
if( pCol->colFlags & COLFLAG_UNIQUE ){ |
105083
|
0 |
0 |
for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){ |
105085
|
0 |
0 |
if( pIdx->aiColumn[0]==p->nCol-1 ){ |
105123
|
10611 |
1841 |
while( zIn[0] ){ |
105126
|
120 |
10491 |
if( h==(('c'<<24)+('h'<<16)+('a'<<8)+'r') ){ /* CHAR */ |
105129
|
0 |
10491 |
}else if( h==(('c'<<24)+('l'<<16)+('o'<<8)+'b') ){ /* CLOB */ |
105131
|
1617 |
8874 |
}else if( h==(('t'<<24)+('e'<<16)+('x'<<8)+'t') ){ /* TEXT */ |
105133
|
66 |
8808 |
}else if( h==(('b'<<24)+('l'<<16)+('o'<<8)+'b') /* BLOB */ |
105134
|
0 |
66 |
&& (aff==SQLITE_AFF_NUMERIC || aff==SQLITE_AFF_REAL) ){ |
|
0 |
0 |
&& (aff==SQLITE_AFF_NUMERIC || aff==SQLITE_AFF_REAL) ){ |
105136
|
0 |
66 |
if( zIn[0]=='(' ) zChar = zIn; |
105138
|
0 |
8808 |
}else if( h==(('r'<<24)+('e'<<16)+('a'<<8)+'l') /* REAL */ |
105139
|
0 |
0 |
&& aff==SQLITE_AFF_NUMERIC ){ |
105141
|
0 |
8808 |
}else if( h==(('f'<<24)+('l'<<16)+('o'<<8)+'a') /* FLOA */ |
105142
|
0 |
0 |
&& aff==SQLITE_AFF_NUMERIC ){ |
105144
|
0 |
8808 |
}else if( h==(('d'<<24)+('o'<<16)+('u'<<8)+'b') /* DOUB */ |
105145
|
0 |
0 |
&& aff==SQLITE_AFF_NUMERIC ){ |
105148
|
835 |
7973 |
}else if( (h&0x00FFFFFF)==(('i'<<16)+('n'<<8)+'t') ){ /* INT */ |
105156
|
2675 |
1 |
if( pCol ){ |
105158
|
1803 |
872 |
if( aff
|
105159
|
120 |
1683 |
if( zChar ){ |
105160
|
269 |
21 |
while( zChar[0] ){ |
105161
|
99 |
170 |
if( sqlite3Isdigit(zChar[0]) ){ |
105178
|
0 |
2675 |
if( v>255 ) v = 255; |
105204
|
4 |
0 |
if( p!=0 ){ |
105206
|
0 |
4 |
if( !sqlite3ExprIsConstantOrFunction(pExpr, db->init.busy) ){ |
105244
|
0 |
218 |
if( p->op==TK_STRING ){ |
105246
|
0 |
218 |
}else if( p->op==TK_COLLATE && p->pLeft->op==TK_STRING ){ |
|
0 |
0 |
}else if( p->op==TK_COLLATE && p->pLeft->op==TK_STRING ){ |
105280
|
0 |
206 |
if( pTab==0 ) goto primary_key_exit; |
105281
|
0 |
206 |
if( pTab->tabFlags & TF_HasPrimaryKey ){ |
105287
|
165 |
41 |
if( pList==0 ){ |
105294
|
86 |
41 |
for(i=0; i
|
105298
|
86 |
0 |
if( pCExpr->op==TK_ID ){ |
105300
|
159 |
0 |
for(iCol=0; iColnCol; iCol++){ |
105301
|
86 |
73 |
if( sqlite3StrICmp(zCName, pTab->aCol[iCol].zName)==0 ){ |
105310
|
175 |
31 |
if( nTerm==1 |
105311
|
175 |
0 |
&& pCol |
105312
|
153 |
22 |
&& sqlite3StrICmp(sqlite3ColumnType(pCol,""), "INTEGER")==0 |
105313
|
153 |
0 |
&& sortOrder!=SQLITE_SO_DESC |
105319
|
6 |
147 |
if( pList ) pParse->iPkSortOrder = pList->a[0].sortOrder; |
105320
|
0 |
53 |
}else if( autoInc ){ |
105346
|
0 |
0 |
if( pTab && !IN_DECLARE_VTAB |
|
0 |
0 |
if( pTab && !IN_DECLARE_VTAB |
105347
|
0 |
0 |
&& !sqlite3BtreeIsReadonly(db->aDb[db->init.iDb].pBt) |
105350
|
0 |
0 |
if( pParse->constraintName.n ){ |
105370
|
0 |
0 |
if( (p = pParse->pNewTable)==0 ) return; |
105374
|
0 |
0 |
if( !zColl ) return; |
105376
|
0 |
0 |
if( sqlite3LocateCollSeq(pParse, zColl) ){ |
105385
|
0 |
0 |
for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){ |
105387
|
0 |
0 |
if( pIdx->aiColumn[0]==i ){ |
105423
|
66 |
0 |
if( !initbusy && (!pColl || !pColl->xCmp) ){ |
|
66 |
0 |
if( !initbusy && (!pColl || !pColl->xCmp) ){ |
|
0 |
66 |
if( !initbusy && (!pColl || !pColl->xCmp) ){ |
105468
|
0 |
0 |
for(n=0; *z; n++, z++){ |
105469
|
0 |
0 |
if( *z=='"' ){ n++; } |
105492
|
0 |
0 |
for(j=0; zIdent[j]; j++){ |
105493
|
0 |
0 |
if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break; |
|
0 |
0 |
if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break; |
105496
|
0 |
0 |
|| sqlite3KeywordCode(zIdent, j)!=TK_ID |
105497
|
0 |
0 |
|| zIdent[j]!=0 |
105498
|
0 |
0 |
|| j==0; |
|
0 |
0 |
|| j==0; |
105500
|
0 |
0 |
if( needQuote ) z[i++] = '"'; |
105501
|
0 |
0 |
for(j=0; zIdent[j]; j++){ |
105503
|
0 |
0 |
if( zIdent[j]=='"' ) z[i++] = '"'; |
105505
|
0 |
0 |
if( needQuote ) z[i++] = '"'; |
105521
|
0 |
0 |
for(pCol = p->aCol, i=0; inCol; i++, pCol++){ |
105525
|
0 |
0 |
if( n<50 ){ |
105536
|
0 |
0 |
if( zStmt==0 ){ |
105544
|
0 |
0 |
for(pCol=p->aCol, i=0; inCol; i++, pCol++){ |
105586
|
0 |
0 |
if( pIdx->nColumn>=N ) return SQLITE_OK; |
105590
|
0 |
0 |
if( zExtra==0 ) return SQLITE_NOMEM_BKPT; |
105611
|
2972 |
873 |
for(i=pTab->nCol, pTabCol=pTab->aCol; i>0; i--, pTabCol++){ |
105614
|
720 |
153 |
if( pTab->iPKey<0 ) wTable++; |
105625
|
211 |
79 |
for(i=0; inColumn; i++){ |
105628
|
132 |
79 |
wIndex += x<0 ? 1 : aCol[pIdx->aiColumn[i]].szEst; |
105636
|
0 |
0 |
while( nCol-- > 0 ) if( x==*(aiCol++) ) return 1; |
|
0 |
0 |
while( nCol-- > 0 ) if( x==*(aiCol++) ) return 1; |
105674
|
0 |
0 |
if( !db->init.imposterTable ){ |
105675
|
0 |
0 |
for(i=0; inCol; i++){ |
105676
|
0 |
0 |
if( (pTab->aCol[i].colFlags & COLFLAG_PRIMKEY)!=0 ){ |
105684
|
0 |
0 |
if( IN_DECLARE_VTAB ) return; |
105689
|
0 |
0 |
if( pParse->addrCrTab ){ |
105697
|
0 |
0 |
if( pTab->iPKey>=0 ){ |
105703
|
0 |
0 |
if( pList==0 ) return; |
105708
|
0 |
0 |
if( db->mallocFailed ) return; |
105719
|
0 |
0 |
for(i=j=1; inKeyCol; i++){ |
105720
|
0 |
0 |
if( hasColumn(pPk->aiColumn, j, pPk->aiColumn[i]) ){ |
105730
|
0 |
0 |
if( !db->init.imposterTable ) pPk->uniqNotNull = 1; |
105737
|
0 |
0 |
if( v && pPk->tnum>0 ){ |
|
0 |
0 |
if( v && pPk->tnum>0 ){ |
105748
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
105750
|
0 |
0 |
if( IsPrimaryKeyIndex(pIdx) ) continue; |
105751
|
0 |
0 |
for(i=n=0; i
|
105752
|
0 |
0 |
if( !hasColumn(pIdx->aiColumn, pIdx->nKeyCol, pPk->aiColumn[i]) ) n++; |
105754
|
0 |
0 |
if( n==0 ){ |
105759
|
0 |
0 |
if( resizeIndexObject(db, pIdx, pIdx->nKeyCol+n) ) return; |
105760
|
0 |
0 |
for(i=0, j=pIdx->nKeyCol; i
|
105761
|
0 |
0 |
if( !hasColumn(pIdx->aiColumn, pIdx->nKeyCol, pPk->aiColumn[i]) ){ |
105773
|
0 |
0 |
if( nPknCol ){ |
105774
|
0 |
0 |
if( resizeIndexObject(db, pPk, pTab->nCol) ) return; |
105775
|
0 |
0 |
for(i=0, j=nPk; inCol; i++){ |
105776
|
0 |
0 |
if( !hasColumn(pPk->aiColumn, j, i) ){ |
105822
|
0 |
873 |
if( pEnd==0 && pSelect==0 ){ |
|
0 |
0 |
if( pEnd==0 && pSelect==0 ){ |
105827
|
0 |
873 |
if( p==0 ) return; |
105838
|
634 |
239 |
if( db->init.busy ){ |
105839
|
0 |
634 |
if( pSelect ){ |
105844
|
387 |
247 |
if( p->tnum==1 ) p->tabFlags |= TF_Readonly; |
105848
|
0 |
873 |
if( tabOpts & TF_WithoutRowid ){ |
105849
|
0 |
0 |
if( (p->tabFlags & TF_Autoincrement) ){ |
105854
|
0 |
0 |
if( (p->tabFlags & TF_HasPrimaryKey)==0 ){ |
105867
|
0 |
873 |
if( p->pCheck ){ |
105874
|
69 |
873 |
for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){ |
105884
|
239 |
634 |
if( !db->init.busy ){ |
105892
|
0 |
239 |
if( NEVER(v==0) ) return; |
105899
|
239 |
0 |
if( p->pSelect==0 ){ |
105924
|
0 |
239 |
if( pSelect ){ |
105943
|
0 |
0 |
if( pParse->nErr ) return; |
105945
|
0 |
0 |
if( pSelTab==0 ) return; |
105954
|
0 |
0 |
if( pParse->nErr ) return; |
105969
|
0 |
239 |
if( pSelect ){ |
105972
|
0 |
239 |
Token *pEnd2 = tabOpts ? &pParse->sLastToken : pEnd; |
105974
|
239 |
0 |
if( pEnd2->z[0]!=';' ) n += pEnd2->n; |
106003
|
5 |
234 |
if( (p->tabFlags & TF_Autoincrement)!=0 ){ |
106006
|
4 |
1 |
if( pDb->pSchema->pSeqTab==0 ){ |
106023
|
634 |
239 |
if( db->init.busy ){ |
106028
|
0 |
634 |
if( pOld ){ |
106037
|
634 |
0 |
if( !p->pSelect ){ |
106041
|
609 |
25 |
if( pCons->z==0 ){ |
106074
|
0 |
0 |
if( pParse->nVar>0 ){ |
106080
|
0 |
0 |
if( p==0 || pParse->nErr ) goto create_view_fail; |
|
0 |
0 |
if( p==0 || pParse->nErr ) goto create_view_fail; |
106084
|
0 |
0 |
if( sqlite3FixSelect(&sFix, pSelect) ) goto create_view_fail; |
106093
|
0 |
0 |
if( db->mallocFailed ) goto create_view_fail; |
106100
|
0 |
0 |
if( sEnd.z[0]!=';' ){ |
106107
|
0 |
0 |
while( sqlite3Isspace(z[n-1]) ){ n--; } |
106146
|
0 |
3191 |
if( rc ){ |
106149
|
152 |
3039 |
if( IsVirtual(pTable) ) return 0; |
106156
|
3039 |
0 |
if( pTable->nCol>0 ) return 0; |
106173
|
0 |
0 |
if( pTable->nCol<0 ){ |
106188
|
0 |
0 |
if( pSel ){ |
106202
|
0 |
0 |
if( pTable->pCheck ){ |
106211
|
0 |
0 |
if( db->mallocFailed==0 |
106212
|
0 |
0 |
&& pParse->nErr==0 |
106213
|
0 |
0 |
&& pTable->nCol==pSel->pEList->nExpr |
106217
|
0 |
0 |
}else if( pSelTab ){ |
106250
|
7 |
0 |
if( !DbHasProperty(db, idx, DB_UnresetViews) ) return; |
106251
|
0 |
0 |
for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){ |
106253
|
0 |
0 |
if( pTab->pSelect ){ |
106291
|
0 |
0 |
for(pElem=sqliteHashFirst(pHash); pElem; pElem=sqliteHashNext(pElem)){ |
106293
|
0 |
0 |
if( pTab->tnum==iFrom ){ |
106298
|
0 |
0 |
for(pElem=sqliteHashFirst(pHash); pElem; pElem=sqliteHashNext(pElem)){ |
106300
|
0 |
0 |
if( pIdx->tnum==iFrom ){ |
106366
|
5 |
5 |
if( iDestroyed==0 || iTab
|
|
0 |
5 |
if( iDestroyed==0 || iTab
|
106369
|
0 |
10 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
106372
|
0 |
0 |
if( (iDestroyed==0 || (iIdxiLargest ){ |
|
0 |
0 |
if( (iDestroyed==0 || (iIdxiLargest ){ |
|
0 |
0 |
if( (iDestroyed==0 || (iIdxiLargest ){ |
106376
|
5 |
5 |
if( iLargest==0 ){ |
106399
|
28 |
7 |
for(i=1; i<=4; i++){ |
106402
|
0 |
28 |
if( sqlite3FindTable(pParse->db, zTab, zDbName) ){ |
106425
|
2 |
5 |
if( IsVirtual(pTab) ){ |
106435
|
0 |
7 |
while( pTrigger ){ |
106448
|
0 |
7 |
if( pTab->tabFlags & TF_Autoincrement ){ |
106466
|
7 |
0 |
if( !isView && !IsVirtual(pTab) ){ |
|
5 |
2 |
if( !isView && !IsVirtual(pTab) ){ |
106473
|
2 |
5 |
if( IsVirtual(pTab) ){ |
106491
|
0 |
14 |
if( db->mallocFailed ){ |
106496
|
0 |
14 |
if( sqlite3ReadSchema(pParse) ) goto exit_drop_table; |
106497
|
1 |
13 |
if( noErr ) db->suppressErr++; |
106500
|
1 |
13 |
if( noErr ) db->suppressErr--; |
106502
|
7 |
7 |
if( pTab==0 ){ |
106503
|
1 |
6 |
if( noErr ) sqlite3CodeVerifyNamedSchema(pParse, pName->a[0].zDatabase); |
106512
|
2 |
5 |
if( IsVirtual(pTab) && sqlite3ViewGetColumnNames(pParse, pTab) ){ |
|
0 |
2 |
if( IsVirtual(pTab) && sqlite3ViewGetColumnNames(pParse, pTab) ){ |
106518
|
0 |
7 |
const char *zTab = SCHEMA_TABLE(iDb); |
106521
|
0 |
7 |
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb)){ |
106524
|
0 |
7 |
if( isView ){ |
106525
|
0 |
0 |
if( !OMIT_TEMPDB && iDb==1 ){ |
106531
|
2 |
5 |
}else if( IsVirtual(pTab) ){ |
106536
|
0 |
5 |
if( !OMIT_TEMPDB && iDb==1 ){ |
106542
|
0 |
7 |
if( sqlite3AuthCheck(pParse, code, pTab->zName, zArg2, zDb) ){ |
106545
|
0 |
7 |
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){ |
106550
|
0 |
7 |
if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 |
106551
|
0 |
0 |
&& sqlite3StrNICmp(pTab->zName, "sqlite_stat", 11)!=0 ){ |
106560
|
0 |
7 |
if( isView && pTab->pSelect==0 ){ |
|
0 |
0 |
if( isView && pTab->pSelect==0 ){ |
106564
|
7 |
0 |
if( !isView && pTab->pSelect ){ |
|
0 |
7 |
if( !isView && pTab->pSelect ){ |
106574
|
7 |
0 |
if( v ){ |
106619
|
16 |
0 |
if( p==0 || IN_DECLARE_VTAB ) goto fk_end; |
|
16 |
0 |
if( p==0 || IN_DECLARE_VTAB ) goto fk_end; |
106620
|
12 |
4 |
if( pFromCol==0 ){ |
106622
|
0 |
12 |
if( NEVER(iCol<0) ) goto fk_end; |
106623
|
12 |
0 |
if( pToCol && pToCol->nExpr!=1 ){ |
|
0 |
12 |
if( pToCol && pToCol->nExpr!=1 ){ |
106630
|
4 |
0 |
}else if( pToCol && pToCol->nExpr!=pFromCol->nExpr ){ |
|
0 |
4 |
}else if( pToCol && pToCol->nExpr!=pFromCol->nExpr ){ |
106639
|
16 |
0 |
if( pToCol ){ |
106640
|
18 |
16 |
for(i=0; inExpr; i++){ |
106645
|
0 |
16 |
if( pFKey==0 ){ |
106657
|
12 |
4 |
if( pFromCol==0 ){ |
106660
|
6 |
4 |
for(i=0; i
|
106662
|
16 |
0 |
for(j=0; jnCol; j++){ |
106663
|
6 |
10 |
if( sqlite3StrICmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){ |
106668
|
0 |
6 |
if( j>=p->nCol ){ |
106676
|
16 |
0 |
if( pToCol ){ |
106677
|
18 |
16 |
for(i=0; i
|
106693
|
0 |
16 |
if( pNextTo==pFKey ){ |
106697
|
0 |
16 |
if( pNextTo ){ |
106726
|
4 |
0 |
if( (pTab = pParse->pNewTable)==0 || (pFKey = pTab->pFKey)==0 ) return; |
|
0 |
4 |
if( (pTab = pParse->pNewTable)==0 || (pFKey = pTab->pFKey)==0 ) return; |
106759
|
0 |
5 |
if( sqlite3AuthCheck(pParse, SQLITE_REINDEX, pIndex->zName, 0, |
106769
|
0 |
5 |
if( v==0 ) return; |
106770
|
5 |
0 |
if( memRootPage>=0 ){ |
106795
|
0 |
5 |
if( memRootPage<0 ) sqlite3VdbeAddOp2(v, OP_Clear, tnum, iDb); |
106798
|
5 |
0 |
sqlite3VdbeChangeP5(v, OPFLAG_BULKCSR|((memRootPage>=0)?OPFLAG_P2ISREG:0)); |
106801
|
2 |
3 |
if( IsUniqueIndex(pIndex) ){ |
106847
|
80 |
0 |
if( p ){ |
106902
|
79 |
0 |
if( db->mallocFailed || pParse->nErr>0 ){ |
|
79 |
0 |
if( db->mallocFailed || pParse->nErr>0 ){ |
106905
|
0 |
79 |
if( IN_DECLARE_VTAB && idxType!=SQLITE_IDXTYPE_PRIMARYKEY ){ |
|
0 |
0 |
if( IN_DECLARE_VTAB && idxType!=SQLITE_IDXTYPE_PRIMARYKEY ){ |
106908
|
0 |
79 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ |
106915
|
10 |
69 |
if( pTblName!=0 ){ |
106923
|
0 |
10 |
if( iDb<0 ) goto exit_create_index; |
106931
|
5 |
5 |
if( !db->init.busy ){ |
106933
|
5 |
0 |
if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){ |
|
5 |
0 |
if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){ |
|
0 |
5 |
if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){ |
106947
|
0 |
10 |
if( pTab==0 ) goto exit_create_index; |
106948
|
0 |
10 |
if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){ |
|
0 |
0 |
if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){ |
106954
|
0 |
10 |
if( !HasRowid(pTab) ) pPk = sqlite3PrimaryKeyIndex(pTab); |
106959
|
0 |
69 |
if( !pTab ) goto exit_create_index; |
106966
|
0 |
79 |
if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 |
106967
|
0 |
0 |
&& db->init.busy==0 |
106974
|
0 |
0 |
&& sqlite3StrNICmp(&pTab->zName[7],"altertab_",9)!=0 |
106980
|
0 |
79 |
if( pTab->pSelect ){ |
106986
|
0 |
79 |
if( IsVirtual(pTab) ){ |
107005
|
10 |
69 |
if( pName ){ |
107007
|
0 |
10 |
if( zName==0 ) goto exit_create_index; |
107009
|
0 |
10 |
if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ |
107012
|
5 |
5 |
if( !db->init.busy ){ |
107013
|
0 |
5 |
if( sqlite3FindTable(db, zName, 0)!=0 ){ |
107018
|
0 |
10 |
if( sqlite3FindIndex(db, zName, pDb->zDbSName)!=0 ){ |
107019
|
0 |
0 |
if( !ifNotExist ){ |
107030
|
2 |
69 |
for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){} |
107032
|
0 |
69 |
if( zName==0 ){ |
107041
|
0 |
69 |
if( IN_DECLARE_VTAB ) zName[7]++; |
107049
|
2 |
77 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iDb), 0, zDb) ){ |
|
0 |
79 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iDb), 0, zDb) ){ |
107053
|
2 |
77 |
if( !OMIT_TEMPDB && iDb==1 ) i = SQLITE_CREATE_TEMP_INDEX; |
107054
|
0 |
79 |
if( sqlite3AuthCheck(pParse, i, zName, pTab->zName, zDb) ){ |
107064
|
26 |
53 |
if( pList==0 ){ |
107071
|
0 |
26 |
if( pList==0 ) goto exit_create_index; |
107081
|
132 |
79 |
for(i=0; inExpr; i++){ |
107084
|
0 |
132 |
if( pExpr->op==TK_COLLATE ){ |
107093
|
0 |
79 |
nExtraCol = pPk ? pPk->nKeyCol : 1; |
107096
|
0 |
79 |
if( db->mallocFailed ){ |
107110
|
0 |
79 |
if( pPIWhere ){ |
107119
|
58 |
21 |
if( pDb->pSchema->file_format>=4 ){ |
107134
|
132 |
79 |
for(i=0, pListItem=pList->a; inExpr; i++, pListItem++){ |
107141
|
0 |
132 |
if( pParse->nErr ) goto exit_create_index; |
107143
|
0 |
132 |
if( pCExpr->op!=TK_COLUMN ){ |
107144
|
0 |
0 |
if( pTab==pParse->pNewTable ){ |
107149
|
0 |
0 |
if( pIndex->aColExpr==0 ){ |
107152
|
0 |
0 |
if( !db->mallocFailed ){ |
107163
|
0 |
132 |
if( j<0 ){ |
107165
|
104 |
28 |
}else if( pTab->aCol[j].notNull==0 ){ |
107171
|
0 |
132 |
if( pListItem->pExpr->op==TK_COLLATE ){ |
107180
|
132 |
0 |
}else if( j>=0 ){ |
107183
|
132 |
0 |
if( !zColl ) zColl = sqlite3StrBINARY; |
107184
|
65 |
67 |
if( !db->init.busy && !sqlite3LocateCollSeq(pParse, zColl) ){ |
|
0 |
65 |
if( !db->init.busy && !sqlite3LocateCollSeq(pParse, zColl) ){ |
107196
|
0 |
79 |
if( pPk ){ |
107197
|
0 |
0 |
for(j=0; jnKeyCol; j++){ |
107200
|
0 |
0 |
if( hasColumn(pIndex->aiColumn, pIndex->nKeyCol, x) ){ |
107215
|
10 |
69 |
if( pParse->pNewTable==0 ) estimateIndexWidth(pIndex); |
107221
|
10 |
69 |
if( pTblName!=0 && pIndex->nColumn>=pTab->nCol ){ |
|
6 |
4 |
if( pTblName!=0 && pIndex->nColumn>=pTab->nCol ){ |
107223
|
10 |
2 |
for(j=0; jnCol; j++){ |
107224
|
2 |
8 |
if( j==pTab->iPKey ) continue; |
107225
|
4 |
4 |
if( sqlite3ColumnOfIndex(pIndex,j)>=0 ) continue; |
107231
|
69 |
10 |
if( pTab==pParse->pNewTable ){ |
107254
|
2 |
69 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
107260
|
0 |
2 |
if( pIdx->nKeyCol!=pIndex->nKeyCol ) continue; |
107261
|
2 |
0 |
for(k=0; knKeyCol; k++){ |
107265
|
2 |
0 |
if( pIdx->aiColumn[k]!=pIndex->aiColumn[k] ) break; |
107268
|
0 |
0 |
if( sqlite3StrICmp(z1, z2) ) break; |
107270
|
0 |
2 |
if( k==pIdx->nKeyCol ){ |
107271
|
0 |
0 |
if( pIdx->onError!=pIndex->onError ){ |
107279
|
0 |
0 |
if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){ |
|
0 |
0 |
if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){ |
107283
|
0 |
0 |
if( pIdx->onError==OE_Default ){ |
107287
|
0 |
0 |
if( idxType==SQLITE_IDXTYPE_PRIMARYKEY ) pIdx->idxType = idxType; |
107297
|
40 |
39 |
if( db->init.busy ){ |
107303
|
0 |
40 |
if( p ){ |
107309
|
5 |
35 |
if( pTblName!=0 ){ |
107327
|
0 |
39 |
else if( HasRowid(pTab) || pTblName!=0 ){ |
|
0 |
0 |
else if( HasRowid(pTab) || pTblName!=0 ){ |
107333
|
0 |
39 |
if( v==0 ) goto exit_create_index; |
107349
|
5 |
34 |
if( pStart ){ |
107351
|
3 |
2 |
if( pName->z[n-1]==';' ) n--; |
107353
|
3 |
2 |
zStmt = sqlite3MPrintf(db, "CREATE%s INDEX %.*s", |
107376
|
5 |
34 |
if( pTblName ){ |
107393
|
39 |
40 |
if( db->init.busy || pTblName==0 ){ |
|
34 |
5 |
if( db->init.busy || pTblName==0 ){ |
107394
|
0 |
74 |
if( onError!=OE_Replace || pTab->pIndex==0 |
|
0 |
0 |
if( onError!=OE_Replace || pTab->pIndex==0 |
107395
|
0 |
0 |
|| pTab->pIndex->onError==OE_Replace){ |
107400
|
0 |
0 |
while( pOther->pNext && pOther->pNext->onError!=OE_Replace ){ |
|
0 |
0 |
while( pOther->pNext && pOther->pNext->onError!=OE_Replace ){ |
107411
|
5 |
74 |
if( pIndex ) freeIndex(db, pIndex); |
107440
|
78 |
2 |
int nCopy = MIN(ArraySize(aVal), pIdx->nKeyCol); |
107450
|
0 |
80 |
if( pIdx->pPartIdxWhere!=0 ) a[0] -= 10; assert( 10==sqlite3LogEst(2) ); |
107451
|
0 |
80 |
if( a[0]<33 ) a[0] = 33; assert( 33==sqlite3LogEst(10) ); |
107456
|
2 |
80 |
for(i=nCopy+1; i<=pIdx->nKeyCol; i++){ |
107461
|
74 |
6 |
if( IsUniqueIndex(pIdx) ) a[pIdx->nKeyCol] = 0; |
107475
|
0 |
0 |
if( db->mallocFailed ){ |
107479
|
0 |
0 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ |
107483
|
0 |
0 |
if( pIndex==0 ){ |
107484
|
0 |
0 |
if( !ifExists ){ |
107492
|
0 |
0 |
if( pIndex->idxType!=SQLITE_IDXTYPE_APPDEF ){ |
107503
|
0 |
0 |
const char *zTab = SCHEMA_TABLE(iDb); |
107504
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){ |
107507
|
0 |
0 |
if( !OMIT_TEMPDB && iDb ) code = SQLITE_DROP_TEMP_INDEX; |
107508
|
0 |
0 |
if( sqlite3AuthCheck(pParse, code, pIndex->zName, pTab->zName, zDb) ){ |
107516
|
0 |
0 |
if( v ){ |
107558
|
2558 |
7 |
if( (n & (n-1))==0 ){ |
107559
|
80 |
2478 |
int sz = (n==0) ? 1 : 2*n; |
107561
|
0 |
2558 |
if( pNew==0 ){ |
107582
|
2286 |
84 |
if( pList==0 ){ |
107584
|
0 |
2286 |
if( pList==0 ) return 0; |
107593
|
0 |
2370 |
if( i<0 ){ |
107606
|
4749 |
2286 |
if( pList==0 ) return; |
107607
|
2370 |
2286 |
for(i=0; inId; i++){ |
107620
|
0 |
0 |
if( pList==0 ) return -1; |
107621
|
0 |
0 |
for(i=0; inId; i++){ |
107622
|
0 |
0 |
if( sqlite3StrICmp(pList->a[i].zName, zName)==0 ) return i; |
107661
|
3 |
0 |
if( (u32)pSrc->nSrc+nExtra>pSrc->nAlloc ){ |
107667
|
0 |
3 |
if( pNew==0 ){ |
107678
|
0 |
3 |
for(i=pSrc->nSrc-1; i>=iStart; i--){ |
107685
|
3 |
3 |
for(i=iStart; i
|
107737
|
4356 |
3 |
if( pList==0 ){ |
107739
|
0 |
4356 |
if( pList==0 ) return 0; |
107747
|
0 |
4359 |
if( db->mallocFailed ){ |
107752
|
1656 |
2703 |
if( pDatabase && pDatabase->z==0 ){ |
|
787 |
869 |
if( pDatabase && pDatabase->z==0 ){ |
107755
|
869 |
3490 |
if( pDatabase ){ |
107772
|
1815 |
0 |
if( pList ){ |
107773
|
1345 |
1802 |
for(i=0, pItem=pList->a; inSrc; i++, pItem++){ |
107774
|
13 |
1332 |
if( pItem->iCursor>=0 ) break; |
107776
|
35 |
1297 |
if( pItem->pSelect ){ |
107789
|
69 |
7466 |
if( pList==0 ) return; |
107790
|
4359 |
7466 |
for(pItem=pList->a, i=0; inSrc; i++, pItem++){ |
107794
|
0 |
4359 |
if( pItem->fg.isIndexedBy ) sqlite3DbFree(db, pItem->u1.zIndexedBy); |
107795
|
0 |
4359 |
if( pItem->fg.isTabFunc ) sqlite3ExprListDelete(db, pItem->u1.pFuncArg); |
107832
|
1327 |
3 |
if( !p && (pOn || pUsing) ){ |
|
1327 |
0 |
if( !p && (pOn || pUsing) ){ |
|
0 |
1327 |
if( !p && (pOn || pUsing) ){ |
107833
|
0 |
0 |
sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s", |
107839
|
0 |
1330 |
if( p==0 ){ |
107845
|
17 |
1313 |
if( pAlias->n ){ |
107867
|
1635 |
0 |
if( p && pIndexedBy->n>0 ){ |
|
0 |
1635 |
if( p && pIndexedBy->n>0 ){ |
107874
|
0 |
0 |
if( pIndexedBy->n==1 && !pIndexedBy->z ){ |
|
0 |
0 |
if( pIndexedBy->n==1 && !pIndexedBy->z ){ |
107890
|
0 |
0 |
if( p ){ |
107918
|
1327 |
0 |
if( p ){ |
107920
|
3 |
1327 |
for(i=p->nSrc-1; i>0; i--){ |
107938
|
0 |
133 |
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "BEGIN", 0, 0) ){ |
107942
|
0 |
133 |
if( !v ) return; |
107943
|
96 |
37 |
if( type!=TK_DEFERRED ){ |
107944
|
192 |
96 |
for(i=0; inDb; i++){ |
107945
|
12 |
180 |
sqlite3VdbeAddOp2(v, OP_Transaction, i, (type==TK_EXCLUSIVE)+1); |
107965
|
28 |
84 |
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, |
|
0 |
112 |
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, |
107970
|
112 |
0 |
if( v ){ |
107981
|
34 |
0 |
if( zName ){ |
107987
|
34 |
0 |
if( !v || sqlite3AuthCheck(pParse, SQLITE_SAVEPOINT, az[op], zName, 0) ){ |
|
0 |
34 |
if( !v || sqlite3AuthCheck(pParse, SQLITE_SAVEPOINT, az[op], zName, 0) ){ |
108001
|
31 |
2430 |
if( db->aDb[1].pBt==0 && !pParse->explain ){ |
|
31 |
0 |
if( db->aDb[1].pBt==0 && !pParse->explain ){ |
108012
|
0 |
31 |
if( rc!=SQLITE_OK ){ |
108020
|
0 |
31 |
if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize, -1, 0) ){ |
108035
|
0 |
5021 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
108041
|
4342 |
679 |
if( DbMaskTest(pToplevel->cookieMask, iDb)==0 ){ |
108043
|
2458 |
1884 |
if( !OMIT_TEMPDB && iDb==1 ){ |
108056
|
2 |
1 |
for(i=0; inDb; i++){ |
108058
|
1 |
1 |
if( pDb->pBt && (!zDb || 0==sqlite3StrICmp(zDb, pDb->zDbSName)) ){ |
|
0 |
1 |
if( pDb->pBt && (!zDb || 0==sqlite3StrICmp(zDb, pDb->zDbSName)) ){ |
|
0 |
0 |
if( pDb->pBt && (!zDb || 0==sqlite3StrICmp(zDb, pDb->zDbSName)) ){ |
108078
|
0 |
3318 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
108092
|
0 |
43 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
108113
|
0 |
169 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
108132
|
66 |
0 |
if( onError==OE_Abort ){ |
108153
|
0 |
26 |
if( pIdx->aColExpr ){ |
108156
|
37 |
26 |
for(j=0; jnKeyCol; j++){ |
108160
|
11 |
26 |
if( j ) sqlite3_str_append(&errMsg, ", ", 2); |
108167
|
19 |
7 |
sqlite3HaltConstraint(pParse, |
108184
|
34 |
0 |
if( pTab->iPKey>=0 ){ |
108204
|
0 |
0 |
for(i=0; inColumn; i++){ |
108207
|
0 |
0 |
if( pIndex->aiColumn[i]>=0 && 0==sqlite3StrICmp(z, zColl) ){ |
|
0 |
0 |
if( pIndex->aiColumn[i]>=0 && 0==sqlite3StrICmp(z, zColl) ){ |
108223
|
0 |
0 |
for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){ |
108224
|
0 |
0 |
if( zColl==0 || collationMatch(zColl, pIndex) ){ |
|
0 |
0 |
if( zColl==0 || collationMatch(zColl, pIndex) ){ |
108247
|
0 |
0 |
for(iDb=0, pDb=db->aDb; iDbnDb; iDb++, pDb++){ |
108249
|
0 |
0 |
for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){ |
108283
|
0 |
0 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ |
108287
|
0 |
0 |
if( pName1==0 ){ |
108290
|
0 |
0 |
}else if( NEVER(pName2==0) || pName2->z==0 ){ |
|
0 |
0 |
}else if( NEVER(pName2==0) || pName2->z==0 ){ |
108294
|
0 |
0 |
if( !zColl ) return; |
108296
|
0 |
0 |
if( pColl ){ |
108304
|
0 |
0 |
if( iDb<0 ) return; |
108306
|
0 |
0 |
if( z==0 ) return; |
108309
|
0 |
0 |
if( pTab ){ |
108316
|
0 |
0 |
if( pIndex ){ |
108336
|
0 |
82 |
if( pParse->nErr ) return 0; |
108337
|
6 |
76 |
if( pIdx->uniqNotNull ){ |
108342
|
82 |
0 |
if( pKey ){ |
108344
|
222 |
82 |
for(i=0; i
|
108346
|
1 |
221 |
pKey->aColl[i] = zColl==sqlite3StrBINARY ? 0 : |
108350
|
0 |
82 |
if( pParse->nErr ){ |
108352
|
0 |
0 |
if( pIdx->bNoQuery==0 ){ |
108389
|
0 |
0 |
if( zName && pWith ){ |
|
0 |
0 |
if( zName && pWith ){ |
108391
|
0 |
0 |
for(i=0; inCte; i++){ |
108392
|
0 |
0 |
if( sqlite3StrICmp(zName, pWith->a[i].zName)==0 ){ |
108398
|
0 |
0 |
if( pWith ){ |
108406
|
0 |
0 |
if( db->mallocFailed ){ |
108426
|
0 |
0 |
if( pWith ){ |
108428
|
0 |
0 |
for(i=0; inCte; i++){ |
108465
|
12 |
0 |
if( db->xCollNeeded ){ |
108467
|
0 |
12 |
if( !zExternal ) return; |
108472
|
0 |
12 |
if( db->xCollNeeded16 ){ |
108477
|
0 |
0 |
if( zExternal ){ |
108497
|
0 |
0 |
for(i=0; i<3; i++){ |
108499
|
0 |
0 |
if( pColl2->xCmp!=0 ){ |
108532
|
16 |
0 |
if( !p ){ |
108535
|
4 |
12 |
if( !p || !p->xCmp ){ |
|
0 |
4 |
if( !p || !p->xCmp ){ |
108542
|
16 |
0 |
if( p && !p->xCmp && synthCollSeq(db, p) ){ |
|
0 |
16 |
if( p && !p->xCmp && synthCollSeq(db, p) ){ |
|
0 |
0 |
if( p && !p->xCmp && synthCollSeq(db, p) ){ |
108546
|
0 |
16 |
if( p==0 ){ |
108565
|
1169 |
583 |
if( pColl && pColl->xCmp==0 ){ |
|
0 |
1169 |
if( pColl && pColl->xCmp==0 ){ |
108569
|
0 |
0 |
if( !p ){ |
108600
|
1652 |
1469 |
if( 0==pColl && create ){ |
|
820 |
832 |
if( 0==pColl && create ){ |
108603
|
820 |
0 |
if( pColl ){ |
108619
|
0 |
820 |
if( pDel!=0 ){ |
108651
|
3121 |
1106 |
if( zName ){ |
108658
|
3395 |
832 |
if( pColl ) pColl += enc-1; |
108699
|
0 |
14630 |
if( nArg==(-2) ) return (p->xSFunc==0) ? 0 : FUNC_PERFECT_MATCH; |
|
0 |
0 |
if( nArg==(-2) ) return (p->xSFunc==0) ? 0 : FUNC_PERFECT_MATCH; |
108702
|
8702 |
5928 |
if( p->nArg!=nArg && p->nArg>=0 ) return 0; |
|
8522 |
180 |
if( p->nArg!=nArg && p->nArg>=0 ) return 0; |
108706
|
5928 |
180 |
if( p->nArg==nArg ){ |
108713
|
1932 |
4176 |
if( enc==(p->funcFlags & SQLITE_FUNC_ENCMASK) ){ |
108715
|
1048 |
3128 |
}else if( (enc & p->funcFlags & 2)!=0 ){ |
108731
|
43837 |
18329 |
for(p=sqlite3BuiltinFunctions.a[h]; p; p=p->u.pHash){ |
108732
|
2061 |
41776 |
if( sqlite3StrICmp(p->zName, zFunc)==0 ){ |
108747
|
7210 |
309 |
for(i=0; i
|
108754
|
1545 |
5665 |
if( pOther ){ |
108807
|
13658 |
27228 |
while( p ){ |
108809
|
3996 |
9662 |
if( score>bestScore ){ |
108828
|
15612 |
11616 |
if( !createFlag && (pBest==0 || (db->mDbFlags & DBFLAG_PreferBuiltin)!=0) ){ |
|
2432 |
13180 |
if( !createFlag && (pBest==0 || (db->mDbFlags & DBFLAG_PreferBuiltin)!=0) ){ |
|
0 |
2432 |
if( !createFlag && (pBest==0 || (db->mDbFlags & DBFLAG_PreferBuiltin)!=0) ){ |
108832
|
972 |
13180 |
while( p ){ |
108834
|
548 |
424 |
if( score>bestScore ){ |
108846
|
11616 |
15612 |
if( createFlag && bestScore
|
|
11616 |
0 |
if( createFlag && bestScore
|
|
11616 |
0 |
if( createFlag && bestScore
|
108854
|
123564 |
11616 |
for(z=(u8*)pBest->zName; *z; z++) *z = sqlite3UpperToLower[*z]; |
108856
|
0 |
11616 |
if( pOther==pBest ){ |
108865
|
14564 |
12664 |
if( pBest && (pBest->xSFunc || createFlag) ){ |
|
11616 |
2948 |
if( pBest && (pBest->xSFunc || createFlag) ){ |
|
11616 |
0 |
if( pBest && (pBest->xSFunc || createFlag) ){ |
108889
|
0 |
545 |
for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){ |
108894
|
648 |
545 |
for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){ |
108901
|
383 |
162 |
if( pSchema->schemaFlags & DB_SchemaLoaded ){ |
108913
|
267 |
262 |
if( pBt ){ |
108918
|
0 |
529 |
if( !p ){ |
108920
|
529 |
0 |
}else if ( 0==p->file_format ){ |
108969
|
3008 |
0 |
if( pTab ){ |
108972
|
0 |
3008 |
if( sqlite3IndexedByLookup(pParse, pItem) ){ |
108994
|
22 |
2981 |
if( ( IsVirtual(pTab) |
108995
|
22 |
0 |
&& sqlite3GetVTable(pParse->db, pTab)->pMod->pModule->xUpdate==0 ) |
108996
|
314 |
2689 |
|| ( (pTab->tabFlags & TF_Readonly)!=0 |
108997
|
314 |
0 |
&& (pParse->db->flags & SQLITE_WriteSchema)==0 |
108998
|
0 |
314 |
&& pParse->nested==0 ) |
109005
|
3003 |
0 |
if( !viewOk && pTab->pSelect ){ |
|
0 |
3003 |
if( !viewOk && pTab->pSelect ){ |
109035
|
0 |
0 |
if( pFrom ){ |
109197
|
67 |
0 |
if( pParse->nErr || db->mallocFailed ){ |
|
67 |
0 |
if( pParse->nErr || db->mallocFailed ){ |
109209
|
0 |
67 |
if( pTab==0 ) goto delete_from_cleanup; |
109221
|
67 |
0 |
bComplex = pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0); |
|
0 |
67 |
bComplex = pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0); |
109239
|
0 |
67 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ){ |
109243
|
0 |
67 |
if( sqlite3IsReadOnly(pParse, pTab, (pTrigger?1:0)) ){ |
109251
|
2 |
65 |
if( rcauth==SQLITE_DENY ){ |
109260
|
10 |
65 |
for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){ |
109266
|
0 |
65 |
if( isView ){ |
109273
|
0 |
65 |
if( v==0 ){ |
109276
|
58 |
7 |
if( pParse->nested==0 ) sqlite3VdbeCountChanges(v); |
109283
|
0 |
65 |
if( isView ){ |
109298
|
0 |
65 |
if( sqlite3ResolveExprNames(&sNC, pWhere) ){ |
109305
|
0 |
65 |
if( (db->flags & SQLITE_CountRows)!=0 |
109306
|
0 |
0 |
&& !pParse->nested |
109307
|
0 |
0 |
&& !pParse->pTriggerTab |
109325
|
65 |
0 |
if( rcauth==SQLITE_OK |
109326
|
32 |
33 |
&& pWhere==0 |
109327
|
32 |
0 |
&& !bComplex |
109328
|
32 |
0 |
&& !IsVirtual(pTab) |
109335
|
32 |
0 |
if( HasRowid(pTab) ){ |
109336
|
0 |
32 |
sqlite3VdbeAddOp4(v, OP_Clear, pTab->tnum, iDb, memCnt ? memCnt : -1, |
109339
|
1 |
32 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
109347
|
0 |
33 |
if( sNC.ncFlags & NC_VarSelect ) bComplex = 1; |
109348
|
0 |
33 |
wcf |= (bComplex ? 0 : WHERE_ONEPASS_MULTIROW); |
109349
|
33 |
0 |
if( HasRowid(pTab) ){ |
109377
|
0 |
33 |
if( pWInfo==0 ) goto delete_from_cleanup; |
109381
|
28 |
5 |
if( eOnePass!=ONEPASS_SINGLE ) sqlite3MultiWrite(pParse); |
109384
|
0 |
33 |
if( memCnt ){ |
109389
|
0 |
33 |
if( pPk ){ |
109390
|
0 |
0 |
for(i=0; i
|
109399
|
20 |
13 |
if( iKey>pParse->nMem ) pParse->nMem = iKey; |
109402
|
32 |
1 |
if( eOnePass!=ONEPASS_OFF ){ |
109408
|
0 |
32 |
if( aToOpen==0 ){ |
109414
|
32 |
0 |
if( aiCurOnePass[0]>=0 ) aToOpen[aiCurOnePass[0]-iTabCur] = 0; |
109415
|
9 |
23 |
if( aiCurOnePass[1]>=0 ) aToOpen[aiCurOnePass[1]-iTabCur] = 0; |
109416
|
0 |
32 |
if( addrEphOpen ) sqlite3VdbeChangeToNoop(v, addrEphOpen); |
109418
|
0 |
1 |
if( pPk ){ |
109434
|
32 |
1 |
if( eOnePass!=ONEPASS_OFF ){ |
109445
|
33 |
0 |
if( !isView ){ |
109447
|
27 |
6 |
if( eOnePass==ONEPASS_MULTI ){ |
109455
|
27 |
6 |
if( eOnePass==ONEPASS_MULTI ) sqlite3VdbeJumpHere(v, iAddrOnce); |
109461
|
32 |
1 |
if( eOnePass!=ONEPASS_OFF ){ |
109463
|
32 |
0 |
if( !IsVirtual(pTab) && aToOpen[iDataCur-iTabCur] ){ |
|
0 |
32 |
if( !IsVirtual(pTab) && aToOpen[iDataCur-iTabCur] ){ |
109468
|
0 |
1 |
}else if( pPk ){ |
109470
|
0 |
0 |
if( IsVirtual(pTab) ){ |
109484
|
1 |
32 |
if( IsVirtual(pTab) ){ |
109489
|
0 |
1 |
if( eOnePass==ONEPASS_SINGLE ){ |
109491
|
0 |
0 |
if( sqlite3IsToplevel(pParse) ){ |
109506
|
32 |
1 |
if( eOnePass!=ONEPASS_OFF ){ |
109509
|
0 |
1 |
}else if( pPk ){ |
109522
|
58 |
7 |
if( pParse->nested==0 && pParse->pTriggerTab==0 ){ |
|
58 |
0 |
if( pParse->nested==0 && pParse->pTriggerTab==0 ){ |
109530
|
0 |
65 |
if( memCnt ){ |
109625
|
40 |
0 |
opSeek = HasRowid(pTab) ? OP_NotExists : OP_NotFound; |
109626
|
8 |
32 |
if( eMode==ONEPASS_OFF ){ |
109634
|
40 |
0 |
if( sqlite3FkRequired(pParse, pTab, 0, 0) || pTrigger ){ |
|
0 |
40 |
if( sqlite3FkRequired(pParse, pTab, 0, 0) || pTrigger ){ |
109651
|
0 |
0 |
for(iCol=0; iColnCol; iCol++){ |
109654
|
0 |
0 |
if( mask==0xffffffff || (iCol<=31 && (mask & MASKBIT32(iCol))!=0) ){ |
|
0 |
0 |
if( mask==0xffffffff || (iCol<=31 && (mask & MASKBIT32(iCol))!=0) ){ |
|
0 |
0 |
if( mask==0xffffffff || (iCol<=31 && (mask & MASKBIT32(iCol))!=0) ){ |
109673
|
0 |
0 |
if( addrStart
|
109697
|
40 |
0 |
if( pTab->pSelect==0 ){ |
109701
|
7 |
33 |
if( pParse->nested==0 || 0==sqlite3_stricmp(pTab->zName, "sqlite_stat1") ){ |
|
0 |
7 |
if( pParse->nested==0 || 0==sqlite3_stricmp(pTab->zName, "sqlite_stat1") ){ |
109704
|
32 |
8 |
if( eMode!=ONEPASS_OFF ){ |
109707
|
17 |
23 |
if( iIdxNoSeek>=0 && iIdxNoSeek!=iDataCur ){ |
|
17 |
0 |
if( iIdxNoSeek>=0 && iIdxNoSeek!=iDataCur ){ |
109710
|
27 |
13 |
if( eMode==ONEPASS_MULTI ) p5 |= OPFLAG_SAVEPOSITION; |
109766
|
0 |
313 |
pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab); |
109767
|
17 |
313 |
for(i=0, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){ |
109769
|
0 |
17 |
if( aRegIdx!=0 && aRegIdx[i]==0 ) continue; |
|
0 |
0 |
if( aRegIdx!=0 && aRegIdx[i]==0 ) continue; |
109770
|
0 |
17 |
if( pIdx==pPk ) continue; |
109771
|
17 |
0 |
if( iIdxCur+i==iIdxNoSeek ) continue; |
109775
|
0 |
0 |
sqlite3VdbeAddOp3(v, OP_IdxDelete, iIdxCur+i, r1, |
109828
|
5 |
1 |
if( piPartIdxLabel ){ |
109829
|
0 |
5 |
if( pIdx->pPartIdxWhere ){ |
109840
|
0 |
6 |
nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn; |
|
0 |
0 |
nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn; |
109842
|
0 |
6 |
if( pPrior && (regBase!=regPrior || pPrior->pPartIdxWhere) ) pPrior = 0; |
|
0 |
0 |
if( pPrior && (regBase!=regPrior || pPrior->pPartIdxWhere) ) pPrior = 0; |
|
0 |
0 |
if( pPrior && (regBase!=regPrior || pPrior->pPartIdxWhere) ) pPrior = 0; |
109843
|
14 |
6 |
for(j=0; j
|
109844
|
0 |
14 |
if( pPrior |
109845
|
0 |
0 |
&& pPrior->aiColumn[j]==pIdx->aiColumn[j] |
109846
|
0 |
0 |
&& pPrior->aiColumn[j]!=XN_EXPR |
109860
|
6 |
0 |
if( regOut ){ |
109862
|
0 |
6 |
if( pIdx->pTable->pSelect ){ |
109877
|
0 |
5 |
if( iLabel ){ |
109941
|
0 |
0 |
mask = sqlite3_user_data(context)==0 ? 0 : -1; |
109946
|
0 |
0 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; |
109947
|
0 |
0 |
for(i=1; i
|
109948
|
0 |
0 |
if( sqlite3_value_type(argv[i])==SQLITE_NULL ) return; |
109949
|
0 |
0 |
if( (sqlite3MemCompare(argv[iBest], argv[i], pColl)^mask)>=0 ){ |
110003
|
0 |
13 |
if( z==0 ) return; |
110005
|
144 |
13 |
while( (c = *z)!=0 ){ |
110007
|
3 |
141 |
if( c>=0xc0 ){ |
110008
|
4 |
3 |
while( (*z & 0xc0)==0x80 ){ z++; z0++; } |
110033
|
0 |
0 |
if( iVal<0 ){ |
110034
|
0 |
0 |
if( iVal==SMALLEST_INT64 ){ |
110058
|
0 |
0 |
if( rVal<0 ) rVal = -rVal; |
110092
|
0 |
0 |
if( typeHaystack==SQLITE_NULL || typeNeedle==SQLITE_NULL ) return; |
|
0 |
0 |
if( typeHaystack==SQLITE_NULL || typeNeedle==SQLITE_NULL ) return; |
110095
|
0 |
0 |
if( nNeedle>0 ){ |
110096
|
0 |
0 |
if( typeHaystack==SQLITE_BLOB && typeNeedle==SQLITE_BLOB ){ |
|
0 |
0 |
if( typeHaystack==SQLITE_BLOB && typeNeedle==SQLITE_BLOB ){ |
110105
|
0 |
0 |
if( zNeedle==0 || (nHaystack && zHaystack==0) ) return; |
|
0 |
0 |
if( zNeedle==0 || (nHaystack && zHaystack==0) ) return; |
|
0 |
0 |
if( zNeedle==0 || (nHaystack && zHaystack==0) ) return; |
110106
|
0 |
0 |
while( nNeedle<=nHaystack && memcmp(zHaystack, zNeedle, nNeedle)!=0 ){ |
|
0 |
0 |
while( nNeedle<=nHaystack && memcmp(zHaystack, zNeedle, nNeedle)!=0 ){ |
110111
|
0 |
0 |
}while( isText && (zHaystack[0]&0xc0)==0x80 ); |
|
0 |
0 |
}while( isText && (zHaystack[0]&0xc0)==0x80 ); |
110113
|
0 |
0 |
if( nNeedle>nHaystack ) N = 0; |
110132
|
0 |
0 |
if( argc>=1 && (zFormat = (const char*)sqlite3_value_text(argv[0]))!=0 ){ |
|
0 |
0 |
if( argc>=1 && (zFormat = (const char*)sqlite3_value_text(argv[0]))!=0 ){ |
110170
|
0 |
0 |
if( sqlite3_value_type(argv[1])==SQLITE_NULL |
110171
|
0 |
0 |
|| (argc==3 && sqlite3_value_type(argv[2])==SQLITE_NULL) |
|
0 |
0 |
|| (argc==3 && sqlite3_value_type(argv[2])==SQLITE_NULL) |
110177
|
0 |
0 |
if( p0type==SQLITE_BLOB ){ |
110180
|
0 |
0 |
if( z==0 ) return; |
110184
|
0 |
0 |
if( z==0 ) return; |
110186
|
0 |
0 |
if( p1<0 ){ |
110187
|
0 |
0 |
for(z2=z; *z2; len++){ |
110188
|
0 |
0 |
SQLITE_SKIP_UTF8(z2); |
|
0 |
0 |
SQLITE_SKIP_UTF8(z2); |
110200
|
0 |
0 |
if( argc==3 ){ |
110202
|
0 |
0 |
if( p2<0 ){ |
110209
|
0 |
0 |
if( p1<0 ){ |
110211
|
0 |
0 |
if( p1<0 ){ |
110213
|
0 |
0 |
if( p2<0 ) p2 = 0; |
110216
|
0 |
0 |
}else if( p1>0 ){ |
110218
|
0 |
0 |
}else if( p2>0 ){ |
110221
|
0 |
0 |
if( negP2 ){ |
110223
|
0 |
0 |
if( p1<0 ){ |
110229
|
0 |
0 |
if( p0type!=SQLITE_BLOB ){ |
110230
|
0 |
0 |
while( *z && p1 ){ |
|
0 |
0 |
while( *z && p1 ){ |
110231
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
110234
|
0 |
0 |
for(z2=z; *z2 && p2; p2--){ |
|
0 |
0 |
for(z2=z; *z2 && p2; p2--){ |
110235
|
0 |
0 |
SQLITE_SKIP_UTF8(z2); |
|
0 |
0 |
SQLITE_SKIP_UTF8(z2); |
110240
|
0 |
0 |
if( p1+p2>len ){ |
110242
|
0 |
0 |
if( p2<0 ) p2 = 0; |
110257
|
0 |
0 |
if( argc==2 ){ |
110258
|
0 |
0 |
if( SQLITE_NULL==sqlite3_value_type(argv[1]) ) return; |
110260
|
0 |
0 |
if( n>30 ) n = 30; |
110261
|
0 |
0 |
if( n<0 ) n = 0; |
110263
|
0 |
0 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; |
110269
|
0 |
0 |
if( n==0 && r>=0 && r
|
|
0 |
0 |
if( n==0 && r>=0 && r
|
|
0 |
0 |
if( n==0 && r>=0 && r
|
110271
|
0 |
0 |
}else if( n==0 && r<0 && (-r)
|
|
0 |
0 |
}else if( n==0 && r<0 && (-r)
|
|
0 |
0 |
}else if( n==0 && r<0 && (-r)
|
110275
|
0 |
0 |
if( zBuf==0 ){ |
110299
|
0 |
20 |
if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
110304
|
0 |
20 |
if( !z ){ |
110323
|
20 |
0 |
if( z2 ){ |
110325
|
20 |
0 |
if( z1 ){ |
110326
|
100 |
20 |
for(i=0; i
|
110342
|
0 |
0 |
if( z2 ){ |
110344
|
0 |
0 |
if( z1 ){ |
110345
|
0 |
0 |
for(i=0; i
|
110374
|
0 |
0 |
if( r<0 ){ |
110402
|
0 |
0 |
if( n<1 ){ |
110406
|
0 |
0 |
if( p ){ |
110550
|
710 |
56 |
while( (c = Utf8Read(zPattern))!=0 ){ |
|
703 |
63 |
while( (c = Utf8Read(zPattern))!=0 ){ |
110551
|
149 |
554 |
if( c==matchAll ){ /* Match "*" */ |
110555
|
149 |
0 |
while( (c=Utf8Read(zPattern)) == matchAll || c == matchOne ){ |
|
0 |
149 |
while( (c=Utf8Read(zPattern)) == matchAll || c == matchOne ){ |
|
0 |
149 |
while( (c=Utf8Read(zPattern)) == matchAll || c == matchOne ){ |
110556
|
0 |
0 |
if( c==matchOne && sqlite3Utf8Read(&zString)==0 ){ |
|
0 |
0 |
if( c==matchOne && sqlite3Utf8Read(&zString)==0 ){ |
110560
|
22 |
127 |
if( c==0 ){ |
110562
|
0 |
127 |
}else if( c==matchOther ){ |
110563
|
0 |
0 |
if( pInfo->matchSet==0 ){ |
110565
|
0 |
0 |
if( c==0 ) return SQLITE_NOWILDCARDMATCH; |
110570
|
0 |
0 |
while( *zString ){ |
110572
|
0 |
0 |
if( bMatch!=SQLITE_NOMATCH ) return bMatch; |
110573
|
0 |
0 |
SQLITE_SKIP_UTF8(zString); |
|
0 |
0 |
SQLITE_SKIP_UTF8(zString); |
110588
|
127 |
0 |
if( c<=0x80 ){ |
110591
|
127 |
0 |
if( noCase ){ |
110601
|
110 |
212 |
if( zString[0]==0 ) break; |
110604
|
17 |
195 |
if( bMatch!=SQLITE_NOMATCH ) return bMatch; |
110608
|
0 |
0 |
while( (c2 = Utf8Read(zString))!=0 ){ |
|
0 |
0 |
while( (c2 = Utf8Read(zString))!=0 ){ |
110609
|
0 |
0 |
if( c2!=c ) continue; |
110611
|
0 |
0 |
if( bMatch!=SQLITE_NOMATCH ) return bMatch; |
110616
|
9 |
545 |
if( c==matchOther ){ |
110617
|
9 |
0 |
if( pInfo->matchSet==0 ){ |
110619
|
0 |
9 |
if( c==0 ) return SQLITE_NOMATCH; |
110626
|
0 |
0 |
if( c==0 ) return SQLITE_NOMATCH; |
110628
|
0 |
0 |
if( c2=='^' ){ |
110632
|
0 |
0 |
if( c2==']' ){ |
110633
|
0 |
0 |
if( c==']' ) seen = 1; |
110636
|
0 |
0 |
while( c2 && c2!=']' ){ |
|
0 |
0 |
while( c2 && c2!=']' ){ |
110637
|
0 |
0 |
if( c2=='-' && zPattern[0]!=']' && zPattern[0]!=0 && prior_c>0 ){ |
|
0 |
0 |
if( c2=='-' && zPattern[0]!=']' && zPattern[0]!=0 && prior_c>0 ){ |
|
0 |
0 |
if( c2=='-' && zPattern[0]!=']' && zPattern[0]!=0 && prior_c>0 ){ |
|
0 |
0 |
if( c2=='-' && zPattern[0]!=']' && zPattern[0]!=0 && prior_c>0 ){ |
110639
|
0 |
0 |
if( c>=prior_c && c<=c2 ) seen = 1; |
|
0 |
0 |
if( c>=prior_c && c<=c2 ) seen = 1; |
110642
|
0 |
0 |
if( c==c2 ){ |
110649
|
0 |
0 |
if( c2==0 || (seen ^ invert)==0 ){ |
|
0 |
0 |
if( c2==0 || (seen ^ invert)==0 ){ |
110655
|
526 |
28 |
c2 = Utf8Read(zString); |
110656
|
236 |
318 |
if( c==c2 ) continue; |
110657
|
318 |
0 |
if( noCase && sqlite3Tolower(c)==sqlite3Tolower(c2) && c<0x80 && c2<0x80 ){ |
|
54 |
264 |
if( noCase && sqlite3Tolower(c)==sqlite3Tolower(c2) && c<0x80 && c2<0x80 ){ |
|
54 |
0 |
if( noCase && sqlite3Tolower(c)==sqlite3Tolower(c2) && c<0x80 && c2<0x80 ){ |
|
54 |
0 |
if( noCase && sqlite3Tolower(c)==sqlite3Tolower(c2) && c<0x80 && c2<0x80 ){ |
110660
|
3 |
261 |
if( c==matchOne && zPattern!=zEscaped && c2!=0 ) continue; |
|
1 |
2 |
if( c==matchOne && zPattern!=zEscaped && c2!=0 ) continue; |
|
1 |
0 |
if( c==matchOne && zPattern!=zEscaped && c2!=0 ) continue; |
110735
|
0 |
132 |
if( nPat > db->aLimit[SQLITE_LIMIT_LIKE_PATTERN_LENGTH] ){ |
110741
|
0 |
132 |
if( argc==3 ){ |
110746
|
0 |
0 |
if( zEsc==0 ) return; |
110747
|
0 |
0 |
if( sqlite3Utf8CharLen((char*)zEsc, -1)!=1 ){ |
110756
|
132 |
0 |
if( zA && zB ){ |
|
132 |
0 |
if( zA && zB ){ |
110777
|
0 |
0 |
if( sqlite3MemCompare(argv[0], argv[1], pColl)!=0 ){ |
110846
|
0 |
0 |
if( (zOptName = (const char*)sqlite3_value_text(argv[0]))!=0 ){ |
110898
|
0 |
0 |
if( r1!=r2 ){ |
110914
|
0 |
0 |
if( zText ){ |
110916
|
0 |
0 |
for(i=0; i
|
110935
|
0 |
0 |
if( zArg==0 ) return; |
110936
|
0 |
0 |
for(i=0, n=0; zArg[i]; i++){ if( zArg[i]=='\'' ) n++; } |
|
0 |
0 |
for(i=0, n=0; zArg[i]; i++){ if( zArg[i]=='\'' ) n++; } |
110938
|
0 |
0 |
if( z ){ |
110940
|
0 |
0 |
for(i=0, j=1; zArg[i]; i++){ |
110942
|
0 |
0 |
if( zArg[i]=='\'' ){ |
110971
|
0 |
0 |
if( z && z[0] ) sqlite3_result_int(context, sqlite3Utf8Read(&z)); |
|
0 |
0 |
if( z && z[0] ) sqlite3_result_int(context, sqlite3Utf8Read(&z)); |
110987
|
0 |
0 |
if( z==0 ){ |
110991
|
0 |
0 |
for(i=0; i
|
110995
|
0 |
0 |
if( x<0 || x>0x10ffff ) x = 0xfffd; |
|
0 |
0 |
if( x<0 || x>0x10ffff ) x = 0xfffd; |
110997
|
0 |
0 |
if( c<0x00080 ){ |
110999
|
0 |
0 |
}else if( c<0x00800 ){ |
111002
|
0 |
0 |
}else if( c<0x10000 ){ |
111034
|
0 |
0 |
if( zHex ){ |
111035
|
0 |
0 |
for(i=0; i
|
111058
|
0 |
1 |
if( n<0 ) n = 0; |
111060
|
0 |
1 |
if( rc ){ |
111092
|
0 |
0 |
if( zStr==0 ) return; |
111096
|
0 |
0 |
if( zPattern==0 ){ |
111101
|
0 |
0 |
if( zPattern[0]==0 ){ |
111109
|
0 |
0 |
if( zRep==0 ) return; |
111115
|
0 |
0 |
if( zOut==0 ){ |
111120
|
0 |
0 |
for(i=j=0; i<=loopLimit; i++){ |
111121
|
0 |
0 |
if( zStr[i]!=zPattern[0] || memcmp(&zStr[i], zPattern, nPattern) ){ |
|
0 |
0 |
if( zStr[i]!=zPattern[0] || memcmp(&zStr[i], zPattern, nPattern) ){ |
111124
|
0 |
0 |
if( nRep>nPattern ){ |
111128
|
0 |
0 |
if( nOut-1>db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
111134
|
0 |
0 |
if( (cntExpand&(cntExpand-1))==0 ){ |
111140
|
0 |
0 |
if( zOut==0 ){ |
111178
|
0 |
6 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ){ |
111182
|
0 |
6 |
if( zIn==0 ) return; |
111185
|
6 |
0 |
if( argc==1 ){ |
111192
|
0 |
0 |
}else if( (zCharSet = sqlite3_value_text(argv[1]))==0 ){ |
111196
|
0 |
0 |
for(z=zCharSet, nChar=0; *z; nChar++){ |
111197
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
111199
|
0 |
0 |
if( nChar>0 ){ |
111201
|
0 |
0 |
if( azChar==0 ){ |
111205
|
0 |
0 |
for(z=zCharSet, nChar=0; *z; nChar++){ |
111207
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
111212
|
6 |
0 |
if( nChar>0 ){ |
111214
|
6 |
0 |
if( flags & 1 ){ |
111215
|
6 |
0 |
while( nIn>0 ){ |
111217
|
6 |
6 |
for(i=0; i
|
111219
|
6 |
0 |
if( len<=nIn && memcmp(zIn, azChar[i], len)==0 ) break; |
|
0 |
6 |
if( len<=nIn && memcmp(zIn, azChar[i], len)==0 ) break; |
111221
|
6 |
0 |
if( i>=nChar ) break; |
111226
|
6 |
0 |
if( flags & 2 ){ |
111227
|
6 |
0 |
while( nIn>0 ){ |
111229
|
6 |
6 |
for(i=0; i
|
111231
|
6 |
0 |
if( len<=nIn && memcmp(&zIn[nIn-len],azChar[i],len)==0 ) break; |
|
0 |
6 |
if( len<=nIn && memcmp(&zIn[nIn-len],azChar[i],len)==0 ) break; |
111233
|
6 |
0 |
if( i>=nChar ) break; |
111237
|
0 |
6 |
if( zCharSet ){ |
111338
|
0 |
0 |
if( (db->flags & SQLITE_LoadExtFunc)==0 ){ |
111343
|
0 |
0 |
if( argc==2 ){ |
111348
|
0 |
0 |
if( zFile && sqlite3_load_extension(db, zFile, zProc, &zErrMsg) ){ |
|
0 |
0 |
if( zFile && sqlite3_load_extension(db, zFile, zProc, &zErrMsg) ){ |
111386
|
10 |
0 |
if( p && type!=SQLITE_NULL ){ |
|
10 |
0 |
if( p && type!=SQLITE_NULL ){ |
111388
|
10 |
0 |
if( type==SQLITE_INTEGER ){ |
111391
|
10 |
0 |
if( (p->approx|p->overflow)==0 && sqlite3AddInt64(&p->iSum, v) ){ |
|
0 |
10 |
if( (p->approx|p->overflow)==0 && sqlite3AddInt64(&p->iSum, v) ){ |
111403
|
5 |
0 |
if( p && p->cnt>0 ){ |
|
5 |
0 |
if( p && p->cnt>0 ){ |
111404
|
0 |
5 |
if( p->overflow ){ |
111406
|
0 |
5 |
}else if( p->approx ){ |
111416
|
0 |
0 |
if( p && p->cnt>0 ){ |
|
0 |
0 |
if( p && p->cnt>0 ){ |
111424
|
0 |
0 |
sqlite3_result_double(context, p ? p->rSum : (double)0); |
111442
|
247 |
50 |
if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && p ){ |
|
247 |
0 |
if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && p ){ |
|
297 |
0 |
if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && p ){ |
111458
|
33 |
4 |
sqlite3_result_int64(context, p ? p->n : 0); |
111474
|
0 |
19 |
if( !pBest ) return; |
111476
|
0 |
19 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ){ |
111477
|
0 |
0 |
if( pBest->flags ) sqlite3SkipAccumulatorLoad(context); |
111478
|
0 |
19 |
}else if( pBest->flags ){ |
111492
|
0 |
0 |
if( (max && cmp<0) || (!max && cmp>0) ){ |
|
0 |
0 |
if( (max && cmp<0) || (!max && cmp>0) ){ |
|
0 |
0 |
if( (max && cmp<0) || (!max && cmp>0) ){ |
|
0 |
0 |
if( (max && cmp<0) || (!max && cmp>0) ){ |
111505
|
19 |
33 |
if( pRes ){ |
111506
|
19 |
0 |
if( pRes->flags ){ |
111526
|
0 |
0 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; |
111529
|
0 |
0 |
if( pAccum ){ |
111533
|
0 |
0 |
if( !firstTerm ){ |
111534
|
0 |
0 |
if( argc==2 ){ |
111541
|
0 |
0 |
if( zSep ) sqlite3_str_append(pAccum, zSep, nSep); |
111545
|
0 |
0 |
if( zVal ) sqlite3_str_append(pAccum, zVal, nVal); |
111551
|
0 |
0 |
if( pAccum ){ |
111552
|
0 |
0 |
if( pAccum->accError==SQLITE_TOOBIG ){ |
111554
|
0 |
0 |
}else if( pAccum->accError==SQLITE_NOMEM ){ |
111571
|
0 |
262 |
if( rc==SQLITE_NOMEM ){ |
111582
|
0 |
0 |
if( ALWAYS(pDef) ){ |
111594
|
0 |
0 |
if( caseSensitive ){ |
111604
|
0 |
0 |
setLikeOptFlag(db, "like", |
111628
|
202 |
1643 |
if( pExpr->op!=TK_FUNCTION || !pExpr->x.pList ){ |
|
0 |
202 |
if( pExpr->op!=TK_FUNCTION || !pExpr->x.pList ){ |
111634
|
202 |
0 |
if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_LIKE)==0 ){ |
|
83 |
119 |
if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_LIKE)==0 ){ |
111637
|
119 |
0 |
if( nExpr<3 ){ |
111642
|
0 |
0 |
if( pEscape->op!=TK_STRING ) return 0; |
111644
|
0 |
0 |
if( zEscape[0]==0 || zEscape[1]!=0 ) return 0; |
|
0 |
0 |
if( zEscape[0]==0 || zEscape[1]!=0 ) return 0; |
112005
|
10 |
0 |
if( nCol==1 ){ |
112013
|
10 |
0 |
if( pParent->iPKey>=0 ){ |
112014
|
0 |
10 |
if( !zKey ) return 0; |
112015
|
10 |
0 |
if( !sqlite3StrICmp(pParent->aCol[pParent->iPKey].zName, zKey) ) return 0; |
112017
|
0 |
0 |
}else if( paiCol ){ |
112020
|
0 |
0 |
if( !aiCol ) return 1; |
112024
|
0 |
0 |
for(pIdx=pParent->pIndex; pIdx; pIdx=pIdx->pNext){ |
112025
|
0 |
0 |
if( pIdx->nKeyCol==nCol && IsUniqueIndex(pIdx) && pIdx->pPartIdxWhere==0 ){ |
|
0 |
0 |
if( pIdx->nKeyCol==nCol && IsUniqueIndex(pIdx) && pIdx->pPartIdxWhere==0 ){ |
|
0 |
0 |
if( pIdx->nKeyCol==nCol && IsUniqueIndex(pIdx) && pIdx->pPartIdxWhere==0 ){ |
112030
|
0 |
0 |
if( zKey==0 ){ |
112034
|
0 |
0 |
if( IsPrimaryKeyIndex(pIdx) ){ |
112035
|
0 |
0 |
if( aiCol ){ |
112037
|
0 |
0 |
for(i=0; iaCol[i].iFrom; |
112047
|
0 |
0 |
for(i=0; i
|
112052
|
0 |
0 |
if( iCol<0 ) break; /* No foreign keys against expression indexes */ |
112058
|
0 |
0 |
if( !zDfltColl ) zDfltColl = sqlite3StrBINARY; |
112059
|
0 |
0 |
if( sqlite3StrICmp(pIdx->azColl[i], zDfltColl) ) break; |
112062
|
0 |
0 |
for(j=0; j
|
112063
|
0 |
0 |
if( sqlite3StrICmp(pFKey->aCol[j].zCol, zIdxCol)==0 ){ |
112064
|
0 |
0 |
if( aiCol ) aiCol[i] = pFKey->aCol[j].iFrom; |
112068
|
0 |
0 |
if( j==nCol ) break; |
112070
|
0 |
0 |
if( i==nCol ) break; /* pIdx is usable */ |
112075
|
0 |
0 |
if( !pIdx ){ |
112076
|
0 |
0 |
if( !pParse->disableTriggers ){ |
112144
|
2 |
8 |
if( nIncr<0 ){ |
112148
|
10 |
10 |
for(i=0; inCol; i++){ |
112153
|
10 |
0 |
if( isIgnore==0 ){ |
112154
|
10 |
0 |
if( pIdx==0 ){ |
112173
|
0 |
10 |
if( pTab==pFKey->pFrom && nIncr==1 ){ |
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr==1 ){ |
112191
|
0 |
0 |
for(i=0; i
|
112205
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr==1 ){ |
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr==1 ){ |
112207
|
0 |
0 |
for(i=0; i
|
112212
|
0 |
0 |
if( pIdx->aiColumn[i]==pTab->iPKey ){ |
112231
|
10 |
0 |
if( !pFKey->isDeferred && !(pParse->db->flags & SQLITE_DeferFKs) |
|
10 |
0 |
if( !pFKey->isDeferred && !(pParse->db->flags & SQLITE_DeferFKs) |
112232
|
10 |
0 |
&& !pParse->pToplevel |
112233
|
6 |
4 |
&& !pParse->isMultiWrite |
112243
|
2 |
2 |
if( nIncr>0 && pFKey->isDeferred==0 ){ |
|
2 |
0 |
if( nIncr>0 && pFKey->isDeferred==0 ){ |
112274
|
0 |
0 |
if( pExpr ){ |
112275
|
0 |
0 |
if( iCol>=0 && iCol!=pTab->iPKey ){ |
|
0 |
0 |
if( iCol>=0 && iCol!=pTab->iPKey ){ |
112280
|
0 |
0 |
if( zColl==0 ) zColl = db->pDfltColl->zName; |
112301
|
0 |
0 |
if( pExpr ){ |
112364
|
0 |
0 |
if( nIncr<0 ){ |
112377
|
0 |
0 |
for(i=0; inCol; i++){ |
112384
|
0 |
0 |
iCol = pIdx ? pIdx->aiColumn[i] : -1; |
112386
|
0 |
0 |
iCol = aiCol ? aiCol[i] : pFKey->aCol[0].iFrom; |
112405
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr>0 ){ |
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr>0 ){ |
112409
|
0 |
0 |
if( HasRowid(pTab) ){ |
112417
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
112439
|
0 |
0 |
if( pParse->nErr==0 ){ |
112442
|
0 |
0 |
if( pWInfo ){ |
112449
|
0 |
0 |
if( iFkIfZero ){ |
112481
|
0 |
32 |
if( p ){ |
112510
|
0 |
7 |
if( (db->flags&SQLITE_ForeignKeys) && !IsVirtual(pTab) && !pTab->pSelect ){ |
|
0 |
0 |
if( (db->flags&SQLITE_ForeignKeys) && !IsVirtual(pTab) && !pTab->pSelect ){ |
|
0 |
0 |
if( (db->flags&SQLITE_ForeignKeys) && !IsVirtual(pTab) && !pTab->pSelect ){ |
112515
|
0 |
0 |
if( sqlite3FkReferences(pTab)==0 ){ |
112522
|
0 |
0 |
for(p=pTab->pFKey; p; p=p->pNextFrom){ |
112523
|
0 |
0 |
if( p->isDeferred || (db->flags & SQLITE_DeferFKs) ) break; |
|
0 |
0 |
if( p->isDeferred || (db->flags & SQLITE_DeferFKs) ) break; |
112525
|
0 |
0 |
if( !p ) return; |
112543
|
0 |
0 |
if( (db->flags & SQLITE_DeferFKs)==0 ){ |
112551
|
0 |
0 |
if( iSkip ){ |
112577
|
6 |
0 |
for(i=0; inCol; i++){ |
112579
|
6 |
0 |
if( aChange[iChildKey]>=0 ) return 1; |
112580
|
0 |
0 |
if( iChildKey==pTab->iPKey && bChngRowid ) return 1; |
|
0 |
0 |
if( iChildKey==pTab->iPKey && bChngRowid ) return 1; |
112604
|
0 |
0 |
for(i=0; inCol; i++){ |
112607
|
0 |
0 |
for(iKey=0; iKeynCol; iKey++){ |
112608
|
0 |
0 |
if( aChange[iKey]>=0 || (iKey==pTab->iPKey && bChngRowid) ){ |
|
0 |
0 |
if( aChange[iKey]>=0 || (iKey==pTab->iPKey && bChngRowid) ){ |
|
0 |
0 |
if( aChange[iKey]>=0 || (iKey==pTab->iPKey && bChngRowid) ){ |
112610
|
0 |
0 |
if( zKey ){ |
112611
|
0 |
0 |
if( 0==sqlite3StrICmp(pCol->zName, zKey) ) return 1; |
112612
|
0 |
0 |
}else if( pCol->colFlags & COLFLAG_PRIMKEY ){ |
112627
|
0 |
8 |
Parse *pTop = sqlite3ParseToplevel(pParse); |
112628
|
0 |
8 |
if( pTop->pTriggerPrg ){ |
112630
|
0 |
0 |
if( (p==pFKey->apTrigger[0] && pFKey->aAction[0]==OE_SetNull) |
|
0 |
0 |
if( (p==pFKey->apTrigger[0] && pFKey->aAction[0]==OE_SetNull) |
112631
|
0 |
0 |
|| (p==pFKey->apTrigger[1] && pFKey->aAction[1]==OE_SetNull) |
|
0 |
0 |
|| (p==pFKey->apTrigger[1] && pFKey->aAction[1]==OE_SetNull) |
112677
|
2615 |
31 |
if( (db->flags&SQLITE_ForeignKeys)==0 ) return; |
112684
|
10 |
31 |
for(pFKey=pTab->pFKey; pFKey; pFKey=pFKey->pNextFrom){ |
112693
|
4 |
6 |
if( aChange |
112694
|
4 |
0 |
&& sqlite3_stricmp(pTab->zName, pFKey->zTo)!=0 |
112695
|
0 |
4 |
&& fkChildIsModified(pTab, pFKey, aChange, bChngRowid)==0 |
112704
|
0 |
10 |
if( pParse->disableTriggers ){ |
112709
|
10 |
0 |
if( !pTo || sqlite3FkLocateIndex(pParse, pTo, pFKey, &pIdx, &aiFree) ){ |
|
0 |
10 |
if( !pTo || sqlite3FkLocateIndex(pParse, pTo, pFKey, &pIdx, &aiFree) ){ |
112711
|
0 |
0 |
if( !isIgnoreErrors || db->mallocFailed ) return; |
|
0 |
0 |
if( !isIgnoreErrors || db->mallocFailed ) return; |
112712
|
0 |
0 |
if( pTo==0 ){ |
112722
|
0 |
0 |
for(i=0; inCol; i++){ |
112732
|
0 |
10 |
if( aiFree ){ |
112738
|
10 |
10 |
for(i=0; inCol; i++){ |
112739
|
0 |
10 |
if( aiCol[i]==pTab->iPKey ){ |
112747
|
0 |
10 |
if( db->xAuth ){ |
112749
|
0 |
0 |
char *zCol = pTo->aCol[pIdx ? pIdx->aiColumn[i] : pTo->iPKey].zName; |
112762
|
2 |
8 |
if( regOld!=0 ){ |
112768
|
8 |
2 |
if( regNew!=0 && !isSetNullAction(pParse, pFKey) ){ |
|
8 |
0 |
if( regNew!=0 && !isSetNullAction(pParse, pFKey) ){ |
112785
|
15 |
31 |
for(pFKey = sqlite3FkReferences(pTab); pFKey; pFKey=pFKey->pNextTo){ |
112790
|
0 |
15 |
if( aChange && fkParentIsModified(pTab, pFKey, aChange, bChngRowid)==0 ){ |
|
0 |
0 |
if( aChange && fkParentIsModified(pTab, pFKey, aChange, bChngRowid)==0 ){ |
112794
|
15 |
0 |
if( !pFKey->isDeferred && !(db->flags & SQLITE_DeferFKs) |
|
15 |
0 |
if( !pFKey->isDeferred && !(db->flags & SQLITE_DeferFKs) |
112795
|
15 |
0 |
&& !pParse->pToplevel && !pParse->isMultiWrite |
|
15 |
0 |
&& !pParse->pToplevel && !pParse->isMultiWrite |
112803
|
0 |
0 |
if( sqlite3FkLocateIndex(pParse, pTab, pFKey, &pIdx, &aiCol) ){ |
112804
|
0 |
0 |
if( !isIgnoreErrors || db->mallocFailed ) return; |
|
0 |
0 |
if( !isIgnoreErrors || db->mallocFailed ) return; |
112812
|
0 |
0 |
if( pSrc ){ |
112819
|
0 |
0 |
if( regNew!=0 ){ |
112822
|
0 |
0 |
if( regOld!=0 ){ |
112842
|
0 |
0 |
if( !pFKey->isDeferred && eAction!=OE_Cascade && eAction!=OE_SetNull ){ |
|
0 |
0 |
if( !pFKey->isDeferred && eAction!=OE_Cascade && eAction!=OE_SetNull ){ |
|
0 |
0 |
if( !pFKey->isDeferred && eAction!=OE_Cascade && eAction!=OE_SetNull ){ |
112864
|
2 |
0 |
if( pParse->db->flags&SQLITE_ForeignKeys ){ |
112867
|
2 |
2 |
for(p=pTab->pFKey; p; p=p->pNextFrom){ |
112868
|
2 |
0 |
for(i=0; inCol; i++) mask |= COLUMN_MASK(p->aCol[i].iFrom); |
|
2 |
2 |
for(i=0; inCol; i++) mask |= COLUMN_MASK(p->aCol[i].iFrom); |
112870
|
0 |
2 |
for(p=sqlite3FkReferences(pTab); p; p=p->pNextTo){ |
112873
|
0 |
0 |
if( pIdx ){ |
112874
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
112876
|
0 |
0 |
mask |= COLUMN_MASK(pIdx->aiColumn[i]); |
112914
|
17 |
385 |
if( pParse->db->flags&SQLITE_ForeignKeys ){ |
112915
|
0 |
17 |
if( !aChange ){ |
112919
|
0 |
0 |
eRet = (sqlite3FkReferences(pTab) || pTab->pFKey); |
|
0 |
0 |
eRet = (sqlite3FkReferences(pTab) || pTab->pFKey); |
112926
|
2 |
17 |
for(p=pTab->pFKey; p; p=p->pNextFrom){ |
112927
|
0 |
2 |
if( 0==sqlite3_stricmp(pTab->zName, p->zTo) ) return 2; |
112928
|
2 |
0 |
if( fkChildIsModified(pTab, p, aChange, chngRowid) ){ |
112934
|
0 |
17 |
for(p=sqlite3FkReferences(pTab); p; p=p->pNextTo){ |
112935
|
0 |
0 |
if( fkParentIsModified(pTab, p, aChange, chngRowid) ){ |
112936
|
0 |
0 |
if( p->aAction[1]!=OE_None ) return 2; |
112986
|
0 |
0 |
if( action==OE_Restrict && (db->flags & SQLITE_DeferFKs) ){ |
|
0 |
0 |
if( action==OE_Restrict && (db->flags & SQLITE_DeferFKs) ){ |
112991
|
0 |
0 |
if( action!=OE_None && !pTrigger ){ |
|
0 |
0 |
if( action!=OE_None && !pTrigger ){ |
113003
|
0 |
0 |
if( sqlite3FkLocateIndex(pParse, pTab, pFKey, &pIdx, &aiCol) ) return 0; |
113006
|
0 |
0 |
for(i=0; inCol; i++){ |
113014
|
0 |
0 |
iFromCol = aiCol ? aiCol[i] : pFKey->aCol[0].iFrom; |
113019
|
0 |
0 |
pTab->aCol[pIdx ? pIdx->aiColumn[i] : pTab->iPKey].zName); |
113039
|
0 |
0 |
if( pChanges ){ |
113051
|
0 |
0 |
if( action!=OE_Restrict && (action!=OE_Cascade || pChanges) ){ |
|
0 |
0 |
if( action!=OE_Restrict && (action!=OE_Cascade || pChanges) ){ |
|
0 |
0 |
if( action!=OE_Restrict && (action!=OE_Cascade || pChanges) ){ |
113053
|
0 |
0 |
if( action==OE_Cascade ){ |
113057
|
0 |
0 |
}else if( action==OE_SetDflt ){ |
113059
|
0 |
0 |
if( pDflt ){ |
113076
|
0 |
0 |
if( action==OE_Restrict ){ |
113083
|
0 |
0 |
if( pRaise ){ |
113103
|
0 |
0 |
if( pTrigger ){ |
113111
|
0 |
0 |
if( pWhen ){ |
113124
|
0 |
0 |
if( db->mallocFailed==1 ){ |
113135
|
0 |
0 |
if( !pChanges ){ |
113146
|
0 |
0 |
pTrigger->op = (pChanges ? TK_UPDATE : TK_DELETE); |
113168
|
2 |
40 |
if( pParse->db->flags&SQLITE_ForeignKeys ){ |
113170
|
0 |
2 |
for(pFKey = sqlite3FkReferences(pTab); pFKey; pFKey=pFKey->pNextTo){ |
113171
|
0 |
0 |
if( aChange==0 || fkParentIsModified(pTab, pFKey, aChange, bChngRowid) ){ |
|
0 |
0 |
if( aChange==0 || fkParentIsModified(pTab, pFKey, aChange, bChngRowid) ){ |
113173
|
0 |
0 |
if( pAct ){ |
113194
|
16 |
959 |
for(pFKey=pTab->pFKey; pFKey; pFKey=pNext){ |
113197
|
8 |
8 |
if( !db || db->pnBytesFreed==0 ){ |
|
8 |
0 |
if( !db || db->pnBytesFreed==0 ){ |
113198
|
0 |
16 |
if( pFKey->pPrevTo ){ |
113202
|
0 |
16 |
const char *z = (p ? pFKey->pNextTo->zTo : pFKey->zTo); |
113205
|
0 |
16 |
if( pFKey->pNextTo ){ |
113267
|
4135 |
0 |
if( HasRowid(pTab) ){ |
113301
|
17 |
27 |
if( !pIdx->zColAff ){ |
113313
|
0 |
17 |
if( !pIdx->zColAff ){ |
113317
|
49 |
17 |
for(n=0; nnColumn; n++){ |
113319
|
32 |
17 |
if( x>=0 ){ |
113321
|
17 |
0 |
}else if( x==XN_ROWID ){ |
113328
|
0 |
0 |
if( aff==0 ) aff = SQLITE_AFF_BLOB; |
113361
|
315 |
2600 |
if( zColAff==0 ){ |
113364
|
0 |
315 |
if( !zColAff ){ |
113369
|
1138 |
315 |
for(i=0; inCol; i++){ |
113374
|
385 |
49 |
}while( i>=0 && zColAff[i]==SQLITE_AFF_BLOB ); |
|
119 |
266 |
}while( i>=0 && zColAff[i]==SQLITE_AFF_BLOB ); |
113378
|
504 |
2411 |
if( i ){ |
113379
|
20 |
484 |
if( iReg ){ |
113398
|
2 |
2 |
VTable *pVTab = IsVirtual(pTab) ? sqlite3GetVTable(p->db, pTab) : 0; |
113401
|
46 |
4 |
for(i=1; i
|
113404
|
0 |
46 |
if( pOp->opcode==OP_OpenRead && pOp->p3==iDb ){ |
|
0 |
0 |
if( pOp->opcode==OP_OpenRead && pOp->p3==iDb ){ |
113407
|
0 |
0 |
if( tnum==pTab->tnum ){ |
113410
|
0 |
0 |
for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){ |
113411
|
0 |
0 |
if( tnum==pIndex->tnum ){ |
113417
|
0 |
46 |
if( pOp->opcode==OP_VOpen && pOp->p4.pVtab==pVTab ){ |
|
0 |
0 |
if( pOp->opcode==OP_VOpen && pOp->p4.pVtab==pVTab ){ |
113458
|
2 |
2661 |
if( (pTab->tabFlags & TF_Autoincrement)!=0 |
113459
|
2 |
0 |
&& (pParse->db->mDbFlags & DBFLAG_Vacuum)==0 |
113461
|
0 |
2 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
113468
|
2 |
0 |
if( pSeqTab==0 |
113469
|
2 |
0 |
|| !HasRowid(pSeqTab) |
113470
|
2 |
0 |
|| IsVirtual(pSeqTab) |
113471
|
0 |
2 |
|| pSeqTab->nCol!=2 |
113479
|
0 |
2 |
while( pInfo && pInfo->pTab!=pTab ){ pInfo = pInfo->pNext; } |
|
0 |
0 |
while( pInfo && pInfo->pTab!=pTab ){ pInfo = pInfo->pNext; } |
113480
|
2 |
0 |
if( pInfo==0 ){ |
113482
|
0 |
2 |
if( pInfo==0 ) return 0; |
113513
|
2 |
4673 |
for(p = pParse->pAinc; p; p = p->pNext){ |
113536
|
0 |
2 |
if( aOp==0 ) break; |
113561
|
2 |
2661 |
if( memId>0 ){ |
113579
|
2 |
2 |
for(p = pParse->pAinc; p; p = p->pNext){ |
113599
|
0 |
2 |
if( aOp==0 ) break; |
113611
|
2 |
2685 |
if( pParse->pAinc ) autoIncrementEnd(pParse); |
113775
|
2663 |
0 |
if( pParse->nErr || db->mallocFailed ){ |
|
2663 |
0 |
if( pParse->nErr || db->mallocFailed ){ |
113784
|
2663 |
0 |
if( pSelect && (pSelect->selFlags & SF_Values)!=0 && pSelect->pPrior==0 ){ |
|
2663 |
0 |
if( pSelect && (pSelect->selFlags & SF_Values)!=0 && pSelect->pPrior==0 ){ |
|
2659 |
4 |
if( pSelect && (pSelect->selFlags & SF_Values)!=0 && pSelect->pPrior==0 ){ |
113795
|
0 |
2663 |
if( pTab==0 ){ |
113800
|
0 |
2663 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, |
113826
|
0 |
2663 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ){ |
113832
|
0 |
2663 |
if( sqlite3IsReadOnly(pParse, pTab, tmask) ){ |
113839
|
0 |
2663 |
if( v==0 ) goto insert_cleanup; |
113840
|
2624 |
39 |
if( pParse->nested==0 ) sqlite3VdbeCountChanges(v); |
113841
|
2659 |
4 |
sqlite3BeginWriteOperation(pParse, pSelect || pTrigger, iDb); |
|
0 |
2659 |
sqlite3BeginWriteOperation(pParse, pSelect || pTrigger, iDb); |
113853
|
377 |
2286 |
if( pColumn==0 && xferOptimization(pParse, pTab, pSelect, onError, iDb) ){ |
|
0 |
377 |
if( pColumn==0 && xferOptimization(pParse, pTab, pSelect, onError, iDb) ){ |
113870
|
21 |
2642 |
if( IsVirtual(pTab) ){ |
113888
|
2286 |
377 |
if( pColumn ){ |
113889
|
2370 |
2286 |
for(i=0; inId; i++){ |
113892
|
2370 |
2286 |
for(i=0; inId; i++){ |
113893
|
2535 |
0 |
for(j=0; jnCol; j++){ |
113894
|
2370 |
165 |
if( sqlite3StrICmp(pColumn->a[i].zName, pTab->aCol[j].zName)==0 ){ |
113896
|
49 |
2321 |
if( i!=j ) bIdListInOrder = 0; |
113897
|
15 |
2355 |
if( j==pTab->iPKey ){ |
113903
|
0 |
2370 |
if( j>=pTab->nCol ){ |
113904
|
0 |
0 |
if( sqlite3IsRowid(pColumn->a[i].zName) && !withoutRowid ){ |
|
0 |
0 |
if( sqlite3IsRowid(pColumn->a[i].zName) && !withoutRowid ){ |
113922
|
4 |
2659 |
if( pSelect ){ |
113933
|
4 |
0 |
dest.iSdst = bIdListInOrder ? regData : 0; |
113937
|
4 |
0 |
if( rc || db->mallocFailed || pParse->nErr ) goto insert_cleanup; |
|
4 |
0 |
if( rc || db->mallocFailed || pParse->nErr ) goto insert_cleanup; |
|
4 |
0 |
if( rc || db->mallocFailed || pParse->nErr ) goto insert_cleanup; |
113952
|
4 |
0 |
if( pTrigger || readsTable(pParse, iDb, pTab) ){ |
|
0 |
4 |
if( pTrigger || readsTable(pParse, iDb, pTab) ){ |
113956
|
0 |
4 |
if( useTempTable ){ |
113993
|
2659 |
0 |
if( pList ){ |
113995
|
0 |
2659 |
if( sqlite3ResolveExprListNames(&sNC, pList) ){ |
114007
|
377 |
2286 |
if( pColumn==0 && nColumn>0 ){ |
|
377 |
0 |
if( pColumn==0 && nColumn>0 ){ |
114014
|
3175 |
2663 |
for(i=0; inCol; i++){ |
114017
|
377 |
2286 |
if( pColumn==0 && nColumn && nColumn!=(pTab->nCol-nHidden) ){ |
|
377 |
0 |
if( pColumn==0 && nColumn && nColumn!=(pTab->nCol-nHidden) ){ |
|
0 |
377 |
if( pColumn==0 && nColumn && nColumn!=(pTab->nCol-nHidden) ){ |
114023
|
2286 |
377 |
if( pColumn!=0 && nColumn!=pColumn->nId ){ |
|
0 |
2286 |
if( pColumn!=0 && nColumn!=pColumn->nId ){ |
114030
|
0 |
2663 |
if( (db->flags & SQLITE_CountRows)!=0 |
114031
|
0 |
0 |
&& !pParse->nested |
114032
|
0 |
0 |
&& !pParse->pTriggerTab |
114039
|
2663 |
0 |
if( !isView ){ |
114044
|
0 |
2663 |
if( aRegIdx==0 ){ |
114047
|
33 |
2663 |
for(i=0, pIdx=pTab->pIndex; ipNext, i++){ |
114054
|
0 |
2663 |
if( pUpsert ){ |
114060
|
0 |
0 |
if( pUpsert->pUpsertTarget ){ |
114068
|
0 |
2663 |
if( useTempTable ){ |
114080
|
4 |
2659 |
}else if( pSelect ){ |
114096
|
0 |
2663 |
if( tmask & TRIGGER_BEFORE ){ |
114105
|
0 |
0 |
if( ipkColumn<0 ){ |
114110
|
0 |
0 |
if( useTempTable ){ |
114129
|
0 |
0 |
for(i=j=0; inCol; i++){ |
114130
|
0 |
0 |
if( pColumn ){ |
114131
|
0 |
0 |
for(j=0; jnId; j++){ |
114132
|
0 |
0 |
if( pColumn->a[j].idx==i ) break; |
114135
|
0 |
0 |
if( (!useTempTable && !pList) || (pColumn && j>=pColumn->nId) |
|
0 |
0 |
if( (!useTempTable && !pList) || (pColumn && j>=pColumn->nId) |
|
0 |
0 |
if( (!useTempTable && !pList) || (pColumn && j>=pColumn->nId) |
114136
|
0 |
0 |
|| (pColumn==0 && IsOrdinaryHiddenColumn(&pTab->aCol[i])) ){ |
114138
|
0 |
0 |
}else if( useTempTable ){ |
114144
|
0 |
0 |
if( pColumn==0 && !IsOrdinaryHiddenColumn(&pTab->aCol[i]) ) j++; |
114152
|
0 |
0 |
if( !isView ){ |
114166
|
2663 |
0 |
if( !isView ){ |
114167
|
21 |
2642 |
if( IsVirtual(pTab) ){ |
114171
|
48 |
2615 |
if( ipkColumn>=0 ){ |
114172
|
0 |
48 |
if( useTempTable ){ |
114174
|
2 |
46 |
}else if( pSelect ){ |
114181
|
0 |
46 |
if( pOp->opcode==OP_Null && !IsVirtual(pTab) ){ |
|
0 |
0 |
if( pOp->opcode==OP_Null && !IsVirtual(pTab) ){ |
114192
|
48 |
0 |
if( !appendFlag ){ |
114194
|
48 |
0 |
if( !IsVirtual(pTab) ){ |
114204
|
2594 |
21 |
}else if( IsVirtual(pTab) || withoutRowid ){ |
|
0 |
2594 |
}else if( IsVirtual(pTab) || withoutRowid ){ |
114216
|
3175 |
2663 |
for(i=0; inCol; i++){ |
114218
|
65 |
3110 |
if( i==pTab->iPKey ){ |
114227
|
700 |
2410 |
if( pColumn==0 ){ |
114228
|
0 |
700 |
if( IsHiddenColumn(&pTab->aCol[i]) ){ |
114235
|
2581 |
55 |
for(j=0; jnId; j++){ |
114236
|
2355 |
226 |
if( pColumn->a[j].idx==i ) break; |
114239
|
3110 |
0 |
if( j<0 || nColumn==0 || (pColumn && j>=pColumn->nId) ){ |
|
3110 |
0 |
if( j<0 || nColumn==0 || (pColumn && j>=pColumn->nId) ){ |
|
2410 |
700 |
if( j<0 || nColumn==0 || (pColumn && j>=pColumn->nId) ){ |
|
55 |
2355 |
if( j<0 || nColumn==0 || (pColumn && j>=pColumn->nId) ){ |
114241
|
0 |
3055 |
}else if( useTempTable ){ |
114243
|
4 |
3051 |
}else if( pSelect ){ |
114244
|
0 |
4 |
if( regFromSelect!=regData ){ |
114256
|
21 |
2642 |
if( IsVirtual(pTab) ){ |
114260
|
4 |
17 |
sqlite3VdbeChangeP5(v, onError==OE_Default ? OE_Abort : onError); |
114280
|
22 |
2620 |
bUseSeek = (isReplace==0 || (pTrigger==0 && |
|
22 |
0 |
bUseSeek = (isReplace==0 || (pTrigger==0 && |
|
0 |
22 |
bUseSeek = (isReplace==0 || (pTrigger==0 && |
114281
|
0 |
0 |
((db->flags & SQLITE_ForeignKeys)==0 || sqlite3FkReferences(pTab)==0) |
114291
|
0 |
2663 |
if( regRowCount ){ |
114295
|
0 |
2663 |
if( pTrigger ){ |
114305
|
0 |
2663 |
if( useTempTable ){ |
114309
|
4 |
2659 |
}else if( pSelect ){ |
114319
|
2624 |
39 |
if( pParse->nested==0 && pParse->pTriggerTab==0 ){ |
|
2624 |
0 |
if( pParse->nested==0 && pParse->pTriggerTab==0 ){ |
114328
|
0 |
2663 |
if( regRowCount ){ |
114368
|
0 |
0 |
if( pExpr->op==TK_COLUMN ){ |
114370
|
0 |
0 |
if( pExpr->iColumn>=0 ){ |
114371
|
0 |
0 |
if( pWalker->u.aiCol[pExpr->iColumn]>=0 ){ |
114398
|
0 |
0 |
if( !chngRowid ){ |
114432
|
0 |
2923 |
if( p->upsertTop ){ |
114439
|
0 |
2923 |
if( p->ipkTop ){ |
114574
|
2915 |
0 |
if( HasRowid(pTab) ){ |
114588
|
4436 |
2915 |
for(i=0; i
|
114589
|
67 |
4369 |
if( i==pTab->iPKey ){ |
114592
|
1350 |
3019 |
if( aiChng && aiChng[i]<0 ){ |
|
25 |
1325 |
if( aiChng && aiChng[i]<0 ){ |
114597
|
4270 |
74 |
if( onError==OE_None ) continue; /* This column is allowed to be NULL */ |
114598
|
0 |
74 |
if( overrideError!=OE_Default ){ |
114600
|
74 |
0 |
}else if( onError==OE_Default ){ |
114603
|
0 |
74 |
if( onError==OE_Replace && pTab->aCol[i].pDflt==0 ){ |
|
0 |
0 |
if( onError==OE_Replace && pTab->aCol[i].pDflt==0 ){ |
114642
|
0 |
2915 |
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ |
|
0 |
0 |
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ |
114645
|
0 |
0 |
onError = overrideError!=OE_Default ? overrideError : OE_Abort; |
114646
|
0 |
0 |
for(i=0; inExpr; i++){ |
114649
|
0 |
0 |
if( aiChng && checkConstraintUnchanged(pExpr, aiChng, pkChng) ) continue; |
|
0 |
0 |
if( aiChng && checkConstraintUnchanged(pExpr, aiChng, pkChng) ) continue; |
114653
|
0 |
0 |
if( onError==OE_Ignore ){ |
114657
|
0 |
0 |
if( zName==0 ) zName = pTab->zName; |
114658
|
0 |
0 |
if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-15569-63625 */ |
114693
|
0 |
2915 |
if( pUpsert ){ |
114694
|
0 |
0 |
if( pUpsert->pUpsertTarget==0 ){ |
114700
|
0 |
0 |
}else if( (pUpIdx = pUpsert->pUpsertIdx)!=0 ){ |
114712
|
48 |
2867 |
if( pkChng && pPk==0 ){ |
|
48 |
0 |
if( pkChng && pPk==0 ){ |
114717
|
14 |
34 |
if( overrideError!=OE_Default ){ |
114719
|
34 |
0 |
}else if( onError==OE_Default ){ |
114724
|
0 |
48 |
if( pUpsert && pUpsert->pUpsertIdx==0 ){ |
|
0 |
0 |
if( pUpsert && pUpsert->pUpsertIdx==0 ){ |
114725
|
0 |
0 |
if( pUpsert->pUpsertSet==0 ){ |
114742
|
14 |
34 |
if( onError>=OE_Replace |
114743
|
14 |
0 |
&& (pUpsert || onError!=overrideError) |
|
0 |
14 |
&& (pUpsert || onError!=overrideError) |
114744
|
0 |
0 |
&& pTab->pIndex |
114749
|
0 |
48 |
if( isUpdate ){ |
114803
|
0 |
14 |
if( db->flags&SQLITE_RecTriggers ){ |
114806
|
14 |
0 |
if( pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0) ){ |
|
0 |
14 |
if( pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0) ){ |
114820
|
0 |
14 |
if( pTab->pIndex ){ |
114841
|
0 |
48 |
if( sAddr.ipkTop ){ |
114854
|
33 |
2915 |
for(ix=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, ix++){ |
114860
|
0 |
33 |
if( aRegIdx[ix]==0 ) continue; /* Skip indices that do not change */ |
114861
|
0 |
33 |
if( pUpIdx==pIdx ){ |
114870
|
33 |
0 |
if( bAffinityDone==0 ){ |
114878
|
0 |
33 |
if( pIdx->pPartIdxWhere ){ |
114890
|
84 |
33 |
for(i=0; inColumn; i++){ |
114893
|
0 |
84 |
if( iField==XN_EXPR ){ |
114899
|
51 |
33 |
if( iField==XN_ROWID || iField==pTab->iPKey ){ |
|
0 |
51 |
if( iField==XN_ROWID || iField==pTab->iPKey ){ |
114904
|
33 |
51 |
sqlite3VdbeAddOp2(v, iField<0 ? OP_IntCopy : OP_SCopy, x, regIdx+i); |
114918
|
0 |
33 |
if( isUpdate && pPk==pIdx && pkChng==0 ){ |
|
0 |
0 |
if( isUpdate && pPk==pIdx && pkChng==0 ){ |
|
0 |
0 |
if( isUpdate && pPk==pIdx && pkChng==0 ){ |
114925
|
1 |
32 |
if( onError==OE_None ){ |
114929
|
8 |
24 |
if( overrideError!=OE_Default ){ |
114931
|
23 |
1 |
}else if( onError==OE_Default ){ |
114936
|
0 |
32 |
if( pUpIdx==pIdx ){ |
114937
|
0 |
0 |
if( pUpsert->pUpsertSet==0 ){ |
114946
|
8 |
24 |
if( onError==OE_Replace ){ |
114960
|
32 |
0 |
if( (ix==0 && pIdx->pNext==0) /* Condition 3 */ |
|
32 |
0 |
if( (ix==0 && pIdx->pNext==0) /* Condition 3 */ |
114961
|
0 |
32 |
&& pPk==pIdx /* Condition 2 */ |
114962
|
0 |
0 |
&& onError==OE_Replace /* Condition 1 */ |
114965
|
0 |
0 |
&& ( 0==(db->flags&SQLITE_ForeignKeys) || /* Condition 5 */ |
|
0 |
0 |
&& ( 0==(db->flags&SQLITE_ForeignKeys) || /* Condition 5 */ |
114966
|
0 |
0 |
(0==pTab->pFKey && 0==sqlite3FkReferences(pTab))) |
114979
|
32 |
0 |
regR = (pIdx==pPk) ? regIdx : sqlite3GetTempRange(pParse, nPkField); |
114980
|
32 |
0 |
if( isUpdate || onError==OE_Replace ){ |
|
8 |
24 |
if( isUpdate || onError==OE_Replace ){ |
114981
|
8 |
0 |
if( HasRowid(pTab) ){ |
114985
|
0 |
8 |
if( isUpdate ){ |
114994
|
0 |
0 |
if( pIdx!=pPk ){ |
114995
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
115003
|
0 |
0 |
if( isUpdate ){ |
115013
|
0 |
0 |
int regCmp = (IsPrimaryKeyIndex(pIdx) ? regIdx : regR); |
115015
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
115019
|
0 |
0 |
if( i==(pPk->nKeyCol-1) ){ |
115061
|
0 |
8 |
if( db->flags&SQLITE_RecTriggers ){ |
115064
|
8 |
0 |
if( pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0) ){ |
|
0 |
8 |
if( pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0) ){ |
115074
|
0 |
32 |
if( pUpIdx==pIdx ){ |
115080
|
32 |
0 |
if( regR!=regIdx ) sqlite3ReleaseTempRange(pParse, regR, nPkField); |
115150
|
33 |
2915 |
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ |
115151
|
0 |
33 |
if( aRegIdx[i]==0 ) continue; |
115153
|
0 |
33 |
if( pIdx->pPartIdxWhere ){ |
115157
|
33 |
0 |
pik_flags = (useSeekResult ? OPFLAG_USESEEKRESULT : 0); |
115158
|
27 |
6 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){ |
|
0 |
27 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){ |
115171
|
4 |
29 |
sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iIdxCur+i, aRegIdx[i], |
115176
|
0 |
2915 |
if( !HasRowid(pTab) ) return; |
115181
|
2882 |
33 |
if( !bAffinityDone ){ |
115185
|
307 |
2608 |
if( pParse->nested ){ |
115189
|
5 |
2603 |
pik_flags |= (update_flags?update_flags:OPFLAG_LASTROWID); |
115191
|
2594 |
321 |
if( appendBias ){ |
115194
|
2642 |
273 |
if( useSeekResult ){ |
115198
|
2608 |
307 |
if( !pParse->nested ){ |
115243
|
22 |
2947 |
if( IsVirtual(pTab) ){ |
115252
|
2642 |
305 |
if( iBase<0 ) iBase = pParse->nTab; |
115254
|
2674 |
273 |
if( piDataCur ) *piDataCur = iDataCur; |
115255
|
2947 |
0 |
if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){ |
|
305 |
2642 |
if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){ |
|
7 |
298 |
if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){ |
115260
|
2674 |
273 |
if( piIdxCur ) *piIdxCur = iBase; |
115261
|
42 |
2947 |
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ |
115264
|
36 |
6 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){ |
|
0 |
36 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){ |
115265
|
0 |
0 |
if( piDataCur ) *piDataCur = iIdxCur; |
115268
|
9 |
33 |
if( aToOpen==0 || aToOpen[i+1] ){ |
|
0 |
9 |
if( aToOpen==0 || aToOpen[i+1] ){ |
115275
|
2642 |
305 |
if( iBase>pParse->nTab ) pParse->nTab = iBase; |
115307
|
0 |
0 |
if( pDest->nKeyCol!=pSrc->nKeyCol ){ |
115310
|
0 |
0 |
if( pDest->onError!=pSrc->onError ){ |
115313
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
115314
|
0 |
0 |
if( pSrc->aiColumn[i]!=pDest->aiColumn[i] ){ |
115317
|
0 |
0 |
if( pSrc->aiColumn[i]==XN_EXPR ){ |
115319
|
0 |
0 |
if( sqlite3ExprCompare(0, pSrc->aColExpr->a[i].pExpr, |
115324
|
0 |
0 |
if( pSrc->aSortOrder[i]!=pDest->aSortOrder[i] ){ |
115327
|
0 |
0 |
if( sqlite3_stricmp(pSrc->azColl[i],pDest->azColl[i])!=0 ){ |
115331
|
0 |
0 |
if( sqlite3ExprCompare(0, pSrc->pPartIdxWhere, pDest->pPartIdxWhere, -1) ){ |
115387
|
375 |
2 |
if( pSelect==0 ){ |
115390
|
2 |
0 |
if( pParse->pWith || pSelect->pWith ){ |
|
0 |
2 |
if( pParse->pWith || pSelect->pWith ){ |
115396
|
0 |
2 |
if( sqlite3TriggerList(pParse, pDest) ){ |
115400
|
2 |
0 |
if( IsVirtual(pDest) ){ |
115404
|
0 |
0 |
if( onError==OE_Default ){ |
115405
|
0 |
0 |
if( pDest->iPKey>=0 ) onError = pDest->keyConf; |
115406
|
0 |
0 |
if( onError==OE_Default ) onError = OE_Abort; |
115409
|
0 |
0 |
if( pSelect->pSrc->nSrc!=1 ){ |
115412
|
0 |
0 |
if( pSelect->pSrc->a[0].pSelect ){ |
115415
|
0 |
0 |
if( pSelect->pWhere ){ |
115418
|
0 |
0 |
if( pSelect->pOrderBy ){ |
115423
|
0 |
0 |
if( pSelect->pGroupBy ){ |
115426
|
0 |
0 |
if( pSelect->pLimit ){ |
115429
|
0 |
0 |
if( pSelect->pPrior ){ |
115432
|
0 |
0 |
if( pSelect->selFlags & SF_Distinct ){ |
115437
|
0 |
0 |
if( pEList->nExpr!=1 ){ |
115441
|
0 |
0 |
if( pEList->a[0].pExpr->op!=TK_ASTERISK ){ |
115451
|
0 |
0 |
if( pSrc==0 ){ |
115454
|
0 |
0 |
if( pSrc==pDest ){ |
115457
|
0 |
0 |
if( HasRowid(pDest)!=HasRowid(pSrc) ){ |
115461
|
0 |
0 |
if( IsVirtual(pSrc) ){ |
115465
|
0 |
0 |
if( pSrc->pSelect ){ |
115468
|
0 |
0 |
if( pDest->nCol!=pSrc->nCol ){ |
115471
|
0 |
0 |
if( pDest->iPKey!=pSrc->iPKey ){ |
115474
|
0 |
0 |
for(i=0; inCol; i++){ |
115484
|
0 |
0 |
if( pDestCol->affinity!=pSrcCol->affinity ){ |
115487
|
0 |
0 |
if( sqlite3_stricmp(pDestCol->zColl, pSrcCol->zColl)!=0 ){ |
115490
|
0 |
0 |
if( pDestCol->notNull && !pSrcCol->notNull ){ |
|
0 |
0 |
if( pDestCol->notNull && !pSrcCol->notNull ){ |
115494
|
0 |
0 |
if( i>0 ){ |
115497
|
0 |
0 |
if( (pDestCol->pDflt==0)!=(pSrcCol->pDflt==0) |
115498
|
0 |
0 |
|| (pDestCol->pDflt && strcmp(pDestCol->pDflt->u.zToken, |
|
0 |
0 |
|| (pDestCol->pDflt && strcmp(pDestCol->pDflt->u.zToken, |
115505
|
0 |
0 |
for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){ |
115506
|
0 |
0 |
if( IsUniqueIndex(pDestIdx) ){ |
115509
|
0 |
0 |
for(pSrcIdx=pSrc->pIndex; pSrcIdx; pSrcIdx=pSrcIdx->pNext){ |
115510
|
0 |
0 |
if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break; |
115512
|
0 |
0 |
if( pSrcIdx==0 ){ |
115517
|
0 |
0 |
if( pDest->pCheck && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1) ){ |
|
0 |
0 |
if( pDest->pCheck && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1) ){ |
115529
|
0 |
0 |
if( (db->flags & SQLITE_ForeignKeys)!=0 && pDest->pFKey!=0 ){ |
|
0 |
0 |
if( (db->flags & SQLITE_ForeignKeys)!=0 && pDest->pFKey!=0 ){ |
115533
|
0 |
0 |
if( (db->flags & SQLITE_CountRows)!=0 ){ |
115554
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_Vacuum)==0 && ( |
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_Vacuum)==0 && ( |
115555
|
0 |
0 |
(pDest->iPKey<0 && pDest->pIndex!=0) /* (1) */ |
115556
|
0 |
0 |
|| destHasUniqueIdx /* (2) */ |
115557
|
0 |
0 |
|| (onError!=OE_Abort && onError!=OE_Rollback) /* (3) */ |
|
0 |
0 |
|| (onError!=OE_Abort && onError!=OE_Rollback) /* (3) */ |
115580
|
0 |
0 |
if( HasRowid(pSrc) ){ |
115584
|
0 |
0 |
if( pDest->iPKey>=0 ){ |
115592
|
0 |
0 |
}else if( pDest->pIndex==0 ){ |
115599
|
0 |
0 |
if( db->mDbFlags & DBFLAG_Vacuum ){ |
115616
|
0 |
0 |
for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){ |
115618
|
0 |
0 |
for(pSrcIdx=pSrc->pIndex; ALWAYS(pSrcIdx); pSrcIdx=pSrcIdx->pNext){ |
115619
|
0 |
0 |
if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break; |
115631
|
0 |
0 |
if( db->mDbFlags & DBFLAG_Vacuum ){ |
115646
|
0 |
0 |
for(i=0; inColumn; i++){ |
115648
|
0 |
0 |
if( sqlite3_stricmp(sqlite3StrBINARY, zColl) ) break; |
115650
|
0 |
0 |
if( i==pSrcIdx->nColumn ){ |
115655
|
0 |
0 |
if( !HasRowid(pSrc) && pDestIdx->idxType==2 ){ |
|
0 |
0 |
if( !HasRowid(pSrc) && pDestIdx->idxType==2 ){ |
115665
|
0 |
0 |
if( emptySrcTest ) sqlite3VdbeJumpHere(v, emptySrcTest); |
115668
|
0 |
0 |
if( emptyDestTest ){ |
115724
|
0 |
3427 |
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
115725
|
0 |
3427 |
if( zSql==0 ) zSql = ""; |
115729
|
6817 |
39 |
while( rc==SQLITE_OK && zSql[0] ){ |
|
3429 |
3388 |
while( rc==SQLITE_OK && zSql[0] ){ |
115736
|
4 |
3425 |
if( rc!=SQLITE_OK ){ |
115739
|
4 |
3421 |
if( !pStmt ){ |
115753
|
750 |
6985 |
if( xCallback && (SQLITE_ROW==rc || |
|
436 |
314 |
if( xCallback && (SQLITE_ROW==rc || |
|
436 |
0 |
if( xCallback && (SQLITE_ROW==rc || |
115754
|
166 |
270 |
(SQLITE_DONE==rc && !callbackIsInit |
115755
|
0 |
166 |
&& db->flags&SQLITE_NullCallback)) ){ |
115756
|
270 |
44 |
if( !callbackIsInit ){ |
115758
|
0 |
270 |
if( azCols==0 ){ |
115761
|
810 |
270 |
for(i=0; i
|
115769
|
314 |
0 |
if( rc==SQLITE_ROW ){ |
115771
|
942 |
314 |
for(i=0; i
|
115773
|
35 |
907 |
if( !azVals[i] && sqlite3_column_type(pStmt, i)!=SQLITE_NULL ){ |
|
0 |
35 |
if( !azVals[i] && sqlite3_column_type(pStmt, i)!=SQLITE_NULL ){ |
115780
|
0 |
314 |
if( xCallback(pArg, nCol, azVals, azCols) ){ |
115792
|
3421 |
4314 |
if( rc!=SQLITE_ROW ){ |
115796
|
0 |
3421 |
while( sqlite3Isspace(zSql[0]) ) zSql++; |
115806
|
0 |
3427 |
if( pStmt ) sqlite3VdbeFinalize((Vdbe *)pStmt); |
115810
|
39 |
3388 |
if( rc!=SQLITE_OK && pzErrMsg ){ |
|
39 |
0 |
if( rc!=SQLITE_OK && pzErrMsg ){ |
115812
|
0 |
39 |
if( *pzErrMsg==0 ){ |
115816
|
2919 |
469 |
}else if( pzErrMsg ){ |
116941
|
0 |
0 |
if( pzErrMsg ) *pzErrMsg = 0; |
116950
|
0 |
0 |
if( (db->flags & SQLITE_LoadExtension)==0 ){ |
116951
|
0 |
0 |
if( pzErrMsg ){ |
116957
|
0 |
0 |
zEntry = zProc ? zProc : "sqlite3_extension_init"; |
116961
|
0 |
0 |
for(ii=0; ii
|
|
0 |
0 |
for(ii=0; ii
|
116963
|
0 |
0 |
if( zAltFile==0 ) return SQLITE_NOMEM_BKPT; |
116968
|
0 |
0 |
if( handle==0 ){ |
116969
|
0 |
0 |
if( pzErrMsg ){ |
116971
|
0 |
0 |
if( zErrmsg ){ |
116992
|
0 |
0 |
if( xInit==0 && zProc==0 ){ |
|
0 |
0 |
if( xInit==0 && zProc==0 ){ |
116996
|
0 |
0 |
if( zAltEntry==0 ){ |
117001
|
0 |
0 |
for(iFile=ncFile-1; iFile>=0 && zFile[iFile]!='/'; iFile--){} |
|
0 |
0 |
for(iFile=ncFile-1; iFile>=0 && zFile[iFile]!='/'; iFile--){} |
117003
|
0 |
0 |
if( sqlite3_strnicmp(zFile+iFile, "lib", 3)==0 ) iFile += 3; |
117004
|
0 |
0 |
for(iEntry=8; (c = zFile[iFile])!=0 && c!='.'; iFile++){ |
|
0 |
0 |
for(iEntry=8; (c = zFile[iFile])!=0 && c!='.'; iFile++){ |
117005
|
0 |
0 |
if( sqlite3Isalpha(c) ){ |
117013
|
0 |
0 |
if( xInit==0 ){ |
117014
|
0 |
0 |
if( pzErrMsg ){ |
117017
|
0 |
0 |
if( zErrmsg ){ |
117029
|
0 |
0 |
if( rc ){ |
117030
|
0 |
0 |
if( rc==SQLITE_OK_LOAD_PERMANENTLY ) return SQLITE_OK; |
117031
|
0 |
0 |
if( pzErrMsg ){ |
117041
|
0 |
0 |
if( aHandle==0 ){ |
117044
|
0 |
0 |
if( db->nExtension>0 ){ |
117074
|
0 |
266 |
for(i=0; inExtension; i++){ |
117086
|
0 |
0 |
if( onoff ){ |
117136
|
0 |
0 |
if( rc ){ |
117147
|
0 |
0 |
for(i=0; i
|
117148
|
0 |
0 |
if( wsdAutoext.aExt[i]==xInit ) break; |
117150
|
0 |
0 |
if( i==wsdAutoext.nExt ){ |
117154
|
0 |
0 |
if( aNew==0 ){ |
117187
|
0 |
0 |
for(i=(int)wsdAutoext.nExt-1; i>=0; i--){ |
117188
|
0 |
0 |
if( wsdAutoext.aExt[i]==xInit ){ |
117204
|
0 |
0 |
if( sqlite3_initialize()==SQLITE_OK ) |
117231
|
262 |
0 |
if( wsdAutoext.nExt==0 ){ |
117235
|
0 |
0 |
for(i=0; go; i++){ |
117246
|
0 |
0 |
if( i>=wsdAutoext.nExt ){ |
117254
|
0 |
0 |
if( xInit && (rc = xInit(db, &zErrmsg, pThunk))!=0 ){ |
|
0 |
0 |
if( xInit && (rc = xInit(db, &zErrmsg, pThunk))!=0 ){ |
117969
|
2 |
6 |
if( sqlite3Isdigit(*z) ){ |
117973
|
6 |
0 |
for(i=0; i
|
117974
|
6 |
0 |
if( iLength[i]==n && sqlite3StrNICmp(&zText[iOffset[i]],z,n)==0 |
|
6 |
0 |
if( iLength[i]==n && sqlite3StrNICmp(&zText[iOffset[i]],z,n)==0 |
117975
|
6 |
0 |
&& (!omitFull || iValue[i]<=1) |
|
6 |
0 |
&& (!omitFull || iValue[i]<=1) |
118000
|
0 |
0 |
if( z ){ |
118001
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "exclusive") ) return PAGER_LOCKINGMODE_EXCLUSIVE; |
118002
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "normal") ) return PAGER_LOCKINGMODE_NORMAL; |
118016
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "none") ) return BTREE_AUTOVACUUM_NONE; |
118017
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "full") ) return BTREE_AUTOVACUUM_FULL; |
118018
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "incremental") ) return BTREE_AUTOVACUUM_INCR; |
118020
|
0 |
0 |
return (u8)((i>=0&&i<=2)?i:0); |
|
0 |
0 |
return (u8)((i>=0&&i<=2)?i:0); |
118031
|
0 |
0 |
if( z[0]>='0' && z[0]<='2' ){ |
|
0 |
0 |
if( z[0]>='0' && z[0]<='2' ){ |
118033
|
0 |
0 |
}else if( sqlite3StrICmp(z, "file")==0 ){ |
118035
|
0 |
0 |
}else if( sqlite3StrICmp(z, "memory")==0 ){ |
118050
|
0 |
0 |
if( db->aDb[1].pBt!=0 ){ |
118051
|
0 |
0 |
if( !db->autoCommit || sqlite3BtreeIsInReadTrans(db->aDb[1].pBt) ){ |
|
0 |
0 |
if( !db->autoCommit || sqlite3BtreeIsInReadTrans(db->aDb[1].pBt) ){ |
118073
|
0 |
0 |
if( db->temp_store==ts ) return SQLITE_OK; |
118074
|
0 |
0 |
if( invalidateTempStorage( pParse ) != SQLITE_OK ){ |
118090
|
179 |
18 |
sqlite3VdbeSetNumCols(v, n==0 ? 1 : n); |
118091
|
18 |
179 |
if( n==0 ){ |
118095
|
822 |
179 |
for(i=0, j=pPragma->iPragCName; i
|
118116
|
0 |
0 |
if( zValue ){ |
118129
|
8 |
0 |
if( db->autoCommit ){ |
118138
|
16 |
8 |
while( (n--) > 0 ){ |
118139
|
8 |
8 |
if( pDb->pBt ){ |
118191
|
0 |
0 |
if( eMode==ArraySize(azModeName) ) return 0; |
118202
|
969 |
0 |
while( lwr<=upr ){ |
118205
|
202 |
767 |
if( rc==0 ) break; |
118206
|
256 |
511 |
if( rc<0 ){ |
118212
|
202 |
0 |
return lwr>upr ? 0 : &aPragmaName[mid]; |
118265
|
0 |
202 |
if( v==0 ) return; |
118272
|
0 |
202 |
if( iDb<0 ) return; |
118278
|
3 |
199 |
if( iDb==1 && sqlite3OpenTempDatabase(pParse) ){ |
|
0 |
3 |
if( iDb==1 && sqlite3OpenTempDatabase(pParse) ){ |
118283
|
0 |
202 |
if( !zLeft ) return; |
118284
|
0 |
202 |
if( minusFlag ){ |
118291
|
109 |
93 |
zDb = pId2->n>0 ? pDb->zDbSName : 0; |
118292
|
0 |
202 |
if( sqlite3AuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, zDb) ){ |
118317
|
0 |
202 |
if( rc==SQLITE_OK ){ |
118324
|
0 |
202 |
if( rc!=SQLITE_NOTFOUND ){ |
118325
|
0 |
0 |
if( aFcntl[0] ){ |
118336
|
0 |
202 |
if( pPragma==0 ) goto pragma_out; |
118339
|
179 |
23 |
if( (pPragma->mPragFlg & PragFlg_NeedSchema)!=0 ){ |
118340
|
0 |
179 |
if( sqlite3ReadSchema(pParse) ) goto pragma_out; |
118344
|
202 |
0 |
if( (pPragma->mPragFlg & PragFlg_NoColumns)==0 |
118345
|
23 |
179 |
&& ((pPragma->mPragFlg & PragFlg_NoColumns1)==0 || zRight==0) |
|
14 |
9 |
&& ((pPragma->mPragFlg & PragFlg_NoColumns1)==0 || zRight==0) |
118385
|
0 |
0 |
if( !zRight ){ |
118418
|
10 |
0 |
if( !zRight ){ |
118419
|
10 |
0 |
int size = ALWAYS(pBt) ? sqlite3BtreeGetPageSize(pBt) : 0; |
118426
|
0 |
0 |
if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize,-1,0) ){ |
118445
|
0 |
0 |
if( zRight ){ |
118446
|
0 |
0 |
if( sqlite3_stricmp(zRight, "fast")==0 ){ |
118452
|
0 |
0 |
if( pId2->n==0 && b>=0 ){ |
|
0 |
0 |
if( pId2->n==0 && b>=0 ){ |
118454
|
0 |
0 |
for(ii=0; iinDb; ii++){ |
118484
|
0 |
0 |
if( sqlite3Tolower(zLeft[0])=='p' ){ |
118502
|
0 |
0 |
if( pId2->n==0 && eMode==PAGER_LOCKINGMODE_QUERY ){ |
|
0 |
0 |
if( pId2->n==0 && eMode==PAGER_LOCKINGMODE_QUERY ){ |
118510
|
0 |
0 |
if( pId2->n==0 ){ |
118521
|
0 |
0 |
for(ii=2; iinDb; ii++){ |
118533
|
0 |
0 |
if( eMode==PAGER_LOCKINGMODE_EXCLUSIVE ){ |
118549
|
0 |
0 |
if( zRight==0 ){ |
118556
|
0 |
0 |
for(eMode=0; (zMode = sqlite3JournalModename(eMode))!=0; eMode++){ |
118557
|
0 |
0 |
if( sqlite3StrNICmp(zRight, zMode, n)==0 ) break; |
118559
|
0 |
0 |
if( !zMode ){ |
118565
|
0 |
0 |
if( eMode==PAGER_JOURNALMODE_QUERY && pId2->n==0 ){ |
|
0 |
0 |
if( eMode==PAGER_JOURNALMODE_QUERY && pId2->n==0 ){ |
118570
|
0 |
0 |
for(ii=db->nDb-1; ii>=0; ii--){ |
118571
|
0 |
0 |
if( db->aDb[ii].pBt && (ii==iDb || pId2->n==0) ){ |
|
0 |
0 |
if( db->aDb[ii].pBt && (ii==iDb || pId2->n==0) ){ |
|
0 |
0 |
if( db->aDb[ii].pBt && (ii==iDb || pId2->n==0) ){ |
118589
|
0 |
0 |
if( zRight ){ |
118591
|
0 |
0 |
if( iLimit<-1 ) iLimit = -1; |
118611
|
0 |
0 |
if( !zRight ){ |
118623
|
0 |
0 |
if( rc==SQLITE_OK && (eAuto==1 || eAuto==2) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && (eAuto==1 || eAuto==2) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && (eAuto==1 || eAuto==2) ){ |
118662
|
0 |
0 |
if( zRight==0 || !sqlite3GetInt32(zRight, &iLimit) || iLimit<=0 ){ |
|
0 |
0 |
if( zRight==0 || !sqlite3GetInt32(zRight, &iLimit) || iLimit<=0 ){ |
|
0 |
0 |
if( zRight==0 || !sqlite3GetInt32(zRight, &iLimit) || iLimit<=0 ){ |
118690
|
0 |
0 |
if( !zRight ){ |
118724
|
0 |
0 |
if( !zRight ){ |
118725
|
0 |
0 |
returnSingleInt(v, |
118730
|
0 |
0 |
if( sqlite3GetInt32(zRight, &size) ){ |
118733
|
0 |
0 |
if( sqlite3GetBoolean(zRight, size!=0) ){ |
118761
|
0 |
0 |
if( zRight ){ |
118764
|
0 |
0 |
if( sz<0 ) sz = sqlite3GlobalConfig.szMmap; |
118765
|
0 |
0 |
if( pId2->n==0 ) db->szMmap = sz; |
118766
|
0 |
0 |
for(ii=db->nDb-1; ii>=0; ii--){ |
118767
|
0 |
0 |
if( db->aDb[ii].pBt && (ii==iDb || pId2->n==0) ){ |
|
0 |
0 |
if( db->aDb[ii].pBt && (ii==iDb || pId2->n==0) ){ |
|
0 |
0 |
if( db->aDb[ii].pBt && (ii==iDb || pId2->n==0) ){ |
118778
|
0 |
0 |
if( rc==SQLITE_OK ){ |
118780
|
0 |
0 |
}else if( rc!=SQLITE_NOTFOUND ){ |
118799
|
0 |
0 |
if( !zRight ){ |
118818
|
0 |
0 |
if( !zRight ){ |
118822
|
0 |
0 |
if( zRight[0] ){ |
118825
|
0 |
0 |
if( rc!=SQLITE_OK || res==0 ){ |
|
0 |
0 |
if( rc!=SQLITE_OK || res==0 ){ |
118830
|
0 |
0 |
if( SQLITE_TEMP_STORE==0 |
118837
|
0 |
0 |
if( zRight[0] ){ |
118933
|
0 |
0 |
if( !zRight ){ |
118936
|
0 |
0 |
if( !db->autoCommit ){ |
118939
|
0 |
0 |
}else if( iDb!=1 ){ |
118941
|
0 |
0 |
if( iLevel==0 ) iLevel = 1; |
118953
|
4 |
8 |
if( zRight==0 ){ |
118958
|
0 |
8 |
if( db->autoCommit==0 ){ |
118970
|
7 |
1 |
if( sqlite3GetBoolean(zRight, 0) ){ |
118974
|
0 |
1 |
if( mask==SQLITE_DeferFKs ) db->nDeferredImmCons = 0; |
119002
|
69 |
0 |
case PragTyp_TABLE_INFO: if( zRight ){ |
119005
|
67 |
2 |
if( pTab ){ |
119013
|
134 |
67 |
for(i=0, pCol=pTab->aCol; inCol; i++, pCol++){ |
119014
|
0 |
134 |
if( IsHiddenColumn(pCol) ){ |
119018
|
75 |
59 |
if( (pCol->colFlags & COLFLAG_PRIMKEY)==0 ){ |
119020
|
26 |
33 |
}else if( pPk==0 ){ |
119023
|
41 |
0 |
for(k=1; k<=pTab->nCol && pPk->aiColumn[k-1]!=i; k++){} |
|
8 |
33 |
for(k=1; k<=pTab->nCol && pPk->aiColumn[k-1]!=i; k++){} |
119026
|
0 |
134 |
sqlite3VdbeMultiLoad(v, 1, "issisi", |
119065
|
24 |
0 |
case PragTyp_INDEX_INFO: if( zRight ){ |
119069
|
12 |
12 |
if( pIdx ){ |
119072
|
0 |
12 |
if( pPragma->iArg ){ |
119084
|
16 |
12 |
for(i=0; i
|
119086
|
16 |
0 |
sqlite3VdbeMultiLoad(v, 1, "iisX", i, cnum, |
119088
|
0 |
16 |
if( pPragma->iArg ){ |
119100
|
4 |
0 |
case PragTyp_INDEX_LIST: if( zRight ){ |
119105
|
4 |
0 |
if( pTab ){ |
119108
|
16 |
4 |
for(pIdx=pTab->pIndex, i=0; pIdx; pIdx=pIdx->pNext, i++){ |
119124
|
163 |
68 |
for(i=0; inDb; i++){ |
119125
|
39 |
124 |
if( db->aDb[i].pBt==0 ) continue; |
119139
|
0 |
0 |
for(p=sqliteHashFirst(&db->aCollSeq); p; p=sqliteHashNext(p)){ |
119188
|
14 |
0 |
case PragTyp_FOREIGN_KEY_LIST: if( zRight ){ |
119192
|
14 |
0 |
if( pTab ){ |
119194
|
11 |
3 |
if( pFK ){ |
119198
|
16 |
11 |
while(pFK){ |
119200
|
18 |
16 |
for(j=0; jnCol; j++){ |
119244
|
0 |
0 |
while( k ){ |
119245
|
0 |
0 |
if( zRight ){ |
119252
|
0 |
0 |
if( pTab==0 || pTab->pFKey==0 ) continue; |
|
0 |
0 |
if( pTab==0 || pTab->pFKey==0 ) continue; |
119254
|
0 |
0 |
if( pTab->nCol+regRow>pParse->nMem ) pParse->nMem = pTab->nCol + regRow; |
119257
|
0 |
0 |
for(i=1, pFK=pTab->pFKey; pFK; i++, pFK=pFK->pNextFrom){ |
119259
|
0 |
0 |
if( pParent==0 ) continue; |
119263
|
0 |
0 |
if( x==0 ){ |
119264
|
0 |
0 |
if( pIdx==0 ){ |
119276
|
0 |
0 |
if( pFK ) break; |
119277
|
0 |
0 |
if( pParse->nTabnTab = i; |
119279
|
0 |
0 |
for(i=1, pFK=pTab->pFKey; pFK; i++, pFK=pFK->pNextFrom){ |
119283
|
0 |
0 |
if( pParent ){ |
119293
|
0 |
0 |
for(j=0; jnCol; j++){ |
119294
|
0 |
0 |
int iCol = aiCols ? aiCols[j] : pFK->aCol[j].iFrom; |
119301
|
0 |
0 |
if( pIdx ){ |
119306
|
0 |
0 |
}else if( pParent ){ |
119314
|
0 |
0 |
if( HasRowid(pTab) ){ |
119349
|
0 |
0 |
if( zRight ){ |
119388
|
0 |
0 |
if( pId2->z==0 ) iDb = -1; |
119395
|
0 |
0 |
if( zRight ){ |
119397
|
0 |
0 |
if( mxErr<=0 ){ |
119404
|
0 |
0 |
for(i=0; inDb; i++){ |
119412
|
0 |
0 |
if( iDb>=0 && i!=iDb ) continue; |
|
0 |
0 |
if( iDb>=0 && i!=iDb ) continue; |
119423
|
0 |
0 |
for(cnt=0, x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){ |
119427
|
0 |
0 |
if( HasRowid(pTab) ) cnt++; |
119428
|
0 |
0 |
for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){ cnt++; } |
119429
|
0 |
0 |
if( nIdx>mxIdx ) mxIdx = nIdx; |
119432
|
0 |
0 |
if( aRoot==0 ) break; |
119433
|
0 |
0 |
for(cnt=0, x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){ |
119436
|
0 |
0 |
if( HasRowid(pTab) ) aRoot[++cnt] = pTab->tnum; |
119437
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
119460
|
0 |
0 |
for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){ |
119468
|
0 |
0 |
if( pTab->tnum<1 ) continue; /* Skip VIEWs or VIRTUAL TABLEs */ |
119469
|
0 |
0 |
pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab); |
119477
|
0 |
0 |
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ |
119485
|
0 |
0 |
for(j=0; jnCol; j++){ |
119488
|
0 |
0 |
if( j==pTab->iPKey ) continue; |
119489
|
0 |
0 |
if( pTab->aCol[j].notNull==0 ) continue; |
119500
|
0 |
0 |
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ |
|
0 |
0 |
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ |
119502
|
0 |
0 |
if( db->mallocFailed==0 ){ |
119509
|
0 |
0 |
for(k=pCheck->nExpr-1; k>0; k--){ |
119525
|
0 |
0 |
if( !isQuick ){ /* Omit the remaining tests for quick_check */ |
119530
|
0 |
0 |
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ |
119533
|
0 |
0 |
if( pPk==pIdx ) continue; |
119552
|
0 |
0 |
if( IsUniqueIndex(pIdx) ){ |
119556
|
0 |
0 |
for(kk=0; kknKeyCol; kk++){ |
119559
|
0 |
0 |
if( iCol>=0 && pTab->aCol[iCol].notNull ) continue; |
|
0 |
0 |
if( iCol>=0 && pTab->aCol[iCol].notNull ) continue; |
119579
|
0 |
0 |
if( !isQuick ){ |
119581
|
0 |
0 |
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ |
119582
|
0 |
0 |
if( pPk==pIdx ) continue; |
119609
|
0 |
0 |
if( aOp ){ |
119661
|
0 |
0 |
if( !zRight ){ /* "PRAGMA encoding" */ |
119662
|
0 |
0 |
if( sqlite3ReadSchema(pParse) ) goto pragma_out; |
119673
|
0 |
0 |
if( |
119674
|
0 |
0 |
!(DbHasProperty(db, 0, DB_SchemaLoaded)) || |
119677
|
0 |
0 |
for(pEnc=&encnames[0]; pEnc->zName; pEnc++){ |
119678
|
0 |
0 |
if( 0==sqlite3StrICmp(zRight, pEnc->zName) ){ |
119679
|
0 |
0 |
SCHEMA_ENC(db) = ENC(db) = |
119684
|
0 |
0 |
if( !pEnc->zName ){ |
119729
|
1 |
0 |
if( zRight && (pPragma->mPragFlg & PragFlg_ReadOnly)==0 ){ |
|
1 |
0 |
if( zRight && (pPragma->mPragFlg & PragFlg_ReadOnly)==0 ){ |
119774
|
0 |
0 |
while( (zOpt = sqlite3_compileoption_get(i++))!=0 ){ |
119790
|
0 |
0 |
int iBt = (pId2->z?iDb:SQLITE_MAX_ATTACHED); |
119792
|
0 |
0 |
if( zRight ){ |
119793
|
0 |
0 |
if( sqlite3StrICmp(zRight, "full")==0 ){ |
119795
|
0 |
0 |
}else if( sqlite3StrICmp(zRight, "restart")==0 ){ |
119797
|
0 |
0 |
}else if( sqlite3StrICmp(zRight, "truncate")==0 ){ |
119816
|
0 |
0 |
if( zRight ){ |
119819
|
0 |
0 |
returnSingleInt(v, |
119903
|
0 |
0 |
if( zRight ){ |
119905
|
0 |
0 |
if( (opMask & 0x02)==0 ) break; |
119910
|
0 |
0 |
for(iDbLast = zDb?iDb:db->nDb-1; iDb<=iDbLast; iDb++){ |
|
0 |
0 |
for(iDbLast = zDb?iDb:db->nDb-1; iDb<=iDbLast; iDb++){ |
119911
|
0 |
0 |
if( iDb==1 ) continue; |
119914
|
0 |
0 |
for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){ |
119920
|
0 |
0 |
if( (pTab->tabFlags & TF_StatsUsed)==0 ) continue; |
119924
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
119925
|
0 |
0 |
if( !pIdx->hasStat1 ){ |
119930
|
0 |
0 |
if( szThreshold ){ |
119938
|
0 |
0 |
if( opMask & 0x01 ){ |
119962
|
0 |
0 |
if( zRight ){ |
119982
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK ){ |
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK ){ |
119998
|
0 |
0 |
if( zRight |
119999
|
0 |
0 |
&& sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK |
120000
|
0 |
0 |
&& N>=0 |
120038
|
0 |
0 |
if( zRight ) sqlite3_key_v2(db, zDb, zRight, sqlite3Strlen30(zRight)); |
120042
|
0 |
0 |
if( zRight ) sqlite3_rekey_v2(db, zDb, zRight, sqlite3Strlen30(zRight)); |
120046
|
0 |
0 |
if( zRight ){ |
120050
|
0 |
0 |
for(i=0, iByte=0; i
|
|
0 |
0 |
for(i=0, iByte=0; i
|
120052
|
0 |
0 |
if( (i&1)!=0 ) zKey[i/2] = iByte; |
120054
|
0 |
0 |
if( (zLeft[3] & 0xf)==0xb ){ |
120064
|
0 |
0 |
case PragTyp_ACTIVATE_EXTENSIONS: if( zRight ){ |
120066
|
0 |
0 |
if( sqlite3StrNICmp(zRight, "see-", 4)==0 ){ |
120137
|
0 |
0 |
for(i=0, j=pPragma->iPragCName; inPragCName; i++, j++){ |
120141
|
0 |
0 |
if( i==0 ){ |
120147
|
0 |
0 |
if( pPragma->mPragFlg & PragFlg_Result1 ){ |
120151
|
0 |
0 |
if( pPragma->mPragFlg & (PragFlg_SchemaOpt|PragFlg_SchemaReq) ){ |
120159
|
0 |
0 |
if( rc==SQLITE_OK ){ |
120161
|
0 |
0 |
if( pTab==0 ){ |
120201
|
0 |
0 |
if( pTab->nHidden==0 ){ return SQLITE_OK; } |
120205
|
0 |
0 |
for(i=0; inConstraint; i++, pConstraint++){ |
120206
|
0 |
0 |
if( pConstraint->usable==0 ) continue; |
120207
|
0 |
0 |
if( pConstraint->op!=SQLITE_INDEX_CONSTRAINT_EQ ) continue; |
120208
|
0 |
0 |
if( pConstraint->iColumn < pTab->iHidden ) continue; |
120213
|
0 |
0 |
if( seen[0]==0 ){ |
120221
|
0 |
0 |
if( seen[1]==0 ) return SQLITE_OK; |
120234
|
0 |
0 |
if( pCsr==0 ) return SQLITE_NOMEM; |
120246
|
0 |
0 |
for(i=0; iazArg); i++){ |
120268
|
0 |
0 |
if( SQLITE_ROW!=sqlite3_step(pCsr->pPragma) ){ |
120295
|
0 |
0 |
for(i=0; i
|
120299
|
0 |
0 |
if( zText ){ |
120301
|
0 |
0 |
if( pCsr->azArg[j]==0 ){ |
120308
|
0 |
0 |
if( pCsr->azArg[1] ){ |
120312
|
0 |
0 |
if( pCsr->azArg[0] ){ |
120316
|
0 |
0 |
if( zSql==0 ) return SQLITE_NOMEM; |
120319
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
120344
|
0 |
0 |
if( iiHidden ){ |
120397
|
0 |
0 |
if( pName==0 ) return 0; |
120398
|
0 |
0 |
if( (pName->mPragFlg & (PragFlg_Result0|PragFlg_Result1))==0 ) return 0; |
120436
|
0 |
0 |
if( !db->mallocFailed && (db->flags & SQLITE_WriteSchema)==0 ){ |
|
0 |
0 |
if( !db->mallocFailed && (db->flags & SQLITE_WriteSchema)==0 ){ |
120438
|
0 |
0 |
if( zObj==0 ) zObj = "?"; |
120440
|
0 |
0 |
if( zExtra && zExtra[0] ) z = sqlite3MPrintf(db, "%z - %s", z, zExtra); |
|
0 |
0 |
if( zExtra && zExtra[0] ) z = sqlite3MPrintf(db, "%z - %s", z, zExtra); |
120444
|
0 |
0 |
pData->rc = db->mallocFailed ? SQLITE_NOMEM_BKPT : SQLITE_CORRUPT_BKPT; |
120468
|
0 |
701 |
if( db->mallocFailed ){ |
120474
|
0 |
701 |
if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */ |
120475
|
0 |
701 |
if( argv[1]==0 ){ |
120477
|
666 |
35 |
}else if( sqlite3_strnicmp(argv[2],"create ",7)==0 ){ |
120497
|
0 |
666 |
if( SQLITE_OK!=rc ){ |
120498
|
0 |
0 |
if( db->init.orphanTrigger ){ |
120502
|
0 |
0 |
if( rc==SQLITE_NOMEM ){ |
120504
|
0 |
0 |
}else if( rc!=SQLITE_INTERRUPT && (rc&0xFF)!=SQLITE_LOCKED ){ |
|
0 |
0 |
}else if( rc!=SQLITE_INTERRUPT && (rc&0xFF)!=SQLITE_LOCKED ){ |
120510
|
35 |
0 |
}else if( argv[0]==0 || (argv[2]!=0 && argv[2][0]!=0) ){ |
|
0 |
35 |
}else if( argv[0]==0 || (argv[2]!=0 && argv[2][0]!=0) ){ |
|
0 |
0 |
}else if( argv[0]==0 || (argv[2]!=0 && argv[2][0]!=0) ){ |
120521
|
35 |
0 |
if( pIndex==0 ){ |
120528
|
0 |
35 |
}else if( sqlite3GetInt32(argv[1], &pIndex->tnum)==0 ){ |
120569
|
191 |
196 |
azArg[0] = zMasterName = SCHEMA_TABLE(iDb); |
120579
|
0 |
387 |
if( initData.rc ){ |
120587
|
191 |
196 |
if( pDb->pBt==0 ){ |
120598
|
172 |
24 |
if( !sqlite3BtreeIsInReadTrans(pDb->pBt) ){ |
120600
|
0 |
172 |
if( rc!=SQLITE_OK ){ |
120624
|
980 |
196 |
for(i=0; i
|
120627
|
0 |
196 |
if( (db->flags & SQLITE_ResetDatabase)!=0 ){ |
120637
|
31 |
165 |
if( meta[BTREE_TEXT_ENCODING-1] ){ /* text encoding */ |
120638
|
31 |
0 |
if( iDb==0 ){ |
120643
|
0 |
31 |
if( encoding==0 ) encoding = SQLITE_UTF8; |
120650
|
0 |
0 |
if( meta[BTREE_TEXT_ENCODING-1]!=ENC(db) ){ |
120662
|
195 |
1 |
if( pDb->pSchema->cache_size==0 ){ |
120665
|
195 |
0 |
if( size==0 ){ size = SQLITE_DEFAULT_CACHE_SIZE; } |
120680
|
165 |
31 |
if( pDb->pSchema->file_format==0 ){ |
120683
|
0 |
196 |
if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){ |
120694
|
191 |
5 |
if( iDb==0 && meta[BTREE_FILE_FORMAT-1]>=4 ){ |
|
31 |
160 |
if( iDb==0 && meta[BTREE_FILE_FORMAT-1]>=4 ){ |
120717
|
196 |
0 |
if( rc==SQLITE_OK ) rc = initData.rc; |
120720
|
196 |
0 |
if( rc==SQLITE_OK ){ |
120725
|
0 |
196 |
if( db->mallocFailed ){ |
120729
|
0 |
196 |
if( rc==SQLITE_OK || (db->flags&SQLITE_WriteSchema)){ |
|
0 |
0 |
if( rc==SQLITE_OK || (db->flags&SQLITE_WriteSchema)){ |
120747
|
172 |
24 |
if( openedTransaction ){ |
120753
|
0 |
387 |
if( rc ){ |
120754
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){ |
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){ |
120783
|
191 |
4292 |
if( !DbHasProperty(db, 0, DB_SchemaLoaded) ){ |
120785
|
0 |
191 |
if( rc ) return rc; |
120788
|
4683 |
4483 |
for(i=db->nDb-1; i>0; i--){ |
120790
|
196 |
4487 |
if( !DbHasProperty(db, i, DB_SchemaLoaded) ){ |
120792
|
0 |
196 |
if( rc ) return rc; |
120795
|
4324 |
159 |
if( commit_internal ){ |
120809
|
4465 |
1141 |
if( !db->init.busy ){ |
120811
|
0 |
4465 |
if( rc!=SQLITE_OK ){ |
120814
|
0 |
4465 |
}else if( db->noSharedCache ){ |
120835
|
14 |
7 |
for(iDb=0; iDbnDb; iDb++){ |
120838
|
7 |
7 |
if( pBt==0 ) continue; |
120843
|
7 |
0 |
if( !sqlite3BtreeIsInReadTrans(pBt) ){ |
120845
|
7 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){ |
|
0 |
7 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){ |
120848
|
0 |
7 |
if( rc!=SQLITE_OK ) return; |
120857
|
0 |
7 |
if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){ |
120863
|
7 |
0 |
if( openedTransaction ){ |
120890
|
11150 |
35 |
if( pSchema ){ |
120893
|
11150 |
5496 |
if( db->aDb[i].pSchema==pSchema ){ |
120909
|
5791 |
0 |
if( db ){ |
120943
|
90 |
5648 |
if( prepFlags & SQLITE_PREPARE_PERSISTENT ){ |
120971
|
11644 |
5738 |
for(i=0; inDb; i++) { |
120973
|
8606 |
3038 |
if( pBt ){ |
120976
|
0 |
8606 |
if( rc ){ |
120988
|
0 |
5738 |
if( nBytes>=0 && (nBytes==0 || zSql[nBytes-1]!=0) ){ |
|
0 |
0 |
if( nBytes>=0 && (nBytes==0 || zSql[nBytes-1]!=0) ){ |
|
0 |
0 |
if( nBytes>=0 && (nBytes==0 || zSql[nBytes-1]!=0) ){ |
120993
|
0 |
0 |
if( nBytes>mxLen ){ |
120999
|
0 |
0 |
if( zSqlCopy ){ |
121011
|
5720 |
18 |
if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK; |
121012
|
7 |
5731 |
if( sParse.checkSchema ){ |
121015
|
0 |
5738 |
if( db->mallocFailed ){ |
121018
|
4710 |
1028 |
if( pzTail ){ |
121024
|
5728 |
10 |
if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){ |
|
5720 |
8 |
if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){ |
|
0 |
5720 |
if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){ |
121030
|
0 |
0 |
if( sParse.explain==2 ){ |
121039
|
0 |
0 |
for(i=iFirst; i
|
121046
|
4637 |
1101 |
if( db->init.busy==0 ){ |
121049
|
5720 |
18 |
if( sParse.pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){ |
|
5720 |
0 |
if( sParse.pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){ |
|
0 |
5720 |
if( sParse.pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){ |
121056
|
10 |
5728 |
if( zErrMsg ){ |
121064
|
0 |
5738 |
while( sParse.pTriggerPrg ){ |
121091
|
5738 |
0 |
if( !sqlite3SafetyCheckOk(db)||zSql==0 ){ |
|
0 |
5738 |
if( !sqlite3SafetyCheckOk(db)||zSql==0 ){ |
121103
|
0 |
5738 |
|| (rc==SQLITE_SCHEMA && (sqlite3ResetOneSchema(db,-1), cnt++)==0) ); |
|
0 |
5738 |
|| (rc==SQLITE_SCHEMA && (sqlite3ResetOneSchema(db,-1), cnt++)==0) ); |
|
0 |
0 |
|| (rc==SQLITE_SCHEMA && (sqlite3ResetOneSchema(db,-1), cnt++)==0) ); |
121133
|
0 |
1 |
if( rc ){ |
121134
|
0 |
0 |
if( rc==SQLITE_NOMEM ){ |
121236
|
0 |
0 |
if( !sqlite3SafetyCheckOk(db)||zSql==0 ){ |
|
0 |
0 |
if( !sqlite3SafetyCheckOk(db)||zSql==0 ){ |
121239
|
0 |
0 |
if( nBytes>=0 ){ |
121242
|
0 |
0 |
for(sz=0; sz
|
|
0 |
0 |
for(sz=0; sz
|
|
0 |
0 |
for(sz=0; sz
|
121247
|
0 |
0 |
if( zSql8 ){ |
121251
|
0 |
0 |
if( zTail8 && pzTail ){ |
|
0 |
0 |
if( zTail8 && pzTail ){ |
121407
|
4439 |
4354 |
while( p ){ |
121416
|
0 |
4439 |
if( OK_IF_ALWAYS_TRUE(p->pWith) ) sqlite3WithDelete(db, p->pWith); |
121417
|
4439 |
0 |
if( bFree ) sqlite3DbFreeNN(db, p); |
121453
|
0 |
4439 |
if( pNew==0 ){ |
121457
|
2 |
4437 |
if( pEList==0 ){ |
121472
|
2673 |
1766 |
if( pSrc==0 ) pSrc = sqlite3DbMallocZero(pParse->db, sizeof(*pSrc)); |
121482
|
0 |
4439 |
if( pParse->db->mallocFailed ) { |
121508
|
4354 |
8034 |
if( OK_IF_ALWAYS_TRUE(p) ) clearSelect(db, p, 1); |
121515
|
0 |
2 |
while( p->pNext ) p = p->pNext; |
121559
|
0 |
0 |
for(i=0; i<3 && apAll[i]; i++){ |
|
0 |
0 |
for(i=0; i<3 && apAll[i]; i++){ |
121561
|
0 |
0 |
for(j=0; j
|
121562
|
0 |
0 |
if( p->n==aKeyword[j].nChar |
121563
|
0 |
0 |
&& sqlite3StrNICmp((char*)p->z, &zKeyText[aKeyword[j].i], p->n)==0 ){ |
121569
|
0 |
0 |
if( j>=ArraySize(aKeyword) ){ |
121574
|
0 |
0 |
if( |
121575
|
0 |
0 |
(jointype & (JT_INNER|JT_OUTER))==(JT_INNER|JT_OUTER) || |
121580
|
0 |
0 |
if( pC==0 ){ zSp++; } |
121584
|
0 |
0 |
}else if( (jointype & JT_OUTER)!=0 |
121585
|
0 |
0 |
&& (jointype & (JT_LEFT|JT_RIGHT))!=JT_LEFT ){ |
121599
|
0 |
0 |
for(i=0; inCol; i++){ |
121600
|
0 |
0 |
if( sqlite3StrICmp(pTab->aCol[i].zName, zCol)==0 ) return i; |
121625
|
0 |
0 |
for(i=0; i
|
121627
|
0 |
0 |
if( iCol>=0 ){ |
121628
|
0 |
0 |
if( piTab ){ |
121673
|
0 |
0 |
if( pEq && isOuterJoin ){ |
|
0 |
0 |
if( pEq && isOuterJoin ){ |
121709
|
0 |
0 |
while( p ){ |
121714
|
0 |
0 |
if( p->op==TK_FUNCTION && p->x.pList ){ |
|
0 |
0 |
if( p->op==TK_FUNCTION && p->x.pList ){ |
121716
|
0 |
0 |
for(i=0; ix.pList->nExpr; i++){ |
121732
|
303 |
596 |
while( p ){ |
121733
|
0 |
303 |
if( ExprHasProperty(p, EP_FromJoin) |
121734
|
0 |
0 |
&& (iTable<0 || p->iRightJoinTable==iTable) ){ |
|
0 |
0 |
&& (iTable<0 || p->iRightJoinTable==iTable) ){ |
121737
|
96 |
207 |
if( p->op==TK_FUNCTION && p->x.pList ){ |
|
96 |
0 |
if( p->op==TK_FUNCTION && p->x.pList ){ |
121739
|
192 |
96 |
for(i=0; ix.pList->nExpr; i++){ |
121771
|
3 |
1780 |
for(i=0; inSrc-1; i++, pRight++, pLeft++){ |
121775
|
3 |
0 |
if( NEVER(pLeft->pTab==0 || pRightTab==0) ) continue; |
|
0 |
3 |
if( NEVER(pLeft->pTab==0 || pRightTab==0) ) continue; |
121781
|
0 |
3 |
if( pRight->fg.jointype & JT_NATURAL ){ |
121782
|
0 |
0 |
if( pRight->pOn || pRight->pUsing ){ |
|
0 |
0 |
if( pRight->pOn || pRight->pUsing ){ |
121787
|
0 |
0 |
for(j=0; jnCol; j++){ |
121793
|
0 |
0 |
if( tableAndColumnIndex(pSrc, i+1, zName, &iLeft, &iLeftCol) ){ |
121802
|
0 |
3 |
if( pRight->pOn && pRight->pUsing ){ |
|
0 |
0 |
if( pRight->pOn && pRight->pUsing ){ |
121811
|
0 |
3 |
if( pRight->pOn ){ |
121812
|
0 |
0 |
if( isOuter ) setJoinExpr(pRight->pOn, pRight->iCursor); |
121824
|
0 |
3 |
if( pRight->pUsing ){ |
121826
|
0 |
0 |
for(j=0; jnId; j++){ |
121834
|
0 |
0 |
if( iRightCol<0 |
121835
|
0 |
0 |
|| !tableAndColumnIndex(pSrc, i+1, zName, &iLeft, &iLeftCol) |
121906
|
1 |
103 |
if( pSort->pDeferredRowLoad ){ |
121954
|
104 |
0 |
if( nPrefixReg ){ |
121962
|
0 |
104 |
iLimit = pSelect->iOffset ? pSelect->iOffset+1 : pSelect->iLimit; |
121964
|
19 |
85 |
sqlite3ExprCodeExprList(pParse, pSort->pOrderBy, regBase, regOrigData, |
121966
|
1 |
103 |
if( bSeq ){ |
121969
|
0 |
104 |
if( nPrefixReg==0 && nData>0 ){ |
|
0 |
0 |
if( nPrefixReg==0 && nData>0 ){ |
121972
|
18 |
86 |
if( nOBSat>0 ){ |
121984
|
0 |
18 |
if( bSeq ){ |
121992
|
0 |
18 |
if( pParse->db->mallocFailed ) return; |
122006
|
0 |
18 |
if( iLimit ){ |
122014
|
1 |
103 |
if( iLimit ){ |
122039
|
86 |
18 |
if( regRecord==0 ){ |
122042
|
103 |
1 |
if( pSort->sortFlags & SORTFLAG_UseSorter ){ |
122049
|
1 |
103 |
if( iSkip ){ |
122064
|
0 |
1769 |
if( iOffset>0 ){ |
122217
|
1631 |
138 |
hasDistinct = pDistinct ? pDistinct->eTnctType : WHERE_DISTINCT_NOOP; |
122218
|
1631 |
138 |
if( pSort && pSort->pOrderBy==0 ) pSort = 0; |
|
1527 |
104 |
if( pSort && pSort->pOrderBy==0 ) pSort = 0; |
122219
|
1665 |
104 |
if( pSort==0 && !hasDistinct ){ |
|
1663 |
2 |
if( pSort==0 && !hasDistinct ){ |
122228
|
1664 |
105 |
if( pDest->iSdst==0 ){ |
122229
|
104 |
1560 |
if( pSort ){ |
122231
|
1 |
103 |
if( !(pSort->sortFlags & SORTFLAG_UseSorter) ) nPrefixReg++; |
122236
|
0 |
105 |
}else if( pDest->iSdst+nResultCol > pParse->nMem ){ |
122246
|
2 |
1767 |
if( srcTab>=0 ){ |
122247
|
2 |
2 |
for(i=0; i
|
122251
|
1767 |
0 |
}else if( eDest!=SRT_Exists ){ |
122260
|
1749 |
18 |
if( eDest==SRT_Mem || eDest==SRT_Output || eDest==SRT_Coroutine ){ |
|
114 |
1635 |
if( eDest==SRT_Mem || eDest==SRT_Output || eDest==SRT_Coroutine ){ |
|
105 |
9 |
if( eDest==SRT_Mem || eDest==SRT_Output || eDest==SRT_Coroutine ){ |
122265
|
104 |
1663 |
if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab && eDest!=SRT_Table ){ |
|
104 |
0 |
if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab && eDest!=SRT_Table ){ |
|
104 |
0 |
if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab && eDest!=SRT_Table ){ |
|
104 |
0 |
if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab && eDest!=SRT_Table ){ |
122274
|
136 |
104 |
for(i=pSort->nOBSat; ipOrderBy->nExpr; i++){ |
122276
|
117 |
19 |
if( (j = pSort->pOrderBy->a[i].u.x.iOrderByCol)>0 ){ |
122298
|
256 |
104 |
for(i=0; inExpr; i++){ |
122299
|
117 |
139 |
if( pEList->a[i].u.x.iOrderByCol>0 |
122324
|
20 |
1747 |
if( p->iLimit |
122325
|
1 |
19 |
&& (ecelFlags & SQLITE_ECEL_OMITREF)!=0 |
122326
|
1 |
0 |
&& nPrefixReg>0 |
122341
|
2 |
1767 |
if( hasDistinct ){ |
122365
|
0 |
0 |
for(i=0; i
|
122367
|
0 |
0 |
if( i
|
122394
|
2 |
0 |
if( pSort==0 ){ |
122436
|
0 |
0 |
if( eDest==SRT_DistFifo ){ |
122449
|
0 |
0 |
if( pSort ){ |
122469
|
0 |
3 |
if( pSort ){ |
122501
|
0 |
18 |
if( pSort ){ |
122518
|
104 |
1638 |
if( pSort ){ |
122521
|
107 |
1531 |
}else if( eDest==SRT_Coroutine ){ |
122549
|
0 |
0 |
if( eDest==SRT_DistQueue ){ |
122558
|
0 |
0 |
if( eDest==SRT_DistQueue ){ |
122562
|
0 |
0 |
for(i=0; i
|
122570
|
0 |
0 |
if( addrTest ) sqlite3VdbeJumpHere(v, addrTest); |
122596
|
1665 |
104 |
if( pSort==0 && p->iLimit ){ |
|
19 |
1646 |
if( pSort==0 && p->iLimit ){ |
122608
|
672 |
0 |
if( p ){ |
122626
|
692 |
0 |
if( p ){ |
122629
|
672 |
20 |
if( p->nRef==0 ) sqlite3DbFreeNN(p->db, p); |
122637
|
20 |
0 |
if( p ){ |
122682
|
585 |
0 |
if( pInfo ){ |
122684
|
638 |
585 |
for(i=iStart, pItem=pList->a+iStart; i
|
122770
|
18 |
86 |
if( pSort->labelBkOut ){ |
122787
|
0 |
104 |
if( eDest==SRT_Output || eDest==SRT_Coroutine || eDest==SRT_Mem ){ |
|
0 |
0 |
if( eDest==SRT_Output || eDest==SRT_Coroutine || eDest==SRT_Mem ){ |
|
0 |
0 |
if( eDest==SRT_Output || eDest==SRT_Coroutine || eDest==SRT_Mem ){ |
122795
|
103 |
1 |
if( pSort->sortFlags & SORTFLAG_UseSorter ){ |
122798
|
18 |
85 |
if( pSort->labelBkOut ){ |
122803
|
18 |
85 |
if( addrOnce ) sqlite3VdbeJumpHere(v, addrOnce); |
122815
|
256 |
104 |
for(i=0, iCol=nKey+bSeq-1; i
|
122819
|
139 |
117 |
if( aOutEx[i].u.x.iOrderByCol==0 ) iCol++; |
122852
|
256 |
104 |
for(i=nColumn-1; i>=0; i--){ |
122860
|
117 |
139 |
if( aOutEx[i].u.x.iOrderByCol ){ |
122895
|
104 |
0 |
if( eDest==SRT_Output ){ |
122904
|
0 |
104 |
if( regRowid ){ |
122905
|
0 |
0 |
if( eDest==SRT_Set ){ |
122915
|
103 |
1 |
if( pSort->sortFlags & SORTFLAG_UseSorter ){ |
122920
|
18 |
86 |
if( pSort->regReturn ) sqlite3VdbeAddOp1(v, OP_Return, pSort->regReturn); |
122985
|
5154 |
0 |
while( pNC && !pTab ){ |
|
2577 |
2577 |
while( pNC && !pTab ){ |
122987
|
2582 |
0 |
for(j=0;jnSrc && pTabList->a[j].iCursor!=pExpr->iTable;j++); |
|
5 |
2577 |
for(j=0;jnSrc && pTabList->a[j].iCursor!=pExpr->iTable;j++); |
122988
|
2577 |
0 |
if( jnSrc ){ |
122996
|
0 |
2577 |
if( pTab==0 ){ |
123018
|
198 |
2379 |
if( pS ){ |
123023
|
198 |
0 |
if( iCol>=0 && iColpEList->nExpr ){ |
|
198 |
0 |
if( iCol>=0 && iColpEList->nExpr ){ |
123039
|
94 |
2285 |
if( iCol<0 ) iCol = pTab->iPKey; |
123041
|
12 |
2367 |
if( iCol<0 ){ |
123049
|
2346 |
33 |
if( pNC->pParse && pTab->pSchema ){ |
|
2346 |
0 |
if( pNC->pParse && pTab->pSchema ){ |
123084
|
3189 |
146 |
if( pzOrigDb ){ |
123110
|
2991 |
1635 |
for(i=0; inExpr; i++){ |
123180
|
0 |
1635 |
if( pParse->explain ){ |
123185
|
0 |
1635 |
if( pParse->colNamesSet ) return; |
123187
|
0 |
1635 |
while( pSelect->pPrior ) pSelect = pSelect->pPrior; |
123195
|
1 |
1634 |
srcName = (db->flags & SQLITE_ShortColNames)!=0 || fullName; |
|
1 |
0 |
srcName = (db->flags & SQLITE_ShortColNames)!=0 || fullName; |
123197
|
2991 |
1635 |
for(i=0; inExpr; i++){ |
123203
|
351 |
2640 |
if( pEList->a[i].zName ){ |
123207
|
2640 |
0 |
}else if( srcName && p->op==TK_COLUMN ){ |
|
2116 |
524 |
}else if( srcName && p->op==TK_COLUMN ){ |
123212
|
79 |
2037 |
if( iCol<0 ) iCol = pTab->iPKey; |
123214
|
12 |
2104 |
if( iCol<0 ){ |
123219
|
0 |
2116 |
if( fullName ){ |
123228
|
0 |
524 |
z = z==0 ? sqlite3MPrintf(db, "column%d", i+1) : sqlite3DbStrDup(db, z); |
123273
|
35 |
0 |
if( pEList ){ |
123277
|
0 |
35 |
if( nCol>32767 ) nCol = 32767; |
123286
|
146 |
35 |
for(i=0, pCol=aCol; imallocFailed; i++, pCol++){ |
|
146 |
0 |
for(i=0, pCol=aCol; imallocFailed; i++, pCol++){ |
123289
|
59 |
87 |
if( (zName = pEList->a[i].zName)!=0 ){ |
123293
|
0 |
59 |
while( pColExpr->op==TK_DOT ){ |
123298
|
0 |
59 |
if( pColExpr->op==TK_COLUMN ){ |
123303
|
0 |
0 |
if( iCol<0 ) iCol = pTab->iPKey; |
123304
|
0 |
0 |
zName = iCol>=0 ? pTab->aCol[iCol].zName : "rowid"; |
123305
|
59 |
0 |
}else if( pColExpr->op==TK_ID ){ |
123313
|
146 |
0 |
if( zName ){ |
123323
|
146 |
0 |
while( zName && sqlite3HashFind(&ht, zName)!=0 ){ |
|
0 |
146 |
while( zName && sqlite3HashFind(&ht, zName)!=0 ){ |
123325
|
0 |
0 |
if( nName>0 ){ |
123326
|
0 |
0 |
for(j=nName-1; j>0 && sqlite3Isdigit(zName[j]); j--){} |
|
0 |
0 |
for(j=nName-1; j>0 && sqlite3Isdigit(zName[j]); j--){} |
123327
|
0 |
0 |
if( zName[j]==':' ) nName = j; |
123330
|
0 |
0 |
if( cnt>3 ) sqlite3_randomness(sizeof(cnt), &cnt); |
123334
|
146 |
0 |
if( zName && sqlite3HashInsert(&ht, zName, pCol)==pCol ){ |
|
0 |
146 |
if( zName && sqlite3HashInsert(&ht, zName, pCol)==pCol ){ |
123339
|
0 |
35 |
if( db->mallocFailed ){ |
123340
|
0 |
0 |
for(j=0; j
|
123378
|
0 |
35 |
if( db->mallocFailed ) return; |
123382
|
146 |
35 |
for(i=0, pCol=pTab->aCol; inCol; i++, pCol++){ |
123389
|
33 |
113 |
if( zType ){ |
123393
|
33 |
0 |
if( pCol->zName ){ |
123398
|
61 |
85 |
if( pCol->affinity==0 ) pCol->affinity = SQLITE_AFF_BLOB; |
123400
|
85 |
61 |
if( pColl && pCol->zColl==0 ){ |
|
85 |
0 |
if( pColl && pCol->zColl==0 ){ |
123420
|
0 |
0 |
if( pParse->nErr ) return 0; |
123421
|
0 |
0 |
while( pSelect->pPrior ) pSelect = pSelect->pPrior; |
123424
|
0 |
0 |
if( pTab==0 ){ |
123436
|
0 |
0 |
if( db->mallocFailed ){ |
123448
|
23980 |
5746 |
if( pParse->pVdbe ){ |
123451
|
5746 |
0 |
if( pParse->pToplevel==0 |
123452
|
5746 |
0 |
&& OptimizationEnabled(pParse->db,SQLITE_FactorOutConst) |
123490
|
0 |
1755 |
if( p->iLimit ) return; |
123499
|
20 |
1735 |
if( pLimit ){ |
123505
|
20 |
0 |
if( sqlite3ExprIsInteger(pLimit->pLeft, &n) ){ |
123508
|
0 |
20 |
if( n==0 ){ |
123510
|
20 |
0 |
}else if( n>=0 && p->nSelectRow>sqlite3LogEst((u64)n) ){ |
|
20 |
0 |
}else if( n>=0 && p->nSelectRow>sqlite3LogEst((u64)n) ){ |
123520
|
0 |
20 |
if( pLimit->pRight ){ |
123543
|
4 |
2 |
if( p->pPrior ){ |
123552
|
6 |
0 |
if( pRet==0 && ALWAYS(iColpEList->nExpr) ){ |
|
6 |
0 |
if( pRet==0 && ALWAYS(iColpEList->nExpr) ){ |
123572
|
0 |
0 |
if( pRet ){ |
123574
|
0 |
0 |
for(i=0; i
|
123579
|
0 |
0 |
if( pTerm->flags & EP_Collate ){ |
123583
|
0 |
0 |
if( pColl==0 ) pColl = db->pDfltColl; |
123657
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_RECURSIVE, 0, 0, 0) ) return; |
123671
|
0 |
0 |
for(i=0; ALWAYS(inSrc); i++){ |
123672
|
0 |
0 |
if( pSrc->a[i].fg.isRecursive ){ |
123682
|
0 |
0 |
if( p->op==TK_UNION ){ |
123683
|
0 |
0 |
eDest = pOrderBy ? SRT_DistQueue : SRT_DistFifo; |
123686
|
0 |
0 |
eDest = pOrderBy ? SRT_Queue : SRT_Fifo; |
123693
|
0 |
0 |
if( pOrderBy ){ |
123702
|
0 |
0 |
if( iDistinct ){ |
123715
|
0 |
0 |
if( rc ) goto end_of_recursive_query; |
123722
|
0 |
0 |
if( pOrderBy ){ |
123734
|
0 |
0 |
if( regLimit ){ |
123743
|
0 |
0 |
if( p->selFlags & SF_Aggregate ){ |
123801
|
4 |
10 |
if( p->pPrior==0 ) break; |
123806
|
0 |
4 |
ExplainQueryPlan((pParse, 0, "SCAN %d CONSTANT ROW%s", nRow, |
123808
|
14 |
4 |
while( p ){ |
123810
|
0 |
14 |
if( !bShowAll ) break; |
123868
|
79 |
0 |
if( pPrior->pOrderBy || pPrior->pLimit ){ |
|
0 |
79 |
if( pPrior->pOrderBy || pPrior->pLimit ){ |
123869
|
0 |
0 |
sqlite3ErrorMsg(pParse,"%s clause should come after %s not before", |
123880
|
0 |
79 |
if( dest.eDest==SRT_EphemTab ){ |
123888
|
4 |
75 |
if( p->selFlags & SF_MultiValue ){ |
123900
|
0 |
75 |
if( p->selFlags & SF_Recursive ){ |
123907
|
0 |
75 |
if( p->pOrderBy ){ |
123912
|
22 |
53 |
if( pPrior->pPrior==0 ){ |
123930
|
0 |
71 |
if( rc ){ |
123936
|
0 |
71 |
if( p->iLimit ){ |
123939
|
0 |
0 |
if( p->iOffset ){ |
123950
|
0 |
71 |
if( pPrior->pLimit |
123951
|
0 |
0 |
&& sqlite3ExprIsInteger(pPrior->pLimit->pLeft, &nLimit) |
123952
|
0 |
0 |
&& nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit) |
|
0 |
0 |
&& nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit) |
123956
|
0 |
71 |
if( addr ){ |
123973
|
2 |
2 |
if( dest.eDest==priorOp ){ |
123997
|
0 |
4 |
if( rc ){ |
124003
|
0 |
4 |
if( p->op==TK_EXCEPT ){ |
124023
|
4 |
0 |
if( p->op==TK_UNION ){ |
124035
|
2 |
2 |
if( dest.eDest!=priorOp ){ |
124078
|
0 |
0 |
if( rc ){ |
124097
|
0 |
0 |
if( p->nSelectRow>pPrior->nSelectRow ){ |
124128
|
22 |
53 |
if( p->pNext==0 ){ |
124143
|
2 |
73 |
if( p->selFlags & SF_UsesEphemeral ){ |
124153
|
0 |
2 |
if( !pKeyInfo ){ |
124157
|
2 |
2 |
for(i=0, apColl=pKeyInfo->aColl; i
|
124159
|
2 |
0 |
if( 0==*apColl ){ |
124164
|
6 |
2 |
for(pLoop=p; pLoop; pLoop=pLoop->pPrior){ |
124165
|
8 |
0 |
for(i=0; i<2; i++){ |
124167
|
6 |
2 |
if( addr<0 ){ |
124195
|
0 |
0 |
if( p->selFlags & SF_Values ){ |
124242
|
0 |
0 |
if( regPrev ){ |
124252
|
0 |
0 |
if( pParse->db->mallocFailed ) return 0; |
124307
|
0 |
0 |
if( pDest->iSdst==0 ){ |
124334
|
0 |
0 |
if( p->iLimit ){ |
124494
|
0 |
0 |
if( op!=TK_ALL ){ |
124495
|
0 |
0 |
for(i=1; db->mallocFailed==0 && i<=p->pEList->nExpr; i++){ |
|
0 |
0 |
for(i=1; db->mallocFailed==0 && i<=p->pEList->nExpr; i++){ |
124497
|
0 |
0 |
for(j=0, pItem=pOrderBy->a; j
|
124499
|
0 |
0 |
if( pItem->u.x.iOrderByCol==i ) break; |
124501
|
0 |
0 |
if( j==nOrderBy ){ |
124503
|
0 |
0 |
if( pNew==0 ) return SQLITE_NOMEM_BKPT; |
124507
|
0 |
0 |
if( pOrderBy ) pOrderBy->a[nOrderBy++].u.x.iOrderByCol = (u16)i; |
124520
|
0 |
0 |
if( aPermute ){ |
124523
|
0 |
0 |
for(i=1, pItem=pOrderBy->a; i<=nOrderBy; i++, pItem++){ |
124542
|
0 |
0 |
if( op==TK_ALL ){ |
124551
|
0 |
0 |
if( pKeyDup ){ |
124553
|
0 |
0 |
for(i=0; i
|
124565
|
0 |
0 |
if( pPrior->pPrior==0 ){ |
124571
|
0 |
0 |
if( p->iLimit && op==TK_ALL ){ |
|
0 |
0 |
if( p->iLimit && op==TK_ALL ){ |
124574
|
0 |
0 |
sqlite3VdbeAddOp2(v, OP_Copy, p->iOffset ? p->iOffset+1 : p->iLimit, |
124631
|
0 |
0 |
if( op==TK_ALL || op==TK_UNION ){ |
|
0 |
0 |
if( op==TK_ALL || op==TK_UNION ){ |
124642
|
0 |
0 |
if( op==TK_EXCEPT || op==TK_INTERSECT ){ |
|
0 |
0 |
if( op==TK_EXCEPT || op==TK_INTERSECT ){ |
124656
|
0 |
0 |
if( op==TK_INTERSECT ){ |
124658
|
0 |
0 |
if( p->nSelectRow > pPrior->nSelectRow ) p->nSelectRow = pPrior->nSelectRow; |
124675
|
0 |
0 |
if( op==TK_ALL ){ |
124677
|
0 |
0 |
}else if( op==TK_INTERSECT ){ |
124691
|
0 |
0 |
if( op==TK_ALL || op==TK_UNION ){ |
|
0 |
0 |
if( op==TK_ALL || op==TK_UNION ){ |
124718
|
0 |
0 |
if( p->pPrior ){ |
124768
|
1120 |
734 |
if( pExpr==0 ) return 0; |
124769
|
0 |
734 |
if( ExprHasProperty(pExpr, EP_FromJoin) |
124770
|
0 |
0 |
&& pExpr->iRightJoinTable==pSubst->iTable |
124774
|
325 |
409 |
if( pExpr->op==TK_COLUMN && pExpr->iTable==pSubst->iTable ){ |
|
233 |
92 |
if( pExpr->op==TK_COLUMN && pExpr->iTable==pSubst->iTable ){ |
124775
|
0 |
233 |
if( pExpr->iColumn<0 ){ |
124783
|
0 |
233 |
if( sqlite3ExprIsVector(pCopy) ){ |
124787
|
0 |
233 |
if( pSubst->isLeftJoin && pCopy->op!=TK_COLUMN ){ |
|
0 |
0 |
if( pSubst->isLeftJoin && pCopy->op!=TK_COLUMN ){ |
124795
|
233 |
0 |
if( pNew && pSubst->isLeftJoin ){ |
|
0 |
233 |
if( pNew && pSubst->isLeftJoin ){ |
124798
|
233 |
0 |
if( pNew && ExprHasProperty(pExpr,EP_FromJoin) ){ |
|
0 |
233 |
if( pNew && ExprHasProperty(pExpr,EP_FromJoin) ){ |
124807
|
0 |
501 |
if( pExpr->op==TK_IF_NULL_ROW && pExpr->iTable==pSubst->iTable ){ |
|
0 |
0 |
if( pExpr->op==TK_IF_NULL_ROW && pExpr->iTable==pSubst->iTable ){ |
124812
|
0 |
501 |
if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
124825
|
504 |
219 |
if( pList==0 ) return; |
124826
|
603 |
219 |
for(i=0; inExpr; i++){ |
124838
|
35 |
26 |
if( !p ) return; |
124847
|
48 |
74 |
for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){ |
124849
|
0 |
48 |
if( pItem->fg.isTabFunc ){ |
124853
|
61 |
13 |
}while( doPrior && (p = p->pPrior)!=0 ); |
|
48 |
13 |
}while( doPrior && (p = p->pPrior)!=0 ); |
125031
|
0 |
35 |
if( OptimizationDisabled(db, SQLITE_QueryFlattener) ) return 0; |
125046
|
0 |
35 |
if( pSub->pLimit && p->pLimit ) return 0; /* Restriction (13) */ |
|
0 |
0 |
if( pSub->pLimit && p->pLimit ) return 0; /* Restriction (13) */ |
125047
|
0 |
35 |
if( pSub->pLimit && pSub->pLimit->pRight ) return 0; /* Restriction (14) */ |
|
0 |
0 |
if( pSub->pLimit && pSub->pLimit->pRight ) return 0; /* Restriction (14) */ |
125048
|
0 |
35 |
if( (p->selFlags & SF_Compound)!=0 && pSub->pLimit ){ |
|
0 |
0 |
if( (p->selFlags & SF_Compound)!=0 && pSub->pLimit ){ |
125051
|
22 |
13 |
if( pSubSrc->nSrc==0 ) return 0; /* Restriction (7) */ |
125052
|
0 |
13 |
if( pSub->selFlags & SF_Distinct ) return 0; /* Restriction (4) */ |
125053
|
0 |
13 |
if( pSub->pLimit && (pSrc->nSrc>1 || isAgg) ){ |
|
0 |
0 |
if( pSub->pLimit && (pSrc->nSrc>1 || isAgg) ){ |
|
0 |
0 |
if( pSub->pLimit && (pSrc->nSrc>1 || isAgg) ){ |
125056
|
13 |
0 |
if( p->pOrderBy && pSub->pOrderBy ){ |
|
0 |
13 |
if( p->pOrderBy && pSub->pOrderBy ){ |
125059
|
0 |
13 |
if( isAgg && pSub->pOrderBy ) return 0; /* Restriction (16) */ |
|
0 |
0 |
if( isAgg && pSub->pOrderBy ) return 0; /* Restriction (16) */ |
125060
|
0 |
13 |
if( pSub->pLimit && p->pWhere ) return 0; /* Restriction (19) */ |
|
0 |
0 |
if( pSub->pLimit && p->pWhere ) return 0; /* Restriction (19) */ |
125061
|
0 |
13 |
if( pSub->pLimit && (p->selFlags & SF_Distinct)!=0 ){ |
|
0 |
0 |
if( pSub->pLimit && (p->selFlags & SF_Distinct)!=0 ){ |
125064
|
0 |
13 |
if( pSub->selFlags & (SF_Recursive) ){ |
125088
|
0 |
13 |
if( (pSubitem->fg.jointype & JT_OUTER)!=0 ){ |
125090
|
0 |
0 |
if( pSubSrc->nSrc>1 || isAgg || IsVirtual(pSubSrc->a[0].pTab) ){ |
|
0 |
0 |
if( pSubSrc->nSrc>1 || isAgg || IsVirtual(pSubSrc->a[0].pTab) ){ |
|
0 |
0 |
if( pSubSrc->nSrc>1 || isAgg || IsVirtual(pSubSrc->a[0].pTab) ){ |
125110
|
0 |
13 |
if( pSub->pPrior ){ |
125111
|
0 |
0 |
if( pSub->pOrderBy ){ |
125114
|
0 |
0 |
if( isAgg || (p->selFlags & SF_Distinct)!=0 || pSrc->nSrc!=1 ){ |
|
0 |
0 |
if( isAgg || (p->selFlags & SF_Distinct)!=0 || pSrc->nSrc!=1 ){ |
|
0 |
0 |
if( isAgg || (p->selFlags & SF_Distinct)!=0 || pSrc->nSrc!=1 ){ |
125117
|
0 |
0 |
for(pSub1=pSub; pSub1; pSub1=pSub1->pPrior){ |
125122
|
0 |
0 |
if( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))!=0 /* (17b) */ |
125123
|
0 |
0 |
|| (pSub1->pPrior && pSub1->op!=TK_ALL) /* (17a) */ |
|
0 |
0 |
|| (pSub1->pPrior && pSub1->op!=TK_ALL) /* (17a) */ |
125124
|
0 |
0 |
|| pSub1->pSrc->nSrc<1 /* (17c) */ |
125132
|
0 |
0 |
if( p->pOrderBy ){ |
125134
|
0 |
0 |
for(ii=0; iipOrderBy->nExpr; ii++){ |
125135
|
0 |
0 |
if( p->pOrderBy->a[ii].u.x.iOrderByCol==0 ) return 0; |
125191
|
0 |
13 |
for(pSub=pSub->pPrior; pSub; pSub=pSub->pPrior){ |
125206
|
0 |
0 |
if( pNew==0 ){ |
125210
|
0 |
0 |
if( pPrior ) pPrior->pNext = pNew; |
125216
|
0 |
0 |
if( db->mallocFailed ) return 1; |
125242
|
13 |
0 |
if( ALWAYS(pSubitem->pTab!=0) ){ |
125244
|
13 |
0 |
if( pTabToDel->nTabRef==1 ){ |
125245
|
0 |
13 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
125267
|
13 |
13 |
for(pParent=p; pParent; pParent=pParent->pPrior, pSub=pSub->pPrior){ |
125274
|
13 |
0 |
if( pSrc ){ |
125280
|
0 |
0 |
if( pSrc==0 ){ |
125301
|
0 |
13 |
if( nSubSrc>1 ){ |
125303
|
0 |
0 |
if( db->mallocFailed ){ |
125311
|
13 |
13 |
for(i=0; i
|
125332
|
0 |
13 |
if( pSub->pOrderBy ){ |
125344
|
0 |
0 |
for(i=0; inExpr; i++){ |
125352
|
0 |
13 |
if( isLeftJoin>0 ){ |
125356
|
13 |
0 |
if( db->mallocFailed==0 ){ |
125377
|
0 |
13 |
if( pSub->pLimit ){ |
125460
|
3 |
22 |
if( pWhere==0 ) return 0; |
125461
|
0 |
22 |
if( pSubq->selFlags & SF_Recursive ) return 0; /* restriction (2) */ |
125476
|
0 |
22 |
if( pSubq->pLimit!=0 ){ |
125479
|
3 |
22 |
while( pWhere->op==TK_AND ){ |
125484
|
0 |
22 |
if( isLeftJoin |
125485
|
0 |
0 |
&& (ExprHasProperty(pWhere,EP_FromJoin)==0 |
125486
|
0 |
0 |
|| pWhere->iRightJoinTable!=iCursor) |
125490
|
0 |
22 |
if( ExprHasProperty(pWhere,EP_FromJoin) && pWhere->iRightJoinTable!=iCursor ){ |
|
0 |
0 |
if( ExprHasProperty(pWhere,EP_FromJoin) && pWhere->iRightJoinTable!=iCursor ){ |
125493
|
22 |
0 |
if( sqlite3ExprIsTableConstant(pWhere, iCursor) ){ |
125495
|
101 |
22 |
while( pSubq ){ |
125505
|
0 |
101 |
if( pSubq->selFlags & SF_Aggregate ){ |
125542
|
50 |
72 |
if( pEList==0 || pEList->nExpr!=1 ) return eRet; |
|
0 |
50 |
if( pEList==0 || pEList->nExpr!=1 ) return eRet; |
125544
|
0 |
50 |
if( sqlite3StrICmp(zFunc, "min")==0 ){ |
125547
|
16 |
34 |
}else if( sqlite3StrICmp(zFunc, "max")==0 ){ |
125555
|
16 |
0 |
if( pOrderBy ) pOrderBy->a[0].sortOrder = sortOrder; |
125576
|
99 |
23 |
if( p->pWhere || p->pEList->nExpr!=1 |
|
99 |
0 |
if( p->pWhere || p->pEList->nExpr!=1 |
125577
|
99 |
0 |
|| p->pSrc->nSrc!=1 || p->pSrc->a[0].pSelect |
|
0 |
99 |
|| p->pSrc->nSrc!=1 || p->pSrc->a[0].pSelect |
125585
|
0 |
99 |
if( IsVirtual(pTab) ) return 0; |
125586
|
0 |
99 |
if( pExpr->op!=TK_AGG_FUNCTION ) return 0; |
125587
|
0 |
99 |
if( NEVER(pAggInfo->nFunc==0) ) return 0; |
125588
|
90 |
9 |
if( (pAggInfo->aFunc[0].pFunc->funcFlags&SQLITE_FUNC_COUNT)==0 ) return 0; |
125589
|
0 |
9 |
if( pExpr->flags&EP_Distinct ) return 0; |
125602
|
4340 |
0 |
if( pFrom->pTab && pFrom->fg.isIndexedBy ){ |
|
0 |
4340 |
if( pFrom->pTab && pFrom->fg.isIndexedBy ){ |
125606
|
0 |
0 |
for(pIdx=pTab->pIndex; |
125607
|
0 |
0 |
pIdx && sqlite3StrICmp(pIdx->zName, zIndexedBy); |
125610
|
0 |
0 |
if( !pIdx ){ |
125650
|
4 |
4 |
if( p->pPrior==0 ) return WRC_Continue; |
125651
|
4 |
0 |
if( p->pOrderBy==0 ) return WRC_Continue; |
125652
|
0 |
0 |
for(pX=p; pX && (pX->op==TK_ALL || pX->op==TK_SELECT); pX=pX->pPrior){} |
|
0 |
0 |
for(pX=p; pX && (pX->op==TK_ALL || pX->op==TK_SELECT); pX=pX->pPrior){} |
|
0 |
0 |
for(pX=p; pX && (pX->op==TK_ALL || pX->op==TK_SELECT); pX=pX->pPrior){} |
125653
|
0 |
0 |
if( pX==0 ) return WRC_Continue; |
125655
|
0 |
0 |
for(i=p->pOrderBy->nExpr-1; i>=0; i--){ |
125656
|
0 |
0 |
if( a[i].pExpr->flags & EP_Collate ) break; |
125658
|
0 |
0 |
if( i<0 ) return WRC_Continue; |
125665
|
0 |
0 |
if( pNew==0 ) return WRC_Abort; |
125668
|
0 |
0 |
if( pNewSrc==0 ) return WRC_Abort; |
125695
|
0 |
1178 |
if( pFrom->fg.isTabFunc ){ |
125719
|
822 |
510 |
if( pItem->zDatabase==0 && (zName = pItem->zName)!=0 ){ |
|
787 |
35 |
if( pItem->zDatabase==0 && (zName = pItem->zName)!=0 ){ |
125721
|
0 |
787 |
for(p=pWith; p; p=p->pOuter){ |
125723
|
0 |
0 |
for(i=0; inCte; i++){ |
125724
|
0 |
0 |
if( sqlite3StrICmp(zName, p->a[i].zName)==0 ){ |
125746
|
0 |
1780 |
if( pWith ){ |
125750
|
0 |
0 |
if( bFree ) pParse->pWithToFree = pWith; |
125781
|
0 |
1332 |
if( pCte ){ |
125793
|
0 |
0 |
if( pCte->zCteErr ){ |
125797
|
0 |
0 |
if( cannotBeFunction(pParse, pFrom) ) return SQLITE_ERROR; |
125801
|
0 |
0 |
if( pTab==0 ) return WRC_Abort; |
125808
|
0 |
0 |
if( db->mallocFailed ) return SQLITE_NOMEM_BKPT; |
125813
|
0 |
0 |
bMayRecursive = ( pSel->op==TK_ALL || pSel->op==TK_UNION ); |
|
0 |
0 |
bMayRecursive = ( pSel->op==TK_ALL || pSel->op==TK_UNION ); |
125814
|
0 |
0 |
if( bMayRecursive ){ |
125817
|
0 |
0 |
for(i=0; inSrc; i++){ |
125819
|
0 |
0 |
if( pItem->zDatabase==0 |
125820
|
0 |
0 |
&& pItem->zName!=0 |
125821
|
0 |
0 |
&& 0==sqlite3StrICmp(pItem->zName, pCte->zName) |
125832
|
0 |
0 |
if( pTab->nTabRef>2 ){ |
125844
|
0 |
0 |
if( bMayRecursive ){ |
125855
|
0 |
0 |
for(pLeft=pSel; pLeft->pPrior; pLeft=pLeft->pPrior); |
125857
|
0 |
0 |
if( pCte->pCols ){ |
125858
|
0 |
0 |
if( pEList && pEList->nExpr!=pCte->pCols->nExpr ){ |
|
0 |
0 |
if( pEList && pEList->nExpr!=pCte->pCols->nExpr ){ |
125869
|
0 |
0 |
if( bMayRecursive ){ |
125870
|
0 |
0 |
if( pSel->selFlags & SF_Recursive ){ |
125896
|
0 |
1780 |
if( OK_IF_ALWAYS_TRUE(pParse->pWith) && p->pPrior==0 ){ |
|
0 |
0 |
if( OK_IF_ALWAYS_TRUE(pParse->pWith) && p->pPrior==0 ){ |
125898
|
0 |
0 |
if( pWith!=0 ){ |
125944
|
0 |
1815 |
if( db->mallocFailed ){ |
125948
|
35 |
1780 |
if( (selFlags & SF_Expanded)!=0 ){ |
125964
|
1332 |
1780 |
for(i=0, pFrom=pTabList->a; inSrc; i++, pFrom++){ |
125967
|
0 |
1332 |
if( pFrom->fg.isRecursive ) continue; |
125970
|
0 |
1332 |
if( withExpand(pWalker, pFrom) ) return WRC_Abort; |
125971
|
1332 |
0 |
if( pFrom->pTab ) {} else |
125973
|
35 |
1297 |
if( pFrom->zName==0 ){ |
125979
|
0 |
35 |
if( sqlite3WalkSelect(pWalker, pSel) ) return WRC_Abort; |
125981
|
0 |
35 |
if( pTab==0 ) return WRC_Abort; |
125983
|
2 |
33 |
if( pFrom->zAlias ){ |
125988
|
75 |
35 |
while( pSel->pPrior ){ pSel = pSel->pPrior; } |
125998
|
0 |
1297 |
if( pTab==0 ) return WRC_Abort; |
125999
|
0 |
1297 |
if( pTab->nTabRef>=0xffff ){ |
126006
|
1178 |
119 |
if( !IsVirtual(pTab) && cannotBeFunction(pParse, pFrom) ){ |
|
0 |
1178 |
if( !IsVirtual(pTab) && cannotBeFunction(pParse, pFrom) ){ |
126010
|
1178 |
119 |
if( IsVirtual(pTab) || pTab->pSelect ){ |
|
0 |
1178 |
if( IsVirtual(pTab) || pTab->pSelect ){ |
126012
|
0 |
119 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ) return WRC_Abort; |
126025
|
0 |
1332 |
if( sqlite3IndexedByLookup(pParse, pFrom) ){ |
126032
|
1780 |
0 |
if( db->mallocFailed || sqliteProcessJoin(pParse, p) ){ |
|
0 |
1780 |
if( db->mallocFailed || sqliteProcessJoin(pParse, p) ){ |
126047
|
3213 |
1678 |
for(k=0; knExpr; k++){ |
126049
|
99 |
3114 |
if( pE->op==TK_ASTERISK ) break; |
126052
|
28 |
3086 |
if( pE->op==TK_DOT && pE->pRight->op==TK_ASTERISK ) break; |
|
3 |
25 |
if( pE->op==TK_DOT && pE->pRight->op==TK_ASTERISK ) break; |
126055
|
102 |
1678 |
if( knExpr ){ |
126065
|
1 |
101 |
&& (flags & SQLITE_ShortColNames)==0; |
|
1 |
0 |
&& (flags & SQLITE_ShortColNames)==0; |
126067
|
109 |
102 |
for(k=0; knExpr; k++){ |
126072
|
10 |
99 |
if( pE->op!=TK_ASTERISK |
126073
|
6 |
4 |
&& (pE->op!=TK_DOT || pRight->op!=TK_ASTERISK) |
|
3 |
3 |
&& (pE->op!=TK_DOT || pRight->op!=TK_ASTERISK) |
126078
|
7 |
0 |
if( pNew ){ |
126090
|
3 |
99 |
if( pE->op==TK_DOT ){ |
126095
|
102 |
102 |
for(i=0, pFrom=pTabList->a; inSrc; i++, pFrom++){ |
126101
|
102 |
0 |
if( zTabName==0 ){ |
126104
|
0 |
102 |
if( db->mallocFailed ) break; |
126105
|
13 |
89 |
if( pSub==0 || (pSub->selFlags & SF_NestedFrom)==0 ){ |
|
13 |
0 |
if( pSub==0 || (pSub->selFlags & SF_NestedFrom)==0 ){ |
126107
|
3 |
99 |
if( zTName && sqlite3StrICmp(zTName, zTabName)!=0 ){ |
|
0 |
3 |
if( zTName && sqlite3StrICmp(zTName, zTabName)!=0 ){ |
126111
|
89 |
13 |
zSchemaName = iDb>=0 ? db->aDb[iDb].zDbSName : "*"; |
126113
|
319 |
102 |
for(j=0; jnCol; j++){ |
126120
|
9 |
310 |
if( zTName && pSub |
|
0 |
9 |
if( zTName && pSub |
126121
|
0 |
0 |
&& sqlite3MatchSpanName(pSub->pEList->a[j].zSpan, 0, zTName, 0)==0 |
126130
|
319 |
0 |
if( (p->selFlags & SF_IncludeHidden)==0 |
126131
|
6 |
313 |
&& IsHiddenColumn(&pTab->aCol[j]) |
126137
|
0 |
313 |
if( i>0 && zTName==0 ){ |
|
0 |
0 |
if( i>0 && zTName==0 ){ |
126138
|
0 |
0 |
if( (pFrom->fg.jointype & JT_NATURAL)!=0 |
126139
|
0 |
0 |
&& tableAndColumnIndex(pTabList, i, zName, 0, 0) |
126145
|
0 |
0 |
if( sqlite3IdListIndex(pFrom->pUsing, zName)>=0 ){ |
126154
|
310 |
3 |
if( longNames || pTabList->nSrc>1 ){ |
|
0 |
310 |
if( longNames || pTabList->nSrc>1 ){ |
126158
|
3 |
0 |
if( zSchemaName ){ |
126162
|
3 |
0 |
if( longNames ){ |
126172
|
313 |
0 |
if( pNew && (p->selFlags & SF_NestedFrom)!=0 ){ |
|
0 |
313 |
if( pNew && (p->selFlags & SF_NestedFrom)!=0 ){ |
126174
|
0 |
0 |
if( pSub ){ |
126187
|
0 |
102 |
if( !tableSeen ){ |
126188
|
0 |
0 |
if( zTName ){ |
126199
|
1780 |
0 |
if( p->pEList ){ |
126200
|
0 |
1780 |
if( p->pEList->nExpr>db->aLimit[SQLITE_LIMIT_COLUMN] ){ |
126204
|
567 |
1213 |
if( (elistFlags & (EP_HasFunc|EP_Subquery))!=0 ){ |
126261
|
2 |
1637 |
if( OK_IF_ALWAYS_TRUE(pParse->hasCompound) ){ |
126297
|
1332 |
1780 |
for(i=0, pFrom=pTabList->a; inSrc; i++, pFrom++){ |
126300
|
35 |
1297 |
if( (pTab->tabFlags & TF_Ephemeral)!=0 ){ |
126303
|
35 |
0 |
if( pSel ){ |
126304
|
75 |
35 |
while( pSel->pPrior ) pSel = pSel->pPrior; |
126350
|
0 |
1832 |
if( pParse->db->mallocFailed ) return; |
126351
|
193 |
1639 |
if( p->selFlags & SF_HasTypeInfo ) return; |
126353
|
1639 |
0 |
if( pParse->nErr || pParse->db->mallocFailed ) return; |
|
0 |
1639 |
if( pParse->nErr || pParse->db->mallocFailed ) return; |
126355
|
1639 |
0 |
if( pParse->nErr || pParse->db->mallocFailed ) return; |
|
0 |
1639 |
if( pParse->nErr || pParse->db->mallocFailed ) return; |
126372
|
0 |
126 |
if( nReg==0 ) return; |
126387
|
126 |
126 |
for(pFunc=pAggInfo->aFunc, i=0; inFunc; i++, pFunc++){ |
126388
|
0 |
126 |
if( pFunc->iDistinct>=0 ){ |
126391
|
0 |
0 |
if( pE->x.pList==0 || pE->x.pList->nExpr!=1 ){ |
|
0 |
0 |
if( pE->x.pList==0 || pE->x.pList->nExpr!=1 ){ |
126412
|
126 |
126 |
for(i=0, pF=pAggInfo->aFunc; inFunc; i++, pF++){ |
126415
|
52 |
74 |
sqlite3VdbeAddOp2(v, OP_AggFinal, pF->iMem, pList ? pList->nExpr : 0); |
126433
|
126 |
126 |
for(i=0, pF=pAggInfo->aFunc; inFunc; i++, pF++){ |
126439
|
52 |
74 |
if( pList ){ |
126447
|
0 |
126 |
if( pF->iDistinct>=0 ){ |
126453
|
16 |
110 |
if( pF->pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL ){ |
126458
|
24 |
8 |
for(j=0, pItem=pList->a; !pColl && j
|
|
16 |
8 |
for(j=0, pItem=pList->a; !pColl && j
|
126461
|
8 |
8 |
if( !pColl ){ |
126464
|
16 |
0 |
if( regHit==0 && pAggInfo->nAccumulator ) regHit = ++pParse->nMem; |
|
0 |
16 |
if( regHit==0 && pAggInfo->nAccumulator ) regHit = ++pParse->nMem; |
126472
|
0 |
126 |
if( addrNext ){ |
126488
|
0 |
126 |
if( regHit ){ |
126492
|
8 |
126 |
for(i=0, pC=pAggInfo->aCol; inAccumulator; i++, pC++){ |
126497
|
0 |
126 |
if( addrHitTest ){ |
126512
|
0 |
9 |
if( pParse->explain==2 ){ |
126513
|
0 |
0 |
int bCover = (pIdx!=0 && (HasRowid(pTab) || !IsPrimaryKeyIndex(pIdx))); |
|
0 |
0 |
int bCover = (pIdx!=0 && (HasRowid(pTab) || !IsPrimaryKeyIndex(pIdx))); |
|
0 |
0 |
int bCover = (pIdx!=0 && (HasRowid(pTab) || !IsPrimaryKeyIndex(pIdx))); |
126514
|
0 |
0 |
sqlite3VdbeExplain(pParse, 0, "SCAN TABLE %s%s%s", |
|
0 |
0 |
sqlite3VdbeExplain(pParse, 0, "SCAN TABLE %s%s%s", |
126537
|
5 |
0 |
if( pExpr->op!=TK_AND ){ |
126539
|
0 |
5 |
if( sqlite3ExprIsConstantOrGroupBy(pWalker->pParse, pExpr, pS->pGroupBy) ){ |
126542
|
0 |
0 |
if( pNew ){ |
126595
|
0 |
0 |
for(pItem = pTabList->a; pItem
|
126596
|
0 |
0 |
if( pItem->pSelect==0 ) continue; |
126597
|
0 |
0 |
if( pItem->fg.viaCoroutine ) continue; |
126598
|
0 |
0 |
if( pItem->zName==0 ) continue; |
126599
|
0 |
0 |
if( sqlite3_stricmp(pItem->zDatabase, pThis->zDatabase)!=0 ) continue; |
126600
|
0 |
0 |
if( sqlite3_stricmp(pItem->zName, pThis->zName)!=0 ) continue; |
126601
|
0 |
0 |
if( sqlite3ExprCompare(0, |
126733
|
1832 |
0 |
if( p==0 || db->mallocFailed || pParse->nErr ){ |
|
1832 |
0 |
if( p==0 || db->mallocFailed || pParse->nErr ){ |
|
0 |
1832 |
if( p==0 || db->mallocFailed || pParse->nErr ){ |
126736
|
0 |
1832 |
if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1; |
126749
|
8 |
1824 |
if( IgnorableOrderby(pDest) ){ |
126764
|
1832 |
0 |
if( pParse->nErr || db->mallocFailed ){ |
|
1832 |
0 |
if( pParse->nErr || db->mallocFailed ){ |
126776
|
1635 |
197 |
if( pDest->eDest==SRT_Output ){ |
126784
|
3085 |
79 |
for(i=0; !p->pPrior && inSrc; i++){ |
|
1332 |
1753 |
for(i=0; !p->pPrior && inSrc; i++){ |
126792
|
0 |
1332 |
if( (pItem->fg.jointype & JT_LEFT)!=0 |
126793
|
0 |
0 |
&& sqlite3ExprImpliesNonNullRow(p->pWhere, pItem->iCursor) |
126794
|
0 |
0 |
&& OptimizationEnabled(db, SQLITE_SimplifyJoin) |
126803
|
1297 |
35 |
if( pSub==0 ) continue; |
126807
|
0 |
35 |
if( pTab->nCol!=pSub->pEList->nExpr ){ |
126820
|
0 |
35 |
if( (pSub->selFlags & SF_Aggregate)!=0 ) continue; |
126841
|
0 |
35 |
if( pSub->pOrderBy!=0 |
126842
|
0 |
0 |
&& i==0 |
126843
|
0 |
0 |
&& (p->selFlags & SF_ComplexResult)!=0 |
126844
|
0 |
0 |
&& (pTabList->nSrc==1 |
126845
|
0 |
0 |
|| (pTabList->a[1].fg.jointype&(JT_LEFT|JT_CROSS))!=0) |
126850
|
13 |
22 |
if( flattenSubquery(pParse, p, i, isAgg) ){ |
126855
|
0 |
35 |
if( db->mallocFailed ) goto select_end; |
126856
|
35 |
0 |
if( !IgnorableOrderby(pDest) ){ |
126866
|
79 |
1753 |
if( p->pPrior ){ |
126874
|
26 |
53 |
if( p->pNext==0 ) ExplainQueryPlanPop(pParse); |
126883
|
1319 |
1753 |
for(i=0; inSrc; i++){ |
126907
|
81 |
1238 |
if( pItem->colUsed==0 ){ |
126915
|
1297 |
22 |
if( pSub==0 ) continue; |
126923
|
0 |
22 |
if( pItem->addrFillSub ){ |
126924
|
0 |
0 |
if( pItem->fg.viaCoroutine==0 ){ |
126946
|
22 |
0 |
if( OptimizationEnabled(db, SQLITE_PushDown) |
126972
|
22 |
0 |
if( i==0 |
126973
|
0 |
22 |
&& (pTabList->nSrc==1 |
126974
|
0 |
0 |
|| (pTabList->a[1].fg.jointype&(JT_LEFT|JT_CROSS))!=0) /* (1) */ |
127009
|
0 |
0 |
if( pItem->fg.isCorrelated==0 ){ |
127019
|
0 |
0 |
if( pPrior ){ |
127029
|
0 |
0 |
if( onceAddr ) sqlite3VdbeJumpHere(v, onceAddr); |
127035
|
0 |
22 |
if( db->mallocFailed ) goto select_end; |
127081
|
2 |
1751 |
if( (p->selFlags & (SF_Distinct|SF_Aggregate))==SF_Distinct |
127082
|
0 |
2 |
&& sqlite3ExprListCompare(sSort.pOrderBy, pEList, -1)==0 |
127107
|
552 |
1201 |
if( sSort.pOrderBy ){ |
127122
|
0 |
1753 |
if( pDest->eDest==SRT_EphemTab ){ |
127129
|
1753 |
0 |
if( (p->selFlags & SF_FixedLimit)==0 ){ |
127133
|
1733 |
20 |
if( p->iLimit==0 && sSort.addrSortIndex>=0 ){ |
|
551 |
1182 |
if( p->iLimit==0 && sSort.addrSortIndex>=0 ){ |
127140
|
2 |
1751 |
if( p->selFlags & SF_Distinct ){ |
127152
|
1618 |
135 |
if( !isAgg && pGroupBy==0 ){ |
|
1618 |
0 |
if( !isAgg && pGroupBy==0 ){ |
127154
|
2 |
1616 |
u16 wctrlFlags = (sDistinct.isTnct ? WHERE_WANT_DISTINCT : 0); |
127162
|
0 |
1618 |
if( pWInfo==0 ) goto select_end; |
127163
|
1617 |
1 |
if( sqlite3WhereOutputRowCount(pWInfo) < p->nSelectRow ){ |
127166
|
2 |
1616 |
if( sDistinct.isTnct && sqlite3WhereIsDistinct(pWInfo) ){ |
|
0 |
2 |
if( sDistinct.isTnct && sqlite3WhereIsDistinct(pWInfo) ){ |
127169
|
550 |
1068 |
if( sSort.pOrderBy ){ |
127172
|
448 |
102 |
if( sSort.nOBSat==sSort.pOrderBy->nExpr ){ |
127181
|
550 |
1068 |
if( sSort.addrSortIndex>=0 && sSort.pOrderBy==0 ){ |
|
448 |
102 |
if( sSort.addrSortIndex>=0 && sSort.pOrderBy==0 ){ |
127213
|
13 |
122 |
if( pGroupBy ){ |
127217
|
16 |
13 |
for(k=p->pEList->nExpr, pItem=p->pEList->a; k>0; k--, pItem++){ |
127220
|
13 |
13 |
for(k=pGroupBy->nExpr, pItem=pGroupBy->a; k>0; k--, pItem++){ |
127224
|
12 |
1 |
if( p->nSelectRow>66 ) p->nSelectRow = 66; |
127238
|
122 |
13 |
if( sqlite3ExprListCompare(pGroupBy, sSort.pOrderBy, -1)==0 ){ |
127255
|
13 |
122 |
sAggInfo.nSortingColumn = pGroupBy ? pGroupBy->nExpr : 0; |
127259
|
5 |
130 |
if( pHaving ){ |
127260
|
5 |
0 |
if( pGroupBy ){ |
127270
|
122 |
13 |
if( p->pGroupBy==0 && p->pHaving==0 && sAggInfo.nFunc==1 ){ |
|
122 |
0 |
if( p->pGroupBy==0 && p->pHaving==0 && sAggInfo.nFunc==1 ){ |
|
122 |
0 |
if( p->pGroupBy==0 && p->pHaving==0 && sAggInfo.nFunc==1 ){ |
127275
|
135 |
135 |
for(i=0; i
|
127282
|
0 |
135 |
if( db->mallocFailed ) goto select_end; |
127305
|
13 |
122 |
if( pGroupBy ){ |
127352
|
0 |
13 |
pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, pGroupBy, 0, |
127355
|
0 |
13 |
if( pWInfo==0 ) goto select_end; |
127356
|
0 |
13 |
if( sqlite3WhereIsOrdered(pWInfo)==pGroupBy->nExpr ){ |
127373
|
0 |
13 |
explainTempTable(pParse, |
127374
|
0 |
0 |
(sDistinct.isTnct && (p->selFlags&SF_Distinct)==0) ? |
127381
|
10 |
13 |
for(i=0; i
|
127382
|
3 |
7 |
if( sAggInfo.aCol[i].iSorterColumn>=j ){ |
127391
|
10 |
13 |
for(i=0; i
|
127393
|
3 |
7 |
if( pCol->iSorterColumn>=j ){ |
127423
|
0 |
13 |
if( orderByGrp && OptimizationEnabled(db, SQLITE_GroupByOrder) |
|
0 |
0 |
if( orderByGrp && OptimizationEnabled(db, SQLITE_GroupByOrder) |
127424
|
0 |
0 |
&& (groupBySort || sqlite3WhereIsSorted(pWInfo)) |
|
0 |
0 |
&& (groupBySort || sqlite3WhereIsSorted(pWInfo)) |
127437
|
13 |
0 |
if( groupBySort ){ |
127441
|
13 |
13 |
for(j=0; jnExpr; j++){ |
127442
|
13 |
0 |
if( groupBySort ){ |
127481
|
13 |
0 |
if( groupBySort ){ |
127533
|
9 |
113 |
if( (pTab = isSimpleCount(p, &sAggInfo))!=0 ){ |
127566
|
0 |
9 |
if( !HasRowid(pTab) ) pBest = sqlite3PrimaryKeyIndex(pTab); |
127567
|
0 |
9 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
127568
|
0 |
0 |
if( pIdx->bUnordered==0 |
127569
|
0 |
0 |
&& pIdx->szIdxRowszTabRow |
127570
|
0 |
0 |
&& pIdx->pPartIdxWhere==0 |
127571
|
0 |
0 |
&& (!pBest || pIdx->szIdxRowszIdxRow) |
|
0 |
0 |
&& (!pBest || pIdx->szIdxRowszIdxRow) |
127576
|
0 |
9 |
if( pBest ){ |
127583
|
0 |
9 |
if( pKeyInfo ){ |
127610
|
0 |
113 |
if( pWInfo==0 ){ |
127614
|
16 |
97 |
if( sqlite3WhereIsOrdered(pWInfo)>0 ){ |
127632
|
2 |
1751 |
if( sDistinct.eTnctType==WHERE_DISTINCT_UNORDERED ){ |
127639
|
104 |
1649 |
if( sSort.pOrderBy ){ |
127640
|
18 |
86 |
explainTempTable(pParse, |
127723
|
0 |
0 |
if( p->nRow==0 && argv!=0 ){ |
|
0 |
0 |
if( p->nRow==0 && argv!=0 ){ |
127728
|
0 |
0 |
if( p->nData + need > p->nAlloc ){ |
127732
|
0 |
0 |
if( azNew==0 ) goto malloc_failed; |
127739
|
0 |
0 |
if( p->nRow==0 ){ |
127741
|
0 |
0 |
for(i=0; i
|
127743
|
0 |
0 |
if( z==0 ) goto malloc_failed; |
127746
|
0 |
0 |
}else if( (int)p->nColumn!=nCol ){ |
127757
|
0 |
0 |
if( argv!=0 ){ |
127758
|
0 |
0 |
for(i=0; i
|
127759
|
0 |
0 |
if( argv[i]==0 ){ |
127764
|
0 |
0 |
if( z==0 ) goto malloc_failed; |
127803
|
0 |
0 |
if( pnColumn ) *pnColumn = 0; |
127804
|
0 |
0 |
if( pnRow ) *pnRow = 0; |
127805
|
0 |
0 |
if( pzErrMsg ) *pzErrMsg = 0; |
127813
|
0 |
0 |
if( res.azResult==0 ){ |
127821
|
0 |
0 |
if( (rc&0xff)==SQLITE_ABORT ){ |
127823
|
0 |
0 |
if( res.zErrMsg ){ |
127824
|
0 |
0 |
if( pzErrMsg ){ |
127834
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
127838
|
0 |
0 |
if( res.nAlloc>res.nData ){ |
127841
|
0 |
0 |
if( azNew==0 ){ |
127849
|
0 |
0 |
if( pnColumn ) *pnColumn = res.nColumn; |
127850
|
0 |
0 |
if( pnRow ) *pnRow = res.nRow; |
127860
|
0 |
0 |
if( azResult ){ |
127865
|
0 |
0 |
for(i=1; i
|
|
0 |
0 |
for(i=1; i
|
127893
|
0 |
0 |
while( pTriggerStep ){ |
127926
|
0 |
3012 |
if( pParse->disableTriggers ){ |
127930
|
671 |
2341 |
if( pTmpSchema!=pTab->pSchema ){ |
127933
|
0 |
671 |
for(p=sqliteHashFirst(&pTmpSchema->trigHash); p; p=sqliteHashNext(p)){ |
127935
|
0 |
0 |
if( pTrig->pTabSchema==pTab->pSchema |
127936
|
0 |
0 |
&& 0==sqlite3StrICmp(pTrig->table, pTab->zName) |
127938
|
0 |
0 |
pTrig->pNext = (pList ? pList : pTab->pTrigger); |
127944
|
3012 |
0 |
return (pList ? pList : pTab->pTrigger); |
127979
|
0 |
0 |
if( isTemp ){ |
127981
|
0 |
0 |
if( pName2->n>0 ){ |
127990
|
0 |
0 |
if( iDb<0 ){ |
127994
|
0 |
0 |
if( !pTableName || db->mallocFailed ){ |
|
0 |
0 |
if( !pTableName || db->mallocFailed ){ |
128006
|
0 |
0 |
if( db->init.busy && iDb!=1 ){ |
|
0 |
0 |
if( db->init.busy && iDb!=1 ){ |
128017
|
0 |
0 |
if( db->init.busy==0 && pName2->n==0 && pTab |
|
0 |
0 |
if( db->init.busy==0 && pName2->n==0 && pTab |
|
0 |
0 |
if( db->init.busy==0 && pName2->n==0 && pTab |
128018
|
0 |
0 |
&& pTab->pSchema==db->aDb[1].pSchema ){ |
128023
|
0 |
0 |
if( db->mallocFailed ) goto trigger_cleanup; |
128026
|
0 |
0 |
if( sqlite3FixSrcList(&sFix, pTableName) ){ |
128030
|
0 |
0 |
if( !pTab ){ |
128032
|
0 |
0 |
if( db->init.iDb==1 ){ |
128045
|
0 |
0 |
if( IsVirtual(pTab) ){ |
128053
|
0 |
0 |
if( !zName || SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ |
|
0 |
0 |
if( !zName || SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ |
128057
|
0 |
0 |
if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash),zName) ){ |
128058
|
0 |
0 |
if( !noErr ){ |
128068
|
0 |
0 |
if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 ){ |
128076
|
0 |
0 |
if( pTab->pSelect && tr_tm!=TK_INSTEAD ){ |
|
0 |
0 |
if( pTab->pSelect && tr_tm!=TK_INSTEAD ){ |
128077
|
0 |
0 |
sqlite3ErrorMsg(pParse, "cannot create %s trigger on view: %S", |
128081
|
0 |
0 |
if( !pTab->pSelect && tr_tm==TK_INSTEAD ){ |
|
0 |
0 |
if( !pTab->pSelect && tr_tm==TK_INSTEAD ){ |
128092
|
0 |
0 |
const char *zDbTrig = isTemp ? db->aDb[1].zDbSName : zDb; |
128093
|
0 |
0 |
if( iTabDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER; |
|
0 |
0 |
if( iTabDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER; |
128094
|
0 |
0 |
if( sqlite3AuthCheck(pParse, code, zName, pTab->zName, zDbTrig) ){ |
128097
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iTabDb),0,zDb)){ |
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iTabDb),0,zDb)){ |
128108
|
0 |
0 |
if (tr_tm == TK_INSTEAD){ |
128114
|
0 |
0 |
if( pTrigger==0 ) goto trigger_cleanup; |
128121
|
0 |
0 |
pTrigger->tr_tm = tr_tm==TK_BEFORE ? TRIGGER_BEFORE : TRIGGER_AFTER; |
128132
|
0 |
0 |
if( !pParse->pNewTrigger ){ |
128156
|
0 |
0 |
if( NEVER(pParse->nErr) || !pTrig ) goto triggerfinish_cleanup; |
|
0 |
0 |
if( NEVER(pParse->nErr) || !pTrig ) goto triggerfinish_cleanup; |
128160
|
0 |
0 |
while( pStepList ){ |
128166
|
0 |
0 |
if( sqlite3FixTriggerStep(&sFix, pTrig->step_list) |
128167
|
0 |
0 |
|| sqlite3FixExpr(&sFix, pTrig->pWhen) |
128175
|
0 |
0 |
if( !db->init.busy ){ |
128181
|
0 |
0 |
if( v==0 ) goto triggerfinish_cleanup; |
128195
|
0 |
0 |
if( db->init.busy ){ |
128200
|
0 |
0 |
if( pTrig ){ |
128202
|
0 |
0 |
}else if( pLink->pSchema==pLink->pTabSchema ){ |
128224
|
0 |
0 |
if( z ) for(i=0; z[i]; i++) if( sqlite3Isspace(z[i]) ) z[i] = ' '; |
|
0 |
0 |
if( z ) for(i=0; z[i]; i++) if( sqlite3Isspace(z[i]) ) z[i] = ' '; |
|
0 |
0 |
if( z ) for(i=0; z[i]; i++) if( sqlite3Isspace(z[i]) ) z[i] = ' '; |
128242
|
0 |
0 |
if( pTriggerStep==0 ) { |
128269
|
0 |
0 |
if( pTriggerStep ){ |
128302
|
0 |
0 |
if( pTriggerStep ){ |
128335
|
0 |
0 |
if( pTriggerStep ){ |
128360
|
0 |
0 |
if( pTriggerStep ){ |
128372
|
6083 |
0 |
if( pTrigger==0 ) return; |
128396
|
0 |
0 |
if( db->mallocFailed ) goto drop_trigger_cleanup; |
128397
|
0 |
0 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ |
128405
|
0 |
0 |
for(i=OMIT_TEMPDB; inDb; i++){ |
128406
|
0 |
0 |
int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ |
128407
|
0 |
0 |
if( zDb && sqlite3StrICmp(db->aDb[j].zDbSName, zDb) ) continue; |
|
0 |
0 |
if( zDb && sqlite3StrICmp(db->aDb[j].zDbSName, zDb) ) continue; |
128410
|
0 |
0 |
if( pTrigger ) break; |
128412
|
0 |
0 |
if( !pTrigger ){ |
128413
|
0 |
0 |
if( !noErr ){ |
128454
|
0 |
0 |
const char *zTab = SCHEMA_TABLE(iDb); |
128455
|
0 |
0 |
if( iDb==1 ) code = SQLITE_DROP_TEMP_TRIGGER; |
128466
|
0 |
0 |
if( (v = sqlite3GetVdbe(pParse))!=0 ){ |
128486
|
0 |
0 |
if( ALWAYS(pTrigger) ){ |
128487
|
0 |
0 |
if( pTrigger->pSchema==pTrigger->pTabSchema ){ |
128490
|
0 |
0 |
for(pp=&pTab->pTrigger; *pp!=pTrigger; pp=&((*pp)->pNext)); |
128509
|
0 |
0 |
if( pIdList==0 || NEVER(pEList==0) ) return 1; |
|
0 |
0 |
if( pIdList==0 || NEVER(pEList==0) ) return 1; |
128510
|
0 |
0 |
for(e=0; enExpr; e++){ |
128511
|
0 |
0 |
if( sqlite3IdListIndex(pIdList, pEList->a[e].zName)>=0 ) return 1; |
128533
|
3003 |
0 |
if( (pParse->db->flags & SQLITE_EnableTrigger)!=0 ){ |
128537
|
0 |
3003 |
for(p=pList; p; p=p->pNext){ |
128538
|
0 |
0 |
if( p->op==op && checkColumnOverlap(p->pColumns, pChanges) ){ |
|
0 |
0 |
if( p->op==op && checkColumnOverlap(p->pColumns, pChanges) ){ |
128542
|
2936 |
67 |
if( pMask ){ |
128545
|
0 |
3003 |
return (mask ? pList : 0); |
128567
|
0 |
0 |
if( pSrc ){ |
128571
|
0 |
0 |
if( iDb==0 || iDb>=2 ){ |
|
0 |
0 |
if( iDb==0 || iDb>=2 ){ |
128597
|
0 |
0 |
for(pStep=pStepList; pStep; pStep=pStep->pNext){ |
128611
|
0 |
0 |
pParse->eOrconf = (orconf==OE_Default)?pStep->orconf:(u8)orconf; |
128615
|
0 |
0 |
if( pStep->zSpan ){ |
128658
|
0 |
0 |
if( pStep->op!=TK_SELECT ){ |
128692
|
0 |
0 |
if( pTo->nErr==0 ){ |
128711
|
0 |
0 |
Parse *pTop = sqlite3ParseToplevel(pParse); |
128728
|
0 |
0 |
if( !pPrg ) return 0; |
128732
|
0 |
0 |
if( !pProgram ) return 0; |
128742
|
0 |
0 |
if( !pSubParse ) return 0; |
128753
|
0 |
0 |
if( v ){ |
128763
|
0 |
0 |
if( pTrigger->zName ){ |
128773
|
0 |
0 |
if( pTrigger->pWhen ){ |
128775
|
0 |
0 |
if( SQLITE_OK==sqlite3ResolveExprNames(&sNC, pWhen) |
128776
|
0 |
0 |
&& db->mallocFailed==0 |
128788
|
0 |
0 |
if( iEndTrigger ){ |
128795
|
0 |
0 |
if( db->mallocFailed==0 && pParse->nErr==0 ){ |
|
0 |
0 |
if( db->mallocFailed==0 && pParse->nErr==0 ){ |
128826
|
0 |
0 |
Parse *pRoot = sqlite3ParseToplevel(pParse); |
128835
|
0 |
0 |
for(pPrg=pRoot->pTriggerPrg; |
128836
|
0 |
0 |
pPrg && (pPrg->pTrigger!=pTrigger || pPrg->orconf!=orconf); |
|
0 |
0 |
pPrg && (pPrg->pTrigger!=pTrigger || pPrg->orconf!=orconf); |
128841
|
0 |
0 |
if( !pPrg ){ |
128869
|
0 |
0 |
if( pPrg ){ |
128870
|
0 |
0 |
int bRecursive = (p->zName && 0==(pParse->db->flags&SQLITE_RecTriggers)); |
|
0 |
0 |
int bRecursive = (p->zName && 0==(pParse->db->flags&SQLITE_RecTriggers)); |
128943
|
0 |
313 |
for(p=pTrigger; p; p=p->pNext){ |
128954
|
0 |
0 |
if( p->op==op |
128955
|
0 |
0 |
&& p->tr_tm==tr_tm |
128956
|
0 |
0 |
&& checkColumnOverlap(p->pColumns, pChanges) |
128997
|
275 |
0 |
const int op = pChanges ? TK_UPDATE : TK_DELETE; |
129002
|
0 |
275 |
for(p=pTrigger; p; p=p->pNext){ |
129003
|
0 |
0 |
if( p->op==op && (tr_tm&p->tr_tm) |
|
0 |
0 |
if( p->op==op && (tr_tm&p->tr_tm) |
129004
|
0 |
0 |
&& checkColumnOverlap(p->pColumns,pChanges) |
129008
|
0 |
0 |
if( pPrg ){ |
129083
|
3245 |
0 |
if( !pTab->pSelect ){ |
129091
|
0 |
3245 |
if( pValue ){ |
129096
|
0 |
3245 |
if( pTab->aCol[i].affinity==SQLITE_AFF_REAL ){ |
129174
|
273 |
0 |
if( pParse->nErr || db->mallocFailed ){ |
|
273 |
0 |
if( pParse->nErr || db->mallocFailed ){ |
129182
|
0 |
273 |
if( pTab==0 ) goto update_cleanup; |
129212
|
0 |
273 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ){ |
129215
|
0 |
273 |
if( sqlite3IsReadOnly(pParse, pTab, tmask) ){ |
129226
|
0 |
273 |
pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab); |
129228
|
0 |
273 |
for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){ |
129229
|
0 |
0 |
if( pPk==pIdx ){ |
129234
|
0 |
273 |
if( pUpsert ){ |
129246
|
0 |
273 |
if( aXRef==0 ) goto update_cleanup; |
129251
|
1352 |
273 |
for(i=0; inCol; i++) aXRef[i] = -1; |
129267
|
1325 |
273 |
for(i=0; inExpr; i++){ |
129268
|
0 |
1325 |
if( sqlite3ResolveExprNames(&sNC, pChanges->a[i].pExpr) ){ |
129271
|
3975 |
0 |
for(j=0; jnCol; j++){ |
129272
|
1325 |
2650 |
if( sqlite3StrICmp(pTab->aCol[j].zName, pChanges->a[i].zName)==0 ){ |
129273
|
0 |
1325 |
if( j==pTab->iPKey ){ |
129276
|
0 |
1325 |
}else if( pPk && (pTab->aCol[j].colFlags & COLFLAG_PRIMKEY)!=0 ){ |
|
0 |
0 |
}else if( pPk && (pTab->aCol[j].colFlags & COLFLAG_PRIMKEY)!=0 ){ |
129283
|
0 |
1325 |
if( j>=pTab->nCol ){ |
129284
|
0 |
0 |
if( pPk==0 && sqlite3IsRowid(pChanges->a[i].zName) ){ |
|
0 |
0 |
if( pPk==0 && sqlite3IsRowid(pChanges->a[i].zName) ){ |
129297
|
1325 |
0 |
rc = sqlite3AuthCheck(pParse, SQLITE_UPDATE, pTab->zName, |
129300
|
0 |
1325 |
if( rc==SQLITE_DENY ){ |
129302
|
0 |
1325 |
}else if( rc==SQLITE_IGNORE ){ |
129318
|
0 |
273 |
pTabList->a[0].colUsed = IsVirtual(pTab) ? ALLBITS : 0; |
129328
|
0 |
273 |
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ |
129330
|
0 |
0 |
if( chngKey || hasFK>1 || pIdx->pPartIdxWhere || pIdx==pPk ){ |
|
0 |
0 |
if( chngKey || hasFK>1 || pIdx->pPartIdxWhere || pIdx==pPk ){ |
|
0 |
0 |
if( chngKey || hasFK>1 || pIdx->pPartIdxWhere || pIdx==pPk ){ |
|
0 |
0 |
if( chngKey || hasFK>1 || pIdx->pPartIdxWhere || pIdx==pPk ){ |
129335
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
129337
|
0 |
0 |
if( iIdxCol<0 || aXRef[iIdxCol]>=0 ){ |
|
0 |
0 |
if( iIdxCol<0 || aXRef[iIdxCol]>=0 ){ |
129340
|
0 |
0 |
if( (onError==OE_Replace) |
129341
|
0 |
0 |
|| (onError==OE_Default && pIdx->onError==OE_Replace) |
|
0 |
0 |
|| (onError==OE_Default && pIdx->onError==OE_Replace) |
129349
|
0 |
0 |
if( reg==0 ) aToOpen[j+1] = 0; |
129352
|
0 |
273 |
if( bReplace ){ |
129360
|
0 |
273 |
if( v==0 ) goto update_cleanup; |
129361
|
5 |
268 |
if( pParse->nested==0 ) sqlite3VdbeCountChanges(v); |
129362
|
273 |
0 |
sqlite3BeginWriteOperation(pParse, pTrigger || hasFK, iDb); |
|
2 |
271 |
sqlite3BeginWriteOperation(pParse, pTrigger || hasFK, iDb); |
129365
|
273 |
0 |
if( !IsVirtual(pTab) ){ |
129368
|
273 |
0 |
if( chngPk || pTrigger || hasFK ){ |
|
273 |
0 |
if( chngPk || pTrigger || hasFK ){ |
|
2 |
271 |
if( chngPk || pTrigger || hasFK ){ |
129372
|
273 |
0 |
if( chngKey || pTrigger || hasFK ){ |
|
273 |
0 |
if( chngKey || pTrigger || hasFK ){ |
|
2 |
271 |
if( chngKey || pTrigger || hasFK ){ |
129380
|
0 |
273 |
if( isView ){ |
129388
|
0 |
273 |
if( isView ){ |
129400
|
0 |
273 |
if( sqlite3ResolveExprNames(&sNC, pWhere) ){ |
129406
|
0 |
273 |
if( IsVirtual(pTab) ){ |
129418
|
0 |
273 |
if( (db->flags&SQLITE_CountRows)!=0 |
129419
|
0 |
0 |
&& !pParse->pTriggerTab |
129420
|
0 |
0 |
&& !pParse->nested |
129421
|
0 |
0 |
&& pUpsert==0 |
129427
|
273 |
0 |
if( HasRowid(pTab) ){ |
129435
|
0 |
0 |
if( pUpsert==0 ){ |
129443
|
0 |
273 |
if( pUpsert ){ |
129461
|
5 |
268 |
if( !pParse->nested && !pTrigger && !hasFK && !chngKey && !bReplace ){ |
|
5 |
0 |
if( !pParse->nested && !pTrigger && !hasFK && !chngKey && !bReplace ){ |
|
3 |
2 |
if( !pParse->nested && !pTrigger && !hasFK && !chngKey && !bReplace ){ |
|
3 |
0 |
if( !pParse->nested && !pTrigger && !hasFK && !chngKey && !bReplace ){ |
|
3 |
0 |
if( !pParse->nested && !pTrigger && !hasFK && !chngKey && !bReplace ){ |
129465
|
0 |
273 |
if( pWInfo==0 ) goto update_cleanup; |
129478
|
10 |
263 |
if( eOnePass!=ONEPASS_SINGLE ){ |
129480
|
3 |
7 |
if( eOnePass==ONEPASS_MULTI ){ |
129482
|
0 |
3 |
if( iCur>=0 && iCur!=iDataCur && aToOpen[iCur-iBaseCur] ){ |
|
0 |
0 |
if( iCur>=0 && iCur!=iDataCur && aToOpen[iCur-iBaseCur] ){ |
|
0 |
0 |
if( iCur>=0 && iCur!=iDataCur && aToOpen[iCur-iBaseCur] ){ |
129490
|
273 |
0 |
if( HasRowid(pTab) ){ |
129495
|
7 |
266 |
if( eOnePass==ONEPASS_OFF ){ |
129504
|
0 |
0 |
for(i=0; i
|
129508
|
0 |
0 |
if( eOnePass ){ |
129509
|
0 |
0 |
if( addrOpen ) sqlite3VdbeChangeToNoop(v, addrOpen); |
129519
|
273 |
0 |
if( pUpsert==0 ){ |
129520
|
270 |
3 |
if( eOnePass!=ONEPASS_MULTI ){ |
129524
|
273 |
0 |
if( !isView ){ |
129528
|
266 |
7 |
if( eOnePass!=ONEPASS_OFF ){ |
129529
|
266 |
0 |
if( aiCurOnePass[0]>=0 ) aToOpen[aiCurOnePass[0]-iBaseCur] = 0; |
129530
|
0 |
266 |
if( aiCurOnePass[1]>=0 ) aToOpen[aiCurOnePass[1]-iBaseCur] = 0; |
129533
|
3 |
270 |
if( eOnePass==ONEPASS_MULTI && (nIdx-(aiCurOnePass[1]>=0))>0 ){ |
|
0 |
3 |
if( eOnePass==ONEPASS_MULTI && (nIdx-(aiCurOnePass[1]>=0))>0 ){ |
129538
|
0 |
273 |
if( addrOnce ) sqlite3VdbeJumpHere(v, addrOnce); |
129542
|
266 |
7 |
if( eOnePass!=ONEPASS_OFF ){ |
129543
|
266 |
0 |
if( !isView && aiCurOnePass[0]!=iDataCur && aiCurOnePass[1]!=iDataCur ){ |
|
0 |
266 |
if( !isView && aiCurOnePass[0]!=iDataCur && aiCurOnePass[1]!=iDataCur ){ |
|
0 |
0 |
if( !isView && aiCurOnePass[0]!=iDataCur && aiCurOnePass[1]!=iDataCur ){ |
129548
|
3 |
263 |
if( eOnePass!=ONEPASS_SINGLE ){ |
129551
|
0 |
266 |
sqlite3VdbeAddOp2(v, OP_IsNull, pPk ? regKey : regOldRowid, labelBreak); |
129554
|
0 |
7 |
}else if( pPk ){ |
129574
|
0 |
273 |
if( chngRowid ){ |
129581
|
273 |
0 |
if( chngPk || hasFK || pTrigger ){ |
|
271 |
2 |
if( chngPk || hasFK || pTrigger ){ |
|
0 |
271 |
if( chngPk || hasFK || pTrigger ){ |
129582
|
2 |
0 |
u32 oldmask = (hasFK ? sqlite3FkOldmask(pParse, pTab) : 0); |
129586
|
6 |
2 |
for(i=0; inCol; i++){ |
129587
|
6 |
0 |
if( oldmask==0xffffffff |
129588
|
6 |
0 |
|| (i<32 && (oldmask & MASKBIT32(i))!=0) |
|
4 |
2 |
|| (i<32 && (oldmask & MASKBIT32(i))!=0) |
129589
|
2 |
2 |
|| (pTab->aCol[i].colFlags & COLFLAG_PRIMKEY)!=0 |
129597
|
2 |
0 |
if( chngRowid==0 && pPk==0 ){ |
|
2 |
0 |
if( chngRowid==0 && pPk==0 ){ |
129618
|
1352 |
273 |
for(i=0; inCol; i++){ |
129619
|
2 |
1350 |
if( i==pTab->iPKey ){ |
129623
|
1325 |
25 |
if( j>=0 ){ |
129625
|
0 |
25 |
}else if( 0==(tmask&TRIGGER_BEFORE) || i>31 || (newmask & MASKBIT32(i)) ){ |
|
0 |
0 |
}else if( 0==(tmask&TRIGGER_BEFORE) || i>31 || (newmask & MASKBIT32(i)) ){ |
|
0 |
0 |
}else if( 0==(tmask&TRIGGER_BEFORE) || i>31 || (newmask & MASKBIT32(i)) ){ |
129634
|
0 |
25 |
if( tmask & TRIGGER_BEFORE ){ |
129649
|
0 |
273 |
if( tmask&TRIGGER_BEFORE ){ |
129660
|
0 |
0 |
if( pPk ){ |
129677
|
0 |
0 |
for(i=0; inCol; i++){ |
129678
|
0 |
0 |
if( aXRef[i]<0 && i!=pTab->iPKey ){ |
|
0 |
0 |
if( aXRef[i]<0 && i!=pTab->iPKey ){ |
129684
|
273 |
0 |
if( !isView ){ |
129694
|
2 |
271 |
if( hasFK ){ |
129699
|
273 |
0 |
if( bReplace || chngKey ){ |
|
0 |
273 |
if( bReplace || chngKey ){ |
129700
|
0 |
0 |
if( pPk ){ |
129732
|
273 |
0 |
if( hasFK>1 || chngKey ){ |
|
0 |
273 |
if( hasFK>1 || chngKey ){ |
129736
|
273 |
0 |
if( bReplace || chngKey ){ |
|
0 |
273 |
if( bReplace || chngKey ){ |
129740
|
2 |
271 |
if( hasFK ){ |
129745
|
3 |
270 |
sqlite3CompleteInsertion( |
129754
|
2 |
271 |
if( hasFK ){ |
129761
|
0 |
273 |
if( regRowCount ){ |
129771
|
10 |
263 |
if( eOnePass==ONEPASS_SINGLE ){ |
129773
|
3 |
7 |
}else if( eOnePass==ONEPASS_MULTI ){ |
129776
|
0 |
7 |
}else if( pPk ){ |
129788
|
5 |
268 |
if( pParse->nested==0 && pParse->pTriggerTab==0 && pUpsert==0 ){ |
|
5 |
0 |
if( pParse->nested==0 && pParse->pTriggerTab==0 && pUpsert==0 ){ |
|
5 |
0 |
if( pParse->nested==0 && pParse->pTriggerTab==0 && pUpsert==0 ){ |
129796
|
0 |
273 |
if( regRowCount ){ |
129884
|
0 |
0 |
if( pWInfo==0 ) return; |
129887
|
0 |
0 |
for(i=0; inCol; i++){ |
129888
|
0 |
0 |
if( aXRef[i]>=0 ){ |
129895
|
0 |
0 |
if( HasRowid(pTab) ){ |
129897
|
0 |
0 |
if( pRowid ){ |
129918
|
0 |
0 |
if( eOnePass ){ |
129938
|
0 |
0 |
if( eOnePass==ONEPASS_OFF ){ |
129947
|
0 |
0 |
for(i=0; i
|
129953
|
0 |
0 |
sqlite3VdbeChangeP5(v, onError==OE_Default ? OE_Abort : onError); |
129958
|
0 |
0 |
if( eOnePass==ONEPASS_OFF ){ |
129991
|
0 |
2663 |
if( p ){ |
130004
|
0 |
0 |
if( p==0 ) return 0; |
130025
|
0 |
0 |
if( pNew==0 ){ |
130075
|
0 |
0 |
if( rc ) return rc; |
130077
|
0 |
0 |
if( rc ) return rc; |
130083
|
0 |
0 |
if( HasRowid(pTab) |
130084
|
0 |
0 |
&& pTarget->nExpr==1 |
130085
|
0 |
0 |
&& (pTerm = pTarget->a[0].pExpr)->op==TK_COLUMN |
130086
|
0 |
0 |
&& pTerm->iColumn==XN_ROWID |
130106
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
130108
|
0 |
0 |
if( !IsUniqueIndex(pIdx) ) continue; |
130109
|
0 |
0 |
if( pTarget->nExpr!=pIdx->nKeyCol ) continue; |
130110
|
0 |
0 |
if( pIdx->pPartIdxWhere ){ |
130111
|
0 |
0 |
if( pUpsert->pUpsertTargetWhere==0 ) continue; |
130112
|
0 |
0 |
if( sqlite3ExprCompare(pParse, pUpsert->pUpsertTargetWhere, |
130118
|
0 |
0 |
for(ii=0; ii
|
130121
|
0 |
0 |
if( pIdx->aiColumn[ii]==XN_EXPR ){ |
130125
|
0 |
0 |
if( pExpr->op!=TK_COLLATE ){ |
130134
|
0 |
0 |
for(jj=0; jj
|
130135
|
0 |
0 |
if( sqlite3ExprCompare(pParse, pTarget->a[jj].pExpr, pExpr,iCursor)<2 ){ |
130139
|
0 |
0 |
if( jj>=nn ){ |
130144
|
0 |
0 |
if( ii
|
130180
|
0 |
0 |
if( pIdx && iCur!=iDataCur ){ |
|
0 |
0 |
if( pIdx && iCur!=iDataCur ){ |
130181
|
0 |
0 |
if( HasRowid(pTab) ){ |
130193
|
0 |
0 |
for(i=0; i
|
130260
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
130261
|
0 |
0 |
while( SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){ |
130269
|
0 |
0 |
if( zSubSql |
130270
|
0 |
0 |
&& (strncmp(zSubSql,"CRE",3)==0 || strncmp(zSubSql,"INS",3)==0) |
|
0 |
0 |
&& (strncmp(zSubSql,"CRE",3)==0 || strncmp(zSubSql,"INS",3)==0) |
130273
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
130277
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
130278
|
0 |
0 |
if( rc ){ |
130291
|
0 |
0 |
if( z==0 ) return SQLITE_NOMEM; |
130330
|
0 |
0 |
if( v==0 ) return; |
130331
|
0 |
0 |
if( pNm ){ |
130336
|
0 |
0 |
if( iDb<0 ) return; |
130347
|
0 |
0 |
if( iDb!=1 ){ |
130372
|
0 |
0 |
if( !db->autoCommit ){ |
130376
|
0 |
0 |
if( db->nVdbeActive>1 ){ |
130414
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
130430
|
0 |
0 |
if( db->nextPagesize ){ |
130435
|
0 |
0 |
if( nKey ) db->nextPagesize = 0; |
130448
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
130450
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
130453
|
0 |
0 |
if( sqlite3PagerGetJournalMode(sqlite3BtreePager(pMain)) |
130458
|
0 |
0 |
if( sqlite3BtreeSetPageSize(pTemp, sqlite3BtreeGetPageSize(pMain), nRes, 0) |
130459
|
0 |
0 |
|| (!isMemDb && sqlite3BtreeSetPageSize(pTemp, db->nextPagesize, nRes, 0)) |
|
0 |
0 |
|| (!isMemDb && sqlite3BtreeSetPageSize(pTemp, db->nextPagesize, nRes, 0)) |
130460
|
0 |
0 |
|| NEVER(db->mallocFailed) |
130467
|
0 |
0 |
sqlite3BtreeSetAutoVacuum(pTemp, db->nextAutovac>=0 ? db->nextAutovac : |
130481
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
130487
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
130503
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
130517
|
0 |
0 |
if( rc ) goto end_of_vacuum; |
130547
|
0 |
0 |
for(i=0; i
|
130552
|
0 |
0 |
if( NEVER(rc!=SQLITE_OK) ) goto end_of_vacuum; |
130556
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
130558
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
130586
|
0 |
0 |
if( pDb ){ |
130648
|
0 |
2631 |
if( pMod==0 ){ |
130661
|
0 |
2631 |
if( pDel ){ |
130685
|
0 |
2631 |
if( sqlite3HashFind(&db->aModule, zName) ){ |
130691
|
0 |
2631 |
if( rc!=SQLITE_OK && xDestroy ) xDestroy(pAux); |
|
0 |
0 |
if( rc!=SQLITE_OK && xDestroy ) xDestroy(pAux); |
130749
|
518 |
3 |
for(pVtab=pTab->pVTable; pVtab && pVtab->db!=db; pVtab=pVtab->pNext); |
|
0 |
518 |
for(pVtab=pTab->pVTable; pVtab && pVtab->db!=db; pVtab=pVtab->pNext); |
130765
|
26 |
222 |
if( pVTab->nRef==0 ){ |
130767
|
24 |
2 |
if( p ){ |
130794
|
2 |
955 |
while( pVTable ){ |
130798
|
2 |
0 |
if( db2==db ){ |
130828
|
24 |
3 |
for(ppVTab=&p->pVTable; *ppVTab; ppVTab=&(*ppVTab)->pNext){ |
130829
|
24 |
0 |
if( (*ppVTab)->db==db ){ |
130866
|
0 |
6291 |
if( p ){ |
130872
|
0 |
0 |
}while( p ); |
130891
|
311 |
648 |
if( !db || db->pnBytesFreed==0 ) vtabDisconnectAll(0, p); |
|
305 |
6 |
if( !db || db->pnBytesFreed==0 ) vtabDisconnectAll(0, p); |
130892
|
51 |
908 |
if( p->azModuleArg ){ |
130894
|
287 |
51 |
for(i=0; inModuleArg; i++){ |
130895
|
236 |
51 |
if( i!=1 ) sqlite3DbFree(db, p->azModuleArg[i]); |
130911
|
0 |
287 |
if( azModuleArg==0 ){ |
130939
|
0 |
51 |
if( pTable==0 ) return; |
130963
|
51 |
0 |
if( pTable->azModuleArg ){ |
130976
|
134 |
53 |
if( pParse->sArg.z && pParse->pNewTable ){ |
|
134 |
0 |
if( pParse->sArg.z && pParse->pNewTable ){ |
130992
|
0 |
51 |
if( pTab==0 ) return; |
130995
|
0 |
51 |
if( pTab->nModuleArg<1 ) return; |
131003
|
24 |
27 |
if( !db->init.busy ){ |
131011
|
24 |
0 |
if( pEnd ){ |
131059
|
0 |
27 |
if( pOld ){ |
131084
|
134 |
132 |
if( pArg->z==0 ){ |
131116
|
1 |
27 |
for(pCtx=db->pVtabCtx; pCtx; pCtx=pCtx->pPrior){ |
131117
|
0 |
1 |
if( pCtx->pTab==pTab ){ |
131126
|
0 |
27 |
if( !zModuleName ){ |
131131
|
0 |
27 |
if( !pVTable ){ |
131152
|
0 |
27 |
if( rc==SQLITE_NOMEM ) sqlite3OomFault(db); |
131155
|
1 |
26 |
if( SQLITE_OK!=rc ){ |
131156
|
0 |
1 |
if( zErr==0 ){ |
131163
|
26 |
0 |
}else if( ALWAYS(pVTable->pVtab) ){ |
131169
|
0 |
26 |
if( sCtx.bDeclared==0 ){ |
131185
|
87 |
26 |
for(iCol=0; iColnCol; iCol++){ |
131190
|
139 |
59 |
for(i=0; i
|
131191
|
28 |
111 |
if( 0==sqlite3StrNICmp("hidden", &zType[i], 6) |
131192
|
0 |
28 |
&& (i==0 || zType[i-1]==' ') |
|
0 |
0 |
&& (i==0 || zType[i-1]==' ') |
131193
|
0 |
28 |
&& (zType[i+6]=='\0' || zType[i+6]==' ') |
|
0 |
0 |
&& (zType[i+6]=='\0' || zType[i+6]==' ') |
131198
|
28 |
59 |
if( i
|
131200
|
0 |
28 |
int nDel = 6 + (zType[i+6] ? 1 : 0); |
131201
|
28 |
28 |
for(j=i; (j+nDel)<=nType; j++){ |
131204
|
28 |
0 |
if( zType[i]=='\0' && i>0 ){ |
|
0 |
28 |
if( zType[i]=='\0' && i>0 ){ |
131235
|
152 |
3039 |
if( !IsVirtual(pTab) || sqlite3GetVTable(db, pTab) ){ |
|
149 |
3 |
if( !IsVirtual(pTab) || sqlite3GetVTable(db, pTab) ){ |
131243
|
0 |
3 |
if( !pMod ){ |
131250
|
0 |
3 |
if( rc!=SQLITE_OK ){ |
131267
|
58 |
0 |
if( (db->nVTrans%ARRAY_INCR)==0 ){ |
131271
|
0 |
58 |
if( !aVTrans ){ |
131316
|
24 |
0 |
if( pMod==0 || pMod->pModule->xCreate==0 || pMod->pModule->xDestroy==0 ){ |
|
24 |
0 |
if( pMod==0 || pMod->pModule->xCreate==0 || pMod->pModule->xDestroy==0 ){ |
|
0 |
24 |
if( pMod==0 || pMod->pModule->xCreate==0 || pMod->pModule->xDestroy==0 ){ |
131325
|
23 |
1 |
if( rc==SQLITE_OK && ALWAYS(sqlite3GetVTable(db, pTab)) ){ |
|
23 |
0 |
if( rc==SQLITE_OK && ALWAYS(sqlite3GetVTable(db, pTab)) ){ |
131327
|
23 |
0 |
if( rc==SQLITE_OK ){ |
131354
|
26 |
0 |
if( !pCtx || pCtx->bDeclared ){ |
|
0 |
26 |
if( !pCtx || pCtx->bDeclared ){ |
131366
|
26 |
0 |
if( SQLITE_OK==sqlite3RunParser(&sParse, zCreateTable, &zErr) |
131367
|
26 |
0 |
&& sParse.pNewTable |
131368
|
26 |
0 |
&& !db->mallocFailed |
131369
|
26 |
0 |
&& !sParse.pNewTable->pSelect |
131370
|
26 |
0 |
&& !IsVirtual(sParse.pNewTable) |
131372
|
26 |
0 |
if( !pTab->aCol ){ |
131382
|
0 |
26 |
if( !HasRowid(pNew) |
131383
|
0 |
0 |
&& pCtx->pVTable->pMod->pModule->xUpdate!=0 |
131384
|
0 |
0 |
&& sqlite3PrimaryKeyIndex(pNew)->nKeyCol!=1 |
131391
|
0 |
26 |
if( pIdx ){ |
131400
|
0 |
0 |
sqlite3ErrorWithMsg(db, SQLITE_ERROR, (zErr ? "%s" : 0), zErr); |
131406
|
26 |
0 |
if( sParse.pVdbe ){ |
131430
|
2 |
0 |
if( pTab!=0 && ALWAYS(pTab->pVTable!=0) ){ |
|
2 |
0 |
if( pTab!=0 && ALWAYS(pTab->pVTable!=0) ){ |
131433
|
2 |
2 |
for(p=pTab->pVTable; p; p=p->pNext){ |
131435
|
0 |
2 |
if( p->pVtab->nRef>0 ){ |
131444
|
2 |
0 |
if( rc==SQLITE_OK ){ |
131465
|
58 |
2697 |
if( db->aVTrans ){ |
131468
|
58 |
58 |
for(i=0; inVTrans; i++){ |
131471
|
58 |
0 |
if( p ){ |
131474
|
57 |
1 |
if( x ) x(p); |
131497
|
2223 |
0 |
for(i=0; rc==SQLITE_OK && inVTrans; i++){ |
|
58 |
2165 |
for(i=0; rc==SQLITE_OK && inVTrans; i++){ |
131500
|
58 |
0 |
if( pVtab && (x = pVtab->pModule->xSync)!=0 ){ |
|
57 |
1 |
if( pVtab && (x = pVtab->pModule->xSync)!=0 ){ |
131544
|
5 |
61 |
if( sqlite3VtabInSync(db) ){ |
|
0 |
5 |
if( sqlite3VtabInSync(db) ){ |
131547
|
26 |
40 |
if( !pVTab ){ |
131552
|
40 |
0 |
if( pModule->xBegin ){ |
131556
|
5 |
35 |
for(i=0; inVTrans; i++){ |
131557
|
5 |
0 |
if( db->aVTrans[i]==pVTab ){ |
131565
|
35 |
0 |
if( rc==SQLITE_OK ){ |
131567
|
35 |
0 |
if( rc==SQLITE_OK ){ |
131570
|
0 |
35 |
if( iSvpt && pModule->xSavepoint ){ |
|
0 |
0 |
if( iSvpt && pModule->xSavepoint ){ |
131600
|
0 |
27 |
if( db->aVTrans ){ |
131602
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inVTrans; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inVTrans; i++){ |
131605
|
0 |
0 |
if( pVTab->pVtab && pMod->iVersion>=2 ){ |
|
0 |
0 |
if( pVTab->pVtab && pMod->iVersion>=2 ){ |
131619
|
0 |
0 |
if( xMethod && pVTab->iSavepoint>iSavepoint ){ |
|
0 |
0 |
if( xMethod && pVTab->iSavepoint>iSavepoint ){ |
131656
|
0 |
569 |
if( NEVER(pExpr==0) ) return pDef; |
131657
|
420 |
149 |
if( pExpr->op!=TK_COLUMN ) return pDef; |
131659
|
0 |
149 |
if( pTab==0 ) return pDef; |
131660
|
136 |
13 |
if( !IsVirtual(pTab) ) return pDef; |
131665
|
0 |
13 |
if( pMod->xFindFunction==0 ) return pDef; |
131684
|
4 |
9 |
if( rc==0 ){ |
131692
|
0 |
9 |
if( pNew==0 ){ |
131711
|
0 |
22 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
131716
|
0 |
22 |
for(i=0; inVtabLock; i++){ |
131717
|
0 |
0 |
if( pTab==pToplevel->apVtabLock[i] ) return; |
131721
|
22 |
0 |
if( apVtabLock ){ |
131749
|
0 |
0 |
if( pMod->pEpoTab ) return 1; |
131750
|
0 |
0 |
if( pModule->xCreate!=0 && pModule->xCreate!=pModule->xConnect ) return 0; |
|
0 |
0 |
if( pModule->xCreate!=0 && pModule->xCreate!=pModule->xConnect ) return 0; |
131752
|
0 |
0 |
if( pTab==0 ) return 0; |
131754
|
0 |
0 |
if( pTab->zName==0 ){ |
131767
|
0 |
0 |
if( rc ){ |
131782
|
0 |
2611 |
if( pTab!=0 ){ |
131826
|
10 |
0 |
switch( op ){ |
131829
|
0 |
10 |
if( !p ){ |
131833
|
10 |
0 |
p->pVTable->bConstraint = (u8)va_arg(ap, int); |
131843
|
0 |
10 |
if( rc!=SQLITE_OK ) sqlite3Error(db, rc); |
132442
|
0 |
0 |
if( i==XN_EXPR ) return ""; |
132443
|
0 |
0 |
if( i==XN_ROWID ) return "rowid"; |
132466
|
0 |
0 |
if( bAnd ) sqlite3_str_append(pStr, " AND ", 5); |
132468
|
0 |
0 |
if( nTerm>1 ) sqlite3_str_append(pStr, "(", 1); |
132469
|
0 |
0 |
for(i=0; i
|
132470
|
0 |
0 |
if( i ) sqlite3_str_append(pStr, ",", 1); |
132473
|
0 |
0 |
if( nTerm>1 ) sqlite3_str_append(pStr, ")", 1); |
132477
|
0 |
0 |
if( nTerm>1 ) sqlite3_str_append(pStr, "(", 1); |
132478
|
0 |
0 |
for(i=0; i
|
132479
|
0 |
0 |
if( i ) sqlite3_str_append(pStr, ",", 1); |
132482
|
0 |
0 |
if( nTerm>1 ) sqlite3_str_append(pStr, ")", 1); |
132505
|
0 |
0 |
if( nEq==0 && (pLoop->wsFlags&(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))==0 ) return; |
|
0 |
0 |
if( nEq==0 && (pLoop->wsFlags&(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))==0 ) return; |
132507
|
0 |
0 |
for(i=0; i
|
132509
|
0 |
0 |
if( i ) sqlite3_str_append(pStr, " AND ", 5); |
132510
|
0 |
0 |
sqlite3_str_appendf(pStr, i>=nSkip ? "%s=?" : "ANY(%s)", z); |
132514
|
0 |
0 |
if( pLoop->wsFlags&WHERE_BTM_LIMIT ){ |
132518
|
0 |
0 |
if( pLoop->wsFlags&WHERE_TOP_LIMIT ){ |
132541
|
0 |
1626 |
if( sqlite3ParseToplevel(pParse)->explain==2 ) |
|
0 |
1626 |
if( sqlite3ParseToplevel(pParse)->explain==2 ) |
132556
|
0 |
0 |
if( (flags&WHERE_MULTI_OR) || (wctrlFlags&WHERE_OR_SUBCLAUSE) ) return 0; |
|
0 |
0 |
if( (flags&WHERE_MULTI_OR) || (wctrlFlags&WHERE_OR_SUBCLAUSE) ) return 0; |
132559
|
0 |
0 |
|| ((flags&WHERE_VIRTUALTABLE)==0 && (pLoop->u.btree.nEq>0)) |
|
0 |
0 |
|| ((flags&WHERE_VIRTUALTABLE)==0 && (pLoop->u.btree.nEq>0)) |
132560
|
0 |
0 |
|| (wctrlFlags&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX)); |
|
0 |
0 |
|| (wctrlFlags&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX)); |
132563
|
0 |
0 |
sqlite3_str_appendall(&str, isSearch ? "SEARCH" : "SCAN"); |
132564
|
0 |
0 |
if( pItem->pSelect ){ |
132570
|
0 |
0 |
if( pItem->zAlias ){ |
132573
|
0 |
0 |
if( (flags & (WHERE_IPK|WHERE_VIRTUALTABLE))==0 ){ |
132580
|
0 |
0 |
if( !HasRowid(pItem->pTab) && IsPrimaryKeyIndex(pIdx) ){ |
|
0 |
0 |
if( !HasRowid(pItem->pTab) && IsPrimaryKeyIndex(pIdx) ){ |
132581
|
0 |
0 |
if( isSearch ){ |
132584
|
0 |
0 |
}else if( flags & WHERE_PARTIALIDX ){ |
132586
|
0 |
0 |
}else if( flags & WHERE_AUTO_INDEX ){ |
132588
|
0 |
0 |
}else if( flags & WHERE_IDX_ONLY ){ |
132593
|
0 |
0 |
if( zFmt ){ |
132598
|
0 |
0 |
}else if( (flags & WHERE_IPK)!=0 && (flags & WHERE_CONSTRAINT)!=0 ){ |
|
0 |
0 |
}else if( (flags & WHERE_IPK)!=0 && (flags & WHERE_CONSTRAINT)!=0 ){ |
132600
|
0 |
0 |
if( flags&(WHERE_COLUMN_EQ|WHERE_COLUMN_IN) ){ |
132602
|
0 |
0 |
}else if( (flags&WHERE_BOTH_LIMIT)==WHERE_BOTH_LIMIT ){ |
132604
|
0 |
0 |
}else if( flags&WHERE_BTM_LIMIT ){ |
132614
|
0 |
0 |
else if( (flags & WHERE_VIRTUALTABLE)!=0 ){ |
132710
|
804 |
3 |
while( (pTerm->wtFlags & TERM_CODED)==0 |
132711
|
0 |
804 |
&& (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_FromJoin)) |
|
0 |
0 |
&& (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_FromJoin)) |
132712
|
804 |
0 |
&& (pLevel->notReady & pTerm->prereqAll)==0 |
132714
|
90 |
714 |
if( nLoop && (pTerm->wtFlags & TERM_LIKE)!=0 ){ |
|
0 |
90 |
if( nLoop && (pTerm->wtFlags & TERM_LIKE)!=0 ){ |
132719
|
696 |
108 |
if( pTerm->iParent<0 ) break; |
132723
|
18 |
90 |
if( pTerm->nChild!=0 ) break; |
132741
|
0 |
62 |
if( zAff==0 ){ |
132750
|
66 |
7 |
while( n>0 && zAff[0]==SQLITE_AFF_BLOB ){ |
|
11 |
55 |
while( n>0 && zAff[0]==SQLITE_AFF_BLOB ){ |
132755
|
2 |
62 |
while( n>1 && zAff[n-1]==SQLITE_AFF_BLOB ){ |
|
2 |
0 |
while( n>1 && zAff[n-1]==SQLITE_AFF_BLOB ){ |
132760
|
55 |
7 |
if( n>0 ){ |
132782
|
37 |
37 |
for(i=0; i
|
132784
|
37 |
0 |
if( sqlite3CompareAffinity(p, zAff[i])==SQLITE_AFF_BLOB |
132785
|
2 |
35 |
|| sqlite3ExprNeedsNoAffinityChange(p, zAff[i]) |
132830
|
0 |
0 |
if( db->mallocFailed==0 ){ |
132838
|
0 |
0 |
for(i=iEq; inLTerm; i++){ |
132839
|
0 |
0 |
if( pLoop->aLTerm[i]->pExpr==pX ){ |
132853
|
0 |
0 |
if( pLhs && pLhs->nExpr==1 ){ |
|
0 |
0 |
if( pLhs && pLhs->nExpr==1 ){ |
132863
|
0 |
0 |
if( pSelect->pOrderBy ){ |
132872
|
0 |
0 |
for(i=0; inExpr; i++){ |
132917
|
5 |
548 |
if( pX->op==TK_EQ || pX->op==TK_IS ){ |
|
0 |
5 |
if( pX->op==TK_EQ || pX->op==TK_IS ){ |
132919
|
2 |
3 |
}else if( pX->op==TK_ISNULL ){ |
132932
|
0 |
3 |
if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0 |
132933
|
0 |
0 |
&& pLoop->u.btree.pIndex!=0 |
132934
|
0 |
0 |
&& pLoop->u.btree.pIndex->aSortOrder[iEq] |
132943
|
0 |
3 |
for(i=0; i
|
132944
|
0 |
0 |
if( pLoop->aLTerm[i] && pLoop->aLTerm[i]->pExpr==pX ){ |
|
0 |
0 |
if( pLoop->aLTerm[i] && pLoop->aLTerm[i]->pExpr==pX ){ |
132949
|
3 |
3 |
for(i=iEq;inLTerm; i++){ |
132951
|
3 |
0 |
if( pLoop->aLTerm[i]->pExpr==pX ) nEq++; |
132954
|
3 |
0 |
if( (pX->flags & EP_xIsSelect)==0 || pX->x.pSelect->pEList->nExpr==1 ){ |
|
3 |
0 |
if( (pX->flags & EP_xIsSelect)==0 || pX->x.pSelect->pEList->nExpr==1 ){ |
132960
|
0 |
0 |
if( !db->mallocFailed ){ |
132969
|
0 |
3 |
if( eType==IN_INDEX_INDEX_DESC ){ |
132974
|
0 |
3 |
sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iTab, 0); |
132980
|
3 |
0 |
if( pLevel->u.in.nIn==0 ){ |
132990
|
3 |
0 |
if( pIn ){ |
132993
|
3 |
3 |
for(i=iEq;inLTerm; i++){ |
132994
|
3 |
0 |
if( pLoop->aLTerm[i]->pExpr==pX ){ |
132996
|
0 |
3 |
if( eType==IN_INDEX_ROWID ){ |
133000
|
0 |
3 |
int iCol = aiMap ? aiMap[iMap++] : 0; |
133004
|
3 |
0 |
if( i==iEq ){ |
133006
|
0 |
3 |
pIn->eEndLoopOp = bRev ? OP_PrevIfOpen : OP_NextIfOpen; |
133103
|
0 |
44 |
if( nSkip ){ |
133105
|
0 |
0 |
sqlite3VdbeAddOp1(v, (bRev?OP_Last:OP_Rewind), iIdxCur); |
133110
|
0 |
0 |
pLevel->addrSkip = sqlite3VdbeAddOp4Int(v, (bRev?OP_SeekLT:OP_SeekGT), |
133115
|
0 |
0 |
for(j=0; j
|
133125
|
31 |
44 |
for(j=nSkip; j
|
133134
|
0 |
31 |
if( r1!=regBase+j ){ |
133135
|
0 |
0 |
if( nReg==1 ){ |
133142
|
0 |
31 |
if( pTerm->eOperator & WO_IN ){ |
133143
|
0 |
0 |
if( pTerm->pExpr->flags & EP_xIsSelect ){ |
133148
|
0 |
0 |
if( zAff ) zAff[j] = SQLITE_AFF_BLOB; |
133150
|
29 |
2 |
}else if( (pTerm->eOperator & WO_ISNULL)==0 ){ |
133152
|
29 |
0 |
if( (pTerm->wtFlags & TERM_IS)==0 && sqlite3ExprCanBeNull(pRight) ){ |
|
23 |
6 |
if( (pTerm->wtFlags & TERM_IS)==0 && sqlite3ExprCanBeNull(pRight) ){ |
133156
|
29 |
0 |
if( zAff ){ |
133157
|
5 |
24 |
if( sqlite3CompareAffinity(pRight, zAff[j])==SQLITE_AFF_BLOB ){ |
133160
|
11 |
18 |
if( sqlite3ExprNeedsNoAffinityChange(pRight, zAff[j]) ){ |
133193
|
0 |
37 |
if( pTerm->wtFlags & TERM_LIKEOPT ){ |
133456
|
4 |
22 |
if( (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE) |
133457
|
0 |
4 |
&& DbMaskAllZero(sqlite3ParseToplevel(pParse)->writeMask) |
|
4 |
0 |
&& DbMaskAllZero(sqlite3ParseToplevel(pParse)->writeMask) |
133462
|
4 |
0 |
if( ai ){ |
133464
|
4 |
4 |
for(i=0; inColumn-1; i++){ |
133466
|
4 |
0 |
if( pIdx->aiColumn[i]>=0 ) ai[pIdx->aiColumn[i]+1] = i+1; |
133484
|
155 |
4 |
if( p && sqlite3ExprIsVector(p) ){ |
|
0 |
155 |
if( p && sqlite3ExprIsVector(p) ){ |
133486
|
0 |
0 |
if( (p->flags & EP_xIsSelect) ){ |
133496
|
0 |
0 |
for(i=0; i
|
133525
|
0 |
0 |
if( sqlite3ExprCompare(0, pExpr, pX->pIdxExpr, pX->iTabCur)==0 ){ |
133552
|
44 |
0 |
if( aColExpr==0 ) return; /* Not an index on expressions */ |
133558
|
0 |
0 |
for(iIdxCol=0; iIdxColnExpr; iIdxCol++){ |
133559
|
0 |
0 |
if( pIdx->aiColumn[iIdxCol]!=XN_EXPR ) continue; |
133610
|
13 |
1608 |
&& (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0; |
|
9 |
4 |
&& (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0; |
133633
|
3 |
1618 |
if( pLevel->iFrom>0 && (pTabItem[0].fg.jointype & JT_LEFT)!=0 ){ |
|
0 |
3 |
if( pLevel->iFrom>0 && (pTabItem[0].fg.jointype & JT_LEFT)!=0 ){ |
133641
|
3 |
1621 |
for(j=iLevel; j>0 && pWInfo->a[j].iLeftJoin==0; j--){} |
|
3 |
0 |
for(j=iLevel; j>0 && pWInfo->a[j].iLeftJoin==0; j--){} |
133645
|
22 |
1599 |
if( pTabItem->fg.viaCoroutine ){ |
133655
|
120 |
1479 |
if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)!=0 ){ |
133667
|
125 |
120 |
for(j=0; j
|
133670
|
0 |
125 |
if( NEVER(pTerm==0) ) continue; |
133671
|
3 |
122 |
if( pTerm->eOperator & WO_IN ){ |
133681
|
70 |
50 |
sqlite3VdbeAddOp4(v, OP_VFilter, iCur, addrNotFound, iReg, |
133687
|
0 |
120 |
pLevel->op = pWInfo->eOnePass ? OP_Noop : OP_VNext; |
133690
|
125 |
120 |
for(j=nConstraint-1; j>=0; j--){ |
133692
|
125 |
0 |
if( j<16 && (pLoop->u.vtab.omitMask>>j)&1 ){ |
|
125 |
0 |
if( j<16 && (pLoop->u.vtab.omitMask>>j)&1 ){ |
133694
|
0 |
0 |
}else if( (pTerm->eOperator & WO_IN)!=0 ){ |
133704
|
0 |
0 |
if( !db->mallocFailed ){ |
133718
|
0 |
0 |
if( pCompare ){ |
133721
|
0 |
0 |
if( pRight ){ |
133741
|
1433 |
46 |
if( (pLoop->wsFlags & WHERE_IPK)!=0 |
133742
|
519 |
914 |
&& (pLoop->wsFlags & (WHERE_COLUMN_IN|WHERE_COLUMN_EQ))!=0 |
133757
|
263 |
256 |
if( iRowidReg!=iReleaseReg ) sqlite3ReleaseTempReg(pParse, iReleaseReg); |
133765
|
914 |
46 |
}else if( (pLoop->wsFlags & WHERE_IPK)!=0 |
133766
|
0 |
914 |
&& (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0 |
133778
|
0 |
0 |
if( pLoop->wsFlags & WHERE_BTM_LIMIT ) pStart = pLoop->aLTerm[j++]; |
133779
|
0 |
0 |
if( pLoop->wsFlags & WHERE_TOP_LIMIT ) pEnd = pLoop->aLTerm[j++]; |
133781
|
0 |
0 |
if( bRev ){ |
133787
|
0 |
0 |
if( pStart ){ |
133810
|
0 |
0 |
if( sqlite3ExprIsVector(pX->pRight) ){ |
133836
|
0 |
0 |
sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iCur, addrHalt); |
133840
|
0 |
0 |
if( pEnd ){ |
133849
|
0 |
0 |
if( 0==sqlite3ExprIsVector(pX->pRight) |
133850
|
0 |
0 |
&& (pX->op==TK_LT || pX->op==TK_GT) |
|
0 |
0 |
&& (pX->op==TK_LT || pX->op==TK_GT) |
133852
|
0 |
0 |
testOp = bRev ? OP_Le : OP_Ge; |
133854
|
0 |
0 |
testOp = bRev ? OP_Lt : OP_Gt; |
133856
|
0 |
0 |
if( 0==sqlite3ExprIsVector(pX->pRight) ){ |
133861
|
0 |
0 |
pLevel->op = bRev ? OP_Prev : OP_Next; |
133865
|
0 |
0 |
if( testOp!=OP_Noop ){ |
133876
|
44 |
916 |
}else if( pLoop->wsFlags & WHERE_INDEXED ){ |
133957
|
0 |
44 |
if( (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)!=0 |
133958
|
0 |
0 |
&& pWInfo->nOBSat>0 |
133959
|
0 |
0 |
&& (pIdx->nKeyCol>nEq) |
133970
|
19 |
25 |
if( pLoop->wsFlags & WHERE_BTM_LIMIT ){ |
133977
|
18 |
26 |
if( pLoop->wsFlags & WHERE_TOP_LIMIT ){ |
133981
|
0 |
18 |
if( (pRangeEnd->wtFlags & TERM_LIKEOPT)!=0 ){ |
133997
|
1 |
17 |
if( pRangeStart==0 ){ |
133999
|
1 |
0 |
if( (j>=0 && pIdx->pTable->aCol[j].notNull==0) || j==XN_EXPR ){ |
|
0 |
1 |
if( (j>=0 && pIdx->pTable->aCol[j].notNull==0) || j==XN_EXPR ){ |
|
0 |
0 |
if( (j>=0 && pIdx->pTable->aCol[j].notNull==0) || j==XN_EXPR ){ |
134010
|
35 |
9 |
if( (nEqnKeyCol && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC)) |
|
10 |
25 |
if( (nEqnKeyCol && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC)) |
134011
|
0 |
19 |
|| (bRev && pIdx->nKeyCol==nEq) |
|
0 |
0 |
|| (bRev && pIdx->nKeyCol==nEq) |
134025
|
44 |
0 |
if( zStartAff && nTop ){ |
|
18 |
26 |
if( zStartAff && nTop ){ |
134034
|
19 |
25 |
startEq = !pRangeStart || pRangeStart->eOperator & (WO_LE|WO_GE); |
|
17 |
2 |
startEq = !pRangeStart || pRangeStart->eOperator & (WO_LE|WO_GE); |
134035
|
18 |
26 |
endEq = !pRangeEnd || pRangeEnd->eOperator & (WO_LE|WO_GE); |
|
17 |
1 |
endEq = !pRangeEnd || pRangeEnd->eOperator & (WO_LE|WO_GE); |
134036
|
25 |
19 |
start_constraints = pRangeStart || nEq>0; |
|
24 |
1 |
start_constraints = pRangeStart || nEq>0; |
134040
|
19 |
25 |
if( pRangeStart ){ |
134044
|
17 |
2 |
if( (pRangeStart->wtFlags & TERM_VNULL)==0 |
134050
|
19 |
0 |
if( zStartAff ){ |
134055
|
19 |
0 |
if( sqlite3ExprIsVector(pRight)==0 ){ |
134061
|
1 |
24 |
}else if( bSeekPastNull ){ |
134068
|
0 |
44 |
if( pLoop->nSkip>0 && nConstraint==pLoop->nSkip ){ |
|
0 |
0 |
if( pLoop->nSkip>0 && nConstraint==pLoop->nSkip ){ |
134089
|
18 |
26 |
if( pRangeEnd ){ |
134094
|
18 |
0 |
if( (pRangeEnd->wtFlags & TERM_VNULL)==0 |
134100
|
18 |
0 |
if( zEndAff ){ |
134109
|
18 |
0 |
if( sqlite3ExprIsVector(pRight)==0 ){ |
134114
|
0 |
26 |
}else if( bStopAtNull ){ |
134127
|
44 |
0 |
if( nConstraint ){ |
134137
|
35 |
9 |
if( omitTable ){ |
134139
|
35 |
0 |
}else if( HasRowid(pIdx->pTable) ){ |
134140
|
26 |
9 |
if( (pWInfo->wctrlFlags & WHERE_SEEK_TABLE) || ( |
|
0 |
26 |
if( (pWInfo->wctrlFlags & WHERE_SEEK_TABLE) || ( |
134142
|
0 |
0 |
&& (pWInfo->eOnePass==ONEPASS_SINGLE) |
134152
|
0 |
0 |
}else if( iCur!=iIdxCur ){ |
134155
|
0 |
0 |
for(j=0; jnKeyCol; j++){ |
134173
|
44 |
0 |
if( pLevel->iLeftJoin==0 ){ |
134178
|
6 |
38 |
if( pLoop->wsFlags & WHERE_ONEROW ){ |
134180
|
25 |
13 |
}else if( bRev ){ |
134187
|
0 |
44 |
if( (pLoop->wsFlags & WHERE_CONSTRAINT)==0 ){ |
134192
|
9 |
35 |
if( omitTable ) pIdx = 0; |
134196
|
2 |
914 |
if( pLoop->wsFlags & WHERE_MULTI_OR ){ |
134268
|
0 |
2 |
if( pWInfo->nLevel>1 ){ |
134274
|
0 |
0 |
if( pOrTab==0 ) return notReady; |
134279
|
0 |
0 |
for(k=1; k<=nNotReady; k++){ |
134298
|
2 |
0 |
if( (pWInfo->wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ |
134299
|
2 |
0 |
if( HasRowid(pTab) ){ |
134326
|
1 |
1 |
if( pWC->nTerm>1 ){ |
134328
|
3 |
1 |
for(iTerm=0; iTermnTerm; iTerm++){ |
134330
|
1 |
2 |
if( &pWC->a[iTerm] == pTerm ) continue; |
134333
|
1 |
1 |
if( (pWC->a[iTerm].wtFlags & (TERM_VIRTUAL|TERM_CODED))!=0 ) continue; |
134334
|
0 |
1 |
if( (pWC->a[iTerm].eOperator & WO_ALL)==0 ) continue; |
134339
|
1 |
0 |
if( pAndExpr ){ |
134350
|
6 |
2 |
for(ii=0; iinTerm; ii++){ |
134352
|
5 |
1 |
if( pOrTerm->leftCursor==iCur || (pOrTerm->eOperator & WO_AND)!=0 ){ |
|
4 |
1 |
if( pOrTerm->leftCursor==iCur || (pOrTerm->eOperator & WO_AND)!=0 ){ |
134359
|
2 |
3 |
if( pAndExpr ){ |
134368
|
5 |
0 |
if( pSubWInfo ){ |
134380
|
5 |
0 |
if( (pWInfo->wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ |
134382
|
3 |
2 |
int iSet = ((ii==pOrWc->nTerm-1)?-1:ii); |
134383
|
5 |
0 |
if( HasRowid(pTab) ){ |
134395
|
0 |
0 |
for(iPk=0; iPk
|
134411
|
0 |
0 |
if( iSet ){ |
134415
|
0 |
0 |
if( iSet>=0 ){ |
134419
|
0 |
0 |
if( iSet ) sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT); |
134432
|
5 |
0 |
if( jmp1 ) sqlite3VdbeJumpHere(v, jmp1); |
134439
|
0 |
5 |
if( pSubWInfo->untestedTerms ) untestedTerms = 1; |
134455
|
4 |
1 |
if( (pSubLoop->wsFlags & WHERE_INDEXED)!=0 |
134456
|
3 |
1 |
&& (ii==0 || pSubLoop->u.btree.pIndex==pCov) |
|
1 |
2 |
&& (ii==0 || pSubLoop->u.btree.pIndex==pCov) |
134457
|
0 |
2 |
&& (HasRowid(pTab) || !IsPrimaryKeyIndex(pSubLoop->u.btree.pIndex)) |
|
0 |
0 |
&& (HasRowid(pTab) || !IsPrimaryKeyIndex(pSubLoop->u.btree.pIndex)) |
134472
|
0 |
2 |
if( pCov ) pLevel->iIdxCur = iCovCur; |
134473
|
1 |
1 |
if( pAndExpr ){ |
134481
|
0 |
2 |
if( pWInfo->nLevel>1 ) sqlite3StackFree(db, pOrTab); |
134482
|
2 |
0 |
if( !untestedTerms ) disableTerm(pLevel, pTerm); |
134493
|
0 |
914 |
if( pTabItem->fg.isRecursive ){ |
134526
|
35 |
1586 |
iLoop = (pIdx ? 1 : 2); |
134529
|
1787 |
1623 |
for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){ |
134534
|
985 |
802 |
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |
134535
|
3 |
799 |
if( (pTerm->prereqAll & pLevel->notReady)!=0 ){ |
134543
|
0 |
799 |
if( (pTabItem->fg.jointype&JT_LEFT) && !ExprHasProperty(pE,EP_FromJoin) ){ |
|
0 |
0 |
if( (pTabItem->fg.jointype&JT_LEFT) && !ExprHasProperty(pE,EP_FromJoin) ){ |
134547
|
1 |
798 |
if( iLoop==1 && !sqlite3ExprCoveredByIndex(pE, pLevel->iTabCur, pIdx) ){ |
|
0 |
1 |
if( iLoop==1 && !sqlite3ExprCoveredByIndex(pE, pLevel->iTabCur, pIdx) ){ |
134551
|
797 |
2 |
if( iLoop<3 && (pTerm->wtFlags & TERM_VARSELECT) ){ |
|
2 |
795 |
if( iLoop<3 && (pTerm->wtFlags & TERM_VARSELECT) ){ |
134552
|
2 |
0 |
if( iNext==0 ) iNext = 3; |
134556
|
0 |
797 |
if( (pTerm->wtFlags & TERM_LIKECOND)!=0 ){ |
134566
|
0 |
0 |
if( x>0 ){ |
134567
|
0 |
0 |
skipLikeAddr = sqlite3VdbeAddOp1(v, (x&1)?OP_IfNot:OP_If,(int)(x>>1)); |
134579
|
0 |
797 |
if( skipLikeAddr ) sqlite3VdbeJumpHere(v, skipLikeAddr); |
134583
|
2 |
1621 |
}while( iLoop>0 ); |
134593
|
1785 |
1621 |
for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){ |
134596
|
1782 |
3 |
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |
134597
|
0 |
3 |
if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) continue; |
134598
|
0 |
3 |
if( (pTerm->eOperator & WO_EQUIV)==0 ) continue; |
134599
|
2 |
1 |
if( pTerm->leftCursor!=iCur ) continue; |
134600
|
0 |
1 |
if( pLevel->iLeftJoin ) continue; |
134606
|
1 |
0 |
if( pAlt==0 ) continue; |
134607
|
0 |
0 |
if( pAlt->wtFlags & (TERM_CODED) ) continue; |
134608
|
0 |
0 |
if( (pAlt->eOperator & WO_IN) |
134609
|
0 |
0 |
&& (pAlt->pExpr->flags & EP_xIsSelect) |
134610
|
0 |
0 |
&& (pAlt->pExpr->x.pSelect->pEList->nExpr>1) |
134626
|
0 |
1621 |
if( pLevel->iLeftJoin ){ |
134631
|
0 |
0 |
for(pTerm=pWC->a, j=0; jnTerm; j++, pTerm++){ |
134634
|
0 |
0 |
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |
134635
|
0 |
0 |
if( (pTerm->prereqAll & pLevel->notReady)!=0 ){ |
134713
|
0 |
1944 |
if( pWC->nTerm>=pWC->nSlot ){ |
134717
|
0 |
0 |
if( pWC->a==0 ){ |
134718
|
0 |
0 |
if( wtFlags & TERM_DYNAMIC ){ |
134725
|
0 |
0 |
if( pOld!=pWC->aStatic ){ |
134731
|
1944 |
0 |
if( p && ExprHasProperty(p, EP_Unlikely) ){ |
|
0 |
1944 |
if( p && ExprHasProperty(p, EP_Unlikely) ){ |
134755
|
1862 |
19 |
return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS; |
|
1550 |
312 |
return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS; |
|
210 |
1340 |
return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS; |
|
494 |
28 |
return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS; |
|
2 |
492 |
return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS; |
134774
|
14 |
1 |
if( expRight==expLeft ){ |
134776
|
0 |
14 |
if( expRight ){ |
134780
|
7 |
7 |
}else if( sqlite3ExprCollSeq(pParse, pExpr->pLeft)!=0 ){ |
134788
|
8 |
7 |
if( pExpr->op>=TK_GT ){ |
134804
|
19 |
1253 |
if( op==TK_IN ){ |
134806
|
20 |
1233 |
}else if( op==TK_ISNULL ){ |
134808
|
2 |
1231 |
}else if( op==TK_IS ){ |
134857
|
1726 |
119 |
if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, wc) ){ |
134868
|
0 |
119 |
if( op==TK_VARIABLE && (db->flags & SQLITE_EnableQPSG)==0 ){ |
|
0 |
0 |
if( op==TK_VARIABLE && (db->flags & SQLITE_EnableQPSG)==0 ){ |
134872
|
0 |
0 |
if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){ |
|
0 |
0 |
if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){ |
134877
|
119 |
0 |
}else if( op==TK_STRING ){ |
134880
|
119 |
0 |
if( z ){ |
134889
|
119 |
0 |
if( sqlite3Isdigit(z[0]) || z[0]=='-' ){ |
|
0 |
119 |
if( sqlite3Isdigit(z[0]) || z[0]=='-' ){ |
134890
|
0 |
0 |
if( pLeft->op!=TK_COLUMN |
134891
|
0 |
0 |
|| sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT |
134892
|
0 |
0 |
|| IsVirtual(pLeft->pTab) /* Value might be numeric */ |
134901
|
374 |
111 |
while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){ |
|
366 |
8 |
while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){ |
|
366 |
0 |
while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){ |
|
366 |
0 |
while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){ |
134903
|
0 |
366 |
if( c==wc[3] && z[cnt]!=0 ) cnt++; |
|
0 |
0 |
if( c==wc[3] && z[cnt]!=0 ) cnt++; |
134912
|
117 |
2 |
if( cnt!=0 && 255!=(u8)z[cnt-1] ){ |
|
117 |
0 |
if( cnt!=0 && 255!=(u8)z[cnt-1] ){ |
134916
|
6 |
111 |
*pisComplete = c==wc[0] && z[cnt+1]==0; |
|
6 |
0 |
*pisComplete = c==wc[0] && z[cnt+1]==0; |
134920
|
117 |
0 |
if( pPrefix ){ |
134924
|
366 |
117 |
for(iFrom=iTo=0; iFrom
|
134925
|
0 |
366 |
if( zNew[iFrom]==wc[3] ) iFrom++; |
134934
|
0 |
117 |
if( op==TK_VARIABLE ){ |
134937
|
0 |
0 |
if( *pisComplete && pRight->u.zToken[1] ){ |
|
0 |
0 |
if( *pisComplete && pRight->u.zToken[1] ){ |
134995
|
202 |
1643 |
if( pExpr->op==TK_FUNCTION ){ |
135010
|
202 |
0 |
if( pList==0 || pList->nExpr!=2 ){ |
|
0 |
202 |
if( pList==0 || pList->nExpr!=2 ){ |
135014
|
151 |
51 |
if( pCol->op!=TK_COLUMN || !IsVirtual(pCol->pTab) ){ |
|
82 |
69 |
if( pCol->op!=TK_COLUMN || !IsVirtual(pCol->pTab) ){ |
135017
|
76 |
0 |
for(i=0; i
|
135018
|
69 |
7 |
if( sqlite3StrICmp(pExpr->u.zToken, aOp[i].zOp)==0 ){ |
135025
|
1426 |
217 |
}else if( pExpr->op==TK_NE || pExpr->op==TK_ISNOT || pExpr->op==TK_NOTNULL ){ |
|
1423 |
3 |
}else if( pExpr->op==TK_NE || pExpr->op==TK_ISNOT || pExpr->op==TK_NOTNULL ){ |
|
13 |
1410 |
}else if( pExpr->op==TK_NE || pExpr->op==TK_ISNOT || pExpr->op==TK_NOTNULL ){ |
135029
|
233 |
0 |
if( pLeft->op==TK_COLUMN && IsVirtual(pLeft->pTab) ){ |
|
3 |
230 |
if( pLeft->op==TK_COLUMN && IsVirtual(pLeft->pTab) ){ |
135032
|
220 |
13 |
if( pRight && pRight->op==TK_COLUMN && IsVirtual(pRight->pTab) ){ |
|
0 |
220 |
if( pRight && pRight->op==TK_COLUMN && IsVirtual(pRight->pTab) ){ |
|
0 |
0 |
if( pRight && pRight->op==TK_COLUMN && IsVirtual(pRight->pTab) ){ |
135038
|
217 |
16 |
if( pExpr->op==TK_NE ) *peOp2 = SQLITE_INDEX_CONSTRAINT_NE; |
135039
|
3 |
230 |
if( pExpr->op==TK_ISNOT ) *peOp2 = SQLITE_INDEX_CONSTRAINT_ISNOT; |
135040
|
13 |
220 |
if( pExpr->op==TK_NOTNULL ) *peOp2 = SQLITE_INDEX_CONSTRAINT_ISNOTNULL; |
135052
|
270 |
0 |
if( pDerived ){ |
135073
|
0 |
0 |
if( pTerm->eOperator!=WO_AND ){ |
135074
|
0 |
0 |
return N==0 ? pTerm : 0; |
135076
|
0 |
0 |
if( Nu.pAndInfo->wc.nTerm ){ |
135114
|
0 |
0 |
if( (pOne->eOperator & (WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE))==0 ) return; |
135115
|
0 |
0 |
if( (pTwo->eOperator & (WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE))==0 ) return; |
135116
|
0 |
0 |
if( (eOp & (WO_EQ|WO_LT|WO_LE))!=eOp |
135117
|
0 |
0 |
&& (eOp & (WO_EQ|WO_GT|WO_GE))!=eOp ) return; |
135120
|
0 |
0 |
if( sqlite3ExprCompare(0,pOne->pExpr->pLeft, pTwo->pExpr->pLeft, -1) ) return; |
135121
|
0 |
0 |
if( sqlite3ExprCompare(0,pOne->pExpr->pRight, pTwo->pExpr->pRight,-1) )return; |
135123
|
0 |
0 |
if( (eOp & (eOp-1))!=0 ){ |
135124
|
0 |
0 |
if( eOp & (WO_LT|WO_LE) ){ |
135133
|
0 |
0 |
if( pNew==0 ) return; |
135134
|
0 |
0 |
for(op=TK_EQ; eOp!=(WO_EQ<<(op-TK_EQ)); op++){ assert( op
|
135253
|
0 |
5 |
if( pOrInfo==0 ) return; |
135260
|
0 |
5 |
if( db->mallocFailed ) return; |
135268
|
15 |
5 |
for(i=pOrWc->nTerm-1, pOrTerm=pOrWc->a; i>=0 && indexable; i--, pOrTerm++){ |
|
15 |
0 |
for(i=pOrWc->nTerm-1, pOrTerm=pOrWc->a; i>=0 && indexable; i--, pOrTerm++){ |
135269
|
9 |
6 |
if( (pOrTerm->eOperator & WO_SINGLE)==0 ){ |
135274
|
9 |
0 |
if( pAndInfo ){ |
135288
|
9 |
0 |
if( !db->mallocFailed ){ |
135289
|
24 |
9 |
for(j=0, pAndTerm=pAndWC->a; jnTerm; j++, pAndTerm++){ |
135291
|
8 |
16 |
if( allowedOp(pAndTerm->pExpr->op) |
135292
|
0 |
8 |
|| pAndTerm->eOperator==WO_AUX |
135300
|
3 |
3 |
}else if( pOrTerm->wtFlags & TERM_COPIED ){ |
135306
|
3 |
0 |
if( pOrTerm->wtFlags & TERM_VIRTUAL ){ |
135311
|
0 |
3 |
if( (pOrTerm->eOperator & WO_EQ)==0 ){ |
135324
|
0 |
5 |
pTerm->eOperator = indexable==0 ? 0 : WO_OR; |
135328
|
5 |
0 |
if( indexable && pOrWc->nTerm==2 ){ |
|
0 |
5 |
if( indexable && pOrWc->nTerm==2 ){ |
135331
|
0 |
0 |
while( (pOne = whereNthSubterm(&pOrWc->a[0],iOne++))!=0 ){ |
135334
|
0 |
0 |
while( (pTwo = whereNthSubterm(&pOrWc->a[1],iTwo++))!=0 ){ |
135361
|
0 |
5 |
if( chngToIN ){ |
135373
|
0 |
0 |
for(j=0; j<2 && !okToChngToIN; j++){ |
|
0 |
0 |
for(j=0; j<2 && !okToChngToIN; j++){ |
135375
|
0 |
0 |
for(i=pOrWc->nTerm-1; i>=0; i--, pOrTerm++){ |
135378
|
0 |
0 |
if( pOrTerm->leftCursor==iCursor ){ |
135384
|
0 |
0 |
if( (chngToIN & sqlite3WhereGetMask(&pWInfo->sMaskSet, |
135399
|
0 |
0 |
if( i<0 ){ |
135412
|
0 |
0 |
for(; i>=0 && okToChngToIN; i--, pOrTerm++){ |
|
0 |
0 |
for(; i>=0 && okToChngToIN; i--, pOrTerm++){ |
135414
|
0 |
0 |
if( pOrTerm->leftCursor!=iCursor ){ |
135416
|
0 |
0 |
}else if( pOrTerm->u.leftColumn!=iColumn ){ |
135426
|
0 |
0 |
if( affRight!=0 && affRight!=affLeft ){ |
|
0 |
0 |
if( affRight!=0 && affRight!=affLeft ){ |
135439
|
0 |
0 |
if( okToChngToIN ){ |
135445
|
0 |
0 |
for(i=pOrWc->nTerm-1, pOrTerm=pOrWc->a; i>=0; i--, pOrTerm++){ |
135446
|
0 |
0 |
if( (pOrTerm->wtFlags & TERM_OR_OK)==0 ) continue; |
135457
|
0 |
0 |
if( pNew ){ |
135493
|
0 |
15 |
if( !OptimizationEnabled(pParse->db, SQLITE_Transitive) ) return 0; |
135494
|
8 |
7 |
if( pExpr->op!=TK_EQ && pExpr->op!=TK_IS ) return 0; |
|
8 |
0 |
if( pExpr->op!=TK_EQ && pExpr->op!=TK_IS ) return 0; |
135495
|
0 |
7 |
if( ExprHasProperty(pExpr, EP_FromJoin) ) return 0; |
135498
|
0 |
7 |
if( aff1!=aff2 |
135499
|
0 |
0 |
&& (!sqlite3IsNumericAffinity(aff1) || !sqlite3IsNumericAffinity(aff2)) |
|
0 |
0 |
&& (!sqlite3IsNumericAffinity(aff1) || !sqlite3IsNumericAffinity(aff2)) |
135504
|
7 |
0 |
if( pColl==0 || sqlite3StrICmp(pColl->zName, "BINARY")==0 ) return 1; |
|
7 |
0 |
if( pColl==0 || sqlite3StrICmp(pColl->zName, "BINARY")==0 ) return 1; |
135515
|
10 |
20 |
while( pS ){ |
135522
|
10 |
0 |
if( ALWAYS(pSrc!=0) ){ |
135524
|
10 |
10 |
for(i=0; inSrc; i++){ |
135527
|
0 |
10 |
if( pSrc->a[i].fg.isTabFunc ){ |
135559
|
0 |
11 |
for(i=0; mPrereq>1; i++, mPrereq>>=1){} |
135561
|
8 |
11 |
for(pIdx=pFrom->a[i].pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
135562
|
8 |
0 |
if( pIdx->aColExpr==0 ) continue; |
135563
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
135564
|
0 |
0 |
if( pIdx->aiColumn[i]!=XN_EXPR ) continue; |
135565
|
0 |
0 |
if( sqlite3ExprCompareSkip(pExpr, pIdx->aColExpr->a[i].pExpr, iCur)==0 ){ |
135587
|
0 |
2707 |
if( pExpr->op==TK_VECTOR && (op>=TK_GT && ALWAYS(op<=TK_GE)) ){ |
|
0 |
0 |
if( pExpr->op==TK_VECTOR && (op>=TK_GT && ALWAYS(op<=TK_GE)) ){ |
|
0 |
0 |
if( pExpr->op==TK_VECTOR && (op>=TK_GT && ALWAYS(op<=TK_GE)) ){ |
135591
|
1272 |
1435 |
if( pExpr->op==TK_COLUMN ){ |
135596
|
1424 |
11 |
if( mPrereq==0 ) return 0; /* No table references */ |
135597
|
0 |
11 |
if( (mPrereq&(mPrereq-1))!=0 ) return 0; /* Refs more than one table */ |
135640
|
0 |
1857 |
if( db->mallocFailed ){ |
135649
|
19 |
1838 |
if( op==TK_IN ){ |
135651
|
0 |
19 |
if( sqlite3ExprCheckIN(pParse, pExpr) ) return; |
135652
|
3 |
16 |
if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
135657
|
20 |
1818 |
}else if( op==TK_ISNULL ){ |
135664
|
2 |
1855 |
if( pMaskSet->bVarSelect ) pTerm->wtFlags |= TERM_VARSELECT; |
135665
|
0 |
1857 |
if( ExprHasProperty(pExpr, EP_FromJoin) ){ |
135670
|
0 |
0 |
if( (prereqAll>>1)>=x ){ |
135679
|
1373 |
484 |
if( allowedOp(op) ){ |
135683
|
1373 |
0 |
u16 opMask = (pTerm->prereqRight & prereqLeft)==0 ? WO_ALL : WO_EQUIV; |
135685
|
0 |
1373 |
if( pTerm->iField>0 ){ |
135691
|
1257 |
116 |
if( exprMightBeIndexed(pSrc, prereqLeft, aiCurCol, pLeft, op) ){ |
135696
|
2 |
1371 |
if( op==TK_IS ) pTerm->wtFlags |= TERM_IS; |
135697
|
1334 |
39 |
if( pRight |
135698
|
15 |
1319 |
&& exprMightBeIndexed(pSrc, pTerm->prereqRight, aiCurCol, pRight, op) |
135704
|
15 |
0 |
if( pTerm->leftCursor>=0 ){ |
135707
|
0 |
15 |
if( db->mallocFailed ){ |
135712
|
0 |
15 |
if( idxNew==0 ) return; |
135715
|
0 |
15 |
if( op==TK_IS ) pNew->wtFlags |= TERM_IS; |
135719
|
7 |
8 |
if( termIsEquivalence(pParse, pDup) ){ |
135753
|
18 |
466 |
else if( pExpr->op==TK_BETWEEN && pWC->op==TK_AND ){ |
|
18 |
0 |
else if( pExpr->op==TK_BETWEEN && pWC->op==TK_AND ){ |
135759
|
36 |
18 |
for(i=0; i<2; i++){ |
135779
|
5 |
461 |
else if( pExpr->op==TK_OR ){ |
135800
|
1845 |
12 |
if( pWC->op==TK_AND |
135801
|
117 |
1728 |
&& isLikeOrGlob(pParse, pExpr, &pStr1, &isComplete, &noCase) |
135819
|
117 |
0 |
if( noCase && !pParse->db->mallocFailed ){ |
|
117 |
0 |
if( noCase && !pParse->db->mallocFailed ){ |
135823
|
366 |
117 |
for(i=0; (c = pStr1->u.zToken[i])!=0; i++){ |
135829
|
117 |
0 |
if( !db->mallocFailed ){ |
135833
|
117 |
0 |
if( noCase ){ |
135840
|
0 |
117 |
if( c=='A'-1 ) isComplete = 0; |
135845
|
117 |
0 |
zCollSeqName = noCase ? "NOCASE" : "BINARY"; |
135863
|
6 |
111 |
if( isComplete ){ |
135880
|
1845 |
12 |
if( pWC->op==TK_AND ){ |
135883
|
72 |
1845 |
while( res-- > 0 ){ |
135890
|
72 |
0 |
if( (prereqExpr & prereqColumn)==0 ){ |
135894
|
0 |
72 |
if( ExprHasProperty(pExpr, EP_FromJoin) && pNewExpr ){ |
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_FromJoin) && pNewExpr ){ |
135922
|
1845 |
12 |
if( pWC->op==TK_AND |
135923
|
836 |
1009 |
&& (pExpr->op==TK_EQ || pExpr->op==TK_IS) |
|
2 |
834 |
&& (pExpr->op==TK_EQ || pExpr->op==TK_IS) |
135924
|
0 |
1011 |
&& (nLeft = sqlite3ExprVectorSize(pExpr->pLeft))>1 |
135925
|
0 |
0 |
&& sqlite3ExprVectorSize(pExpr->pRight)==nLeft |
135926
|
0 |
0 |
&& ( (pExpr->pLeft->flags & EP_xIsSelect)==0 |
135927
|
0 |
0 |
|| (pExpr->pRight->flags & EP_xIsSelect)==0) |
135930
|
0 |
0 |
for(i=0; i
|
135954
|
1845 |
12 |
if( pWC->op==TK_AND && pExpr->op==TK_IN && pTerm->iField==0 |
|
19 |
1826 |
if( pWC->op==TK_AND && pExpr->op==TK_IN && pTerm->iField==0 |
|
19 |
0 |
if( pWC->op==TK_AND && pExpr->op==TK_IN && pTerm->iField==0 |
135955
|
0 |
19 |
&& pExpr->pLeft->op==TK_VECTOR |
135956
|
0 |
0 |
&& pExpr->x.pSelect->pPrior==0 |
135959
|
0 |
0 |
for(i=0; ipLeft); i++){ |
136039
|
827 |
1932 |
if( pE2==0 ) return; |
136040
|
1587 |
345 |
if( pE2->op!=op ){ |
136071
|
1944 |
2069 |
for(i=pWC->nTerm-1, a=pWC->a; i>=0; i--, a++){ |
136072
|
357 |
1587 |
if( a->wtFlags & TERM_DYNAMIC ){ |
136075
|
5 |
1939 |
if( a->wtFlags & TERM_ORINFO ){ |
136077
|
9 |
1930 |
}else if( a->wtFlags & TERM_ANDINFO ){ |
136081
|
0 |
2069 |
if( pWC->a!=pWC->aStatic ){ |
136094
|
483 |
9877 |
if( p==0 ) return 0; |
136095
|
3505 |
6372 |
if( p->op==TK_COLUMN ){ |
136098
|
0 |
6372 |
mask = (p->op==TK_IF_NULL_ROW) ? sqlite3WhereGetMask(pMaskSet, p->iTable) : 0; |
136100
|
2376 |
3996 |
if( p->pLeft ) mask |= sqlite3WhereExprUsage(pMaskSet, p->pLeft); |
136101
|
1692 |
4680 |
if( p->pRight ){ |
136104
|
7 |
4673 |
}else if( ExprHasProperty(p, EP_xIsSelect) ){ |
136105
|
4 |
3 |
if( ExprHasProperty(p, EP_VarSelect) ) pMaskSet->bVarSelect = 1; |
136107
|
278 |
4395 |
}else if( p->x.pList ){ |
136115
|
306 |
20 |
if( pList ){ |
136116
|
584 |
306 |
for(i=0; inExpr; i++){ |
136137
|
1587 |
2069 |
for(i=pWC->nTerm-1; i>=0; i--){ |
136159
|
1621 |
0 |
if( pItem->fg.isTabFunc==0 ) return; |
136163
|
0 |
0 |
if( pArgs==0 ) return; |
136164
|
0 |
0 |
for(j=k=0; jnExpr; j++){ |
136165
|
0 |
0 |
while( knCol && (pTab->aCol[k].colFlags & COLFLAG_HIDDEN)==0 ){k++;} |
|
0 |
0 |
while( knCol && (pTab->aCol[k].colFlags & COLFLAG_HIDDEN)==0 ){k++;} |
136166
|
0 |
0 |
if( k>=pTab->nCol ){ |
136172
|
0 |
0 |
if( pColRef==0 ) return; |
136333
|
9 |
11 |
for(i=pSet->n, p=pSet->a; i>0; i--, p++){ |
136334
|
9 |
0 |
if( rRun<=p->rRun && (prereq & p->prereq)==prereq ){ |
|
9 |
0 |
if( rRun<=p->rRun && (prereq & p->prereq)==prereq ){ |
136337
|
0 |
0 |
if( p->rRun<=rRun && (p->prereq & prereq)==p->prereq ){ |
|
0 |
0 |
if( p->rRun<=rRun && (p->prereq & prereq)==p->prereq ){ |
136341
|
11 |
0 |
if( pSet->n
|
136346
|
0 |
0 |
for(i=1; in; i++){ |
136347
|
0 |
0 |
if( p->rRun>pSet->a[i].rRun ) p = pSet->a + i; |
136349
|
0 |
0 |
if( p->rRun<=rRun ) return 0; |
136354
|
9 |
11 |
if( p->nOut>nOut ) p->nOut = nOut; |
136365
|
6265 |
152 |
for(i=0; in; i++){ |
136366
|
6095 |
170 |
if( pMaskSet->ix[i]==iCursor ){ |
136406
|
4965 |
3556 |
for(pTerm=pWC->a+k; knTerm; k++, pTerm++){ |
136407
|
3285 |
1680 |
if( pTerm->leftCursor==iCur |
136408
|
947 |
2338 |
&& pTerm->u.leftColumn==iColumn |
136409
|
0 |
947 |
&& (iColumn!=XN_EXPR |
136410
|
0 |
0 |
|| sqlite3ExprCompareSkip(pTerm->pExpr->pLeft, |
136412
|
7 |
940 |
&& (pScan->iEquiv<=1 || !ExprHasProperty(pTerm->pExpr, EP_FromJoin)) |
|
7 |
0 |
&& (pScan->iEquiv<=1 || !ExprHasProperty(pTerm->pExpr, EP_FromJoin)) |
136414
|
16 |
931 |
if( (pTerm->eOperator & WO_EQUIV)!=0 |
136415
|
16 |
0 |
&& pScan->nEquivaiCur) |
136416
|
16 |
0 |
&& (pX = sqlite3ExprSkipCollate(pTerm->pExpr->pRight))->op==TK_COLUMN |
136419
|
16 |
9 |
for(j=0; jnEquiv; j++){ |
136420
|
7 |
9 |
if( pScan->aiCur[j]==pX->iTable |
136421
|
7 |
0 |
&& pScan->aiColumn[j]==pX->iColumn ){ |
136425
|
9 |
7 |
if( j==pScan->nEquiv ){ |
136431
|
654 |
293 |
if( (pTerm->eOperator & pScan->opMask)!=0 ){ |
136433
|
105 |
549 |
if( pScan->zCollName && (pTerm->eOperator & WO_ISNULL)==0 ){ |
|
100 |
5 |
if( pScan->zCollName && (pTerm->eOperator & WO_ISNULL)==0 ){ |
136437
|
0 |
100 |
if( !sqlite3IndexAffinityOk(pX, pScan->idxaff) ){ |
136443
|
0 |
100 |
if( pColl==0 ) pColl = pParse->db->pDfltColl; |
136444
|
0 |
100 |
if( sqlite3StrICmp(pColl->zName, pScan->zCollName) ){ |
136448
|
582 |
72 |
if( (pTerm->eOperator & (WO_EQ|WO_IS))!=0 |
136449
|
16 |
566 |
&& (pX = pTerm->pExpr->pRight)->op==TK_COLUMN |
136450
|
7 |
9 |
&& pX->iTable==pScan->aiCur[0] |
136451
|
7 |
0 |
&& pX->iColumn==pScan->aiColumn[0] |
136464
|
42 |
3514 |
}while( pWC!=0 ); |
136465
|
3505 |
9 |
if( pScan->iEquiv>=pScan->nEquiv ) break; |
136505
|
1190 |
2859 |
if( pIdx ){ |
136508
|
0 |
1190 |
if( iColumn==XN_EXPR ){ |
136511
|
926 |
264 |
}else if( iColumn==pIdx->pTable->iPKey ){ |
136513
|
180 |
84 |
}else if( iColumn>=0 ){ |
136517
|
0 |
2859 |
}else if( iColumn==XN_EXPR ){ |
136568
|
548 |
2389 |
while( p ){ |
136569
|
544 |
4 |
if( (p->prereqRight & notReady)==0 ){ |
136570
|
544 |
0 |
if( p->prereqRight==0 && (p->eOperator&op)!=0 ){ |
|
544 |
0 |
if( p->prereqRight==0 && (p->eOperator&op)!=0 ){ |
136574
|
0 |
0 |
if( pResult==0 ) pResult = p; |
136598
|
0 |
0 |
for(i=0; inExpr; i++){ |
136600
|
0 |
0 |
if( p->op==TK_COLUMN |
136601
|
0 |
0 |
&& p->iColumn==pIdx->aiColumn[iCol] |
136602
|
0 |
0 |
&& p->iTable==iBase |
136605
|
0 |
0 |
if( 0==sqlite3StrICmp(pColl->zName, zColl) ){ |
136622
|
5 |
0 |
if( j>=0 ){ |
136624
|
0 |
0 |
}else if( j==(-1) ){ |
136654
|
2 |
0 |
if( pTabList->nSrc!=1 ) return 0; |
136662
|
0 |
0 |
for(i=0; inExpr; i++){ |
136664
|
0 |
0 |
if( p->op==TK_COLUMN && p->iTable==iBase && p->iColumn<0 ) return 1; |
|
0 |
0 |
if( p->op==TK_COLUMN && p->iTable==iBase && p->iColumn<0 ) return 1; |
|
0 |
0 |
if( p->op==TK_COLUMN && p->iTable==iBase && p->iColumn<0 ) return 1; |
136680
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
136681
|
0 |
0 |
if( !IsUniqueIndex(pIdx) ) continue; |
136682
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
136683
|
0 |
0 |
if( 0==sqlite3WhereFindTerm(pWC, iBase, i, ~(Bitmask)0, WO_EQ, pIdx) ){ |
136684
|
0 |
0 |
if( findIndexCol(pParse, pDistinct, iBase, pIdx, i)<0 ) break; |
136685
|
0 |
0 |
if( indexColumnNotNull(pIdx, i)==0 ) break; |
136688
|
0 |
0 |
if( i==pIdx->nKeyCol ){ |
136702
|
2223 |
2 |
return N<=10 ? 0 : sqlite3LogEst(N) - 33; |
136727
|
0 |
22 |
if( pParse->db->mallocFailed ) return; |
136728
|
283 |
22 |
for(; iStart
|
136729
|
137 |
146 |
if( pOp->p1!=iTabCur ) continue; |
136730
|
89 |
57 |
if( pOp->opcode==OP_Column ){ |
136735
|
0 |
57 |
}else if( pOp->opcode==OP_Rowid ){ |
136736
|
0 |
0 |
if( bIncrRowid ){ |
136807
|
378 |
661 |
if( pTerm->leftCursor!=pSrc->iCursor ) return 0; |
136808
|
192 |
469 |
if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) return 0; |
136809
|
0 |
469 |
if( (pSrc->fg.jointype & JT_LEFT) |
136810
|
0 |
0 |
&& !ExprHasProperty(pTerm->pExpr, EP_FromJoin) |
136811
|
0 |
0 |
&& (pTerm->eOperator & WO_IS) |
136818
|
0 |
469 |
if( (pTerm->prereqRight & notReady)!=0 ) return 0; |
136819
|
2 |
467 |
if( pTerm->u.leftColumn<0 ) return 0; |
136821
|
0 |
467 |
if( !sqlite3IndexAffinityOk(pTerm->pExpr, aff) ) return 0; |
136878
|
2 |
1 |
for(pTerm=pWC->a; pTerm
|
136883
|
0 |
2 |
if( pLoop->prereq==0 |
136884
|
0 |
0 |
&& (pTerm->wtFlags & TERM_VIRTUAL)==0 |
136885
|
0 |
0 |
&& !ExprHasProperty(pExpr, EP_FromJoin) |
136886
|
0 |
0 |
&& sqlite3ExprIsTableConstant(pExpr, pSrc->iCursor) ){ |
136890
|
1 |
1 |
if( termCanDriveIndex(pTerm, pSrc, notReady) ){ |
136892
|
1 |
0 |
Bitmask cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol); |
136895
|
1 |
0 |
if( !sentWarning ){ |
136901
|
1 |
0 |
if( (idxCols & cMask)==0 ){ |
136902
|
0 |
1 |
if( whereLoopResize(pParse->db, pLoop, nKeyCol+1) ){ |
136927
|
2 |
1 |
for(i=0; i
|
136928
|
1 |
1 |
if( extraCols & MASKBIT(i) ) nKeyCol++; |
136930
|
0 |
1 |
if( pSrc->colUsed & MASKBIT(BMS-1) ){ |
136936
|
0 |
1 |
if( pIdx==0 ) goto end_auto_index_create; |
136942
|
2 |
1 |
for(pTerm=pWC->a; pTerm
|
136943
|
1 |
1 |
if( termCanDriveIndex(pTerm, pSrc, notReady) ){ |
136945
|
1 |
0 |
Bitmask cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol); |
136948
|
1 |
0 |
if( (idxCols & cMask)==0 ){ |
136953
|
1 |
0 |
pIdx->azColl[n] = pColl ? pColl->zName : sqlite3StrBINARY; |
136962
|
2 |
1 |
for(i=0; i
|
136963
|
1 |
1 |
if( extraCols & MASKBIT(i) ){ |
136969
|
0 |
1 |
if( pSrc->colUsed & MASKBIT(BMS-1) ){ |
136970
|
0 |
0 |
for(i=BMS-1; inCol; i++){ |
136990
|
0 |
1 |
if( pTabItem->fg.viaCoroutine ){ |
137000
|
0 |
1 |
if( pPartial ){ |
137011
|
0 |
1 |
if( pPartial ) sqlite3VdbeResolveLabel(v, iContinue); |
137012
|
0 |
1 |
if( pTabItem->fg.viaCoroutine ){ |
137062
|
201 |
120 |
for(i=nTerm=0, pTerm=pWC->a; inTerm; i++, pTerm++){ |
137063
|
73 |
128 |
if( pTerm->leftCursor != pSrc->iCursor ) continue; |
137064
|
0 |
128 |
if( pTerm->prereqRight & mUnusable ) continue; |
137070
|
0 |
128 |
if( (pTerm->eOperator & ~(WO_EQUIV))==0 ) continue; |
137081
|
21 |
99 |
if( pOrderBy ){ |
137083
|
21 |
21 |
for(i=0; i
|
137085
|
21 |
0 |
if( pExpr->op!=TK_COLUMN || pExpr->iTable!=pSrc->iCursor ) break; |
|
21 |
0 |
if( pExpr->op!=TK_COLUMN || pExpr->iTable!=pSrc->iCursor ) break; |
137087
|
21 |
0 |
if( i==n){ |
137097
|
0 |
120 |
if( pIdxInfo==0 ){ |
137120
|
201 |
120 |
for(i=j=0, pTerm=pWC->a; inTerm; i++, pTerm++){ |
137122
|
73 |
128 |
if( pTerm->leftCursor != pSrc->iCursor ) continue; |
137123
|
0 |
128 |
if( pTerm->prereqRight & mUnusable ) continue; |
137129
|
0 |
128 |
if( (pTerm->eOperator & ~(WO_EQUIV))==0 ) continue; |
137135
|
3 |
125 |
if( op==WO_IN ) op = WO_EQ; |
137136
|
72 |
56 |
if( op==WO_AUX ){ |
137138
|
3 |
53 |
}else if( op & (WO_ISNULL|WO_IS) ){ |
137139
|
2 |
1 |
if( op==WO_ISNULL ){ |
137156
|
32 |
21 |
if( op & (WO_LT|WO_LE|WO_GT|WO_GE) |
137157
|
0 |
32 |
&& sqlite3ExprIsVector(pTerm->pExpr->pRight) |
137159
|
0 |
0 |
if( i<16 ) mNoOmit |= (1 << i); |
137160
|
0 |
0 |
if( op==WO_LT ) pIdxCons[j].op = WO_LE; |
137161
|
0 |
0 |
if( op==WO_GT ) pIdxCons[j].op = WO_GE; |
137167
|
21 |
120 |
for(i=0; i
|
137199
|
0 |
120 |
if( rc!=SQLITE_OK ){ |
137200
|
0 |
0 |
if( rc==SQLITE_NOMEM ){ |
137202
|
0 |
0 |
}else if( !pVtab->zErrMsg ){ |
137434
|
84 |
50 |
if( pTerm ){ |
137435
|
0 |
84 |
if( pTerm->truthProb<=0 ){ |
137751
|
48 |
19 |
if( pLower && pLower->truthProb>0 && pUpper && pUpper->truthProb>0 ){ |
|
48 |
0 |
if( pLower && pLower->truthProb>0 && pUpper && pUpper->truthProb>0 ){ |
|
17 |
31 |
if( pLower && pLower->truthProb>0 && pUpper && pUpper->truthProb>0 ){ |
|
17 |
0 |
if( pLower && pLower->truthProb>0 && pUpper && pUpper->truthProb>0 ){ |
137756
|
0 |
67 |
if( nNew<10 ) nNew = 10; |
137757
|
67 |
0 |
if( nNew
|
137999
|
667 |
4041 |
if( p->wsFlags & (WHERE_VIRTUALTABLE|WHERE_AUTO_INDEX) ){ |
138000
|
240 |
427 |
if( (p->wsFlags & WHERE_VIRTUALTABLE)!=0 && p->u.vtab.needFree ){ |
|
0 |
240 |
if( (p->wsFlags & WHERE_VIRTUALTABLE)!=0 && p->u.vtab.needFree ){ |
138004
|
427 |
240 |
}else if( (p->wsFlags & WHERE_AUTO_INDEX)!=0 && p->u.btree.pIndex!=0 ){ |
|
1 |
426 |
}else if( (p->wsFlags & WHERE_AUTO_INDEX)!=0 && p->u.btree.pIndex!=0 ){ |
138016
|
14 |
3073 |
if( p->aLTerm!=p->aLTermSpace ) sqlite3DbFreeNN(db, p->aLTerm); |
138026
|
1827 |
14 |
if( p->nLSlot>=n ) return SQLITE_OK; |
138029
|
0 |
14 |
if( paNew==0 ) return SQLITE_NOMEM_BKPT; |
138031
|
0 |
14 |
if( p->aLTerm!=p->aLTermSpace ) sqlite3DbFreeNN(db, p->aLTerm); |
138042
|
0 |
1621 |
if( whereLoopResize(db, pTo, pFrom->nLTerm) ){ |
138048
|
120 |
1501 |
if( pFrom->wsFlags & WHERE_VIRTUALTABLE ){ |
138050
|
427 |
1074 |
}else if( (pFrom->wsFlags & WHERE_AUTO_INDEX)!=0 ){ |
138070
|
1621 |
2055 |
for(i=0; inLevel; i++){ |
138072
|
1621 |
0 |
if( pLevel->pWLoop && (pLevel->pWLoop->wsFlags & WHERE_IN_ABLE) ){ |
|
3 |
1618 |
if( pLevel->pWLoop && (pLevel->pWLoop->wsFlags & WHERE_IN_ABLE) ){ |
138077
|
1545 |
2055 |
while( pWInfo->pLoops ){ |
138108
|
65 |
66 |
if( pX->nLTerm-pX->nSkip >= pY->nLTerm-pY->nSkip ){ |
138111
|
0 |
66 |
if( pY->nSkip > pX->nSkip ) return 0; |
138112
|
66 |
0 |
if( pX->rRun >= pY->rRun ){ |
138113
|
65 |
1 |
if( pX->rRun > pY->rRun ) return 0; /* X costs more than Y */ |
138114
|
0 |
1 |
if( pX->nOut > pY->nOut ) return 0; /* X costs more than Y */ |
138116
|
1 |
1 |
for(i=pX->nLTerm-1; i>=0; i--){ |
138117
|
0 |
1 |
if( pX->aLTerm[i]==0 ) continue; |
138118
|
2 |
0 |
for(j=pY->nLTerm-1; j>=0; j--){ |
138119
|
1 |
1 |
if( pY->aLTerm[j]==pX->aLTerm[i] ) break; |
138121
|
0 |
1 |
if( j<0 ) return 0; /* X not a subset of Y since term X[i] not used by Y */ |
138123
|
1 |
0 |
if( (pX->wsFlags&WHERE_IDX_ONLY)!=0 |
138124
|
0 |
1 |
&& (pY->wsFlags&WHERE_IDX_ONLY)==0 ){ |
138145
|
1571 |
105 |
if( (pTemplate->wsFlags & WHERE_INDEXED)==0 ) return; |
138146
|
189 |
105 |
for(; p; p=p->pNextLoop){ |
138147
|
0 |
189 |
if( p->iTab!=pTemplate->iTab ) continue; |
138148
|
123 |
66 |
if( (p->wsFlags & WHERE_INDEXED)==0 ) continue; |
138149
|
1 |
65 |
if( whereLoopCheaperProperSubset(p, pTemplate) ){ |
138156
|
0 |
65 |
}else if( whereLoopCheaperProperSubset(pTemplate, p) ){ |
138186
|
673 |
1554 |
for(p=(*ppPrev); p; ppPrev=&p->pNextLoop, p=*ppPrev){ |
138187
|
661 |
12 |
if( p->iTab!=pTemplate->iTab || p->iSortIdx!=pTemplate->iSortIdx ){ |
|
340 |
321 |
if( p->iTab!=pTemplate->iTab || p->iSortIdx!=pTemplate->iSortIdx ){ |
138207
|
235 |
86 |
if( (p->wsFlags & WHERE_AUTO_INDEX)!=0 |
138208
|
235 |
0 |
&& (pTemplate->nSkip)==0 |
138209
|
9 |
226 |
&& (pTemplate->wsFlags & WHERE_INDEXED)!=0 |
138210
|
9 |
0 |
&& (pTemplate->wsFlags & WHERE_COLUMN_EQ)!=0 |
138211
|
9 |
0 |
&& (p->prereq & pTemplate->prereq)==pTemplate->prereq |
138221
|
310 |
2 |
if( (p->prereq & pTemplate->prereq)==p->prereq /* (1) */ |
138222
|
124 |
186 |
&& p->rSetup<=pTemplate->rSetup /* (2a) */ |
138223
|
56 |
68 |
&& p->rRun<=pTemplate->rRun /* (2b) */ |
138224
|
55 |
1 |
&& p->nOut<=pTemplate->nOut /* (2c) */ |
138234
|
255 |
2 |
if( (p->prereq & pTemplate->prereq)==pTemplate->prereq /* (1) */ |
138235
|
67 |
188 |
&& p->rRun>=pTemplate->rRun /* (2a) */ |
138236
|
67 |
0 |
&& p->nOut>=pTemplate->nOut /* (2b) */ |
138278
|
24 |
1676 |
if( pBuilder->pOrSet!=0 ){ |
138279
|
16 |
8 |
if( pTemplate->nLTerm ){ |
138301
|
55 |
1621 |
if( ppPrev==0 ){ |
138331
|
1554 |
67 |
if( p==0 ){ |
138334
|
0 |
1554 |
if( p==0 ) return SQLITE_NOMEM_BKPT; |
138343
|
9 |
67 |
while( *ppTail ){ |
138345
|
0 |
9 |
if( ppTail==0 ) break; |
138347
|
0 |
9 |
if( pToDel==0 ) break; |
138359
|
1501 |
120 |
if( (p->wsFlags & WHERE_VIRTUALTABLE)==0 ){ |
138361
|
1072 |
429 |
if( pIndex && pIndex->tnum==0 ){ |
|
984 |
88 |
if( pIndex && pIndex->tnum==0 ){ |
138408
|
1234 |
932 |
for(i=pWC->nTerm, pTerm=pWC->a; i>0; i--, pTerm++){ |
138409
|
180 |
1054 |
if( (pTerm->wtFlags & TERM_VIRTUAL)!=0 ) break; |
138410
|
40 |
1014 |
if( (pTerm->prereqAll & pLoop->maskSelf)==0 ) continue; |
138411
|
6 |
1008 |
if( (pTerm->prereqAll & notAllowed)!=0 ) continue; |
138412
|
192 |
900 |
for(j=pLoop->nLTerm-1; j>=0; j--){ |
138414
|
0 |
192 |
if( pX==0 ) continue; |
138415
|
57 |
135 |
if( pX==pTerm ) break; |
138416
|
51 |
84 |
if( pX->iParent>=0 && (&pWC->a[pX->iParent])==pTerm ) break; |
|
51 |
0 |
if( pX->iParent>=0 && (&pWC->a[pX->iParent])==pTerm ) break; |
138418
|
900 |
108 |
if( j<0 ){ |
138419
|
0 |
900 |
if( pTerm->truthProb<=0 ){ |
138427
|
486 |
414 |
if( pTerm->eOperator&(WO_EQ|WO_IS) ){ |
138430
|
37 |
449 |
if( sqlite3ExprIsInteger(pRight, &k) && k>=(-1) && k<=1 ){ |
|
37 |
0 |
if( sqlite3ExprIsInteger(pRight, &k) && k>=(-1) && k<=1 ){ |
|
31 |
6 |
if( sqlite3ExprIsInteger(pRight, &k) && k>=(-1) && k<=1 ){ |
138435
|
440 |
46 |
if( iReduce
|
138440
|
434 |
678 |
if( pLoop->nOut > nRow-iReduce ) pLoop->nOut = nRow - iReduce; |
138471
|
0 |
67 |
for(i=1; i
|
138479
|
0 |
0 |
if( pRhs->flags & EP_xIsSelect ){ |
138489
|
0 |
0 |
if( pLhs->op!=TK_COLUMN |
138490
|
0 |
0 |
|| pLhs->iTable!=iCur |
138491
|
0 |
0 |
|| pLhs->iColumn!=pIdx->aiColumn[i+nEq] |
138492
|
0 |
0 |
|| pIdx->aSortOrder[i+nEq]!=pIdx->aSortOrder[nEq] |
138500
|
0 |
0 |
if( aff!=idxaff ) break; |
138503
|
0 |
0 |
if( pColl==0 ) break; |
138504
|
0 |
0 |
if( sqlite3StrICmp(pColl->zName, pIdx->azColl[i+nEq]) ) break; |
138558
|
0 |
1116 |
if( db->mallocFailed ) return SQLITE_NOMEM_BKPT; |
138564
|
31 |
1085 |
if( pNew->wsFlags & WHERE_BTM_LIMIT ){ |
138570
|
0 |
1116 |
if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE); |
138587
|
1215 |
0 |
for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){ |
|
99 |
1116 |
for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){ |
138595
|
5 |
94 |
if( (eOp==WO_ISNULL || (pTerm->wtFlags&TERM_VNULL)!=0) |
138596
|
0 |
5 |
&& indexColumnNotNull(pProbe, saved_nEq) |
138600
|
0 |
99 |
if( pTerm->prereqRight & pNew->maskSelf ) continue; |
138604
|
0 |
99 |
if( pTerm->wtFlags & TERM_LIKEOPT && pTerm->eOperator==WO_LT ) continue; |
|
0 |
0 |
if( pTerm->wtFlags & TERM_LIKEOPT && pTerm->eOperator==WO_LT ) continue; |
138609
|
0 |
99 |
if( (pSrc->fg.jointype & JT_LEFT)!=0 |
138610
|
0 |
0 |
&& !ExprHasProperty(pTerm->pExpr, EP_FromJoin) |
138615
|
83 |
16 |
if( IsUniqueIndex(pProbe) && saved_nEq==pProbe->nKeyCol-1 ){ |
|
11 |
72 |
if( IsUniqueIndex(pProbe) && saved_nEq==pProbe->nKeyCol-1 ){ |
138625
|
0 |
99 |
if( whereLoopResize(db, pNew, pNew->nLTerm+1) ) break; /* OOM */ |
138635
|
0 |
99 |
if( eOp & WO_IN ){ |
138638
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
138648
|
0 |
0 |
for(i=0; inLTerm-1; i++){ |
138649
|
0 |
0 |
if( pNew->aLTerm[i] && pNew->aLTerm[i]->pExpr==pExpr ) nIn = 0; |
|
0 |
0 |
if( pNew->aLTerm[i] && pNew->aLTerm[i]->pExpr==pExpr ) nIn = 0; |
138651
|
0 |
0 |
}else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){ |
|
0 |
0 |
}else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){ |
138657
|
27 |
72 |
}else if( eOp & (WO_EQ|WO_IS) ){ |
138661
|
25 |
2 |
if( iCol==XN_ROWID |
138662
|
25 |
0 |
|| (iCol>=0 && nInMul==0 && saved_nEq==pProbe->nKeyCol-1) |
|
25 |
0 |
|| (iCol>=0 && nInMul==0 && saved_nEq==pProbe->nKeyCol-1) |
|
4 |
21 |
|| (iCol>=0 && nInMul==0 && saved_nEq==pProbe->nKeyCol-1) |
138664
|
4 |
2 |
if( iCol==XN_ROWID || pProbe->uniqNotNull |
|
3 |
1 |
if( iCol==XN_ROWID || pProbe->uniqNotNull |
138665
|
3 |
0 |
|| (pProbe->nKeyCol==1 && pProbe->onError && eOp==WO_EQ) |
|
0 |
3 |
|| (pProbe->nKeyCol==1 && pProbe->onError && eOp==WO_EQ) |
|
0 |
0 |
|| (pProbe->nKeyCol==1 && pProbe->onError && eOp==WO_EQ) |
138672
|
5 |
67 |
}else if( eOp & WO_ISNULL ){ |
138674
|
31 |
36 |
}else if( eOp & (WO_GT|WO_GE) ){ |
138683
|
0 |
31 |
if( pTerm->wtFlags & TERM_LIKEOPT ){ |
138690
|
0 |
0 |
if( whereLoopResize(db, pNew, pNew->nLTerm+1) ) break; /* OOM */ |
138705
|
17 |
19 |
pNew->aLTerm[pNew->nLTerm-2] : 0; |
138714
|
67 |
32 |
if( pNew->wsFlags & WHERE_COLUMN_RANGE ){ |
138723
|
0 |
32 |
if( pTerm->truthProb<=0 && pProbe->aiColumn[saved_nEq]>=0 ){ |
|
0 |
0 |
if( pTerm->truthProb<=0 && pProbe->aiColumn[saved_nEq]>=0 ){ |
138757
|
5 |
27 |
if( eOp & WO_ISNULL ){ |
138773
|
51 |
48 |
if( (pNew->wsFlags & (WHERE_IDX_ONLY|WHERE_IPK))==0 ){ |
138784
|
67 |
32 |
if( pNew->wsFlags & WHERE_COLUMN_RANGE ){ |
138790
|
63 |
36 |
if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 |
138791
|
61 |
2 |
&& pNew->u.btree.nEqnColumn |
138820
|
1080 |
36 |
if( saved_nEq==saved_nSkip |
138821
|
52 |
1028 |
&& saved_nEq+1nKeyCol |
138822
|
52 |
0 |
&& pProbe->noSkipScan==0 |
138823
|
0 |
52 |
&& pProbe->aiRowLogEst[saved_nEq+1]>=42 /* TUNING: Minimum for skip-scan */ |
138824
|
0 |
0 |
&& (rc = whereLoopResize(db, pNew, pNew->nLTerm+1))==SQLITE_OK |
138865
|
0 |
1055 |
if( pIndex->bUnordered ) return 0; |
138866
|
466 |
589 |
if( (pOB = pBuilder->pWInfo->pOrderBy)==0 ) return 0; |
138867
|
643 |
107 |
for(ii=0; iinExpr; ii++){ |
138869
|
643 |
0 |
if( pExpr->op==TK_COLUMN && pExpr->iTable==iCursor ){ |
|
638 |
5 |
if( pExpr->op==TK_COLUMN && pExpr->iTable==iCursor ){ |
138870
|
457 |
181 |
if( pExpr->iColumn<0 ) return 1; |
138871
|
189 |
156 |
for(jj=0; jjnKeyCol; jj++){ |
138872
|
25 |
164 |
if( pExpr->iColumn==pIndex->aiColumn[jj] ) return 1; |
138874
|
0 |
5 |
}else if( (aColExpr = pIndex->aColExpr)!=0 ){ |
138875
|
0 |
0 |
for(jj=0; jjnKeyCol; jj++){ |
138876
|
0 |
0 |
if( pIndex->aiColumn[jj]!=XN_EXPR ) continue; |
138877
|
0 |
0 |
if( sqlite3ExprCompareSkip(pExpr,aColExpr->a[jj].pExpr,iCursor)==0 ){ |
138893
|
157 |
59 |
for(j=pIdx->nColumn-1; j>=0; j--){ |
138895
|
98 |
59 |
if( x>=0 ){ |
138898
|
98 |
0 |
if( x
|
138911
|
0 |
0 |
while( pWhere->op==TK_AND ){ |
138912
|
0 |
0 |
if( !whereUsablePartialIndex(iTab,pWC,pWhere->pLeft) ) return 0; |
138915
|
0 |
0 |
if( pParse->db->flags & SQLITE_EnableQPSG ) pParse = 0; |
138916
|
0 |
0 |
for(i=0, pTerm=pWC->a; inTerm; i++, pTerm++){ |
138918
|
0 |
0 |
if( (!ExprHasProperty(pExpr, EP_FromJoin) || pExpr->iRightJoinTable==iTab) |
|
0 |
0 |
if( (!ExprHasProperty(pExpr, EP_FromJoin) || pExpr->iRightJoinTable==iTab) |
138919
|
0 |
0 |
&& sqlite3ExprImpliesExpr(pParse, pExpr, pWhere, iTab) |
138991
|
0 |
987 |
if( pSrc->pIBIndex ){ |
138994
|
0 |
987 |
}else if( !HasRowid(pTab) ){ |
139013
|
987 |
0 |
if( pSrc->fg.notIndexed==0 ){ |
139025
|
979 |
8 |
if( !pBuilder->pOrSet /* Not part of an OR optimization */ |
139026
|
974 |
5 |
&& (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0 |
139027
|
974 |
0 |
&& (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0 |
139028
|
974 |
0 |
&& pSrc->pIBIndex==0 /* Has no INDEXED BY clause */ |
139029
|
974 |
0 |
&& !pSrc->fg.notIndexed /* Has no NOT INDEXED clause */ |
139030
|
974 |
0 |
&& HasRowid(pTab) /* Not WITHOUT ROWID table. (FIXME: Why not?) */ |
139031
|
974 |
0 |
&& !pSrc->fg.isCorrelated /* Not a correlated subquery */ |
139032
|
974 |
0 |
&& !pSrc->fg.isRecursive /* Not a recursive common table expression. */ |
139037
|
2019 |
0 |
for(pTerm=pWC->a; rc==SQLITE_OK && pTerm
|
|
1045 |
974 |
for(pTerm=pWC->a; rc==SQLITE_OK && pTerm
|
139038
|
10 |
1035 |
if( pTerm->prereqRight & pNew->maskSelf ) continue; |
139039
|
465 |
570 |
if( termCanDriveIndex(pTerm, pSrc, 0) ){ |
139054
|
465 |
0 |
if( pTab->pSelect==0 && (pTab->tabFlags & TF_Ephemeral)==0 ){ |
|
464 |
1 |
if( pTab->pSelect==0 && (pTab->tabFlags & TF_Ephemeral)==0 ){ |
139060
|
0 |
465 |
if( pNew->rSetup<0 ) pNew->rSetup = 0; |
139077
|
2042 |
0 |
for(; rc==SQLITE_OK && pProbe; |
|
1055 |
987 |
for(; rc==SQLITE_OK && pProbe; |
139078
|
1055 |
0 |
pProbe=(pSrc->pIBIndex ? 0 : pProbe->pNext), iSortIdx++ |
139080
|
0 |
1055 |
if( pProbe->pPartIdxWhere!=0 |
139081
|
0 |
0 |
&& !whereUsablePartialIndex(pSrc->iCursor, pWC, pProbe->pPartIdxWhere) ){ |
139085
|
0 |
1055 |
if( pProbe->bNoQuery ) continue; |
139100
|
987 |
68 |
if( pProbe->tnum<=0 ){ |
139105
|
456 |
531 |
pNew->iSortIdx = b ? iSortIdx : 0; |
139112
|
0 |
987 |
if( rc ) break; |
139115
|
14 |
54 |
if( pProbe->isCovering ){ |
139120
|
18 |
36 |
pNew->wsFlags = (m==0) ? (WHERE_IDX_ONLY|WHERE_INDEXED) : WHERE_INDEXED; |
139124
|
42 |
26 |
if( b |
139125
|
42 |
0 |
|| !HasRowid(pTab) |
139126
|
42 |
0 |
|| pProbe->pPartIdxWhere!=0 |
139127
|
23 |
19 |
|| ( m==0 |
139128
|
23 |
0 |
&& pProbe->bUnordered==0 |
139129
|
9 |
14 |
&& (pProbe->szIdxRowszTabRow) |
139130
|
0 |
9 |
&& (pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0 |
139131
|
0 |
0 |
&& sqlite3GlobalConfig.bUseCis |
139132
|
0 |
0 |
&& OptimizationEnabled(pWInfo->pParse->db, SQLITE_CoverIdxScan) |
139135
|
26 |
0 |
pNew->iSortIdx = b ? iSortIdx : 0; |
139141
|
17 |
9 |
if( m!=0 ){ |
139151
|
51 |
17 |
for(ii=0; iinTerm; ii++){ |
139153
|
0 |
51 |
if( !sqlite3ExprCoveredByIndex(pTerm->pExpr, iCur, pProbe) ){ |
139158
|
0 |
51 |
if( pTerm->truthProb<=0 ){ |
139162
|
0 |
51 |
if( pTerm->eOperator & (WO_EQ|WO_IS) ) nLookup -= 19; |
139172
|
0 |
26 |
if( rc ) break; |
139178
|
43 |
1012 |
if( pBuilder->bldFlags==SQLITE_BLDF_INDEXED ){ |
139243
|
128 |
120 |
for(i=0; i
|
139246
|
128 |
0 |
if( (pTerm->prereqRight & mUsable)==pTerm->prereqRight |
139247
|
128 |
0 |
&& (pTerm->eOperator & mExclude)==0 |
139266
|
0 |
120 |
if( rc ) return rc; |
139270
|
128 |
120 |
for(i=0; iaLTerm[i] = 0; |
139273
|
128 |
120 |
for(i=0; i
|
139275
|
125 |
3 |
if( (iTerm = pUsage[i].argvIndex - 1)>=0 ){ |
139278
|
125 |
0 |
if( iTerm>=nConstraint |
139279
|
125 |
0 |
|| j<0 |
139280
|
125 |
0 |
|| j>=pWC->nTerm |
139281
|
125 |
0 |
|| pNew->aLTerm[iTerm]!=0 |
139282
|
0 |
125 |
|| pIdxCons->usable==0 |
139295
|
125 |
0 |
if( iTerm>mxTerm ) mxTerm = iTerm; |
139298
|
125 |
0 |
if( iTerm<16 && pUsage[i].omit ) pNew->u.vtab.omitMask |= 1<
|
|
125 |
0 |
if( iTerm<16 && pUsage[i].omit ) pNew->u.vtab.omitMask |= 1<
|
139299
|
3 |
122 |
if( (pTerm->eOperator & WO_IN)!=0 ){ |
139314
|
125 |
120 |
for(i=0; i<=mxTerm; i++){ |
139315
|
0 |
125 |
if( pNew->aLTerm[i]==0 ){ |
139328
|
0 |
120 |
pNew->u.vtab.isOrdered = (i8)(pIdxInfo->orderByConsumed ? |
139336
|
2 |
118 |
if( pIdxInfo->idxFlags & SQLITE_INDEX_SCAN_UNIQUE ){ |
139342
|
0 |
120 |
if( pNew->u.vtab.needFree ){ |
139363
|
0 |
0 |
if( iCons>=0 && iConsnConstraint ){ |
|
0 |
0 |
if( iCons>=0 && iConsnConstraint ){ |
139367
|
0 |
0 |
if( pX->pLeft ){ |
139370
|
0 |
0 |
zRet = (pC ? pC->zName : "BINARY"); |
139426
|
0 |
120 |
if( p==0 ) return SQLITE_NOMEM_BKPT; |
139432
|
0 |
120 |
if( whereLoopResize(pParse->db, pNew, nConstraint) ){ |
139447
|
120 |
0 |
if( rc==SQLITE_OK && (mBest = (pNew->prereq & ~mPrereq))!=0 ){ |
|
0 |
120 |
if( rc==SQLITE_OK && (mBest = (pNew->prereq & ~mPrereq))!=0 ){ |
139455
|
0 |
0 |
if( bIn ){ |
139461
|
0 |
0 |
if( mBestNoIn==0 ){ |
139469
|
0 |
0 |
while( rc==SQLITE_OK ){ |
139473
|
0 |
0 |
for(i=0; i
|
139477
|
0 |
0 |
if( mThis>mPrev && mThis
|
|
0 |
0 |
if( mThis>mPrev && mThis
|
139480
|
0 |
0 |
if( mNext==ALLBITS ) break; |
139481
|
0 |
0 |
if( mNext==mBest || mNext==mBestNoIn ) continue; |
|
0 |
0 |
if( mNext==mBest || mNext==mBestNoIn ) continue; |
139486
|
0 |
0 |
if( pNew->prereq==mPrereq ){ |
139488
|
0 |
0 |
if( bIn==0 ) seenZeroNoIN = 1; |
139495
|
0 |
0 |
if( rc==SQLITE_OK && seenZero==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && seenZero==0 ){ |
139499
|
0 |
0 |
if( bIn==0 ) seenZeroNoIN = 1; |
139505
|
0 |
0 |
if( rc==SQLITE_OK && seenZeroNoIN==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && seenZeroNoIN==0 ){ |
139512
|
0 |
120 |
if( p->needToFreeIdxStr ) sqlite3_free(p->idxStr); |
139546
|
1280 |
1107 |
for(pTerm=pWC->a; pTerm
|
|
1280 |
0 |
for(pTerm=pWC->a; pTerm
|
139547
|
4 |
1276 |
if( (pTerm->eOperator & WO_OR)!=0 |
139548
|
4 |
0 |
&& (pTerm->u.pOrInfo->indexable & pNew->maskSelf)!=0 |
139561
|
10 |
3 |
for(pOrTerm=pOrWC->a; pOrTerm
|
139562
|
6 |
4 |
if( (pOrTerm->eOperator & WO_AND)!=0 ){ |
139564
|
2 |
2 |
}else if( pOrTerm->leftCursor==iCur ){ |
139583
|
0 |
8 |
if( IsVirtual(pItem->pTab) ){ |
139590
|
8 |
0 |
if( rc==SQLITE_OK ){ |
139594
|
1 |
7 |
if( sCur.n==0 ){ |
139597
|
3 |
4 |
}else if( once ){ |
139604
|
4 |
4 |
for(i=0; i
|
139605
|
4 |
4 |
for(j=0; j
|
139619
|
7 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
3 |
4 |
for(i=0; rc==SQLITE_OK && i
|
139662
|
1099 |
1533 |
for(iTab=0, pItem=pTabList->a; pItem
|
139666
|
0 |
1099 |
if( ((pItem->fg.jointype|priorJointype) & (JT_LEFT|JT_CROSS))!=0 ){ |
139673
|
120 |
979 |
if( IsVirtual(pItem->pTab) ){ |
139675
|
0 |
120 |
for(p=&pItem[1]; p
|
139676
|
0 |
0 |
if( mUnusable || (p->fg.jointype & (JT_LEFT|JT_CROSS)) ){ |
|
0 |
0 |
if( mUnusable || (p->fg.jointype & (JT_LEFT|JT_CROSS)) ){ |
139686
|
1099 |
0 |
if( rc==SQLITE_OK ){ |
139690
|
1099 |
0 |
if( rc || db->mallocFailed ) break; |
|
1099 |
0 |
if( rc || db->mallocFailed ) break; |
139771
|
2 |
1284 |
if( nLoop && OptimizationDisabled(db, SQLITE_OrderByIdxJoin) ) return 0; |
|
0 |
2 |
if( nLoop && OptimizationDisabled(db, SQLITE_OrderByIdxJoin) ) return 0; |
139775
|
0 |
1286 |
if( nOrderBy>BMS-1 ) return 0; /* Cannot optimize overly large ORDER BYs */ |
139781
|
676 |
610 |
if( wctrlFlags & WHERE_ORDERBY_LIMIT ) eqOpMask |= WO_IN; |
139782
|
2198 |
311 |
for(iLoop=0; isOrderDistinct && obSat
|
|
1288 |
910 |
for(iLoop=0; isOrderDistinct && obSat
|
|
1288 |
0 |
for(iLoop=0; isOrderDistinct && obSat
|
139783
|
2 |
1286 |
if( iLoop>0 ) ready |= pLoop->maskSelf; |
139784
|
2 |
1286 |
if( iLoop
|
139786
|
2 |
0 |
if( wctrlFlags & WHERE_ORDERBY_LIMIT ) continue; |
139790
|
63 |
1223 |
if( pLoop->wsFlags & WHERE_VIRTUALTABLE ){ |
139791
|
0 |
63 |
if( pLoop->u.vtab.isOrdered ) obSat = obDone; |
139803
|
1375 |
1223 |
for(i=0; i
|
139804
|
0 |
1375 |
if( MASKBIT(i) & obSat ) continue; |
139806
|
0 |
1375 |
if( pOBExpr->op!=TK_COLUMN ) continue; |
139807
|
7 |
1368 |
if( pOBExpr->iTable!=iCur ) continue; |
139810
|
1362 |
6 |
if( pTerm==0 ) continue; |
139811
|
0 |
6 |
if( pTerm->eOperator==WO_IN ){ |
139816
|
0 |
0 |
for(j=0; jnLTerm && pTerm!=pLoop->aLTerm[j]; j++){} |
|
0 |
0 |
for(j=0; jnLTerm && pTerm!=pLoop->aLTerm[j]; j++){} |
139817
|
0 |
0 |
if( j>=pLoop->nLTerm ) continue; |
139819
|
6 |
0 |
if( (pTerm->eOperator&(WO_EQ|WO_IS))!=0 && pOBExpr->iColumn>=0 ){ |
|
6 |
0 |
if( (pTerm->eOperator&(WO_EQ|WO_IS))!=0 && pOBExpr->iColumn>=0 ){ |
139820
|
0 |
6 |
if( sqlite3ExprCollSeqMatch(pWInfo->pParse, |
139829
|
1223 |
0 |
if( (pLoop->wsFlags & WHERE_ONEROW)==0 ){ |
139830
|
1170 |
53 |
if( pLoop->wsFlags & WHERE_IPK ){ |
139834
|
51 |
2 |
}else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered ){ |
|
0 |
51 |
}else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered ){ |
139850
|
1287 |
910 |
for(j=0; j
|
139856
|
16 |
1271 |
if( ju.btree.nEq && j>=pLoop->nSkip ){ |
|
16 |
0 |
if( ju.btree.nEq && j>=pLoop->nSkip ){ |
139867
|
16 |
0 |
if( (eOp & eqOpMask)!=0 ){ |
139868
|
0 |
16 |
if( eOp & WO_ISNULL ){ |
139873
|
0 |
0 |
}else if( ALWAYS(eOp & WO_IN) ){ |
139879
|
0 |
0 |
for(i=j+1; iu.btree.nEq; i++){ |
139880
|
0 |
0 |
if( pLoop->aLTerm[i]->pExpr==pX ){ |
139892
|
101 |
1170 |
if( pIndex ){ |
139895
|
16 |
85 |
if( iColumn==pIndex->pTable->iPKey ) iColumn = XN_ROWID; |
139904
|
1220 |
51 |
if( isOrderDistinct |
139905
|
50 |
1170 |
&& iColumn>=0 |
139906
|
50 |
0 |
&& j>=pLoop->u.btree.nEq |
139907
|
50 |
0 |
&& pIndex->pTable->aCol[iColumn].notNull==0 |
139916
|
1347 |
241 |
for(i=0; bOnce && i
|
|
1311 |
36 |
for(i=0; bOnce && i
|
139917
|
56 |
1255 |
if( MASKBIT(i) & obSat ) continue; |
139921
|
1233 |
22 |
if( (wctrlFlags & (WHERE_GROUPBY|WHERE_DISTINCTBY))==0 ) bOnce = 0; |
139922
|
1255 |
0 |
if( iColumn>=XN_ROWID ){ |
139923
|
0 |
1255 |
if( pOBExpr->op!=TK_COLUMN ) continue; |
139924
|
5 |
1250 |
if( pOBExpr->iTable!=iCur ) continue; |
139925
|
256 |
994 |
if( pOBExpr->iColumn!=iColumn ) continue; |
139928
|
0 |
0 |
if( sqlite3ExprCompareSkip(pOBExpr, pIdxExpr, iCur) ){ |
139932
|
84 |
910 |
if( iColumn!=XN_ROWID ){ |
139934
|
0 |
84 |
if( sqlite3StrICmp(pColl->zName, pIndex->azColl[j])!=0 ) continue; |
139940
|
994 |
277 |
if( isMatch && (wctrlFlags & WHERE_GROUPBY)==0 ){ |
|
994 |
0 |
if( isMatch && (wctrlFlags & WHERE_GROUPBY)==0 ){ |
139943
|
34 |
960 |
if( revSet ){ |
139944
|
34 |
0 |
if( (rev ^ revIdx)!=pOrderBy->a[i].sortOrder ) isMatch = 0; |
139947
|
66 |
894 |
if( rev ) *pRevMask |= MASKBIT(iLoop); |
139951
|
960 |
311 |
if( isMatch ){ |
139952
|
910 |
50 |
if( iColumn==XN_ROWID ){ |
139959
|
50 |
261 |
if( j==0 || j
|
|
34 |
16 |
if( j==0 || j
|
139966
|
910 |
311 |
if( distinctColumns ){ |
139973
|
910 |
311 |
if( isOrderDistinct ){ |
139975
|
912 |
910 |
for(i=0; i
|
139978
|
910 |
2 |
if( MASKBIT(i) & obSat ) continue; |
139981
|
0 |
2 |
if( mTerm==0 && !sqlite3ExprIsConstant(p) ) continue; |
|
0 |
0 |
if( mTerm==0 && !sqlite3ExprIsConstant(p) ) continue; |
139982
|
2 |
0 |
if( (mTerm&~orderDistinctMask)==0 ){ |
139988
|
930 |
354 |
if( obSat==obDone ) return (i8)nOrderBy; |
139989
|
291 |
63 |
if( !isOrderDistinct ){ |
139990
|
150 |
255 |
for(i=nOrderBy-1; i>0; i--){ |
139992
|
36 |
114 |
if( (obSat&m)==m ) return i; |
140072
|
0 |
122 |
if( (pWInfo->wctrlFlags & WHERE_USE_LIMIT)!=0 && pWInfo->iLimit
|
|
0 |
0 |
if( (pWInfo->wctrlFlags & WHERE_USE_LIMIT)!=0 && pWInfo->iLimit
|
140119
|
6 |
2108 |
mxChoice = (nLoop<=1) ? 1 : (nLoop==2 ? 5 : 10); |
|
6 |
0 |
mxChoice = (nLoop<=1) ? 1 : (nLoop==2 ? 5 : 10); |
140128
|
1162 |
952 |
if( pWInfo->pOrderBy==0 || nRowEst==0 ){ |
|
581 |
581 |
if( pWInfo->pOrderBy==0 || nRowEst==0 ){ |
140138
|
0 |
2114 |
if( pSpace==0 ) return SQLITE_NOMEM_BKPT; |
140143
|
4276 |
2114 |
for(ii=mxChoice*2, pFrom=aTo; ii>0; ii--, pFrom++, pX += nLoop){ |
140146
|
581 |
1533 |
if( nOrderBy ){ |
140167
|
581 |
1533 |
if( nOrderBy ){ |
140174
|
0 |
581 |
aFrom[0].isOrdered = nLoop>0 ? -1 : nOrderBy; |
140180
|
1683 |
2114 |
for(iLoop=0; iLoop
|
140182
|
1689 |
1683 |
for(ii=0, pFrom=aFrom; ii
|
140183
|
2459 |
1689 |
for(pWLoop=pWInfo->pLoops; pWLoop; pWLoop=pWLoop->pNextLoop){ |
140191
|
16 |
2443 |
if( (pWLoop->prereq & ~pFrom->maskLoop)!=0 ) continue; |
140192
|
16 |
2427 |
if( (pWLoop->maskSelf & pFrom->maskLoop)!=0 ) continue; |
140193
|
676 |
1751 |
if( (pWLoop->wsFlags & WHERE_AUTO_INDEX)!=0 && pFrom->nRow<3 ){ |
|
668 |
8 |
if( (pWLoop->wsFlags & WHERE_AUTO_INDEX)!=0 && pFrom->nRow<3 ){ |
140208
|
610 |
1149 |
if( isOrdered<0 ){ |
140215
|
1738 |
21 |
if( isOrdered>=0 && isOrdered
|
|
131 |
1607 |
if( isOrdered>=0 && isOrdered
|
140216
|
122 |
9 |
if( aSortCost[isOrdered]==0 ){ |
140243
|
76 |
1689 |
for(jj=0, pTo=aTo; jj
|
140244
|
70 |
6 |
if( pTo->maskLoop==maskNew |
140245
|
70 |
0 |
&& ((pTo->isOrdered^isOrdered)&0x80)==0 |
140251
|
1689 |
70 |
if( jj>=nTo ){ |
140253
|
0 |
1689 |
if( nTo>=mxChoice |
140254
|
0 |
0 |
&& (rCost>mxCost || (rCost==mxCost && rUnsorted>=mxUnsorted)) |
|
0 |
0 |
&& (rCost>mxCost || (rCost==mxCost && rUnsorted>=mxUnsorted)) |
|
0 |
0 |
&& (rCost>mxCost || (rCost==mxCost && rUnsorted>=mxUnsorted)) |
140270
|
1689 |
0 |
if( nTo
|
140294
|
57 |
13 |
if( pTo->rCost
|
140295
|
3 |
54 |
|| (pTo->rCost==rCost |
140296
|
3 |
0 |
&& (pTo->nRow
|
140297
|
3 |
0 |
|| (pTo->nRow==nOut && pTo->rUnsorted<=rUnsorted) |
|
3 |
0 |
|| (pTo->nRow==nOut && pTo->rUnsorted<=rUnsorted) |
140340
|
1721 |
22 |
if( nTo>=mxChoice ){ |
140344
|
0 |
1721 |
for(jj=1, pTo=&aTo[1]; jj
|
140345
|
0 |
0 |
if( pTo->rCost>mxCost |
140346
|
0 |
0 |
|| (pTo->rCost==mxCost && pTo->rUnsorted>mxUnsorted) |
|
0 |
0 |
|| (pTo->rCost==mxCost && pTo->rUnsorted>mxUnsorted) |
140380
|
0 |
2114 |
if( nFrom==0 ){ |
140388
|
0 |
2114 |
for(ii=1; ii
|
140389
|
0 |
0 |
if( pFrom->rCost>aFrom[ii].rCost ) pFrom = &aFrom[ii]; |
140393
|
1683 |
2114 |
for(iLoop=0; iLoop
|
140399
|
4 |
2110 |
if( (pWInfo->wctrlFlags & WHERE_WANT_DISTINCT)!=0 |
140400
|
0 |
4 |
&& (pWInfo->wctrlFlags & WHERE_DISTINCTBY)==0 |
140401
|
0 |
0 |
&& pWInfo->eDistinct==WHERE_DISTINCT_NOOP |
140402
|
0 |
0 |
&& nRowEst |
140407
|
0 |
0 |
if( rc==pWInfo->pResultSet->nExpr ){ |
140411
|
1162 |
952 |
if( pWInfo->pOrderBy ){ |
140412
|
4 |
1158 |
if( pWInfo->wctrlFlags & WHERE_DISTINCTBY ){ |
140413
|
0 |
4 |
if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){ |
140419
|
676 |
482 |
if( pWInfo->nOBSat<=0 ){ |
140421
|
676 |
0 |
if( nLoop>0 ){ |
140423
|
676 |
0 |
if( (wsFlags & WHERE_ONEROW)==0 |
140424
|
676 |
0 |
&& (wsFlags&(WHERE_IPK|WHERE_COLUMN_IN))!=(WHERE_IPK|WHERE_COLUMN_IN) |
140431
|
464 |
212 |
if( rc==pWInfo->pOrderBy->nExpr ){ |
140439
|
0 |
1162 |
if( (pWInfo->wctrlFlags & WHERE_SORTBYGROUP) |
140440
|
0 |
0 |
&& pWInfo->nOBSat==pWInfo->pOrderBy->nExpr && nLoop>0 |
|
0 |
0 |
&& pWInfo->nOBSat==pWInfo->pOrderBy->nExpr && nLoop>0 |
140447
|
0 |
0 |
if( nOrder==pWInfo->pOrderBy->nExpr ){ |
140485
|
5 |
1610 |
if( pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE ) return 0; |
140489
|
120 |
1490 |
if( IsVirtual(pTab) ) return 0; |
140490
|
0 |
1490 |
if( pItem->fg.isIndexedBy ) return 0; |
140497
|
517 |
973 |
if( pTerm ){ |
140506
|
61 |
968 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
140509
|
59 |
2 |
if( !IsUniqueIndex(pIdx) |
140510
|
59 |
0 |
|| pIdx->pPartIdxWhere!=0 |
140511
|
1 |
58 |
|| pIdx->nKeyCol>ArraySize(pLoop->aLTermSpace) |
140513
|
8 |
50 |
opMask = pIdx->uniqNotNull ? (WO_EQ|WO_IS) : WO_EQ; |
140514
|
74 |
5 |
for(j=0; jnKeyCol; j++){ |
140516
|
53 |
21 |
if( pTerm==0 ) break; |
140520
|
53 |
5 |
if( j!=pIdx->nKeyCol ) continue; |
140522
|
5 |
0 |
if( pIdx->isCovering || (pItem->colUsed & ~columnsInIndex(pIdx))==0 ){ |
|
0 |
5 |
if( pIdx->isCovering || (pItem->colUsed & ~columnsInIndex(pIdx))==0 ){ |
140533
|
522 |
968 |
if( pLoop->wsFlags ){ |
140540
|
0 |
522 |
if( pWInfo->pOrderBy ) pWInfo->nOBSat = pWInfo->pOrderBy->nExpr; |
140541
|
0 |
522 |
if( pWInfo->wctrlFlags & WHERE_WANT_DISTINCT ){ |
140556
|
9 |
32 |
if( pExpr->op==TK_FUNCTION && ExprHasProperty(pExpr, EP_ConstFunc)==0 ){ |
|
0 |
9 |
if( pExpr->op==TK_FUNCTION && ExprHasProperty(pExpr, EP_ConstFunc)==0 ){ |
140705
|
579 |
1476 |
if( pOrderBy && pOrderBy->nExpr>=BMS ) pOrderBy = 0; |
|
0 |
579 |
if( pOrderBy && pOrderBy->nExpr>=BMS ) pOrderBy = 0; |
140710
|
0 |
2055 |
if( OptimizationDisabled(db, SQLITE_DistinctOpt) ){ |
140718
|
0 |
2055 |
if( pTabList->nSrc>BMS ){ |
140728
|
2050 |
5 |
nTabList = (wctrlFlags & WHERE_OR_SUBCLAUSE) ? 1 : pTabList->nSrc; |
140739
|
0 |
2055 |
if( db->mallocFailed ){ |
140778
|
437 |
1618 |
if( nTabList==0 ){ |
140779
|
0 |
437 |
if( pOrderBy ) pWInfo->nOBSat = pOrderBy->nExpr; |
140780
|
0 |
437 |
if( wctrlFlags & WHERE_WANT_DISTINCT ){ |
140803
|
3 |
1618 |
}while( (++ii)nSrc ); |
140818
|
0 |
2055 |
if( db->mallocFailed ) goto whereBeginError; |
140831
|
1905 |
2055 |
for(ii=0; iinTerm; ii++){ |
140833
|
350 |
1555 |
if( pT->wtFlags & TERM_VIRTUAL ) continue; |
140834
|
62 |
1493 |
if( pT->prereqAll==0 && (nTabList==0 || exprIsDeterministic(pT->pExpr)) ){ |
|
18 |
44 |
if( pT->prereqAll==0 && (nTabList==0 || exprIsDeterministic(pT->pExpr)) ){ |
|
18 |
0 |
if( pT->prereqAll==0 && (nTabList==0 || exprIsDeterministic(pT->pExpr)) ){ |
140840
|
2 |
2053 |
if( wctrlFlags & WHERE_WANT_DISTINCT ){ |
140841
|
0 |
2 |
if( isDistinctRedundant(pParse, pTabList, &pWInfo->sWC, pResultSet) ){ |
140844
|
2 |
0 |
}else if( pOrderBy==0 ){ |
140865
|
1615 |
440 |
if( nTabList!=1 || whereShortCut(&sWLB)==0 ){ |
|
1093 |
522 |
if( nTabList!=1 || whereShortCut(&sWLB)==0 ){ |
140867
|
0 |
1533 |
if( rc ) goto whereBeginError; |
140883
|
0 |
1533 |
if( db->mallocFailed ) goto whereBeginError; |
140884
|
581 |
952 |
if( pWInfo->pOrderBy ){ |
140886
|
0 |
581 |
if( db->mallocFailed ) goto whereBeginError; |
140889
|
1474 |
581 |
if( pWInfo->pOrderBy==0 && (db->flags & SQLITE_ReverseOrder)!=0 ){ |
|
0 |
1474 |
if( pWInfo->pOrderBy==0 && (db->flags & SQLITE_ReverseOrder)!=0 ){ |
140892
|
2055 |
0 |
if( pParse->nErr || NEVER(db->mallocFailed) ){ |
|
2055 |
0 |
if( pParse->nErr || NEVER(db->mallocFailed) ){ |
140952
|
3 |
2052 |
if( pWInfo->nLevel>=2 |
140953
|
2 |
1 |
&& pResultSet!=0 /* guarantees condition (1) above */ |
140954
|
2 |
0 |
&& OptimizationEnabled(db, SQLITE_OmitNoopJoin) |
140958
|
0 |
2 |
if( sWLB.pOrderBy ){ |
140961
|
2 |
2 |
for(i=pWInfo->nLevel-1; i>=1; i--){ |
140966
|
2 |
0 |
if( (pItem->fg.jointype & JT_LEFT)==0 ) continue; |
140967
|
0 |
0 |
if( (wctrlFlags & WHERE_WANT_DISTINCT)==0 |
140968
|
0 |
0 |
&& (pLoop->wsFlags & WHERE_ONEROW)==0 |
140972
|
0 |
0 |
if( (tabUsed & pLoop->maskSelf)!=0 ) continue; |
140974
|
0 |
0 |
for(pTerm=sWLB.pWC->a; pTerm
|
140975
|
0 |
0 |
if( (pTerm->prereqAll & pLoop->maskSelf)!=0 ){ |
140976
|
0 |
0 |
if( !ExprHasProperty(pTerm->pExpr, EP_FromJoin) |
140977
|
0 |
0 |
|| pTerm->pExpr->iRightJoinTable!=pItem->iCursor |
140983
|
0 |
0 |
if( pTerm
|
140986
|
0 |
0 |
for(pTerm=sWLB.pWC->a; pTerm
|
140987
|
0 |
0 |
if( (pTerm->prereqAll & pLoop->maskSelf)!=0 ){ |
140991
|
0 |
0 |
if( i!=pWInfo->nLevel-1 ){ |
141022
|
306 |
1749 |
if( (wctrlFlags & WHERE_ONEPASS_DESIRED)!=0 ){ |
141025
|
38 |
268 |
if( bOnerow || ( |
|
31 |
7 |
if( bOnerow || ( |
141027
|
30 |
1 |
&& 0==(wsFlags & WHERE_VIRTUALTABLE) |
141028
|
0 |
30 |
&& (0==(wsFlags & WHERE_MULTI_OR) || (wctrlFlags & WHERE_DUPLICATES_OK)) |
|
0 |
0 |
&& (0==(wsFlags & WHERE_MULTI_OR) || (wctrlFlags & WHERE_DUPLICATES_OK)) |
141030
|
268 |
30 |
pWInfo->eOnePass = bOnerow ? ONEPASS_SINGLE : ONEPASS_MULTI; |
141031
|
298 |
0 |
if( HasRowid(pTabList->a[0].pTab) && (wsFlags & WHERE_IDX_ONLY) ){ |
|
9 |
289 |
if( HasRowid(pTabList->a[0].pTab) && (wsFlags & WHERE_IDX_ONLY) ){ |
141032
|
9 |
0 |
if( wctrlFlags & WHERE_ONEPASS_MULTIROW ){ |
141043
|
1621 |
2055 |
for(ii=0, pLevel=pWInfo->a; ii
|
141052
|
1599 |
22 |
if( (pTab->tabFlags & TF_Ephemeral)!=0 || pTab->pSelect ){ |
|
1599 |
0 |
if( (pTab->tabFlags & TF_Ephemeral)!=0 || pTab->pSelect ){ |
141056
|
120 |
1479 |
if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)!=0 ){ |
141060
|
1479 |
0 |
}else if( IsVirtual(pTab) ){ |
141064
|
1467 |
12 |
if( (pLoop->wsFlags & WHERE_IDX_ONLY)==0 |
141065
|
1466 |
1 |
&& (wctrlFlags & WHERE_OR_SUBCLAUSE)==0 ){ |
141067
|
298 |
1168 |
if( pWInfo->eOnePass!=ONEPASS_OFF ){ |
141075
|
1168 |
298 |
if( pWInfo->eOnePass==ONEPASS_OFF && pTab->nCol
|
|
1168 |
0 |
if( pWInfo->eOnePass==ONEPASS_OFF && pTab->nCol
|
|
1168 |
0 |
if( pWInfo->eOnePass==ONEPASS_OFF && pTab->nCol
|
141078
|
3857 |
1168 |
for(; b; b=b>>1, n++){} |
141097
|
43 |
1578 |
if( pLoop->wsFlags & WHERE_INDEXED ){ |
141103
|
0 |
43 |
if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIx) |
|
0 |
0 |
if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIx) |
141104
|
0 |
0 |
&& (wctrlFlags & WHERE_OR_SUBCLAUSE)!=0 |
141110
|
9 |
34 |
}else if( pWInfo->eOnePass!=ONEPASS_OFF ){ |
141114
|
9 |
0 |
while( ALWAYS(pJ) && pJ!=pIx ){ |
|
0 |
9 |
while( ALWAYS(pJ) && pJ!=pIx ){ |
141120
|
26 |
8 |
}else if( iAuxArg && (wctrlFlags & WHERE_OR_SUBCLAUSE)!=0 ){ |
|
4 |
22 |
}else if( iAuxArg && (wctrlFlags & WHERE_OR_SUBCLAUSE)!=0 ){ |
141129
|
43 |
0 |
if( op ){ |
141132
|
43 |
0 |
if( (pLoop->wsFlags & WHERE_CONSTRAINT)!=0 |
141133
|
23 |
20 |
&& (pLoop->wsFlags & (WHERE_COLUMN_RANGE|WHERE_SKIPSCAN))==0 |
141134
|
23 |
0 |
&& (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)==0 |
141135
|
23 |
0 |
&& pWInfo->eDistinct!=WHERE_DISTINCT_ORDERED |
141157
|
1599 |
22 |
if( iDb>=0 ) sqlite3CodeVerifySchema(pParse, iDb); |
141160
|
0 |
2055 |
if( db->mallocFailed ) goto whereBeginError; |
141166
|
1621 |
2055 |
for(ii=0; ii
|
141172
|
1 |
1620 |
if( (pLevel->pWLoop->wsFlags & WHERE_AUTO_INDEX)!=0 ){ |
141175
|
0 |
1 |
if( db->mallocFailed ) goto whereBeginError; |
141184
|
1619 |
2 |
if( (wsFlags&WHERE_MULTI_OR)==0 && (wctrlFlags&WHERE_OR_SUBCLAUSE)==0 ){ |
141195
|
0 |
0 |
if( pWInfo ){ |
141219
|
1621 |
2055 |
for(i=pWInfo->nLevel-1; i>=0; i--){ |
141223
|
1096 |
525 |
if( pLevel->op!=OP_Noop ){ |
141228
|
0 |
1096 |
if( pWInfo->eDistinct==WHERE_DISTINCT_ORDERED |
141229
|
0 |
0 |
&& i==pWInfo->nLevel-1 /* Ticket [ef9318757b152e3] 2017-10-21 */ |
141230
|
0 |
0 |
&& (pLoop->wsFlags & WHERE_INDEXED)!=0 |
141231
|
0 |
0 |
&& (pIdx = pLoop->u.btree.pIndex)->hasStat1 |
141232
|
0 |
0 |
&& (n = pLoop->u.btree.nIdxCol)>0 |
141233
|
0 |
0 |
&& pIdx->aiRowLogEst[n]>=36 |
141237
|
0 |
0 |
for(j=0; j
|
141241
|
0 |
0 |
op = pLevel->op==OP_Prev ? OP_SeekLT : OP_SeekGT; |
141257
|
0 |
1096 |
if( addrSeek ) sqlite3VdbeJumpHere(v, addrSeek); |
141262
|
3 |
1618 |
if( pLoop->wsFlags & WHERE_IN_ABLE && pLevel->u.in.nIn>0 ){ |
|
3 |
0 |
if( pLoop->wsFlags & WHERE_IN_ABLE && pLevel->u.in.nIn>0 ){ |
141266
|
3 |
3 |
for(j=pLevel->u.in.nIn, pIn=&pLevel->u.in.aInLoop[j-1]; j>0; j--, pIn--){ |
141268
|
3 |
0 |
if( pIn->eEndLoopOp!=OP_Noop ){ |
141278
|
0 |
1621 |
if( pLevel->addrSkip ){ |
141285
|
0 |
1621 |
if( pLevel->addrLikeRep ){ |
141291
|
0 |
1621 |
if( pLevel->iLeftJoin ){ |
141295
|
0 |
0 |
if( (ws & WHERE_IDX_ONLY)==0 ){ |
141299
|
0 |
0 |
if( (ws & WHERE_INDEXED) |
141300
|
0 |
0 |
|| ((ws & WHERE_MULTI_OR) && pLevel->u.pCovidx) |
|
0 |
0 |
|| ((ws & WHERE_MULTI_OR) && pLevel->u.pCovidx) |
141304
|
0 |
0 |
if( pLevel->op==OP_Return ){ |
141321
|
1621 |
2055 |
for(i=0, pLevel=pWInfo->a; inLevel; i++, pLevel++){ |
141334
|
22 |
1599 |
if( pTabItem->fg.viaCoroutine ){ |
141352
|
44 |
1555 |
if( pLoop->wsFlags & (WHERE_INDEXED|WHERE_IDX_ONLY) ){ |
141354
|
2 |
1553 |
}else if( pLoop->wsFlags & WHERE_MULTI_OR ){ |
141357
|
44 |
1555 |
if( pIdx |
141358
|
9 |
35 |
&& (pWInfo->eOnePass==ONEPASS_OFF || !HasRowid(pIdx->pTable)) |
|
0 |
9 |
&& (pWInfo->eOnePass==ONEPASS_OFF || !HasRowid(pIdx->pTable)) |
141359
|
35 |
0 |
&& !db->mallocFailed |
141364
|
563 |
35 |
for(; k
|
141365
|
441 |
122 |
if( pOp->p1!=pLevel->iTabCur ) continue; |
141366
|
93 |
29 |
if( pOp->opcode==OP_Column |
141373
|
0 |
93 |
if( !HasRowid(pTab) ){ |
141379
|
44 |
49 |
if( x>=0 ){ |
141385
|
4 |
25 |
}else if( pOp->opcode==OP_Rowid ){ |
141388
|
0 |
25 |
}else if( pOp->opcode==OP_IfNullRow ){ |
141496
|
26 |
4326 |
if( p->pPrior ){ |
141499
|
111 |
26 |
for(pLoop=p; pLoop; pNext=pLoop, pLoop=pLoop->pPrior, cnt++){ |
141503
|
22 |
4 |
if( (p->selFlags & SF_MultiValue)==0 && |
|
22 |
0 |
if( (p->selFlags & SF_MultiValue)==0 && |
141504
|
0 |
22 |
(mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 && |
141519
|
10311 |
0 |
if( p ){ |
141527
|
2283 |
8028 |
if( sqlite3Isquote(p->u.zToken[0]) ){ |
141528
|
57 |
2226 |
if( p->u.zToken[0]=='"' ) p->flags |= EP_DblQuoted; |
141542
|
30 |
0 |
if( pA && pY && pY->op==TK_NULL ){ |
|
30 |
0 |
if( pA && pY && pY->op==TK_NULL ){ |
|
25 |
5 |
if( pA && pY && pY->op==TK_NULL ){ |
141562
|
24 |
0 |
if( (hasCollate || sortOrder!=SQLITE_SO_UNDEFINED) |
|
0 |
24 |
if( (hasCollate || sortOrder!=SQLITE_SO_UNDEFINED) |
141563
|
0 |
0 |
&& pParse->db->init.busy==0 |
143259
|
11510 |
6083 |
while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser); |
143343
|
61388 |
157918 |
if( stateno>YY_MAX_SHIFT ) return stateno; |
143355
|
81002 |
77101 |
if( yy_lookahead[i]!=iLookAhead ){ |
143358
|
58575 |
22427 |
if( iLookAhead
|
143359
|
185 |
58390 |
&& (iFallback = yyFallback[iLookAhead])!=0 ){ |
143374
|
67654 |
13163 |
if( |
143379
|
266 |
67388 |
j
|
143381
|
266 |
0 |
yy_lookahead[j]==YYWILDCARD && iLookAhead>0 |
143442
|
0 |
0 |
while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); |
143492
|
0 |
76787 |
if( yypParser->yytos>yypParser->yystackEnd ){ |
143506
|
36413 |
40374 |
if( yyNewState > YY_MAX_SHIFT ){ |
143910
|
47223 |
94967 |
if( yyRuleInfo[yyruleno].nrhs==0 ){ |
143918
|
0 |
47223 |
if( yypParser->yytos>=yypParser->yystackEnd ){ |
144028
|
0 |
0 |
if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){ |
|
0 |
0 |
if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){ |
144085
|
0 |
0 |
if( p ){ |
144223
|
0 |
0 |
if( p ){ |
144235
|
0 |
0 |
if( p ){ |
144247
|
4352 |
0 |
if( p ){ |
144257
|
75 |
0 |
if( pRhs && pRhs->pPrior ){ |
|
0 |
75 |
if( pRhs && pRhs->pPrior ){ |
144265
|
75 |
0 |
if( pRhs ){ |
144268
|
75 |
0 |
if( ALWAYS(pLhs) ) pLhs->selFlags &= ~SF_MultiValue; |
144270
|
4 |
71 |
if( yymsp[-1].minor.yy502!=TK_ALL ) pParse->hasCompound = 1; |
144324
|
10 |
0 |
if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue; |
144325
|
10 |
0 |
if( pRight ){ |
144351
|
316 |
2771 |
if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy232, &yymsp[0].minor.yy0, 1); |
144386
|
3 |
0 |
if( ALWAYS(yymsp[-1].minor.yy427 && yymsp[-1].minor.yy427->nSrc>0) ) yymsp[-1].minor.yy427->a[yymsp[-1].minor.yy427->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy502; |
|
3 |
0 |
if( ALWAYS(yymsp[-1].minor.yy427 && yymsp[-1].minor.yy427->nSrc>0) ) yymsp[-1].minor.yy427->a[yymsp[-1].minor.yy427->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy502; |
144411
|
0 |
0 |
if( yymsp[-6].minor.yy427==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy182==0 && yymsp[0].minor.yy510==0 ){ |
|
0 |
0 |
if( yymsp[-6].minor.yy427==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy182==0 && yymsp[0].minor.yy510==0 ){ |
|
0 |
0 |
if( yymsp[-6].minor.yy427==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy182==0 && yymsp[0].minor.yy510==0 ){ |
|
0 |
0 |
if( yymsp[-6].minor.yy427==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy182==0 && yymsp[0].minor.yy510==0 ){ |
144413
|
0 |
0 |
}else if( yymsp[-4].minor.yy427->nSrc==1 ){ |
144415
|
0 |
0 |
if( yymsp[-6].minor.yy427 ){ |
144448
|
0 |
0 |
if( yymsp[-4].minor.yy427 ) yymsp[-4].minor.yy427->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0); |
144454
|
0 |
0 |
if( yymsp[-2].minor.yy427 ) yymsp[-2].minor.yy427->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0); |
144634
|
551 |
1231 |
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){ |
|
0 |
551 |
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){ |
144644
|
0 |
551 |
if( pParse->nested==0 ){ |
144649
|
551 |
0 |
if( yymsp[0].minor.yy182 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy182->iTable); |
144667
|
473 |
78 |
if( yymsp[-1].minor.yy232 && yymsp[-1].minor.yy232->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ |
|
0 |
473 |
if( yymsp[-1].minor.yy232 && yymsp[-1].minor.yy232->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ |
144671
|
0 |
551 |
if( yymsp[-2].minor.yy502==SF_Distinct && yylhsminor.yy182 ){ |
|
0 |
0 |
if( yymsp[-2].minor.yy502==SF_Distinct && yylhsminor.yy182 ){ |
144693
|
0 |
0 |
if( yymsp[-4].minor.yy182 ){ |
144721
|
12 |
120 |
if( bNot ) yymsp[-2].minor.yy182 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy182, 0); |
144722
|
132 |
0 |
if( yymsp[-2].minor.yy182 ) yymsp[-2].minor.yy182->flags |= EP_InfixFunc; |
144734
|
0 |
0 |
if( bNot ) yymsp[-4].minor.yy182 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy182, 0); |
144735
|
0 |
0 |
if( yymsp[-4].minor.yy182 ) yymsp[-4].minor.yy182->flags |= EP_InfixFunc; |
144775
|
18 |
0 |
if( yymsp[-4].minor.yy182 ){ |
144780
|
0 |
18 |
if( yymsp[-3].minor.yy502 ) yymsp[-4].minor.yy182 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy182, 0); |
144785
|
0 |
17 |
if( yymsp[-1].minor.yy232==0 ){ |
144796
|
1 |
16 |
}else if( yymsp[-1].minor.yy232->nExpr==1 ){ |
144818
|
1 |
0 |
if( ALWAYS(pRHS) ){ |
144822
|
0 |
1 |
yymsp[-4].minor.yy182 = sqlite3PExpr(pParse, yymsp[-3].minor.yy502 ? TK_NE : TK_EQ, yymsp[-4].minor.yy182, pRHS); |
144825
|
16 |
0 |
if( yymsp[-4].minor.yy182 ){ |
144831
|
0 |
16 |
if( yymsp[-3].minor.yy502 ) yymsp[-4].minor.yy182 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy182, 0); |
144845
|
0 |
1 |
if( yymsp[-3].minor.yy502 ) yymsp[-4].minor.yy182 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy182, 0); |
144852
|
0 |
2 |
if( yymsp[0].minor.yy232 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy232); |
|
0 |
0 |
if( yymsp[0].minor.yy232 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy232); |
144855
|
0 |
2 |
if( yymsp[-3].minor.yy502 ) yymsp[-4].minor.yy182 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy182, 0); |
144868
|
0 |
0 |
if( yymsp[-4].minor.yy182 ){ |
144869
|
0 |
0 |
yymsp[-4].minor.yy182->x.pList = yymsp[-1].minor.yy182 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy232,yymsp[-1].minor.yy182) : yymsp[-2].minor.yy232; |
144961
|
0 |
0 |
yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/ |
145044
|
0 |
0 |
if( yymsp[-3].minor.yy182 ){ |
145052
|
0 |
0 |
if( yymsp[-5].minor.yy182 ) { |
145260
|
2 |
0 |
if( TOKEN.z[0] ){ |
145353
|
142190 |
77116 |
if( yyact >= YY_MIN_REDUCE ){ |
145356
|
76787 |
329 |
}else if( yyact <= YY_MAX_SHIFTREDUCE ){ |
145362
|
327 |
2 |
}else if( yyact==YY_ACCEPT_ACTION ){ |
145469
|
142190 |
0 |
}while( yypParser->yytos>yypParser->yystack ); |
145782
|
37534 |
560 |
if( n>=2 ){ |
145784
|
41980 |
18769 |
for(i=((int)aKWHash[i])-1; i>=0; i=((int)aKWNext[i])-1){ |
145785
|
22974 |
19006 |
if( aKWLen[i]!=n ) continue; |
145789
|
96975 |
18765 |
while( j
|
|
96734 |
241 |
while( j
|
145794
|
241 |
18765 |
if( j
|
145934
|
0 |
0 |
if( i<0 || i>=SQLITE_N_KEYWORD ) return SQLITE_ERROR; |
|
0 |
0 |
if( i<0 || i>=SQLITE_N_KEYWORD ) return SQLITE_ERROR; |
146007
|
4468 |
38985 |
for(i=1; sqlite3Isspace(z[i]); i++){} |
146012
|
3 |
1 |
if( z[1]=='-' ){ |
146013
|
51 |
1 |
for(i=2; (c=z[i])!=0 && c!='\n'; i++){} |
|
49 |
2 |
for(i=2; (c=z[i])!=0 && c!='\n'; i++){} |
146041
|
1 |
0 |
if( z[1]!='*' || z[2]==0 ){ |
|
0 |
1 |
if( z[1]!='*' || z[2]==0 ){ |
146045
|
1 |
25 |
for(i=3, c=z[2]; (c!='*' || z[i]!='/') && (c=z[i])!=0; i++){} |
|
0 |
1 |
for(i=3, c=z[2]; (c!='*' || z[i]!='/') && (c=z[i])!=0; i++){} |
|
25 |
0 |
for(i=3, c=z[2]; (c!='*' || z[i]!='/') && (c=z[i])!=0; i++){} |
146046
|
1 |
0 |
if( c ) i++; |
146056
|
0 |
2382 |
return 1 + (z[1]=='='); |
146059
|
12 |
7 |
if( (c=z[1])=='=' ){ |
146062
|
0 |
7 |
}else if( c=='>' ){ |
146065
|
0 |
7 |
}else if( c=='<' ){ |
146074
|
14 |
18 |
if( (c=z[1])=='=' ){ |
146077
|
0 |
18 |
}else if( c=='>' ){ |
146086
|
0 |
217 |
if( z[1]!='=' ){ |
146095
|
0 |
0 |
if( z[1]!='|' ){ |
146120
|
43429 |
0 |
for(i=1; (c=z[i])!=0; i++){ |
146121
|
3967 |
39462 |
if( c==delim ){ |
146122
|
164 |
3803 |
if( z[i+1]==delim ){ |
146129
|
3151 |
652 |
if( c=='\'' ){ |
146132
|
652 |
0 |
}else if( c!=0 ){ |
146142
|
1087 |
0 |
if( !sqlite3Isdigit(z[1]) ) |
146158
|
2194 |
614 |
if( z[0]=='0' && (z[1]=='x' || z[1]=='X') && sqlite3Isxdigit(z[2]) ){ |
|
2194 |
0 |
if( z[0]=='0' && (z[1]=='x' || z[1]=='X') && sqlite3Isxdigit(z[2]) ){ |
|
0 |
2194 |
if( z[0]=='0' && (z[1]=='x' || z[1]=='X') && sqlite3Isxdigit(z[2]) ){ |
|
0 |
0 |
if( z[0]=='0' && (z[1]=='x' || z[1]=='X') && sqlite3Isxdigit(z[2]) ){ |
146159
|
0 |
0 |
for(i=3; sqlite3Isxdigit(z[i]); i++){} |
146163
|
3321 |
2808 |
for(i=0; sqlite3Isdigit(z[i]); i++){} |
146165
|
2166 |
642 |
if( z[i]=='.' ){ |
146167
|
32395 |
2166 |
while( sqlite3Isdigit(z[i]) ){ i++; } |
146170
|
2808 |
0 |
if( (z[i]=='e' || z[i]=='E') && |
|
0 |
2808 |
if( (z[i]=='e' || z[i]=='E') && |
|
0 |
0 |
if( (z[i]=='e' || z[i]=='E') && |
146172
|
0 |
0 |
|| ((z[i+1]=='+' || z[i+1]=='-') && sqlite3Isdigit(z[i+2])) |
|
0 |
0 |
|| ((z[i+1]=='+' || z[i+1]=='-') && sqlite3Isdigit(z[i+2])) |
|
0 |
0 |
|| ((z[i+1]=='+' || z[i+1]=='-') && sqlite3Isdigit(z[i+2])) |
146176
|
0 |
0 |
while( sqlite3Isdigit(z[i]) ){ i++; } |
146180
|
0 |
2808 |
while( IdChar(z[i]) ){ |
146187
|
18 |
6 |
for(i=1, c=z[0]; c!=']' && (c=z[i])!=0; i++){} |
|
18 |
0 |
for(i=1, c=z[0]; c!=']' && (c=z[i])!=0; i++){} |
146188
|
6 |
0 |
*tokenType = c==']' ? TK_ID : TK_ILLEGAL; |
146193
|
13 |
1223 |
for(i=1; sqlite3Isdigit(z[i]); i++){} |
146202
|
891 |
274 |
for(i=1; (c=z[i])!=0; i++){ |
146203
|
596 |
295 |
if( IdChar(c) ){ |
146206
|
0 |
295 |
}else if( c=='(' && n>0 ){ |
|
0 |
0 |
}else if( c=='(' && n>0 ){ |
146209
|
0 |
0 |
}while( (c=z[i])!=0 && !sqlite3Isspace(c) && c!=')' ); |
|
0 |
0 |
}while( (c=z[i])!=0 && !sqlite3Isspace(c) && c!=')' ); |
|
0 |
0 |
}while( (c=z[i])!=0 && !sqlite3Isspace(c) && c!=')' ); |
146210
|
0 |
0 |
if( c==')' ){ |
146216
|
0 |
295 |
}else if( c==':' && z[i+1]==':' ){ |
|
0 |
0 |
}else if( c==':' && z[i+1]==':' ){ |
146223
|
0 |
569 |
if( n==0 ) *tokenType = TK_ILLEGAL; |
146227
|
177912 |
38653 |
for(i=1; aiClass[z[i]]<=CC_KYWD; i++){} |
146228
|
559 |
38094 |
if( IdChar(z[i]) ){ |
146241
|
0 |
419 |
if( z[1]=='\'' ){ |
146243
|
0 |
0 |
for(i=2; sqlite3Isxdigit(z[i]); i++){} |
146244
|
0 |
0 |
if( z[i]!='\'' || i%2 ){ |
|
0 |
0 |
if( z[i]!='\'' || i%2 ){ |
146246
|
0 |
0 |
while( z[i] && z[i]!='\'' ){ i++; } |
|
0 |
0 |
while( z[i] && z[i]!='\'' ){ i++; } |
146248
|
0 |
0 |
if( z[i] ) i++; |
146264
|
2594 |
982 |
while( IdChar(z[i]) ){ i++; } |
146290
|
5229 |
854 |
if( db->nVdbeActive==0 ){ |
146312
|
109761 |
6631 |
if( zSql[0]!=0 ){ |
146315
|
0 |
109761 |
if( mxSqlLen<0 ){ |
146322
|
327 |
6304 |
if( lastTokenParsed==TK_SEMI ){ |
146324
|
327 |
5977 |
}else if( lastTokenParsed==0 ){ |
146331
|
38949 |
77116 |
if( tokenType>=TK_SPACE ){ |
146333
|
0 |
38949 |
if( db->u1.isInterrupted ){ |
146337
|
0 |
38949 |
if( tokenType==TK_ILLEGAL ){ |
146348
|
71360 |
5756 |
if( pParse->rc!=SQLITE_OK || db->mallocFailed ) break; |
|
71360 |
0 |
if( pParse->rc!=SQLITE_OK || db->mallocFailed ) break; |
146365
|
0 |
6083 |
if( db->mallocFailed ){ |
146368
|
5756 |
327 |
if( pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE && pParse->zErrMsg==0 ){ |
|
10 |
5746 |
if( pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE && pParse->zErrMsg==0 ){ |
|
0 |
10 |
if( pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE && pParse->zErrMsg==0 ){ |
146372
|
10 |
6073 |
if( pParse->zErrMsg ){ |
146378
|
6065 |
18 |
if( pParse->pVdbe && pParse->nErr>0 && pParse->nested==0 ){ |
|
0 |
6065 |
if( pParse->pVdbe && pParse->nErr>0 && pParse->nested==0 ){ |
|
0 |
0 |
if( pParse->pVdbe && pParse->nErr>0 && pParse->nested==0 ){ |
146383
|
5764 |
319 |
if( pParse->nested==0 ){ |
146393
|
6057 |
26 |
if( !IN_DECLARE_VTAB ){ |
146401
|
0 |
6083 |
if( pParse->pWithToFree ) sqlite3WithDelete(db, pParse->pWithToFree); |
146404
|
2 |
6083 |
while( pParse->pAinc ){ |
146409
|
13 |
6083 |
while( pParse->pZombieTab ){ |
146563
|
0 |
0 |
while( *zSql ){ |
146578
|
0 |
0 |
if( zSql[1]!='*' ){ |
146583
|
0 |
0 |
while( zSql[0] && (zSql[0]!='*' || zSql[1]!='/') ){ zSql++; } |
|
0 |
0 |
while( zSql[0] && (zSql[0]!='*' || zSql[1]!='/') ){ zSql++; } |
|
0 |
0 |
while( zSql[0] && (zSql[0]!='*' || zSql[1]!='/') ){ zSql++; } |
146584
|
0 |
0 |
if( zSql[0]==0 ) return 0; |
146590
|
0 |
0 |
if( zSql[1]!='-' ){ |
146594
|
0 |
0 |
while( *zSql && *zSql!='\n' ){ zSql++; } |
|
0 |
0 |
while( *zSql && *zSql!='\n' ){ zSql++; } |
146595
|
0 |
0 |
if( *zSql==0 ) return state==1; |
146601
|
0 |
0 |
while( *zSql && *zSql!=']' ){ zSql++; } |
|
0 |
0 |
while( *zSql && *zSql!=']' ){ zSql++; } |
146602
|
0 |
0 |
if( *zSql==0 ) return 0; |
146611
|
0 |
0 |
while( *zSql && *zSql!=c ){ zSql++; } |
|
0 |
0 |
while( *zSql && *zSql!=c ){ zSql++; } |
146612
|
0 |
0 |
if( *zSql==0 ) return 0; |
146620
|
0 |
0 |
if( IdChar((u8)*zSql) ){ |
146623
|
0 |
0 |
for(nId=1; IdChar(zSql[nId]); nId++){} |
146629
|
0 |
0 |
if( nId==6 && sqlite3StrNICmp(zSql, "create", 6)==0 ){ |
|
0 |
0 |
if( nId==6 && sqlite3StrNICmp(zSql, "create", 6)==0 ){ |
146637
|
0 |
0 |
if( nId==7 && sqlite3StrNICmp(zSql, "trigger", 7)==0 ){ |
|
0 |
0 |
if( nId==7 && sqlite3StrNICmp(zSql, "trigger", 7)==0 ){ |
146639
|
0 |
0 |
}else if( nId==4 && sqlite3StrNICmp(zSql, "temp", 4)==0 ){ |
|
0 |
0 |
}else if( nId==4 && sqlite3StrNICmp(zSql, "temp", 4)==0 ){ |
146641
|
0 |
0 |
}else if( nId==9 && sqlite3StrNICmp(zSql, "temporary", 9)==0 ){ |
|
0 |
0 |
}else if( nId==9 && sqlite3StrNICmp(zSql, "temporary", 9)==0 ){ |
146649
|
0 |
0 |
if( nId==3 && sqlite3StrNICmp(zSql, "end", 3)==0 ){ |
|
0 |
0 |
if( nId==3 && sqlite3StrNICmp(zSql, "end", 3)==0 ){ |
146653
|
0 |
0 |
if( nId==7 && sqlite3StrNICmp(zSql, "explain", 7)==0 ){ |
|
0 |
0 |
if( nId==7 && sqlite3StrNICmp(zSql, "explain", 7)==0 ){ |
146695
|
0 |
0 |
if( rc ) return rc; |
146700
|
0 |
0 |
if( zSql8 ){ |
146971
|
35660 |
618 |
if( sqlite3GlobalConfig.isInit ) return SQLITE_OK; |
146982
|
0 |
618 |
if( rc ) return rc; |
146993
|
103 |
515 |
if( !sqlite3GlobalConfig.isMallocInit ){ |
146996
|
618 |
0 |
if( rc==SQLITE_OK ){ |
146998
|
103 |
515 |
if( !sqlite3GlobalConfig.pInitMutex ){ |
147001
|
103 |
0 |
if( sqlite3GlobalConfig.bCoreMutex && !sqlite3GlobalConfig.pInitMutex ){ |
|
0 |
103 |
if( sqlite3GlobalConfig.bCoreMutex && !sqlite3GlobalConfig.pInitMutex ){ |
147006
|
618 |
0 |
if( rc==SQLITE_OK ){ |
147014
|
0 |
618 |
if( rc!=SQLITE_OK ){ |
147032
|
618 |
0 |
if( sqlite3GlobalConfig.isInit==0 && sqlite3GlobalConfig.inProgress==0 ){ |
|
103 |
515 |
if( sqlite3GlobalConfig.isInit==0 && sqlite3GlobalConfig.inProgress==0 ){ |
147042
|
103 |
0 |
if( sqlite3GlobalConfig.isPCacheInit==0 ){ |
147045
|
103 |
0 |
if( rc==SQLITE_OK ){ |
147054
|
103 |
0 |
if( rc==SQLITE_OK ){ |
147071
|
103 |
515 |
if( sqlite3GlobalConfig.nRefInitMutex<=0 ){ |
147126
|
0 |
0 |
if( sqlite3GlobalConfig.isInit ){ |
147135
|
0 |
0 |
if( sqlite3GlobalConfig.isPCacheInit ){ |
147139
|
0 |
0 |
if( sqlite3GlobalConfig.isMallocInit ){ |
147155
|
0 |
0 |
if( sqlite3GlobalConfig.isMutexInit ){ |
147178
|
0 |
206 |
if( sqlite3GlobalConfig.isInit ) return SQLITE_MISUSE_BKPT; |
147234
|
103 |
0 |
sqlite3GlobalConfig.m = *va_arg(ap, sqlite3_mem_methods*); |
147242
|
0 |
0 |
if( sqlite3GlobalConfig.m.xMalloc==0 ) sqlite3MemSetDefault(); |
147243
|
0 |
0 |
*va_arg(ap, sqlite3_mem_methods*) = sqlite3GlobalConfig.m; |
147250
|
0 |
0 |
sqlite3GlobalConfig.bMemstat = va_arg(ap, int); |
147254
|
0 |
0 |
sqlite3GlobalConfig.bSmallMalloc = va_arg(ap, int); |
147262
|
0 |
0 |
sqlite3GlobalConfig.pPage = va_arg(ap, void*); |
147263
|
0 |
0 |
sqlite3GlobalConfig.szPage = va_arg(ap, int); |
147264
|
0 |
0 |
sqlite3GlobalConfig.nPage = va_arg(ap, int); |
147272
|
0 |
0 |
*va_arg(ap, int*) = |
147294
|
103 |
0 |
sqlite3GlobalConfig.pcache2 = *va_arg(ap, sqlite3_pcache_methods2*); |
147302
|
0 |
0 |
if( sqlite3GlobalConfig.pcache2.xInit==0 ){ |
147305
|
0 |
0 |
*va_arg(ap, sqlite3_pcache_methods2*) = sqlite3GlobalConfig.pcache2; |
147355
|
0 |
0 |
sqlite3GlobalConfig.szLookaside = va_arg(ap, int); |
147356
|
0 |
0 |
sqlite3GlobalConfig.nLookaside = va_arg(ap, int); |
147370
|
0 |
0 |
sqlite3GlobalConfig.xLog = va_arg(ap, LOGFUNC_t); |
147371
|
0 |
0 |
sqlite3GlobalConfig.pLogArg = va_arg(ap, void*); |
147385
|
0 |
0 |
sqlite3GlobalConfig.bOpenUri = va_arg(ap, int); |
147394
|
0 |
0 |
sqlite3GlobalConfig.bUseCis = va_arg(ap, int); |
147412
|
0 |
0 |
sqlite3_int64 szMmap = va_arg(ap, sqlite3_int64); |
147413
|
0 |
0 |
sqlite3_int64 mxMmap = va_arg(ap, sqlite3_int64); |
147422
|
0 |
0 |
if( mxMmap<0 || mxMmap>SQLITE_MAX_MMAP_SIZE ){ |
|
0 |
0 |
if( mxMmap<0 || mxMmap>SQLITE_MAX_MMAP_SIZE ){ |
147425
|
0 |
0 |
if( szMmap<0 ) szMmap = SQLITE_DEFAULT_MMAP_SIZE; |
147426
|
0 |
0 |
if( szMmap>mxMmap) szMmap = mxMmap; |
147443
|
0 |
0 |
sqlite3GlobalConfig.szPma = va_arg(ap, unsigned int); |
147448
|
0 |
0 |
sqlite3GlobalConfig.nStmtSpill = va_arg(ap, int); |
147487
|
0 |
262 |
if( sqlite3LookasideUsed(db,0)>0 ){ |
147494
|
0 |
262 |
if( db->lookaside.bMalloced ){ |
147501
|
0 |
262 |
if( sz<=(int)sizeof(LookasideSlot*) ) sz = 0; |
147502
|
0 |
262 |
if( cnt<0 ) cnt = 0; |
147503
|
262 |
0 |
if( sz==0 || cnt==0 ){ |
|
0 |
262 |
if( sz==0 || cnt==0 ){ |
147506
|
262 |
0 |
}else if( pBuf==0 ){ |
147510
|
262 |
0 |
if( pStart ) cnt = sqlite3MallocSize(pStart)/sz; |
147518
|
262 |
0 |
if( pStart ){ |
147524
|
26200 |
262 |
for(i=cnt-1; i>=0; i--){ |
147568
|
0 |
0 |
for(i=0; inDb; i++){ |
147570
|
0 |
0 |
if( pBt ){ |
147594
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
147596
|
0 |
0 |
if( pBt && sqlite3BtreeIsInTrans(pBt) ){ |
|
0 |
0 |
if( pBt && sqlite3BtreeIsInTrans(pBt) ){ |
147599
|
0 |
0 |
if( rc==SQLITE_BUSY ){ |
147607
|
0 |
0 |
return ((rc==SQLITE_OK && bSeenBusy) ? SQLITE_BUSY : rc); |
|
0 |
0 |
return ((rc==SQLITE_OK && bSeenBusy) ? SQLITE_BUSY : rc); |
147621
|
0 |
0 |
db->aDb[0].zDbSName = va_arg(ap,char*); |
147626
|
0 |
0 |
void *pBuf = va_arg(ap, void*); /* IMP: R-26835-10964 */ |
147627
|
0 |
0 |
int sz = va_arg(ap, int); /* IMP: R-47871-25994 */ |
147628
|
0 |
0 |
int cnt = va_arg(ap, int); /* IMP: R-04460-53386 */ |
147648
|
1548 |
0 |
for(i=0; i
|
147649
|
516 |
1032 |
if( aFlagOp[i].op==op ){ |
147650
|
516 |
0 |
int onoff = va_arg(ap, int); |
147651
|
516 |
0 |
int *pRes = va_arg(ap, int*); |
147653
|
258 |
258 |
if( onoff>0 ){ |
147655
|
0 |
258 |
}else if( onoff==0 ){ |
147658
|
258 |
258 |
if( oldFlags!=db->flags ){ |
147661
|
258 |
258 |
if( pRes ){ |
147680
|
0 |
0 |
while( n>0 && z[n-1]==' ' ){ n--; } |
|
0 |
0 |
while( n>0 && z[n-1]==' ' ){ n--; } |
147703
|
533 |
634 |
if( rc==0 ){ |
147704
|
0 |
533 |
if( padFlag |
147705
|
0 |
0 |
&& allSpaces(((char*)pKey1)+n, nKey1-n) |
147706
|
0 |
0 |
&& allSpaces(((char*)pKey2)+n, nKey2-n) |
147737
|
0 |
0 |
if( 0==r ){ |
147803
|
13 |
484 |
while( db->pSavepoint ){ |
147821
|
2080 |
21064 |
if( pDestructor ){ |
147823
|
2080 |
0 |
if( pDestructor->nRef==0 ){ |
147839
|
559 |
277 |
for(i=0; inDb; i++){ |
147841
|
547 |
12 |
if( db->aDb[i].pSchema ){ |
147842
|
673 |
547 |
for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){ |
147844
|
27 |
646 |
if( IsVirtual(pTab) ) sqlite3VtabDisconnect(db, pTab); |
147848
|
2722 |
277 |
for(p=sqliteHashFirst(&db->aModule); p; p=sqliteHashNext(p)){ |
147850
|
0 |
2722 |
if( pMod->pEpoTab ){ |
147868
|
11 |
532 |
if( db->pVdbe ) return 1; |
147869
|
1074 |
532 |
for(j=0; jnDb; j++){ |
147871
|
592 |
482 |
if( pBt && sqlite3BtreeIsInBackup(pBt) ) return 1; |
|
0 |
592 |
if( pBt && sqlite3BtreeIsInBackup(pBt) ) return 1; |
147880
|
0 |
277 |
if( !db ){ |
147885
|
0 |
277 |
if( !sqlite3SafetyCheckSickOrOk(db) ){ |
147889
|
0 |
277 |
if( db->mTrace & SQLITE_TRACE_CLOSE ){ |
147908
|
277 |
0 |
if( !forceZombie && connectionIsBusy(db) ){ |
|
11 |
266 |
if( !forceZombie && connectionIsBusy(db) ){ |
147958
|
266 |
2333 |
if( db->magic!=SQLITE_MAGIC_ZOMBIE || connectionIsBusy(db) ){ |
|
0 |
266 |
if( db->magic!=SQLITE_MAGIC_ZOMBIE || connectionIsBusy(db) ){ |
147979
|
537 |
266 |
for(j=0; jnDb; j++){ |
147981
|
296 |
241 |
if( pDb->pBt ){ |
147984
|
265 |
31 |
if( j!=1 ){ |
147990
|
260 |
6 |
if( db->aDb[1].pSchema ){ |
148005
|
9448 |
266 |
for(i=sqliteHashFirst(&db->aFunc); i; i=sqliteHashNext(i)){ |
148013
|
2080 |
9448 |
}while( p ); |
148016
|
814 |
266 |
for(i=sqliteHashFirst(&db->aCollSeq); i; i=sqliteHashNext(i)){ |
148019
|
2442 |
814 |
for(j=0; j<3; j++){ |
148020
|
0 |
2442 |
if( pColl[j].xDel ){ |
148028
|
2611 |
266 |
for(i=sqliteHashFirst(&db->aModule); i; i=sqliteHashNext(i)){ |
148030
|
531 |
2080 |
if( pMod->xDestroy ){ |
148060
|
260 |
6 |
if( db->lookaside.bMalloced ){ |
148087
|
5 |
312 |
schemaChange = (db->mDbFlags & DBFLAG_SchemaChange)!=0 && db->init.busy==0; |
|
5 |
0 |
schemaChange = (db->mDbFlags & DBFLAG_SchemaChange)!=0 && db->init.busy==0; |
148089
|
639 |
317 |
for(i=0; inDb; i++){ |
148091
|
351 |
288 |
if( p ){ |
148092
|
44 |
307 |
if( sqlite3BtreeIsInTrans(p) ){ |
148101
|
5 |
312 |
if( (db->mDbFlags&DBFLAG_SchemaChange)!=0 && db->init.busy==0 ){ |
|
5 |
0 |
if( (db->mDbFlags&DBFLAG_SchemaChange)!=0 && db->init.busy==0 ){ |
148113
|
2 |
315 |
if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){ |
|
0 |
2 |
if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){ |
|
0 |
0 |
if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){ |
148284
|
23 |
0 |
if( ALWAYS(rc>=0) && rc
|
|
23 |
0 |
if( ALWAYS(rc>=0) && rc
|
|
23 |
0 |
if( ALWAYS(rc>=0) && rc
|
148333
|
120 |
58 |
if( count < NDELAY ){ |
148340
|
14 |
164 |
if( prior + delay > tmout ){ |
148342
|
7 |
7 |
if( delay<=0 ) return 0; |
148371
|
180 |
0 |
if( p->xBusyHandler==0 || p->nBusy<0 ) return 0; |
|
2 |
178 |
if( p->xBusyHandler==0 || p->nBusy<0 ) return 0; |
148372
|
178 |
0 |
if( p->bExtraFileArg ){ |
148382
|
7 |
171 |
if( rc==0 ){ |
148431
|
2 |
2 |
if( nOps>0 ){ |
148453
|
272 |
2 |
if( ms>0 ){ |
148500
|
11616 |
0 |
if( zFunctionName==0 || |
|
11056 |
560 |
if( zFunctionName==0 || |
148501
|
11056 |
0 |
(xSFunc && (xFinal || xStep)) || |
|
11056 |
0 |
(xSFunc && (xFinal || xStep)) || |
|
560 |
11056 |
(xSFunc && (xFinal || xStep)) || |
148502
|
560 |
0 |
(!xSFunc && (xFinal && !xStep)) || |
|
560 |
0 |
(!xSFunc && (xFinal && !xStep)) || |
|
560 |
11056 |
(!xSFunc && (xFinal && !xStep)) || |
148503
|
0 |
560 |
(!xSFunc && (!xFinal && xStep)) || |
|
0 |
0 |
(!xSFunc && (!xFinal && xStep)) || |
|
11616 |
0 |
(!xSFunc && (!xFinal && xStep)) || |
148504
|
11616 |
0 |
(nArg<-1 || nArg>SQLITE_MAX_FUNCTION_ARG) || |
|
0 |
11616 |
(nArg<-1 || nArg>SQLITE_MAX_FUNCTION_ARG) || |
148521
|
0 |
11616 |
if( enc==SQLITE_UTF16 ){ |
148523
|
524 |
11092 |
}else if( enc==SQLITE_ANY ){ |
148527
|
524 |
0 |
if( rc==SQLITE_OK ){ |
148531
|
0 |
524 |
if( rc!=SQLITE_OK ){ |
148546
|
1048 |
10568 |
if( p && (p->funcFlags & SQLITE_FUNC_ENCMASK)==enc && p->nArg==nArg ){ |
|
0 |
1048 |
if( p && (p->funcFlags & SQLITE_FUNC_ENCMASK)==enc && p->nArg==nArg ){ |
|
0 |
0 |
if( p && (p->funcFlags & SQLITE_FUNC_ENCMASK)==enc && p->nArg==nArg ){ |
148547
|
0 |
0 |
if( db->nVdbeActive ){ |
148559
|
0 |
11616 |
if( !p ){ |
148567
|
2096 |
9520 |
if( pDestructor ){ |
148573
|
11056 |
560 |
p->xSFunc = xSFunc ? xSFunc : xStep; |
148617
|
2096 |
8472 |
if( xDestroy ){ |
148619
|
0 |
2096 |
if( !pArg ){ |
148629
|
2096 |
8472 |
if( pArg && pArg->nRef==0 ){ |
|
0 |
2096 |
if( pArg && pArg->nRef==0 ){ |
148720
|
262 |
2096 |
if( rc ) return SQLITE_OK; |
148722
|
0 |
2096 |
if( zCopy==0 ) return SQLITE_NOMEM; |
148748
|
4 |
2 |
db->mTrace = xTrace ? SQLITE_TRACE_LEGACY : 0; |
148770
|
0 |
0 |
if( mTrace==0 ) xTrace = 0; |
148771
|
0 |
0 |
if( xTrace==0 ) mTrace = 0; |
148921
|
0 |
0 |
if( nFrame>=SQLITE_PTR_TO_INT(pClientData) ){ |
148949
|
262 |
0 |
if( nFrame>0 ){ |
149007
|
0 |
0 |
if( pnLog ) *pnLog = -1; |
149008
|
0 |
0 |
if( pnCkpt ) *pnCkpt = -1; |
149014
|
0 |
0 |
if( eModeSQLITE_CHECKPOINT_TRUNCATE ){ |
|
0 |
0 |
if( eModeSQLITE_CHECKPOINT_TRUNCATE ){ |
149021
|
0 |
0 |
if( zDb && zDb[0] ){ |
|
0 |
0 |
if( zDb && zDb[0] ){ |
149024
|
0 |
0 |
if( iDb<0 ){ |
149036
|
0 |
0 |
if( db->nVdbeActive==0 ){ |
149087
|
0 |
0 |
for(i=0; inDb && rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; inDb && rc==SQLITE_OK; i++){ |
149088
|
0 |
0 |
if( i==iDb || iDb==SQLITE_MAX_ATTACHED ){ |
|
0 |
0 |
if( i==iDb || iDb==SQLITE_MAX_ATTACHED ){ |
149092
|
0 |
0 |
if( rc==SQLITE_BUSY ){ |
149099
|
0 |
0 |
return (rc==SQLITE_OK && bBusy) ? SQLITE_BUSY : rc; |
|
0 |
0 |
return (rc==SQLITE_OK && bBusy) ? SQLITE_BUSY : rc; |
149145
|
0 |
107 |
if( !db ){ |
149148
|
0 |
107 |
if( !sqlite3SafetyCheckSickOrOk(db) ){ |
149152
|
0 |
107 |
if( db->mallocFailed ){ |
149158
|
17 |
90 |
if( z==0 ){ |
149182
|
0 |
0 |
if( !db ){ |
149185
|
0 |
0 |
if( !sqlite3SafetyCheckSickOrOk(db) ){ |
149189
|
0 |
0 |
if( db->mallocFailed ){ |
149193
|
0 |
0 |
if( z==0 ){ |
149214
|
796 |
0 |
if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
|
0 |
796 |
if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
149217
|
796 |
0 |
if( !db || db->mallocFailed ){ |
|
0 |
796 |
if( !db || db->mallocFailed ){ |
149223
|
0 |
0 |
if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
|
0 |
0 |
if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
149226
|
0 |
0 |
if( !db || db->mallocFailed ){ |
|
0 |
0 |
if( !db || db->mallocFailed ){ |
149232
|
0 |
0 |
return db ? db->iSysErrno : 0; |
149268
|
1356 |
0 |
if( enc2==SQLITE_UTF16 || enc2==SQLITE_UTF16_ALIGNED ){ |
|
0 |
1356 |
if( enc2==SQLITE_UTF16 || enc2==SQLITE_UTF16_ALIGNED ){ |
149271
|
1356 |
0 |
if( enc2SQLITE_UTF16BE ){ |
|
0 |
1356 |
if( enc2SQLITE_UTF16BE ){ |
149280
|
536 |
820 |
if( pColl && pColl->xCmp ){ |
|
0 |
536 |
if( pColl && pColl->xCmp ){ |
149281
|
0 |
0 |
if( db->nVdbeActive ){ |
149294
|
0 |
0 |
if( (pColl->enc & ~SQLITE_UTF16_ALIGNED)==enc2 ){ |
149297
|
0 |
0 |
for(j=0; j<3; j++){ |
149299
|
0 |
0 |
if( p->enc==pColl->enc ){ |
149300
|
0 |
0 |
if( p->xDel ){ |
149310
|
0 |
1356 |
if( pColl==0 ) return SQLITE_NOMEM_BKPT; |
149419
|
0 |
0 |
if( limitId<0 || limitId>=SQLITE_N_LIMIT ){ |
|
0 |
0 |
if( limitId<0 || limitId>=SQLITE_N_LIMIT ){ |
149423
|
0 |
0 |
if( newLimit>=0 ){ /* IMP: R-52476-28732 */ |
149424
|
0 |
0 |
if( newLimit>aHardLimit[limitId] ){ |
149473
|
260 |
13 |
if( ((flags & SQLITE_OPEN_URI) /* IMP: R-48725-32206 */ |
149474
|
260 |
0 |
|| sqlite3GlobalConfig.bOpenUri) /* IMP: R-51689-46548 */ |
149475
|
270 |
3 |
&& nUri>=5 && memcmp(zUri, "file:", 5)==0 /* IMP: R-57884-37496 */ |
|
12 |
258 |
&& nUri>=5 && memcmp(zUri, "file:", 5)==0 /* IMP: R-57884-37496 */ |
149487
|
214 |
12 |
for(iIn=0; iIn
|
149489
|
0 |
12 |
if( !zFile ) return SQLITE_NOMEM_BKPT; |
149506
|
0 |
12 |
if( zUri[5]=='/' && zUri[6]=='/' ){ |
|
0 |
0 |
if( zUri[5]=='/' && zUri[6]=='/' ){ |
149508
|
0 |
0 |
while( zUri[iIn] && zUri[iIn]!='/' ) iIn++; |
|
0 |
0 |
while( zUri[iIn] && zUri[iIn]!='/' ) iIn++; |
149509
|
0 |
0 |
if( iIn!=7 && (iIn!=16 || memcmp("localhost", &zUri[7], 9)) ){ |
|
0 |
0 |
if( iIn!=7 && (iIn!=16 || memcmp("localhost", &zUri[7], 9)) ){ |
|
0 |
0 |
if( iIn!=7 && (iIn!=16 || memcmp("localhost", &zUri[7], 9)) ){ |
149529
|
154 |
12 |
while( (c = zUri[iIn])!=0 && c!='#' ){ |
|
154 |
0 |
while( (c = zUri[iIn])!=0 && c!='#' ){ |
149531
|
0 |
154 |
if( c=='%' |
149532
|
0 |
0 |
&& sqlite3Isxdigit(zUri[iIn]) |
149533
|
0 |
0 |
&& sqlite3Isxdigit(zUri[iIn+1]) |
149539
|
0 |
0 |
if( octet==0 ){ |
149545
|
0 |
0 |
while( (c = zUri[iIn])!=0 && c!='#' |
|
0 |
0 |
while( (c = zUri[iIn])!=0 && c!='#' |
149546
|
0 |
0 |
&& (eState!=0 || c!='?') |
|
0 |
0 |
&& (eState!=0 || c!='?') |
149547
|
0 |
0 |
&& (eState!=1 || (c!='=' && c!='&')) |
|
0 |
0 |
&& (eState!=1 || (c!='=' && c!='&')) |
|
0 |
0 |
&& (eState!=1 || (c!='=' && c!='&')) |
149548
|
0 |
0 |
&& (eState!=2 || c!='&') |
|
0 |
0 |
&& (eState!=2 || c!='&') |
149561
|
50 |
104 |
}else if( eState==1 && (c=='&' || c=='=') ){ |
|
50 |
0 |
}else if( eState==1 && (c=='&' || c=='=') ){ |
|
10 |
40 |
}else if( eState==1 && (c=='&' || c=='=') ){ |
149562
|
0 |
10 |
if( zFile[iOut-1]==0 ){ |
149564
|
0 |
0 |
while( zUri[iIn] && zUri[iIn]!='#' && zUri[iIn-1]!='&' ) iIn++; |
|
0 |
0 |
while( zUri[iIn] && zUri[iIn]!='#' && zUri[iIn-1]!='&' ) iIn++; |
|
0 |
0 |
while( zUri[iIn] && zUri[iIn]!='#' && zUri[iIn-1]!='&' ) iIn++; |
149567
|
0 |
10 |
if( c=='&' ){ |
149573
|
82 |
62 |
}else if( (eState==0 && c=='?') || (eState==2 && c=='&') ){ |
|
72 |
10 |
}else if( (eState==0 && c=='?') || (eState==2 && c=='&') ){ |
|
22 |
112 |
}else if( (eState==0 && c=='?') || (eState==2 && c=='&') ){ |
|
0 |
22 |
}else if( (eState==0 && c=='?') || (eState==2 && c=='&') ){ |
149579
|
0 |
12 |
if( eState==1 ) zFile[iOut++] = '\0'; |
149588
|
10 |
12 |
while( zOpt[0] ){ |
149593
|
0 |
10 |
if( nOpt==3 && memcmp("vfs", zOpt, 3)==0 ){ |
|
0 |
0 |
if( nOpt==3 && memcmp("vfs", zOpt, 3)==0 ){ |
149604
|
0 |
10 |
if( nOpt==5 && memcmp("cache", zOpt, 5)==0 ){ |
|
0 |
0 |
if( nOpt==5 && memcmp("cache", zOpt, 5)==0 ){ |
149616
|
10 |
0 |
if( nOpt==4 && memcmp("mode", zOpt, 4)==0 ){ |
|
10 |
0 |
if( nOpt==4 && memcmp("mode", zOpt, 4)==0 ){ |
149632
|
10 |
0 |
if( aMode ){ |
149635
|
18 |
0 |
for(i=0; aMode[i].z; i++){ |
149637
|
14 |
4 |
if( nVal==sqlite3Strlen30(z) && 0==memcmp(zVal, z, nVal) ){ |
|
10 |
4 |
if( nVal==sqlite3Strlen30(z) && 0==memcmp(zVal, z, nVal) ){ |
149642
|
0 |
10 |
if( mode==0 ){ |
149647
|
0 |
10 |
if( (mode & ~SQLITE_OPEN_MEMORY)>limit ){ |
149662
|
0 |
261 |
if( !zFile ) return SQLITE_NOMEM_BKPT; |
149663
|
258 |
3 |
if( nUri ){ |
149672
|
0 |
273 |
if( *ppVfs==0 ){ |
149677
|
0 |
273 |
if( rc!=SQLITE_OK ){ |
149710
|
0 |
268 |
if( rc ) return rc; |
149713
|
0 |
268 |
if( sqlite3GlobalConfig.bCoreMutex==0 ){ |
149715
|
0 |
268 |
}else if( flags & SQLITE_OPEN_NOMUTEX ){ |
149717
|
0 |
268 |
}else if( flags & SQLITE_OPEN_FULLMUTEX ){ |
149723
|
0 |
268 |
if( flags & SQLITE_OPEN_PRIVATECACHE ){ |
149725
|
0 |
268 |
}else if( sqlite3GlobalConfig.sharedCacheEnabled ){ |
149754
|
0 |
268 |
if( db==0 ) goto opendb_out; |
149755
|
0 |
268 |
if( isThreadsafe |
149761
|
0 |
0 |
if( db->mutex==0 ){ |
149833
|
0 |
268 |
if( db->mallocFailed ){ |
149861
|
0 |
268 |
if( ((1<<(flags&7)) & 0x46)==0 ){ |
149866
|
0 |
268 |
if( rc!=SQLITE_OK ){ |
149867
|
0 |
0 |
if( rc==SQLITE_NOMEM ) sqlite3OomFault(db); |
149868
|
0 |
0 |
sqlite3ErrorWithMsg(db, rc, zErrMsg ? "%s" : 0, zErrMsg); |
149876
|
6 |
262 |
if( rc!=SQLITE_OK ){ |
149877
|
0 |
6 |
if( rc==SQLITE_IOERR_NOMEM ){ |
149885
|
262 |
0 |
if( !db->mallocFailed ) ENC(db) = SCHEMA_ENC(db); |
149898
|
0 |
262 |
if( db->mallocFailed ){ |
149914
|
262 |
0 |
if( !db->mallocFailed && rc==SQLITE_OK ){ |
|
262 |
0 |
if( !db->mallocFailed && rc==SQLITE_OK ){ |
149922
|
262 |
0 |
if( rc==SQLITE_OK ){ |
149925
|
0 |
262 |
if( rc!=SQLITE_OK ){ |
149945
|
262 |
0 |
if( !db->mallocFailed && rc==SQLITE_OK ){ |
|
262 |
0 |
if( !db->mallocFailed && rc==SQLITE_OK ){ |
149957
|
262 |
0 |
if( !db->mallocFailed && rc==SQLITE_OK){ |
|
262 |
0 |
if( !db->mallocFailed && rc==SQLITE_OK){ |
149975
|
262 |
0 |
if( !db->mallocFailed && rc==SQLITE_OK){ |
|
262 |
0 |
if( !db->mallocFailed && rc==SQLITE_OK){ |
149996
|
0 |
262 |
if( rc ) sqlite3Error(db, rc); |
150012
|
0 |
268 |
if( rc==SQLITE_NOMEM ){ |
150015
|
6 |
262 |
}else if( rc!=SQLITE_OK ){ |
150027
|
262 |
6 |
if( rc==SQLITE_OK ){ |
150029
|
0 |
262 |
if( (zKey = sqlite3_uri_parameter(zOpen, "hexkey"))!=0 && zKey[0] ){ |
|
0 |
0 |
if( (zKey = sqlite3_uri_parameter(zOpen, "hexkey"))!=0 && zKey[0] ){ |
150033
|
0 |
0 |
for(i=0, iByte=0; i
|
|
0 |
0 |
for(i=0, iByte=0; i
|
150035
|
0 |
0 |
if( (i&1)!=0 ) zDecoded[i/2] = iByte; |
150038
|
0 |
262 |
}else if( (zKey = sqlite3_uri_parameter(zOpen, "key"))!=0 ){ |
150084
|
0 |
0 |
if( rc ) return rc; |
150086
|
0 |
0 |
if( zFilename==0 ) zFilename = "\000\000"; |
150090
|
0 |
0 |
if( zFilename8 ){ |
150094
|
0 |
0 |
if( rc==SQLITE_OK && !DbHasProperty(*ppDb, 0, DB_SchemaLoaded) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && !DbHasProperty(*ppDb, 0, DB_SchemaLoaded) ){ |
150163
|
0 |
0 |
if( zName8 ){ |
150335
|
0 |
13 |
if( SQLITE_OK!=rc ){ |
150341
|
10 |
3 |
if( !pTab || pTab->pSelect ){ |
|
0 |
10 |
if( !pTab || pTab->pSelect ){ |
150347
|
10 |
0 |
if( zColumnName==0 ){ |
150350
|
22 |
2 |
for(iCol=0; iColnCol; iCol++){ |
150352
|
8 |
14 |
if( 0==sqlite3StrICmp(pCol->zName, zColumnName) ){ |
150356
|
2 |
8 |
if( iCol==pTab->nCol ){ |
150357
|
2 |
0 |
if( HasRowid(pTab) && sqlite3IsRowid(zColumnName) ){ |
|
0 |
2 |
if( HasRowid(pTab) && sqlite3IsRowid(zColumnName) ){ |
150359
|
0 |
0 |
pCol = iCol>=0 ? &pTab->aCol[iCol] : 0; |
150377
|
8 |
0 |
if( pCol ){ |
150382
|
3 |
5 |
autoinc = pTab->iPKey==iCol && (pTab->tabFlags & TF_Autoincrement)!=0; |
|
2 |
1 |
autoinc = pTab->iPKey==iCol && (pTab->tabFlags & TF_Autoincrement)!=0; |
150387
|
8 |
0 |
if( !zCollSeq ){ |
150398
|
12 |
1 |
if( pzDataType ) *pzDataType = zDataType; |
150399
|
12 |
1 |
if( pzCollSeq ) *pzCollSeq = zCollSeq; |
150400
|
12 |
1 |
if( pNotNull ) *pNotNull = notnull; |
150401
|
12 |
1 |
if( pPrimaryKey ) *pPrimaryKey = primarykey; |
150402
|
12 |
1 |
if( pAutoinc ) *pAutoinc = autoinc; |
150404
|
13 |
0 |
if( SQLITE_OK==rc && !pTab ){ |
|
5 |
8 |
if( SQLITE_OK==rc && !pTab ){ |
150410
|
5 |
8 |
sqlite3ErrorWithMsg(db, rc, (zErrMsg?"%s":0), zErrMsg); |
150424
|
0 |
0 |
if( pVfs==0 ) return 0; |
150441
|
0 |
0 |
db->errMask = onoff ? 0xffffffff : 0xff; |
150458
|
202 |
0 |
if( pBtree ){ |
150466
|
0 |
202 |
if( op==SQLITE_FCNTL_FILE_POINTER ){ |
150469
|
0 |
202 |
}else if( op==SQLITE_FCNTL_VFS_POINTER ){ |
150472
|
0 |
202 |
}else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){ |
150533
|
0 |
0 |
int sz = va_arg(ap, int); |
150534
|
0 |
0 |
int *aProg = va_arg(ap, int*); |
150556
|
0 |
0 |
sqlite3GlobalConfig.xTestCallback = va_arg(ap, TESTCALLBACKFUNC_t); |
150571
|
0 |
0 |
xBenignBegin = va_arg(ap, void_function); |
150572
|
0 |
0 |
xBenignEnd = va_arg(ap, void_function); |
150593
|
0 |
0 |
unsigned int newVal = va_arg(ap, unsigned int); |
150594
|
0 |
0 |
if( newVal ) sqlite3PendingByte = newVal; |
150647
|
0 |
0 |
int x = va_arg(ap,int); |
150674
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*); |
150675
|
0 |
0 |
int x = va_arg(ap,int); |
150692
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*); |
150693
|
0 |
0 |
db->dbOptFlags = (u16)(va_arg(ap, int) & 0xffff); |
150704
|
0 |
0 |
sqlite3GlobalConfig.bLocaltimeFault = va_arg(ap, int); |
150717
|
0 |
0 |
sqlite3GlobalConfig.neverCorrupt = va_arg(ap, int); |
150727
|
0 |
0 |
sqlite3GlobalConfig.iOnceResetThreshold = va_arg(ap, int); |
150747
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*); |
150748
|
0 |
0 |
db->nMaxSorterMmap = va_arg(ap, int); |
150758
|
0 |
0 |
if( sqlite3GlobalConfig.isInit==0 ) rc = SQLITE_ERROR; |
150779
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*); |
150781
|
0 |
0 |
db->init.iDb = sqlite3FindDbName(db, va_arg(ap,const char*)); |
150782
|
0 |
0 |
db->init.busy = db->init.imposterTable = va_arg(ap,int); |
150783
|
0 |
0 |
db->init.newTnum = va_arg(ap,int); |
150784
|
0 |
0 |
if( db->init.busy==0 && db->init.newTnum>0 ){ |
|
0 |
0 |
if( db->init.busy==0 && db->init.newTnum>0 ){ |
150824
|
754 |
188 |
if( zFilename==0 || zParam==0 ) return 0; |
|
0 |
754 |
if( zFilename==0 || zParam==0 ) return 0; |
150826
|
40 |
754 |
while( zFilename[0] ){ |
150829
|
0 |
40 |
if( x==0 ) return zFilename; |
150841
|
0 |
406 |
return z ? sqlite3GetBoolean(z, bDflt) : bDflt; |
150854
|
0 |
0 |
if( z && sqlite3DecOrHexToI64(z, &v)==0 ){ |
|
0 |
0 |
if( z && sqlite3DecOrHexToI64(z, &v)==0 ){ |
150864
|
122 |
93 |
int iDb = zDbName ? sqlite3FindDbName(db, zDbName) : 0; |
150865
|
215 |
0 |
return iDb<0 ? 0 : db->aDb[iDb].pBt; |
150881
|
9 |
0 |
return pBt ? sqlite3BtreeGetFilename(pBt) : 0; |
150897
|
4 |
0 |
return pBt ? sqlite3BtreeIsReadonly(pBt) : -1; |
151037
|
0 |
0 |
if( sqlite3StrNICmp(zOptName, "SQLITE_", 7)==0 ) zOptName += 7; |
151042
|
0 |
0 |
for(i=0; i
|
151043
|
0 |
0 |
if( sqlite3StrNICmp(zOptName, azCompileOpt[i], n)==0 |
151044
|
0 |
0 |
&& sqlite3IsIdChar((unsigned char)azCompileOpt[i][n])==0 |
151060
|
165 |
0 |
if( N>=0 && N
|
|
150 |
15 |
if( N>=0 && N
|
152641
|
10355 |
40838 |
}while( vu!=0 ); |
152666
|
843 |
74 |
GETVARINT_INIT(a, p, 0, 0x00, 0x80, *v, 1); |
152667
|
72 |
2 |
GETVARINT_STEP(a, p, 7, 0x7F, 0x4000, *v, 2); |
152668
|
2 |
0 |
GETVARINT_STEP(a, p, 14, 0x3FFF, 0x200000, *v, 3); |
152669
|
0 |
0 |
GETVARINT_STEP(a, p, 21, 0x1FFFFF, 0x10000000, *v, 4); |
152672
|
0 |
0 |
for(shift=28; shift<=63; shift+=7){ |
152675
|
0 |
0 |
if( (c & 0x80)==0 ) break; |
152695
|
54 |
0 |
GETVARINT_STEP(a, p, 7, 0x7F, 0x4000, *pi, 2); |
152696
|
0 |
0 |
GETVARINT_STEP(a, p, 14, 0x3FFF, 0x200000, *pi, 3); |
152697
|
0 |
0 |
GETVARINT_STEP(a, p, 21, 0x1FFFFF, 0x10000000, *pi, 4); |
152713
|
55 |
9236 |
}while( v!=0 ); |
152735
|
32 |
0 |
if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){ |
|
28 |
4 |
if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){ |
|
25 |
3 |
if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){ |
|
0 |
25 |
if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){ |
152740
|
0 |
7 |
if( quote=='[' ) quote = ']'; |
152742
|
101 |
0 |
while( z[iIn] ){ |
152743
|
7 |
94 |
if( z[iIn]==quote ){ |
152744
|
7 |
0 |
if( z[iIn+1]!=quote ) break; |
152786
|
0 |
0 |
for(p = (*pp)-2; p>=pStart && *p&0x80; p--); |
|
0 |
0 |
for(p = (*pp)-2; p>=pStart && *p&0x80; p--); |
152806
|
360 |
9 |
for(i=0; iaStmt); i++){ |
152848
|
0 |
32 |
if( *pRc ) return; |
152852
|
0 |
32 |
if( zSql==0 ){ |
152870
|
0 |
0 |
if( p->zContentTbl==0 ){ |
152882
|
0 |
0 |
return (rc==SQLITE_OK ? fts3DisconnectMethod(pVtab) : rc); |
152896
|
9 |
0 |
if( *pRc==SQLITE_OK ){ |
152903
|
0 |
9 |
zLanguageid = (p->zLanguageid ? p->zLanguageid : "__langid"); |
152908
|
14 |
0 |
for(i=1; zCols && inColumn; i++){ |
|
5 |
9 |
for(i=1; zCols && inColumn; i++){ |
152917
|
9 |
0 |
if( !zCols || !zSql ){ |
|
0 |
9 |
if( !zCols || !zSql ){ |
152938
|
5 |
0 |
if( (*pRc)==SQLITE_OK ) p->bHasStat = 1; |
152955
|
6 |
2 |
if( p->zContentTbl==0 ){ |
152961
|
14 |
0 |
for(i=0; zContentCols && inColumn; i++){ |
|
8 |
6 |
for(i=0; zContentCols && inColumn; i++){ |
152965
|
0 |
6 |
if( zLanguageid && zContentCols ){ |
|
0 |
0 |
if( zLanguageid && zContentCols ){ |
152968
|
0 |
6 |
if( zContentCols==0 ) rc = SQLITE_NOMEM; |
152995
|
5 |
3 |
if( p->bHasDocsize ){ |
153002
|
5 |
3 |
if( p->bHasStat ){ |
153016
|
9 |
0 |
if( *pRc==SQLITE_OK ){ |
153022
|
0 |
9 |
if( !zSql ){ |
153026
|
9 |
0 |
if( rc==SQLITE_OK ){ |
153030
|
0 |
0 |
}else if( rc==SQLITE_AUTH ){ |
153057
|
51 |
3 |
while( *zCsr!='=' ){ |
153058
|
6 |
45 |
if( *zCsr=='\0' ) return 0; |
153064
|
3 |
0 |
if( zValue ){ |
153080
|
55 |
0 |
if( *pRc==SQLITE_OK ){ |
153086
|
55 |
0 |
if( z && *pz ){ |
|
37 |
18 |
if( z && *pz ){ |
153091
|
0 |
55 |
if( z==0 ) *pRc = SQLITE_NOMEM; |
153112
|
0 |
0 |
if( zRet ){ |
153116
|
0 |
0 |
for(i=0; zInput[i]; i++){ |
153117
|
0 |
0 |
if( zInput[i]=='"' ) *(z++) = '"'; |
153155
|
6 |
3 |
if( p->zContentTbl==0 ){ |
153156
|
6 |
0 |
if( !zFunc ){ |
153162
|
8 |
6 |
for(i=0; inColumn; i++){ |
153165
|
0 |
6 |
if( p->zLanguageid ){ |
153171
|
6 |
3 |
for(i=0; inColumn; i++){ |
153174
|
0 |
3 |
if( p->zLanguageid ){ |
153178
|
3 |
6 |
fts3Appendf(pRc, &zRet, " FROM '%q'.'%q%s' AS x", |
|
3 |
6 |
fts3Appendf(pRc, &zRet, " FROM '%q'.'%q%s' AS x", |
153212
|
9 |
0 |
if( !zFunc ){ |
153218
|
14 |
9 |
for(i=0; inColumn; i++){ |
153221
|
0 |
9 |
if( p->zLanguageid ){ |
153246
|
0 |
0 |
for(p=*pp; p[0]>='0' && p[0]<='9'; p++){ |
|
0 |
0 |
for(p=*pp; p[0]>='0' && p[0]<='9'; p++){ |
153248
|
0 |
0 |
if( nInt>MAX_NPREFIX ){ |
153253
|
0 |
0 |
if( p==*pp ) return SQLITE_ERROR; |
153284
|
0 |
9 |
if( zParam && zParam[0] ){ |
|
0 |
0 |
if( zParam && zParam[0] ){ |
153287
|
0 |
0 |
for(p=zParam; *p; p++){ |
153288
|
0 |
0 |
if( *p==',' ) nIndex++; |
153294
|
0 |
9 |
if( !aIndex ){ |
153299
|
0 |
9 |
if( zParam ){ |
153302
|
0 |
0 |
for(i=1; i
|
153304
|
0 |
0 |
if( fts3GobbleInt(&p, &nPrefix) ) return SQLITE_ERROR; |
153306
|
0 |
0 |
if( nPrefix==0 ){ |
153359
|
0 |
2 |
if( !zSql ){ |
153363
|
0 |
2 |
if( rc!=SQLITE_OK ){ |
153369
|
2 |
0 |
if( rc==SQLITE_OK ){ |
153379
|
4 |
2 |
for(i=0; i
|
153386
|
0 |
2 |
if( azCol==0 ){ |
153390
|
4 |
2 |
for(i=0; i
|
153468
|
10 |
0 |
if( aCol ){ |
153472
|
10 |
0 |
if( azNotindexed ){ |
153475
|
10 |
0 |
if( !aCol || !azNotindexed ){ |
|
0 |
10 |
if( !aCol || !azNotindexed ){ |
153491
|
29 |
1 |
for(i=3; rc==SQLITE_OK && i
|
|
20 |
9 |
for(i=3; rc==SQLITE_OK && i
|
153497
|
20 |
0 |
if( !pTokenizer |
153498
|
11 |
9 |
&& strlen(z)>8 |
153499
|
6 |
5 |
&& 0==sqlite3_strnicmp(z, "tokenize", 8) |
153500
|
6 |
0 |
&& 0==sqlite3Fts3IsIdChar(z[8]) |
153506
|
9 |
5 |
else if( isFts4 && fts3IsSpecialColumn(z, &nKey, &zVal) ){ |
|
3 |
6 |
else if( isFts4 && fts3IsSpecialColumn(z, &nKey, &zVal) ){ |
153522
|
0 |
3 |
if( !zVal ){ |
153525
|
18 |
0 |
for(iOpt=0; iOpt
|
153527
|
3 |
15 |
if( nKey==pOp->nOpt && !sqlite3_strnicmp(z, pOp->zOpt, pOp->nOpt) ){ |
|
3 |
0 |
if( nKey==pOp->nOpt && !sqlite3_strnicmp(z, pOp->zOpt, pOp->nOpt) ){ |
153533
|
0 |
0 |
if( strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "fts3", 4) ){ |
|
0 |
0 |
if( strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "fts3", 4) ){ |
153559
|
0 |
0 |
if( (strlen(zVal)!=3 || sqlite3_strnicmp(zVal, "asc", 3)) |
|
0 |
0 |
if( (strlen(zVal)!=3 || sqlite3_strnicmp(zVal, "asc", 3)) |
153560
|
0 |
0 |
&& (strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "desc", 4)) |
|
0 |
0 |
&& (strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "desc", 4)) |
153565
|
0 |
0 |
bDescIdx = (zVal[0]=='d' || zVal[0]=='D'); |
|
0 |
0 |
bDescIdx = (zVal[0]=='d' || zVal[0]=='D'); |
153610
|
9 |
1 |
if( rc==SQLITE_OK && zContent ){ |
|
3 |
6 |
if( rc==SQLITE_OK && zContent ){ |
153615
|
2 |
1 |
if( nCol==0 ){ |
153622
|
2 |
0 |
if( rc==SQLITE_OK && zLanguageid ){ |
|
0 |
2 |
if( rc==SQLITE_OK && zLanguageid ){ |
153624
|
0 |
0 |
for(j=0; j
|
153625
|
0 |
0 |
if( sqlite3_stricmp(zLanguageid, aCol[j])==0 ){ |
153627
|
0 |
0 |
for(k=j; k
|
153635
|
1 |
9 |
if( rc!=SQLITE_OK ) goto fts3_init_out; |
153637
|
0 |
9 |
if( nCol==0 ){ |
153644
|
4 |
5 |
if( pTokenizer==0 ){ |
153646
|
0 |
4 |
if( rc!=SQLITE_OK ) goto fts3_init_out; |
153651
|
0 |
9 |
if( rc==SQLITE_ERROR ){ |
153655
|
0 |
9 |
if( rc!=SQLITE_OK ) goto fts3_init_out; |
153666
|
0 |
9 |
if( p==0 ){ |
153677
|
6 |
3 |
p->bHasDocsize = (isFts4 && bNoDocsize==0); |
|
6 |
0 |
p->bHasDocsize = (isFts4 && bNoDocsize==0); |
153692
|
9 |
9 |
for(i=0; i
|
153707
|
14 |
9 |
for(iCol=0; iCol
|
153711
|
14 |
0 |
if( n>0 ){ |
153722
|
14 |
9 |
for(iCol=0; iCol
|
153724
|
0 |
14 |
for(i=0; i
|
153726
|
0 |
0 |
if( zNot && n==(int)strlen(zNot) |
|
0 |
0 |
if( zNot && n==(int)strlen(zNot) |
153727
|
0 |
0 |
&& 0==sqlite3_strnicmp(p->azColumn[iCol], zNot, n) |
153735
|
0 |
9 |
for(i=0; i
|
153736
|
0 |
0 |
if( azNotindexed[i] ){ |
153742
|
9 |
0 |
if( rc==SQLITE_OK && (zCompress==0)!=(zUncompress==0) ){ |
|
0 |
9 |
if( rc==SQLITE_OK && (zCompress==0)!=(zUncompress==0) ){ |
153743
|
0 |
0 |
char const *zMiss = (zCompress==0 ? "compress" : "uncompress"); |
153749
|
0 |
9 |
if( rc!=SQLITE_OK ) goto fts3_init_out; |
153754
|
8 |
1 |
if( isCreate ){ |
153761
|
3 |
6 |
if( !isFts4 && !isCreate ){ |
|
0 |
3 |
if( !isFts4 && !isCreate ){ |
153780
|
0 |
10 |
for(i=0; i
|
153783
|
1 |
9 |
if( rc!=SQLITE_OK ){ |
153784
|
0 |
1 |
if( p ){ |
153786
|
0 |
1 |
}else if( pTokenizer ){ |
153828
|
0 |
0 |
if( sqlite3_libversion_number()>=3008002 ){ |
153841
|
0 |
0 |
if( sqlite3_libversion_number()>=3008012 ){ |
153871
|
47 |
47 |
for(i=0; inConstraint; i++){ |
153874
|
0 |
47 |
if( pCons->usable==0 ){ |
153875
|
0 |
0 |
if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH ){ |
153889
|
47 |
0 |
bDocid = (pCons->iColumn<0 || pCons->iColumn==p->nColumn+1); |
|
0 |
47 |
bDocid = (pCons->iColumn<0 || pCons->iColumn==p->nColumn+1); |
153892
|
47 |
0 |
if( iCons<0 && pCons->op==SQLITE_INDEX_CONSTRAINT_EQ && bDocid ){ |
|
1 |
46 |
if( iCons<0 && pCons->op==SQLITE_INDEX_CONSTRAINT_EQ && bDocid ){ |
|
0 |
1 |
if( iCons<0 && pCons->op==SQLITE_INDEX_CONSTRAINT_EQ && bDocid ){ |
153907
|
46 |
1 |
if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH |
153908
|
46 |
0 |
&& pCons->iColumn>=0 && pCons->iColumn<=p->nColumn |
|
46 |
0 |
&& pCons->iColumn>=0 && pCons->iColumn<=p->nColumn |
153916
|
1 |
46 |
if( pCons->op==SQLITE_INDEX_CONSTRAINT_EQ |
153917
|
0 |
1 |
&& pCons->iColumn==p->nColumn + 2 |
153922
|
0 |
47 |
if( bDocid ){ |
153938
|
0 |
47 |
if( pInfo->idxNum==FTS3_DOCID_SEARCH ) fts3SetUniqueFlag(pInfo); |
153941
|
46 |
1 |
if( iCons>=0 ){ |
153945
|
0 |
47 |
if( iLangidCons>=0 ){ |
153949
|
0 |
47 |
if( iDocidGe>=0 ){ |
153953
|
0 |
47 |
if( iDocidLe>=0 ){ |
153961
|
0 |
47 |
if( pInfo->nOrderBy==1 ){ |
153963
|
0 |
0 |
if( pOrder->iColumn<0 || pOrder->iColumn==p->nColumn+1 ){ |
|
0 |
0 |
if( pOrder->iColumn<0 || pOrder->iColumn==p->nColumn+1 ){ |
153964
|
0 |
0 |
if( pOrder->desc ){ |
153990
|
0 |
47 |
if( !pCsr ){ |
154005
|
14 |
127 |
if( pCsr->bSeekStmt ){ |
154007
|
14 |
0 |
if( p->pSeekStmt==0 ){ |
154054
|
14 |
41 |
if( pCsr->pStmt==0 ){ |
154057
|
10 |
4 |
if( p->pSeekStmt ){ |
154062
|
0 |
4 |
if( !zSql ) return SQLITE_NOMEM; |
154066
|
14 |
0 |
if( rc==SQLITE_OK ) pCsr->bSeekStmt = 1; |
154078
|
55 |
16 |
if( pCsr->isRequireSeek ){ |
154080
|
55 |
0 |
if( rc==SQLITE_OK ){ |
154083
|
55 |
0 |
if( SQLITE_ROW==sqlite3_step(pCsr->pStmt) ){ |
154087
|
0 |
0 |
if( rc==SQLITE_OK && ((Fts3Table *)pCsr->base.pVtab)->zContentTbl==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && ((Fts3Table *)pCsr->base.pVtab)->zContentTbl==0 ){ |
154098
|
0 |
16 |
if( rc!=SQLITE_OK && pContext ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && pContext ){ |
154150
|
0 |
45 |
if( zCsr>zEnd ){ |
154154
|
363 |
33 |
while( zCsr
|
|
351 |
12 |
while( zCsr
|
|
0 |
12 |
while( zCsr
|
154162
|
306 |
45 |
if( !isFirstTerm ){ |
154163
|
0 |
306 |
zCsr += fts3GetVarint32(zCsr, &nPrefix); |
154166
|
0 |
351 |
zCsr += fts3GetVarint32(zCsr, &nSuffix); |
154169
|
0 |
351 |
if( &zCsr[nSuffix]>zEnd ){ |
154173
|
45 |
306 |
if( nPrefix+nSuffix>nAlloc ){ |
154177
|
0 |
45 |
if( !zNew ){ |
154198
|
351 |
0 |
if( piFirst && (cmp<0 || (cmp==0 && nBuffer>nTerm)) ){ |
|
326 |
25 |
if( piFirst && (cmp<0 || (cmp==0 && nBuffer>nTerm)) ){ |
|
3 |
323 |
if( piFirst && (cmp<0 || (cmp==0 && nBuffer>nTerm)) ){ |
|
0 |
3 |
if( piFirst && (cmp<0 || (cmp==0 && nBuffer>nTerm)) ){ |
154203
|
0 |
351 |
if( piLast && cmp<0 ){ |
|
0 |
0 |
if( piLast && cmp<0 ){ |
154211
|
20 |
25 |
if( piFirst ) *piFirst = iChild; |
154212
|
0 |
45 |
if( piLast ) *piLast = iChild; |
154255
|
0 |
45 |
fts3GetVarint32(zNode, &iHeight); |
154259
|
45 |
0 |
if( rc==SQLITE_OK && iHeight>1 ){ |
|
0 |
45 |
if( rc==SQLITE_OK && iHeight>1 ){ |
154263
|
0 |
0 |
if( piLeaf && piLeaf2 && (*piLeaf!=*piLeaf2) ){ |
|
0 |
0 |
if( piLeaf && piLeaf2 && (*piLeaf!=*piLeaf2) ){ |
|
0 |
0 |
if( piLeaf && piLeaf2 && (*piLeaf!=*piLeaf2) ){ |
154265
|
0 |
0 |
if( rc==SQLITE_OK ){ |
154273
|
0 |
0 |
if( rc==SQLITE_OK ){ |
154274
|
0 |
0 |
rc = sqlite3Fts3ReadBlock(p, piLeaf?*piLeaf:*piLeaf2, &zBlob, &nBlob, 0); |
154276
|
0 |
0 |
if( rc==SQLITE_OK ){ |
154327
|
20 |
148 |
while( *pEnd | c ){ |
154333
|
8 |
140 |
if( pp ){ |
154367
|
992 |
128 |
while( 0xFE & (*pEnd | c) ){ |
154371
|
0 |
128 |
if( pp ){ |
154409
|
0 |
0 |
if( (**pp)&0xFE ){ |
154428
|
0 |
0 |
if( iCol ){ |
154453
|
0 |
0 |
while( *p1 || *p2 ){ |
|
0 |
0 |
while( *p1 || *p2 ){ |
154457
|
0 |
0 |
if( *p1==POS_COLUMN ) fts3GetVarint32(&p1[1], &iCol1); |
|
0 |
0 |
if( *p1==POS_COLUMN ) fts3GetVarint32(&p1[1], &iCol1); |
154458
|
0 |
0 |
else if( *p1==POS_END ) iCol1 = POSITION_LIST_END; |
154461
|
0 |
0 |
if( *p2==POS_COLUMN ) fts3GetVarint32(&p2[1], &iCol2); |
|
0 |
0 |
if( *p2==POS_COLUMN ) fts3GetVarint32(&p2[1], &iCol2); |
154462
|
0 |
0 |
else if( *p2==POS_END ) iCol2 = POSITION_LIST_END; |
154465
|
0 |
0 |
if( iCol1==iCol2 ){ |
154487
|
0 |
0 |
if( i1==i2 ){ |
154490
|
0 |
0 |
}else if( i1
|
154495
|
0 |
0 |
}while( i1!=POSITION_LIST_END || i2!=POSITION_LIST_END ); |
|
0 |
0 |
}while( i1!=POSITION_LIST_END || i2!=POSITION_LIST_END ); |
154496
|
0 |
0 |
}else if( iCol1
|
154552
|
0 |
64 |
if( *p1==POS_COLUMN ){ |
154554
|
0 |
0 |
p1 += fts3GetVarint32(p1, &iCol1); |
154556
|
0 |
64 |
if( *p2==POS_COLUMN ){ |
154558
|
0 |
0 |
p2 += fts3GetVarint32(p2, &iCol2); |
154562
|
64 |
0 |
if( iCol1==iCol2 ){ |
154568
|
0 |
64 |
if( iCol1 ){ |
154579
|
325 |
82 |
if( iPos2==iPos1+nToken |
154580
|
0 |
325 |
|| (isExact==0 && iPos2>iPos1 && iPos2<=iPos1+nToken) |
|
0 |
0 |
|| (isExact==0 && iPos2>iPos1 && iPos2<=iPos1+nToken) |
|
0 |
0 |
|| (isExact==0 && iPos2>iPos1 && iPos2<=iPos1+nToken) |
154583
|
0 |
82 |
iSave = isSaveLeft ? iPos1 : iPos2; |
154588
|
407 |
0 |
if( (!isSaveLeft && iPos2<=(iPos1+nToken)) || iPos2<=iPos1 ){ |
|
223 |
184 |
if( (!isSaveLeft && iPos2<=(iPos1+nToken)) || iPos2<=iPos1 ){ |
|
0 |
223 |
if( (!isSaveLeft && iPos2<=(iPos1+nToken)) || iPos2<=iPos1 ){ |
154589
|
61 |
123 |
if( (*p2&0xFE)==0 ) break; |
154592
|
3 |
220 |
if( (*p1&0xFE)==0 ) break; |
154597
|
3 |
61 |
if( pSave ){ |
154605
|
0 |
64 |
if( 0==*p1 || 0==*p2 ) break; |
|
0 |
0 |
if( 0==*p1 || 0==*p2 ) break; |
154608
|
0 |
0 |
p1 += fts3GetVarint32(p1, &iCol1); |
154610
|
0 |
0 |
p2 += fts3GetVarint32(p2, &iCol2); |
154618
|
0 |
0 |
else if( iCol1
|
154620
|
0 |
0 |
if( 0==*p1 ) break; |
154622
|
0 |
0 |
p1 += fts3GetVarint32(p1, &iCol1); |
154625
|
0 |
0 |
if( 0==*p2 ) break; |
154627
|
0 |
0 |
p2 += fts3GetVarint32(p2, &iCol2); |
154635
|
3 |
61 |
if( *pp==p ){ |
154679
|
0 |
0 |
if( pTmp1!=aTmp && pTmp2!=aTmp2 ){ |
|
0 |
0 |
if( pTmp1!=aTmp && pTmp2!=aTmp2 ){ |
154681
|
0 |
0 |
}else if( pTmp1!=aTmp ){ |
154683
|
0 |
0 |
}else if( pTmp2!=aTmp2 ){ |
154722
|
8 |
8 |
if( *pp>=pEnd ){ |
154727
|
0 |
8 |
if( bDescIdx ){ |
154758
|
0 |
8 |
if( bDescIdx==0 || *pbFirst==0 ){ |
|
0 |
0 |
if( bDescIdx==0 || *pbFirst==0 ){ |
154846
|
0 |
4 |
if( !aOut ) return SQLITE_NOMEM; |
154851
|
4 |
8 |
while( p1 || p2 ){ |
|
4 |
4 |
while( p1 || p2 ){ |
154852
|
0 |
8 |
sqlite3_int64 iDiff = DOCID_CMP(i1, i2); |
154854
|
8 |
0 |
if( p2 && p1 && iDiff==0 ){ |
|
4 |
4 |
if( p2 && p1 && iDiff==0 ){ |
|
0 |
4 |
if( p2 && p1 && iDiff==0 ){ |
154859
|
8 |
0 |
}else if( !p2 || (p1 && iDiff<0) ){ |
|
4 |
4 |
}else if( !p2 || (p1 && iDiff<0) ){ |
|
4 |
0 |
}else if( !p2 || (p1 && iDiff<0) ){ |
154907
|
0 |
0 |
if( bDescDoclist ){ |
154909
|
0 |
0 |
if( aOut==0 ) return SQLITE_NOMEM; |
154918
|
0 |
0 |
while( p1 && p2 ){ |
|
0 |
0 |
while( p1 && p2 ){ |
154919
|
0 |
0 |
sqlite3_int64 iDiff = DOCID_CMP(i1, i2); |
154920
|
0 |
0 |
if( iDiff==0 ){ |
154926
|
0 |
0 |
if( 0==fts3PoslistPhraseMerge(&p, nDist, 0, 1, &p1, &p2) ){ |
154933
|
0 |
0 |
}else if( iDiff<0 ){ |
154943
|
0 |
0 |
if( bDescDoclist ){ |
154970
|
0 |
0 |
if( *p!=0x01 ){ |
154971
|
0 |
0 |
if( *p==0x02 ){ |
154979
|
0 |
0 |
while( p
|
154983
|
0 |
0 |
if( *p==0x02 ){ |
154984
|
0 |
0 |
if( bWritten==0 ){ |
154994
|
0 |
0 |
if( bWritten ){ |
155019
|
128 |
8 |
for(i=0; iaaOutput); i++){ |
155020
|
8 |
120 |
if( pTS->aaOutput[i] ){ |
155021
|
8 |
0 |
if( !aOut ){ |
155032
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
155071
|
8 |
4 |
if( pTS->aaOutput[0]==0 ){ |
155090
|
8 |
0 |
if( pTS->aaOutput[0] ){ |
155100
|
8 |
0 |
for(iOut=0; iOutaaOutput); iOut++){ |
155101
|
4 |
4 |
if( pTS->aaOutput[iOut]==0 ){ |
155113
|
0 |
4 |
if( rc!=SQLITE_OK ){ |
155114
|
0 |
0 |
if( aMerge!=aDoclist ) sqlite3_free(aMerge); |
155118
|
0 |
4 |
if( aMerge!=aDoclist ) sqlite3_free(aMerge); |
155124
|
0 |
4 |
if( (iOut+1)==SizeofArray(pTS->aaOutput) ){ |
155141
|
112 |
191 |
if( (pCsr->nSegment%16)==0 ){ |
155145
|
0 |
112 |
if( !apNew ){ |
155183
|
120 |
0 |
if( iLevel<0 && p->aIndex ){ |
|
119 |
1 |
if( iLevel<0 && p->aIndex ){ |
155185
|
77 |
42 |
rc = sqlite3Fts3SegReaderPending(p, iIndex, zTerm, nTerm, isPrefix||isScan, &pSeg); |
|
0 |
77 |
rc = sqlite3Fts3SegReaderPending(p, iIndex, zTerm, nTerm, isPrefix||isScan, &pSeg); |
155186
|
119 |
0 |
if( rc==SQLITE_OK && pSeg ){ |
|
27 |
92 |
if( rc==SQLITE_OK && pSeg ){ |
155191
|
86 |
34 |
if( iLevel!=FTS3_SEGCURSOR_PENDING ){ |
155192
|
86 |
0 |
if( rc==SQLITE_OK ){ |
155196
|
362 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){ |
|
276 |
86 |
while( rc==SQLITE_OK && SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){ |
155208
|
45 |
231 |
if( iStartBlock && zTerm ){ |
|
45 |
0 |
if( iStartBlock && zTerm ){ |
155209
|
0 |
45 |
sqlite3_int64 *pi = (isPrefix ? &iLeavesEndBlock : 0); |
155211
|
0 |
45 |
if( rc!=SQLITE_OK ) goto finished; |
155212
|
45 |
0 |
if( isPrefix==0 && isScan==0 ) iLeavesEndBlock = iStartBlock; |
|
45 |
0 |
if( isPrefix==0 && isScan==0 ) iLeavesEndBlock = iStartBlock; |
155215
|
244 |
32 |
rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1, |
|
241 |
3 |
rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1, |
155220
|
0 |
276 |
if( rc!=SQLITE_OK ) goto finished; |
155227
|
86 |
34 |
if( rc==SQLITE_DONE ) rc = rc2; |
155304
|
85 |
0 |
if( pSegcsr ){ |
155309
|
8 |
77 |
if( isPrefix ){ |
155310
|
8 |
0 |
for(i=1; bFound==0 && inIndex; i++){ |
|
0 |
8 |
for(i=1; bFound==0 && inIndex; i++){ |
155311
|
0 |
0 |
if( p->aIndex[i].nPrefix==nTerm ){ |
155320
|
8 |
0 |
for(i=1; bFound==0 && inIndex; i++){ |
|
0 |
8 |
for(i=1; bFound==0 && inIndex; i++){ |
155321
|
0 |
0 |
if( p->aIndex[i].nPrefix==nTerm+1 ){ |
155326
|
0 |
0 |
if( rc==SQLITE_OK ){ |
155335
|
85 |
0 |
if( bFound==0 ){ |
155375
|
8 |
0 |
| (pTok->isPrefix ? FTS3_SEGMENT_PREFIX : 0) |
155376
|
0 |
8 |
| (pTok->bFirst ? FTS3_SEGMENT_FIRST : 0) |
155377
|
8 |
0 |
| (iColumnnColumn ? FTS3_SEGMENT_COLUMN_FILTER : 0); |
155383
|
20 |
0 |
while( SQLITE_OK==rc |
155384
|
12 |
8 |
&& SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, pSegcsr)) |
155389
|
8 |
0 |
if( rc==SQLITE_OK ){ |
155392
|
8 |
0 |
if( rc==SQLITE_OK ){ |
155397
|
0 |
0 |
for(i=0; i
|
155418
|
0 |
0 |
if( aList ){ |
155421
|
0 |
0 |
while( p
|
155423
|
0 |
0 |
while( (*p++)&0x80 ); /* Skip docid varint */ |
155445
|
147 |
0 |
if( pCsr->eSearch==FTS3_DOCID_SEARCH || pCsr->eSearch==FTS3_FULLSCAN_SEARCH ){ |
|
10 |
137 |
if( pCsr->eSearch==FTS3_DOCID_SEARCH || pCsr->eSearch==FTS3_FULLSCAN_SEARCH ){ |
155446
|
1 |
9 |
if( SQLITE_ROW!=sqlite3_step(pCsr->pStmt) ){ |
155478
|
0 |
94 |
if( pVal ){ |
155480
|
0 |
0 |
if( eType==SQLITE_INTEGER ){ |
155531
|
46 |
1 |
if( eSearch!=FTS3_FULLSCAN_SEARCH ) pCons = apVal[iIdx++]; |
155532
|
0 |
47 |
if( idxNum & FTS3_HAVE_LANGID ) pLangid = apVal[iIdx++]; |
155533
|
0 |
47 |
if( idxNum & FTS3_HAVE_DOCID_GE ) pDocidGe = apVal[iIdx++]; |
155534
|
0 |
47 |
if( idxNum & FTS3_HAVE_DOCID_LE ) pDocidLe = apVal[iIdx++]; |
155544
|
0 |
47 |
if( idxStr ){ |
155551
|
47 |
0 |
if( eSearch!=FTS3_DOCID_SEARCH && eSearch!=FTS3_FULLSCAN_SEARCH ){ |
|
46 |
1 |
if( eSearch!=FTS3_DOCID_SEARCH && eSearch!=FTS3_FULLSCAN_SEARCH ){ |
155555
|
0 |
46 |
if( zQuery==0 && sqlite3_value_type(pCons)!=SQLITE_NULL ){ |
|
0 |
0 |
if( zQuery==0 && sqlite3_value_type(pCons)!=SQLITE_NULL ){ |
155560
|
0 |
46 |
if( pLangid ) pCsr->iLangid = sqlite3_value_int(pLangid); |
155567
|
0 |
46 |
if( rc!=SQLITE_OK ){ |
155573
|
0 |
46 |
if( rc!=SQLITE_OK ) return rc; |
155583
|
1 |
46 |
if( eSearch==FTS3_FULLSCAN_SEARCH ){ |
155584
|
1 |
0 |
if( pDocidGe || pDocidLe ){ |
|
0 |
1 |
if( pDocidGe || pDocidLe ){ |
155585
|
0 |
0 |
zSql = sqlite3_mprintf( |
155591
|
0 |
1 |
zSql = sqlite3_mprintf("SELECT %s ORDER BY rowid %s", |
155595
|
1 |
0 |
if( zSql ){ |
155601
|
0 |
46 |
}else if( eSearch==FTS3_DOCID_SEARCH ){ |
155603
|
0 |
0 |
if( rc==SQLITE_OK ){ |
155607
|
0 |
47 |
if( rc!=SQLITE_OK ) return rc; |
155618
|
47 |
100 |
if( pCsr->isEof ){ |
155672
|
0 |
0 |
if( pCsr->pExpr ){ |
155675
|
0 |
0 |
}else if( p->zLanguageid==0 ){ |
155687
|
71 |
0 |
if( rc==SQLITE_OK && sqlite3_data_count(pCsr->pStmt)-1>iCol ){ |
|
71 |
0 |
if( rc==SQLITE_OK && sqlite3_data_count(pCsr->pStmt)-1>iCol ){ |
155743
|
33 |
0 |
if( rc==SQLITE_OK |
155744
|
1 |
32 |
&& p->nLeafAdd>(nMinMerge/16) |
155745
|
0 |
1 |
&& p->nAutoincrmerge && p->nAutoincrmerge!=0xff |
|
0 |
0 |
&& p->nAutoincrmerge && p->nAutoincrmerge!=0xff |
155754
|
0 |
0 |
if( A>(int)nMinMerge ) rc = sqlite3Fts3Incrmerge(p, A, p->nAutoincrmerge); |
155769
|
0 |
25 |
if( p->bHasStat==2 ){ |
155771
|
0 |
0 |
if( zTbl ){ |
155837
|
0 |
0 |
while( p>pStart && (c=*p--)==0 ); |
|
0 |
0 |
while( p>pStart && (c=*p--)==0 ); |
155842
|
0 |
0 |
while( p>pStart && (*p & 0x80) | c ){ |
|
0 |
0 |
while( p>pStart && (*p & 0x80) | c ){ |
155860
|
0 |
0 |
if( p>pStart || (c==0 && *ppPoslist>&p[2]) ){ p = &p[2]; } |
|
0 |
0 |
if( p>pStart || (c==0 && *ppPoslist>&p[2]) ){ p = &p[2]; } |
|
0 |
0 |
if( p>pStart || (c==0 && *ppPoslist>&p[2]) ){ p = &p[2]; } |
155861
|
0 |
0 |
while( *p++&0x80 ); |
155883
|
0 |
0 |
if( (*ppCsr)!=0 ){ |
155914
|
0 |
0 |
if( nVal>6 ){ |
155919
|
0 |
0 |
if( fts3FunctionArg(pContext, "snippet", apVal[0], &pCsr) ) return; |
155928
|
0 |
0 |
if( !zEllipsis || !zEnd || !zStart ){ |
|
0 |
0 |
if( !zEllipsis || !zEnd || !zStart ){ |
|
0 |
0 |
if( !zEllipsis || !zEnd || !zStart ){ |
155930
|
0 |
0 |
}else if( nToken==0 ){ |
155932
|
0 |
0 |
}else if( SQLITE_OK==fts3CursorSeek(pContext, pCsr) ){ |
155950
|
0 |
0 |
if( fts3FunctionArg(pContext, "offsets", apVal[0], &pCsr) ) return; |
155952
|
0 |
0 |
if( SQLITE_OK==fts3CursorSeek(pContext, pCsr) ){ |
155978
|
0 |
0 |
if( fts3FunctionArg(pContext, "optimize", apVal[0], &pCursor) ) return; |
156007
|
0 |
0 |
if( SQLITE_OK==fts3FunctionArg(pContext, "matchinfo", apVal[0], &pCsr) ){ |
156009
|
0 |
0 |
if( nVal>1 ){ |
156042
|
0 |
0 |
for(i=0; i
|
156043
|
0 |
0 |
if( strcmp(zName, aOverload[i].zName)==0 ){ |
156075
|
0 |
0 |
if( rc==SQLITE_OK ){ |
156079
|
0 |
0 |
if( p->zContentTbl==0 ){ |
156086
|
0 |
0 |
if( p->bHasDocsize ){ |
156092
|
0 |
0 |
if( p->bHasStat ){ |
156120
|
0 |
0 |
if( ((Fts3Table *)pVtab)->bIgnoreSavepoint==0 ){ |
156242
|
0 |
262 |
if( rc!=SQLITE_OK ) return rc; |
156249
|
0 |
262 |
if( !pHash ){ |
156256
|
262 |
0 |
if( rc==SQLITE_OK ){ |
156257
|
262 |
0 |
if( sqlite3Fts3HashInsert(pHash, "simple", 7, (void *)pSimple) |
156258
|
262 |
0 |
|| sqlite3Fts3HashInsert(pHash, "porter", 7, (void *)pPorter) |
156261
|
0 |
262 |
|| sqlite3Fts3HashInsert(pHash, "unicode61", 10, (void *)pUnicode) |
156281
|
262 |
0 |
if( SQLITE_OK==rc |
156282
|
262 |
0 |
&& SQLITE_OK==(rc = sqlite3Fts3InitHashTable(db, pHash, "fts3_tokenizer")) |
156283
|
262 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1)) |
156284
|
262 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", 1)) |
156285
|
262 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 1)) |
156286
|
262 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 2)) |
156287
|
262 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "optimize", 1)) |
156292
|
262 |
0 |
if( rc==SQLITE_OK ){ |
156297
|
262 |
0 |
if( rc==SQLITE_OK ){ |
156306
|
0 |
0 |
if( pHash ){ |
156335
|
98 |
0 |
if( pExpr && SQLITE_OK==*pRc ){ |
|
98 |
0 |
if( pExpr && SQLITE_OK==*pRc ){ |
156336
|
72 |
26 |
if( pExpr->eType==FTSQUERY_PHRASE ){ |
156340
|
85 |
72 |
for(i=0; i
|
156345
|
0 |
85 |
if( rc!=SQLITE_OK ){ |
156380
|
0 |
8 |
if( pList==0 ){ |
156386
|
8 |
0 |
else if( p->iDoclistToken<0 ){ |
156391
|
0 |
0 |
else if( p->doclist.aAll==0 ){ |
156402
|
0 |
0 |
if( p->iDoclistToken
|
156424
|
8 |
0 |
if( iToken>p->iDoclistToken ) p->iDoclistToken = iToken; |
156442
|
16 |
0 |
for(iToken=0; rc==SQLITE_OK && iTokennToken; iToken++){ |
|
8 |
8 |
for(iToken=0; rc==SQLITE_OK && iTokennToken; iToken++){ |
156446
|
8 |
0 |
if( pToken->pSegcsr ){ |
156450
|
8 |
0 |
if( rc==SQLITE_OK ){ |
156478
|
0 |
0 |
for(iToken=0; iTokennToken; iToken++){ |
156482
|
0 |
0 |
if( pDeferred ){ |
156486
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
156488
|
0 |
0 |
if( pList==0 ){ |
156494
|
0 |
0 |
}else if( aPoslist==0 ){ |
156508
|
0 |
0 |
if( nPoslist==0 ){ |
156519
|
0 |
0 |
if( iPrev>=0 ){ |
156521
|
0 |
0 |
if( nMaxUndeferred<0 ){ |
156532
|
0 |
0 |
if( nMaxUndeferred>iPrev ){ |
156543
|
0 |
0 |
if( !aOut ){ |
156549
|
0 |
0 |
if( fts3PoslistPhraseMerge(&aOut, nDistance, 0, 1, &p1, &p2) ){ |
156594
|
72 |
0 |
&& pCsr->bDesc==pTab->bDescIdx |
156595
|
72 |
0 |
&& p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 |
|
72 |
0 |
&& p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 |
|
72 |
0 |
&& p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 |
156600
|
149 |
8 |
for(i=0; bIncrOk==1 && inToken; i++){ |
|
85 |
64 |
for(i=0; bIncrOk==1 && inToken; i++){ |
156602
|
85 |
0 |
if( pToken->bFirst || (pToken->pSegcsr!=0 && !pToken->pSegcsr->bLookup) ){ |
|
85 |
0 |
if( pToken->bFirst || (pToken->pSegcsr!=0 && !pToken->pSegcsr->bLookup) ){ |
|
8 |
77 |
if( pToken->bFirst || (pToken->pSegcsr!=0 && !pToken->pSegcsr->bLookup) ){ |
156605
|
85 |
0 |
if( pToken->pSegcsr ) bHaveIncr = 1; |
156608
|
64 |
8 |
if( bIncrOk && bHaveIncr ){ |
|
64 |
0 |
if( bIncrOk && bHaveIncr ){ |
156610
|
46 |
18 |
int iCol = (p->iColumn >= pTab->nColumn ? -1 : p->iColumn); |
156611
|
141 |
0 |
for(i=0; rc==SQLITE_OK && inToken; i++){ |
|
77 |
64 |
for(i=0; rc==SQLITE_OK && inToken; i++){ |
156614
|
77 |
0 |
if( pSegcsr ){ |
156655
|
0 |
0 |
if( p==0 ){ |
156662
|
0 |
0 |
while( pDocid
|
156668
|
0 |
0 |
while( pDocid
|
|
0 |
0 |
while( pDocid
|
156669
|
0 |
0 |
iMul = (bDescIdx ? -1 : 1); |
156676
|
0 |
0 |
int iMul = (bDescIdx ? -1 : 1); |
156681
|
0 |
0 |
if( p==aDoclist ){ |
156710
|
0 |
0 |
if( p==0 ){ |
156715
|
0 |
0 |
while( p<&aDoclist[nDoclist] && *p==0 ) p++; |
|
0 |
0 |
while( p<&aDoclist[nDoclist] && *p==0 ) p++; |
156716
|
0 |
0 |
if( p>=&aDoclist[nDoclist] ){ |
156721
|
0 |
0 |
*piDocid += ((bDescIdx ? -1 : 1) * iVar); |
156740
|
12 |
8 |
if( pDL->pNextDocid ){ |
156746
|
8 |
12 |
if( pIter>=pEnd ){ |
156752
|
0 |
12 |
if( pTab->bDescIdx==0 || pDL->pNextDocid==0 ){ |
|
0 |
0 |
if( pTab->bDescIdx==0 || pDL->pNextDocid==0 ){ |
156767
|
4 |
8 |
while( pIter
|
|
0 |
4 |
while( pIter
|
156804
|
0 |
153 |
if( pPhrase->iDoclistToken==iToken ){ |
156815
|
153 |
0 |
if( pToken->pSegcsr ){ |
156820
|
10 |
143 |
if( p->pList==0 ) *pbEof = 1; |
156861
|
114 |
71 |
if( p->nToken==1 ){ |
156865
|
44 |
70 |
if( pDL->pList==0 ) bEof = 1; |
156874
|
74 |
10 |
while( bEof==0 ){ |
156880
|
215 |
0 |
for(i=0; rc==SQLITE_OK && inToken && bEof==0; i++){ |
|
148 |
67 |
for(i=0; rc==SQLITE_OK && inToken && bEof==0; i++){ |
|
141 |
7 |
for(i=0; rc==SQLITE_OK && inToken && bEof==0; i++){ |
156882
|
141 |
0 |
if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ |
|
67 |
74 |
if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ |
|
0 |
67 |
if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ |
|
12 |
55 |
if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ |
156891
|
148 |
74 |
for(i=0; inToken; i++){ |
156892
|
160 |
0 |
while( rc==SQLITE_OK && bEof==0 |
|
140 |
20 |
while( rc==SQLITE_OK && bEof==0 |
156893
|
140 |
0 |
&& a[i].bIgnore==0 && DOCID_CMP(a[i].iDocid, iMax)<0 |
|
0 |
140 |
&& a[i].bIgnore==0 && DOCID_CMP(a[i].iDocid, iMax)<0 |
|
12 |
128 |
&& a[i].bIgnore==0 && DOCID_CMP(a[i].iDocid, iMax)<0 |
156896
|
0 |
12 |
if( DOCID_CMP(a[i].iDocid, iMax)>0 ){ |
|
0 |
12 |
if( DOCID_CMP(a[i].iDocid, iMax)>0 ){ |
156904
|
64 |
10 |
if( bEof==0 ){ |
156908
|
0 |
64 |
if( !aDoclist ) return SQLITE_NOMEM; |
156911
|
64 |
61 |
for(i=0; i<(p->nToken-1); i++){ |
156912
|
64 |
0 |
if( a[i].bIgnore==0 ){ |
156918
|
3 |
61 |
if( res==0 ) break; |
156922
|
61 |
3 |
if( i==(p->nToken-1) ){ |
156956
|
185 |
20 |
if( p->bIncr ){ |
156958
|
0 |
20 |
}else if( pCsr->bDesc!=pTab->bDescIdx && pDL->nAll ){ |
|
0 |
0 |
}else if( pCsr->bDesc!=pTab->bDescIdx && pDL->nAll ){ |
156991
|
98 |
0 |
if( pExpr && SQLITE_OK==*pRc ){ |
|
98 |
0 |
if( pExpr && SQLITE_OK==*pRc ){ |
156992
|
72 |
26 |
if( pExpr->eType==FTSQUERY_PHRASE ){ |
156994
|
72 |
0 |
if( nToken ){ |
156996
|
72 |
0 |
for(i=0; i
|
156997
|
72 |
0 |
if( pExpr->pPhrase->aToken[i].pDeferred==0 ) break; |
157005
|
0 |
26 |
pExpr->bDeferred = (pExpr->pLeft->bDeferred && pExpr->pRight->bDeferred); |
|
0 |
0 |
pExpr->bDeferred = (pExpr->pLeft->bDeferred && pExpr->pRight->bDeferred); |
157047
|
47 |
0 |
if( *pRc==SQLITE_OK ){ |
157048
|
31 |
16 |
if( pExpr->eType==FTSQUERY_PHRASE ){ |
157051
|
73 |
0 |
for(i=0; *pRc==SQLITE_OK && inToken; i++){ |
|
42 |
31 |
for(i=0; *pRc==SQLITE_OK && inToken; i++){ |
157060
|
14 |
2 |
}else if( pExpr->eType!=FTSQUERY_NOT ){ |
157066
|
2 |
12 |
if( pExpr->eType==FTSQUERY_OR ){ |
157072
|
2 |
12 |
if( pExpr->eType==FTSQUERY_OR ){ |
157095
|
0 |
0 |
if( pCsr->nRowAvg==0 ){ |
157115
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
157121
|
0 |
0 |
while( a
|
157124
|
0 |
0 |
if( nDoc==0 || nByte==0 ){ |
|
0 |
0 |
if( nDoc==0 || nByte==0 ){ |
157174
|
9 |
14 |
if( pTab->zContentTbl ){ |
157181
|
30 |
14 |
for(ii=0; ii
|
157182
|
18 |
12 |
if( aTC[ii].pRoot==pRoot ){ |
157187
|
0 |
14 |
if( nOvfl==0 || nToken<2 ) return SQLITE_OK; |
|
0 |
0 |
if( nOvfl==0 || nToken<2 ) return SQLITE_OK; |
157216
|
0 |
0 |
for(ii=0; ii
|
|
0 |
0 |
for(ii=0; ii
|
157221
|
0 |
0 |
for(iTC=0; iTC
|
157222
|
0 |
0 |
if( aTC[iTC].pToken && aTC[iTC].pRoot==pRoot |
|
0 |
0 |
if( aTC[iTC].pToken && aTC[iTC].pRoot==pRoot |
157223
|
0 |
0 |
&& (!pTC || aTC[iTC].nOvflnOvfl) |
|
0 |
0 |
&& (!pTC || aTC[iTC].nOvflnOvfl) |
157230
|
0 |
0 |
if( ii && pTC->nOvfl>=((nMinEst+(nLoad4/4)-1)/(nLoad4/4))*nDocSize ){ |
|
0 |
0 |
if( ii && pTC->nOvfl>=((nMinEst+(nLoad4/4)-1)/(nLoad4/4))*nDocSize ){ |
157243
|
0 |
0 |
if( ii<12 ) nLoad4 = nLoad4*4; |
157245
|
0 |
0 |
if( ii==0 || (pTC->pPhrase->nToken>1 && ii!=nToken-1) ){ |
|
0 |
0 |
if( ii==0 || (pTC->pPhrase->nToken>1 && ii!=nToken-1) ){ |
|
0 |
0 |
if( ii==0 || (pTC->pPhrase->nToken>1 && ii!=nToken-1) ){ |
157254
|
0 |
0 |
if( rc==SQLITE_OK ){ |
157259
|
0 |
0 |
if( rc==SQLITE_OK ){ |
157264
|
0 |
0 |
if( ii==0 || nCount
|
|
0 |
0 |
if( ii==0 || nCount
|
157297
|
46 |
0 |
if( rc==SQLITE_OK && nToken>1 && pTab->bFts4 ){ |
|
29 |
17 |
if( rc==SQLITE_OK && nToken>1 && pTab->bFts4 ){ |
|
19 |
10 |
if( rc==SQLITE_OK && nToken>1 && pTab->bFts4 ){ |
157306
|
0 |
19 |
if( !aTC ){ |
157317
|
19 |
0 |
if( rc==SQLITE_OK ){ |
157319
|
23 |
0 |
for(ii=0; rc==SQLITE_OK && ii
|
|
4 |
19 |
for(ii=0; rc==SQLITE_OK && ii
|
157337
|
61 |
216 |
if( pPhrase->doclist.bFreeList ){ |
157387
|
0 |
0 |
if( res ){ |
157446
|
279 |
0 |
if( *pRc==SQLITE_OK ){ |
157458
|
0 |
50 |
if( pLeft->bDeferred ){ |
157464
|
0 |
50 |
}else if( pRight->bDeferred ){ |
157474
|
41 |
15 |
while( !pLeft->bEof && !pRight->bEof && *pRc==SQLITE_OK ){ |
|
38 |
3 |
while( !pLeft->bEof && !pRight->bEof && *pRc==SQLITE_OK ){ |
|
38 |
0 |
while( !pLeft->bEof && !pRight->bEof && *pRc==SQLITE_OK ){ |
157475
|
0 |
38 |
sqlite3_int64 iDiff = DOCID_CMP(pLeft->iDocid, pRight->iDocid); |
157476
|
32 |
6 |
if( iDiff==0 ) break; |
157477
|
6 |
0 |
if( iDiff<0 ){ |
157484
|
35 |
15 |
pExpr->bEof = (pLeft->bEof || pRight->bEof); |
|
3 |
32 |
pExpr->bEof = (pLeft->bEof || pRight->bEof); |
157485
|
0 |
50 |
if( pExpr->eType==FTSQUERY_NEAR && pExpr->bEof ){ |
|
0 |
0 |
if( pExpr->eType==FTSQUERY_NEAR && pExpr->bEof ){ |
157487
|
0 |
0 |
if( pRight->pPhrase->doclist.aAll ){ |
157489
|
0 |
0 |
while( *pRc==SQLITE_OK && pRight->bEof==0 ){ |
|
0 |
0 |
while( *pRc==SQLITE_OK && pRight->bEof==0 ){ |
157494
|
0 |
0 |
if( pLeft->pPhrase && pLeft->pPhrase->doclist.aAll ){ |
|
0 |
0 |
if( pLeft->pPhrase && pLeft->pPhrase->doclist.aAll ){ |
157496
|
0 |
0 |
while( *pRc==SQLITE_OK && pLeft->bEof==0 ){ |
|
0 |
0 |
while( *pRc==SQLITE_OK && pLeft->bEof==0 ){ |
157509
|
0 |
12 |
sqlite3_int64 iCmp = DOCID_CMP(pLeft->iDocid, pRight->iDocid); |
157514
|
12 |
0 |
if( pRight->bEof || (pLeft->bEof==0 && iCmp<0) ){ |
|
8 |
4 |
if( pRight->bEof || (pLeft->bEof==0 && iCmp<0) ){ |
|
4 |
4 |
if( pRight->bEof || (pLeft->bEof==0 && iCmp<0) ){ |
157516
|
4 |
4 |
}else if( pLeft->bEof || iCmp>0 ){ |
|
0 |
4 |
}else if( pLeft->bEof || iCmp>0 ){ |
157523
|
8 |
4 |
pExpr->bEof = (pLeft->bEof && pRight->bEof); |
|
4 |
4 |
pExpr->bEof = (pLeft->bEof && pRight->bEof); |
157524
|
0 |
12 |
iCmp = DOCID_CMP(pLeft->iDocid, pRight->iDocid); |
157525
|
8 |
4 |
if( pRight->bEof || (pLeft->bEof==0 && iCmp<0) ){ |
|
4 |
4 |
if( pRight->bEof || (pLeft->bEof==0 && iCmp<0) ){ |
|
4 |
0 |
if( pRight->bEof || (pLeft->bEof==0 && iCmp<0) ){ |
157538
|
4 |
8 |
if( pRight->bStart==0 ){ |
157544
|
8 |
4 |
if( pLeft->bEof==0 ){ |
157545
|
8 |
0 |
while( !*pRc |
157546
|
8 |
0 |
&& !pRight->bEof |
157547
|
0 |
8 |
&& DOCID_CMP(pLeft->iDocid, pRight->iDocid)>0 |
|
0 |
8 |
&& DOCID_CMP(pLeft->iDocid, pRight->iDocid)>0 |
157606
|
32 |
0 |
if( *pRc==SQLITE_OK |
157607
|
0 |
32 |
&& pExpr->eType==FTSQUERY_NEAR |
157608
|
0 |
0 |
&& (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) |
|
0 |
0 |
&& (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) |
157615
|
0 |
0 |
for(p=pExpr; p->pLeft; p=p->pLeft){ |
157621
|
0 |
0 |
if( !aTmp ){ |
157628
|
0 |
0 |
for(p=p->pParent;res && p && p->eType==FTSQUERY_NEAR; p=p->pParent){ |
|
0 |
0 |
for(p=p->pParent;res && p && p->eType==FTSQUERY_NEAR; p=p->pParent){ |
|
0 |
0 |
for(p=p->pParent;res && p && p->eType==FTSQUERY_NEAR; p=p->pParent){ |
157636
|
0 |
0 |
for(p=pExpr->pLeft; p && res; p=p->pLeft){ |
|
0 |
0 |
for(p=pExpr->pLeft; p && res; p=p->pLeft){ |
157642
|
0 |
0 |
p->eType==FTSQUERY_NEAR ? p->pRight->pPhrase : p->pPhrase |
157671
|
191 |
0 |
if( *pRc==SQLITE_OK ){ |
157677
|
32 |
0 |
&& fts3EvalTestExpr(pCsr, pExpr->pRight, pRc) |
157678
|
32 |
0 |
&& fts3EvalNearTest(pExpr, pRc) |
|
32 |
0 |
&& fts3EvalNearTest(pExpr, pRc) |
157696
|
0 |
32 |
if( bHit==0 |
157697
|
0 |
0 |
&& pExpr->eType==FTSQUERY_NEAR |
157698
|
0 |
0 |
&& (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) |
|
0 |
0 |
&& (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) |
157701
|
0 |
0 |
for(p=pExpr; p->pPhrase==0; p=p->pLeft){ |
157702
|
0 |
0 |
if( p->pRight->iDocid==pCsr->iPrevId ){ |
157706
|
0 |
0 |
if( p->iDocid==pCsr->iPrevId ){ |
157716
|
4 |
4 |
bHit = bHit1 || bHit2; |
|
4 |
0 |
bHit = bHit1 || bHit2; |
157723
|
8 |
0 |
&& !fts3EvalTestExpr(pCsr, pExpr->pRight, pRc) |
|
4 |
4 |
&& !fts3EvalTestExpr(pCsr, pExpr->pRight, pRc) |
157729
|
0 |
143 |
if( pCsr->pDeferred |
157730
|
0 |
0 |
&& (pExpr->iDocid==pCsr->iPrevId || pExpr->bDeferred) |
|
0 |
0 |
&& (pExpr->iDocid==pCsr->iPrevId || pExpr->bDeferred) |
157734
|
0 |
0 |
if( pExpr->bDeferred ){ |
157743
|
139 |
4 |
bHit = (pExpr->bEof==0 && pExpr->iDocid==pCsr->iPrevId); |
|
131 |
8 |
bHit = (pExpr->bEof==0 && pExpr->iDocid==pCsr->iPrevId); |
157779
|
95 |
0 |
if( rc==SQLITE_OK ){ |
157787
|
0 |
95 |
if( pCsr->pDeferred ){ |
157789
|
0 |
0 |
if( rc==SQLITE_OK ){ |
157799
|
95 |
0 |
return (rc==SQLITE_OK && bMiss); |
|
4 |
91 |
return (rc==SQLITE_OK && bMiss); |
157810
|
0 |
137 |
if( pExpr==0 ){ |
157814
|
101 |
40 |
if( pCsr->isRequireSeek==0 ){ |
157823
|
95 |
46 |
}while( pCsr->isEof==0 && sqlite3Fts3EvalTestDeferred(pCsr, &rc) ); |
|
4 |
91 |
}while( pCsr->isEof==0 && sqlite3Fts3EvalTestDeferred(pCsr, &rc) ); |
157828
|
137 |
0 |
if( rc==SQLITE_OK && ( |
|
137 |
0 |
if( rc==SQLITE_OK && ( |
157829
|
137 |
0 |
(pCsr->bDesc==0 && pCsr->iPrevId>pCsr->iMaxDocid) |
157830
|
0 |
137 |
|| (pCsr->bDesc!=0 && pCsr->iPrevIdiMinDocid) |
|
0 |
0 |
|| (pCsr->bDesc!=0 && pCsr->iPrevIdiMinDocid) |
157852
|
0 |
0 |
if( pExpr && *pRc==SQLITE_OK ){ |
|
0 |
0 |
if( pExpr && *pRc==SQLITE_OK ){ |
157855
|
0 |
0 |
if( pPhrase ){ |
157857
|
0 |
0 |
if( pPhrase->bIncr ){ |
157859
|
0 |
0 |
for(i=0; inToken; i++){ |
157862
|
0 |
0 |
if( pToken->pSegcsr ){ |
157891
|
0 |
0 |
if( pExpr ){ |
157893
|
0 |
0 |
if( pPhrase && pPhrase->doclist.pList ){ |
|
0 |
0 |
if( pPhrase && pPhrase->doclist.pList ){ |
157901
|
0 |
0 |
while( 0xFE & (*p | c) ){ |
157902
|
0 |
0 |
if( (c&0x80)==0 ) iCnt++; |
157911
|
0 |
0 |
if( *p==0x00 ) break; |
157913
|
0 |
0 |
p += fts3GetVarint32(p, &iCol); |
157940
|
0 |
0 |
if( pExpr->aMI==0 ){ |
157951
|
0 |
0 |
while( pRoot->pParent && pRoot->pParent->eType==FTSQUERY_NEAR ){ |
|
0 |
0 |
while( pRoot->pParent && pRoot->pParent->eType==FTSQUERY_NEAR ){ |
157959
|
0 |
0 |
for(p=pRoot; p; p=p->pLeft){ |
157960
|
0 |
0 |
Fts3Expr *pE = (p->eType==FTSQUERY_PHRASE?p:p->pRight); |
157963
|
0 |
0 |
if( !pE->aMI ) return SQLITE_NOMEM; |
157969
|
0 |
0 |
while( pCsr->isEof==0 && rc==SQLITE_OK ){ |
|
0 |
0 |
while( pCsr->isEof==0 && rc==SQLITE_OK ){ |
157973
|
0 |
0 |
if( pCsr->isRequireSeek==0 ) sqlite3_reset(pCsr->pStmt); |
157983
|
0 |
0 |
&& pRoot->eType==FTSQUERY_NEAR |
157984
|
0 |
0 |
&& sqlite3Fts3EvalTestDeferred(pCsr, &rc) |
157985
|
0 |
0 |
); |
157987
|
0 |
0 |
if( rc==SQLITE_OK && pCsr->isEof==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pCsr->isEof==0 ){ |
157995
|
0 |
0 |
if( bEof ){ |
158008
|
0 |
0 |
}while( pRoot->iDocid!=iDocid && rc==SQLITE_OK ); |
|
0 |
0 |
}while( pRoot->iDocid!=iDocid && rc==SQLITE_OK ); |
158053
|
0 |
0 |
if( pExpr->bDeferred && pExpr->pParent->eType!=FTSQUERY_NEAR ){ |
|
0 |
0 |
if( pExpr->bDeferred && pExpr->pParent->eType!=FTSQUERY_NEAR ){ |
158055
|
0 |
0 |
for(iCol=0; iColnColumn; iCol++){ |
158061
|
0 |
0 |
if( rc==SQLITE_OK ){ |
158063
|
0 |
0 |
for(iCol=0; iColnColumn; iCol++){ |
158108
|
0 |
0 |
if( (pPhrase->iColumnnColumn && pPhrase->iColumn!=iCol) ){ |
|
0 |
0 |
if( (pPhrase->iColumnnColumn && pPhrase->iColumn!=iCol) ){ |
158114
|
0 |
0 |
if( iDocid!=pCsr->iPrevId || pExpr->bEof ){ |
|
0 |
0 |
if( iDocid!=pCsr->iPrevId || pExpr->bEof ){ |
158129
|
0 |
0 |
for(p=pExpr->pParent; p; p=p->pParent){ |
158130
|
0 |
0 |
if( p->eType==FTSQUERY_OR ) bOr = 1; |
158131
|
0 |
0 |
if( p->eType==FTSQUERY_NEAR ) pNear = p; |
158132
|
0 |
0 |
if( p->bEof ) bTreeEof = 1; |
158134
|
0 |
0 |
if( bOr==0 ) return SQLITE_OK; |
158139
|
0 |
0 |
if( pPhrase->bIncr ){ |
158142
|
0 |
0 |
while( rc==SQLITE_OK && !pNear->bEof ){ |
|
0 |
0 |
while( rc==SQLITE_OK && !pNear->bEof ){ |
158144
|
0 |
0 |
if( bEofSave==0 && pNear->iDocid==iDocid ) break; |
|
0 |
0 |
if( bEofSave==0 && pNear->iDocid==iDocid ) break; |
158148
|
0 |
0 |
if( bTreeEof ){ |
158149
|
0 |
0 |
while( rc==SQLITE_OK && !pNear->bEof ){ |
|
0 |
0 |
while( rc==SQLITE_OK && !pNear->bEof ){ |
158153
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
158156
|
0 |
0 |
for(p=pNear; p; p=p->pLeft){ |
158161
|
0 |
0 |
if( pTest->eType==FTSQUERY_NEAR ) pTest = pTest->pRight; |
158167
|
0 |
0 |
if( pCsr->bDesc==bDescDoclist ){ |
158168
|
0 |
0 |
bEof = !pPh->doclist.nAll || |
|
0 |
0 |
bEof = !pPh->doclist.nAll || |
158170
|
0 |
0 |
while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)<0 ) && bEof==0 ){ |
|
0 |
0 |
while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)<0 ) && bEof==0 ){ |
|
0 |
0 |
while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)<0 ) && bEof==0 ){ |
|
0 |
0 |
while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)<0 ) && bEof==0 ){ |
158177
|
0 |
0 |
bEof = !pPh->doclist.nAll || (pIter && pIter<=pPh->doclist.aAll); |
|
0 |
0 |
bEof = !pPh->doclist.nAll || (pIter && pIter<=pPh->doclist.aAll); |
|
0 |
0 |
bEof = !pPh->doclist.nAll || (pIter && pIter<=pPh->doclist.aAll); |
158178
|
0 |
0 |
while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)>0 ) && bEof==0 ){ |
|
0 |
0 |
while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)>0 ) && bEof==0 ){ |
|
0 |
0 |
while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)>0 ) && bEof==0 ){ |
|
0 |
0 |
while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)>0 ) && bEof==0 ){ |
158188
|
0 |
0 |
if( bEof || iDocid!=pCsr->iPrevId ) bMatch = 0; |
|
0 |
0 |
if( bEof || iDocid!=pCsr->iPrevId ) bMatch = 0; |
158191
|
0 |
0 |
if( bMatch ){ |
158197
|
0 |
0 |
if( pIter==0 ) return SQLITE_OK; |
158199
|
0 |
0 |
if( *pIter==0x01 ){ |
158201
|
0 |
0 |
pIter += fts3GetVarint32(pIter, &iThis); |
158205
|
0 |
0 |
while( iThis
|
158207
|
0 |
0 |
if( *pIter==0x00 ) return SQLITE_OK; |
158209
|
0 |
0 |
pIter += fts3GetVarint32(pIter, &iThis); |
158211
|
0 |
0 |
if( *pIter==0x00 ){ |
158215
|
0 |
0 |
*ppOut = ((iCol==iThis)?pIter:0); |
158227
|
72 |
26 |
if( pPhrase ){ |
158232
|
85 |
72 |
for(i=0; inToken; i++){ |
158349
|
0 |
1 |
if( argc!=4 && argc!=5 ) goto bad_args; |
|
0 |
0 |
if( argc!=4 && argc!=5 ) goto bad_args; |
158353
|
0 |
1 |
if( argc==5 ){ |
158354
|
0 |
0 |
if( nDb==4 && 0==sqlite3_strnicmp("temp", zDb, 4) ){ |
|
0 |
0 |
if( nDb==4 && 0==sqlite3_strnicmp("temp", zDb, 4) ){ |
158367
|
0 |
1 |
if( rc!=SQLITE_OK ) return rc; |
158371
|
0 |
1 |
if( !p ) return SQLITE_NOMEM; |
158403
|
40 |
1 |
for(i=0; iaStmt); i++){ |
158432
|
0 |
1 |
if( pInfo->nOrderBy==1 |
158433
|
0 |
0 |
&& pInfo->aOrderBy[0].iColumn==0 |
158434
|
0 |
0 |
&& pInfo->aOrderBy[0].desc==0 |
158441
|
1 |
1 |
for(i=0; inConstraint; i++){ |
158442
|
1 |
0 |
if( pInfo->aConstraint[i].usable ){ |
158446
|
0 |
1 |
if( iCol==0 ){ |
158447
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_EQ ) iEq = i; |
158448
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_LT ) iLe = i; |
158449
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_LE ) iLe = i; |
158450
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_GT ) iGe = i; |
158451
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_GE ) iGe = i; |
158453
|
0 |
1 |
if( iCol==4 ){ |
158454
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_EQ ) iLangid = i; |
158459
|
0 |
1 |
if( iEq>=0 ){ |
158466
|
0 |
1 |
if( iGe>=0 ){ |
158471
|
0 |
1 |
if( iLe>=0 ){ |
158477
|
0 |
1 |
if( iLangid>=0 ){ |
158494
|
0 |
1 |
if( !pCsr ) return SQLITE_NOMEM; |
158518
|
2 |
7 |
if( nSize>pCsr->nStat ){ |
158523
|
0 |
2 |
if( aNew==0 ) return SQLITE_NOMEM; |
158544
|
9 |
7 |
for(pCsr->iCol++; pCsr->iColnStat; pCsr->iCol++){ |
158545
|
6 |
3 |
if( pCsr->aStat[pCsr->iCol].nDoc>0 ) return SQLITE_OK; |
158549
|
6 |
1 |
if( rc==SQLITE_ROW ){ |
158557
|
0 |
6 |
if( pCsr->zStop ){ |
158560
|
0 |
0 |
if( mc<0 || (mc==0 && pCsr->csr.nTerm>pCsr->nStop) ){ |
|
0 |
0 |
if( mc<0 || (mc==0 && pCsr->csr.nTerm>pCsr->nStop) ){ |
|
0 |
0 |
if( mc<0 || (mc==0 && pCsr->csr.nTerm>pCsr->nStop) ){ |
158566
|
0 |
6 |
if( fts3auxGrowStatArray(pCsr, 2) ) return SQLITE_NOMEM; |
158570
|
24 |
6 |
while( i
|
158592
|
3 |
3 |
if( v>1 ){ |
158599
|
6 |
9 |
if( v==0 ){ /* 0x00. Next integer will be a docid. */ |
158601
|
3 |
6 |
}else if( v==1 ){ /* 0x01. Next integer will be a column number. */ |
158612
|
0 |
3 |
if( fts3auxGrowStatArray(pCsr, iCol+2) ) return SQLITE_NOMEM; |
158658
|
0 |
1 |
if( idxNum==FTS4AUX_EQ_CONSTRAINT ){ |
158662
|
0 |
1 |
if( idxNum & FTS4AUX_GE_CONSTRAINT ){ |
158665
|
0 |
1 |
if( idxNum & FTS4AUX_LE_CONSTRAINT ){ |
158669
|
0 |
1 |
if( iNext
|
158681
|
1 |
0 |
if( isScan ) pCsr->filter.flags |= FTS3_SEGMENT_SCAN; |
158683
|
1 |
0 |
if( iEq>=0 || iGe>=0 ){ |
|
0 |
1 |
if( iEq>=0 || iGe>=0 ){ |
158686
|
0 |
0 |
if( zStr ){ |
158689
|
0 |
0 |
if( pCsr->filter.zTerm==0 ) return SQLITE_NOMEM; |
158693
|
0 |
1 |
if( iLe>=0 ){ |
158696
|
0 |
0 |
if( pCsr->zStop==0 ) return SQLITE_NOMEM; |
158699
|
0 |
1 |
if( iLangid>=0 ){ |
158707
|
0 |
0 |
if( iLangVal<0 ) iLangVal = 0; |
158714
|
1 |
0 |
if( rc==SQLITE_OK ){ |
158718
|
1 |
0 |
if( rc==SQLITE_OK ) rc = fts3auxNextMethod(pCursor); |
158747
|
6 |
6 |
if( p->iCol ){ |
158939
|
95 |
49 |
return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; |
|
95 |
0 |
return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; |
|
95 |
0 |
return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; |
|
95 |
0 |
return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; |
|
95 |
0 |
return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; |
|
0 |
95 |
return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; |
158949
|
85 |
0 |
if( pRet ) memset(pRet, 0, nByte); |
158966
|
132 |
0 |
if( rc==SQLITE_OK ){ |
158968
|
0 |
132 |
if( pModule->iVersion>=1 ){ |
158970
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
159013
|
497 |
51 |
for(i=0; i
|
159014
|
497 |
0 |
if( sqlite3_fts3_enable_parentheses && (z[i]=='(' || z[i]==')') ) break; |
|
489 |
8 |
if( sqlite3_fts3_enable_parentheses && (z[i]=='(' || z[i]==')') ) break; |
159015
|
0 |
489 |
if( z[i]=='"' ) break; |
159020
|
59 |
0 |
if( rc==SQLITE_OK ){ |
159026
|
59 |
0 |
if( rc==SQLITE_OK ){ |
159029
|
0 |
59 |
if( !pRet ){ |
159040
|
31 |
28 |
if( iEnd
|
|
8 |
23 |
if( iEnd
|
159051
|
34 |
25 |
}else if( pParse->bFts4 && iStart>0 && z[iStart-1]=='^' ){ |
|
13 |
21 |
}else if( pParse->bFts4 && iStart>0 && z[iStart-1]=='^' ){ |
|
0 |
13 |
}else if( pParse->bFts4 && iStart>0 && z[iStart-1]=='^' ){ |
159061
|
0 |
0 |
}else if( i && rc==SQLITE_DONE ){ |
|
0 |
0 |
}else if( i && rc==SQLITE_DONE ){ |
159079
|
0 |
65 |
if( !pRet ){ |
159134
|
13 |
0 |
if( rc==SQLITE_OK ){ |
159136
|
39 |
13 |
for(ii=0; rc==SQLITE_OK; ii++){ |
159140
|
26 |
13 |
if( rc==SQLITE_OK ){ |
159144
|
0 |
26 |
if( !p ) goto no_mem; |
159147
|
0 |
26 |
if( !zTemp ) goto no_mem; |
159157
|
13 |
13 |
pToken->isPrefix = (iEnd
|
|
0 |
13 |
pToken->isPrefix = (iEnd
|
159158
|
13 |
13 |
pToken->bFirst = (iBegin>0 && zInput[iBegin-1]=='^'); |
|
0 |
13 |
pToken->bFirst = (iBegin>0 && zInput[iBegin-1]=='^'); |
159167
|
13 |
0 |
if( rc==SQLITE_DONE ){ |
159172
|
0 |
13 |
if( !p ) goto no_mem; |
159180
|
13 |
0 |
if( zTemp ){ |
159187
|
26 |
13 |
for(jj=0; jjpPhrase->nToken; jj++){ |
159198
|
0 |
0 |
if( pCursor ){ |
159246
|
129 |
46 |
while( nInput>0 && fts3isspace(*zInput) ){ |
|
34 |
95 |
while( nInput>0 && fts3isspace(*zInput) ){ |
159250
|
46 |
95 |
if( nInput==0 ){ |
159255
|
350 |
80 |
for(ii=0; ii<(int)(sizeof(aKeyword)/sizeof(struct Fts3Keyword)); ii++){ |
159258
|
0 |
350 |
if( (pKey->parenOnly & ~sqlite3_fts3_enable_parentheses)!=0 ){ |
159262
|
344 |
6 |
if( nInput>=pKey->n && 0==memcmp(zInput, pKey->z, pKey->n) ){ |
|
15 |
329 |
if( nInput>=pKey->n && 0==memcmp(zInput, pKey->z, pKey->n) ){ |
159268
|
0 |
15 |
if( pKey->eType==FTSQUERY_NEAR ){ |
159270
|
0 |
0 |
if( zInput[4]=='/' && zInput[5]>='0' && zInput[5]<='9' ){ |
|
0 |
0 |
if( zInput[4]=='/' && zInput[5]>='0' && zInput[5]<='9' ){ |
|
0 |
0 |
if( zInput[4]=='/' && zInput[5]>='0' && zInput[5]<='9' ){ |
159272
|
0 |
0 |
for(nKey=5; zInput[nKey]>='0' && zInput[nKey]<='9'; nKey++){ |
|
0 |
0 |
for(nKey=5; zInput[nKey]>='0' && zInput[nKey]<='9'; nKey++){ |
159283
|
0 |
15 |
if( fts3isspace(cNext) |
159284
|
0 |
0 |
|| cNext=='"' || cNext=='(' || cNext==')' || cNext==0 |
|
0 |
0 |
|| cNext=='"' || cNext=='(' || cNext==')' || cNext==0 |
|
0 |
0 |
|| cNext=='"' || cNext=='(' || cNext==')' || cNext==0 |
|
0 |
0 |
|| cNext=='"' || cNext=='(' || cNext==')' || cNext==0 |
159287
|
0 |
15 |
if( !pRet ){ |
159308
|
13 |
67 |
if( *zInput=='"' ){ |
159309
|
153 |
0 |
for(ii=1; ii
|
|
140 |
13 |
for(ii=1; ii
|
159311
|
0 |
13 |
if( ii==nInput ){ |
159318
|
4 |
63 |
if( *zInput=='(' ){ |
159322
|
4 |
0 |
if( rc==SQLITE_OK && !*ppExpr ){ rc = SQLITE_DONE; } |
|
0 |
4 |
if( rc==SQLITE_OK && !*ppExpr ){ rc = SQLITE_DONE; } |
159325
|
4 |
59 |
}else if( *zInput==')' ){ |
159346
|
70 |
59 |
for(ii=0; iinCol; ii++){ |
159349
|
39 |
31 |
if( nInput>nStr && zInput[nStr]==':' |
|
0 |
39 |
if( nInput>nStr && zInput[nStr]==':' |
159350
|
0 |
0 |
&& sqlite3_strnicmp(zStr, zInput, nStr)==0 |
159408
|
0 |
26 |
while( pSplit->pParent && opPrecedence(pSplit->pParent)<=opPrecedence(pNew) ){ |
|
0 |
0 |
while( pSplit->pParent && opPrecedence(pSplit->pParent)<=opPrecedence(pNew) ){ |
159412
|
0 |
26 |
if( pSplit->pParent ){ |
159447
|
141 |
50 |
while( rc==SQLITE_OK ){ |
159453
|
91 |
50 |
if( rc==SQLITE_OK ){ |
159454
|
91 |
0 |
if( p ){ |
159478
|
19 |
72 |
isPhrase = (eType==FTSQUERY_PHRASE || p->pLeft); |
|
4 |
15 |
isPhrase = (eType==FTSQUERY_PHRASE || p->pLeft); |
159485
|
15 |
76 |
if( !isPhrase && isRequirePhrase ){ |
|
0 |
15 |
if( !isPhrase && isRequirePhrase ){ |
159491
|
76 |
15 |
if( isPhrase && !isRequirePhrase ){ |
|
11 |
65 |
if( isPhrase && !isRequirePhrase ){ |
159496
|
0 |
11 |
if( !pAnd ){ |
159515
|
41 |
50 |
if( pPrev && ( |
|
0 |
41 |
if( pPrev && ( |
159516
|
0 |
0 |
(eType==FTSQUERY_NEAR && !isPhrase && pPrev->eType!=FTSQUERY_PHRASE) |
|
0 |
0 |
(eType==FTSQUERY_NEAR && !isPhrase && pPrev->eType!=FTSQUERY_PHRASE) |
159517
|
15 |
26 |
|| (eType!=FTSQUERY_PHRASE && isPhrase && pPrev->eType==FTSQUERY_NEAR) |
|
0 |
15 |
|| (eType!=FTSQUERY_PHRASE && isPhrase && pPrev->eType==FTSQUERY_NEAR) |
|
0 |
0 |
|| (eType!=FTSQUERY_PHRASE && isPhrase && pPrev->eType==FTSQUERY_NEAR) |
159524
|
76 |
15 |
if( isPhrase ){ |
159525
|
26 |
50 |
if( pRet ){ |
159546
|
50 |
0 |
if( rc==SQLITE_DONE && pRet && isRequirePhrase ){ |
|
50 |
0 |
if( rc==SQLITE_DONE && pRet && isRequirePhrase ){ |
|
0 |
50 |
if( rc==SQLITE_DONE && pRet && isRequirePhrase ){ |
159550
|
50 |
0 |
if( rc==SQLITE_DONE ){ |
159569
|
0 |
50 |
if( rc!=SQLITE_OK ){ |
159584
|
98 |
144 |
if( p ){ |
159585
|
0 |
98 |
if( nMaxDepth<0 ){ |
159589
|
98 |
0 |
if( rc==SQLITE_OK ){ |
159614
|
0 |
98 |
if( nMaxDepth==0 ){ |
159618
|
98 |
0 |
if( rc==SQLITE_OK ){ |
159619
|
80 |
18 |
if( (eType==FTSQUERY_AND || eType==FTSQUERY_OR) ){ |
|
4 |
76 |
if( (eType==FTSQUERY_AND || eType==FTSQUERY_OR) ){ |
159622
|
0 |
22 |
if( 0==apLeaf ){ |
159628
|
22 |
0 |
if( rc==SQLITE_OK ){ |
159633
|
22 |
22 |
for(p=pRoot; p->eType==eType; p=p->pLeft){ |
159645
|
22 |
22 |
if( pParent ){ |
159651
|
0 |
44 |
if( rc!=SQLITE_OK ) break; |
159653
|
66 |
44 |
for(iLvl=0; p && iLvl
|
|
66 |
0 |
for(iLvl=0; p && iLvl
|
159654
|
44 |
22 |
if( apLeaf[iLvl]==0 ){ |
159670
|
0 |
44 |
if( p ){ |
159677
|
22 |
22 |
if( pParent==0 ) break; |
159680
|
0 |
22 |
for(p=pParent->pRight; p->eType==eType; p=p->pLeft); |
159685
|
0 |
22 |
if( pParent->pParent ){ |
159698
|
22 |
0 |
if( rc==SQLITE_OK ){ |
159700
|
260 |
22 |
for(i=0; i
|
159701
|
22 |
238 |
if( apLeaf[i] ){ |
159702
|
22 |
0 |
if( p==0 ){ |
159724
|
0 |
0 |
for(i=0; i
|
159727
|
0 |
0 |
while( (pDel=pFree)!=0 ){ |
159736
|
4 |
72 |
}else if( eType==FTSQUERY_NOT ){ |
159746
|
4 |
0 |
if( rc==SQLITE_OK ){ |
159750
|
0 |
4 |
if( rc!=SQLITE_OK ){ |
159763
|
0 |
98 |
if( rc!=SQLITE_OK ){ |
159803
|
0 |
46 |
if( z==0 ){ |
159807
|
46 |
0 |
if( n<0 ){ |
159814
|
46 |
0 |
if( rc==SQLITE_OK && sParse.nNest ){ |
|
0 |
46 |
if( rc==SQLITE_OK && sParse.nNest ){ |
159862
|
46 |
0 |
if( rc==SQLITE_OK && *ppExpr ){ |
|
46 |
0 |
if( rc==SQLITE_OK && *ppExpr ){ |
159864
|
46 |
0 |
if( rc==SQLITE_OK ){ |
159869
|
0 |
46 |
if( rc!=SQLITE_OK ){ |
159872
|
0 |
0 |
if( rc==SQLITE_TOOBIG ){ |
159878
|
0 |
0 |
}else if( rc==SQLITE_ERROR ){ |
159906
|
26 |
0 |
for(p=pDel; p && (p->pLeft||p->pRight); p=(p->pLeft ? p->pLeft : p->pRight)){ |
|
72 |
95 |
for(p=pDel; p && (p->pLeft||p->pRight); p=(p->pLeft ? p->pLeft : p->pRight)){ |
|
26 |
46 |
for(p=pDel; p && (p->pLeft||p->pRight); p=(p->pLeft ? p->pLeft : p->pRight)){ |
|
0 |
46 |
for(p=pDel; p && (p->pLeft||p->pRight); p=(p->pLeft ? p->pLeft : p->pRight)){ |
159909
|
98 |
141 |
while( p ){ |
159912
|
52 |
46 |
if( pParent && p==pParent->pLeft && pParent->pRight ){ |
|
26 |
26 |
if( pParent && p==pParent->pLeft && pParent->pRight ){ |
|
26 |
0 |
if( pParent && p==pParent->pLeft && pParent->pRight ){ |
159914
|
26 |
0 |
while( p && (p->pLeft || p->pRight) ){ |
|
0 |
26 |
while( p && (p->pLeft || p->pRight) ){ |
|
0 |
26 |
while( p && (p->pLeft || p->pRight) ){ |
159916
|
0 |
0 |
p = (p->pLeft ? p->pLeft : p->pRight); |
160157
|
8496 |
0 |
if( p ){ |
160200
|
4088 |
295 |
while( elem ){ |
160202
|
4088 |
0 |
if( pH->copyKey && elem->pKey ){ |
|
4088 |
0 |
if( pH->copyKey && elem->pKey ){ |
160217
|
0 |
38572 |
if( nKey<=0 ) nKey = (int) strlen(z); |
160218
|
193358 |
38572 |
while( nKey > 0 ){ |
160225
|
12566 |
28597 |
if( n1!=n2 ) return 1; |
160235
|
0 |
0 |
while( nKey-- > 0 ){ |
160241
|
0 |
0 |
if( n1!=n2 ) return 1; |
160258
|
33772 |
0 |
if( keyClass==FTS3_HASH_STRING ){ |
160273
|
33180 |
0 |
if( keyClass==FTS3_HASH_STRING ){ |
160290
|
2966 |
6234 |
if( pHead ){ |
160293
|
1698 |
1268 |
if( pHead->prev ){ pHead->prev->next = pNew; } |
160298
|
5930 |
304 |
if( pH->first ){ pH->first->prev = pNew; } |
160320
|
0 |
304 |
if( new_ht==0 ) return 1; |
160325
|
5104 |
304 |
for(elem=pH->first, pH->first=0; elem; elem = next_elem){ |
160347
|
33180 |
288 |
if( pH->ht ){ |
160352
|
41163 |
6834 |
while( count-- && elem ){ |
|
41163 |
0 |
while( count-- && elem ){ |
160353
|
26346 |
14817 |
if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ |
160371
|
0 |
0 |
if( elem->prev ){ |
160376
|
0 |
0 |
if( elem->next ){ |
160380
|
0 |
0 |
if( pEntry->chain==elem ){ |
160384
|
0 |
0 |
if( pEntry->count<=0 ){ |
160387
|
0 |
0 |
if( pH->copyKey && elem->pKey ){ |
|
0 |
0 |
if( pH->copyKey && elem->pKey ){ |
160392
|
0 |
0 |
if( pH->count<=0 ){ |
160407
|
29360 |
0 |
if( pH==0 || pH->ht==0 ) return 0; |
|
102 |
29258 |
if( pH==0 || pH->ht==0 ) return 0; |
160424
|
26231 |
3052 |
return pElem ? pElem->data : 0; |
160461
|
114 |
4096 |
if( elem ){ |
160463
|
0 |
114 |
if( data==0 ){ |
160470
|
0 |
4096 |
if( data==0 ) return 0; |
160471
|
288 |
3808 |
if( (pH->htsize==0 && fts3Rehash(pH,8)) |
|
288 |
0 |
if( (pH->htsize==0 && fts3Rehash(pH,8)) |
160472
|
16 |
4080 |
|| (pH->count>=pH->htsize && fts3Rehash(pH, pH->htsize*2)) |
|
0 |
16 |
|| (pH->count>=pH->htsize && fts3Rehash(pH, pH->htsize*2)) |
160479
|
0 |
4096 |
if( new_elem==0 ) return data; |
160480
|
4096 |
0 |
if( pH->copyKey && pKey!=0 ){ |
|
4096 |
0 |
if( pH->copyKey && pKey!=0 ){ |
160482
|
0 |
4096 |
if( new_elem->pKey==0 ){ |
160572
|
0 |
0 |
if( t==NULL ) return SQLITE_NOMEM; |
160602
|
0 |
0 |
if( c==NULL ) return SQLITE_NOMEM; |
160605
|
0 |
0 |
if( zInput==0 ){ |
160607
|
0 |
0 |
}else if( nInput<0 ){ |
160656
|
0 |
0 |
if( x==0 ) return 0; |
160659
|
0 |
0 |
if( j<2 ) return j; |
160660
|
0 |
0 |
return z[1]==0 || isVowel(z + 1); |
|
0 |
0 |
return z[1]==0 || isVowel(z + 1); |
160665
|
0 |
0 |
if( x==0 ) return 0; |
160668
|
0 |
0 |
if( j<2 ) return 1-j; |
160692
|
0 |
0 |
while( isVowel(z) ){ z++; } |
160693
|
0 |
0 |
if( *z==0 ) return 0; |
160694
|
0 |
0 |
while( isConsonant(z) ){ z++; } |
160702
|
0 |
0 |
while( isVowel(z) ){ z++; } |
160703
|
0 |
0 |
if( *z==0 ) return 0; |
160704
|
0 |
0 |
while( isConsonant(z) ){ z++; } |
160705
|
0 |
0 |
if( *z==0 ) return 0; |
160706
|
0 |
0 |
while( isVowel(z) ){ z++; } |
160707
|
0 |
0 |
if( *z==0 ) return 1; |
160708
|
0 |
0 |
while( isConsonant(z) ){ z++; } |
160716
|
0 |
0 |
while( isVowel(z) ){ z++; } |
160717
|
0 |
0 |
if( *z==0 ) return 0; |
160718
|
0 |
0 |
while( isConsonant(z) ){ z++; } |
160719
|
0 |
0 |
if( *z==0 ) return 0; |
160720
|
0 |
0 |
while( isVowel(z) ){ z++; } |
160721
|
0 |
0 |
if( *z==0 ) return 0; |
160722
|
0 |
0 |
while( isConsonant(z) ){ z++; } |
160730
|
0 |
0 |
while( isConsonant(z) ){ z++; } |
160741
|
0 |
0 |
return isConsonant(z) && z[0]==z[1]; |
|
0 |
0 |
return isConsonant(z) && z[0]==z[1]; |
160754
|
0 |
0 |
isConsonant(z) && |
160755
|
0 |
0 |
z[0]!='w' && z[0]!='x' && z[0]!='y' && |
160756
|
0 |
0 |
isVowel(z+1) && |
|
0 |
0 |
isVowel(z+1) && |
160779
|
0 |
0 |
while( *zFrom && *zFrom==*z ){ z++; zFrom++; } |
|
0 |
0 |
while( *zFrom && *zFrom==*z ){ z++; zFrom++; } |
160780
|
0 |
0 |
if( *zFrom!=0 ) return 0; |
160781
|
0 |
0 |
if( xCond && !xCond(z) ) return 1; |
|
0 |
0 |
if( xCond && !xCond(z) ) return 1; |
160782
|
0 |
0 |
while( *zTo ){ |
160800
|
0 |
0 |
for(i=0; i
|
160802
|
0 |
0 |
if( c>='A' && c<='Z' ){ |
|
0 |
0 |
if( c>='A' && c<='Z' ){ |
160805
|
0 |
0 |
if( c>='0' && c<='9' ) hasDigit = 1; |
|
0 |
0 |
if( c>='0' && c<='9' ) hasDigit = 1; |
160809
|
0 |
0 |
mx = hasDigit ? 3 : 10; |
160810
|
0 |
0 |
if( nIn>mx*2 ){ |
160811
|
0 |
0 |
for(j=mx, i=nIn-mx; i
|
160848
|
0 |
0 |
if( nIn<3 || nIn>=(int)sizeof(zReverse)-7 ){ |
|
0 |
0 |
if( nIn<3 || nIn>=(int)sizeof(zReverse)-7 ){ |
160854
|
0 |
0 |
for(i=0, j=sizeof(zReverse)-6; i
|
160856
|
0 |
0 |
if( c>='A' && c<='Z' ){ |
|
0 |
0 |
if( c>='A' && c<='Z' ){ |
160858
|
0 |
0 |
}else if( c>='a' && c<='z' ){ |
|
0 |
0 |
}else if( c>='a' && c<='z' ){ |
160872
|
0 |
0 |
if( z[0]=='s' ){ |
160873
|
0 |
0 |
if( |
160874
|
0 |
0 |
!stem(&z, "sess", "ss", 0) && |
160875
|
0 |
0 |
!stem(&z, "sei", "i", 0) && |
160884
|
0 |
0 |
if( stem(&z, "dee", "ee", m_gt_0) ){ |
160886
|
0 |
0 |
}else if( |
160887
|
0 |
0 |
(stem(&z, "gni", "", hasVowel) || stem(&z, "de", "", hasVowel)) |
160888
|
0 |
0 |
&& z!=z2 |
160891
|
0 |
0 |
stem(&z, "lb", "ble", 0) || |
160894
|
0 |
0 |
}else if( doubleConsonant(z) && (*z!='l' && *z!='s' && *z!='z') ){ |
|
0 |
0 |
}else if( doubleConsonant(z) && (*z!='l' && *z!='s' && *z!='z') ){ |
|
0 |
0 |
}else if( doubleConsonant(z) && (*z!='l' && *z!='s' && *z!='z') ){ |
|
0 |
0 |
}else if( doubleConsonant(z) && (*z!='l' && *z!='s' && *z!='z') ){ |
160896
|
0 |
0 |
}else if( m_eq_1(z) && star_oh(z) ){ |
|
0 |
0 |
}else if( m_eq_1(z) && star_oh(z) ){ |
160902
|
0 |
0 |
if( z[0]=='y' && hasVowel(z+1) ){ |
|
0 |
0 |
if( z[0]=='y' && hasVowel(z+1) ){ |
160909
|
0 |
0 |
if( !stem(&z, "lanoita", "ate", m_gt_0) ){ |
160914
|
0 |
0 |
if( !stem(&z, "icne", "ence", m_gt_0) ){ |
160925
|
0 |
0 |
if( !stem(&z, "ilb", "ble", m_gt_0) |
160926
|
0 |
0 |
&& !stem(&z, "illa", "al", m_gt_0) |
160927
|
0 |
0 |
&& !stem(&z, "iltne", "ent", m_gt_0) |
160928
|
0 |
0 |
&& !stem(&z, "ile", "e", m_gt_0) |
160934
|
0 |
0 |
if( !stem(&z, "noitazi", "ize", m_gt_0) |
160935
|
0 |
0 |
&& !stem(&z, "noita", "ate", m_gt_0) |
160941
|
0 |
0 |
if( !stem(&z, "msila", "al", m_gt_0) |
160942
|
0 |
0 |
&& !stem(&z, "ssenevi", "ive", m_gt_0) |
160943
|
0 |
0 |
&& !stem(&z, "ssenluf", "ful", m_gt_0) |
160949
|
0 |
0 |
if( !stem(&z, "itila", "al", m_gt_0) |
160950
|
0 |
0 |
&& !stem(&z, "itivi", "ive", m_gt_0) |
160960
|
0 |
0 |
if( !stem(&z, "etaci", "ic", m_gt_0) |
160961
|
0 |
0 |
&& !stem(&z, "evita", "", m_gt_0) |
160970
|
0 |
0 |
if( !stem(&z, "laci", "ic", m_gt_0) ){ |
160982
|
0 |
0 |
if( z[0]=='l' && m_gt_1(z+2) ){ |
|
0 |
0 |
if( z[0]=='l' && m_gt_1(z+2) ){ |
160987
|
0 |
0 |
if( z[0]=='e' && z[2]=='n' && (z[3]=='a' || z[3]=='e') && m_gt_1(z+4) ){ |
|
0 |
0 |
if( z[0]=='e' && z[2]=='n' && (z[3]=='a' || z[3]=='e') && m_gt_1(z+4) ){ |
|
0 |
0 |
if( z[0]=='e' && z[2]=='n' && (z[3]=='a' || z[3]=='e') && m_gt_1(z+4) ){ |
|
0 |
0 |
if( z[0]=='e' && z[2]=='n' && (z[3]=='a' || z[3]=='e') && m_gt_1(z+4) ){ |
|
0 |
0 |
if( z[0]=='e' && z[2]=='n' && (z[3]=='a' || z[3]=='e') && m_gt_1(z+4) ){ |
160992
|
0 |
0 |
if( z[0]=='r' && m_gt_1(z+2) ){ |
|
0 |
0 |
if( z[0]=='r' && m_gt_1(z+2) ){ |
160997
|
0 |
0 |
if( z[0]=='c' && m_gt_1(z+2) ){ |
|
0 |
0 |
if( z[0]=='c' && m_gt_1(z+2) ){ |
161002
|
0 |
0 |
if( z[0]=='e' && z[2]=='b' && (z[3]=='a' || z[3]=='i') && m_gt_1(z+4) ){ |
|
0 |
0 |
if( z[0]=='e' && z[2]=='b' && (z[3]=='a' || z[3]=='i') && m_gt_1(z+4) ){ |
|
0 |
0 |
if( z[0]=='e' && z[2]=='b' && (z[3]=='a' || z[3]=='i') && m_gt_1(z+4) ){ |
|
0 |
0 |
if( z[0]=='e' && z[2]=='b' && (z[3]=='a' || z[3]=='i') && m_gt_1(z+4) ){ |
|
0 |
0 |
if( z[0]=='e' && z[2]=='b' && (z[3]=='a' || z[3]=='i') && m_gt_1(z+4) ){ |
161007
|
0 |
0 |
if( z[0]=='t' ){ |
161008
|
0 |
0 |
if( z[2]=='a' ){ |
161009
|
0 |
0 |
if( m_gt_1(z+3) ){ |
161012
|
0 |
0 |
}else if( z[2]=='e' ){ |
161013
|
0 |
0 |
if( !stem(&z, "tneme", "", m_gt_1) |
161014
|
0 |
0 |
&& !stem(&z, "tnem", "", m_gt_1) |
161022
|
0 |
0 |
if( z[0]=='u' ){ |
161023
|
0 |
0 |
if( m_gt_1(z+2) ){ |
161026
|
0 |
0 |
}else if( z[3]=='s' || z[3]=='t' ){ |
|
0 |
0 |
}else if( z[3]=='s' || z[3]=='t' ){ |
161031
|
0 |
0 |
if( z[0]=='m' && z[2]=='i' && m_gt_1(z+3) ){ |
|
0 |
0 |
if( z[0]=='m' && z[2]=='i' && m_gt_1(z+3) ){ |
|
0 |
0 |
if( z[0]=='m' && z[2]=='i' && m_gt_1(z+3) ){ |
161036
|
0 |
0 |
if( !stem(&z, "eta", "", m_gt_1) ){ |
161041
|
0 |
0 |
if( z[0]=='s' && z[2]=='o' && m_gt_1(z+3) ){ |
|
0 |
0 |
if( z[0]=='s' && z[2]=='o' && m_gt_1(z+3) ){ |
|
0 |
0 |
if( z[0]=='s' && z[2]=='o' && m_gt_1(z+3) ){ |
161047
|
0 |
0 |
if( z[0]=='e' && z[2]=='i' && m_gt_1(z+3) ){ |
|
0 |
0 |
if( z[0]=='e' && z[2]=='i' && m_gt_1(z+3) ){ |
|
0 |
0 |
if( z[0]=='e' && z[2]=='i' && m_gt_1(z+3) ){ |
161054
|
0 |
0 |
if( z[0]=='e' ){ |
161055
|
0 |
0 |
if( m_gt_1(z+1) ){ |
161057
|
0 |
0 |
}else if( m_eq_1(z+1) && !star_oh(z+1) ){ |
|
0 |
0 |
}else if( m_eq_1(z+1) && !star_oh(z+1) ){ |
161063
|
0 |
0 |
if( m_gt_1(z) && z[0]=='l' && z[1]=='l' ){ |
|
0 |
0 |
if( m_gt_1(z) && z[0]=='l' && z[1]=='l' ){ |
|
0 |
0 |
if( m_gt_1(z) && z[0]=='l' && z[1]=='l' ){ |
161072
|
0 |
0 |
while( *z ){ |
161108
|
0 |
0 |
while( c->iOffsetnInput ){ |
161112
|
0 |
0 |
while( c->iOffsetnInput && isDelim(z[c->iOffset]) ){ |
|
0 |
0 |
while( c->iOffsetnInput && isDelim(z[c->iOffset]) ){ |
|
0 |
0 |
while( c->iOffsetnInput && isDelim(z[c->iOffset]) ){ |
|
0 |
0 |
while( c->iOffsetnInput && isDelim(z[c->iOffset]) ){ |
161118
|
0 |
0 |
while( c->iOffsetnInput && !isDelim(z[c->iOffset]) ){ |
|
0 |
0 |
while( c->iOffsetnInput && !isDelim(z[c->iOffset]) ){ |
|
0 |
0 |
while( c->iOffsetnInput && !isDelim(z[c->iOffset]) ){ |
|
0 |
0 |
while( c->iOffsetnInput && !isDelim(z[c->iOffset]) ){ |
161122
|
0 |
0 |
if( c->iOffset>iStartOffset ){ |
161124
|
0 |
0 |
if( n>c->nAllocated ){ |
161128
|
0 |
0 |
if( !pNew ) return SQLITE_NOMEM; |
161249
|
258 |
0 |
if( argc==2 ){ |
161250
|
258 |
0 |
if( fts3TokenizerEnabled(context) ){ |
161253
|
258 |
0 |
if( zName==0 || n!=sizeof(pPtr) ){ |
|
0 |
258 |
if( zName==0 || n!=sizeof(pPtr) ){ |
161259
|
0 |
258 |
if( pOld==pPtr ){ |
161267
|
0 |
0 |
if( zName ){ |
161270
|
0 |
0 |
if( !pPtr ){ |
161291
|
159 |
0 |
return (c&0x80 || isFtsIdChar[(int)(c)]); |
|
129 |
30 |
return (c&0x80 || isFtsIdChar[(int)(c)]); |
161300
|
28 |
28 |
while( z2==0 ){ |
161308
|
92 |
0 |
while( *++z2 && (*z2!=c || *++z2==c) ); |
|
88 |
4 |
while( *++z2 && (*z2!=c || *++z2==c) ); |
|
0 |
4 |
while( *++z2 && (*z2!=c || *++z2==c) ); |
161313
|
0 |
0 |
while( *z2 && z2[0]!=']' ) z2++; |
|
0 |
0 |
while( *z2 && z2[0]!=']' ) z2++; |
161314
|
0 |
0 |
if( *z2 ) z2++; |
161318
|
24 |
0 |
if( sqlite3Fts3IsIdChar(*z1) ){ |
161320
|
105 |
24 |
while( sqlite3Fts3IsIdChar(*z2) ) z2++; |
161345
|
0 |
10 |
if( !zCopy ) return SQLITE_NOMEM; |
161349
|
0 |
10 |
if( z==0 ){ |
161357
|
0 |
10 |
if( !m ){ |
161364
|
4 |
10 |
while( z
|
|
4 |
0 |
while( z
|
161367
|
0 |
4 |
if( !aNew ){ |
161380
|
1 |
9 |
if( rc!=SQLITE_OK ){ |
161661
|
262 |
0 |
if( SQLITE_OK==rc ){ |
161664
|
262 |
0 |
if( SQLITE_OK==rc ){ |
161739
|
263054 |
85 |
return c<0x80 && t->delim[c]; |
|
97890 |
165164 |
return c<0x80 && t->delim[c]; |
161742
|
400 |
235 |
return (x>='0' && x<='9') || (x>='A' && x<='Z') || (x>='a' && x<='z'); |
|
350 |
50 |
return (x>='0' && x<='9') || (x>='A' && x<='Z') || (x>='a' && x<='z'); |
|
315 |
270 |
return (x>='0' && x<='9') || (x>='A' && x<='Z') || (x>='a' && x<='z'); |
|
185 |
130 |
return (x>='0' && x<='9') || (x>='A' && x<='Z') || (x>='a' && x<='z'); |
|
155 |
300 |
return (x>='0' && x<='9') || (x>='A' && x<='Z') || (x>='a' && x<='z'); |
|
130 |
25 |
return (x>='0' && x<='9') || (x>='A' && x<='Z') || (x>='a' && x<='z'); |
161755
|
0 |
5 |
if( t==NULL ) return SQLITE_NOMEM; |
161763
|
0 |
5 |
if( argc>1 ){ |
161765
|
0 |
0 |
for(i=0; i
|
161768
|
0 |
0 |
if( ch>=0x80 ){ |
161777
|
635 |
5 |
for(i=1; i<0x80; i++){ |
161778
|
325 |
310 |
t->delim[i] = !fts3_isalnum(i) ? -1 : 0; |
161810
|
0 |
64 |
if( c==NULL ) return SQLITE_NOMEM; |
161813
|
0 |
64 |
if( pInput==0 ){ |
161815
|
44 |
20 |
}else if( nBytes<0 ){ |
161856
|
29240 |
53 |
while( c->iOffsetnBytes ){ |
161860
|
97941 |
10 |
while( c->iOffsetnBytes && simpleDelim(t, p[c->iOffset]) ){ |
|
68711 |
29230 |
while( c->iOffsetnBytes && simpleDelim(t, p[c->iOffset]) ){ |
161866
|
165198 |
61 |
while( c->iOffsetnBytes && !simpleDelim(t, p[c->iOffset]) ){ |
|
136019 |
29179 |
while( c->iOffsetnBytes && !simpleDelim(t, p[c->iOffset]) ){ |
161870
|
29230 |
10 |
if( c->iOffset>iStartOffset ){ |
161872
|
65 |
29165 |
if( n>c->nTokenAllocated ){ |
161876
|
0 |
65 |
if( !pNew ) return SQLITE_NOMEM; |
161879
|
136019 |
29230 |
for(i=0; i
|
161884
|
134682 |
1337 |
c->pToken[i] = (char)((ch>='A' && ch<='Z') ? ch-'A'+'a' : ch); |
|
24747 |
109935 |
c->pToken[i] = (char)((ch>='A' && ch<='Z') ? ch-'A'+'a' : ch); |
162011
|
0 |
0 |
if( !p ){ |
162038
|
0 |
0 |
if( argc==0 ){ |
162045
|
0 |
0 |
for(i=0; i
|
162050
|
0 |
0 |
if( azDequote==0 ){ |
162054
|
0 |
0 |
for(i=0; i
|
162098
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
162103
|
0 |
0 |
if( rc==SQLITE_OK ){ |
162105
|
0 |
0 |
if( nDequote<1 ){ |
162114
|
0 |
0 |
if( rc==SQLITE_OK ){ |
162116
|
0 |
0 |
rc = pMod->xCreate((nDequote>1 ? nDequote-1 : 0), azArg, &pTok); |
162119
|
0 |
0 |
if( rc==SQLITE_OK ){ |
162121
|
0 |
0 |
if( pTab==0 ){ |
162126
|
0 |
0 |
if( rc==SQLITE_OK ){ |
162132
|
0 |
0 |
if( pTok ){ |
162164
|
0 |
0 |
for(i=0; inConstraint; i++){ |
162165
|
0 |
0 |
if( pInfo->aConstraint[i].usable |
162166
|
0 |
0 |
&& pInfo->aConstraint[i].iColumn==0 |
162167
|
0 |
0 |
&& pInfo->aConstraint[i].op==SQLITE_INDEX_CONSTRAINT_EQ |
162191
|
0 |
0 |
if( pCsr==0 ){ |
162205
|
0 |
0 |
if( pCsr->pCsr ){ |
162245
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
162247
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
162270
|
0 |
0 |
if( idxNum==1 ){ |
162274
|
0 |
0 |
if( pCsr->zInput==0 ){ |
162280
|
0 |
0 |
if( rc==SQLITE_OK ){ |
162286
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
162779
|
77 |
252 |
if( !pStmt ){ |
162781
|
6 |
71 |
if( eStmt==SQL_CONTENT_INSERT ){ |
162783
|
1 |
70 |
}else if( eStmt==SQL_SELECT_CONTENT_BY_ROWID ){ |
162788
|
0 |
77 |
if( !zSql ){ |
162798
|
27 |
302 |
if( apVal ){ |
162801
|
88 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
61 |
27 |
for(i=0; rc==SQLITE_OK && i
|
162819
|
0 |
0 |
if( rc==SQLITE_OK ){ |
162822
|
0 |
0 |
if( rc!=SQLITE_ROW || sqlite3_column_type(pStmt, 0)!=SQLITE_BLOB ){ |
|
0 |
0 |
if( rc!=SQLITE_ROW || sqlite3_column_type(pStmt, 0)!=SQLITE_BLOB ){ |
162824
|
0 |
0 |
if( rc==SQLITE_OK ) rc = FTS_CORRUPT_VTAB; |
162842
|
0 |
0 |
if( rc==SQLITE_OK ){ |
162844
|
0 |
0 |
if( sqlite3_step(pStmt)!=SQLITE_ROW |
162845
|
0 |
0 |
|| sqlite3_column_type(pStmt, 0)!=SQLITE_BLOB |
162848
|
0 |
0 |
if( rc==SQLITE_OK ) rc = FTS_CORRUPT_VTAB; |
162880
|
0 |
5 |
if( *pRC ) return; |
162882
|
5 |
0 |
if( rc==SQLITE_OK ){ |
162907
|
25 |
4 |
if( p->nPendingData==0 ){ |
162910
|
25 |
0 |
if( rc==SQLITE_OK ){ |
162989
|
86 |
0 |
if( iLevel<0 ){ |
162992
|
86 |
0 |
if( rc==SQLITE_OK ){ |
163001
|
0 |
0 |
if( rc==SQLITE_OK ){ |
163029
|
3052 |
28386 |
if( !p ){ |
163031
|
0 |
3052 |
if( !p ){ |
163038
|
114 |
28272 |
else if( p->nData+FTS3_VARINT_MAX+1>p->nSpace ){ |
163041
|
0 |
114 |
if( !p ){ |
163078
|
26221 |
3052 |
if( !p || p->iLastDocid!=iDocid ){ |
|
2259 |
23962 |
if( !p || p->iLastDocid!=iDocid ){ |
163079
|
2259 |
3052 |
sqlite3_int64 iDelta = iDocid - (p ? p->iLastDocid : 0); |
163080
|
2259 |
3052 |
if( p ){ |
163085
|
0 |
5311 |
if( SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, iDelta)) ){ |
163092
|
73 |
29200 |
if( iCol>0 && p->iLastCol!=iCol ){ |
|
73 |
0 |
if( iCol>0 && p->iLastCol!=iCol ){ |
163093
|
73 |
0 |
if( SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, 1)) |
163094
|
73 |
0 |
|| SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, iCol)) |
163101
|
25981 |
3292 |
if( iCol>=0 ){ |
163104
|
25981 |
0 |
if( rc==SQLITE_OK ){ |
163111
|
3166 |
26107 |
if( p!=*pp ){ |
163140
|
26221 |
3052 |
if( pList ){ |
163143
|
3166 |
26107 |
if( fts3PendingListAppend(&pList, p->iPrevDocid, iCol, iPos, &rc) ){ |
163144
|
0 |
3166 |
if( pList==fts3HashInsert(pHash, zToken, nToken, pList) ){ |
163153
|
29273 |
0 |
if( rc==SQLITE_OK ){ |
163193
|
0 |
60 |
if( zText==0 ){ |
163199
|
0 |
60 |
if( rc!=SQLITE_OK ){ |
163204
|
29333 |
0 |
while( SQLITE_OK==rc |
163205
|
29273 |
60 |
&& SQLITE_OK==(rc = xNext(pCsr, &zToken, &nToken, &iStart, &iEnd, &iPos)) |
163208
|
29273 |
0 |
if( iPos>=nWord ) nWord = iPos+1; |
163213
|
29273 |
0 |
if( iPos<0 || !zToken || nToken<=0 ){ |
|
29273 |
0 |
if( iPos<0 || !zToken || nToken<=0 ){ |
|
0 |
29273 |
if( iPos<0 || !zToken || nToken<=0 ){ |
163225
|
29273 |
0 |
for(i=1; rc==SQLITE_OK && inIndex; i++){ |
|
0 |
29273 |
for(i=1; rc==SQLITE_OK && inIndex; i++){ |
163227
|
0 |
0 |
if( nTokennPrefix ) continue; |
163236
|
0 |
60 |
return (rc==SQLITE_DONE ? SQLITE_OK : rc); |
163259
|
37 |
1 |
if( iDocidiPrevDocid |
163260
|
0 |
37 |
|| (iDocid==p->iPrevDocid && p->bPrevDelete==0) |
|
0 |
0 |
|| (iDocid==p->iPrevDocid && p->bPrevDelete==0) |
163261
|
37 |
0 |
|| p->iPrevLangid!=iLangid |
163262
|
0 |
37 |
|| p->nPendingData>p->nMaxPendingData |
163265
|
0 |
1 |
if( rc!=SQLITE_OK ) return rc; |
163278
|
35 |
35 |
for(i=0; inIndex; i++){ |
163281
|
3052 |
35 |
for(pElem=fts3HashFirst(pHash); pElem; pElem=fts3HashNext(pElem)){ |
163305
|
40 |
28 |
for(i=2; inColumn+2; i++){ |
163307
|
40 |
0 |
if( p->abNotindexed[iCol]==0 ){ |
163310
|
0 |
40 |
if( rc!=SQLITE_OK ){ |
163341
|
3 |
25 |
if( p->zContentTbl ){ |
163343
|
0 |
3 |
if( sqlite3_value_type(pRowid)==SQLITE_NULL ){ |
163346
|
0 |
3 |
if( sqlite3_value_type(pRowid)!=SQLITE_INTEGER ){ |
163362
|
25 |
0 |
if( rc==SQLITE_OK && p->zLanguageid ){ |
|
0 |
25 |
if( rc==SQLITE_OK && p->zLanguageid ){ |
163368
|
0 |
25 |
if( rc!=SQLITE_OK ) return rc; |
163380
|
0 |
25 |
if( SQLITE_NULL!=sqlite3_value_type(apVal[3+p->nColumn]) ){ |
163381
|
0 |
0 |
if( SQLITE_NULL==sqlite3_value_type(apVal[0]) |
163382
|
0 |
0 |
&& SQLITE_NULL!=sqlite3_value_type(apVal[1]) |
163388
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
163416
|
0 |
1 |
if( bContent ) fts3SqlExec(&rc, p, SQL_DELETE_ALL_CONTENT, 0); |
163419
|
1 |
0 |
if( p->bHasDocsize ){ |
163422
|
1 |
0 |
if( p->bHasStat ){ |
163433
|
0 |
10 |
if( p->zLanguageid ) iLangid = sqlite3_column_int(pSelect, p->nColumn+1); |
163453
|
0 |
1 |
if( *pRC ) return; |
163455
|
1 |
0 |
if( rc==SQLITE_OK ){ |
163456
|
1 |
0 |
if( SQLITE_ROW==sqlite3_step(pSelect) ){ |
163461
|
3 |
0 |
for(i=1; rc==SQLITE_OK && i<=p->nColumn; i++){ |
|
2 |
1 |
for(i=1; rc==SQLITE_OK && i<=p->nColumn; i++){ |
163463
|
2 |
0 |
if( p->abNotindexed[iCol]==0 ){ |
163469
|
0 |
1 |
if( rc!=SQLITE_OK ){ |
163520
|
26 |
0 |
if( rc==SQLITE_OK ){ |
163524
|
26 |
0 |
if( SQLITE_ROW==sqlite3_step(pNextIdx) ){ |
163530
|
26 |
0 |
if( rc==SQLITE_OK ){ |
163536
|
0 |
26 |
if( iNext>=FTS3_MERGE_COUNT ){ |
163587
|
73 |
12 |
if( p->pSegments ){ |
163590
|
2 |
10 |
if( 0==p->zSegmentsTbl ){ |
163592
|
0 |
2 |
if( 0==p->zSegmentsTbl ) return SQLITE_NOMEM; |
163599
|
85 |
0 |
if( rc==SQLITE_OK ){ |
163602
|
45 |
40 |
if( paBlob ){ |
163604
|
0 |
45 |
if( !aByte ){ |
163607
|
0 |
45 |
if( pnLoad && nByte>(FTS3_NODE_CHUNK_THRESHOLD) ){ |
|
0 |
0 |
if( pnLoad && nByte>(FTS3_NODE_CHUNK_THRESHOLD) ){ |
163613
|
0 |
45 |
if( rc!=SQLITE_OK ){ |
163646
|
0 |
0 |
if( rc==SQLITE_OK ){ |
163649
|
0 |
0 |
if( pReader->nPopulate==pReader->nNode ){ |
163663
|
0 |
11472 |
while( pReader->pBlob && rc==SQLITE_OK |
|
0 |
0 |
while( pReader->pBlob && rc==SQLITE_OK |
163664
|
0 |
0 |
&& (pFrom - pReader->aNode + nByte)>pReader->nPopulate |
163675
|
47 |
159 |
if( !fts3SegReaderIsRootOnly(pSeg) ){ |
163698
|
303 |
8406 |
if( !pReader->aDoclist ){ |
163704
|
8637 |
72 |
if( !pNext || pNext>=&pReader->aNode[pReader->nNode] ){ |
|
3079 |
5558 |
if( !pNext || pNext>=&pReader->aNode[pReader->nNode] ){ |
163706
|
3079 |
72 |
if( fts3SegReaderIsPending(pReader) ){ |
163710
|
3053 |
26 |
if( pElem ){ |
163717
|
0 |
3053 |
if( !aCopy ) return SQLITE_NOMEM; |
163732
|
27 |
45 |
if( pReader->iCurrentBlock>=pReader->iLeafEndBlock ){ |
163736
|
0 |
45 |
rc = sqlite3Fts3ReadBlock( |
163740
|
0 |
45 |
if( rc!=SQLITE_OK ) return rc; |
163742
|
0 |
45 |
if( bIncr && pReader->nPopulatenNode ){ |
|
0 |
0 |
if( bIncr && pReader->nPopulatenNode ){ |
163752
|
0 |
5603 |
if( rc!=SQLITE_OK ) return rc; |
163756
|
0 |
5603 |
pNext += fts3GetVarint32(pNext, &nPrefix); |
163757
|
0 |
5603 |
pNext += fts3GetVarint32(pNext, &nSuffix); |
163758
|
5603 |
0 |
if( nPrefix<0 || nSuffix<=0 |
|
5603 |
0 |
if( nPrefix<0 || nSuffix<=0 |
163759
|
0 |
5603 |
|| &pNext[nSuffix]>&pReader->aNode[pReader->nNode] |
163764
|
348 |
5255 |
if( nPrefix+nSuffix>pReader->nTermAlloc ){ |
163767
|
0 |
348 |
if( !zNew ){ |
163775
|
0 |
5603 |
if( rc!=SQLITE_OK ) return rc; |
163780
|
54 |
5549 |
pNext += fts3GetVarint32(pNext, &pReader->nDoclist); |
163788
|
5603 |
0 |
if( &pReader->aDoclist[pReader->nDoclist]>&pReader->aNode[pReader->nNode] |
163789
|
5603 |
0 |
|| (pReader->nPopulate==0 && pReader->aDoclist[pReader->nDoclist-1]) |
|
0 |
5603 |
|| (pReader->nPopulate==0 && pReader->aDoclist[pReader->nDoclist-1]) |
163804
|
0 |
118 |
if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){ |
|
0 |
0 |
if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){ |
163814
|
118 |
0 |
if( rc==SQLITE_OK ){ |
163844
|
0 |
263 |
if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){ |
|
0 |
0 |
if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){ |
163849
|
0 |
0 |
if( ppOffsetList ){ |
163857
|
0 |
0 |
if( bEof ){ |
163876
|
2560 |
263 |
while( *p | c ) c = *p++ & 0x80; |
163879
|
0 |
263 |
if( pReader->pBlob==0 || p<&pReader->aNode[pReader->nPopulate] ) break; |
|
0 |
0 |
if( pReader->pBlob==0 || p<&pReader->aNode[pReader->nPopulate] ) break; |
163881
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
163888
|
247 |
16 |
if( ppOffsetList ){ |
163894
|
148 |
115 |
while( p
|
|
0 |
148 |
while( p
|
163901
|
115 |
148 |
if( p>=pEnd ){ |
163905
|
148 |
0 |
if( rc==SQLITE_OK ){ |
163908
|
0 |
148 |
if( pTab->bDescIdx ){ |
163935
|
154 |
0 |
for(ii=0; rc==SQLITE_OK && iinSegment; ii++){ |
|
112 |
42 |
for(ii=0; rc==SQLITE_OK && iinSegment; ii++){ |
163937
|
112 |
0 |
if( !fts3SegReaderIsPending(pReader) |
163938
|
40 |
72 |
&& !fts3SegReaderIsRootOnly(pReader) |
163941
|
40 |
40 |
for(jj=pReader->iStartBlock; jj<=pReader->iLeafEndBlock; jj++){ |
163944
|
0 |
40 |
if( rc!=SQLITE_OK ) break; |
163945
|
0 |
40 |
if( (nBlob+35)>pgsz ){ |
163960
|
303 |
0 |
if( pReader ){ |
163961
|
276 |
27 |
if( !fts3SegReaderIsPending(pReader) ){ |
163964
|
72 |
231 |
if( !fts3SegReaderIsRootOnly(pReader) ){ |
163989
|
231 |
45 |
if( iStartLeaf==0 ){ |
163994
|
0 |
276 |
if( !pReader ){ |
164004
|
231 |
45 |
if( nExtra ){ |
164034
|
1375 |
26769 |
if( c==0 ){ |
164075
|
42 |
77 |
if( bPrefix ){ |
164078
|
3052 |
42 |
for(pE=fts3HashFirst(pHash); pE; pE=fts3HashNext(pE)){ |
164081
|
0 |
3052 |
if( nTerm==0 || (nKey>=nTerm && 0==memcmp(zKey, zTerm, nTerm)) ){ |
|
0 |
0 |
if( nTerm==0 || (nKey>=nTerm && 0==memcmp(zKey, zTerm, nTerm)) ){ |
|
0 |
0 |
if( nTerm==0 || (nKey>=nTerm && 0==memcmp(zKey, zTerm, nTerm)) ){ |
164082
|
209 |
2843 |
if( nElem==nAlloc ){ |
164088
|
0 |
209 |
if( !aElem2 ){ |
164104
|
26 |
16 |
if( nElem>1 ){ |
164117
|
1 |
76 |
if( pE ){ |
164123
|
27 |
92 |
if( nElem>0 ){ |
164126
|
0 |
27 |
if( !pReader ){ |
164136
|
42 |
77 |
if( bPrefix ){ |
164157
|
120 |
229 |
if( pLhs->aNode && pRhs->aNode ){ |
|
70 |
50 |
if( pLhs->aNode && pRhs->aNode ){ |
164159
|
13 |
57 |
if( rc2<0 ){ |
164164
|
39 |
31 |
if( rc==0 ){ |
164170
|
196 |
153 |
if( rc==0 ){ |
164190
|
114 |
56 |
if( rc==0 ){ |
164191
|
16 |
98 |
if( pLhs->iDocid==pRhs->iDocid ){ |
164194
|
58 |
40 |
rc = (pLhs->iDocid > pRhs->iDocid) ? 1 : -1; |
164202
|
0 |
0 |
if( rc==0 ){ |
164203
|
0 |
0 |
if( pLhs->iDocid==pRhs->iDocid ){ |
164206
|
0 |
0 |
rc = (pLhs->iDocid < pRhs->iDocid) ? 1 : -1; |
164227
|
5694 |
16 |
if( pSeg->aNode ){ |
164228
|
2877 |
2817 |
if( pSeg->nTerm>nTerm ){ |
164233
|
274 |
5420 |
if( res==0 ){ |
164256
|
3390 |
169 |
if( nSuspect==nSegment ) nSuspect--; |
164257
|
368 |
3559 |
for(i=nSuspect-1; i>=0; i--){ |
164259
|
519 |
240 |
for(j=i; j<(nSegment-1); j++){ |
164261
|
128 |
391 |
if( xCmp(apSegment[j], apSegment[j+1])<0 ) break; |
164287
|
17 |
0 |
if( rc==SQLITE_OK ){ |
164308
|
0 |
0 |
if( rc==SQLITE_OK ){ |
164309
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
164334
|
26 |
0 |
if( rc==SQLITE_OK ){ |
164339
|
0 |
26 |
if( nLeafData==0 ){ |
164343
|
0 |
26 |
if( !zEnd ) return SQLITE_NOMEM; |
164370
|
12158 |
784 |
for(n=0; n
|
|
9875 |
2283 |
for(n=0; n
|
164392
|
15 |
2 |
if( pTree ){ |
164402
|
0 |
15 |
if( nReq<=p->nNodeSize || !pTree->zTerm ){ |
|
0 |
0 |
if( nReq<=p->nNodeSize || !pTree->zTerm ){ |
164404
|
0 |
15 |
if( nReq>p->nNodeSize ){ |
164414
|
0 |
0 |
if( !pTree->aData ){ |
164419
|
13 |
2 |
if( pTree->zTerm ){ |
164429
|
15 |
0 |
if( isCopyTerm ){ |
164430
|
2 |
13 |
if( pTree->nMalloc
|
164432
|
0 |
2 |
if( !zNew ){ |
164458
|
0 |
2 |
if( !pNew ){ |
164465
|
0 |
2 |
if( pTree ){ |
164468
|
0 |
0 |
if( pTree->pParent==0 ){ |
164527
|
2 |
0 |
if( !pTree->pParent ){ |
164537
|
0 |
0 |
for(pIter=pTree->pLeftmost; pIter && rc==SQLITE_OK; pIter=pIter->pRight){ |
|
0 |
0 |
for(pIter=pTree->pLeftmost; pIter && rc==SQLITE_OK; pIter=pIter->pRight){ |
164545
|
0 |
0 |
if( rc==SQLITE_OK ){ |
164560
|
2 |
26 |
if( pTree ){ |
164563
|
2 |
2 |
while( p ){ |
164565
|
0 |
2 |
if( p->aData!=(char *)&p[1] ){ |
164599
|
26 |
3026 |
if( !pWriter ){ |
164605
|
0 |
26 |
if( !pWriter ) return SQLITE_NOMEM; |
164611
|
0 |
26 |
if( !pWriter->aData ) return SQLITE_NOMEM; |
164616
|
0 |
26 |
if( rc!=SQLITE_OK ) return rc; |
164617
|
26 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
164622
|
0 |
26 |
if( rc!=SQLITE_OK ) return rc; |
164636
|
3026 |
26 |
if( nData>0 && nData+nReq>p->nNodeSize ){ |
|
15 |
3011 |
if( nData>0 && nData+nReq>p->nNodeSize ){ |
164641
|
0 |
15 |
if( rc!=SQLITE_OK ) return rc; |
164658
|
0 |
15 |
if( rc!=SQLITE_OK ) return rc; |
164678
|
0 |
3052 |
if( nReq>pWriter->nSize ){ |
164680
|
0 |
0 |
if( !aNew ) return SQLITE_NOMEM; |
164700
|
3052 |
0 |
if( isCopyTerm ){ |
164701
|
36 |
3016 |
if( nTerm>pWriter->nMalloc ){ |
164703
|
0 |
36 |
if( !zNew ){ |
164733
|
2 |
24 |
if( pWriter->pTree ){ |
164741
|
2 |
0 |
if( rc==SQLITE_OK ){ |
164745
|
2 |
0 |
if( rc==SQLITE_OK ){ |
164763
|
26 |
8 |
if( pWriter ){ |
164784
|
1 |
0 |
if( p->zContentTbl ){ |
164790
|
0 |
0 |
if( rc==SQLITE_OK ){ |
164791
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
164825
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
164830
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
164854
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
164861
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
164877
|
0 |
0 |
if( pSeg->iStartBlock ){ |
164880
|
0 |
0 |
if( rc==SQLITE_OK ){ |
164916
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
164919
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
164924
|
0 |
0 |
if( iLevel==FTS3_SEGCURSOR_ALL ){ |
164926
|
0 |
0 |
if( rc==SQLITE_OK ){ |
164934
|
0 |
0 |
if( rc==SQLITE_OK ){ |
164941
|
0 |
0 |
if( rc==SQLITE_OK ){ |
164976
|
78 |
71 |
while( p
|
|
71 |
7 |
while( p
|
164978
|
71 |
7 |
if( iCol==iCurrent ){ |
164985
|
0 |
7 |
if( nList==0 ){ |
164989
|
0 |
7 |
p += fts3GetVarint32(p, &iCurrent); |
164992
|
59 |
12 |
if( bZero && &pList[nList]!=pEnd ){ |
|
0 |
59 |
if( bZero && &pList[nList]!=pEnd ){ |
165011
|
29 |
3026 |
if( nList>pMsr->nBuffer ){ |
165015
|
0 |
29 |
if( !pNew ) return SQLITE_NOMEM; |
165033
|
0 |
267 |
p->bDescIdx ? fts3SegReaderDoclistCmpRev : fts3SegReaderDoclistCmp |
165036
|
4 |
263 |
if( nMerge==0 ){ |
165045
|
50 |
229 |
if( pSeg->pOffsetList==0 ){ |
165057
|
245 |
0 |
while( rc==SQLITE_OK |
165058
|
132 |
113 |
&& j
|
165059
|
83 |
49 |
&& apSegment[j]->pOffsetList |
165060
|
16 |
67 |
&& apSegment[j]->iDocid==iDocid |
165065
|
0 |
229 |
if( rc!=SQLITE_OK ) return rc; |
165068
|
213 |
16 |
if( nList>0 && fts3SegReaderIsPending(apSegment[0]) ){ |
|
3 |
210 |
if( nList>0 && fts3SegReaderIsPending(apSegment[0]) ){ |
165070
|
0 |
3 |
if( rc!=SQLITE_OK ) return rc; |
165075
|
59 |
170 |
if( pMsr->iColFilter>=0 ){ |
165079
|
213 |
16 |
if( nList>0 ){ |
165106
|
415 |
0 |
for(i=0; pCsr->bRestart==0 && inSegment; i++){ |
|
303 |
112 |
for(i=0; pCsr->bRestart==0 && inSegment; i++){ |
165111
|
0 |
5639 |
if( rc!=SQLITE_OK ) return rc; |
165112
|
5610 |
29 |
}while( zTerm && (res = fts3SegReaderTermCmp(pSeg, zTerm, nTerm))<0 ); |
|
5336 |
274 |
}while( zTerm && (res = fts3SegReaderTermCmp(pSeg, zTerm, nTerm))<0 ); |
165114
|
241 |
62 |
if( pSeg->bLookup && res!=0 ){ |
|
134 |
107 |
if( pSeg->bLookup && res!=0 ){ |
165143
|
0 |
77 |
p->bDescIdx ? fts3SegReaderDoclistCmpRev : fts3SegReaderDoclistCmp |
165151
|
0 |
77 |
if( rc!=SQLITE_OK ) return rc; |
165154
|
150 |
27 |
for(i=0; i
|
165156
|
100 |
50 |
if( !pSeg->aNode || fts3SegReaderTermCmp(pSeg, zTerm, nTerm) ){ |
|
100 |
0 |
if( !pSeg->aNode || fts3SegReaderTermCmp(pSeg, zTerm, nTerm) ){ |
165163
|
100 |
77 |
for(i=0; inAdvance; i++){ |
165165
|
0 |
100 |
if( rc!=SQLITE_OK ) return rc; |
165197
|
0 |
0 |
for(i=0; inSegment; i++){ |
165224
|
0 |
3105 |
p->bDescIdx ? fts3SegReaderDoclistCmpRev : fts3SegReaderDoclistCmp |
165227
|
0 |
3105 |
if( pCsr->nSegment==0 ) return SQLITE_OK; |
165236
|
3070 |
3105 |
for(i=0; inAdvance; i++){ |
165238
|
0 |
3070 |
if( pSeg->bLookup ){ |
165243
|
0 |
3070 |
if( rc!=SQLITE_OK ) return rc; |
165250
|
31 |
3074 |
if( apSegment[0]->aNode==0 ) break; |
165262
|
16 |
3058 |
if( pFilter->zTerm && !isScan ){ |
|
16 |
0 |
if( pFilter->zTerm && !isScan ){ |
165263
|
12 |
4 |
if( pCsr->nTermnTerm |
165264
|
0 |
12 |
|| (!isPrefix && pCsr->nTerm>pFilter->nTerm) |
|
0 |
0 |
|| (!isPrefix && pCsr->nTerm>pFilter->nTerm) |
165265
|
12 |
0 |
|| memcmp(pCsr->zTerm, pFilter->zTerm, pFilter->nTerm) |
165272
|
18 |
3052 |
while( nMerge
|
165273
|
13 |
5 |
&& apSegment[nMerge]->aNode |
165274
|
0 |
13 |
&& apSegment[nMerge]->nTerm==pCsr->nTerm |
165275
|
0 |
0 |
&& 0==memcmp(pCsr->zTerm, apSegment[nMerge]->zTerm, pCsr->nTerm) |
165281
|
3070 |
0 |
if( nMerge==1 |
165282
|
3052 |
18 |
&& !isIgnoreEmpty |
165283
|
3052 |
0 |
&& !isFirst |
165284
|
0 |
3052 |
&& (p->bDescIdx==0 || fts3SegReaderIsPending(apSegment[0])==0) |
|
0 |
0 |
&& (p->bDescIdx==0 || fts3SegReaderIsPending(apSegment[0])==0) |
165287
|
3052 |
0 |
if( fts3SegReaderIsPending(apSegment[0]) ){ |
165293
|
3052 |
0 |
if( rc==SQLITE_OK ) rc = SQLITE_ROW; |
165302
|
18 |
18 |
for(i=0; i
|
165306
|
18 |
18 |
while( apSegment[0]->pOffsetList ){ |
165314
|
0 |
18 |
while( j
|
165315
|
0 |
0 |
&& apSegment[j]->pOffsetList |
165316
|
0 |
0 |
&& apSegment[j]->iDocid==iDocid |
165322
|
12 |
6 |
if( isColFilter ){ |
165326
|
18 |
0 |
if( !isIgnoreEmpty || nList>0 ){ |
|
18 |
0 |
if( !isIgnoreEmpty || nList>0 ){ |
165331
|
0 |
18 |
if( p->bDescIdx && nDoclist>0 ){ |
|
0 |
0 |
if( p->bDescIdx && nDoclist>0 ){ |
165339
|
18 |
0 |
nByte = sqlite3Fts3VarintLen(iDelta) + (isRequirePos?nList+1:0); |
165340
|
9 |
9 |
if( nDoclist+nByte>pCsr->nBuffer ){ |
165344
|
0 |
9 |
if( !aNew ){ |
165350
|
0 |
18 |
if( isFirst ){ |
165355
|
0 |
0 |
if( nWrite ){ |
165362
|
18 |
0 |
if( isRequirePos ){ |
165372
|
18 |
0 |
if( nDoclist>0 ){ |
165379
|
0 |
3070 |
}while( rc==SQLITE_OK ); |
165388
|
121 |
8 |
if( pCsr ){ |
165390
|
303 |
121 |
for(i=0; inSegment; i++){ |
165419
|
0 |
0 |
if( zText ){ |
165423
|
0 |
0 |
for(i=0; zText[i]>='0' && zText[i]<='9'; i++){ |
|
0 |
0 |
for(i=0; zText[i]>='0' && zText[i]<='9'; i++){ |
165427
|
0 |
0 |
while( zText[i]==' ' ) i++; |
165429
|
0 |
0 |
if( zText[i]=='-' ){ |
165433
|
0 |
0 |
for(/* no-op */; zText[i]>='0' && zText[i]<='9'; i++){ |
|
0 |
0 |
for(/* no-op */; zText[i]>='0' && zText[i]<='9'; i++){ |
165455
|
26 |
0 |
if( rc==SQLITE_OK ){ |
165467
|
0 |
26 |
while( SQLITE_ROW==sqlite3_step(pRange) ){ |
165470
|
0 |
0 |
if( nSize<=0 || nSize>nLimit ){ |
|
0 |
0 |
if( nSize<=0 || nSize>nLimit ){ |
165483
|
0 |
26 |
if( bOk ){ |
165488
|
0 |
0 |
if( rc==SQLITE_OK ){ |
165491
|
0 |
0 |
if( rc==SQLITE_OK ){ |
165495
|
0 |
0 |
if( rc==SQLITE_OK ){ |
165507
|
0 |
0 |
while( SQLITE_ROW==sqlite3_step(pRange) ){ |
165513
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
165519
|
0 |
0 |
if( rc==SQLITE_OK ){ |
165524
|
0 |
0 |
if( rc==SQLITE_OK ){ |
165570
|
34 |
0 |
if( rc!=SQLITE_OK || csr.nSegment==0 ) goto finished; |
|
26 |
8 |
if( rc!=SQLITE_OK || csr.nSegment==0 ) goto finished; |
165572
|
0 |
26 |
if( iLevel!=FTS3_SEGCURSOR_PENDING ){ |
165574
|
0 |
0 |
if( rc!=SQLITE_OK ) goto finished; |
165577
|
0 |
26 |
if( iLevel==FTS3_SEGCURSOR_ALL ){ |
165582
|
0 |
0 |
if( csr.nSegment==1 && 0==fts3SegReaderIsPending(csr.apSegment[0]) ){ |
|
0 |
0 |
if( csr.nSegment==1 && 0==fts3SegReaderIsPending(csr.apSegment[0]) ){ |
165597
|
0 |
26 |
bIgnoreEmpty = (iLevel!=FTS3_SEGCURSOR_PENDING) && (iNewLevel>iMaxLevel); |
|
0 |
0 |
bIgnoreEmpty = (iLevel!=FTS3_SEGCURSOR_PENDING) && (iNewLevel>iMaxLevel); |
165599
|
0 |
26 |
if( rc!=SQLITE_OK ) goto finished; |
165607
|
0 |
26 |
filter.flags |= (bIgnoreEmpty ? FTS3_SEGMENT_IGNORE_EMPTY : 0); |
165610
|
3078 |
0 |
while( SQLITE_OK==rc ){ |
165612
|
26 |
3052 |
if( rc!=SQLITE_ROW ) break; |
165616
|
0 |
26 |
if( rc!=SQLITE_OK ) goto finished; |
165619
|
0 |
26 |
if( iLevel!=FTS3_SEGCURSOR_PENDING ){ |
165623
|
0 |
0 |
if( rc!=SQLITE_OK ) goto finished; |
165625
|
26 |
0 |
if( pWriter ){ |
165627
|
26 |
0 |
if( rc==SQLITE_OK ){ |
165628
|
0 |
26 |
if( iLevel==FTS3_SEGCURSOR_PENDING || iNewLevel
|
|
0 |
0 |
if( iLevel==FTS3_SEGCURSOR_PENDING || iNewLevel
|
165648
|
68 |
0 |
for(i=0; rc==SQLITE_OK && inIndex; i++){ |
|
34 |
34 |
for(i=0; rc==SQLITE_OK && inIndex; i++){ |
165650
|
0 |
34 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
165657
|
34 |
0 |
if( rc==SQLITE_OK && p->bHasStat |
|
19 |
15 |
if( rc==SQLITE_OK && p->bHasStat |
165658
|
9 |
10 |
&& p->nAutoincrmerge==0xff && p->nLeafAdd>0 |
|
5 |
4 |
&& p->nAutoincrmerge==0xff && p->nLeafAdd>0 |
165662
|
5 |
0 |
if( rc==SQLITE_OK ){ |
165665
|
0 |
5 |
if( rc==SQLITE_ROW ){ |
165667
|
0 |
0 |
if( p->nAutoincrmerge==1 ) p->nAutoincrmerge = 8; |
165668
|
5 |
0 |
}else if( rc==SQLITE_DONE ){ |
165687
|
106 |
43 |
for(i=j=0; i
|
165704
|
46 |
13 |
for(i=j=0; i
|
165727
|
0 |
25 |
if( *pRC ) return; |
165729
|
0 |
25 |
if( pBlob==0 ){ |
165735
|
0 |
25 |
if( rc ){ |
165777
|
0 |
18 |
if( *pRC ) return; |
165779
|
0 |
18 |
if( a==0 ){ |
165785
|
0 |
18 |
if( rc ){ |
165791
|
13 |
5 |
if( sqlite3_step(pStmt)==SQLITE_ROW ){ |
165799
|
0 |
18 |
if( rc!=SQLITE_OK ){ |
165804
|
1 |
17 |
if( nChng<0 && a[0]<(u32)(-nChng) ){ |
|
0 |
1 |
if( nChng<0 && a[0]<(u32)(-nChng) ){ |
165809
|
46 |
18 |
for(i=0; inColumn+1; i++){ |
165811
|
0 |
46 |
if( x+aSzIns[i] < aSzDel[i] ){ |
165820
|
0 |
18 |
if( rc ){ |
165843
|
0 |
0 |
if( rc==SQLITE_OK ){ |
165847
|
0 |
0 |
while( sqlite3_step(pAllLangid)==SQLITE_ROW ){ |
165850
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inIndex; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inIndex; i++){ |
165852
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
165859
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
165865
|
0 |
0 |
return (rc==SQLITE_OK && bReturnDone && bSeenDone) ? SQLITE_DONE : rc; |
|
0 |
0 |
return (rc==SQLITE_OK && bReturnDone && bSeenDone) ? SQLITE_DONE : rc; |
|
0 |
0 |
return (rc==SQLITE_OK && bReturnDone && bSeenDone) ? SQLITE_DONE : rc; |
165882
|
1 |
0 |
if( rc==SQLITE_OK ){ |
165891
|
0 |
1 |
if( !zSql ){ |
165898
|
1 |
0 |
if( rc==SQLITE_OK ){ |
165901
|
0 |
1 |
if( aSz==0 ){ |
165910
|
10 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ |
|
9 |
1 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ |
165915
|
27 |
0 |
for(iCol=0; rc==SQLITE_OK && iColnColumn; iCol++){ |
|
18 |
9 |
for(iCol=0; rc==SQLITE_OK && iColnColumn; iCol++){ |
165916
|
18 |
0 |
if( p->abNotindexed[iCol]==0 ){ |
165922
|
9 |
0 |
if( p->bHasDocsize ){ |
165925
|
0 |
9 |
if( rc!=SQLITE_OK ){ |
165930
|
27 |
9 |
for(iCol=0; iCol<=p->nColumn; iCol++){ |
165935
|
1 |
0 |
if( p->bFts4 ){ |
165940
|
1 |
0 |
if( pStmt ){ |
165942
|
1 |
0 |
if( rc==SQLITE_OK ){ |
165973
|
0 |
0 |
if( pCsr->apSegment==0 ){ |
165979
|
0 |
0 |
if( rc==SQLITE_OK ){ |
165984
|
0 |
0 |
for(i=0; rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW && i
|
165996
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
166075
|
0 |
0 |
if( *pRc==SQLITE_OK && nMin>pBlob->nAlloc ){ |
|
0 |
0 |
if( *pRc==SQLITE_OK && nMin>pBlob->nAlloc ){ |
166078
|
0 |
0 |
if( a ){ |
166104
|
0 |
0 |
if( p->iChild && bFirst==0 ) p->iChild++; |
|
0 |
0 |
if( p->iChild && bFirst==0 ) p->iChild++; |
166105
|
0 |
0 |
if( p->iOff>=p->nNode ){ |
166109
|
0 |
0 |
if( bFirst==0 ){ |
166110
|
0 |
0 |
p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &nPrefix); |
166112
|
0 |
0 |
p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &nSuffix); |
166115
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166119
|
0 |
0 |
if( p->iChild==0 ){ |
166120
|
0 |
0 |
p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &p->nDoclist); |
166152
|
0 |
0 |
if( p->aNode[0] ){ |
166182
|
0 |
0 |
for(iLayer=1; ALWAYS(iLayer
|
166199
|
0 |
0 |
if( pNode->key.n==0 || (pNode->block.n + nSpace)<=p->nNodeSize ){ |
|
0 |
0 |
if( pNode->key.n==0 || (pNode->block.n + nSpace)<=p->nNodeSize ){ |
166205
|
0 |
0 |
if( pBlk->n==0 ){ |
166207
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166215
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166216
|
0 |
0 |
if( pNode->key.n ){ |
166241
|
0 |
0 |
if( rc!=SQLITE_OK || iNextPtr==0 ) return rc; |
|
0 |
0 |
if( rc!=SQLITE_OK || iNextPtr==0 ) return rc; |
166292
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
166299
|
0 |
0 |
if( bFirst==0 ){ |
166306
|
0 |
0 |
if( aDoclist ){ |
166349
|
0 |
0 |
if( pLeaf->block.n>0 && (pLeaf->block.n + nSpace)>p->nNodeSize ){ |
|
0 |
0 |
if( pLeaf->block.n>0 && (pLeaf->block.n + nSpace)>p->nNodeSize ){ |
166365
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166382
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166383
|
0 |
0 |
if( pLeaf->block.n==0 ){ |
166422
|
0 |
0 |
for(iRoot=FTS_MAX_APPENDABLE_HEIGHT-1; iRoot>=0; iRoot--){ |
166424
|
0 |
0 |
if( pNode->block.n>0 ) break; |
166432
|
0 |
0 |
if( iRoot<0 ) return; |
166449
|
0 |
0 |
if( iRoot==0 ){ |
166452
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166463
|
0 |
0 |
for(i=0; i
|
166465
|
0 |
0 |
if( pNode->block.n>0 && rc==SQLITE_OK ){ |
|
0 |
0 |
if( pNode->block.n>0 && rc==SQLITE_OK ){ |
166473
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166474
|
0 |
0 |
rc = fts3WriteSegdir(p, |
166506
|
0 |
0 |
if( res==0 ) res = nLhs - nRhs; |
166530
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166532
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pCheck) ) bRes = 1; |
166567
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166579
|
0 |
0 |
if( sqlite3_step(pSelect)==SQLITE_ROW ){ |
166583
|
0 |
0 |
if( pWriter->nLeafData<0 ){ |
166597
|
0 |
0 |
if( rc==SQLITE_OK && bAppendable ){ |
|
0 |
0 |
if( rc==SQLITE_OK && bAppendable ){ |
166602
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166604
|
0 |
0 |
for(rc = nodeReaderInit(&reader, aLeaf, nLeaf); |
166605
|
0 |
0 |
rc==SQLITE_OK && reader.aNode; |
166610
|
0 |
0 |
if( fts3TermCmp(zKey, nKey, reader.term.a, reader.term.n)<=0 ){ |
166618
|
0 |
0 |
if( rc==SQLITE_OK && bAppendable ){ |
|
0 |
0 |
if( rc==SQLITE_OK && bAppendable ){ |
166631
|
0 |
0 |
for(i=nHeight+1; i
|
166638
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166643
|
0 |
0 |
for(i=nHeight; i>=0 && rc==SQLITE_OK; i--){ |
|
0 |
0 |
for(i=nHeight; i>=0 && rc==SQLITE_OK; i--){ |
166648
|
0 |
0 |
while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader); |
|
0 |
0 |
while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader); |
166650
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166653
|
0 |
0 |
if( i>0 ){ |
166660
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166672
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
166696
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166747
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166750
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pLeafEst) ){ |
166755
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
166759
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166760
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pFirstBlock) ){ |
166767
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
166773
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
166780
|
0 |
0 |
for(i=0; i
|
166806
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166834
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166837
|
0 |
0 |
while( SQLITE_ROW==sqlite3_step(pSelect) ){ |
166838
|
0 |
0 |
if( nIdx>=nAlloc ){ |
166842
|
0 |
0 |
if( !aNew ){ |
166851
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
166854
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166857
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166863
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
166864
|
0 |
0 |
if( aIdx[i]!=i ){ |
166879
|
0 |
0 |
if( iChild ){ |
166911
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
166915
|
0 |
0 |
for(rc = nodeReaderInit(&reader, aNode, nNode); |
166916
|
0 |
0 |
rc==SQLITE_OK && reader.aNode; |
166919
|
0 |
0 |
if( pNew->n==0 ){ |
166921
|
0 |
0 |
if( res<0 || (bLeaf==0 && res==0) ) continue; |
|
0 |
0 |
if( res<0 || (bLeaf==0 && res==0) ) continue; |
|
0 |
0 |
if( res<0 || (bLeaf==0 && res==0) ) continue; |
166929
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
166931
|
0 |
0 |
if( pNew->n==0 ){ |
166967
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166971
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pFetch) ){ |
166978
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
166981
|
0 |
0 |
while( rc==SQLITE_OK && iBlock ){ |
|
0 |
0 |
while( rc==SQLITE_OK && iBlock ){ |
166987
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166990
|
0 |
0 |
if( rc==SQLITE_OK ){ |
166997
|
0 |
0 |
if( rc==SQLITE_OK && iNewStart ){ |
|
0 |
0 |
if( rc==SQLITE_OK && iNewStart ){ |
167000
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167008
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167011
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167047
|
0 |
0 |
for(i=pCsr->nSegment-1; i>=0 && rc==SQLITE_OK; i--){ |
|
0 |
0 |
for(i=pCsr->nSegment-1; i>=0 && rc==SQLITE_OK; i--){ |
167053
|
0 |
0 |
for(j=0; ALWAYS(jnSegment); j++){ |
167055
|
0 |
0 |
if( pSeg->iIdx==i ) break; |
167059
|
0 |
0 |
if( pSeg->aNode==0 ){ |
167062
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167077
|
0 |
0 |
if( rc==SQLITE_OK && nRem!=pCsr->nSegment ){ |
|
0 |
0 |
if( rc==SQLITE_OK && nRem!=pCsr->nSegment ){ |
167093
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167118
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167121
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pSelect) ){ |
167124
|
0 |
0 |
if( aHint ){ |
167126
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167133
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
167155
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
167174
|
0 |
0 |
while( i>0 && (pHint->a[i-1] & 0x80) ) i--; |
|
0 |
0 |
while( i>0 && (pHint->a[i-1] & 0x80) ) i--; |
167175
|
0 |
0 |
while( i>0 && (pHint->a[i-1] & 0x80) ) i--; |
|
0 |
0 |
while( i>0 && (pHint->a[i-1] & 0x80) ) i--; |
167179
|
0 |
0 |
i += fts3GetVarint32(&pHint->a[i], pnInput); |
167180
|
0 |
0 |
if( i!=nHint ) return FTS_CORRUPT_VTAB; |
167209
|
0 |
0 |
if( !pWriter ) return SQLITE_NOMEM; |
167214
|
0 |
0 |
while( rc==SQLITE_OK && nRem>0 ){ |
|
0 |
0 |
while( rc==SQLITE_OK && nRem>0 ){ |
167228
|
0 |
0 |
if( sqlite3_step(pFindLevel)==SQLITE_ROW ){ |
167242
|
0 |
0 |
if( rc==SQLITE_OK && hint.n ){ |
|
0 |
0 |
if( rc==SQLITE_OK && hint.n ){ |
167248
|
0 |
0 |
if( nSeg<0 || (iAbsLevel % nMod) >= (iHintAbsLevel % nMod) ){ |
|
0 |
0 |
if( nSeg<0 || (iAbsLevel % nMod) >= (iHintAbsLevel % nMod) ){ |
167263
|
0 |
0 |
if( nSeg<0 ) break; |
167274
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167277
|
0 |
0 |
if( iIdx==0 || (bUseHint && iIdx==1) ){ |
|
0 |
0 |
if( iIdx==0 || (bUseHint && iIdx==1) ){ |
|
0 |
0 |
if( iIdx==0 || (bUseHint && iIdx==1) ){ |
167280
|
0 |
0 |
if( bIgnore ){ |
167286
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167289
|
0 |
0 |
if( SQLITE_OK==rc && pCsr->nSegment==nSeg |
|
0 |
0 |
if( SQLITE_OK==rc && pCsr->nSegment==nSeg |
167290
|
0 |
0 |
&& SQLITE_OK==(rc = sqlite3Fts3SegReaderStart(p, pCsr, pFilter)) |
167291
|
0 |
0 |
&& SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, pCsr)) |
167293
|
0 |
0 |
if( bUseHint && iIdx>0 ){ |
|
0 |
0 |
if( bUseHint && iIdx>0 ){ |
167301
|
0 |
0 |
if( rc==SQLITE_OK && pWriter->nLeafEst ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pWriter->nLeafEst ){ |
167305
|
0 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts3SegReaderStep(p, pCsr); |
167306
|
0 |
0 |
if( pWriter->nWork>=nRem && rc==SQLITE_ROW ) rc = SQLITE_OK; |
|
0 |
0 |
if( pWriter->nWork>=nRem && rc==SQLITE_ROW ) rc = SQLITE_OK; |
167307
|
0 |
0 |
}while( rc==SQLITE_ROW ); |
167310
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167313
|
0 |
0 |
if( nSeg!=0 ){ |
167320
|
0 |
0 |
if( nSeg!=0 ){ |
167324
|
0 |
0 |
if( nSeg==0 && pWriter->bNoLeafData==0 ){ |
|
0 |
0 |
if( nSeg==0 && pWriter->bNoLeafData==0 ){ |
167333
|
0 |
0 |
if( bDirtyHint && rc==SQLITE_OK ){ |
|
0 |
0 |
if( bDirtyHint && rc==SQLITE_OK ){ |
167353
|
0 |
0 |
while( (*z)>='0' && (*z)<='9' && i<214748363 ) i = 10*i + *(z++) - '0'; |
|
0 |
0 |
while( (*z)>='0' && (*z)<='9' && i<214748363 ) i = 10*i + *(z++) - '0'; |
|
0 |
0 |
while( (*z)>='0' && (*z)<='9' && i<214748363 ) i = 10*i + *(z++) - '0'; |
167381
|
0 |
0 |
if( z[0]==',' && z[1]!='\0' ){ |
|
0 |
0 |
if( z[0]==',' && z[1]!='\0' ){ |
167386
|
0 |
0 |
if( z[0]!='\0' || nMin<2 ){ |
|
0 |
0 |
if( z[0]!='\0' || nMin<2 ){ |
167390
|
0 |
0 |
if( !p->bHasStat ){ |
167394
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167417
|
0 |
0 |
if( p->nAutoincrmerge==1 || p->nAutoincrmerge>FTS3_MERGE_COUNT ){ |
|
0 |
0 |
if( p->nAutoincrmerge==1 || p->nAutoincrmerge>FTS3_MERGE_COUNT ){ |
167420
|
0 |
0 |
if( !p->bHasStat ){ |
167423
|
0 |
0 |
if( rc ) return rc; |
167426
|
0 |
0 |
if( rc ) return rc; |
167454
|
0 |
0 |
for(i=0; i
|
167489
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167493
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167494
|
0 |
0 |
while( SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, &csr)) ){ |
167503
|
0 |
0 |
while( pCsr
|
167506
|
0 |
0 |
if( pCsr
|
167507
|
0 |
0 |
if( iVal==0 || iVal==1 ){ |
|
0 |
0 |
if( iVal==0 || iVal==1 ){ |
167510
|
0 |
0 |
if( iVal ){ |
167550
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167554
|
0 |
0 |
while( rc==SQLITE_OK && sqlite3_step(pAllLangid)==SQLITE_ROW ){ |
|
0 |
0 |
while( rc==SQLITE_OK && sqlite3_step(pAllLangid)==SQLITE_ROW ){ |
167557
|
0 |
0 |
for(i=0; inIndex; i++){ |
167562
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
167566
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167572
|
0 |
0 |
if( !zSql ){ |
167579
|
0 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ |
|
0 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ |
167584
|
0 |
0 |
for(iCol=0; rc==SQLITE_OK && iColnColumn; iCol++){ |
|
0 |
0 |
for(iCol=0; rc==SQLITE_OK && iColnColumn; iCol++){ |
167585
|
0 |
0 |
if( p->abNotindexed[iCol]==0 ){ |
167591
|
0 |
0 |
while( rc==SQLITE_OK ){ |
167598
|
0 |
0 |
if( rc==SQLITE_OK ){ |
167603
|
0 |
0 |
for(i=1; inIndex; i++){ |
167604
|
0 |
0 |
if( p->aIndex[i].nPrefix<=nToken ){ |
167612
|
0 |
0 |
if( pT ) pModule->xClose(pT); |
167613
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
167662
|
0 |
0 |
if( rc==SQLITE_OK && bOk==0 ) rc = FTS_CORRUPT_VTAB; |
|
0 |
0 |
if( rc==SQLITE_OK && bOk==0 ) rc = FTS_CORRUPT_VTAB; |
167679
|
0 |
1 |
if( !zVal ){ |
167681
|
0 |
1 |
}else if( nVal==8 && 0==sqlite3_strnicmp(zVal, "optimize", 8) ){ |
|
0 |
0 |
}else if( nVal==8 && 0==sqlite3_strnicmp(zVal, "optimize", 8) ){ |
167683
|
1 |
0 |
}else if( nVal==7 && 0==sqlite3_strnicmp(zVal, "rebuild", 7) ){ |
|
1 |
0 |
}else if( nVal==7 && 0==sqlite3_strnicmp(zVal, "rebuild", 7) ){ |
167685
|
0 |
0 |
}else if( nVal==15 && 0==sqlite3_strnicmp(zVal, "integrity-check", 15) ){ |
|
0 |
0 |
}else if( nVal==15 && 0==sqlite3_strnicmp(zVal, "integrity-check", 15) ){ |
167687
|
0 |
0 |
}else if( nVal>6 && 0==sqlite3_strnicmp(zVal, "merge=", 6) ){ |
|
0 |
0 |
}else if( nVal>6 && 0==sqlite3_strnicmp(zVal, "merge=", 6) ){ |
167689
|
0 |
0 |
}else if( nVal>10 && 0==sqlite3_strnicmp(zVal, "automerge=", 10) ){ |
|
0 |
0 |
}else if( nVal>10 && 0==sqlite3_strnicmp(zVal, "automerge=", 10) ){ |
167716
|
0 |
95 |
for(pDef=pCsr->pDeferred; pDef; pDef=pDef->pNext){ |
167729
|
0 |
141 |
for(pDef=pCsr->pDeferred; pDef; pDef=pNext){ |
167747
|
0 |
0 |
if( pCsr->pDeferred ){ |
167759
|
0 |
0 |
for(i=0; inColumn && rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; inColumn && rc==SQLITE_OK; i++){ |
167760
|
0 |
0 |
if( p->abNotindexed[i]==0 ){ |
167765
|
0 |
0 |
while( rc==SQLITE_OK ){ |
167772
|
0 |
0 |
for(pDef=pCsr->pDeferred; pDef && rc==SQLITE_OK; pDef=pDef->pNext){ |
|
0 |
0 |
for(pDef=pCsr->pDeferred; pDef && rc==SQLITE_OK; pDef=pDef->pNext){ |
167774
|
0 |
0 |
if( (pDef->iCol>=p->nColumn || pDef->iCol==i) |
|
0 |
0 |
if( (pDef->iCol>=p->nColumn || pDef->iCol==i) |
167775
|
0 |
0 |
&& (pPT->bFirst==0 || iPos==0) |
|
0 |
0 |
&& (pPT->bFirst==0 || iPos==0) |
167776
|
0 |
0 |
&& (pPT->n==nToken || (pPT->isPrefix && pPT->n
|
|
0 |
0 |
&& (pPT->n==nToken || (pPT->isPrefix && pPT->n
|
|
0 |
0 |
&& (pPT->n==nToken || (pPT->isPrefix && pPT->n
|
167777
|
0 |
0 |
&& (0==memcmp(zToken, pPT->z, pPT->n)) |
167783
|
0 |
0 |
if( pTC ) pModule->xClose(pTC); |
167784
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
167788
|
0 |
0 |
for(pDef=pCsr->pDeferred; pDef && rc==SQLITE_OK; pDef=pDef->pNext){ |
|
0 |
0 |
for(pDef=pCsr->pDeferred; pDef && rc==SQLITE_OK; pDef=pDef->pNext){ |
167789
|
0 |
0 |
if( pDef->pList ){ |
167810
|
0 |
0 |
if( p->pList==0 ){ |
167815
|
0 |
0 |
if( !pRet ) return SQLITE_NOMEM; |
167835
|
0 |
0 |
if( !pDeferred ){ |
167866
|
1 |
0 |
if( bFound && rc==SQLITE_OK ){ |
|
1 |
0 |
if( bFound && rc==SQLITE_OK ){ |
167869
|
1 |
0 |
if( rc==SQLITE_OK ){ |
167870
|
0 |
1 |
if( isEmpty ){ |
167879
|
0 |
1 |
if( p->zContentTbl==0 ){ |
167882
|
1 |
0 |
if( p->bHasDocsize ){ |
167932
|
29 |
1 |
if( nArg>1 |
167933
|
29 |
0 |
&& sqlite3_value_type(apVal[0])==SQLITE_NULL |
167934
|
1 |
28 |
&& sqlite3_value_type(apVal[p->nColumn+2])!=SQLITE_NULL |
167940
|
28 |
1 |
if( nArg>1 && sqlite3_value_int(apVal[2 + p->nColumn + 2])<0 ){ |
|
0 |
28 |
if( nArg>1 && sqlite3_value_int(apVal[2 + p->nColumn + 2])<0 ){ |
167947
|
0 |
29 |
if( aSzDel==0 ){ |
167955
|
0 |
29 |
if( rc!=SQLITE_OK ) goto update_out; |
167966
|
28 |
1 |
if( nArg>1 && p->zContentTbl==0 ){ |
|
25 |
3 |
if( nArg>1 && p->zContentTbl==0 ){ |
167969
|
25 |
0 |
if( sqlite3_value_type(pNewRowid)==SQLITE_NULL ){ |
167975
|
0 |
0 |
|| sqlite3_value_int64(apVal[0])!=sqlite3_value_int64(pNewRowid) |
167994
|
0 |
0 |
if( sqlite3_vtab_on_conflict(p->db)==SQLITE_REPLACE ){ |
168002
|
0 |
29 |
if( rc!=SQLITE_OK ){ |
168007
|
1 |
28 |
if( sqlite3_value_type(apVal[0])!=SQLITE_NULL ){ |
168013
|
28 |
1 |
if( nArg>1 && rc==SQLITE_OK ){ |
|
28 |
0 |
if( nArg>1 && rc==SQLITE_OK ){ |
168015
|
28 |
0 |
if( bInsertDone==0 ){ |
168017
|
0 |
28 |
if( rc==SQLITE_CONSTRAINT && p->zContentTbl==0 ){ |
|
0 |
0 |
if( rc==SQLITE_CONSTRAINT && p->zContentTbl==0 ){ |
168021
|
28 |
0 |
if( rc==SQLITE_OK ){ |
168024
|
28 |
0 |
if( rc==SQLITE_OK ){ |
168028
|
16 |
12 |
if( p->bHasDocsize ){ |
168034
|
17 |
12 |
if( p->bFts4 ){ |
168052
|
0 |
0 |
if( rc==SQLITE_OK ){ |
168054
|
0 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_DONE ){ |
|
0 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_DONE ){ |
168056
|
0 |
0 |
if( rc2!=SQLITE_OK ) rc = rc2; |
168206
|
0 |
0 |
if( pRet ){ |
168225
|
0 |
0 |
if( (u32*)p==&pBuf->aMatchinfo[1] ){ |
168231
|
0 |
0 |
if( pBuf->aRef[0]==0 && pBuf->aRef[1]==0 && pBuf->aRef[2]==0 ){ |
|
0 |
0 |
if( pBuf->aRef[0]==0 && pBuf->aRef[1]==0 && pBuf->aRef[2]==0 ){ |
|
0 |
0 |
if( pBuf->aRef[0]==0 && pBuf->aRef[1]==0 && pBuf->aRef[2]==0 ){ |
168240
|
0 |
0 |
if( p->aRef[1]==0 ){ |
168245
|
0 |
0 |
else if( p->aRef[2]==0 ){ |
168251
|
0 |
0 |
if( aOut ){ |
168253
|
0 |
0 |
if( p->bGlobal ) memcpy(aOut, &p->aMatchinfo[1], p->nElem*sizeof(u32)); |
168270
|
0 |
141 |
if( p ){ |
168273
|
0 |
0 |
if( p->aRef[0]==0 && p->aRef[1]==0 && p->aRef[2]==0 ){ |
|
0 |
0 |
if( p->aRef[0]==0 && p->aRef[1]==0 && p->aRef[2]==0 ){ |
|
0 |
0 |
if( p->aRef[0]==0 && p->aRef[1]==0 && p->aRef[2]==0 ){ |
168306
|
0 |
0 |
*pp += fts3GetVarint32(*pp, &iVal); |
168322
|
0 |
0 |
if( eType!=FTSQUERY_PHRASE ){ |
168325
|
0 |
0 |
if( rc==SQLITE_OK && eType!=FTSQUERY_NOT ){ |
|
0 |
0 |
if( rc==SQLITE_OK && eType!=FTSQUERY_NOT ){ |
168392
|
0 |
0 |
if( pnPhrase ) *pnPhrase = sCtx.nPhrase; |
168393
|
0 |
0 |
if( pnToken ) *pnToken = sCtx.nToken; |
168415
|
0 |
0 |
if( pIter ){ |
168418
|
0 |
0 |
while( iIter
|
168419
|
0 |
0 |
if( 0==(*pIter & 0xFE) ){ |
168438
|
0 |
0 |
if( pIter->iCurrent<0 ){ |
168448
|
0 |
0 |
for(i=0; inPhrase; i++){ |
168456
|
0 |
0 |
for(i=0; inPhrase; i++){ |
168458
|
0 |
0 |
if( pPhrase->pHead && pPhrase->iHead
|
|
0 |
0 |
if( pPhrase->pHead && pPhrase->iHead
|
168462
|
0 |
0 |
if( iEnd==0x7FFFFFFF ){ |
168467
|
0 |
0 |
for(i=0; inPhrase; i++){ |
168495
|
0 |
0 |
for(i=0; inPhrase; i++){ |
168497
|
0 |
0 |
if( pPhrase->pTail ){ |
168501
|
0 |
0 |
while( iCsr<(iStart+pIter->nSnippet) ){ |
168506
|
0 |
0 |
if( (mCover|mCovered)&mPhrase ){ |
168513
|
0 |
0 |
for(j=0; jnToken; j++){ |
168517
|
0 |
0 |
if( 0==(*pCsr & 0x0FE) ) break; |
168543
|
0 |
0 |
if( pCsr ){ |
168598
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
168607
|
0 |
0 |
if( !sIter.aPhrase ){ |
168621
|
0 |
0 |
if( rc==SQLITE_OK ){ |
168624
|
0 |
0 |
for(i=0; i
|
168625
|
0 |
0 |
if( sIter.aPhrase[i].pHead ){ |
168634
|
0 |
0 |
while( !fts3SnippetNextCandidate(&sIter) ){ |
168641
|
0 |
0 |
if( iScore>iBestScore ){ |
168667
|
0 |
0 |
if( nAppend<0 ){ |
168675
|
0 |
0 |
if( pStr->n+nAppend+1>=pStr->nAlloc ){ |
168678
|
0 |
0 |
if( !zNew ){ |
168725
|
0 |
0 |
if( hlmask ){ |
168730
|
0 |
0 |
for(nLeft=0; !(hlmask & ((u64)1 << nLeft)); nLeft++); |
168731
|
0 |
0 |
for(nRight=0; !(hlmask & ((u64)1 << (nSnippet-1-nRight))); nRight++); |
168741
|
0 |
0 |
if( nDesired>0 ){ |
168753
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
168756
|
0 |
0 |
while( rc==SQLITE_OK && iCurrent<(nSnippet+nDesired) ){ |
|
0 |
0 |
while( rc==SQLITE_OK && iCurrent<(nSnippet+nDesired) ){ |
168761
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_DONE ){ return rc; } |
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_DONE ){ return rc; } |
168765
|
0 |
0 |
if( nShift>0 ){ |
168803
|
0 |
0 |
if( zDoc==0 ){ |
168804
|
0 |
0 |
if( sqlite3_column_type(pCsr->pStmt, iCol)!=SQLITE_NULL ){ |
168814
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
168818
|
0 |
0 |
while( rc==SQLITE_OK ){ |
168837
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
168838
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
168847
|
0 |
0 |
if( iCurrent
|
168849
|
0 |
0 |
if( !isShiftDone ){ |
168860
|
0 |
0 |
if( rc==SQLITE_OK ){ |
168861
|
0 |
0 |
if( iPos>0 || iFragment>0 ){ |
|
0 |
0 |
if( iPos>0 || iFragment>0 ){ |
168863
|
0 |
0 |
}else if( iBegin ){ |
168867
|
0 |
0 |
if( rc!=SQLITE_OK || iCurrent
|
|
0 |
0 |
if( rc!=SQLITE_OK || iCurrent
|
168870
|
0 |
0 |
if( iCurrent>=(iPos+nSnippet) ){ |
168871
|
0 |
0 |
if( isLast ){ |
168880
|
0 |
0 |
if( iCurrent>iPos ) rc = fts3StringAppend(pOut, &zDoc[iEnd], iBegin-iEnd); |
168881
|
0 |
0 |
if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zOpen, -1); |
|
0 |
0 |
if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zOpen, -1); |
168882
|
0 |
0 |
if( rc==SQLITE_OK ) rc = fts3StringAppend(pOut, &zDoc[iBegin], iFin-iBegin); |
168883
|
0 |
0 |
if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zClose, -1); |
|
0 |
0 |
if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zClose, -1); |
168912
|
0 |
0 |
while( 0xFE & (*pEnd | c) ){ |
168914
|
0 |
0 |
if( !c ) nEntry++; |
168935
|
0 |
0 |
if( p->flag==FTS3_MATCHINFO_LHITS ){ |
168943
|
0 |
0 |
if( (pPhrase->iColumn>=pTab->nColumn || pPhrase->iColumn==iCol) ){ |
|
0 |
0 |
if( (pPhrase->iColumn>=pTab->nColumn || pPhrase->iColumn==iCol) ){ |
168944
|
0 |
0 |
if( p->flag==FTS3_MATCHINFO_LHITS ){ |
168946
|
0 |
0 |
}else if( nHit ){ |
168951
|
0 |
0 |
if( *pIter!=0x01 ) break; |
168953
|
0 |
0 |
pIter += fts3GetVarint32(pIter, &iCol); |
168965
|
0 |
0 |
if( pExpr->bEof==0 && pExpr->iDocid==p->pCursor->iPrevId ){ |
|
0 |
0 |
if( pExpr->bEof==0 && pExpr->iDocid==p->pCursor->iPrevId ){ |
168966
|
0 |
0 |
if( pExpr->pLeft ){ |
169028
|
0 |
0 |
for(i=0; inCol && rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; inCol && rc==SQLITE_OK; i++){ |
169031
|
0 |
0 |
if( pCsr ){ |
169046
|
0 |
0 |
if( (cArg==FTS3_MATCHINFO_NPHRASE) |
169047
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_NCOL) |
169048
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_NDOC && pTab->bFts4) |
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_NDOC && pTab->bFts4) |
169049
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_AVGLENGTH && pTab->bFts4) |
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_AVGLENGTH && pTab->bFts4) |
169050
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LENGTH && pTab->bHasDocsize) |
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LENGTH && pTab->bHasDocsize) |
169051
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LCS) |
169052
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_HITS) |
169053
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LHITS) |
169054
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LHITS_BM) |
169105
|
0 |
0 |
if( !*ppStmt ){ |
169107
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
169114
|
0 |
0 |
if( nDoc==0 ) return FTS_CORRUPT_VTAB; |
169117
|
0 |
0 |
if( paLen ) *paLen = a; |
169162
|
0 |
0 |
if( iRead==0 || iRead==1 ){ |
|
0 |
0 |
if( iRead==0 || iRead==1 ){ |
169194
|
0 |
0 |
if( !aIter ) return SQLITE_NOMEM; |
169198
|
0 |
0 |
for(i=0; inPhrase; i++){ |
169204
|
0 |
0 |
for(iCol=0; iColnCol; iCol++){ |
169208
|
0 |
0 |
for(i=0; inPhrase; i++){ |
169212
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
169213
|
0 |
0 |
if( pIt->pRead ){ |
169220
|
0 |
0 |
while( nLive>0 ){ |
169224
|
0 |
0 |
for(i=0; inPhrase; i++){ |
169226
|
0 |
0 |
if( pIter->pRead==0 ){ |
169230
|
0 |
0 |
if( pAdv==0 || pIter->iPosiPos ){ |
|
0 |
0 |
if( pAdv==0 || pIter->iPosiPos ){ |
169233
|
0 |
0 |
if( nThisLcs==0 || pIter->iPos==pIter[-1].iPos ){ |
|
0 |
0 |
if( nThisLcs==0 || pIter->iPos==pIter[-1].iPos ){ |
169238
|
0 |
0 |
if( nThisLcs>nLcs ) nLcs = nThisLcs; |
169241
|
0 |
0 |
if( fts3LcsIteratorAdvance(pAdv) ) nLive--; |
169279
|
0 |
0 |
for(i=0; rc==SQLITE_OK && zArg[i]; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && zArg[i]; i++){ |
169283
|
0 |
0 |
if( bGlobal ) pInfo->aMatchinfo[0] = pInfo->nPhrase; |
169287
|
0 |
0 |
if( bGlobal ) pInfo->aMatchinfo[0] = pInfo->nCol; |
169291
|
0 |
0 |
if( bGlobal ){ |
169299
|
0 |
0 |
if( bGlobal ){ |
169304
|
0 |
0 |
if( rc==SQLITE_OK ){ |
169306
|
0 |
0 |
for(iCol=0; iColnCol; iCol++){ |
169320
|
0 |
0 |
if( rc==SQLITE_OK ){ |
169323
|
0 |
0 |
for(iCol=0; iColnCol; iCol++){ |
169335
|
0 |
0 |
if( rc==SQLITE_OK ){ |
169353
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
169354
|
0 |
0 |
if( bGlobal ){ |
169355
|
0 |
0 |
if( pCsr->pDeferred ){ |
169357
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
169361
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
169400
|
0 |
0 |
if( pCsr->pMIBuffer && strcmp(pCsr->pMIBuffer->zMatchinfo, zArg) ){ |
|
0 |
0 |
if( pCsr->pMIBuffer && strcmp(pCsr->pMIBuffer->zMatchinfo, zArg) ){ |
169410
|
0 |
0 |
if( pCsr->pMIBuffer==0 ){ |
169419
|
0 |
0 |
for(i=0; zArg[i]; i++){ |
169421
|
0 |
0 |
if( fts3MatchinfoCheck(pTab, zArg[i], &zErr) ){ |
169431
|
0 |
0 |
if( !pCsr->pMIBuffer ) rc = SQLITE_NOMEM; |
169437
|
0 |
0 |
if( rc==SQLITE_OK ){ |
169439
|
0 |
0 |
if( xDestroyOut==0 ){ |
169444
|
0 |
0 |
if( rc==SQLITE_OK ){ |
169448
|
0 |
0 |
if( bGlobal ){ |
169453
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
169455
|
0 |
0 |
if( xDestroyOut ) xDestroyOut(aOut); |
169491
|
0 |
0 |
if( !pCsr->pExpr ){ |
169502
|
0 |
0 |
if( nToken>=0 ){ |
169508
|
0 |
0 |
for(iSnip=0; iSnip
|
169519
|
0 |
0 |
for(iRead=0; iReadnColumn; iRead++){ |
169522
|
0 |
0 |
if( iCol>=0 && iRead!=iCol ) continue; |
|
0 |
0 |
if( iCol>=0 && iRead!=iCol ) continue; |
169526
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
169529
|
0 |
0 |
if( iS>iBestScore ){ |
169542
|
0 |
0 |
if( mSeen==mCovered || nSnippet==SizeofArray(aSnippet) ) break; |
|
0 |
0 |
if( mSeen==mCovered || nSnippet==SizeofArray(aSnippet) ) break; |
169547
|
0 |
0 |
for(i=0; i
|
|
0 |
0 |
for(i=0; i
|
169555
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
169595
|
0 |
0 |
if( pList ){ |
169600
|
0 |
0 |
for(iTerm=0; iTerm
|
169625
|
0 |
0 |
if( !pCsr->pExpr ){ |
169635
|
0 |
0 |
if( rc!=SQLITE_OK ) goto offsets_out; |
169639
|
0 |
0 |
if( 0==sCtx.aTerm ){ |
169649
|
0 |
0 |
for(iCol=0; iColnColumn; iCol++){ |
169675
|
0 |
0 |
if( zDoc==0 ){ |
169676
|
0 |
0 |
if( sqlite3_column_type(pCsr->pStmt, iCol+1)==SQLITE_NULL ){ |
169687
|
0 |
0 |
if( rc!=SQLITE_OK ) goto offsets_out; |
169690
|
0 |
0 |
while( rc==SQLITE_OK ){ |
169695
|
0 |
0 |
for(i=0; i
|
169697
|
0 |
0 |
if( pT->pList && (pT->iPos-pT->iOff)
|
|
0 |
0 |
if( pT->pList && (pT->iPos-pT->iOff)
|
169703
|
0 |
0 |
if( !pTerm ){ |
169708
|
0 |
0 |
if( 0==(0xFE&*pTerm->pList) ){ |
169713
|
0 |
0 |
while( rc==SQLITE_OK && iCurrent
|
|
0 |
0 |
while( rc==SQLITE_OK && iCurrent
|
169716
|
0 |
0 |
if( rc==SQLITE_OK ){ |
169722
|
0 |
0 |
}else if( rc==SQLITE_DONE && pTab->zContentTbl==0 ){ |
|
0 |
0 |
}else if( rc==SQLITE_DONE && pTab->zContentTbl==0 ){ |
169727
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
169732
|
0 |
0 |
if( rc!=SQLITE_OK ) goto offsets_out; |
169739
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
169759
|
0 |
0 |
if( zArg ){ |
169765
|
0 |
0 |
if( !pCsr->pExpr ){ |
169883
|
0 |
0 |
if( pTokenizer ){ |
169922
|
0 |
0 |
while( z
|
169923
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
169925
|
0 |
0 |
if( sqlite3FtsUnicodeIsalnum((int)iCode)!=bAlnum |
169926
|
0 |
0 |
&& sqlite3FtsUnicodeIsdiacritic((int)iCode)==0 |
169932
|
0 |
0 |
if( nEntry ){ |
169937
|
0 |
0 |
if( aNew==0 ) return SQLITE_NOMEM; |
169941
|
0 |
0 |
while( z
|
169942
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
169943
|
0 |
0 |
if( sqlite3FtsUnicodeIsalnum((int)iCode)!=bAlnum |
169944
|
0 |
0 |
&& sqlite3FtsUnicodeIsdiacritic((int)iCode)==0 |
169947
|
0 |
0 |
for(i=0; i
|
|
0 |
0 |
for(i=0; i
|
169948
|
0 |
0 |
for(j=nNew; j>i; j--) aNew[j] = aNew[j-1]; |
169964
|
0 |
0 |
if( p->nException>0 ){ |
169969
|
0 |
0 |
while( iHi>=iLo ){ |
169971
|
0 |
0 |
if( iCode==a[iTest] ){ |
169973
|
0 |
0 |
}else if( iCode>a[iTest] ){ |
170006
|
0 |
0 |
if( pNew==NULL ) return SQLITE_NOMEM; |
170010
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
170014
|
0 |
0 |
if( n==19 && memcmp("remove_diacritics=1", z, 19)==0 ){ |
|
0 |
0 |
if( n==19 && memcmp("remove_diacritics=1", z, 19)==0 ){ |
170017
|
0 |
0 |
else if( n==19 && memcmp("remove_diacritics=0", z, 19)==0 ){ |
|
0 |
0 |
else if( n==19 && memcmp("remove_diacritics=0", z, 19)==0 ){ |
170020
|
0 |
0 |
else if( n>=11 && memcmp("tokenchars=", z, 11)==0 ){ |
|
0 |
0 |
else if( n>=11 && memcmp("tokenchars=", z, 11)==0 ){ |
170023
|
0 |
0 |
else if( n>=11 && memcmp("separators=", z, 11)==0 ){ |
|
0 |
0 |
else if( n>=11 && memcmp("separators=", z, 11)==0 ){ |
170032
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
170055
|
0 |
0 |
if( pCsr==0 ){ |
170061
|
0 |
0 |
if( aInput==0 ){ |
170063
|
0 |
0 |
}else if( nInput<0 ){ |
170109
|
0 |
0 |
while( z
|
170110
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
170111
|
0 |
0 |
if( unicodeIsAlnum(p, (int)iCode) ) break; |
170114
|
0 |
0 |
if( zStart>=zTerm ) return SQLITE_DONE; |
170121
|
0 |
0 |
if( (zOut-pCsr->zToken)>=(pCsr->nAlloc-4) ){ |
170123
|
0 |
0 |
if( !zNew ) return SQLITE_NOMEM; |
170132
|
0 |
0 |
if( iOut ){ |
170133
|
0 |
0 |
WRITE_UTF8(zOut, iOut); |
|
0 |
0 |
WRITE_UTF8(zOut, iOut); |
|
0 |
0 |
WRITE_UTF8(zOut, iOut); |
170137
|
0 |
0 |
if( z>=zTerm ) break; |
170138
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(z, zTerm, iCode); |
170140
|
0 |
0 |
|| sqlite3FtsUnicodeIsdiacritic((int)iCode) |
170141
|
0 |
0 |
); |
170304
|
0 |
0 |
if( (unsigned int)c<128 ){ |
170306
|
0 |
0 |
}else if( (unsigned int)c<(1<<22) ){ |
170311
|
0 |
0 |
while( iHi>=iLo ){ |
170313
|
0 |
0 |
if( key >= aEntry[iTest] ){ |
170368
|
0 |
0 |
while( iHi>=iLo ){ |
170370
|
0 |
0 |
if( key >= aDia[iTest] ){ |
170378
|
0 |
0 |
return ((c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : (int)aChar[iRes]); |
170389
|
0 |
0 |
if( c<768 || c>817 ) return 0; |
|
0 |
0 |
if( c<768 || c>817 ) return 0; |
170390
|
0 |
0 |
return (c < 768+32) ? |
170501
|
0 |
0 |
if( c<128 ){ |
170502
|
0 |
0 |
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
|
0 |
0 |
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
170503
|
0 |
0 |
}else if( c<65536 ){ |
170510
|
0 |
0 |
while( iHi>=iLo ){ |
170513
|
0 |
0 |
if( cmp>=0 ){ |
170523
|
0 |
0 |
if( c<(p->iCode + p->nRange) && 0==(0x01 & p->flags & (p->iCode ^ c)) ){ |
|
0 |
0 |
if( c<(p->iCode + p->nRange) && 0==(0x01 & p->flags & (p->iCode ^ c)) ){ |
170528
|
0 |
0 |
if( bRemoveDiacritic ) ret = remove_diacritic(ret); |
170531
|
0 |
0 |
else if( c>=66560 && c<66600 ){ |
|
0 |
0 |
else if( c>=66560 && c<66600 ){ |
171078
|
0 |
15 |
if( p ){ |
171106
|
18 |
15 |
for(p=pRtree->aHash[nodeHash(iNode)]; p && p->iNode!=iNode; p=p->pNext); |
|
0 |
18 |
for(p=pRtree->aHash[nodeHash(iNode)]; p && p->iNode!=iNode; p=p->pNext); |
171126
|
15 |
0 |
if( pNode->iNode!=0 ){ |
171128
|
0 |
15 |
for( ; (*pp)!=pNode; pp = &(*pp)->pNext){ assert(*pp); } |
171143
|
0 |
0 |
if( pNode ){ |
171159
|
15 |
10 |
if( pRtree->pNodeBlob && pRtree->inWrTrans==0 && pRtree->nCursor==0 ){ |
|
15 |
0 |
if( pRtree->pNodeBlob && pRtree->inWrTrans==0 && pRtree->nCursor==0 ){ |
|
15 |
0 |
if( pRtree->pNodeBlob && pRtree->inWrTrans==0 && pRtree->nCursor==0 ){ |
171181
|
18 |
15 |
if( (pNode = nodeHashLookup(pRtree, iNode))!=0 ){ |
171183
|
0 |
18 |
if( pParent && !pNode->pParent ){ |
|
0 |
0 |
if( pParent && !pNode->pParent ){ |
171192
|
0 |
15 |
if( pRtree->pNodeBlob ){ |
171197
|
0 |
0 |
if( rc ){ |
171199
|
0 |
0 |
if( rc==SQLITE_NOMEM ) return SQLITE_NOMEM; |
171202
|
15 |
0 |
if( pRtree->pNodeBlob==0 ){ |
171204
|
0 |
15 |
if( zTab==0 ) return SQLITE_NOMEM; |
171209
|
0 |
15 |
if( rc ){ |
171214
|
0 |
0 |
if( rc==SQLITE_ERROR ) rc = SQLITE_CORRUPT_VTAB; |
171215
|
15 |
0 |
}else if( pRtree->iNodeSize==sqlite3_blob_bytes(pRtree->pNodeBlob) ){ |
171217
|
0 |
15 |
if( !pNode ){ |
171239
|
15 |
0 |
if( pNode && iNode==1 ){ |
|
15 |
0 |
if( pNode && iNode==1 ){ |
171241
|
0 |
15 |
if( pRtree->iDepth>RTREE_MAX_DEPTH ){ |
171250
|
15 |
0 |
if( pNode && rc==SQLITE_OK ){ |
|
15 |
0 |
if( pNode && rc==SQLITE_OK ){ |
171251
|
0 |
15 |
if( NCELL(pNode)>((pRtree->iNodeSize-4)/pRtree->nBytesPerCell) ){ |
171256
|
15 |
0 |
if( rc==SQLITE_OK ){ |
171257
|
15 |
0 |
if( pNode!=0 ){ |
171264
|
0 |
0 |
if( pNode ){ |
171286
|
28 |
7 |
for(ii=0; iinDim2; ii++){ |
171322
|
7 |
0 |
if( nCell
|
171336
|
7 |
8 |
if( pNode->isDirty ){ |
171338
|
7 |
0 |
if( pNode->iNode ){ |
171348
|
0 |
7 |
if( pNode->iNode==0 && rc==SQLITE_OK ){ |
|
0 |
0 |
if( pNode->iNode==0 && rc==SQLITE_OK ){ |
171362
|
33 |
48 |
if( pNode ){ |
171366
|
15 |
18 |
if( pNode->nRef==0 ){ |
171368
|
15 |
0 |
if( pNode->iNode==1 ){ |
171371
|
0 |
15 |
if( pNode->pParent ){ |
171374
|
15 |
0 |
if( rc==SQLITE_OK ){ |
171432
|
0 |
0 |
}while( iinDim2 ); |
171482
|
1 |
15 |
if( pRtree->nBusy==0 ){ |
171523
|
0 |
0 |
if( !zCreate ){ |
171530
|
0 |
0 |
if( rc==SQLITE_OK ){ |
171546
|
8 |
0 |
if( pCsr ){ |
171562
|
6 |
10 |
if( pCsr->aConstraint ){ |
171564
|
24 |
6 |
for(i=0; inConstraint; i++){ |
171566
|
0 |
24 |
if( pInfo ){ |
171567
|
0 |
0 |
if( pInfo->xDelUser ) pInfo->xDelUser(pInfo->pUser); |
171587
|
40 |
8 |
for(ii=0; iiaNode[ii]); |
171672
|
0 |
0 |
if( pConstraint->op==RTREE_QUERY && pSearch->iLevel==1 ){ |
|
0 |
0 |
if( pConstraint->op==RTREE_QUERY && pSearch->iLevel==1 ){ |
171677
|
0 |
0 |
if( eInt==0 ){ |
171706
|
0 |
0 |
if( pConstraint->op==RTREE_MATCH ){ |
171710
|
0 |
0 |
if( eWithin==0 ) *peWithin = NOT_WITHIN; |
171718
|
0 |
0 |
if( pInfo->eWithin<*peWithin ) *peWithin = pInfo->eWithin; |
171719
|
0 |
0 |
if( pInfo->rScore<*prScore || *prScore
|
|
0 |
0 |
if( pInfo->rScore<*prScore || *prScore
|
171747
|
0 |
0 |
switch( p->op ){ |
171751
|
0 |
0 |
RTREE_DECODE_COORD(eInt, pCellData, val); |
171753
|
0 |
0 |
if( p->u.rValue>=val ) return; |
171754
|
0 |
0 |
if( p->op!=RTREE_EQ ) break; /* RTREE_LE and RTREE_LT end here */ |
171759
|
0 |
0 |
RTREE_DECODE_COORD(eInt, pCellData, val); |
171761
|
0 |
0 |
if( p->u.rValue<=val ) return; |
171788
|
119 |
0 |
RTREE_DECODE_COORD(eInt, pCellData, xN); |
171790
|
40 |
15 |
case RTREE_LE: if( xN <= p->u.rValue ) return; break; |
171791
|
0 |
0 |
case RTREE_LT: if( xN < p->u.rValue ) return; break; |
171792
|
55 |
9 |
case RTREE_GE: if( xN >= p->u.rValue ) return; break; |
171793
|
0 |
0 |
case RTREE_GT: if( xN > p->u.rValue ) return; break; |
171794
|
0 |
0 |
default: if( xN == p->u.rValue ) return; break; |
171812
|
3 |
0 |
for(ii=0; ii
|
171813
|
2 |
1 |
if( nodeGetRowid(pRtree, pNode, ii)==iRowid ){ |
171827
|
0 |
0 |
if( pParent ){ |
171848
|
0 |
0 |
if( pA->rScorerScore ) return -1; |
171849
|
0 |
0 |
if( pA->rScore>pB->rScore ) return +1; |
171850
|
0 |
0 |
if( pA->iLeveliLevel ) return -1; |
171851
|
0 |
0 |
if( pA->iLevel>pB->iLevel ) return +1; |
171864
|
0 |
0 |
if( i
|
171865
|
0 |
0 |
if( j>=RTREE_CACHE_SZ ){ |
171880
|
57 |
47 |
return pCur->bPoint ? &pCur->sPoint : pCur->nPoint ? pCur->aPoint : 0; |
|
31 |
16 |
return pCur->bPoint ? &pCur->sPoint : pCur->nPoint ? pCur->aPoint : 0; |
171891
|
18 |
34 |
if( pCur->aNode[ii]==0 ){ |
171893
|
0 |
18 |
id = ii ? pCur->aPoint[0].id : pCur->sPoint.id; |
171909
|
5 |
0 |
if( pCur->nPoint>=pCur->nPointAlloc ){ |
171912
|
0 |
5 |
if( pNew==0 ) return 0; |
171921
|
0 |
5 |
while( i>0 ){ |
171925
|
0 |
0 |
if( rtreeSearchPointCompare(pNew, pParent)>=0 ) break; |
171945
|
18 |
8 |
if( pFirst==0 |
171946
|
18 |
0 |
|| pFirst->rScore>rScore |
171947
|
18 |
0 |
|| (pFirst->rScore==rScore && pFirst->iLevel>iLevel) |
|
18 |
0 |
|| (pFirst->rScore==rScore && pFirst->iLevel>iLevel) |
171949
|
5 |
21 |
if( pCur->bPoint ){ |
171952
|
0 |
5 |
if( pNew==0 ) return 0; |
171954
|
5 |
0 |
if( ii
|
172008
|
26 |
0 |
if( p->aNode[i] ){ |
172012
|
21 |
5 |
if( p->bPoint ){ |
172015
|
5 |
0 |
}else if( p->nPoint ){ |
172019
|
5 |
0 |
if( n
|
172024
|
0 |
5 |
while( (j = i*2+1)
|
172026
|
0 |
0 |
if( kaPoint[k], &p->aPoint[j])<0 ){ |
|
0 |
0 |
if( kaPoint[k], &p->aPoint[j])<0 ){ |
172027
|
0 |
0 |
if( rtreeSearchPointCompare(&p->aPoint[k], &p->aPoint[i])<0 ){ |
172034
|
0 |
0 |
if( rtreeSearchPointCompare(&p->aPoint[j], &p->aPoint[i])<0 ){ |
172065
|
42 |
8 |
while( (p = rtreeSearchPointFirst(pCur))!=0 && p->iLevel>0 ){ |
|
24 |
18 |
while( (p = rtreeSearchPointFirst(pCur))!=0 && p->iLevel>0 ){ |
172067
|
0 |
24 |
if( rc ) return rc; |
172070
|
42 |
6 |
while( p->iCell
|
172074
|
119 |
18 |
for(ii=0; ii
|
172076
|
0 |
119 |
if( pConstraint->op>=RTREE_MATCH ){ |
172079
|
0 |
0 |
if( rc ) return rc; |
172080
|
119 |
0 |
}else if( p->iLevel==1 ){ |
172085
|
24 |
95 |
if( eWithin==NOT_WITHIN ) break; |
172088
|
24 |
18 |
if( eWithin==NOT_WITHIN ) continue; |
172090
|
0 |
18 |
if( x.iLevel ){ |
172097
|
0 |
18 |
if( p->iCell>=nCell ){ |
172101
|
18 |
0 |
if( rScore
|
172103
|
0 |
18 |
if( p==0 ) return SQLITE_NOMEM; |
172110
|
6 |
18 |
if( p->iCell>=nCell ){ |
172128
|
0 |
20 |
if( pCsr->bAuxValid ){ |
172145
|
0 |
0 |
if( rc==SQLITE_OK && p ){ |
|
0 |
0 |
if( rc==SQLITE_OK && p ){ |
172162
|
0 |
28 |
if( rc ) return rc; |
172163
|
0 |
28 |
if( p==0 ) return SQLITE_OK; |
172164
|
20 |
8 |
if( i==0 ){ |
172166
|
8 |
0 |
}else if( i<=pRtree->nDim2 ){ |
172169
|
0 |
8 |
if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ |
172178
|
0 |
0 |
if( !pCsr->bAuxValid ){ |
172179
|
0 |
0 |
if( pCsr->pReadAux==0 ){ |
172182
|
0 |
0 |
if( rc ) return rc; |
172187
|
0 |
0 |
if( rc==SQLITE_ROW ){ |
172191
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
172217
|
2 |
0 |
if( sqlite3_step(pRtree->pReadRowid)==SQLITE_ROW ){ |
172219
|
2 |
0 |
if( piNode ) *piNode = iNode; |
172239
|
0 |
0 |
if( pSrc==0 ) return SQLITE_ERROR; |
172242
|
0 |
0 |
if( !pInfo ) return SQLITE_NOMEM; |
172251
|
0 |
0 |
if( pBlob->cb.xGeom ){ |
172288
|
2 |
6 |
if( idxNum==1 ){ |
172295
|
2 |
0 |
if( rc==SQLITE_OK && pLeaf!=0 ){ |
|
2 |
0 |
if( rc==SQLITE_OK && pLeaf!=0 ){ |
172312
|
6 |
0 |
if( rc==SQLITE_OK && argc>0 ){ |
|
6 |
0 |
if( rc==SQLITE_OK && argc>0 ){ |
172315
|
0 |
6 |
if( !pCsr->aConstraint ){ |
172322
|
24 |
6 |
for(ii=0; ii
|
172326
|
0 |
24 |
if( p->op>=RTREE_MATCH ){ |
172332
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
172348
|
6 |
0 |
if( rc==SQLITE_OK ){ |
172351
|
0 |
6 |
if( pNew==0 ) return SQLITE_NOMEM; |
172417
|
26 |
8 |
for(ii=0; iinConstraint; ii++){ |
172418
|
0 |
26 |
if( pIdxInfo->aConstraint[ii].op==SQLITE_INDEX_CONSTRAINT_MATCH ){ |
172424
|
26 |
6 |
for(ii=0; iinConstraint && iIdx<(int)(sizeof(zIdxStr)-1); ii++){ |
|
26 |
0 |
for(ii=0; iinConstraint && iIdx<(int)(sizeof(zIdxStr)-1); ii++){ |
172427
|
26 |
0 |
if( bMatch==0 && p->usable |
|
26 |
0 |
if( bMatch==0 && p->usable |
172428
|
2 |
24 |
&& p->iColumn==0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ |
|
2 |
0 |
&& p->iColumn==0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ |
172432
|
0 |
2 |
for(jj=0; jj
|
172452
|
24 |
0 |
if( p->usable |
172453
|
24 |
0 |
&& ((p->iColumn>0 && p->iColumn<=pRtree->nDim2) |
|
0 |
24 |
&& ((p->iColumn>0 && p->iColumn<=pRtree->nDim2) |
172454
|
0 |
0 |
|| p->op==SQLITE_INDEX_CONSTRAINT_MATCH) |
172477
|
6 |
0 |
if( iIdx>0 && 0==(pIdxInfo->idxStr = sqlite3_mprintf("%s", zIdxStr)) ){ |
|
0 |
6 |
if( iIdx>0 && 0==(pIdxInfo->idxStr = sqlite3_mprintf("%s", zIdxStr)) ){ |
172495
|
0 |
0 |
if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ |
172525
|
0 |
0 |
margin += (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii])); |
|
0 |
0 |
margin += (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii])); |
172527
|
0 |
0 |
}while( ii>=0 ); |
172536
|
0 |
0 |
if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ |
172538
|
0 |
0 |
p1->aCoord[ii].f = MIN(p1->aCoord[ii].f, p2->aCoord[ii].f); |
172539
|
0 |
0 |
p1->aCoord[ii+1].f = MAX(p1->aCoord[ii+1].f, p2->aCoord[ii+1].f); |
172541
|
0 |
0 |
}while( iinDim2 ); |
172547
|
0 |
0 |
}while( iinDim2 ); |
172558
|
0 |
0 |
for(ii=0; iinDim2; ii+=2){ |
172561
|
0 |
0 |
if( (!isInt && (a2[0].fa1[1].f)) |
|
0 |
0 |
if( (!isInt && (a2[0].fa1[1].f)) |
|
0 |
0 |
if( (!isInt && (a2[0].fa1[1].f)) |
172562
|
0 |
0 |
|| ( isInt && (a2[0].ia1[1].i)) |
|
0 |
0 |
|| ( isInt && (a2[0].ia1[1].i)) |
|
0 |
0 |
|| ( isInt && (a2[0].ia1[1].i)) |
172590
|
0 |
0 |
for(ii=0; ii
|
172593
|
0 |
0 |
for(jj=0; jjnDim2; jj+=2){ |
172595
|
0 |
0 |
x1 = MAX(DCOORD(p->aCoord[jj]), DCOORD(aCell[ii].aCoord[jj])); |
|
0 |
0 |
x1 = MAX(DCOORD(p->aCoord[jj]), DCOORD(aCell[ii].aCoord[jj])); |
|
0 |
0 |
x1 = MAX(DCOORD(p->aCoord[jj]), DCOORD(aCell[ii].aCoord[jj])); |
|
0 |
0 |
x1 = MAX(DCOORD(p->aCoord[jj]), DCOORD(aCell[ii].aCoord[jj])); |
|
0 |
0 |
x1 = MAX(DCOORD(p->aCoord[jj]), DCOORD(aCell[ii].aCoord[jj])); |
172596
|
0 |
0 |
x2 = MIN(DCOORD(p->aCoord[jj+1]), DCOORD(aCell[ii].aCoord[jj+1])); |
|
0 |
0 |
x2 = MIN(DCOORD(p->aCoord[jj+1]), DCOORD(aCell[ii].aCoord[jj+1])); |
|
0 |
0 |
x2 = MIN(DCOORD(p->aCoord[jj+1]), DCOORD(aCell[ii].aCoord[jj+1])); |
|
0 |
0 |
x2 = MIN(DCOORD(p->aCoord[jj+1]), DCOORD(aCell[ii].aCoord[jj+1])); |
|
0 |
0 |
x2 = MIN(DCOORD(p->aCoord[jj+1]), DCOORD(aCell[ii].aCoord[jj+1])); |
172597
|
0 |
0 |
if( x2
|
172625
|
7 |
0 |
for(ii=0; rc==SQLITE_OK && ii<(pRtree->iDepth-iHeight); ii++){ |
|
0 |
7 |
for(ii=0; rc==SQLITE_OK && ii<(pRtree->iDepth-iHeight); ii++){ |
172642
|
0 |
0 |
for(iCell=0; iCell
|
172649
|
0 |
0 |
if( iCell==0||growth
|
|
0 |
0 |
if( iCell==0||growth
|
|
0 |
0 |
if( iCell==0||growth
|
|
0 |
0 |
if( iCell==0||growth
|
172652
|
0 |
0 |
if( bBest ){ |
172680
|
0 |
7 |
while( p->pParent ){ |
172685
|
0 |
0 |
if( nodeParentIndex(pRtree, p, &iCell) ){ |
172690
|
0 |
0 |
if( !cellContains(pRtree, &cell, pCell) ){ |
172746
|
0 |
0 |
if( nIdx>1 ){ |
172761
|
0 |
0 |
while( iLeft
|
|
0 |
0 |
while( iLeft
|
172762
|
0 |
0 |
if( iLeft==nLeft ){ |
172765
|
0 |
0 |
}else if( iRight==nRight ){ |
172771
|
0 |
0 |
if( fLeft
|
172814
|
0 |
0 |
if( nIdx>1 ){ |
172829
|
0 |
0 |
while( iLeft
|
|
0 |
0 |
while( iLeft
|
172830
|
0 |
0 |
RtreeDValue xleft1 = DCOORD(aCell[aLeft[iLeft]].aCoord[iDim*2]); |
172831
|
0 |
0 |
RtreeDValue xleft2 = DCOORD(aCell[aLeft[iLeft]].aCoord[iDim*2+1]); |
172832
|
0 |
0 |
RtreeDValue xright1 = DCOORD(aCell[aRight[iRight]].aCoord[iDim*2]); |
172833
|
0 |
0 |
RtreeDValue xright2 = DCOORD(aCell[aRight[iRight]].aCoord[iDim*2+1]); |
172834
|
0 |
0 |
if( (iLeft!=nLeft) && ((iRight==nRight) |
|
0 |
0 |
if( (iLeft!=nLeft) && ((iRight==nRight) |
172835
|
0 |
0 |
|| (xleft1
|
172836
|
0 |
0 |
|| (xleft1==xright1 && xleft2
|
|
0 |
0 |
|| (xleft1==xright1 && xleft2
|
172885
|
0 |
0 |
if( !aaSorted ){ |
172891
|
0 |
0 |
for(ii=0; iinDim; ii++){ |
172894
|
0 |
0 |
for(jj=0; jj
|
172900
|
0 |
0 |
for(ii=0; iinDim; ii++){ |
172907
|
0 |
0 |
for( |
172920
|
0 |
0 |
for(kk=1; kk<(nCell-1); kk++){ |
172921
|
0 |
0 |
if( kk
|
172931
|
0 |
0 |
if( (nLeft==RTREE_MINCELLS(pRtree)) |
172932
|
0 |
0 |
|| (overlap
|
172933
|
0 |
0 |
|| (overlap==fBestOverlap && area
|
|
0 |
0 |
|| (overlap==fBestOverlap && area
|
172941
|
0 |
0 |
if( ii==0 || margin
|
|
0 |
0 |
if( ii==0 || margin
|
172950
|
0 |
0 |
for(ii=0; ii
|
172951
|
0 |
0 |
RtreeNode *pTarget = (ii
|
172952
|
0 |
0 |
RtreeCell *pBbox = (ii
|
172970
|
0 |
0 |
xSetMapping = ((iHeight==0)?rowidWrite:parentWrite); |
172971
|
0 |
0 |
if( iHeight>0 ){ |
172973
|
0 |
0 |
if( pChild ){ |
173006
|
0 |
0 |
if( !aCell ){ |
173012
|
0 |
0 |
for(i=0; i
|
173019
|
0 |
0 |
if( pNode->iNode==1 ){ |
173031
|
0 |
0 |
if( !pLeft || !pRight ){ |
|
0 |
0 |
if( !pLeft || !pRight ){ |
173041
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
173050
|
0 |
0 |
if( SQLITE_OK!=(rc = nodeWrite(pRtree, pRight)) |
173051
|
0 |
0 |
|| (0==pLeft->iNode && SQLITE_OK!=(rc = nodeWrite(pRtree, pLeft))) |
|
0 |
0 |
|| (0==pLeft->iNode && SQLITE_OK!=(rc = nodeWrite(pRtree, pLeft))) |
173059
|
0 |
0 |
if( pNode->iNode==1 ){ |
173061
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
173068
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173072
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
173076
|
0 |
0 |
if( (rc = rtreeInsertCell(pRtree, pRight->pParent, &rightbbox, iHeight+1)) ){ |
173080
|
0 |
0 |
for(i=0; i
|
173083
|
0 |
0 |
if( iRowid==pCell->iRowid ){ |
173086
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
173090
|
0 |
0 |
if( pNode->iNode==1 ){ |
173091
|
0 |
0 |
for(i=0; i
|
173094
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
173098
|
0 |
0 |
}else if( newCellIsRight==0 ){ |
173102
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173106
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173132
|
0 |
0 |
while( rc==SQLITE_OK && pChild->iNode!=1 && pChild->pParent==0 ){ |
|
0 |
0 |
while( rc==SQLITE_OK && pChild->iNode!=1 && pChild->pParent==0 ){ |
|
0 |
0 |
while( rc==SQLITE_OK && pChild->iNode!=1 && pChild->pParent==0 ){ |
173136
|
0 |
0 |
if( rc==SQLITE_ROW ){ |
173146
|
0 |
0 |
for(pTest=pLeaf; pTest && pTest->iNode!=iNode; pTest=pTest->pParent); |
|
0 |
0 |
for(pTest=pLeaf; pTest && pTest->iNode!=iNode; pTest=pTest->pParent); |
173147
|
0 |
0 |
if( !pTest ){ |
173152
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
173153
|
0 |
0 |
if( rc==SQLITE_OK && !pChild->pParent ) rc = SQLITE_CORRUPT_VTAB; |
|
0 |
0 |
if( rc==SQLITE_OK && !pChild->pParent ) rc = SQLITE_CORRUPT_VTAB; |
173171
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173177
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173180
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
173187
|
0 |
0 |
if( SQLITE_OK!=(rc = sqlite3_reset(pRtree->pDeleteNode)) ){ |
173194
|
0 |
0 |
if( SQLITE_OK!=(rc = sqlite3_reset(pRtree->pDeleteParent)) ){ |
173213
|
0 |
0 |
if( pParent ){ |
173218
|
0 |
0 |
for(ii=1; ii
|
173225
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173241
|
0 |
0 |
if( SQLITE_OK!=(rc = fixLeafParent(pRtree, pNode)) ){ |
173257
|
0 |
0 |
if( pParent ){ |
173258
|
0 |
0 |
if( NCELL(pNode)
|
173299
|
0 |
0 |
if( !aCell ){ |
173306
|
0 |
0 |
for(ii=0; ii
|
173307
|
0 |
0 |
if( ii==(nCell-1) ){ |
173313
|
0 |
0 |
for(iDim=0; iDimnDim; iDim++){ |
173314
|
0 |
0 |
aCenterCoord[iDim] += DCOORD(aCell[ii].aCoord[iDim*2]); |
173315
|
0 |
0 |
aCenterCoord[iDim] += DCOORD(aCell[ii].aCoord[iDim*2+1]); |
173318
|
0 |
0 |
for(iDim=0; iDimnDim; iDim++){ |
173322
|
0 |
0 |
for(ii=0; ii
|
173324
|
0 |
0 |
for(iDim=0; iDimnDim; iDim++){ |
173325
|
0 |
0 |
RtreeDValue coord = (DCOORD(aCell[ii].aCoord[iDim*2+1]) - |
173326
|
0 |
0 |
DCOORD(aCell[ii].aCoord[iDim*2])); |
173334
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii<(nCell-(RTREE_MINCELLS(pRtree)+1)); ii++){ |
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii<(nCell-(RTREE_MINCELLS(pRtree)+1)); ii++){ |
173337
|
0 |
0 |
if( p->iRowid==pCell->iRowid ){ |
173338
|
0 |
0 |
if( iHeight==0 ){ |
173345
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173348
|
0 |
0 |
for(; rc==SQLITE_OK && ii
|
|
0 |
0 |
for(; rc==SQLITE_OK && ii
|
173355
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173359
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173380
|
0 |
7 |
if( iHeight>0 ){ |
173382
|
0 |
0 |
if( pChild ){ |
173388
|
0 |
7 |
if( nodeInsertCell(pRtree, pNode, pCell) ){ |
173389
|
0 |
0 |
if( iHeight<=pRtree->iReinsertHeight || pNode->iNode==1){ |
|
0 |
0 |
if( iHeight<=pRtree->iReinsertHeight || pNode->iNode==1){ |
173397
|
7 |
0 |
if( rc==SQLITE_OK ){ |
173398
|
7 |
0 |
if( iHeight==0 ){ |
173413
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii
|
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii
|
173422
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173426
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173463
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173468
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173471
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173475
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173481
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173495
|
0 |
0 |
if( rc==SQLITE_OK && pRtree->iDepth>0 && NCELL(pRoot)==1 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pRtree->iDepth>0 && NCELL(pRoot)==1 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pRtree->iDepth>0 && NCELL(pRoot)==1 ){ |
173500
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173504
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
173505
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173513
|
0 |
0 |
for(pLeaf=pRtree->pDeleted; pLeaf; pLeaf=pRtree->pDeleted){ |
173514
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173523
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173546
|
0 |
0 |
if( f>d ){ |
173547
|
0 |
0 |
f = (float)(d*(d<0 ? RNDAWAY : RNDTOWARDS)); |
173554
|
0 |
0 |
if( f
|
173555
|
0 |
0 |
f = (float)(d*(d<0 ? RNDTOWARDS : RNDAWAY)); |
173581
|
0 |
0 |
if( zSql ){ |
173588
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173589
|
0 |
0 |
if( iCol==0 ){ |
173604
|
0 |
0 |
return (rc==SQLITE_OK ? SQLITE_CONSTRAINT : rc); |
173623
|
0 |
7 |
if( pRtree->nNodeRef ){ |
173645
|
7 |
0 |
if( nData>1 ){ |
173649
|
0 |
7 |
if( nn > pRtree->nDim2 ) nn = pRtree->nDim2; |
173660
|
0 |
7 |
if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ |
173661
|
0 |
0 |
for(ii=0; ii
|
173664
|
0 |
0 |
if( cell.aCoord[ii].f>cell.aCoord[ii+1].f ){ |
173672
|
14 |
7 |
for(ii=0; ii
|
173675
|
0 |
14 |
if( cell.aCoord[ii].i>cell.aCoord[ii+1].i ){ |
173684
|
7 |
0 |
if( sqlite3_value_type(aData[2])!=SQLITE_NULL ){ |
173686
|
0 |
7 |
if( sqlite3_value_type(aData[0])==SQLITE_NULL |
173687
|
0 |
0 |
|| sqlite3_value_int64(aData[0])!=cell.iRowid |
173693
|
0 |
7 |
if( SQLITE_ROW==steprc ){ |
173694
|
0 |
0 |
if( sqlite3_vtab_on_conflict(pRtree->db)==SQLITE_REPLACE ){ |
173710
|
0 |
7 |
if( sqlite3_value_type(aData[0])!=SQLITE_NULL ){ |
173718
|
7 |
0 |
if( rc==SQLITE_OK && nData>1 ){ |
|
7 |
0 |
if( rc==SQLITE_OK && nData>1 ){ |
173723
|
0 |
7 |
if( bHaveRowid==0 ){ |
173728
|
7 |
0 |
if( rc==SQLITE_OK ){ |
173731
|
7 |
0 |
if( rc==SQLITE_OK ){ |
173736
|
7 |
0 |
if( rc==SQLITE_OK ){ |
173740
|
0 |
7 |
if( pRtree->nAux ){ |
173744
|
0 |
0 |
for(jj=0; jjnAux; jj++){ |
173792
|
0 |
0 |
if( zSql ){ |
173839
|
1 |
0 |
if( rc!=SQLITE_OK ){ |
173841
|
0 |
1 |
return rc==SQLITE_ERROR ? SQLITE_OK : rc; |
173844
|
0 |
0 |
if( zSql==0 ){ |
173848
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173849
|
0 |
0 |
if( sqlite3_step(p)==SQLITE_ROW ) nRow = sqlite3_column_int64(p, 0); |
173851
|
0 |
0 |
}else if( rc!=SQLITE_NOMEM ){ |
173855
|
0 |
0 |
if( rc==SQLITE_OK ){ |
173856
|
0 |
0 |
if( nRow==0 ){ |
173924
|
1 |
0 |
if( isCreate ){ |
173931
|
0 |
1 |
for(ii=0; iinAux; ii++){ |
173944
|
0 |
1 |
if( !zCreate ){ |
173949
|
0 |
1 |
if( rc!=SQLITE_OK ){ |
173964
|
8 |
1 |
for(i=0; i
|
|
8 |
0 |
for(i=0; i
|
173967
|
1 |
7 |
if( i!=3 || pRtree->nAux==0 ){ |
|
1 |
0 |
if( i!=3 || pRtree->nAux==0 ){ |
173976
|
8 |
0 |
if( zSql ){ |
173984
|
0 |
1 |
if( pRtree->nAux ){ |
173988
|
0 |
0 |
if( pRtree->zReadAuxSql==0 ){ |
173995
|
0 |
0 |
for(ii=0; iinAux; ii++){ |
173996
|
0 |
0 |
if( ii ) sqlite3_str_append(p, ",", 1); |
174001
|
0 |
0 |
if( zSql==0 ){ |
174023
|
1 |
0 |
if( zSql ){ |
174026
|
1 |
0 |
if( rc==SQLITE_OK ){ |
174027
|
1 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
174059
|
1 |
0 |
if( isCreate ){ |
174063
|
1 |
0 |
if( rc==SQLITE_OK ){ |
174065
|
1 |
0 |
if( (4+pRtree->nBytesPerCell*RTREE_MAXCELLS)iNodeSize ){ |
174077
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
174079
|
0 |
0 |
}else if( pRtree->iNodeSize<(512-64) ){ |
174126
|
0 |
1 |
if( argc>RTREE_MAX_AUX_COLUMN+3 ){ |
174137
|
0 |
1 |
if( !pRtree ){ |
174156
|
4 |
1 |
for(ii=4; ii
|
174157
|
0 |
4 |
if( argv[ii][0]=='+' ){ |
174160
|
0 |
4 |
}else if( pRtree->nAux>0 ){ |
174169
|
0 |
1 |
if( !zSql ){ |
174171
|
0 |
1 |
}else if( ii
|
174174
|
0 |
1 |
}else if( SQLITE_OK!=(rc = sqlite3_declare_vtab(db, zSql)) ){ |
174178
|
0 |
1 |
if( rc ) goto rtreeInit_fail; |
174180
|
0 |
1 |
if( pRtree->nDim<1 ){ |
174182
|
0 |
1 |
}else if( pRtree->nDim2>RTREE_MAX_DIMENSIONS*2 ){ |
174184
|
0 |
1 |
}else if( pRtree->nDim2 % 2 ){ |
174189
|
0 |
1 |
if( iErr ){ |
174197
|
0 |
1 |
if( rc ) goto rtreeInit_fail; |
174199
|
0 |
1 |
if( rc ){ |
174208
|
0 |
0 |
if( rc==SQLITE_OK ) rc = SQLITE_ERROR; |
174246
|
0 |
0 |
for(ii=0; ii
|
174255
|
0 |
0 |
for(jj=0; jj
|
174266
|
0 |
0 |
if( zText ){ |
174289
|
0 |
0 |
if( sqlite3_value_type(apArg[0])!=SQLITE_BLOB |
174290
|
0 |
0 |
|| sqlite3_value_bytes(apArg[0])<2 |
174327
|
0 |
0 |
if( pCheck->rc==SQLITE_OK ) pCheck->rc = rc; |
174349
|
0 |
0 |
if( pCheck->rc==SQLITE_OK ){ |
174350
|
0 |
0 |
if( z==0 ){ |
174370
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pCheck->nErr
|
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pCheck->nErr
|
174372
|
0 |
0 |
if( z==0 ){ |
174375
|
0 |
0 |
pCheck->zReport = sqlite3_mprintf("%z%s%z", |
174378
|
0 |
0 |
if( pCheck->zReport==0 ){ |
174405
|
0 |
0 |
if( pCheck->pGetNode==0 ){ |
174412
|
0 |
0 |
if( pCheck->rc==SQLITE_OK ){ |
174414
|
0 |
0 |
if( sqlite3_step(pCheck->pGetNode)==SQLITE_ROW ){ |
174418
|
0 |
0 |
if( pRet==0 ){ |
174426
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pRet==0 ){ |
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pRet==0 ){ |
174460
|
0 |
0 |
if( pCheck->aCheckMapping[bLeaf]==0 ){ |
174465
|
0 |
0 |
if( pCheck->rc!=SQLITE_OK ) return; |
174470
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
174471
|
0 |
0 |
rtreeCheckAppendMsg(pCheck, "Mapping (%lld -> %lld) missing from %s table", |
174474
|
0 |
0 |
}else if( rc==SQLITE_ROW ){ |
174476
|
0 |
0 |
if( ii!=iVal ){ |
174477
|
0 |
0 |
rtreeCheckAppendMsg(pCheck, |
174509
|
0 |
0 |
for(i=0; inDim; i++){ |
174514
|
0 |
0 |
if( pCheck->bInt ? c1.i>c2.i : c1.f>c2.f ){ |
|
0 |
0 |
if( pCheck->bInt ? c1.i>c2.i : c1.f>c2.f ){ |
174520
|
0 |
0 |
if( pParent ){ |
174524
|
0 |
0 |
if( (pCheck->bInt ? c1.i
|
|
0 |
0 |
if( (pCheck->bInt ? c1.i
|
|
0 |
0 |
if( (pCheck->bInt ? c1.i
|
174525
|
0 |
0 |
|| (pCheck->bInt ? c2.i>p2.i : c2.f>p2.f) |
|
0 |
0 |
|| (pCheck->bInt ? c2.i>p2.i : c2.f>p2.f) |
|
0 |
0 |
|| (pCheck->bInt ? c2.i>p2.i : c2.f>p2.f) |
174557
|
0 |
0 |
if( aNode ){ |
174558
|
0 |
0 |
if( nNode<4 ){ |
174565
|
0 |
0 |
if( aParent==0 ){ |
174567
|
0 |
0 |
if( iDepth>RTREE_MAX_DEPTH ){ |
174574
|
0 |
0 |
if( (4 + nCell*(8 + pCheck->nDim*2*4))>nNode ){ |
174580
|
0 |
0 |
for(i=0; i
|
174585
|
0 |
0 |
if( iDepth>0 ){ |
174608
|
0 |
0 |
if( pCheck->rc==SQLITE_OK ){ |
174613
|
0 |
0 |
if( pCount ){ |
174614
|
0 |
0 |
if( sqlite3_step(pCount)==SQLITE_ROW ){ |
174616
|
0 |
0 |
if( nActual!=nExpect ){ |
174651
|
0 |
0 |
if( sqlite3_get_autocommit(db) ){ |
174657
|
0 |
0 |
if( check.rc==SQLITE_OK ){ |
174659
|
0 |
0 |
if( pStmt ){ |
174668
|
0 |
0 |
if( pStmt ){ |
174671
|
0 |
0 |
if( check.nDim<1 ){ |
174673
|
0 |
0 |
}else if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
174677
|
0 |
0 |
if( rc!=SQLITE_CORRUPT ) check.rc = rc; |
174681
|
0 |
0 |
if( check.nDim>=1 ){ |
174682
|
0 |
0 |
if( check.rc==SQLITE_OK ){ |
174695
|
0 |
0 |
if( bEnd ){ |
174697
|
0 |
0 |
if( check.rc==SQLITE_OK ) check.rc = rc; |
174741
|
0 |
0 |
if( nArg!=1 && nArg!=2 ){ |
|
0 |
0 |
if( nArg!=1 && nArg!=2 ){ |
174750
|
0 |
0 |
if( nArg==1 ){ |
174757
|
0 |
0 |
if( rc==SQLITE_OK ){ |
174758
|
0 |
0 |
sqlite3_result_text(ctx, zReport ? zReport : "ok", -1, SQLITE_TRANSIENT); |
174777
|
262 |
0 |
if( rc==SQLITE_OK ){ |
174780
|
262 |
0 |
if( rc==SQLITE_OK ){ |
174783
|
262 |
0 |
if( rc==SQLITE_OK ){ |
174791
|
262 |
0 |
if( rc==SQLITE_OK ){ |
174808
|
0 |
0 |
if( pInfo->xDestructor ) pInfo->xDestructor(pInfo->pContext); |
174818
|
0 |
0 |
for(i=0; inParam; i++){ |
174847
|
0 |
0 |
if( !pBlob ){ |
174855
|
0 |
0 |
for(i=0; i
|
174857
|
0 |
0 |
if( pBlob->apSqlParam[i]==0 ) memErr = 1; |
174864
|
0 |
0 |
if( memErr ){ |
174886
|
0 |
0 |
if( !pGeomCtx ) return SQLITE_NOMEM; |
174911
|
0 |
0 |
if( !pGeomCtx ) return SQLITE_NOMEM; |
187969
|
0 |
0 |
if( !p->bStatic ) sqlite3_free(p->zBuf); |
187986
|
0 |
0 |
u64 nTotal = NnAlloc ? p->nAlloc*2 : p->nAlloc+N+10; |
187988
|
0 |
0 |
if( p->bStatic ){ |
187989
|
0 |
0 |
if( p->bErr ) return 1; |
187991
|
0 |
0 |
if( zNew==0 ){ |
188000
|
0 |
0 |
if( zNew==0 ){ |
188013
|
0 |
0 |
if( (N+p->nUsed >= p->nAlloc) && jsonGrow(p,N)!=0 ) return; |
|
0 |
0 |
if( (N+p->nUsed >= p->nAlloc) && jsonGrow(p,N)!=0 ) return; |
188022
|
0 |
0 |
if( (p->nUsed + N >= p->nAlloc) && jsonGrow(p, N) ) return; |
|
0 |
0 |
if( (p->nUsed + N >= p->nAlloc) && jsonGrow(p, N) ) return; |
188032
|
0 |
0 |
if( p->nUsed>=p->nAlloc && jsonGrow(p,1)!=0 ) return; |
|
0 |
0 |
if( p->nUsed>=p->nAlloc && jsonGrow(p,1)!=0 ) return; |
188041
|
0 |
0 |
if( p->nUsed==0 ) return; |
188043
|
0 |
0 |
if( c!='[' && c!='{' ) jsonAppendChar(p, ','); |
|
0 |
0 |
if( c!='[' && c!='{' ) jsonAppendChar(p, ','); |
188053
|
0 |
0 |
if( (N+p->nUsed+2 >= p->nAlloc) && jsonGrow(p,N+2)!=0 ) return; |
|
0 |
0 |
if( (N+p->nUsed+2 >= p->nAlloc) && jsonGrow(p,N+2)!=0 ) return; |
188055
|
0 |
0 |
for(i=0; i
|
188057
|
0 |
0 |
if( c=='"' || c=='\\' ){ |
|
0 |
0 |
if( c=='"' || c=='\\' ){ |
188059
|
0 |
0 |
if( (p->nUsed+N+3-i > p->nAlloc) && jsonGrow(p,N+3-i)!=0 ) return; |
|
0 |
0 |
if( (p->nUsed+N+3-i > p->nAlloc) && jsonGrow(p,N+3-i)!=0 ) return; |
188061
|
0 |
0 |
}else if( c<=0x1f ){ |
188072
|
0 |
0 |
if( aSpecial[c] ){ |
188076
|
0 |
0 |
if( (p->nUsed+N+7+i > p->nAlloc) && jsonGrow(p,N+7-i)!=0 ) return; |
|
0 |
0 |
if( (p->nUsed+N+7+i > p->nAlloc) && jsonGrow(p,N+7-i)!=0 ) return; |
188113
|
0 |
0 |
if( sqlite3_value_subtype(pValue)==JSON_SUBTYPE ){ |
188121
|
0 |
0 |
if( p->bErr==0 ){ |
188135
|
0 |
0 |
if( p->bErr==0 ){ |
188136
|
0 |
0 |
sqlite3_result_text64(p->pCtx, p->zBuf, p->nUsed, |
188158
|
0 |
0 |
return pNode->eType>=JSON_ARRAY ? pNode->n+1 : 1; |
188192
|
0 |
0 |
if( pNode->jnFlags & (JNODE_REPLACE|JNODE_PATCH) ){ |
188193
|
0 |
0 |
if( pNode->jnFlags & JNODE_REPLACE ){ |
188214
|
0 |
0 |
if( pNode->jnFlags & JNODE_RAW ){ |
188229
|
0 |
0 |
while( j<=pNode->n ){ |
188230
|
0 |
0 |
if( (pNode[j].jnFlags & JNODE_REMOVE)==0 ){ |
188236
|
0 |
0 |
if( (pNode->jnFlags & JNODE_APPEND)==0 ) break; |
188247
|
0 |
0 |
while( j<=pNode->n ){ |
188248
|
0 |
0 |
if( (pNode[j+1].jnFlags & JNODE_REMOVE)==0 ){ |
188256
|
0 |
0 |
if( (pNode->jnFlags & JNODE_APPEND)==0 ) break; |
188306
|
0 |
0 |
if( z[0]=='-' ){ z++; } |
188307
|
0 |
0 |
while( z[0]>='0' && z[0]<='9' ){ |
|
0 |
0 |
while( z[0]>='0' && z[0]<='9' ){ |
188309
|
0 |
0 |
if( i>=LARGEST_INT64/10 ){ |
188310
|
0 |
0 |
if( i>LARGEST_INT64/10 ) goto int_as_real; |
188311
|
0 |
0 |
if( z[0]>='0' && z[0]<='9' ) goto int_as_real; |
|
0 |
0 |
if( z[0]>='0' && z[0]<='9' ) goto int_as_real; |
188312
|
0 |
0 |
if( v==9 ) goto int_as_real; |
188313
|
0 |
0 |
if( v==8 ){ |
188314
|
0 |
0 |
if( pNode->u.zJContent[0]=='-' ){ |
188324
|
0 |
0 |
if( pNode->u.zJContent[0]=='-' ){ i = -i; } |
188351
|
0 |
0 |
if( (pNode->jnFlags & JNODE_ESCAPE)==0 ){ |
188363
|
0 |
0 |
if( zOut==0 ){ |
188367
|
0 |
0 |
for(i=1, j=0; i
|
188369
|
0 |
0 |
if( c!='\\' ){ |
188373
|
0 |
0 |
if( c=='u' ){ |
188375
|
0 |
0 |
for(k=0; k<4; i++, k++){ |
188379
|
0 |
0 |
if( c<='9' ) v = v*16 + c - '0'; |
188380
|
0 |
0 |
else if( c<='F' ) v = v*16 + c - 'A' + 10; |
188383
|
0 |
0 |
if( v==0 ) break; |
188384
|
0 |
0 |
if( v<=0x7f ){ |
188386
|
0 |
0 |
}else if( v<=0x7ff ){ |
188395
|
0 |
0 |
if( c=='b' ){ |
188397
|
0 |
0 |
}else if( c=='f' ){ |
188399
|
0 |
0 |
}else if( c=='n' ){ |
188401
|
0 |
0 |
}else if( c=='r' ){ |
188403
|
0 |
0 |
}else if( c=='t' ){ |
188448
|
0 |
0 |
if( pParse->oom ) return -1; |
188451
|
0 |
0 |
if( pNew==0 ){ |
188473
|
0 |
0 |
if( pParse->nNode>=pParse->nAlloc ){ |
188489
|
0 |
0 |
for(i=0; i<4; i++) if( !safe_isxdigit(z[i]) ) return 0; |
|
0 |
0 |
for(i=0; i<4; i++) if( !safe_isxdigit(z[i]) ) return 0; |
188508
|
0 |
0 |
while( safe_isspace(z[i]) ){ i++; } |
188509
|
0 |
0 |
if( (c = z[i])=='{' ){ |
188512
|
0 |
0 |
if( iThis<0 ) return -1; |
188514
|
0 |
0 |
while( safe_isspace(z[j]) ){ j++; } |
188515
|
0 |
0 |
if( ++pParse->iDepth > JSON_MAX_DEPTH ) return -1; |
188517
|
0 |
0 |
if( x<0 ){ |
188519
|
0 |
0 |
if( x==(-2) && pParse->nNode==(u32)iThis+1 ) return j+1; |
|
0 |
0 |
if( x==(-2) && pParse->nNode==(u32)iThis+1 ) return j+1; |
188522
|
0 |
0 |
if( pParse->oom ) return -1; |
188524
|
0 |
0 |
if( pNode->eType!=JSON_STRING ) return -1; |
188527
|
0 |
0 |
while( safe_isspace(z[j]) ){ j++; } |
188528
|
0 |
0 |
if( z[j]!=':' ) return -1; |
188532
|
0 |
0 |
if( x<0 ) return -1; |
188534
|
0 |
0 |
while( safe_isspace(z[j]) ){ j++; } |
188536
|
0 |
0 |
if( c==',' ) continue; |
188537
|
0 |
0 |
if( c!='}' ) return -1; |
188542
|
0 |
0 |
}else if( c=='[' ){ |
188545
|
0 |
0 |
if( iThis<0 ) return -1; |
188547
|
0 |
0 |
while( safe_isspace(z[j]) ){ j++; } |
188548
|
0 |
0 |
if( ++pParse->iDepth > JSON_MAX_DEPTH ) return -1; |
188551
|
0 |
0 |
if( x<0 ){ |
188552
|
0 |
0 |
if( x==(-3) && pParse->nNode==(u32)iThis+1 ) return j+1; |
|
0 |
0 |
if( x==(-3) && pParse->nNode==(u32)iThis+1 ) return j+1; |
188556
|
0 |
0 |
while( safe_isspace(z[j]) ){ j++; } |
188558
|
0 |
0 |
if( c==',' ) continue; |
188559
|
0 |
0 |
if( c!=']' ) return -1; |
188564
|
0 |
0 |
}else if( c=='"' ){ |
188570
|
0 |
0 |
if( (c & ~0x1f)==0 ){ |
188574
|
0 |
0 |
if( c=='\\' ){ |
188576
|
0 |
0 |
if( c=='"' || c=='\\' || c=='/' || c=='b' || c=='f' |
|
0 |
0 |
if( c=='"' || c=='\\' || c=='/' || c=='b' || c=='f' |
|
0 |
0 |
if( c=='"' || c=='\\' || c=='/' || c=='b' || c=='f' |
|
0 |
0 |
if( c=='"' || c=='\\' || c=='/' || c=='b' || c=='f' |
|
0 |
0 |
if( c=='"' || c=='\\' || c=='/' || c=='b' || c=='f' |
188577
|
0 |
0 |
|| c=='n' || c=='r' || c=='t' |
|
0 |
0 |
|| c=='n' || c=='r' || c=='t' |
|
0 |
0 |
|| c=='n' || c=='r' || c=='t' |
188578
|
0 |
0 |
|| (c=='u' && jsonIs4Hex(z+j+1)) ){ |
|
0 |
0 |
|| (c=='u' && jsonIs4Hex(z+j+1)) ){ |
188583
|
0 |
0 |
}else if( c=='"' ){ |
188589
|
0 |
0 |
if( !pParse->oom ) pParse->aNode[pParse->nNode-1].jnFlags = jnFlags; |
188591
|
0 |
0 |
}else if( c=='n' |
188592
|
0 |
0 |
&& strncmp(z+i,"null",4)==0 |
188593
|
0 |
0 |
&& !safe_isalnum(z[i+4]) ){ |
188596
|
0 |
0 |
}else if( c=='t' |
188597
|
0 |
0 |
&& strncmp(z+i,"true",4)==0 |
188598
|
0 |
0 |
&& !safe_isalnum(z[i+4]) ){ |
188601
|
0 |
0 |
}else if( c=='f' |
188602
|
0 |
0 |
&& strncmp(z+i,"false",5)==0 |
188603
|
0 |
0 |
&& !safe_isalnum(z[i+5]) ){ |
188606
|
0 |
0 |
}else if( c=='-' || (c>='0' && c<='9') ){ |
|
0 |
0 |
}else if( c=='-' || (c>='0' && c<='9') ){ |
|
0 |
0 |
}else if( c=='-' || (c>='0' && c<='9') ){ |
188611
|
0 |
0 |
if( c<='0' ){ |
188612
|
0 |
0 |
j = c=='-' ? i+1 : i; |
188613
|
0 |
0 |
if( z[j]=='0' && z[j+1]>='0' && z[j+1]<='9' ) return -1; |
|
0 |
0 |
if( z[j]=='0' && z[j+1]>='0' && z[j+1]<='9' ) return -1; |
|
0 |
0 |
if( z[j]=='0' && z[j+1]>='0' && z[j+1]<='9' ) return -1; |
188618
|
0 |
0 |
if( c>='0' && c<='9' ) continue; |
|
0 |
0 |
if( c>='0' && c<='9' ) continue; |
188619
|
0 |
0 |
if( c=='.' ){ |
188620
|
0 |
0 |
if( z[j-1]=='-' ) return -1; |
188621
|
0 |
0 |
if( seenDP ) return -1; |
188625
|
0 |
0 |
if( c=='e' || c=='E' ){ |
|
0 |
0 |
if( c=='e' || c=='E' ){ |
188626
|
0 |
0 |
if( z[j-1]<'0' ) return -1; |
188627
|
0 |
0 |
if( seenE ) return -1; |
188630
|
0 |
0 |
if( c=='+' || c=='-' ){ |
|
0 |
0 |
if( c=='+' || c=='-' ){ |
188634
|
0 |
0 |
if( c<'0' || c>'9' ) return -1; |
|
0 |
0 |
if( c<'0' || c>'9' ) return -1; |
188639
|
0 |
0 |
if( z[j-1]<'0' ) return -1; |
188640
|
0 |
0 |
jsonParseAddNode(pParse, seenDP ? JSON_REAL : JSON_INT, |
188643
|
0 |
0 |
}else if( c=='}' ){ |
188645
|
0 |
0 |
}else if( c==']' ){ |
188647
|
0 |
0 |
}else if( c==0 ){ |
188668
|
0 |
0 |
if( zJson==0 ) return 1; |
188671
|
0 |
0 |
if( pParse->oom ) i = -1; |
188672
|
0 |
0 |
if( i>0 ){ |
188674
|
0 |
0 |
while( safe_isspace(zJson[i]) ) i++; |
188675
|
0 |
0 |
if( zJson[i] ) i = -1; |
188677
|
0 |
0 |
if( i<=0 ){ |
188678
|
0 |
0 |
if( pCtx!=0 ){ |
188679
|
0 |
0 |
if( pParse->oom ){ |
188700
|
0 |
0 |
for(j=1; j<=pNode->n; j += jsonNodeSize(pNode+j)){ |
188706
|
0 |
0 |
for(j=1; j<=pNode->n; j += jsonNodeSize(pNode+j+1)+1){ |
188725
|
0 |
0 |
if( aUp==0 ){ |
188753
|
0 |
0 |
if( zJson==0 ) return 0; |
188755
|
0 |
0 |
if( p && p->nJson==nJson && memcmp(p->zJson,zJson,nJson)==0 ){ |
|
0 |
0 |
if( p && p->nJson==nJson && memcmp(p->zJson,zJson,nJson)==0 ){ |
|
0 |
0 |
if( p && p->nJson==nJson && memcmp(p->zJson,zJson,nJson)==0 ){ |
188760
|
0 |
0 |
if( p==0 ){ |
188767
|
0 |
0 |
if( jsonParse(p, pCtx, p->zJson) ){ |
188781
|
0 |
0 |
if( pNode->jnFlags & JNODE_RAW ){ |
188782
|
0 |
0 |
if( pNode->n!=nKey ) return 0; |
188785
|
0 |
0 |
if( pNode->n!=nKey+2 ) return 0; |
188812
|
0 |
0 |
if( zPath[0]==0 ) return pRoot; |
188813
|
0 |
0 |
if( zPath[0]=='.' ){ |
188814
|
0 |
0 |
if( pRoot->eType!=JSON_OBJECT ) return 0; |
188816
|
0 |
0 |
if( zPath[0]=='"' ){ |
188818
|
0 |
0 |
for(i=1; zPath[i] && zPath[i]!='"'; i++){} |
|
0 |
0 |
for(i=1; zPath[i] && zPath[i]!='"'; i++){} |
188820
|
0 |
0 |
if( zPath[i] ){ |
188828
|
0 |
0 |
for(i=0; zPath[i] && zPath[i]!='.' && zPath[i]!='['; i++){} |
|
0 |
0 |
for(i=0; zPath[i] && zPath[i]!='.' && zPath[i]!='['; i++){} |
|
0 |
0 |
for(i=0; zPath[i] && zPath[i]!='.' && zPath[i]!='['; i++){} |
188831
|
0 |
0 |
if( nKey==0 ){ |
188837
|
0 |
0 |
while( j<=pRoot->n ){ |
188838
|
0 |
0 |
if( jsonLabelCompare(pRoot+j, zKey, nKey) ){ |
188844
|
0 |
0 |
if( (pRoot->jnFlags & JNODE_APPEND)==0 ) break; |
188849
|
0 |
0 |
if( pApnd ){ |
188856
|
0 |
0 |
if( pParse->oom ) return 0; |
188857
|
0 |
0 |
if( pNode ){ |
188865
|
0 |
0 |
}else if( zPath[0]=='[' && safe_isdigit(zPath[1]) ){ |
|
0 |
0 |
}else if( zPath[0]=='[' && safe_isdigit(zPath[1]) ){ |
188866
|
0 |
0 |
if( pRoot->eType!=JSON_ARRAY ) return 0; |
188869
|
0 |
0 |
while( safe_isdigit(zPath[j]) ){ |
188873
|
0 |
0 |
if( zPath[j]!=']' ){ |
188880
|
0 |
0 |
while( j<=pRoot->n && (i>0 || (pRoot[j].jnFlags & JNODE_REMOVE)!=0) ){ |
|
0 |
0 |
while( j<=pRoot->n && (i>0 || (pRoot[j].jnFlags & JNODE_REMOVE)!=0) ){ |
|
0 |
0 |
while( j<=pRoot->n && (i>0 || (pRoot[j].jnFlags & JNODE_REMOVE)!=0) ){ |
188881
|
0 |
0 |
if( (pRoot[j].jnFlags & JNODE_REMOVE)==0 ) i--; |
188884
|
0 |
0 |
if( (pRoot->jnFlags & JNODE_APPEND)==0 ) break; |
188889
|
0 |
0 |
if( j<=pRoot->n ){ |
188892
|
0 |
0 |
if( i==0 && pApnd ){ |
|
0 |
0 |
if( i==0 && pApnd ){ |
188897
|
0 |
0 |
if( pParse->oom ) return 0; |
188898
|
0 |
0 |
if( pNode ){ |
188922
|
0 |
0 |
if( zPath[0]==0 ){ |
188924
|
0 |
0 |
return pParse->oom ? 0 : &pParse->aNode[pParse->nNode-1]; |
188926
|
0 |
0 |
if( zPath[0]=='.' ){ |
188928
|
0 |
0 |
}else if( strncmp(zPath,"[0]",3)==0 ){ |
188933
|
0 |
0 |
if( pParse->oom ) return 0; |
188965
|
0 |
0 |
if( zPath==0 ) return 0; |
188966
|
0 |
0 |
if( zPath[0]!='$' ){ |
188972
|
0 |
0 |
if( zErr==0 ) return pNode; |
188978
|
0 |
0 |
if( zMsg ){ |
189009
|
0 |
0 |
for(i=2; i<=n; i += jsonNodeSize(&pNode[i])+1){ |
189119
|
0 |
0 |
for(i=0; i
|
189147
|
0 |
0 |
if( p==0 ) return; |
189149
|
0 |
0 |
if( argc==2 ){ |
189155
|
0 |
0 |
if( pNode==0 ){ |
189158
|
0 |
0 |
if( pNode->eType==JSON_ARRAY ){ |
189160
|
0 |
0 |
for(i=1; i<=pNode->n; n++){ |
189186
|
0 |
0 |
if( argc<2 ) return; |
189188
|
0 |
0 |
if( p==0 ) return; |
189191
|
0 |
0 |
for(i=1; i
|
189194
|
0 |
0 |
if( p->nErr ) break; |
189195
|
0 |
0 |
if( argc>2 ){ |
189197
|
0 |
0 |
if( pNode ){ |
189202
|
0 |
0 |
}else if( pNode ){ |
189206
|
0 |
0 |
if( argc>2 && i==argc ){ |
|
0 |
0 |
if( argc>2 && i==argc ){ |
189224
|
0 |
0 |
if( pPatch->eType!=JSON_OBJECT ){ |
189230
|
0 |
0 |
if( pTarget->eType!=JSON_OBJECT ){ |
189235
|
0 |
0 |
for(i=1; in; i += jsonNodeSize(&pPatch[i+1])+1){ |
189243
|
0 |
0 |
for(j=1; jn; j += jsonNodeSize(&pTarget[j+1])+1 ){ |
189247
|
0 |
0 |
if( pTarget[j].n==nKey && strncmp(pTarget[j].u.zJContent,zKey,nKey)==0 ){ |
|
0 |
0 |
if( pTarget[j].n==nKey && strncmp(pTarget[j].u.zJContent,zKey,nKey)==0 ){ |
189248
|
0 |
0 |
if( pTarget[j+1].jnFlags & (JNODE_REMOVE|JNODE_PATCH) ) break; |
189249
|
0 |
0 |
if( pPatch[i+1].eType==JSON_NULL ){ |
189253
|
0 |
0 |
if( pNew==0 ) return 0; |
189255
|
0 |
0 |
if( pNew!=&pTarget[j+1] ){ |
189263
|
0 |
0 |
if( j>=pTarget->n && pPatch[i+1].eType!=JSON_NULL ){ |
|
0 |
0 |
if( j>=pTarget->n && pPatch[i+1].eType!=JSON_NULL ){ |
189268
|
0 |
0 |
if( pParse->oom ) return 0; |
189296
|
0 |
0 |
if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; |
189297
|
0 |
0 |
if( jsonParse(&y, ctx, (const char*)sqlite3_value_text(argv[1])) ){ |
189303
|
0 |
0 |
if( pResult ){ |
189328
|
0 |
0 |
if( argc&1 ){ |
189335
|
0 |
0 |
for(i=0; i
|
189336
|
0 |
0 |
if( sqlite3_value_type(argv[i])!=SQLITE_TEXT ){ |
189370
|
0 |
0 |
if( argc<1 ) return; |
189371
|
0 |
0 |
if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; |
189373
|
0 |
0 |
for(i=1; i<(u32)argc; i++){ |
189375
|
0 |
0 |
if( zPath==0 ) goto remove_done; |
189377
|
0 |
0 |
if( x.nErr ) goto remove_done; |
189378
|
0 |
0 |
if( pNode ) pNode->jnFlags |= JNODE_REMOVE; |
189380
|
0 |
0 |
if( (x.aNode[0].jnFlags & JNODE_REMOVE)==0 ){ |
189403
|
0 |
0 |
if( argc<1 ) return; |
189404
|
0 |
0 |
if( (argc&1)==0 ) { |
189408
|
0 |
0 |
if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; |
189410
|
0 |
0 |
for(i=1; i<(u32)argc; i+=2){ |
189413
|
0 |
0 |
if( x.nErr ) goto replace_err; |
189414
|
0 |
0 |
if( pNode ){ |
189419
|
0 |
0 |
if( x.aNode[0].jnFlags & JNODE_REPLACE ){ |
189452
|
0 |
0 |
if( argc<1 ) return; |
189453
|
0 |
0 |
if( (argc&1)==0 ) { |
189454
|
0 |
0 |
jsonWrongNumArgs(ctx, bIsSet ? "set" : "insert"); |
189457
|
0 |
0 |
if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; |
189459
|
0 |
0 |
for(i=1; i<(u32)argc; i+=2){ |
189463
|
0 |
0 |
if( x.oom ){ |
189466
|
0 |
0 |
}else if( x.nErr ){ |
189468
|
0 |
0 |
}else if( pNode && (bApnd || bIsSet) ){ |
|
0 |
0 |
}else if( pNode && (bApnd || bIsSet) ){ |
|
0 |
0 |
}else if( pNode && (bApnd || bIsSet) ){ |
189473
|
0 |
0 |
if( x.aNode[0].jnFlags & JNODE_REPLACE ){ |
189498
|
0 |
0 |
if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; |
189500
|
0 |
0 |
if( argc==2 ){ |
189506
|
0 |
0 |
if( pNode ){ |
189527
|
0 |
0 |
if( jsonParse(&x, 0, (const char*)sqlite3_value_text(argv[0]))==0 ){ |
189551
|
0 |
0 |
if( pStr ){ |
189552
|
0 |
0 |
if( pStr->zBuf==0 ){ |
189565
|
0 |
0 |
if( pStr ){ |
189568
|
0 |
0 |
if( pStr->bErr ){ |
189569
|
0 |
0 |
if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); |
189572
|
0 |
0 |
sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, |
189597
|
0 |
0 |
if( pStr ){ |
189598
|
0 |
0 |
if( pStr->zBuf==0 ){ |
189615
|
0 |
0 |
if( pStr ){ |
189617
|
0 |
0 |
if( pStr->bErr ){ |
189618
|
0 |
0 |
if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); |
189621
|
0 |
0 |
sqlite3_result_text(ctx, pStr->zBuf, pStr->nUsed, |
189680
|
0 |
0 |
if( rc==SQLITE_OK ){ |
189682
|
0 |
0 |
if( pNew==0 ) return SQLITE_NOMEM; |
189700
|
0 |
0 |
if( pCur==0 ) return SQLITE_NOMEM; |
189709
|
0 |
0 |
if( rc==SQLITE_OK ){ |
189748
|
0 |
0 |
if( p->bRecursive ){ |
189749
|
0 |
0 |
if( p->sParse.aNode[p->i].jnFlags & JNODE_LABEL ) p->i++; |
189752
|
0 |
0 |
if( p->iiEnd ){ |
189756
|
0 |
0 |
if( pUp->eType==JSON_ARRAY ){ |
189757
|
0 |
0 |
if( iUp==p->i-1 ){ |
189794
|
0 |
0 |
if( i==0 ){ |
189802
|
0 |
0 |
if( pUp->eType==JSON_ARRAY ){ |
189806
|
0 |
0 |
if( (pNode->jnFlags & JNODE_LABEL)==0 ) pNode--; |
189823
|
0 |
0 |
if( p->i==0 ) break; |
189824
|
0 |
0 |
if( p->eType==JSON_OBJECT ){ |
189826
|
0 |
0 |
}else if( p->eType==JSON_ARRAY ){ |
189828
|
0 |
0 |
if( p->bRecursive ){ |
189829
|
0 |
0 |
if( p->iRowid==0 ) break; |
189839
|
0 |
0 |
if( pThis->jnFlags & JNODE_LABEL ) pThis++; |
189844
|
0 |
0 |
if( pThis->jnFlags & JNODE_LABEL ) pThis++; |
189849
|
0 |
0 |
if( pThis->jnFlags & JNODE_LABEL ) pThis++; |
189850
|
0 |
0 |
if( pThis->eType>=JSON_ARRAY ) break; |
189860
|
0 |
0 |
if( p->i>p->iBegin && p->bRecursive ){ |
|
0 |
0 |
if( p->i>p->iBegin && p->bRecursive ){ |
189868
|
0 |
0 |
if( p->bRecursive ){ |
189871
|
0 |
0 |
if( p->zRoot ){ |
189876
|
0 |
0 |
if( p->eType==JSON_ARRAY ){ |
189878
|
0 |
0 |
}else if( p->eType==JSON_OBJECT ){ |
189886
|
0 |
0 |
if( p->bRecursive ){ |
189898
|
0 |
0 |
if( zRoot==0 ) zRoot = "$"; |
189934
|
0 |
0 |
for(i=0; inConstraint; i++, pConstraint++){ |
189935
|
0 |
0 |
if( pConstraint->usable==0 ) continue; |
189936
|
0 |
0 |
if( pConstraint->op!=SQLITE_INDEX_CONSTRAINT_EQ ) continue; |
189943
|
0 |
0 |
if( jsonIdx<0 ){ |
189950
|
0 |
0 |
if( rootIdx<0 ){ |
189975
|
0 |
0 |
if( idxNum==0 ) return SQLITE_OK; |
189977
|
0 |
0 |
if( z==0 ) return SQLITE_OK; |
189980
|
0 |
0 |
if( p->zJson==0 ) return SQLITE_NOMEM; |
189982
|
0 |
0 |
if( jsonParse(&p->sParse, 0, p->zJson) ){ |
189984
|
0 |
0 |
if( p->sParse.oom==0 ){ |
189987
|
0 |
0 |
if( cur->pVtab->zErrMsg ) rc = SQLITE_ERROR; |
189991
|
0 |
0 |
}else if( p->bRecursive && jsonParseFindParents(&p->sParse) ){ |
|
0 |
0 |
}else if( p->bRecursive && jsonParseFindParents(&p->sParse) ){ |
189996
|
0 |
0 |
if( idxNum==3 ){ |
189999
|
0 |
0 |
if( zRoot==0 ) return SQLITE_OK; |
190002
|
0 |
0 |
if( p->zRoot==0 ) return SQLITE_NOMEM; |
190004
|
0 |
0 |
if( zRoot[0]!='$' ){ |
190009
|
0 |
0 |
if( zErr ){ |
190013
|
0 |
0 |
return cur->pVtab->zErrMsg ? SQLITE_ERROR : SQLITE_NOMEM; |
190014
|
0 |
0 |
}else if( pNode==0 ){ |
190022
|
0 |
0 |
if( p->eType>=JSON_ARRAY ){ |
190025
|
0 |
0 |
if( p->bRecursive ){ |
190027
|
0 |
0 |
if( p->i>0 && (p->sParse.aNode[p->i-1].jnFlags & JNODE_LABEL)!=0 ){ |
|
0 |
0 |
if( p->i>0 && (p->sParse.aNode[p->i-1].jnFlags & JNODE_LABEL)!=0 ){ |
190150
|
3930 |
262 |
for(i=0; i
|
|
3930 |
0 |
for(i=0; i
|
190156
|
524 |
262 |
for(i=0; i
|
|
524 |
0 |
for(i=0; i
|
190162
|
524 |
262 |
for(i=0; i
|
|
524 |
0 |
for(i=0; i
|
192115
|
0 |
0 |
if( fts5yypParser ){ |
192210
|
0 |
0 |
while( pParser->fts5yytos>pParser->fts5yystack ) fts5yy_pop_parser_stack(pParser); |
192230
|
0 |
0 |
if( p==0 ) return; |
192294
|
0 |
0 |
if( stateno>fts5YY_MAX_SHIFT ) return stateno; |
192306
|
0 |
0 |
if( fts5yy_lookahead[i]!=iLookAhead ){ |
192393
|
0 |
0 |
while( fts5yypParser->fts5yytos>fts5yypParser->fts5yystack ) fts5yy_pop_parser_stack(fts5yypParser); |
192443
|
0 |
0 |
if( fts5yypParser->fts5yytos>fts5yypParser->fts5yystackEnd ){ |
192457
|
0 |
0 |
if( fts5yyNewState > fts5YY_MAX_SHIFT ){ |
192548
|
0 |
0 |
if( fts5yyRuleInfo[fts5yyruleno].nrhs==0 ){ |
192556
|
0 |
0 |
if( fts5yypParser->fts5yytos>=fts5yypParser->fts5yystackEnd ){ |
192881
|
0 |
0 |
if( fts5yyact >= fts5YY_MIN_REDUCE ){ |
192884
|
0 |
0 |
}else if( fts5yyact <= fts5YY_MAX_SHIFTREDUCE ){ |
192890
|
0 |
0 |
}else if( fts5yyact==fts5YY_ACCEPT_ACTION ){ |
192997
|
0 |
0 |
}while( fts5yypParser->fts5yytos>fts5yypParser->fts5yystack ); |
193071
|
0 |
0 |
while( rc==SQLITE_OK && pIter->iInstnInst ){ |
|
0 |
0 |
while( rc==SQLITE_OK && pIter->iInstnInst ){ |
193074
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193075
|
0 |
0 |
if( ic==pIter->iCol ){ |
193077
|
0 |
0 |
if( pIter->iStart<0 ){ |
193080
|
0 |
0 |
}else if( io<=pIter->iEnd ){ |
193081
|
0 |
0 |
if( iEnd>pIter->iEnd ) pIter->iEnd = iEnd; |
193111
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193151
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
193152
|
0 |
0 |
if( n<0 ) n = (int)strlen(z); |
193154
|
0 |
0 |
if( p->zOut==0 ) *pRc = SQLITE_NOMEM; |
193175
|
0 |
0 |
if( tflags & FTS5_TOKEN_COLOCATED ) return SQLITE_OK; |
193178
|
0 |
0 |
if( p->iRangeEnd>0 ){ |
193179
|
0 |
0 |
if( iPosiRangeStart || iPos>p->iRangeEnd ) return SQLITE_OK; |
|
0 |
0 |
if( iPosiRangeStart || iPos>p->iRangeEnd ) return SQLITE_OK; |
193180
|
0 |
0 |
if( p->iRangeStart && iPos==p->iRangeStart ) p->iOff = iStartOff; |
|
0 |
0 |
if( p->iRangeStart && iPos==p->iRangeStart ) p->iOff = iStartOff; |
193183
|
0 |
0 |
if( iPos==p->iter.iStart ){ |
193189
|
0 |
0 |
if( iPos==p->iter.iEnd ){ |
193190
|
0 |
0 |
if( p->iRangeEnd && p->iter.iStartiRangeStart ){ |
|
0 |
0 |
if( p->iRangeEnd && p->iter.iStartiRangeStart ){ |
193196
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193201
|
0 |
0 |
if( p->iRangeEnd>0 && iPos==p->iRangeEnd ){ |
|
0 |
0 |
if( p->iRangeEnd>0 && iPos==p->iRangeEnd ){ |
193204
|
0 |
0 |
if( iPos>=p->iter.iStart && iPositer.iEnd ){ |
|
0 |
0 |
if( iPos>=p->iter.iStart && iPositer.iEnd ){ |
193226
|
0 |
0 |
if( nVal!=3 ){ |
193238
|
0 |
0 |
if( ctx.zIn ){ |
193239
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193243
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193248
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193253
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
193279
|
0 |
0 |
if( p->nFirstAlloc==p->nFirst ){ |
193280
|
0 |
0 |
int nNew = p->nFirstAlloc ? p->nFirstAlloc*2 : 64; |
193284
|
0 |
0 |
if( aNew==0 ) return SQLITE_NOMEM; |
193310
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ){ |
193312
|
0 |
0 |
if( p->iPos>0 ){ |
193315
|
0 |
0 |
for(i=iStartOff-1; i>=0; i--){ |
193317
|
0 |
0 |
if( c!=' ' && c!='\t' && c!='\n' && c!='\r' ) break; |
|
0 |
0 |
if( c!=' ' && c!='\t' && c!='\n' && c!='\r' ) break; |
|
0 |
0 |
if( c!=' ' && c!='\t' && c!='\n' && c!='\r' ) break; |
|
0 |
0 |
if( c!=' ' && c!='\t' && c!='\n' && c!='\r' ) break; |
193319
|
0 |
0 |
if( i!=iStartOff-1 && (c=='.' || c==':') ){ |
|
0 |
0 |
if( i!=iStartOff-1 && (c=='.' || c==':') ){ |
|
0 |
0 |
if( i!=iStartOff-1 && (c=='.' || c==':') ){ |
193352
|
0 |
0 |
for(i=0; i
|
|
0 |
0 |
for(i=0; i
|
193354
|
0 |
0 |
if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff<(iPos+nToken) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff<(iPos+nToken) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff<(iPos+nToken) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff<(iPos+nToken) ){ |
193355
|
0 |
0 |
nScore += (aSeen[ip] ? 1 : 1000); |
193357
|
0 |
0 |
if( iFirst<0 ) iFirst = iOff; |
193363
|
0 |
0 |
if( piPos ){ |
193365
|
0 |
0 |
if( (iAdj+nToken)>nDocsize ) iAdj = nDocsize - nToken; |
193366
|
0 |
0 |
if( iAdj<0 ) iAdj = 0; |
193380
|
0 |
0 |
return zRet ? zRet : ""; |
193409
|
0 |
0 |
if( nVal!=5 ){ |
193426
|
0 |
0 |
if( aSeen==0 ){ |
193429
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193434
|
0 |
0 |
for(i=0; i
|
193435
|
0 |
0 |
if( iCol<0 || iCol==i ){ |
|
0 |
0 |
if( iCol<0 || iCol==i ){ |
193442
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
193446
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
193448
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
193450
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii
|
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii
|
193457
|
0 |
0 |
if( ic!=i || rc!=SQLITE_OK ) continue; |
|
0 |
0 |
if( ic!=i || rc!=SQLITE_OK ) continue; |
193462
|
0 |
0 |
if( rc==SQLITE_OK && nScore>nBestScore ){ |
|
0 |
0 |
if( rc==SQLITE_OK && nScore>nBestScore ){ |
193469
|
0 |
0 |
if( rc==SQLITE_OK && sFinder.nFirst && nDocsize>nToken ){ |
|
0 |
0 |
if( rc==SQLITE_OK && sFinder.nFirst && nDocsize>nToken ){ |
|
0 |
0 |
if( rc==SQLITE_OK && sFinder.nFirst && nDocsize>nToken ){ |
193470
|
0 |
0 |
for(jj=0; jj<(sFinder.nFirst-1); jj++){ |
193471
|
0 |
0 |
if( sFinder.aFirst[jj+1]>io ) break; |
193474
|
0 |
0 |
if( sFinder.aFirst[jj]
|
193480
|
0 |
0 |
nScore += (sFinder.aFirst[jj]==0 ? 120 : 100); |
193481
|
0 |
0 |
if( rc==SQLITE_OK && nScore>nBestScore ){ |
|
0 |
0 |
if( rc==SQLITE_OK && nScore>nBestScore ){ |
193493
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193496
|
0 |
0 |
if( rc==SQLITE_OK && nColSize==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && nColSize==0 ){ |
193499
|
0 |
0 |
if( ctx.zIn ){ |
193500
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193507
|
0 |
0 |
if( iBestStart>0 ){ |
193513
|
0 |
0 |
while( ctx.iter.iStart>=0 && ctx.iter.iStart
|
|
0 |
0 |
while( ctx.iter.iStart>=0 && ctx.iter.iStart
|
|
0 |
0 |
while( ctx.iter.iStart>=0 && ctx.iter.iStart
|
193517
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193520
|
0 |
0 |
if( ctx.iRangeEnd>=(nColSize-1) ){ |
193526
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193579
|
0 |
0 |
if( p==0 ){ |
193590
|
0 |
0 |
if( p==0 ){ |
193600
|
0 |
0 |
if( rc==SQLITE_OK ) rc = pApi->xRowCount(pFts, &nRow); |
193601
|
0 |
0 |
if( rc==SQLITE_OK ) rc = pApi->xColumnTotalSize(pFts, -1, &nToken); |
193602
|
0 |
0 |
if( rc==SQLITE_OK ) p->avgdl = (double)nToken / (double)nRow; |
193605
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
193608
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193623
|
0 |
0 |
if( idf<=0.0 ) idf = 1e-6; |
193628
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
193633
|
0 |
0 |
if( rc!=SQLITE_OK ) p = 0; |
193662
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193667
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
193670
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193671
|
0 |
0 |
double w = (nVal > ic) ? sqlite3_value_double(apVal[ic]) : 1.0; |
193677
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193684
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inPhrase; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inPhrase; i++){ |
193693
|
0 |
0 |
if( rc==SQLITE_OK ){ |
193714
|
1048 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
786 |
262 |
for(i=0; rc==SQLITE_OK && i
|
193746
|
0 |
0 |
if( (u32)pBuf->nSpace
|
193747
|
0 |
0 |
u32 nNew = pBuf->nSpace ? pBuf->nSpace : 64; |
193749
|
0 |
0 |
while( nNew
|
193753
|
0 |
0 |
if( pNew==0 ){ |
193770
|
0 |
0 |
if( fts5BufferGrow(pRc, pBuf, 9) ) return; |
|
0 |
0 |
if( fts5BufferGrow(pRc, pBuf, 9) ) return; |
193797
|
0 |
0 |
if( nData ){ |
193798
|
0 |
0 |
if( fts5BufferGrow(pRc, pBuf, nData) ) return; |
|
0 |
0 |
if( fts5BufferGrow(pRc, pBuf, nData) ) return; |
193832
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
193839
|
0 |
0 |
if( zTmp==0 ){ |
193850
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
193855
|
0 |
0 |
if( zRet==0 ){ |
193900
|
0 |
0 |
if( i>=n ){ |
193907
|
0 |
0 |
fts5FastGetVarint32(a, i, iVal); |
193908
|
0 |
0 |
if( iVal==1 ){ |
193909
|
0 |
0 |
fts5FastGetVarint32(a, i, iVal); |
193911
|
0 |
0 |
fts5FastGetVarint32(a, i, iVal); |
193925
|
0 |
0 |
if( sqlite3Fts5PoslistNext64(pIter->a, pIter->n, &pIter->i, &pIter->iPos) ){ |
193954
|
0 |
0 |
if( (iPos & colmask) != (*piPrev & colmask) ){ |
193969
|
0 |
0 |
if( fts5BufferGrow(&rc, pBuf, 5+5+5) ) return rc; |
|
0 |
0 |
if( fts5BufferGrow(&rc, pBuf, 5+5+5) ) return rc; |
193976
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
193978
|
0 |
0 |
if( pRet==0 ){ |
193979
|
0 |
0 |
if( nByte>0 ) *pRc = SQLITE_NOMEM; |
193997
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
193998
|
0 |
0 |
if( nIn<0 ){ |
194002
|
0 |
0 |
if( zRet ){ |
194035
|
0 |
0 |
return (t & 0x80) || aBareword[(int)t]; |
|
0 |
0 |
return (t & 0x80) || aBareword[(int)t]; |
194067
|
0 |
0 |
if( p ){ |
194076
|
0 |
0 |
for(i=nTerm-1; i>=0; i--){ |
194082
|
0 |
0 |
for(pEntry=p->apHash[hash]; pEntry; pEntry=pEntry->pNext){ |
194083
|
0 |
0 |
if( pEntry->iIdx==iIdx |
194084
|
0 |
0 |
&& pEntry->nTerm==nTerm |
194085
|
0 |
0 |
&& memcmp(pEntry->pTerm, pTerm, nTerm)==0 |
194092
|
0 |
0 |
if( pEntry==0 ){ |
194094
|
0 |
0 |
if( pEntry ){ |
194109
|
0 |
0 |
if( p ){ |
194111
|
0 |
0 |
for(i=0; iapHash); i++){ |
194113
|
0 |
0 |
while( pEntry ){ |
194155
|
0 |
0 |
return (x=='"' || x=='\'' || x=='[' || x=='`'); |
|
0 |
0 |
return (x=='"' || x=='\'' || x=='[' || x=='`'); |
|
0 |
0 |
return (x=='"' || x=='\'' || x=='[' || x=='`'); |
|
0 |
0 |
return (x=='"' || x=='\'' || x=='[' || x=='`'); |
194165
|
0 |
0 |
if( p ){ |
194166
|
0 |
0 |
while( fts5_iswhitespace(*p) ){ p++; } |
194178
|
0 |
0 |
while ( sqlite3Fts5IsBareword(*p) ) p++; |
194179
|
0 |
0 |
if( p==pIn ) p = 0; |
194184
|
0 |
0 |
return (a>='0' && a<='9'); |
|
0 |
0 |
return (a>='0' && a<='9'); |
194193
|
0 |
0 |
if( sqlite3_strnicmp("null", p, 4)==0 ){ |
194202
|
0 |
0 |
if( *p=='\'' ){ |
194204
|
0 |
0 |
while( (*p>='a' && *p<='f') |
|
0 |
0 |
while( (*p>='a' && *p<='f') |
194205
|
0 |
0 |
|| (*p>='A' && *p<='F') |
|
0 |
0 |
|| (*p>='A' && *p<='F') |
194206
|
0 |
0 |
|| (*p>='0' && *p<='9') |
|
0 |
0 |
|| (*p>='0' && *p<='9') |
194210
|
0 |
0 |
if( *p=='\'' && 0==((p-pIn)%2) ){ |
|
0 |
0 |
if( *p=='\'' && 0==((p-pIn)%2) ){ |
194222
|
0 |
0 |
while( p ){ |
194223
|
0 |
0 |
if( *p=='\'' ){ |
194225
|
0 |
0 |
if( *p!='\'' ) break; |
194228
|
0 |
0 |
if( *p==0 ) p = 0; |
194234
|
0 |
0 |
if( *p=='+' || *p=='-' ) p++; |
|
0 |
0 |
if( *p=='+' || *p=='-' ) p++; |
194235
|
0 |
0 |
while( fts5_isdigit(*p) ) p++; |
194240
|
0 |
0 |
if( *p=='.' && fts5_isdigit(p[1]) ){ |
|
0 |
0 |
if( *p=='.' && fts5_isdigit(p[1]) ){ |
194242
|
0 |
0 |
while( fts5_isdigit(*p) ) p++; |
194244
|
0 |
0 |
if( p==pIn ) p = 0; |
194273
|
0 |
0 |
if( q=='[' ) q = ']'; |
194275
|
0 |
0 |
while( ALWAYS(z[iIn]) ){ |
194276
|
0 |
0 |
if( z[iIn]==q ){ |
194277
|
0 |
0 |
if( z[iIn+1]!=q ){ |
194315
|
0 |
0 |
if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){ |
|
0 |
0 |
if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){ |
|
0 |
0 |
if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){ |
|
0 |
0 |
if( quote=='[' || quote=='\'' || quote=='"' || quote=='`' ){ |
194336
|
0 |
0 |
for(i=0; aEnum[i].zName; i++){ |
194337
|
0 |
0 |
if( sqlite3_strnicmp(aEnum[i].zName, zEnum, nEnum)==0 ){ |
194338
|
0 |
0 |
if( iVal>=0 ) return SQLITE_ERROR; |
194365
|
0 |
0 |
if( sqlite3_strnicmp("prefix", zCmd, nCmd)==0 ){ |
194369
|
0 |
0 |
if( pConfig->aPrefix==0 ){ |
194371
|
0 |
0 |
if( rc ) return rc; |
194378
|
0 |
0 |
while( p[0]==' ' ) p++; |
194379
|
0 |
0 |
if( bFirst==0 && p[0]==',' ){ |
|
0 |
0 |
if( bFirst==0 && p[0]==',' ){ |
194381
|
0 |
0 |
while( p[0]==' ' ) p++; |
194382
|
0 |
0 |
}else if( p[0]=='\0' ){ |
194385
|
0 |
0 |
if( p[0]<'0' || p[0]>'9' ){ |
|
0 |
0 |
if( p[0]<'0' || p[0]>'9' ){ |
194391
|
0 |
0 |
if( pConfig->nPrefix==FTS5_MAX_PREFIX_INDEXES ){ |
194399
|
0 |
0 |
while( p[0]>='0' && p[0]<='9' && nPre<1000 ){ |
|
0 |
0 |
while( p[0]>='0' && p[0]<='9' && nPre<1000 ){ |
|
0 |
0 |
while( p[0]>='0' && p[0]<='9' && nPre<1000 ){ |
194404
|
0 |
0 |
if( nPre<=0 || nPre>=1000 ){ |
|
0 |
0 |
if( nPre<=0 || nPre>=1000 ){ |
194418
|
0 |
0 |
if( sqlite3_strnicmp("tokenize", zCmd, nCmd)==0 ){ |
194425
|
0 |
0 |
if( azArg && pSpace ){ |
|
0 |
0 |
if( azArg && pSpace ){ |
194426
|
0 |
0 |
if( pConfig->pTok ){ |
194430
|
0 |
0 |
for(nArg=0; p && *p; nArg++){ |
|
0 |
0 |
for(nArg=0; p && *p; nArg++){ |
194432
|
0 |
0 |
if( *p2=='\'' ){ |
194437
|
0 |
0 |
if( p ){ |
194445
|
0 |
0 |
if( p==0 ){ |
194462
|
0 |
0 |
if( sqlite3_strnicmp("content", zCmd, nCmd)==0 ){ |
194463
|
0 |
0 |
if( pConfig->eContent!=FTS5_CONTENT_NORMAL ){ |
194467
|
0 |
0 |
if( zArg[0] ){ |
194477
|
0 |
0 |
if( sqlite3_strnicmp("content_rowid", zCmd, nCmd)==0 ){ |
194478
|
0 |
0 |
if( pConfig->zContentRowid ){ |
194487
|
0 |
0 |
if( sqlite3_strnicmp("columnsize", zCmd, nCmd)==0 ){ |
194488
|
0 |
0 |
if( (zArg[0]!='0' && zArg[0]!='1') || zArg[1]!='\0' ){ |
|
0 |
0 |
if( (zArg[0]!='0' && zArg[0]!='1') || zArg[1]!='\0' ){ |
|
0 |
0 |
if( (zArg[0]!='0' && zArg[0]!='1') || zArg[1]!='\0' ){ |
194497
|
0 |
0 |
if( sqlite3_strnicmp("detail", zCmd, nCmd)==0 ){ |
194505
|
0 |
0 |
if( (rc = fts5ConfigSetEnum(aDetail, zArg, &pConfig->eDetail)) ){ |
194557
|
0 |
0 |
if( zOut==0 ){ |
194561
|
0 |
0 |
if( fts5_isopenquote(zOut[0]) ){ |
194567
|
0 |
0 |
if( zRet ){ |
194573
|
0 |
0 |
if( zRet==0 ){ |
194589
|
0 |
0 |
if( 0==sqlite3_stricmp(zCol, FTS5_RANK_NAME) |
194590
|
0 |
0 |
|| 0==sqlite3_stricmp(zCol, FTS5_ROWID_NAME) |
194594
|
0 |
0 |
}else if( zArg ){ |
194595
|
0 |
0 |
if( 0==sqlite3_stricmp(zArg, "unindexed") ){ |
194616
|
0 |
0 |
if( p->eContent!=FTS5_CONTENT_NONE ){ |
194617
|
0 |
0 |
for(i=0; inCol; i++){ |
194618
|
0 |
0 |
if( p->eContent==FTS5_CONTENT_EXTERNAL ){ |
194657
|
0 |
0 |
if( pRet==0 ) return SQLITE_NOMEM; |
194672
|
0 |
0 |
if( rc==SQLITE_OK && sqlite3_stricmp(pRet->zName, FTS5_RANK_NAME)==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && sqlite3_stricmp(pRet->zName, FTS5_RANK_NAME)==0 ){ |
194677
|
0 |
0 |
for(i=3; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=3; rc==SQLITE_OK && i
|
194687
|
0 |
0 |
if( z && *z=='=' ){ |
|
0 |
0 |
if( z && *z=='=' ){ |
194690
|
0 |
0 |
if( bMustBeCol ) z = 0; |
194693
|
0 |
0 |
if( z && z[0] ){ |
|
0 |
0 |
if( z && z[0] ){ |
194696
|
0 |
0 |
if( z && z[0] ) z = 0; |
|
0 |
0 |
if( z && z[0] ) z = 0; |
194699
|
0 |
0 |
if( rc==SQLITE_OK ){ |
194700
|
0 |
0 |
if( z==0 ){ |
194704
|
0 |
0 |
if( bOption ){ |
194705
|
0 |
0 |
rc = fts5ConfigParseSpecial(pGlobal, pRet, zOne, zTwo?zTwo:"", pzErr); |
194720
|
0 |
0 |
if( rc==SQLITE_OK && pRet->pTok==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pRet->pTok==0 ){ |
194725
|
0 |
0 |
if( rc==SQLITE_OK && pRet->zContent==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pRet->zContent==0 ){ |
194730
|
0 |
0 |
if( pRet->eContent==FTS5_CONTENT_NORMAL ){ |
194732
|
0 |
0 |
}else if( pRet->bColumnsize ){ |
194736
|
0 |
0 |
if( zTail ){ |
194743
|
0 |
0 |
if( rc==SQLITE_OK && pRet->zContentRowid==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pRet->zContentRowid==0 ){ |
194748
|
0 |
0 |
if( rc==SQLITE_OK ){ |
194752
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
194763
|
0 |
0 |
if( pConfig ){ |
194765
|
0 |
0 |
if( pConfig->pTok ){ |
194770
|
0 |
0 |
for(i=0; inCol; i++){ |
194795
|
0 |
0 |
for(i=0; zSql && inCol; i++){ |
|
0 |
0 |
for(i=0; zSql && inCol; i++){ |
194796
|
0 |
0 |
const char *zSep = (i==0?"":", "); |
194804
|
0 |
0 |
if( zSql ){ |
194842
|
0 |
0 |
if( pText==0 ) return SQLITE_OK; |
194861
|
0 |
0 |
if( p==0 || *p==')' ) break; |
|
0 |
0 |
if( p==0 || *p==')' ) break; |
194862
|
0 |
0 |
if( *p!=',' ){ |
194895
|
0 |
0 |
if( p==0 ){ |
194902
|
0 |
0 |
if( p ){ |
194904
|
0 |
0 |
if( zRank ) memcpy(zRank, pRank, p-pRank); |
194909
|
0 |
0 |
if( rc==SQLITE_OK ){ |
194911
|
0 |
0 |
if( *p!='(' ) rc = SQLITE_ERROR; |
194914
|
0 |
0 |
if( rc==SQLITE_OK ){ |
194918
|
0 |
0 |
if( *p!=')' ){ |
194920
|
0 |
0 |
if( p==0 ){ |
194924
|
0 |
0 |
if( zRankArgs ) memcpy(zRankArgs, pArgs, p-pArgs); |
194930
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
194948
|
0 |
0 |
if( 0==sqlite3_stricmp(zKey, "pgsz") ){ |
194950
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ |
194953
|
0 |
0 |
if( pgsz<=0 || pgsz>FTS5_MAX_PAGE_SIZE ){ |
|
0 |
0 |
if( pgsz<=0 || pgsz>FTS5_MAX_PAGE_SIZE ){ |
194960
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "hashsize") ){ |
194962
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ |
194965
|
0 |
0 |
if( nHashSize<=0 ){ |
194972
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "automerge") ){ |
194974
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ |
194977
|
0 |
0 |
if( nAutomerge<0 || nAutomerge>64 ){ |
|
0 |
0 |
if( nAutomerge<0 || nAutomerge>64 ){ |
194980
|
0 |
0 |
if( nAutomerge==1 ) nAutomerge = FTS5_DEFAULT_AUTOMERGE; |
194985
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "usermerge") ){ |
194987
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ |
194990
|
0 |
0 |
if( nUsermerge<2 || nUsermerge>16 ){ |
|
0 |
0 |
if( nUsermerge<2 || nUsermerge>16 ){ |
194997
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "crisismerge") ){ |
194999
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ |
195002
|
0 |
0 |
if( nCrisisMerge<0 ){ |
195005
|
0 |
0 |
if( nCrisisMerge<=1 ) nCrisisMerge = FTS5_DEFAULT_CRISISMERGE; |
195010
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "rank") ){ |
195015
|
0 |
0 |
if( rc==SQLITE_OK ){ |
195020
|
0 |
0 |
}else if( rc==SQLITE_ERROR ){ |
195048
|
0 |
0 |
if( zSql ){ |
195054
|
0 |
0 |
if( rc==SQLITE_OK ){ |
195055
|
0 |
0 |
while( SQLITE_ROW==sqlite3_step(p) ){ |
195058
|
0 |
0 |
if( 0==sqlite3_stricmp(zK, "version") ){ |
195068
|
0 |
0 |
if( rc==SQLITE_OK && iVersion!=FTS5_CURRENT_VERSION ){ |
|
0 |
0 |
if( rc==SQLITE_OK && iVersion!=FTS5_CURRENT_VERSION ){ |
195070
|
0 |
0 |
if( pConfig->pzErrmsg ){ |
195079
|
0 |
0 |
if( rc==SQLITE_OK ){ |
195219
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){ |
195227
|
0 |
0 |
return t==' ' || t=='\t' || t=='\n' || t=='\r'; |
|
0 |
0 |
return t==' ' || t=='\t' || t=='\n' || t=='\r'; |
|
0 |
0 |
return t==' ' || t=='\t' || t=='\n' || t=='\r'; |
|
0 |
0 |
return t==' ' || t=='\t' || t=='\n' || t=='\r'; |
195242
|
0 |
0 |
while( fts5ExprIsspace(*z) ) z++; |
195264
|
0 |
0 |
if( z2[0]=='"' ){ |
195266
|
0 |
0 |
if( z2[0]!='"' ) break; |
195268
|
0 |
0 |
if( z2[0]=='\0' ){ |
195279
|
0 |
0 |
if( sqlite3Fts5IsBareword(z[0])==0 ){ |
195284
|
0 |
0 |
for(z2=&z[1]; sqlite3Fts5IsBareword(*z2); z2++); |
195286
|
0 |
0 |
if( pToken->n==2 && memcmp(pToken->p, "OR", 2)==0 ) tok = FTS5_OR; |
|
0 |
0 |
if( pToken->n==2 && memcmp(pToken->p, "OR", 2)==0 ) tok = FTS5_OR; |
195287
|
0 |
0 |
if( pToken->n==3 && memcmp(pToken->p, "NOT", 3)==0 ) tok = FTS5_NOT; |
|
0 |
0 |
if( pToken->n==3 && memcmp(pToken->p, "NOT", 3)==0 ) tok = FTS5_NOT; |
195288
|
0 |
0 |
if( pToken->n==3 && memcmp(pToken->p, "AND", 3)==0 ) tok = FTS5_AND; |
|
0 |
0 |
if( pToken->n==3 && memcmp(pToken->p, "AND", 3)==0 ) tok = FTS5_AND; |
195318
|
0 |
0 |
if( pEngine==0 ){ return SQLITE_NOMEM; } |
195324
|
0 |
0 |
}while( sParse.rc==SQLITE_OK && t!=FTS5_EOF ); |
|
0 |
0 |
}while( sParse.rc==SQLITE_OK && t!=FTS5_EOF ); |
195329
|
0 |
0 |
if( iColnCol && sParse.pExpr && sParse.rc==SQLITE_OK ){ |
|
0 |
0 |
if( iColnCol && sParse.pExpr && sParse.rc==SQLITE_OK ){ |
|
0 |
0 |
if( iColnCol && sParse.pExpr && sParse.rc==SQLITE_OK ){ |
195332
|
0 |
0 |
if( pColset ){ |
195340
|
0 |
0 |
if( sParse.rc==SQLITE_OK ){ |
195342
|
0 |
0 |
if( pNew==0 ){ |
195346
|
0 |
0 |
if( !sParse.pExpr ){ |
195349
|
0 |
0 |
if( pNew->pRoot ){ |
195374
|
0 |
0 |
if( p ){ |
195376
|
0 |
0 |
for(i=0; inChild; i++){ |
195388
|
0 |
0 |
if( p ){ |
195406
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){ |
195407
|
0 |
0 |
if( 0==sqlite3Fts5IterEof(p->pIter) ){ |
195409
|
0 |
0 |
if( bRetValid==0 || (bDesc!=(iRowid
|
|
0 |
0 |
if( bRetValid==0 || (bDesc!=(iRowid
|
195416
|
0 |
0 |
if( pbEof && bRetValid==0 ) *pbEof = 1; |
|
0 |
0 |
if( pbEof && bRetValid==0 ) *pbEof = 1; |
195437
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){ |
195439
|
0 |
0 |
if( sqlite3Fts5IterEof(pIter)==0 && pIter->iRowid==iRowid ){ |
|
0 |
0 |
if( sqlite3Fts5IterEof(pIter)==0 && pIter->iRowid==iRowid ){ |
195440
|
0 |
0 |
if( pIter->nData==0 ) continue; |
195441
|
0 |
0 |
if( nIter==nAlloc ){ |
195444
|
0 |
0 |
if( aNew==0 ){ |
195450
|
0 |
0 |
if( aIter!=aStatic ) sqlite3_free(aIter); |
195459
|
0 |
0 |
if( nIter==1 ){ |
195469
|
0 |
0 |
for(i=0; i
|
195470
|
0 |
0 |
if( aIter[i].bEof==0 ){ |
195471
|
0 |
0 |
if( aIter[i].iPos==iPrev ){ |
195472
|
0 |
0 |
if( sqlite3Fts5PoslistReaderNext(&aIter[i]) ) continue; |
195474
|
0 |
0 |
if( aIter[i].iPos
|
195479
|
0 |
0 |
if( iMin==FTS5_LARGEST_INT64 || rc!=SQLITE_OK ) break; |
|
0 |
0 |
if( iMin==FTS5_LARGEST_INT64 || rc!=SQLITE_OK ) break; |
195483
|
0 |
0 |
if( rc==SQLITE_OK ){ |
195490
|
0 |
0 |
if( aIter!=aStatic ) sqlite3_free(aIter); |
195522
|
0 |
0 |
if( pPhrase->nTerm>ArraySize(aStatic) ){ |
195525
|
0 |
0 |
if( !aIter ) return SQLITE_NOMEM; |
195530
|
0 |
0 |
for(i=0; inTerm; i++){ |
195535
|
0 |
0 |
if( pTerm->pSynonym ){ |
195538
|
0 |
0 |
if( rc ){ |
195542
|
0 |
0 |
if( a==buf.p ) bFlag = 1; |
195549
|
0 |
0 |
if( aIter[i].bEof ) goto ismatch_out; |
195557
|
0 |
0 |
for(i=0; inTerm; i++){ |
195560
|
0 |
0 |
if( pPos->iPos!=iAdj ){ |
195562
|
0 |
0 |
while( pPos->iPos
|
195563
|
0 |
0 |
if( sqlite3Fts5PoslistReaderNext(pPos) ) goto ismatch_out; |
195565
|
0 |
0 |
if( pPos->iPos>iAdj ) iPos = pPos->iPos-i; |
195568
|
0 |
0 |
}while( bMatch==0 ); |
195571
|
0 |
0 |
if( bFirst==0 || FTS5_POS2OFFSET(iPos)==0 ){ |
|
0 |
0 |
if( bFirst==0 || FTS5_POS2OFFSET(iPos)==0 ){ |
195573
|
0 |
0 |
if( rc!=SQLITE_OK ) goto ismatch_out; |
195576
|
0 |
0 |
for(i=0; inTerm; i++){ |
195577
|
0 |
0 |
if( sqlite3Fts5PoslistReaderNext(&aIter[i]) ) goto ismatch_out; |
195583
|
0 |
0 |
for(i=0; inTerm; i++){ |
195584
|
0 |
0 |
if( aIter[i].bFlag ) sqlite3_free((u8*)aIter[i].a); |
195586
|
0 |
0 |
if( aIter!=aStatic ) sqlite3_free(aIter); |
195603
|
0 |
0 |
if( sqlite3Fts5PoslistNext64(p->a, p->n, &p->i, &p->iLookahead) ){ |
195657
|
0 |
0 |
if( pNear->nPhrase>ArraySize(aStatic) ){ |
195663
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
195676
|
0 |
0 |
for(i=0; inPhrase; i++){ |
195693
|
0 |
0 |
for(i=0; inPhrase; i++){ |
195696
|
0 |
0 |
if( pPos->iPosiPos>iMax ){ |
|
0 |
0 |
if( pPos->iPosiPos>iMax ){ |
195698
|
0 |
0 |
while( pPos->iPos
|
195699
|
0 |
0 |
if( fts5LookaheadReaderNext(pPos) ) goto ismatch_out; |
195701
|
0 |
0 |
if( pPos->iPos>iMax ) iMax = pPos->iPos; |
195704
|
0 |
0 |
}while( bMatch==0 ); |
195707
|
0 |
0 |
for(i=0; inPhrase; i++){ |
195710
|
0 |
0 |
if( a[i].pOut->n==0 || iPos!=pWriter->iPrev ){ |
|
0 |
0 |
if( a[i].pOut->n==0 || iPos!=pWriter->iPrev ){ |
195717
|
0 |
0 |
for(i=0; inPhrase; i++){ |
195718
|
0 |
0 |
if( a[i].reader.iLookahead < iMin ){ |
195723
|
0 |
0 |
if( fts5LookaheadReaderNext(&a[iAdv].reader) ) goto ismatch_out; |
195729
|
0 |
0 |
if( a!=aStatic ) sqlite3_free(a); |
195754
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast
|
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast
|
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast
|
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast
|
195756
|
0 |
0 |
if( rc || sqlite3Fts5IterEof(pIter) ){ |
|
0 |
0 |
if( rc || sqlite3Fts5IterEof(pIter) ){ |
195780
|
0 |
0 |
for(p=pTerm; rc==SQLITE_OK && p; p=p->pSynonym){ |
|
0 |
0 |
for(p=pTerm; rc==SQLITE_OK && p; p=p->pSynonym){ |
195781
|
0 |
0 |
if( sqlite3Fts5IterEof(p->pIter)==0 ){ |
195783
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast
|
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast
|
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast
|
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast
|
195789
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
195807
|
0 |
0 |
if( pExpr->pConfig->eDetail!=FTS5_DETAIL_FULL ){ |
195811
|
0 |
0 |
for(pTerm=&pPhrase->aTerm[0]; pTerm; pTerm=pTerm->pSynonym){ |
195813
|
0 |
0 |
if( sqlite3Fts5IterEof(pIter)==0 ){ |
195814
|
0 |
0 |
if( pIter->iRowid==pNode->iRowid && pIter->nData>0 ){ |
|
0 |
0 |
if( pIter->iRowid==pNode->iRowid && pIter->nData>0 ){ |
195826
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inPhrase; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inPhrase; i++){ |
195828
|
0 |
0 |
if( pPhrase->nTerm>1 || pPhrase->aTerm[0].pSynonym |
|
0 |
0 |
if( pPhrase->nTerm>1 || pPhrase->aTerm[0].pSynonym |
195829
|
0 |
0 |
|| pNear->pColset || pPhrase->aTerm[0].bFirst |
|
0 |
0 |
|| pNear->pColset || pPhrase->aTerm[0].bFirst |
195833
|
0 |
0 |
if( bMatch==0 ) break; |
195841
|
0 |
0 |
if( i==pNear->nPhrase && (i==1 || fts5ExprNearIsMatch(pRc, pNear)) ){ |
|
0 |
0 |
if( i==pNear->nPhrase && (i==1 || fts5ExprNearIsMatch(pRc, pNear)) ){ |
|
0 |
0 |
if( i==pNear->nPhrase && (i==1 || fts5ExprNearIsMatch(pRc, pNear)) ){ |
195866
|
0 |
0 |
for(i=0; inPhrase; i++){ |
195868
|
0 |
0 |
if( pPhrase->nTerm==0 ){ |
195873
|
0 |
0 |
for(j=0; jnTerm; j++){ |
195878
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){ |
195880
|
0 |
0 |
if( p->pIter ){ |
195887
|
0 |
0 |
(pExpr->bDesc ? FTS5INDEX_QUERY_DESC : 0), |
195892
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
195893
|
0 |
0 |
if( 0==sqlite3Fts5IterEof(p->pIter) ){ |
195898
|
0 |
0 |
if( bHit==0 ){ |
195926
|
0 |
0 |
if( pExpr->bDesc==0 ){ |
195927
|
0 |
0 |
if( iLhs
|
195930
|
0 |
0 |
if( iLhs>iRhs ) return -1; |
195939
|
0 |
0 |
for(i=0; inChild; i++){ |
195945
|
0 |
0 |
if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){ |
|
0 |
0 |
if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){ |
195948
|
0 |
0 |
for(i=0; inPhrase; i++){ |
195954
|
0 |
0 |
for(i=0; inChild; i++){ |
195979
|
0 |
0 |
if( p2->bEof ) return -1; |
195980
|
0 |
0 |
if( p1->bEof ) return +1; |
196018
|
0 |
0 |
if( pLeft->aTerm[0].pSynonym ){ |
196026
|
0 |
0 |
for(i=0; inPhrase; i++){ |
196028
|
0 |
0 |
for(j=0; jnTerm; j++){ |
196030
|
0 |
0 |
if( pTerm->pSynonym ){ |
196032
|
0 |
0 |
if( iRowid==iLast ) continue; |
196034
|
0 |
0 |
if( fts5ExprSynonymAdvanceto(pTerm, bDesc, &iLast, &rc) ){ |
196041
|
0 |
0 |
if( pIter->iRowid==iLast || pIter->bEof ) continue; |
|
0 |
0 |
if( pIter->iRowid==iLast || pIter->bEof ) continue; |
196043
|
0 |
0 |
if( fts5ExprAdvanceto(pIter, bDesc, &iLast, &rc, &pNode->bEof) ){ |
196049
|
0 |
0 |
}while( bMatch==0 ); |
196052
|
0 |
0 |
pNode->bNomatch = ((0==fts5ExprNearTest(&rc, pExpr, pNode)) && rc==SQLITE_OK); |
|
0 |
0 |
pNode->bNomatch = ((0==fts5ExprNearTest(&rc, pExpr, pNode)) && rc==SQLITE_OK); |
196075
|
0 |
0 |
if( pTerm->pSynonym ){ |
196084
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){ |
196085
|
0 |
0 |
if( sqlite3Fts5IterEof(p->pIter)==0 ){ |
196087
|
0 |
0 |
if( ii==iRowid |
196088
|
0 |
0 |
|| (bFromValid && ii!=iFrom && (ii>iFrom)==pExpr->bDesc) |
|
0 |
0 |
|| (bFromValid && ii!=iFrom && (ii>iFrom)==pExpr->bDesc) |
|
0 |
0 |
|| (bFromValid && ii!=iFrom && (ii>iFrom)==pExpr->bDesc) |
196090
|
0 |
0 |
if( bFromValid ){ |
196095
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
196096
|
0 |
0 |
if( sqlite3Fts5IterEof(p->pIter)==0 ){ |
196107
|
0 |
0 |
pNode->bEof = (rc || bEof); |
|
0 |
0 |
pNode->bEof = (rc || bEof); |
196112
|
0 |
0 |
if( bFromValid ){ |
196118
|
0 |
0 |
pNode->bEof = (rc || sqlite3Fts5IterEof(pIter)); |
|
0 |
0 |
pNode->bEof = (rc || sqlite3Fts5IterEof(pIter)); |
196121
|
0 |
0 |
if( pNode->bEof==0 ){ |
196147
|
0 |
0 |
if( pExpr->pConfig->eDetail==FTS5_DETAIL_FULL ){ |
196168
|
0 |
0 |
if( bFromValid ){ |
196173
|
0 |
0 |
if( rc==SQLITE_OK && sqlite3Fts5IterEof(pIter)==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && sqlite3Fts5IterEof(pIter)==0 ){ |
196189
|
0 |
0 |
for(i=1; inChild; i++){ |
196192
|
0 |
0 |
if( cmp>0 || (cmp==0 && pChild->bNomatch==0) ){ |
|
0 |
0 |
if( cmp>0 || (cmp==0 && pChild->bNomatch==0) ){ |
|
0 |
0 |
if( cmp>0 || (cmp==0 && pChild->bNomatch==0) ){ |
196210
|
0 |
0 |
for(i=0; inChild; i++){ |
196213
|
0 |
0 |
if( p1->bEof==0 ){ |
196214
|
0 |
0 |
if( (p1->iRowid==iLast) |
196215
|
0 |
0 |
|| (bFromValid && fts5RowidCmp(pExpr, p1->iRowid, iFrom)<0) |
|
0 |
0 |
|| (bFromValid && fts5RowidCmp(pExpr, p1->iRowid, iFrom)<0) |
196218
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
196246
|
0 |
0 |
for(iChild=0; iChildnChild; iChild++){ |
196249
|
0 |
0 |
if( cmp>0 ){ |
196252
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
196263
|
0 |
0 |
if( pChild->bEof ){ |
196267
|
0 |
0 |
}else if( iLast!=pChild->iRowid ){ |
196272
|
0 |
0 |
if( pChild->bNomatch ){ |
196276
|
0 |
0 |
}while( bMatch==0 ); |
196278
|
0 |
0 |
if( pAnd->bNomatch && pAnd!=pExpr->pRoot ){ |
|
0 |
0 |
if( pAnd->bNomatch && pAnd!=pExpr->pRoot ){ |
196292
|
0 |
0 |
if( rc==SQLITE_OK ){ |
196309
|
0 |
0 |
while( rc==SQLITE_OK && p1->bEof==0 ){ |
|
0 |
0 |
while( rc==SQLITE_OK && p1->bEof==0 ){ |
196311
|
0 |
0 |
if( cmp>0 ){ |
196316
|
0 |
0 |
if( cmp || p2->bNomatch ) break; |
|
0 |
0 |
if( cmp || p2->bNomatch ) break; |
196322
|
0 |
0 |
if( p1->bEof ){ |
196335
|
0 |
0 |
if( rc==SQLITE_OK ){ |
196338
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
196354
|
0 |
0 |
if( pNode->bEof==0 ){ |
196399
|
0 |
0 |
if( Fts5NodeIsString(pNode) ){ |
|
0 |
0 |
if( Fts5NodeIsString(pNode) ){ |
196402
|
0 |
0 |
}else if( pNode->xNext==0 ){ |
196407
|
0 |
0 |
for(i=0; inChild && rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; inChild && rc==SQLITE_OK; i++){ |
196417
|
0 |
0 |
if( nEof>0 ) fts5ExprSetEof(pNode); |
196421
|
0 |
0 |
if( pNode->nChild==nEof ) fts5ExprSetEof(pNode); |
196431
|
0 |
0 |
if( rc==SQLITE_OK ){ |
196463
|
0 |
0 |
if( rc==SQLITE_OK |
196464
|
0 |
0 |
&& 0==pRoot->bEof |
196465
|
0 |
0 |
&& fts5RowidCmp(p, pRoot->iRowid, iFirst)<0 |
196471
|
0 |
0 |
while( pRoot->bNomatch ){ |
196491
|
0 |
0 |
}while( pRoot->bNomatch ); |
196492
|
0 |
0 |
if( fts5RowidCmp(p, pRoot->iRowid, iLast)>0 ){ |
196516
|
0 |
0 |
if( pPhrase ){ |
196518
|
0 |
0 |
for(i=0; inTerm; i++){ |
196524
|
0 |
0 |
for(pSyn=pTerm->pSynonym; pSyn; pSyn=pNext){ |
196531
|
0 |
0 |
if( pPhrase->poslist.nSpace>0 ) fts5BufferFree(&pPhrase->poslist); |
196541
|
0 |
0 |
if( pPhrase && pPhrase->nTerm ){ |
|
0 |
0 |
if( pPhrase && pPhrase->nTerm ){ |
196562
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){ |
196563
|
0 |
0 |
if( pPhrase==0 ){ |
196566
|
0 |
0 |
if( pNear==0 ){ |
196569
|
0 |
0 |
if( pRet==0 ){ |
196574
|
0 |
0 |
}else if( (pNear->nPhrase % SZALLOC)==0 ){ |
196579
|
0 |
0 |
if( pRet==0 ){ |
196587
|
0 |
0 |
if( pRet==0 ){ |
196592
|
0 |
0 |
if( pRet->nPhrase>0 ){ |
196595
|
0 |
0 |
if( pPhrase->nTerm==0 ){ |
196600
|
0 |
0 |
}else if( pLast->nTerm==0 ){ |
196637
|
0 |
0 |
if( pCtx->rc!=SQLITE_OK ) return pCtx->rc; |
196638
|
0 |
0 |
if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE; |
196640
|
0 |
0 |
if( pPhrase && pPhrase->nTerm>0 && (tflags & FTS5_TOKEN_COLOCATED) ){ |
|
0 |
0 |
if( pPhrase && pPhrase->nTerm>0 && (tflags & FTS5_TOKEN_COLOCATED) ){ |
|
0 |
0 |
if( pPhrase && pPhrase->nTerm>0 && (tflags & FTS5_TOKEN_COLOCATED) ){ |
196644
|
0 |
0 |
if( pSyn==0 ){ |
196655
|
0 |
0 |
if( pPhrase==0 || (pPhrase->nTerm % SZALLOC)==0 ){ |
|
0 |
0 |
if( pPhrase==0 || (pPhrase->nTerm % SZALLOC)==0 ){ |
196657
|
0 |
0 |
int nNew = SZALLOC + (pPhrase ? pPhrase->nTerm : 0); |
196662
|
0 |
0 |
if( pNew==0 ){ |
196665
|
0 |
0 |
if( pPhrase==0 ) memset(pNew, 0, sizeof(Fts5ExprPhrase)); |
196671
|
0 |
0 |
if( rc==SQLITE_OK ){ |
196694
|
0 |
0 |
if( pNear ){ |
196696
|
0 |
0 |
for(i=0; inPhrase; i++){ |
196729
|
0 |
0 |
if( rc==SQLITE_OK ){ |
196730
|
0 |
0 |
int flags = FTS5_TOKENIZE_QUERY | (bPrefix ? FTS5_TOKENIZE_PREFIX : 0); |
196737
|
0 |
0 |
if( rc || (rc = sCtx.rc) ){ |
|
0 |
0 |
if( rc || (rc = sCtx.rc) ){ |
196743
|
0 |
0 |
if( pAppend==0 ){ |
196744
|
0 |
0 |
if( (pParse->nPhrase % 8)==0 ){ |
196748
|
0 |
0 |
if( apNew==0 ){ |
196758
|
0 |
0 |
if( sCtx.pPhrase==0 ){ |
196762
|
0 |
0 |
}else if( sCtx.pPhrase->nTerm ){ |
196787
|
0 |
0 |
if( rc==SQLITE_OK ){ |
196791
|
0 |
0 |
if( rc==SQLITE_OK ){ |
196795
|
0 |
0 |
if( rc==SQLITE_OK ){ |
196799
|
0 |
0 |
if( rc==SQLITE_OK ){ |
196801
|
0 |
0 |
if( pColsetOrig ){ |
196804
|
0 |
0 |
if( pColset ){ |
196811
|
0 |
0 |
if( pOrig->nTerm ){ |
196813
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inTerm; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inTerm; i++){ |
196816
|
0 |
0 |
for(p=&pOrig->aTerm[i]; p && rc==SQLITE_OK; p=p->pSynonym){ |
|
0 |
0 |
for(p=&pOrig->aTerm[i]; p && rc==SQLITE_OK; p=p->pSynonym){ |
196822
|
0 |
0 |
if( rc==SQLITE_OK ){ |
196833
|
0 |
0 |
if( rc==SQLITE_OK ){ |
196843
|
0 |
0 |
if( pOrig->nTerm==1 |
196844
|
0 |
0 |
&& pOrig->aTerm[0].pSynonym==0 |
196845
|
0 |
0 |
&& pOrig->aTerm[0].bFirst==0 |
196870
|
0 |
0 |
if( pTok->n!=4 || memcmp("NEAR", pTok->p, 4) ){ |
|
0 |
0 |
if( pTok->n!=4 || memcmp("NEAR", pTok->p, 4) ){ |
196882
|
0 |
0 |
if( pNear ){ |
196885
|
0 |
0 |
if( p->n ){ |
196886
|
0 |
0 |
for(i=0; in; i++){ |
196888
|
0 |
0 |
if( c<'0' || c>'9' ){ |
|
0 |
0 |
if( c<'0' || c>'9' ){ |
196917
|
0 |
0 |
int nCol = p ? p->nCol : 0; /* Num. columns already in colset object */ |
196924
|
0 |
0 |
if( pNew==0 ){ |
196929
|
0 |
0 |
for(i=0; i
|
196930
|
0 |
0 |
if( aiCol[i]==iCol ) return pNew; |
196931
|
0 |
0 |
if( aiCol[i]>iCol ) break; |
196933
|
0 |
0 |
for(j=nCol; j>i; j--){ |
196960
|
0 |
0 |
if( pRet ){ |
196963
|
0 |
0 |
for(i=0; i
|
196964
|
0 |
0 |
if( iOld>=p->nCol || p->aiCol[iOld]!=i ){ |
|
0 |
0 |
if( iOld>=p->nCol || p->aiCol[iOld]!=i ){ |
196986
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){ |
196989
|
0 |
0 |
for(iCol=0; iColnCol; iCol++){ |
196990
|
0 |
0 |
if( 0==sqlite3_stricmp(pConfig->azCol[iCol], z) ) break; |
196992
|
0 |
0 |
if( iCol==pConfig->nCol ){ |
197000
|
0 |
0 |
if( pRet==0 ){ |
197018
|
0 |
0 |
if( pOrig ){ |
197021
|
0 |
0 |
if( pRet ){ |
197038
|
0 |
0 |
while( iInnCol && iMergenCol ){ |
|
0 |
0 |
while( iInnCol && iMergenCol ){ |
197040
|
0 |
0 |
if( iDiff==0 ){ |
197044
|
0 |
0 |
}else if( iDiff>0 ){ |
197065
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){ |
197070
|
0 |
0 |
if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){ |
|
0 |
0 |
if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){ |
197072
|
0 |
0 |
if( pNear->pColset ){ |
197074
|
0 |
0 |
if( pNear->pColset->nCol==0 ){ |
197078
|
0 |
0 |
}else if( *ppFree ){ |
197087
|
0 |
0 |
for(i=0; inChild; i++){ |
197103
|
0 |
0 |
if( pParse->pConfig->eDetail==FTS5_DETAIL_NONE ){ |
197118
|
0 |
0 |
if( pNear->nPhrase==1 && pNear->apPhrase[0]->nTerm==1 |
|
0 |
0 |
if( pNear->nPhrase==1 && pNear->apPhrase[0]->nTerm==1 |
197119
|
0 |
0 |
&& pNear->apPhrase[0]->aTerm[0].pSynonym==0 |
197120
|
0 |
0 |
&& pNear->apPhrase[0]->aTerm[0].bFirst==0 |
197148
|
0 |
0 |
if( p->eType!=FTS5_NOT && pSub->eType==p->eType ){ |
|
0 |
0 |
if( p->eType!=FTS5_NOT && pSub->eType==p->eType ){ |
197171
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){ |
197178
|
0 |
0 |
if( eType==FTS5_STRING && pNear==0 ) return 0; |
|
0 |
0 |
if( eType==FTS5_STRING && pNear==0 ) return 0; |
197179
|
0 |
0 |
if( eType!=FTS5_STRING && pLeft==0 ) return pRight; |
|
0 |
0 |
if( eType!=FTS5_STRING && pLeft==0 ) return pRight; |
197180
|
0 |
0 |
if( eType!=FTS5_STRING && pRight==0 ) return pLeft; |
|
0 |
0 |
if( eType!=FTS5_STRING && pRight==0 ) return pLeft; |
197182
|
0 |
0 |
if( eType==FTS5_NOT ){ |
197184
|
0 |
0 |
}else if( eType==FTS5_AND || eType==FTS5_OR ){ |
|
0 |
0 |
}else if( eType==FTS5_AND || eType==FTS5_OR ){ |
197186
|
0 |
0 |
if( pLeft->eType==eType ) nChild += pLeft->nChild-1; |
197187
|
0 |
0 |
if( pRight->eType==eType ) nChild += pRight->nChild-1; |
197193
|
0 |
0 |
if( pRet ){ |
197197
|
0 |
0 |
if( eType==FTS5_STRING ){ |
197199
|
0 |
0 |
for(iPhrase=0; iPhrasenPhrase; iPhrase++){ |
197201
|
0 |
0 |
if( pNear->apPhrase[iPhrase]->nTerm==0 ){ |
197207
|
0 |
0 |
if( pParse->pConfig->eDetail!=FTS5_DETAIL_FULL ){ |
197209
|
0 |
0 |
if( pNear->nPhrase!=1 |
197210
|
0 |
0 |
|| pPhrase->nTerm>1 |
197211
|
0 |
0 |
|| (pPhrase->nTerm>0 && pPhrase->aTerm[0].bFirst) |
|
0 |
0 |
|| (pPhrase->nTerm>0 && pPhrase->aTerm[0].bFirst) |
197216
|
0 |
0 |
pParse->zErr = sqlite3_mprintf( |
197231
|
0 |
0 |
if( pRet==0 ){ |
197248
|
0 |
0 |
if( pParse->rc ){ |
197263
|
0 |
0 |
if( pLeft->eType==FTS5_AND ){ |
197273
|
0 |
0 |
if( pRight->eType==FTS5_EOF ){ |
197279
|
0 |
0 |
else if( pPrev->eType==FTS5_EOF ){ |
197282
|
0 |
0 |
if( pPrev==pLeft ){ |
197310
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){ |
197315
|
0 |
0 |
if( zQuoted ){ |
197317
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){ |
197320
|
0 |
0 |
while( *zIn ){ |
197321
|
0 |
0 |
if( *zIn=='"' ) zQuoted[i++] = '"'; |
197325
|
0 |
0 |
if( p->pSynonym ) zQuoted[i++] = '|'; |
197327
|
0 |
0 |
if( pTerm->bPrefix ){ |
197342
|
0 |
0 |
if( zApp && zNew ){ |
|
0 |
0 |
if( zApp && zNew ){ |
197363
|
0 |
0 |
if( pExpr->eType==FTS5_STRING || pExpr->eType==FTS5_TERM ){ |
|
0 |
0 |
if( pExpr->eType==FTS5_STRING || pExpr->eType==FTS5_TERM ){ |
197369
|
0 |
0 |
if( zRet==0 ) return 0; |
197370
|
0 |
0 |
if( pNear->pColset ){ |
197373
|
0 |
0 |
if( nCol==1 ){ |
197377
|
0 |
0 |
for(i=1; ipColset->nCol; i++){ |
197382
|
0 |
0 |
if( zRet==0 ) return 0; |
197385
|
0 |
0 |
if( pNear->nPhrase>1 ){ |
197387
|
0 |
0 |
if( zRet==0 ) return 0; |
197391
|
0 |
0 |
if( zRet==0 ) return 0; |
197393
|
0 |
0 |
for(i=0; inPhrase; i++){ |
197397
|
0 |
0 |
for(iTerm=0; zRet && iTermnTerm; iTerm++){ |
|
0 |
0 |
for(iTerm=0; zRet && iTermnTerm; iTerm++){ |
197399
|
0 |
0 |
zRet = fts5PrintfAppend(zRet, "%s%s", iTerm==0?"":" ", zTerm); |
197400
|
0 |
0 |
if( pPhrase->aTerm[iTerm].bPrefix ){ |
197405
|
0 |
0 |
if( zRet ) zRet = fts5PrintfAppend(zRet, "}"); |
197406
|
0 |
0 |
if( zRet==0 ) return 0; |
197422
|
0 |
0 |
for(i=0; zRet && inChild; i++){ |
|
0 |
0 |
for(i=0; zRet && inChild; i++){ |
197424
|
0 |
0 |
if( !z ){ |
197438
|
0 |
0 |
if( pExpr->eType==0 ){ |
197441
|
0 |
0 |
if( pExpr->eType==FTS5_STRING || pExpr->eType==FTS5_TERM ){ |
|
0 |
0 |
if( pExpr->eType==FTS5_STRING || pExpr->eType==FTS5_TERM ){ |
197446
|
0 |
0 |
if( pNear->pColset ){ |
197449
|
0 |
0 |
if( zRet==0 ) return 0; |
197452
|
0 |
0 |
if( pNear->nPhrase>1 ){ |
197454
|
0 |
0 |
if( zRet==0 ) return 0; |
197457
|
0 |
0 |
for(i=0; inPhrase; i++){ |
197459
|
0 |
0 |
if( i!=0 ){ |
197461
|
0 |
0 |
if( zRet==0 ) return 0; |
197463
|
0 |
0 |
for(iTerm=0; iTermnTerm; iTerm++){ |
197465
|
0 |
0 |
if( zTerm ){ |
197466
|
0 |
0 |
zRet = fts5PrintfAppend(zRet, "%s%s", iTerm==0?"":" + ", zTerm); |
197469
|
0 |
0 |
if( zTerm==0 || zRet==0 ){ |
|
0 |
0 |
if( zTerm==0 || zRet==0 ){ |
197476
|
0 |
0 |
if( pNear->nPhrase>1 ){ |
197478
|
0 |
0 |
if( zRet==0 ) return 0; |
197494
|
0 |
0 |
for(i=0; inChild; i++){ |
197496
|
0 |
0 |
if( z==0 ){ |
197501
|
0 |
0 |
int b = (e!=FTS5_STRING && e!=FTS5_TERM && e!=FTS5_EOF); |
|
0 |
0 |
int b = (e!=FTS5_STRING && e!=FTS5_TERM && e!=FTS5_EOF); |
|
0 |
0 |
int b = (e!=FTS5_STRING && e!=FTS5_TERM && e!=FTS5_EOF); |
197502
|
0 |
0 |
zRet = fts5PrintfAppend(zRet, "%s%s%z%s", |
|
0 |
0 |
zRet = fts5PrintfAppend(zRet, "%s%s%z%s", |
|
0 |
0 |
zRet = fts5PrintfAppend(zRet, "%s%s%z%s", |
197507
|
0 |
0 |
if( zRet==0 ) break; |
197538
|
0 |
0 |
if( nArg<1 ){ |
197539
|
0 |
0 |
zErr = sqlite3_mprintf("wrong number of arguments to function %s", |
197547
|
0 |
0 |
if( bTcl && nArg>1 ){ |
|
0 |
0 |
if( bTcl && nArg>1 ){ |
197554
|
0 |
0 |
if( azConfig==0 ){ |
197561
|
0 |
0 |
for(i=3; iArg
|
197568
|
0 |
0 |
if( rc==SQLITE_OK ){ |
197571
|
0 |
0 |
if( rc==SQLITE_OK ){ |
197573
|
0 |
0 |
if( pExpr->pRoot->xNext==0 ){ |
197575
|
0 |
0 |
}else if( bTcl ){ |
197580
|
0 |
0 |
if( zText==0 ){ |
197588
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
197589
|
0 |
0 |
if( zErr ){ |
197627
|
0 |
0 |
if( nArg!=1 ){ |
197642
|
0 |
0 |
if( nArg!=1 && nArg!=2 ){ |
|
0 |
0 |
if( nArg!=1 && nArg!=2 ){ |
197650
|
0 |
0 |
if( nArg==2 ) bRemoveDiacritics = sqlite3_value_int(apVal[1]); |
197673
|
1310 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
1048 |
262 |
for(i=0; rc==SQLITE_OK && i
|
197690
|
0 |
0 |
return (pExpr ? pExpr->nPhrase : 0); |
197697
|
0 |
0 |
if( iPhrase<0 || iPhrase>=pExpr->nPhrase ) return 0; |
|
0 |
0 |
if( iPhrase<0 || iPhrase>=pExpr->nPhrase ) return 0; |
197709
|
0 |
0 |
if( pNode->bEof==0 && pNode->iRowid==pExpr->pRoot->iRowid ){ |
|
0 |
0 |
if( pNode->bEof==0 && pNode->iRowid==pExpr->pRoot->iRowid ){ |
197728
|
0 |
0 |
if( pRet ){ |
197731
|
0 |
0 |
for(i=0; inPhrase; i++){ |
197735
|
0 |
0 |
if( bLive && |
|
0 |
0 |
if( bLive && |
197736
|
0 |
0 |
(pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof) |
|
0 |
0 |
(pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof) |
197759
|
0 |
0 |
for(i=0; inCol; i++){ |
197760
|
0 |
0 |
if( pColset->aiCol[i]==iCol ) return 1; |
197779
|
0 |
0 |
if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE; |
197780
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ) p->iOff++; |
197781
|
0 |
0 |
for(i=0; inPhrase; i++){ |
197783
|
0 |
0 |
if( p->aPopulator[i].bOk==0 ) continue; |
197784
|
0 |
0 |
for(pTerm=&pExpr->apExprPhrase[i]->aTerm[0]; pTerm; pTerm=pTerm->pSynonym){ |
197786
|
0 |
0 |
if( (nTerm==nToken || (nTermbPrefix)) |
|
0 |
0 |
if( (nTerm==nToken || (nTermbPrefix)) |
|
0 |
0 |
if( (nTerm==nToken || (nTermbPrefix)) |
197787
|
0 |
0 |
&& memcmp(pTerm->zTerm, pToken, nTerm)==0 |
197792
|
0 |
0 |
if( rc ) return rc; |
197813
|
0 |
0 |
for(i=0; inPhrase; i++){ |
197816
|
0 |
0 |
if( (pColset && 0==fts5ExprColsetTest(pColset, iCol)) |
|
0 |
0 |
if( (pColset && 0==fts5ExprColsetTest(pColset, iCol)) |
197817
|
0 |
0 |
|| aPopulator[i].bMiss |
197831
|
0 |
0 |
if( pNode->eType==FTS5_TERM || pNode->eType==FTS5_STRING ){ |
|
0 |
0 |
if( pNode->eType==FTS5_TERM || pNode->eType==FTS5_STRING ){ |
197835
|
0 |
0 |
for(i=0; inChild; i++){ |
197851
|
0 |
0 |
for(i=0; inChild; i++){ |
197852
|
0 |
0 |
if( fts5ExprCheckPoslists(pNode->apChild[i], iRowid)==0 ){ |
197863
|
0 |
0 |
for(i=0; inChild; i++){ |
197864
|
0 |
0 |
if( fts5ExprCheckPoslists(pNode->apChild[i], iRowid) ){ |
197873
|
0 |
0 |
if( 0==fts5ExprCheckPoslists(pNode->apChild[0], iRowid) |
197874
|
0 |
0 |
|| 0!=fts5ExprCheckPoslists(pNode->apChild[1], iRowid) |
197905
|
0 |
0 |
if( pNode->bEof==0 |
197906
|
0 |
0 |
&& pNode->iRowid==pExpr->pRoot->iRowid |
197907
|
0 |
0 |
&& pPhrase->poslist.n>0 |
197910
|
0 |
0 |
if( pTerm->pSynonym ){ |
198017
|
0 |
0 |
if( pNew==0 ){ |
198028
|
0 |
0 |
if( pNew->aSlot==0 ){ |
198043
|
0 |
0 |
if( pHash ){ |
198055
|
0 |
0 |
for(i=0; inSlot; i++){ |
198058
|
0 |
0 |
for(pSlot=pHash->aSlot[i]; pSlot; pSlot=pNext){ |
198070
|
0 |
0 |
for(i=n-1; i>=0; i--){ |
198079
|
0 |
0 |
for(i=n-1; i>=0; i--){ |
198096
|
0 |
0 |
if( !apNew ) return SQLITE_NOMEM; |
198099
|
0 |
0 |
for(i=0; inSlot; i++){ |
198100
|
0 |
0 |
while( apOld[i] ){ |
198118
|
0 |
0 |
if( p->iSzPoslist ){ |
198120
|
0 |
0 |
if( pHash->eDetail==FTS5_DETAIL_NONE ){ |
198122
|
0 |
0 |
if( p->bDel ){ |
198124
|
0 |
0 |
if( p->bContent ){ |
198133
|
0 |
0 |
if( nPos<=127 ){ |
198175
|
0 |
0 |
for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ |
198177
|
0 |
0 |
if( zKey[0]==bByte |
198178
|
0 |
0 |
&& p->nKey==nToken |
198179
|
0 |
0 |
&& memcmp(&zKey[1], pToken, nToken)==0 |
198186
|
0 |
0 |
if( p==0 ){ |
198190
|
0 |
0 |
if( nByte<128 ) nByte = 128; |
198193
|
0 |
0 |
if( (pHash->nEntry*2)>=pHash->nSlot ){ |
198195
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
198201
|
0 |
0 |
if( !p ) return SQLITE_NOMEM; |
198220
|
0 |
0 |
if( pHash->eDetail!=FTS5_DETAIL_NONE ){ |
198222
|
0 |
0 |
p->iCol = (pHash->eDetail==FTS5_DETAIL_FULL ? 0 : -1); |
198238
|
0 |
0 |
if( (p->nAlloc - p->nData) < (9 + 4 + 1 + 3 + 5) ){ |
198243
|
0 |
0 |
if( pNew==0 ) return SQLITE_NOMEM; |
198245
|
0 |
0 |
for(pp=&pHash->aSlot[iHash]; *pp!=p; pp=&(*pp)->pHashNext); |
198257
|
0 |
0 |
if( iRowid!=p->iRowid ){ |
198263
|
0 |
0 |
if( pHash->eDetail!=FTS5_DETAIL_NONE ){ |
198265
|
0 |
0 |
p->iCol = (pHash->eDetail==FTS5_DETAIL_FULL ? 0 : -1); |
198270
|
0 |
0 |
if( iCol>=0 ){ |
198271
|
0 |
0 |
if( pHash->eDetail==FTS5_DETAIL_NONE ){ |
198276
|
0 |
0 |
if( iCol!=p->iCol ){ |
198277
|
0 |
0 |
if( pHash->eDetail==FTS5_DETAIL_FULL ){ |
198289
|
0 |
0 |
if( bNew ){ |
198319
|
0 |
0 |
while( p1 || p2 ){ |
|
0 |
0 |
while( p1 || p2 ){ |
198320
|
0 |
0 |
if( p1==0 ){ |
198323
|
0 |
0 |
}else if( p2==0 ){ |
198330
|
0 |
0 |
while( zKey1[i]==zKey2[i] ) i++; |
198332
|
0 |
0 |
if( ((u8)zKey1[i])>((u8)zKey2[i]) ){ |
198369
|
0 |
0 |
if( !ap ) return SQLITE_NOMEM; |
198372
|
0 |
0 |
for(iSlot=0; iSlotnSlot; iSlot++){ |
198374
|
0 |
0 |
for(pIter=pHash->aSlot[iSlot]; pIter; pIter=pIter->pHashNext){ |
198375
|
0 |
0 |
if( pTerm==0 || 0==memcmp(fts5EntryKey(pIter), pTerm, nTerm) ){ |
|
0 |
0 |
if( pTerm==0 || 0==memcmp(fts5EntryKey(pIter), pTerm, nTerm) ){ |
198378
|
0 |
0 |
for(i=0; ap[i]; i++){ |
198388
|
0 |
0 |
for(i=0; i
|
198411
|
0 |
0 |
for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ |
198413
|
0 |
0 |
if( memcmp(zKey, pTerm, nTerm)==0 && zKey[nTerm]==0 ) break; |
|
0 |
0 |
if( memcmp(zKey, pTerm, nTerm)==0 && zKey[nTerm]==0 ) break; |
198416
|
0 |
0 |
if( p ){ |
198451
|
0 |
0 |
if( (p = pHash->pScan) ){ |
199076
|
0 |
0 |
return (res==0 ? (pLeft->n - pRight->n) : res); |
199089
|
0 |
0 |
if( p->pReader ){ |
199104
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
199107
|
0 |
0 |
if( p->pReader ){ |
199116
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
199119
|
0 |
0 |
if( rc==SQLITE_ABORT ) rc = SQLITE_OK; |
199124
|
0 |
0 |
if( p->pReader==0 && rc==SQLITE_OK ){ |
|
0 |
0 |
if( p->pReader==0 && rc==SQLITE_OK ){ |
199136
|
0 |
0 |
if( rc==SQLITE_ERROR ) rc = FTS5_CORRUPT; |
199138
|
0 |
0 |
if( rc==SQLITE_OK ){ |
199143
|
0 |
0 |
if( pRet ){ |
199150
|
0 |
0 |
if( rc==SQLITE_OK ){ |
199153
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
199179
|
0 |
0 |
if( pRet ){ |
199180
|
0 |
0 |
if( pRet->szLeaf>pRet->nn ){ |
199194
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
199195
|
0 |
0 |
if( zSql ){ |
199211
|
0 |
0 |
if( p->rc!=SQLITE_OK ) return; |
199213
|
0 |
0 |
if( p->pWriter==0 ){ |
199219
|
0 |
0 |
if( p->rc ) return; |
199235
|
0 |
0 |
if( p->rc!=SQLITE_OK ) return; |
199237
|
0 |
0 |
if( p->pDeleter==0 ){ |
199244
|
0 |
0 |
if( zSql==0 ){ |
199251
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
199270
|
0 |
0 |
if( p->pIdxDeleter==0 ){ |
199277
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
199289
|
0 |
0 |
if( pStruct && 0>=(--pStruct->nRef) ){ |
|
0 |
0 |
if( pStruct && 0>=(--pStruct->nRef) ){ |
199292
|
0 |
0 |
for(i=0; inLevel; i++){ |
199330
|
0 |
0 |
if( piCookie ) *piCookie = sqlite3Fts5Get32(pData); |
199343
|
0 |
0 |
if( pRet ){ |
199349
|
0 |
0 |
for(iLvl=0; rc==SQLITE_OK && iLvl
|
|
0 |
0 |
for(iLvl=0; rc==SQLITE_OK && iLvl
|
199354
|
0 |
0 |
if( i>=nData ){ |
199365
|
0 |
0 |
if( rc==SQLITE_OK ){ |
199367
|
0 |
0 |
for(iSeg=0; iSeg
|
199368
|
0 |
0 |
if( i>=nData ){ |
199378
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
199392
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
199401
|
0 |
0 |
if( pStruct ){ |
199422
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
199429
|
0 |
0 |
if( aNew ){ |
199430
|
0 |
0 |
if( bInsert==0 ){ |
199451
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
199455
|
0 |
0 |
if( p->rc==SQLITE_OK && pConfig->iCookie!=iCookie ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && pConfig->iCookie!=iCookie ){ |
199459
|
0 |
0 |
if( p->rc!=SQLITE_OK ){ |
199471
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
199472
|
0 |
0 |
if( p->pDataVersion==0 ){ |
199476
|
0 |
0 |
if( p->rc ) return 0; |
199479
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(p->pDataVersion) ){ |
199501
|
0 |
0 |
if( p->pStruct==0 ){ |
199503
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
199531
|
0 |
0 |
if( p->rc!=SQLITE_OK ) return 0; |
199539
|
0 |
0 |
if( p->pStruct ){ |
199582
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
199592
|
0 |
0 |
if( iCookie<0 ) iCookie = 0; |
199594
|
0 |
0 |
if( 0==sqlite3Fts5BufferSize(&p->rc, &buf, 4+9+9+9) ){ |
199602
|
0 |
0 |
for(iLvl=0; iLvlnLevel; iLvl++){ |
199609
|
0 |
0 |
for(iSeg=0; iSegnSeg; iSeg++){ |
199654
|
0 |
0 |
if( pOut->nMerge==0 ){ |
199655
|
0 |
0 |
for(il=iPromote+1; ilnLevel; il++){ |
199657
|
0 |
0 |
if( pLvl->nMerge ) return; |
199658
|
0 |
0 |
for(is=pLvl->nSeg-1; is>=0; is--){ |
199660
|
0 |
0 |
if( sz>szPromote ) return; |
199662
|
0 |
0 |
if( p->rc ) return; |
199693
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
199701
|
0 |
0 |
if( nSeg==0 ) return; |
199706
|
0 |
0 |
for(iTst=iLvl-1; iTst>=0 && pStruct->aLevel[iTst].nSeg==0; iTst--); |
|
0 |
0 |
for(iTst=iLvl-1; iTst>=0 && pStruct->aLevel[iTst].nSeg==0; iTst--); |
199707
|
0 |
0 |
if( iTst>=0 ){ |
199712
|
0 |
0 |
for(i=0; inSeg; i++){ |
199714
|
0 |
0 |
if( sz>szMax ) szMax = sz; |
199716
|
0 |
0 |
if( szMax>=szSeg ){ |
199726
|
0 |
0 |
if( iPromote<0 ){ |
199742
|
0 |
0 |
if( pLvl->iOff==0 ){ |
199750
|
0 |
0 |
for(iOff=pLvl->iOff; iOffnn; iOff++){ |
199751
|
0 |
0 |
if( pData->p[iOff] ) break; |
199754
|
0 |
0 |
if( iOffnn ){ |
199775
|
0 |
0 |
if( fts5DlidxLvlNext(pLvl) ){ |
199776
|
0 |
0 |
if( (iLvl+1) < pIter->nLvl ){ |
199778
|
0 |
0 |
if( pLvl[1].bEof==0 ){ |
199784
|
0 |
0 |
if( pLvl->pData ) fts5DlidxLvlNext(pLvl); |
199808
|
0 |
0 |
for(i=0; inLvl; i++){ |
199816
|
0 |
0 |
return p->rc!=SQLITE_OK || pIter->aLvl[0].bEof; |
|
0 |
0 |
return p->rc!=SQLITE_OK || pIter->aLvl[0].bEof; |
199823
|
0 |
0 |
for(i=pIter->nLvl-1; p->rc==SQLITE_OK && i>=0; i--){ |
|
0 |
0 |
for(i=pIter->nLvl-1; p->rc==SQLITE_OK && i>=0; i--){ |
199825
|
0 |
0 |
while( fts5DlidxLvlNext(pLvl)==0 ); |
199828
|
0 |
0 |
if( i>0 ){ |
199846
|
0 |
0 |
if( iOff<=pLvl->iFirstOff ){ |
199859
|
0 |
0 |
iLimit = (iOff>9 ? iOff-9 : 0); |
199860
|
0 |
0 |
for(iOff--; iOff>iLimit; iOff--){ |
199861
|
0 |
0 |
if( (a[iOff-1] & 0x80)==0 ) break; |
199869
|
0 |
0 |
for(ii=iOff-1; ii>=pLvl->iFirstOff && a[ii]==0x00; ii--){ |
|
0 |
0 |
for(ii=iOff-1; ii>=pLvl->iFirstOff && a[ii]==0x00; ii--){ |
199872
|
0 |
0 |
if( ii>=pLvl->iFirstOff && (a[ii] & 0x80) ){ |
|
0 |
0 |
if( ii>=pLvl->iFirstOff && (a[ii] & 0x80) ){ |
199877
|
0 |
0 |
if( (ii-8)>=pLvl->iFirstOff ){ |
199879
|
0 |
0 |
for(j=1; j<=8 && (a[ii-j] & 0x80); j++); |
|
0 |
0 |
for(j=1; j<=8 && (a[ii-j] & 0x80); j++); |
199882
|
0 |
0 |
if( bZero==0 ) nZero--; |
199895
|
0 |
0 |
if( fts5DlidxLvlPrev(pLvl) ){ |
199896
|
0 |
0 |
if( (iLvl+1) < pIter->nLvl ){ |
199898
|
0 |
0 |
if( pLvl[1].bEof==0 ){ |
199904
|
0 |
0 |
if( pLvl->pData ){ |
199905
|
0 |
0 |
while( fts5DlidxLvlNext(pLvl)==0 ); |
199922
|
0 |
0 |
if( pIter ){ |
199924
|
0 |
0 |
for(i=0; inLvl; i++){ |
199941
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){ |
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){ |
199946
|
0 |
0 |
if( pNew==0 ){ |
199954
|
0 |
0 |
if( pLvl->pData && (pLvl->pData->p[0] & 0x0001)==0 ){ |
|
0 |
0 |
if( pLvl->pData && (pLvl->pData->p[0] & 0x0001)==0 ){ |
199961
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
199963
|
0 |
0 |
if( bRev==0 ){ |
199970
|
0 |
0 |
if( p->rc!=SQLITE_OK ){ |
199996
|
0 |
0 |
if( pIter->pNextLeaf ){ |
199999
|
0 |
0 |
}else if( pIter->iLeafPgno<=pSeg->pgnoLast ){ |
200008
|
0 |
0 |
if( pLeaf ){ |
200010
|
0 |
0 |
if( fts5LeafIsTermless(pLeaf) ){ |
200029
|
0 |
0 |
fts5FastGetVarint32(p, n, nSz); |
200048
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
200051
|
0 |
0 |
if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){ |
200055
|
0 |
0 |
if( iOffpLeaf->p[iOff]==0 ){ |
|
0 |
0 |
if( iOffpLeaf->p[iOff]==0 ){ |
200058
|
0 |
0 |
if( iOffpLeaf->p[iOff]==0 ){ |
|
0 |
0 |
if( iOffpLeaf->p[iOff]==0 ){ |
200067
|
0 |
0 |
fts5FastGetVarint32(pIter->pLeaf->p, iOff, nSz); |
200081
|
0 |
0 |
if( iOff>=pIter->pLeaf->szLeaf ){ |
200083
|
0 |
0 |
if( pIter->pLeaf==0 ){ |
200084
|
0 |
0 |
if( p->rc==SQLITE_OK ) p->rc = FTS5_CORRUPT; |
200115
|
0 |
0 |
if( iOff+nNew>pIter->pLeaf->nn ){ |
200126
|
0 |
0 |
if( pIter->iPgidxOff>=pIter->pLeaf->nn ){ |
200142
|
0 |
0 |
if( pIter->flags & FTS5_SEGITER_REVERSE ){ |
200144
|
0 |
0 |
}else if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){ |
200164
|
0 |
0 |
if( pSeg->pgnoFirst==0 ){ |
200174
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
200182
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
200214
|
0 |
0 |
if( n>pIter->iEndofDoclist ){ |
200222
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ){ |
200224
|
0 |
0 |
if( i
|
|
0 |
0 |
if( i
|
200226
|
0 |
0 |
if( i
|
|
0 |
0 |
if( i
|
200234
|
0 |
0 |
if( i>=n ) break; |
200239
|
0 |
0 |
if( iRowidOffset>=pIter->nRowidOffset ){ |
200242
|
0 |
0 |
if( aNew==0 ){ |
200266
|
0 |
0 |
while( p->rc==SQLITE_OK && pIter->iLeafPgno>pIter->iTermLeafPgno ){ |
|
0 |
0 |
while( p->rc==SQLITE_OK && pIter->iLeafPgno>pIter->iTermLeafPgno ){ |
200272
|
0 |
0 |
if( pNew ){ |
200276
|
0 |
0 |
if( pIter->iLeafPgno==pIter->iTermLeafPgno ){ |
200278
|
0 |
0 |
if( pIter->iTermLeafOffsetszLeaf ){ |
200285
|
0 |
0 |
if( iRowidOff ){ |
200291
|
0 |
0 |
if( pIter->pLeaf ){ |
200301
|
0 |
0 |
if( pIter->pLeaf ){ |
200314
|
0 |
0 |
return (p->rc==SQLITE_OK && pSeg->pLeaf && pSeg->nPos==0); |
|
0 |
0 |
return (p->rc==SQLITE_OK && pSeg->pLeaf && pSeg->nPos==0); |
|
0 |
0 |
return (p->rc==SQLITE_OK && pSeg->pLeaf && pSeg->nPos==0); |
200331
|
0 |
0 |
if( pIter->iRowidOffset>0 ){ |
200340
|
0 |
0 |
if( p->pConfig->eDetail!=FTS5_DETAIL_NONE ){ |
200371
|
0 |
0 |
if( pIter->pSeg && iOff>=pIter->pLeaf->szLeaf ){ |
|
0 |
0 |
if( pIter->pSeg && iOff>=pIter->pLeaf->szLeaf ){ |
200373
|
0 |
0 |
if( p->rc || pIter->pLeaf==0 ) return; |
|
0 |
0 |
if( p->rc || pIter->pLeaf==0 ) return; |
200378
|
0 |
0 |
if( iOffiEndofDoclist ){ |
200384
|
0 |
0 |
}else if( (pIter->flags & FTS5_SEGITER_ONETERM)==0 ){ |
200385
|
0 |
0 |
if( pIter->pSeg ){ |
200387
|
0 |
0 |
if( iOff!=fts5LeafFirstTermOff(pIter->pLeaf) ){ |
200398
|
0 |
0 |
if( pList==0 ) goto next_none_eof; |
200407
|
0 |
0 |
if( pbNewTerm ) *pbNewTerm = 1; |
200450
|
0 |
0 |
if( iOff
|
200453
|
0 |
0 |
if( iOff>=pIter->iEndofDoclist ){ |
200455
|
0 |
0 |
if( iOff!=fts5LeafFirstTermOff(pLeaf) ){ |
200466
|
0 |
0 |
}else if( pIter->pSeg==0 ){ |
200471
|
0 |
0 |
if( 0==(pIter->flags & FTS5_SEGITER_ONETERM) ){ |
200475
|
0 |
0 |
if( pList==0 ){ |
200491
|
0 |
0 |
while( iOff==0 ){ |
200494
|
0 |
0 |
if( pLeaf==0 ) break; |
200496
|
0 |
0 |
if( (iOff = fts5LeafFirstRowidOff(pLeaf)) && iOffszLeaf ){ |
|
0 |
0 |
if( (iOff = fts5LeafFirstRowidOff(pLeaf)) && iOffszLeaf ){ |
200500
|
0 |
0 |
if( pLeaf->nn>pLeaf->szLeaf ){ |
200506
|
0 |
0 |
else if( pLeaf->nn>pLeaf->szLeaf ){ |
200515
|
0 |
0 |
if( iOff>pLeaf->szLeaf ){ |
200523
|
0 |
0 |
if( pIter->pLeaf ){ |
200524
|
0 |
0 |
if( bNewTerm ){ |
200525
|
0 |
0 |
if( pIter->flags & FTS5_SEGITER_ONETERM ){ |
200531
|
0 |
0 |
if( pbNewTerm ) *pbNewTerm = 1; |
200544
|
0 |
0 |
fts5FastGetVarint32(pIter->pLeaf->p, pIter->iLeafOffset, nSz); |
200569
|
0 |
0 |
if( pDlidx ){ |
200580
|
0 |
0 |
if( pIter->iTermLeafPgno==pIter->iLeafPgno ){ |
200585
|
0 |
0 |
fts5IndexSkipVarint(pLeaf->p, iPoslist); |
|
0 |
0 |
fts5IndexSkipVarint(pLeaf->p, iPoslist); |
200591
|
0 |
0 |
if( pIter->iEndofDoclist>=pLeaf->szLeaf ){ |
200597
|
0 |
0 |
for(pgno=pIter->iLeafPgno+1; !p->rc && pgno<=pSeg->pgnoLast; pgno++){ |
|
0 |
0 |
for(pgno=pIter->iLeafPgno+1; !p->rc && pgno<=pSeg->pgnoLast; pgno++){ |
200600
|
0 |
0 |
if( pNew ){ |
200604
|
0 |
0 |
if( iRowid ){ |
200609
|
0 |
0 |
if( bTermless==0 ) break; |
200624
|
0 |
0 |
if( pLast ){ |
200633
|
0 |
0 |
if( fts5LeafIsTermless(pLast) ){ |
200661
|
0 |
0 |
if( pIter->iTermLeafPgno==pIter->iLeafPgno |
200662
|
0 |
0 |
&& pIter->iEndofDoclistszLeaf |
200707
|
0 |
0 |
if( iOff>n ){ |
200715
|
0 |
0 |
fts5FastGetVarint32(a, iOff, nNew); |
200716
|
0 |
0 |
if( nKeep
|
200721
|
0 |
0 |
if( nKeep==nMatch ){ |
200725
|
0 |
0 |
for(i=0; i
|
200726
|
0 |
0 |
if( a[iOff+i]!=pTerm[nMatch+i] ) break; |
200730
|
0 |
0 |
if( nTerm==nMatch ){ |
200731
|
0 |
0 |
if( i==nNew ){ |
200736
|
0 |
0 |
}else if( ipTerm[nMatch] ){ |
|
0 |
0 |
}else if( ipTerm[nMatch] ){ |
200741
|
0 |
0 |
if( iPgidx>=n ){ |
200750
|
0 |
0 |
if( iOff>=n ){ |
200756
|
0 |
0 |
fts5FastGetVarint32(a, iOff, nKeep); |
200760
|
0 |
0 |
if( bGe==0 ){ |
200764
|
0 |
0 |
}else if( bEndOfPage ){ |
200767
|
0 |
0 |
if( pIter->pLeaf==0 ) return; |
200769
|
0 |
0 |
if( fts5LeafIsTermless(pIter->pLeaf)==0 ){ |
200772
|
0 |
0 |
if( iOff<4 || iOff>=pIter->pLeaf->szLeaf ){ |
|
0 |
0 |
if( iOff<4 || iOff>=pIter->pLeaf->szLeaf ){ |
200794
|
0 |
0 |
if( iPgidx>=n ){ |
200808
|
0 |
0 |
if( p->pIdxSelect==0 ){ |
200846
|
0 |
0 |
if( p->rc ) return; |
200849
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pIdxSelect) ){ |
200857
|
0 |
0 |
if( iPgpgnoFirst ){ |
200865
|
0 |
0 |
if( pIter->pLeaf ){ |
200869
|
0 |
0 |
if( p->rc==SQLITE_OK && bGe==0 ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && bGe==0 ){ |
200871
|
0 |
0 |
if( pIter->pLeaf ){ |
200872
|
0 |
0 |
if( flags & FTS5INDEX_QUERY_DESC ){ |
200875
|
0 |
0 |
if( bDlidx ){ |
200878
|
0 |
0 |
if( flags & FTS5INDEX_QUERY_DESC ){ |
200923
|
0 |
0 |
if( pTerm==0 || (flags & FTS5INDEX_QUERY_SCAN) ){ |
|
0 |
0 |
if( pTerm==0 || (flags & FTS5INDEX_QUERY_SCAN) ){ |
200926
|
0 |
0 |
n = (z ? (int)strlen((const char*)z) : 0); |
200934
|
0 |
0 |
if( pList ){ |
200938
|
0 |
0 |
if( pLeaf==0 ) return; |
200945
|
0 |
0 |
if( flags & FTS5INDEX_QUERY_DESC ){ |
201074
|
0 |
0 |
if( iOut>=(pIter->nSeg/2) ){ |
201085
|
0 |
0 |
if( p1->pLeaf==0 ){ /* If p1 is at EOF */ |
201087
|
0 |
0 |
}else if( p2->pLeaf==0 ){ /* If p2 is at EOF */ |
201091
|
0 |
0 |
if( res==0 ){ |
201095
|
0 |
0 |
if( p1->iRowid==p2->iRowid ){ |
201099
|
0 |
0 |
res = ((p1->iRowid > p2->iRowid)==pIter->bRev) ? -1 : +1; |
201102
|
0 |
0 |
if( res<0 ){ |
201124
|
0 |
0 |
if( iLeafPgno>pIter->pSeg->pgnoLast ){ |
201133
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
201139
|
0 |
0 |
if( iOff<4 || iOff>=n ){ |
|
0 |
0 |
if( iOff<4 || iOff>=n ){ |
201169
|
0 |
0 |
if( bRev==0 ){ |
201170
|
0 |
0 |
while( !fts5DlidxIterEof(p, pDlidx) && iMatch>fts5DlidxIterRowid(pDlidx) ){ |
|
0 |
0 |
while( !fts5DlidxIterEof(p, pDlidx) && iMatch>fts5DlidxIterRowid(pDlidx) ){ |
201175
|
0 |
0 |
if( iLeafPgno>pIter->iLeafPgno ){ |
201182
|
0 |
0 |
while( !fts5DlidxIterEof(p, pDlidx) && iMatch
|
|
0 |
0 |
while( !fts5DlidxIterEof(p, pDlidx) && iMatch
|
201189
|
0 |
0 |
if( iLeafPgnoiLeafPgno ){ |
201197
|
0 |
0 |
if( bMove && p->rc==SQLITE_OK ) pIter->xNext(p, pIter, 0); |
|
0 |
0 |
if( bMove && p->rc==SQLITE_OK ) pIter->xNext(p, pIter, 0); |
201198
|
0 |
0 |
if( pIter->pLeaf==0 ) break; |
201199
|
0 |
0 |
if( bRev==0 && pIter->iRowid>=iMatch ) break; |
|
0 |
0 |
if( bRev==0 && pIter->iRowid>=iMatch ) break; |
201200
|
0 |
0 |
if( bRev!=0 && pIter->iRowid<=iMatch ) break; |
|
0 |
0 |
if( bRev!=0 && pIter->iRowid<=iMatch ) break; |
201202
|
0 |
0 |
}while( p->rc==SQLITE_OK ); |
201210
|
0 |
0 |
if( pIter ){ |
201212
|
0 |
0 |
for(i=0; inSeg; i++){ |
201228
|
0 |
0 |
for(i=(pIter->nSeg+iChanged)/2; i>=iMinset && p->rc==SQLITE_OK; i=i/2){ |
|
0 |
0 |
for(i=(pIter->nSeg+iChanged)/2; i>=iMinset && p->rc==SQLITE_OK; i=i/2){ |
201230
|
0 |
0 |
if( (iEq = fts5MultiIterDoCompare(pIter, i)) ){ |
201256
|
0 |
0 |
if( pNew->iRowid==pIter->iSwitchRowid |
201257
|
0 |
0 |
|| (pNew->iRowidiSwitchRowid)==pIter->bRev |
201261
|
0 |
0 |
pIter->iSwitchRowid = pIter->bRev ? SMALLEST_INT64 : LARGEST_INT64; |
201268
|
0 |
0 |
if( pRes->bTermEq ){ |
201269
|
0 |
0 |
if( pNew->iRowid==pOther->iRowid ){ |
201271
|
0 |
0 |
}else if( (pOther->iRowid>pNew->iRowid)==pIter->bRev ){ |
201274
|
0 |
0 |
}else if( (pOther->iRowid>pIter->iSwitchRowid)==pIter->bRev ){ |
201279
|
0 |
0 |
if( i==1 ) break; |
201313
|
0 |
0 |
while( p->rc==SQLITE_OK ){ |
201318
|
0 |
0 |
if( bUseFrom && pSeg->pDlidx ){ |
|
0 |
0 |
if( bUseFrom && pSeg->pDlidx ){ |
201324
|
0 |
0 |
if( pSeg->pLeaf==0 || bNewTerm |
|
0 |
0 |
if( pSeg->pLeaf==0 || bNewTerm |
201325
|
0 |
0 |
|| fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg) |
201330
|
0 |
0 |
if( pSeg->pLeaf==0 ) return; |
201335
|
0 |
0 |
if( pIter->bSkipEmpty==0 || pSeg->nPos ){ |
|
0 |
0 |
if( pIter->bSkipEmpty==0 || pSeg->nPos ){ |
201349
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
201358
|
0 |
0 |
if( pSeg->pLeaf==0 || bNewTerm |
|
0 |
0 |
if( pSeg->pLeaf==0 || bNewTerm |
201359
|
0 |
0 |
|| fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg) |
201367
|
0 |
0 |
}while( fts5MultiIterIsEmpty(p, pIter) ); |
201382
|
0 |
0 |
for(nSlot=2; nSlot
|
201388
|
0 |
0 |
if( pNew ){ |
201404
|
0 |
0 |
if( nChunk>0 ){ |
201429
|
0 |
0 |
for(i=0; inCol; i++){ |
201430
|
0 |
0 |
if( pColset->aiCol[i]==iCol ) return 1; |
201443
|
0 |
0 |
if( nChunk>0 ){ |
201445
|
0 |
0 |
while( i
|
201450
|
0 |
0 |
if( fts5IndexColsetTest(pCtx->pColset, iVal) ){ |
201466
|
0 |
0 |
if( nChunk>0 ){ |
201472
|
0 |
0 |
if( pCtx->eState==2 ){ |
201474
|
0 |
0 |
fts5FastGetVarint32(pChunk, i, iCol); |
201475
|
0 |
0 |
if( fts5IndexColsetTest(pCtx->pColset, iCol) ){ |
201484
|
0 |
0 |
while( i
|
|
0 |
0 |
while( i
|
201485
|
0 |
0 |
while( pChunk[i] & 0x80 ) i++; |
201488
|
0 |
0 |
if( pCtx->eState ){ |
201491
|
0 |
0 |
if( i
|
201495
|
0 |
0 |
if( i>=nChunk ){ |
201498
|
0 |
0 |
fts5FastGetVarint32(pChunk, i, iCol); |
201500
|
0 |
0 |
if( pCtx->eState ){ |
201506
|
0 |
0 |
}while( i
|
201526
|
0 |
0 |
if( (pSeg->flags & FTS5_SEGITER_REVERSE)==0 ){ |
201534
|
0 |
0 |
if( nRem<=0 ){ |
201539
|
0 |
0 |
if( pData==0 ) break; |
201542
|
0 |
0 |
if( pgno==pgnoSave ){ |
201563
|
0 |
0 |
if( 0==fts5BufferGrow(&p->rc, pBuf, pSeg->nPos) ){ |
|
0 |
0 |
if( 0==fts5BufferGrow(&p->rc, pBuf, pSeg->nPos) ){ |
201564
|
0 |
0 |
if( pColset==0 ){ |
201567
|
0 |
0 |
if( p->pConfig->eDetail==FTS5_DETAIL_FULL ){ |
201601
|
0 |
0 |
while( iCol>iCurrent ){ |
201607
|
0 |
0 |
while( *p!=0x01 ){ |
201608
|
0 |
0 |
while( *p++ & 0x80 ); |
201609
|
0 |
0 |
if( p>=pEnd ) return 0; |
201613
|
0 |
0 |
if( iCurrent & 0x80 ){ |
201618
|
0 |
0 |
if( iCol!=iCurrent ) return 0; |
201622
|
0 |
0 |
while( p
|
|
0 |
0 |
while( p
|
201623
|
0 |
0 |
while( *p++ & 0x80 ); |
201635
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
201638
|
0 |
0 |
for(i=0; inCol; i++){ |
201641
|
0 |
0 |
if( nSub ){ |
201668
|
0 |
0 |
if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){ |
201719
|
0 |
0 |
if( pSeg->iLeafOffset+pSeg->nPos>pSeg->pLeaf->szLeaf ){ |
201733
|
0 |
0 |
while( a
|
201735
|
0 |
0 |
while( *aiCol
|
201737
|
0 |
0 |
if( aiCol==aiColEnd ) goto setoutputs_col_out; |
201739
|
0 |
0 |
if( *aiCol==iPrev ){ |
201761
|
0 |
0 |
if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){ |
201765
|
0 |
0 |
if( pColset->nCol==1 ){ |
201787
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
201789
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_NONE ){ |
201793
|
0 |
0 |
else if( pIter->pColset==0 ){ |
201797
|
0 |
0 |
else if( pIter->pColset->nCol==0 ){ |
201801
|
0 |
0 |
else if( pConfig->eDetail==FTS5_DETAIL_FULL ){ |
201807
|
0 |
0 |
if( pConfig->nCol<=100 ){ |
201848
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
201849
|
0 |
0 |
if( iLevel<0 ){ |
201858
|
0 |
0 |
if( pNew==0 ) return; |
201864
|
0 |
0 |
if( (flags & FTS5INDEX_QUERY_NOOUTPUT)==0 ){ |
201869
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
201870
|
0 |
0 |
if( iLevel<0 ){ |
201872
|
0 |
0 |
if( p->pHash ){ |
201877
|
0 |
0 |
for(pLvl=&pStruct->aLevel[0]; pLvl
|
201878
|
0 |
0 |
for(iSeg=pLvl->nSeg-1; iSeg>=0; iSeg--){ |
201881
|
0 |
0 |
if( pTerm==0 ){ |
201890
|
0 |
0 |
for(iSeg=nSeg-1; iSeg>=0; iSeg--){ |
201901
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
201902
|
0 |
0 |
for(iIter=pNew->nSeg-1; iIter>0; iIter--){ |
201904
|
0 |
0 |
if( (iEq = fts5MultiIterDoCompare(pNew, iIter)) ){ |
201906
|
0 |
0 |
if( p->rc==SQLITE_OK ) pSeg->xNext(p, pSeg, 0); |
201913
|
0 |
0 |
if( pNew->bSkipEmpty && fts5MultiIterIsEmpty(p, pNew) ){ |
|
0 |
0 |
if( pNew->bSkipEmpty && fts5MultiIterIsEmpty(p, pNew) ){ |
201915
|
0 |
0 |
}else if( pNew->base.bEof==0 ){ |
201938
|
0 |
0 |
if( pNew ){ |
201942
|
0 |
0 |
if( pData->szLeaf>0 ){ |
201947
|
0 |
0 |
if( bDesc ){ |
201974
|
0 |
0 |
return (p->rc || pIter->base.bEof); |
|
0 |
0 |
return (p->rc || pIter->base.bEof); |
201998
|
0 |
0 |
if( fts5MultiIterEof(p, pIter) ) break; |
202000
|
0 |
0 |
if( pIter->bRev==0 && iRowid>=iMatch ) break; |
|
0 |
0 |
if( pIter->bRev==0 && iRowid>=iMatch ) break; |
202001
|
0 |
0 |
if( pIter->bRev!=0 && iRowid<=iMatch ) break; |
|
0 |
0 |
if( pIter->bRev!=0 && iRowid<=iMatch ) break; |
202027
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
202028
|
0 |
0 |
if( pStruct->nSegment>=FTS5_MAX_SEGMENT ){ |
202038
|
0 |
0 |
for(iLvl=0; iLvlnLevel; iLvl++){ |
202039
|
0 |
0 |
for(iSeg=0; iSegaLevel[iLvl].nSeg; iSeg++){ |
202041
|
0 |
0 |
if( iId<=FTS5_MAX_SEGMENT ){ |
202047
|
0 |
0 |
for(i=0; aUsed[i]==0xFFFFFFFF; i++); |
202049
|
0 |
0 |
for(iSegid=0; mask & (1 << iSegid); iSegid++); |
202083
|
0 |
0 |
if( p->pHash ){ |
202098
|
0 |
0 |
for(i=0; i
|
202099
|
0 |
0 |
if( pOld[i]!=pNew[i] ) break; |
202111
|
0 |
0 |
for(i=0; inDlidx; i++){ |
202113
|
0 |
0 |
if( pDlidx->buf.n==0 ) break; |
202114
|
0 |
0 |
if( bFlush ){ |
202135
|
0 |
0 |
if( p->rc==SQLITE_OK && nLvl>=pWriter->nDlidx ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && nLvl>=pWriter->nDlidx ){ |
202139
|
0 |
0 |
if( aDlidx==0 ){ |
202161
|
0 |
0 |
if( pWriter->aDlidx[0].buf.n>0 && pWriter->nEmpty>=FTS5_MIN_DLIDX_SIZE ){ |
|
0 |
0 |
if( pWriter->aDlidx[0].buf.n>0 && pWriter->nEmpty>=FTS5_MIN_DLIDX_SIZE ){ |
202184
|
0 |
0 |
if( pWriter->iBtPage==0 ) return; |
202187
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
202188
|
0 |
0 |
const char *z = (pWriter->btterm.n>0?(const char*)pWriter->btterm.p:""); |
202229
|
0 |
0 |
if( pWriter->bFirstRowidInPage && pWriter->aDlidx[0].buf.n>0 ){ |
|
0 |
0 |
if( pWriter->bFirstRowidInPage && pWriter->aDlidx[0].buf.n>0 ){ |
202261
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){ |
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){ |
202265
|
0 |
0 |
if( pDlidx->buf.n>=p->pConfig->pgsz ){ |
202278
|
0 |
0 |
if( p->rc==SQLITE_OK && pDlidx[1].buf.n==0 ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && pDlidx[1].buf.n==0 ){ |
202297
|
0 |
0 |
if( pDlidx->bPrevValid ){ |
202300
|
0 |
0 |
i64 iPgno = (i==0 ? pWriter->writer.pgno : pDlidx[-1].pgno); |
202324
|
0 |
0 |
if( pWriter->bFirstTermInPage ){ |
202373
|
0 |
0 |
if( (pPage->buf.n + pPgidx->n + nTerm + 2)>=p->pConfig->pgsz ){ |
202374
|
0 |
0 |
if( pPage->buf.n>4 ){ |
202377
|
0 |
0 |
fts5BufferGrow(&p->rc, &pPage->buf, nTerm+FTS5_DATA_PADDING); |
202390
|
0 |
0 |
if( pWriter->bFirstTermInPage ){ |
202392
|
0 |
0 |
if( pPage->pgno!=1 ){ |
202407
|
0 |
0 |
if( pPage->term.n ){ |
202442
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
202445
|
0 |
0 |
if( (pPage->buf.n + pPage->pgidx.n)>=p->pConfig->pgsz ){ |
202452
|
0 |
0 |
if( pWriter->bFirstRowidInPage ){ |
202458
|
0 |
0 |
if( pWriter->bFirstRowidInDoclist || pWriter->bFirstRowidInPage ){ |
|
0 |
0 |
if( pWriter->bFirstRowidInDoclist || pWriter->bFirstRowidInPage ){ |
202481
|
0 |
0 |
while( p->rc==SQLITE_OK |
202482
|
0 |
0 |
&& (pPage->buf.n + pPage->pgidx.n + n)>=p->pConfig->pgsz |
202486
|
0 |
0 |
while( nCopy
|
202495
|
0 |
0 |
if( n>0 ){ |
202511
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
202513
|
0 |
0 |
if( pLeaf->buf.n>4 ){ |
202517
|
0 |
0 |
if( pLeaf->pgno>1 ){ |
202526
|
0 |
0 |
for(i=0; inDlidx; i++){ |
202554
|
0 |
0 |
if( p->pIdxWriter==0 ){ |
202562
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
202583
|
0 |
0 |
for(i=0; inSeg; i++){ |
202585
|
0 |
0 |
if( pSeg->pSeg==0 ){ |
202587
|
0 |
0 |
}else if( pSeg->pLeaf==0 ){ |
202602
|
0 |
0 |
if( pData ){ |
202604
|
0 |
0 |
fts5BufferGrow(&p->rc, &buf, pData->nn); |
202609
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
202616
|
0 |
0 |
if( pSeg->iLeafPgno==pSeg->iTermLeafPgno |
202617
|
0 |
0 |
&& pSeg->iEndofDoclistszLeaf |
202658
|
0 |
0 |
int nRem = pnRem ? *pnRem : 0; /* Output leaf pages left to write */ |
202673
|
0 |
0 |
if( pLvl->nMerge ){ |
202687
|
0 |
0 |
if( iLvl==pStruct->nLevel-1 ){ |
202692
|
0 |
0 |
if( p->rc ) return; |
202708
|
0 |
0 |
bOldest = (pLvlOut->nSeg==1 && pStruct->nLevel==iLvl+2); |
|
0 |
0 |
bOldest = (pLvlOut->nSeg==1 && pStruct->nLevel==iLvl+2); |
202711
|
0 |
0 |
for(fts5MultiIterNew(p, pStruct, flags, 0, 0, 0, iLvl, nInput, &pIter); |
202721
|
0 |
0 |
if( nTerm!=term.n || memcmp(pTerm, term.p, nTerm) ){ |
|
0 |
0 |
if( nTerm!=term.n || memcmp(pTerm, term.p, nTerm) ){ |
202722
|
0 |
0 |
if( pnRem && writer.nLeafWritten>nRem ){ |
|
0 |
0 |
if( pnRem && writer.nLeafWritten>nRem ){ |
202730
|
0 |
0 |
if( pSegIter->nPos==0 && (bOldest || pSegIter->bDel==0) ) continue; |
|
0 |
0 |
if( pSegIter->nPos==0 && (bOldest || pSegIter->bDel==0) ) continue; |
|
0 |
0 |
if( pSegIter->nPos==0 && (bOldest || pSegIter->bDel==0) ) continue; |
202732
|
0 |
0 |
if( p->rc==SQLITE_OK && bTermWritten==0 ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && bTermWritten==0 ){ |
202742
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ){ |
202743
|
0 |
0 |
if( pSegIter->bDel ){ |
202745
|
0 |
0 |
if( pSegIter->nPos>0 ){ |
202761
|
0 |
0 |
if( fts5MultiIterEof(p, pIter) ){ |
202765
|
0 |
0 |
for(i=0; i
|
202770
|
0 |
0 |
if( pLvl->nSeg!=nInput ){ |
202777
|
0 |
0 |
if( pSeg->pgnoLast==0 ){ |
202789
|
0 |
0 |
if( pnRem ) *pnRem -= writer.nLeafWritten; |
202806
|
0 |
0 |
while( nRem>0 && p->rc==SQLITE_OK ){ |
|
0 |
0 |
while( nRem>0 && p->rc==SQLITE_OK ){ |
202813
|
0 |
0 |
for(iLvl=0; iLvlnLevel; iLvl++){ |
202815
|
0 |
0 |
if( pLvl->nMerge ){ |
202816
|
0 |
0 |
if( pLvl->nMerge>nBest ){ |
202822
|
0 |
0 |
if( pLvl->nSeg>nBest ){ |
202835
|
0 |
0 |
if( nBestaLevel[iBestLvl].nMerge==0 ){ |
|
0 |
0 |
if( nBestaLevel[iBestLvl].nMerge==0 ){ |
202840
|
0 |
0 |
if( p->rc==SQLITE_OK && pStruct->aLevel[iBestLvl].nMerge==0 ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && pStruct->aLevel[iBestLvl].nMerge==0 ){ |
202861
|
0 |
0 |
if( p->rc==SQLITE_OK && p->pConfig->nAutomerge>0 ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && p->pConfig->nAutomerge>0 ){ |
202886
|
0 |
0 |
while( p->rc==SQLITE_OK && pStruct->aLevel[iLvl].nSeg>=nCrisis ){ |
|
0 |
0 |
while( p->rc==SQLITE_OK && pStruct->aLevel[iLvl].nSeg>=nCrisis ){ |
202916
|
0 |
0 |
if( ret
|
202919
|
0 |
0 |
if( (ret + i) > nMax ) break; |
202945
|
0 |
0 |
if( iSegid ){ |
202965
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
202968
|
0 |
0 |
while( p->rc==SQLITE_OK && 0==sqlite3Fts5HashScanEof(pHash) ){ |
|
0 |
0 |
while( p->rc==SQLITE_OK && 0==sqlite3Fts5HashScanEof(pHash) ){ |
202978
|
0 |
0 |
if( pgsz>=(pBuf->n + pPgidx->n + nDoclist + 1) ){ |
202989
|
0 |
0 |
while( p->rc==SQLITE_OK && iOff
|
|
0 |
0 |
while( p->rc==SQLITE_OK && iOff
|
202993
|
0 |
0 |
if( writer.bFirstRowidInPage ){ |
203003
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ){ |
203004
|
0 |
0 |
if( iOff
|
|
0 |
0 |
if( iOff
|
203007
|
0 |
0 |
if( iOff
|
|
0 |
0 |
if( iOff
|
203012
|
0 |
0 |
if( (pBuf->n + pPgidx->n)>=pgsz ){ |
203020
|
0 |
0 |
if( (pBuf->n + pPgidx->n + nCopy) <= pgsz ){ |
203030
|
0 |
0 |
while( p->rc==SQLITE_OK ){ |
203033
|
0 |
0 |
if( (nCopy - iPos)<=nSpace ){ |
203041
|
0 |
0 |
if( (pBuf->n + pPgidx->n)>=pgsz ){ |
203044
|
0 |
0 |
if( iPos>=nCopy ) break; |
203062
|
0 |
0 |
if( pStruct->nLevel==0 ){ |
203066
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
203087
|
0 |
0 |
if( p->nPendingData ){ |
203113
|
0 |
0 |
if( nSeg<2 ) return 0; |
203114
|
0 |
0 |
for(i=0; inLevel; i++){ |
203116
|
0 |
0 |
if( nThis==nSeg || (nThis==nSeg-1 && pStruct->aLevel[i].nMerge==nThis) ){ |
|
0 |
0 |
if( nThis==nSeg || (nThis==nSeg-1 && pStruct->aLevel[i].nMerge==nThis) ){ |
|
0 |
0 |
if( nThis==nSeg || (nThis==nSeg-1 && pStruct->aLevel[i].nMerge==nThis) ){ |
203126
|
0 |
0 |
if( pNew ){ |
203134
|
0 |
0 |
if( pLvl->aSeg ){ |
203140
|
0 |
0 |
for(iLvl=pStruct->nLevel-1; iLvl>=0; iLvl--){ |
203141
|
0 |
0 |
for(iSeg=0; iSegaLevel[iLvl].nSeg; iSeg++){ |
203165
|
0 |
0 |
if( pStruct ){ |
203171
|
0 |
0 |
if( pNew ){ |
203173
|
0 |
0 |
for(iLvl=0; pNew->aLevel[iLvl].nSeg==0; iLvl++){} |
203174
|
0 |
0 |
while( p->rc==SQLITE_OK && pNew->aLevel[iLvl].nSeg>0 ){ |
|
0 |
0 |
while( p->rc==SQLITE_OK && pNew->aLevel[iLvl].nSeg>0 ){ |
203192
|
0 |
0 |
if( pStruct ){ |
203195
|
0 |
0 |
if( nMerge<0 ){ |
203202
|
0 |
0 |
if( pStruct && pStruct->nLevel ){ |
|
0 |
0 |
if( pStruct && pStruct->nLevel ){ |
203203
|
0 |
0 |
if( fts5IndexMerge(p, &pStruct, nMerge, nMin) ){ |
203230
|
0 |
0 |
if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nData+9+9) ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nData+9+9) ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nData+9+9) ){ |
203242
|
0 |
0 |
if( p>=pIter->aEof ){ |
203251
|
0 |
0 |
if( p[0] & 0x80 ){ |
203309
|
0 |
0 |
if( i>=pBuf->n ){ |
203336
|
0 |
0 |
if( p->rc ) return; |
203340
|
0 |
0 |
while( i1>=0 || i2>=0 ){ |
|
0 |
0 |
while( i1>=0 || i2>=0 ){ |
203341
|
0 |
0 |
if( i1>=0 && (i2<0 || iRowid1
|
|
0 |
0 |
if( i1>=0 && (i2<0 || iRowid1
|
|
0 |
0 |
if( i1>=0 && (i2<0 || iRowid1
|
203350
|
0 |
0 |
if( i1>=0 && iRowid1==iRowid2 ){ |
|
0 |
0 |
if( i1>=0 && iRowid1==iRowid2 ){ |
203374
|
0 |
0 |
if( p2->n ){ |
203387
|
0 |
0 |
if( sqlite3Fts5BufferSize(&p->rc, &out, p1->n + p2->n + 9) ) return; |
203392
|
0 |
0 |
if( i1.iRowid
|
203397
|
0 |
0 |
if( i1.aPoslist==0 ) break; |
203399
|
0 |
0 |
else if( i2.iRowid!=i1.iRowid ){ |
203404
|
0 |
0 |
if( i2.aPoslist==0 ) break; |
203422
|
0 |
0 |
if( p->rc ) break; |
203428
|
0 |
0 |
if( iPos1
|
203436
|
0 |
0 |
if( iPos1>=0 && iPos2>=0 ){ |
|
0 |
0 |
if( iPos1>=0 && iPos2>=0 ){ |
203438
|
0 |
0 |
if( iPos1
|
203439
|
0 |
0 |
if( iPos1!=iPrev ){ |
203443
|
0 |
0 |
if( iPos1<0 ) break; |
203448
|
0 |
0 |
if( iPos2<0 ) break; |
203453
|
0 |
0 |
if( iPos1>=0 ){ |
203454
|
0 |
0 |
if( iPos1!=iPrev ){ |
203469
|
0 |
0 |
if( i1.aPoslist==0 || i2.aPoslist==0 ) break; |
|
0 |
0 |
if( i1.aPoslist==0 || i2.aPoslist==0 ) break; |
203473
|
0 |
0 |
if( i1.aPoslist ){ |
203477
|
0 |
0 |
else if( i2.aPoslist ){ |
203503
|
0 |
0 |
if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){ |
203514
|
0 |
0 |
if( aBuf && pStruct ){ |
|
0 |
0 |
if( aBuf && pStruct ){ |
203528
|
0 |
0 |
for( /* no-op */ ; |
203538
|
0 |
0 |
if( bNewTerm ){ |
203539
|
0 |
0 |
if( nTerm
|
|
0 |
0 |
if( nTerm
|
203542
|
0 |
0 |
if( p1->base.nData==0 ) continue; |
203544
|
0 |
0 |
if( p1->base.iRowid<=iLastRowid && doclist.n>0 ){ |
|
0 |
0 |
if( p1->base.iRowid<=iLastRowid && doclist.n>0 ){ |
203545
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && doclist.n; i++){ |
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && doclist.n; i++){ |
203547
|
0 |
0 |
if( aBuf[i].n==0 ){ |
203562
|
0 |
0 |
for(i=0; i
|
203563
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
203571
|
0 |
0 |
if( pData ){ |
203574
|
0 |
0 |
if( doclist.n ) memcpy(pData->p, doclist.p, doclist.n); |
203593
|
0 |
0 |
if( p->pHash==0 ){ |
203598
|
0 |
0 |
if( iRowidiWriteRowid |
203599
|
0 |
0 |
|| (iRowid==p->iWriteRowid && p->bDelete==0) |
|
0 |
0 |
|| (iRowid==p->iWriteRowid && p->bDelete==0) |
203600
|
0 |
0 |
|| (p->nPendingData > p->pConfig->nHashSize) |
203665
|
0 |
0 |
if( rc==SQLITE_OK ){ |
203669
|
0 |
0 |
if( p->zDataTbl && bCreate ){ |
|
0 |
0 |
if( p->zDataTbl && bCreate ){ |
203673
|
0 |
0 |
if( rc==SQLITE_OK ){ |
203679
|
0 |
0 |
if( rc==SQLITE_OK ){ |
203686
|
0 |
0 |
if( rc ){ |
203698
|
0 |
0 |
if( p ){ |
203726
|
0 |
0 |
for(i=0; i
|
203727
|
0 |
0 |
if( n>=nByte ) return 0; /* Input contains fewer than nChar chars */ |
203728
|
0 |
0 |
if( (unsigned char)p[n++]>=0xc0 ){ |
203729
|
0 |
0 |
while( (p[n] & 0xc0)==0x80 ) n++; |
203742
|
0 |
0 |
while( i
|
203743
|
0 |
0 |
if( (unsigned char)pIn[i++]>=0xc0 ){ |
203744
|
0 |
0 |
while( i
|
|
0 |
0 |
while( i
|
203779
|
0 |
0 |
for(i=0; inPrefix && rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; inPrefix && rc==SQLITE_OK; i++){ |
203782
|
0 |
0 |
if( nByte ){ |
203811
|
0 |
0 |
if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){ |
203813
|
0 |
0 |
if( nToken ) memcpy(&buf.p[1], pToken, nToken); |
203831
|
0 |
0 |
if( flags & FTS5INDEX_QUERY_PREFIX ){ |
203833
|
0 |
0 |
for(iIdx=1; iIdx<=pConfig->nPrefix; iIdx++){ |
203834
|
0 |
0 |
if( pConfig->aPrefix[iIdx-1]==nChar ) break; |
203838
|
0 |
0 |
if( iIdx<=pConfig->nPrefix ){ |
203842
|
0 |
0 |
if( pStruct ){ |
203855
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
203857
|
0 |
0 |
if( pSeg->pLeaf ) pRet->xSetOutputs(pRet, pSeg); |
203861
|
0 |
0 |
if( p->rc ){ |
203896
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
203898
|
0 |
0 |
if( pSeg->pLeaf && pSeg->term.p[0]!=FTS5_MAIN_PREFIX ){ |
|
0 |
0 |
if( pSeg->pLeaf && pSeg->term.p[0]!=FTS5_MAIN_PREFIX ){ |
203933
|
0 |
0 |
if( pIndexIter ){ |
203954
|
0 |
0 |
if( p->rc==SQLITE_OK && pData->nn ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && pData->nn ){ |
203958
|
0 |
0 |
for(iCol=0; inn && iCol
|
|
0 |
0 |
for(iCol=0; inn && iCol
|
204004
|
0 |
0 |
if( rc==SQLITE_OK ){ |
204041
|
0 |
0 |
if( iIdx>=0 ) ret += (ret<<3) + (FTS5_MAIN_PREFIX + iIdx); |
204042
|
0 |
0 |
for(i=0; i
|
204221
|
0 |
0 |
for(i=iFirst; p->rc==SQLITE_OK && i<=iLast; i++){ |
|
0 |
0 |
for(i=iFirst; p->rc==SQLITE_OK && i<=iLast; i++){ |
204223
|
0 |
0 |
if( pLeaf ){ |
204224
|
0 |
0 |
if( !fts5LeafIsTermless(pLeaf) ) p->rc = FTS5_CORRUPT; |
204225
|
0 |
0 |
if( i>=iNoRowid && 0!=fts5LeafFirstRowidOff(pLeaf) ) p->rc = FTS5_CORRUPT; |
|
0 |
0 |
if( i>=iNoRowid && 0!=fts5LeafFirstRowidOff(pLeaf) ) p->rc = FTS5_CORRUPT; |
204239
|
0 |
0 |
while( iinn && p->rc==SQLITE_OK ){ |
|
0 |
0 |
while( iinn && p->rc==SQLITE_OK ){ |
204248
|
0 |
0 |
if( iOff>=pLeaf->szLeaf ){ |
204250
|
0 |
0 |
}else if( iTermOff==nIncr ){ |
204253
|
0 |
0 |
if( (iOff+nByte)>pLeaf->szLeaf ){ |
204262
|
0 |
0 |
if( nKeep>buf1.n || (iOff+nByte)>pLeaf->szLeaf ){ |
|
0 |
0 |
if( nKeep>buf1.n || (iOff+nByte)>pLeaf->szLeaf ){ |
204269
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
204271
|
0 |
0 |
if( res<=0 ) p->rc = FTS5_CORRUPT; |
204291
|
0 |
0 |
if( pSeg->pgnoFirst==0 ) return; |
204299
|
0 |
0 |
while( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ |
|
0 |
0 |
while( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ |
204310
|
0 |
0 |
if( iIdxLeafpgnoFirst ) continue; |
204313
|
0 |
0 |
if( pLeaf==0 ) break; |
204319
|
0 |
0 |
if( pLeaf->nn<=pLeaf->szLeaf ){ |
204329
|
0 |
0 |
if( iRowidOff>=iOff ){ |
204334
|
0 |
0 |
if( res==0 ) res = nTerm - nIdxTerm; |
204335
|
0 |
0 |
if( res<0 ) p->rc = FTS5_CORRUPT; |
204341
|
0 |
0 |
if( p->rc ) break; |
204348
|
0 |
0 |
if( p->rc ) break; |
204351
|
0 |
0 |
if( bIdxDlidx ){ |
204358
|
0 |
0 |
for(pDlidx=fts5DlidxIterInit(p, 0, iSegid, iIdxLeaf); |
204364
|
0 |
0 |
for(iPg=iPrevLeaf+1; iPg
|
204367
|
0 |
0 |
if( pLeaf ){ |
204368
|
0 |
0 |
if( fts5LeafFirstRowidOff(pLeaf)!=0 ) p->rc = FTS5_CORRUPT; |
204378
|
0 |
0 |
if( pLeaf ){ |
204382
|
0 |
0 |
if( iRowidOff>=pLeaf->szLeaf ){ |
204386
|
0 |
0 |
if( iRowid!=fts5DlidxIterRowid(pDlidx) ) p->rc = FTS5_CORRUPT; |
204404
|
0 |
0 |
if( p->rc==SQLITE_OK ) p->rc = rc2; |
204443
|
0 |
0 |
if( pStruct ){ |
204445
|
0 |
0 |
for(iLvl=0; iLvlnLevel; iLvl++){ |
204446
|
0 |
0 |
for(iSeg=0; iSegaLevel[iLvl].nSeg; iSeg++){ |
204466
|
0 |
0 |
for(fts5MultiIterNew(p, pStruct, flags, 0, 0, 0, -1, 0, &pIter); |
204479
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ){ |
204480
|
0 |
0 |
if( 0==fts5MultiIterIsEmpty(p, pIter) ){ |
204486
|
0 |
0 |
while( 0==sqlite3Fts5PoslistNext64(poslist.p, poslist.n, &iOff, &iPos) ){ |
204496
|
0 |
0 |
if( p->rc==SQLITE_OK && cksum!=cksum2 ) p->rc = FTS5_CORRUPT; |
|
0 |
0 |
if( p->rc==SQLITE_OK && cksum!=cksum2 ) p->rc = FTS5_CORRUPT; |
204539
|
0 |
0 |
if( iSegid==0 ){ |
204540
|
0 |
0 |
if( iKey==FTS5_AVERAGES_ROWID ){ |
204547
|
0 |
0 |
sqlite3Fts5BufferAppendPrintf(pRc, pBuf, "{%ssegid=%d h=%d pgno=%d}", |
204560
|
0 |
0 |
for(iLvl=0; iLvlnLevel; iLvl++){ |
204565
|
0 |
0 |
for(iSeg=0; iSegnSeg; iSeg++){ |
204591
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
204615
|
0 |
0 |
while( i
|
204632
|
0 |
0 |
while( iOff
|
204652
|
0 |
0 |
if( n>0 ){ |
204656
|
0 |
0 |
while( iOff
|
204660
|
0 |
0 |
sqlite3Fts5BufferAppendPrintf(pRc, pBuf, " nPos=%d%s", nPos, bDel?"*":""); |
204662
|
0 |
0 |
if( iOff
|
204694
|
0 |
0 |
while( i
|
204700
|
0 |
0 |
if( i
|
|
0 |
0 |
if( i
|
204702
|
0 |
0 |
if( i
|
|
0 |
0 |
if( i
|
204743
|
0 |
0 |
if( a==0 ) goto decode_out; |
204750
|
0 |
0 |
if( bDlidx ){ |
204761
|
0 |
0 |
for(fts5DlidxLvlNext(&lvl); lvl.bEof==0; fts5DlidxLvlNext(&lvl)){ |
204766
|
0 |
0 |
}else if( iSegid==0 ){ |
204767
|
0 |
0 |
if( iRowid==FTS5_AVERAGES_ROWID ){ |
204772
|
0 |
0 |
}else if( eDetailNone ){ |
204783
|
0 |
0 |
if( szLeaf
|
204791
|
0 |
0 |
while( iOff
|
204804
|
0 |
0 |
if( iPgidxOff
|
204814
|
0 |
0 |
if( iOff
|
204832
|
0 |
0 |
if( n<4 ){ |
204838
|
0 |
0 |
if( iPgidxOff
|
204844
|
0 |
0 |
if( iRowidOff!=0 ){ |
204846
|
0 |
0 |
}else if( iTermOff!=0 ){ |
204855
|
0 |
0 |
nDoclist = (iTermOff ? iTermOff : szLeaf) - iOff; |
204858
|
0 |
0 |
while( iPgidxOff
|
204867
|
0 |
0 |
if( iPgidxOff
|
204874
|
0 |
0 |
if( bFirst==0 ){ |
204893
|
0 |
0 |
if( rc==SQLITE_OK ){ |
204910
|
0 |
0 |
if( nArg==0 ){ |
204914
|
0 |
0 |
if( 0==sqlite3_stricmp(zArg, "segment") ){ |
204917
|
0 |
0 |
if( nArg!=3 ){ |
204948
|
262 |
0 |
if( rc==SQLITE_OK ){ |
204955
|
262 |
0 |
if( rc==SQLITE_OK ){ |
204966
|
0 |
0 |
if( fts5IndexDataVersion(p)!=p->iStructVersion ){ |
205288
|
0 |
0 |
if( pTab ){ |
205310
|
0 |
0 |
if( rc==SQLITE_OK ){ |
205344
|
0 |
0 |
if( rc==SQLITE_OK ){ |
205348
|
0 |
0 |
if( rc==SQLITE_OK ){ |
205354
|
0 |
0 |
if( rc==SQLITE_OK ){ |
205359
|
0 |
0 |
if( rc==SQLITE_OK ){ |
205366
|
0 |
0 |
if( rc==SQLITE_OK ){ |
205371
|
0 |
0 |
if( rc==SQLITE_OK ){ |
205379
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
205516
|
0 |
0 |
for(i=0; inConstraint; i++){ |
205520
|
0 |
0 |
if( (p->op==SQLITE_INDEX_CONSTRAINT_MATCH && iCol>=0 && iCol<=nCol) |
|
0 |
0 |
if( (p->op==SQLITE_INDEX_CONSTRAINT_MATCH && iCol>=0 && iCol<=nCol) |
|
0 |
0 |
if( (p->op==SQLITE_INDEX_CONSTRAINT_MATCH && iCol>=0 && iCol<=nCol) |
205521
|
0 |
0 |
|| (p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol==nCol) |
|
0 |
0 |
|| (p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol==nCol) |
205524
|
0 |
0 |
if( p->usable ){ |
205533
|
0 |
0 |
}else if( p->op<=SQLITE_INDEX_CONSTRAINT_MATCH ){ |
205535
|
0 |
0 |
for(j=1; j
|
205537
|
0 |
0 |
if( iCol==aColMap[pC->iCol] && (p->op & pC->op) && p->usable ){ |
|
0 |
0 |
if( iCol==aColMap[pC->iCol] && (p->op & pC->op) && p->usable ){ |
|
0 |
0 |
if( iCol==aColMap[pC->iCol] && (p->op & pC->op) && p->usable ){ |
205546
|
0 |
0 |
if( pInfo->nOrderBy==1 ){ |
205548
|
0 |
0 |
if( iSort==(pConfig->nCol+1) && BitFlagTest(idxFlags, FTS5_BI_MATCH) ){ |
|
0 |
0 |
if( iSort==(pConfig->nCol+1) && BitFlagTest(idxFlags, FTS5_BI_MATCH) ){ |
205550
|
0 |
0 |
}else if( iSort==-1 ){ |
205553
|
0 |
0 |
if( BitFlagTest(idxFlags, FTS5_BI_ORDER_RANK|FTS5_BI_ORDER_ROWID) ){ |
205555
|
0 |
0 |
if( pInfo->aOrderBy[0].desc ){ |
205563
|
0 |
0 |
if( BitFlagTest(idxFlags, FTS5_BI_ROWID_EQ) ){ |
205564
|
0 |
0 |
pInfo->estimatedCost = bHasMatch ? 100.0 : 10.0; |
205565
|
0 |
0 |
if( bHasMatch==0 ) fts5SetUniqueFlag(pInfo); |
205566
|
0 |
0 |
}else if( BitFlagAllTest(idxFlags, FTS5_BI_ROWID_LE|FTS5_BI_ROWID_GE) ){ |
205567
|
0 |
0 |
pInfo->estimatedCost = bHasMatch ? 500.0 : 250000.0; |
205568
|
0 |
0 |
}else if( BitFlagTest(idxFlags, FTS5_BI_ROWID_LE|FTS5_BI_ROWID_GE) ){ |
205569
|
0 |
0 |
pInfo->estimatedCost = bHasMatch ? 750.0 : 750000.0; |
205571
|
0 |
0 |
pInfo->estimatedCost = bHasMatch ? 1000.0 : 1000000.0; |
205576
|
0 |
0 |
for(i=0; i
|
205578
|
0 |
0 |
if( pC->iConsIndex>=0 ){ |
205590
|
0 |
0 |
for(pCsr=pTab->pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){ |
205591
|
0 |
0 |
if( pCsr->base.pVtab==(sqlite3_vtab*)pTab ) return SQLITE_OK; |
205607
|
0 |
0 |
if( rc==SQLITE_OK ){ |
205610
|
0 |
0 |
if( pCsr ){ |
205626
|
0 |
0 |
if( pCsr->ePlan==FTS5_PLAN_SCAN ){ |
205653
|
0 |
0 |
if( pCsr->pStmt ){ |
205657
|
0 |
0 |
if( pCsr->pSorter ){ |
205663
|
0 |
0 |
if( pCsr->ePlan!=FTS5_PLAN_SOURCE ){ |
205667
|
0 |
0 |
for(pData=pCsr->pAuxdata; pData; pData=pNext){ |
205669
|
0 |
0 |
if( pData->xDelete ) pData->xDelete(pData->pPtr); |
205676
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_FREE_ZRANK) ){ |
205690
|
0 |
0 |
if( pCursor ){ |
205697
|
0 |
0 |
for(pp=&pTab->pGlobal->pCsr; (*pp)!=pCsr; pp=&(*pp)->pNext); |
205710
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
205713
|
0 |
0 |
}else if( rc==SQLITE_ROW ){ |
205726
|
0 |
0 |
if( nBlob>0 ){ |
205727
|
0 |
0 |
for(i=0; i<(pSorter->nIdx-1); i++){ |
205750
|
0 |
0 |
for(pCsr=pTab->pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){ |
205751
|
0 |
0 |
if( pCsr->ePlan==FTS5_PLAN_MATCH |
205752
|
0 |
0 |
&& pCsr->base.pVtab==(sqlite3_vtab*)pTab |
205774
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_RESEEK) ){ |
205780
|
0 |
0 |
if( rc==SQLITE_OK && iRowid!=sqlite3Fts5ExprRowid(pCsr->pExpr) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && iRowid!=sqlite3Fts5ExprRowid(pCsr->pExpr) ){ |
205786
|
0 |
0 |
if( sqlite3Fts5ExprEof(pCsr->pExpr) ){ |
205812
|
0 |
0 |
if( pCsr->ePlan<3 ){ |
205814
|
0 |
0 |
if( (rc = fts5CursorReseek(pCsr, &bSkip)) || bSkip ) return rc; |
|
0 |
0 |
if( (rc = fts5CursorReseek(pCsr, &bSkip)) || bSkip ) return rc; |
205833
|
0 |
0 |
if( rc!=SQLITE_ROW ){ |
205860
|
0 |
0 |
if( zSql==0 ){ |
205865
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
205888
|
0 |
0 |
if( pSorter==0 ) return SQLITE_NOMEM; |
205899
|
0 |
0 |
rc = fts5PrepareStatement(&pSorter->pStmt, pConfig, |
|
0 |
0 |
rc = fts5PrepareStatement(&pSorter->pStmt, pConfig, |
|
0 |
0 |
rc = fts5PrepareStatement(&pSorter->pStmt, pConfig, |
205908
|
0 |
0 |
if( rc==SQLITE_OK ){ |
205915
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
205928
|
0 |
0 |
if( sqlite3Fts5ExprEof(pExpr) ){ |
205950
|
0 |
0 |
while( z[0]==' ' ) z++; |
205951
|
0 |
0 |
for(n=0; z[n] && z[n]!=' '; n++); |
|
0 |
0 |
for(n=0; z[n] && z[n]!=' '; n++); |
205956
|
0 |
0 |
if( 0==sqlite3_strnicmp("reads", z, n) ){ |
205959
|
0 |
0 |
else if( 0==sqlite3_strnicmp("id", z, n) ){ |
205979
|
0 |
0 |
for(pAux=pTab->pGlobal->pAux; pAux; pAux=pAux->pNext){ |
205980
|
0 |
0 |
if( sqlite3_stricmp(zName, pAux->zFunc)==0 ) return pAux; |
205996
|
0 |
0 |
if( zRankArgs ){ |
205998
|
0 |
0 |
if( zSql ){ |
206004
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206005
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
206010
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206012
|
0 |
0 |
for(i=0; inRankArg; i++){ |
206025
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206027
|
0 |
0 |
if( pAux==0 ){ |
206045
|
0 |
0 |
if( pRank ){ |
206050
|
0 |
0 |
if( z==0 ){ |
206051
|
0 |
0 |
if( sqlite3_value_type(pRank)==SQLITE_NULL ) rc = SQLITE_ERROR; |
206055
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206059
|
0 |
0 |
}else if( rc==SQLITE_ERROR ){ |
206065
|
0 |
0 |
if( pConfig->zRank ){ |
206077
|
0 |
0 |
if( pVal ){ |
206079
|
0 |
0 |
if( eType==SQLITE_INTEGER ){ |
206122
|
0 |
0 |
if( pCsr->ePlan ){ |
206142
|
0 |
0 |
if( BitFlagTest(idxNum, FTS5_BI_MATCH) ) pMatch = apVal[iVal++]; |
206143
|
0 |
0 |
if( BitFlagTest(idxNum, FTS5_BI_RANK) ) pRank = apVal[iVal++]; |
206144
|
0 |
0 |
if( BitFlagTest(idxNum, FTS5_BI_ROWID_EQ) ) pRowidEq = apVal[iVal++]; |
206145
|
0 |
0 |
if( BitFlagTest(idxNum, FTS5_BI_ROWID_LE) ) pRowidLe = apVal[iVal++]; |
206146
|
0 |
0 |
if( BitFlagTest(idxNum, FTS5_BI_ROWID_GE) ) pRowidGe = apVal[iVal++]; |
206157
|
0 |
0 |
if( pRowidEq ){ |
206160
|
0 |
0 |
if( bDesc ){ |
206168
|
0 |
0 |
if( pTab->pSortCsr ){ |
206182
|
0 |
0 |
}else if( pMatch ){ |
206184
|
0 |
0 |
if( zExpr==0 ) zExpr = ""; |
206187
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206188
|
0 |
0 |
if( zExpr[0]=='*' ){ |
206196
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206197
|
0 |
0 |
if( bOrderByRank ){ |
206207
|
0 |
0 |
}else if( pConfig->zContent==0 ){ |
206215
|
0 |
0 |
pCsr->ePlan = (pRowidEq ? FTS5_PLAN_ROWID : FTS5_PLAN_SCAN); |
206219
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206220
|
0 |
0 |
if( pCsr->ePlan==FTS5_PLAN_ROWID ){ |
206251
|
0 |
0 |
if( pCsr->pSorter ){ |
206299
|
0 |
0 |
if( pCsr->pStmt==0 ){ |
206302
|
0 |
0 |
rc = sqlite3Fts5StorageStmt( |
206309
|
0 |
0 |
if( rc==SQLITE_OK && CsrFlagTest(pCsr, FTS5CSR_REQUIRE_CONTENT) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && CsrFlagTest(pCsr, FTS5CSR_REQUIRE_CONTENT) ){ |
206314
|
0 |
0 |
if( rc==SQLITE_ROW ){ |
206319
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206359
|
0 |
0 |
if( 0==sqlite3_stricmp("delete-all", zCmd) ){ |
206360
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
206369
|
0 |
0 |
}else if( 0==sqlite3_stricmp("rebuild", zCmd) ){ |
206370
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NONE ){ |
206378
|
0 |
0 |
}else if( 0==sqlite3_stricmp("optimize", zCmd) ){ |
206380
|
0 |
0 |
}else if( 0==sqlite3_stricmp("merge", zCmd) ){ |
206383
|
0 |
0 |
}else if( 0==sqlite3_stricmp("integrity-check", zCmd) ){ |
206391
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206394
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206395
|
0 |
0 |
if( bError ){ |
206411
|
0 |
0 |
if( eType1==SQLITE_INTEGER ){ |
206425
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206428
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206475
|
0 |
0 |
if( eType0==SQLITE_NULL |
206476
|
0 |
0 |
&& sqlite3_value_type(apVal[2+pConfig->nCol])!=SQLITE_NULL |
206480
|
0 |
0 |
if( pConfig->eContent!=FTS5_CONTENT_NORMAL |
206481
|
0 |
0 |
&& 0==sqlite3_stricmp("delete", z) |
206500
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
206509
|
0 |
0 |
if( eType0==SQLITE_INTEGER && fts5IsContentless(pTab) ){ |
|
0 |
0 |
if( eType0==SQLITE_INTEGER && fts5IsContentless(pTab) ){ |
206510
|
0 |
0 |
pTab->base.zErrMsg = sqlite3_mprintf( |
206518
|
0 |
0 |
else if( nArg==1 ){ |
206524
|
0 |
0 |
else if( eType0!=SQLITE_INTEGER ){ |
206526
|
0 |
0 |
if( eConflict==SQLITE_REPLACE |
206527
|
0 |
0 |
&& sqlite3_value_type(apVal[1])==SQLITE_INTEGER |
206539
|
0 |
0 |
if( iOld!=iNew ){ |
206540
|
0 |
0 |
if( eConflict==SQLITE_REPLACE ){ |
206542
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206548
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206551
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206671
|
0 |
0 |
if( fts5IsContentless((Fts5Table*)(pCsr->base.pVtab)) ){ |
206676
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206694
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_POSLIST) ){ |
206696
|
0 |
0 |
if( pConfig->eDetail!=FTS5_DETAIL_FULL ){ |
206700
|
0 |
0 |
if( aPopulator==0 ) rc = SQLITE_NOMEM; |
206701
|
0 |
0 |
for(i=0; inCol && rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; inCol && rc==SQLITE_OK; i++){ |
206704
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206712
|
0 |
0 |
if( pCsr->pSorter ){ |
206719
|
0 |
0 |
if( pCsr->pSorter && pConfig->eDetail==FTS5_DETAIL_FULL ){ |
|
0 |
0 |
if( pCsr->pSorter && pConfig->eDetail==FTS5_DETAIL_FULL ){ |
206721
|
0 |
0 |
int i1 = (iPhrase==0 ? 0 : pSorter->aIdx[iPhrase-1]); |
206742
|
0 |
0 |
if( pCsr->aInstIter==0 ){ |
206748
|
0 |
0 |
if( aIter ){ |
206753
|
0 |
0 |
for(i=0; i
|
|
0 |
0 |
for(i=0; i
|
206757
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206762
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206766
|
0 |
0 |
for(i=0; i
|
206767
|
0 |
0 |
if( (aIter[i].bEof==0) |
206768
|
0 |
0 |
&& (iBest<0 || aIter[i].iPos
|
|
0 |
0 |
&& (iBest<0 || aIter[i].iPos
|
206773
|
0 |
0 |
if( iBest<0 ) break; |
206776
|
0 |
0 |
if( nInst>=pCsr->nInstAlloc ){ |
206777
|
0 |
0 |
pCsr->nInstAlloc = pCsr->nInstAlloc ? pCsr->nInstAlloc*2 : 32; |
206781
|
0 |
0 |
if( aInst ){ |
206806
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_INST)==0 |
206807
|
0 |
0 |
|| SQLITE_OK==(rc = fts5CacheInstArray(pCsr)) ){ |
206822
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_INST)==0 |
206823
|
0 |
0 |
|| SQLITE_OK==(rc = fts5CacheInstArray(pCsr)) |
206825
|
0 |
0 |
if( iIdx<0 || iIdx>=pCsr->nInstCount ){ |
|
0 |
0 |
if( iIdx<0 || iIdx>=pCsr->nInstCount ){ |
206857
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ){ |
206869
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_DOCSIZE) ){ |
206870
|
0 |
0 |
if( pConfig->bColumnsize ){ |
206873
|
0 |
0 |
}else if( pConfig->zContent==0 ){ |
206875
|
0 |
0 |
for(i=0; inCol; i++){ |
206876
|
0 |
0 |
if( pConfig->abUnindexed[i]==0 ){ |
206882
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inCol; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inCol; i++){ |
206883
|
0 |
0 |
if( pConfig->abUnindexed[i]==0 ){ |
206888
|
0 |
0 |
if( rc==SQLITE_OK ){ |
206898
|
0 |
0 |
if( iCol<0 ){ |
206901
|
0 |
0 |
for(i=0; inCol; i++){ |
206904
|
0 |
0 |
}else if( iColnCol ){ |
206926
|
0 |
0 |
for(pData=pCsr->pAuxdata; pData; pData=pData->pNext){ |
206927
|
0 |
0 |
if( pData->pAux==pCsr->pAux ) break; |
206930
|
0 |
0 |
if( pData ){ |
206931
|
0 |
0 |
if( pData->xDelete ){ |
206937
|
0 |
0 |
if( pData==0 ){ |
206938
|
0 |
0 |
if( xDelete ) xDelete(pPtr); |
206956
|
0 |
0 |
for(pData=pCsr->pAuxdata; pData; pData=pData->pNext){ |
206957
|
0 |
0 |
if( pData->pAux==pCsr->pAux ) break; |
206960
|
0 |
0 |
if( pData ){ |
206962
|
0 |
0 |
if( bClear ){ |
206977
|
0 |
0 |
if( pIter->a>=pIter->b ){ |
206983
|
0 |
0 |
if( iVal==1 ){ |
207002
|
0 |
0 |
if( rc==SQLITE_OK ){ |
207019
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){ |
207020
|
0 |
0 |
if( pIter->a>=pIter->b ){ |
207030
|
0 |
0 |
if( pIter->a>=pIter->b ){ |
207034
|
0 |
0 |
if( pIter->a[0]==0x01 ) break; |
207051
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){ |
207054
|
0 |
0 |
if( pSorter ){ |
207055
|
0 |
0 |
int i1 = (iPhrase==0 ? 0 : pSorter->aIdx[iPhrase-1]); |
207061
|
0 |
0 |
if( rc==SQLITE_OK ){ |
207069
|
0 |
0 |
if( rc==SQLITE_OK ){ |
207071
|
0 |
0 |
if( n<=0 ){ |
207073
|
0 |
0 |
}else if( pIter->a[0]==0x01 ){ |
207127
|
0 |
0 |
if( rc==SQLITE_OK ){ |
207135
|
0 |
0 |
if( rc==SQLITE_OK ){ |
207136
|
0 |
0 |
for(rc = fts5CursorFirst(pTab, pNew, 0); |
207137
|
0 |
0 |
rc==SQLITE_OK && CsrFlagTest(pNew, FTS5CSR_EOF)==0; |
207141
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
207142
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
207167
|
0 |
0 |
for(pCsr=pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){ |
207168
|
0 |
0 |
if( pCsr->iCsrId==iCsrId ) break; |
207188
|
0 |
0 |
if( pCsr==0 ){ |
207246
|
0 |
0 |
for(i=0; i<(nPhrase-1); i++){ |
207253
|
0 |
0 |
for(i=0; i
|
207264
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<(nPhrase-1); i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<(nPhrase-1); i++){ |
207272
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
207304
|
0 |
0 |
if( pCsr->ePlan==FTS5_PLAN_SPECIAL ){ |
207305
|
0 |
0 |
if( iCol==pConfig->nCol ){ |
207310
|
0 |
0 |
if( iCol==pConfig->nCol ){ |
207316
|
0 |
0 |
}else if( iCol==pConfig->nCol+1 ){ |
207319
|
0 |
0 |
if( pCsr->ePlan==FTS5_PLAN_SOURCE ){ |
207321
|
0 |
0 |
}else if( |
207323
|
0 |
0 |
|| pCsr->ePlan==FTS5_PLAN_SORTED_MATCH |
207325
|
0 |
0 |
if( pCsr->pRank || SQLITE_OK==(rc = fts5FindRankFunction(pCsr)) ){ |
|
0 |
0 |
if( pCsr->pRank || SQLITE_OK==(rc = fts5FindRankFunction(pCsr)) ){ |
207329
|
0 |
0 |
}else if( !fts5IsContentless(pTab) ){ |
207331
|
0 |
0 |
if( rc==SQLITE_OK ){ |
207355
|
0 |
0 |
if( pAux ){ |
207427
|
786 |
0 |
if( rc==SQLITE_OK ){ |
207435
|
786 |
0 |
if( pAux ){ |
207473
|
786 |
0 |
if( pNew ){ |
207482
|
262 |
524 |
if( pNew->pNext==0 ){ |
207498
|
0 |
0 |
if( zName==0 ){ |
207501
|
0 |
0 |
for(pMod=pGlobal->pTok; pMod; pMod=pMod->pNext){ |
207502
|
0 |
0 |
if( sqlite3_stricmp(zName, pMod->zName)==0 ) break; |
207523
|
0 |
0 |
if( pMod ){ |
207545
|
0 |
0 |
pMod = fts5LocateTokenizer(pGlobal, nArg==0 ? 0 : azArg[0]); |
207546
|
0 |
0 |
if( pMod==0 ){ |
207551
|
0 |
0 |
rc = pMod->x.xCreate(pMod->pUserData, &azArg[1], (nArg?nArg-1:0), ppTok); |
207553
|
0 |
0 |
if( rc!=SQLITE_OK && pzErr ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && pzErr ){ |
207558
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
207571
|
780 |
260 |
for(pAux=pGlobal->pAux; pAux; pAux=pNextAux){ |
207573
|
0 |
780 |
if( pAux->xDestroy ) pAux->xDestroy(pAux->pUserData); |
207577
|
780 |
260 |
for(pTok=pGlobal->pTok; pTok; pTok=pNextTok){ |
207579
|
0 |
780 |
if( pTok->xDestroy ) pTok->xDestroy(pTok->pUserData); |
207596
|
0 |
0 |
if( ppApi ) *ppApi = &pGlobal->api; |
207643
|
0 |
262 |
if( pGlobal==0 ){ |
207654
|
262 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5IndexInit(db); |
207655
|
262 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5ExprInit(pGlobal, db); |
207656
|
262 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5AuxInit(&pGlobal->api); |
207657
|
262 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5TokenizerInit(&pGlobal->api); |
207658
|
262 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5VocabInit(pGlobal, db); |
207659
|
262 |
0 |
if( rc==SQLITE_OK ){ |
207664
|
262 |
0 |
if( rc==SQLITE_OK ){ |
207795
|
0 |
0 |
if( p->aStmt[eStmt]==0 ){ |
207843
|
0 |
0 |
if( zBind ){ |
207844
|
0 |
0 |
for(i=0; i
|
207860
|
0 |
0 |
if( zSql==0 ){ |
207866
|
0 |
0 |
if( rc!=SQLITE_OK && pzErrMsg ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && pzErrMsg ){ |
207891
|
0 |
0 |
if( zSql==0 ){ |
207915
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
207921
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
207936
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
207951
|
0 |
0 |
if( pConfig->bColumnsize ){ |
207954
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
207974
|
0 |
0 |
rc = fts5ExecPrintf(pConfig->db, &zErr, "CREATE TABLE %Q.'%q_%q'(%s)%s", |
207981
|
0 |
0 |
if( zErr ){ |
208013
|
0 |
0 |
if( !p ) return SQLITE_NOMEM; |
208020
|
0 |
0 |
if( bCreate ){ |
208021
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
208024
|
0 |
0 |
if( zDefn==0 ){ |
208031
|
0 |
0 |
for(i=0; inCol; i++){ |
208040
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
208045
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208050
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208055
|
0 |
0 |
if( rc ){ |
208067
|
0 |
0 |
if( p ){ |
208071
|
0 |
0 |
for(i=0; iaStmt); i++){ |
208101
|
0 |
0 |
if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE; |
208102
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){ |
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){ |
208125
|
0 |
0 |
if( apVal==0 ){ |
208127
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
208129
|
0 |
0 |
if( sqlite3_step(pSeek)!=SQLITE_ROW ){ |
208137
|
0 |
0 |
for(iCol=1; rc==SQLITE_OK && iCol<=pConfig->nCol; iCol++){ |
|
0 |
0 |
for(iCol=1; rc==SQLITE_OK && iCol<=pConfig->nCol; iCol++){ |
208138
|
0 |
0 |
if( pConfig->abUnindexed[iCol-1]==0 ){ |
208141
|
0 |
0 |
if( pSeek ){ |
208158
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
208177
|
0 |
0 |
if( p->pConfig->bColumnsize ){ |
208180
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208203
|
0 |
0 |
if( p->bTotalsValid==0 ){ |
208225
|
0 |
0 |
for(i=0; i
|
208228
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208248
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208253
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
208255
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208263
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
208264
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208267
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208291
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
208300
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208303
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208319
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208323
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208327
|
0 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pScan) ){ |
|
0 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pScan) ){ |
208332
|
0 |
0 |
for(ctx.iCol=0; rc==SQLITE_OK && ctx.iColnCol; ctx.iCol++){ |
|
0 |
0 |
for(ctx.iCol=0; rc==SQLITE_OK && ctx.iColnCol; ctx.iCol++){ |
208334
|
0 |
0 |
if( pConfig->abUnindexed[ctx.iCol]==0 ){ |
208348
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208355
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208384
|
0 |
0 |
if( p->pConfig->bColumnsize ){ |
208387
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208393
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208412
|
0 |
0 |
if( pConfig->eContent!=FTS5_CONTENT_NORMAL ){ |
208413
|
0 |
0 |
if( sqlite3_value_type(apVal[1])==SQLITE_INTEGER ){ |
208422
|
0 |
0 |
for(i=1; rc==SQLITE_OK && i<=pConfig->nCol+1; i++){ |
|
0 |
0 |
for(i=1; rc==SQLITE_OK && i<=pConfig->nCol+1; i++){ |
208425
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208452
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208455
|
0 |
0 |
for(ctx.iCol=0; rc==SQLITE_OK && ctx.iColnCol; ctx.iCol++){ |
|
0 |
0 |
for(ctx.iCol=0; rc==SQLITE_OK && ctx.iColnCol; ctx.iCol++){ |
208457
|
0 |
0 |
if( pConfig->abUnindexed[ctx.iCol]==0 ){ |
208472
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208488
|
0 |
0 |
if( zSql==0 ){ |
208493
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208494
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pCnt) ){ |
208539
|
0 |
0 |
if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE; |
208541
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){ |
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){ |
208564
|
0 |
0 |
if( rc==SQLITE_OK && bPresent==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && bPresent==0 ){ |
208570
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && iipConfig->nPrefix; ii++){ |
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && iipConfig->nPrefix; ii++){ |
208573
|
0 |
0 |
if( nByte ){ |
208575
|
0 |
0 |
if( bPresent==0 ){ |
208603
|
0 |
0 |
if( !aTotalSize ) return SQLITE_NOMEM; |
208610
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208612
|
0 |
0 |
while( SQLITE_ROW==sqlite3_step(pScan) ){ |
208616
|
0 |
0 |
if( pConfig->bColumnsize ){ |
208619
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eDetail==FTS5_DETAIL_NONE ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eDetail==FTS5_DETAIL_NONE ){ |
208622
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inCol; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inCol; i++){ |
208623
|
0 |
0 |
if( pConfig->abUnindexed[i] ) continue; |
208626
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){ |
208629
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208638
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize && ctx.szCol!=aColSize[i] ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize && ctx.szCol!=aColSize[i] ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize && ctx.szCol!=aColSize[i] ){ |
208642
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){ |
208650
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
208653
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
208657
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208660
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inCol; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inCol; i++){ |
208661
|
0 |
0 |
if( p->aTotalSize[i]!=aTotalSize[i] ) rc = FTS5_CORRUPT; |
208667
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
208670
|
0 |
0 |
if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT; |
|
0 |
0 |
if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT; |
208672
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
208675
|
0 |
0 |
if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT; |
|
0 |
0 |
if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT; |
208681
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208705
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208726
|
0 |
0 |
if( p->aStmt[eStmt]==0 ){ |
208740
|
0 |
0 |
for(i=0; i
|
208741
|
0 |
0 |
if( iOff>=nBlob ) return 1; |
208762
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208765
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pLookup) ){ |
208768
|
0 |
0 |
if( 0==fts5StorageDecodeSizeArray(aCol, nCol, aBlob, nBlob) ){ |
208773
|
0 |
0 |
if( bCorrupt && rc==SQLITE_OK ){ |
|
0 |
0 |
if( bCorrupt && rc==SQLITE_OK ){ |
208783
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208785
|
0 |
0 |
if( iCol<0 ){ |
208787
|
0 |
0 |
for(i=0; ipConfig->nCol; i++){ |
208790
|
0 |
0 |
}else if( iColpConfig->nCol ){ |
208801
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208813
|
0 |
0 |
if( p->bTotalsValid ){ |
208817
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208837
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208839
|
0 |
0 |
if( pVal ){ |
208848
|
0 |
0 |
if( rc==SQLITE_OK && pVal ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pVal ){ |
208851
|
0 |
0 |
if( rc==SQLITE_OK ){ |
208904
|
0 |
0 |
for(i=0; zArg[i]; i++){ |
208905
|
0 |
0 |
if( (zArg[i] & 0x80)==0 ){ |
208929
|
0 |
0 |
if( nArg%2 ){ |
208933
|
0 |
0 |
if( p==0 ){ |
208939
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
208941
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "tokenchars") ){ |
208944
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "separators") ){ |
208950
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
208964
|
0 |
0 |
for(i=0; i
|
208966
|
0 |
0 |
if( c>='A' && c<='Z' ) c += 32; |
|
0 |
0 |
if( c>='A' && c<='Z' ) c += 32; |
208993
|
0 |
0 |
while( is
|
|
0 |
0 |
while( is
|
208997
|
0 |
0 |
while( is
|
|
0 |
0 |
while( is
|
|
0 |
0 |
while( is
|
209000
|
0 |
0 |
if( is==nText ) break; |
209004
|
0 |
0 |
while( ie
|
|
0 |
0 |
while( ie
|
|
0 |
0 |
while( ie
|
209010
|
0 |
0 |
if( nByte>nFold ){ |
209011
|
0 |
0 |
if( pFold!=aFold ) sqlite3_free(pFold); |
209013
|
0 |
0 |
if( pFold==0 ){ |
209026
|
0 |
0 |
if( pFold!=aFold ) sqlite3_free(pFold); |
209027
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
209108
|
0 |
0 |
if( n>0 ){ |
209110
|
0 |
0 |
if( aNew ){ |
209114
|
0 |
0 |
while( zCsr
|
209117
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
209118
|
0 |
0 |
if( iCode<128 ){ |
209124
|
0 |
0 |
if( bToken!=bTokenChars && sqlite3Fts5UnicodeIsdiacritic(iCode)==0 ){ |
|
0 |
0 |
if( bToken!=bTokenChars && sqlite3Fts5UnicodeIsdiacritic(iCode)==0 ){ |
209126
|
0 |
0 |
for(i=0; i
|
209127
|
0 |
0 |
if( aNew[i]>iCode ) break; |
209149
|
0 |
0 |
if( p->nException>0 ){ |
209154
|
0 |
0 |
while( iHi>=iLo ){ |
209156
|
0 |
0 |
if( iCode==a[iTest] ){ |
209158
|
0 |
0 |
}else if( iCode>a[iTest] ){ |
209173
|
0 |
0 |
if( pTok ){ |
209195
|
0 |
0 |
if( nArg%2 ){ |
209199
|
0 |
0 |
if( p ){ |
209206
|
0 |
0 |
if( p->aFold==0 ){ |
209209
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
209211
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "remove_diacritics") ){ |
209212
|
0 |
0 |
if( (zArg[0]!='0' && zArg[0]!='1') || zArg[1] ){ |
|
0 |
0 |
if( (zArg[0]!='0' && zArg[0]!='1') || zArg[1] ){ |
|
0 |
0 |
if( (zArg[0]!='0' && zArg[0]!='1') || zArg[1] ){ |
209217
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "tokenchars") ){ |
209220
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "separators") ){ |
209229
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
209271
|
0 |
0 |
while( rc==SQLITE_OK ){ |
209279
|
0 |
0 |
if( zCsr>=zTerm ) goto tokenize_done; |
209280
|
0 |
0 |
if( *zCsr & 0x80 ) { |
209284
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
209285
|
0 |
0 |
if( fts5UnicodeIsAlnum(p, iCode) ){ |
209289
|
0 |
0 |
if( a[*zCsr] ){ |
209299
|
0 |
0 |
while( zCsr
|
209303
|
0 |
0 |
if( zOut>pEnd ){ |
209305
|
0 |
0 |
if( aFold==0 ){ |
209317
|
0 |
0 |
if( *zCsr & 0x80 ){ |
209320
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
|
0 |
0 |
READ_UTF8(zCsr, zTerm, iCode); |
209321
|
0 |
0 |
if( fts5UnicodeIsAlnum(p,iCode)||sqlite3Fts5UnicodeIsdiacritic(iCode) ){ |
|
0 |
0 |
if( fts5UnicodeIsAlnum(p,iCode)||sqlite3Fts5UnicodeIsdiacritic(iCode) ){ |
209324
|
0 |
0 |
if( iCode ) WRITE_UTF8(zOut, iCode); |
|
0 |
0 |
if( iCode ) WRITE_UTF8(zOut, iCode); |
|
0 |
0 |
if( iCode ) WRITE_UTF8(zOut, iCode); |
|
0 |
0 |
if( iCode ) WRITE_UTF8(zOut, iCode); |
209328
|
0 |
0 |
}else if( a[*zCsr]==0 ){ |
209333
|
0 |
0 |
if( *zCsr>='A' && *zCsr<='Z' ){ |
|
0 |
0 |
if( *zCsr>='A' && *zCsr<='Z' ){ |
209348
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
209371
|
0 |
0 |
if( pTok ){ |
209373
|
0 |
0 |
if( p->pTokenizer ){ |
209394
|
0 |
0 |
if( nArg>0 ){ |
209399
|
0 |
0 |
if( pRet ){ |
209405
|
0 |
0 |
if( rc==SQLITE_OK ){ |
209406
|
0 |
0 |
int nArg2 = (nArg>0 ? nArg-1 : 0); |
209407
|
0 |
0 |
const char **azArg2 = (nArg2 ? &azArg[1] : 0); |
209411
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
209463
|
0 |
0 |
c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || (bYIsVowel && c=='y') |
|
0 |
0 |
c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || (bYIsVowel && c=='y') |
|
0 |
0 |
c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || (bYIsVowel && c=='y') |
|
0 |
0 |
c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || (bYIsVowel && c=='y') |
|
0 |
0 |
c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || (bYIsVowel && c=='y') |
|
0 |
0 |
c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || (bYIsVowel && c=='y') |
|
0 |
0 |
c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || (bYIsVowel && c=='y') |
209472
|
0 |
0 |
for(i=0; i
|
209473
|
0 |
0 |
if( 0==(bCons = !fts5PorterIsVowel(zStem[i], bCons)) ) break; |
209477
|
0 |
0 |
for(i++; i
|
209478
|
0 |
0 |
if( (bCons = !fts5PorterIsVowel(zStem[i], bCons)) ) return i+1; |
209492
|
0 |
0 |
if( n && fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){ |
|
0 |
0 |
if( n && fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){ |
209502
|
0 |
0 |
if( n && 0==fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){ |
|
0 |
0 |
if( n && 0==fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){ |
209510
|
0 |
0 |
if( zStem[nStem-1]=='w' || zStem[nStem-1]=='x' || zStem[nStem-1]=='y' ){ |
|
0 |
0 |
if( zStem[nStem-1]=='w' || zStem[nStem-1]=='x' || zStem[nStem-1]=='y' ){ |
|
0 |
0 |
if( zStem[nStem-1]=='w' || zStem[nStem-1]=='x' || zStem[nStem-1]=='y' ){ |
209516
|
0 |
0 |
for(i=0; i
|
209528
|
0 |
0 |
return (zStem[nStem-1]=='s' || zStem[nStem-1]=='t') |
209529
|
0 |
0 |
&& fts5Porter_MGt1(zStem, nStem); |
|
0 |
0 |
&& fts5Porter_MGt1(zStem, nStem); |
209535
|
0 |
0 |
for(i=0; i
|
209536
|
0 |
0 |
if( fts5PorterIsVowel(zStem[i], i>0) ){ |
209555
|
0 |
0 |
if( nBuf>2 && 0==memcmp("al", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
if( nBuf>2 && 0==memcmp("al", &aBuf[nBuf-2], 2) ){ |
209556
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-2) ){ |
209563
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ance", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ance", &aBuf[nBuf-4], 4) ){ |
209564
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){ |
209567
|
0 |
0 |
}else if( nBuf>4 && 0==memcmp("ence", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
}else if( nBuf>4 && 0==memcmp("ence", &aBuf[nBuf-4], 4) ){ |
209568
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){ |
209575
|
0 |
0 |
if( nBuf>2 && 0==memcmp("er", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
if( nBuf>2 && 0==memcmp("er", &aBuf[nBuf-2], 2) ){ |
209576
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-2) ){ |
209583
|
0 |
0 |
if( nBuf>2 && 0==memcmp("ic", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
if( nBuf>2 && 0==memcmp("ic", &aBuf[nBuf-2], 2) ){ |
209584
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-2) ){ |
209591
|
0 |
0 |
if( nBuf>4 && 0==memcmp("able", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("able", &aBuf[nBuf-4], 4) ){ |
209592
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){ |
209595
|
0 |
0 |
}else if( nBuf>4 && 0==memcmp("ible", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
}else if( nBuf>4 && 0==memcmp("ible", &aBuf[nBuf-4], 4) ){ |
209596
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){ |
209603
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ant", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ant", &aBuf[nBuf-3], 3) ){ |
209604
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
209607
|
0 |
0 |
}else if( nBuf>5 && 0==memcmp("ement", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
}else if( nBuf>5 && 0==memcmp("ement", &aBuf[nBuf-5], 5) ){ |
209608
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-5) ){ |
209611
|
0 |
0 |
}else if( nBuf>4 && 0==memcmp("ment", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
}else if( nBuf>4 && 0==memcmp("ment", &aBuf[nBuf-4], 4) ){ |
209612
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){ |
209615
|
0 |
0 |
}else if( nBuf>3 && 0==memcmp("ent", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
}else if( nBuf>3 && 0==memcmp("ent", &aBuf[nBuf-3], 3) ){ |
209616
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
209623
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ion", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ion", &aBuf[nBuf-3], 3) ){ |
209624
|
0 |
0 |
if( fts5Porter_MGt1_and_S_or_T(aBuf, nBuf-3) ){ |
209627
|
0 |
0 |
}else if( nBuf>2 && 0==memcmp("ou", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
}else if( nBuf>2 && 0==memcmp("ou", &aBuf[nBuf-2], 2) ){ |
209628
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-2) ){ |
209635
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ism", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ism", &aBuf[nBuf-3], 3) ){ |
209636
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
209643
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ate", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ate", &aBuf[nBuf-3], 3) ){ |
209644
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
209647
|
0 |
0 |
}else if( nBuf>3 && 0==memcmp("iti", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
}else if( nBuf>3 && 0==memcmp("iti", &aBuf[nBuf-3], 3) ){ |
209648
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
209655
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ous", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ous", &aBuf[nBuf-3], 3) ){ |
209656
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
209663
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ive", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ive", &aBuf[nBuf-3], 3) ){ |
209664
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
209671
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ize", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ize", &aBuf[nBuf-3], 3) ){ |
209672
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
209689
|
0 |
0 |
if( nBuf>2 && 0==memcmp("at", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
if( nBuf>2 && 0==memcmp("at", &aBuf[nBuf-2], 2) ){ |
209697
|
0 |
0 |
if( nBuf>2 && 0==memcmp("bl", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
if( nBuf>2 && 0==memcmp("bl", &aBuf[nBuf-2], 2) ){ |
209705
|
0 |
0 |
if( nBuf>2 && 0==memcmp("iz", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
if( nBuf>2 && 0==memcmp("iz", &aBuf[nBuf-2], 2) ){ |
209723
|
0 |
0 |
if( nBuf>7 && 0==memcmp("ational", &aBuf[nBuf-7], 7) ){ |
|
0 |
0 |
if( nBuf>7 && 0==memcmp("ational", &aBuf[nBuf-7], 7) ){ |
209724
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){ |
209728
|
0 |
0 |
}else if( nBuf>6 && 0==memcmp("tional", &aBuf[nBuf-6], 6) ){ |
|
0 |
0 |
}else if( nBuf>6 && 0==memcmp("tional", &aBuf[nBuf-6], 6) ){ |
209729
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-6) ){ |
209737
|
0 |
0 |
if( nBuf>4 && 0==memcmp("enci", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("enci", &aBuf[nBuf-4], 4) ){ |
209738
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
209742
|
0 |
0 |
}else if( nBuf>4 && 0==memcmp("anci", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
}else if( nBuf>4 && 0==memcmp("anci", &aBuf[nBuf-4], 4) ){ |
209743
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
209751
|
0 |
0 |
if( nBuf>4 && 0==memcmp("izer", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("izer", &aBuf[nBuf-4], 4) ){ |
209752
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
209760
|
0 |
0 |
if( nBuf>4 && 0==memcmp("logi", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("logi", &aBuf[nBuf-4], 4) ){ |
209761
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
209769
|
0 |
0 |
if( nBuf>3 && 0==memcmp("bli", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("bli", &aBuf[nBuf-3], 3) ){ |
209770
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-3) ){ |
209774
|
0 |
0 |
}else if( nBuf>4 && 0==memcmp("alli", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
}else if( nBuf>4 && 0==memcmp("alli", &aBuf[nBuf-4], 4) ){ |
209775
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
209779
|
0 |
0 |
}else if( nBuf>5 && 0==memcmp("entli", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
}else if( nBuf>5 && 0==memcmp("entli", &aBuf[nBuf-5], 5) ){ |
209780
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
209784
|
0 |
0 |
}else if( nBuf>3 && 0==memcmp("eli", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
}else if( nBuf>3 && 0==memcmp("eli", &aBuf[nBuf-3], 3) ){ |
209785
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-3) ){ |
209789
|
0 |
0 |
}else if( nBuf>5 && 0==memcmp("ousli", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
}else if( nBuf>5 && 0==memcmp("ousli", &aBuf[nBuf-5], 5) ){ |
209790
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
209798
|
0 |
0 |
if( nBuf>7 && 0==memcmp("ization", &aBuf[nBuf-7], 7) ){ |
|
0 |
0 |
if( nBuf>7 && 0==memcmp("ization", &aBuf[nBuf-7], 7) ){ |
209799
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){ |
209803
|
0 |
0 |
}else if( nBuf>5 && 0==memcmp("ation", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
}else if( nBuf>5 && 0==memcmp("ation", &aBuf[nBuf-5], 5) ){ |
209804
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
209808
|
0 |
0 |
}else if( nBuf>4 && 0==memcmp("ator", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
}else if( nBuf>4 && 0==memcmp("ator", &aBuf[nBuf-4], 4) ){ |
209809
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
209817
|
0 |
0 |
if( nBuf>5 && 0==memcmp("alism", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
if( nBuf>5 && 0==memcmp("alism", &aBuf[nBuf-5], 5) ){ |
209818
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
209822
|
0 |
0 |
}else if( nBuf>7 && 0==memcmp("iveness", &aBuf[nBuf-7], 7) ){ |
|
0 |
0 |
}else if( nBuf>7 && 0==memcmp("iveness", &aBuf[nBuf-7], 7) ){ |
209823
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){ |
209827
|
0 |
0 |
}else if( nBuf>7 && 0==memcmp("fulness", &aBuf[nBuf-7], 7) ){ |
|
0 |
0 |
}else if( nBuf>7 && 0==memcmp("fulness", &aBuf[nBuf-7], 7) ){ |
209828
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){ |
209832
|
0 |
0 |
}else if( nBuf>7 && 0==memcmp("ousness", &aBuf[nBuf-7], 7) ){ |
|
0 |
0 |
}else if( nBuf>7 && 0==memcmp("ousness", &aBuf[nBuf-7], 7) ){ |
209833
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){ |
209841
|
0 |
0 |
if( nBuf>5 && 0==memcmp("aliti", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
if( nBuf>5 && 0==memcmp("aliti", &aBuf[nBuf-5], 5) ){ |
209842
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
209846
|
0 |
0 |
}else if( nBuf>5 && 0==memcmp("iviti", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
}else if( nBuf>5 && 0==memcmp("iviti", &aBuf[nBuf-5], 5) ){ |
209847
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
209851
|
0 |
0 |
}else if( nBuf>6 && 0==memcmp("biliti", &aBuf[nBuf-6], 6) ){ |
|
0 |
0 |
}else if( nBuf>6 && 0==memcmp("biliti", &aBuf[nBuf-6], 6) ){ |
209852
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-6) ){ |
209870
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ical", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ical", &aBuf[nBuf-4], 4) ){ |
209871
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
209879
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ness", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ness", &aBuf[nBuf-4], 4) ){ |
209880
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
209887
|
0 |
0 |
if( nBuf>5 && 0==memcmp("icate", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
if( nBuf>5 && 0==memcmp("icate", &aBuf[nBuf-5], 5) ){ |
209888
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
209892
|
0 |
0 |
}else if( nBuf>5 && 0==memcmp("iciti", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
}else if( nBuf>5 && 0==memcmp("iciti", &aBuf[nBuf-5], 5) ){ |
209893
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
209901
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ful", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ful", &aBuf[nBuf-3], 3) ){ |
209902
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-3) ){ |
209909
|
0 |
0 |
if( nBuf>5 && 0==memcmp("ative", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
if( nBuf>5 && 0==memcmp("ative", &aBuf[nBuf-5], 5) ){ |
209910
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
209917
|
0 |
0 |
if( nBuf>5 && 0==memcmp("alize", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
if( nBuf>5 && 0==memcmp("alize", &aBuf[nBuf-5], 5) ){ |
209918
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
209936
|
0 |
0 |
if( nBuf>3 && 0==memcmp("eed", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("eed", &aBuf[nBuf-3], 3) ){ |
209937
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-3) ){ |
209941
|
0 |
0 |
}else if( nBuf>2 && 0==memcmp("ed", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
}else if( nBuf>2 && 0==memcmp("ed", &aBuf[nBuf-2], 2) ){ |
209942
|
0 |
0 |
if( fts5Porter_Vowel(aBuf, nBuf-2) ){ |
209950
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ing", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ing", &aBuf[nBuf-3], 3) ){ |
209951
|
0 |
0 |
if( fts5Porter_Vowel(aBuf, nBuf-3) ){ |
209969
|
0 |
0 |
if( aBuf[nBuf-1]=='s' ){ |
209970
|
0 |
0 |
if( aBuf[nBuf-2]=='e' ){ |
209971
|
0 |
0 |
if( (nBuf>4 && aBuf[nBuf-4]=='s' && aBuf[nBuf-3]=='s') |
|
0 |
0 |
if( (nBuf>4 && aBuf[nBuf-4]=='s' && aBuf[nBuf-3]=='s') |
|
0 |
0 |
if( (nBuf>4 && aBuf[nBuf-4]=='s' && aBuf[nBuf-3]=='s') |
209972
|
0 |
0 |
|| (nBuf>3 && aBuf[nBuf-3]=='i' ) |
|
0 |
0 |
|| (nBuf>3 && aBuf[nBuf-3]=='i' ) |
209979
|
0 |
0 |
else if( aBuf[nBuf-2]!='s' ){ |
209998
|
0 |
0 |
if( nToken>FTS5_PORTER_MAX_TOKEN || nToken<3 ) goto pass_through; |
|
0 |
0 |
if( nToken>FTS5_PORTER_MAX_TOKEN || nToken<3 ) goto pass_through; |
210005
|
0 |
0 |
if( fts5PorterStep1B(aBuf, &nBuf) ){ |
210006
|
0 |
0 |
if( fts5PorterStep1B2(aBuf, &nBuf)==0 ){ |
210008
|
0 |
0 |
if( fts5PorterIsVowel(c, 0)==0 |
210009
|
0 |
0 |
&& c!='l' && c!='s' && c!='z' && c==aBuf[nBuf-2] |
|
0 |
0 |
&& c!='l' && c!='s' && c!='z' && c==aBuf[nBuf-2] |
|
0 |
0 |
&& c!='l' && c!='s' && c!='z' && c==aBuf[nBuf-2] |
|
0 |
0 |
&& c!='l' && c!='s' && c!='z' && c==aBuf[nBuf-2] |
210012
|
0 |
0 |
}else if( fts5Porter_MEq1(aBuf, nBuf) && fts5Porter_Ostar(aBuf, nBuf) ){ |
|
0 |
0 |
}else if( fts5Porter_MEq1(aBuf, nBuf) && fts5Porter_Ostar(aBuf, nBuf) ){ |
210019
|
0 |
0 |
if( aBuf[nBuf-1]=='y' && fts5Porter_Vowel(aBuf, nBuf-1) ){ |
|
0 |
0 |
if( aBuf[nBuf-1]=='y' && fts5Porter_Vowel(aBuf, nBuf-1) ){ |
210030
|
0 |
0 |
if( aBuf[nBuf-1]=='e' ){ |
210031
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-1) |
210032
|
0 |
0 |
|| (fts5Porter_MEq1(aBuf, nBuf-1) && !fts5Porter_Ostar(aBuf, nBuf-1)) |
|
0 |
0 |
|| (fts5Porter_MEq1(aBuf, nBuf-1) && !fts5Porter_Ostar(aBuf, nBuf-1)) |
210039
|
0 |
0 |
if( nBuf>1 && aBuf[nBuf-1]=='l' |
|
0 |
0 |
if( nBuf>1 && aBuf[nBuf-1]=='l' |
210040
|
0 |
0 |
&& aBuf[nBuf-2]=='l' && fts5Porter_MGt1(aBuf, nBuf-1) |
|
0 |
0 |
&& aBuf[nBuf-2]=='l' && fts5Porter_MGt1(aBuf, nBuf-1) |
210087
|
1048 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
786 |
262 |
for(i=0; rc==SQLITE_OK && i
|
210228
|
0 |
0 |
if( (unsigned int)c<128 ){ |
210230
|
0 |
0 |
}else if( (unsigned int)c<(1<<22) ){ |
210235
|
0 |
0 |
while( iHi>=iLo ){ |
210237
|
0 |
0 |
if( key >= aEntry[iTest] ){ |
210292
|
0 |
0 |
while( iHi>=iLo ){ |
210294
|
0 |
0 |
if( key >= aDia[iTest] ){ |
210302
|
0 |
0 |
return ((c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : (int)aChar[iRes]); |
210313
|
0 |
0 |
if( c<768 || c>817 ) return 0; |
|
0 |
0 |
if( c<768 || c>817 ) return 0; |
210314
|
0 |
0 |
return (c < 768+32) ? |
210425
|
0 |
0 |
if( c<128 ){ |
210426
|
0 |
0 |
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
|
0 |
0 |
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
210427
|
0 |
0 |
}else if( c<65536 ){ |
210434
|
0 |
0 |
while( iHi>=iLo ){ |
210437
|
0 |
0 |
if( cmp>=0 ){ |
210447
|
0 |
0 |
if( c<(p->iCode + p->nRange) && 0==(0x01 & p->flags & (p->iCode ^ c)) ){ |
|
0 |
0 |
if( c<(p->iCode + p->nRange) && 0==(0x01 & p->flags & (p->iCode ^ c)) ){ |
210452
|
0 |
0 |
if( bRemoveDiacritic ) ret = fts5_remove_diacritic(ret); |
210455
|
0 |
0 |
else if( c>=66560 && c<66600 ){ |
|
0 |
0 |
else if( c>=66560 && c<66600 ){ |
210491
|
0 |
0 |
if (!(a&0x80)) |
210502
|
0 |
0 |
if (!(b&0x80)) |
210516
|
0 |
0 |
if (!(a&0x80)) |
210568
|
0 |
0 |
if (!(a&0x80)) |
210577
|
0 |
0 |
if (!(b&0x80)) |
210594
|
0 |
0 |
if (!(a&0x80)) |
210610
|
0 |
0 |
if (!(b&0x80)) |
210634
|
0 |
0 |
if (!(a&0x80)) |
210655
|
0 |
0 |
if (!(b&0x80)) |
210671
|
0 |
0 |
if (!(a&0x80)) |
210688
|
0 |
0 |
if (!(b&0x80)) |
210760
|
0 |
0 |
if( v & (((u64)0xff000000)<<32) ){ |
210763
|
0 |
0 |
for(i=7; i>=0; i--){ |
210773
|
0 |
0 |
}while( v!=0 ); |
210776
|
0 |
0 |
for(i=0, j=n-1; j>=0; j--, i++){ |
210783
|
0 |
0 |
if( v<=0x7f ){ |
210787
|
0 |
0 |
if( v<=0x3fff ){ |
210801
|
0 |
0 |
if( iVal<(1 << 14) ) return 2; |
210802
|
0 |
0 |
if( iVal<(1 << 21) ) return 3; |
210803
|
0 |
0 |
if( iVal<(1 << 28) ) return 4; |
210913
|
0 |
0 |
if( rc==SQLITE_OK ){ |
210915
|
0 |
0 |
if( sqlite3_stricmp(zCopy, "col")==0 ){ |
210919
|
0 |
0 |
if( sqlite3_stricmp(zCopy, "row")==0 ){ |
210922
|
0 |
0 |
if( sqlite3_stricmp(zCopy, "instance")==0 ){ |
210993
|
0 |
0 |
bDb = (argc==6 && strlen(argv[1])==4 && memcmp("temp", argv[1], 4)==0); |
|
0 |
0 |
bDb = (argc==6 && strlen(argv[1])==4 && memcmp("temp", argv[1], 4)==0); |
|
0 |
0 |
bDb = (argc==6 && strlen(argv[1])==4 && memcmp("temp", argv[1], 4)==0); |
210995
|
0 |
0 |
if( argc!=5 && bDb==0 ){ |
|
0 |
0 |
if( argc!=5 && bDb==0 ){ |
211000
|
0 |
0 |
const char *zDb = bDb ? argv[3] : argv[1]; |
211001
|
0 |
0 |
const char *zTab = bDb ? argv[4] : argv[3]; |
211002
|
0 |
0 |
const char *zType = bDb ? argv[5] : argv[4]; |
211008
|
0 |
0 |
if( rc==SQLITE_OK ){ |
211015
|
0 |
0 |
if( pRet ){ |
211083
|
0 |
0 |
for(i=0; inConstraint; i++){ |
211085
|
0 |
0 |
if( p->usable==0 ) continue; |
211086
|
0 |
0 |
if( p->iColumn==0 ){ /* term column */ |
211087
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_EQ ) iTermEq = i; |
211088
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_LE ) iTermLe = i; |
211089
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_LT ) iTermLe = i; |
211090
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_GE ) iTermGe = i; |
211091
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_GT ) iTermGe = i; |
211095
|
0 |
0 |
if( iTermEq>=0 ){ |
211101
|
0 |
0 |
if( iTermGe>=0 ){ |
211106
|
0 |
0 |
if( iTermLe>=0 ){ |
211118
|
0 |
0 |
if( pInfo->nOrderBy==1 |
211119
|
0 |
0 |
&& pInfo->aOrderBy[0].iColumn==0 |
211120
|
0 |
0 |
&& pInfo->aOrderBy[0].desc==0 |
211148
|
0 |
0 |
if( zSql ){ |
211153
|
0 |
0 |
if( rc==SQLITE_ERROR ) rc = SQLITE_OK; |
211155
|
0 |
0 |
if( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){ |
|
0 |
0 |
if( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){ |
211160
|
0 |
0 |
if( rc==SQLITE_OK && pIndex==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pIndex==0 ){ |
211163
|
0 |
0 |
if( rc==SQLITE_OK ){ |
211171
|
0 |
0 |
if( rc==SQLITE_OK ){ |
211176
|
0 |
0 |
if( pCsr ){ |
211215
|
0 |
0 |
if( sqlite3Fts5IterEof(pCsr->pIter) ){ |
211221
|
0 |
0 |
if( pCsr->nLeTerm>=0 ){ |
211224
|
0 |
0 |
if( bCmp<0 || (bCmp==0 && pCsr->nLeTerm
|
|
0 |
0 |
if( bCmp<0 || (bCmp==0 && pCsr->nLeTerm
|
|
0 |
0 |
if( bCmp<0 || (bCmp==0 && pCsr->nLeTerm
|
211241
|
0 |
0 |
while( eDetail==FTS5_DETAIL_NONE |
211242
|
0 |
0 |
|| sqlite3Fts5PoslistNext64(pIter->pData, pIter->nData, po, pp) |
211248
|
0 |
0 |
if( rc==SQLITE_OK ){ |
211250
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ) break; |
211252
|
0 |
0 |
if( rc ){ |
211272
|
0 |
0 |
if( pTab->eType==FTS5_VOCAB_INSTANCE ){ |
211276
|
0 |
0 |
if( pTab->eType==FTS5_VOCAB_COL ){ |
211277
|
0 |
0 |
for(pCsr->iCol++; pCsr->iColiCol++){ |
211278
|
0 |
0 |
if( pCsr->aDoc[pCsr->iCol] ) break; |
211282
|
0 |
0 |
if( pTab->eType!=FTS5_VOCAB_COL || pCsr->iCol>=nCol ){ |
|
0 |
0 |
if( pTab->eType!=FTS5_VOCAB_COL || pCsr->iCol>=nCol ){ |
211283
|
0 |
0 |
if( sqlite3Fts5IterEof(pCsr->pIter) ){ |
211290
|
0 |
0 |
if( pCsr->nLeTerm>=0 ){ |
211293
|
0 |
0 |
if( bCmp<0 || (bCmp==0 && pCsr->nLeTerm
|
|
0 |
0 |
if( bCmp<0 || (bCmp==0 && pCsr->nLeTerm
|
|
0 |
0 |
if( bCmp<0 || (bCmp==0 && pCsr->nLeTerm
|
211305
|
0 |
0 |
while( rc==SQLITE_OK ){ |
211316
|
0 |
0 |
if( eDetail==FTS5_DETAIL_FULL ){ |
211317
|
0 |
0 |
while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff, &iPos) ){ |
211325
|
0 |
0 |
if( eDetail==FTS5_DETAIL_FULL ){ |
211327
|
0 |
0 |
while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff, &iPos) ){ |
211330
|
0 |
0 |
if( iCol!=ii ){ |
211331
|
0 |
0 |
if( ii>=nCol ){ |
211339
|
0 |
0 |
}else if( eDetail==FTS5_DETAIL_COLUMNS ){ |
211340
|
0 |
0 |
while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff,&iPos) ){ |
211342
|
0 |
0 |
if( iPos>=nCol ){ |
211359
|
0 |
0 |
if( rc==SQLITE_OK ){ |
211362
|
0 |
0 |
if( pTab->eType==FTS5_VOCAB_INSTANCE ) break; |
211364
|
0 |
0 |
if( rc==SQLITE_OK ){ |
211366
|
0 |
0 |
if( nTerm!=pCsr->term.n || memcmp(zTerm, pCsr->term.p, nTerm) ){ |
|
0 |
0 |
if( nTerm!=pCsr->term.n || memcmp(zTerm, pCsr->term.p, nTerm) ){ |
211369
|
0 |
0 |
if( sqlite3Fts5IterEof(pCsr->pIter) ) break; |
211375
|
0 |
0 |
if( rc==SQLITE_OK && pCsr->bEof==0 && pTab->eType==FTS5_VOCAB_COL ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pCsr->bEof==0 && pTab->eType==FTS5_VOCAB_COL ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pCsr->bEof==0 && pTab->eType==FTS5_VOCAB_COL ){ |
211376
|
0 |
0 |
while( pCsr->aDoc[pCsr->iCol]==0 ) pCsr->iCol++; |
211409
|
0 |
0 |
if( idxNum & FTS5_VOCAB_TERM_EQ ) pEq = apVal[iVal++]; |
211410
|
0 |
0 |
if( idxNum & FTS5_VOCAB_TERM_GE ) pGe = apVal[iVal++]; |
211411
|
0 |
0 |
if( idxNum & FTS5_VOCAB_TERM_LE ) pLe = apVal[iVal++]; |
211413
|
0 |
0 |
if( pEq ){ |
211418
|
0 |
0 |
if( pGe ){ |
211422
|
0 |
0 |
if( pLe ){ |
211426
|
0 |
0 |
if( pCsr->zLeTerm==0 ){ |
211434
|
0 |
0 |
if( rc==SQLITE_OK ){ |
211437
|
0 |
0 |
if( rc==SQLITE_OK && eType==FTS5_VOCAB_INSTANCE ){ |
|
0 |
0 |
if( rc==SQLITE_OK && eType==FTS5_VOCAB_INSTANCE ){ |
211440
|
0 |
0 |
if( rc==SQLITE_OK |
211441
|
0 |
0 |
&& !pCsr->bEof |
211442
|
0 |
0 |
&& (eType!=FTS5_VOCAB_INSTANCE || pCsr->pConfig->eDetail!=FTS5_DETAIL_NONE) |
|
0 |
0 |
&& (eType!=FTS5_VOCAB_INSTANCE || pCsr->pConfig->eDetail!=FTS5_DETAIL_NONE) |
211469
|
0 |
0 |
if( iCol==0 ){ |
211473
|
0 |
0 |
}else if( eType==FTS5_VOCAB_COL ){ |
211475
|
0 |
0 |
if( iCol==1 ){ |
211476
|
0 |
0 |
if( eDetail!=FTS5_DETAIL_NONE ){ |
211480
|
0 |
0 |
}else if( iCol==2 ){ |
211485
|
0 |
0 |
}else if( eType==FTS5_VOCAB_ROW ){ |
211487
|
0 |
0 |
if( iCol==1 ){ |
211500
|
0 |
0 |
if( eDetail==FTS5_DETAIL_FULL ){ |
211502
|
0 |
0 |
}else if( eDetail==FTS5_DETAIL_COLUMNS ){ |
211505
|
0 |
0 |
if( ii>=0 && iipConfig->nCol ){ |
|
0 |
0 |
if( ii>=0 && iipConfig->nCol ){ |
211513
|
0 |
0 |
if( eDetail==FTS5_DETAIL_FULL ){ |
211522
|
0 |
0 |
if( iVal>0 ) sqlite3_result_int64(pCtx, iVal); |
211918
|
0 |
0 |
if( !db->autoCommit ){ |
211922
|
0 |
0 |
if( db->nVdbeActive>1 ){ |
211960
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
211977
|
0 |
0 |
if( db->nextPagesize ){ |
211982
|
0 |
0 |
if( nKey ) db->nextPagesize = 0; |
211995
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
211997
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
212000
|
0 |
0 |
if( sqlite3PagerGetJournalMode(sqlite3BtreePager(pMain)) |
212005
|
0 |
0 |
if( sqlite3BtreeSetPageSize(pTemp, sqlite3BtreeGetPageSize(pMain), nRes, 0) |
212006
|
0 |
0 |
|| (!isMemDb && sqlite3BtreeSetPageSize(pTemp, db->nextPagesize, nRes, 0)) |
|
0 |
0 |
|| (!isMemDb && sqlite3BtreeSetPageSize(pTemp, db->nextPagesize, nRes, 0)) |
212007
|
0 |
0 |
|| NEVER(db->mallocFailed) |
212014
|
0 |
0 |
sqlite3BtreeSetAutoVacuum(pTemp, db->nextAutovac>=0 ? db->nextAutovac : |
212028
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
212034
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
212050
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
212064
|
0 |
0 |
if( rc ) goto end_of_vacuum; |
212094
|
0 |
0 |
for(i=0; i
|
212099
|
0 |
0 |
if( NEVER(rc!=SQLITE_OK) ) goto end_of_vacuum; |
212103
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
212105
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
212133
|
0 |
0 |
if( pDb ){ |
212198
|
0 |
0 |
for (i = 0; i < 10; i++) { |
212211
|
0 |
0 |
for (i = 0; i < 16; i++) { |
212246
|
0 |
0 |
while (n >= 64) { |
212248
|
0 |
0 |
for (i = 0; i < 64; i++) { |
212256
|
0 |
0 |
if (n > 0) { |
212258
|
0 |
0 |
for (i = 0; i < n; i++) { |
212288
|
0 |
0 |
while (n >= 16) { |
212315
|
0 |
0 |
if (n) { |
212316
|
0 |
0 |
for (i = 0; i < n; i++) buf[i] = msg[i]; |
212318
|
0 |
0 |
while (i < 16) buf[i++] = 0; |
212472
|
0 |
0 |
if (n < 64 || ctx->n) { |
|
0 |
0 |
if (n < 64 || ctx->n) { |
212473
|
0 |
0 |
int i, j = (ctx->n + n < 64) ? n : 64 - ctx->n; |
212474
|
0 |
0 |
for (i = 0; i < j; i++) { |
212477
|
0 |
0 |
if ((ctx->n += j) < 64) |
212486
|
0 |
0 |
while (n >= 64) { |
212493
|
0 |
0 |
if (n) { |
212495
|
0 |
0 |
while (i < n) { |
212521
|
0 |
0 |
for (i = 1; (ctx->n + i + 8) % 64; buf[i++] = 0); |
212540
|
0 |
0 |
if (m > 64) { |
212553
|
0 |
0 |
for (i = 0; i < 64; i++) { |
212567
|
0 |
0 |
for (i = 1; dklen; i++) { |
212581
|
0 |
0 |
for (j = 1; j < iter; j++) { |
212588
|
0 |
0 |
for (k = 0; k < len; k++) { |
212597
|
0 |
0 |
for (i = 0; i < 64; i++) { /* for truly paranoid people, yes */ |
212627
|
0 |
0 |
} while (fd == -1 && errno == EINTR); |
|
0 |
0 |
} while (fd == -1 && errno == EINTR); |
212628
|
0 |
0 |
if (fd == -1) |
212633
|
0 |
0 |
if (fstat(fd, &st) == -1 || !S_ISCHR(st.st_mode) |
|
0 |
0 |
if (fstat(fd, &st) == -1 || !S_ISCHR(st.st_mode) |
212635
|
0 |
0 |
|| ioctl(fd, RNDGETENTCNT, &count) == -1 |
212643
|
0 |
0 |
for (i = 0; i < n; i += ret) { |
212644
|
0 |
0 |
while ((ret = read(fd, (char *)buf + i, n - i)) == -1) { |
212645
|
0 |
0 |
if (errno != EAGAIN && errno != EINTR) { |
|
0 |
0 |
if (errno != EAGAIN && errno != EINTR) { |
212654
|
0 |
0 |
for (i = 0; i < n; i++) { |
212655
|
0 |
0 |
if (((unsigned char *)buf)[i] != 0) { |
212672
|
0 |
0 |
if (syscall(SYS_getrandom, buf, n, 0) == n) |
212710
|
0 |
0 |
while (n > 0) { |
212711
|
0 |
0 |
if (available == 0) { |
212712
|
0 |
0 |
if (counter == 0xFFFFFFFF) { |
212713
|
0 |
0 |
if (entropy(key, sizeof(key)) != sizeof(key)) |
212715
|
0 |
0 |
if (entropy(nonce, sizeof(nonce)) != sizeof(nonce)) |
212746
|
0 |
0 |
if ((codec = sqlite3_malloc(sizeof(Codec)))) { |
212761
|
0 |
0 |
if ((codec = codec_new(src->zKey, src->nKey))) { |
212762
|
0 |
0 |
codec->reader = (src->reader == src) ? codec : src->reader; |
212763
|
0 |
0 |
codec->writer = (src->writer == src) ? codec : src->writer; |
212774
|
0 |
0 |
while (codec->nKey) ((volatile char *)codec->zKey)[--codec->nKey] = '\0'; |
212780
|
0 |
0 |
if (pcodec) { |
212784
|
0 |
0 |
if (codec->zKey) { |
212786
|
0 |
0 |
for (i = 0; i < codec->nKey; p[i++] = '\0'); |
212789
|
0 |
0 |
if (codec->pagebuf) { |
212791
|
0 |
0 |
for (i = 0; i < codec->pagesize; p[i++] = '\0'); |
212795
|
0 |
0 |
for (i = 0; i < sizeof(Codec); p[i++] = '\0'); |
212855
|
0 |
0 |
if (reader) { |
212857
|
0 |
0 |
if (page == 1 && reader->zKey) { |
|
0 |
0 |
if (page == 1 && reader->zKey) { |
212869
|
0 |
0 |
if (poly1305_tagcmp(data + n + PAGE_NONCE_LEN, tag) != 0) |
212874
|
0 |
0 |
if (page == 1) memcpy(data, "SQLite format 3", 16); |
212882
|
0 |
0 |
if (writer) { |
212894
|
0 |
0 |
if (page == 1) memcpy(data, writer->salt, 16); |
212910
|
0 |
0 |
if (count > 0) { |
212914
|
0 |
0 |
if (sqlite3PagerGet(pager, 1, &page, 0) == SQLITE_OK) { |
212915
|
0 |
0 |
if (!memcmp(page->pData, "SQLite format 3", 16)) |
212921
|
0 |
0 |
} else if (codec && codec->zKey) { |
|
0 |
0 |
} else if (codec && codec->zKey) { |
212941
|
0 |
0 |
if (!codec) { |
212949
|
0 |
0 |
if (!codec->pagebuf || codec->pagesize != pagesize) { |
|
0 |
0 |
if (!codec->pagebuf || codec->pagesize != pagesize) { |
212951
|
0 |
0 |
if (!new) { |
212955
|
0 |
0 |
if (codec->pagebuf) { |
212957
|
0 |
0 |
while (i < codec->pagesize) |
212969
|
0 |
0 |
if (pager->nReserve != PAGE_RESERVED_LEN) { |
212998
|
0 |
0 |
if (!nKey) { |
213002
|
0 |
0 |
} else if (zKey) { |
213004
|
0 |
0 |
if ((codec = codec_new(zKey, nKey))) |
213006
|
0 |
0 |
} else if (nDb != 0) { |
213009
|
0 |
0 |
if (codec && (codec = codec_dup(codec))) { |
|
0 |
0 |
if (codec && (codec = codec_dup(codec))) { |
213025
|
0 |
0 |
if (zDbName) { |
213026
|
0 |
0 |
for (i = 0; i < db->nDb; i++) { |
213027
|
0 |
0 |
if (!strcmp(db->aDb[i].zDbSName, zDbName)) |
213051
|
0 |
0 |
if (!db || (!nKey && !zKey)) |
|
0 |
0 |
if (!db || (!nKey && !zKey)) |
|
0 |
0 |
if (!db || (!nKey && !zKey)) |
213056
|
0 |
0 |
if ((pBt = db->aDb[(nDb = db_index_of(db, zDbName))].pBt)) { |
213063
|
0 |
0 |
if (!nKey) { |
213065
|
0 |
0 |
if (reader) { |
213068
|
0 |
0 |
if (rc == SQLITE_OK) { |
213080
|
0 |
0 |
if ((codec = codec_new(zKey, nKey))) { |
213082
|
0 |
0 |
if ((codec->pagebuf = sqlite3_malloc(codec->pagesize))) { |
213087
|
0 |
0 |
if (!codec || !codec->pagebuf) { |
|
0 |
0 |
if (!codec || !codec->pagebuf) { |
213093
|
0 |
0 |
if (!reader) { |
213096
|
0 |
0 |
if ((rc = codec_set_to(codec, pBt)) == SQLITE_OK) { |
213098
|
0 |
0 |
if (rc == SQLITE_OK) { |
213110
|
0 |
0 |
for (pgno = 1; rc == SQLITE_OK && pgno <= pager->dbSize; pgno++) { |
|
0 |
0 |
for (pgno = 1; rc == SQLITE_OK && pgno <= pager->dbSize; pgno++) { |
213112
|
0 |
0 |
if (pgno == PENDING_BYTE_PAGE(pager)) |
213114
|
0 |
0 |
if ((rc = sqlite3PagerGet(pager, pgno, &page, 0)) == SQLITE_OK) { |
213119
|
0 |
0 |
if (rc == SQLITE_OK) { |