line |
true |
false |
branch |
22962
|
77197 |
191279 |
if( wsdStat.nowValue[op]>wsdStat.mxValue[op] ){ |
22992
|
792 |
137279 |
if( newValue>wsdStat.mxValue[op] ){ |
23008
|
11 |
0 |
if( op<0 || op>=ArraySize(wsdStat.nowValue) ){ |
|
0 |
11 |
if( op<0 || op>=ArraySize(wsdStat.nowValue) ){ |
23014
|
3 |
8 |
pMutex = statMutex[op] ? sqlite3Pcache1Mutex() : sqlite3MallocMutex(); |
23018
|
0 |
11 |
if( resetFlag ){ |
23032
|
11 |
0 |
if( rc==0 ){ |
23044
|
244 |
1252 |
while( p ){ |
23061
|
2 |
311 |
if( pHighwater ) *pHighwater = db->lookaside.nSlot - nInit; |
23085
|
0 |
2 |
if( resetFlag ){ |
23087
|
0 |
0 |
if( p ){ |
23088
|
0 |
0 |
while( p->pNext ) p = p->pNext; |
23095
|
0 |
0 |
if( p ){ |
23096
|
0 |
0 |
while( p->pNext ) p = p->pNext; |
23116
|
0 |
6 |
if( resetFlag ){ |
23132
|
4 |
2 |
for(i=0; inDb; i++){ |
23134
|
2 |
2 |
if( pBt ){ |
23137
|
0 |
2 |
if( op==SQLITE_DBSTATUS_CACHE_USED_SHARED ){ |
23160
|
4 |
2 |
for(i=0; inDb; i++){ |
23162
|
4 |
0 |
if( ALWAYS(pSchema!=0) ){ |
23176
|
0 |
4 |
for(p=sqliteHashFirst(&pSchema->trigHash); p; p=sqliteHashNext(p)){ |
23179
|
6 |
4 |
for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){ |
23202
|
0 |
2 |
for(pVdbe=db->pVdbe; pVdbe; pVdbe=pVdbe->pNext){ |
23229
|
12 |
6 |
for(i=0; inDb; i++){ |
23230
|
6 |
6 |
if( db->aDb[i].pBt ){ |
23248
|
0 |
0 |
*pCurrent = db->nDeferredImmCons>0 || db->nDeferredCons>0; |
|
0 |
0 |
*pCurrent = db->nDeferredImmCons>0 || db->nDeferredCons>0; |
23389
|
0 |
0 |
while( N-- ){ |
23390
|
0 |
0 |
if( !sqlite3Isdigit(*zDate) ){ |
23396
|
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) ){ |
23399
|
0 |
0 |
*va_arg(ap,int*) = val; |
23403
|
0 |
0 |
}while( nextC ); |
23429
|
0 |
0 |
while( sqlite3Isspace(*zDate) ){ zDate++; } |
23432
|
0 |
0 |
if( c=='-' ){ |
23434
|
0 |
0 |
}else if( c=='+' ){ |
23436
|
0 |
0 |
}else if( c=='Z' || c=='z' ){ |
|
0 |
0 |
}else if( c=='Z' || c=='z' ){ |
23443
|
0 |
0 |
if( getDigits(zDate, "20b:20e", &nHr, &nMn)!=2 ){ |
23449
|
0 |
0 |
while( sqlite3Isspace(*zDate) ){ zDate++; } |
23464
|
0 |
0 |
if( getDigits(zDate, "20c:20e", &h, &m)!=2 ){ |
23468
|
0 |
0 |
if( *zDate==':' ){ |
23470
|
0 |
0 |
if( getDigits(zDate, "20e", &s)!=1 ){ |
23474
|
0 |
0 |
if( *zDate=='.' && sqlite3Isdigit(zDate[1]) ){ |
|
0 |
0 |
if( *zDate=='.' && sqlite3Isdigit(zDate[1]) ){ |
23477
|
0 |
0 |
while( sqlite3Isdigit(*zDate) ){ |
23493
|
0 |
0 |
if( parseTimezone(zDate, p) ) return 1; |
23515
|
0 |
0 |
if( p->validJD ) return; |
23516
|
0 |
0 |
if( p->validYMD ){ |
23525
|
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 ){ |
23529
|
0 |
0 |
if( M<=2 ){ |
23539
|
0 |
0 |
if( p->validHMS ){ |
23541
|
0 |
0 |
if( p->validTZ ){ |
23565
|
0 |
0 |
if( zDate[0]=='-' ){ |
23571
|
0 |
0 |
if( getDigits(zDate, "40f-21a-21d", &Y, &M, &D)!=3 ){ |
23575
|
0 |
0 |
while( sqlite3Isspace(*zDate) || 'T'==*(u8*)zDate ){ zDate++; } |
|
0 |
0 |
while( sqlite3Isspace(*zDate) || 'T'==*(u8*)zDate ){ zDate++; } |
23576
|
0 |
0 |
if( parseHhMmSs(zDate, p)==0 ){ |
23578
|
0 |
0 |
}else if( *zDate==0 ){ |
23585
|
0 |
0 |
p->Y = neg ? -Y : Y; |
23588
|
0 |
0 |
if( p->validTZ ){ |
23601
|
0 |
0 |
if( p->iJD>0 ){ |
23618
|
0 |
0 |
if( r>=0.0 && r<5373484.5 ){ |
|
0 |
0 |
if( r>=0.0 && r<5373484.5 ){ |
23646
|
0 |
0 |
if( parseYyyyMmDd(zDate,p)==0 ){ |
23648
|
0 |
0 |
}else if( parseHhMmSs(zDate, p)==0 ){ |
23650
|
0 |
0 |
}else if( sqlite3StrICmp(zDate,"now")==0 && sqlite3NotPureFunc(context) ){ |
|
0 |
0 |
}else if( sqlite3StrICmp(zDate,"now")==0 && sqlite3NotPureFunc(context) ){ |
23652
|
0 |
0 |
}else if( sqlite3AtoF(zDate, &r, sqlite3Strlen30(zDate), SQLITE_UTF8)>0 ){ |
23674
|
0 |
0 |
return iJD>=0 && iJD<=INT_464269060799999; |
|
0 |
0 |
return iJD>=0 && iJD<=INT_464269060799999; |
23682
|
0 |
0 |
if( p->validYMD ) return; |
23683
|
0 |
0 |
if( !p->validJD ){ |
23687
|
0 |
0 |
}else if( !validJulianDay(p->iJD) ){ |
23700
|
0 |
0 |
p->M = E<14 ? E-1 : E-13; |
23701
|
0 |
0 |
p->Y = p->M>2 ? C - 4716 : C - 4715; |
23711
|
0 |
0 |
if( p->validHMS ) return; |
23786
|
0 |
0 |
if( sqlite3GlobalConfig.bLocaltimeFault ){ |
23787
|
0 |
0 |
if( sqlite3GlobalConfig.xAltLocaltime!=0 |
23788
|
0 |
0 |
&& 0==sqlite3GlobalConfig.xAltLocaltime((const void*)t,(void*)pTm) |
23796
|
0 |
0 |
if( pX ) *pTm = *pX; |
23838
|
0 |
0 |
if( p->iJD<2108667600*(i64)100000 /* 1970-01-01 */ |
23839
|
0 |
0 |
|| p->iJD>2130141456*(i64)100000 /* 2038-01-18 */ |
23857
|
0 |
0 |
if( osLocaltime(&t, &sLocal) ){ |
23940
|
0 |
0 |
if( sqlite3_stricmp(z, "auto")==0 ){ |
23941
|
0 |
0 |
if( idx>1 ) return 1; /* IMP: R-33611-57934 */ |
23942
|
0 |
0 |
if( !p->rawS || p->validJD ){ |
|
0 |
0 |
if( !p->rawS || p->validJD ){ |
23945
|
0 |
0 |
}else if( p->s>=-21086676*(i64)10000 /* -4713-11-24 12:00:00 */ |
23946
|
0 |
0 |
&& p->s<=(25340230*(i64)10000)+799 /* 9999-12-31 23:59:59 */ |
23967
|
0 |
0 |
if( sqlite3_stricmp(z, "julianday")==0 ){ |
23968
|
0 |
0 |
if( idx>1 ) return 1; /* IMP: R-31176-64601 */ |
23969
|
0 |
0 |
if( p->validJD && p->rawS ){ |
|
0 |
0 |
if( p->validJD && p->rawS ){ |
23983
|
0 |
0 |
if( sqlite3_stricmp(z, "localtime")==0 && sqlite3NotPureFunc(pCtx) ){ |
|
0 |
0 |
if( sqlite3_stricmp(z, "localtime")==0 && sqlite3NotPureFunc(pCtx) ){ |
23996
|
0 |
0 |
if( sqlite3_stricmp(z, "unixepoch")==0 && p->rawS ){ |
|
0 |
0 |
if( sqlite3_stricmp(z, "unixepoch")==0 && p->rawS ){ |
23997
|
0 |
0 |
if( idx>1 ) return 1; /* IMP: R-49255-55373 */ |
23999
|
0 |
0 |
if( r>=0.0 && r<464269060800000.0 ){ |
|
0 |
0 |
if( r>=0.0 && r<464269060800000.0 ){ |
24008
|
0 |
0 |
else if( sqlite3_stricmp(z, "utc")==0 && sqlite3NotPureFunc(pCtx) ){ |
|
0 |
0 |
else if( sqlite3_stricmp(z, "utc")==0 && sqlite3NotPureFunc(pCtx) ){ |
24009
|
0 |
0 |
if( p->tzSet==0 ){ |
24025
|
0 |
0 |
if( rc ) return rc; |
24028
|
0 |
0 |
}while( iErr && cnt++<3 ); |
|
0 |
0 |
}while( iErr && cnt++<3 ); |
24047
|
0 |
0 |
if( sqlite3_strnicmp(z, "weekday ", 8)==0 |
24048
|
0 |
0 |
&& sqlite3AtoF(&z[8], &r, sqlite3Strlen30(&z[8]), SQLITE_UTF8)>0 |
24049
|
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 ){ |
24056
|
0 |
0 |
if( Z>n ) Z -= 7; |
24070
|
0 |
0 |
if( sqlite3_strnicmp(z, "start of ", 9)!=0 ) break; |
24071
|
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; |
24080
|
0 |
0 |
if( sqlite3_stricmp(z,"month")==0 ){ |
24083
|
0 |
0 |
}else if( sqlite3_stricmp(z,"year")==0 ){ |
24087
|
0 |
0 |
}else if( sqlite3_stricmp(z,"day")==0 ){ |
24106
|
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++){} |
24107
|
0 |
0 |
if( sqlite3AtoF(z, &r, n, SQLITE_UTF8)<=0 ){ |
24111
|
0 |
0 |
if( z[n]==':' ){ |
24120
|
0 |
0 |
if( !sqlite3Isdigit(*z2) ) z2++; |
24122
|
0 |
0 |
if( parseHhMmSs(z2, &tx) ) break; |
24127
|
0 |
0 |
if( z[0]=='-' ) tx.iJD = -tx.iJD; |
24138
|
0 |
0 |
while( sqlite3Isspace(*z) ) z++; |
24140
|
0 |
0 |
if( n>10 || n<3 ) break; |
|
0 |
0 |
if( n>10 || n<3 ) break; |
24141
|
0 |
0 |
if( sqlite3UpperToLower[(u8)z[n-1]]=='s' ) n--; |
24144
|
0 |
0 |
rRounder = r<0 ? -0.5 : +0.5; |
24145
|
0 |
0 |
for(i=0; i
|
24146
|
0 |
0 |
if( aXformType[i].nName==n |
24147
|
0 |
0 |
&& sqlite3_strnicmp(aXformType[i].zName, z, n)==0 |
24148
|
0 |
0 |
&& r>-aXformType[i].rLimit && r
|
|
0 |
0 |
&& r>-aXformType[i].rLimit && r
|
24156
|
0 |
0 |
x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12; |
24208
|
0 |
0 |
if( argc==0 ){ |
24209
|
0 |
0 |
if( !sqlite3NotPureFunc(context) ) return 1; |
24212
|
0 |
0 |
if( (eType = sqlite3_value_type(argv[0]))==SQLITE_FLOAT |
24213
|
0 |
0 |
|| eType==SQLITE_INTEGER ){ |
24217
|
0 |
0 |
if( !z || parseDateOrTime(context, (char*)z, p) ){ |
|
0 |
0 |
if( !z || parseDateOrTime(context, (char*)z, p) ){ |
24221
|
0 |
0 |
for(i=1; i
|
24224
|
0 |
0 |
if( z==0 || parseModifier(context, (char*)z, n, p, i) ) return 1; |
|
0 |
0 |
if( z==0 || parseModifier(context, (char*)z, n, p, i) ) return 1; |
24227
|
0 |
0 |
if( p->isError || !validJulianDay(p->iJD) ) return 1; |
|
0 |
0 |
if( p->isError || !validJulianDay(p->iJD) ) return 1; |
24248
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){ |
24266
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){ |
24283
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){ |
24288
|
0 |
0 |
if( Y<0 ) Y = -Y; |
24310
|
0 |
0 |
if( x.Y<0 ){ |
24330
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){ |
24359
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){ |
24364
|
0 |
0 |
if( Y<0 ) Y = -Y; |
24376
|
0 |
0 |
if( x.Y<0 ){ |
24416
|
0 |
0 |
if( argc==0 ) return; |
24418
|
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; |
24424
|
0 |
0 |
for(i=j=0; zFmt[i]; i++){ |
24425
|
0 |
0 |
if( zFmt[i]!='%' ) continue; |
24426
|
0 |
0 |
if( j
|
24436
|
0 |
0 |
if( s>59.999 ) s = 59.999; |
24453
|
0 |
0 |
if( zFmt[i]=='W' ){ |
24502
|
0 |
0 |
if( j
|
24704
|
1216 |
2178 |
if( pId->pMethods ){ |
24722
|
270 |
0 |
return flags ? id->pMethods->xSync(id, flags) : SQLITE_OK; |
24749
|
1185 |
327 |
if( id->pMethods==0 ) return SQLITE_NOTFOUND; |
24777
|
563 |
260 |
if( id->pMethods ) (void)id->pMethods->xFileControl(id, op, pArg); |
24782
|
0 |
0 |
return (xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE); |
24785
|
0 |
941 |
if( NEVER(id->pMethods==0) ) return 0; |
24854
|
92 |
0 |
return pVfs->xDelete!=0 ? pVfs->xDelete(pVfs, zPath, dirSync) : SQLITE_OK; |
24892
|
0 |
100 |
if( sqlite3Config.iPrngSeed ){ |
24894
|
0 |
0 |
if( ALWAYS(nByte>(signed)sizeof(unsigned)) ) nByte = sizeof(unsigned int); |
24906
|
6 |
0 |
return pVfs->xGetLastError ? pVfs->xGetLastError(pVfs, 0, 0) : 0; |
24916
|
12 |
0 |
if( pVfs->iVersion>=2 && pVfs->xCurrentTimeInt64 ){ |
|
12 |
0 |
if( pVfs->iVersion>=2 && pVfs->xCurrentTimeInt64 ){ |
24936
|
0 |
0 |
if( pFile ){ |
24938
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
24965
|
0 |
110 |
if( p==0 ) return SQLITE_NOMEM_BKPT; |
24987
|
0 |
532 |
if( rc ) return 0; |
24993
|
532 |
0 |
for(pVfs = vfsList; pVfs; pVfs=pVfs->pNext){ |
24994
|
527 |
5 |
if( zVfs==0 ) break; |
24995
|
5 |
0 |
if( strcmp(zVfs, pVfs->zName)==0 ) break; |
25006
|
550 |
0 |
if( pVfs==0 ){ |
25008
|
0 |
550 |
}else if( vfsList==pVfs ){ |
25010
|
440 |
110 |
}else if( vfsList ){ |
25012
|
660 |
440 |
while( p->pNext && p->pNext!=pVfs ){ |
|
660 |
0 |
while( p->pNext && p->pNext!=pVfs ){ |
25015
|
0 |
440 |
if( p->pNext==pVfs ){ |
25030
|
0 |
550 |
if( rc ) return rc; |
25039
|
440 |
110 |
if( makeDflt || vfsList==0 ){ |
|
0 |
440 |
if( makeDflt || vfsList==0 ){ |
25058
|
0 |
0 |
if( rc ) return rc; |
25144
|
0 |
2857 |
if( wsdHooks.xBenignBegin ){ |
25150
|
0 |
2857 |
if( wsdHooks.xBenignEnd ){ |
25363
|
130405 |
0 |
if( p ){ |
25436
|
6001 |
0 |
if( p ){ |
27540
|
110 |
770 |
if( !sqlite3GlobalConfig.mutex.xMutexAlloc ){ |
27549
|
110 |
0 |
if( sqlite3GlobalConfig.bCoreMutex ){ |
27586
|
0 |
0 |
if( sqlite3GlobalConfig.mutex.xMutexEnd ){ |
27602
|
97 |
0 |
if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0; |
|
0 |
97 |
if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0; |
27603
|
0 |
97 |
if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0; |
|
0 |
0 |
if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0; |
27610
|
0 |
3939 |
if( !sqlite3GlobalConfig.bCoreMutex ){ |
27622
|
520 |
0 |
if( p ){ |
27633
|
336375 |
0 |
if( p ){ |
27645
|
0 |
0 |
if( p ){ |
27659
|
336375 |
0 |
if( p ){ |
28073
|
427 |
0 |
if( p ){ |
28094
|
97 |
0 |
if( p ){ |
28226
|
0 |
0 |
if( pthread_mutex_trylock(&p->mutex)==0 ){ |
28893
|
0 |
0 |
if( rc ) return -1; |
28897
|
0 |
0 |
if( n<0 ){ |
28901
|
0 |
0 |
if( mem0.hardLimit>0 && (n>mem0.hardLimit || n==0) ){ |
|
0 |
0 |
if( mem0.hardLimit>0 && (n>mem0.hardLimit || n==0) ){ |
|
0 |
0 |
if( mem0.hardLimit>0 && (n>mem0.hardLimit || n==0) ){ |
28906
|
0 |
0 |
AtomicStore(&mem0.nearlyFull, n>0 && n<=nUsed); |
|
0 |
0 |
AtomicStore(&mem0.nearlyFull, n>0 && n<=nUsed); |
28909
|
0 |
0 |
if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff)); |
28913
|
0 |
0 |
if( n<0 ) n = 0; |
28933
|
0 |
0 |
if( rc ) return -1; |
28937
|
0 |
0 |
if( n>=0 ){ |
28939
|
0 |
0 |
if( n
|
|
0 |
0 |
if( n
|
28953
|
110 |
0 |
if( sqlite3GlobalConfig.m.xMalloc==0 ){ |
28957
|
0 |
110 |
if( sqlite3GlobalConfig.pPage==0 || sqlite3GlobalConfig.szPage<512 |
|
0 |
0 |
if( sqlite3GlobalConfig.pPage==0 || sqlite3GlobalConfig.szPage<512 |
28958
|
0 |
0 |
|| sqlite3GlobalConfig.nPage<=0 ){ |
28963
|
0 |
110 |
if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0)); |
28980
|
0 |
0 |
if( sqlite3GlobalConfig.m.xShutdown ){ |
29010
|
5996 |
0 |
if( mem0.alarmThreshold<=0 ) return; |
29034
|
0 |
130405 |
if( mem0.alarmThreshold>0 ){ |
29036
|
0 |
0 |
if( nUsed >= mem0.alarmThreshold - nFull ){ |
29039
|
0 |
0 |
if( mem0.hardLimit ){ |
29041
|
0 |
0 |
if( nUsed >= mem0.hardLimit - nFull ){ |
29057
|
130405 |
0 |
if( p ){ |
29071
|
130405 |
0 |
if( n==0 || n>=0x7fffff00 ){ |
|
0 |
130405 |
if( n==0 || n>=0x7fffff00 ){ |
29078
|
130405 |
0 |
}else if( sqlite3GlobalConfig.bMemstat ){ |
29096
|
0 |
7856 |
if( sqlite3_initialize() ) return 0; |
29098
|
7856 |
0 |
return n<=0 ? 0 : sqlite3Malloc(n); |
29102
|
0 |
56752 |
if( sqlite3_initialize() ) return 0; |
29112
|
3198 |
728 |
return SQLITE_WITHIN(p, db->lookaside.pStart, db->lookaside.pEnd); |
|
405 |
2793 |
return SQLITE_WITHIN(p, db->lookaside.pStart, db->lookaside.pEnd); |
29128
|
24 |
381 |
return plookaside.pMiddle ? db->lookaside.szTrue : LOOKASIDE_SMALL; |
29146
|
34798 |
132 |
if( db ){ |
29147
|
29504 |
5294 |
if( ((uptr)p)<(uptr)(db->lookaside.pEnd) ){ |
29149
|
23262 |
6242 |
if( ((uptr)p)>=(uptr)(db->lookaside.pMiddle) ){ |
29154
|
5128 |
1114 |
if( ((uptr)p)>=(uptr)(db->lookaside.pStart) ){ |
29165
|
0 |
16 |
return p ? sqlite3GlobalConfig.m.xSize(p) : 0; |
29172
|
28491 |
130139 |
if( p==0 ) return; /* IMP: R-49053-54554 */ |
29175
|
130139 |
0 |
if( sqlite3GlobalConfig.bMemstat ){ |
29202
|
151812 |
6244 |
if( db ){ |
29203
|
46 |
151766 |
if( db->pnBytesFreed ){ |
29207
|
126370 |
25396 |
if( ((uptr)p)<(uptr)(db->lookaside.pEnd) ){ |
29209
|
91620 |
34750 |
if( ((uptr)p)>=(uptr)(db->lookaside.pMiddle) ){ |
29219
|
20921 |
13829 |
if( ((uptr)p)>=(uptr)(db->lookaside.pStart) ){ |
29238
|
51559 |
29874 |
if( p ) sqlite3DbFreeNN(db, p); |
29249
|
1135 |
6061 |
if( pOld==0 ){ |
29252
|
0 |
6061 |
if( nBytes==0 ){ |
29256
|
0 |
6061 |
if( nBytes>=0x7fffff00 ){ |
29265
|
60 |
6001 |
if( nOld==nNew ){ |
29267
|
6001 |
0 |
}else if( sqlite3GlobalConfig.bMemstat ){ |
29272
|
5996 |
5 |
if( nDiff>0 && (nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED)) >= |
|
5996 |
0 |
if( nDiff>0 && (nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED)) >= |
29275
|
0 |
5996 |
if( mem0.hardLimit>0 && nUsed >= mem0.hardLimit - nDiff ){ |
|
0 |
0 |
if( mem0.hardLimit>0 && nUsed >= mem0.hardLimit - nDiff ){ |
29287
|
6001 |
0 |
if( pNew ){ |
29305
|
0 |
108 |
if( sqlite3_initialize() ) return 0; |
29307
|
0 |
108 |
if( n<0 ) n = 0; /* IMP: R-26507-47431 */ |
29312
|
0 |
3340 |
if( sqlite3_initialize() ) return 0; |
29323
|
3875 |
0 |
if( p ){ |
29337
|
14085 |
0 |
if( p ) memset(p, 0, (size_t)n); |
29349
|
0 |
38330 |
if( !p ) sqlite3OomFault(db); |
29379
|
56440 |
4365 |
if( db ) return sqlite3DbMallocRawNN(db, n); |
29390
|
36250 |
114623 |
if( n>db->lookaside.sz ){ |
29391
|
780 |
35470 |
if( !db->lookaside.bDisable ){ |
29393
|
0 |
35470 |
}else if( db->mallocFailed ){ |
29399
|
94479 |
20144 |
if( n<=LOOKASIDE_SMALL ){ |
29400
|
77986 |
16493 |
if( (pBuf = db->lookaside.pSmallFree)!=0 ){ |
29404
|
13636 |
2857 |
}else if( (pBuf = db->lookaside.pSmallInit)!=0 ){ |
29411
|
18920 |
4081 |
if( (pBuf = db->lookaside.pFree)!=0 ){ |
29415
|
2001 |
2080 |
}else if( (pBuf = db->lookaside.pInit)!=0 ){ |
29442
|
12574 |
4420 |
if( p==0 ) return sqlite3DbMallocRawNN(db, n); |
29444
|
1627 |
2793 |
if( ((uptr)p)<(uptr)db->lookaside.pEnd ){ |
29446
|
814 |
813 |
if( ((uptr)p)>=(uptr)db->lookaside.pMiddle ){ |
29447
|
433 |
381 |
if( n<=LOOKASIDE_SMALL ) return p; |
29450
|
85 |
728 |
if( ((uptr)p)>=(uptr)db->lookaside.pStart ){ |
29451
|
61 |
24 |
if( n<=db->lookaside.szTrue ) return p; |
29460
|
3926 |
0 |
if( db->mallocFailed==0 ){ |
29461
|
405 |
3521 |
if( isLookaside(db, p) ){ |
29463
|
405 |
0 |
if( pNew ){ |
29472
|
0 |
3521 |
if( !pNew ){ |
29489
|
0 |
5447 |
if( !pNew ){ |
29505
|
398 |
4403 |
if( z==0 ){ |
29510
|
4403 |
0 |
if( zNew ){ |
29520
|
21552 |
147 |
zNew = z ? sqlite3DbMallocRawNN(db, n+1) : 0; |
29521
|
21552 |
147 |
if( zNew ){ |
29535
|
0 |
1631 |
while( sqlite3Isspace(zStart[0]) ) zStart++; |
29537
|
2935 |
0 |
while( ALWAYS(n>0) && sqlite3Isspace(zStart[n-1]) ) n--; |
|
1304 |
1631 |
while( ALWAYS(n>0) && sqlite3Isspace(zStart[n-1]) ) n--; |
29564
|
0 |
0 |
if( db->mallocFailed==0 && db->bBenignMalloc==0 ){ |
|
0 |
0 |
if( db->mallocFailed==0 && db->bBenignMalloc==0 ){ |
29566
|
0 |
0 |
if( db->nVdbeExec>0 ){ |
29570
|
0 |
0 |
if( db->pParse ){ |
29574
|
0 |
0 |
for(pParse=db->pParse->pOuterParse; pParse; pParse = pParse->pOuterParse){ |
29591
|
0 |
0 |
if( db->mallocFailed && db->nVdbeExec==0 ){ |
|
0 |
0 |
if( db->mallocFailed && db->nVdbeExec==0 ){ |
29595
|
0 |
0 |
EnableLookaside; |
29603
|
138 |
0 |
if( db->mallocFailed || rc==SQLITE_IOERR_NOMEM ){ |
|
0 |
138 |
if( db->mallocFailed || rc==SQLITE_IOERR_NOMEM ){ |
29630
|
40837 |
0 |
if( db->mallocFailed || rc ){ |
|
138 |
40699 |
if( db->mallocFailed || rc ){ |
29772
|
0 |
30 |
if( (*cnt)<=0 ) return '0'; |
29788
|
0 |
0 |
if( p->mxAlloc ) sqlite3_str_reset(p); |
29789
|
0 |
0 |
if( eError==SQLITE_TOOBIG ) sqlite3ErrorToParser(p->db, eError); |
29796
|
0 |
0 |
if( p->nArg<=p->nUsed ) return 0; |
29800
|
0 |
0 |
if( p->nArg<=p->nUsed ) return 0.0; |
29804
|
0 |
0 |
if( p->nArg<=p->nUsed ) return 0; |
29819
|
0 |
129 |
if( pAccum->accError ) return 0; |
29820
|
39 |
90 |
if( n>pAccum->nAlloc && n>pAccum->mxAlloc ){ |
|
0 |
39 |
if( n>pAccum->nAlloc && n>pAccum->mxAlloc ){ |
29825
|
0 |
129 |
if( z==0 ){ |
29894
|
0 |
4831 |
if( (pAccum->printfFlags & SQLITE_PRINTF_SQLFUNC)!=0 ){ |
29895
|
0 |
0 |
pArgList = va_arg(ap, PrintfArguments*); |
29900
|
9407 |
1155 |
for(; (c=(*fmt))!=0; ++fmt){ |
29901
|
8871 |
536 |
if( c!='%' ){ |
29906
|
83793 |
3676 |
do{ fmt++; }while( *fmt && *fmt != '%' ); |
|
78598 |
5195 |
do{ fmt++; }while( *fmt && *fmt != '%' ); |
29909
|
3676 |
5195 |
if( *fmt==0 ) break; |
29911
|
0 |
5731 |
if( (c=(*++fmt))==0 ){ |
29935
|
68 |
0 |
if( c=='l' ){ |
29945
|
0 |
0 |
while( (c = *++fmt)>='0' && c<='9' ){ |
|
0 |
0 |
while( (c = *++fmt)>='0' && c<='9' ){ |
29955
|
0 |
0 |
if( c!='.' && c!='l' ){ |
|
0 |
0 |
if( c!='.' && c!='l' ){ |
29963
|
0 |
0 |
if( bArgList ){ |
29966
|
0 |
0 |
width = va_arg(ap,int); |
29968
|
0 |
0 |
if( width<0 ){ |
29970
|
0 |
0 |
width = width >= -2147483647 ? -width : 0; |
29977
|
0 |
0 |
if( (c = fmt[1])!='.' && c!='l' ){ |
|
0 |
0 |
if( (c = fmt[1])!='.' && c!='l' ){ |
29985
|
282 |
2 |
if( c=='*' ){ |
29986
|
0 |
282 |
if( bArgList ){ |
29989
|
282 |
0 |
precision = va_arg(ap,int); |
29991
|
0 |
282 |
if( precision<0 ){ |
29992
|
0 |
0 |
precision = precision >= -2147483647 ? -precision : -1; |
29997
|
6 |
0 |
while( c>='0' && c<='9' ){ |
|
4 |
2 |
while( c>='0' && c<='9' ){ |
30009
|
0 |
284 |
if( c=='l' ){ |
30017
|
41 |
5731 |
}while( !done && (c=(*++fmt))!=0 ); |
|
41 |
0 |
}while( !done && (c=(*++fmt))!=0 ); |
30022
|
22434 |
0 |
for(idx=0; idx
|
30023
|
5731 |
16703 |
if( c==fmtinfo[idx].fmttype ){ |
30059
|
826 |
33 |
if( infop->flags & FLAG_SIGNED ){ |
30061
|
0 |
826 |
if( bArgList ){ |
30063
|
68 |
758 |
}else if( flag_long ){ |
30064
|
68 |
0 |
if( flag_long==2 ){ |
30065
|
68 |
0 |
v = va_arg(ap,i64) ; |
30067
|
0 |
0 |
v = va_arg(ap,long int); |
30070
|
193 |
565 |
v = va_arg(ap,int); |
30072
|
0 |
826 |
if( v<0 ){ |
30083
|
0 |
33 |
if( bArgList ){ |
30085
|
0 |
33 |
}else if( flag_long ){ |
30086
|
0 |
0 |
if( flag_long==2 ){ |
30087
|
0 |
0 |
longvalue = va_arg(ap,u64); |
30089
|
0 |
0 |
longvalue = va_arg(ap,unsigned long int); |
30092
|
33 |
0 |
longvalue = va_arg(ap,unsigned int); |
30096
|
48 |
811 |
if( longvalue==0 ) flag_alternateform = 0; |
30097
|
0 |
859 |
if( flag_zeropad && precision
|
|
0 |
0 |
if( flag_zeropad && precision
|
30100
|
859 |
0 |
if( precision
|
30106
|
0 |
0 |
if( cThousand ) n += precision/3; |
30108
|
0 |
0 |
if( zOut==0 ) return; |
30112
|
0 |
859 |
if( xtype==etORDINAL ){ |
30115
|
0 |
0 |
if( x>=4 || (longvalue/10)%10==1 ){ |
|
0 |
0 |
if( x>=4 || (longvalue/10)%10==1 ){ |
30127
|
79 |
859 |
}while( longvalue>0 ); |
30130
|
0 |
859 |
while( precision>length ){ |
30134
|
0 |
859 |
if( cThousand ){ |
30138
|
0 |
0 |
for(idx=0; nn>0; idx++){ |
30141
|
0 |
0 |
if( ix==0 ){ |
30148
|
0 |
859 |
if( prefix ) *(--bufpt) = prefix; /* Add sign */ |
30149
|
0 |
859 |
if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */ |
|
0 |
0 |
if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */ |
30153
|
0 |
0 |
for(; (x=(*pre))!=0; pre++) *(--bufpt) = x; |
30160
|
0 |
2 |
if( bArgList ){ |
30163
|
2 |
0 |
realvalue = va_arg(ap,double); |
30168
|
0 |
2 |
if( precision<0 ) precision = 6; /* Set default precision */ |
30170
|
0 |
2 |
if( precision>SQLITE_FP_PRECISION_LIMIT ){ |
30174
|
0 |
2 |
if( realvalue<0.0 ){ |
30180
|
2 |
0 |
if( xtype==etGENERIC && precision>0 ) precision--; |
|
2 |
0 |
if( xtype==etGENERIC && precision>0 ) precision--; |
30184
|
2 |
2 |
while( idx>=10 ){ rounder *= 1.0e-10; idx -= 10; } |
30185
|
0 |
2 |
if( xtype==etFLOAT ){ |
30191
|
0 |
0 |
if( precision+(ex/3) < 15 ) rounder += realvalue*3e-16; |
30196
|
0 |
2 |
if( sqlite3IsNaN((double)realvalue) ){ |
30201
|
2 |
0 |
if( realvalue>0.0 ){ |
30203
|
0 |
2 |
while( realvalue>=1e100*scale && exp<=350 ){ scale *= 1e100;exp+=100;} |
|
0 |
0 |
while( realvalue>=1e100*scale && exp<=350 ){ scale *= 1e100;exp+=100;} |
30204
|
0 |
2 |
while( realvalue>=1e10*scale && exp<=350 ){ scale *= 1e10; exp+=10; } |
|
0 |
0 |
while( realvalue>=1e10*scale && exp<=350 ){ scale *= 1e10; exp+=10; } |
30205
|
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++; } |
30207
|
0 |
2 |
while( realvalue<1e-8 ){ realvalue *= 1e8; exp-=8; } |
30208
|
0 |
2 |
while( realvalue<1.0 ){ realvalue *= 10.0; exp--; } |
30209
|
0 |
2 |
if( exp>350 ){ |
30213
|
0 |
0 |
length = 3+(prefix!=0); |
30222
|
2 |
0 |
if( xtype!=etFLOAT ){ |
30224
|
0 |
2 |
if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; } |
30226
|
2 |
0 |
if( xtype==etGENERIC ){ |
30228
|
2 |
0 |
if( exp<-4 || exp>precision ){ |
|
0 |
2 |
if( exp<-4 || exp>precision ){ |
30237
|
0 |
2 |
if( xtype==etEXP ){ |
30245
|
0 |
2 |
if( szBufNeeded > etBUFSIZE ){ |
30247
|
0 |
0 |
if( bufpt==0 ) return; |
30254
|
0 |
2 |
if( prefix ){ |
30258
|
0 |
2 |
if( e2<0 ){ |
30261
|
14 |
2 |
for(; e2>=0; e2--){ |
30266
|
2 |
0 |
if( flag_dp ){ |
30271
|
0 |
2 |
for(e2++; e2<0; precision--, e2++){ |
30276
|
16 |
2 |
while( (precision--)>0 ){ |
30280
|
2 |
0 |
if( flag_rtz && flag_dp ){ |
|
2 |
0 |
if( flag_rtz && flag_dp ){ |
30281
|
14 |
2 |
while( bufpt[-1]=='0' ) *(--bufpt) = 0; |
30283
|
0 |
2 |
if( bufpt[-1]=='.' ){ |
30284
|
0 |
0 |
if( flag_altform2 ){ |
30292
|
0 |
2 |
if( xtype==etEXP ){ |
30294
|
0 |
0 |
if( exp<0 ){ |
30299
|
0 |
0 |
if( exp>=100 ){ |
30316
|
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){ |
30319
|
0 |
0 |
for(i=width; i>=nPad; i--){ |
30323
|
0 |
0 |
while( nPad-- ) bufpt[i++] = '0'; |
30329
|
0 |
0 |
if( !bArgList ){ |
30330
|
0 |
0 |
*(va_arg(ap,int*)) = pAccum->nChar; |
30340
|
0 |
0 |
if( bArgList ){ |
30343
|
0 |
0 |
if( bufpt ){ |
30345
|
0 |
0 |
if( (c&0xc0)==0xc0 ){ |
30346
|
0 |
0 |
while( length<4 && (bufpt[0]&0xc0)==0x80 ){ |
|
0 |
0 |
while( length<4 && (bufpt[0]&0xc0)==0x80 ){ |
30354
|
0 |
0 |
unsigned int ch = va_arg(ap,unsigned int); |
30355
|
0 |
0 |
if( ch<0x00080 ){ |
30358
|
0 |
0 |
}else if( ch<0x00800 ){ |
30362
|
0 |
0 |
}else if( ch<0x10000 ){ |
30375
|
0 |
0 |
if( precision>1 ){ |
30377
|
0 |
0 |
if( width>1 && !flag_leftjustify ){ |
|
0 |
0 |
if( width>1 && !flag_leftjustify ){ |
30381
|
0 |
0 |
while( precision-- > 1 ){ |
30390
|
0 |
2282 |
if( bArgList ){ |
30394
|
2282 |
0 |
bufpt = va_arg(ap,char*); |
30396
|
1 |
2281 |
if( bufpt==0 ){ |
30398
|
16 |
2265 |
}else if( xtype==etDYNSTRING ){ |
30399
|
16 |
0 |
if( pAccum->nChar==0 |
30400
|
16 |
0 |
&& pAccum->mxAlloc |
30401
|
16 |
0 |
&& width==0 |
30402
|
16 |
0 |
&& precision<0 |
30403
|
16 |
0 |
&& pAccum->accError==0 |
30418
|
278 |
1988 |
if( precision>=0 ){ |
30419
|
0 |
278 |
if( flag_altform2 ){ |
30423
|
0 |
0 |
while( precision-- > 0 && z[0] ){ |
|
0 |
0 |
while( precision-- > 0 && z[0] ){ |
30424
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
30428
|
12588 |
278 |
for(length=0; length
|
|
12588 |
0 |
for(length=0; length
|
30434
|
0 |
4783 |
if( flag_altform2 && width>0 ){ |
|
0 |
0 |
if( flag_altform2 && width>0 ){ |
30437
|
0 |
0 |
while( ii>=0 ) if( (bufpt[ii--] & 0xc0)==0x80 ) width++; |
|
0 |
0 |
while( ii>=0 ) if( (bufpt[ii--] & 0xc0)==0x80 ) width++; |
30446
|
495 |
2022 |
char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */ |
30449
|
0 |
2517 |
if( bArgList ){ |
30452
|
2212 |
305 |
escarg = va_arg(ap,char*); |
30455
|
34 |
2483 |
if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); |
|
34 |
0 |
if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); |
30462
|
37807 |
4 |
for(i=n=0; k!=0 && (ch=escarg[i])!=0; i++, k--){ |
|
35294 |
2513 |
for(i=n=0; k!=0 && (ch=escarg[i])!=0; i++, k--){ |
30463
|
166 |
35128 |
if( ch==q ) n++; |
30464
|
0 |
35294 |
if( flag_altform2 && (ch&0xc0)==0xc0 ){ |
|
0 |
0 |
if( flag_altform2 && (ch&0xc0)==0xc0 ){ |
30465
|
0 |
0 |
while( (escarg[i+1]&0xc0)==0x80 ){ i++; } |
30468
|
2483 |
34 |
needQuote = !isnull && xtype==etSQLESCAPE2; |
|
1543 |
940 |
needQuote = !isnull && xtype==etSQLESCAPE2; |
30470
|
129 |
2388 |
if( n>etBUFSIZE ){ |
30472
|
0 |
129 |
if( bufpt==0 ) return; |
30477
|
1543 |
974 |
if( needQuote ) bufpt[j++] = q; |
30479
|
35294 |
2517 |
for(i=0; i
|
30481
|
166 |
35128 |
if( ch==q ) bufpt[j++] = ch; |
30483
|
1543 |
974 |
if( needQuote ) bufpt[j++] = q; |
30489
|
0 |
38 |
if( (pAccum->printfFlags & SQLITE_PRINTF_INTERNAL)==0 ) return; |
30490
|
6 |
32 |
if( flag_alternateform ){ |
30492
|
6 |
0 |
Expr *pExpr = va_arg(ap,Expr*); |
30493
|
6 |
0 |
if( ALWAYS(pExpr) && ALWAYS(!ExprHasProperty(pExpr,EP_IntValue)) ){ |
|
6 |
0 |
if( ALWAYS(pExpr) && ALWAYS(!ExprHasProperty(pExpr,EP_IntValue)) ){ |
30499
|
32 |
0 |
Token *pToken = va_arg(ap, Token*); |
30501
|
32 |
0 |
if( pToken && pToken->n ){ |
|
32 |
0 |
if( pToken && pToken->n ){ |
30511
|
0 |
33 |
if( (pAccum->printfFlags & SQLITE_PRINTF_INTERNAL)==0 ) return; |
30512
|
33 |
0 |
pItem = va_arg(ap, SrcItem*); |
30514
|
0 |
33 |
if( pItem->zAlias && !flag_altform2 ){ |
|
0 |
0 |
if( pItem->zAlias && !flag_altform2 ){ |
30516
|
0 |
33 |
}else if( pItem->zName ){ |
30517
|
0 |
0 |
if( pItem->zDatabase ){ |
30522
|
0 |
33 |
}else if( pItem->zAlias ){ |
30527
|
0 |
33 |
if( pSel->selFlags & SF_NestedFrom ){ |
30550
|
0 |
5731 |
if( width>0 ){ |
30551
|
0 |
0 |
if( !flag_leftjustify ) sqlite3_str_appendchar(pAccum, width, ' '); |
30553
|
0 |
0 |
if( flag_leftjustify ) sqlite3_str_appendchar(pAccum, width, ' '); |
30558
|
129 |
5602 |
if( zExtra ){ |
30577
|
0 |
32 |
if( NEVER(db==0) ) return; |
30578
|
29 |
3 |
if( db->errByteOffset!=(-2) ) return; |
30580
|
0 |
3 |
if( NEVER(pParse==0) ) return; |
30582
|
0 |
3 |
if( NEVER(zText==0) ) return; |
30584
|
3 |
0 |
if( SQLITE_WITHIN(z,zText,zEnd) ){ |
|
3 |
0 |
if( SQLITE_WITHIN(z,zText,zEnd) ){ |
30594
|
12 |
0 |
while( pExpr |
30595
|
0 |
12 |
&& (ExprHasProperty(pExpr,EP_OuterON|EP_InnerON) || pExpr->w.iOfst<=0) |
|
0 |
12 |
&& (ExprHasProperty(pExpr,EP_OuterON|EP_InnerON) || pExpr->w.iOfst<=0) |
30599
|
0 |
12 |
if( pExpr==0 ) return; |
30613
|
0 |
1135 |
if( p->accError ){ |
30618
|
0 |
1135 |
if( p->mxAlloc==0 ){ |
30622
|
282 |
853 |
char *zOld = isMalloced(p) ? p->zText : 0; |
30625
|
1135 |
0 |
if( szNew+p->nChar<=p->mxAlloc ){ |
30630
|
0 |
1135 |
if( szNew > p->mxAlloc ){ |
30637
|
1016 |
119 |
if( p->db ){ |
30642
|
1135 |
0 |
if( zNew ){ |
30644
|
853 |
282 |
if( !isMalloced(p) && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar); |
|
819 |
34 |
if( !isMalloced(p) && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar); |
30662
|
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 ){ |
30665
|
0 |
0 |
while( (N--)>0 ) p->zText[p->nChar++] = c; |
30678
|
1135 |
0 |
if( N>0 ){ |
30693
|
1135 |
13637 |
if( p->nChar+N >= p->nAlloc ){ |
30695
|
13516 |
121 |
}else if( N ){ |
30719
|
3825 |
0 |
if( zText ){ |
30729
|
4694 |
0 |
if( p->zText ){ |
30731
|
4694 |
0 |
if( p->mxAlloc>0 && !isMalloced(p) ){ |
|
3825 |
869 |
if( p->mxAlloc>0 && !isMalloced(p) ){ |
30743
|
0 |
0 |
if( p->accError ){ |
30746
|
0 |
0 |
}else if( isMalloced(p) ){ |
30768
|
2 |
0 |
if( p!=0 && p!=&sqlite3OomStr ){ |
|
2 |
0 |
if( p!=0 && p!=&sqlite3OomStr ){ |
30779
|
0 |
0 |
return p ? p->accError : SQLITE_NOMEM; |
30784
|
0 |
0 |
return p ? p->nChar : 0; |
30789
|
0 |
0 |
if( p==0 || p->nChar==0 ) return 0; |
|
0 |
0 |
if( p==0 || p->nChar==0 ) return 0; |
30798
|
0 |
0 |
if( isMalloced(p) ){ |
30834
|
2 |
0 |
if( p ){ |
30835
|
2 |
0 |
sqlite3StrAccumInit(p, 0, 0, 0, |
30857
|
0 |
1779 |
if( acc.accError==SQLITE_NOMEM ){ |
30892
|
0 |
2881 |
if( sqlite3_initialize() ) return 0; |
30908
|
0 |
2793 |
if( sqlite3_initialize() ) return 0; |
30931
|
0 |
122 |
if( n<=0 ) return zBuf; |
30982
|
0 |
93 |
if( sqlite3GlobalConfig.xLog ){ |
32377
|
0 |
1110 |
if( sqlite3_initialize() ) return; |
32385
|
1087 |
23 |
if( N<=0 || pBuf==0 ){ |
|
0 |
1087 |
if( N<=0 || pBuf==0 ){ |
32400
|
100 |
987 |
if( !wsdPrng.isInit ){ |
32406
|
0 |
100 |
if( NEVER(pVfs==0) ){ |
32411
|
25600 |
100 |
for(i=0; i<256; i++){ |
32414
|
25600 |
100 |
for(i=0; i<256; i++){ |
32432
|
3261 |
1087 |
}while( --N ); |
32530
|
0 |
0 |
if( p==0 ) return SQLITE_NOMEM_BKPT; |
32538
|
0 |
0 |
if( sqlite3FaultSim(200) ){ |
32543
|
0 |
0 |
if( rc ){ |
32556
|
0 |
0 |
if( NEVER(p==0) ) return SQLITE_NOMEM_BKPT; |
32557
|
0 |
0 |
if( p->done ){ |
32896
|
84 |
9 |
if( c>=0xc0 ){ |
32898
|
126 |
84 |
while( (*(*pz) & 0xc0)==0x80 ){ |
32901
|
84 |
0 |
if( c<0x80 |
32902
|
84 |
0 |
|| (c&0xFFFFF800)==0xD800 |
32903
|
0 |
84 |
|| (c&0xFFFFFFFE)==0xFFFE ){ c = 0xFFFD; } |
32951
|
0 |
0 |
if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){ |
|
0 |
0 |
if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){ |
32955
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
32961
|
0 |
0 |
while( zIn
|
32972
|
0 |
0 |
if( desiredEnc==SQLITE_UTF8 ){ |
32998
|
0 |
0 |
if( !zOut ){ |
33003
|
0 |
0 |
if( pMem->enc==SQLITE_UTF8 ){ |
33004
|
0 |
0 |
if( desiredEnc==SQLITE_UTF16LE ){ |
33006
|
0 |
0 |
while( zIn
|
33007
|
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); |
33008
|
0 |
0 |
WRITE_UTF16LE(z, c); |
33013
|
0 |
0 |
while( zIn
|
33014
|
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); |
33015
|
0 |
0 |
WRITE_UTF16BE(z, c); |
33022
|
0 |
0 |
if( pMem->enc==SQLITE_UTF16LE ){ |
33024
|
0 |
0 |
while( zIn
|
33027
|
0 |
0 |
if( c>=0xd800 && c<0xe000 ){ |
|
0 |
0 |
if( c>=0xd800 && c<0xe000 ){ |
33042
|
0 |
0 |
if( zIn
|
33049
|
0 |
0 |
WRITE_UTF8(z, c); |
|
0 |
0 |
WRITE_UTF8(z, c); |
|
0 |
0 |
WRITE_UTF8(z, c); |
33053
|
0 |
0 |
while( zIn
|
33056
|
0 |
0 |
if( c>=0xd800 && c<0xe000 ){ |
|
0 |
0 |
if( c>=0xd800 && c<0xe000 ){ |
33071
|
0 |
0 |
if( zIn
|
33078
|
0 |
0 |
WRITE_UTF8(z, c); |
|
0 |
0 |
WRITE_UTF8(z, c); |
|
0 |
0 |
WRITE_UTF8(z, c); |
33123
|
0 |
0 |
if( pMem->n>1 ){ |
33126
|
0 |
0 |
if( b1==0xFE && b2==0xFF ){ |
|
0 |
0 |
if( b1==0xFE && b2==0xFF ){ |
33129
|
0 |
0 |
if( b1==0xFF && b2==0xFE ){ |
|
0 |
0 |
if( b1==0xFF && b2==0xFE ){ |
33134
|
0 |
0 |
if( bom ){ |
33136
|
0 |
0 |
if( rc==SQLITE_OK ){ |
33160
|
0 |
0 |
if( nByte>=0 ){ |
33166
|
0 |
0 |
while( *z!=0 && z
|
|
0 |
0 |
while( *z!=0 && z
|
33167
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
33216
|
0 |
0 |
if( db->mallocFailed ){ |
33237
|
0 |
0 |
while( n
|
33240
|
0 |
0 |
if( c>=0xd8 && c<0xdc && z[0]>=0xdc && z[0]<0xe0 ) z += 2; |
|
0 |
0 |
if( c>=0xd8 && c<0xdc && z[0]>=0xdc && z[0]<0xe0 ) z += 2; |
|
0 |
0 |
if( c>=0xd8 && c<0xdc && z[0]>=0xdc && z[0]<0xe0 ) z += 2; |
|
0 |
0 |
if( c>=0xd8 && c<0xdc && z[0]>=0xdc && z[0]<0xe0 ) z += 2; |
33325
|
0 |
2158 |
return xCallback ? xCallback(iTest) : SQLITE_OK; |
33341
|
0 |
222 |
rc = IsNaN(y); |
|
0 |
0 |
rc = IsNaN(y); |
33359
|
737 |
59823 |
if( z==0 ) return 0; |
33371
|
239 |
3588 |
if( pCol->colFlags & COLFLAG_HASTYPE ){ |
33373
|
3364 |
224 |
}else if( pCol->eCType ){ |
33387
|
218 |
8 |
if( db->pErr ) sqlite3ValueSetNull(db->pErr); |
33399
|
5900 |
8 |
if( err_code || db->pErr ){ |
|
218 |
5682 |
if( err_code || db->pErr ){ |
33414
|
359 |
5715 |
if( db->pErr ) sqlite3ValueSetNull(db->pErr); |
33422
|
0 |
340 |
if( rc==SQLITE_IOERR_NOMEM ) return; |
33424
|
334 |
6 |
if( rc==SQLITE_CANTOPEN || rc==SQLITE_IOERR ){ |
|
0 |
334 |
if( rc==SQLITE_CANTOPEN || rc==SQLITE_IOERR ){ |
33445
|
39 |
42 |
if( zFormat==0 ){ |
33447
|
33 |
9 |
}else if( db->pErr || (db->pErr = sqlite3ValueNew(db))!=0 ){ |
|
33 |
0 |
}else if( db->pErr || (db->pErr = sqlite3ValueNew(db))!=0 ){ |
33477
|
19 |
9 |
if( db->errByteOffset<-1 ) db->errByteOffset = -1; |
33478
|
2 |
26 |
if( db->suppressErr ){ |
33480
|
0 |
2 |
if( db->mallocFailed ){ |
33500
|
0 |
0 |
if( db==0 || (pParse = db->pParse)==0 ) return errCode; |
|
0 |
0 |
if( db==0 || (pParse = db->pParse)==0 ) return errCode; |
33526
|
0 |
16998 |
if( z==0 ) return; |
33528
|
13004 |
3994 |
if( !sqlite3Isquote(quote) ) return; |
33529
|
4 |
3990 |
if( quote=='[' ) quote = ']'; |
33532
|
4166 |
44934 |
if( z[i]==quote ){ |
33533
|
172 |
3994 |
if( z[i+1]==quote ){ |
33548
|
67 |
2456 |
p->flags |= p->u.zToken[0]=='"' ? EP_Quoted|EP_DblQuoted : EP_Quoted; |
33565
|
85 |
6229 |
if( p->n<2 ) return; |
33566
|
6123 |
106 |
if( !sqlite3Isquote(p->z[0]) ) return; |
33567
|
674 |
104 |
for(i=1; in-1; i++){ |
33568
|
2 |
672 |
if( sqlite3Isquote(p->z[i]) ) return; |
33596
|
0 |
6935 |
if( zLeft==0 ){ |
33597
|
0 |
0 |
return zRight ? -1 : 0; |
33598
|
0 |
6935 |
}else if( zRight==0 ){ |
33611
|
309734 |
189271 |
if( c==x ){ |
33612
|
30887 |
278847 |
if( c==0 ) break; |
33615
|
180976 |
8295 |
if( c ) break; |
33624
|
0 |
9631 |
if( zLeft==0 ){ |
33625
|
0 |
0 |
return zRight ? -1 : 0; |
33626
|
0 |
9631 |
}else if( zRight==0 ){ |
33631
|
26975 |
3927 |
while( N-- > 0 && *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } |
|
26742 |
233 |
while( N-- > 0 && *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } |
|
21271 |
5471 |
while( N-- > 0 && *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } |
33632
|
5704 |
3927 |
return N<0 ? 0 : UpperToLower[*a] - UpperToLower[*b]; |
33640
|
0 |
11262 |
if( z==0 ) return 0; |
33641
|
57142 |
11262 |
while( z[0] ){ |
33678
|
7820 |
1059 |
if( E & 1 ) r *= x; |
33680
|
2170 |
6709 |
if( E==0 ) break; |
33736
|
0 |
2708 |
if( length==0 ) return 0; |
33738
|
2708 |
0 |
if( enc==SQLITE_UTF8 ){ |
33748
|
0 |
0 |
for(i=3-enc; i
|
|
0 |
0 |
for(i=3-enc; i
|
33749
|
0 |
0 |
if( i
|
33755
|
2708 |
0 |
while( z
|
|
0 |
2708 |
while( z
|
33756
|
0 |
2708 |
if( z>=zEnd ) return 0; |
33759
|
4 |
2704 |
if( *z=='-' ){ |
33762
|
0 |
2704 |
}else if( *z=='+' ){ |
33767
|
5065 |
392 |
while( z
|
|
2749 |
2316 |
while( z
|
33770
|
0 |
2749 |
if( s>=((LARGEST_INT64-9)/10) ){ |
33773
|
0 |
0 |
while( z
|
|
0 |
0 |
while( z
|
33776
|
392 |
2316 |
if( z>=zEnd ) goto do_atof_calc; |
33779
|
2170 |
146 |
if( *z=='.' ){ |
33784
|
32448 |
2170 |
while( z
|
|
32448 |
0 |
while( z
|
33785
|
32448 |
0 |
if( s<((LARGEST_INT64-9)/10) ){ |
33793
|
2170 |
146 |
if( z>=zEnd ) goto do_atof_calc; |
33796
|
146 |
0 |
if( *z=='e' || *z=='E' ){ |
|
0 |
146 |
if( *z=='e' || *z=='E' ){ |
33804
|
0 |
0 |
if( z>=zEnd ) goto do_atof_calc; /*PREVENTS-HARMLESS-OVERREAD*/ |
33807
|
0 |
0 |
if( *z=='-' ){ |
33810
|
0 |
0 |
}else if( *z=='+' ){ |
33814
|
0 |
0 |
while( z
|
|
0 |
0 |
while( z
|
33815
|
0 |
0 |
e = e<10000 ? (e*10 + (*z - '0')) : 10000; |
33822
|
180 |
0 |
while( z
|
|
34 |
146 |
while( z
|
33827
|
2170 |
538 |
if( e<0 ) { |
33834
|
140 |
2568 |
if( s==0 ) { |
33836
|
0 |
140 |
result = sign<0 ? -(double)0 : (double)0; |
33844
|
2170 |
398 |
while( e>0 ){ /*OPTIMIZATION-IF-TRUE*/ |
33845
|
0 |
2170 |
if( esign>0 ){ |
33846
|
0 |
0 |
if( s>=(LARGEST_INT64/10) ) break; /*OPTIMIZATION-IF-FALSE*/ |
33849
|
2170 |
0 |
if( s%10!=0 ) break; /*OPTIMIZATION-IF-FALSE*/ |
33856
|
4 |
2564 |
s = sign<0 ? -s : s; |
33858
|
398 |
2170 |
if( e==0 ){ /*OPTIMIZATION-IF-TRUE*/ |
33862
|
0 |
2170 |
if( e>307 ){ /*OPTIMIZATION-IF-TRUE*/ |
33863
|
0 |
0 |
if( e<342 ){ /*OPTIMIZATION-IF-TRUE*/ |
33865
|
0 |
0 |
if( esign<0 ){ |
33873
|
0 |
0 |
if( esign<0 ){ |
33885
|
2170 |
0 |
if( esign<0 ){ |
33898
|
2562 |
146 |
if( z==zEnd && nDigit>0 && eValid && eType>0 ){ |
|
2562 |
0 |
if( z==zEnd && nDigit>0 && eValid && eType>0 ){ |
|
2562 |
0 |
if( z==zEnd && nDigit>0 && eValid && eType>0 ){ |
|
2562 |
0 |
if( z==zEnd && nDigit>0 && eValid && eType>0 ){ |
33900
|
0 |
146 |
}else if( eType>=2 && (eType==3 || eValid) && nDigit>0 ){ |
|
0 |
0 |
}else if( eType>=2 && (eType==3 || eValid) && nDigit>0 ){ |
|
0 |
0 |
}else if( eType>=2 && (eType==3 || eValid) && nDigit>0 ){ |
|
0 |
0 |
}else if( eType>=2 && (eType==3 || eValid) && nDigit>0 ){ |
33922
|
0 |
355 |
if( v<0 ){ |
33923
|
0 |
0 |
x = (v==SMALLEST_INT64) ? ((u64)1)<<63 : (u64)-v; |
33932
|
24 |
355 |
}while( x ); |
33933
|
0 |
355 |
if( v<0 ) zTemp[i--] = '-'; |
33956
|
0 |
0 |
for(i=0; c==0 && i<18; i++){ |
|
0 |
0 |
for(i=0; c==0 && i<18; i++){ |
33959
|
0 |
0 |
if( c==0 ){ |
33995
|
478 |
0 |
if( enc==SQLITE_UTF8 ){ |
34001
|
0 |
0 |
for(i=3-enc; i
|
|
0 |
0 |
for(i=3-enc; i
|
34006
|
478 |
0 |
while( zNum
|
|
0 |
478 |
while( zNum
|
34007
|
478 |
0 |
if( zNum
|
34008
|
0 |
478 |
if( *zNum=='-' ){ |
34011
|
0 |
478 |
}else if( *zNum=='+' ){ |
34016
|
845 |
0 |
while( zNum
|
|
367 |
478 |
while( zNum
|
34017
|
743 |
54 |
for(i=0; &zNum[i]='0' && c<='9'; i+=incr){ |
|
319 |
424 |
for(i=0; &zNum[i]='0' && c<='9'; i+=incr){ |
|
319 |
0 |
for(i=0; &zNum[i]='0' && c<='9'; i+=incr){ |
34023
|
0 |
478 |
if( u>LARGEST_INT64 ){ |
34028
|
0 |
0 |
*pNum = neg ? SMALLEST_INT64 : LARGEST_INT64; |
34029
|
0 |
478 |
}else if( neg ){ |
34035
|
367 |
111 |
if( i==0 && zStart==zNum ){ /* No digits */ |
|
0 |
367 |
if( i==0 && zStart==zNum ){ /* No digits */ |
34037
|
0 |
478 |
}else if( nonNum ){ /* UTF16 with high-order bytes non-zero */ |
34039
|
424 |
54 |
}else if( &zNum[i]
|
34042
|
424 |
424 |
if( !sqlite3Isspace(zNum[jj]) ){ |
34047
|
424 |
0 |
}while( &zNum[jj]
|
34049
|
478 |
0 |
if( i<19*incr ){ |
34055
|
0 |
0 |
c = i>19*incr ? 1 : compare2pow63(zNum, incr); |
34056
|
0 |
0 |
if( c<0 ){ |
34061
|
0 |
0 |
*pNum = neg ? SMALLEST_INT64 : LARGEST_INT64; |
34062
|
0 |
0 |
if( c>0 ){ |
34069
|
0 |
0 |
return neg ? rc : 3; |
34089
|
0 |
12 |
if( z[0]=='0' |
34090
|
0 |
0 |
&& (z[1]=='x' || z[1]=='X') |
|
0 |
0 |
&& (z[1]=='x' || z[1]=='X') |
34094
|
0 |
0 |
for(i=2; z[i]=='0'; i++){} |
34095
|
0 |
0 |
for(k=i; sqlite3Isxdigit(z[k]); k++){ |
34099
|
0 |
0 |
return (z[k]==0 && k-i<=16) ? 0 : 2; |
|
0 |
0 |
return (z[k]==0 && k-i<=16) ? 0 : 2; |
34121
|
0 |
1291 |
if( zNum[0]=='-' ){ |
34124
|
0 |
1291 |
}else if( zNum[0]=='+' ){ |
34128
|
39 |
1252 |
else if( zNum[0]=='0' |
34129
|
39 |
0 |
&& (zNum[1]=='x' || zNum[1]=='X') |
|
0 |
39 |
&& (zNum[1]=='x' || zNum[1]=='X') |
34130
|
0 |
0 |
&& sqlite3Isxdigit(zNum[2]) |
34134
|
0 |
0 |
while( zNum[0]=='0' ) zNum++; |
34135
|
0 |
0 |
for(i=0; sqlite3Isxdigit(zNum[i]) && i<8; i++){ |
|
0 |
0 |
for(i=0; sqlite3Isxdigit(zNum[i]) && i<8; i++){ |
34138
|
0 |
0 |
if( (u&0x80000000)==0 && sqlite3Isxdigit(zNum[i])==0 ){ |
|
0 |
0 |
if( (u&0x80000000)==0 && sqlite3Isxdigit(zNum[i])==0 ){ |
34146
|
0 |
1291 |
if( !sqlite3Isdigit(zNum[0]) ) return 0; |
34147
|
39 |
1291 |
while( zNum[0]=='0' ) zNum++; |
34148
|
3076 |
0 |
for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){ |
|
1785 |
1291 |
for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){ |
|
1785 |
0 |
for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){ |
34158
|
0 |
1291 |
if( i>10 ){ |
34162
|
12 |
1279 |
if( v-neg>2147483647 ){ |
34165
|
0 |
1279 |
if( neg ){ |
34191
|
808 |
784 |
for(i=0; sqlite3Isdigit(z[i]); i++){ |
34193
|
0 |
808 |
if( v>4294967296LL ){ *pI = 0; return 0; } |
34195
|
784 |
0 |
if( i==0 || z[i]!=0 ){ *pI = 0; return 0; } |
|
0 |
784 |
if( i==0 || z[i]!=0 ){ *pI = 0; return 0; } |
34232
|
0 |
43 |
if( v & (((u64)0xff000000)<<32) ){ |
34235
|
0 |
0 |
for(i=7; i>=0; i--){ |
34245
|
86 |
43 |
}while( v!=0 ); |
34248
|
129 |
43 |
for(i=0, j=n-1; j>=0; j--, i++){ |
34254
|
2168 |
2420 |
if( v<=0x7f ){ |
34258
|
2377 |
43 |
if( v<=0x3fff ){ |
34286
|
4574 |
380 |
if( ((signed char*)p)[0]>=0 ){ |
34290
|
380 |
0 |
if( ((signed char*)p)[1]>=0 ){ |
34304
|
0 |
0 |
if (!(a&0x80)) |
34320
|
0 |
0 |
if (!(b&0x80)) |
34344
|
0 |
0 |
if (!(a&0x80)) |
34366
|
0 |
0 |
if (!(b&0x80)) |
34382
|
0 |
0 |
if (!(a&0x80)) |
34399
|
0 |
0 |
if (!(b&0x80)) |
34464
|
471 |
28 |
if (!(b&0x80)) |
34478
|
28 |
0 |
if (!(a&0x80)) |
34504
|
0 |
0 |
if( (v64 & SQLITE_MAX_U32)!=v64 ){ |
34568
|
495 |
8854 |
for(i=1; (v >>= 7)!=0; i++){ assert( i<10 ); } |
34642
|
6 |
0 |
if( zBlob ){ |
34643
|
163840 |
6 |
for(i=0; i
|
34680
|
0 |
8905 |
if( db==0 ){ |
34685
|
0 |
8905 |
if( eOpenState!=SQLITE_STATE_OPEN ){ |
34686
|
0 |
0 |
if( sqlite3SafetyCheckSickOrOk(db) ){ |
34698
|
1390 |
12 |
if( eOpenState!=SQLITE_STATE_SICK && |
|
6 |
1384 |
if( eOpenState!=SQLITE_STATE_SICK && |
34699
|
0 |
6 |
eOpenState!=SQLITE_STATE_OPEN && |
34777
|
219 |
0 |
if( x>=0 ) return x; |
34778
|
0 |
0 |
if( x==(int)0x80000000 ) return 0x7fffffff; |
34831
|
2648 |
2167 |
if( a>=b ){ |
34832
|
1779 |
869 |
if( a>b+49 ) return a; |
34833
|
3 |
866 |
if( a>b+31 ) return a+1; |
34836
|
1876 |
291 |
if( b>a+49 ) return b; |
34837
|
97 |
194 |
if( b>a+31 ) return b+1; |
34849
|
211 |
3620 |
if( x<8 ){ |
34850
|
124 |
87 |
if( x<2 ) return 0; |
34851
|
151 |
87 |
while( x<8 ){ y -= 10; x <<= 1; } |
34873
|
84 |
72 |
if( x<=1 ) return 0; |
34874
|
72 |
0 |
if( x<=2000000000 ) return sqlite3LogEst((u64)x); |
34887
|
0 |
0 |
if( n>=5 ) n -= 2; |
34888
|
0 |
0 |
else if( n>=1 ) n -= 1; |
34889
|
0 |
0 |
if( x>60 ) return (u64)LARGEST_INT64; |
34890
|
0 |
0 |
return x>=3 ? (n+8)<<(x-3) : (n+8)>>(3-x); |
34942
|
8 |
22 |
if( pIn==0 || pIn[1]+nInt > pIn[0] ){ |
|
0 |
8 |
if( pIn==0 || pIn[1]+nInt > pIn[0] ){ |
34944
|
0 |
22 |
sqlite3_int64 nAlloc = (pIn ? 2*(sqlite3_int64)pIn[0] : 10) + nInt; |
34946
|
0 |
22 |
if( pOut==0 ) return pIn; |
34947
|
22 |
0 |
if( pIn==0 ) pOut[1] = 2; |
34969
|
3 |
32 |
if( pIn==0 ) return 0; |
34973
|
32 |
8 |
if( pIn[i]==iVal ) return (char*)&pIn[i+2]; |
34975
|
8 |
0 |
}while( i
|
34985
|
13 |
12 |
if( pIn==0 ) return 0; |
34990
|
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]; |
34992
|
2 |
5 |
}while( i
|
35041
|
9413 |
3598 |
while( elem ){ |
35055
|
100941 |
12459 |
while( (c = (unsigned char)*z++)!=0 ){ /*OPTIMIZATION-IF-TRUE*/ |
35075
|
7605 |
7507 |
if( pEntry ){ |
35076
|
1641 |
5964 |
pHead = pEntry->count ? pEntry->chain : 0; |
35082
|
1641 |
13471 |
if( pHead ){ |
35085
|
1631 |
10 |
if( pHead->prev ){ pHead->prev->next = pNew; } |
35090
|
11392 |
2079 |
if( pH->first ){ pH->first->prev = pNew; } |
35108
|
0 |
624 |
if( new_size*sizeof(struct _ht)>SQLITE_MALLOC_SOFT_LIMIT ){ |
35111
|
0 |
624 |
if( new_size==pH->htsize ) return 0; |
35126
|
0 |
624 |
if( new_ht==0 ) return 0; |
35131
|
5616 |
624 |
for(elem=pH->first, pH->first=0; elem; elem = next_elem){ |
35154
|
6219 |
32488 |
if( pH->ht ){ /*OPTIMIZATION-IF-TRUE*/ |
35165
|
10215 |
28492 |
if( pHash ) *pHash = h; |
35166
|
89581 |
28121 |
while( count-- ){ |
35168
|
10586 |
78995 |
if( sqlite3StrICmp(elem->pKey,pKey)==0 ){ |
35185
|
2 |
21 |
if( elem->prev ){ |
35190
|
9 |
14 |
if( elem->next ){ |
35193
|
0 |
23 |
if( pH->ht ){ |
35195
|
0 |
0 |
if( pEntry->chain==elem ){ |
35203
|
14 |
9 |
if( pH->count==0 ){ |
35242
|
645 |
9570 |
if( elem->data ){ |
35244
|
23 |
622 |
if( data==0 ){ |
35252
|
74 |
9496 |
if( data==0 ) return 0; |
35254
|
0 |
9496 |
if( new_elem==0 ) return data; |
35258
|
1989 |
7507 |
if( pH->count>=10 && pH->count > 2*pH->htsize ){ |
|
624 |
1365 |
if( pH->count>=10 && pH->count > 2*pH->htsize ){ |
35259
|
624 |
0 |
if( rehash(pH, pH->count*2) ){ |
35264
|
1989 |
7507 |
insertElement(pH, pH->ht ? &pH->ht[h] : 0, new_elem); |
36035
|
92 |
0 |
return osGeteuid() ? 0 : osFchown(fd,uid,gid); |
36056
|
0 |
0 |
if( zName==0 ){ |
36061
|
0 |
0 |
for(i=0; i
|
36062
|
0 |
0 |
if( aSyscall[i].pDefault ){ |
36070
|
0 |
0 |
for(i=0; i
|
36071
|
0 |
0 |
if( strcmp(zName, aSyscall[i].zName)==0 ){ |
36072
|
0 |
0 |
if( aSyscall[i].pDefault==0 ){ |
36076
|
0 |
0 |
if( pNewFunc==0 ) pNewFunc = aSyscall[i].pDefault; |
36097
|
0 |
0 |
for(i=0; i
|
36098
|
0 |
0 |
if( strcmp(zName, aSyscall[i].zName)==0 ) return aSyscall[i].pCurrent; |
36113
|
0 |
0 |
if( zName ){ |
36114
|
0 |
0 |
for(i=0; i
|
36115
|
0 |
0 |
if( strcmp(zName, aSyscall[i].zName)==0 ) break; |
36118
|
0 |
0 |
for(i++; i
|
36119
|
0 |
0 |
if( aSyscall[i].pCurrent!=0 ) return aSyscall[i].zName; |
36152
|
92 |
305 |
mode_t m2 = m ? m : SQLITE_DEFAULT_FILE_PERMISSIONS; |
36159
|
9 |
388 |
if( fd<0 ){ |
36160
|
0 |
9 |
if( errno==EINTR ) continue; |
36163
|
388 |
0 |
if( fd>=SQLITE_MINIMUM_FILE_DESCRIPTOR ) break; |
36168
|
0 |
0 |
if( osOpen("/dev/null", O_RDONLY, m)<0 ) break; |
36170
|
388 |
9 |
if( fd>=0 ){ |
36171
|
92 |
296 |
if( m!=0 ){ |
36173
|
92 |
0 |
if( osFstat(fd, &statbuf)==0 |
36174
|
92 |
0 |
&& statbuf.st_size==0 |
36175
|
0 |
92 |
&& (statbuf.st_mode&0777)!=m |
36324
|
0 |
0 |
do{ rc = osFtruncate(h,sz); }while( rc<0 && errno==EINTR ); |
|
0 |
0 |
do{ rc = osFtruncate(h,sz); }while( rc<0 && errno==EINTR ); |
36740
|
0 |
6 |
if( zPath==0 ) zPath = ""; |
36763
|
0 |
386 |
if( osClose(h) ){ |
36764
|
0 |
0 |
unixLogErrorAtLine(SQLITE_IOERR_CLOSE, "close", |
36785
|
0 |
366 |
for(p=pInode->pUnused; p; p=pNext){ |
36803
|
104 |
0 |
if( ALWAYS(pInode) ){ |
36805
|
95 |
9 |
if( pInode->nRef==0 ){ |
36810
|
0 |
95 |
if( pInode->pPrev ){ |
36817
|
0 |
95 |
if( pInode->pNext ){ |
36853
|
0 |
106 |
if( rc!=0 ){ |
36895
|
9 |
97 |
while( pInode && memcmp(&fileId, &pInode->fileId, sizeof(fileId)) ){ |
|
0 |
9 |
while( pInode && memcmp(&fileId, &pInode->fileId, sizeof(fileId)) ){ |
36898
|
97 |
9 |
if( pInode==0 ){ |
36900
|
0 |
97 |
if( pInode==0 ){ |
36905
|
97 |
0 |
if( sqlite3GlobalConfig.bCoreMutex ){ |
36907
|
0 |
97 |
if( pInode->pLockMutex==0 ){ |
36916
|
0 |
97 |
if( inodeList ) inodeList->pPrev = pInode; |
36935
|
0 |
334 |
|| (u64)buf.st_ino!=pFile->pInode->fileId.ino); |
36954
|
92 |
210 |
if( pFile->ctrlFlags & UNIXFILE_NOLOCK ) return; |
36957
|
0 |
210 |
if( rc!=0 ){ |
36961
|
0 |
210 |
if( buf.st_nlink==0 ){ |
36965
|
0 |
210 |
if( buf.st_nlink>1 ){ |
36969
|
0 |
210 |
if( fileHasMoved(pFile) ){ |
36994
|
65 |
87 |
if( pFile->pInode->eFileLock>SHARED_LOCK ){ |
37001
|
87 |
65 |
if( !reserved && !pFile->pInode->bProcessLock ){ |
|
87 |
0 |
if( !reserved && !pFile->pInode->bProcessLock ){ |
37007
|
0 |
87 |
if( osFcntl(pFile->h, F_GETLK, &lock) ){ |
37010
|
87 |
0 |
} else if( lock.l_type!=F_UNLCK ){ |
37088
|
0 |
1662 |
if( (pFile->ctrlFlags & (UNIXFILE_EXCL|UNIXFILE_RDONLY))==UNIXFILE_EXCL ){ |
37089
|
0 |
0 |
if( pInode->bProcessLock==0 ){ |
37097
|
0 |
0 |
if( rc<0 ) return rc; |
37189
|
0 |
710 |
if( pFile->eFileLock>=eFileLock ){ |
37212
|
156 |
554 |
if( (pFile->eFileLock!=pInode->eFileLock && |
|
130 |
26 |
if( (pFile->eFileLock!=pInode->eFileLock && |
37213
|
65 |
65 |
(pInode->eFileLock>=PENDING_LOCK || eFileLock>SHARED_LOCK)) |
37223
|
336 |
283 |
if( eFileLock==SHARED_LOCK && |
|
336 |
0 |
if( eFileLock==SHARED_LOCK && |
37224
|
65 |
271 |
(pInode->eFileLock==SHARED_LOCK || pInode->eFileLock==RESERVED_LOCK) ){ |
37241
|
283 |
271 |
if( eFileLock==SHARED_LOCK |
37242
|
97 |
186 |
|| (eFileLock==EXCLUSIVE_LOCK && pFile->eFileLock
|
|
97 |
0 |
|| (eFileLock==EXCLUSIVE_LOCK && pFile->eFileLock
|
37246
|
0 |
368 |
if( unixFileLock(pFile, &lock) ){ |
37249
|
0 |
0 |
if( rc!=SQLITE_BUSY ){ |
37260
|
271 |
283 |
if( eFileLock==SHARED_LOCK ){ |
37268
|
0 |
271 |
if( unixFileLock(pFile, &lock) ){ |
37277
|
0 |
271 |
if( unixFileLock(pFile, &lock) && rc==SQLITE_OK ){ |
|
0 |
0 |
if( unixFileLock(pFile, &lock) && rc==SQLITE_OK ){ |
37283
|
0 |
271 |
if( rc ){ |
37284
|
0 |
0 |
if( rc!=SQLITE_BUSY ){ |
37293
|
97 |
186 |
}else if( eFileLock==EXCLUSIVE_LOCK && pInode->nShared>1 ){ |
|
0 |
97 |
}else if( eFileLock==EXCLUSIVE_LOCK && pInode->nShared>1 ){ |
37306
|
186 |
97 |
if( eFileLock==RESERVED_LOCK ){ |
37314
|
87 |
196 |
if( unixFileLock(pFile, &lock) ){ |
37317
|
0 |
87 |
if( rc!=SQLITE_BUSY ){ |
37341
|
467 |
87 |
if( rc==SQLITE_OK ){ |
37344
|
0 |
87 |
}else if( eFileLock==EXCLUSIVE_LOCK ){ |
37395
|
210 |
435 |
if( pFile->eFileLock<=eFileLock ){ |
37401
|
99 |
336 |
if( pFile->eFileLock>SHARED_LOCK ){ |
37425
|
99 |
0 |
if( eFileLock==SHARED_LOCK ){ |
37474
|
0 |
99 |
if( unixFileLock(pFile, &lock) ){ |
37491
|
99 |
0 |
if( unixFileLock(pFile, &lock)==0 ){ |
37499
|
336 |
99 |
if( eFileLock==NO_LOCK ){ |
37505
|
271 |
65 |
if( pInode->nShared==0 ){ |
37509
|
271 |
0 |
if( unixFileLock(pFile, &lock)==0 ){ |
37525
|
271 |
65 |
if( pInode->nLock==0 ) closePendingFds(pFile); |
37530
|
435 |
0 |
if( rc==SQLITE_OK ){ |
37570
|
196 |
0 |
if( pFile->h>=0 ){ |
37616
|
0 |
104 |
if( pInode->nLock ){ |
37764
|
0 |
0 |
if( pFile->eFileLock > NO_LOCK ){ |
37777
|
0 |
0 |
if( rc<0 ){ |
37780
|
0 |
0 |
if( EEXIST == tErrno ){ |
37784
|
0 |
0 |
if( rc!=SQLITE_BUSY ){ |
37816
|
0 |
0 |
if( pFile->eFileLock==eFileLock ){ |
37823
|
0 |
0 |
if( eFileLock==SHARED_LOCK ){ |
37831
|
0 |
0 |
if( rc<0 ){ |
37833
|
0 |
0 |
if( tErrno==ENOENT ){ |
38781
|
0 |
587 |
if( newOffset<0 ){ |
38787
|
406 |
181 |
if( got==cnt ) break; |
38788
|
0 |
181 |
if( got<0 ){ |
38789
|
0 |
0 |
if( errno==EINTR ){ got = 1; continue; } |
38793
|
0 |
181 |
}else if( got>0 ){ |
38799
|
0 |
181 |
}while( got>0 ); |
38835
|
0 |
587 |
if( offsetmmapSize ){ |
38836
|
0 |
0 |
if( offset+amt <= pFile->mmapSize ){ |
38850
|
406 |
181 |
if( got==amt ){ |
38852
|
0 |
181 |
}else if( got<0 ){ |
38860
|
0 |
0 |
switch( pFile->lastErrno ){ |
38910
|
0 |
835 |
if( iSeek<0 ){ |
38915
|
0 |
835 |
}while( rc<0 && errno==EINTR ); |
|
0 |
0 |
}while( rc<0 && errno==EINTR ); |
38921
|
0 |
835 |
if( rc<0 ) *piErrno = errno; |
39001
|
0 |
835 |
while( (wrote = seekAndWrite(pFile, offset, pBuf, amt))0 ){ |
|
0 |
0 |
while( (wrote = seekAndWrite(pFile, offset, pBuf, amt))0 ){ |
39009
|
0 |
835 |
if( amt>wrote ){ |
39010
|
0 |
0 |
if( wrote<0 && pFile->lastErrno!=ENOSPC ){ |
|
0 |
0 |
if( wrote<0 && pFile->lastErrno!=ENOSPC ){ |
39179
|
1566 |
0 |
for(ii=(int)strlen(zDirname); ii>0 && zDirname[ii]!='/'; ii--); |
|
1476 |
90 |
for(ii=(int)strlen(zDirname); ii>0 && zDirname[ii]!='/'; ii--); |
39180
|
90 |
0 |
if( ii>0 ){ |
39183
|
0 |
0 |
if( zDirname[0]!='/' ) zDirname[0] = '.'; |
39191
|
90 |
0 |
if( fd>=0 ) return SQLITE_OK; |
39231
|
0 |
270 |
if( rc ){ |
39240
|
90 |
180 |
if( pFile->ctrlFlags & UNIXFILE_DIRSYNC ){ |
39245
|
90 |
0 |
if( rc==SQLITE_OK ){ |
39271
|
0 |
0 |
if( pFile->szChunk>0 ){ |
39276
|
0 |
0 |
if( rc ){ |
39298
|
0 |
0 |
if( nBytemmapSize ){ |
39316
|
0 |
342 |
if( rc!=0 ){ |
39328
|
0 |
342 |
if( *pSize==1 ) *pSize = 0; |
39349
|
0 |
29 |
if( pFile->szChunk>0 ){ |
39353
|
0 |
0 |
if( osFstat(pFile->h, &buf) ){ |
39358
|
0 |
0 |
if( nSize>(i64)buf.st_size ){ |
39384
|
0 |
0 |
for(/*no-op*/; iWrite
|
39385
|
0 |
0 |
if( iWrite>=nSize ) iWrite = nSize - 1; |
39387
|
0 |
0 |
if( nWrite!=1 ) return SQLITE_IOERR_WRITE; |
39394
|
0 |
29 |
if( pFile->mmapSizeMax>0 && nByte>pFile->mmapSize ){ |
|
0 |
0 |
if( pFile->mmapSizeMax>0 && nByte>pFile->mmapSize ){ |
39396
|
0 |
0 |
if( pFile->szChunk<=0 ){ |
39397
|
0 |
0 |
if( robust_ftruncate(pFile->h, nByte) ){ |
39418
|
0 |
0 |
if( *pArg<0 ){ |
39420
|
0 |
0 |
}else if( (*pArg)==0 ){ |
39487
|
0 |
0 |
if( zTFile ){ |
39509
|
0 |
322 |
if( newLimit>sqlite3GlobalConfig.mxMmap ){ |
39521
|
322 |
0 |
if( newLimit>=0 && newLimit!=pFile->mmapSizeMax && pFile->nFetchOut==0 ){ |
|
0 |
322 |
if( newLimit>=0 && newLimit!=pFile->mmapSizeMax && pFile->nFetchOut==0 ){ |
|
0 |
0 |
if( newLimit>=0 && newLimit!=pFile->mmapSizeMax && pFile->nFetchOut==0 ){ |
39523
|
0 |
0 |
if( pFile->mmapSize>0 ){ |
39573
|
106 |
835 |
if( pFd->sectorSize==0 ){ |
39586
|
106 |
0 |
if( pFd->ctrlFlags & UNIXFILE_PSOW ){ |
39813
|
0 |
0 |
if( pFile->pShm){ |
39824
|
0 |
0 |
if( osFcntl(pShmNode->hShm, F_GETLK, &f)<0 ){ |
39863
|
0 |
0 |
if( pShmNode->hShm>=0 ){ |
39871
|
0 |
0 |
if( res==-1 ){ |
39931
|
0 |
0 |
if( pgsz
|
39944
|
0 |
0 |
if( p && ALWAYS(p->nRef==0) ){ |
|
0 |
0 |
if( p && ALWAYS(p->nRef==0) ){ |
39949
|
0 |
0 |
for(i=0; inRegion; i+=nShmPerMap){ |
39950
|
0 |
0 |
if( p->hShm>=0 ){ |
39957
|
0 |
0 |
if( p->hShm>=0 ){ |
40001
|
0 |
0 |
if( osFcntl(pShmNode->hShm, F_GETLK, &lock)!=0 ) { |
40003
|
0 |
0 |
}else if( lock.l_type==F_UNLCK ){ |
40004
|
0 |
0 |
if( pShmNode->isReadonly ){ |
40014
|
0 |
0 |
if( rc==SQLITE_OK && robust_ftruncate(pShmNode->hShm, 3) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && robust_ftruncate(pShmNode->hShm, 3) ){ |
40018
|
0 |
0 |
}else if( lock.l_type==F_WRLCK ){ |
40022
|
0 |
0 |
if( rc==SQLITE_OK ){ |
40074
|
0 |
0 |
if( p==0 ) return SQLITE_NOMEM_BKPT; |
40085
|
0 |
0 |
if( pShmNode==0 ){ |
40095
|
0 |
0 |
if( osFstat(pDbFd->h, &sStat) ){ |
40106
|
0 |
0 |
if( pShmNode==0 ){ |
40123
|
0 |
0 |
if( sqlite3GlobalConfig.bCoreMutex ){ |
40125
|
0 |
0 |
if( pShmNode->pShmMutex==0 ){ |
40131
|
0 |
0 |
if( pInode->bProcessLock==0 ){ |
40132
|
0 |
0 |
if( 0==sqlite3_uri_boolean(pDbFd->zPath, "readonly_shm", 0) ){ |
40136
|
0 |
0 |
if( pShmNode->hShm<0 ){ |
40139
|
0 |
0 |
if( pShmNode->hShm<0 ){ |
40153
|
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; |
40221
|
0 |
0 |
if( pDbFd->pShm==0 ){ |
40223
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
40229
|
0 |
0 |
if( pShmNode->isUnlocked ){ |
40231
|
0 |
0 |
if( rc!=SQLITE_OK ) goto shmpage_out; |
40242
|
0 |
0 |
if( pShmNode->nRegion
|
40249
|
0 |
0 |
if( pShmNode->hShm>=0 ){ |
40254
|
0 |
0 |
if( osFstat(pShmNode->hShm, &sStat) ){ |
40259
|
0 |
0 |
if( sStat.st_size
|
40263
|
0 |
0 |
if( !bExtend ){ |
40280
|
0 |
0 |
for(iPg=(sStat.st_size/pgsz); iPg<(nByte/pgsz); iPg++){ |
40282
|
0 |
0 |
if( seekAndWriteFd(pShmNode->hShm, iPg*pgsz + pgsz-1,"",1,&x)!=1 ){ |
40296
|
0 |
0 |
if( !apNew ){ |
40301
|
0 |
0 |
while( pShmNode->nRegion
|
40305
|
0 |
0 |
if( pShmNode->hShm>=0 ){ |
40306
|
0 |
0 |
pMem = osMmap(0, nMap, |
40310
|
0 |
0 |
if( pMem==MAP_FAILED ){ |
40316
|
0 |
0 |
if( pMem==0 ){ |
40323
|
0 |
0 |
for(i=0; i
|
40331
|
0 |
0 |
if( pShmNode->nRegion>iRegion ){ |
40336
|
0 |
0 |
if( pShmNode->isReadonly && rc==SQLITE_OK ) rc = SQLITE_READONLY; |
|
0 |
0 |
if( pShmNode->isReadonly && rc==SQLITE_OK ) rc = SQLITE_READONLY; |
40395
|
0 |
0 |
if( p==0 ) return SQLITE_IOERR_SHMLOCK; |
40397
|
0 |
0 |
if( NEVER(pShmNode==0) ) return SQLITE_IOERR_SHMLOCK; |
40438
|
0 |
0 |
if( flags & SQLITE_SHM_UNLOCK ){ |
40439
|
0 |
0 |
if( (p->exclMask|p->sharedMask) & mask ){ |
40443
|
0 |
0 |
for(ii=ofst; ii
|
40444
|
0 |
0 |
if( aLock[ii]>((p->sharedMask & (1<
|
40449
|
0 |
0 |
if( bUnlock ){ |
40451
|
0 |
0 |
if( rc==SQLITE_OK ){ |
40454
|
0 |
0 |
}else if( ALWAYS(p->sharedMask & (1<
|
40460
|
0 |
0 |
if( rc==SQLITE_OK ){ |
40465
|
0 |
0 |
}else if( flags & SQLITE_SHM_SHARED ){ |
40468
|
0 |
0 |
if( (p->sharedMask & mask)==0 ){ |
40469
|
0 |
0 |
if( aLock[ofst]<0 ){ |
40471
|
0 |
0 |
}else if( aLock[ofst]==0 ){ |
40476
|
0 |
0 |
if( rc==SQLITE_OK ){ |
40485
|
0 |
0 |
for(ii=ofst; ii
|
40487
|
0 |
0 |
if( ALWAYS((p->exclMask & (1<
|
|
0 |
0 |
if( ALWAYS((p->exclMask & (1<
|
40495
|
0 |
0 |
if( rc==SQLITE_OK ){ |
40497
|
0 |
0 |
if( rc==SQLITE_OK ){ |
40500
|
0 |
0 |
for(ii=ofst; ii
|
40549
|
0 |
0 |
if( p==0 ) return SQLITE_OK; |
40558
|
0 |
0 |
for(pp=&pShmNode->pFirst; (*pp)!=p; pp = &(*pp)->pNext){} |
40572
|
0 |
0 |
if( pShmNode->nRef==0 ){ |
40573
|
0 |
0 |
if( deleteFlag && pShmNode->hShm>=0 ){ |
|
0 |
0 |
if( deleteFlag && pShmNode->hShm>=0 ){ |
40597
|
0 |
196 |
if( pFd->pMapRegion ){ |
40642
|
0 |
0 |
if( pOrig ){ |
40652
|
0 |
0 |
if( nReuse!=nOrig ){ |
40672
|
0 |
0 |
if( pNew==MAP_FAILED || pNew==0 ){ |
|
0 |
0 |
if( pNew==MAP_FAILED || pNew==0 ){ |
40678
|
0 |
0 |
if( pNew==0 ){ |
40682
|
0 |
0 |
if( pNew==MAP_FAILED ){ |
40715
|
0 |
0 |
if( pFd->nFetchOut>0 ) return SQLITE_OK; |
40717
|
0 |
0 |
if( nMap<0 ){ |
40719
|
0 |
0 |
if( osFstat(pFd->h, &statbuf) ){ |
40724
|
0 |
0 |
if( nMap>pFd->mmapSizeMax ){ |
40729
|
0 |
0 |
if( nMap!=pFd->mmapSize ){ |
40756
|
0 |
0 |
if( pFd->mmapSizeMax>0 ){ |
40757
|
0 |
0 |
if( pFd->pMapRegion==0 ){ |
40759
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
40761
|
0 |
0 |
if( pFd->mmapSize >= iOff+nAmt ){ |
40793
|
0 |
0 |
if( p ){ |
41134
|
8 |
190 |
if( sqlite3_uri_boolean(((ctrlFlags & UNIXFILE_URI) ? zFilename : 0), |
|
198 |
0 |
if( sqlite3_uri_boolean(((ctrlFlags & UNIXFILE_URI) ? zFilename : 0), |
41138
|
0 |
198 |
if( strcmp(pVfs->zName,"unix-excl")==0 ){ |
41150
|
92 |
106 |
if( ctrlFlags & UNIXFILE_NOLOCK ){ |
41162
|
106 |
92 |
if( pLockingStyle == &posixIoMethods |
41169
|
0 |
106 |
if( rc!=SQLITE_OK ){ |
41222
|
0 |
92 |
else if( pLockingStyle == &dotlockIoMethods ){ |
41231
|
0 |
0 |
if( zLockFile==0 ){ |
41272
|
0 |
198 |
if( rc!=SQLITE_OK ){ |
41273
|
0 |
0 |
if( h>=0 ) robust_close(pNew, h, __LINE__); |
41312
|
0 |
0 |
if( zDir!=0 |
41313
|
0 |
0 |
&& osStat(zDir, &buf)==0 |
41314
|
0 |
0 |
&& S_ISDIR(buf.st_mode) |
41315
|
0 |
0 |
&& osAccess(zDir, 03)==0 |
41319
|
0 |
0 |
if( i>=sizeof(azTempDirs)/sizeof(azTempDirs[0]) ) break; |
41344
|
0 |
0 |
if( zDir==0 ){ |
41354
|
0 |
0 |
if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ){ |
|
0 |
0 |
if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ){ |
41358
|
0 |
0 |
}while( osAccess(zBuf,0)==0 ); |
41410
|
9 |
103 |
if( inodeList!=0 && 0==osStat(zPath, &sStat) ){ |
|
9 |
0 |
if( inodeList!=0 && 0==osStat(zPath, &sStat) ){ |
41414
|
9 |
0 |
while( pInode && (pInode->fileId.dev!=sStat.st_dev |
|
0 |
9 |
while( pInode && (pInode->fileId.dev!=sStat.st_dev |
41415
|
0 |
9 |
|| pInode->fileId.ino!=(u64)sStat.st_ino) ){ |
41418
|
9 |
0 |
if( pInode ){ |
41423
|
0 |
9 |
for(pp=&pInode->pUnused; *pp && (*pp)->flags!=flags; pp=&((*pp)->pNext)); |
|
0 |
0 |
for(pp=&pInode->pUnused; *pp && (*pp)->flags!=flags; pp=&((*pp)->pNext)); |
41425
|
0 |
9 |
if( pUnused ){ |
41447
|
92 |
0 |
if( 0==osStat(zFile, &sStat) ){ |
41489
|
92 |
112 |
if( flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) ){ |
41512
|
736 |
0 |
while( nDb>0 && zPath[nDb]!='.' ){ |
|
736 |
0 |
while( nDb>0 && zPath[nDb]!='.' ){ |
41513
|
92 |
644 |
if( zPath[nDb]=='-' ){ |
41521
|
0 |
112 |
}else if( flags & SQLITE_OPEN_DELETEONCLOSE ){ |
41523
|
12 |
100 |
}else if( flags & SQLITE_OPEN_URI ){ |
41529
|
0 |
12 |
if( z ){ |
41589
|
192 |
12 |
int isNewJrnl = (isCreate && ( |
|
192 |
0 |
int isNewJrnl = (isCreate && ( |
41591
|
100 |
92 |
|| eType==SQLITE_OPEN_MAIN_JOURNAL |
41592
|
0 |
100 |
|| eType==SQLITE_OPEN_WAL |
41632
|
23 |
181 |
if( randomnessPid!=osGetpid(0) ){ |
41643
|
112 |
92 |
if( eType==SQLITE_OPEN_MAIN_DB ){ |
41646
|
0 |
112 |
if( pUnused ){ |
41650
|
0 |
112 |
if( !pUnused ){ |
41661
|
0 |
92 |
}else if( !zName ){ |
41665
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
41679
|
6 |
198 |
if( isReadonly ) openFlags |= O_RDONLY; |
41680
|
198 |
6 |
if( isReadWrite ) openFlags |= O_RDWR; |
41681
|
192 |
12 |
if( isCreate ) openFlags |= O_CREAT; |
41682
|
0 |
204 |
if( isExclusive ) openFlags |= (O_EXCL|O_NOFOLLOW); |
41685
|
204 |
0 |
if( fd<0 ){ |
41690
|
0 |
204 |
if( rc!=SQLITE_OK ){ |
41698
|
6 |
198 |
if( fd<0 ){ |
41699
|
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) ){ |
41703
|
6 |
0 |
}else if( errno!=EISDIR && isReadWrite ){ |
|
3 |
3 |
}else if( errno!=EISDIR && isReadWrite ){ |
41713
|
6 |
198 |
if( fd<0 ){ |
41715
|
6 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
41731
|
92 |
106 |
if( openMode && (flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL))!=0 ){ |
|
92 |
0 |
if( openMode && (flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL))!=0 ){ |
41736
|
106 |
92 |
if( pOutFlags ){ |
41740
|
106 |
92 |
if( p->pPreallocatedUnused ){ |
41746
|
0 |
198 |
if( isDelete ){ |
41780
|
0 |
198 |
if( isDelete ) ctrlFlags |= UNIXFILE_DELETE; |
41781
|
3 |
195 |
if( isReadonly ) ctrlFlags |= UNIXFILE_RDONLY; |
41783
|
92 |
106 |
if( noLock ) ctrlFlags |= UNIXFILE_NOLOCK; |
41784
|
92 |
106 |
if( isNewJrnl ) ctrlFlags |= UNIXFILE_DIRSYNC; |
41785
|
8 |
190 |
if( flags & SQLITE_OPEN_URI ) ctrlFlags |= UNIXFILE_URI; |
41826
|
6 |
198 |
if( rc!=SQLITE_OK ){ |
41845
|
0 |
92 |
if( osUnlink(zPath)==(-1) ){ |
41846
|
0 |
0 |
if( errno==ENOENT |
41858
|
0 |
92 |
if( (dirSync & 1)!=0 ){ |
41861
|
0 |
0 |
if( rc==SQLITE_OK ){ |
41862
|
0 |
0 |
if( full_fsync(fd,0,0) ){ |
41899
|
672 |
0 |
if( flags==SQLITE_ACCESS_EXISTS ){ |
41901
|
152 |
520 |
*pResOut = 0==osStat(zPath, &buf) && |
|
152 |
0 |
*pResOut = 0==osStat(zPath, &buf) && |
41902
|
152 |
0 |
(!S_ISREG(buf.st_mode) || buf.st_size>0); |
41934
|
88 |
440 |
if( zName[0]=='.' ){ |
41935
|
0 |
88 |
if( nName==1 ) return; |
41936
|
0 |
88 |
if( zName[1]=='.' && nName==2 ){ |
|
0 |
0 |
if( zName[1]=='.' && nName==2 ){ |
41937
|
0 |
0 |
if( pPath->nUsed<=1 ){ |
41942
|
0 |
0 |
while( pPath->zOut[--pPath->nUsed]!='/' ){} |
41946
|
0 |
528 |
if( pPath->nUsed + nName + 2 >= pPath->nOut ){ |
41954
|
528 |
0 |
if( pPath->rc==SQLITE_OK ){ |
41959
|
60 |
468 |
if( osLstat(zIn, &buf)!=0 ){ |
41960
|
0 |
60 |
if( errno!=ENOENT ){ |
41963
|
0 |
468 |
}else if( S_ISLNK(buf.st_mode) ){ |
41966
|
0 |
0 |
if( pPath->nSymlink++ > SQLITE_MAX_SYMLINK ){ |
41971
|
0 |
0 |
if( got<=0 || got>=(ssize_t)sizeof(zLnk)-2 ){ |
|
0 |
0 |
if( got<=0 || got>=(ssize_t)sizeof(zLnk)-2 ){ |
41976
|
0 |
0 |
if( zLnk[0]=='/' ){ |
41997
|
4477 |
200 |
while( zPath[i] && zPath[i]!='/' ){ i++; } |
|
4037 |
440 |
while( zPath[i] && zPath[i]!='/' ){ i++; } |
41998
|
528 |
112 |
if( i>j ){ |
42002
|
440 |
200 |
}while( zPath[i++] ); |
42027
|
88 |
24 |
if( zPath[0]!='/' ){ |
42029
|
0 |
88 |
if( osGetcwd(zPwd, sizeof(zPwd)-2)==0 ){ |
42036
|
112 |
0 |
if( path.rc || path.nUsed<2 ) return SQLITE_CANTOPEN_BKPT; |
|
0 |
112 |
if( path.rc || path.nUsed<2 ) return SQLITE_CANTOPEN_BKPT; |
42037
|
0 |
112 |
if( path.nSymlink ) return SQLITE_OK_SYMLINK; |
42064
|
0 |
0 |
if( zErr ){ |
42128
|
0 |
100 |
if( fd<0 ){ |
42136
|
0 |
100 |
do{ got = osRead(fd, zBuf, nBuf); }while( got<0 && errno==EINTR ); |
|
0 |
0 |
do{ got = osRead(fd, zBuf, nBuf); }while( got<0 && errno==EINTR ); |
42163
|
0 |
171 |
if( microseconds>=1000000 ) sleep(microseconds/1000000); |
42164
|
171 |
0 |
if( microseconds%1000000 ) usleep(microseconds%1000000); |
43535
|
440 |
110 |
for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){ |
49986
|
0 |
0 |
if( p->zFName ){ |
49992
|
0 |
0 |
for(i=0; ALWAYS(i
|
49993
|
0 |
0 |
if( memdb_g.apMemStore[i]==p ){ |
49995
|
0 |
0 |
if( p->nRef==1 ){ |
49997
|
0 |
0 |
if( memdb_g.nMemStore==0 ){ |
50010
|
0 |
0 |
if( p->nRef<=0 ){ |
50011
|
0 |
0 |
if( p->mFlags & SQLITE_DESERIALIZE_FREEONCLOSE ){ |
50034
|
0 |
0 |
if( iOfst+iAmt>p->sz ){ |
50036
|
0 |
0 |
if( iOfstsz ) memcpy(zBuf, p->aData+iOfst, p->sz - iOfst); |
50050
|
0 |
0 |
if( (p->mFlags & SQLITE_DESERIALIZE_RESIZEABLE)==0 || NEVER(p->nMmap>0) ){ |
|
0 |
0 |
if( (p->mFlags & SQLITE_DESERIALIZE_RESIZEABLE)==0 || NEVER(p->nMmap>0) ){ |
50053
|
0 |
0 |
if( newSz>p->szMax ){ |
50057
|
0 |
0 |
if( newSz>p->szMax ) newSz = p->szMax; |
50059
|
0 |
0 |
if( pNew==0 ) return SQLITE_IOERR_NOMEM; |
50076
|
0 |
0 |
if( NEVER(p->mFlags & SQLITE_DESERIALIZE_READONLY) ){ |
50082
|
0 |
0 |
if( iOfst+iAmt>p->sz ){ |
50084
|
0 |
0 |
if( iOfst+iAmt>p->szAlloc |
50085
|
0 |
0 |
&& (rc = memdbEnlarge(p, iOfst+iAmt))!=SQLITE_OK |
50090
|
0 |
0 |
if( iOfst>p->sz ) memset(p->aData+p->sz, 0, iOfst-p->sz); |
50109
|
0 |
0 |
if( size>p->sz ){ |
50146
|
0 |
0 |
if( eLock==pThis->eLock ) return SQLITE_OK; |
50148
|
0 |
0 |
if( eLock>SQLITE_LOCK_SHARED ){ |
50149
|
0 |
0 |
if( p->mFlags & SQLITE_DESERIALIZE_READONLY ){ |
50151
|
0 |
0 |
}else if( pThis->eLock<=SQLITE_LOCK_SHARED ){ |
50152
|
0 |
0 |
if( p->nWrLock ){ |
50158
|
0 |
0 |
}else if( eLock==SQLITE_LOCK_SHARED ){ |
50159
|
0 |
0 |
if( pThis->eLock > SQLITE_LOCK_SHARED ){ |
50162
|
0 |
0 |
}else if( p->nWrLock ){ |
50169
|
0 |
0 |
if( pThis->eLock>SQLITE_LOCK_SHARED ){ |
50176
|
0 |
0 |
if( rc==SQLITE_OK ) pThis->eLock = eLock; |
50200
|
0 |
0 |
if( op==SQLITE_FCNTL_VFSNAME ){ |
50204
|
0 |
0 |
if( op==SQLITE_FCNTL_SIZE_LIMIT ){ |
50206
|
0 |
0 |
if( iLimitsz ){ |
50207
|
0 |
0 |
if( iLimit<0 ){ |
50250
|
0 |
0 |
if( iOfst+iAmt>p->sz || (p->mFlags & SQLITE_DESERIALIZE_RESIZEABLE)!=0 ){ |
|
0 |
0 |
if( iOfst+iAmt>p->sz || (p->mFlags & SQLITE_DESERIALIZE_RESIZEABLE)!=0 ){ |
50288
|
0 |
0 |
if( szName>1 && zName[0]=='/' ){ |
|
0 |
0 |
if( szName>1 && zName[0]=='/' ){ |
50294
|
0 |
0 |
for(i=0; i
|
50295
|
0 |
0 |
if( strcmp(memdb_g.apMemStore[i]->zFName,zName)==0 ){ |
50300
|
0 |
0 |
if( p==0 ){ |
50303
|
0 |
0 |
if( p==0 ){ |
50309
|
0 |
0 |
if( apNew==0 ){ |
50322
|
0 |
0 |
if( p->pMutex==0 ){ |
50337
|
0 |
0 |
if( p==0 ){ |
50345
|
0 |
0 |
if( pOutFlags!=0 ){ |
50470
|
0 |
0 |
if( rc ) return 0; |
50471
|
0 |
0 |
if( p->base.pMethods!=&memdb_io_methods ) return 0; |
50474
|
0 |
0 |
if( pStore->zFName!=0 ) p = 0; |
50505
|
0 |
0 |
if( zSchema==0 ) zSchema = db->aDb[0].zDbSName; |
50508
|
0 |
0 |
if( piSize ) *piSize = -1; |
50509
|
0 |
0 |
if( iDb<0 ) return 0; |
50510
|
0 |
0 |
if( p ){ |
50513
|
0 |
0 |
if( piSize ) *piSize = pStore->sz; |
50514
|
0 |
0 |
if( mFlags & SQLITE_SERIALIZE_NOCOPY ){ |
50518
|
0 |
0 |
if( pOut ) memcpy(pOut, pStore->aData, pStore->sz); |
50523
|
0 |
0 |
if( pBt==0 ) return 0; |
50526
|
0 |
0 |
rc = zSql ? sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0) : SQLITE_NOMEM; |
50528
|
0 |
0 |
if( rc ) return 0; |
50530
|
0 |
0 |
if( rc!=SQLITE_ROW ){ |
50534
|
0 |
0 |
if( piSize ) *piSize = sz; |
50535
|
0 |
0 |
if( mFlags & SQLITE_SERIALIZE_NOCOPY ){ |
50539
|
0 |
0 |
if( pOut ){ |
50543
|
0 |
0 |
for(pgno=1; pgno<=nPage; pgno++){ |
50547
|
0 |
0 |
if( rc==SQLITE_OK ){ |
50586
|
0 |
0 |
if( zSchema==0 ) zSchema = db->aDb[0].zDbSName; |
50589
|
0 |
0 |
if( iDb<2 && iDb!=0 ){ |
|
0 |
0 |
if( iDb<2 && iDb!=0 ){ |
50594
|
0 |
0 |
if( zSql==0 ){ |
50600
|
0 |
0 |
if( rc ) goto end_deserialize; |
50605
|
0 |
0 |
if( rc!=SQLITE_DONE ){ |
50610
|
0 |
0 |
if( p==0 ){ |
50619
|
0 |
0 |
if( pStore->szMax
|
50628
|
0 |
0 |
if( pData && (mFlags & SQLITE_DESERIALIZE_FREEONCLOSE)!=0 ){ |
|
0 |
0 |
if( pData && (mFlags & SQLITE_DESERIALIZE_FREEONCLOSE)!=0 ){ |
50642
|
0 |
110 |
if( NEVER(pLower==0) ) return SQLITE_ERROR; |
50649
|
0 |
110 |
if( sz
|
50775
|
1144 |
0 |
if( p ){ |
50789
|
1181 |
1677 |
if( i>=p->iSize ) return 0; |
50790
|
0 |
1677 |
while( p->iDivisor ){ |
50794
|
0 |
0 |
if (!p) { |
50798
|
1677 |
0 |
if( p->iSize<=BITVEC_NBIT ){ |
50802
|
0 |
0 |
while( p->u.aHash[h] ){ |
50803
|
0 |
0 |
if( p->u.aHash[h]==i ) return 1; |
50810
|
1 |
28 |
return p!=0 && sqlite3BitvecTestNotNull(p,i); |
|
0 |
1 |
return p!=0 && sqlite3BitvecTestNotNull(p,i); |
50827
|
0 |
1374 |
if( p==0 ) return SQLITE_OK; |
50831
|
0 |
1374 |
while((p->iSize > BITVEC_NBIT) && p->iDivisor) { |
|
0 |
0 |
while((p->iSize > BITVEC_NBIT) && p->iDivisor) { |
50834
|
0 |
0 |
if( p->u.apSub[bin]==0 ){ |
50836
|
0 |
0 |
if( p->u.apSub[bin]==0 ) return SQLITE_NOMEM_BKPT; |
50840
|
1374 |
0 |
if( p->iSize<=BITVEC_NBIT ){ |
50848
|
0 |
0 |
if( !p->u.aHash[h] ){ |
50849
|
0 |
0 |
if (p->nSet<(BITVEC_NINT-1)) { |
50858
|
0 |
0 |
if( p->u.aHash[h]==i ) return SQLITE_OK; |
50860
|
0 |
0 |
if( h>=BITVEC_NINT ) h = 0; |
50861
|
0 |
0 |
} while( p->u.aHash[h] ); |
50866
|
0 |
0 |
if( p->nSet>=BITVEC_MXHASH ){ |
50870
|
0 |
0 |
if( aiValues==0 ){ |
50877
|
0 |
0 |
for(j=0; j
|
50878
|
0 |
0 |
if( aiValues[j] ) rc |= sqlite3BitvecSet(p, aiValues[j]); |
50897
|
0 |
0 |
if( p==0 ) return; |
50900
|
0 |
0 |
while( p->iDivisor ){ |
50904
|
0 |
0 |
if (!p) { |
50908
|
0 |
0 |
if( p->iSize<=BITVEC_NBIT ){ |
50916
|
0 |
0 |
for(j=0; j
|
50917
|
0 |
0 |
if( aiValues[j] && aiValues[j]!=(i+1) ){ |
|
0 |
0 |
if( aiValues[j] && aiValues[j]!=(i+1) ){ |
50920
|
0 |
0 |
while( p->u.aHash[h] ){ |
50922
|
0 |
0 |
if( h>=BITVEC_NINT ) h = 0; |
50934
|
3989 |
1144 |
if( p==0 ) return; |
50935
|
0 |
1144 |
if( p->iDivisor ){ |
50937
|
0 |
0 |
for(i=0; i
|
51005
|
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; |
51013
|
0 |
0 |
while( (op = aOp[pc])!=0 ){ |
51014
|
0 |
0 |
switch( op ){ |
51031
|
0 |
0 |
if( (--aOp[pc+1]) > 0 ) nx = 0; |
51034
|
0 |
0 |
if( (op & 1)!=0 ){ |
51036
|
0 |
0 |
if( op!=5 ){ |
51037
|
0 |
0 |
if( sqlite3BitvecSet(pBitvec, i+1) ) goto bitvec_end; |
51053
|
0 |
0 |
for(i=1; i<=sz; i++){ |
51054
|
0 |
0 |
if( (TESTBIT(pV,i))!=sqlite3BitvecTest(pBitvec,i) ){ |
51234
|
8982 |
2342 |
if( addRemove & PCACHE_DIRTYLIST_REMOVE ){ |
51239
|
1826 |
7156 |
if( p->pSynced==pPage ){ |
51243
|
6800 |
2182 |
if( pPage->pDirtyNext ){ |
51249
|
4352 |
4630 |
if( pPage->pDirtyPrev ){ |
51259
|
1649 |
2981 |
if( p->pDirty==0 ){ /*OPTIMIZATION-IF-TRUE*/ |
51265
|
8982 |
2342 |
if( addRemove & PCACHE_DIRTYLIST_ADD ){ |
51268
|
7333 |
1649 |
if( pPage->pDirtyNext ){ |
51273
|
231 |
1418 |
if( p->bPurgeable ){ |
51285
|
2206 |
6776 |
if( !p->pSynced |
51286
|
1270 |
936 |
&& 0==(pPage->flags&PGHDR_NEED_SYNC) /*OPTIMIZATION-IF-FALSE*/ |
51299
|
825 |
5051 |
if( p->pCache->bPurgeable ){ |
51311
|
366 |
584 |
if( p->szCache>=0 ){ |
51322
|
0 |
584 |
if( n>1000000000 ) n = 1000000000; |
51333
|
110 |
0 |
if( sqlite3GlobalConfig.pcache2.xInit==0 ){ |
51343
|
0 |
0 |
if( sqlite3GlobalConfig.pcache2.xShutdown ){ |
51394
|
366 |
366 |
if( pCache->szPage ){ |
51400
|
0 |
366 |
if( pNew==0 ) return SQLITE_NOMEM_BKPT; |
51402
|
0 |
366 |
if( pCache->pCache ){ |
51483
|
0 |
0 |
if( pCache->eCreate==2 ) return 0; |
51485
|
0 |
0 |
if( sqlite3PcachePagecount(pCache)>pCache->szSpill ){ |
51495
|
0 |
0 |
for(pPg=pCache->pSynced; |
51496
|
0 |
0 |
pPg && (pPg->nRef || (pPg->flags&PGHDR_NEED_SYNC)); |
|
0 |
0 |
pPg && (pPg->nRef || (pPg->flags&PGHDR_NEED_SYNC)); |
51500
|
0 |
0 |
if( !pPg ){ |
51501
|
0 |
0 |
for(pPg=pCache->pDirtyTail; pPg && pPg->nRef; pPg=pPg->pDirtyPrev); |
|
0 |
0 |
for(pPg=pCache->pDirtyTail; pPg && pPg->nRef; pPg=pPg->pDirtyPrev); |
51503
|
0 |
0 |
if( pPg ){ |
51515
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ |
51521
|
0 |
0 |
return *ppPage==0 ? SQLITE_NOMEM_BKPT : SQLITE_OK; |
51569
|
1336 |
11623 |
if( !pPgHdr->pPage ){ |
51585
|
10456 |
1172 |
if( (--p->nRef)==0 ){ |
51586
|
3816 |
6640 |
if( p->flags&PGHDR_CLEAN ){ |
51612
|
0 |
0 |
if( p->flags&PGHDR_DIRTY ){ |
51626
|
2342 |
175 |
if( p->flags & (PGHDR_CLEAN|PGHDR_DONT_WRITE) ){ /*OPTIMIZATION-IF-FALSE*/ |
51628
|
2342 |
0 |
if( p->flags & PGHDR_CLEAN ){ |
51651
|
2060 |
282 |
if( p->nRef==0 ){ |
51662
|
2253 |
1012 |
while( (p = pCache->pDirty)!=0 ){ |
51673
|
432 |
271 |
for(p=pCache->pDirty; p; p=p->pDirtyNext){ |
51684
|
219 |
90 |
for(p=pCache->pDirty; p; p=p->pDirtyNext){ |
51701
|
0 |
0 |
if( pOther ){ |
51710
|
0 |
0 |
if( (p->flags&PGHDR_DIRTY) && (p->flags&PGHDR_NEED_SYNC) ){ |
|
0 |
0 |
if( (p->flags&PGHDR_DIRTY) && (p->flags&PGHDR_NEED_SYNC) ){ |
51726
|
1568 |
366 |
if( pCache->pCache ){ |
51730
|
521 |
1568 |
for(p=pCache->pDirty; p; p=pNext){ |
51737
|
89 |
432 |
if( p->pgno>pgno ){ |
51742
|
388 |
1180 |
if( pgno==0 && pCache->nRefSum ){ |
|
5 |
383 |
if( pgno==0 && pCache->nRefSum ){ |
51745
|
5 |
0 |
if( ALWAYS(pPage1) ){ /* Page 1 is always available in cache, because |
51780
|
98 |
89 |
if( pA->pgnopgno ){ |
51784
|
72 |
26 |
if( pA==0 ){ |
51792
|
57 |
32 |
if( pB==0 ){ |
51816
|
219 |
90 |
while( pIn ){ |
51820
|
336 |
0 |
for(i=0; ALWAYS(i
|
51821
|
219 |
117 |
if( a[i]==0 ){ |
51829
|
0 |
219 |
if( NEVER(i==N_SORT_BUCKET-1) ){ |
51837
|
2790 |
90 |
for(i=1; i
|
51838
|
2701 |
89 |
if( a[i]==0 ) continue; |
51839
|
12 |
77 |
p = p ? pcacheMergeDirtyList(p, a[i]) : a[i]; |
51849
|
219 |
90 |
for(p=pCache->pDirty; p; p=p->pDirtyNext){ |
51907
|
0 |
0 |
if( mxPage ){ |
51908
|
0 |
0 |
if( mxPage<0 ){ |
51914
|
0 |
0 |
if( resszSpill ) res = p->szSpill; |
51940
|
0 |
0 |
for(pDirty=pCache->pDirty; pDirty; pDirty=pDirty->pDirtyNext) nDirty++; |
51941
|
0 |
0 |
return nCache ? (int)(((i64)nDirty * 100) / nCache) : 0; |
52233
|
110 |
0 |
if( pcache1.isInit ){ |
52235
|
110 |
0 |
if( pBuf==0 ) sz = n = 0; |
52236
|
110 |
0 |
if( n==0 ) sz = 0; |
52240
|
110 |
0 |
pcache1.nReserve = n>90 ? 10 : (n/10 + 1); |
52244
|
0 |
110 |
while( n-- ){ |
52261
|
0 |
274 |
if( pcache1.nInitPage==0 ) return 0; |
52263
|
171 |
103 |
if( pCache->nMax<3 ) return 0; |
52265
|
103 |
0 |
if( pcache1.nInitPage>0 ){ |
52270
|
0 |
103 |
if( szBulk > pCache->szAlloc*(i64)pCache->nMax ){ |
52275
|
103 |
0 |
if( zBulk ){ |
52287
|
1957 |
103 |
}while( --nBulk ); |
52304
|
0 |
1665 |
if( nByte<=pcache1.szSlot ){ |
52307
|
0 |
0 |
if( p ){ |
52317
|
1665 |
0 |
if( p==0 ){ |
52323
|
1665 |
0 |
if( p ){ |
52340
|
372 |
1661 |
if( p==0 ) return; |
52341
|
1661 |
0 |
if( SQLITE_WITHIN(p, pcache1.pStart, pcache1.pEnd) ){ |
|
0 |
1661 |
if( SQLITE_WITHIN(p, pcache1.pStart, pcache1.pEnd) ){ |
52394
|
1192 |
144 |
if( pCache->pFree || (pCache->nPage==0 && pcache1InitBulk(pCache)) ){ |
|
274 |
918 |
if( pCache->pFree || (pCache->nPage==0 && pcache1InitBulk(pCache)) ){ |
|
103 |
171 |
if( pCache->pFree || (pCache->nPage==0 && pcache1InitBulk(pCache)) ){ |
52408
|
10 |
1079 |
if( benignMalloc ){ sqlite3BeginBenignMalloc(); } |
52420
|
10 |
1079 |
if( benignMalloc ){ sqlite3EndBenignMalloc(); } |
52424
|
0 |
1089 |
if( pPg==0 ) return 0; |
52446
|
243 |
1089 |
if( p->isBulkLocal ){ |
52493
|
0 |
151 |
if( pcache1.nSlot && (pCache->szPage+pCache->szExtra)<=pcache1.szSlot ){ |
|
0 |
0 |
if( pcache1.nSlot && (pCache->szPage+pCache->szExtra)<=pcache1.szSlot ){ |
52517
|
366 |
2 |
if( nNew<256 ){ |
52522
|
2 |
366 |
if( p->nHash ){ sqlite3BeginBenignMalloc(); } |
52524
|
2 |
366 |
if( p->nHash ){ sqlite3EndBenignMalloc(); } |
52526
|
368 |
0 |
if( apNew ){ |
52527
|
512 |
368 |
for(i=0; inHash; i++){ |
52530
|
512 |
512 |
while( (pPage = pNext)!=0 ){ |
52582
|
0 |
0 |
for(pp=&pCache->apHash[h]; (*pp)!=pPage; pp=&(*pp)->pNext); |
52586
|
0 |
0 |
if( freeFlag ) pcache1FreePage(pPage); |
52597
|
0 |
729 |
while( pGroup->nPurgeable>pGroup->nMaxPage |
52598
|
0 |
0 |
&& (p=pGroup->lru.pLruPrev)->isAnchor==0 |
52605
|
682 |
47 |
if( pCache->nPage==0 && pCache->pBulk ){ |
|
101 |
581 |
if( pCache->nPage==0 && pCache->pBulk ){ |
52627
|
288 |
0 |
if( pCache->iMaxKey - iLimit < pCache->nHash ){ |
52646
|
1332 |
1353 |
while( (pPage = *pp)!=0 ){ |
52647
|
1332 |
0 |
if( pPage->iKey>=iLimit ){ |
52650
|
253 |
1079 |
if( PAGE_IS_UNPINNED(pPage) ) pcache1PinPage(pPage); |
52657
|
288 |
1065 |
if( h==iStop ) break; |
52693
|
0 |
110 |
|| sqlite3GlobalConfig.bCoreMutex>0; |
|
0 |
0 |
|| sqlite3GlobalConfig.bCoreMutex>0; |
52699
|
110 |
0 |
if( sqlite3GlobalConfig.bCoreMutex ){ |
52704
|
110 |
0 |
if( pcache1.separateCache |
52705
|
110 |
0 |
&& sqlite3GlobalConfig.nPage!=0 |
52706
|
110 |
0 |
&& sqlite3GlobalConfig.pPage==0 |
52746
|
366 |
0 |
if( pCache ){ |
52747
|
366 |
0 |
if( pcache1.separateCache ){ |
52754
|
366 |
0 |
if( pGroup->lru.isAnchor==0 ){ |
52764
|
159 |
207 |
if( bPurgeable ){ |
52773
|
0 |
366 |
if( pCache->nHash==0 ){ |
52790
|
365 |
585 |
if( pCache->bPurgeable ){ |
52794
|
0 |
365 |
if( n > 0x7fff0000 - pGroup->nMaxPage + pCache->nMax ){ |
52813
|
0 |
0 |
if( pCache->bPurgeable ){ |
52860
|
106 |
1230 |
if( createFlag==1 && ( |
|
106 |
0 |
if( createFlag==1 && ( |
52862
|
106 |
0 |
|| nPinned>=pCache->n90pct |
52863
|
0 |
106 |
|| (pcache1UnderMemoryPressure(pCache) && pCache->nRecyclable
|
|
0 |
0 |
|| (pcache1UnderMemoryPressure(pCache) && pCache->nRecyclable
|
52868
|
2 |
1334 |
if( pCache->nPage>=pCache->nHash ) pcache1ResizeHash(pCache); |
52872
|
257 |
1079 |
if( pCache->bPurgeable |
52873
|
45 |
212 |
&& !pGroup->lru.pLruPrev->isAnchor |
52874
|
45 |
0 |
&& ((pCache->nPage+1>=pCache->nMax) || pcache1UnderMemoryPressure(pCache)) |
|
0 |
45 |
&& ((pCache->nPage+1>=pCache->nMax) || pcache1UnderMemoryPressure(pCache)) |
52882
|
0 |
0 |
if( pOther->szAlloc != pCache->szAlloc ){ |
52893
|
1336 |
0 |
if( !pPage ){ |
52897
|
1336 |
0 |
if( pPage ){ |
52908
|
1328 |
8 |
if( iKey>pCache->iMaxKey ){ |
52984
|
10294 |
1336 |
while( pPage && pPage->iKey!=iKey ){ pPage = pPage->pNext; } |
|
2 |
10292 |
while( pPage && pPage->iKey!=iKey ){ pPage = pPage->pNext; } |
52990
|
10292 |
1336 |
if( pPage ){ |
52991
|
568 |
9724 |
if( PAGE_IS_UNPINNED(pPage) ){ |
52996
|
1336 |
0 |
}else if( createFlag ){ |
53068
|
825 |
0 |
if( reuseUnlikely || pGroup->nPurgeable>pGroup->nMaxPage ){ |
|
0 |
825 |
if( reuseUnlikely || pGroup->nPurgeable>pGroup->nMaxPage ){ |
53104
|
0 |
0 |
while( (*pp)!=pPage ){ |
53114
|
0 |
0 |
if( iNew>pCache->iMaxKey ){ |
53131
|
288 |
1280 |
if( iLimit<=pCache->iMaxKey ){ |
53148
|
0 |
364 |
if( pCache->nPage ) pcache1TruncateUnsafe(pCache, 0); |
53390
|
8 |
0 |
if( p ){ |
53413
|
1 |
9 |
for(pChunk=p->pChunk; pChunk; pChunk = pNextChunk){ |
53445
|
1 |
10 |
if( p->nFresh==0 ){ /*OPTIMIZATION-IF-FALSE*/ |
53450
|
0 |
1 |
if( pNew==0 ){ |
53476
|
0 |
11 |
if( pEntry==0 ) return; |
53480
|
6 |
5 |
if( pLast ){ |
53481
|
0 |
6 |
if( rowid<=pLast->v ){ /*OPTIMIZATION-IF-FALSE*/ |
53511
|
0 |
0 |
if( pA->v<=pB->v ){ |
53512
|
0 |
0 |
if( pA->vv ) pTail = pTail->pRight = pA; |
53514
|
0 |
0 |
if( pA==0 ){ |
53521
|
0 |
0 |
if( pB==0 ){ |
53539
|
0 |
0 |
while( pIn ){ |
53542
|
0 |
0 |
for(i=0; aBucket[i]; i++){ |
53550
|
0 |
0 |
for(i=1; i
|
53551
|
0 |
0 |
if( aBucket[i]==0 ) continue; |
53552
|
0 |
0 |
pIn = pIn ? rowSetEntryMerge(pIn, aBucket[i]) : aBucket[i]; |
53569
|
0 |
0 |
if( pIn->pLeft ){ |
53576
|
0 |
0 |
if( pIn->pRight ){ |
53604
|
0 |
0 |
if( *ppList==0 ){ /*OPTIMIZATION-IF-TRUE*/ |
53608
|
0 |
0 |
if( iDepth>1 ){ /*OPTIMIZATION-IF-TRUE*/ |
53614
|
0 |
0 |
if( p==0 ){ /*OPTIMIZATION-IF-FALSE*/ |
53643
|
0 |
0 |
for(iDepth=1; pList; iDepth++){ |
53671
|
2 |
0 |
if( (p->rsFlags & ROWSET_NEXT)==0 ){ /*OPTIMIZATION-IF-FALSE*/ |
53672
|
0 |
2 |
if( (p->rsFlags & ROWSET_SORTED)==0 ){ /*OPTIMIZATION-IF-FALSE*/ |
53679
|
1 |
1 |
if( p->pEntry ){ |
53682
|
1 |
0 |
if( p->pEntry==0 ){ /*OPTIMIZATION-IF-TRUE*/ |
53709
|
6 |
6 |
if( iBatch!=pRowSet->iBatch ){ /*OPTIMIZATION-IF-FALSE*/ |
53711
|
0 |
6 |
if( p ){ |
53713
|
0 |
0 |
if( (pRowSet->rsFlags & ROWSET_SORTED)==0 ){ /*OPTIMIZATION-IF-FALSE*/ |
53717
|
0 |
0 |
for(pTree = pRowSet->pForest; pTree; pTree=pTree->pRight){ |
53719
|
0 |
0 |
if( pTree->pLeft==0 ){ |
53729
|
0 |
0 |
if( pTree==0 ){ |
53731
|
0 |
0 |
if( pTree ){ |
53747
|
0 |
12 |
for(pTree = pRowSet->pForest; pTree; pTree=pTree->pRight){ |
53749
|
0 |
0 |
while( p ){ |
53750
|
0 |
0 |
if( p->v
|
53752
|
0 |
0 |
}else if( p->v>iRowid ){ |
54970
|
17 |
705 |
if( pPager->errCode ){ |
54973
|
0 |
705 |
}else if( USEFETCH(pPager) ){ |
54995
|
437 |
328 |
for(i=0; inSavepoint; i++){ |
54997
|
367 |
70 |
if( p->nOrig>=pgno && 0==sqlite3BitvecTestNotNull(p->pInSavepoint, pgno) ){ |
|
55 |
312 |
if( p->nOrig>=pgno && 0==sqlite3BitvecTestNotNull(p->pInSavepoint, pgno) ){ |
54998
|
0 |
55 |
for(i=i+1; inSavepoint; i++){ |
55026
|
274 |
0 |
if( rc==SQLITE_OK ){ |
55063
|
541 |
313 |
if( isOpen(pPager->fd) ){ |
55065
|
541 |
0 |
rc = pPager->noLock ? SQLITE_OK : sqlite3OsUnlock(pPager->fd, eLock); |
55066
|
541 |
0 |
if( pPager->eLock!=UNKNOWN_LOCK ){ |
55089
|
2127 |
710 |
if( pPager->eLockeLock==UNKNOWN_LOCK ){ |
|
0 |
2127 |
if( pPager->eLockeLock==UNKNOWN_LOCK ){ |
55090
|
710 |
0 |
rc = pPager->noLock ? SQLITE_OK : sqlite3OsLock(pPager->fd, eLock); |
55091
|
532 |
178 |
if( rc==SQLITE_OK && (pPager->eLock!=UNKNOWN_LOCK||eLock==EXCLUSIVE_LOCK) ){ |
|
0 |
532 |
if( rc==SQLITE_OK && (pPager->eLock!=UNKNOWN_LOCK||eLock==EXCLUSIVE_LOCK) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && (pPager->eLock!=UNKNOWN_LOCK||eLock==EXCLUSIVE_LOCK) ){ |
55232
|
62 |
0 |
if( SQLITE_OK!=(rc = sqlite3OsFileSize(pJrnl, &szJ)) |
55233
|
62 |
0 |
|| szJ<16 |
55234
|
62 |
0 |
|| SQLITE_OK!=(rc = read32bits(pJrnl, szJ-16, &len)) |
55235
|
36 |
26 |
|| len>=nSuper |
55236
|
36 |
0 |
|| len>szJ-16 |
55237
|
0 |
36 |
|| len==0 |
55238
|
0 |
0 |
|| SQLITE_OK!=(rc = read32bits(pJrnl, szJ-12, &cksum)) |
55239
|
0 |
0 |
|| SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, aMagic, 8, szJ-8)) |
55240
|
0 |
0 |
|| memcmp(aMagic, aJournalMagic, 8) |
55241
|
0 |
0 |
|| SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, zSuper, len, szJ-16-len)) |
55247
|
0 |
0 |
for(u=0; u
|
55250
|
0 |
0 |
if( cksum ){ |
55282
|
121 |
1118 |
if( c ){ |
55316
|
0 |
0 |
if( pPager->journalOff ){ |
55320
|
0 |
0 |
if( doTruncate || iLimit==0 ){ |
|
0 |
0 |
if( doTruncate || iLimit==0 ){ |
55326
|
0 |
0 |
if( rc==SQLITE_OK && !pPager->noSync ){ |
|
0 |
0 |
if( rc==SQLITE_OK && !pPager->noSync ){ |
55336
|
0 |
0 |
if( rc==SQLITE_OK && iLimit>0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && iLimit>0 ){ |
55339
|
0 |
0 |
if( rc==SQLITE_OK && sz>iLimit ){ |
|
0 |
0 |
if( rc==SQLITE_OK && sz>iLimit ){ |
55371
|
1087 |
0 |
if( nHeader>JOURNAL_HDR_SZ(pPager) ){ |
55379
|
0 |
1087 |
for(ii=0; iinSavepoint; ii++){ |
55380
|
0 |
0 |
if( pPager->aSavepoint[ii].iHdrOffset==0 ){ |
55408
|
92 |
995 |
if( pPager->noSync || (pPager->journalMode==PAGER_JOURNALMODE_MEMORY) |
|
92 |
0 |
if( pPager->noSync || (pPager->journalMode==PAGER_JOURNALMODE_MEMORY) |
55409
|
0 |
92 |
|| (sqlite3OsDeviceCharacteristics(pPager->fd)&SQLITE_IOCAP_SAFE_APPEND) |
55453
|
2174 |
0 |
for(nWrite=0; rc==SQLITE_OK&&nWrite
|
|
1087 |
1087 |
for(nWrite=0; rc==SQLITE_OK&&nWrite
|
55498
|
31 |
31 |
if( pPager->journalOff+JOURNAL_HDR_SZ(pPager) > journalSize ){ |
55508
|
31 |
0 |
if( isHot || iHdrOff!=pPager->journalHdr ){ |
|
0 |
31 |
if( isHot || iHdrOff!=pPager->journalHdr ){ |
55510
|
0 |
0 |
if( rc ){ |
55513
|
0 |
0 |
if( memcmp(aMagic, aJournalMagic, sizeof(aMagic))!=0 ){ |
55522
|
31 |
0 |
if( SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+8, pNRec)) |
55523
|
31 |
0 |
|| SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+12, &pPager->cksumInit)) |
55524
|
0 |
31 |
|| SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+16, pDbSize)) |
55529
|
31 |
0 |
if( pPager->journalOff==0 ){ |
55534
|
31 |
0 |
if( SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+20, &iSectorSize)) |
55535
|
0 |
31 |
|| SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+24, &iPageSize)) |
55544
|
0 |
31 |
if( iPageSize==0 ){ |
55553
|
31 |
0 |
if( iPageSize<512 || iSectorSize<32 |
|
31 |
0 |
if( iPageSize<512 || iSectorSize<32 |
55554
|
31 |
0 |
|| iPageSize>SQLITE_MAX_PAGE_SIZE || iSectorSize>MAX_SECTOR_SIZE |
|
31 |
0 |
|| iPageSize>SQLITE_MAX_PAGE_SIZE || iSectorSize>MAX_SECTOR_SIZE |
55555
|
31 |
0 |
|| ((iPageSize-1)&iPageSize)!=0 || ((iSectorSize-1)&iSectorSize)!=0 |
|
0 |
31 |
|| ((iPageSize-1)&iPageSize)!=0 || ((iSectorSize-1)&iSectorSize)!=0 |
55615
|
0 |
90 |
if( !zSuper |
55616
|
0 |
0 |
|| pPager->journalMode==PAGER_JOURNALMODE_MEMORY |
55617
|
0 |
0 |
|| !isOpen(pPager->jfd) |
55625
|
0 |
0 |
for(nSuper=0; zSuper[nSuper]; nSuper++){ |
55633
|
0 |
0 |
if( pPager->fullSync ){ |
55641
|
0 |
0 |
if( (0 != (rc = write32bits(pPager->jfd, iHdrOff, PAGER_SJ_PGNO(pPager)))) |
55642
|
0 |
0 |
|| (0 != (rc = sqlite3OsWrite(pPager->jfd, zSuper, nSuper, iHdrOff+4))) |
55643
|
0 |
0 |
|| (0 != (rc = write32bits(pPager->jfd, iHdrOff+4+nSuper, nSuper))) |
55644
|
0 |
0 |
|| (0 != (rc = write32bits(pPager->jfd, iHdrOff+4+nSuper+4, cksum))) |
55645
|
0 |
0 |
|| (0 != (rc = sqlite3OsWrite(pPager->jfd, aJournalMagic, 8, |
55662
|
0 |
0 |
if( SQLITE_OK==(rc = sqlite3OsFileSize(pPager->jfd, &jrnlSize)) |
55663
|
0 |
0 |
&& jrnlSize>pPager->journalOff |
55693
|
1 |
3937 |
for(ii=0; iinSavepoint; ii++){ |
55696
|
3083 |
854 |
if( !pPager->exclusiveMode || sqlite3JournalIsInMemory(pPager->sjfd) ){ |
|
17 |
3066 |
if( !pPager->exclusiveMode || sqlite3JournalIsInMemory(pPager->sjfd) ){ |
55714
|
133 |
2364 |
for(ii=0; iinSavepoint; ii++){ |
55716
|
63 |
70 |
if( pgno<=p->nOrig ){ |
55753
|
0 |
2744 |
if( pagerUseWal(pPager) ){ |
55757
|
702 |
2042 |
}else if( !pPager->exclusiveMode ){ |
55759
|
442 |
260 |
int iDc = isOpen(pPager->fd)?sqlite3OsDeviceCharacteristics(pPager->fd):0; |
55772
|
0 |
702 |
if( 0==(iDc & SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN) |
55773
|
0 |
0 |
|| 1!=(pPager->journalMode & 5) |
55784
|
0 |
702 |
if( rc!=SQLITE_OK && pPager->eState==PAGER_ERROR ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && pPager->eState==PAGER_ERROR ){ |
55802
|
17 |
2727 |
if( pPager->errCode ){ |
55803
|
0 |
17 |
if( pPager->tempFile==0 ){ |
55810
|
0 |
17 |
if( USEFETCH(pPager) ) sqlite3OsUnfetch(pPager->fd, 0, 0); |
55847
|
1123 |
0 |
if( rc2==SQLITE_FULL || rc2==SQLITE_IOERR ){ |
|
0 |
1123 |
if( rc2==SQLITE_FULL || rc2==SQLITE_IOERR ){ |
55874
|
189 |
1237 |
if( pPager->tempFile==0 ) return 1; |
55875
|
74 |
1163 |
if( !bCommit ) return 0; |
55876
|
1163 |
0 |
if( !isOpen(pPager->fd) ) return 0; |
55952
|
389 |
1140 |
if( pPager->eStateeLock
|
|
336 |
53 |
if( pPager->eStateeLock
|
55960
|
1087 |
106 |
if( isOpen(pPager->jfd) ){ |
55964
|
995 |
92 |
if( sqlite3JournalIsInMemory(pPager->jfd) ){ |
55967
|
0 |
92 |
}else if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE ){ |
55968
|
0 |
0 |
if( pPager->journalOff==0 ){ |
55972
|
0 |
0 |
if( rc==SQLITE_OK && pPager->fullSync ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pPager->fullSync ){ |
55982
|
92 |
0 |
}else if( pPager->journalMode==PAGER_JOURNALMODE_PERSIST |
55983
|
0 |
92 |
|| (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL) |
|
0 |
0 |
|| (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL) |
55985
|
0 |
0 |
rc = zeroJournalHdr(pPager, hasSuper||pPager->tempFile); |
|
0 |
0 |
rc = zeroJournalHdr(pPager, hasSuper||pPager->tempFile); |
56000
|
92 |
0 |
if( bDelete ){ |
56020
|
1193 |
0 |
if( rc==SQLITE_OK ){ |
56021
|
370 |
823 |
if( MEMDB || pagerFlushOnCommit(pPager, bCommit) ){ |
|
99 |
271 |
if( MEMDB || pagerFlushOnCommit(pPager, bCommit) ){ |
56029
|
0 |
1193 |
if( pagerUseWal(pPager) ){ |
56036
|
1193 |
0 |
}else if( rc==SQLITE_OK && bCommit && pPager->dbFileSize>pPager->dbSize ){ |
|
1079 |
114 |
}else if( rc==SQLITE_OK && bCommit && pPager->dbFileSize>pPager->dbSize ){ |
|
0 |
1079 |
}else if( rc==SQLITE_OK && bCommit && pPager->dbFileSize>pPager->dbSize ){ |
56047
|
1193 |
0 |
if( rc==SQLITE_OK && bCommit ){ |
|
1079 |
114 |
if( rc==SQLITE_OK && bCommit ){ |
56049
|
1079 |
0 |
if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK; |
56052
|
152 |
1041 |
if( !pPager->exclusiveMode |
56053
|
0 |
152 |
&& (!pagerUseWal(pPager) || sqlite3WalExclusiveMode(pPager->pWal, 0)) |
|
0 |
0 |
&& (!pagerUseWal(pPager) || sqlite3WalExclusiveMode(pPager->pWal, 0)) |
56060
|
1193 |
0 |
return (rc==SQLITE_OK?rc2:rc); |
56081
|
2518 |
17 |
if( pPager->eState!=PAGER_ERROR && pPager->eState!=PAGER_OPEN ){ |
|
2414 |
104 |
if( pPager->eState!=PAGER_ERROR && pPager->eState!=PAGER_OPEN ){ |
56083
|
0 |
2414 |
if( pPager->eState>=PAGER_WRITER_LOCKED ){ |
56087
|
389 |
2025 |
}else if( !pPager->exclusiveMode ){ |
56117
|
26720 |
1336 |
while( i>0 ){ |
56199
|
28 |
1 |
jfd = isMainJrnl ? pPager->jfd : pPager->sjfd; |
56201
|
0 |
29 |
if( rc!=SQLITE_OK ) return rc; |
56203
|
0 |
29 |
if( rc!=SQLITE_OK ) return rc; |
56211
|
29 |
0 |
if( pgno==0 || pgno==PAGER_SJ_PGNO(pPager) ){ |
|
0 |
29 |
if( pgno==0 || pgno==PAGER_SJ_PGNO(pPager) ){ |
56215
|
29 |
0 |
if( pgno>(Pgno)pPager->dbSize || sqlite3BitvecTest(pDone, pgno) ){ |
|
0 |
29 |
if( pgno>(Pgno)pPager->dbSize || sqlite3BitvecTest(pDone, pgno) ){ |
56218
|
28 |
1 |
if( isMainJrnl ){ |
56220
|
0 |
28 |
if( rc ) return rc; |
56221
|
28 |
0 |
if( !isSavepnt && pager_cksum(pPager, (u8*)aData)!=cksum ){ |
|
0 |
28 |
if( !isSavepnt && pager_cksum(pPager, (u8*)aData)!=cksum ){ |
56229
|
1 |
28 |
if( pDone && (rc = sqlite3BitvecSet(pDone, pgno))!=SQLITE_OK ){ |
|
0 |
1 |
if( pDone && (rc = sqlite3BitvecSet(pDone, pgno))!=SQLITE_OK ){ |
56235
|
1 |
28 |
if( pgno==1 && pPager->nReserve!=((u8*)aData)[20] ){ |
|
0 |
1 |
if( pgno==1 && pPager->nReserve!=((u8*)aData)[20] ){ |
56274
|
0 |
29 |
if( pagerUseWal(pPager) ){ |
56285
|
28 |
1 |
if( isMainJrnl ){ |
56286
|
2 |
26 |
isSynced = pPager->noSync || (*pOffset <= pPager->journalHdr); |
|
0 |
2 |
isSynced = pPager->noSync || (*pOffset <= pPager->journalHdr); |
56288
|
1 |
0 |
isSynced = (pPg==0 || 0==(pPg->flags & PGHDR_NEED_SYNC)); |
|
0 |
1 |
isSynced = (pPg==0 || 0==(pPg->flags & PGHDR_NEED_SYNC)); |
56290
|
2 |
27 |
if( isOpen(pPager->fd) |
56291
|
2 |
0 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) |
|
0 |
2 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) |
56292
|
0 |
0 |
&& isSynced |
56306
|
0 |
0 |
if( pgno>pPager->dbFileSize ){ |
56309
|
0 |
0 |
if( pPager->pBackup ){ |
56312
|
1 |
28 |
}else if( !isMainJrnl && pPg==0 ){ |
|
0 |
1 |
}else if( !isMainJrnl && pPg==0 ){ |
56335
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
56338
|
29 |
0 |
if( pPg ){ |
56357
|
1 |
28 |
if( pgno==1 ){ |
56424
|
0 |
0 |
if( !pSuper ){ |
56432
|
0 |
0 |
if( rc!=SQLITE_OK ) goto delsuper_out; |
56440
|
0 |
0 |
if( rc!=SQLITE_OK ) goto delsuper_out; |
56443
|
0 |
0 |
if( !zFree ){ |
56451
|
0 |
0 |
if( rc!=SQLITE_OK ) goto delsuper_out; |
56456
|
0 |
0 |
while( (zJournal-zSuperJournal)
|
56459
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
56462
|
0 |
0 |
if( exists ){ |
56473
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
56479
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
56483
|
0 |
0 |
c = zSuperPtr[0]!=0 && strcmp(zSuperPtr, zSuper)==0; |
|
0 |
0 |
c = zSuperPtr[0]!=0 && strcmp(zSuperPtr, zSuper)==0; |
56484
|
0 |
0 |
if( c ){ |
56497
|
0 |
0 |
if( pSuper ){ |
56531
|
2 |
29 |
if( isOpen(pPager->fd) |
56532
|
2 |
0 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) |
|
0 |
2 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) |
56540
|
0 |
0 |
if( rc==SQLITE_OK && currentSize!=newSize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && currentSize!=newSize ){ |
56541
|
0 |
0 |
if( currentSize>newSize ){ |
56543
|
0 |
0 |
}else if( (currentSize+szPage)<=newSize ){ |
56551
|
0 |
0 |
if( rc==SQLITE_OK ){ |
56565
|
0 |
0 |
if( iRet<32 ){ |
56567
|
0 |
0 |
}else if( iRet>MAX_SECTOR_SIZE ){ |
56600
|
211 |
289 |
if( pPager->tempFile |
56601
|
211 |
0 |
|| (sqlite3OsDeviceCharacteristics(pPager->fd) & |
56688
|
0 |
31 |
if( rc!=SQLITE_OK ){ |
56705
|
31 |
0 |
if( rc==SQLITE_OK && zSuper[0] ){ |
|
0 |
31 |
if( rc==SQLITE_OK && zSuper[0] ){ |
56709
|
31 |
0 |
if( rc!=SQLITE_OK || !res ){ |
|
31 |
0 |
if( rc!=SQLITE_OK || !res ){ |
56726
|
31 |
31 |
if( rc!=SQLITE_OK ){ |
56727
|
31 |
0 |
if( rc==SQLITE_DONE ){ |
56738
|
29 |
2 |
if( nRec==0xffffffff ){ |
56757
|
7 |
24 |
if( nRec==0 && !isHot && |
|
7 |
0 |
if( nRec==0 && !isHot && |
|
7 |
0 |
if( nRec==0 && !isHot && |
56765
|
31 |
0 |
if( pPager->journalOff==JOURNAL_HDR_SZ(pPager) ){ |
56767
|
0 |
31 |
if( rc!=SQLITE_OK ){ |
56771
|
0 |
31 |
if( pPager->mxPgno
|
56779
|
28 |
31 |
for(u=0; u
|
56780
|
0 |
28 |
if( needPagerReset ){ |
56785
|
28 |
0 |
if( rc==SQLITE_OK ){ |
56788
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
56791
|
0 |
0 |
}else if( rc==SQLITE_IOERR_SHORT_READ ){ |
56814
|
31 |
0 |
if( rc==SQLITE_OK ){ |
56837
|
31 |
0 |
if( rc==SQLITE_OK ){ |
56846
|
31 |
0 |
if( rc==SQLITE_OK |
56847
|
31 |
0 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) |
|
0 |
31 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN) |
56851
|
31 |
0 |
if( rc==SQLITE_OK ){ |
56855
|
31 |
0 |
if( rc==SQLITE_OK && zSuper[0] && res ){ |
|
0 |
31 |
if( rc==SQLITE_OK && zSuper[0] && res ){ |
|
0 |
0 |
if( rc==SQLITE_OK && zSuper[0] && res ){ |
56864
|
0 |
31 |
if( isHot && nPlayback ){ |
|
0 |
0 |
if( isHot && nPlayback ){ |
56900
|
0 |
88 |
if( pagerUseWal(pPager) ){ |
56902
|
0 |
0 |
if( rc ) return rc; |
56904
|
0 |
88 |
if( iFrame ){ |
56911
|
0 |
88 |
if( rc==SQLITE_IOERR_SHORT_READ ){ |
56916
|
45 |
43 |
if( pPg->pgno==1 ){ |
56917
|
0 |
45 |
if( rc ){ |
56955
|
0 |
180 |
if( NEVER(pPg==0) ) return; |
56988
|
0 |
0 |
if( pPg ){ |
56989
|
0 |
0 |
if( sqlite3PcachePageRefcount(pPg)==1 ){ |
56993
|
0 |
0 |
if( rc==SQLITE_OK ){ |
57030
|
0 |
0 |
while( pList && rc==SQLITE_OK ){ |
|
0 |
0 |
while( pList && rc==SQLITE_OK ){ |
57068
|
0 |
0 |
if( isCommit ){ |
57075
|
0 |
0 |
for(p=pList; (*ppNext = p)!=0; p=p->pDirty){ |
57076
|
0 |
0 |
if( p->pgno<=nTruncate ){ |
57087
|
0 |
0 |
if( pList->pgno==1 ) pager_write_changecounter(pList); |
57091
|
0 |
0 |
if( rc==SQLITE_OK && pPager->pBackup ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pPager->pBackup ){ |
57092
|
0 |
0 |
for(p=pList; p; p=p->pDirty){ |
57130
|
0 |
0 |
if( rc!=SQLITE_OK || changed ){ |
|
0 |
0 |
if( rc!=SQLITE_OK || changed ){ |
57132
|
0 |
0 |
if( USEFETCH(pPager) ) sqlite3OsUnfetch(pPager->fd, 0, 0); |
57168
|
336 |
0 |
if( nPage==0 && ALWAYS(isOpen(pPager->fd)) ){ |
|
336 |
0 |
if( nPage==0 && ALWAYS(isOpen(pPager->fd)) ){ |
57171
|
0 |
336 |
if( rc!=SQLITE_OK ){ |
57181
|
0 |
336 |
if( nPage>pPager->mxPgno ){ |
57213
|
336 |
0 |
if( !pPager->tempFile ){ |
57218
|
336 |
0 |
if( rc==SQLITE_OK ){ |
57219
|
0 |
336 |
if( isWal ){ |
57223
|
0 |
0 |
if( rc ) return rc; |
57224
|
0 |
0 |
if( nPage==0 ){ |
57230
|
0 |
336 |
}else if( pPager->journalMode==PAGER_JOURNALMODE_WAL ){ |
57285
|
1 |
0 |
if( pSavepoint ){ |
57287
|
0 |
1 |
if( !pDone ){ |
57295
|
1 |
0 |
pPager->dbSize = pSavepoint ? pSavepoint->nOrig : pPager->dbOrigSize; |
57298
|
0 |
1 |
if( !pSavepoint && pagerUseWal(pPager) ){ |
|
0 |
0 |
if( !pSavepoint && pagerUseWal(pPager) ){ |
57317
|
1 |
0 |
if( pSavepoint && !pagerUseWal(pPager) ){ |
|
1 |
0 |
if( pSavepoint && !pagerUseWal(pPager) ){ |
57318
|
0 |
1 |
iHdrOff = pSavepoint->iHdrOffset ? pSavepoint->iHdrOffset : szJ; |
57320
|
1 |
0 |
while( rc==SQLITE_OK && pPager->journalOff
|
|
0 |
1 |
while( rc==SQLITE_OK && pPager->journalOff
|
57333
|
1 |
0 |
while( rc==SQLITE_OK && pPager->journalOff
|
|
0 |
1 |
while( rc==SQLITE_OK && pPager->journalOff
|
57345
|
0 |
0 |
if( nJRec==0 |
57346
|
0 |
0 |
&& pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff |
57350
|
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
|
57361
|
1 |
0 |
if( pSavepoint ){ |
57365
|
0 |
1 |
if( pagerUseWal(pPager) ){ |
57368
|
2 |
0 |
for(ii=pSavepoint->iSubRec; rc==SQLITE_OK && iinSubRec; ii++){ |
|
1 |
1 |
for(ii=pSavepoint->iSubRec; rc==SQLITE_OK && iinSubRec; ii++){ |
57376
|
1 |
0 |
if( rc==SQLITE_OK ){ |
57405
|
322 |
875 |
if( isOpen(fd) && fd->pMethods->iVersion>=3 ){ |
|
322 |
0 |
if( isOpen(fd) && fd->pMethods->iVersion>=3 ){ |
57487
|
24 |
0 |
if( pPager->tempFile ){ |
57496
|
24 |
0 |
if( pPager->noSync ){ |
57498
|
0 |
0 |
}else if( pgFlags & PAGER_FULLFSYNC ){ |
57504
|
0 |
24 |
if( pPager->fullSync ){ |
57507
|
0 |
24 |
if( (pgFlags & PAGER_CKPT_FULLFSYNC) && !pPager->noSync ){ |
|
0 |
0 |
if( (pgFlags & PAGER_CKPT_FULLFSYNC) && !pPager->noSync ){ |
57510
|
24 |
0 |
if( pgFlags & PAGER_CACHESPILL ){ |
57640
|
261 |
570 |
if( (pPager->memDb==0 || pPager->dbSize==0) |
|
216 |
45 |
if( (pPager->memDb==0 || pPager->dbSize==0) |
57641
|
769 |
17 |
&& sqlite3PcacheRefCount(pPager->pPCache)==0 |
57642
|
430 |
339 |
&& pageSize && pageSize!=(u32)pPager->pageSize |
|
366 |
64 |
&& pageSize && pageSize!=(u32)pPager->pageSize |
57647
|
260 |
106 |
if( pPager->eState>PAGER_OPEN && isOpen(pPager->fd) ){ |
|
0 |
260 |
if( pPager->eState>PAGER_OPEN && isOpen(pPager->fd) ){ |
57650
|
366 |
0 |
if( rc==SQLITE_OK ){ |
57654
|
0 |
366 |
if( !pNew ){ |
57661
|
366 |
0 |
if( rc==SQLITE_OK ){ |
57665
|
366 |
0 |
if( rc==SQLITE_OK ){ |
57677
|
831 |
0 |
if( rc==SQLITE_OK ){ |
57678
|
428 |
403 |
if( nReserve<0 ) nReserve = pPager->nReserve; |
57706
|
0 |
0 |
if( mxPage>0 ){ |
57766
|
106 |
260 |
if( isOpen(pPager->fd) ){ |
57769
|
79 |
27 |
if( rc==SQLITE_IOERR_SHORT_READ ){ |
57819
|
26 |
1519 |
}while( rc==SQLITE_BUSY && pPager->xBusyHandler(pPager->pBusyHandlerArg) ); |
|
24 |
2 |
}while( rc==SQLITE_BUSY && pPager->xBusyHandler(pPager->pBusyHandlerArg) ); |
57908
|
0 |
0 |
if( !pPager->noSync ){ |
57911
|
0 |
0 |
if( rc==SQLITE_OK ){ |
57936
|
0 |
0 |
if( pPager->pMmapFreelist ){ |
57944
|
0 |
0 |
if( p==0 ){ |
57988
|
0 |
364 |
for(p=pPager->pMmapFreelist; p; p=pNext){ |
58003
|
461 |
196 |
if( pPager->tempFile ) return SQLITE_OK; |
58004
|
72 |
124 |
if( pPager->dbSize==0 ) return SQLITE_OK; |
58007
|
0 |
124 |
if( rc==SQLITE_NOTFOUND ){ |
58012
|
124 |
0 |
}else if( rc==SQLITE_OK && bHasMoved ){ |
|
0 |
124 |
}else if( rc==SQLITE_OK && bHasMoved ){ |
58046
|
364 |
0 |
if( db && 0==(db->flags & SQLITE_NoCkptOnClose) |
|
364 |
0 |
if( db && 0==(db->flags & SQLITE_NoCkptOnClose) |
58047
|
364 |
0 |
&& SQLITE_OK==databaseIsUnmoved(pPager) |
58056
|
207 |
157 |
if( MEMDB ){ |
58070
|
0 |
157 |
if( isOpen(pPager->jfd) ){ |
58151
|
0 |
90 |
if( rc!=SQLITE_OK ) return rc; |
58153
|
90 |
0 |
if( !pPager->noSync ){ |
58155
|
90 |
0 |
if( isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_MEMORY ){ |
|
90 |
0 |
if( isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_MEMORY ){ |
58159
|
90 |
0 |
if( 0==(iDc&SQLITE_IOCAP_SAFE_APPEND) ){ |
58191
|
0 |
90 |
if( rc==SQLITE_OK && 0==memcmp(aMagic, aJournalMagic, 8) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && 0==memcmp(aMagic, aJournalMagic, 8) ){ |
58195
|
90 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_IOERR_SHORT_READ ){ |
|
0 |
90 |
if( rc!=SQLITE_OK && rc!=SQLITE_IOERR_SHORT_READ ){ |
58210
|
90 |
0 |
if( pPager->fullSync && 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){ |
|
90 |
0 |
if( pPager->fullSync && 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){ |
58214
|
0 |
90 |
if( rc!=SQLITE_OK ) return rc; |
58220
|
0 |
90 |
if( rc!=SQLITE_OK ) return rc; |
58222
|
90 |
0 |
if( 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){ |
58226
|
0 |
90 |
(pPager->syncFlags==SQLITE_SYNC_FULL?SQLITE_SYNC_DATAONLY:0) |
58228
|
0 |
90 |
if( rc!=SQLITE_OK ) return rc; |
58232
|
0 |
90 |
if( newHdr && 0==(iDc&SQLITE_IOCAP_SAFE_APPEND) ){ |
|
0 |
0 |
if( newHdr && 0==(iDc&SQLITE_IOCAP_SAFE_APPEND) ){ |
58235
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
58297
|
0 |
90 |
if( !isOpen(pPager->fd) ){ |
58306
|
90 |
0 |
if( rc==SQLITE_OK |
58307
|
29 |
61 |
&& pPager->dbHintSizedbSize |
58308
|
1 |
28 |
&& (pList->pDirty || pList->pgno>pPager->dbHintSize) |
|
1 |
0 |
&& (pList->pDirty || pList->pgno>pPager->dbHintSize) |
58315
|
309 |
0 |
while( rc==SQLITE_OK && pList ){ |
|
219 |
90 |
while( rc==SQLITE_OK && pList ){ |
58326
|
219 |
0 |
if( pgno<=pPager->dbSize && 0==(pList->flags&PGHDR_DONT_WRITE) ){ |
|
218 |
1 |
if( pgno<=pPager->dbSize && 0==(pList->flags&PGHDR_DONT_WRITE) ){ |
58331
|
90 |
128 |
if( pList->pgno==1 ) pager_write_changecounter(pList); |
58342
|
90 |
128 |
if( pgno==1 ){ |
58345
|
75 |
143 |
if( pgno>pPager->dbFileSize ){ |
58377
|
25 |
30 |
if( !isOpen(pPager->sjfd) ){ |
58382
|
8 |
17 |
if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){ |
|
0 |
8 |
if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){ |
58404
|
55 |
0 |
if( pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ |
58418
|
55 |
0 |
if( rc==SQLITE_OK ){ |
58425
|
55 |
0 |
if( rc==SQLITE_OK ){ |
58430
|
55 |
0 |
if( rc==SQLITE_OK ){ |
58438
|
55 |
328 |
if( subjRequiresPage(pPg) ){ |
58487
|
0 |
0 |
if( NEVER(pPager->errCode) ) return SQLITE_OK; |
58491
|
0 |
0 |
if( pPager->doNotSpill |
58492
|
0 |
0 |
&& ((pPager->doNotSpill & (SPILLFLAG_ROLLBACK|SPILLFLAG_OFF))!=0 |
58493
|
0 |
0 |
|| (pPg->flags & PGHDR_NEED_SYNC)!=0) |
58500
|
0 |
0 |
if( pagerUseWal(pPager) ){ |
58503
|
0 |
0 |
if( rc==SQLITE_OK ){ |
58516
|
0 |
0 |
if( pPg->flags&PGHDR_NEED_SYNC |
58517
|
0 |
0 |
|| pPager->eState==PAGER_WRITER_CACHEMOD |
58523
|
0 |
0 |
if( rc==SQLITE_OK ){ |
58530
|
0 |
0 |
if( rc==SQLITE_OK ){ |
58543
|
0 |
0 |
if( !MEMDB ){ |
58546
|
0 |
0 |
while( rc==SQLITE_OK && pList ){ |
|
0 |
0 |
while( rc==SQLITE_OK && pList ){ |
58548
|
0 |
0 |
if( pList->nRef==0 ){ |
58628
|
207 |
165 |
if( flags & PAGER_MEMORY ){ |
58630
|
207 |
0 |
if( zFilename && zFilename[0] ){ |
|
207 |
0 |
if( zFilename && zFilename[0] ){ |
58632
|
0 |
207 |
if( zPathname==0 ) return SQLITE_NOMEM_BKPT; |
58643
|
115 |
257 |
if( zFilename && zFilename[0] ){ |
|
112 |
3 |
if( zFilename && zFilename[0] ){ |
58647
|
0 |
112 |
if( zPathname==0 ){ |
58652
|
0 |
112 |
if( rc!=SQLITE_OK ){ |
58653
|
0 |
0 |
if( rc==SQLITE_OK_SYMLINK ){ |
58654
|
0 |
0 |
if( vfsFlags & SQLITE_OPEN_NOFOLLOW ){ |
58663
|
10 |
112 |
while( *z ){ |
58670
|
112 |
0 |
if( rc==SQLITE_OK && nPathname+8>pVfs->mxPathname ){ |
|
0 |
112 |
if( rc==SQLITE_OK && nPathname+8>pVfs->mxPathname ){ |
58679
|
0 |
112 |
if( rc!=SQLITE_OK ){ |
58745
|
0 |
372 |
if( !pPtr ){ |
58760
|
319 |
53 |
if( nPathname>0 ){ |
58762
|
112 |
207 |
if( zUri ){ |
58771
|
319 |
53 |
if( nPathname>0 ){ |
58785
|
319 |
53 |
if( nPathname>0 ){ |
58799
|
319 |
53 |
if( nPathname ) sqlite3DbFree(0, zPathname); |
58805
|
115 |
257 |
if( zFilename && zFilename[0] ){ |
|
112 |
3 |
if( zFilename && zFilename[0] ){ |
58822
|
106 |
6 |
if( rc==SQLITE_OK ){ |
58824
|
103 |
3 |
if( !readOnly ){ |
58827
|
0 |
103 |
if( szPageDfltsectorSize ){ |
58828
|
0 |
0 |
if( pPager->sectorSize>SQLITE_MAX_DEFAULT_PAGE_SIZE ){ |
58849
|
106 |
0 |
if( (iDc & SQLITE_IOCAP_IMMUTABLE)!=0 |
58850
|
0 |
106 |
|| sqlite3_uri_boolean(pPager->zFilename, "immutable", 0) ){ |
58877
|
366 |
6 |
if( rc==SQLITE_OK ){ |
58884
|
366 |
6 |
if( rc==SQLITE_OK ){ |
58887
|
159 |
207 |
rc = sqlite3PcacheOpen(szPageDflt, nExtra, !memDb, |
58893
|
6 |
366 |
if( rc!=SQLITE_OK ){ |
58923
|
106 |
260 |
if( pPager->noSync ){ |
58941
|
17 |
349 |
if( !useJournal ){ |
58943
|
142 |
207 |
}else if( memDb || memJM ){ |
|
0 |
142 |
}else if( memDb || memJM ){ |
58964
|
0 |
0 |
while( zName[-1]!=0 || zName[-2]!=0 || zName[-3]!=0 || zName[-4]!=0 ){ |
|
0 |
0 |
while( zName[-1]!=0 || zName[-2]!=0 || zName[-3]!=0 || zName[-4]!=0 ){ |
|
0 |
0 |
while( zName[-1]!=0 || zName[-2]!=0 || zName[-3]!=0 || zName[-4]!=0 ){ |
|
0 |
0 |
while( zName[-1]!=0 || zName[-2]!=0 || zName[-3]!=0 || zName[-4]!=0 ){ |
59018
|
336 |
0 |
if( !jrnlOpen ){ |
59021
|
336 |
0 |
if( rc==SQLITE_OK && exists ){ |
|
152 |
184 |
if( rc==SQLITE_OK && exists ){ |
59033
|
152 |
0 |
if( rc==SQLITE_OK && !locked ){ |
|
0 |
152 |
if( rc==SQLITE_OK && !locked ){ |
59038
|
0 |
0 |
if( rc==SQLITE_OK ){ |
59047
|
0 |
0 |
if( nPage==0 && !jrnlOpen ){ |
|
0 |
0 |
if( nPage==0 && !jrnlOpen ){ |
59049
|
0 |
0 |
if( pagerLockDb(pPager, RESERVED_LOCK)==SQLITE_OK ){ |
59051
|
0 |
0 |
if( !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK); |
59061
|
0 |
0 |
if( !jrnlOpen ){ |
59065
|
0 |
0 |
if( rc==SQLITE_OK ){ |
59068
|
0 |
0 |
if( rc==SQLITE_IOERR_SHORT_READ ){ |
59071
|
0 |
0 |
if( !jrnlOpen ){ |
59075
|
0 |
0 |
}else if( rc==SQLITE_CANTOPEN ){ |
59135
|
2380 |
0 |
if( !pagerUseWal(pPager) && pPager->eState==PAGER_OPEN ){ |
|
338 |
2042 |
if( !pagerUseWal(pPager) && pPager->eState==PAGER_OPEN ){ |
59142
|
2 |
336 |
if( rc!=SQLITE_OK ){ |
59150
|
336 |
0 |
if( pPager->eLock<=SHARED_LOCK ){ |
59153
|
0 |
336 |
if( rc!=SQLITE_OK ){ |
59156
|
0 |
336 |
if( bHotJournal ){ |
59157
|
0 |
0 |
if( pPager->readOnly ){ |
59178
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
59195
|
0 |
0 |
if( !isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ |
|
0 |
0 |
if( !isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ |
59200
|
0 |
0 |
if( rc==SQLITE_OK && bExists ){ |
|
0 |
0 |
if( rc==SQLITE_OK && bExists ){ |
59206
|
0 |
0 |
if( rc==SQLITE_OK && fout&SQLITE_OPEN_READONLY ){ |
|
0 |
0 |
if( rc==SQLITE_OK && fout&SQLITE_OPEN_READONLY ){ |
59221
|
0 |
0 |
if( isOpen(pPager->jfd) ){ |
59224
|
0 |
0 |
if( rc==SQLITE_OK ){ |
59228
|
0 |
0 |
}else if( !pPager->exclusiveMode ){ |
59232
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
59259
|
336 |
0 |
if( !pPager->tempFile && pPager->hasHeldSharedLock ){ |
|
283 |
53 |
if( !pPager->tempFile && pPager->hasHeldSharedLock ){ |
59280
|
12 |
271 |
if( rc!=SQLITE_OK ){ |
59281
|
0 |
12 |
if( rc!=SQLITE_IOERR_SHORT_READ ){ |
59287
|
11 |
272 |
if( memcmp(pPager->dbFileVers, dbFileVers, sizeof(dbFileVers))!=0 ){ |
59296
|
0 |
11 |
if( USEFETCH(pPager) ){ |
59311
|
0 |
2378 |
if( pagerUseWal(pPager) ){ |
59316
|
336 |
2042 |
if( pPager->tempFile==0 && pPager->eState==PAGER_OPEN && rc==SQLITE_OK ){ |
|
336 |
0 |
if( pPager->tempFile==0 && pPager->eState==PAGER_OPEN && rc==SQLITE_OK ){ |
|
336 |
0 |
if( pPager->tempFile==0 && pPager->eState==PAGER_OPEN && rc==SQLITE_OK ){ |
59321
|
2 |
2378 |
if( rc!=SQLITE_OK ){ |
59341
|
2378 |
44 |
if( sqlite3PcacheRefCount(pPager->pPCache)==0 ){ |
59420
|
0 |
11594 |
if( pgno==0 ) return SQLITE_CORRUPT_BKPT; |
59422
|
0 |
11594 |
if( pBase==0 ){ |
59425
|
0 |
0 |
if( rc!=SQLITE_OK ) goto pager_acquire_err; |
59426
|
0 |
0 |
if( pBase==0 ){ |
59437
|
10258 |
1336 |
if( pPg->pPager && !noContent ){ |
|
10257 |
1 |
if( pPg->pPager && !noContent ){ |
59451
|
0 |
1337 |
if( pgno==PAGER_SJ_PGNO(pPager) ){ |
59459
|
164 |
1173 |
if( !isOpen(pPager->fd) || pPager->dbSize
|
|
89 |
75 |
if( !isOpen(pPager->fd) || pPager->dbSize
|
|
1 |
88 |
if( !isOpen(pPager->fd) || pPager->dbSize
|
59460
|
0 |
1249 |
if( pgno>pPager->mxPgno ){ |
59464
|
1001 |
248 |
if( noContent ){ |
59472
|
1 |
1000 |
if( pgno<=pPager->dbOrigSize ){ |
59486
|
0 |
88 |
if( rc!=SQLITE_OK ){ |
59496
|
0 |
0 |
if( pPg ){ |
59521
|
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)) |
59530
|
0 |
0 |
if( pgno<=1 && pgno==0 ){ |
|
0 |
0 |
if( pgno<=1 && pgno==0 ){ |
59538
|
0 |
0 |
if( bMmapOk && pagerUseWal(pPager) ){ |
|
0 |
0 |
if( bMmapOk && pagerUseWal(pPager) ){ |
59540
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
59545
|
0 |
0 |
if( bMmapOk && iFrame==0 ){ |
|
0 |
0 |
if( bMmapOk && iFrame==0 ){ |
59550
|
0 |
0 |
if( rc==SQLITE_OK && pData ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pData ){ |
59551
|
0 |
0 |
if( pPager->eState>PAGER_READER || pPager->tempFile ){ |
|
0 |
0 |
if( pPager->eState>PAGER_READER || pPager->tempFile ){ |
59554
|
0 |
0 |
if( pPg==0 ){ |
59559
|
0 |
0 |
if( pPg ){ |
59565
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
59619
|
0 |
29 |
if( pPage==0 ) return 0; |
59638
|
0 |
9177 |
if( pPg->flags & PGHDR_MMAP ){ |
59648
|
979 |
0 |
if( pPg ) sqlite3PagerUnrefNotNull(pPg); |
59693
|
0 |
1104 |
if( NEVER(pPager->errCode) ) return pPager->errCode; |
59695
|
1104 |
0 |
if( !pagerUseWal(pPager) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ |
|
1087 |
17 |
if( !pagerUseWal(pPager) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ |
59697
|
0 |
1087 |
if( pPager->pInJournal==0 ){ |
59702
|
1087 |
0 |
if( !isOpen(pPager->jfd) ){ |
59703
|
794 |
293 |
if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY ){ |
59709
|
201 |
92 |
if( pPager->tempFile ){ |
59720
|
293 |
0 |
if( rc==SQLITE_OK ){ |
59733
|
1087 |
0 |
if( rc==SQLITE_OK ){ |
59743
|
0 |
1104 |
if( rc!=SQLITE_OK ){ |
59775
|
0 |
1292 |
if( pPager->errCode ) return pPager->errCode; |
59779
|
1292 |
0 |
if( pPager->eState==PAGER_READER ){ |
59782
|
0 |
1292 |
if( pagerUseWal(pPager) ){ |
59786
|
0 |
0 |
if( pPager->exclusiveMode && sqlite3WalExclusiveMode(pPager->pWal, -1) ){ |
|
0 |
0 |
if( pPager->exclusiveMode && sqlite3WalExclusiveMode(pPager->pWal, -1) ){ |
59788
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
59807
|
1140 |
152 |
if( rc==SQLITE_OK && exFlag ){ |
|
14 |
1126 |
if( rc==SQLITE_OK && exFlag ){ |
59812
|
1140 |
152 |
if( rc==SQLITE_OK ){ |
59867
|
0 |
1308 |
if( rc!=SQLITE_OK ) return rc; |
59869
|
0 |
1308 |
if( rc!=SQLITE_OK ) return rc; |
59871
|
0 |
1308 |
if( rc!=SQLITE_OK ) return rc; |
59924
|
1104 |
1413 |
if( pPager->eState==PAGER_WRITER_LOCKED ){ |
59926
|
0 |
1104 |
if( rc!=SQLITE_OK ) return rc; |
59939
|
2490 |
27 |
if( pPager->pInJournal!=0 |
59940
|
2489 |
1 |
&& sqlite3BitvecTestNotNull(pPager->pInJournal, pPg->pgno)==0 |
59943
|
1308 |
1181 |
if( pPg->pgno<=pPager->dbOrigSize ){ |
59945
|
0 |
1308 |
if( rc!=SQLITE_OK ){ |
59949
|
1181 |
0 |
if( pPager->eState!=PAGER_WRITER_DBMOD ){ |
59968
|
60 |
2457 |
if( pPager->nSavepoint>0 ){ |
59973
|
1208 |
1309 |
if( pPager->dbSizepgno ){ |
60015
|
0 |
0 |
if( pPg->pgno>nPageCount ){ |
60017
|
0 |
0 |
}else if( (pg1+nPagePerSector-1)>nPageCount ){ |
60026
|
0 |
0 |
for(ii=0; ii
|
|
0 |
0 |
for(ii=0; ii
|
60029
|
0 |
0 |
if( pg==pPg->pgno || !sqlite3BitvecTest(pPager->pInJournal, pg) ){ |
|
0 |
0 |
if( pg==pPg->pgno || !sqlite3BitvecTest(pPager->pInJournal, pg) ){ |
60030
|
0 |
0 |
if( pg!=PAGER_SJ_PGNO(pPager) ){ |
60032
|
0 |
0 |
if( rc==SQLITE_OK ){ |
60034
|
0 |
0 |
if( pPage->flags&PGHDR_NEED_SYNC ){ |
60040
|
0 |
0 |
}else if( (pPage = sqlite3PagerLookup(pPager, pg))!=0 ){ |
60041
|
0 |
0 |
if( pPage->flags&PGHDR_NEED_SYNC ){ |
60054
|
0 |
0 |
if( rc==SQLITE_OK && needSync ){ |
|
0 |
0 |
if( rc==SQLITE_OK && needSync ){ |
60056
|
0 |
0 |
for(ii=0; ii
|
60058
|
0 |
0 |
if( pPage ){ |
60089
|
4984 |
2517 |
if( (pPg->flags & PGHDR_WRITEABLE)!=0 && pPager->dbSize>=pPg->pgno ){ |
|
4984 |
0 |
if( (pPg->flags & PGHDR_WRITEABLE)!=0 && pPager->dbSize>=pPg->pgno ){ |
60090
|
323 |
4661 |
if( pPager->nSavepoint ) return subjournalPageIfRequired(pPg); |
60092
|
0 |
2517 |
}else if( pPager->errCode ){ |
60094
|
0 |
2517 |
}else if( pPager->sectorSize > (u32)pPager->pageSize ){ |
60135
|
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 ){ |
60193
|
90 |
0 |
if( !pPager->changeCountDone && ALWAYS(pPager->dbSize>0) ){ |
|
90 |
0 |
if( !pPager->changeCountDone && ALWAYS(pPager->dbSize>0) ){ |
60207
|
90 |
0 |
if( !DIRECT_MODE && ALWAYS(rc==SQLITE_OK) ){ |
60211
|
90 |
0 |
if( rc==SQLITE_OK ){ |
60254
|
90 |
0 |
if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK; |
60255
|
90 |
0 |
if( rc==SQLITE_OK && !pPager->noSync ){ |
|
90 |
0 |
if( rc==SQLITE_OK && !pPager->noSync ){ |
60276
|
1169 |
0 |
if( rc==SQLITE_OK ){ |
60282
|
1169 |
0 |
if( 0==pagerUseWal(pPager) ){ |
60330
|
0 |
1079 |
if( NEVER(pPager->errCode) ) return pPager->errCode; |
60333
|
0 |
1079 |
if( sqlite3FaultSim(400) ) return SQLITE_IOERR; |
60339
|
23 |
1056 |
if( pPager->eState
|
60343
|
966 |
90 |
if( 0==pagerFlushOnCommit(pPager, 1) ){ |
60350
|
0 |
90 |
if( pagerUseWal(pPager) ){ |
60353
|
0 |
0 |
if( pList==0 ){ |
60361
|
0 |
0 |
if( ALWAYS(pList) ){ |
60365
|
0 |
0 |
if( rc==SQLITE_OK ){ |
60442
|
0 |
90 |
if( rc!=SQLITE_OK ) goto commit_phase_one_exit; |
60449
|
0 |
90 |
if( rc!=SQLITE_OK ) goto commit_phase_one_exit; |
60463
|
0 |
90 |
if( rc!=SQLITE_OK ) goto commit_phase_one_exit; |
60495
|
0 |
90 |
if( rc!=SQLITE_OK ){ |
60507
|
0 |
90 |
if( pPager->dbSize>pPager->dbFileSize ){ |
60511
|
0 |
0 |
if( rc!=SQLITE_OK ) goto commit_phase_one_exit; |
60515
|
90 |
0 |
if( !noSync ){ |
60523
|
1056 |
0 |
if( rc==SQLITE_OK && !pagerUseWal(pPager) ){ |
|
1056 |
0 |
if( rc==SQLITE_OK && !pagerUseWal(pPager) ){ |
60551
|
0 |
1079 |
if( NEVER(pPager->errCode) ) return pPager->errCode; |
60571
|
23 |
1056 |
if( pPager->eState==PAGER_WRITER_LOCKED |
60572
|
16 |
7 |
&& pPager->exclusiveMode |
60573
|
0 |
16 |
&& pPager->journalMode==PAGER_JOURNALMODE_PERSIST |
60620
|
0 |
61 |
if( pPager->eState==PAGER_ERROR ) return pPager->errCode; |
60621
|
0 |
61 |
if( pPager->eState<=PAGER_READER ) return SQLITE_OK; |
60623
|
0 |
61 |
if( pagerUseWal(pPager) ){ |
60627
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
60628
|
31 |
30 |
}else if( !isOpen(pPager->jfd) || pPager->eState==PAGER_WRITER_LOCKED ){ |
|
0 |
31 |
}else if( !isOpen(pPager->jfd) || pPager->eState==PAGER_WRITER_LOCKED ){ |
60631
|
17 |
13 |
if( !MEMDB && eState>PAGER_WRITER_LOCKED ){ |
|
17 |
0 |
if( !MEMDB && eState>PAGER_WRITER_LOCKED ){ |
60740
|
0 |
6 |
if( reset ){ |
60749
|
95 |
0 |
return pPager->tempFile || pPager->memVfs; |
|
0 |
95 |
return pPager->tempFile || pPager->memVfs; |
60779
|
0 |
55 |
if( !aNew ){ |
60786
|
55 |
55 |
for(ii=nCurrent; ii
|
60788
|
55 |
0 |
if( isOpen(pPager->jfd) && pPager->journalOff>0 ){ |
|
55 |
0 |
if( isOpen(pPager->jfd) && pPager->journalOff>0 ){ |
60796
|
0 |
55 |
if( !aNew[ii].pInSavepoint ){ |
60799
|
0 |
55 |
if( pagerUseWal(pPager) ){ |
60812
|
55 |
3759 |
if( nSavepoint>pPager->nSavepoint && pPager->useJournal ){ |
|
55 |
0 |
if( nSavepoint>pPager->nSavepoint && pPager->useJournal ){ |
60860
|
55 |
0 |
if( rc==SQLITE_OK && iSavepointnSavepoint ){ |
|
55 |
0 |
if( rc==SQLITE_OK && iSavepointnSavepoint ){ |
60869
|
54 |
55 |
for(ii=nNew; iinSavepoint; ii++){ |
60876
|
54 |
1 |
if( op==SAVEPOINT_RELEASE ){ |
60878
|
54 |
0 |
if( pRel->bTruncateOnRelease && isOpen(pPager->sjfd) ){ |
|
54 |
0 |
if( pRel->bTruncateOnRelease && isOpen(pPager->sjfd) ){ |
60880
|
54 |
0 |
if( sqlite3JournalIsInMemory(pPager->sjfd) ){ |
60893
|
1 |
0 |
else if( pagerUseWal(pPager) || isOpen(pPager->jfd) ){ |
|
1 |
0 |
else if( pagerUseWal(pPager) || isOpen(pPager->jfd) ){ |
60894
|
1 |
0 |
PagerSavepoint *pSavepoint = (nNew==0)?0:&pPager->aSavepoint[nNew-1]; |
60933
|
2510 |
0 |
return (nullIfMemDb && pPager->memDb) ? &zFake[4] : pPager->zFilename; |
|
361 |
2149 |
return (nullIfMemDb && pPager->memDb) ? &zFake[4] : pPager->zFilename; |
60960
|
0 |
0 |
return pPager->pWal ? sqlite3WalFile(pPager->pWal) : pPager->jfd; |
61013
|
0 |
0 |
if( pPager->tempFile ){ |
61015
|
0 |
0 |
if( rc ) return rc; |
61036
|
0 |
0 |
if( (pPg->flags & PGHDR_DIRTY)!=0 |
61037
|
0 |
0 |
&& SQLITE_OK!=(rc = subjournalPageIfRequired(pPg)) |
61053
|
0 |
0 |
if( (pPg->flags&PGHDR_NEED_SYNC) && !isCommit ){ |
|
0 |
0 |
if( (pPg->flags&PGHDR_NEED_SYNC) && !isCommit ){ |
61068
|
0 |
0 |
if( pPgOld ){ |
61069
|
0 |
0 |
if( NEVER(pPgOld->nRef>1) ){ |
61074
|
0 |
0 |
if( pPager->tempFile ){ |
61091
|
0 |
0 |
if( pPager->tempFile && pPgOld ){ |
|
0 |
0 |
if( pPager->tempFile && pPgOld ){ |
61096
|
0 |
0 |
if( needSyncPgno ){ |
61113
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
61114
|
0 |
0 |
if( needSyncPgno<=pPager->dbOrigSize ){ |
61174
|
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) ){ |
61220
|
2 |
0 |
if( MEMDB ){ |
61222
|
0 |
2 |
if( eMode!=PAGER_JOURNALMODE_MEMORY && eMode!=PAGER_JOURNALMODE_OFF ){ |
|
0 |
0 |
if( eMode!=PAGER_JOURNALMODE_MEMORY && eMode!=PAGER_JOURNALMODE_OFF ){ |
61227
|
0 |
2 |
if( eMode!=eOld ){ |
61245
|
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 ){ |
61255
|
0 |
0 |
if( pPager->eLock>=RESERVED_LOCK ){ |
61261
|
0 |
0 |
if( state==PAGER_OPEN ){ |
61264
|
0 |
0 |
if( pPager->eState==PAGER_READER ){ |
61268
|
0 |
0 |
if( rc==SQLITE_OK ){ |
61271
|
0 |
0 |
if( rc==SQLITE_OK && state==PAGER_READER ){ |
|
0 |
0 |
if( rc==SQLITE_OK && state==PAGER_READER ){ |
61273
|
0 |
0 |
}else if( state==PAGER_OPEN ){ |
61278
|
0 |
0 |
}else if( eMode==PAGER_JOURNALMODE_OFF ){ |
61301
|
0 |
2 |
if( pPager->eState>=PAGER_WRITER_CACHEMOD ) return 0; |
61302
|
0 |
2 |
if( isOpen(pPager->jfd) && pPager->journalOff>0 ) return 0; |
|
0 |
0 |
if( isOpen(pPager->jfd) && pPager->journalOff>0 ) return 0; |
61313
|
0 |
0 |
if( iLimit>=-1 ){ |
61336
|
0 |
0 |
if( pPager->tempFile==0 ) pager_reset(pPager); |
61357
|
0 |
0 |
if( pPager->pWal==0 && pPager->journalMode==PAGER_JOURNALMODE_WAL ){ |
|
0 |
0 |
if( pPager->pWal==0 && pPager->journalMode==PAGER_JOURNALMODE_WAL ){ |
61369
|
0 |
0 |
if( pPager->pWal ){ |
61370
|
0 |
0 |
rc = sqlite3WalCheckpoint(pPager->pWal, db, eMode, |
61390
|
0 |
0 |
if( pPager->noLock ) return 0; |
61391
|
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); |
61403
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
61429
|
0 |
0 |
if( pPager->exclusiveMode ){ |
61436
|
0 |
0 |
if( rc==SQLITE_OK ){ |
61475
|
0 |
0 |
if( !pPager->tempFile && !pPager->pWal ){ |
|
0 |
0 |
if( !pPager->tempFile && !pPager->pWal ){ |
61476
|
0 |
0 |
if( !sqlite3PagerWalSupported(pPager) ) return SQLITE_CANTOPEN; |
61482
|
0 |
0 |
if( rc==SQLITE_OK ){ |
61511
|
0 |
0 |
if( !pPager->pWal ){ |
61514
|
0 |
0 |
if( rc==SQLITE_OK ){ |
61519
|
0 |
0 |
if( rc==SQLITE_OK && logexists ){ |
|
0 |
0 |
if( rc==SQLITE_OK && logexists ){ |
61527
|
0 |
0 |
if( rc==SQLITE_OK && pPager->pWal ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pPager->pWal ){ |
61529
|
0 |
0 |
if( rc==SQLITE_OK ){ |
61534
|
0 |
0 |
if( rc && !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK); |
|
0 |
0 |
if( rc && !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK); |
62301
|
0 |
0 |
if( pWal->nWiData<=iPage ){ |
62305
|
0 |
0 |
if( !apNew ){ |
62317
|
0 |
0 |
if( pWal->exclusiveMode==WAL_HEAPMEMORY_MODE ){ |
62319
|
0 |
0 |
if( !pWal->apWiData[iPage] ) rc = SQLITE_NOMEM_BKPT; |
62328
|
0 |
0 |
if( rc==SQLITE_OK ){ |
62329
|
0 |
0 |
if( iPage>0 && sqlite3FaultSim(600) ) rc = SQLITE_NOMEM; |
|
0 |
0 |
if( iPage>0 && sqlite3FaultSim(600) ) rc = SQLITE_NOMEM; |
62330
|
0 |
0 |
}else if( (rc&0xff)==SQLITE_READONLY ){ |
62332
|
0 |
0 |
if( rc==SQLITE_READONLY ){ |
62347
|
0 |
0 |
if( pWal->nWiData<=iPage || (*ppPage = pWal->apWiData[iPage])==0 ){ |
|
0 |
0 |
if( pWal->nWiData<=iPage || (*ppPage = pWal->apWiData[iPage])==0 ){ |
62401
|
0 |
0 |
if( aIn ){ |
62412
|
0 |
0 |
if( nativeCksum ){ |
62416
|
0 |
0 |
}while( aData
|
62422
|
0 |
0 |
}while( aData
|
62434
|
0 |
0 |
if( pWal->exclusiveMode!=WAL_HEAPMEMORY_MODE ){ |
62496
|
0 |
0 |
if( pWal->iReCksum==0 ){ |
62530
|
0 |
0 |
if( memcmp(&pWal->hdr.aSalt, &aFrame[8], 8)!=0 ){ |
62537
|
0 |
0 |
if( pgno==0 ){ |
62549
|
0 |
0 |
if( aCksum[0]!=sqlite3Get4byte(&aFrame[16]) |
62550
|
0 |
0 |
|| aCksum[1]!=sqlite3Get4byte(&aFrame[20]) |
62596
|
0 |
0 |
if( pWal->exclusiveMode ) return SQLITE_OK; |
62605
|
0 |
0 |
if( pWal->exclusiveMode ) return; |
62612
|
0 |
0 |
if( pWal->exclusiveMode ) return SQLITE_OK; |
62621
|
0 |
0 |
if( pWal->exclusiveMode ) return; |
62678
|
0 |
0 |
if( pLoc->aPgno ){ |
62680
|
0 |
0 |
if( iHash==0 ){ |
62686
|
0 |
0 |
}else if( NEVER(rc==SQLITE_OK) ){ |
62715
|
0 |
0 |
if( iHash==0 ){ |
62744
|
0 |
0 |
if( pWal->hdr.mxFrame==0 ) return; |
62753
|
0 |
0 |
if( NEVER(i) ) return; /* Defense-in-depth, in case (1) above is wrong */ |
62760
|
0 |
0 |
for(i=0; i
|
62761
|
0 |
0 |
if( sLoc.aHash[i]>iLimit ){ |
62804
|
0 |
0 |
if( rc==SQLITE_OK ){ |
62815
|
0 |
0 |
if( idx==1 ){ |
62827
|
0 |
0 |
if( sLoc.aPgno[idx-1] ){ |
62834
|
0 |
0 |
for(iKey=walHash(iPage); sLoc.aHash[iKey]; iKey=walNextHash(iKey)){ |
62835
|
0 |
0 |
if( (nCollide--)==0 ) return SQLITE_CORRUPT_BKPT; |
62902
|
0 |
0 |
if( rc ){ |
62911
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
62915
|
0 |
0 |
if( nSize>WAL_HDRSIZE ){ |
62930
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
62941
|
0 |
0 |
if( (magic&0xFFFFFFFE)!=WAL_MAGIC |
62942
|
0 |
0 |
|| szPage&(szPage-1) |
62943
|
0 |
0 |
|| szPage>SQLITE_MAX_PAGE_SIZE |
62944
|
0 |
0 |
|| szPage<512 |
62957
|
0 |
0 |
if( pWal->hdr.aFrameCksum[0]!=sqlite3Get4byte(&aBuf[24]) |
62958
|
0 |
0 |
|| pWal->hdr.aFrameCksum[1]!=sqlite3Get4byte(&aBuf[28]) |
62966
|
0 |
0 |
if( version!=WAL_MAX_VERSION ){ |
62974
|
0 |
0 |
if( !aFrame ){ |
62983
|
0 |
0 |
for(iPg=0; iPg<=(u32)walFramePage(iLastFrame); iPg++){ |
62987
|
0 |
0 |
u32 iFirst = 1 + (iPg==0?0:HASHTABLE_NPAGE_ONE+(iPg-1)*HASHTABLE_NPAGE); |
62991
|
0 |
0 |
if( aShare==0 ) break; |
62994
|
0 |
0 |
for(iFrame=iFirst; iFrame<=iLast; iFrame++){ |
63001
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
63003
|
0 |
0 |
if( !isValid ) break; |
63005
|
0 |
0 |
if( NEVER(rc!=SQLITE_OK) ) break; |
63008
|
0 |
0 |
if( nTruncate ){ |
63019
|
0 |
0 |
nHdr = (iPg==0 ? WALINDEX_HDR_SIZE : 0); |
63049
|
0 |
0 |
if( iFrame<=iLast ) break; |
63056
|
0 |
0 |
if( rc==SQLITE_OK ){ |
63071
|
0 |
0 |
for(i=1; i
|
63073
|
0 |
0 |
if( rc==SQLITE_OK ){ |
63074
|
0 |
0 |
if( i==1 && pWal->hdr.mxFrame ){ |
|
0 |
0 |
if( i==1 && pWal->hdr.mxFrame ){ |
63080
|
0 |
0 |
}else if( rc!=SQLITE_BUSY ){ |
63090
|
0 |
0 |
if( pWal->hdr.nPage ){ |
63108
|
0 |
0 |
if( pWal->exclusiveMode==WAL_HEAPMEMORY_MODE || pWal->bShmUnreliable ){ |
|
0 |
0 |
if( pWal->exclusiveMode==WAL_HEAPMEMORY_MODE || pWal->bShmUnreliable ){ |
63110
|
0 |
0 |
for(i=0; inWiData; i++){ |
63115
|
0 |
0 |
if( pWal->exclusiveMode!=WAL_HEAPMEMORY_MODE ){ |
63198
|
0 |
0 |
if( !pRet ){ |
63210
|
0 |
0 |
pRet->exclusiveMode = (bNoShm ? WAL_HEAPMEMORY_MODE: WAL_NORMAL_MODE); |
63215
|
0 |
0 |
if( rc==SQLITE_OK && flags&SQLITE_OPEN_READONLY ){ |
|
0 |
0 |
if( rc==SQLITE_OK && flags&SQLITE_OPEN_READONLY ){ |
63219
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
63225
|
0 |
0 |
if( iDC & SQLITE_IOCAP_SEQUENTIAL ){ pRet->syncHeader = 0; } |
63226
|
0 |
0 |
if( iDC & SQLITE_IOCAP_POWERSAFE_OVERWRITE ){ |
63239
|
0 |
0 |
if( pWal ) pWal->mxWalSize = iLimit; |
63263
|
0 |
0 |
for(i=p->nSegment-1; i>=0; i--){ |
63265
|
0 |
0 |
while( pSegment->iNextnEntry ){ |
63267
|
0 |
0 |
if( iPg>iMin ){ |
63268
|
0 |
0 |
if( iPg
|
63320
|
0 |
0 |
while( iRight
|
|
0 |
0 |
while( iRight
|
63324
|
0 |
0 |
if( (iLeft
|
63325
|
0 |
0 |
&& (iRight>=nRight || aContent[aLeft[iLeft]]
|
|
0 |
0 |
&& (iRight>=nRight || aContent[aLeft[iLeft]]
|
63334
|
0 |
0 |
if( iLeft
|
|
0 |
0 |
if( iLeft
|
63384
|
0 |
0 |
for(iList=0; iList
|
63387
|
0 |
0 |
for(iSub=0; iList & (1<
|
63399
|
0 |
0 |
for(iSub++; iSub
|
63400
|
0 |
0 |
if( nList & (1<
|
63463
|
0 |
0 |
if( !p ){ |
63472
|
0 |
0 |
aTmp = (ht_slot *)sqlite3_malloc64( |
63475
|
0 |
0 |
if( !aTmp ){ |
63479
|
0 |
0 |
for(i=walFramePage(nBackfill+1); rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=walFramePage(nBackfill+1); rc==SQLITE_OK && i
|
63483
|
0 |
0 |
if( rc==SQLITE_OK ){ |
63488
|
0 |
0 |
if( (i+1)==nSegment ){ |
63496
|
0 |
0 |
for(j=0; j
|
63508
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
63615
|
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) ); |
63662
|
0 |
0 |
for(i=2; iaReadMark[i] = READMARK_NOT_USED; |
63720
|
0 |
0 |
if( pInfo->nBackfillhdr.mxFrame ){ |
63733
|
0 |
0 |
for(i=1; i
|
63735
|
0 |
0 |
if( mxSafeFrame>y ){ |
63738
|
0 |
0 |
if( rc==SQLITE_OK ){ |
63739
|
0 |
0 |
u32 iMark = (i==1 ? mxSafeFrame : READMARK_NOT_USED); |
63742
|
0 |
0 |
}else if( rc==SQLITE_BUSY ){ |
63752
|
0 |
0 |
if( pInfo->nBackfill
|
63757
|
0 |
0 |
if( pIter |
63758
|
0 |
0 |
&& (rc = walBusyLock(pWal,xBusy,pBusyArg,WAL_READ_LOCK(0),1))==SQLITE_OK |
63770
|
0 |
0 |
if( rc==SQLITE_OK ){ |
63775
|
0 |
0 |
if( rc==SQLITE_OK && nSize
|
|
0 |
0 |
if( rc==SQLITE_OK && nSize
|
63776
|
0 |
0 |
if( (nSize+65536+(i64)pWal->hdr.mxFrame*szPage)
|
63790
|
0 |
0 |
while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){ |
|
0 |
0 |
while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){ |
63793
|
0 |
0 |
if( AtomicLoad(&db->u1.isInterrupted) ){ |
63794
|
0 |
0 |
rc = db->mallocFailed ? SQLITE_NOMEM_BKPT : SQLITE_INTERRUPT; |
63797
|
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 ){ |
63803
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
63807
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
63812
|
0 |
0 |
if( rc==SQLITE_OK ){ |
63813
|
0 |
0 |
if( mxSafeFrame==walIndexHdr(pWal)->mxFrame ){ |
63817
|
0 |
0 |
if( rc==SQLITE_OK ){ |
63821
|
0 |
0 |
if( rc==SQLITE_OK ){ |
63830
|
0 |
0 |
if( rc==SQLITE_BUSY ){ |
63842
|
0 |
0 |
if( rc==SQLITE_OK && eMode!=SQLITE_CHECKPOINT_PASSIVE ){ |
|
0 |
0 |
if( rc==SQLITE_OK && eMode!=SQLITE_CHECKPOINT_PASSIVE ){ |
63844
|
0 |
0 |
if( pInfo->nBackfillhdr.mxFrame ){ |
63846
|
0 |
0 |
}else if( eMode>=SQLITE_CHECKPOINT_RESTART ){ |
63851
|
0 |
0 |
if( rc==SQLITE_OK ){ |
63852
|
0 |
0 |
if( eMode==SQLITE_CHECKPOINT_TRUNCATE ){ |
63888
|
0 |
0 |
if( rx==SQLITE_OK && (sz > nMax ) ){ |
|
0 |
0 |
if( rx==SQLITE_OK && (sz > nMax ) ){ |
63892
|
0 |
0 |
if( rx ){ |
63908
|
0 |
364 |
if( pWal ){ |
63919
|
0 |
0 |
if( zBuf!=0 |
63920
|
0 |
0 |
&& SQLITE_OK==(rc = sqlite3OsLock(pWal->pDbFd, SQLITE_LOCK_EXCLUSIVE)) |
63922
|
0 |
0 |
if( pWal->exclusiveMode==WAL_NORMAL_MODE ){ |
63928
|
0 |
0 |
if( rc==SQLITE_OK ){ |
63933
|
0 |
0 |
if( bPersist!=1 ){ |
63938
|
0 |
0 |
}else if( pWal->mxWalSize>=0 ){ |
63952
|
0 |
0 |
if( isDelete ){ |
64010
|
0 |
0 |
if( memcmp(&h1, &h2, sizeof(h1))!=0 ){ |
64013
|
0 |
0 |
if( h1.isInit==0 ){ |
64017
|
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] ){ |
64021
|
0 |
0 |
if( memcmp(&pWal->hdr, &h1, sizeof(WalIndexHdr)) ){ |
64061
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
64063
|
0 |
0 |
if( rc==SQLITE_READONLY_CANTINIT ){ |
64091
|
0 |
0 |
badHdr = (page0 ? walIndexTryHdr(pWal, pChanged) : 1); |
64096
|
0 |
0 |
if( badHdr ){ |
64097
|
0 |
0 |
if( pWal->bShmUnreliable==0 && (pWal->readOnly & WAL_SHM_RDONLY) ){ |
|
0 |
0 |
if( pWal->bShmUnreliable==0 && (pWal->readOnly & WAL_SHM_RDONLY) ){ |
64098
|
0 |
0 |
if( SQLITE_OK==(rc = walLockShared(pWal, WAL_WRITE_LOCK)) ){ |
64104
|
0 |
0 |
if( bWriteLock || SQLITE_OK==(rc = walLockWriter(pWal)) ){ |
|
0 |
0 |
if( bWriteLock || SQLITE_OK==(rc = walLockWriter(pWal)) ){ |
64106
|
0 |
0 |
if( SQLITE_OK==(rc = walIndexPage(pWal, 0, &page0)) ){ |
64108
|
0 |
0 |
if( badHdr ){ |
64117
|
0 |
0 |
if( bWriteLock==0 ){ |
64129
|
0 |
0 |
if( badHdr==0 && pWal->hdr.iVersion!=WALINDEX_MAX_VERSION ){ |
|
0 |
0 |
if( badHdr==0 && pWal->hdr.iVersion!=WALINDEX_MAX_VERSION ){ |
64132
|
0 |
0 |
if( pWal->bShmUnreliable ){ |
64133
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
64140
|
0 |
0 |
if( rc==SQLITE_IOERR_SHORT_READ ) rc = WAL_RETRY; |
64194
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
64195
|
0 |
0 |
if( rc==SQLITE_BUSY ) rc = WAL_RETRY; |
64224
|
0 |
0 |
if( rc!=SQLITE_READONLY_CANTINIT ){ |
64225
|
0 |
0 |
rc = (rc==SQLITE_READONLY ? WAL_RETRY : rc); |
64239
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
64242
|
0 |
0 |
if( szWal
|
64250
|
0 |
0 |
rc = (pWal->hdr.mxFrame==0 ? SQLITE_OK : WAL_RETRY); |
64256
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
64259
|
0 |
0 |
if( memcmp(&pWal->hdr.aSalt, &aBuf[16], 8) ){ |
64272
|
0 |
0 |
if( aFrame==0 ){ |
64284
|
0 |
0 |
for(iOffset=walFrameOffset(pWal->hdr.mxFrame+1, pWal->szPage); |
64293
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
64294
|
0 |
0 |
if( !walDecodeFrame(pWal, &pgno, &nTruncate, aData, aFrame) ) break; |
64299
|
0 |
0 |
if( nTruncate ){ |
64309
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
64311
|
0 |
0 |
for(i=0; inWiData; i++){ |
64402
|
0 |
0 |
if( cnt>5 ){ |
64404
|
0 |
0 |
if( cnt>100 ){ |
64408
|
0 |
0 |
if( cnt>=10 ) nDelay = (cnt-9)*(cnt-9)*39; |
64412
|
0 |
0 |
if( !useWal ){ |
64414
|
0 |
0 |
if( pWal->bShmUnreliable==0 ){ |
64417
|
0 |
0 |
if( rc==SQLITE_BUSY ){ |
64426
|
0 |
0 |
if( pWal->apWiData[0]==0 ){ |
64435
|
0 |
0 |
}else if( SQLITE_OK==(rc = walLockShared(pWal, WAL_RECOVER_LOCK)) ){ |
64438
|
0 |
0 |
}else if( rc==SQLITE_BUSY ){ |
64442
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
64445
|
0 |
0 |
else if( pWal->bShmUnreliable ){ |
64453
|
0 |
0 |
if( !useWal && AtomicLoad(&pInfo->nBackfill)==pWal->hdr.mxFrame |
|
0 |
0 |
if( !useWal && AtomicLoad(&pInfo->nBackfill)==pWal->hdr.mxFrame |
64463
|
0 |
0 |
if( rc==SQLITE_OK ){ |
64464
|
0 |
0 |
if( memcmp((void *)walIndexHdr(pWal), &pWal->hdr, sizeof(WalIndexHdr)) ){ |
64483
|
0 |
0 |
}else if( rc!=SQLITE_BUSY ){ |
64501
|
0 |
0 |
for(i=1; i
|
64503
|
0 |
0 |
if( mxReadMark<=thisMark && thisMark<=mxFrame ){ |
|
0 |
0 |
if( mxReadMark<=thisMark && thisMark<=mxFrame ){ |
64509
|
0 |
0 |
if( (pWal->readOnly & WAL_SHM_RDONLY)==0 |
64510
|
0 |
0 |
&& (mxReadMark
|
|
0 |
0 |
&& (mxReadMark
|
64512
|
0 |
0 |
for(i=1; i
|
64514
|
0 |
0 |
if( rc==SQLITE_OK ){ |
64520
|
0 |
0 |
}else if( rc!=SQLITE_BUSY ){ |
64525
|
0 |
0 |
if( mxI==0 ){ |
64527
|
0 |
0 |
return rc==SQLITE_BUSY ? WAL_RETRY : SQLITE_READONLY_CANTINIT; |
64531
|
0 |
0 |
if( rc ){ |
64532
|
0 |
0 |
return rc==SQLITE_BUSY ? WAL_RETRY : rc; |
64570
|
0 |
0 |
if( AtomicLoad(pInfo->aReadMark+mxI)!=mxReadMark |
64571
|
0 |
0 |
|| memcmp((void *)walIndexHdr(pWal), &pWal->hdr, sizeof(WalIndexHdr)) |
64710
|
0 |
0 |
}while( rc==WAL_RETRY ); |
64783
|
0 |
0 |
if( pWal->readLock>=0 ){ |
64816
|
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) ){ |
64847
|
0 |
0 |
for(iHash=walFramePage(iLast); iHash>=iMinHash; iHash--){ |
64855
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
64860
|
0 |
0 |
while( (iH = AtomicLoad(&sLoc.aHash[iKey]))!=0 ){ |
64862
|
0 |
0 |
if( iFrame<=iLast && iFrame>=pWal->minFrame && sLoc.aPgno[iH-1]==pgno ){ |
|
0 |
0 |
if( iFrame<=iLast && iFrame>=pWal->minFrame && sLoc.aPgno[iH-1]==pgno ){ |
|
0 |
0 |
if( iFrame<=iLast && iFrame>=pWal->minFrame && sLoc.aPgno[iH-1]==pgno ){ |
64866
|
0 |
0 |
if( (nCollide--)==0 ){ |
64871
|
0 |
0 |
if( iRead ) break; |
64922
|
0 |
336 |
if( pWal && ALWAYS(pWal->readLock>=0) ){ |
|
0 |
0 |
if( pWal && ALWAYS(pWal->readLock>=0) ){ |
64960
|
0 |
0 |
if( pWal->readOnly ){ |
64968
|
0 |
0 |
if( rc ){ |
64977
|
0 |
0 |
if( memcmp(&pWal->hdr, (void *)walIndexHdr(pWal), sizeof(WalIndexHdr))!=0 ){ |
64991
|
0 |
0 |
if( pWal->writeLock ){ |
65014
|
0 |
0 |
if( ALWAYS(pWal->writeLock) ){ |
65023
|
0 |
0 |
for(iFrame=pWal->hdr.mxFrame+1; |
65024
|
0 |
0 |
ALWAYS(rc==SQLITE_OK) && iFrame<=iMax; |
65041
|
0 |
0 |
if( iMax!=pWal->hdr.mxFrame ) walCleanupHash(pWal); |
65072
|
0 |
0 |
if( aWalData[3]!=pWal->nCkpt ){ |
65081
|
0 |
0 |
if( aWalData[0]hdr.mxFrame ){ |
65107
|
0 |
0 |
if( pWal->readLock==0 ){ |
65110
|
0 |
0 |
if( pInfo->nBackfill>0 ){ |
65114
|
0 |
0 |
if( rc==SQLITE_OK ){ |
65126
|
0 |
0 |
}else if( rc!=SQLITE_BUSY ){ |
65136
|
0 |
0 |
}while( rc==WAL_RETRY ); |
65173
|
0 |
0 |
if( iOffsetiSyncPoint && iOffset+iAmt>=p->iSyncPoint ){ |
|
0 |
0 |
if( iOffsetiSyncPoint && iOffset+iAmt>=p->iSyncPoint ){ |
65176
|
0 |
0 |
if( rc ) return rc; |
65182
|
0 |
0 |
if( iAmt==0 || rc ) return rc; |
|
0 |
0 |
if( iAmt==0 || rc ) return rc; |
65203
|
0 |
0 |
if( rc ) return rc; |
65226
|
0 |
0 |
if( aBuf==0 ) return SQLITE_NOMEM_BKPT; |
65234
|
0 |
0 |
if( pWal->iReCksum==1 ){ |
65245
|
0 |
0 |
for(; rc==SQLITE_OK && iRead<=iLast; iRead++){ |
|
0 |
0 |
for(; rc==SQLITE_OK && iRead<=iLast; iRead++){ |
65248
|
0 |
0 |
if( rc==SQLITE_OK ){ |
65300
|
0 |
0 |
if( memcmp(&pWal->hdr, (void *)pLive, sizeof(WalIndexHdr))!=0 ){ |
65307
|
0 |
0 |
if( SQLITE_OK!=(rc = walRestartLog(pWal)) ){ |
65316
|
0 |
0 |
if( iFrame==0 ){ |
65324
|
0 |
0 |
if( pWal->nCkpt==0 ) sqlite3_randomness(8, pWal->hdr.aSalt); |
65338
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
65349
|
0 |
0 |
if( pWal->syncHeader ){ |
65351
|
0 |
0 |
if( rc ) return rc; |
65366
|
0 |
0 |
for(p=pList; p; p=p->pDirty){ |
65373
|
0 |
0 |
if( iFirst && (p->pDirty || isCommit==0) ){ |
|
0 |
0 |
if( iFirst && (p->pDirty || isCommit==0) ){ |
|
0 |
0 |
if( iFirst && (p->pDirty || isCommit==0) ){ |
65377
|
0 |
0 |
if( iWrite>=iFirst ){ |
65380
|
0 |
0 |
if( pWal->iReCksum==0 || iWriteiReCksum ){ |
|
0 |
0 |
if( pWal->iReCksum==0 || iWriteiReCksum ){ |
65385
|
0 |
0 |
if( rc ) return rc; |
65393
|
0 |
0 |
nDbSize = (isCommit && p->pDirty==0) ? nTruncate : 0; |
|
0 |
0 |
nDbSize = (isCommit && p->pDirty==0) ? nTruncate : 0; |
65395
|
0 |
0 |
if( rc ) return rc; |
65402
|
0 |
0 |
if( isCommit && pWal->iReCksum ){ |
|
0 |
0 |
if( isCommit && pWal->iReCksum ){ |
65404
|
0 |
0 |
if( rc ) return rc; |
65421
|
0 |
0 |
if( isCommit && WAL_SYNC_FLAGS(sync_flags)!=0 ){ |
|
0 |
0 |
if( isCommit && WAL_SYNC_FLAGS(sync_flags)!=0 ){ |
65423
|
0 |
0 |
if( pWal->padToSectorBoundary ){ |
65428
|
0 |
0 |
while( iOffset
|
65430
|
0 |
0 |
if( rc ) return rc; |
65436
|
0 |
0 |
if( bSync ){ |
65446
|
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 ){ |
65448
|
0 |
0 |
if( walFrameOffset(iFrame+nExtra+1, szPage)>pWal->mxWalSize ){ |
65461
|
0 |
0 |
for(p=pList; p && rc==SQLITE_OK; p=p->pDirty){ |
|
0 |
0 |
for(p=pList; p && rc==SQLITE_OK; p=p->pDirty){ |
65462
|
0 |
0 |
if( (p->flags & PGHDR_WAL_APPEND)==0 ) continue; |
65467
|
0 |
0 |
while( rc==SQLITE_OK && nExtra>0 ){ |
|
0 |
0 |
while( rc==SQLITE_OK && nExtra>0 ){ |
65473
|
0 |
0 |
if( rc==SQLITE_OK ){ |
65479
|
0 |
0 |
if( isCommit ){ |
65484
|
0 |
0 |
if( isCommit ){ |
65528
|
0 |
0 |
if( pWal->readOnly ) return SQLITE_READONLY; |
65547
|
0 |
0 |
if( rc==SQLITE_OK ){ |
65559
|
0 |
0 |
if( eMode!=SQLITE_CHECKPOINT_PASSIVE ){ |
65561
|
0 |
0 |
if( rc==SQLITE_OK ){ |
65563
|
0 |
0 |
}else if( rc==SQLITE_BUSY ){ |
65573
|
0 |
0 |
if( rc==SQLITE_OK ){ |
65577
|
0 |
0 |
if( isChanged && pWal->pDbFd->pMethods->iVersion>=3 ){ |
|
0 |
0 |
if( isChanged && pWal->pDbFd->pMethods->iVersion>=3 ){ |
65583
|
0 |
0 |
if( rc==SQLITE_OK ){ |
65585
|
0 |
0 |
if( pWal->hdr.mxFrame && walPagesize(pWal)!=nBuf ){ |
|
0 |
0 |
if( pWal->hdr.mxFrame && walPagesize(pWal)!=nBuf ){ |
65592
|
0 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_BUSY ){ |
|
0 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_BUSY ){ |
65593
|
0 |
0 |
if( pnLog ) *pnLog = (int)pWal->hdr.mxFrame; |
65594
|
0 |
0 |
if( pnCkpt ) *pnCkpt = (int)(walCkptInfo(pWal)->nBackfill); |
65598
|
0 |
0 |
if( isChanged ){ |
65613
|
0 |
0 |
if( pWal->ckptLock ){ |
65621
|
0 |
0 |
return (rc==SQLITE_OK && eMode!=eMode2 ? SQLITE_BUSY : rc); |
|
0 |
0 |
return (rc==SQLITE_OK && eMode!=eMode2 ? SQLITE_BUSY : rc); |
65631
|
0 |
3828 |
if( pWal ){ |
65676
|
0 |
0 |
if( op==0 ){ |
65677
|
0 |
0 |
if( pWal->exclusiveMode!=WAL_NORMAL_MODE ){ |
65679
|
0 |
0 |
if( walLockShared(pWal, WAL_READ_LOCK(pWal->readLock))!=SQLITE_OK ){ |
65687
|
0 |
0 |
}else if( op>0 ){ |
65705
|
0 |
0 |
return (pWal && pWal->exclusiveMode==WAL_HEAPMEMORY_MODE ); |
|
0 |
0 |
return (pWal && pWal->exclusiveMode==WAL_HEAPMEMORY_MODE ); |
66648
|
26541 |
0 |
if( !p->sharable ) return; |
66650
|
0 |
0 |
if( p->locked ) return; |
66667
|
0 |
0 |
if( sqlite3_mutex_try(p->pBt->mutex)==SQLITE_OK ){ |
66678
|
0 |
0 |
for(pLater=p->pNext; pLater; pLater=pLater->pNext){ |
66682
|
0 |
0 |
if( pLater->locked ){ |
66687
|
0 |
0 |
for(pLater=p->pNext; pLater; pLater=pLater->pNext){ |
66688
|
0 |
0 |
if( pLater->wantToLock ){ |
66700
|
0 |
26524 |
if( p->sharable ){ |
66703
|
0 |
0 |
if( p->wantToLock==0 ){ |
66746
|
649 |
322 |
for(i=0; inDb; i++){ |
66748
|
323 |
326 |
if( p && p->sharable ){ |
|
0 |
323 |
if( p && p->sharable ){ |
66756
|
322 |
5788 |
if( db->noSharedCache==0 ) btreeEnterAll(db); |
66762
|
0 |
0 |
for(i=0; inDb; i++){ |
66764
|
0 |
0 |
if( p ) sqlite3BtreeLeave(p); |
66768
|
0 |
6110 |
if( db->noSharedCache==0 ) btreeLeaveAll(db); |
67171
|
2233 |
0 |
if( !p->sharable ){ |
67178
|
0 |
0 |
if( pBt->pWriter!=p && (pBt->btsFlags & BTS_EXCLUSIVE)!=0 ){ |
|
0 |
0 |
if( pBt->pWriter!=p && (pBt->btsFlags & BTS_EXCLUSIVE)!=0 ){ |
67183
|
0 |
0 |
for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){ |
67195
|
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 ){ |
67197
|
0 |
0 |
if( eLock==WRITE_LOCK ){ |
67247
|
0 |
0 |
for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){ |
67248
|
0 |
0 |
if( pIter->iTable==iTable && pIter->pBtree==p ){ |
|
0 |
0 |
if( pIter->iTable==iTable && pIter->pBtree==p ){ |
67257
|
0 |
0 |
if( !pLock ){ |
67259
|
0 |
0 |
if( !pLock ){ |
67273
|
0 |
0 |
if( eLock>pLock->eLock ){ |
67298
|
0 |
2226 |
while( *ppIter ){ |
67302
|
0 |
0 |
if( pLock->pBtree==p ){ |
67305
|
0 |
0 |
if( pLock->iTable!=1 ){ |
67314
|
1140 |
1086 |
if( pBt->pWriter==p ){ |
67317
|
0 |
1086 |
}else if( pBt->nTransaction==2 ){ |
67336
|
0 |
292 |
if( pBt->pWriter==p ){ |
67340
|
0 |
0 |
for(pLock=pBt->pLock; pLock; pLock=pLock->pNext){ |
67390
|
0 |
0 |
for(p=pBt->pCursor; p; p=p->pNext){ |
67419
|
31 |
17 |
for(p=pBtree->pBt->pCursor; p; p=p->pNext){ |
67420
|
14 |
17 |
if( (p->curFlags & BTCF_Incrblob)!=0 ){ |
67422
|
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) ){ |
67471
|
1 |
0 |
if( !pBt->pHasContent ){ |
67474
|
0 |
1 |
if( !pBt->pHasContent ){ |
67478
|
1 |
0 |
if( rc==SQLITE_OK && pgno<=sqlite3BitvecSize(pBt->pHasContent) ){ |
|
1 |
0 |
if( rc==SQLITE_OK && pgno<=sqlite3BitvecSize(pBt->pHasContent) ){ |
67493
|
0 |
1 |
return p && (pgno>sqlite3BitvecSize(p) || sqlite3BitvecTestNotNull(p, pgno)); |
|
0 |
0 |
return p && (pgno>sqlite3BitvecSize(p) || sqlite3BitvecTestNotNull(p, pgno)); |
|
0 |
0 |
return p && (pgno>sqlite3BitvecSize(p) || sqlite3BitvecTestNotNull(p, pgno)); |
67510
|
5741 |
453 |
if( pCur->iPage>=0 ){ |
67511
|
1451 |
5741 |
for(i=0; iiPage; i++){ |
67538
|
72 |
0 |
if( pCur->curIntKey ){ |
67551
|
0 |
0 |
if( pKey ){ |
67553
|
0 |
0 |
if( rc==SQLITE_OK ){ |
67581
|
0 |
54 |
if( pCur->curFlags & BTCF_Pinned ){ |
67584
|
0 |
54 |
if( pCur->eState==CURSOR_SKIPNEXT ){ |
67591
|
54 |
0 |
if( rc==SQLITE_OK ){ |
67628
|
243 |
785 |
for(p=pBt->pCursor; p; p=p->pNext){ |
67629
|
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; |
67631
|
119 |
785 |
if( p ) return saveCursorsOnList(p, iRoot, pExcept); |
67632
|
0 |
785 |
if( pExcept ) pExcept->curFlags &= ~BTCF_Multiple; |
67647
|
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) ){ |
67648
|
78 |
54 |
if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){ |
|
0 |
78 |
if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){ |
67650
|
0 |
54 |
if( SQLITE_OK!=rc ){ |
67659
|
13 |
119 |
}while( p ); |
67688
|
0 |
18 |
if( pKey ){ |
67692
|
0 |
0 |
if( pIdxKey==0 ) return SQLITE_NOMEM_BKPT; |
67694
|
0 |
0 |
if( pIdxKey->nField==0 || pIdxKey->nField>pKeyInfo->nAllField ){ |
|
0 |
0 |
if( pIdxKey->nField==0 || pIdxKey->nField>pKeyInfo->nAllField ){ |
67719
|
0 |
18 |
if( pCur->eState==CURSOR_FAULT ){ |
67723
|
0 |
18 |
if( sqlite3FaultSim(410) ){ |
67728
|
18 |
0 |
if( rc==SQLITE_OK ){ |
67732
|
18 |
0 |
if( skipNext ) pCur->skipNext = skipNext; |
67733
|
18 |
0 |
if( pCur->skipNext && pCur->eState==CURSOR_VALID ){ |
|
10 |
8 |
if( pCur->skipNext && pCur->eState==CURSOR_VALID ){ |
67794
|
0 |
0 |
rc = restoreCursorPosition(pCur); |
67795
|
0 |
0 |
if( rc ){ |
67799
|
0 |
0 |
if( pCur->eState!=CURSOR_VALID ){ |
67841
|
0 |
0 |
if( pgno<2 ) return 0; |
67845
|
0 |
0 |
if( ret==PENDING_BYTE_PAGE(pBt) ){ |
67868
|
0 |
0 |
if( *pRC ) return; |
67875
|
0 |
0 |
if( key==0 ){ |
67881
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
67885
|
0 |
0 |
if( ((char*)sqlite3PagerGetExtra(pDbPage))[0]!=0 ){ |
67893
|
0 |
0 |
if( offset<0 ){ |
67900
|
0 |
0 |
if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){ |
|
0 |
0 |
if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){ |
67903
|
0 |
0 |
if( rc==SQLITE_OK ){ |
67931
|
0 |
0 |
if( rc!=0 ){ |
67937
|
0 |
0 |
if( offset<0 ){ |
67944
|
0 |
0 |
if( pPgno ) *pPgno = get4byte(&pPtrmap[offset+1]); |
67947
|
0 |
0 |
if( *pEType<1 || *pEType>5 ) return SQLITE_CORRUPT_PGNO(iPtrmap); |
|
0 |
0 |
if( *pEType<1 || *pEType>5 ) return SQLITE_CORRUPT_PGNO(iPtrmap); |
68002
|
2 |
50 |
if( surplus <= maxLocal ){ |
68017
|
0 |
0 |
if( nPayload<=maxLocal ){ |
68024
|
0 |
0 |
return ( surplus <= maxLocal ) ? surplus : minLocal; |
68081
|
354 |
11250 |
if( nPayload>=0x80 ){ |
68086
|
44 |
354 |
}while( (*pIter)>=0x80 && pIter
|
|
44 |
0 |
}while( (*pIter)>=0x80 && pIter
|
68098
|
5365 |
6239 |
if( iKey>=0x80 ){ |
68101
|
0 |
5365 |
if( x>=0x80 ){ |
68103
|
0 |
0 |
if( x>=0x80 ){ |
68105
|
0 |
0 |
if( x>=0x80 ){ |
68107
|
0 |
0 |
if( x>=0x80 ){ |
68109
|
0 |
0 |
if( x>=0x80 ){ |
68111
|
0 |
0 |
if( x>=0x80 ){ |
68113
|
0 |
0 |
if( x>=0x80 ){ |
68130
|
11552 |
52 |
if( nPayload<=pPage->maxLocal ){ |
68135
|
2 |
11550 |
if( pInfo->nSize<4 ) pInfo->nSize = 4; |
68154
|
0 |
529 |
if( nPayload>=0x80 ){ |
68159
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter
|
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter
|
68167
|
529 |
0 |
if( nPayload<=pPage->maxLocal ){ |
68172
|
1 |
528 |
if( pInfo->nSize<4 ) pInfo->nSize = 4; |
68214
|
0 |
0 |
if( nSize>=0x80 ){ |
68219
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter
|
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter
|
68224
|
0 |
0 |
if( nSize<=pPage->maxLocal ){ |
68226
|
0 |
0 |
if( nSize<4 ) nSize = 4; |
68232
|
0 |
0 |
if( nSize>pPage->maxLocal ){ |
68257
|
0 |
0 |
while( (*pIter++)&0x80 && pIter
|
|
0 |
0 |
while( (*pIter++)&0x80 && pIter
|
68276
|
133 |
24 |
if( nSize>=0x80 ){ |
68281
|
0 |
133 |
}while( *(pIter)>=0x80 && pIter
|
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter
|
68287
|
6 |
151 |
if( (*pIter++)&0x80 |
68288
|
0 |
6 |
&& (*pIter++)&0x80 |
68289
|
0 |
0 |
&& (*pIter++)&0x80 |
68290
|
0 |
0 |
&& (*pIter++)&0x80 |
68291
|
0 |
0 |
&& (*pIter++)&0x80 |
68292
|
0 |
0 |
&& (*pIter++)&0x80 |
68293
|
0 |
0 |
&& (*pIter++)&0x80 |
68294
|
0 |
0 |
&& (*pIter++)&0x80 ){ pIter++; } |
68297
|
147 |
10 |
if( nSize<=pPage->maxLocal ){ |
68299
|
0 |
147 |
if( nSize<4 ) nSize = 4; |
68305
|
10 |
0 |
if( nSize>pPage->maxLocal ){ |
68332
|
0 |
0 |
if( *pRC ) return; |
68335
|
0 |
0 |
if( info.nLocal
|
68337
|
0 |
0 |
if( SQLITE_WITHIN(pSrc->aDataEnd, pCell, pCell+info.nLocal) ){ |
|
0 |
0 |
if( SQLITE_WITHIN(pSrc->aDataEnd, pCell, pCell+info.nLocal) ){ |
68396
|
0 |
0 |
if( (int)data[hdr+7]<=nMaxFrag ){ |
68398
|
0 |
0 |
if( iFree>usableSize-4 ) return SQLITE_CORRUPT_PAGE(pPage); |
68399
|
0 |
0 |
if( iFree ){ |
68401
|
0 |
0 |
if( iFree2>usableSize-4 ) return SQLITE_CORRUPT_PAGE(pPage); |
68402
|
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) ){ |
68408
|
0 |
0 |
if( top>=iFree ){ |
68411
|
0 |
0 |
if( iFree2 ){ |
68412
|
0 |
0 |
if( iFree+sz>iFree2 ) return SQLITE_CORRUPT_PAGE(pPage); |
68414
|
0 |
0 |
if( iFree2+sz2 > usableSize ) return SQLITE_CORRUPT_PAGE(pPage); |
68417
|
0 |
0 |
}else if( iFree+sz>usableSize ){ |
68424
|
0 |
0 |
for(pAddr=&data[cellOffset]; pAddr
|
68426
|
0 |
0 |
if( pc
|
68427
|
0 |
0 |
else if( pc
|
68437
|
0 |
0 |
for(i=0; i
|
68446
|
0 |
0 |
if( pciCellLast ){ |
|
0 |
0 |
if( pciCellLast ){ |
68452
|
0 |
0 |
if( cbrkusableSize ){ |
|
0 |
0 |
if( cbrkusableSize ){ |
68459
|
0 |
0 |
if( temp==0 ){ |
68460
|
0 |
0 |
if( cbrk==pc ) continue; |
68471
|
0 |
0 |
if( data[hdr+7]+cbrk-iCellFirst!=pPage->nFree ){ |
68508
|
58 |
36 |
while( pc<=maxPC ){ |
68514
|
32 |
26 |
if( (x = size - nByte)>=0 ){ |
68517
|
32 |
0 |
if( x<4 ){ |
68520
|
0 |
32 |
if( aData[hdr+7]>57 ) return 0; |
68528
|
0 |
0 |
}else if( x+pc > maxPC ){ |
68542
|
26 |
0 |
if( pc<=iAddr+size ){ |
68543
|
0 |
26 |
if( pc ){ |
68550
|
0 |
36 |
if( pc>maxPC+nByte-4 ){ |
68597
|
0 |
3857 |
if( gap>top ){ |
68598
|
0 |
0 |
if( top==0 && pPage->pBt->usableSize==65536 ){ |
|
0 |
0 |
if( top==0 && pPage->pBt->usableSize==65536 ){ |
68612
|
3763 |
94 |
if( (data[hdr+2] || data[hdr+1]) && gap+2<=top ){ |
|
0 |
3763 |
if( (data[hdr+2] || data[hdr+1]) && gap+2<=top ){ |
|
94 |
0 |
if( (data[hdr+2] || data[hdr+1]) && gap+2<=top ){ |
68614
|
32 |
62 |
if( pSpace ){ |
68618
|
0 |
32 |
if( g2<=gap ){ |
68623
|
0 |
62 |
}else if( rc ){ |
68632
|
0 |
3825 |
if( gap+2+nByte>top ){ |
68636
|
0 |
0 |
if( rc ) return rc; |
68692
|
289 |
2 |
if( data[iPtr+1]==0 && data[iPtr]==0 ){ |
|
289 |
0 |
if( data[iPtr+1]==0 && data[iPtr]==0 ){ |
68695
|
0 |
2 |
while( (iFreeBlk = get2byte(&data[iPtr]))
|
68696
|
0 |
0 |
if( iFreeBlk
|
68697
|
0 |
0 |
if( iFreeBlk==0 ) break; /* TH3: corrupt082.100 */ |
68702
|
0 |
2 |
if( iFreeBlk>pPage->pBt->usableSize-4 ){ /* TH3: corrupt081.100 */ |
68713
|
2 |
0 |
if( iFreeBlk && iEnd+3>=iFreeBlk ){ |
|
2 |
0 |
if( iFreeBlk && iEnd+3>=iFreeBlk ){ |
68715
|
0 |
2 |
if( iEnd>iFreeBlk ) return SQLITE_CORRUPT_PAGE(pPage); |
68717
|
0 |
2 |
if( iEnd > pPage->pBt->usableSize ){ |
68728
|
0 |
2 |
if( iPtr>hdr+1 ){ |
68730
|
0 |
0 |
if( iPtrEnd+3>=iStart ){ |
68731
|
0 |
0 |
if( iPtrEnd>iStart ) return SQLITE_CORRUPT_PAGE(pPage); |
68737
|
0 |
2 |
if( nFrag>data[hdr+7] ) return SQLITE_CORRUPT_PAGE(pPage); |
68742
|
227 |
64 |
if( iStart<=x ){ |
68746
|
0 |
227 |
if( iStart
|
68747
|
0 |
227 |
if( iPtr!=hdr+1 ) return SQLITE_CORRUPT_PAGE(pPage); |
68754
|
0 |
291 |
if( pPage->pBt->btsFlags & BTS_FAST_SECURE ){ |
68786
|
723 |
51 |
if( flagByte==(PTF_LEAFDATA | PTF_INTKEY) ){ |
68794
|
715 |
8 |
if( pPage->leaf ){ |
68805
|
51 |
0 |
}else if( flagByte==PTF_ZERODATA ){ |
68870
|
0 |
48 |
if( pc>0 ){ |
68872
|
0 |
0 |
if( pc
|
68879
|
0 |
0 |
if( pc>iCellLast ){ |
68886
|
0 |
0 |
if( next<=pc+size+3 ) break; |
68889
|
0 |
0 |
if( next>0 ){ |
68893
|
0 |
0 |
if( pc+size>(unsigned int)usableSize ){ |
68906
|
48 |
0 |
if( nFree>usableSize || nFree
|
|
0 |
48 |
if( nFree>usableSize || nFree
|
68932
|
0 |
0 |
if( !pPage->leaf ) iCellLast--; |
68933
|
0 |
0 |
for(i=0; inCell; i++){ |
68937
|
0 |
0 |
if( pciCellLast ){ |
|
0 |
0 |
if( pciCellLast ){ |
68942
|
0 |
0 |
if( pc+sz>usableSize ){ |
68974
|
0 |
109 |
if( decodeFlags(pPage, data[0]) ){ |
68987
|
0 |
109 |
if( pPage->nCell>MX_CELL(pBt) ){ |
69001
|
0 |
109 |
if( pBt->db->flags & SQLITE_CellSizeCk ){ |
69022
|
0 |
665 |
if( pBt->btsFlags & BTS_FAST_SECURE ){ |
69026
|
7 |
658 |
first = hdr + ((flags&PTF_LEAF)==0 ? 12 : 8); |
69050
|
1329 |
2203 |
if( pgno!=pPage->pgno ){ |
69055
|
285 |
1044 |
pPage->hdrOffset = pgno==1 ? 100 : 0; |
69084
|
17 |
3431 |
if( rc ) return rc; |
69098
|
0 |
0 |
if( pDbPage ){ |
69143
|
0 |
7465 |
if( pgno>btreePagecount(pBt) ){ |
69148
|
0 |
7465 |
if( rc ){ |
69152
|
101 |
7364 |
if( (*ppPage)->isInit==0 ){ |
69155
|
0 |
101 |
if( rc!=SQLITE_OK ){ |
69164
|
1686 |
5779 |
if( pCur && ((*ppPage)->nCell<1 || (*ppPage)->intKey!=pCur->curIntKey) ){ |
|
1686 |
0 |
if( pCur && ((*ppPage)->nCell<1 || (*ppPage)->intKey!=pCur->curIntKey) ){ |
|
0 |
1686 |
if( pCur && ((*ppPage)->nCell<1 || (*ppPage)->intKey!=pCur->curIntKey) ){ |
69173
|
0 |
0 |
if( pCur ){ |
69200
|
903 |
2035 |
if( pPage ) releasePageNotNull(pPage); |
69229
|
1003 |
0 |
if( rc==SQLITE_OK ){ |
69230
|
0 |
1003 |
if( sqlite3PagerPageRefcount((*ppPage)->pDbPage)>1 ){ |
69255
|
29 |
0 |
if( pPage->isInit ){ |
69258
|
1 |
28 |
if( sqlite3PagerPageRefcount(pData)>1 ){ |
69317
|
322 |
50 |
const int isTempDb = zFilename==0 || zFilename[0]==0; |
|
3 |
319 |
const int isTempDb = zFilename==0 || zFilename[0]==0; |
69325
|
115 |
207 |
const int isMemdb = (zFilename && strcmp(zFilename, ":memory:")==0) |
69326
|
53 |
112 |
|| (isTempDb && sqlite3TempInMemory(db)) |
|
53 |
0 |
|| (isTempDb && sqlite3TempInMemory(db)) |
69327
|
322 |
50 |
|| (vfsFlags & SQLITE_OPEN_MEMORY)!=0; |
|
0 |
165 |
|| (vfsFlags & SQLITE_OPEN_MEMORY)!=0; |
69341
|
207 |
165 |
if( isMemdb ){ |
69344
|
322 |
50 |
if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (isMemdb || isTempDb) ){ |
|
115 |
207 |
if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (isMemdb || isTempDb) ){ |
|
3 |
112 |
if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (isMemdb || isTempDb) ){ |
69348
|
0 |
372 |
if( !p ){ |
69363
|
319 |
53 |
if( isTempDb==0 && (isMemdb==0 || (vfsFlags&SQLITE_OPEN_URI)!=0) ){ |
|
207 |
112 |
if( isTempDb==0 && (isMemdb==0 || (vfsFlags&SQLITE_OPEN_URI)!=0) ){ |
|
0 |
207 |
if( isTempDb==0 && (isMemdb==0 || (vfsFlags&SQLITE_OPEN_URI)!=0) ){ |
69364
|
0 |
112 |
if( vfsFlags & SQLITE_OPEN_SHAREDCACHE ){ |
69371
|
0 |
0 |
if( !zFullPathname ){ |
69375
|
0 |
0 |
if( isMemdb ){ |
69380
|
0 |
0 |
if( rc ){ |
69381
|
0 |
0 |
if( rc==SQLITE_OK_SYMLINK ){ |
69396
|
0 |
0 |
for(pBt=GLOBAL(BtShared*,sqlite3SharedCacheList); pBt; pBt=pBt->pNext){ |
69398
|
0 |
0 |
if( 0==strcmp(zFullPathname, sqlite3PagerFilename(pBt->pPager, 0)) |
69399
|
0 |
0 |
&& sqlite3PagerVfs(pBt->pPager)==pVfs ){ |
69401
|
0 |
0 |
for(iDb=db->nDb-1; iDb>=0; iDb--){ |
69403
|
0 |
0 |
if( pExisting && pExisting->pBt==pBt ){ |
|
0 |
0 |
if( pExisting && pExisting->pBt==pBt ){ |
69431
|
372 |
0 |
if( pBt==0 ){ |
69444
|
0 |
372 |
if( pBt==0 ){ |
69450
|
366 |
6 |
if( rc==SQLITE_OK ){ |
69454
|
6 |
366 |
if( rc!=SQLITE_OK ){ |
69464
|
5 |
361 |
if( sqlite3PagerIsreadonly(pBt->pPager) ) pBt->btsFlags |= BTS_READ_ONLY; |
69474
|
27 |
339 |
if( pBt->pageSize<512 || pBt->pageSize>SQLITE_MAX_PAGE_SIZE |
|
27 |
0 |
if( pBt->pageSize<512 || pBt->pageSize>SQLITE_MAX_PAGE_SIZE |
69475
|
0 |
27 |
|| ((pBt->pageSize-1)&pBt->pageSize)!=0 ){ |
69484
|
289 |
50 |
if( zFilename && !isMemdb ){ |
|
82 |
207 |
if( zFilename && !isMemdb ){ |
69502
|
0 |
366 |
if( rc ) goto btree_open_out; |
69510
|
0 |
366 |
if( p->sharable ){ |
69513
|
0 |
0 |
if( SQLITE_THREADSAFE && sqlite3GlobalConfig.bCoreMutex ){ |
69515
|
0 |
0 |
if( pBt->mutex==0 ){ |
69533
|
0 |
366 |
if( p->sharable ){ |
69536
|
0 |
0 |
for(i=0; inDb; i++){ |
69537
|
0 |
0 |
if( (pSib = db->aDb[i].pBt)!=0 && pSib->sharable ){ |
|
0 |
0 |
if( (pSib = db->aDb[i].pBt)!=0 && pSib->sharable ){ |
69538
|
0 |
0 |
while( pSib->pPrev ){ pSib = pSib->pPrev; } |
69539
|
0 |
0 |
if( (uptr)p->pBt<(uptr)pSib->pBt ){ |
69544
|
0 |
0 |
while( pSib->pNext && (uptr)pSib->pNext->pBt<(uptr)p->pBt ){ |
|
0 |
0 |
while( pSib->pNext && (uptr)pSib->pNext->pBt<(uptr)p->pBt ){ |
69549
|
0 |
0 |
if( p->pNext ){ |
69562
|
6 |
366 |
if( rc!=SQLITE_OK ){ |
69563
|
6 |
0 |
if( pBt && pBt->pPager ){ |
|
0 |
6 |
if( pBt && pBt->pPager ){ |
69576
|
366 |
0 |
if( sqlite3BtreeSchema(p, 0, 0)==0 ){ |
69581
|
106 |
260 |
if( pFile->pMethods ){ |
69585
|
0 |
372 |
if( mutexOpen ){ |
69609
|
0 |
0 |
if( pBt->nRef<=0 ){ |
69610
|
0 |
0 |
if( GLOBAL(BtShared*,sqlite3SharedCacheList)==pBt ){ |
69614
|
0 |
0 |
while( ALWAYS(pList) && pList->pNext!=pBt ){ |
|
0 |
0 |
while( ALWAYS(pList) && pList->pNext!=pBt ){ |
69617
|
0 |
0 |
if( ALWAYS(pList) ){ |
69645
|
0 |
210 |
if( pBt->pTmpSpace==0 ){ |
69676
|
208 |
160 |
if( pBt->pTmpSpace ){ |
69718
|
0 |
364 |
if( !p->sharable || removeFromSharingList(pBt) ){ |
|
0 |
0 |
if( !p->sharable || removeFromSharingList(pBt) ){ |
69726
|
314 |
50 |
if( pBt->xFreeSchema && pBt->pSchema ){ |
|
314 |
0 |
if( pBt->xFreeSchema && pBt->pSchema ){ |
69737
|
0 |
364 |
if( p->pPrev ) p->pPrev->pNext = p->pNext; |
69738
|
0 |
364 |
if( p->pNext ) p->pNext->pPrev = p->pPrev; |
69846
|
0 |
41 |
if( nReserve
|
69847
|
4 |
37 |
if( pBt->btsFlags & BTS_PAGESIZE_FIXED ){ |
69852
|
4 |
33 |
if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE && |
|
4 |
0 |
if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE && |
|
4 |
0 |
if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE && |
69856
|
0 |
4 |
if( nReserve>32 && pageSize==512 ) pageSize = 1024; |
|
0 |
0 |
if( nReserve>32 && pageSize==512 ) pageSize = 1024; |
69862
|
0 |
37 |
if( iFix ) pBt->btsFlags |= BTS_PAGESIZE_FIXED; |
69944
|
0 |
10 |
if( p==0 ) return 0; |
69948
|
5 |
5 |
if( newFlag>=0 ){ |
69972
|
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 ){ |
69994
|
0 |
0 |
(!p->pBt->autoVacuum)?BTREE_AUTOVACUUM_NONE: |
69995
|
0 |
0 |
(!p->pBt->incrVacuum)?BTREE_AUTOVACUUM_FULL: |
70052
|
2 |
2378 |
if( rc!=SQLITE_OK ) return rc; |
70054
|
0 |
2378 |
if( rc!=SQLITE_OK ) return rc; |
70061
|
1975 |
403 |
if( nPage==0 || memcmp(24+(u8*)pPage1->aData, 92+(u8*)pPage1->aData,4)!=0 ){ |
|
0 |
1975 |
if( nPage==0 || memcmp(24+(u8*)pPage1->aData, 92+(u8*)pPage1->aData,4)!=0 ){ |
70064
|
0 |
2378 |
if( (pBt->db->flags & SQLITE_ResetDatabase)!=0 ){ |
70067
|
1975 |
403 |
if( nPage>0 ){ |
70075
|
0 |
1975 |
if( memcmp(page1, zMagicHeader, 16)!=0 ){ |
70087
|
0 |
1975 |
if( page1[18]>2 ){ |
70090
|
0 |
1975 |
if( page1[19]>2 ){ |
70102
|
0 |
1975 |
if( page1[19]==2 && (pBt->btsFlags & BTS_NO_WAL)==0 ){ |
|
0 |
0 |
if( page1[19]==2 && (pBt->btsFlags & BTS_NO_WAL)==0 ){ |
70105
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70109
|
0 |
0 |
if( isOpen==0 ){ |
70126
|
0 |
1975 |
if( memcmp(&page1[21], "\100\040\040",3)!=0 ){ |
70135
|
1975 |
0 |
if( ((pageSize-1)&pageSize)!=0 |
70136
|
1975 |
0 |
|| pageSize>SQLITE_MAX_PAGE_SIZE |
70137
|
1975 |
0 |
|| pageSize<=256 |
70151
|
0 |
1975 |
if( (u32)pageSize!=pBt->pageSize ){ |
70166
|
0 |
1975 |
if( nPage>nPageFile ){ |
70167
|
0 |
0 |
if( sqlite3WritableSchema(pBt->db)==0 ){ |
70177
|
0 |
1975 |
if( usableSize<480 ){ |
70205
|
2378 |
0 |
if( pBt->maxLocal>127 ){ |
70256
|
3091 |
6044 |
if( pBt->inTransaction==TRANS_NONE && pBt->pPage1!=0 ){ |
|
2378 |
713 |
if( pBt->inTransaction==TRANS_NONE && pBt->pPage1!=0 ){ |
70276
|
995 |
200 |
if( pBt->nPage>0 ){ |
70283
|
0 |
200 |
if( rc ) return rc; |
70370
|
2710 |
3092 |
if( p->inTrans==TRANS_WRITE || (p->inTrans==TRANS_READ && !wrflag) ){ |
|
475 |
2235 |
if( p->inTrans==TRANS_WRITE || (p->inTrans==TRANS_READ && !wrflag) ){ |
|
0 |
475 |
if( p->inTrans==TRANS_WRITE || (p->inTrans==TRANS_READ && !wrflag) ){ |
70375
|
0 |
2235 |
if( (p->db->flags & SQLITE_ResetDatabase) |
70376
|
0 |
0 |
&& sqlite3PagerIsreadonly(pPager)==0 |
70382
|
4 |
2231 |
if( (pBt->btsFlags & BTS_READ_ONLY)!=0 && wrflag ){ |
|
2 |
2 |
if( (pBt->btsFlags & BTS_READ_ONLY)!=0 && wrflag ){ |
70394
|
1147 |
1086 |
if( (wrflag && pBt->inTransaction==TRANS_WRITE) |
|
1147 |
0 |
if( (wrflag && pBt->inTransaction==TRANS_WRITE) |
70395
|
0 |
2233 |
|| (pBt->btsFlags & BTS_PENDING)!=0 |
70398
|
14 |
2219 |
}else if( wrflag>1 ){ |
70400
|
0 |
14 |
for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){ |
70401
|
0 |
0 |
if( pIter->pBtree!=p ){ |
70407
|
0 |
2233 |
if( pBlock ){ |
70419
|
0 |
2233 |
if( SQLITE_OK!=rc ) goto trans_begun; |
70422
|
437 |
1796 |
if( pBt->nPage==0 ) pBt->btsFlags |= BTS_INITIALLY_EMPTY; |
70443
|
2380 |
2378 |
while( pBt->pPage1==0 && SQLITE_OK==(rc = lockBtree(pBt)) ); |
|
2378 |
2 |
while( pBt->pPage1==0 && SQLITE_OK==(rc = lockBtree(pBt)) ); |
70445
|
2378 |
2 |
if( rc==SQLITE_OK && wrflag ){ |
|
1292 |
1086 |
if( rc==SQLITE_OK && wrflag ){ |
70446
|
0 |
1292 |
if( (pBt->btsFlags & BTS_READ_ONLY)!=0 ){ |
70450
|
1140 |
152 |
if( rc==SQLITE_OK ){ |
70452
|
0 |
152 |
}else if( rc==SQLITE_BUSY_SNAPSHOT && pBt->inTransaction==TRANS_NONE ){ |
|
0 |
0 |
}else if( rc==SQLITE_BUSY_SNAPSHOT && pBt->inTransaction==TRANS_NONE ){ |
70461
|
154 |
2226 |
if( rc!=SQLITE_OK ){ |
70466
|
154 |
2226 |
btreeInvokeBusyHandler(pBt) ); |
70472
|
2226 |
7 |
if( rc==SQLITE_OK ){ |
70473
|
2226 |
0 |
if( p->inTrans==TRANS_NONE ){ |
70476
|
0 |
2226 |
if( p->sharable ){ |
70484
|
1140 |
1086 |
p->inTrans = (wrflag?TRANS_WRITE:TRANS_READ); |
70485
|
2226 |
0 |
if( p->inTrans>pBt->inTransaction ){ |
70488
|
1140 |
1086 |
if( wrflag ){ |
70494
|
14 |
1126 |
if( wrflag>1 ) pBt->btsFlags |= BTS_EXCLUSIVE; |
70503
|
0 |
1140 |
if( pBt->nPage!=get4byte(&pPage1->aData[28]) ){ |
70505
|
0 |
0 |
if( rc==SQLITE_OK ){ |
70513
|
5793 |
9 |
if( rc==SQLITE_OK ){ |
70514
|
5561 |
232 |
if( pSchemaVersion ){ |
70517
|
3760 |
2033 |
if( wrflag ){ |
70546
|
0 |
0 |
rc = pPage->isInit ? SQLITE_OK : btreeInitPage(pPage); |
70547
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
70550
|
0 |
0 |
for(i=0; i
|
70555
|
0 |
0 |
if( !pPage->leaf ){ |
70561
|
0 |
0 |
if( !pPage->leaf ){ |
70586
|
0 |
0 |
if( eType==PTRMAP_OVERFLOW2 ){ |
70588
|
0 |
0 |
if( get4byte(pPage->aData)!=iFrom ){ |
70597
|
0 |
0 |
rc = pPage->isInit ? SQLITE_OK : btreeInitPage(pPage); |
70598
|
0 |
0 |
if( rc ) return rc; |
70601
|
0 |
0 |
for(i=0; i
|
70603
|
0 |
0 |
if( eType==PTRMAP_OVERFLOW1 ){ |
70606
|
0 |
0 |
if( info.nLocal
|
70607
|
0 |
0 |
if( pCell+info.nSize > pPage->aData+pPage->pBt->usableSize ){ |
70610
|
0 |
0 |
if( iFrom==get4byte(pCell+info.nSize-4) ){ |
70616
|
0 |
0 |
if( get4byte(pCell)==iFrom ){ |
70623
|
0 |
0 |
if( i==nCell ){ |
70661
|
0 |
0 |
if( iDbPage<3 ) return SQLITE_CORRUPT_BKPT; |
70667
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70680
|
0 |
0 |
if( eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE ){ |
|
0 |
0 |
if( eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE ){ |
70682
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70687
|
0 |
0 |
if( nextOvfl!=0 ){ |
70689
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70699
|
0 |
0 |
if( eType!=PTRMAP_ROOTPAGE ){ |
70701
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70705
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70711
|
0 |
0 |
if( rc==SQLITE_OK ){ |
70745
|
0 |
0 |
if( !PTRMAP_ISPAGE(pBt, iLastPg) && iLastPg!=PENDING_BYTE_PAGE(pBt) ){ |
|
0 |
0 |
if( !PTRMAP_ISPAGE(pBt, iLastPg) && iLastPg!=PENDING_BYTE_PAGE(pBt) ){ |
70750
|
0 |
0 |
if( nFreeList==0 ){ |
70755
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70758
|
0 |
0 |
if( eType==PTRMAP_ROOTPAGE ){ |
70762
|
0 |
0 |
if( eType==PTRMAP_FREEPAGE ){ |
70763
|
0 |
0 |
if( bCommit==0 ){ |
70772
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70785
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70796
|
0 |
0 |
if( bCommit==0 ){ |
70804
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70809
|
0 |
0 |
if( iFreePg>dbSize ){ |
70813
|
0 |
0 |
}while( bCommit && iFreePg>nFin ); |
|
0 |
0 |
}while( bCommit && iFreePg>nFin ); |
70818
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
70824
|
0 |
0 |
if( bCommit==0 ){ |
70827
|
0 |
0 |
}while( iLastPg==PENDING_BYTE_PAGE(pBt) || PTRMAP_ISPAGE(pBt, iLastPg) ); |
|
0 |
0 |
}while( iLastPg==PENDING_BYTE_PAGE(pBt) || PTRMAP_ISPAGE(pBt, iLastPg) ); |
70847
|
0 |
0 |
if( nOrig>PENDING_BYTE_PAGE(pBt) && nFin
|
|
0 |
0 |
if( nOrig>PENDING_BYTE_PAGE(pBt) && nFin
|
70850
|
0 |
0 |
while( PTRMAP_ISPAGE(pBt, nFin) || nFin==PENDING_BYTE_PAGE(pBt) ){ |
|
0 |
0 |
while( PTRMAP_ISPAGE(pBt, nFin) || nFin==PENDING_BYTE_PAGE(pBt) ){ |
70871
|
0 |
0 |
if( !pBt->autoVacuum ){ |
70878
|
0 |
0 |
if( nOrig=nOrig ){ |
|
0 |
0 |
if( nOrig=nOrig ){ |
70880
|
0 |
0 |
}else if( nFree>0 ){ |
70882
|
0 |
0 |
if( rc==SQLITE_OK ){ |
70886
|
0 |
0 |
if( rc==SQLITE_OK ){ |
70917
|
0 |
0 |
if( !pBt->incrVacuum ){ |
70925
|
0 |
0 |
if( PTRMAP_ISPAGE(pBt, nOrig) || nOrig==PENDING_BYTE_PAGE(pBt) ){ |
|
0 |
0 |
if( PTRMAP_ISPAGE(pBt, nOrig) || nOrig==PENDING_BYTE_PAGE(pBt) ){ |
70935
|
0 |
0 |
if( db->xAutovacPages ){ |
70937
|
0 |
0 |
for(iDb=0; ALWAYS(iDbnDb); iDb++){ |
70938
|
0 |
0 |
if( db->aDb[iDb].pBt==p ) break; |
70947
|
0 |
0 |
if( nVac>nFree ){ |
70950
|
0 |
0 |
if( nVac==0 ){ |
70957
|
0 |
0 |
if( nFin>nOrig ) return SQLITE_CORRUPT_BKPT; |
70958
|
0 |
0 |
if( nFin
|
70961
|
0 |
0 |
for(iFree=nOrig; iFree>nFin && rc==SQLITE_OK; iFree--){ |
|
0 |
0 |
for(iFree=nOrig; iFree>nFin && rc==SQLITE_OK; iFree--){ |
70964
|
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 ){ |
70966
|
0 |
0 |
if( nVac==nFree ){ |
70974
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
71015
|
1071 |
1977 |
if( p->inTrans==TRANS_WRITE ){ |
71019
|
0 |
1071 |
if( pBt->autoVacuum ){ |
71021
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
71026
|
0 |
1071 |
if( pBt->bDoTruncate ){ |
71048
|
2518 |
711 |
if( p->inTrans>TRANS_NONE && db->nVdbeRead>1 ){ |
|
292 |
2226 |
if( p->inTrans>TRANS_NONE && db->nVdbeRead>1 ){ |
71059
|
2226 |
711 |
if( p->inTrans!=TRANS_NONE ){ |
71062
|
2226 |
0 |
if( 0==pBt->nTransaction ){ |
71104
|
601 |
2455 |
if( p->inTrans==TRANS_NONE ) return SQLITE_OK; |
71111
|
1079 |
1376 |
if( p->inTrans==TRANS_WRITE ){ |
71117
|
0 |
1079 |
if( rc!=SQLITE_OK && bCleanup==0 ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && bCleanup==0 ){ |
71138
|
207 |
0 |
if( rc==SQLITE_OK ){ |
71176
|
29 |
1 |
if( pBtree ){ |
71178
|
0 |
29 |
for(p=pBtree->pBt->pCursor; p; p=p->pNext){ |
71179
|
0 |
0 |
if( writeOnly && (p->curFlags & BTCF_WriteFlag)==0 ){ |
|
0 |
0 |
if( writeOnly && (p->curFlags & BTCF_WriteFlag)==0 ){ |
71180
|
0 |
0 |
if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){ |
|
0 |
0 |
if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){ |
71182
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
71206
|
5 |
94 |
if( nPage==0 ) sqlite3PagerPagecount(pBt->pPager, &nPage); |
71230
|
746 |
28 |
if( tripCode==SQLITE_OK ){ |
71232
|
0 |
746 |
if( rc ) writeOnly = 0; |
71236
|
28 |
746 |
if( tripCode ){ |
71239
|
0 |
28 |
if( rc2!=SQLITE_OK ) rc = rc2; |
71243
|
61 |
713 |
if( p->inTrans==TRANS_WRITE ){ |
71248
|
0 |
61 |
if( rc2!=SQLITE_OK ){ |
71255
|
44 |
17 |
if( btreeGetPage(pBt, 1, &pPage1, 0)==SQLITE_OK ){ |
71320
|
57 |
3 |
if( p && p->inTrans==TRANS_WRITE ){ |
|
55 |
2 |
if( p && p->inTrans==TRANS_WRITE ){ |
71325
|
1 |
54 |
if( op==SAVEPOINT_ROLLBACK ){ |
71328
|
55 |
0 |
if( rc==SQLITE_OK ){ |
71331
|
55 |
0 |
if( rc==SQLITE_OK ){ |
71332
|
0 |
55 |
if( iSavepoint<0 && (pBt->btsFlags & BTS_INITIALLY_EMPTY)!=0 ){ |
|
0 |
0 |
if( iSavepoint<0 && (pBt->btsFlags & BTS_INITIALLY_EMPTY)!=0 ){ |
71419
|
1200 |
4844 |
if( iTable<=1 ){ |
71420
|
0 |
1200 |
if( iTable<1 ){ |
71422
|
200 |
1000 |
}else if( btreePagecount(pBt)==0 ){ |
71438
|
802 |
6044 |
for(pX=pBt->pCursor; pX; pX=pX->pNext){ |
71439
|
495 |
307 |
if( pX->pgnoRoot==iTable ){ |
71447
|
4155 |
1889 |
if( wrFlag ){ |
71450
|
210 |
3945 |
if( pBt->pTmpSpace==0 ) return allocateTempSpace(pBt); |
71476
|
0 |
6044 |
if( p->sharable ){ |
71513
|
6044 |
0 |
if( pBtree ){ |
71517
|
5738 |
306 |
if( pBt->pCursor==pCur ){ |
71522
|
306 |
6 |
if( pPrev->pNext==pCur ){ |
71527
|
6 |
0 |
}while( ALWAYS(pPrev) ); |
71533
|
17 |
6027 |
if( (pBt->openFlags & BTREE_SINGLE) && pBt->pCursor==0 ){ |
|
17 |
0 |
if( (pBt->openFlags & BTREE_SINGLE) && pBt->pCursor==0 ){ |
71573
|
11603 |
1365 |
if( pCur->info.nSize==0 ){ |
71710
|
0 |
0 |
if( pBt->autoVacuum ){ |
71715
|
0 |
0 |
while( PTRMAP_ISPAGE(pBt, iGuess) || iGuess==PENDING_BYTE_PAGE(pBt) ){ |
|
0 |
0 |
while( PTRMAP_ISPAGE(pBt, iGuess) || iGuess==PENDING_BYTE_PAGE(pBt) ){ |
71719
|
0 |
0 |
if( iGuess<=btreePagecount(pBt) ){ |
71721
|
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 ){ |
71730
|
0 |
0 |
if( rc==SQLITE_OK ){ |
71731
|
0 |
0 |
rc = btreeGetPage(pBt, ovfl, &pPage, (ppPage==0) ? PAGER_GET_READONLY : 0); |
71733
|
0 |
0 |
if( rc==SQLITE_OK ){ |
71739
|
0 |
0 |
if( ppPage ){ |
71744
|
0 |
0 |
return (rc==SQLITE_DONE ? SQLITE_OK : rc); |
71765
|
0 |
655 |
if( eOp ){ |
71768
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
71827
|
0 |
87 |
if( pCur->ix>=pPage->nCell ){ |
71837
|
0 |
87 |
if( (uptr)(aPayload - pPage->aData) > (pBt->usableSize - pCur->info.nLocal) ){ |
71847
|
87 |
0 |
if( offsetinfo.nLocal ){ |
71849
|
19 |
68 |
if( a+offset>pCur->info.nLocal ){ |
71861
|
87 |
0 |
if( rc==SQLITE_OK && amt>0 ){ |
|
19 |
68 |
if( rc==SQLITE_OK && amt>0 ){ |
71874
|
19 |
0 |
if( (pCur->curFlags & BTCF_ValidOvfl)==0 ){ |
71876
|
7 |
12 |
if( pCur->aOverflow==0 |
71877
|
0 |
7 |
|| nOvfl*(int)sizeof(Pgno) > sqlite3MallocSize(pCur->aOverflow) |
71882
|
0 |
12 |
if( aNew==0 ){ |
71895
|
0 |
0 |
if( pCur->aOverflow[offset/ovflSize] ){ |
71903
|
568 |
0 |
while( nextPage ){ |
71905
|
0 |
568 |
if( nextPage > pBt->nPage ) return SQLITE_CORRUPT_BKPT; |
71911
|
0 |
568 |
if( offset>=ovflSize ){ |
71920
|
0 |
0 |
if( pCur->aOverflow[iIdx+1] ){ |
71931
|
549 |
19 |
if( a + offset > ovflSize ){ |
71968
|
568 |
0 |
rc = sqlite3PagerGet(pBt->pPager, nextPage, &pDbPage, |
71971
|
568 |
0 |
if( rc==SQLITE_OK ){ |
71980
|
19 |
549 |
if( amt==0 ) return rc; |
71983
|
0 |
549 |
if( rc ) break; |
71988
|
68 |
0 |
if( rc==SQLITE_OK && amt>0 ){ |
|
0 |
68 |
if( rc==SQLITE_OK && amt>0 ){ |
72032
|
0 |
0 |
if ( pCur->eState==CURSOR_INVALID ){ |
72037
|
0 |
0 |
return rc ? rc : accessPayload(pCur, offset, amt, pBuf, 0); |
72040
|
72 |
0 |
if( pCur->eState==CURSOR_VALID ){ |
72082
|
0 |
9286 |
if( amt>(int)(pCur->pPage->aDataEnd - pCur->info.pPayload) ){ |
72128
|
0 |
1686 |
if( pCur->iPage>=(BTCURSOR_MAX_DEPTH-1) ){ |
72222
|
825 |
5941 |
if( pCur->iPage>=0 ){ |
72223
|
85 |
740 |
if( pCur->iPage ){ |
72225
|
0 |
85 |
while( --pCur->iPage ){ |
72231
|
200 |
5741 |
}else if( pCur->pgnoRoot==0 ){ |
72236
|
0 |
5741 |
if( pCur->eState>=CURSOR_REQUIRESEEK ){ |
72237
|
0 |
0 |
if( pCur->eState==CURSOR_FAULT ){ |
72245
|
0 |
5741 |
if( rc!=SQLITE_OK ){ |
72266
|
6481 |
0 |
if( pRoot->isInit==0 || (pCur->pKeyInfo==0)!=pRoot->intKey ){ |
|
0 |
6481 |
if( pRoot->isInit==0 || (pCur->pKeyInfo==0)!=pRoot->intKey ){ |
72275
|
5682 |
884 |
if( pRoot->nCell>0 ){ |
72277
|
0 |
884 |
}else if( !pRoot->leaf ){ |
72279
|
0 |
0 |
if( pRoot->pgno!=1 ) return SQLITE_CORRUPT_BKPT; |
72304
|
965 |
0 |
while( rc==SQLITE_OK && !(pPage = pCur->pPage)->leaf ){ |
|
12 |
953 |
while( rc==SQLITE_OK && !(pPage = pCur->pPage)->leaf ){ |
72329
|
1437 |
2856 |
while( !(pPage = pCur->pPage)->leaf ){ |
72333
|
0 |
1437 |
if( rc ) return rc; |
72351
|
939 |
277 |
if( rc==SQLITE_OK ){ |
72355
|
277 |
0 |
}else if( rc==SQLITE_EMPTY ){ |
72374
|
2 |
3225 |
if( CURSOR_VALID==pCur->eState && (pCur->curFlags & BTCF_AtLast)!=0 ){ |
|
1 |
1 |
if( CURSOR_VALID==pCur->eState && (pCur->curFlags & BTCF_AtLast)!=0 ){ |
72392
|
2856 |
370 |
if( rc==SQLITE_OK ){ |
72396
|
2856 |
0 |
if( rc==SQLITE_OK ){ |
72401
|
370 |
0 |
}else if( rc==SQLITE_EMPTY ){ |
72448
|
3254 |
1604 |
if( pCur->eState==CURSOR_VALID && (pCur->curFlags & BTCF_ValidNKey)!=0 ){ |
|
3248 |
6 |
if( pCur->eState==CURSOR_VALID && (pCur->curFlags & BTCF_ValidNKey)!=0 ){ |
72449
|
0 |
3248 |
if( pCur->info.nKey==intKey ){ |
72453
|
2899 |
349 |
if( pCur->info.nKey
|
72454
|
2850 |
49 |
if( (pCur->curFlags & BTCF_AtLast)!=0 ){ |
72462
|
2 |
47 |
if( pCur->info.nKey+1==intKey ){ |
72465
|
2 |
0 |
if( rc==SQLITE_OK ){ |
72467
|
2 |
0 |
if( pCur->info.nKey==intKey ){ |
72470
|
0 |
0 |
}else if( rc!=SQLITE_DONE ){ |
72482
|
381 |
1625 |
if( rc ){ |
72483
|
381 |
0 |
if( rc==SQLITE_EMPTY ){ |
72518
|
3986 |
968 |
if( pPage->intKeyLeaf ){ |
72519
|
387 |
3986 |
while( 0x80 <= *(pCell++) ){ |
72520
|
0 |
387 |
if( pCell>=pPage->aDataEnd ){ |
72526
|
3338 |
1616 |
if( nCellKey
|
72528
|
469 |
2869 |
if( lwr>upr ){ c = -1; break; } |
72529
|
232 |
1384 |
}else if( nCellKey>intKey ){ |
72531
|
3 |
229 |
if( lwr>upr ){ c = +1; break; } |
72535
|
66 |
1318 |
if( !pPage->leaf ){ |
72551
|
307 |
165 |
if( pPage->leaf ){ |
72559
|
165 |
66 |
if( lwr>=pPage->nCell ){ |
72566
|
0 |
231 |
if( rc ) break; |
72602
|
4 |
0 |
if( nCell<=pPage->max1bytePayload ){ |
72608
|
0 |
0 |
}else if( !(pCell[1] & 0x80) |
72609
|
0 |
0 |
&& (nCell = ((nCell&0x7f)<<7) + pCell[1])<=pPage->maxLocal |
72630
|
0 |
12 |
for(i=0; iiPage; i++){ |
72632
|
0 |
0 |
if( pCur->aiIdx[i]nCell ) return 0; |
72699
|
12 |
271 |
if( pCur->eState==CURSOR_VALID |
72700
|
12 |
0 |
&& pCur->pPage->leaf |
72701
|
12 |
0 |
&& cursorOnLastPage(pCur) |
72704
|
4 |
8 |
if( pCur->ix==pCur->pPage->nCell-1 |
72705
|
0 |
4 |
&& (c = indexCellCompare(pCur, pCur->ix, pIdxKey, xRecordCompare))<=0 |
72706
|
0 |
0 |
&& pIdxKey->errCode==SQLITE_OK |
72711
|
0 |
12 |
if( pCur->iPage>0 |
72712
|
0 |
0 |
&& indexCellCompare(pCur, 0, pIdxKey, xRecordCompare)<=0 |
72713
|
0 |
0 |
&& pIdxKey->errCode==SQLITE_OK |
72716
|
0 |
0 |
if( !pCur->pPage->isInit ){ |
72725
|
40 |
243 |
if( rc ){ |
72726
|
40 |
0 |
if( rc==SQLITE_EMPTY ){ |
72771
|
553 |
0 |
if( nCell<=pPage->max1bytePayload ){ |
72777
|
0 |
0 |
}else if( !(pCell[1] & 0x80) |
72778
|
0 |
0 |
&& (nCell = ((nCell&0x7f)<<7) + pCell[1])<=pPage->maxLocal |
72803
|
0 |
0 |
if( nCell<2 || nCell/pCur->pBt->usableSize>pCur->pBt->nPage ){ |
|
0 |
0 |
if( nCell<2 || nCell/pCur->pBt->usableSize>pCur->pBt->nPage ){ |
72808
|
0 |
0 |
if( pCellKey==0 ){ |
72816
|
0 |
0 |
if( rc ){ |
72827
|
517 |
36 |
if( c<0 ){ |
72829
|
33 |
3 |
}else if( c>0 ){ |
72836
|
0 |
3 |
if( pIdxKey->errCode ) rc = SQLITE_CORRUPT_BKPT; |
72839
|
240 |
310 |
if( lwr>upr ) break; |
72845
|
240 |
0 |
if( pPage->leaf ){ |
72852
|
0 |
0 |
if( lwr>=pPage->nCell ){ |
72859
|
0 |
0 |
if( rc ) break; |
72898
|
0 |
0 |
if( NEVER(pCur->eState!=CURSOR_VALID) ) return -1; |
72899
|
0 |
0 |
if( NEVER(pCur->pPage->leaf==0) ) return -1; |
72902
|
0 |
0 |
for(i=0; iiPage; i++){ |
72934
|
18 |
743 |
if( pCur->eState!=CURSOR_VALID ){ |
72936
|
18 |
0 |
rc = restoreCursorPosition(pCur); |
72937
|
0 |
18 |
if( rc!=SQLITE_OK ){ |
72940
|
8 |
10 |
if( CURSOR_INVALID==pCur->eState ){ |
72943
|
10 |
0 |
if( pCur->eState==CURSOR_SKIPNEXT ){ |
72945
|
3 |
7 |
if( pCur->skipNext>0 ) return SQLITE_OK; |
72951
|
750 |
0 |
if( !pPage->isInit || sqlite3FaultSim(412) ){ |
|
0 |
750 |
if( !pPage->isInit || sqlite3FaultSim(412) ){ |
72962
|
749 |
1 |
if( idx>=pPage->nCell ){ |
72963
|
6 |
743 |
if( !pPage->leaf ){ |
72965
|
0 |
6 |
if( rc ) return rc; |
72969
|
729 |
18 |
if( pCur->iPage==0 ){ |
72975
|
4 |
14 |
}while( pCur->ix>=pPage->nCell ); |
72976
|
14 |
0 |
if( pPage->intKey ){ |
72982
|
1 |
0 |
if( pPage->leaf ){ |
72995
|
18 |
6994 |
if( pCur->eState!=CURSOR_VALID ) return btreeNext(pCur); |
72997
|
743 |
6251 |
if( (++pCur->ix)>=pPage->nCell ){ |
73001
|
6243 |
8 |
if( pPage->leaf ){ |
73035
|
0 |
113 |
if( pCur->eState!=CURSOR_VALID ){ |
73036
|
0 |
0 |
rc = restoreCursorPosition(pCur); |
73037
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
73040
|
0 |
0 |
if( CURSOR_INVALID==pCur->eState ){ |
73043
|
0 |
0 |
if( CURSOR_SKIPNEXT==pCur->eState ){ |
73045
|
0 |
0 |
if( pCur->skipNext<0 ) return SQLITE_OK; |
73051
|
0 |
113 |
if( !pPage->leaf ){ |
73054
|
0 |
0 |
if( rc ) return rc; |
73057
|
113 |
0 |
while( pCur->ix==0 ){ |
73058
|
113 |
0 |
if( pCur->iPage==0 ){ |
73069
|
0 |
0 |
if( pPage->intKey && !pPage->leaf ){ |
|
0 |
0 |
if( pPage->intKey && !pPage->leaf ){ |
73083
|
424 |
0 |
if( pCur->eState!=CURSOR_VALID |
73084
|
311 |
113 |
|| pCur->ix==0 |
73085
|
0 |
311 |
|| pCur->pPage->leaf==0 |
73138
|
0 |
1002 |
if( n>=mxPage ){ |
73141
|
2 |
1000 |
if( n>0 ){ |
73152
|
0 |
2 |
if( eMode==BTALLOC_EXACT ){ |
73153
|
0 |
0 |
if( nearby<=mxPage ){ |
73158
|
0 |
0 |
if( rc ) return rc; |
73159
|
0 |
0 |
if( eType==PTRMAP_FREEPAGE ){ |
73163
|
0 |
2 |
}else if( eMode==BTALLOC_LE ){ |
73172
|
0 |
2 |
if( rc ) return rc; |
73182
|
0 |
2 |
if( pPrevTrunk ){ |
73194
|
2 |
0 |
if( iTrunk>mxPage || nSearch++ > n ){ |
|
0 |
2 |
if( iTrunk>mxPage || nSearch++ > n ){ |
73199
|
0 |
2 |
if( rc ){ |
73208
|
1 |
1 |
if( k==0 && !searchList ){ |
|
1 |
0 |
if( k==0 && !searchList ){ |
73214
|
0 |
1 |
if( rc ){ |
73222
|
0 |
1 |
}else if( k>(u32)(pBt->usableSize/4 - 2) ){ |
73227
|
0 |
1 |
}else if( searchList |
73228
|
0 |
0 |
&& (nearby==iTrunk || (iTrunk
|
|
0 |
0 |
&& (nearby==iTrunk || (iTrunk
|
|
0 |
0 |
&& (nearby==iTrunk || (iTrunk
|
73237
|
0 |
0 |
if( rc ){ |
73240
|
0 |
0 |
if( k==0 ){ |
73241
|
0 |
0 |
if( !pPrevTrunk ){ |
73245
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
73257
|
0 |
0 |
if( iNewTrunk>mxPage ){ |
73263
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
73267
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
73275
|
0 |
0 |
if( !pPrevTrunk ){ |
73280
|
0 |
0 |
if( rc ){ |
73289
|
1 |
0 |
}else if( k>0 ){ |
73294
|
1 |
0 |
if( nearby>0 ){ |
73297
|
0 |
1 |
if( eMode==BTALLOC_LE ){ |
73298
|
0 |
0 |
for(i=0; i
|
73300
|
0 |
0 |
if( iPage<=nearby ){ |
73308
|
0 |
1 |
for(i=1; i
|
73310
|
0 |
0 |
if( d2
|
73322
|
1 |
0 |
if( iPage>mxPage || iPage<2 ){ |
|
0 |
1 |
if( iPage>mxPage || iPage<2 ){ |
73327
|
0 |
1 |
if( !searchList |
73328
|
0 |
0 |
|| (iPage==nearby || (iPage
|
|
0 |
0 |
|| (iPage==nearby || (iPage
|
|
0 |
0 |
|| (iPage==nearby || (iPage
|
73336
|
0 |
1 |
if( rc ) goto end_allocate_page; |
73337
|
0 |
1 |
if( closest
|
73343
|
1 |
0 |
if( rc==SQLITE_OK ){ |
73345
|
0 |
1 |
if( rc!=SQLITE_OK ){ |
73355
|
0 |
2 |
}while( searchList ); |
73378
|
0 |
1000 |
if( rc ) return rc; |
73380
|
0 |
1000 |
if( pBt->nPage==PENDING_BYTE_PAGE(pBt) ) pBt->nPage++; |
73383
|
0 |
1000 |
if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt, pBt->nPage) ){ |
|
0 |
0 |
if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt, pBt->nPage) ){ |
73392
|
0 |
0 |
if( rc==SQLITE_OK ){ |
73396
|
0 |
0 |
if( rc ) return rc; |
73398
|
0 |
0 |
if( pBt->nPage==PENDING_BYTE_PAGE(pBt) ){ pBt->nPage++; } |
73406
|
0 |
1000 |
if( rc ) return rc; |
73408
|
0 |
1000 |
if( rc!=SQLITE_OK ){ |
73449
|
5 |
0 |
if( iPage<2 || iPage>pBt->nPage ){ |
|
0 |
5 |
if( iPage<2 || iPage>pBt->nPage ){ |
73452
|
5 |
0 |
if( pMemPage ){ |
73461
|
0 |
5 |
if( rc ) goto freepage_out; |
73465
|
0 |
5 |
if( pBt->btsFlags & BTS_SECURE_DELETE ){ |
73469
|
0 |
0 |
if( (!pPage && ((rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0) ) |
|
0 |
0 |
if( (!pPage && ((rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0) ) |
73470
|
0 |
0 |
|| ((rc = sqlite3PagerWrite(pPage->pDbPage))!=0) |
73480
|
0 |
5 |
if( ISAUTOVACUUM ){ |
73482
|
0 |
0 |
if( rc ) goto freepage_out; |
73492
|
1 |
4 |
if( nFree!=0 ){ |
73496
|
0 |
1 |
if( iTrunk>btreePagecount(pBt) ){ |
73501
|
0 |
1 |
if( rc!=SQLITE_OK ){ |
73507
|
0 |
1 |
if( nLeaf > (u32)pBt->usableSize/4 - 2 ){ |
73511
|
1 |
0 |
if( nLeaf < (u32)pBt->usableSize/4 - 8 ){ |
73532
|
1 |
0 |
if( rc==SQLITE_OK ){ |
73535
|
1 |
0 |
if( pPage && (pBt->btsFlags & BTS_SECURE_DELETE)==0 ){ |
|
1 |
0 |
if( pPage && (pBt->btsFlags & BTS_SECURE_DELETE)==0 ){ |
73551
|
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)) ){ |
73555
|
0 |
4 |
if( rc!=SQLITE_OK ){ |
73564
|
5 |
0 |
if( pPage ){ |
73572
|
5 |
0 |
if( (*pRC)==SQLITE_OK ){ |
73595
|
0 |
0 |
if( pCell + pInfo->nSize > pPage->aDataEnd ){ |
73607
|
0 |
0 |
while( nOvfl-- ){ |
73610
|
0 |
0 |
if( ovflPgno<2 || ovflPgno>btreePagecount(pBt) ){ |
|
0 |
0 |
if( ovflPgno<2 || ovflPgno>btreePagecount(pBt) ){ |
73616
|
0 |
0 |
if( nOvfl ){ |
73618
|
0 |
0 |
if( rc ) return rc; |
73621
|
0 |
0 |
if( ( pOvfl || ((pOvfl = btreePageLookup(pBt, ovflPgno))!=0) ) |
|
0 |
0 |
if( ( pOvfl || ((pOvfl = btreePageLookup(pBt, ovflPgno))!=0) ) |
73622
|
0 |
0 |
&& sqlite3PagerPageRefcount(pOvfl->pDbPage)!=1 |
73639
|
0 |
0 |
if( pOvfl ){ |
73642
|
0 |
0 |
if( rc ) return rc; |
73701
|
3979 |
87 |
if( pPage->intKey ){ |
73706
|
3772 |
207 |
nHeader += putVarint32(&pCell[nHeader], nPayload); |
73712
|
87 |
0 |
nHeader += putVarint32(&pCell[nHeader], nPayload); |
73717
|
4040 |
26 |
if( nPayload<=pPage->maxLocal ){ |
73723
|
5 |
4035 |
if( n<4 ) n = 4; |
73739
|
24 |
2 |
if( n > pPage->maxLocal ) n = mn; |
73773
|
575 |
26 |
if( n>spaceLeft ) n = spaceLeft; |
73784
|
601 |
0 |
if( nSrc>=n ){ |
73786
|
0 |
0 |
}else if( nSrc>0 ){ |
73793
|
26 |
575 |
if( nPayload<=0 ) break; |
73798
|
575 |
0 |
if( spaceLeft==0 ){ |
73802
|
0 |
575 |
if( pBt->autoVacuum ){ |
73806
|
0 |
0 |
PTRMAP_ISPAGE(pBt, pgnoOvfl) || pgnoOvfl==PENDING_BYTE_PAGE(pBt) |
73807
|
0 |
0 |
); |
73822
|
0 |
575 |
if( pBt->autoVacuum && rc==SQLITE_OK ){ |
|
0 |
0 |
if( pBt->autoVacuum && rc==SQLITE_OK ){ |
73823
|
0 |
0 |
u8 eType = (pgnoPtrmap?PTRMAP_OVERFLOW2:PTRMAP_OVERFLOW1); |
73825
|
0 |
0 |
if( rc ){ |
73830
|
0 |
575 |
if( rc ){ |
73872
|
0 |
291 |
if( *pRC ) return; |
73892
|
0 |
291 |
if( pc+sz > pPage->pBt->usableSize ){ |
73897
|
0 |
291 |
if( rc ){ |
73902
|
174 |
117 |
if( pPage->nCell==0 ){ |
73952
|
3996 |
0 |
if( pPage->nOverflow || sz+2>pPage->nFree ){ |
|
139 |
3857 |
if( pPage->nOverflow || sz+2>pPage->nFree ){ |
73953
|
0 |
139 |
if( pTemp ){ |
73957
|
0 |
139 |
if( iChild ){ |
73977
|
0 |
3857 |
if( rc!=SQLITE_OK ){ |
73985
|
0 |
3857 |
if( rc ){ *pRC = rc; return; } |
73992
|
139 |
3718 |
if( iChild ){ |
74008
|
6 |
3851 |
if( (++data[pPage->hdrOffset+4])==0 ) data[pPage->hdrOffset+3]++; |
74011
|
0 |
3857 |
if( pPage->pBt->autoVacuum ){ |
74120
|
0 |
0 |
while( N>0 ){ |
74122
|
0 |
0 |
if( p->szCell[idx]==0 ){ |
74144
|
0 |
0 |
if( p->szCell[N] ) return p->szCell[N]; |
74182
|
0 |
139 |
if( j>(u32)usableSize ){ j = 0; } |
74185
|
0 |
139 |
for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k
|
|
0 |
0 |
for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k
|
74193
|
15 |
124 |
if( SQLITE_WITHIN(pCell,aData+j,pEnd) ){ |
|
0 |
15 |
if( SQLITE_WITHIN(pCell,aData+j,pEnd) ){ |
74194
|
0 |
0 |
if( ((uptr)(pCell+sz))>(uptr)pEnd ) return SQLITE_CORRUPT_BKPT; |
74196
|
16 |
123 |
}else if( (uptr)(pCell+sz)>(uptr)pSrcEnd |
74197
|
0 |
16 |
&& (uptr)(pCell)<(uptr)pSrcEnd |
74205
|
0 |
139 |
if( pData < pCellptr ) return SQLITE_CORRUPT_BKPT; |
74209
|
139 |
0 |
if( i>=iEnd ) break; |
74210
|
0 |
0 |
if( pCArray->ixNx[k]<=i ){ |
74267
|
0 |
0 |
if( iEnd<=iFirst ) return 0; |
74268
|
0 |
0 |
for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k
|
|
0 |
0 |
for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k
|
74275
|
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 ){ |
74276
|
0 |
0 |
if( (pData - pBegin)
|
74286
|
0 |
0 |
if( (uptr)(pCArray->apCell[i]+sz)>(uptr)pEnd |
74287
|
0 |
0 |
&& (uptr)(pCArray->apCell[i])<(uptr)pEnd |
74297
|
0 |
0 |
if( i>=iEnd ) break; |
74298
|
0 |
0 |
if( pCArray->ixNx[k]<=i ){ |
74331
|
0 |
0 |
for(i=iFirst; i
|
74333
|
0 |
0 |
if( SQLITE_WITHIN(pCell, pStart, pEnd) ){ |
|
0 |
0 |
if( SQLITE_WITHIN(pCell, pStart, pEnd) ){ |
74339
|
0 |
0 |
if( pFree!=(pCell + sz) ){ |
74340
|
0 |
0 |
if( pFree ){ |
74346
|
0 |
0 |
if( pFree+sz>pEnd ){ |
74356
|
0 |
0 |
if( pFree ){ |
74399
|
0 |
0 |
if( iOld
|
74401
|
0 |
0 |
if( NEVER(nShift>nCell) ) return SQLITE_CORRUPT_BKPT; |
74405
|
0 |
0 |
if( iNewEnd < iOldEnd ){ |
74412
|
0 |
0 |
if( pData
|
74413
|
0 |
0 |
if( pData>pPg->aDataEnd ) goto editpage_fail; |
74416
|
0 |
0 |
if( iNew
|
74422
|
0 |
0 |
if( pageInsertArray( |
74430
|
0 |
0 |
for(i=0; inOverflow; i++){ |
74432
|
0 |
0 |
if( iCell>=0 && iCell
|
|
0 |
0 |
if( iCell>=0 && iCell
|
74434
|
0 |
0 |
if( nCell>iCell ){ |
74439
|
0 |
0 |
if( pageInsertArray( |
74449
|
0 |
0 |
if( pageInsertArray( |
74514
|
0 |
139 |
if( pPage->nCell==0 ) return SQLITE_CORRUPT_BKPT; /* dbfuzz001.test */ |
74524
|
139 |
0 |
if( rc==SQLITE_OK ){ |
74542
|
0 |
139 |
if( NEVER(rc) ){ |
74557
|
0 |
139 |
if( ISAUTOVACUUM ){ |
74559
|
0 |
0 |
if( szCell>pNew->minLocal ){ |
74579
|
133 |
139 |
while( (*(pCell++)&0x80) && pCell
|
|
133 |
0 |
while( (*(pCell++)&0x80) && pCell
|
74581
|
6 |
139 |
while( ((*(pOut++) = *(pCell++))&0x80) && pCell
|
|
6 |
0 |
while( ((*(pOut++) = *(pCell++))&0x80) && pCell
|
74584
|
139 |
0 |
if( rc==SQLITE_OK ){ |
74660
|
7 |
0 |
if( (*pRC)==SQLITE_OK ){ |
74665
|
0 |
7 |
int const iToHdr = ((pTo->pgno==1) ? 100 : 0); |
74686
|
7 |
0 |
if( rc==SQLITE_OK ) rc = btreeComputeFreeSpace(pTo); |
74687
|
0 |
7 |
if( rc!=SQLITE_OK ){ |
74695
|
0 |
7 |
if( ISAUTOVACUUM ){ |
74789
|
0 |
0 |
if( !aOvflSpace ){ |
74806
|
0 |
0 |
if( i<2 ){ |
74810
|
0 |
0 |
if( iParentIdx==0 ){ |
74812
|
0 |
0 |
}else if( iParentIdx==i ){ |
74820
|
0 |
0 |
if( (i+nxDiv-pParent->nOverflow)==pParent->nCell ){ |
74827
|
0 |
0 |
if( rc==SQLITE_OK ){ |
74830
|
0 |
0 |
if( rc ){ |
74834
|
0 |
0 |
if( apOld[i]->nFree<0 ){ |
74836
|
0 |
0 |
if( rc ){ |
74842
|
0 |
0 |
if( (i--)==0 ) break; |
74844
|
0 |
0 |
if( pParent->nOverflow && i+nxDiv==pParent->aiOvfl[0] ){ |
|
0 |
0 |
if( pParent->nOverflow && i+nxDiv==pParent->aiOvfl[0] ){ |
74866
|
0 |
0 |
if( pBt->btsFlags & BTS_FAST_SECURE ){ |
74872
|
0 |
0 |
if( (iOff+szNew[i])<=(int)pBt->usableSize ){ |
74895
|
0 |
0 |
if( b.apCell==0 ){ |
74922
|
0 |
0 |
for(i=0; i
|
74934
|
0 |
0 |
if( pOld->aData[0]!=apOld[0]->aData[0] ){ |
74957
|
0 |
0 |
if( pOld->nOverflow>0 ){ |
74958
|
0 |
0 |
if( NEVER(limitaiOvfl[0]) ){ |
74963
|
0 |
0 |
for(j=0; j
|
74968
|
0 |
0 |
for(k=0; knOverflow; k++){ |
74975
|
0 |
0 |
while( piCell
|
74984
|
0 |
0 |
if( i
|
|
0 |
0 |
if( i
|
74997
|
0 |
0 |
if( !pOld->leaf ){ |
75005
|
0 |
0 |
while( b.szCell[b.nCell]<4 ){ |
75035
|
0 |
0 |
for(i=k=0; i
|
75039
|
0 |
0 |
if( k && b.ixNx[k]==b.ixNx[k-1] ){ |
|
0 |
0 |
if( k && b.ixNx[k]==b.ixNx[k-1] ){ |
75042
|
0 |
0 |
if( !leafData ){ |
75049
|
0 |
0 |
for(j=0; jnOverflow; j++){ |
75055
|
0 |
0 |
for(i=0; i
|
75057
|
0 |
0 |
while( szNew[i]>usableSpace ){ |
75058
|
0 |
0 |
if( i+1>=k ){ |
75060
|
0 |
0 |
if( k>NB+2 ){ rc = SQLITE_CORRUPT_BKPT; goto balance_cleanup; } |
75066
|
0 |
0 |
if( !leafData ){ |
75067
|
0 |
0 |
if( cntNew[i]
|
75076
|
0 |
0 |
while( cntNew[i]
|
75078
|
0 |
0 |
if( szNew[i]+sz>usableSpace ) break; |
75081
|
0 |
0 |
if( !leafData ){ |
75082
|
0 |
0 |
if( cntNew[i]
|
75090
|
0 |
0 |
if( cntNew[i]>=b.nCell ){ |
75092
|
0 |
0 |
}else if( cntNew[i] <= (i>0 ? cntNew[i-1] : 0) ){ |
|
0 |
0 |
}else if( cntNew[i] <= (i>0 ? cntNew[i-1] : 0) ){ |
75109
|
0 |
0 |
for(i=k-1; i>0; i--){ |
75122
|
0 |
0 |
if( szRight!=0 |
75123
|
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)))){ |
75131
|
0 |
0 |
}while( r>=0 ); |
75134
|
0 |
0 |
if( cntNew[i-1] <= (i>1 ? cntNew[i-2] : 0) ){ |
|
0 |
0 |
if( cntNew[i-1] <= (i>1 ? cntNew[i-2] : 0) ){ |
75158
|
0 |
0 |
for(i=0; i
|
75160
|
0 |
0 |
if( i
|
75165
|
0 |
0 |
if( sqlite3PagerPageRefcount(pNew->pDbPage)!=1+(i==(iParentIdx-nxDiv)) |
|
0 |
0 |
if( sqlite3PagerPageRefcount(pNew->pDbPage)!=1+(i==(iParentIdx-nxDiv)) |
75166
|
0 |
0 |
&& rc==SQLITE_OK |
75170
|
0 |
0 |
if( rc ) goto balance_cleanup; |
75173
|
0 |
0 |
rc = allocateBtreePage(pBt, &pNew, &pgno, (bBulk ? 1 : pgno), 0); |
75174
|
0 |
0 |
if( rc ) goto balance_cleanup; |
75181
|
0 |
0 |
if( ISAUTOVACUUM ){ |
75183
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
75202
|
0 |
0 |
for(i=0; i
|
75207
|
0 |
0 |
for(i=0; i
|
75209
|
0 |
0 |
for(j=i+1; j
|
75210
|
0 |
0 |
if( apNew[j]->pgno < apNew[iB]->pgno ) iB = j; |
75218
|
0 |
0 |
if( iB!=i ){ |
75253
|
0 |
0 |
if( (pageFlags & PTF_LEAF)==0 && nOld!=nNew ){ |
|
0 |
0 |
if( (pageFlags & PTF_LEAF)==0 && nOld!=nNew ){ |
75254
|
0 |
0 |
MemPage *pOld = (nNew>nOld ? apNew : apOld)[nOld-1]; |
75274
|
0 |
0 |
if( ISAUTOVACUUM ){ |
75281
|
0 |
0 |
for(i=0; i
|
75283
|
0 |
0 |
while( i==cntOldNext ){ |
75287
|
0 |
0 |
pOld = iOld
|
75290
|
0 |
0 |
if( i==cntNew[iNew] ){ |
75292
|
0 |
0 |
if( !leafData ) continue; |
75301
|
0 |
0 |
if( iOld>=nNew |
75302
|
0 |
0 |
|| pNew->pgno!=aPgno[iOld] |
75303
|
0 |
0 |
|| !SQLITE_WITHIN(pCell,pOld->aData,pOld->aDataEnd) |
|
0 |
0 |
|| !SQLITE_WITHIN(pCell,pOld->aData,pOld->aDataEnd) |
75305
|
0 |
0 |
if( !leafCorrection ){ |
75308
|
0 |
0 |
if( cachedCellSize(&b,i)>pNew->minLocal ){ |
75311
|
0 |
0 |
if( rc ) goto balance_cleanup; |
75317
|
0 |
0 |
for(i=0; i
|
75330
|
0 |
0 |
if( !pNew->leaf ){ |
75332
|
0 |
0 |
}else if( leafData ){ |
75357
|
0 |
0 |
if( b.szCell[j]==4 ){ |
75365
|
0 |
0 |
for(k=0; b.ixNx[k]<=j && ALWAYS(k
|
|
0 |
0 |
for(k=0; b.ixNx[k]<=j && ALWAYS(k
|
75367
|
0 |
0 |
if( SQLITE_WITHIN(pSrcEnd, pCell, pCell+sz) ){ |
|
0 |
0 |
if( SQLITE_WITHIN(pSrcEnd, pCell, pCell+sz) ){ |
75372
|
0 |
0 |
if( rc!=SQLITE_OK ) goto balance_cleanup; |
75398
|
0 |
0 |
for(i=1-nNew; i
|
75401
|
0 |
0 |
if( abDone[iPg] ) continue; /* Skip pages already processed */ |
75402
|
0 |
0 |
if( i>=0 /* On the upwards pass, or... */ |
75403
|
0 |
0 |
|| cntOld[iPg-1]>=cntNew[iPg-1] /* Condition (1) is true */ |
75417
|
0 |
0 |
if( iPg==0 ){ |
75421
|
0 |
0 |
iOld = iPg
|
75427
|
0 |
0 |
if( rc ) goto balance_cleanup; |
75441
|
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 ){ |
75467
|
0 |
0 |
}else if( ISAUTOVACUUM && !leafCorrection ){ |
|
0 |
0 |
}else if( ISAUTOVACUUM && !leafCorrection ){ |
75471
|
0 |
0 |
for(i=0; i
|
75483
|
0 |
0 |
for(i=nNew; i
|
75503
|
0 |
0 |
for(i=0; i
|
75506
|
0 |
0 |
for(i=0; i
|
75547
|
7 |
0 |
if( rc==SQLITE_OK ){ |
75550
|
0 |
7 |
if( ISAUTOVACUUM ){ |
75554
|
0 |
7 |
if( rc ){ |
75593
|
7 |
7 |
for(pOther=pCur->pBt->pCursor; pOther; pOther=pOther->pNext){ |
75594
|
0 |
7 |
if( pOther!=pCur |
75595
|
0 |
0 |
&& pOther->eState==CURSOR_VALID |
75596
|
0 |
0 |
&& pOther->pPage==pCur->pPage |
75626
|
0 |
306 |
if( NEVER(pPage->nFree<0) && btreeComputeFreeSpace(pPage) ) break; |
|
0 |
0 |
if( NEVER(pPage->nFree<0) && btreeComputeFreeSpace(pPage) ) break; |
75627
|
160 |
146 |
if( pPage->nOverflow==0 && pPage->nFree*3<=(int)pCur->pBt->usableSize*2 ){ |
|
160 |
0 |
if( pPage->nOverflow==0 && pPage->nFree*3<=(int)pCur->pBt->usableSize*2 ){ |
75633
|
167 |
139 |
}else if( (iPage = pCur->iPage)==0 ){ |
75634
|
7 |
160 |
if( pPage->nOverflow && (rc = anotherValidCursor(pCur))==SQLITE_OK ){ |
|
7 |
0 |
if( pPage->nOverflow && (rc = anotherValidCursor(pCur))==SQLITE_OK ){ |
75643
|
7 |
0 |
if( rc==SQLITE_OK ){ |
75659
|
139 |
0 |
if( rc==SQLITE_OK && pParent->nFree<0 ){ |
|
0 |
139 |
if( rc==SQLITE_OK && pParent->nFree<0 ){ |
75662
|
139 |
0 |
if( rc==SQLITE_OK ){ |
75664
|
139 |
0 |
if( pPage->intKeyLeaf |
75665
|
139 |
0 |
&& pPage->nOverflow==1 |
75666
|
139 |
0 |
&& pPage->aiOvfl[0]==pPage->nCell |
75667
|
139 |
0 |
&& pParent->pgno!=1 |
75668
|
139 |
0 |
&& pParent->nCell==iIdx |
75709
|
0 |
0 |
if( pFree ){ |
75732
|
146 |
0 |
}while( rc==SQLITE_OK ); |
75734
|
0 |
160 |
if( pFree ){ |
75751
|
0 |
3 |
if( nData<=0 ){ |
75754
|
0 |
0 |
for(i=0; i
|
|
0 |
0 |
for(i=0; i
|
75755
|
0 |
0 |
if( i
|
75757
|
0 |
0 |
if( rc ) return rc; |
75761
|
0 |
3 |
if( nData
|
75766
|
0 |
0 |
if( rc ) return rc; |
75769
|
3 |
0 |
if( memcmp(pDest, ((u8*)pX->pData) + iOffset, iAmt)!=0 ){ |
75771
|
0 |
3 |
if( rc ) return rc; |
75795
|
3 |
0 |
if( pCur->info.pPayload + pCur->info.nLocal > pPage->aDataEnd |
75796
|
0 |
3 |
|| pCur->info.pPayload < pPage->aData + pPage->cellOffset |
75803
|
0 |
3 |
if( rc ) return rc; |
75804
|
3 |
0 |
if( pCur->info.nLocal==nTotal ) return SQLITE_OK; |
75815
|
0 |
0 |
if( rc ) return rc; |
75816
|
0 |
0 |
if( sqlite3PagerPageRefcount(pPage->pDbPage)!=1 || pPage->isInit ){ |
|
0 |
0 |
if( sqlite3PagerPageRefcount(pPage->pDbPage)!=1 || pPage->isInit ){ |
75819
|
0 |
0 |
if( iOffset+ovflPageSize<(u32)nTotal ){ |
75828
|
0 |
0 |
if( rc ) return rc; |
75830
|
0 |
0 |
}while( iOffset
|
75895
|
119 |
3950 |
if( pCur->curFlags & BTCF_Multiple ){ |
75897
|
0 |
119 |
if( rc ) return rc; |
75898
|
0 |
119 |
if( loc && pCur->iPage<0 ){ |
|
0 |
0 |
if( loc && pCur->iPage<0 ){ |
75911
|
0 |
4069 |
if( pCur->eState>=CURSOR_REQUIRESEEK ){ |
75915
|
0 |
0 |
if( rc && rc!=SQLITE_EMPTY ) return rc; |
|
0 |
0 |
if( rc && rc!=SQLITE_EMPTY ) return rc; |
75931
|
3982 |
87 |
if( pCur->pKeyInfo==0 ){ |
75935
|
16 |
3966 |
if( p->hasIncrblobCur ){ |
75954
|
3141 |
841 |
if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey ){ |
|
291 |
2850 |
if( (pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey ){ |
75958
|
267 |
24 |
if( pCur->info.nSize!=0 |
75959
|
3 |
264 |
&& pCur->info.nPayload==(u32)pX->nData+pX->nZero |
75965
|
3346 |
345 |
}else if( loc==0 ){ |
75972
|
0 |
3346 |
if( rc ) return rc; |
75987
|
26 |
61 |
if( loc==0 && (flags & BTREE_SAVEPOSITION)==0 ){ |
|
26 |
0 |
if( loc==0 && (flags & BTREE_SAVEPOSITION)==0 ){ |
75988
|
26 |
0 |
if( pX->nMem ){ |
76000
|
0 |
26 |
if( rc ) return rc; |
76007
|
0 |
87 |
if( loc==0 ){ |
76009
|
0 |
0 |
if( pCur->info.nKey==pX->nKey ){ |
76024
|
38 |
4028 |
if( pPage->nFree<0 ){ |
76025
|
0 |
38 |
if( NEVER(pCur->eState>CURSOR_INVALID) ){ |
76031
|
0 |
38 |
if( rc ) return rc; |
76040
|
0 |
4066 |
if( flags & BTREE_PREFORMAT ){ |
76043
|
0 |
0 |
if( szNew<4 ) szNew = 4; |
76044
|
0 |
0 |
if( ISAUTOVACUUM && szNew>pPage->maxLocal ){ |
|
0 |
0 |
if( ISAUTOVACUUM && szNew>pPage->maxLocal ){ |
76047
|
0 |
0 |
if( info.nPayload!=info.nLocal ){ |
76055
|
0 |
4066 |
if( rc ) goto end_insert; |
76059
|
479 |
3587 |
if( loc==0 ){ |
76062
|
0 |
479 |
if( idx>=pPage->nCell ){ |
76066
|
0 |
479 |
if( rc ){ |
76070
|
0 |
479 |
if( !pPage->leaf ){ |
76073
|
0 |
479 |
BTREE_CLEAR_CELL(rc, pPage, oldCell, info); |
76076
|
209 |
270 |
if( info.nSize==szNew && info.nLocal==info.nPayload |
|
209 |
0 |
if( info.nSize==szNew && info.nLocal==info.nPayload |
76077
|
0 |
209 |
&& (!ISAUTOVACUUM || szNewminLocal) |
|
0 |
0 |
&& (!ISAUTOVACUUM || szNewminLocal) |
76089
|
0 |
209 |
if( oldCell < pPage->aData+pPage->hdrOffset+10 ){ |
76092
|
0 |
209 |
if( oldCell+szNew > pPage->aDataEnd ){ |
76099
|
0 |
270 |
if( rc ) goto end_insert; |
76100
|
3573 |
14 |
}else if( loc<0 && pPage->nCell>0 ){ |
|
3174 |
399 |
}else if( loc<0 && pPage->nCell>0 ){ |
76132
|
139 |
3718 |
if( pPage->nOverflow ){ |
76143
|
0 |
139 |
if( (flags & BTREE_SAVEPOSITION) && rc==SQLITE_OK ){ |
|
0 |
0 |
if( (flags & BTREE_SAVEPOSITION) && rc==SQLITE_OK ){ |
76145
|
0 |
0 |
if( pCur->pKeyInfo ){ |
76148
|
0 |
0 |
if( pCur->pKey==0 ){ |
76188
|
0 |
0 |
if( pSrc->info.nPayload<0x80 ){ |
76193
|
0 |
0 |
if( pDest->pKeyInfo==0 ) aOut += putVarint(aOut, iKey); |
76196
|
0 |
0 |
if( aIn+nIn>pSrc->pPage->aDataEnd ){ |
76200
|
0 |
0 |
if( nIn==nRem && nInpPage->maxLocal ){ |
|
0 |
0 |
if( nIn==nRem && nInpPage->maxLocal ){ |
76213
|
0 |
0 |
if( nOutinfo.nPayload ){ |
76218
|
0 |
0 |
if( nRem>nIn ){ |
76219
|
0 |
0 |
if( aIn+nIn+4>pSrc->pPage->aDataEnd ){ |
76229
|
0 |
0 |
if( nIn>0 ){ |
76237
|
0 |
0 |
if( nOut>0 ){ |
76241
|
0 |
0 |
if( rc==SQLITE_OK ){ |
76248
|
0 |
0 |
}while( rc==SQLITE_OK && nOut>0 ); |
|
0 |
0 |
}while( rc==SQLITE_OK && nOut>0 ); |
76250
|
0 |
0 |
if( rc==SQLITE_OK && nRem>0 && ALWAYS(pPgnoOut) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && nRem>0 && ALWAYS(pPgnoOut) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && nRem>0 && ALWAYS(pPgnoOut) ){ |
76255
|
0 |
0 |
if( ISAUTOVACUUM && pPageOut ){ |
|
0 |
0 |
if( ISAUTOVACUUM && pPageOut ){ |
76260
|
0 |
0 |
if( pPageOut ){ |
76267
|
0 |
0 |
}while( nRem>0 && rc==SQLITE_OK ); |
|
0 |
0 |
}while( nRem>0 && rc==SQLITE_OK ); |
76311
|
0 |
21 |
if( pCur->eState!=CURSOR_VALID ){ |
76312
|
0 |
0 |
if( pCur->eState>=CURSOR_REQUIRESEEK ){ |
76315
|
0 |
0 |
if( rc || pCur->eState!=CURSOR_VALID ) return rc; |
|
0 |
0 |
if( rc || pCur->eState!=CURSOR_VALID ) return rc; |
76325
|
0 |
21 |
if( pPage->nCell<=iCellIdx ){ |
76329
|
3 |
18 |
if( pPage->nFree<0 && btreeComputeFreeSpace(pPage) ){ |
|
0 |
3 |
if( pPage->nFree<0 && btreeComputeFreeSpace(pPage) ){ |
76350
|
18 |
3 |
if( bPreserve ){ |
76351
|
18 |
0 |
if( !pPage->leaf |
76352
|
0 |
18 |
|| (pPage->nFree+pPage->xCellSize(pPage,pCell)+2) > |
76354
|
0 |
0 |
|| pPage->nCell==1 /* See dbfuzz001.test for a test case */ |
76359
|
0 |
18 |
if( rc ) return rc; |
76372
|
0 |
21 |
if( !pPage->leaf ){ |
76375
|
0 |
0 |
if( rc ) return rc; |
76380
|
0 |
21 |
if( pCur->curFlags & BTCF_Multiple ){ |
76382
|
0 |
0 |
if( rc ) return rc; |
76387
|
20 |
1 |
if( pCur->pKeyInfo==0 && p->hasIncrblobCur ){ |
|
1 |
19 |
if( pCur->pKeyInfo==0 && p->hasIncrblobCur ){ |
76395
|
0 |
21 |
if( rc ) return rc; |
76396
|
0 |
21 |
BTREE_CLEAR_CELL(rc, pPage, pCell, info); |
76398
|
0 |
21 |
if( rc ) return rc; |
76405
|
0 |
21 |
if( !pPage->leaf ){ |
76411
|
0 |
0 |
if( pLeaf->nFree<0 ){ |
76413
|
0 |
0 |
if( rc ) return rc; |
76415
|
0 |
0 |
if( iCellDepthiPage-1 ){ |
76421
|
0 |
0 |
if( pCell<&pLeaf->aData[4] ) return SQLITE_CORRUPT_BKPT; |
76427
|
0 |
0 |
if( rc==SQLITE_OK ){ |
76431
|
0 |
0 |
if( rc ) return rc; |
76451
|
0 |
21 |
if( pCur->pPage->nFree*3<=(int)pCur->pBt->usableSize*2 ){ |
76458
|
21 |
0 |
if( rc==SQLITE_OK && pCur->iPage>iCellDepth ){ |
|
0 |
21 |
if( rc==SQLITE_OK && pCur->iPage>iCellDepth ){ |
76461
|
0 |
0 |
while( pCur->iPage>iCellDepth ){ |
76468
|
21 |
0 |
if( rc==SQLITE_OK ){ |
76469
|
0 |
21 |
if( bPreserve>1 ){ |
76474
|
0 |
0 |
if( iCellIdx>=pPage->nCell ){ |
76482
|
18 |
3 |
if( bPreserve ){ |
76486
|
10 |
11 |
if( rc==SQLITE_EMPTY ) rc = SQLITE_OK; |
76520
|
0 |
281 |
if( pBt->autoVacuum ){ |
76536
|
0 |
0 |
if( pgnoRoot>btreePagecount(pBt) ){ |
76544
|
0 |
0 |
while( pgnoRoot==PTRMAP_PAGENO(pBt, pgnoRoot) || |
|
0 |
0 |
while( pgnoRoot==PTRMAP_PAGENO(pBt, pgnoRoot) || |
76555
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
76559
|
0 |
0 |
if( pgnoMove!=pgnoRoot ){ |
76574
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
76580
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
76584
|
0 |
0 |
if( eType==PTRMAP_ROOTPAGE || eType==PTRMAP_FREEPAGE ){ |
|
0 |
0 |
if( eType==PTRMAP_ROOTPAGE || eType==PTRMAP_FREEPAGE ){ |
76587
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
76597
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
76601
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
76605
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
76615
|
0 |
0 |
if( rc ){ |
76626
|
0 |
0 |
if( NEVER(rc) ){ |
76633
|
0 |
281 |
if( rc ) return rc; |
76637
|
232 |
49 |
if( createTabFlags & BTREE_INTKEY ){ |
76674
|
0 |
38 |
if( pgno>btreePagecount(pBt) ){ |
76678
|
0 |
38 |
if( rc ) return rc; |
76679
|
38 |
0 |
if( (pBt->openFlags & BTREE_SINGLE)==0 |
76680
|
0 |
38 |
&& sqlite3PagerPageRefcount(pPage->pDbPage) != (1 + (pgno==1)) |
|
0 |
38 |
&& sqlite3PagerPageRefcount(pPage->pDbPage) != (1 + (pgno==1)) |
76686
|
30 |
38 |
for(i=0; inCell; i++){ |
76688
|
0 |
30 |
if( !pPage->leaf ){ |
76690
|
0 |
0 |
if( rc ) goto cleardatabasepage_out; |
76692
|
0 |
30 |
BTREE_CLEAR_CELL(rc, pPage, pCell, info); |
76693
|
0 |
30 |
if( rc ) goto cleardatabasepage_out; |
76695
|
0 |
38 |
if( !pPage->leaf ){ |
76697
|
0 |
0 |
if( rc ) goto cleardatabasepage_out; |
76698
|
0 |
0 |
if( pPage->intKey ) pnChange = 0; |
76700
|
33 |
5 |
if( pnChange ){ |
76704
|
0 |
38 |
if( freePageFlag ){ |
76706
|
38 |
0 |
}else if( (rc = sqlite3PagerWrite(pPage->pDbPage))==0 ){ |
76735
|
38 |
0 |
if( SQLITE_OK==rc ){ |
76739
|
0 |
38 |
if( p->hasIncrblobCur ){ |
76785
|
0 |
5 |
if( iTable>btreePagecount(pBt) ){ |
76790
|
0 |
5 |
if( rc ) return rc; |
76792
|
0 |
5 |
if( NEVER(rc) ){ |
76803
|
0 |
5 |
if( pBt->autoVacuum ){ |
76807
|
0 |
0 |
if( iTable==maxRootPgno ){ |
76813
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
76824
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
76829
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
76836
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
76848
|
0 |
0 |
while( maxRootPgno==PENDING_BYTE_PAGE(pBt) |
76849
|
0 |
0 |
|| PTRMAP_ISPAGE(pBt, maxRootPgno) ){ |
76900
|
0 |
1376 |
if( idx==BTREE_DATA_VERSION ){ |
76931
|
632 |
0 |
if( rc==SQLITE_OK ){ |
76934
|
0 |
632 |
if( idx==BTREE_INCR_VACUUM ){ |
76958
|
6 |
4 |
if( rc==SQLITE_EMPTY ){ |
76966
|
4 |
0 |
while( rc==SQLITE_OK && !AtomicLoad(&db->u1.isInterrupted) ){ |
|
4 |
0 |
while( rc==SQLITE_OK && !AtomicLoad(&db->u1.isInterrupted) ){ |
76975
|
0 |
4 |
if( pPage->leaf || !pPage->intKey ){ |
|
0 |
0 |
if( pPage->leaf || !pPage->intKey ){ |
76989
|
4 |
0 |
if( pPage->leaf ){ |
76991
|
4 |
0 |
if( pCur->iPage==0 ){ |
76997
|
0 |
0 |
}while ( pCur->ix>=pCur->pPage->nCell ); |
77007
|
0 |
0 |
if( iIdx==pPage->nCell ){ |
77036
|
0 |
0 |
if( !pCheck->mxErr ) return; |
77040
|
0 |
0 |
if( pCheck->errMsg.nChar ){ |
77043
|
0 |
0 |
if( pCheck->zPfx ){ |
77048
|
0 |
0 |
if( pCheck->errMsg.accError==SQLITE_NOMEM ){ |
77083
|
0 |
0 |
if( iPage>pCheck->nPage || iPage==0 ){ |
|
0 |
0 |
if( iPage>pCheck->nPage || iPage==0 ){ |
77087
|
0 |
0 |
if( getPageReferenced(pCheck, iPage) ){ |
77091
|
0 |
0 |
if( AtomicLoad(&pCheck->db->u1.isInterrupted) ) return 1; |
77113
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
77114
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ) pCheck->bOomFault = 1; |
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ) pCheck->bOomFault = 1; |
77119
|
0 |
0 |
if( ePtrmapType!=eType || iPtrmapParent!=iParent ){ |
|
0 |
0 |
if( ePtrmapType!=eType || iPtrmapParent!=iParent ){ |
77140
|
0 |
0 |
while( iPage!=0 && pCheck->mxErr ){ |
|
0 |
0 |
while( iPage!=0 && pCheck->mxErr ){ |
77143
|
0 |
0 |
if( checkRef(pCheck, iPage) ) break; |
77145
|
0 |
0 |
if( sqlite3PagerGet(pCheck->pPager, (Pgno)iPage, &pOvflPage, 0) ){ |
77150
|
0 |
0 |
if( isFreeList ){ |
77153
|
0 |
0 |
if( pCheck->pBt->autoVacuum ){ |
77157
|
0 |
0 |
if( n>pCheck->pBt->usableSize/4-2 ){ |
77162
|
0 |
0 |
for(i=0; i<(int)n; i++){ |
77165
|
0 |
0 |
if( pCheck->pBt->autoVacuum ){ |
77180
|
0 |
0 |
if( pCheck->pBt->autoVacuum && N>0 ){ |
|
0 |
0 |
if( pCheck->pBt->autoVacuum && N>0 ){ |
77189
|
0 |
0 |
if( N && nErrAtStart==pCheck->nErr ){ |
|
0 |
0 |
if( N && nErrAtStart==pCheck->nErr ){ |
77190
|
0 |
0 |
checkAppendMsg(pCheck, |
77223
|
0 |
0 |
while( (j = i/2)>0 && aHeap[j]>aHeap[i] ){ |
|
0 |
0 |
while( (j = i/2)>0 && aHeap[j]>aHeap[i] ){ |
77232
|
0 |
0 |
if( (x = aHeap[0])==0 ) return 0; |
77238
|
0 |
0 |
while( (j = i*2)<=aHeap[0] ){ |
77239
|
0 |
0 |
if( aHeap[j]>aHeap[j+1] ) j++; |
77240
|
0 |
0 |
if( aHeap[i]
|
77300
|
0 |
0 |
if( iPage==0 ) return 0; |
77301
|
0 |
0 |
if( checkRef(pCheck, iPage) ) return 0; |
77304
|
0 |
0 |
if( (rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0 ){ |
77314
|
0 |
0 |
if( (rc = btreeInitPage(pPage))!=0 ){ |
77320
|
0 |
0 |
if( (rc = btreeComputeFreeSpace(pPage))!=0 ){ |
77344
|
0 |
0 |
if( !pPage->leaf ){ |
77348
|
0 |
0 |
if( pBt->autoVacuum ){ |
77364
|
0 |
0 |
for(i=nCell-1; i>=0 && pCheck->mxErr; i--){ |
|
0 |
0 |
for(i=nCell-1; i>=0 && pCheck->mxErr; i--){ |
77372
|
0 |
0 |
if( pcusableSize-4 ){ |
|
0 |
0 |
if( pcusableSize-4 ){ |
77380
|
0 |
0 |
if( pc+info.nSize>usableSize ){ |
77387
|
0 |
0 |
if( pPage->intKey ){ |
77388
|
0 |
0 |
if( keyCanBeEqual ? (info.nKey > maxKey) : (info.nKey >= maxKey) ){ |
|
0 |
0 |
if( keyCanBeEqual ? (info.nKey > maxKey) : (info.nKey >= maxKey) ){ |
77396
|
0 |
0 |
if( info.nPayload>info.nLocal ){ |
77403
|
0 |
0 |
if( pBt->autoVacuum ){ |
77410
|
0 |
0 |
if( !pPage->leaf ){ |
77414
|
0 |
0 |
if( pBt->autoVacuum ){ |
77420
|
0 |
0 |
if( d2!=depth ){ |
77434
|
0 |
0 |
if( doCoverageCheck && pCheck->mxErr>0 ){ |
|
0 |
0 |
if( doCoverageCheck && pCheck->mxErr>0 ){ |
77438
|
0 |
0 |
if( !pPage->leaf ){ |
77441
|
0 |
0 |
for(i=nCell-1; i>=0; i--){ |
77455
|
0 |
0 |
while( i>0 ){ |
77487
|
0 |
0 |
while( btreeHeapPull(heap,&x) ){ |
77488
|
0 |
0 |
if( (prev&0xffff)>=(x>>16) ){ |
77503
|
0 |
0 |
if( heap[0]==0 && nFrag!=data[hdr+7] ){ |
|
0 |
0 |
if( heap[0]==0 && nFrag!=data[hdr+7] ){ |
77511
|
0 |
0 |
if( !doCoverageCheck ) pPage->isInit = savedIsInit; |
77562
|
0 |
0 |
if( aRoot[0]==0 ){ |
77565
|
0 |
0 |
if( aRoot[1]!=1 ) bCkFreelist = 0; |
77586
|
0 |
0 |
if( sCheck.nPage==0 ){ |
77591
|
0 |
0 |
if( !sCheck.aPgRef ){ |
77596
|
0 |
0 |
if( sCheck.heap==0 ){ |
77602
|
0 |
0 |
if( i<=sCheck.nPage ) setPageReferenced(&sCheck, i); |
77606
|
0 |
0 |
if( bCkFreelist ){ |
77616
|
0 |
0 |
if( !bPartial ){ |
77617
|
0 |
0 |
if( pBt->autoVacuum ){ |
77620
|
0 |
0 |
for(i=0; (int)i
|
|
0 |
0 |
for(i=0; (int)i
|
77622
|
0 |
0 |
if( mx!=mxInHdr ){ |
77628
|
0 |
0 |
}else if( get4byte(&pBt->pPage1->aData[64])!=0 ){ |
77637
|
0 |
0 |
for(i=0; (int)i
|
|
0 |
0 |
for(i=0; (int)i
|
77639
|
0 |
0 |
if( aRoot[i]==0 ) continue; |
77641
|
0 |
0 |
if( pBt->autoVacuum && aRoot[i]>1 && !bPartial ){ |
|
0 |
0 |
if( pBt->autoVacuum && aRoot[i]>1 && !bPartial ){ |
|
0 |
0 |
if( pBt->autoVacuum && aRoot[i]>1 && !bPartial ){ |
77651
|
0 |
0 |
if( !bPartial ){ |
77652
|
0 |
0 |
for(i=1; i<=sCheck.nPage && sCheck.mxErr; i++){ |
|
0 |
0 |
for(i=1; i<=sCheck.nPage && sCheck.mxErr; i++){ |
77662
|
0 |
0 |
(PTRMAP_PAGENO(pBt, i)!=i || !pBt->autoVacuum) ){ |
77666
|
0 |
0 |
(PTRMAP_PAGENO(pBt, i)==i && pBt->autoVacuum) ){ |
77678
|
0 |
0 |
if( sCheck.bOomFault ){ |
77683
|
0 |
0 |
if( sCheck.nErr==0 ) sqlite3_str_reset(&sCheck.errMsg); |
77722
|
3490 |
2014 |
return p ? p->inTrans : 0; |
77736
|
0 |
0 |
if( p ){ |
77739
|
0 |
0 |
if( pBt->inTransaction!=TRANS_NONE ){ |
77782
|
682 |
0 |
if( !pBt->pSchema && nBytes ){ |
|
316 |
366 |
if( !pBt->pSchema && nBytes ){ |
77815
|
0 |
31 |
if( p->sharable ){ |
77822
|
0 |
0 |
if( rc==SQLITE_OK ){ |
77848
|
0 |
0 |
rc = restoreCursorPosition(pCsr); |
77849
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
77853
|
0 |
0 |
if( pCsr->eState!=CURSOR_VALID ){ |
77875
|
0 |
0 |
if( (pCsr->curFlags & BTCF_WriteFlag)==0 ){ |
77911
|
0 |
0 |
if( iVersion==1 ) pBt->btsFlags |= BTS_NO_WAL; |
77914
|
0 |
0 |
if( rc==SQLITE_OK ){ |
77916
|
0 |
0 |
if( aData[18]!=(u8)iVersion || aData[19]!=(u8)iVersion ){ |
|
0 |
0 |
if( aData[18]!=(u8)iVersion || aData[19]!=(u8)iVersion ){ |
77918
|
0 |
0 |
if( rc==SQLITE_OK ){ |
77920
|
0 |
0 |
if( rc==SQLITE_OK ){ |
78057
|
0 |
16 |
if( i==1 ){ |
78061
|
0 |
0 |
if( sqlite3OpenTempDatabase(&sParse) ){ |
78067
|
0 |
0 |
if( rc ){ |
78072
|
0 |
16 |
if( i<0 ){ |
78097
|
0 |
8 |
if( sqlite3BtreeTxnState(p)!=SQLITE_TXN_NONE ){ |
78138
|
0 |
8 |
if( pSrcDb==pDestDb ){ |
78149
|
0 |
8 |
if( !p ){ |
78155
|
8 |
0 |
if( p ){ |
78163
|
8 |
0 |
if( 0==p->pSrc || 0==p->pDest |
|
8 |
0 |
if( 0==p->pSrc || 0==p->pDest |
78164
|
0 |
8 |
|| checkReadTransaction(pDestDb, p->pDest)!=SQLITE_OK |
78175
|
8 |
0 |
if( p ){ |
78190
|
0 |
8 |
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)); |
78221
|
0 |
20 |
if( nSrcPgsz!=nDestPgsz && sqlite3PagerIsMemdb(pDestPager) ){ |
|
0 |
0 |
if( nSrcPgsz!=nDestPgsz && sqlite3PagerIsMemdb(pDestPager) ){ |
78229
|
40 |
0 |
for(iOff=iEnd-(i64)nSrcPgsz; rc==SQLITE_OK && iOff
|
|
20 |
20 |
for(iOff=iEnd-(i64)nSrcPgsz; rc==SQLITE_OK && iOff
|
78232
|
0 |
20 |
if( iDest==PENDING_BYTE_PAGE(p->pDest->pBt) ) continue; |
78233
|
20 |
0 |
if( SQLITE_OK==(rc = sqlite3PagerGet(pDestPager, iDest, &pDestPg, 0)) |
78234
|
20 |
0 |
&& SQLITE_OK==(rc = sqlite3PagerWrite(pDestPg)) |
78249
|
8 |
12 |
if( iOff==0 && bUpdate==0 ){ |
|
8 |
0 |
if( iOff==0 && bUpdate==0 ){ |
78270
|
0 |
0 |
if( rc==SQLITE_OK && iCurrent>iSize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && iCurrent>iSize ){ |
78303
|
8 |
0 |
if( p->pDestDb ){ |
78308
|
8 |
0 |
if( !isFatalError(rc) ){ |
78318
|
8 |
0 |
if( p->pDestDb && p->pSrc->pBt->inTransaction==TRANS_WRITE ){ |
|
0 |
8 |
if( p->pDestDb && p->pSrc->pBt->inTransaction==TRANS_WRITE ){ |
78328
|
8 |
0 |
if( rc==SQLITE_OK && SQLITE_TXN_NONE==sqlite3BtreeTxnState(p->pSrc) ){ |
|
8 |
0 |
if( rc==SQLITE_OK && SQLITE_TXN_NONE==sqlite3BtreeTxnState(p->pSrc) ){ |
78339
|
8 |
0 |
if( p->bDestLocked==0 && rc==SQLITE_OK && setDestPgsz(p)==SQLITE_NOMEM ){ |
|
8 |
0 |
if( p->bDestLocked==0 && rc==SQLITE_OK && setDestPgsz(p)==SQLITE_NOMEM ){ |
|
0 |
8 |
if( p->bDestLocked==0 && rc==SQLITE_OK && setDestPgsz(p)==SQLITE_NOMEM ){ |
78344
|
8 |
0 |
if( SQLITE_OK==rc && p->bDestLocked==0 |
|
8 |
0 |
if( SQLITE_OK==rc && p->bDestLocked==0 |
78345
|
8 |
0 |
&& SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2, |
78356
|
8 |
0 |
if( SQLITE_OK==rc && destMode==PAGER_JOURNALMODE_WAL && pgszSrc!=pgszDest ){ |
|
0 |
8 |
if( SQLITE_OK==rc && destMode==PAGER_JOURNALMODE_WAL && pgszSrc!=pgszDest ){ |
|
0 |
0 |
if( SQLITE_OK==rc && destMode==PAGER_JOURNALMODE_WAL && pgszSrc!=pgszDest ){ |
78365
|
0 |
28 |
for(ii=0; (nPage<0 || iiiNext<=(Pgno)nSrcPage && !rc; ii++){ |
|
0 |
0 |
for(ii=0; (nPage<0 || iiiNext<=(Pgno)nSrcPage && !rc; ii++){ |
|
20 |
8 |
for(ii=0; (nPage<0 || iiiNext<=(Pgno)nSrcPage && !rc; ii++){ |
|
20 |
0 |
for(ii=0; (nPage<0 || iiiNext<=(Pgno)nSrcPage && !rc; ii++){ |
78367
|
20 |
0 |
if( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) ){ |
78370
|
20 |
0 |
if( rc==SQLITE_OK ){ |
78377
|
8 |
0 |
if( rc==SQLITE_OK ){ |
78380
|
8 |
0 |
if( p->iNext>(Pgno)nSrcPage ){ |
78382
|
0 |
0 |
}else if( !p->isAttached ){ |
78392
|
8 |
0 |
if( rc==SQLITE_DONE ){ |
78393
|
0 |
8 |
if( nSrcPage==0 ){ |
78397
|
8 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_DONE ){ |
|
8 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_DONE ){ |
78400
|
8 |
0 |
if( rc==SQLITE_OK ){ |
78401
|
8 |
0 |
if( p->pDestDb ){ |
78404
|
0 |
8 |
if( destMode==PAGER_JOURNALMODE_WAL ){ |
78408
|
8 |
0 |
if( rc==SQLITE_OK ){ |
78424
|
0 |
8 |
if( pgszSrc
|
78427
|
0 |
0 |
if( nDestTruncate==(int)PENDING_BYTE_PAGE(p->pDest->pBt) ){ |
78435
|
0 |
8 |
if( pgszSrc
|
78466
|
0 |
0 |
for(iPg=nDestTruncate; rc==SQLITE_OK && iPg<=(Pgno)nDstPage; iPg++){ |
|
0 |
0 |
for(iPg=nDestTruncate; rc==SQLITE_OK && iPg<=(Pgno)nDstPage; iPg++){ |
78467
|
0 |
0 |
if( iPg!=PENDING_BYTE_PAGE(p->pDest->pBt) ){ |
78470
|
0 |
0 |
if( rc==SQLITE_OK ){ |
78476
|
0 |
0 |
if( rc==SQLITE_OK ){ |
78482
|
0 |
0 |
for( |
78484
|
0 |
0 |
rc==SQLITE_OK && iOff
|
78490
|
0 |
0 |
if( rc==SQLITE_OK ){ |
78496
|
0 |
0 |
if( rc==SQLITE_OK ){ |
78501
|
0 |
0 |
if( rc==SQLITE_OK ){ |
78510
|
8 |
0 |
if( SQLITE_OK==rc |
78511
|
8 |
0 |
&& SQLITE_OK==(rc = sqlite3BtreeCommitPhaseTwo(p->pDest, 0)) |
78523
|
8 |
0 |
if( bCloseTrans ){ |
78530
|
0 |
8 |
if( rc==SQLITE_IOERR_NOMEM ){ |
78535
|
8 |
0 |
if( p->pDestDb ){ |
78552
|
0 |
8 |
if( p==0 ) return SQLITE_OK; |
78556
|
8 |
0 |
if( p->pDestDb ){ |
78561
|
8 |
0 |
if( p->pDestDb ){ |
78564
|
0 |
8 |
if( p->isAttached ){ |
78567
|
0 |
0 |
while( *pp!=p ){ |
78578
|
0 |
8 |
rc = (p->rc==SQLITE_DONE) ? SQLITE_OK : p->rc; |
78579
|
8 |
0 |
if( p->pDestDb ){ |
78586
|
8 |
0 |
if( p->pDestDb ){ |
78644
|
0 |
0 |
if( !isFatalError(p->rc) && iPageiNext ){ |
|
0 |
0 |
if( !isFatalError(p->rc) && iPageiNext ){ |
78655
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
78659
|
0 |
0 |
}while( (p = p->pNext)!=0 ); |
78662
|
0 |
218 |
if( pBackup ) backupUpdate(pBackup, iPage, aData); |
78678
|
0 |
1707 |
for(p=pBackup; p; p=p->pNext){ |
78702
|
0 |
0 |
if( pFd->pMethods ){ |
78705
|
0 |
0 |
if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK; |
78706
|
0 |
0 |
if( rc ) goto copy_finished; |
78730
|
0 |
0 |
if( rc==SQLITE_OK ){ |
78855
|
355 |
2 |
if( p->flags & MEM_Int ){ |
78868
|
0 |
2 |
sqlite3_str_appendf(&acc, "%!.15g", |
78952
|
774 |
3611 |
if( !(pMem->flags&MEM_Str) ){ |
78956
|
3611 |
0 |
if( pMem->enc==desiredEnc ){ |
78997
|
447 |
26956 |
if( pMem->szMalloc>0 && bPreserve && pMem->z==pMem->zMalloc ){ |
|
379 |
68 |
if( pMem->szMalloc>0 && bPreserve && pMem->z==pMem->zMalloc ){ |
|
282 |
97 |
if( pMem->szMalloc>0 && bPreserve && pMem->z==pMem->zMalloc ){ |
78998
|
282 |
0 |
if( pMem->db ){ |
79002
|
0 |
0 |
if( pMem->zMalloc==0 ) sqlite3_free(pMem->z); |
79007
|
165 |
26956 |
if( pMem->szMalloc>0 ) sqlite3DbFreeNN(pMem->db, pMem->zMalloc); |
79010
|
0 |
27403 |
if( pMem->zMalloc==0 ){ |
79019
|
314 |
27089 |
if( bPreserve && pMem->z ){ |
|
314 |
0 |
if( bPreserve && pMem->z ){ |
79023
|
4 |
27399 |
if( (pMem->flags&MEM_Dyn)!=0 ){ |
79049
|
23892 |
5514 |
if( pMem->szMalloc
|
79068
|
0 |
596 |
if( sqlite3VdbeMemGrow(pMem, pMem->n+3, 1) ){ |
79088
|
193 |
469 |
if( (pMem->flags & (MEM_Str|MEM_Blob))!=0 ){ |
79089
|
0 |
193 |
if( ExpandBlob(pMem) ) return SQLITE_NOMEM; |
|
0 |
0 |
if( ExpandBlob(pMem) ) return SQLITE_NOMEM; |
79090
|
97 |
96 |
if( pMem->szMalloc==0 || pMem->z!=pMem->zMalloc ){ |
|
97 |
0 |
if( pMem->szMalloc==0 || pMem->z!=pMem->zMalloc ){ |
79092
|
0 |
193 |
if( rc ) return rc; |
79119
|
0 |
0 |
if( nByte<=0 ){ |
79120
|
0 |
0 |
if( (pMem->flags & MEM_Blob)==0 ) return SQLITE_OK; |
79123
|
0 |
0 |
if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){ |
79144
|
0 |
403 |
if( (pMem->flags & (MEM_Term|MEM_Str))!=MEM_Str ){ |
79177
|
0 |
357 |
if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){ |
79187
|
4 |
353 |
if( bForce ) pMem->flags &= ~(MEM_Int|MEM_Real|MEM_IntReal); |
79219
|
138 |
81 |
if( pMem->szMalloc>0 ) sqlite3DbFreeNN(pMem->db, pMem->zMalloc); |
79263
|
0 |
120 |
if( p->flags&MEM_Agg ){ |
79268
|
120 |
0 |
if( p->flags&MEM_Dyn ){ |
79284
|
110 |
477 |
if( VdbeMemDynamic(p) ){ |
79287
|
461 |
126 |
if( p->szMalloc ){ |
79306
|
6111 |
110 |
if( VdbeMemDynamic(p) || p->szMalloc ){ |
|
461 |
5650 |
if( VdbeMemDynamic(p) || p->szMalloc ){ |
79316
|
0 |
925 |
if( p->szMalloc ) vdbeMemClear(p); |
79339
|
0 |
4 |
if( r<=(double)minInt ){ |
79341
|
0 |
4 |
}else if( r>=(double)maxInt ){ |
79371
|
3337 |
544 |
if( flags & (MEM_Int|MEM_IntReal) ){ |
79374
|
0 |
544 |
}else if( flags & MEM_Real ){ |
79376
|
464 |
80 |
}else if( (flags & (MEM_Str|MEM_Blob))!=0 && pMem->z!=0 ){ |
|
464 |
0 |
}else if( (flags & (MEM_Str|MEM_Blob))!=0 && pMem->z!=0 ){ |
79399
|
226 |
24 |
if( pMem->flags & MEM_Real ){ |
79401
|
24 |
0 |
}else if( pMem->flags & (MEM_Int|MEM_IntReal) ){ |
79404
|
0 |
0 |
}else if( pMem->flags & (MEM_Str|MEM_Blob) ){ |
79418
|
489 |
340 |
if( pMem->flags & (MEM_Int|MEM_IntReal) ) return pMem->u.i!=0; |
79419
|
128 |
212 |
if( pMem->flags & MEM_Null ) return ifNull; |
79447
|
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
|
79493
|
390 |
0 |
|| (memcmp(&r1, &r2, sizeof(r1))==0 |
|
390 |
0 |
|| (memcmp(&r1, &r2, sizeof(r1))==0 |
79494
|
390 |
0 |
&& i >= -2251799813685248LL && i < 2251799813685248LL); |
|
390 |
0 |
&& i >= -2251799813685248LL && i < 2251799813685248LL); |
79511
|
0 |
0 |
if( (pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Null))==0 ){ |
79517
|
0 |
0 |
if( ((rc==0 || rc==1) && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)<=1) |
|
0 |
0 |
if( ((rc==0 || rc==1) && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)<=1) |
|
0 |
0 |
if( ((rc==0 || rc==1) && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)<=1) |
79518
|
0 |
0 |
|| sqlite3RealSameAsInt(pMem->u.r, (ix = (i64)pMem->u.r)) |
79539
|
0 |
3 |
if( pMem->flags & MEM_Null ) return SQLITE_OK; |
79542
|
0 |
0 |
if( (pMem->flags & MEM_Blob)==0 ){ |
79545
|
0 |
0 |
if( pMem->flags & MEM_Str ) MemSetTypeFlag(pMem, MEM_Blob); |
79602
|
10 |
5513 |
if( VdbeMemDynamic(pMem) ){ |
79621
|
0 |
1 |
if( n<0 ) n = 0; |
79658
|
0 |
1647 |
if( VdbeMemDynamic(pMem) ){ |
79681
|
16 |
0 |
pMem->u.zPType = zPType ? zPType : ""; |
79685
|
0 |
16 |
pMem->xDel = xDestructor ? xDestructor : sqlite3NoopDestructor; |
79695
|
220 |
0 |
if( !sqlite3IsNaN(val) ){ |
79727
|
0 |
8 |
if( p==0 ) return SQLITE_NOMEM; |
79740
|
3202 |
1113 |
if( p->flags & (MEM_Str|MEM_Blob) ){ |
79742
|
0 |
3202 |
if( p->flags & MEM_Zero ){ |
79802
|
0 |
1030 |
if( VdbeMemDynamic(pTo) ){ vdbeClrCopy(pTo,pFrom,srcType); return; } |
79804
|
884 |
146 |
if( (pFrom->flags&MEM_Static)==0 ){ |
79819
|
0 |
158 |
if( VdbeMemDynamic(pTo) ) vdbeMemClearExternAndSetNull(pTo); |
79822
|
104 |
54 |
if( pTo->flags&(MEM_Str|MEM_Blob) ){ |
79823
|
75 |
29 |
if( 0==(pFrom->flags&MEM_Static) ){ |
79888
|
3139 |
22731 |
if( !z ){ |
79893
|
22731 |
0 |
if( pMem->db ){ |
79898
|
19713 |
3018 |
if( nByte<0 ){ |
79900
|
19713 |
0 |
if( enc==SQLITE_UTF8 ){ |
79903
|
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){} |
79906
|
1138 |
1880 |
}else if( enc==0 ){ |
79912
|
0 |
22731 |
if( nByte>iLimit ){ |
79913
|
0 |
0 |
if( xDel && xDel!=SQLITE_TRANSIENT ){ |
|
0 |
0 |
if( xDel && xDel!=SQLITE_TRANSIENT ){ |
79914
|
0 |
0 |
if( xDel==SQLITE_DYNAMIC ){ |
79928
|
19980 |
2751 |
if( xDel==SQLITE_TRANSIENT ){ |
79930
|
17793 |
2187 |
if( flags&MEM_Term ){ |
79931
|
17793 |
0 |
nAlloc += (enc==SQLITE_UTF8?1:2); |
79936
|
198 |
19782 |
if( sqlite3VdbeMemClearAndResize(pMem, (int)MAX(nAlloc,32)) ){ |
|
0 |
19980 |
if( sqlite3VdbeMemClearAndResize(pMem, (int)MAX(nAlloc,32)) ){ |
79943
|
666 |
2085 |
if( xDel==SQLITE_DYNAMIC ){ |
79948
|
1985 |
100 |
flags |= ((xDel==SQLITE_STATIC)?MEM_Static:MEM_Dyn); |
79957
|
0 |
22731 |
if( enc>SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){ |
|
0 |
0 |
if( enc>SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){ |
79989
|
0 |
15 |
if( sqlite3BtreeMaxRecordSize(pCur)
|
79992
|
15 |
0 |
if( SQLITE_OK==(rc = sqlite3VdbeMemClearAndResize(pMem, amt+1)) ){ |
79994
|
15 |
0 |
if( rc==SQLITE_OK ){ |
80021
|
925 |
0 |
if( amt<=available ){ |
80042
|
403 |
353 |
if( pVal->flags & (MEM_Blob|MEM_Str) ){ |
80043
|
0 |
403 |
if( ExpandBlob(pVal) ) return 0; |
|
0 |
0 |
if( ExpandBlob(pVal) ) return 0; |
80045
|
0 |
403 |
if( pVal->enc != (enc & ~SQLITE_UTF16_ALIGNED) ){ |
80048
|
0 |
403 |
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)) ){ |
80050
|
0 |
0 |
if( sqlite3VdbeMemMakeWriteable(pVal)!=SQLITE_OK ){ |
80061
|
756 |
0 |
if( pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) ){ |
80080
|
17 |
9257 |
if( !pVal ) return 0; |
80084
|
8466 |
791 |
if( (pVal->flags&(MEM_Str|MEM_Term))==(MEM_Str|MEM_Term) && pVal->enc==enc ){ |
|
8466 |
0 |
if( (pVal->flags&(MEM_Str|MEM_Term))==(MEM_Str|MEM_Term) && pVal->enc==enc ){ |
80088
|
35 |
756 |
if( pVal->flags&MEM_Null ){ |
80099
|
47 |
0 |
if( p ){ |
80304
|
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; |
80305
|
0 |
0 |
if( op==TK_REGISTER ) op = pExpr->op2; |
80313
|
0 |
0 |
if( op==TK_CAST ){ |
80319
|
0 |
0 |
if( *ppVal ){ |
80329
|
0 |
0 |
if( op==TK_UMINUS |
80330
|
0 |
0 |
&& (pExpr->pLeft->op==TK_INTEGER || pExpr->pLeft->op==TK_FLOAT) ){ |
|
0 |
0 |
&& (pExpr->pLeft->op==TK_INTEGER || pExpr->pLeft->op==TK_FLOAT) ){ |
80337
|
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 ){ |
80339
|
0 |
0 |
if( pVal==0 ) goto no_mem; |
80340
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_IntValue) ){ |
80344
|
0 |
0 |
if( zVal==0 ) goto no_mem; |
80347
|
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 ){ |
80353
|
0 |
0 |
if( pVal->flags & (MEM_Int|MEM_IntReal|MEM_Real) ){ |
80358
|
0 |
0 |
if( enc!=SQLITE_UTF8 ){ |
80361
|
0 |
0 |
}else if( op==TK_UMINUS ) { |
80363
|
0 |
0 |
if( SQLITE_OK==valueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal,pCtx) |
80364
|
0 |
0 |
&& pVal!=0 |
80367
|
0 |
0 |
if( pVal->flags & MEM_Real ){ |
80369
|
0 |
0 |
}else if( pVal->u.i==SMALLEST_INT64 ){ |
80381
|
0 |
0 |
}else if( op==TK_NULL ){ |
80383
|
0 |
0 |
if( pVal==0 ) goto no_mem; |
80387
|
0 |
0 |
else if( op==TK_BLOB ){ |
80393
|
0 |
0 |
if( !pVal ) goto no_mem; |
80406
|
0 |
0 |
else if( op==TK_TRUEFALSE ){ |
80409
|
0 |
0 |
if( pVal ){ |
80450
|
0 |
4721 |
return pExpr ? valueFromExpr(db, pExpr, enc, affinity, ppVal, 0) : 0; |
80679
|
118 |
0 |
if( v ) sqlite3VdbeMemSetStr((Mem *)v, z, n, enc, xDel); |
80686
|
538 |
47 |
if( !v ) return; |
80697
|
0 |
0 |
return valueToText(pVal, enc)!=0 ? pVal->n : 0; |
80702
|
3426 |
775 |
if( (p->flags & MEM_Str)!=0 && pVal->enc==enc ){ |
|
3426 |
0 |
if( (p->flags & MEM_Str)!=0 && pVal->enc==enc ){ |
80705
|
775 |
0 |
if( (p->flags & MEM_Blob)!=0 ){ |
80706
|
0 |
775 |
if( p->flags & MEM_Zero ){ |
80712
|
0 |
0 |
if( p->flags & MEM_Null ) return 0; |
80746
|
0 |
5389 |
if( p==0 ) return 0; |
80749
|
1167 |
4222 |
if( db->pVdbe ){ |
80788
|
24 |
4840 |
if( p==0 ) return; |
80790
|
11 |
4829 |
if( (prepFlags & SQLITE_PREPARE_SAVESQL)==0 ){ |
80890
|
41 |
5389 |
: (sqlite3_int64)(1024/sizeof(Op))); |
80895
|
0 |
5430 |
if( nNew > p->db->aLimit[SQLITE_LIMIT_VDBE_OP] ){ |
80903
|
5430 |
0 |
if( pNew ){ |
80908
|
5430 |
0 |
return (pNew ? SQLITE_OK : SQLITE_NOMEM_BKPT); |
80947
|
0 |
5430 |
if( growOpArray(p, 1) ) return 1; |
80958
|
5430 |
64762 |
if( p->nOpAlloc<=i ){ |
81029
|
1545 |
306 |
for(i=0; (c = zTypes[i])!=0; i++){ |
81030
|
847 |
698 |
if( c=='s' ){ |
81031
|
594 |
253 |
const char *z = va_arg(ap, const char*); |
81032
|
147 |
700 |
sqlite3VdbeAddOp4(p, z==0 ? OP_Null : OP_String8, 0, iDest+i, 0, z, 0); |
81033
|
682 |
16 |
}else if( c=='i' ){ |
81034
|
372 |
310 |
sqlite3VdbeAddOp2(p, OP_Integer, va_arg(ap, int), iDest+i); |
81087
|
0 |
700 |
if( pCtx==0 ){ |
81098
|
0 |
700 |
addr = sqlite3VdbeAddOp4(v, eCallCtx ? OP_PureFunc : OP_Function, |
81119
|
2192 |
0 |
if( p4copy ) memcpy(p4copy, zP4, 8); |
81130
|
1986 |
0 |
if( pParse->addrExplain==0 ) return 0; |
81156
|
0 |
814 |
if( pParse->explain==2 ) |
81171
|
0 |
0 |
if( bPush){ |
81198
|
612 |
302 |
for(j=0; jdb->nDb; j++) sqlite3VdbeUsesBtree(p, j); |
81214
|
9440 |
0 |
if( p->db->mallocFailed==0 ){ |
81275
|
0 |
4821 |
if( p->aLabel==0 ){ |
81297
|
4821 |
6526 |
if( p->nLabelAlloc + p->nLabel < 0 ){ |
81317
|
0 |
0 |
for(i=1; ALWAYS(inOp); i++){ |
81318
|
0 |
0 |
if( ALWAYS(p->aOp[i].opcode==OP_Expire) ){ |
81536
|
21155 |
43766 |
if( pOp->opcode<=SQLITE_MX_JUMP_OPCODE ){ |
81541
|
3225 |
1534 |
if( pOp->p2!=0 ) p->readOnly = 0; |
81560
|
22 |
0 |
if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2; |
81568
|
119 |
29 |
if( n>nMaxArgs ) nMaxArgs = n; |
81574
|
3608 |
12473 |
if( pOp->p2<0 ){ |
81590
|
5379 |
59542 |
if( pOp==p->aOp ) break; |
81593
|
4799 |
580 |
if( aLabel ){ |
81776
|
0 |
36 |
if( p->nOp + nOp > p->nOpAlloc && growOpArray(p, nOp) ){ |
|
0 |
0 |
if( p->nOp + nOp > p->nOpAlloc && growOpArray(p, nOp) ){ |
81780
|
222 |
36 |
for(i=0; i
|
81785
|
41 |
181 |
if( (sqlite3OpcodeProperty[aOp->opcode] & OPFLG_JUMP)!=0 && aOp->p2>0 ){ |
|
41 |
0 |
if( (sqlite3OpcodeProperty[aOp->opcode] & OPFLG_JUMP)!=0 && aOp->p2>0 ){ |
81856
|
12411 |
0 |
if( p->nOp>0 ) p->aOp[p->nOp-1].p5 = p5; |
81881
|
27 |
14 |
if( addr==p->nOp-1 ){ |
81901
|
25 |
951 |
if( (pDef->funcFlags & SQLITE_FUNC_EPHEM)!=0 ){ |
81910
|
0 |
0 |
if( p->szMalloc ) sqlite3DbFree(db, p->zMalloc); |
81932
|
762 |
0 |
if( db->pnBytesFreed==0 ) sqlite3KeyInfoUnref((KeyInfo*)p4); |
81946
|
0 |
0 |
if( db->pnBytesFreed==0 ){ |
81954
|
192 |
0 |
if( db->pnBytesFreed==0 ) sqlite3VtabUnlock((VTable *)p4); |
81967
|
5389 |
0 |
if( aOp ){ |
81970
|
8298 |
56659 |
if( pOp->p4type <= P4_FREE_IF_LE ) freeP4(db, pOp->p4type, pOp->p4.p); |
81974
|
5389 |
59568 |
if( pOp==aOp ) break; |
82003
|
0 |
801 |
if( p->db->mallocFailed ) return 0; |
82018
|
8 |
0 |
if( p->nOp>0 && p->aOp[p->nOp-1].opcode==op ){ |
|
0 |
8 |
if( p->nOp>0 && p->aOp[p->nOp-1].opcode==op ){ |
82083
|
1246 |
4108 |
if( pOp->p4type ){ |
82088
|
1246 |
4108 |
if( n<0 ){ |
82091
|
3495 |
613 |
if( n==0 ) n = sqlite3Strlen30(zP4); |
82103
|
0 |
12067 |
if( db->mallocFailed ){ |
82104
|
0 |
0 |
if( n!=P4_VTAB ) freeP4(db, n, (void*)*(char**)&zP4); |
82109
|
1802 |
10265 |
if( addr<0 ){ |
82113
|
7959 |
4108 |
if( n>=0 || pOp->p4type ){ |
|
1246 |
6713 |
if( n>=0 || pOp->p4type ){ |
82117
|
1246 |
5467 |
if( n==P4_INT32 ){ |
82122
|
5377 |
90 |
}else if( zP4!=0 ){ |
82126
|
192 |
5185 |
if( n==P4_VTAB ) sqlite3VtabLock((VTable*)zP4); |
82143
|
0 |
3140 |
if( p->db->mallocFailed ){ |
82165
|
77 |
0 |
if( pKeyInfo ) sqlite3VdbeAppendP4(v, pKeyInfo, P4_KEYINFO); |
82230
|
237 |
6288 |
if( addr<0 ){ |
82234
|
0 |
6525 |
if( p->db->mallocFailed ){ |
82443
|
0 |
0 |
for(j=0; jnKeyField; j++){ |
82445
|
0 |
0 |
const char *zColl = pColl ? pColl->zName : ""; |
82446
|
0 |
0 |
if( strcmp(zColl, "BINARY")==0 ) zColl = "B"; |
82447
|
0 |
0 |
sqlite3_str_appendf(&x, ",%s%s%s", |
|
0 |
0 |
sqlite3_str_appendf(&x, ",%s%s%s", |
82493
|
0 |
0 |
if( pMem->flags & MEM_Str ){ |
82495
|
0 |
0 |
}else if( pMem->flags & (MEM_Int|MEM_IntReal) ){ |
82497
|
0 |
0 |
}else if( pMem->flags & MEM_Real ){ |
82499
|
0 |
0 |
}else if( pMem->flags & MEM_Null ){ |
82519
|
0 |
0 |
for(i=1; i<=n; i++){ |
82520
|
0 |
0 |
sqlite3_str_appendf(&x, "%c%u", (i==1 ? '[' : ','), ai[i]); |
82537
|
0 |
0 |
if( zP4 ) sqlite3_str_appendall(&x, zP4); |
82538
|
0 |
0 |
if( (x.accError & SQLITE_NOMEM)!=0 ){ |
82557
|
2753 |
2917 |
if( i!=1 && sqlite3BtreeSharable(p->db->aDb[i].pBt) ){ |
|
0 |
2753 |
if( i!=1 && sqlite3BtreeSharable(p->db->aDb[i].pBt) ){ |
82589
|
18706 |
0 |
if( DbMaskAllZero(p->lockMask) ) return; /* The common case */ |
82593
|
0 |
0 |
for(i=0; i
|
82594
|
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) ){ |
82613
|
0 |
0 |
for(i=0; i
|
82614
|
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) ){ |
82620
|
18706 |
0 |
if( DbMaskAllZero(p->lockMask) ) return; /* The common case */ |
82674
|
7943 |
4825 |
if( N>0 ){ |
82683
|
48015 |
7943 |
}while( (--N)>0 ); |
82696
|
13653 |
0 |
if( p && N ){ |
|
8828 |
4825 |
if( p && N ){ |
82699
|
0 |
8828 |
if( db->pnBytesFreed ){ |
82701
|
0 |
0 |
if( p->szMalloc ) sqlite3DbFree(db, p->zMalloc); |
82702
|
0 |
0 |
}while( (++p)
|
82723
|
51 |
63258 |
if( p->flags&(MEM_Agg|MEM_Dyn) ){ |
82727
|
33381 |
29877 |
}else if( p->szMalloc ){ |
82737
|
54481 |
8828 |
}while( (++p)
|
82801
|
0 |
0 |
if( pSub!=0 ){ |
82802
|
0 |
0 |
if( pSub->flags&MEM_Blob ){ |
82808
|
0 |
0 |
for(i=0; i
|
82815
|
0 |
0 |
if( i>=nRow ){ |
82820
|
0 |
0 |
if( inOp ){ |
82831
|
0 |
0 |
for(j=0; i>=apSub[j]->nOp; j++){ |
82843
|
0 |
0 |
if( pSub!=0 && aOp[i].p4type==P4_SUBPROGRAM ){ |
|
0 |
0 |
if( pSub!=0 && aOp[i].p4type==P4_SUBPROGRAM ){ |
82846
|
0 |
0 |
for(j=0; j
|
82847
|
0 |
0 |
if( apSub[j]==aOp[i].p4.pProgram ) break; |
82849
|
0 |
0 |
if( j==nSub ){ |
82851
|
0 |
0 |
if( p->rc!=SQLITE_OK ){ |
82862
|
0 |
0 |
if( eMode==0 ) break; |
82873
|
0 |
0 |
if( aOp[i].opcode==OP_Explain ) break; |
82874
|
0 |
0 |
if( aOp[i].opcode==OP_Init && iPc>1 ) break; |
|
0 |
0 |
if( aOp[i].opcode==OP_Init && iPc>1 ) break; |
82894
|
0 |
0 |
for(i=0; inChildCsr; i++){ |
82895
|
0 |
0 |
if( apCsr[i] ) sqlite3VdbeFreeCursorNN(p->v, apCsr[i]); |
82929
|
0 |
0 |
int bListSubprogs = (p->explain==1 || (db->flags & SQLITE_TriggerEQP)!=0); |
|
0 |
0 |
int bListSubprogs = (p->explain==1 || (db->flags & SQLITE_TriggerEQP)!=0); |
82944
|
0 |
0 |
if( p->rc==SQLITE_NOMEM ){ |
82951
|
0 |
0 |
if( bListSubprogs ){ |
82965
|
0 |
0 |
if( rc==SQLITE_OK ){ |
82967
|
0 |
0 |
if( AtomicLoad(&db->u1.isInterrupted) ){ |
82973
|
0 |
0 |
if( p->explain==2 ){ |
83000
|
0 |
0 |
if( db->mallocFailed ){ |
83092
|
21986 |
1218 |
if( pBuf==0 ){ |
83094
|
21516 |
470 |
if( nByte <= p->nFree ){ |
83195
|
986 |
4393 |
if( nCursor==0 && nMem>0 ) nMem++; /* Space for aMem[0] even if not used */ |
|
695 |
291 |
if( nCursor==0 && nMem>0 ) nMem++; /* Space for aMem[0] even if not used */ |
83209
|
335 |
5044 |
p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort); |
|
310 |
25 |
p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort); |
83210
|
0 |
5379 |
if( pParse->explain ){ |
83216
|
0 |
0 |
if( nMem<10 ) nMem = 10; |
83218
|
0 |
0 |
if( pParse->explain==2 ){ |
83227
|
0 |
0 |
for(i=iFirst; i
|
83252
|
422 |
4957 |
if( x.nNeeded ){ |
83255
|
422 |
0 |
if( !db->mallocFailed ){ |
83266
|
0 |
5379 |
if( db->mallocFailed ){ |
83289
|
677 |
235 |
if( pCx ) sqlite3VdbeFreeCursorNN(p,pCx); |
83320
|
7256 |
6264 |
for(i=0; inCursor; i++){ |
83322
|
5878 |
1378 |
if( pC ){ |
83364
|
0 |
6264 |
if( p->pFrame ){ |
83366
|
0 |
0 |
for(pFrame=p->pFrame; pFrame->pParent; pFrame=pFrame->pParent); |
83374
|
0 |
6264 |
while( p->pDelFrame ){ |
83381
|
0 |
6264 |
if( p->pAuxData ) sqlite3VdbeDeleteAuxData(p->db, &p->pAuxData, -1, 0); |
83395
|
4 |
2006 |
if( p->nResColumn ){ |
83402
|
0 |
2010 |
if( p->aColName==0 ) return; |
83427
|
0 |
22353 |
if( p->db->mallocFailed ){ |
83473
|
7233 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
|
4855 |
2378 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
83475
|
1079 |
3776 |
if( sqlite3BtreeTxnState(pBt)==SQLITE_TXN_WRITE ){ |
83491
|
878 |
201 |
if( db->aDb[i].safety_level!=PAGER_SYNCHRONOUS_OFF |
83492
|
95 |
783 |
&& aMJNeeded[sqlite3PagerGetJournalMode(pPager)] |
83493
|
95 |
0 |
&& sqlite3PagerIsMemdb(pPager)==0 |
83502
|
0 |
2378 |
if( rc!=SQLITE_OK ){ |
83507
|
1061 |
1317 |
if( needXcommit && db->xCommitCallback ){ |
|
10 |
1051 |
if( needXcommit && db->xCommitCallback ){ |
83509
|
4 |
6 |
if( rc ){ |
83523
|
323 |
2051 |
if( 0==sqlite3Strlen30(sqlite3BtreeGetFilename(db->aDb[0].pBt)) |
83524
|
323 |
0 |
|| nTrans<=1 |
83526
|
7221 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
|
4847 |
2374 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
83528
|
2833 |
2014 |
if( pBt ){ |
83538
|
7221 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
|
4847 |
2374 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
83540
|
2833 |
2014 |
if( pBt ){ |
83544
|
2374 |
0 |
if( rc==SQLITE_OK ){ |
83567
|
0 |
0 |
if( zSuper==0 ) return SQLITE_NOMEM_BKPT; |
83571
|
0 |
0 |
if( retryCount ){ |
83572
|
0 |
0 |
if( retryCount>100 ){ |
83576
|
0 |
0 |
}else if( retryCount==1 ){ |
83589
|
0 |
0 |
}while( rc==SQLITE_OK && res ); |
|
0 |
0 |
}while( rc==SQLITE_OK && res ); |
83590
|
0 |
0 |
if( rc==SQLITE_OK ){ |
83597
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
83608
|
0 |
0 |
for(i=0; inDb; i++){ |
83610
|
0 |
0 |
if( sqlite3BtreeTxnState(pBt)==SQLITE_TXN_WRITE ){ |
83612
|
0 |
0 |
if( zFile==0 ){ |
83618
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
83630
|
0 |
0 |
if( 0==(sqlite3OsDeviceCharacteristics(pSuperJrnl)&SQLITE_IOCAP_SEQUENTIAL) |
83631
|
0 |
0 |
&& SQLITE_OK!=(rc = sqlite3OsSync(pSuperJrnl, SQLITE_SYNC_NORMAL)) |
83649
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
83651
|
0 |
0 |
if( pBt ){ |
83657
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
83669
|
0 |
0 |
if( rc ){ |
83682
|
0 |
0 |
for(i=0; inDb; i++){ |
83684
|
0 |
0 |
if( pBt ){ |
83750
|
108 |
54 |
for(i=0; inDb; i++){ |
83753
|
54 |
54 |
if( pBt ){ |
83754
|
0 |
54 |
if( eOp==SAVEPOINT_ROLLBACK ){ |
83757
|
54 |
0 |
if( rc2==SQLITE_OK ){ |
83760
|
54 |
0 |
if( rc==SQLITE_OK ){ |
83768
|
54 |
0 |
if( rc==SQLITE_OK ){ |
83769
|
0 |
54 |
if( eOp==SAVEPOINT_ROLLBACK ){ |
83772
|
54 |
0 |
if( rc==SQLITE_OK ){ |
83780
|
0 |
54 |
if( eOp==SAVEPOINT_ROLLBACK ){ |
83787
|
108 |
3187 |
if( p->db->nStatement && p->iStatement ){ |
|
54 |
54 |
if( p->db->nStatement && p->iStatement ){ |
83807
|
2587 |
5654 |
if( (deferred && (db->nDeferredCons+db->nDeferredImmCons)>0) |
|
2587 |
0 |
if( (deferred && (db->nDeferredCons+db->nDeferredImmCons)>0) |
83808
|
5654 |
2587 |
|| (!deferred && p->nFkConstraint>0) |
|
1 |
5653 |
|| (!deferred && p->nFkConstraint>0) |
83813
|
0 |
1 |
if( (p->prepFlags & SQLITE_PREPARE_SAVESQL)==0 ) return SQLITE_ERROR; |
83854
|
0 |
6264 |
if( db->mallocFailed ){ |
83862
|
5692 |
572 |
if( p->bIsReader ){ |
83871
|
38 |
5654 |
if( p->rc ){ |
83874
|
38 |
0 |
|| mrc==SQLITE_IOERR |
83875
|
38 |
0 |
|| mrc==SQLITE_INTERRUPT |
83876
|
38 |
0 |
|| mrc==SQLITE_FULL; |
|
0 |
38 |
|| mrc==SQLITE_FULL; |
83880
|
0 |
5692 |
if( isSpecialError ){ |
83893
|
0 |
0 |
if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){ |
|
0 |
0 |
if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){ |
83894
|
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 ){ |
83909
|
38 |
5654 |
if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){ |
|
0 |
38 |
if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){ |
83919
|
547 |
5145 |
if( !sqlite3VtabInSync(db) |
|
259 |
288 |
if( !sqlite3VtabInSync(db) |
83920
|
2812 |
2592 |
&& db->autoCommit |
83921
|
2397 |
415 |
&& db->nVdbeWrite==(p->readOnly==0) |
83923
|
19 |
2378 |
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) ){ |
83925
|
0 |
2378 |
if( rc!=SQLITE_OK ){ |
83926
|
0 |
0 |
if( NEVER(p->readOnly) ){ |
83931
|
0 |
2378 |
}else if( db->flags & SQLITE_CorruptRdOnly ){ |
83941
|
0 |
2378 |
if( rc==SQLITE_BUSY && p->readOnly ){ |
|
0 |
0 |
if( rc==SQLITE_BUSY && p->readOnly ){ |
83944
|
4 |
2374 |
}else if( rc!=SQLITE_OK ){ |
83959
|
3295 |
0 |
}else if( eStatementOp==0 ){ |
83960
|
20 |
3275 |
if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){ |
|
0 |
20 |
if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){ |
83962
|
20 |
0 |
}else if( p->errorAction==OE_Abort ){ |
83978
|
3295 |
2397 |
if( eStatementOp ){ |
83980
|
0 |
3295 |
if( rc ){ |
83981
|
0 |
0 |
if( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_CONSTRAINT ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_CONSTRAINT ){ |
83996
|
3354 |
2338 |
if( p->changeCntOn ){ |
83997
|
3354 |
0 |
if( eStatementOp!=SAVEPOINT_ROLLBACK ){ |
84011
|
3728 |
2536 |
if( !p->readOnly ) db->nVdbeWrite--; |
84012
|
5692 |
572 |
if( p->bIsReader ) db->nVdbeRead--; |
84018
|
0 |
6264 |
if( db->mallocFailed ){ |
84031
|
7 |
6257 |
return (p->rc==SQLITE_BUSY ? SQLITE_BUSY : SQLITE_OK); |
84054
|
76 |
375 |
if( p->zErrMsg ){ |
84057
|
14 |
62 |
if( db->pErr==0 ) db->pErr = sqlite3ValueNew(db); |
84061
|
363 |
12 |
}else if( db->pErr ){ |
84113
|
541 |
7126 |
if( p->eVdbeState==VDBE_RUN_STATE ) sqlite3VdbeHalt(p); |
84120
|
6264 |
1403 |
if( p->pc>=0 ){ |
84122
|
5863 |
401 |
if( db->pErr || p->zErrMsg ){ |
|
0 |
5863 |
if( db->pErr || p->zErrMsg ){ |
84139
|
38 |
7629 |
if( p->zErrMsg ){ |
84195
|
5379 |
10 |
if( p->eVdbeState>=VDBE_READY_STATE ){ |
84220
|
0 |
6 |
while( *pp ){ |
84222
|
0 |
0 |
if( (iOp<0) |
84223
|
0 |
0 |
|| (pAux->iAuxOp==iOp |
84224
|
0 |
0 |
&& pAux->iAuxArg>=0 |
84225
|
0 |
0 |
&& (pAux->iAuxArg>31 || !(mask & MASKBIT32(pAux->iAuxArg)))) |
|
0 |
0 |
&& (pAux->iAuxArg>31 || !(mask & MASKBIT32(pAux->iAuxArg)))) |
84228
|
0 |
0 |
if( pAux->xDeleteAux ){ |
84250
|
2006 |
3383 |
if( p->aColName ){ |
84254
|
0 |
5389 |
for(pSub=p->pProgram; pSub; pSub=pNext){ |
84259
|
5379 |
10 |
if( p->eVdbeState!=VDBE_INIT_STATE ){ |
84261
|
22 |
5357 |
if( p->pVList ) sqlite3DbFreeNN(db, p->pVList); |
84262
|
422 |
4957 |
if( p->pFree ) sqlite3DbFreeNN(db, p->pFree); |
84297
|
5389 |
0 |
if( db->pnBytesFreed==0 ){ |
84298
|
133 |
5256 |
if( p->pPrev ){ |
84304
|
1100 |
4289 |
if( p->pNext ){ |
84325
|
0 |
430 |
if( rc ) return rc; |
84326
|
0 |
430 |
if( res!=0 ) return SQLITE_CORRUPT_BKPT; |
84349
|
0 |
0 |
if( isDifferentRow ) p->nullRow = 1; |
84359
|
0 |
1118 |
if( sqlite3BtreeCursorHasMoved(p->uc.pCursor) ){ |
84504
|
632 |
20211 |
if( serial_type>=128 ){ |
84594
|
84 |
62837 |
if( serial_type==6 ){ |
84618
|
0 |
62837 |
pMem->flags = IsNaN(x) ? MEM_Null : MEM_Real; |
|
0 |
0 |
pMem->flags = IsNaN(x) ? MEM_Null : MEM_Real; |
84734
|
0 |
213 |
if( !p ) return 0; |
84762
|
20122 |
0 |
idx = getVarint32(aKey, szHdr); |
84765
|
20132 |
0 |
while( idx
|
|
20132 |
0 |
while( idx
|
84768
|
20132 |
0 |
idx += getVarint32(&aKey[idx], serial_type); |
84777
|
20122 |
10 |
if( (++u)>=p->nField ) break; |
84779
|
0 |
20122 |
if( d>(u32)nKey && u ){ |
|
0 |
0 |
if( d>(u32)nKey && u ){ |
84950
|
2373 |
0 |
if( pMem1->enc==pColl->enc ){ |
84965
|
0 |
0 |
if( (v1==0 || v2==0) ){ |
|
0 |
0 |
if( (v1==0 || v2==0) ){ |
84966
|
0 |
0 |
if( prcErr ) *prcErr = SQLITE_NOMEM_BKPT; |
84983
|
0 |
0 |
for(i=0; i
|
84984
|
0 |
0 |
if( z[i] ) return 0; |
85006
|
0 |
191 |
if( (pB1->flags|pB2->flags) & MEM_Zero ){ |
85007
|
0 |
0 |
if( pB1->flags & pB2->flags & MEM_Zero ){ |
85009
|
0 |
0 |
}else if( pB1->flags & MEM_Zero ){ |
85010
|
0 |
0 |
if( !isAllZero(pB2->z, pB2->n) ) return -1; |
85013
|
0 |
0 |
if( !isAllZero(pB1->z, pB1->n) ) return +1; |
85018
|
0 |
191 |
if( c ) return c; |
85033
|
0 |
0 |
if( x
|
85034
|
0 |
0 |
if( x>r ) return +1; /*NO_TEST*/ /* work around bugs in gcov */ |
85072
|
25 |
2409 |
if( combined_flags&MEM_Null ){ |
85078
|
541 |
1868 |
if( combined_flags&(MEM_Int|MEM_Real|MEM_IntReal) ){ |
85082
|
405 |
136 |
if( (f1 & f2 & (MEM_Int|MEM_IntReal))!=0 ){ |
85085
|
44 |
361 |
if( pMem1->u.i < pMem2->u.i ) return -1; |
85086
|
21 |
340 |
if( pMem1->u.i > pMem2->u.i ) return +1; |
85089
|
0 |
136 |
if( (f1 & f2 & MEM_Real)!=0 ){ |
85090
|
0 |
0 |
if( pMem1->u.r < pMem2->u.r ) return -1; |
85091
|
0 |
0 |
if( pMem1->u.r > pMem2->u.r ) return +1; |
85094
|
16 |
120 |
if( (f1&(MEM_Int|MEM_IntReal))!=0 ){ |
85097
|
0 |
16 |
if( (f2&MEM_Real)!=0 ){ |
85099
|
0 |
16 |
}else if( (f2&(MEM_Int|MEM_IntReal))!=0 ){ |
85100
|
0 |
0 |
if( pMem1->u.i < pMem2->u.i ) return -1; |
85101
|
0 |
0 |
if( pMem1->u.i > pMem2->u.i ) return +1; |
85107
|
120 |
0 |
if( (f1&MEM_Real)!=0 ){ |
85108
|
0 |
120 |
if( (f2&(MEM_Int|MEM_IntReal))!=0 ){ |
85122
|
1868 |
0 |
if( combined_flags&MEM_Str ){ |
85123
|
0 |
1868 |
if( (f1 & MEM_Str)==0 ){ |
85126
|
0 |
1868 |
if( (f2 & MEM_Str)==0 ){ |
85140
|
1677 |
191 |
if( pColl ){ |
85232
|
60 |
36047 |
if( bSkip ){ |
85234
|
60 |
0 |
if( s1<0x80 ){ |
85244
|
36047 |
0 |
if( (szHdr1 = aKey1[0])<0x80 ){ |
85252
|
0 |
36107 |
if( d1>(unsigned)nKey1 ){ |
85267
|
543 |
35583 |
if( pRhs->flags & (MEM_Int|MEM_IntReal) ){ |
85272
|
0 |
543 |
if( serial_type>=10 ){ |
85274
|
8 |
535 |
}else if( serial_type==0 ){ |
85276
|
0 |
535 |
}else if( serial_type==7 ){ |
85282
|
96 |
439 |
if( lhs
|
85284
|
4 |
435 |
}else if( lhs>rhs ){ |
85291
|
34839 |
744 |
else if( pRhs->flags & MEM_Real ){ |
85293
|
0 |
34839 |
if( serial_type>=10 ){ |
85299
|
0 |
34839 |
}else if( serial_type==0 ){ |
85303
|
34839 |
0 |
if( serial_type==7 ){ |
85304
|
17463 |
17376 |
if( mem1.u.ru.r ){ |
85306
|
17376 |
0 |
}else if( mem1.u.r>pRhs->u.r ){ |
85316
|
702 |
42 |
else if( pRhs->flags & MEM_Str ){ |
85317
|
0 |
702 |
getVarint32NR(&aKey1[idx1], serial_type); |
85319
|
6 |
696 |
if( serial_type<12 ){ |
85321
|
0 |
696 |
}else if( !(serial_type & 0x01) ){ |
85327
|
696 |
0 |
if( (d1+mem1.n) > (unsigned)nKey1 |
85328
|
0 |
696 |
|| (pKeyInfo = pPKey2->pKeyInfo)->nAllField<=i |
85332
|
696 |
0 |
}else if( pKeyInfo->aColl[i] ){ |
85343
|
0 |
0 |
if( rc==0 ) rc = mem1.n - pRhs->n; |
85349
|
0 |
42 |
else if( pRhs->flags & MEM_Blob ){ |
85351
|
0 |
0 |
getVarint32NR(&aKey1[idx1], serial_type); |
85353
|
0 |
0 |
if( serial_type<12 || (serial_type & 0x01) ){ |
|
0 |
0 |
if( serial_type<12 || (serial_type & 0x01) ){ |
85359
|
0 |
0 |
if( (d1+nStr) > (unsigned)nKey1 ){ |
85362
|
0 |
0 |
}else if( pRhs->flags & MEM_Zero ){ |
85363
|
0 |
0 |
if( !isAllZero((const char*)&aKey1[d1],nStr) ){ |
85371
|
0 |
0 |
if( rc==0 ) rc = nStr - pRhs->n; |
85382
|
35599 |
527 |
if( rc!=0 ){ |
85384
|
17430 |
18169 |
if( sortFlags ){ |
85385
|
0 |
17430 |
if( (sortFlags & KEYINFO_ORDER_BIGNULL)==0 |
85386
|
0 |
0 |
|| ((sortFlags & KEYINFO_ORDER_DESC) |
85387
|
0 |
0 |
!=(serial_type==0 || (pRhs->flags&MEM_Null))) |
|
0 |
0 |
!=(serial_type==0 || (pRhs->flags&MEM_Null))) |
85398
|
508 |
19 |
if( i==pPKey2->nField ) break; |
85402
|
19 |
0 |
}while( idx1<(unsigned)szHdr1 && d1<=(unsigned)nKey1 ); |
|
19 |
0 |
}while( idx1<(unsigned)szHdr1 && d1<=(unsigned)nKey1 ); |
85506
|
378 |
114 |
if( v>lhs ){ |
85508
|
2 |
112 |
}else if( v
|
85510
|
55 |
57 |
}else if( pPKey2->nField>1 ){ |
85546
|
2 |
11 |
if( serial_type<12 ){ |
85547
|
0 |
2 |
if( serial_type<0 ){ |
85549
|
0 |
0 |
if( serial_type>=12 ) goto vrcs_restart; |
85553
|
0 |
11 |
}else if( !(serial_type & 0x01) ){ |
85561
|
0 |
11 |
if( (szHdr + nStr) > nKey1 ){ |
85568
|
0 |
11 |
if( res>0 ){ |
85570
|
1 |
10 |
}else if( res<0 ){ |
85574
|
4 |
6 |
if( res==0 ){ |
85575
|
0 |
4 |
if( pPKey2->nField>1 ){ |
85581
|
0 |
6 |
}else if( res>0 ){ |
85615
|
283 |
0 |
if( p->pKeyInfo->nAllField<=13 ){ |
85617
|
0 |
283 |
if( p->pKeyInfo->aSortFlags[0] ){ |
85618
|
0 |
0 |
if( p->pKeyInfo->aSortFlags[0] & KEYINFO_ORDER_BIGNULL ){ |
85627
|
234 |
49 |
if( (flags & MEM_Int) ){ |
85634
|
33 |
16 |
if( (flags & (MEM_Real|MEM_IntReal|MEM_Null|MEM_Blob))==0 |
85635
|
15 |
18 |
&& p->pKeyInfo->aColl[0]==0 |
85675
|
0 |
450 |
if( rc ){ |
85680
|
0 |
450 |
getVarint32NR((u8*)m.z, szHdr); |
85685
|
450 |
0 |
if( unlikely(szHdr<3 || szHdr>(unsigned)m.n) ){ |
|
450 |
0 |
if( unlikely(szHdr<3 || szHdr>(unsigned)m.n) ){ |
85691
|
0 |
450 |
getVarint32NR((u8*)&m.z[szHdr-1], typeRowid); |
85700
|
450 |
0 |
if( unlikely(typeRowid<1 || typeRowid>9 || typeRowid==7) ){ |
|
450 |
0 |
if( unlikely(typeRowid<1 || typeRowid>9 || typeRowid==7) ){ |
|
450 |
0 |
if( unlikely(typeRowid<1 || typeRowid>9 || typeRowid==7) ){ |
85705
|
0 |
450 |
if( unlikely((u32)m.n
|
85751
|
0 |
0 |
if( nCellKey<=0 || nCellKey>0x7fffffff ){ |
|
0 |
0 |
if( nCellKey<=0 || nCellKey>0x7fffffff ){ |
85757
|
0 |
0 |
if( rc ){ |
85803
|
191 |
507 |
for(p = db->pVdbe; p; p=p->pNext){ |
85832
|
0 |
0 |
if( v ){ |
85835
|
0 |
0 |
if( 0==(pMem->flags & MEM_Null) ){ |
85837
|
0 |
0 |
if( pRet ){ |
85855
|
0 |
0 |
if( iVar>=32 ){ |
85877
|
0 |
0 |
if( pOp->opcode==OP_PureFunc ){ |
85880
|
0 |
0 |
if( pOp->p5 & NC_IsCheck ){ |
85882
|
0 |
0 |
}else if( pOp->p5 & NC_GenCol ){ |
85903
|
0 |
2123 |
if( pVtab->zErrMsg ){ |
86037
|
0 |
0 |
return p==0 || p->expired; |
|
0 |
0 |
return p==0 || p->expired; |
86047
|
0 |
17873 |
if( p->db==0 ){ |
86055
|
0 |
16069 |
if( p==0 ){ |
86078
|
6 |
0 |
if( db->xProfile ){ |
86082
|
0 |
6 |
if( db->mTrace & SQLITE_TRACE_PROFILE ){ |
86108
|
1266 |
1804 |
if( pStmt==0 ){ |
86115
|
0 |
1804 |
if( vdbeSafety(v) ) return SQLITE_MISUSE_BKPT; |
86117
|
0 |
1804 |
checkProfileCallback(db, v); |
86135
|
104 |
2288 |
if( pStmt==0 ){ |
86141
|
0 |
2288 |
checkProfileCallback(db, v); |
86162
|
0 |
0 |
for(i=0; inVar; i++){ |
86167
|
0 |
0 |
if( p->expmask ){ |
86181
|
782 |
0 |
if( p->flags & (MEM_Blob|MEM_Str) ){ |
86182
|
0 |
782 |
if( ExpandBlob(p)!=SQLITE_OK ){ |
|
0 |
0 |
if( ExpandBlob(p)!=SQLITE_OK ){ |
86187
|
780 |
2 |
return p->n ? p->z : 0; |
86209
|
0 |
0 |
return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0); |
86213
|
16 |
0 |
if( (p->flags&(MEM_TypeMask|MEM_Term|MEM_Subtype)) == |
86215
|
16 |
0 |
&& zPType!=0 |
86216
|
16 |
0 |
&& p->eSubtype=='p' |
86217
|
16 |
0 |
&& strcmp(p->u.zPType, zPType)==0 |
86341
|
0 |
0 |
if( pOrig==0 ) return 0; |
86343
|
0 |
0 |
if( pNew==0 ) return 0; |
86348
|
0 |
0 |
if( pNew->flags&(MEM_Str|MEM_Blob) ){ |
86351
|
0 |
0 |
if( sqlite3VdbeMemMakeWriteable(pNew)!=SQLITE_OK ){ |
86355
|
0 |
0 |
}else if( pNew->flags & MEM_Null ){ |
86390
|
0 |
1274 |
if( rc ){ |
86391
|
0 |
0 |
if( rc==SQLITE_TOOBIG ){ |
86402
|
0 |
1274 |
if( sqlite3VdbeMemTooBig(pOut) ){ |
86412
|
0 |
0 |
if( xDel==0 ){ |
86414
|
0 |
0 |
}else if( xDel==SQLITE_TRANSIENT ){ |
86440
|
0 |
0 |
if( n>0x7fffffff ){ |
86510
|
0 |
0 |
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE; |
86511
|
0 |
0 |
if( n>0x7fffffff ){ |
86551
|
0 |
102 |
if( sqlite3VdbeMemTooBig(pOut) ){ |
86561
|
0 |
1 |
if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
86573
|
0 |
0 |
pCtx->isError = errCode ? errCode : -1; |
86577
|
0 |
0 |
if( pCtx->pOut->flags & MEM_Null ){ |
86606
|
0 |
0 |
if( pCtx->pOut->flags & MEM_Int ){ |
86622
|
6400 |
3120 |
for(i=0; inDb; i++){ |
86624
|
3828 |
2572 |
if( pBt ){ |
86629
|
0 |
3828 |
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 ){ |
86654
|
6265 |
6663 |
if( p->eVdbeState!=VDBE_RUN_STATE ){ |
86656
|
6265 |
0 |
if( p->eVdbeState==VDBE_READY_STATE ){ |
86657
|
1 |
6264 |
if( p->expired ){ |
86660
|
1 |
0 |
if( (p->prepFlags & SQLITE_PREPARE_SAVESQL)!=0 ){ |
86675
|
5174 |
1090 |
if( db->nVdbeActive==0 ){ |
86684
|
8 |
6256 |
if( (db->mTrace & (SQLITE_TRACE_PROFILE|SQLITE_TRACE_XPROFILE))!=0 |
86685
|
6 |
2 |
&& !db->init.busy && p->zSql ){ |
|
6 |
0 |
&& !db->init.busy && p->zSql ){ |
86693
|
3728 |
2536 |
if( p->readOnly==0 ) db->nVdbeWrite++; |
86694
|
5692 |
572 |
if( p->bIsReader ) db->nVdbeRead++; |
86699
|
0 |
0 |
if( ALWAYS(p->eVdbeState==VDBE_HALT_STATE) ){ |
86734
|
0 |
12927 |
if( p->explain ){ |
86744
|
7197 |
5730 |
if( rc==SQLITE_ROW ){ |
86752
|
6 |
5724 |
checkProfileCallback(db, p); |
86755
|
5681 |
49 |
if( rc==SQLITE_DONE && db->autoCommit ){ |
|
3120 |
2561 |
if( rc==SQLITE_DONE && db->autoCommit ){ |
86758
|
0 |
3120 |
if( p->rc!=SQLITE_OK ){ |
86761
|
49 |
2561 |
}else if( rc!=SQLITE_DONE && (p->prepFlags & SQLITE_PREPARE_SAVESQL)!=0 ){ |
|
49 |
0 |
}else if( rc!=SQLITE_DONE && (p->prepFlags & SQLITE_PREPARE_SAVESQL)!=0 ){ |
86771
|
0 |
5730 |
if( SQLITE_NOMEM==sqlite3ApiExit(p->db, p->rc) ){ |
86773
|
0 |
0 |
if( (p->prepFlags & SQLITE_PREPARE_SAVESQL)!=0 ) rc = p->rc; |
86796
|
0 |
12927 |
if( vdbeSafetyNotNull(v) ){ |
86801
|
1 |
12927 |
while( (rc = sqlite3Step(v))==SQLITE_SCHEMA |
86802
|
1 |
0 |
&& cnt++ < SQLITE_MAX_SCHEMA_RETRY ){ |
86805
|
0 |
1 |
if( rc!=SQLITE_OK ){ |
86816
|
0 |
0 |
if( !db->mallocFailed ){ |
86826
|
0 |
1 |
if( savedPc>=0 ){ |
86896
|
0 |
0 |
if( pVal==0 ) return SQLITE_MISUSE; |
86898
|
0 |
0 |
if( pRhs==0 ) return SQLITE_MISUSE; |
86899
|
0 |
0 |
if( bNext ){ |
86905
|
0 |
0 |
if( sqlite3BtreeEof(pRhs->pCsr) ) rc = SQLITE_DONE; |
86907
|
0 |
0 |
if( rc==SQLITE_OK ){ |
86913
|
0 |
0 |
if( rc==SQLITE_OK ){ |
86917
|
0 |
0 |
int iOff = 1 + getVarint32(&zBuf[1], iSerial); |
86920
|
0 |
0 |
if( (pOut->flags & MEM_Ephem)!=0 && sqlite3VdbeMemMakeWriteable(pOut) ){ |
|
0 |
0 |
if( (pOut->flags & MEM_Ephem)!=0 && sqlite3VdbeMemMakeWriteable(pOut) ){ |
86963
|
0 |
0 |
if( *piTime==0 ){ |
86965
|
0 |
0 |
if( rc ) *piTime = 0; |
86977
|
81 |
138 |
if( nByte<=0 ){ |
86984
|
138 |
0 |
if( pMem->z ){ |
87000
|
219 |
500 |
if( (p->pMem->flags & MEM_Agg)==0 ){ |
87026
|
0 |
0 |
for(pAuxData=pCtx->pVdbe->pAuxData; pAuxData; pAuxData=pAuxData->pNextAux){ |
87027
|
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) ){ |
87061
|
0 |
0 |
for(pAuxData=pVdbe->pAuxData; pAuxData; pAuxData=pAuxData->pNextAux){ |
87062
|
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) ){ |
87066
|
0 |
0 |
if( pAuxData==0 ){ |
87068
|
0 |
0 |
if( !pAuxData ) goto failed; |
87073
|
0 |
0 |
if( pCtx->isError==0 ) pCtx->isError = -1; |
87074
|
0 |
0 |
}else if( pAuxData->xDeleteAux ){ |
87083
|
0 |
0 |
if( xDelete ){ |
87109
|
5398 |
4 |
return pVm ? pVm->nResColumn : 0; |
87118
|
75 |
0 |
if( pVm==0 || pVm->pResultSet==0 ) return 0; |
|
0 |
75 |
if( pVm==0 || pVm->pResultSet==0 ) return 0; |
87170
|
0 |
13649 |
if( pVm==0 ) return (Mem*)columnNullValue(); |
87173
|
13647 |
2 |
if( pVm->pResultSet!=0 && inResColumn && i>=0 ){ |
|
13647 |
0 |
if( pVm->pResultSet!=0 && inResColumn && i>=0 ){ |
|
13647 |
0 |
if( pVm->pResultSet!=0 && inResColumn && i>=0 ){ |
87208
|
13649 |
0 |
if( p ){ |
87262
|
0 |
75 |
if( pOut->flags&MEM_Static ){ |
87319
|
3740 |
0 |
if( N=0 ){ |
|
3740 |
0 |
if( N=0 ){ |
87324
|
0 |
3740 |
if( useUtf16 ){ |
87334
|
0 |
3740 |
if( db->mallocFailed ){ |
87442
|
0 |
3142 |
if( vdbeSafetyNotNull(p) ){ |
87446
|
0 |
3142 |
if( p->eVdbeState!=VDBE_READY_STATE ){ |
87453
|
3142 |
0 |
if( i<1 || i>p->nVar ){ |
|
0 |
3142 |
if( i<1 || i>p->nVar ){ |
87474
|
0 |
3142 |
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<
|
87496
|
1852 |
0 |
if( rc==SQLITE_OK ){ |
87497
|
1852 |
0 |
if( zData!=0 ){ |
87500
|
1852 |
0 |
if( rc==SQLITE_OK && encoding!=0 ){ |
|
1300 |
552 |
if( rc==SQLITE_OK && encoding!=0 ){ |
87503
|
0 |
1852 |
if( rc ){ |
87509
|
0 |
0 |
}else if( xDel!=SQLITE_STATIC && xDel!=SQLITE_TRANSIENT ){ |
|
0 |
0 |
}else if( xDel!=SQLITE_STATIC && xDel!=SQLITE_TRANSIENT ){ |
87545
|
2 |
0 |
if( rc==SQLITE_OK ){ |
87558
|
1005 |
0 |
if( rc==SQLITE_OK ){ |
87568
|
283 |
0 |
if( rc==SQLITE_OK ){ |
87583
|
0 |
0 |
if( rc==SQLITE_OK ){ |
87586
|
0 |
0 |
}else if( xDestructor ){ |
87609
|
0 |
0 |
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE; |
87632
|
0 |
0 |
rc = sqlite3_bind_double(pStmt, i, |
87638
|
0 |
0 |
if( pValue->flags & MEM_Zero ){ |
87661
|
0 |
0 |
if( rc==SQLITE_OK ){ |
87675
|
0 |
0 |
if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
87692
|
1515 |
7 |
return p ? p->nVar : 0; |
87703
|
0 |
4 |
if( p==0 ) return 0; |
87713
|
7 |
0 |
if( p==0 || zName==0 ) return 0; |
|
0 |
7 |
if( p==0 || zName==0 ) return 0; |
87730
|
0 |
1 |
for(i=0; inVar; i++){ |
87753
|
0 |
0 |
if( pFrom->nVar!=pTo->nVar ){ |
87757
|
0 |
0 |
if( pTo->expmask ){ |
87761
|
0 |
0 |
if( pFrom->expmask ){ |
87775
|
0 |
0 |
return pStmt ? ((Vdbe*)pStmt)->db : 0; |
87783
|
0 |
0 |
return pStmt ? ((Vdbe*)pStmt)->readOnly : 1; |
87791
|
0 |
0 |
return pStmt ? ((Vdbe*)pStmt)->explain : 0; |
87799
|
0 |
0 |
return v!=0 && v->eVdbeState==VDBE_RUN_STATE; |
|
0 |
0 |
return v!=0 && v->eVdbeState==VDBE_RUN_STATE; |
87817
|
0 |
0 |
if( pStmt==0 ){ |
87840
|
0 |
6 |
if( op==SQLITE_STMTSTATUS_MEMUSED ){ |
87850
|
0 |
6 |
if( resetFlag ) pVdbe->aCounter[op] = 0; |
87860
|
1678 |
0 |
return p ? p->zSql : 0; |
87878
|
0 |
0 |
if( zSql ){ |
88209
|
44 |
4 |
while( zSql[0] ){ |
88212
|
4 |
40 |
if( tokenType==TK_VARIABLE ){ |
88264
|
0 |
6 |
if( db->nVdbeExec>1 ){ |
88265
|
0 |
0 |
while( *zRawSql ){ |
88267
|
0 |
0 |
while( *(zRawSql++)!='\n' && *zRawSql ); |
|
0 |
0 |
while( *(zRawSql++)!='\n' && *zRawSql ); |
88272
|
2 |
4 |
}else if( p->nVar==0 ){ |
88275
|
8 |
0 |
while( zRawSql[0] ){ |
88281
|
4 |
4 |
if( nToken==0 ) break; |
88282
|
4 |
0 |
if( zRawSql[0]=='?' ){ |
88283
|
0 |
4 |
if( nToken>1 ){ |
88303
|
0 |
4 |
if( pVar->flags & MEM_Null ){ |
88305
|
0 |
4 |
}else if( pVar->flags & (MEM_Int|MEM_IntReal) ){ |
88307
|
0 |
4 |
}else if( pVar->flags & MEM_Real ){ |
88309
|
4 |
0 |
}else if( pVar->flags & MEM_Str ){ |
88313
|
0 |
4 |
if( enc!=SQLITE_UTF8 ){ |
88317
|
0 |
0 |
if( SQLITE_NOMEM==sqlite3VdbeChangeEncoding(&utf8, SQLITE_UTF8) ){ |
88338
|
0 |
4 |
if( enc!=SQLITE_UTF8 ) sqlite3VdbeMemRelease(&utf8); |
88340
|
0 |
0 |
}else if( pVar->flags & MEM_Zero ){ |
88350
|
0 |
0 |
for(i=0; i
|
88362
|
0 |
6 |
if( out.accError ) sqlite3_str_reset(&out); |
88633
|
1213 |
5544 |
Mem *pMem = iCur>0 ? &p->aMem[p->nMem-iCur] : p->aMem; |
88637
|
6044 |
713 |
nByte = |
88642
|
202 |
6555 |
if( p->apCsr[iCur] ){ /*OPTIMIZATION-IF-FALSE*/ |
88654
|
6552 |
205 |
if( pMem->szMalloc
|
88655
|
194 |
6358 |
if( pMem->szMalloc>0 ){ |
88659
|
0 |
6552 |
if( pMem->zMalloc==0 ){ |
88671
|
6044 |
713 |
if( eCurType==CURTYPE_BTREE ){ |
88687
|
390 |
0 |
if( sqlite3RealSameAsInt(rValue,iValue) ){ |
88715
|
38 |
394 |
if( rc<=0 ) return; |
88716
|
390 |
4 |
if( rc==1 && alsoAnInt(pRec, rValue, &pRec->u.i) ){ |
|
390 |
0 |
if( rc==1 && alsoAnInt(pRec, rValue, &pRec->u.i) ){ |
88721
|
4 |
0 |
if( bTryForInt ) sqlite3VdbeIntegerAffinity(pRec); |
88754
|
2166 |
1369 |
if( affinity>=SQLITE_AFF_NUMERIC ){ |
88757
|
1117 |
1049 |
if( (pRec->flags & MEM_Int)==0 ){ /*OPTIMIZATION-IF-FALSE*/ |
88758
|
1117 |
0 |
if( (pRec->flags & MEM_Real)==0 ){ |
88759
|
312 |
805 |
if( pRec->flags & MEM_Str ) applyNumericAffinity(pRec,1); |
88764
|
1359 |
10 |
}else if( affinity==SQLITE_AFF_TEXT ){ |
88770
|
41 |
1318 |
if( 0==(pRec->flags&MEM_Str) ){ /*OPTIMIZATION-IF-FALSE*/ |
88771
|
4 |
37 |
if( (pRec->flags&(MEM_Real|MEM_Int|MEM_IntReal)) ){ |
88790
|
26 |
10 |
if( eType==SQLITE_TEXT ){ |
88821
|
0 |
2 |
if( ExpandBlob(pMem) ){ |
|
0 |
0 |
if( ExpandBlob(pMem) ){ |
88826
|
0 |
2 |
if( rc<=0 ){ |
88827
|
0 |
0 |
if( rc==0 && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)<=1 ){ |
|
0 |
0 |
if( rc==0 && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)<=1 ){ |
88833
|
2 |
0 |
}else if( rc==1 && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)==0 ){ |
|
2 |
0 |
}else if( rc==1 && sqlite3Atoi64(pMem->z, &ix, pMem->n, pMem->enc)==0 ){ |
88848
|
119 |
43 |
if( pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal) ){ |
88854
|
2 |
41 |
if( pMem->flags & (MEM_Str|MEM_Blob) ){ |
89033
|
9 |
16888 |
if( VdbeMemDynamic(pOut) ){ /*OPTIMIZATION-IF-FALSE*/ |
89050
|
0 |
0 |
for(i=pOp->p3, mx=i+pOp->p4.i; i
|
89052
|
0 |
0 |
if( p->flags & (MEM_Int|MEM_IntReal) ){ |
89054
|
0 |
0 |
}else if( p->flags & MEM_Real ){ |
89056
|
0 |
0 |
}else if( p->flags & (MEM_Str|MEM_Blob) ){ |
89058
|
0 |
0 |
if( p->flags & MEM_Zero ) h += p->u.nZero; |
89115
|
4014 |
9000 |
if( db->xProgress ){ |
89123
|
0 |
13014 |
if( p->rc==SQLITE_NOMEM ){ |
89136
|
0 |
13014 |
if( AtomicLoad(&db->u1.isInterrupted) ) goto abort_due_to_interrupt; |
89320
|
0 |
19125 |
if( AtomicLoad(&db->u1.isInterrupted) ) goto abort_due_to_interrupt; |
89328
|
240 |
19125 |
while( nVmStep>=nProgressLimit && db->xProgress!=0 ){ |
|
240 |
0 |
while( nVmStep>=nProgressLimit && db->xProgress!=0 ){ |
89331
|
0 |
240 |
if( db->xProgress(db->pProgressArg) ){ |
89382
|
239 |
81 |
if( pIn1->flags & MEM_Int ){ |
89410
|
22 |
26 |
if( pOp->p2==0 ) break; |
89480
|
88 |
0 |
if( (pIn3->flags & MEM_Null)==0 ) break; |
89522
|
0 |
5453 |
if( p->pFrame && pOp->p1==SQLITE_OK ){ |
|
0 |
0 |
if( p->pFrame && pOp->p1==SQLITE_OK ){ |
89529
|
0 |
0 |
if( pOp->p2==OE_Ignore ){ |
89545
|
4 |
5449 |
if( p->rc ){ |
89546
|
4 |
0 |
if( pOp->p5 ){ |
89554
|
3 |
1 |
if( pOp->p4.z ){ |
89565
|
0 |
5453 |
if( rc==SQLITE_BUSY ){ |
89570
|
5 |
5448 |
rc = p->rc ? SQLITE_ERROR : SQLITE_DONE; |
89629
|
0 |
3027 |
if( encoding!=SQLITE_UTF8 ){ |
89632
|
0 |
0 |
if( rc ) goto too_big; |
89633
|
0 |
0 |
if( SQLITE_OK!=sqlite3VdbeChangeEncoding(pOut, encoding) ) goto no_mem; |
89638
|
0 |
0 |
if( pOp->p4type==P4_DYNAMIC ){ |
89646
|
0 |
3027 |
if( pOp->p1>db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
89676
|
0 |
3222 |
if( pOp->p3>0 ){ |
89680
|
0 |
0 |
if( pIn3->u.i==pOp->p5 ) pOut->flags = MEM_Blob|MEM_Static|MEM_Term; |
89727
|
0 |
1666 |
pOut->flags = nullFlag = pOp->p1 ? (MEM_Null|MEM_Cleared) : MEM_Null; |
89732
|
819 |
1666 |
while( cnt>0 ){ |
89768
|
0 |
267 |
if( pOp->p4.z==0 ){ |
89770
|
0 |
0 |
if( sqlite3VdbeMemExpandBlob(pOut) ) goto no_mem; |
89793
|
0 |
2939 |
if( sqlite3VdbeMemTooBig(pVar) ){ |
89797
|
0 |
2939 |
if( VdbeMemDynamic(pOut) ) sqlite3VdbeMemSetNull(pOut); |
89843
|
0 |
149 |
Deephemeralize(pOut); |
|
0 |
0 |
Deephemeralize(pOut); |
89847
|
0 |
149 |
}while( --n ); |
89874
|
587 |
57 |
Deephemeralize(pOut); |
|
0 |
587 |
Deephemeralize(pOut); |
89875
|
0 |
644 |
if( (pOut->flags & MEM_Subtype)!=0 && (pOp->p5 & 0x0002)!=0 ){ |
|
0 |
0 |
if( (pOut->flags & MEM_Subtype)!=0 && (pOp->p5 & 0x0002)!=0 ){ |
89882
|
638 |
6 |
if( (n--)==0 ) break; |
89942
|
0 |
0 |
if( (rc = sqlite3VdbeCheckFk(p,0))!=SQLITE_OK ){ |
89980
|
0 |
7284 |
if( db->mallocFailed ) goto no_mem; |
89981
|
0 |
7284 |
if( db->mTrace & SQLITE_TRACE_ROW ){ |
90015
|
0 |
0 |
if( (flags1 | pIn2->flags) & MEM_Null ){ |
90019
|
0 |
0 |
if( (flags1 & (MEM_Str|MEM_Blob))==0 ){ |
90020
|
0 |
0 |
if( sqlite3VdbeMemStringify(pIn1,encoding,0) ) goto no_mem; |
90022
|
0 |
0 |
}else if( (flags1 & MEM_Zero)!=0 ){ |
90023
|
0 |
0 |
if( sqlite3VdbeMemExpandBlob(pIn1) ) goto no_mem; |
90027
|
0 |
0 |
if( (flags2 & (MEM_Str|MEM_Blob))==0 ){ |
90028
|
0 |
0 |
if( sqlite3VdbeMemStringify(pIn2,encoding,0) ) goto no_mem; |
90030
|
0 |
0 |
}else if( (flags2 & MEM_Zero)!=0 ){ |
90031
|
0 |
0 |
if( sqlite3VdbeMemExpandBlob(pIn2) ) goto no_mem; |
90035
|
0 |
0 |
if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
90038
|
0 |
0 |
if( sqlite3VdbeMemGrow(pOut, (int)nByte+2, pOut==pIn2) ){ |
90042
|
0 |
0 |
if( pOut!=pIn2 ){ |
90050
|
0 |
0 |
if( encoding>SQLITE_UTF8 ) nByte &= ~1; |
90117
|
40 |
41 |
if( (type1 & type2 & MEM_Int)!=0 ){ |
90121
|
0 |
40 |
case OP_Add: if( sqlite3AddInt64(&iB,iA) ) goto fp_math; break; |
90122
|
0 |
0 |
case OP_Subtract: if( sqlite3SubInt64(&iB,iA) ) goto fp_math; break; |
90123
|
0 |
0 |
case OP_Multiply: if( sqlite3MulInt64(&iB,iA) ) goto fp_math; break; |
90125
|
0 |
0 |
if( iA==0 ) goto arithmetic_result_is_null; |
90126
|
0 |
0 |
if( iA==-1 && iB==SMALLEST_INT64 ) goto fp_math; |
|
0 |
0 |
if( iA==-1 && iB==SMALLEST_INT64 ) goto fp_math; |
90131
|
0 |
0 |
if( iA==0 ) goto arithmetic_result_is_null; |
90132
|
0 |
0 |
if( iA==-1 ) iA = 1; |
90139
|
41 |
0 |
}else if( (flags & MEM_Null)!=0 ){ |
90151
|
0 |
0 |
if( rA==(double)0 ) goto arithmetic_result_is_null; |
90158
|
0 |
0 |
if( iA==0 ) goto arithmetic_result_is_null; |
90159
|
0 |
0 |
if( iA==-1 ) iA = 1; |
90168
|
0 |
0 |
if( sqlite3IsNaN(rB) ){ |
90199
|
0 |
27 |
if( pOp->p1 ){ |
90247
|
0 |
0 |
if( (pIn1->flags | pIn2->flags) & MEM_Null ){ |
90254
|
0 |
0 |
if( op==OP_BitAnd ){ |
90256
|
0 |
0 |
}else if( op==OP_BitOr ){ |
90258
|
0 |
0 |
}else if( iB!=0 ){ |
90262
|
0 |
0 |
if( iB<0 ){ |
90265
|
0 |
0 |
iB = iB>(-64) ? -iB : 64; |
90268
|
0 |
0 |
if( iB>=64 ){ |
90269
|
0 |
0 |
iA = (iA>=0 || op==OP_ShiftLeft) ? 0 : -1; |
|
0 |
0 |
iA = (iA>=0 || op==OP_ShiftLeft) ? 0 : -1; |
90272
|
0 |
0 |
if( op==OP_ShiftLeft ){ |
90277
|
0 |
0 |
if( iA<0 ) uA |= ((((u64)0xffffffff)<<32)|0xffffffff) << (64-iB); |
90312
|
114 |
267 |
if( (pIn1->flags & MEM_Int)==0 ){ |
90314
|
4 |
110 |
if( (pIn1->flags & MEM_Int)==0 ){ |
90316
|
4 |
0 |
if( pOp->p2==0 ){ |
90341
|
0 |
0 |
if( pIn1->flags & (MEM_Int|MEM_IntReal) ){ |
90376
|
0 |
3 |
rc = ExpandBlob(pIn1); |
90377
|
0 |
3 |
if( rc ) goto abort_due_to_error; |
90379
|
0 |
3 |
if( rc ) goto abort_due_to_error; |
90493
|
283 |
2101 |
if( (flags1 & flags3 & MEM_Int)!=0 ){ |
90496
|
225 |
58 |
if( pIn3->u.i > pIn1->u.i ){ |
90497
|
0 |
225 |
if( sqlite3aGTb[pOp->opcode] ){ |
90502
|
21 |
37 |
}else if( pIn3->u.i < pIn1->u.i ){ |
90503
|
20 |
1 |
if( sqlite3aLTb[pOp->opcode] ){ |
90509
|
9 |
28 |
if( sqlite3aEQb[pOp->opcode] ){ |
90518
|
49 |
2052 |
if( (flags1 | flags3)&MEM_Null ){ |
90520
|
12 |
37 |
if( pOp->p5 & SQLITE_NULLEQ ){ |
90528
|
2 |
10 |
if( (flags1&flags3&MEM_Null)!=0 |
90529
|
2 |
0 |
&& (flags3&MEM_Cleared)==0 |
90533
|
0 |
10 |
res = ((flags3 & MEM_Null) ? -1 : +1); /* Operands are not equal */ |
90541
|
16 |
21 |
if( pOp->p5 & SQLITE_JUMPIFNULL ){ |
90551
|
94 |
1958 |
if( affinity>=SQLITE_AFF_NUMERIC ){ |
90552
|
94 |
0 |
if( (flags1 | flags3)&MEM_Str ){ |
90553
|
94 |
0 |
if( (flags1 & (MEM_Int|MEM_IntReal|MEM_Real|MEM_Str))==MEM_Str ){ |
90558
|
0 |
94 |
if( (flags3 & (MEM_Int|MEM_IntReal|MEM_Real|MEM_Str))==MEM_Str ){ |
90562
|
1109 |
849 |
}else if( affinity==SQLITE_AFF_TEXT ){ |
90563
|
0 |
1109 |
if( (flags1 & MEM_Str)==0 && (flags1&(MEM_Int|MEM_Real|MEM_IntReal))!=0 ){ |
|
0 |
0 |
if( (flags1 & MEM_Str)==0 && (flags1&(MEM_Int|MEM_Real|MEM_IntReal))!=0 ){ |
90570
|
0 |
0 |
if( pIn1==pIn3 ) flags3 = flags1 | MEM_Str; |
90572
|
0 |
1109 |
if( (flags3 & MEM_Str)==0 && (flags3&(MEM_Int|MEM_Real|MEM_IntReal))!=0 ){ |
|
0 |
0 |
if( (flags3 & MEM_Str)==0 && (flags3&(MEM_Int|MEM_Real|MEM_IntReal))!=0 ){ |
90593
|
988 |
1076 |
if( res<0 ){ |
90595
|
739 |
337 |
}else if( res==0 ){ |
90609
|
1059 |
1005 |
if( res2 ){ |
90640
|
0 |
0 |
if( iCompare==0 ) goto jump_to_p2; |
90697
|
382 |
0 |
if( (pOp->p5 & OPFLAG_PERMUTE)==0 ){ |
90723
|
382 |
347 |
for(i=0; i
|
90724
|
0 |
382 |
idx = aPermute ? aPermute[i] : (u32)i; |
90733
|
35 |
347 |
if( iCompare ){ |
90734
|
0 |
35 |
if( (pKeyInfo->aSortFlags[i] & KEYINFO_ORDER_BIGNULL) |
90735
|
0 |
0 |
&& ((aMem[p1+idx].flags & MEM_Null) || (aMem[p2+idx].flags & MEM_Null)) |
|
0 |
0 |
&& ((aMem[p1+idx].flags & MEM_Null) || (aMem[p2+idx].flags & MEM_Null)) |
90739
|
0 |
35 |
if( bRev ) iCompare = -iCompare; |
90757
|
35 |
347 |
if( iCompare<0 ){ |
90759
|
347 |
0 |
}else if( iCompare==0 ){ |
90794
|
0 |
0 |
if( pOp->opcode==OP_And ){ |
90802
|
0 |
0 |
if( v1==2 ){ |
90850
|
0 |
0 |
if( (pIn1->flags & MEM_Null)==0 ){ |
90869
|
0 |
0 |
if( (pIn1->flags & MEM_Null)==0 ){ |
90896
|
0 |
322 |
if( p->pFrame ){ |
90898
|
0 |
0 |
if( (p->pFrame->aOnce[iAddr/8] & (1<<(iAddr & 7)))!=0 ){ |
90904
|
0 |
322 |
if( p->aOp[0].p1==pOp->p1 ){ |
90924
|
203 |
302 |
if( c ) goto jump_to_p2; |
90938
|
239 |
85 |
if( c ) goto jump_to_p2; |
90950
|
95 |
648 |
if( (pIn1->flags & MEM_Null)!=0 ){ |
90966
|
0 |
0 |
doTheJump = (pIn1->flags & MEM_Null)!=0 || sqlite3_value_type(pIn1)==pOp->p3; |
|
0 |
0 |
doTheJump = (pIn1->flags & MEM_Null)!=0 || sqlite3_value_type(pIn1)==pOp->p3; |
90968
|
0 |
0 |
if( doTheJump ) goto jump_to_p2; |
90980
|
0 |
0 |
if( (aMem[pOp->p1].flags & MEM_Null)!=0 |
90981
|
0 |
0 |
|| (aMem[pOp->p3].flags & MEM_Null)!=0 |
90998
|
545 |
118 |
if( (pIn1->flags & MEM_Null)==0 ){ |
91015
|
0 |
0 |
if( p->apCsr[pOp->p1]->nullRow ){ |
91111
|
13286 |
7038 |
if( pC->cacheStatus!=p->cacheCtr ){ /*OPTIMIZATION-IF-FALSE*/ |
91112
|
4925 |
8361 |
if( pC->nullRow ){ |
91113
|
4925 |
0 |
if( pC->eCurType==CURTYPE_PSEUDO && pC->seekResult>0 ){ |
|
4925 |
0 |
if( pC->eCurType==CURTYPE_PSEUDO && pC->seekResult>0 ){ |
91129
|
429 |
7932 |
if( pC->deferredMoveto ){ |
91132
|
0 |
429 |
if( pC->ub.aAltMap && (iMap = pC->ub.aAltMap[1+p2])>0 ){ |
|
0 |
0 |
if( pC->ub.aAltMap && (iMap = pC->ub.aAltMap[1+p2])>0 ){ |
91138
|
0 |
429 |
if( rc ) goto abort_due_to_error; |
91139
|
0 |
7932 |
}else if( sqlite3BtreeCursorHasMoved(pCrsr) ){ |
91141
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
91153
|
13286 |
0 |
if( (aOffset[0] = pC->aRow[0])<0x80 ){ |
91160
|
0 |
13286 |
if( pC->szRow
|
91177
|
0 |
0 |
if( aOffset[0] > 98307 || aOffset[0] > pC->payloadSize ){ |
|
0 |
0 |
if( aOffset[0] > 98307 || aOffset[0] > pC->payloadSize ){ |
91199
|
0 |
7038 |
}else if( sqlite3BtreeCursorHasMoved(pC->uc.pCursor) ){ |
91201
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
91208
|
3086 |
3952 |
if( pC->nHdrParsed<=p2 ){ |
91212
|
3086 |
0 |
if( pC->iHdrOffset
|
91214
|
0 |
3086 |
if( pC->aRow==0 ){ |
91217
|
0 |
0 |
if( rc!=SQLITE_OK ) goto abort_due_to_error; |
91231
|
21166 |
499 |
if( (pC->aType[i] = t = zHdr[0])<0x80 ){ |
91240
|
5411 |
16254 |
}while( (u32)i<=p2 && zHdr
|
|
5293 |
118 |
}while( (u32)i<=p2 && zHdr
|
91247
|
11763 |
4609 |
if( (zHdr>=zEndHdr && (zHdr>zEndHdr || offset64!=pC->payloadSize)) |
|
11763 |
0 |
if( (zHdr>=zEndHdr && (zHdr>zEndHdr || offset64!=pC->payloadSize)) |
|
11763 |
0 |
if( (zHdr>=zEndHdr && (zHdr>zEndHdr || offset64!=pC->payloadSize)) |
91248
|
0 |
16372 |
|| (offset64 > pC->payloadSize) |
91250
|
0 |
0 |
if( aOffset[0]==0 ){ |
91254
|
0 |
0 |
if( pC->aRow==0 ) sqlite3VdbeMemRelease(&sMem); |
91261
|
0 |
16372 |
if( pC->aRow==0 ) sqlite3VdbeMemRelease(&sMem); |
91270
|
118 |
16254 |
if( pC->nHdrParsed<=p2 ){ |
91273
|
0 |
118 |
if( pOp->p4type==P4_MEM ){ |
91293
|
0 |
20206 |
if( VdbeMemDynamic(pDest) ){ |
91297
|
20191 |
15 |
if( pC->szRow>=aOffset[p2+1] ){ |
91301
|
12885 |
7306 |
if( t<12 ){ |
91311
|
2915 |
4391 |
if( pDest->szMalloc < len+2 ){ |
91312
|
0 |
2915 |
if( len>db->aLimit[SQLITE_LIMIT_LENGTH] ) goto too_big; |
91314
|
0 |
2915 |
if( sqlite3VdbeMemGrow(pDest, len+2, 0) ) goto no_mem; |
91326
|
0 |
15 |
if( ((pOp->p5 & (OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG))!=0 |
91327
|
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)) |
91328
|
0 |
15 |
|| (len = sqlite3VdbeSerialTypeLen(t))==0 |
91345
|
0 |
15 |
if( len>db->aLimit[SQLITE_LIMIT_LENGTH] ) goto too_big; |
91347
|
0 |
15 |
if( rc!=SQLITE_OK ) goto abort_due_to_error; |
91359
|
0 |
0 |
if( aOp[0].p3>0 ){ |
91405
|
0 |
0 |
for(i=0; inCol; i++){ |
91406
|
0 |
0 |
if( aCol[i].colFlags & COLFLAG_GENERATED ){ |
91407
|
0 |
0 |
if( aCol[i].colFlags & COLFLAG_VIRTUAL ) continue; |
91408
|
0 |
0 |
if( pOp->p3 ){ pIn1++; continue; } |
91412
|
0 |
0 |
if( (pIn1->flags & MEM_Null)==0 ){ |
91415
|
0 |
0 |
if( (pIn1->flags & MEM_Blob)==0 ) goto vdbe_type_error; |
91420
|
0 |
0 |
if( (pIn1->flags & MEM_Int)==0 ) goto vdbe_type_error; |
91424
|
0 |
0 |
if( (pIn1->flags & MEM_Str)==0 ) goto vdbe_type_error; |
91430
|
0 |
0 |
if( pIn1->flags & MEM_Int ){ |
91439
|
0 |
0 |
if( pIn1->u.i<=140737488355327LL && pIn1->u.i>=-140737488355328LL){ |
|
0 |
0 |
if( pIn1->u.i<=140737488355327LL && pIn1->u.i>=-140737488355328LL){ |
91447
|
0 |
0 |
}else if( (pIn1->flags & (MEM_Real|MEM_IntReal))==0 ){ |
91493
|
0 |
546 |
if( zAffinity[0]==SQLITE_AFF_REAL && (pIn1->flags & MEM_Int)!=0 ){ |
|
0 |
0 |
if( zAffinity[0]==SQLITE_AFF_REAL && (pIn1->flags & MEM_Int)!=0 ){ |
91502
|
0 |
0 |
if( pIn1->u.i<=140737488355327LL && pIn1->u.i>=-140737488355328LL ){ |
|
0 |
0 |
if( pIn1->u.i<=140737488355327LL && pIn1->u.i>=-140737488355328LL ){ |
91513
|
388 |
158 |
if( zAffinity[0]==0 ) break; |
91595
|
1057 |
7677 |
if( zAffinity ){ |
91599
|
0 |
2823 |
if( zAffinity[0]==SQLITE_AFF_REAL && (pRec->flags & MEM_Int) ){ |
|
0 |
0 |
if( zAffinity[0]==SQLITE_AFF_REAL && (pRec->flags & MEM_Int) ){ |
91607
|
1766 |
1057 |
}while( zAffinity[0] ); |
91653
|
939 |
12767 |
if( pRec->flags & MEM_Null ){ |
91654
|
0 |
939 |
if( pRec->flags & MEM_Zero ){ |
91669
|
2696 |
10071 |
}else if( pRec->flags & (MEM_Int|MEM_IntReal) ){ |
91675
|
101 |
2595 |
if( i<0 ){ |
91686
|
2448 |
248 |
if( uu<=127 ){ |
91687
|
1421 |
1027 |
if( (i&1)==i && p->minWriteFileFormat>=4 ){ |
|
1421 |
0 |
if( (i&1)==i && p->minWriteFileFormat>=4 ){ |
91693
|
86 |
162 |
}else if( uu<=32767 ){ |
91696
|
0 |
162 |
}else if( uu<=8388607 ){ |
91699
|
30 |
132 |
}else if( uu<=2147483647 ){ |
91702
|
48 |
84 |
}else if( uu<=140737488355327LL ){ |
91707
|
0 |
84 |
if( pRec->flags & MEM_IntReal ){ |
91719
|
6162 |
3909 |
}else if( pRec->flags & MEM_Real ){ |
91728
|
1 |
3908 |
if( pRec->flags & MEM_Zero ){ |
91730
|
0 |
1 |
if( nData ){ |
91731
|
0 |
0 |
if( sqlite3VdbeMemExpandBlob(pRec) ) goto no_mem; |
91741
|
8734 |
4972 |
if( pRec==pData0 ) break; |
91751
|
8734 |
0 |
if( nHdr<=126 ){ |
91758
|
0 |
0 |
if( nVarint
|
91767
|
4740 |
3994 |
if( nByte+nZero<=pOut->szMalloc ){ |
91774
|
0 |
3994 |
if( nByte+nZero>db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
91777
|
0 |
3994 |
if( sqlite3VdbeMemClearAndResize(pOut, (int)nByte) ){ |
91783
|
1 |
8733 |
if( nZero ){ |
91792
|
8734 |
0 |
if( nHdr<0x80 ){ |
91805
|
8376 |
5330 |
if( serial_type<=7 ){ |
91807
|
7437 |
939 |
if( serial_type==0 ){ |
91812
|
6162 |
1275 |
if( serial_type==7 ){ |
91823
|
7437 |
44138 |
if( i==0 ) break; |
91828
|
4928 |
402 |
}else if( serial_type<0x80 ){ |
91830
|
3503 |
1425 |
if( serial_type>=14 && pRec->n>0 ){ |
|
3503 |
0 |
if( serial_type>=14 && pRec->n>0 ){ |
91837
|
401 |
1 |
if( pRec->n ){ |
91843
|
8734 |
4972 |
if( pRec==pLast ) break; |
91871
|
0 |
10 |
if( pOp->p3 ){ |
91876
|
0 |
10 |
if( rc ) goto abort_due_to_error; |
91912
|
24 |
10 |
if( p1==SAVEPOINT_BEGIN ){ |
91913
|
0 |
24 |
if( db->nVdbeWrite>0 ){ |
91930
|
0 |
24 |
if( rc!=SQLITE_OK ) goto abort_due_to_error; |
91935
|
24 |
0 |
if( pNew ){ |
91941
|
13 |
11 |
if( db->autoCommit ){ |
91961
|
12 |
0 |
for( |
91963
|
2 |
10 |
pSavepoint && sqlite3StrICmp(pSavepoint->zName, zName); |
91968
|
0 |
10 |
if( !pSavepoint ){ |
91971
|
0 |
10 |
}else if( db->nVdbeWrite>0 && p1==SAVEPOINT_RELEASE ){ |
|
0 |
0 |
}else if( db->nVdbeWrite>0 && p1==SAVEPOINT_RELEASE ){ |
91984
|
8 |
2 |
int isTransaction = pSavepoint->pNext==0 && db->isTransactionSavepoint; |
|
7 |
1 |
int isTransaction = pSavepoint->pNext==0 && db->isTransactionSavepoint; |
91985
|
7 |
3 |
if( isTransaction && p1==SAVEPOINT_RELEASE ){ |
|
7 |
0 |
if( isTransaction && p1==SAVEPOINT_RELEASE ){ |
91986
|
0 |
7 |
if( (rc = sqlite3VdbeCheckFk(p, 1))!=SQLITE_OK ){ |
91990
|
0 |
7 |
if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){ |
91997
|
0 |
7 |
if( rc ){ |
92005
|
1 |
2 |
if( p1==SAVEPOINT_ROLLBACK ){ |
92007
|
2 |
1 |
for(ii=0; iinDb; ii++){ |
92011
|
0 |
2 |
if( rc!=SQLITE_OK ) goto abort_due_to_error; |
92017
|
6 |
3 |
for(ii=0; iinDb; ii++){ |
92019
|
0 |
6 |
if( rc!=SQLITE_OK ){ |
92023
|
1 |
2 |
if( isSchemaChange ){ |
92029
|
0 |
10 |
if( rc ) goto abort_due_to_error; |
92033
|
2 |
10 |
while( db->pSavepoint!=pSavepoint ){ |
92044
|
9 |
1 |
if( p1==SAVEPOINT_RELEASE ){ |
92048
|
2 |
7 |
if( !isTransaction ){ |
92057
|
7 |
3 |
if( !isTransaction || p1==SAVEPOINT_ROLLBACK ){ |
|
0 |
7 |
if( !isTransaction || p1==SAVEPOINT_ROLLBACK ){ |
92059
|
0 |
3 |
if( rc!=SQLITE_OK ) goto abort_due_to_error; |
92063
|
0 |
34 |
if( rc ) goto abort_due_to_error; |
92064
|
7 |
27 |
if( p->eVdbeState==VDBE_HALT_STATE ){ |
92091
|
230 |
20 |
if( desiredAutoCommit!=db->autoCommit ){ |
92092
|
28 |
202 |
if( iRollback ){ |
92096
|
90 |
112 |
}else if( desiredAutoCommit && db->nVdbeWrite>0 ){ |
|
0 |
90 |
}else if( desiredAutoCommit && db->nVdbeWrite>0 ){ |
92104
|
0 |
202 |
}else if( (rc = sqlite3VdbeCheckFk(p, 1))!=SQLITE_OK ){ |
92109
|
0 |
230 |
if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){ |
92116
|
226 |
4 |
if( p->rc==SQLITE_OK ){ |
92123
|
0 |
20 |
sqlite3VdbeError(p, |
92124
|
0 |
0 |
(!desiredAutoCommit)?"cannot start a transaction within a transaction":( |
92180
|
3819 |
1818 |
if( pOp->p2 && (db->flags & (SQLITE_QueryOnly|SQLITE_CorruptRdOnly))!=0 ){ |
|
0 |
3819 |
if( pOp->p2 && (db->flags & (SQLITE_QueryOnly|SQLITE_CorruptRdOnly))!=0 ){ |
92181
|
0 |
0 |
if( db->flags & SQLITE_QueryOnly ){ |
92194
|
5562 |
75 |
if( pBt ){ |
92198
|
9 |
5553 |
if( rc!=SQLITE_OK ){ |
92199
|
7 |
2 |
if( (rc&0xff)==SQLITE_BUSY ){ |
92207
|
276 |
5277 |
if( p->usesStmtJournal |
92208
|
276 |
0 |
&& pOp->p2 |
92209
|
249 |
27 |
&& (db->autoCommit==0 || db->nVdbeRead>1) |
|
27 |
222 |
&& (db->autoCommit==0 || db->nVdbeRead>1) |
92212
|
54 |
0 |
if( p->iStatement==0 ){ |
92219
|
54 |
0 |
if( rc==SQLITE_OK ){ |
92231
|
5628 |
0 |
if( rc==SQLITE_OK |
92232
|
4954 |
674 |
&& pOp->p5 |
92233
|
4954 |
0 |
&& (iMeta!=pOp->p3 || pDb->pSchema->iGeneration!=pOp->p4.i) |
|
0 |
4954 |
&& (iMeta!=pOp->p3 || pDb->pSchema->iGeneration!=pOp->p4.i) |
92255
|
0 |
0 |
if( db->aDb[pOp->p1].pSchema->schema_cookie!=iMeta ){ |
92266
|
0 |
5628 |
if( rc ) goto abort_due_to_error; |
92329
|
273 |
351 |
if( pOp->p2==BTREE_SCHEMA_VERSION ){ |
92334
|
175 |
176 |
}else if( pOp->p2==BTREE_FILE_FORMAT ){ |
92338
|
87 |
537 |
if( pOp->p1==1 ){ |
92344
|
0 |
624 |
if( rc ) goto abort_due_to_error; |
92445
|
9 |
2 |
if( pCur && pCur->pgnoRoot==(u32)pOp->p2 ){ |
|
9 |
0 |
if( pCur && pCur->pgnoRoot==(u32)pOp->p2 ){ |
92461
|
0 |
6027 |
if( p->expired==1 ){ |
92475
|
4138 |
1889 |
if( pOp->opcode==OP_OpenWrite ){ |
92479
|
3543 |
595 |
if( pDb->pSchema->file_format < p->minWriteFileFormat ){ |
92485
|
6 |
6021 |
if( pOp->p5 & OPFLAG_P2ISREG ){ |
92500
|
287 |
5740 |
if( pOp->p4type==P4_KEYINFO ){ |
92505
|
5740 |
0 |
}else if( pOp->p4type==P4_INT32 ){ |
92512
|
0 |
6027 |
if( pCur==0 ) goto no_mem; |
92535
|
0 |
6036 |
if( rc ) goto abort_due_to_error; |
92556
|
0 |
0 |
if( pCx==0 ) goto no_mem; |
92622
|
7 |
10 |
if( pOp->p3>0 ){ |
92632
|
0 |
17 |
if( pCx && !pCx->noReuse && ALWAYS(pOp->p2<=pCx->nField) ){ |
|
0 |
0 |
if( pCx && !pCx->noReuse && ALWAYS(pOp->p2<=pCx->nField) ){ |
|
0 |
0 |
if( pCx && !pCx->noReuse && ALWAYS(pOp->p2<=pCx->nField) ){ |
92642
|
0 |
17 |
if( pCx==0 ) goto no_mem; |
92647
|
17 |
0 |
if( rc==SQLITE_OK ){ |
92649
|
17 |
0 |
if( rc==SQLITE_OK ){ |
92655
|
10 |
7 |
if( (pCx->pKeyInfo = pKeyInfo = pOp->p4.pKeyInfo)!=0 ){ |
92659
|
10 |
0 |
if( rc==SQLITE_OK ){ |
92675
|
0 |
17 |
if( rc ){ |
92680
|
0 |
17 |
if( rc ) goto abort_due_to_error; |
92701
|
0 |
262 |
if( pCx==0 ) goto no_mem; |
92706
|
0 |
262 |
if( rc ) goto abort_due_to_error; |
92722
|
114 |
312 |
if( (pC->seqCount++)==0 ){ |
92750
|
0 |
257 |
if( pCx==0 ) goto no_mem; |
92916
|
0 |
195 |
if( pC->isTable ){ |
92927
|
0 |
0 |
if( (flags3 & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Str))==MEM_Str ){ |
92936
|
0 |
0 |
if( (newType & (MEM_Int|MEM_IntReal))==0 ){ |
92938
|
0 |
0 |
if( (newType & MEM_Real)==0 ){ |
92939
|
0 |
0 |
if( (newType & MEM_Null) || oc>=OP_SeekGE ){ |
|
0 |
0 |
if( (newType & MEM_Null) || oc>=OP_SeekGE ){ |
92944
|
0 |
0 |
if( rc!=SQLITE_OK ) goto abort_due_to_error; |
92957
|
0 |
0 |
if( c>0 ){ |
92961
|
0 |
0 |
if( (oc & 0x0001)==(OP_SeekGT & 0x0001) ) oc--; |
92966
|
0 |
0 |
else if( c<0 ){ |
92970
|
0 |
0 |
if( (oc & 0x0001)==(OP_SeekLT & 0x0001) ) oc++; |
92975
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
92984
|
41 |
154 |
if( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ) ){ |
93009
|
188 |
7 |
r.default_rc = ((1 & (oc - OP_SeekLT)) ? -1 : +1); |
93021
|
0 |
195 |
if( rc!=SQLITE_OK ){ |
93024
|
41 |
154 |
if( eqOnly && r.eqSeen==0 ){ |
|
8 |
33 |
if( eqOnly && r.eqSeen==0 ){ |
93032
|
13 |
174 |
if( oc>=OP_SeekGE ){ assert( oc==OP_SeekGE || oc==OP_SeekGT ); |
93033
|
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) ){ |
93036
|
1 |
3 |
if( rc!=SQLITE_OK ){ |
93037
|
1 |
0 |
if( rc==SQLITE_DONE ){ |
93049
|
174 |
0 |
if( res>0 || (res==0 && oc==OP_SeekLT) ){ |
|
0 |
174 |
if( res>0 || (res==0 && oc==OP_SeekLT) ){ |
|
0 |
0 |
if( res>0 || (res==0 && oc==OP_SeekLT) ){ |
93052
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
93053
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
93070
|
10 |
185 |
if( res ){ |
93072
|
33 |
152 |
}else if( eqOnly ){ |
93148
|
0 |
0 |
if( !sqlite3BtreeCursorIsValidNN(pC->uc.pCursor) ){ |
93174
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
93175
|
0 |
0 |
if( res>0 ){ |
93186
|
0 |
0 |
if( res==0 ){ |
93196
|
0 |
0 |
if( nStep<=0 ){ |
93207
|
0 |
0 |
if( rc ){ |
93208
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
93241
|
0 |
0 |
if( pC->seekHitp2 ){ |
93248
|
0 |
0 |
}else if( pC->seekHit>pOp->p3 ){ |
93267
|
0 |
0 |
if( !p->apCsr[pOp->p1] ){ |
93373
|
0 |
0 |
if( pC->seekHit>=pOp->p4.i ) break; |
93402
|
62 |
0 |
if( r.nField>0 ){ |
93418
|
0 |
0 |
rc = ExpandBlob(r.aMem); |
93420
|
0 |
0 |
if( rc ) goto no_mem; |
93422
|
0 |
0 |
if( pIdxKey==0 ) goto no_mem; |
93428
|
0 |
62 |
if( rc!=SQLITE_OK ){ |
93435
|
4 |
58 |
if( pOp->opcode==OP_Found ){ |
93437
|
0 |
4 |
if( alreadyExists ) goto jump_to_p2; |
93439
|
55 |
3 |
if( !alreadyExists ){ |
93443
|
3 |
0 |
if( pOp->opcode==OP_NoConflict ){ |
93447
|
3 |
3 |
for(ii=0; ii
|
93448
|
0 |
3 |
if( r.aMem[ii].flags & MEM_Null ){ |
93455
|
0 |
3 |
if( pOp->opcode==OP_IfNoHope ){ |
93520
|
52 |
515 |
if( (pIn3->flags & (MEM_Int|MEM_IntReal))==0 ){ |
93528
|
0 |
52 |
if( (x.flags & MEM_Int)==0 ) goto jump_to_p2; |
93558
|
365 |
699 |
if( res!=0 ){ |
93560
|
0 |
365 |
if( pOp->p2==0 ){ |
93566
|
0 |
699 |
if( rc ) goto abort_due_to_error; |
93648
|
3189 |
0 |
if( !pC->useRandomRowid ){ |
93650
|
0 |
3189 |
if( rc!=SQLITE_OK ){ |
93653
|
336 |
2853 |
if( res ){ |
93658
|
0 |
2853 |
if( v>=MAX_ROWID ){ |
93667
|
192 |
2997 |
if( pOp->p3 ){ |
93670
|
0 |
192 |
if( p->pFrame ){ |
93671
|
0 |
0 |
for(pFrame=p->pFrame; pFrame->pParent; pFrame=pFrame->pParent); |
93686
|
192 |
0 |
if( pMem->u.i==MAX_ROWID || pC->useRandomRowid ){ |
|
0 |
192 |
if( pMem->u.i==MAX_ROWID || pC->useRandomRowid ){ |
93690
|
0 |
192 |
if( vu.i+1 ){ |
93696
|
0 |
3189 |
if( pC->useRandomRowid ){ |
93709
|
0 |
0 |
&& (res==0) |
93710
|
0 |
0 |
&& (++cnt<100)); |
|
0 |
0 |
&& (++cnt<100)); |
93711
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
93712
|
0 |
0 |
if( res==0 ){ |
93790
|
3227 |
755 |
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){ |
|
60 |
3167 |
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){ |
93814
|
3227 |
755 |
if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++; |
93815
|
3221 |
761 |
if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = x.nKey; |
93819
|
3260 |
722 |
seekResult = ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0); |
93820
|
1 |
3981 |
if( pData->flags & MEM_Zero ){ |
93834
|
0 |
3982 |
if( rc ) goto abort_due_to_error; |
93835
|
60 |
3922 |
if( pTab ){ |
93838
|
0 |
60 |
db->xUpdateCallback(db->pUpdateArg, |
93866
|
0 |
0 |
iKey = pOp->p3 ? aMem[pOp->p3].u.i : 0; |
93868
|
0 |
0 |
if( rc!=SQLITE_OK ) goto abort_due_to_error; |
93941
|
13 |
8 |
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){ |
|
0 |
13 |
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){ |
93946
|
0 |
0 |
if( (pOp->p5 & OPFLAG_SAVEPOSITION)!=0 && pC->isTable ){ |
|
0 |
0 |
if( (pOp->p5 & OPFLAG_SAVEPOSITION)!=0 && pC->isTable ){ |
93993
|
0 |
21 |
if( rc ) goto abort_due_to_error; |
93996
|
13 |
8 |
if( opflags & OPFLAG_NCHANGE ){ |
93998
|
0 |
13 |
if( db->xUpdateCallback && ALWAYS(pTab!=0) && HasRowid(pTab) ){ |
|
0 |
0 |
if( db->xUpdateCallback && ALWAYS(pTab!=0) && HasRowid(pTab) ){ |
|
0 |
0 |
if( db->xUpdateCallback && ALWAYS(pTab!=0) && HasRowid(pTab) ){ |
94048
|
0 |
1 |
if( rc ) goto abort_due_to_error; |
94049
|
1 |
0 |
if( res ) goto jump_to_p2; |
94074
|
0 |
4922 |
if( rc ) goto abort_due_to_error; |
94135
|
0 |
0 |
if( n>(u32)db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
94140
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
94141
|
0 |
0 |
if( !pOp->p3 ) Deephemeralize(pOut); |
|
0 |
0 |
if( !pOp->p3 ) Deephemeralize(pOut); |
|
0 |
0 |
if( !pOp->p3 ) Deephemeralize(pOut); |
94168
|
0 |
769 |
if( pC->nullRow ){ |
94171
|
12 |
757 |
}else if( pC->deferredMoveto ){ |
94174
|
89 |
668 |
}else if( pC->eCurType==CURTYPE_VTAB ){ |
94181
|
0 |
89 |
if( rc ) goto abort_due_to_error; |
94187
|
0 |
668 |
if( rc ) goto abort_due_to_error; |
94188
|
0 |
668 |
if( pC->nullRow ){ |
94212
|
0 |
2 |
if( pC==0 ){ |
94216
|
0 |
0 |
if( pC==0 ) goto no_mem; |
94224
|
0 |
2 |
if( pC->eCurType==CURTYPE_BTREE ){ |
94272
|
2 |
36 |
if( pOp->opcode==OP_SeekEnd ){ |
94275
|
0 |
2 |
if( sqlite3BtreeCursorIsValidNN(pCrsr) ){ |
94283
|
0 |
38 |
if( rc ) goto abort_due_to_error; |
94284
|
34 |
4 |
if( pOp->p2>0 ){ |
94286
|
33 |
1 |
if( res ) goto jump_to_p2; |
94308
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
94309
|
0 |
0 |
if( res==0 ){ |
94311
|
0 |
0 |
if( ALWAYS(sz>=0) && sqlite3LogEst((u64)sz)p3 ) res = 1; |
|
0 |
0 |
if( ALWAYS(sz>=0) && sqlite3LogEst((u64)sz)p3 ) res = 1; |
94314
|
0 |
0 |
if( res ) goto jump_to_p2; |
94376
|
262 |
1216 |
if( isSorter(pC) ){ |
94386
|
0 |
1478 |
if( rc ) goto abort_due_to_error; |
94390
|
327 |
1151 |
if( res ) goto jump_to_p2; |
94485
|
11277 |
1055 |
if( rc==SQLITE_OK ){ |
94493
|
0 |
1055 |
if( rc!=SQLITE_DONE ) goto abort_due_to_error; |
94538
|
0 |
87 |
if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++; |
94541
|
0 |
87 |
rc = ExpandBlob(pIn2); |
94542
|
0 |
87 |
if( rc ) goto abort_due_to_error; |
94547
|
66 |
21 |
rc = sqlite3BtreeInsert(pC->uc.pCursor, &x, |
94553
|
0 |
87 |
if( rc) goto abort_due_to_error; |
94575
|
0 |
4926 |
rc = ExpandBlob(pIn2); |
94576
|
0 |
4926 |
if( rc ) goto abort_due_to_error; |
94578
|
0 |
4926 |
if( rc) goto abort_due_to_error; |
94617
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
94618
|
0 |
0 |
if( res==0 ){ |
94620
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
94621
|
0 |
0 |
}else if( pOp->p5 && !sqlite3WritableSchema(db) ){ |
|
0 |
0 |
}else if( pOp->p5 && !sqlite3WritableSchema(db) ){ |
94681
|
0 |
450 |
if( NEVER(rc!=SQLITE_OK) ) goto abort_due_to_error; |
94683
|
450 |
0 |
if( !pC->nullRow ){ |
94686
|
0 |
450 |
if( rc!=SQLITE_OK ){ |
94689
|
440 |
10 |
if( pOp->opcode==OP_DeferredSeek ){ |
94727
|
1 |
0 |
if( pC->deferredMoveto ){ |
94729
|
0 |
1 |
if( rc ) goto abort_due_to_error; |
94796
|
16 |
459 |
if( pOp->opcode
|
94826
|
475 |
0 |
if( nCellKey<=0 || nCellKey>0x7fffffff ){ |
|
0 |
475 |
if( nCellKey<=0 || nCellKey>0x7fffffff ){ |
94832
|
0 |
475 |
if( rc ) goto abort_due_to_error; |
94839
|
460 |
15 |
if( (pOp->opcode&1)==(OP_IdxLT&1) ){ |
94848
|
42 |
433 |
if( res>0 ) goto jump_to_p2; |
94888
|
0 |
5 |
if( db->nVdbeRead > db->nVDestroy+1 ){ |
94899
|
0 |
5 |
if( rc ) goto abort_due_to_error; |
94901
|
0 |
5 |
if( iMoved!=0 ){ |
94937
|
32 |
1 |
if( pOp->p3 ){ |
94939
|
0 |
32 |
if( pOp->p3>0 ){ |
94945
|
0 |
33 |
if( rc ) goto abort_due_to_error; |
94963
|
0 |
0 |
if( isSorter(pC) ){ |
94969
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
94997
|
0 |
271 |
if( rc ) goto abort_due_to_error; |
95011
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
95047
|
0 |
266 |
if( pOp->p4.z==0 ){ |
95065
|
0 |
266 |
if( zSql==0 ){ |
95074
|
266 |
0 |
if( rc==SQLITE_OK ) rc = initData.rc; |
95075
|
266 |
0 |
if( rc==SQLITE_OK && initData.nInitRow==0 ){ |
|
0 |
266 |
if( rc==SQLITE_OK && initData.nInitRow==0 ){ |
95085
|
0 |
266 |
if( rc ){ |
95087
|
0 |
0 |
if( rc==SQLITE_NOMEM ){ |
95105
|
0 |
1 |
if( rc ) goto abort_due_to_error; |
95195
|
0 |
0 |
if( nErr==0 ){ |
95197
|
0 |
0 |
}else if( z==0 ){ |
95221
|
1 |
0 |
if( (pIn1->flags & MEM_Blob)==0 ){ |
95222
|
0 |
1 |
if( sqlite3VdbeMemSetRowSet(pIn1) ) goto no_mem; |
95242
|
2 |
0 |
if( (pIn1->flags & MEM_Blob)==0 |
95243
|
1 |
1 |
|| sqlite3RowSetNext((RowSet*)pIn1->z, &val)==0 |
95292
|
7 |
9 |
if( (pIn1->flags & MEM_Blob)==0 ){ |
95293
|
0 |
7 |
if( sqlite3VdbeMemSetRowSet(pIn1) ) goto no_mem; |
95298
|
12 |
4 |
if( iSet ){ |
95301
|
0 |
12 |
if( exists ) goto jump_to_p2; |
95303
|
10 |
6 |
if( iSet>=0 ){ |
95352
|
0 |
0 |
if( pOp->p5 ){ |
95354
|
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); |
95355
|
0 |
0 |
if( pFrame ) break; |
95358
|
0 |
0 |
if( p->nFrame>=db->aLimit[SQLITE_LIMIT_TRIGGER_DEPTH] ){ |
95368
|
0 |
0 |
if( (pRt->flags&MEM_Blob)==0 ){ |
95376
|
0 |
0 |
if( pProgram->nCsr==0 ) nMem++; |
95382
|
0 |
0 |
if( !pFrame ){ |
95410
|
0 |
0 |
for(pMem=VdbeFrameMem(pFrame); pMem!=pEnd; pMem++){ |
95493
|
0 |
1 |
if( db->flags & SQLITE_DeferFKs ){ |
95495
|
0 |
1 |
}else if( pOp->p1 ){ |
95516
|
0 |
2 |
if( pOp->p1 ){ |
95518
|
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; |
95521
|
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; |
95541
|
0 |
192 |
if( p->pFrame ){ |
95542
|
0 |
0 |
for(pFrame=p->pFrame; pFrame->pParent; pFrame=pFrame->pParent); |
95551
|
0 |
192 |
if( pIn1->u.iu.i){ |
95572
|
42 |
50 |
if( pIn1->u.i>0 ){ |
95605
|
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) ){ |
95632
|
3 |
2 |
if( pIn1->u.i ){ |
95633
|
3 |
0 |
if( pIn1->u.i>0 ) pIn1->u.i--; |
95648
|
78 |
0 |
if( pIn1->u.i>SMALLEST_INT64 ) pIn1->u.i--; |
95650
|
78 |
0 |
if( pIn1->u.i==0 ) goto jump_to_p2; |
95706
|
0 |
91 |
if( pCtx==0 ) goto no_mem; |
95751
|
91 |
409 |
if( pCtx->pMem != pMem ){ |
95753
|
41 |
91 |
for(i=pCtx->argc-1; i>=0; i--) pCtx->argv[i] = &aMem[pOp->p2+i]; |
95768
|
0 |
500 |
if( pOp->p1 ){ |
95774
|
0 |
500 |
if( pCtx->isError ){ |
95775
|
0 |
0 |
if( pCtx->isError>0 ){ |
95779
|
0 |
0 |
if( pCtx->skipFlag ){ |
95782
|
0 |
0 |
if( i ) sqlite3VdbeMemSetInt64(&aMem[i], 1); |
95788
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
95829
|
0 |
219 |
if( pOp->p3 ){ |
95839
|
0 |
219 |
if( rc ){ |
95874
|
0 |
0 |
if( rc ){ |
95875
|
0 |
0 |
if( rc!=SQLITE_BUSY ) goto abort_due_to_error; |
95879
|
0 |
0 |
for(i=0, pMem = &aMem[pOp->p3]; i<3; i++, pMem++){ |
95923
|
2 |
0 |
if( eNew==PAGER_JOURNALMODE_QUERY ) eNew = eOld; |
95925
|
0 |
2 |
if( !sqlite3PagerOkToChangeJournalMode(pPager) ) eNew = eOld; |
95933
|
0 |
2 |
if( eNew==PAGER_JOURNALMODE_WAL |
95934
|
0 |
0 |
&& (sqlite3Strlen30(zFilename)==0 /* Temp file */ |
95935
|
0 |
0 |
|| !sqlite3PagerWalSupported(pPager)) /* No shared-memory support */ |
95940
|
0 |
2 |
if( (eNew!=eOld) |
95941
|
0 |
0 |
&& (eOld==PAGER_JOURNALMODE_WAL || eNew==PAGER_JOURNALMODE_WAL) |
|
0 |
0 |
&& (eOld==PAGER_JOURNALMODE_WAL || eNew==PAGER_JOURNALMODE_WAL) |
95943
|
0 |
0 |
if( !db->autoCommit || db->nVdbeRead>1 ){ |
|
0 |
0 |
if( !db->autoCommit || db->nVdbeRead>1 ){ |
95945
|
0 |
0 |
sqlite3VdbeError(p, |
95952
|
0 |
0 |
if( eOld==PAGER_JOURNALMODE_WAL ){ |
95959
|
0 |
0 |
if( rc==SQLITE_OK ){ |
95962
|
0 |
0 |
}else if( eOld==PAGER_JOURNALMODE_MEMORY ){ |
95972
|
0 |
0 |
if( rc==SQLITE_OK ){ |
95973
|
0 |
0 |
rc = sqlite3BtreeSetVersion(pBt, (eNew==PAGER_JOURNALMODE_WAL ? 2 : 1)); |
95979
|
0 |
2 |
if( rc ) eNew = eOld; |
95987
|
0 |
2 |
if( rc ) goto abort_due_to_error; |
96004
|
0 |
0 |
rc = sqlite3RunVacuum(&p->zErrMsg, db, pOp->p1, |
96006
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
96027
|
0 |
0 |
if( rc ){ |
96028
|
0 |
0 |
if( rc!=SQLITE_DONE ) goto abort_due_to_error; |
96054
|
54 |
224 |
if( !pOp->p1 ){ |
96110
|
31 |
0 |
if( isWriteLock || 0==(db->flags&SQLITE_ReadUncommit) ){ |
|
31 |
0 |
if( isWriteLock || 0==(db->flags&SQLITE_ReadUncommit) ){ |
96116
|
0 |
31 |
if( rc ){ |
96117
|
0 |
0 |
if( (rc&0xFF)==SQLITE_LOCKED ){ |
96142
|
48 |
31 |
if( pVTab ) sqlite3VtabImportErrmsg(p, pVTab->pVtab); |
96143
|
0 |
79 |
if( rc ) goto abort_due_to_error; |
96168
|
29 |
0 |
if( zTab ){ |
96172
|
1 |
28 |
if( rc ) goto abort_due_to_error; |
96188
|
0 |
2 |
if( rc ) goto abort_due_to_error; |
96210
|
194 |
0 |
if( pVtab==0 || NEVER(pVtab->pModule==0) ){ |
|
0 |
194 |
if( pVtab==0 || NEVER(pVtab->pModule==0) ){ |
96217
|
0 |
194 |
if( rc ) goto abort_due_to_error; |
96224
|
194 |
0 |
if( pCur ){ |
96253
|
0 |
0 |
if( pRhs==0 ) goto no_mem; |
96315
|
202 |
204 |
for(i = 0; i
|
96320
|
0 |
204 |
if( rc ) goto abort_due_to_error; |
96324
|
28 |
176 |
if( res ) goto jump_to_p2; |
96355
|
2 |
1131 |
if( pCur->nullRow ){ |
96367
|
0 |
1131 |
if( pOp->p5 & OPFLAG_NOCHNG ){ |
96376
|
0 |
1131 |
if( sContext.isError>0 ){ |
96384
|
0 |
1131 |
if( rc ) goto abort_due_to_error; |
96405
|
1 |
337 |
if( pCur->nullRow ){ |
96420
|
0 |
337 |
if( rc ) goto abort_due_to_error; |
96423
|
221 |
116 |
if( !res ){ |
96456
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
96458
|
0 |
0 |
if( isLegacy==0 ) db->flags &= ~(u64)SQLITE_LegacyAlter; |
96461
|
0 |
0 |
if( rc ) goto abort_due_to_error; |
96507
|
0 |
50 |
if( db->mallocFailed ) goto no_mem; |
96510
|
50 |
0 |
if( pVtab==0 || NEVER(pVtab->pModule==0) ){ |
|
0 |
50 |
if( pVtab==0 || NEVER(pVtab->pModule==0) ){ |
96517
|
50 |
0 |
if( ALWAYS(pModule->xUpdate) ){ |
96521
|
302 |
50 |
for(i=0; i
|
96531
|
50 |
0 |
if( rc==SQLITE_OK && pOp->p1 ){ |
|
49 |
1 |
if( rc==SQLITE_OK && pOp->p1 ){ |
96535
|
0 |
50 |
if( (rc&0xff)==SQLITE_CONSTRAINT && pOp->p4.pVtab->bConstraint ){ |
|
0 |
0 |
if( (rc&0xff)==SQLITE_CONSTRAINT && pOp->p4.pVtab->bConstraint ){ |
96536
|
0 |
0 |
if( pOp->p5==OE_Ignore ){ |
96539
|
0 |
0 |
p->errorAction = ((pOp->p5==OE_Replace) ? OE_Abort : pOp->p5); |
96544
|
0 |
50 |
if( rc ) goto abort_due_to_error; |
96579
|
0 |
0 |
if( pOp->p3 ){ |
96581
|
0 |
0 |
if( newMax < (unsigned)pOp->p3 ) newMax = (unsigned)pOp->p3; |
96647
|
669 |
411 |
if( pCtx->pOut != pOut ){ |
96651
|
1143 |
669 |
for(i=pCtx->argc-1; i>=0; i--) pCtx->argv[i] = &aMem[pOp->p2+i]; |
96667
|
6 |
1074 |
if( pCtx->isError ){ |
96668
|
6 |
0 |
if( pCtx->isError>0 ){ |
96674
|
6 |
0 |
if( rc ) goto abort_due_to_error; |
96758
|
0 |
0 |
if( (pIn1->z[h/8] & (1<<(h&7)))==0 ){ |
96816
|
10 |
6254 |
if( (db->mTrace & (SQLITE_TRACE_STMT|SQLITE_TRACE_LEGACY))!=0 |
96817
|
10 |
0 |
&& p->minWriteFileFormat!=254 /* tag-20220401a */ |
96818
|
0 |
10 |
&& (zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0 |
|
6 |
4 |
&& (zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0 |
96821
|
6 |
0 |
if( db->mTrace & SQLITE_TRACE_LEGACY ){ |
96827
|
0 |
0 |
if( db->nVdbeExec>1 ){ |
96854
|
0 |
6264 |
if( pOp->p1>=sqlite3GlobalConfig.iOnceResetThreshold ){ |
96855
|
0 |
0 |
if( pOp->opcode==OP_Trace ) break; |
96856
|
0 |
0 |
for(i=1; inOp; i++){ |
96857
|
0 |
0 |
if( p->aOp[i].opcode==OP_Once ) p->aOp[i].p1 = 0; |
97020
|
0 |
33 |
if( db->mallocFailed ){ |
97022
|
0 |
33 |
}else if( rc==SQLITE_IOERR_CORRUPTFS ){ |
97038
|
6 |
27 |
if( p->zErrMsg==0 && rc!=SQLITE_IOERR_NOMEM ){ |
|
6 |
0 |
if( p->zErrMsg==0 && rc!=SQLITE_IOERR_NOMEM ){ |
97046
|
33 |
0 |
if( p->eVdbeState==VDBE_RUN_STATE ) sqlite3VdbeHalt(p); |
97047
|
0 |
33 |
if( rc==SQLITE_IOERR_NOMEM ) sqlite3OomFault(db); |
97048
|
0 |
33 |
if( rc==SQLITE_CORRUPT && db->autoCommit==0 ){ |
|
0 |
0 |
if( rc==SQLITE_CORRUPT && db->autoCommit==0 ){ |
97052
|
0 |
33 |
if( resetSchemaOnFault>0 ){ |
97061
|
80 |
13014 |
while( nVmStep>=nProgressLimit && db->xProgress!=0 ){ |
|
80 |
0 |
while( nVmStep>=nProgressLimit && db->xProgress!=0 ){ |
97063
|
0 |
80 |
if( db->xProgress(db->pProgressArg) ){ |
97173
|
87 |
31 |
if( v->pc>4 ){ |
97180
|
118 |
0 |
if( rc==SQLITE_ROW ){ |
97185
|
118 |
0 |
type = pC->nHdrParsed>p->iCol ? pC->aType[p->iCol] : 0; |
97188
|
0 |
118 |
if( type<12 ){ |
97189
|
0 |
0 |
zErr = sqlite3MPrintf(p->db, "cannot open value of type %s", |
97190
|
0 |
0 |
type==0?"null": type==7?"real": "integer" |
97203
|
118 |
0 |
if( rc==SQLITE_ROW ){ |
97205
|
0 |
0 |
}else if( p->pStmt ){ |
97208
|
0 |
0 |
if( rc==SQLITE_OK ){ |
97261
|
0 |
31 |
if( !pBlob ) goto blob_open_out; |
97267
|
31 |
0 |
if( pTab && IsVirtual(pTab) ){ |
|
0 |
31 |
if( pTab && IsVirtual(pTab) ){ |
97271
|
31 |
0 |
if( pTab && !HasRowid(pTab) ){ |
|
0 |
31 |
if( pTab && !HasRowid(pTab) ){ |
97276
|
31 |
0 |
if( pTab && IsView(pTab) ){ |
|
0 |
31 |
if( pTab && IsView(pTab) ){ |
97281
|
0 |
31 |
if( !pTab ){ |
97282
|
0 |
0 |
if( sParse.zErrMsg ){ |
97295
|
62 |
0 |
for(iCol=0; iColnCol; iCol++) { |
97296
|
31 |
31 |
if( sqlite3StrICmp(pTab->aCol[iCol].zCnName, zColumn)==0 ){ |
97300
|
0 |
31 |
if( iCol==pTab->nCol ){ |
97311
|
0 |
31 |
if( wrFlag ){ |
97315
|
0 |
0 |
if( db->flags&SQLITE_ForeignKeys ){ |
97322
|
0 |
0 |
for(pFKey=pTab->u.tab.pFKey; pFKey; pFKey=pFKey->pNextFrom){ |
97324
|
0 |
0 |
for(j=0; jnCol; j++){ |
97325
|
0 |
0 |
if( pFKey->aCol[j].iFrom==iCol ){ |
97332
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
97334
|
0 |
0 |
for(j=0; jnKeyCol; j++){ |
97336
|
0 |
0 |
if( pIdx->aiColumn[j]==iCol || pIdx->aiColumn[j]==XN_EXPR ){ |
|
0 |
0 |
if( pIdx->aiColumn[j]==iCol || pIdx->aiColumn[j]==XN_EXPR ){ |
97341
|
0 |
0 |
if( zFault ){ |
97352
|
31 |
0 |
if( pBlob->pStmt ){ |
97393
|
31 |
0 |
if( db->mallocFailed==0 ){ |
97404
|
31 |
0 |
if( db->mallocFailed==0 ){ |
97409
|
0 |
31 |
if( wrFlag ) aOp[1].opcode = OP_OpenWrite; |
97434
|
0 |
31 |
if( db->mallocFailed ){ |
97438
|
31 |
0 |
if( (++nAttempt)>=SQLITE_MAX_SCHEMA_RETRY || rc!=SQLITE_SCHEMA ) break; |
|
0 |
31 |
if( (++nAttempt)>=SQLITE_MAX_SCHEMA_RETRY || rc!=SQLITE_SCHEMA ) break; |
97443
|
31 |
0 |
if( rc==SQLITE_OK && db->mallocFailed==0 ){ |
|
31 |
0 |
if( rc==SQLITE_OK && db->mallocFailed==0 ){ |
97446
|
0 |
0 |
if( pBlob && pBlob->pStmt ) sqlite3VdbeFinalize((Vdbe *)pBlob->pStmt); |
|
0 |
0 |
if( pBlob && pBlob->pStmt ) sqlite3VdbeFinalize((Vdbe *)pBlob->pStmt); |
97449
|
0 |
31 |
sqlite3ErrorWithMsg(db, rc, (zErr ? "%s" : 0), zErr); |
97466
|
31 |
660 |
if( p ){ |
97494
|
0 |
72 |
if( p==0 ) return SQLITE_MISUSE_BKPT; |
97499
|
72 |
0 |
if( n<0 || iOffset<0 || ((sqlite3_int64)iOffset+n)>p->nByte ){ |
|
72 |
0 |
if( n<0 || iOffset<0 || ((sqlite3_int64)iOffset+n)>p->nByte ){ |
|
0 |
72 |
if( n<0 || iOffset<0 || ((sqlite3_int64)iOffset+n)>p->nByte ){ |
97502
|
0 |
72 |
}else if( v==0 ){ |
97541
|
0 |
72 |
if( rc==SQLITE_ABORT ){ |
97576
|
118 |
0 |
return (p && p->pStmt) ? p->nByte : 0; |
|
118 |
0 |
return (p && p->pStmt) ? p->nByte : 0; |
97594
|
0 |
87 |
if( p==0 ) return SQLITE_MISUSE_BKPT; |
97598
|
0 |
87 |
if( p->pStmt==0 ){ |
97607
|
0 |
87 |
if( rc!=SQLITE_OK ){ |
97608
|
0 |
0 |
sqlite3ErrorWithMsg(db, rc, (zErr ? "%s" : 0), zErr); |
98095
|
0 |
0 |
if( pReadr->aMap ) sqlite3OsUnfetch(pReadr->pFd, 0, pReadr->aMap); |
98117
|
0 |
0 |
if( p->aMap ){ |
98129
|
0 |
0 |
if( iBuf==0 ){ |
98134
|
0 |
0 |
if( (p->iEof - p->iReadOff) > (i64)p->nBuffer ){ |
98144
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
98148
|
0 |
0 |
if( nByte<=nAvail ){ |
98161
|
0 |
0 |
if( p->nAlloc
|
98164
|
0 |
0 |
while( nByte>nNew ) nNew = nNew*2; |
98166
|
0 |
0 |
if( !aNew ) return SQLITE_NOMEM_BKPT; |
98179
|
0 |
0 |
while( nRem>0 ){ |
98185
|
0 |
0 |
if( nRem>p->nBuffer ) nCopy = p->nBuffer; |
98187
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
98206
|
0 |
0 |
if( p->aMap ){ |
98210
|
0 |
0 |
if( iBuf && (p->nBuffer-iBuf)>=9 ){ |
|
0 |
0 |
if( iBuf && (p->nBuffer-iBuf)>=9 ){ |
98217
|
0 |
0 |
if( rc ) return rc; |
98219
|
0 |
0 |
}while( (a[0]&0x80)!=0 ); |
98238
|
0 |
0 |
if( pFile->iEof<=(i64)(pTask->pSorter->db->nMaxSorterMmap) ){ |
98240
|
0 |
0 |
if( pFd->pMethods->iVersion>=3 ){ |
98263
|
0 |
0 |
if( sqlite3FaultSim(201) ) return SQLITE_IOERR_READ; |
98264
|
0 |
0 |
if( pReadr->aMap ){ |
98273
|
0 |
0 |
if( rc==SQLITE_OK && pReadr->aMap==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pReadr->aMap==0 ){ |
98276
|
0 |
0 |
if( pReadr->aBuffer==0 ){ |
98278
|
0 |
0 |
if( pReadr->aBuffer==0 ) rc = SQLITE_NOMEM_BKPT; |
98281
|
0 |
0 |
if( rc==SQLITE_OK && iBuf ){ |
|
0 |
0 |
if( rc==SQLITE_OK && iBuf ){ |
98283
|
0 |
0 |
if( (pReadr->iReadOff + nRead) > pReadr->iEof ){ |
98305
|
0 |
0 |
if( pReadr->iReadOff>=pReadr->iEof ){ |
98308
|
0 |
0 |
if( pIncr ){ |
98310
|
0 |
0 |
if( rc==SQLITE_OK && pIncr->bEof==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pIncr->bEof==0 ){ |
98318
|
0 |
0 |
if( bEof ){ |
98326
|
0 |
0 |
if( rc==SQLITE_OK ){ |
98329
|
0 |
0 |
if( rc==SQLITE_OK ){ |
98362
|
0 |
0 |
if( rc==SQLITE_OK ){ |
98369
|
0 |
0 |
if( rc==SQLITE_OK ){ |
98387
|
5 |
0 |
if( *pbKey2Cached==0 ){ |
98414
|
20116 |
15403 |
if( !*pbKey2Cached ){ |
98441
|
0 |
103 |
getVarint32NR(&p1[1], n1); |
98442
|
0 |
103 |
getVarint32NR(&p2[1], n2); |
98444
|
34 |
69 |
if( res==0 ){ |
98448
|
34 |
69 |
if( res==0 ){ |
98449
|
5 |
29 |
if( pTask->pSorter->pKeyInfo->nKeyField>1 ){ |
98456
|
0 |
69 |
if( pTask->pSorter->pKeyInfo->aSortFlags[0] ){ |
98485
|
233 |
360 |
if( s1==s2 ){ |
98491
|
233 |
0 |
for(i=0; i
|
98492
|
233 |
0 |
if( (res = v1[i] - v2[i])!=0 ){ |
98493
|
0 |
233 |
if( ((v1[0] ^ v2[0]) & 0x80)!=0 ){ |
98494
|
0 |
0 |
res = v1[0] & 0x80 ? -1 : +1; |
98499
|
140 |
220 |
}else if( s1>7 && s2>7 ){ |
|
104 |
36 |
}else if( s1>7 && s2>7 ){ |
98502
|
220 |
36 |
if( s2>7 ){ |
98504
|
36 |
0 |
}else if( s1>7 ){ |
98511
|
220 |
36 |
if( res>0 ){ |
98512
|
0 |
220 |
if( *v1 & 0x80 ) res = -1; |
98514
|
0 |
36 |
if( *v2 & 0x80 ) res = +1; |
98518
|
0 |
593 |
if( res==0 ){ |
98519
|
0 |
0 |
if( pTask->pSorter->pKeyInfo->nKeyField>1 ){ |
98524
|
2 |
591 |
}else if( pTask->pSorter->pKeyInfo->aSortFlags[0] ){ |
98571
|
262 |
0 |
if( sqlite3TempInMemory(db) || sqlite3GlobalConfig.bCoreMutex==0 ){ |
|
0 |
262 |
if( sqlite3TempInMemory(db) || sqlite3GlobalConfig.bCoreMutex==0 ){ |
98594
|
0 |
262 |
if( pSorter==0 ){ |
98601
|
5 |
257 |
if( nField && nWorker==0 ){ |
|
5 |
0 |
if( nField && nWorker==0 ){ |
98611
|
262 |
262 |
for(i=0; inTask; i++){ |
98616
|
262 |
0 |
if( !sqlite3TempInMemory(db) ){ |
98622
|
261 |
1 |
if( mxCache<0 ){ |
98634
|
262 |
0 |
if( sqlite3GlobalConfig.bSmallMalloc==0 ){ |
98638
|
0 |
262 |
if( !pSorter->list.aMemory ) rc = SQLITE_NOMEM_BKPT; |
98642
|
262 |
0 |
if( pKeyInfo->nAllField<13 |
98643
|
257 |
5 |
&& (pKeyInfo->aColl[0]==0 || pKeyInfo->aColl[0]==db->pDfltColl) |
|
241 |
16 |
&& (pKeyInfo->aColl[0]==0 || pKeyInfo->aColl[0]==db->pDfltColl) |
98644
|
246 |
0 |
&& (pKeyInfo->aSortFlags[0] & KEYINFO_ORDER_BIGNULL)==0 |
98660
|
0 |
262 |
for(p=pRecord; p; p=pNext){ |
98675
|
0 |
262 |
if( pTask->list.aMemory ){ |
98683
|
0 |
262 |
if( pTask->file.pFd ){ |
98686
|
0 |
262 |
if( pTask->file2.pFd ){ |
98738
|
0 |
262 |
if( pTask->pThread ){ |
98781
|
262 |
262 |
for(i=pSorter->nTask-1; i>=0; i--){ |
98784
|
262 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
98807
|
0 |
0 |
while( N
|
98810
|
0 |
0 |
pNew = sqlite3FaultSim(100) ? 0 : (MergeEngine*)sqlite3MallocZero(nByte); |
98811
|
0 |
0 |
if( pNew ){ |
98825
|
0 |
262 |
if( pMerger ){ |
98826
|
0 |
0 |
for(i=0; inTree; i++){ |
98838
|
0 |
0 |
if( pIncr ){ |
98840
|
0 |
0 |
if( pIncr->bUseThread ){ |
98842
|
0 |
0 |
if( pIncr->aFile[0].pFd ) sqlite3OsCloseFree(pIncr->aFile[0].pFd); |
98843
|
0 |
0 |
if( pIncr->aFile[1].pFd ) sqlite3OsCloseFree(pIncr->aFile[1].pFd); |
98859
|
0 |
262 |
if( pSorter->pReader ){ |
98867
|
262 |
262 |
for(i=0; inTask; i++){ |
98872
|
0 |
262 |
if( pSorter->list.aMemory==0 ){ |
98891
|
262 |
0 |
if( pSorter ){ |
98910
|
0 |
0 |
if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){ |
|
0 |
0 |
if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){ |
98916
|
0 |
0 |
if( p ) sqlite3OsUnfetch(pFd, 0, p); |
98934
|
0 |
0 |
if( sqlite3FaultSim(202) ) return SQLITE_IOERR_ACCESS; |
98940
|
0 |
0 |
if( rc==SQLITE_OK ){ |
98943
|
0 |
0 |
if( nExtend>0 ){ |
98956
|
212 |
0 |
if( pTask->pUnpacked==0 ){ |
98958
|
0 |
212 |
if( pTask->pUnpacked==0 ) return SQLITE_NOMEM_BKPT; |
98985
|
17720 |
18495 |
if( res<=0 ){ |
98989
|
2270 |
15450 |
if( p1==0 ){ |
98998
|
2444 |
16051 |
if( p2==0 ){ |
99012
|
148 |
64 |
if( p->typeMask==SORTER_TYPE_INTEGER ){ |
99014
|
38 |
26 |
}else if( p->typeMask==SORTER_TYPE_TEXT ){ |
99032
|
0 |
212 |
if( rc!=SQLITE_OK ) return rc; |
99038
|
4926 |
212 |
while( p ){ |
99040
|
4926 |
0 |
if( pList->aMemory ){ |
99041
|
212 |
4714 |
if( (u8*)p==pList->aMemory ){ |
99052
|
4639 |
4926 |
for(i=0; aSlot[i]; i++){ |
99061
|
13568 |
212 |
for(i=0; i
|
99062
|
13281 |
287 |
if( aSlot[i]==0 ) continue; |
99063
|
75 |
212 |
p = p ? vdbeSorterMerge(pTask, p, aSlot[i]) : aSlot[i]; |
99084
|
0 |
0 |
if( !p->aBuffer ){ |
99100
|
0 |
0 |
while( nRem>0 && p->eFWErr==0 ){ |
|
0 |
0 |
while( nRem>0 && p->eFWErr==0 ){ |
99102
|
0 |
0 |
if( nCopy>(p->nBuffer - p->iBufEnd) ){ |
99108
|
0 |
0 |
if( p->iBufEnd==p->nBuffer ){ |
99133
|
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 ){ |
99187
|
0 |
0 |
if( pTask->file.pFd==0 ){ |
99195
|
0 |
0 |
if( rc==SQLITE_OK ){ |
99200
|
0 |
0 |
if( rc==SQLITE_OK ){ |
99204
|
0 |
0 |
if( rc==SQLITE_OK ){ |
99212
|
0 |
0 |
for(p=pList->pList; p; p=pNext){ |
99216
|
0 |
0 |
if( pList->aMemory==0 ) sqlite3_free(p); |
99247
|
0 |
0 |
if( rc==SQLITE_OK ){ |
99258
|
0 |
0 |
for(i=(pMerger->nTree+iPrev)/2; i>0; i=i/2){ |
99261
|
0 |
0 |
if( pReadr1->pFd==0 ){ |
99263
|
0 |
0 |
}else if( pReadr2->pFd==0 ){ |
99286
|
0 |
0 |
if( iRes<0 || (iRes==0 && pReadr1
|
|
0 |
0 |
if( iRes<0 || (iRes==0 && pReadr1
|
|
0 |
0 |
if( iRes<0 || (iRes==0 && pReadr1
|
99291
|
0 |
0 |
if( pReadr1->pFd ) bCached = 0; |
99299
|
0 |
0 |
return (rc==SQLITE_OK ? pTask->pUnpacked->errCode : rc); |
99342
|
0 |
0 |
for(i=0; i
|
99345
|
0 |
0 |
if( pTask->bDone ){ |
99348
|
0 |
0 |
if( rc!=SQLITE_OK || pTask->pThread==0 ) break; |
|
0 |
0 |
if( rc!=SQLITE_OK || pTask->pThread==0 ) break; |
99351
|
0 |
0 |
if( rc==SQLITE_OK ){ |
99352
|
0 |
0 |
if( i==nWorker ){ |
99371
|
0 |
0 |
if( aMem ){ |
99374
|
0 |
0 |
}else if( pSorter->list.aMemory ){ |
99376
|
0 |
0 |
if( !pSorter->list.aMemory ) return SQLITE_NOMEM_BKPT; |
99404
|
0 |
4926 |
getVarint32NR((const u8*)&pVal->z[1], t); |
99405
|
4920 |
6 |
if( t>0 && t<10 && t!=7 ){ |
|
4556 |
364 |
if( t>0 && t<10 && t!=7 ){ |
|
556 |
4000 |
if( t>0 && t<10 && t!=7 ){ |
99407
|
364 |
4006 |
}else if( t>10 && (t & 0x01) ){ |
|
364 |
0 |
}else if( t>10 && (t & 0x01) ){ |
99433
|
4926 |
0 |
if( pSorter->mxPmaSize ){ |
99434
|
4926 |
0 |
if( pSorter->list.aMemory ){ |
99435
|
4714 |
212 |
bFlush = pSorter->iMemory && (pSorter->iMemory+nReq) > pSorter->mxPmaSize; |
|
0 |
4714 |
bFlush = pSorter->iMemory && (pSorter->iMemory+nReq) > pSorter->mxPmaSize; |
99439
|
0 |
0 |
|| (pSorter->list.szPMA > pSorter->mnPmaSize && sqlite3HeapNearlyFull()) |
|
0 |
0 |
|| (pSorter->list.szPMA > pSorter->mnPmaSize && sqlite3HeapNearlyFull()) |
|
0 |
0 |
|| (pSorter->list.szPMA > pSorter->mnPmaSize && sqlite3HeapNearlyFull()) |
99442
|
0 |
4926 |
if( bFlush ){ |
99451
|
301 |
4625 |
if( nPMA>pSorter->mxKeysize ){ |
99455
|
4926 |
0 |
if( pSorter->list.aMemory ){ |
99458
|
19 |
4907 |
if( nMin>pSorter->nMemory ){ |
99462
|
17 |
2 |
if( pSorter->list.pList ){ |
99465
|
6 |
19 |
while( nNew < nMin ) nNew = nNew*2; |
99466
|
0 |
19 |
if( nNew > pSorter->mxPmaSize ) nNew = pSorter->mxPmaSize; |
99467
|
0 |
19 |
if( nNew < nMin ) nNew = nMin; |
99469
|
0 |
19 |
if( !aNew ) return SQLITE_NOMEM_BKPT; |
99470
|
17 |
2 |
if( iListOff>=0 ){ |
99479
|
4714 |
212 |
if( pSorter->list.pList ){ |
99484
|
0 |
0 |
if( pNew==0 ){ |
99515
|
0 |
0 |
while( rc==SQLITE_OK ){ |
99523
|
0 |
0 |
if( pReader->pFd==0 ) break; |
99524
|
0 |
0 |
if( (iEof + nKey + sqlite3VarintLen(nKey))>(iStart + pIncr->mxSz) ) break; |
99534
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
99582
|
0 |
0 |
if( pIncr->bUseThread ){ |
99585
|
0 |
0 |
if( rc==SQLITE_OK ){ |
99591
|
0 |
0 |
if( rc==SQLITE_OK ){ |
99592
|
0 |
0 |
if( pIncr->aFile[0].iEof==pIncr->iStartOff ){ |
99603
|
0 |
0 |
if( pIncr->aFile[0].iEof==pIncr->iStartOff ){ |
99623
|
0 |
0 |
IncrMerger *pIncr = *ppOut = (IncrMerger*) |
99625
|
0 |
0 |
if( pIncr ){ |
99667
|
0 |
0 |
if( iOut>=(pMerger->nTree/2) ){ |
99678
|
0 |
0 |
if( p1->pFd==0 ){ |
99680
|
0 |
0 |
}else if( p2->pFd==0 ){ |
99690
|
0 |
0 |
if( res<=0 ){ |
99758
|
0 |
0 |
for(i=0; i
|
99759
|
0 |
0 |
if( SQLITE_MAX_WORKER_THREADS>0 && eMode==INCRINIT_ROOT ){ |
99771
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
99774
|
0 |
0 |
for(i=pMerger->nTree-1; i>0; i--){ |
99827
|
0 |
0 |
if( rc==SQLITE_OK ){ |
99830
|
0 |
0 |
if( pIncr->bUseThread ){ |
99832
|
0 |
0 |
if( rc==SQLITE_OK ){ |
99838
|
0 |
0 |
if( pTask->file2.pFd==0 ){ |
99843
|
0 |
0 |
if( rc==SQLITE_OK ){ |
99852
|
0 |
0 |
if( rc==SQLITE_OK && pIncr->bUseThread ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pIncr->bUseThread ){ |
99868
|
0 |
0 |
if( rc==SQLITE_OK && (SQLITE_MAX_WORKER_THREADS==0 || eMode!=INCRINIT_TASK) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && (SQLITE_MAX_WORKER_THREADS==0 || eMode!=INCRINIT_TASK) ){ |
99904
|
0 |
0 |
if( pIncr ){ |
99907
|
0 |
0 |
if( pIncr->bUseThread ){ |
99943
|
0 |
0 |
if( pNew==0 ) rc = SQLITE_NOMEM_BKPT; |
99945
|
0 |
0 |
for(i=0; i
|
|
0 |
0 |
for(i=0; i
|
99952
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
99973
|
0 |
0 |
while( nDiv < (i64)nPMA ){ |
100003
|
0 |
0 |
for(i=1; i
|
100007
|
0 |
0 |
for(i=1; i
|
|
0 |
0 |
for(i=1; i
|
100011
|
0 |
0 |
if( pReadr->pIncr==0 ){ |
100013
|
0 |
0 |
if( pNew==0 ){ |
100019
|
0 |
0 |
if( rc==SQLITE_OK ){ |
100025
|
0 |
0 |
if( rc==SQLITE_OK ){ |
100057
|
0 |
0 |
if( pSorter->nTask>1 ){ |
100059
|
0 |
0 |
if( pMain==0 ) rc = SQLITE_NOMEM_BKPT; |
100063
|
0 |
0 |
for(iTask=0; rc==SQLITE_OK && iTasknTask; iTask++){ |
|
0 |
0 |
for(iTask=0; rc==SQLITE_OK && iTasknTask; iTask++){ |
100066
|
0 |
0 |
if( SQLITE_MAX_WORKER_THREADS==0 || pTask->nPMA ){ |
100071
|
0 |
0 |
if( pTask->nPMA<=SORTER_MAX_MERGE_COUNT ){ |
100077
|
0 |
0 |
if( pRoot==0 ) rc = SQLITE_NOMEM_BKPT; |
100078
|
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){ |
100084
|
0 |
0 |
if( rc==SQLITE_OK ){ |
100090
|
0 |
0 |
if( rc==SQLITE_OK ){ |
100092
|
0 |
0 |
if( pMain!=0 ){ |
100106
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
100131
|
0 |
0 |
for(i=0; inTask; i++){ |
100137
|
0 |
0 |
if( rc==SQLITE_OK ){ |
100140
|
0 |
0 |
if( pSorter->bUseThreads ){ |
100145
|
0 |
0 |
if( rc==SQLITE_OK ){ |
100148
|
0 |
0 |
if( pReadr==0 ) rc = SQLITE_NOMEM_BKPT; |
100150
|
0 |
0 |
if( rc==SQLITE_OK ){ |
100152
|
0 |
0 |
if( rc==SQLITE_OK ){ |
100154
|
0 |
0 |
for(iTask=0; iTask<(pSorter->nTask-1); iTask++){ |
100156
|
0 |
0 |
if( (pIncr = pMain->aReadr[iTask].pIncr) ){ |
100161
|
0 |
0 |
for(iTask=0; rc==SQLITE_OK && iTasknTask; iTask++){ |
|
0 |
0 |
for(iTask=0; rc==SQLITE_OK && iTasknTask; iTask++){ |
100181
|
0 |
0 |
if( rc==SQLITE_OK ){ |
100193
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
100216
|
262 |
0 |
if( pSorter->bUsePMA==0 ){ |
100217
|
212 |
50 |
if( pSorter->list.pList ){ |
100241
|
0 |
0 |
if( rc==SQLITE_OK ){ |
100264
|
0 |
4916 |
if( pSorter->bUsePMA ){ |
100269
|
0 |
0 |
if( pSorter->bUseThreads ){ |
100271
|
0 |
0 |
if( rc==SQLITE_OK && pSorter->pReader->pFd==0 ) rc = SQLITE_DONE; |
|
0 |
0 |
if( rc==SQLITE_OK && pSorter->pReader->pFd==0 ) rc = SQLITE_DONE; |
100279
|
0 |
0 |
if( rc==SQLITE_OK && res ) rc = SQLITE_DONE; |
|
0 |
0 |
if( rc==SQLITE_OK && res ) rc = SQLITE_DONE; |
100285
|
0 |
4916 |
if( pSorter->list.aMemory==0 ) vdbeSorterRecordFree(db, pFree); |
100286
|
4710 |
206 |
rc = pSorter->list.pList ? SQLITE_OK : SQLITE_DONE; |
100300
|
0 |
4923 |
if( pSorter->bUsePMA ){ |
100303
|
0 |
0 |
if( pSorter->bUseThreads ){ |
100329
|
0 |
4922 |
if( sqlite3VdbeMemClearAndResize(pOut, nKey) ){ |
100371
|
1 |
0 |
if( r2==0 ){ |
100373
|
0 |
1 |
if( r2==0 ) return SQLITE_NOMEM_BKPT; |
100380
|
1 |
1 |
for(i=0; i
|
100381
|
0 |
1 |
if( r2->aMem[i].flags & MEM_Null ){ |
100917
|
0 |
283 |
if( (iAmt+iOfst)>p->endpoint.iOffset ){ |
100921
|
172 |
111 |
if( p->readpoint.iOffset!=iOfst || iOfst==0 ){ |
|
1 |
171 |
if( p->readpoint.iOffset!=iOfst || iOfst==0 ){ |
100923
|
288 |
0 |
for(pChunk=p->pFirst; |
100924
|
176 |
112 |
ALWAYS(pChunk) && (iOff+p->nChunkSize)<=iOfst; |
100942
|
92 |
283 |
} while( nRead>=0 && (pChunk=pChunk->pNext)!=0 && nRead>0 ); |
|
92 |
0 |
} while( nRead>=0 && (pChunk=pChunk->pNext)!=0 && nRead>0 ); |
|
92 |
0 |
} while( nRead>=0 && (pChunk=pChunk->pNext)!=0 && nRead>0 ); |
100943
|
283 |
0 |
p->readpoint.iOffset = pChunk ? iOfst+iAmt : 0; |
100955
|
5170 |
1074 |
for(pIter=pFirst; pIter; pIter=pNext){ |
100971
|
0 |
0 |
if( rc==SQLITE_OK ){ |
100975
|
0 |
0 |
for(pIter=copy.pFirst; pIter; pIter=pIter->pNext){ |
100976
|
0 |
0 |
if( iOff + nChunk > copy.endpoint.iOffset ){ |
100980
|
0 |
0 |
if( rc ) break; |
100983
|
0 |
0 |
if( rc==SQLITE_OK ){ |
100988
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
101018
|
748 |
3846 |
if( p->nSpill>0 && (iAmt+iOfst)>p->nSpill ){ |
|
0 |
748 |
if( p->nSpill>0 && (iAmt+iOfst)>p->nSpill ){ |
101020
|
0 |
0 |
if( rc==SQLITE_OK ){ |
101034
|
3552 |
1042 |
if( iOfst>0 && iOfst!=p->endpoint.iOffset ){ |
|
0 |
3552 |
if( iOfst>0 && iOfst!=p->endpoint.iOffset ){ |
101037
|
1042 |
3552 |
if( iOfst==0 && p->pFirst ){ |
|
0 |
1042 |
if( iOfst==0 && p->pFirst ){ |
101041
|
8722 |
4594 |
while( nWrite>0 ){ |
101047
|
5170 |
3552 |
if( iChunkOffset==0 ){ |
101050
|
0 |
5170 |
if( !pNew ){ |
101054
|
4128 |
1042 |
if( pChunk ){ |
101082
|
54 |
0 |
if( sizeendpoint.iOffset ){ |
101084
|
46 |
8 |
if( size==0 ){ |
101089
|
40 |
0 |
for(pIter=p->pFirst; ALWAYS(pIter) && iOffpNext){ |
|
32 |
8 |
for(pIter=p->pFirst; ALWAYS(pIter) && iOffpNext){ |
101092
|
8 |
0 |
if( ALWAYS(pIter) ){ |
101186
|
92 |
1020 |
if( nSpill==0 ){ |
101190
|
209 |
811 |
if( nSpill>0 ){ |
101287
|
0 |
0 |
for(pWin=pList; pWin; pWin=pWin->pNextWin){ |
101290
|
0 |
0 |
if( rc ) return WRC_Abort; |
101292
|
0 |
0 |
if( rc ) return WRC_Abort; |
101294
|
0 |
0 |
if( rc ) return WRC_Abort; |
101296
|
0 |
0 |
if( rc ) return WRC_Abort; |
101298
|
0 |
0 |
if( rc ) return WRC_Abort; |
101299
|
0 |
0 |
if( bOneOnly ) break; |
101330
|
9884 |
36459 |
if( rc ) return rc & WRC_Abort; |
101331
|
11674 |
24785 |
if( !ExprHasProperty(pExpr,(EP_TokenOnly|EP_Leaf)) ){ |
101333
|
6048 |
5626 |
if( pExpr->pLeft && walkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort; |
|
17 |
6031 |
if( pExpr->pLeft && walkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort; |
101334
|
5474 |
6183 |
if( pExpr->pRight ){ |
101338
|
89 |
6094 |
}else if( ExprUseXSelect(pExpr) ){ |
101340
|
26 |
63 |
if( sqlite3WalkSelect(pWalker, pExpr->x.pSelect) ) return WRC_Abort; |
101342
|
2008 |
4086 |
if( pExpr->x.pList ){ |
101343
|
219 |
1789 |
if( sqlite3WalkExprList(pWalker, pExpr->x.pList) ) return WRC_Abort; |
101346
|
0 |
5875 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){ |
101347
|
0 |
0 |
if( walkWindowList(pWalker, pExpr->y.pWin, 1) ) return WRC_Abort; |
101357
|
34821 |
10254 |
return pExpr ? walkExpr(pWalker,pExpr) : WRC_Continue; |
101367
|
8084 |
6958 |
if( p ){ |
101368
|
15971 |
7859 |
for(i=p->nExpr, pItem=p->a; i>0; i--, pItem++){ |
101369
|
225 |
15746 |
if( sqlite3WalkExpr(pWalker, pItem->pExpr) ) return WRC_Abort; |
101392
|
0 |
4015 |
if( sqlite3WalkExprList(pWalker, p->pEList) ) return WRC_Abort; |
101393
|
0 |
4015 |
if( sqlite3WalkExpr(pWalker, p->pWhere) ) return WRC_Abort; |
101394
|
0 |
4015 |
if( sqlite3WalkExprList(pWalker, p->pGroupBy) ) return WRC_Abort; |
101395
|
0 |
4015 |
if( sqlite3WalkExpr(pWalker, p->pHaving) ) return WRC_Abort; |
101396
|
0 |
4015 |
if( sqlite3WalkExprList(pWalker, p->pOrderBy) ) return WRC_Abort; |
101397
|
0 |
4015 |
if( sqlite3WalkExpr(pWalker, p->pLimit) ) return WRC_Abort; |
101399
|
0 |
4015 |
if( p->pWinDefn ){ |
101401
|
0 |
0 |
if( pWalker->xSelectCallback2==sqlite3WalkWinDefnDummyCallback |
101402
|
0 |
0 |
|| ((pParse = pWalker->pParse)!=0 && IN_RENAME_OBJECT) |
|
0 |
0 |
|| ((pParse = pWalker->pParse)!=0 && IN_RENAME_OBJECT) |
101404
|
0 |
0 |
|| pWalker->xSelectCallback2==sqlite3SelectPopWith |
101430
|
4015 |
0 |
if( ALWAYS(pSrc) ){ |
101431
|
2951 |
4015 |
for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){ |
101432
|
85 |
2866 |
if( pItem->pSelect && sqlite3WalkSelect(pWalker, pItem->pSelect) ){ |
|
0 |
85 |
if( pItem->pSelect && sqlite3WalkSelect(pWalker, pItem->pSelect) ){ |
101435
|
0 |
2951 |
if( pItem->fg.isTabFunc |
101436
|
0 |
0 |
&& sqlite3WalkExprList(pWalker, pItem->u1.pFuncArg) |
101464
|
147 |
5748 |
if( p==0 ) return WRC_Continue; |
101465
|
0 |
5748 |
if( pWalker->xSelectCallback==0 ) return WRC_Continue; |
101468
|
1955 |
4015 |
if( rc ) return rc & WRC_Abort; |
101469
|
4015 |
0 |
if( sqlite3WalkSelectExpr(pWalker, p) |
101470
|
0 |
4015 |
|| sqlite3WalkSelectFrom(pWalker, p) |
101474
|
3920 |
95 |
if( pWalker->xSelectCallback2 ){ |
101478
|
222 |
3793 |
}while( p!=0 ); |
101556
|
0 |
0 |
if( pExpr->op==TK_AGG_FUNCTION ) pExpr->op2 += pWalker->u.n; |
101560
|
0 |
164 |
if( N>0 ){ |
101604
|
0 |
164 |
if( db->mallocFailed ){ |
101610
|
0 |
164 |
if( pExpr->op==TK_COLLATE ){ |
101617
|
0 |
164 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){ |
101618
|
0 |
0 |
if( ALWAYS(pExpr->y.pWin!=0) ){ |
101643
|
0 |
0 |
if( pItem->fg.eEName!=ENAME_TAB ) return 0; |
101645
|
0 |
0 |
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){} |
|
0 |
0 |
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){} |
101646
|
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) ){ |
101650
|
0 |
0 |
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){} |
|
0 |
0 |
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){} |
101651
|
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) ){ |
101655
|
0 |
0 |
if( zCol && sqlite3StrICmp(zSpan, zCol)!=0 ){ |
|
0 |
0 |
if( zCol && sqlite3StrICmp(zSpan, zCol)!=0 ){ |
101665
|
2 |
19 |
if( db->init.busy ) return 1; /* Always support for legacy schemas */ |
101666
|
4 |
15 |
if( pTopNC->ncFlags & NC_IsDDL ){ |
101668
|
0 |
4 |
if( sqlite3WritableSchema(db) && (db->flags & SQLITE_DqsDML)!=0 ){ |
|
0 |
0 |
if( sqlite3WritableSchema(db) && (db->flags & SQLITE_DqsDML)!=0 ){ |
101690
|
0 |
5204 |
if( (pExTab->tabFlags & TF_HasGenerated)!=0 |
101691
|
0 |
0 |
&& (pExTab->aCol[n].colFlags & COLFLAG_GENERATED)!=0 |
101695
|
0 |
0 |
return pExTab->nCol>=BMS ? ALLBITS : MASKBIT(pExTab->nCol)-1; |
101699
|
0 |
5204 |
if( n>=BMS ) n = BMS-1; |
101717
|
0 |
0 |
if( pNew ){ |
101789
|
4 |
6285 |
if( zDb ){ |
101792
|
0 |
4 |
if( (pNC->ncFlags & (NC_PartIdx|NC_IsCheck))!=0 ){ |
101799
|
8 |
0 |
for(i=0; inDb; i++){ |
101801
|
4 |
4 |
if( sqlite3StrICmp(db->aDb[i].zDbSName,zDb)==0 ){ |
101806
|
0 |
4 |
if( i==db->nDb && sqlite3StrICmp("main", zDb)==0 ){ |
|
0 |
0 |
if( i==db->nDb && sqlite3StrICmp("main", zDb)==0 ){ |
101821
|
6287 |
14 |
if( pSrcList ){ |
101822
|
6340 |
6287 |
for(i=0, pItem=pSrcList->a; inSrc; i++, pItem++){ |
101828
|
0 |
6340 |
if( pItem->fg.isNestedFrom ){ |
101840
|
0 |
0 |
for(j=0; jnExpr; j++){ |
101841
|
0 |
0 |
if( !sqlite3MatchEName(&pEList->a[j], zCol, zTab, zDb) ){ |
101844
|
0 |
0 |
if( cnt>0 ){ |
101845
|
0 |
0 |
if( pItem->fg.isUsing==0 |
101846
|
0 |
0 |
|| sqlite3IdListIndex(pItem->u3.pUsing, zCol)<0 |
101854
|
0 |
0 |
if( (pItem->fg.jointype & JT_RIGHT)==0 ){ |
101858
|
0 |
0 |
if( (pItem->fg.jointype & JT_LEFT)==0 ){ |
101874
|
0 |
0 |
if( pEList->a[j].fg.bUsingTerm ) break; |
101876
|
0 |
0 |
if( hit || zTab==0 ) continue; |
|
0 |
0 |
if( hit || zTab==0 ) continue; |
101879
|
139 |
6201 |
if( zTab ){ |
101881
|
8 |
131 |
if( zDb ){ |
101882
|
4 |
4 |
if( pTab->pSchema!=pSchema ) continue; |
101883
|
0 |
4 |
if( pSchema==0 && strcmp(zDb,"*")!=0 ) continue; |
|
0 |
0 |
if( pSchema==0 && strcmp(zDb,"*")!=0 ) continue; |
101885
|
108 |
27 |
zTabName = pItem->zAlias ? pItem->zAlias : pTab->zName; |
101887
|
48 |
87 |
if( sqlite3StrICmp(zTabName, zTab)!=0 ){ |
101891
|
0 |
87 |
if( IN_RENAME_OBJECT && pItem->zAlias ){ |
|
0 |
0 |
if( IN_RENAME_OBJECT && pItem->zAlias ){ |
101896
|
17602 |
941 |
for(j=0, pCol=pTab->aCol; jnCol; j++, pCol++){ |
101897
|
5347 |
12255 |
if( pCol->hName==hCol |
101898
|
5347 |
0 |
&& sqlite3StrICmp(pCol->zCnName, zCol)==0 |
101900
|
0 |
5347 |
if( cnt>0 ){ |
101901
|
0 |
0 |
if( pItem->fg.isUsing==0 |
101902
|
0 |
0 |
|| sqlite3IdListIndex(pItem->u3.pUsing, zCol)<0 |
101910
|
0 |
0 |
if( (pItem->fg.jointype & JT_RIGHT)==0 ){ |
101914
|
0 |
0 |
if( (pItem->fg.jointype & JT_LEFT)==0 ){ |
101927
|
5096 |
251 |
pExpr->iColumn = j==pTab->iPKey ? -1 : (i16)j; |
101928
|
0 |
5347 |
if( pItem->fg.isNestedFrom ){ |
101934
|
928 |
5360 |
if( 0==cnt && VisibleRowid(pTab) ){ |
|
921 |
7 |
if( 0==cnt && VisibleRowid(pTab) ){ |
101939
|
6268 |
19 |
if( pMatch ){ |
101943
|
7 |
6261 |
if( (pMatch->fg.jointype & (JT_LEFT|JT_LTORJ))!=0 ){ |
101956
|
954 |
5347 |
if( cnt==0 && zDb==0 ){ |
|
954 |
0 |
if( cnt==0 && zDb==0 ){ |
101959
|
0 |
954 |
if( pParse->pTriggerTab!=0 ){ |
101962
|
0 |
0 |
if( pParse->bReturning ){ |
101963
|
0 |
0 |
if( (pNC->ncFlags & NC_UBaseReg)!=0 |
101964
|
0 |
0 |
&& (zTab==0 || sqlite3StrICmp(zTab,pParse->pTriggerTab->zName)==0) |
|
0 |
0 |
&& (zTab==0 || sqlite3StrICmp(zTab,pParse->pTriggerTab->zName)==0) |
101969
|
0 |
0 |
}else if( op!=TK_DELETE && zTab && sqlite3StrICmp("new",zTab) == 0 ){ |
|
0 |
0 |
}else if( op!=TK_DELETE && zTab && sqlite3StrICmp("new",zTab) == 0 ){ |
|
0 |
0 |
}else if( op!=TK_DELETE && zTab && sqlite3StrICmp("new",zTab) == 0 ){ |
101972
|
0 |
0 |
}else if( op!=TK_INSERT && zTab && sqlite3StrICmp("old",zTab)==0 ){ |
|
0 |
0 |
}else if( op!=TK_INSERT && zTab && sqlite3StrICmp("old",zTab)==0 ){ |
|
0 |
0 |
}else if( op!=TK_INSERT && zTab && sqlite3StrICmp("old",zTab)==0 ){ |
101979
|
295 |
659 |
if( (pNC->ncFlags & NC_UUpsert)!=0 && zTab!=0 ){ |
|
0 |
295 |
if( (pNC->ncFlags & NC_UUpsert)!=0 && zTab!=0 ){ |
101981
|
0 |
0 |
if( pUpsert && sqlite3StrICmp("excluded",zTab)==0 ){ |
|
0 |
0 |
if( pUpsert && sqlite3StrICmp("excluded",zTab)==0 ){ |
101988
|
0 |
954 |
if( pTab ){ |
101993
|
0 |
0 |
for(iCol=0, pCol=pTab->aCol; iColnCol; iCol++, pCol++){ |
101994
|
0 |
0 |
if( pCol->hName==hCol |
101995
|
0 |
0 |
&& sqlite3StrICmp(pCol->zCnName, zCol)==0 |
101997
|
0 |
0 |
if( iCol==pTab->iPKey ){ |
102003
|
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) ){ |
102007
|
0 |
0 |
if( iColnCol ){ |
102011
|
0 |
0 |
if( pExpr->iTable==EXCLUDED_TABLE_NUMBER ){ |
102014
|
0 |
0 |
if( IN_RENAME_OBJECT ){ |
102028
|
0 |
0 |
if( pParse->bReturning ){ |
102037
|
0 |
0 |
if( iCol<0 ){ |
102039
|
0 |
0 |
}else if( pExpr->iTable==0 ){ |
102042
|
0 |
0 |
pParse->oldmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<
|
102046
|
0 |
0 |
pParse->newmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<
|
102059
|
954 |
5347 |
if( cnt==0 |
102060
|
921 |
33 |
&& cntTab==1 |
102061
|
921 |
0 |
&& pMatch |
102062
|
921 |
0 |
&& (pNC->ncFlags & (NC_IdxExpr|NC_GenCol))==0 |
102063
|
914 |
7 |
&& sqlite3IsRowid(zCol) |
102064
|
914 |
0 |
&& ALWAYS(VisibleRowid(pMatch->pTab)) |
102089
|
40 |
6261 |
if( cnt==0 |
102090
|
20 |
20 |
&& (pNC->ncFlags & NC_UEList)!=0 |
102091
|
8 |
12 |
&& zTab==0 |
102095
|
16 |
1 |
for(j=0; jnExpr; j++){ |
102097
|
9 |
7 |
if( pEList->a[j].fg.eEName==ENAME_NAME |
102098
|
7 |
2 |
&& sqlite3_stricmp(zAs, zCol)==0 |
102105
|
7 |
0 |
if( (pNC->ncFlags&NC_AllowAgg)==0 && ExprHasProperty(pOrig, EP_Agg) ){ |
|
0 |
7 |
if( (pNC->ncFlags&NC_AllowAgg)==0 && ExprHasProperty(pOrig, EP_Agg) ){ |
102109
|
0 |
7 |
if( ExprHasProperty(pOrig, EP_Win) |
102110
|
0 |
0 |
&& ((pNC->ncFlags&NC_AllowWin)==0 || pNC!=pTopNC ) |
|
0 |
0 |
&& ((pNC->ncFlags&NC_AllowWin)==0 || pNC!=pTopNC ) |
102115
|
0 |
7 |
if( sqlite3ExprVectorSize(pOrig)!=1 ){ |
102123
|
0 |
7 |
if( IN_RENAME_OBJECT ){ |
102134
|
6261 |
33 |
if( cnt ) break; |
102137
|
12 |
21 |
}while( pNC ); |
102150
|
21 |
6261 |
if( cnt==0 && zTab==0 ){ |
|
21 |
0 |
if( cnt==0 && zTab==0 ){ |
102152
|
21 |
0 |
if( ExprHasProperty(pExpr,EP_DblQuoted) |
102153
|
17 |
4 |
&& areDoubleQuotedStringsEnabled(db, pTopNC) |
102178
|
0 |
4 |
if( sqlite3ExprIdToTrueFalse(pExpr) ){ |
102192
|
4 |
6261 |
if( cnt!=1 ){ |
102194
|
0 |
4 |
if( pFJMatch ){ |
102195
|
0 |
0 |
if( pFJMatch->nExpr==cnt-1 ){ |
102196
|
0 |
0 |
if( ExprHasProperty(pExpr,EP_Leaf) ){ |
102215
|
4 |
0 |
zErr = cnt==0 ? "no such column" : "ambiguous column name"; |
102216
|
0 |
4 |
if( zDb ){ |
102218
|
0 |
4 |
}else if( zTab ){ |
102230
|
2881 |
3384 |
if( !ExprHasProperty(pExpr,(EP_TokenOnly|EP_Leaf)) ){ |
102252
|
5100 |
1165 |
if( pExpr->iColumn>=0 && pMatch!=0 ){ |
|
5098 |
2 |
if( pExpr->iColumn>=0 && pMatch!=0 ){ |
102258
|
6268 |
4 |
if( cnt==1 ){ |
102261
|
0 |
6268 |
if( pParse->db->xAuth |
102262
|
0 |
0 |
&& (pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER) |
|
0 |
0 |
&& (pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER) |
102272
|
6268 |
12 |
if( pTopNC==pNC ) break; |
102287
|
0 |
0 |
if( p ){ |
102293
|
0 |
0 |
if( p->y.pTab->iPKey==iCol ){ |
102297
|
0 |
0 |
if( (pTab->tabFlags & TF_HasGenerated)!=0 |
102298
|
0 |
0 |
&& (pTab->aCol[iCol].colFlags & COLFLAG_GENERATED)!=0 |
102302
|
0 |
0 |
pItem->colUsed = pTab->nCol>=64 ? ALLBITS : MASKBIT(pTab->nCol)-1; |
102337
|
0 |
0 |
if( pNC->ncFlags & NC_IdxExpr ) zIn = "index expressions"; |
102339
|
0 |
0 |
else if( pNC->ncFlags & NC_IsCheck ) zIn = "CHECK constraints"; |
102342
|
0 |
0 |
else if( pNC->ncFlags & NC_GenCol ) zIn = "generated columns"; |
102345
|
0 |
0 |
if( pExpr ) pExpr->op = TK_NULL; |
102359
|
0 |
0 |
if( p->op!=TK_FLOAT ) return -1; |
102363
|
0 |
0 |
if( r>1.0 ) return -1; |
102436
|
40 |
28 |
for(i=0, p=pNC; p && ipNext, i++){ |
|
40 |
0 |
for(i=0, p=pNC; p && ipNext, i++){ |
102440
|
0 |
28 |
if( 0==sqlite3ExprCanBeNull(pExpr->pLeft) && !IN_RENAME_OBJECT ){ |
|
0 |
0 |
if( 0==sqlite3ExprCanBeNull(pExpr->pLeft) && !IN_RENAME_OBJECT ){ |
102443
|
0 |
0 |
if( pExpr->op==TK_NOTNULL ){ |
102451
|
0 |
0 |
for(i=0, p=pNC; p && ipNext, i++){ |
|
0 |
0 |
for(i=0, p=pNC; p && ipNext, i++){ |
102475
|
6202 |
87 |
if( pExpr->op==TK_ID ){ |
102484
|
0 |
87 |
sqlite3ResolveNotValid(pParse, pNC, "the \".\" operator", |
102487
|
83 |
4 |
if( pRight->op==TK_ID ){ |
102500
|
0 |
87 |
if( IN_RENAME_OBJECT ){ |
102512
|
739 |
103 |
int n = pList ? pList->nExpr : 0; /* Number of arguments */ |
102521
|
0 |
842 |
Window *pWin = (IsWindowFunc(pExpr) ? pExpr->y.pWin : 0); |
|
0 |
0 |
Window *pWin = (IsWindowFunc(pExpr) ? pExpr->y.pWin : 0); |
102526
|
6 |
836 |
if( pDef==0 ){ |
102528
|
6 |
0 |
if( pDef==0 ){ |
102535
|
0 |
836 |
if( pDef->funcFlags & SQLITE_FUNC_UNLIKELY ){ |
102537
|
0 |
0 |
if( n==2 ){ |
102539
|
0 |
0 |
if( pExpr->iTable<0 ){ |
102555
|
0 |
0 |
pExpr->iTable = pDef->zName[0]=='u' ? 8388608 : 125829120; |
102561
|
0 |
836 |
if( auth!=SQLITE_OK ){ |
102562
|
0 |
0 |
if( auth==SQLITE_DENY ){ |
102572
|
187 |
649 |
if( pDef->funcFlags & (SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG) ){ |
102579
|
649 |
187 |
if( (pDef->funcFlags & SQLITE_FUNC_CONSTANT)==0 ){ |
102586
|
0 |
649 |
sqlite3ResolveNotValid(pParse, pNC, "non-deterministic functions", |
102591
|
0 |
187 |
if( pNC->ncFlags & NC_FromDDL ) ExprSetProperty(pExpr, EP_FromDDL); |
102593
|
0 |
836 |
if( (pDef->funcFlags & SQLITE_FUNC_INTERNAL)!=0 |
102594
|
0 |
0 |
&& pParse->nested==0 |
102595
|
0 |
0 |
&& (pParse->db->mDbFlags & DBFLAG_InternalFunc)==0 |
102604
|
664 |
172 |
if( (pDef->funcFlags & (SQLITE_FUNC_DIRECT|SQLITE_FUNC_UNSAFE))!=0 |
102605
|
664 |
0 |
&& !IN_RENAME_OBJECT |
102611
|
842 |
0 |
if( 0==IN_RENAME_OBJECT ){ |
102617
|
836 |
6 |
if( pDef && pDef->xValue==0 && pWin ){ |
|
779 |
57 |
if( pDef && pDef->xValue==0 && pWin ){ |
|
0 |
779 |
if( pDef && pDef->xValue==0 && pWin ){ |
102622
|
147 |
695 |
}else if( |
102623
|
147 |
0 |
(is_agg && (pNC->ncFlags & NC_AllowAgg)==0) |
102624
|
147 |
695 |
|| (is_agg && (pDef->funcFlags&SQLITE_FUNC_WINDOW) && !pWin) |
|
0 |
147 |
|| (is_agg && (pDef->funcFlags&SQLITE_FUNC_WINDOW) && !pWin) |
|
0 |
0 |
|| (is_agg && (pDef->funcFlags&SQLITE_FUNC_WINDOW) && !pWin) |
102625
|
147 |
695 |
|| (is_agg && pWin && (pNC->ncFlags & NC_AllowWin)==0) |
|
0 |
147 |
|| (is_agg && pWin && (pNC->ncFlags & NC_AllowWin)==0) |
|
0 |
0 |
|| (is_agg && pWin && (pNC->ncFlags & NC_AllowWin)==0) |
102628
|
0 |
0 |
if( (pDef->funcFlags & SQLITE_FUNC_WINDOW) || pWin ){ |
|
0 |
0 |
if( (pDef->funcFlags & SQLITE_FUNC_WINDOW) || pWin ){ |
102644
|
6 |
836 |
else if( no_such_func && pParse->db->init.busy==0 |
|
6 |
0 |
else if( no_such_func && pParse->db->init.busy==0 |
102651
|
0 |
836 |
}else if( wrong_num_args ){ |
102657
|
689 |
147 |
else if( is_agg==0 && ExprHasProperty(pExpr, EP_WinFunc) ){ |
|
0 |
689 |
else if( is_agg==0 && ExprHasProperty(pExpr, EP_WinFunc) ){ |
102665
|
147 |
695 |
if( is_agg ){ |
102670
|
147 |
0 |
pNC->ncFlags &= ~(NC_AllowWin | (!pWin ? NC_AllowAgg : 0)); |
102677
|
0 |
0 |
else if( ExprHasProperty(pExpr, EP_WinFunc) ){ |
102682
|
147 |
695 |
if( is_agg ){ |
102684
|
0 |
147 |
if( pWin ){ |
102687
|
0 |
0 |
if( IN_RENAME_OBJECT==0 ){ |
102688
|
0 |
0 |
sqlite3WindowUpdate(pParse, pSel ? pSel->pWinDefn : 0, pWin, pDef); |
102689
|
0 |
0 |
if( pParse->db->mallocFailed ) break; |
102703
|
0 |
147 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){ |
102708
|
147 |
0 |
while( pNC2 |
102709
|
0 |
147 |
&& sqlite3ReferencesSrcList(pParse, pExpr, pNC2->pSrcList)==0 |
102715
|
147 |
0 |
if( pNC2 && pDef ){ |
|
147 |
0 |
if( pNC2 && pDef ){ |
102738
|
21 |
16 |
if( ExprUseXSelect(pExpr) ){ |
102744
|
0 |
21 |
if( pNC->ncFlags & NC_SelfRef ){ |
102750
|
2 |
19 |
if( nRef!=pNC->nRef ){ |
102762
|
0 |
1388 |
sqlite3ResolveNotValid(pParse, pNC, "parameters", |
102772
|
5 |
0 |
if( ALWAYS(pRight) && (pRight->op==TK_ID || pRight->op==TK_TRUEFALSE) ){ |
|
5 |
0 |
if( ALWAYS(pRight) && (pRight->op==TK_ID || pRight->op==TK_TRUEFALSE) ){ |
|
0 |
5 |
if( ALWAYS(pRight) && (pRight->op==TK_ID || pRight->op==TK_TRUEFALSE) ){ |
102774
|
0 |
0 |
if( rc==WRC_Abort ) return WRC_Abort; |
102775
|
0 |
0 |
if( pRight->op==TK_TRUEFALSE ){ |
102791
|
0 |
1416 |
if( pParse->db->mallocFailed ) break; |
102794
|
18 |
1398 |
if( pExpr->op==TK_BETWEEN ){ |
102797
|
18 |
0 |
if( nRight==nLeft ){ |
102804
|
0 |
1416 |
if( nLeft!=nRight ){ |
102821
|
6 |
9160 |
return pParse->nErr ? WRC_Abort : WRC_Continue; |
102845
|
657 |
1 |
if( pE->op==TK_ID ){ |
102849
|
2820 |
582 |
for(i=0; inExpr; i++){ |
102850
|
2608 |
212 |
if( pEList->a[i].fg.eEName==ENAME_NAME |
102851
|
75 |
2533 |
&& sqlite3_stricmp(pEList->a[i].zEName, zCol)==0 |
102906
|
0 |
0 |
if( rc ) return 0; |
102912
|
0 |
0 |
for(i=0; inExpr; i++){ |
102913
|
0 |
0 |
if( sqlite3ExprCompare(0, pEList->a[i].pExpr, pE, -1)<2 ){ |
102964
|
26 |
0 |
if( pOrderBy==0 ) return 0; |
102966
|
0 |
0 |
if( pOrderBy->nExpr>db->aLimit[SQLITE_LIMIT_COLUMN] ){ |
102970
|
0 |
0 |
for(i=0; inExpr; i++){ |
102974
|
0 |
0 |
while( pSelect->pPrior ){ |
102978
|
0 |
0 |
while( pSelect && moreToDo ){ |
|
0 |
0 |
while( pSelect && moreToDo ){ |
102983
|
0 |
0 |
for(i=0, pItem=pOrderBy->a; inExpr; i++, pItem++){ |
102986
|
0 |
0 |
if( pItem->fg.done ) continue; |
102988
|
0 |
0 |
if( NEVER(pE==0) ) continue; |
102989
|
0 |
0 |
if( sqlite3ExprIsInteger(pE, &iCol) ){ |
102990
|
0 |
0 |
if( iCol<=0 || iCol>pEList->nExpr ){ |
|
0 |
0 |
if( iCol<=0 || iCol>pEList->nExpr ){ |
102996
|
0 |
0 |
if( iCol==0 ){ |
103009
|
0 |
0 |
if( !db->mallocFailed ){ |
103012
|
0 |
0 |
if( IN_RENAME_OBJECT && iCol>0 ){ |
|
0 |
0 |
if( IN_RENAME_OBJECT && iCol>0 ){ |
103019
|
0 |
0 |
if( iCol>0 ){ |
103022
|
0 |
0 |
if( !IN_RENAME_OBJECT ){ |
103024
|
0 |
0 |
if( pNew==0 ) return 1; |
103027
|
0 |
0 |
if( pItem->pExpr==pE ){ |
103032
|
0 |
0 |
while( pParent->pLeft->op==TK_COLLATE ) pParent = pParent->pLeft; |
103046
|
0 |
0 |
for(i=0; inExpr; i++){ |
103047
|
0 |
0 |
if( pOrderBy->a[i].fg.done==0 ){ |
103077
|
628 |
0 |
if( pOrderBy==0 || pParse->db->mallocFailed || IN_RENAME_OBJECT ) return 0; |
|
628 |
0 |
if( pOrderBy==0 || pParse->db->mallocFailed || IN_RENAME_OBJECT ) return 0; |
|
0 |
628 |
if( pOrderBy==0 || pParse->db->mallocFailed || IN_RENAME_OBJECT ) return 0; |
103078
|
0 |
628 |
if( pOrderBy->nExpr>db->aLimit[SQLITE_LIMIT_COLUMN] ){ |
103084
|
678 |
628 |
for(i=0, pItem=pOrderBy->a; inExpr; i++, pItem++){ |
103085
|
157 |
521 |
if( pItem->u.x.iOrderByCol ){ |
103086
|
0 |
157 |
if( pItem->u.x.iOrderByCol>pEList->nExpr ){ |
103102
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){ |
103114
|
0 |
82 |
if( pSelect->pWin ){ |
103159
|
678 |
628 |
for(i=0, pItem=pOrderBy->a; inExpr; i++, pItem++){ |
103162
|
0 |
678 |
if( NEVER(pE2==0) ) continue; |
103163
|
658 |
20 |
if( zType[0]!='G' ){ |
103165
|
75 |
583 |
if( iCol>0 ){ |
103174
|
0 |
603 |
if( sqlite3ExprIsInteger(pE2, &iCol) ){ |
103178
|
0 |
0 |
if( iCol<1 || iCol>0xffff ){ |
|
0 |
0 |
if( iCol<1 || iCol>0xffff ){ |
103188
|
0 |
603 |
if( sqlite3ResolveExprNames(pNC, pE) ){ |
103191
|
2682 |
603 |
for(j=0; jpEList->nExpr; j++){ |
103192
|
82 |
2600 |
if( sqlite3ExprCompare(0, pE, pSelect->pEList->a[j].pExpr, -1)==0 ){ |
103220
|
21 |
1873 |
if( p->selFlags & SF_Resolved ){ |
103235
|
0 |
1873 |
if( (p->selFlags & SF_Expanded)==0 ){ |
103237
|
0 |
0 |
return pParse->nErr ? WRC_Abort : WRC_Prune; |
103243
|
1958 |
1867 |
while( p ){ |
103256
|
0 |
1958 |
if( sqlite3ResolveExprNames(&sNC, p->pLimit) ){ |
103266
|
0 |
1958 |
if( p->selFlags & SF_Converted ){ |
103276
|
1439 |
1958 |
for(i=0; ipSrc->nSrc; i++){ |
103278
|
35 |
1404 |
if( pItem->pSelect && (pItem->pSelect->selFlags & SF_Resolved)==0 ){ |
|
35 |
0 |
if( pItem->pSelect && (pItem->pSelect->selFlags & SF_Resolved)==0 ){ |
103279
|
0 |
35 |
int nRef = pOuterNC ? pOuterNC->nRef : 0; |
103282
|
0 |
35 |
if( pItem->zName ) pParse->zAuthContext = pItem->zName; |
103285
|
0 |
35 |
if( pParse->nErr ) return WRC_Abort; |
103294
|
0 |
35 |
if( pOuterNC ){ |
103309
|
6 |
1952 |
if( sqlite3ResolveExprListNames(&sNC, p->pEList) ) return WRC_Abort; |
103317
|
1932 |
20 |
if( pGroupBy || (sNC.ncFlags & NC_HasAgg)!=0 ){ |
|
127 |
1805 |
if( pGroupBy || (sNC.ncFlags & NC_HasAgg)!=0 ){ |
103336
|
6 |
1946 |
if( p->pHaving ){ |
103337
|
0 |
6 |
if( (p->selFlags & SF_Aggregate)==0 ){ |
103341
|
0 |
6 |
if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort; |
103343
|
0 |
1952 |
if( sqlite3ResolveExprNames(&sNC, p->pWhere) ) return WRC_Abort; |
103346
|
1439 |
1952 |
for(i=0; ipSrc->nSrc; i++){ |
103348
|
0 |
1439 |
if( pItem->fg.isTabFunc |
103349
|
0 |
0 |
&& sqlite3ResolveExprListNames(&sNC, pItem->u1.pFuncArg) |
103356
|
0 |
1952 |
if( IN_RENAME_OBJECT ){ |
103358
|
0 |
0 |
for(pWin=p->pWinDefn; pWin; pWin=pWin->pNextWin){ |
103359
|
0 |
0 |
if( sqlite3ResolveExprListNames(&sNC, pWin->pOrderBy) |
103360
|
0 |
0 |
|| sqlite3ResolveExprListNames(&sNC, pWin->pPartition) |
103379
|
0 |
1952 |
if( p->selFlags & SF_Converted ){ |
103395
|
608 |
1344 |
if( p->pOrderBy!=0 |
103396
|
608 |
0 |
&& isCompound<=nCompound /* Defer right-most ORDER BY of a compound */ |
103397
|
0 |
608 |
&& resolveOrderGroupBy(&sNC, p, p->pOrderBy, "ORDER") |
103401
|
0 |
1952 |
if( db->mallocFailed ){ |
103409
|
20 |
1932 |
if( pGroupBy ){ |
103412
|
20 |
0 |
if( resolveOrderGroupBy(&sNC, p, pGroupBy, "GROUP") || db->mallocFailed ){ |
|
0 |
20 |
if( resolveOrderGroupBy(&sNC, p, pGroupBy, "GROUP") || db->mallocFailed ){ |
103415
|
20 |
20 |
for(i=0, pItem=pGroupBy->a; inExpr; i++, pItem++){ |
103416
|
0 |
20 |
if( ExprHasProperty(pItem->pExpr, EP_Agg) ){ |
103426
|
85 |
1867 |
if( p->pNext && p->pEList->nExpr!=p->pNext->pEList->nExpr ){ |
|
0 |
85 |
if( p->pNext && p->pEList->nExpr!=p->pNext->pEList->nExpr ){ |
103440
|
26 |
1841 |
if( isCompound && resolveCompoundOrderBy(pParse, pLeftmost) ){ |
|
0 |
26 |
if( isCompound && resolveCompoundOrderBy(pParse, pLeftmost) ){ |
103502
|
3032 |
3487 |
if( pExpr==0 ) return SQLITE_OK; |
103507
|
3487 |
0 |
w.xSelectCallback = (pNC->ncFlags & NC_NoSelect) ? 0 : resolveSelectStep; |
103512
|
0 |
3487 |
if( sqlite3ExprCheckHeight(w.pParse, w.pParse->nHeight) ){ |
103526
|
3487 |
0 |
return pNC->nNcErr>0 || w.pParse->nErr>0; |
|
0 |
3487 |
return pNC->nNcErr>0 || w.pParse->nErr>0; |
103541
|
0 |
4657 |
if( pList==0 ) return WRC_Continue; |
103549
|
7896 |
4647 |
for(i=0; inExpr; i++){ |
103551
|
0 |
7896 |
if( pExpr==0 ) continue; |
103554
|
0 |
7896 |
if( sqlite3ExprCheckHeight(w.pParse, w.pParse->nHeight) ){ |
103566
|
141 |
7755 |
if( pNC->ncFlags & (NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg) ){ |
103572
|
10 |
7886 |
if( w.pParse->nErr>0 ) return WRC_Abort; |
103640
|
138 |
0 |
if( pTab ){ |
103645
|
136 |
2 |
if( pTab->pSchema!=pParse->db->aDb[1].pSchema ){ |
103654
|
0 |
138 |
if( (rc = sqlite3ResolveExprNames(&sNC, pExpr))!=SQLITE_OK ) return rc; |
103655
|
6 |
132 |
if( pList ) rc = sqlite3ResolveExprListNames(&sNC, pList); |
103685
|
1887 |
10 |
if( iCol<0 || NEVER(iCol>=pTab->nCol) ) return SQLITE_AFF_INTEGER; |
|
0 |
1887 |
if( iCol<0 || NEVER(iCol>=pTab->nCol) ) return SQLITE_AFF_INTEGER; |
103707
|
5 |
3706 |
while( ExprHasProperty(pExpr, EP_Skip|EP_IfNullRow) ){ |
103715
|
10 |
3696 |
if( op==TK_REGISTER ) op = pExpr->op2; |
103716
|
1809 |
1897 |
if( op==TK_COLUMN || op==TK_AGG_COLUMN ){ |
|
0 |
1809 |
if( op==TK_COLUMN || op==TK_AGG_COLUMN ){ |
103718
|
1897 |
0 |
if( pExpr->y.pTab ){ |
103722
|
2 |
1807 |
if( op==TK_SELECT ){ |
103730
|
2 |
1805 |
if( op==TK_CAST ){ |
103735
|
0 |
1805 |
if( op==TK_SELECT_COLUMN ){ |
103743
|
0 |
1805 |
if( op==TK_VECTOR ){ |
103764
|
356 |
0 |
if( pCollName->n>0 ){ |
103766
|
356 |
0 |
if( pNew ){ |
103789
|
3569 |
41 |
while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){ |
|
341 |
3228 |
while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){ |
103802
|
10510 |
932 |
while( pExpr && ExprHasProperty(pExpr, EP_Skip|EP_Unlikely) ){ |
|
133 |
10377 |
while( pExpr && ExprHasProperty(pExpr, EP_Skip|EP_Unlikely) ){ |
103803
|
0 |
133 |
if( ExprHasProperty(pExpr, EP_Unlikely) ){ |
103834
|
2328 |
0 |
while( p ){ |
103836
|
0 |
2328 |
if( op==TK_REGISTER ) op = p->op2; |
103837
|
2312 |
16 |
if( op==TK_AGG_COLUMN || op==TK_COLUMN || op==TK_TRIGGER ){ |
|
205 |
2107 |
if( op==TK_AGG_COLUMN || op==TK_COLUMN || op==TK_TRIGGER ){ |
|
0 |
205 |
if( op==TK_AGG_COLUMN || op==TK_COLUMN || op==TK_TRIGGER ){ |
103839
|
2123 |
0 |
if( p->y.pTab!=0 ){ |
103843
|
1585 |
538 |
if( j>=0 ){ |
103850
|
203 |
2 |
if( op==TK_CAST || op==TK_UPLUS ){ |
|
0 |
203 |
if( op==TK_CAST || op==TK_UPLUS ){ |
103854
|
0 |
203 |
if( op==TK_VECTOR ){ |
103859
|
21 |
182 |
if( op==TK_COLLATE ){ |
103864
|
0 |
182 |
if( p->flags & EP_Collate ){ |
103865
|
0 |
0 |
if( p->pLeft && (p->pLeft->flags & EP_Collate)!=0 ){ |
|
0 |
0 |
if( p->pLeft && (p->pLeft->flags & EP_Collate)!=0 ){ |
103872
|
0 |
0 |
if( p->x.pList!=0 && !db->mallocFailed ){ |
|
0 |
0 |
if( p->x.pList!=0 && !db->mallocFailed ){ |
103874
|
0 |
0 |
for(i=0; ALWAYS(ix.pList->nExpr); i++){ |
103875
|
0 |
0 |
if( ExprHasProperty(p->x.pList->a[i].pExpr, EP_Collate) ){ |
103887
|
0 |
2326 |
if( sqlite3CheckCollSeq(pParse, pColl) ){ |
103905
|
503 |
290 |
if( p==0 ) p = pParse->db->pDfltColl; |
103926
|
765 |
683 |
if( aff1>SQLITE_AFF_NONE && aff2>SQLITE_AFF_NONE ){ |
|
34 |
731 |
if( aff1>SQLITE_AFF_NONE && aff2>SQLITE_AFF_NONE ){ |
103930
|
15 |
19 |
if( sqlite3IsNumericAffinity(aff1) || sqlite3IsNumericAffinity(aff2) ){ |
|
0 |
15 |
if( sqlite3IsNumericAffinity(aff1) || sqlite3IsNumericAffinity(aff2) ){ |
103938
|
683 |
731 |
return (aff1<=SQLITE_AFF_NONE ? aff2 : aff1) | SQLITE_AFF_NONE; |
103953
|
617 |
0 |
if( pExpr->pRight ){ |
103955
|
0 |
0 |
}else if( ExprUseXSelect(pExpr) ){ |
103957
|
0 |
0 |
}else if( aff==0 ){ |
103971
|
37 |
580 |
if( aff
|
103974
|
399 |
181 |
if( aff==SQLITE_AFF_TEXT ){ |
104013
|
0 |
1235 |
if( pLeft->flags & EP_Collate ){ |
104015
|
1235 |
0 |
}else if( pRight && (pRight->flags & EP_Collate)!=0 ){ |
|
0 |
1235 |
}else if( pRight && (pRight->flags & EP_Collate)!=0 ){ |
104019
|
32 |
1203 |
if( !pColl ){ |
104035
|
0 |
433 |
if( ExprHasProperty(p, EP_Commuted) ){ |
104059
|
0 |
761 |
if( pParse->nErr ) return 0; |
104060
|
0 |
761 |
if( isCommuted ){ |
104093
|
300 |
5133 |
if( op==TK_REGISTER ) op = pExpr->op2; |
104094
|
0 |
5433 |
if( op==TK_VECTOR ){ |
104097
|
2 |
5431 |
}else if( op==TK_SELECT ){ |
104122
|
0 |
60 |
if( sqlite3ExprIsVector(pVector) ){ |
104124
|
0 |
0 |
if( pVector->op==TK_SELECT || pVector->op2==TK_SELECT ){ |
|
0 |
0 |
if( pVector->op==TK_SELECT || pVector->op2==TK_SELECT ){ |
104163
|
0 |
0 |
if( pVector->op==TK_SELECT ){ |
104182
|
0 |
0 |
if( pRet ){ |
104188
|
0 |
0 |
if( pVector->op==TK_VECTOR ){ |
104193
|
0 |
0 |
if( IN_RENAME_OBJECT ){ |
104215
|
0 |
0 |
if( pExpr->op==TK_SELECT ){ |
104250
|
0 |
0 |
if( op==TK_REGISTER ){ |
104254
|
0 |
0 |
if( op==TK_SELECT ){ |
104259
|
0 |
0 |
if( op==TK_VECTOR ){ |
104298
|
0 |
0 |
if( pParse->nErr ) return; |
104299
|
0 |
0 |
if( nLeft!=sqlite3ExprVectorSize(pRight) ){ |
104313
|
0 |
0 |
if( op==TK_LE ) opx = TK_LT; |
104314
|
0 |
0 |
if( op==TK_GE ) opx = TK_GT; |
104315
|
0 |
0 |
if( op==TK_NE ) opx = TK_EQ; |
104326
|
0 |
0 |
if( addrCmp ) sqlite3VdbeJumpHere(v, addrCmp); |
104339
|
0 |
0 |
if( (opx==TK_LT || opx==TK_GT) && i
|
|
0 |
0 |
if( (opx==TK_LT || opx==TK_GT) && i
|
|
0 |
0 |
if( (opx==TK_LT || opx==TK_GT) && i
|
104344
|
0 |
0 |
if( p5==SQLITE_NULLEQ ){ |
104349
|
0 |
0 |
if( i==nLeft-1 ){ |
104352
|
0 |
0 |
if( opx==TK_EQ ){ |
104357
|
0 |
0 |
if( i==nLeft-2 ) opx = op; |
104362
|
0 |
0 |
if( op==TK_NE ){ |
104376
|
0 |
15252 |
if( nHeight>mxHeight ){ |
104395
|
1652 |
146 |
if( p ){ |
104396
|
806 |
846 |
if( p->nHeight>*pnHeight ){ |
104402
|
862 |
88 |
if( p ){ |
104404
|
1603 |
862 |
for(i=0; inExpr; i++){ |
104411
|
65 |
65 |
for(p=pSelect; p; p=p->pPrior){ |
104432
|
2291 |
1581 |
int nHeight = p->pLeft ? p->pLeft->nHeight : 0; |
104433
|
2285 |
1587 |
if( p->pRight && p->pRight->nHeight>nHeight ) nHeight = p->pRight->nHeight; |
|
114 |
2171 |
if( p->pRight && p->pRight->nHeight>nHeight ) nHeight = p->pRight->nHeight; |
104434
|
21 |
3851 |
if( ExprUseXSelect(p) ){ |
104436
|
755 |
3096 |
}else if( p->x.pList ){ |
104452
|
0 |
879 |
if( pParse->nErr ) return; |
104511
|
5281 |
14 |
if( pToken ){ |
104512
|
579 |
4702 |
if( op!=TK_INTEGER || pToken->z==0 |
|
579 |
0 |
if( op!=TK_INTEGER || pToken->z==0 |
104513
|
12 |
567 |
|| sqlite3GetInt32(pToken->z, &iValue)==0 ){ |
104519
|
5295 |
0 |
if( pNew ){ |
104523
|
5281 |
14 |
if( pToken ){ |
104524
|
567 |
4714 |
if( nExtra==0 ){ |
104525
|
529 |
38 |
pNew->flags |= EP_IntValue|EP_Leaf|(iValue?EP_IsTrue:EP_IsFalse); |
104530
|
4124 |
590 |
if( pToken->n ) memcpy(pNew->u.zToken, pToken->z, pToken->n); |
104532
|
897 |
3817 |
if( dequote && sqlite3Isquote(pNew->u.zToken[0]) ){ |
|
0 |
897 |
if( dequote && sqlite3Isquote(pNew->u.zToken[0]) ){ |
104571
|
0 |
2993 |
if( pRoot==0 ){ |
104576
|
2285 |
708 |
if( pRight ){ |
104580
|
2272 |
721 |
if( pLeft ){ |
104603
|
2990 |
0 |
if( p ){ |
104621
|
21 |
0 |
if( pExpr ){ |
104654
|
0 |
0 |
for(ii=0; iinExpr; ii++){ |
104658
|
0 |
0 |
if( pExpr->op==TK_VECTOR ){ |
104664
|
0 |
0 |
if( nExprElem!=nElem ){ |
104665
|
0 |
0 |
sqlite3ErrorMsg(pParse, "IN(...) element has %d term%s - expected %d", |
104673
|
0 |
0 |
if( pSel ){ |
104674
|
0 |
0 |
if( pRet ){ |
104682
|
0 |
0 |
if( pRet && pRet->pPrior ){ |
|
0 |
0 |
if( pRet && pRet->pPrior ){ |
104699
|
75 |
361 |
if( pLeft==0 ){ |
104701
|
0 |
361 |
}else if( pRight==0 ){ |
104703
|
361 |
0 |
}else if( (ExprAlwaysFalse(pLeft) || ExprAlwaysFalse(pRight)) |
|
0 |
361 |
}else if( (ExprAlwaysFalse(pLeft) || ExprAlwaysFalse(pRight)) |
104704
|
0 |
0 |
&& !IN_RENAME_OBJECT |
104728
|
0 |
842 |
if( pNew==0 ){ |
104734
|
739 |
103 |
if( pList |
104735
|
0 |
739 |
&& pList->nExpr > pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] |
104736
|
0 |
0 |
&& !pParse->nested |
104744
|
0 |
842 |
if( eDistinct==SF_Distinct ) ExprSetProperty(pNew, EP_Distinct); |
104766
|
0 |
1155 |
if( ExprHasProperty(pExpr, EP_FromDDL) ){ |
104767
|
0 |
0 |
if( (pDef->funcFlags & SQLITE_FUNC_DIRECT)!=0 |
104768
|
0 |
0 |
|| (pParse->db->flags & SQLITE_TrustedSchema)==0 |
104803
|
0 |
1398 |
if( pExpr==0 ) return; |
104809
|
1367 |
31 |
if( z[1]==0 ){ |
104815
|
13 |
18 |
if( z[0]=='?' ){ |
104820
|
13 |
0 |
if( n==2 ){ /*OPTIMIZATION-IF-TRUE*/ |
104830
|
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] ){ |
104837
|
13 |
0 |
if( x>pParse->nVar ){ |
104840
|
0 |
0 |
}else if( sqlite3VListNumToName(pParse->pVList, x)==0 ){ |
104849
|
17 |
1 |
if( x==0 ){ |
104854
|
30 |
1 |
if( doAdd ){ |
104859
|
2 |
1396 |
if( x>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){ |
104882
|
5415 |
16125 |
if( !ExprHasProperty(p, (EP_TokenOnly|EP_Leaf)) ){ |
104885
|
2777 |
2638 |
if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft); |
|
2777 |
0 |
if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft); |
104886
|
2209 |
3206 |
if( p->pRight ){ |
104889
|
21 |
3185 |
}else if( ExprUseXSelect(p) ){ |
104895
|
0 |
3185 |
if( ExprHasProperty(p, EP_WinFunc) ){ |
104901
|
0 |
21540 |
if( ExprHasProperty(p, EP_MemToken) ){ |
104905
|
21536 |
4 |
if( !ExprHasProperty(p, EP_Static) ){ |
104910
|
16554 |
18826 |
if( p ) sqlite3ExprDeleteNN(db, p); |
104917
|
0 |
0 |
if( p==0 ){ |
104919
|
0 |
0 |
}else if( p->pOn ){ |
104921
|
0 |
0 |
}else if( p->pUsing ){ |
104945
|
0 |
0 |
if( p ){ |
104946
|
0 |
0 |
if( IN_RENAME_OBJECT ){ |
104959
|
0 |
3396 |
if( ExprHasProperty(p, EP_TokenOnly) ) return EXPR_TOKENONLYSIZE; |
104960
|
0 |
3396 |
if( ExprHasProperty(p, EP_Reduced) ) return EXPR_REDUCEDSIZE; |
105003
|
24 |
6792 |
if( 0==flags || p->op==TK_SELECT_COLUMN |
|
24 |
0 |
if( 0==flags || p->op==TK_SELECT_COLUMN |
105005
|
0 |
24 |
|| ExprHasProperty(p, EP_WinFunc) |
105014
|
12 |
12 |
if( p->pLeft || p->x.pList ){ |
|
0 |
12 |
if( p->pLeft || p->x.pList ){ |
105031
|
3315 |
97 |
if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){ |
|
3193 |
122 |
if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){ |
105052
|
3404 |
12 |
if( p ){ |
105054
|
8 |
3396 |
if( flags&EXPRDUP_REDUCE ){ |
105080
|
4 |
3400 |
if( pzBuffer ){ |
105090
|
3404 |
0 |
if( pNew ){ |
105099
|
3309 |
95 |
if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){ |
|
3187 |
122 |
if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){ |
105104
|
8 |
3396 |
if( dupFlags ){ |
105110
|
0 |
3396 |
if( nSize
|
105125
|
3187 |
217 |
if( nToken ){ |
105130
|
578 |
2826 |
if( 0==((p->flags|pNew->flags) & (EP_TokenOnly|EP_Leaf)) ){ |
105132
|
0 |
578 |
if( ExprUseXSelect(p) ){ |
105140
|
8 |
3396 |
if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly|EP_WinFunc) ){ |
105142
|
4 |
4 |
if( !ExprHasProperty(pNew, EP_TokenOnly|EP_Leaf) ){ |
105144
|
4 |
0 |
exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc) : 0; |
105146
|
0 |
4 |
exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc) : 0; |
105149
|
0 |
8 |
if( ExprHasProperty(p, EP_WinFunc) ){ |
105154
|
4 |
4 |
if( pzBuffer ){ |
105158
|
574 |
2822 |
if( !ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){ |
105159
|
0 |
574 |
if( pNew->op==TK_SELECT_COLUMN ){ |
105181
|
0 |
3 |
if( p ){ |
105184
|
0 |
0 |
if( pRet ){ |
105187
|
0 |
0 |
for(i=0; inCte; i++){ |
105209
|
0 |
0 |
if( pExpr->op==TK_FUNCTION && ExprHasProperty(pExpr, EP_WinFunc) ){ |
|
0 |
0 |
if( pExpr->op==TK_FUNCTION && ExprHasProperty(pExpr, EP_WinFunc) ){ |
105253
|
3400 |
946 |
return p ? exprDup(db, p, flags, 0) : 0; |
105263
|
377 |
226 |
if( p==0 ) return 0; |
105265
|
0 |
226 |
if( pNew==0 ) return 0; |
105270
|
395 |
226 |
for(i=0; inExpr; i++, pItem++, pOldItem++){ |
105274
|
395 |
0 |
if( pOldExpr |
105275
|
0 |
395 |
&& pOldExpr->op==TK_SELECT_COLUMN |
105276
|
0 |
0 |
&& (pNewExpr = pItem->pExpr)!=0 |
105278
|
0 |
0 |
if( pNewExpr->pRight ){ |
105283
|
0 |
0 |
if( pOldExpr->pLeft!=pPriorSelectColOld ){ |
105312
|
0 |
3 |
if( p==0 ) return 0; |
105313
|
3 |
0 |
nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0); |
105315
|
0 |
3 |
if( pNew==0 ) return 0; |
105317
|
3 |
3 |
for(i=0; inSrc; i++){ |
105329
|
0 |
3 |
if( pNewItem->fg.isIndexedBy ){ |
105333
|
0 |
3 |
if( pNewItem->fg.isCte ){ |
105336
|
0 |
3 |
if( pNewItem->fg.isTabFunc ){ |
105341
|
3 |
0 |
if( pTab ){ |
105345
|
0 |
3 |
if( pOldItem->fg.isUsing ){ |
105359
|
0 |
0 |
if( p==0 ) return 0; |
105362
|
0 |
0 |
if( pNew==0 ) return 0; |
105365
|
0 |
0 |
for(i=0; inId; i++){ |
105380
|
3 |
6 |
for(p=pDup; p; p=p->pPrior){ |
105382
|
0 |
3 |
if( pNew==0 ) break; |
105403
|
0 |
3 |
if( p->pWin && db->mallocFailed==0 ) gatherSelectWindows(pNew); |
|
0 |
0 |
if( p->pWin && db->mallocFailed==0 ) gatherSelectWindows(pNew); |
105406
|
0 |
3 |
if( db->mallocFailed ){ |
105453
|
0 |
8003 |
if( pList==0 ){ |
105474
|
0 |
906 |
if( pNew==0 ){ |
105492
|
8003 |
5768 |
if( pList==0 ){ |
105495
|
906 |
4862 |
if( pList->nAllocnExpr+1 ){ |
105524
|
0 |
0 |
int iFirst = pList ? pList->nExpr : 0; |
105527
|
0 |
0 |
if( NEVER(pColumns==0) ) goto vector_append_error; |
105528
|
0 |
0 |
if( pExpr==0 ) goto vector_append_error; |
105535
|
0 |
0 |
if( pExpr->op!=TK_SELECT && pColumns->nId!=(n=sqlite3ExprVectorSize(pExpr)) ){ |
|
0 |
0 |
if( pExpr->op!=TK_SELECT && pColumns->nId!=(n=sqlite3ExprVectorSize(pExpr)) ){ |
105541
|
0 |
0 |
for(i=0; inId; i++){ |
105544
|
0 |
0 |
if( pSubExpr==0 ) continue; |
105546
|
0 |
0 |
if( pList ){ |
105553
|
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) ){ |
105579
|
0 |
796 |
if( p==0 ) return; |
105594
|
746 |
50 |
if( iSortOrder==SQLITE_SO_UNDEFINED ){ |
105599
|
0 |
796 |
if( eNulls!=SQLITE_SO_UNDEFINED ){ |
105601
|
0 |
0 |
if( iSortOrder!=eNulls ){ |
105623
|
1836 |
0 |
if( pList ){ |
105630
|
1836 |
0 |
if( dequote ){ |
105635
|
0 |
1836 |
if( IN_RENAME_OBJECT ){ |
105658
|
1943 |
0 |
if( pList ){ |
105661
|
1627 |
316 |
if( pItem->zEName==0 ){ |
105680
|
363 |
0 |
if( pEList && pEList->nExpr>mx ){ |
|
0 |
363 |
if( pEList && pEList->nExpr>mx ){ |
105696
|
5937 |
8229 |
}while( --i>0 ); |
105700
|
8229 |
17907 |
if( pList ) exprListDeleteNN(db, pList); |
105711
|
1270 |
755 |
for(i=0; inExpr; i++){ |
105741
|
0 |
146 |
if( sqlite3StrICmp(zIn, "true")==0 ) return EP_IsTrue; |
105742
|
0 |
146 |
if( sqlite3StrICmp(zIn, "false")==0 ) return EP_IsFalse; |
105755
|
0 |
4 |
if( !ExprHasProperty(pExpr, EP_Quoted|EP_IntValue) |
105756
|
0 |
0 |
&& (v = sqlite3IsTrueOrFalse(pExpr->u.zToken))!=0 |
105793
|
36 |
16 |
if( pExpr->op==TK_AND || pExpr->op==TK_OR ){ |
|
6 |
30 |
if( pExpr->op==TK_AND || pExpr->op==TK_OR ){ |
105796
|
22 |
0 |
if( ExprAlwaysTrue(pLeft) || ExprAlwaysFalse(pRight) ){ |
|
0 |
22 |
if( ExprAlwaysTrue(pLeft) || ExprAlwaysFalse(pRight) ){ |
105797
|
0 |
0 |
pExpr = pExpr->op==TK_AND ? pRight : pLeft; |
105798
|
22 |
0 |
}else if( ExprAlwaysTrue(pRight) || ExprAlwaysFalse(pLeft) ){ |
|
0 |
22 |
}else if( ExprAlwaysTrue(pRight) || ExprAlwaysFalse(pLeft) ){ |
105799
|
0 |
0 |
pExpr = pExpr->op==TK_AND ? pLeft : pRight; |
105837
|
4032 |
1764 |
if( pWalker->eCode==2 && ExprHasProperty(pExpr, EP_OuterON) ){ |
|
12 |
4020 |
if( pWalker->eCode==2 && ExprHasProperty(pExpr, EP_OuterON) ){ |
105847
|
871 |
0 |
if( (pWalker->eCode>=4 || ExprHasProperty(pExpr,EP_ConstFunc)) |
|
360 |
511 |
if( (pWalker->eCode>=4 || ExprHasProperty(pExpr,EP_ConstFunc)) |
105848
|
360 |
0 |
&& !ExprHasProperty(pExpr, EP_WinFunc) |
105850
|
0 |
360 |
if( pWalker->eCode==5 ) ExprSetProperty(pExpr, EP_FromDDL); |
105859
|
0 |
0 |
if( sqlite3ExprIdToTrueFalse(pExpr) ){ |
105870
|
0 |
1428 |
if( ExprHasProperty(pExpr, EP_FixedCol) && pWalker->eCode!=2 ){ |
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_FixedCol) && pWalker->eCode!=2 ){ |
105873
|
23 |
1405 |
if( pWalker->eCode==3 && pExpr->iTable==pWalker->u.iCur ){ |
|
22 |
1 |
if( pWalker->eCode==3 && pExpr->iTable==pWalker->u.iCur ){ |
105886
|
0 |
1385 |
if( pWalker->eCode==5 ){ |
105891
|
0 |
1385 |
}else if( pWalker->eCode==4 ){ |
105980
|
0 |
23 |
if( pSrc->fg.jointype & JT_LTORJ ){ |
105983
|
0 |
23 |
if( pSrc->fg.jointype & JT_LEFT ){ |
105984
|
0 |
0 |
if( !ExprHasProperty(pExpr, EP_OuterON) ) return 0; /* rule (4a) */ |
105985
|
0 |
0 |
if( pExpr->w.iJoin!=pSrc->iCursor ) return 0; /* rule (4b) */ |
105987
|
0 |
23 |
if( ExprHasProperty(pExpr, EP_OuterON) ) return 0; /* rule (5) */ |
106002
|
12 |
12 |
for(i=0; inExpr; i++){ |
106004
|
0 |
12 |
if( sqlite3ExprCompare(0, pExpr, p, -1)<2 ){ |
106006
|
0 |
0 |
if( sqlite3IsBinary(pColl) ){ |
106013
|
0 |
12 |
if( ExprUseXSelect(pExpr) ){ |
106103
|
0 |
1152 |
if( NEVER(p==0) ) return 0; /* Used to only happen following on OOM */ |
106110
|
61 |
1091 |
if( p->flags & EP_IntValue ){ |
106121
|
0 |
0 |
if( sqlite3ExprIsInteger(p->pLeft, &v) ){ |
106150
|
0 |
116 |
while( p->op==TK_UPLUS || p->op==TK_UMINUS ){ |
|
0 |
116 |
while( p->op==TK_UPLUS || p->op==TK_UMINUS ){ |
106155
|
0 |
116 |
if( op==TK_REGISTER ) op = p->op2; |
106164
|
52 |
0 |
return ExprHasProperty(p, EP_CanBeNull) || |
106165
|
52 |
3 |
p->y.pTab==0 || /* Reference to column of index on expression */ |
|
50 |
2 |
p->y.pTab==0 || /* Reference to column of index on expression */ |
106167
|
50 |
0 |
&& p->y.pTab->aCol!=0 /* Possible due to prior error */ |
106168
|
50 |
0 |
&& p->y.pTab->aCol[p->iColumn].notNull==0); |
106187
|
5 |
62 |
if( aff==SQLITE_AFF_BLOB ) return 1; |
106188
|
0 |
62 |
while( p->op==TK_UPLUS || p->op==TK_UMINUS ){ |
|
0 |
62 |
while( p->op==TK_UPLUS || p->op==TK_UMINUS ){ |
106189
|
0 |
0 |
if( p->op==TK_UMINUS ) unaryMinus = 1; |
106193
|
0 |
62 |
if( op==TK_REGISTER ) op = p->op2; |
106202
|
0 |
0 |
return !unaryMinus && aff==SQLITE_AFF_TEXT; |
|
0 |
0 |
return !unaryMinus && aff==SQLITE_AFF_TEXT; |
106209
|
4 |
0 |
return aff>=SQLITE_AFF_NUMERIC && p->iColumn<0; |
|
2 |
2 |
return aff>=SQLITE_AFF_NUMERIC && p->iColumn<0; |
106221
|
0 |
923 |
if( sqlite3StrICmp(z, "_ROWID_")==0 ) return 1; |
106222
|
914 |
9 |
if( sqlite3StrICmp(z, "ROWID")==0 ) return 1; |
106223
|
0 |
9 |
if( sqlite3StrICmp(z, "OID")==0 ) return 1; |
106241
|
16 |
3 |
if( !ExprUseXSelect(pX) ) return 0; /* Not a subquery */ |
106242
|
0 |
3 |
if( ExprHasProperty(pX, EP_VarSelect) ) return 0; /* Correlated subq */ |
106244
|
0 |
3 |
if( p->pPrior ) return 0; /* Not a compound SELECT */ |
106245
|
0 |
3 |
if( p->selFlags & (SF_Distinct|SF_Aggregate) ){ |
106251
|
0 |
3 |
if( p->pLimit ) return 0; /* Has no LIMIT clause */ |
106252
|
1 |
2 |
if( p->pWhere ) return 0; /* Has no WHERE clause */ |
106255
|
0 |
2 |
if( pSrc->nSrc!=1 ) return 0; /* Single term in FROM clause */ |
106256
|
0 |
2 |
if( pSrc->a[0].pSelect ) return 0; /* FROM is not a subquery or view */ |
106260
|
2 |
0 |
if( IsVirtual(pTab) ) return 0; /* FROM clause not a virtual table */ |
106264
|
0 |
0 |
for(i=0; inExpr; i++){ |
106266
|
0 |
0 |
if( pRes->op!=TK_COLUMN ) return 0; |
106416
|
0 |
19 |
if( prRhsHasNull && ExprUseXSelect(pX) ){ |
|
0 |
0 |
if( prRhsHasNull && ExprUseXSelect(pX) ){ |
106419
|
0 |
0 |
for(i=0; inExpr; i++){ |
106420
|
0 |
0 |
if( sqlite3ExprCanBeNull(pEList->a[i].pExpr) ) break; |
106422
|
0 |
0 |
if( i==pEList->nExpr ){ |
106430
|
19 |
0 |
if( pParse->nErr==0 && (p = isCandidateForInOpt(pX))!=0 ){ |
|
0 |
19 |
if( pParse->nErr==0 && (p = isCandidateForInOpt(pX))!=0 ){ |
106449
|
0 |
0 |
if( nExpr==1 && pEList->a[0].pExpr->iColumn<0 ){ |
|
0 |
0 |
if( nExpr==1 && pEList->a[0].pExpr->iColumn<0 ){ |
106468
|
0 |
0 |
for(i=0; i
|
|
0 |
0 |
for(i=0; i
|
106490
|
0 |
0 |
if( affinity_ok ){ |
106492
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx && eType==0; pIdx=pIdx->pNext){ |
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx && eType==0; pIdx=pIdx->pNext){ |
106495
|
0 |
0 |
if( pIdx->nColumn
|
106496
|
0 |
0 |
if( pIdx->pPartIdxWhere!=0 ) continue; |
106501
|
0 |
0 |
if( pIdx->nColumn>=BMS-1 ) continue; |
106502
|
0 |
0 |
if( mustBeUnique ){ |
106503
|
0 |
0 |
if( pIdx->nKeyCol>nExpr |
106504
|
0 |
0 |
||(pIdx->nColumn>nExpr && !IsUniqueIndex(pIdx)) |
|
0 |
0 |
||(pIdx->nColumn>nExpr && !IsUniqueIndex(pIdx)) |
106511
|
0 |
0 |
for(i=0; i
|
106518
|
0 |
0 |
for(j=0; j
|
106519
|
0 |
0 |
if( pIdx->aiColumn[j]!=pRhs->iColumn ) continue; |
106521
|
0 |
0 |
if( pReq!=0 && sqlite3StrICmp(pReq->zName, pIdx->azColl[j])!=0 ){ |
|
0 |
0 |
if( pReq!=0 && sqlite3StrICmp(pReq->zName, pIdx->azColl[j])!=0 ){ |
106526
|
0 |
0 |
if( j==nExpr ) break; |
106528
|
0 |
0 |
if( mCol & colUsed ) break; /* Each column used only once */ |
106530
|
0 |
0 |
if( aiMap ) aiMap[i] = j; |
106534
|
0 |
0 |
if( colUsed==(MASKBIT(nExpr)-1) ){ |
106545
|
0 |
0 |
if( prRhsHasNull ){ |
106552
|
0 |
0 |
if( nExpr==1 ){ |
106570
|
19 |
0 |
if( eType==0 |
106571
|
16 |
3 |
&& (inFlags & IN_INDEX_NOOP_OK) |
106572
|
16 |
0 |
&& ExprUseXList(pX) |
106573
|
16 |
0 |
&& (!sqlite3InRhsIsConstant(pX) || pX->x.pList->nExpr<=2) |
|
16 |
0 |
&& (!sqlite3InRhsIsConstant(pX) || pX->x.pList->nExpr<=2) |
106580
|
3 |
16 |
if( eType==0 ){ |
106587
|
3 |
0 |
if( inFlags & IN_INDEX_LOOP ){ |
106589
|
0 |
0 |
}else if( prRhsHasNull ){ |
106594
|
0 |
3 |
if( rMayHaveNull ){ |
106600
|
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 ){ |
106603
|
16 |
16 |
for(i=0; i
|
106622
|
3 |
16 |
Select *pSelect = ExprUseXSelect(pExpr) ? pExpr->x.pSelect : 0; |
106627
|
19 |
0 |
if( zRet ){ |
106629
|
19 |
19 |
for(i=0; i
|
106632
|
3 |
16 |
if( pSelect ){ |
106652
|
0 |
0 |
if( pParse->nErr==0 ){ |
106672
|
0 |
0 |
if( ExprUseXSelect(pExpr) ){ |
106729
|
3 |
0 |
if( !ExprHasProperty(pExpr, EP_VarSelect) && pParse->iSelfTab==0 ){ |
|
3 |
0 |
if( !ExprHasProperty(pExpr, EP_VarSelect) && pParse->iSelfTab==0 ){ |
106734
|
0 |
3 |
if( ExprHasProperty(pExpr, EP_Subrtn) ){ |
106736
|
0 |
0 |
if( ExprUseXSelect(pExpr) ){ |
106778
|
3 |
0 |
if( ExprUseXSelect(pExpr) ){ |
106787
|
3 |
0 |
ExplainQueryPlan((pParse, 1, "%sLIST SUBQUERY %d", |
106792
|
3 |
0 |
if( ALWAYS(pEList->nExpr==nVal) ){ |
106803
|
3 |
0 |
rc = pParse->db->mallocFailed ? 1 :sqlite3Select(pParse, pCopy, &dest); |
106806
|
0 |
3 |
if( rc ){ |
106814
|
3 |
3 |
for(i=0; i
|
106821
|
0 |
0 |
}else if( ALWAYS(pExpr->x.pList!=0) ){ |
106835
|
0 |
0 |
if( affinity<=SQLITE_AFF_NONE ){ |
106837
|
0 |
0 |
}else if( affinity==SQLITE_AFF_REAL ){ |
106840
|
0 |
0 |
if( pKeyInfo ){ |
106848
|
0 |
0 |
for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){ |
106856
|
0 |
0 |
if( addrOnce && !sqlite3ExprIsConstant(pE2) ){ |
|
0 |
0 |
if( addrOnce && !sqlite3ExprIsConstant(pE2) ){ |
106871
|
3 |
0 |
if( pKeyInfo ){ |
106874
|
3 |
0 |
if( addrOnce ){ |
106913
|
0 |
18 |
if( pParse->nErr ) return 0; |
106922
|
0 |
18 |
if( ExprHasProperty(pExpr, EP_Subrtn) ){ |
106948
|
16 |
2 |
if( !ExprHasProperty(pExpr, EP_VarSelect) ){ |
106962
|
16 |
2 |
ExplainQueryPlan((pParse, 1, "%sSCALAR SUBQUERY %d", |
106964
|
18 |
0 |
nReg = pExpr->op==TK_SELECT ? pSel->pEList->nExpr : 1; |
106967
|
18 |
0 |
if( pExpr->op==TK_SELECT ){ |
106978
|
0 |
18 |
if( pSel->pLimit ){ |
106983
|
0 |
0 |
if( pLimit ){ |
106996
|
0 |
18 |
if( sqlite3Select(pParse, pSel, &dest) ){ |
107003
|
16 |
2 |
if( addrOnce ){ |
107028
|
3 |
32 |
if( ExprUseXSelect(pIn) && !pParse->db->mallocFailed ){ |
|
3 |
0 |
if( ExprUseXSelect(pIn) && !pParse->db->mallocFailed ){ |
107029
|
0 |
3 |
if( nVector!=pIn->x.pSelect->pEList->nExpr ){ |
107033
|
0 |
32 |
}else if( nVector!=1 ){ |
107094
|
0 |
16 |
if( sqlite3ExprCheckIN(pParse, pExpr) ) return; |
107100
|
0 |
16 |
if( pParse->db->mallocFailed ) goto sqlite3ExprCodeIN_oom_error; |
107109
|
0 |
16 |
eType = sqlite3FindInIndex(pParse, pExpr, |
107143
|
16 |
16 |
for(i=0; i
|
|
16 |
0 |
for(i=0; i
|
107144
|
16 |
0 |
if( i==nVector ){ |
107150
|
0 |
0 |
for(i=0; i
|
107161
|
16 |
0 |
if( eType==IN_INDEX_NOOP ){ |
107171
|
0 |
16 |
if( destIfNull!=destIfFalse ){ |
107175
|
32 |
16 |
for(ii=0; iinExpr; ii++){ |
107177
|
0 |
32 |
if( regCkNull && sqlite3ExprCanBeNull(pList->a[ii].pExpr) ){ |
|
0 |
0 |
if( regCkNull && sqlite3ExprCanBeNull(pList->a[ii].pExpr) ){ |
107181
|
16 |
16 |
if( iinExpr-1 || destIfNull!=destIfFalse ){ |
|
0 |
16 |
if( iinExpr-1 || destIfNull!=destIfFalse ){ |
107182
|
16 |
0 |
int op = rLhs!=r2 ? OP_Eq : OP_NotNull; |
107191
|
16 |
0 |
int op = rLhs!=r2 ? OP_Ne : OP_IsNull; |
107200
|
0 |
16 |
if( regCkNull ){ |
107213
|
0 |
0 |
if( destIfNull==destIfFalse ){ |
107218
|
0 |
0 |
for(i=0; i
|
107220
|
0 |
0 |
if( pParse->nErr ) goto sqlite3ExprCodeIN_oom_error; |
107221
|
0 |
0 |
if( sqlite3ExprCanBeNull(p) ){ |
107231
|
0 |
0 |
if( eType==IN_INDEX_ROWID ){ |
107240
|
0 |
0 |
if( destIfFalse==destIfNull ){ |
107254
|
0 |
0 |
if( rRhsHasNull && nVector==1 ){ |
|
0 |
0 |
if( rRhsHasNull && nVector==1 ){ |
107262
|
0 |
0 |
if( destIfFalse==destIfNull ) sqlite3VdbeGoto(v, destIfFalse); |
107271
|
0 |
0 |
if( destStep6 ) sqlite3VdbeResolveLabel(v, destStep6); |
107274
|
0 |
0 |
if( nVector>1 ){ |
107281
|
0 |
0 |
for(i=0; i
|
107294
|
0 |
0 |
if( nVector>1 ){ |
107308
|
0 |
16 |
if( rLhs!=rLhsOrig ) sqlite3ReleaseTempReg(pParse, rLhs); |
107326
|
2166 |
0 |
if( ALWAYS(z!=0) ){ |
107330
|
0 |
2166 |
if( negateFlag ) value = -value; |
107345
|
543 |
12 |
if( pExpr->flags & EP_IntValue ){ |
107348
|
1 |
542 |
if( negFlag ) i = -i; |
107356
|
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)){ |
107361
|
0 |
0 |
if( sqlite3_strnicmp(z,"0x",2)==0 ){ |
107362
|
0 |
0 |
sqlite3ErrorMsg(pParse, "hex literal too big: %s%#T", |
107371
|
0 |
12 |
if( negFlag ){ value = c==3 ? SMALLEST_INT64 : -value; } |
|
0 |
0 |
if( negFlag ){ value = c==3 ? SMALLEST_INT64 : -value; } |
107389
|
0 |
14 |
if( iTabCol==XN_EXPR ){ |
107416
|
0 |
0 |
if( pParse->iSelfTab>0 ){ |
107422
|
0 |
0 |
if( pCol->affinity>=SQLITE_AFF_TEXT ){ |
107425
|
0 |
0 |
if( iAddr ) sqlite3VdbeJumpHere(v, iAddr); |
107441
|
0 |
4883 |
if( pTab==0 ){ |
107445
|
4723 |
160 |
if( iCol<0 || iCol==pTab->iPKey ){ |
|
2 |
4721 |
if( iCol<0 || iCol==pTab->iPKey ){ |
107451
|
214 |
4507 |
if( IsVirtual(pTab) ){ |
107455
|
0 |
4507 |
}else if( (pCol = &pTab->aCol[iCol])->colFlags & COLFLAG_VIRTUAL ){ |
107457
|
0 |
0 |
if( pCol->colFlags & COLFLAG_BUSY ){ |
107470
|
0 |
4507 |
}else if( !HasRowid(pTab) ){ |
107501
|
17 |
4768 |
if( p5 ){ |
107503
|
17 |
0 |
if( pOp->opcode==OP_Column ) pOp->p5 = p5; |
107523
|
0 |
0 |
if( NEVER(p==0) ) return; |
107543
|
16 |
0 |
if( nResult==1 ){ |
107547
|
0 |
0 |
if( p->op==TK_SELECT ){ |
107558
|
0 |
0 |
for(i=0; i
|
107571
|
0 |
8 |
if( sqlite3VdbeGetOp(v, -1)->opcode==OP_Copy ){ |
107602
|
8 |
8 |
for(i=1; i
|
107666
|
0 |
0 |
if( pA1->op==TK_COLUMN ){ |
107685
|
0 |
0 |
sqlite3VdbeLoadString(v, target, |
107720
|
66 |
13329 |
if( pExpr==0 ){ |
107733
|
15 |
77 |
if( !pAggInfo->directMode ){ |
107736
|
23 |
54 |
}else if( pAggInfo->useSortingIdx ){ |
107740
|
23 |
0 |
if( pCol->iColumn<0 ){ |
107745
|
0 |
23 |
if( pTab->aCol[pCol->iColumn].affinity==SQLITE_AFF_REAL ){ |
107757
|
0 |
4785 |
if( ExprHasProperty(pExpr, EP_FixedCol) ){ |
107767
|
0 |
0 |
if( pExpr->y.pTab ){ |
107772
|
0 |
0 |
if( aff>SQLITE_AFF_BLOB ){ |
107781
|
0 |
4785 |
if( iTab<0 ){ |
107782
|
0 |
0 |
if( pParse->iSelfTab<0 ){ |
107798
|
0 |
0 |
if( iCol<0 ){ |
107805
|
0 |
0 |
if( pCol->colFlags & COLFLAG_GENERATED ){ |
107806
|
0 |
0 |
if( pCol->colFlags & COLFLAG_BUSY ){ |
107812
|
0 |
0 |
if( pCol->colFlags & COLFLAG_NOTAVAIL ){ |
107819
|
0 |
0 |
if( pCol->affinity==SQLITE_AFF_REAL ){ |
107836
|
0 |
4785 |
if( pExpr->y.pTab==0 && pExpr->affExpr==SQLITE_AFF_REAL ){ |
|
0 |
0 |
if( pExpr->y.pTab==0 && pExpr->affExpr==SQLITE_AFF_REAL ){ |
107891
|
31 |
1357 |
if( pExpr->u.zToken[1]!=0 ){ |
107906
|
0 |
3 |
if( inReg!=target ){ |
107918
|
0 |
0 |
op = (op==TK_IS) ? TK_EQ : TK_NE; |
107928
|
0 |
0 |
if( sqlite3ExprIsVector(pLeft) ){ |
107943
|
0 |
0 |
if( p5==SQLITE_NULLEQ ){ |
107986
|
1 |
0 |
if( pLeft->op==TK_INTEGER ){ |
107990
|
0 |
0 |
}else if( pLeft->op==TK_FLOAT ){ |
108045
|
147 |
0 |
if( pInfo==0 |
108046
|
147 |
0 |
|| NEVER(pExpr->iAgg<0) |
108047
|
0 |
147 |
|| NEVER(pExpr->iAgg>=pInfo->nFunc) |
108068
|
0 |
760 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){ |
108073
|
646 |
114 |
if( ConstFactorOk(pParse) && sqlite3ExprIsConstantNotJoin(pExpr) ){ |
|
57 |
589 |
if( ConstFactorOk(pParse) && sqlite3ExprIsConstantNotJoin(pExpr) ){ |
108081
|
685 |
18 |
nFarg = pFarg ? pFarg->nExpr : 0; |
108090
|
703 |
0 |
if( pDef==0 || pDef->xFinalize!=0 ){ |
|
0 |
703 |
if( pDef==0 || pDef->xFinalize!=0 ){ |
108094
|
8 |
695 |
if( pDef->funcFlags & SQLITE_FUNC_INLINE ){ |
108099
|
491 |
204 |
}else if( pDef->funcFlags & (SQLITE_FUNC_DIRECT|SQLITE_FUNC_UNSAFE) ){ |
108103
|
1180 |
695 |
for(i=0; i
|
108104
|
1180 |
0 |
if( i<32 && sqlite3ExprIsConstant(pFarg->a[i].pExpr) ){ |
|
984 |
196 |
if( i<32 && sqlite3ExprIsConstant(pFarg->a[i].pExpr) ){ |
108108
|
0 |
1180 |
if( (pDef->funcFlags & SQLITE_FUNC_NEEDCOLL)!=0 && !pColl ){ |
|
0 |
0 |
if( (pDef->funcFlags & SQLITE_FUNC_NEEDCOLL)!=0 && !pColl ){ |
108112
|
677 |
18 |
if( pFarg ){ |
108113
|
585 |
92 |
if( constMask ){ |
108125
|
35 |
642 |
if( (pDef->funcFlags & (SQLITE_FUNC_LENGTH|SQLITE_FUNC_TYPEOF))!=0 ){ |
108130
|
18 |
17 |
if( exprOp==TK_COLUMN || exprOp==TK_AGG_COLUMN ){ |
|
0 |
18 |
if( exprOp==TK_COLUMN || exprOp==TK_AGG_COLUMN ){ |
108157
|
488 |
207 |
if( nFarg>=2 && ExprHasProperty(pExpr, EP_InfixFunc) ){ |
|
148 |
340 |
if( nFarg>=2 && ExprHasProperty(pExpr, EP_InfixFunc) ){ |
108159
|
529 |
18 |
}else if( nFarg>0 ){ |
108163
|
0 |
695 |
if( pDef->funcFlags & SQLITE_FUNC_NEEDCOLL ){ |
108164
|
0 |
0 |
if( !pColl ) pColl = db->pDfltColl; |
108169
|
677 |
18 |
if( nFarg ){ |
108170
|
92 |
585 |
if( constMask==0 ){ |
108184
|
0 |
18 |
if( pParse->db->mallocFailed ){ |
108186
|
18 |
0 |
}else if( op==TK_SELECT |
108187
|
18 |
0 |
&& ALWAYS( ExprUseXSelect(pExpr) ) |
108188
|
0 |
18 |
&& (nCol = pExpr->x.pSelect->pEList->nExpr)!=1 |
108199
|
0 |
0 |
if( pLeft->iTable==0 || pParse->withinRJSubrtn > pLeft->op2 ){ |
|
0 |
0 |
if( pLeft->iTable==0 || pParse->withinRJSubrtn > pLeft->op2 ){ |
108205
|
0 |
0 |
if( pExpr->iTable!=n ){ |
108241
|
77 |
40 |
if( !ExprHasProperty(pExpr, EP_Collate) |
108242
|
77 |
0 |
&& ALWAYS(pExpr->pLeft) |
108243
|
0 |
77 |
&& pExpr->pLeft->op==TK_FUNCTION |
108246
|
0 |
0 |
if( inReg!=target ){ |
108316
|
0 |
0 |
if( iCol>=0 && pTab->aCol[iCol].affinity==SQLITE_AFF_REAL ){ |
|
0 |
0 |
if( iCol>=0 && pTab->aCol[iCol].affinity==SQLITE_AFF_REAL ){ |
108390
|
0 |
0 |
if( (pX = pExpr->pLeft)!=0 ){ |
108392
|
0 |
0 |
if( db->mallocFailed ){ |
108409
|
0 |
0 |
for(i=0; i
|
108410
|
0 |
0 |
if( pX ){ |
108424
|
0 |
0 |
if( (nExpr&1)!=0 ){ |
108441
|
0 |
0 |
if( !pParse->pTriggerTab && !pParse->nested ){ |
|
0 |
0 |
if( !pParse->pTriggerTab && !pParse->nested ){ |
108446
|
0 |
0 |
if( pExpr->affExpr==OE_Abort ){ |
108450
|
0 |
0 |
if( pExpr->affExpr==OE_Ignore ){ |
108455
|
0 |
0 |
sqlite3HaltConstraint(pParse, |
108494
|
904 |
858 |
if( regDest<0 && p ){ |
|
357 |
547 |
if( regDest<0 && p ){ |
108497
|
466 |
333 |
for(pItem=p->a, i=p->nExpr; i>0; pItem++, i--){ |
108498
|
349 |
117 |
if( pItem->fg.reusable |
108499
|
24 |
325 |
&& sqlite3ExprCompare(0,pItem->pExpr,pExpr,-1)==0 |
108506
|
1683 |
55 |
if( pExpr!=0 && ExprHasProperty(pExpr, EP_HasFunc) ){ |
|
108 |
1575 |
if( pExpr!=0 && ExprHasProperty(pExpr, EP_HasFunc) ){ |
108512
|
108 |
0 |
if( !pParse->db->mallocFailed ){ |
108513
|
108 |
0 |
if( regDest<0 ) regDest = ++pParse->nMem; |
108521
|
1630 |
0 |
if( p ){ |
108524
|
772 |
858 |
if( regDest<0 ) regDest = ++pParse->nMem; |
108548
|
1767 |
20 |
if( ConstFactorOk(pParse) |
108549
|
1767 |
0 |
&& ALWAYS(pExpr!=0) |
108550
|
1757 |
10 |
&& pExpr->op!=TK_REGISTER |
108551
|
847 |
910 |
&& sqlite3ExprIsConstantNotJoin(pExpr) |
108558
|
906 |
34 |
if( r2==r1 ){ |
108579
|
0 |
6600 |
if( pParse->pVdbe==0 ) return; |
108581
|
306 |
6294 |
if( inReg!=target ){ |
108583
|
306 |
0 |
if( ALWAYS(pExpr) && ExprHasProperty(pExpr,EP_Subquery) ){ |
|
0 |
306 |
if( ALWAYS(pExpr) && ExprHasProperty(pExpr,EP_Subquery) ){ |
108600
|
0 |
0 |
if( !db->mallocFailed ) sqlite3ExprCode(pParse, pExpr, target); |
108611
|
55 |
0 |
if( pParse->okConstFactor && sqlite3ExprIsConstantNotJoin(pExpr) ){ |
|
55 |
0 |
if( pParse->okConstFactor && sqlite3ExprIsConstantNotJoin(pExpr) ){ |
108647
|
2776 |
29 |
u8 copyOp = (flags & SQLITE_ECEL_DUP) ? OP_Copy : OP_SCopy; |
108653
|
108 |
2697 |
if( !ConstFactorOk(pParse) ) flags &= ~SQLITE_ECEL_FACTOR; |
108654
|
6070 |
2805 |
for(pItem=pList->a, i=0; i
|
108662
|
280 |
5790 |
if( (flags & SQLITE_ECEL_REF)!=0 && (j = pItem->u.x.iOrderByCol)>0 ){ |
|
120 |
160 |
if( (flags & SQLITE_ECEL_REF)!=0 && (j = pItem->u.x.iOrderByCol)>0 ){ |
108663
|
120 |
0 |
if( flags & SQLITE_ECEL_OMITREF ){ |
108669
|
999 |
4951 |
}else if( (flags & SQLITE_ECEL_FACTOR)!=0 |
108670
|
803 |
196 |
&& sqlite3ExprIsConstantNotJoin(pExpr) |
108675
|
212 |
4935 |
if( inReg!=target+i ){ |
108677
|
212 |
0 |
if( copyOp==OP_Copy |
108678
|
8 |
204 |
&& (pOp=sqlite3VdbeGetOp(v, -1))->opcode==OP_Copy |
108679
|
8 |
0 |
&& pOp->p1+pOp->p3+1==inReg |
108680
|
8 |
0 |
&& pOp->p2+pOp->p3+1==target+i |
108681
|
8 |
0 |
&& pOp->p5==0 /* The do-not-merge flag must be clear */ |
108733
|
0 |
0 |
if( db->mallocFailed==0 ){ |
108744
|
0 |
0 |
if( xJump ){ |
108793
|
0 |
18 |
if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */ |
108794
|
0 |
18 |
if( NEVER(pExpr==0) ) return; /* No way this can happen */ |
108801
|
0 |
3 |
if( pAlt!=pExpr ){ |
108803
|
2 |
1 |
}else if( op==TK_AND ){ |
108830
|
0 |
0 |
if( isTrue ^ isNot ){ |
108831
|
0 |
0 |
sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, |
108834
|
0 |
0 |
sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, |
108843
|
0 |
0 |
op = (op==TK_IS) ? TK_EQ : TK_NE; |
108852
|
0 |
2 |
if( sqlite3ExprIsVector(pExpr->pLeft) ) goto default_expr; |
108891
|
0 |
0 |
int destIfNull = jumpIfNull ? dest : destIfFalse; |
108900
|
0 |
12 |
if( ExprAlwaysTrue(pExpr) ){ |
108902
|
12 |
0 |
}else if( ExprAlwaysFalse(pExpr) ){ |
108935
|
0 |
1093 |
if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */ |
108936
|
141 |
952 |
if( pExpr==0 ) return; |
108974
|
0 |
5 |
if( pAlt!=pExpr ){ |
108976
|
3 |
2 |
}else if( pExpr->op==TK_AND ){ |
109003
|
0 |
0 |
if( isTrue ^ isNot ){ |
109005
|
0 |
0 |
sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, |
109010
|
0 |
0 |
sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, |
109019
|
1 |
2 |
op = (pExpr->op==TK_IS) ? TK_NE : TK_EQ; |
109028
|
0 |
759 |
if( sqlite3ExprIsVector(pExpr->pLeft) ) goto default_expr; |
109064
|
16 |
0 |
if( jumpIfNull ){ |
109076
|
0 |
139 |
if( ExprAlwaysFalse(pExpr) ){ |
109078
|
139 |
0 |
}else if( ExprAlwaysTrue(pExpr) ){ |
109102
|
0 |
0 |
if( db->mallocFailed==0 ){ |
109131
|
0 |
0 |
if( pR ){ |
109135
|
0 |
0 |
if( pL ){ |
109136
|
0 |
0 |
if( sqlite3_value_type(pL)==SQLITE_TEXT ){ |
109184
|
3068 |
5393 |
if( pA==0 || pB==0 ){ |
|
0 |
3068 |
if( pA==0 || pB==0 ){ |
109185
|
5393 |
0 |
return pB==pA ? 0 : 2; |
109187
|
0 |
3068 |
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) ){ |
109191
|
0 |
3068 |
if( combinedFlags & EP_IntValue ){ |
109192
|
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 ){ |
109197
|
2991 |
77 |
if( pA->op!=pB->op || pA->op==TK_RAISE ){ |
|
0 |
2991 |
if( pA->op!=pB->op || pA->op==TK_RAISE ){ |
109198
|
16 |
61 |
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 ){ |
109201
|
0 |
61 |
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 ){ |
109208
|
2981 |
10 |
if( pA->u.zToken ){ |
109209
|
2981 |
0 |
if( pA->op==TK_FUNCTION || pA->op==TK_AGG_FUNCTION ){ |
|
1 |
2980 |
if( pA->op==TK_FUNCTION || pA->op==TK_AGG_FUNCTION ){ |
109210
|
0 |
1 |
if( sqlite3StrICmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2; |
109213
|
0 |
1 |
if( ExprHasProperty(pA,EP_WinFunc)!=ExprHasProperty(pB,EP_WinFunc) ){ |
109216
|
0 |
1 |
if( ExprHasProperty(pA,EP_WinFunc) ){ |
109217
|
0 |
0 |
if( sqlite3WindowCompare(pParse, pA->y.pWin, pB->y.pWin, 1)!=0 ){ |
109222
|
0 |
2980 |
}else if( pA->op==TK_NULL ){ |
109224
|
0 |
2980 |
}else if( pA->op==TK_COLLATE ){ |
109225
|
0 |
0 |
if( sqlite3_stricmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2; |
109227
|
2978 |
2 |
if( pB->u.zToken!=0 |
109228
|
318 |
2660 |
&& pA->op!=TK_COLUMN |
109229
|
318 |
0 |
&& pA->op!=TK_AGG_COLUMN |
109230
|
292 |
26 |
&& strcmp(pA->u.zToken,pB->u.zToken)!=0 |
109235
|
0 |
2699 |
if( (pA->flags & (EP_Distinct|EP_Commuted)) |
109237
|
2699 |
0 |
if( ALWAYS((combinedFlags & EP_TokenOnly)==0) ){ |
109238
|
0 |
2699 |
if( combinedFlags & EP_xIsSelect ) return 2; |
109239
|
2699 |
0 |
if( (combinedFlags & EP_FixedCol)==0 |
109240
|
0 |
2699 |
&& sqlite3ExprCompare(pParse, pA->pLeft, pB->pLeft, iTab) ) return 2; |
109241
|
0 |
2699 |
if( sqlite3ExprCompare(pParse, pA->pRight, pB->pRight, iTab) ) return 2; |
109242
|
0 |
2699 |
if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList, iTab) ) return 2; |
109243
|
2675 |
24 |
if( pA->op!=TK_STRING |
109244
|
2675 |
0 |
&& pA->op!=TK_TRUEFALSE |
109245
|
2675 |
0 |
&& ALWAYS((combinedFlags & EP_Reduced)==0) |
109247
|
2567 |
108 |
if( pA->iColumn!=pB->iColumn ) return 2; |
109248
|
0 |
108 |
if( pA->op2!=pB->op2 && pA->op==TK_TRUTH ) return 2; |
|
0 |
0 |
if( pA->op2!=pB->op2 && pA->op==TK_TRUTH ) return 2; |
109249
|
108 |
0 |
if( pA->op!=TK_IN && pA->iTable!=pB->iTable && pA->iTable!=iTab ){ |
|
2 |
106 |
if( pA->op!=TK_IN && pA->iTable!=pB->iTable && pA->iTable!=iTab ){ |
|
2 |
0 |
if( pA->op!=TK_IN && pA->iTable!=pB->iTable && pA->iTable!=iTab ){ |
109275
|
2702 |
3 |
if( pA==0 && pB==0 ) return 0; |
|
2698 |
4 |
if( pA==0 && pB==0 ) return 0; |
109276
|
3 |
4 |
if( pA==0 || pB==0 ) return 1; |
|
0 |
3 |
if( pA==0 || pB==0 ) return 1; |
109277
|
0 |
3 |
if( pA->nExpr!=pB->nExpr ) return 1; |
109278
|
3 |
2 |
for(i=0; inExpr; i++){ |
109282
|
0 |
3 |
if( pA->a[i].fg.sortFlags!=pB->a[i].fg.sortFlags ) return 1; |
109283
|
1 |
2 |
if( (res = sqlite3ExprCompare(0, pExprA, pExprB, iTab)) ) return res; |
109314
|
0 |
0 |
if( sqlite3ExprCompare(pParse, p, pNN, iTab)==0 ){ |
109319
|
0 |
0 |
if( seenNot && ExprHasProperty(p, EP_xIsSelect) ) return 0; |
|
0 |
0 |
if( seenNot && ExprHasProperty(p, EP_xIsSelect) ) return 0; |
109329
|
0 |
0 |
if( seenNot ) return 0; |
109330
|
0 |
0 |
if( exprImpliesNotNull(pParse, pList->a[0].pExpr, pNN, iTab, 1) |
109331
|
0 |
0 |
|| exprImpliesNotNull(pParse, pList->a[1].pExpr, pNN, iTab, 1) |
109355
|
0 |
0 |
if( exprImpliesNotNull(pParse, p->pRight, pNN, iTab, seenNot) ) return 1; |
109365
|
0 |
0 |
if( seenNot ) return 0; |
109366
|
0 |
0 |
if( p->op2!=TK_IS ) return 0; |
109408
|
0 |
0 |
if( sqlite3ExprCompare(pParse, pE1, pE2, iTab)==0 ){ |
109411
|
0 |
0 |
if( pE2->op==TK_OR |
109412
|
0 |
0 |
&& (sqlite3ExprImpliesExpr(pParse, pE1, pE2->pLeft, iTab) |
109413
|
0 |
0 |
|| sqlite3ExprImpliesExpr(pParse, pE1, pE2->pRight, iTab) ) |
109417
|
0 |
0 |
if( pE2->op==TK_NOTNULL |
109418
|
0 |
0 |
&& exprImpliesNotNull(pParse, pE1, pE2->pLeft, iTab, 0) |
109437
|
3 |
4 |
if( ExprHasProperty(pExpr, EP_OuterON) ) return WRC_Prune; |
109461
|
1 |
0 |
if( pWalker->u.iCur==pExpr->iTable ){ |
109468
|
0 |
0 |
if( pWalker->eCode==0 ){ |
109470
|
0 |
0 |
if( pWalker->eCode ){ |
109478
|
0 |
0 |
if( sqlite3WalkExpr(pWalker, pExpr->pLeft)==WRC_Abort ){ |
109505
|
1 |
0 |
if( (pLeft->op==TK_COLUMN |
109506
|
1 |
0 |
&& pLeft->y.pTab!=0 |
109507
|
0 |
1 |
&& IsVirtual(pLeft->y.pTab)) |
109508
|
0 |
0 |
|| (pRight->op==TK_COLUMN |
109509
|
0 |
0 |
&& pRight->y.pTab!=0 |
109510
|
0 |
0 |
&& IsVirtual(pRight->y.pTab)) |
109546
|
0 |
8 |
if( p==0 ) return 0; |
109547
|
1 |
7 |
if( p->op==TK_NOTNULL ){ |
109550
|
4 |
6 |
while( p->op==TK_AND ){ |
109551
|
1 |
3 |
if( sqlite3ExprImpliesNonNullRow(p->pLeft, iTab) ) return 1; |
109582
|
51 |
119 |
if( pExpr->op==TK_COLUMN |
109583
|
51 |
0 |
&& pExpr->iTable==pWalker->u.pIdxCover->iCur |
109584
|
0 |
51 |
&& sqlite3TableColumnToIndex(pWalker->u.pIdxCover->pIdx, pExpr->iColumn)<0 |
109642
|
0 |
0 |
if( pSrc->nSrc==0 ) return WRC_Continue; |
109646
|
0 |
0 |
if( piNew==0 ){ |
109652
|
0 |
0 |
for(i=0; inSrc; i++, j++){ |
109660
|
0 |
0 |
if( p->nExclude ){ |
109675
|
0 |
62 |
if( pExpr->op==TK_COLUMN |
109676
|
0 |
0 |
|| pExpr->op==TK_AGG_COLUMN |
109681
|
62 |
0 |
int nSrc = pSrc ? pSrc->nSrc : 0; |
109682
|
62 |
0 |
for(i=0; i
|
109683
|
62 |
0 |
if( pExpr->iTable==pSrc->a[i].iCursor ){ |
109688
|
0 |
0 |
for(i=0; inExclude && p->aiExclude[i]!=pExpr->iTable; i++){} |
|
0 |
0 |
for(i=0; inExclude && p->aiExclude[i]!=pExpr->iTable; i++){} |
109689
|
0 |
0 |
if( i>=p->nExclude ){ |
109726
|
0 |
147 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){ |
109731
|
62 |
85 |
if( w.eCode & 0x01 ){ |
109733
|
0 |
85 |
}else if( w.eCode ){ |
109754
|
78 |
0 |
if( ALWAYS(!ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced)) |
109755
|
0 |
78 |
&& pExpr->pAggInfo!=0 |
109762
|
0 |
0 |
if( pExpr->op==TK_AGG_COLUMN ){ |
109764
|
0 |
0 |
if( pAggInfo->aCol[iAgg].pCExpr==pExpr ){ |
109766
|
0 |
0 |
if( pExpr ){ |
109773
|
0 |
0 |
if( pAggInfo->aFunc[iAgg].pFExpr==pExpr ){ |
109775
|
0 |
0 |
if( pExpr ){ |
109848
|
78 |
0 |
if( ALWAYS(pSrcList!=0) ){ |
109850
|
79 |
0 |
for(i=0; inSrc; i++, pItem++){ |
109853
|
78 |
1 |
if( pExpr->iTable==pItem->iCursor ){ |
109862
|
11 |
77 |
for(k=0; knColumn; k++, pCol++){ |
109863
|
9 |
2 |
if( pCol->iTable==pExpr->iTable && |
|
1 |
8 |
if( pCol->iTable==pExpr->iTable && |
109868
|
77 |
1 |
if( (k>=pAggInfo->nColumn) |
109869
|
77 |
0 |
&& (k = addAggInfoColumn(pParse->db, pAggInfo))>=0 |
109879
|
23 |
54 |
if( pAggInfo->pGroupBy ){ |
109884
|
23 |
9 |
for(j=0; j
|
109886
|
23 |
0 |
if( pE->op==TK_COLUMN && pE->iTable==pExpr->iTable && |
|
22 |
1 |
if( pE->op==TK_COLUMN && pE->iTable==pExpr->iTable && |
|
14 |
8 |
if( pE->op==TK_COLUMN && pE->iTable==pExpr->iTable && |
109893
|
63 |
14 |
if( pCol->iSorterColumn<0 ){ |
109913
|
148 |
0 |
if( (pNC->ncFlags & NC_InAggFunc)==0 |
109914
|
148 |
0 |
&& pWalker->walkerDepth==pExpr->op2 |
109920
|
1 |
147 |
for(i=0; inFunc; i++, pItem++){ |
109921
|
0 |
1 |
if( pItem->pFExpr==pExpr ) break; |
109922
|
1 |
0 |
if( sqlite3ExprCompare(0, pItem->pFExpr, pExpr, -1)==0 ){ |
109926
|
147 |
1 |
if( i>=pAggInfo->nFunc ){ |
109931
|
147 |
0 |
if( i>=0 ){ |
109937
|
62 |
85 |
pItem->pFunc = sqlite3FindFunction(pParse->db, |
109940
|
0 |
147 |
if( pExpr->flags & EP_Distinct ){ |
109992
|
211 |
230 |
if( pList ){ |
109993
|
220 |
211 |
for(pItem=pList->a, i=0; inExpr; i++, pItem++){ |
110003
|
791 |
417 |
if( pParse->nTempReg==0 ){ |
110014
|
1467 |
1142 |
if( iReg ){ |
110016
|
1467 |
0 |
if( pParse->nTempRegaTempReg) ){ |
110027
|
192 |
173 |
if( nReg==1 ) return sqlite3GetTempReg(pParse); |
110030
|
1 |
172 |
if( nReg<=n ){ |
110040
|
192 |
96 |
if( nReg==1 ){ |
110045
|
20 |
76 |
if( nReg>pParse->nRangeReg ){ |
110120
|
0 |
0 |
if( 0==sqlite3StrNICmp(pTab->zName, "sqlite_", 7) |
110122
|
0 |
0 |
|| (pTab->tabFlags & TF_Eponymous)!=0 |
110123
|
0 |
0 |
|| ( (pTab->tabFlags & TF_Shadow)!=0 |
110124
|
0 |
0 |
&& sqlite3ReadOnlyShadowTables(pParse->db) |
110159
|
0 |
0 |
if( bTemp==0 ){ |
110185
|
0 |
0 |
if( bTemp==0 ){ |
110201
|
0 |
0 |
if( v ){ |
110204
|
0 |
0 |
if( iDb!=1 ) sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, 1, 0, p5); |
110227
|
0 |
0 |
if( NEVER(db->mallocFailed) ) goto exit_rename_table; |
110232
|
0 |
0 |
if( !pTab ) goto exit_rename_table; |
110238
|
0 |
0 |
if( !zName ) goto exit_rename_table; |
110243
|
0 |
0 |
if( sqlite3FindTable(db, zName, zDb) |
110244
|
0 |
0 |
|| sqlite3FindIndex(db, zName, zDb) |
110245
|
0 |
0 |
|| sqlite3IsShadowTableOf(db, pTab, zName) |
110255
|
0 |
0 |
if( SQLITE_OK!=isAlterableTable(pParse, pTab) ){ |
110258
|
0 |
0 |
if( SQLITE_OK!=sqlite3CheckObjectName(pParse,zName,"table",zName) ){ |
110263
|
0 |
0 |
if( IsView(pTab) ){ |
110271
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){ |
110277
|
0 |
0 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ){ |
110280
|
0 |
0 |
if( IsVirtual(pTab) ){ |
110282
|
0 |
0 |
if( pVTab->pVtab->pModule->xRename==0 ){ |
110293
|
0 |
0 |
if( v==0 ){ |
110334
|
0 |
0 |
if( sqlite3FindTable(db, "sqlite_sequence", zDb) ){ |
110344
|
0 |
0 |
if( iDb!=1 ){ |
110362
|
0 |
0 |
if( pVTab ){ |
110416
|
0 |
0 |
if( pParse->nErr ) return; |
110432
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){ |
110442
|
0 |
0 |
if( pCol->colFlags & COLFLAG_PRIMKEY ){ |
110446
|
0 |
0 |
if( pNew->pIndex ){ |
110451
|
0 |
0 |
if( (pCol->colFlags & COLFLAG_GENERATED)==0 ){ |
110457
|
0 |
0 |
if( pDflt && pDflt->pLeft->op==TK_NULL ){ |
|
0 |
0 |
if( pDflt && pDflt->pLeft->op==TK_NULL ){ |
110461
|
0 |
0 |
if( (db->flags&SQLITE_ForeignKeys) && pNew->u.tab.pFKey && pDflt ){ |
|
0 |
0 |
if( (db->flags&SQLITE_ForeignKeys) && pNew->u.tab.pFKey && pDflt ){ |
|
0 |
0 |
if( (db->flags&SQLITE_ForeignKeys) && pNew->u.tab.pFKey && pDflt ){ |
110465
|
0 |
0 |
if( pCol->notNull && !pDflt ){ |
|
0 |
0 |
if( pCol->notNull && !pDflt ){ |
110474
|
0 |
0 |
if( pDflt ){ |
110479
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
110483
|
0 |
0 |
if( !pVal ){ |
110489
|
0 |
0 |
}else if( pCol->colFlags & COLFLAG_STORED ){ |
110496
|
0 |
0 |
if( zCol ){ |
110498
|
0 |
0 |
while( zEnd>zCol && (*zEnd==';' || sqlite3Isspace(*zEnd)) ){ |
|
0 |
0 |
while( zEnd>zCol && (*zEnd==';' || sqlite3Isspace(*zEnd)) ){ |
|
0 |
0 |
while( zEnd>zCol && (*zEnd==';' || sqlite3Isspace(*zEnd)) ){ |
110517
|
0 |
0 |
if( v ){ |
110535
|
0 |
0 |
if( pNew->pCheck!=0 |
110536
|
0 |
0 |
|| (pCol->notNull && (pCol->colFlags & COLFLAG_GENERATED)!=0) |
|
0 |
0 |
|| (pCol->notNull && (pCol->colFlags & COLFLAG_GENERATED)!=0) |
110577
|
0 |
0 |
if( db->mallocFailed ) goto exit_begin_add_column; |
110579
|
0 |
0 |
if( !pTab ) goto exit_begin_add_column; |
110582
|
0 |
0 |
if( IsVirtual(pTab) ){ |
110589
|
0 |
0 |
if( IsView(pTab) ){ |
110593
|
0 |
0 |
if( SQLITE_OK!=isAlterableTable(pParse, pTab) ){ |
110610
|
0 |
0 |
if( !pNew ) goto exit_begin_add_column; |
110619
|
0 |
0 |
if( !pNew->aCol || !pNew->zName ){ |
|
0 |
0 |
if( !pNew->aCol || !pNew->zName ){ |
110624
|
0 |
0 |
for(i=0; inCol; i++){ |
110652
|
0 |
0 |
if( IsView(pTab) ){ |
110657
|
0 |
0 |
if( IsVirtual(pTab) ){ |
110661
|
0 |
0 |
if( zType ){ |
110662
|
0 |
0 |
sqlite3ErrorMsg(pParse, "cannot %s %s \"%s\"", |
110696
|
0 |
0 |
if( !pTab ) goto exit_rename_column; |
110699
|
0 |
0 |
if( SQLITE_OK!=isAlterableTable(pParse, pTab) ) goto exit_rename_column; |
110700
|
0 |
0 |
if( SQLITE_OK!=isRealTable(pParse, pTab, 0) ) goto exit_rename_column; |
110709
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){ |
110717
|
0 |
0 |
if( !zOld ) goto exit_rename_column; |
110718
|
0 |
0 |
for(iCol=0; iColnCol; iCol++){ |
110719
|
0 |
0 |
if( 0==sqlite3StrICmp(pTab->aCol[iCol].zCnName, zOld) ) break; |
110721
|
0 |
0 |
if( iCol==pTab->nCol ){ |
110736
|
0 |
0 |
if( !zNew ) goto exit_rename_column; |
110865
|
0 |
0 |
if( ALWAYS(pParse->eParseMode!=PARSE_MODE_UNMAP) ){ |
110867
|
0 |
0 |
if( pNew ){ |
110886
|
0 |
0 |
for(p=pParse->pRename; p; p=p->pNext){ |
110887
|
0 |
0 |
if( p->p==pFrom ){ |
110900
|
0 |
0 |
if( ExprUseYTab(pExpr) ){ |
110912
|
0 |
0 |
if( pWith ){ |
110917
|
0 |
0 |
if( (pWith->a[0].pSelect->selFlags & SF_Expanded)==0 ){ |
110926
|
0 |
0 |
for(i=0; inCte; i++){ |
110931
|
0 |
0 |
if( pCopy ) sqlite3SelectPrep(sNC.pParse, p, &sNC); |
110932
|
0 |
0 |
if( sNC.pParse->db->mallocFailed ) return; |
110936
|
0 |
0 |
if( pCopy && pParse->pWith==pCopy ){ |
|
0 |
0 |
if( pCopy && pParse->pWith==pCopy ){ |
110951
|
0 |
0 |
for(ii=0; iinId; ii++){ |
110962
|
0 |
0 |
if( pParse->nErr ) return WRC_Abort; |
110965
|
0 |
0 |
if( p->selFlags & (SF_View|SF_CopyCte) ){ |
110968
|
0 |
0 |
if( ALWAYS(p->pEList) ){ |
110970
|
0 |
0 |
for(i=0; inExpr; i++){ |
110971
|
0 |
0 |
if( pList->a[i].zEName && pList->a[i].fg.eEName==ENAME_NAME ){ |
|
0 |
0 |
if( pList->a[i].zEName && pList->a[i].fg.eEName==ENAME_NAME ){ |
110976
|
0 |
0 |
if( ALWAYS(p->pSrc) ){ /* Every Select as a SrcList, even if it is empty */ |
110978
|
0 |
0 |
for(i=0; inSrc; i++){ |
110980
|
0 |
0 |
if( pSrc->a[i].fg.isUsing==0 ){ |
111012
|
0 |
0 |
if( pEList ){ |
111019
|
0 |
0 |
for(i=0; inExpr; i++){ |
111020
|
0 |
0 |
if( ALWAYS(pEList->a[i].fg.eEName==ENAME_NAME) ){ |
111033
|
0 |
0 |
for(p=pToken; p; p=pNext){ |
111054
|
0 |
0 |
if( NEVER(pPtr==0) ){ |
111057
|
0 |
0 |
for(pp=&pParse->pRename; (*pp); pp=&(*pp)->pNext){ |
111058
|
0 |
0 |
if( (*pp)->p==pPtr ){ |
111060
|
0 |
0 |
if( pCtx ){ |
111078
|
0 |
0 |
if( p->selFlags & (SF_View|SF_CopyCte) ){ |
111098
|
0 |
0 |
if( pExpr->op==TK_TRIGGER |
111099
|
0 |
0 |
&& pExpr->iColumn==p->iCol |
111100
|
0 |
0 |
&& pWalker->pParse->pTriggerTab==p->pTab |
111103
|
0 |
0 |
}else if( pExpr->op==TK_COLUMN |
111104
|
0 |
0 |
&& pExpr->iColumn==p->iCol |
111105
|
0 |
0 |
&& ALWAYS(ExprUseYTab(pExpr)) |
111106
|
0 |
0 |
&& p->pTab==pExpr->y.pTab |
111127
|
0 |
0 |
for(pToken=pBest->pNext; pToken; pToken=pToken->pNext){ |
111128
|
0 |
0 |
if( pToken->t.z>pBest->t.z ) pBest = pToken; |
111130
|
0 |
0 |
for(pp=&pCtx->pList; *pp!=pBest; pp=&(*pp)->pNext); |
111154
|
0 |
0 |
zErr = sqlite3MPrintf(pParse->db, "error in %s %s%s%s: %s", |
111174
|
0 |
0 |
if( pEList ){ |
111176
|
0 |
0 |
for(i=0; inExpr; i++){ |
111178
|
0 |
0 |
if( ALWAYS(pEList->a[i].fg.eEName==ENAME_NAME) |
111179
|
0 |
0 |
&& ALWAYS(zName!=0) |
111180
|
0 |
0 |
&& 0==sqlite3_stricmp(zName, zOld) |
111199
|
0 |
0 |
if( pIdList ){ |
111201
|
0 |
0 |
for(i=0; inId; i++){ |
111203
|
0 |
0 |
if( 0==sqlite3_stricmp(zName, zOld) ){ |
111225
|
0 |
0 |
if( zSql==0 ){ |
111228
|
0 |
0 |
if( sqlite3StrNICmp(zSql,"CREATE ",7)!=0 ){ |
111231
|
0 |
0 |
db->init.iDb = bTemp ? 1 : sqlite3FindDbName(db, zDb); |
111236
|
0 |
0 |
if( db->mallocFailed ) rc = SQLITE_NOMEM; |
111237
|
0 |
0 |
if( rc==SQLITE_OK |
111238
|
0 |
0 |
&& NEVER(p->pNewTable==0 && p->pNewIndex==0 && p->pNewTrigger==0) |
|
0 |
0 |
&& NEVER(p->pNewTable==0 && p->pNewIndex==0 && p->pNewTrigger==0) |
|
0 |
0 |
&& NEVER(p->pNewTable==0 && p->pNewIndex==0 && p->pNewTrigger==0) |
111285
|
0 |
0 |
if( zNew ){ |
111292
|
0 |
0 |
if( zQuot==0 ){ |
111302
|
0 |
0 |
if( zOut ){ |
111312
|
0 |
0 |
if( zOut ){ |
111315
|
0 |
0 |
while( pRename->pList ){ |
111321
|
0 |
0 |
if( zNew ){ |
111322
|
0 |
0 |
if( bQuote==0 && sqlite3IsIdChar(*pBest->t.z) ){ |
|
0 |
0 |
if( bQuote==0 && sqlite3IsIdChar(*pBest->t.z) ){ |
111328
|
0 |
0 |
if( pBest->t.z[pBest->t.n]=='"' ) nReplace++; |
111340
|
0 |
0 |
sqlite3_snprintf(nSql*2, zBuf2, "%Q%s", zBuf1, |
111348
|
0 |
0 |
if( pBest->t.n!=nReplace ){ |
111391
|
0 |
0 |
if( ALWAYS(pParse->pTriggerTab) ){ |
111396
|
0 |
0 |
if( rc==SQLITE_OK && pNew->pWhen ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pNew->pWhen ){ |
111400
|
0 |
0 |
for(pStep=pNew->step_list; rc==SQLITE_OK && pStep; pStep=pStep->pNext){ |
|
0 |
0 |
for(pStep=pNew->step_list; rc==SQLITE_OK && pStep; pStep=pStep->pNext){ |
111401
|
0 |
0 |
if( pStep->pSelect ){ |
111403
|
0 |
0 |
if( pParse->nErr ) rc = pParse->rc; |
111405
|
0 |
0 |
if( rc==SQLITE_OK && pStep->zTarget ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pStep->zTarget ){ |
111407
|
0 |
0 |
if( pSrc ){ |
111411
|
0 |
0 |
if( pSel==0 ){ |
111420
|
0 |
0 |
if( pStep->pExprList ) pSel->pEList = 0; |
111424
|
0 |
0 |
if( pStep->pFrom ){ |
111426
|
0 |
0 |
for(i=0; ipFrom->nSrc && rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; ipFrom->nSrc && rc==SQLITE_OK; i++){ |
111428
|
0 |
0 |
if( p->pSelect ){ |
111434
|
0 |
0 |
if( db->mallocFailed ){ |
111438
|
0 |
0 |
if( rc==SQLITE_OK && pStep->pWhere ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pStep->pWhere ){ |
111441
|
0 |
0 |
if( rc==SQLITE_OK ){ |
111445
|
0 |
0 |
if( pStep->pUpsert && rc==SQLITE_OK ){ |
|
0 |
0 |
if( pStep->pUpsert && rc==SQLITE_OK ){ |
111451
|
0 |
0 |
if( rc==SQLITE_OK ){ |
111455
|
0 |
0 |
if( rc==SQLITE_OK ){ |
111458
|
0 |
0 |
if( rc==SQLITE_OK ){ |
111484
|
0 |
0 |
for(pStep=pTrigger->step_list; pStep; pStep=pStep->pNext){ |
111488
|
0 |
0 |
if( pStep->pUpsert ){ |
111495
|
0 |
0 |
if( pStep->pFrom ){ |
111497
|
0 |
0 |
for(i=0; ipFrom->nSrc; i++){ |
111511
|
0 |
0 |
if( pParse->pVdbe ){ |
111515
|
0 |
0 |
while( (pIdx = pParse->pNewIndex)!=0 ){ |
111575
|
0 |
0 |
if( zSql==0 ) return; |
111576
|
0 |
0 |
if( zTable==0 ) return; |
111577
|
0 |
0 |
if( zNew==0 ) return; |
111578
|
0 |
0 |
if( iCol<0 ) return; |
111581
|
0 |
0 |
if( pTab==0 || iCol>=pTab->nCol ){ |
|
0 |
0 |
if( pTab==0 || iCol>=pTab->nCol ){ |
111587
|
0 |
0 |
sCtx.iCol = ((iCol==pTab->iPKey) ? -1 : iCol); |
111602
|
0 |
0 |
if( rc!=SQLITE_OK ) goto renameColumnFunc_done; |
111603
|
0 |
0 |
if( sParse.pNewTable ){ |
111604
|
0 |
0 |
if( IsView(sParse.pNewTable) ){ |
111609
|
0 |
0 |
rc = (db->mallocFailed ? SQLITE_NOMEM : sParse.rc); |
111610
|
0 |
0 |
if( rc==SQLITE_OK ){ |
111613
|
0 |
0 |
if( rc!=SQLITE_OK ) goto renameColumnFunc_done; |
111614
|
0 |
0 |
}else if( IsOrdinaryTable(sParse.pNewTable) ){ |
111619
|
0 |
0 |
if( bFKOnly==0 ){ |
111620
|
0 |
0 |
if( iColnCol ){ |
111625
|
0 |
0 |
if( sCtx.iCol<0 ){ |
111629
|
0 |
0 |
for(pIdx=sParse.pNewTable->pIndex; pIdx; pIdx=pIdx->pNext){ |
111632
|
0 |
0 |
for(pIdx=sParse.pNewIndex; pIdx; pIdx=pIdx->pNext){ |
111636
|
0 |
0 |
for(i=0; inCol; i++){ |
111645
|
0 |
0 |
for(pFKey=sParse.pNewTable->u.tab.pFKey; pFKey; pFKey=pFKey->pNextFrom){ |
111646
|
0 |
0 |
for(i=0; inCol; i++){ |
111647
|
0 |
0 |
if( bFKOnly==0 && pFKey->aCol[i].iFrom==iCol ){ |
|
0 |
0 |
if( bFKOnly==0 && pFKey->aCol[i].iFrom==iCol ){ |
111650
|
0 |
0 |
if( 0==sqlite3_stricmp(pFKey->zTo, zTable) |
111651
|
0 |
0 |
&& 0==sqlite3_stricmp(pFKey->aCol[i].zCol, zOld) |
111658
|
0 |
0 |
}else if( sParse.pNewIndex ){ |
111665
|
0 |
0 |
if( rc!=SQLITE_OK ) goto renameColumnFunc_done; |
111667
|
0 |
0 |
for(pStep=sParse.pNewTrigger->step_list; pStep; pStep=pStep->pNext){ |
111668
|
0 |
0 |
if( pStep->zTarget ){ |
111670
|
0 |
0 |
if( pTarget==pTab ){ |
111671
|
0 |
0 |
if( pStep->pUpsert ){ |
111683
|
0 |
0 |
if( sParse.pTriggerTab==pTab ){ |
111695
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
111696
|
0 |
0 |
if( rc==SQLITE_ERROR && sqlite3WritableSchema(db) ){ |
|
0 |
0 |
if( rc==SQLITE_ERROR && sqlite3WritableSchema(db) ){ |
111698
|
0 |
0 |
}else if( sParse.zErrMsg ){ |
111718
|
0 |
0 |
if( pExpr->op==TK_COLUMN |
111719
|
0 |
0 |
&& ALWAYS(ExprUseYTab(pExpr)) |
111720
|
0 |
0 |
&& p->pTab==pExpr->y.pTab |
111734
|
0 |
0 |
if( pSelect->selFlags & (SF_View|SF_CopyCte) ){ |
111739
|
0 |
0 |
if( NEVER(pSrc==0) ){ |
111743
|
0 |
0 |
for(i=0; inSrc; i++){ |
111745
|
0 |
0 |
if( pItem->pTab==p->pTab ){ |
111787
|
0 |
0 |
if( zInput && zOld && zNew ){ |
|
0 |
0 |
if( zInput && zOld && zNew ){ |
|
0 |
0 |
if( zInput && zOld && zNew ){ |
111811
|
0 |
0 |
if( rc==SQLITE_OK ){ |
111813
|
0 |
0 |
if( sParse.pNewTable ){ |
111816
|
0 |
0 |
if( IsView(pTab) ){ |
111817
|
0 |
0 |
if( isLegacy==0 ){ |
111826
|
0 |
0 |
if( sParse.nErr ){ |
111835
|
0 |
0 |
if( (isLegacy==0 || (db->flags & SQLITE_ForeignKeys)) |
|
0 |
0 |
if( (isLegacy==0 || (db->flags & SQLITE_ForeignKeys)) |
111836
|
0 |
0 |
&& !IsVirtual(pTab) |
111840
|
0 |
0 |
for(pFKey=pTab->u.tab.pFKey; pFKey; pFKey=pFKey->pNextFrom){ |
111841
|
0 |
0 |
if( sqlite3_stricmp(pFKey->zTo, zOld)==0 ){ |
111851
|
0 |
0 |
if( sqlite3_stricmp(zOld, pTab->zName)==0 ){ |
111853
|
0 |
0 |
if( isLegacy==0 ){ |
111861
|
0 |
0 |
else if( sParse.pNewIndex ){ |
111863
|
0 |
0 |
if( isLegacy==0 ){ |
111872
|
0 |
0 |
if( 0==sqlite3_stricmp(sParse.pNewTrigger->table, zOld) |
111873
|
0 |
0 |
&& sCtx.pTab->pSchema==pTrigger->pTabSchema |
111878
|
0 |
0 |
if( isLegacy==0 ){ |
111880
|
0 |
0 |
if( rc==SQLITE_OK ){ |
111882
|
0 |
0 |
for(pStep=pTrigger->step_list; pStep; pStep=pStep->pNext){ |
111883
|
0 |
0 |
if( pStep->zTarget && 0==sqlite3_stricmp(pStep->zTarget, zOld) ){ |
|
0 |
0 |
if( pStep->zTarget && 0==sqlite3_stricmp(pStep->zTarget, zOld) ){ |
111886
|
0 |
0 |
if( pStep->pFrom ){ |
111888
|
0 |
0 |
for(i=0; ipFrom->nSrc; i++){ |
111890
|
0 |
0 |
if( 0==sqlite3_stricmp(pItem->zName, zOld) ){ |
111902
|
0 |
0 |
if( rc==SQLITE_OK ){ |
111905
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
111906
|
0 |
0 |
if( rc==SQLITE_ERROR && sqlite3WritableSchema(db) ){ |
|
0 |
0 |
if( rc==SQLITE_ERROR && sqlite3WritableSchema(db) ){ |
111908
|
0 |
0 |
}else if( sParse.zErrMsg ){ |
111927
|
0 |
0 |
if( pExpr->op==TK_STRING && (pExpr->flags & EP_DblQuoted) ){ |
|
0 |
0 |
if( pExpr->op==TK_STRING && (pExpr->flags & EP_DblQuoted) ){ |
111977
|
0 |
0 |
if( zDb && zInput ){ |
|
0 |
0 |
if( zDb && zInput ){ |
111982
|
0 |
0 |
if( rc==SQLITE_OK ){ |
111994
|
0 |
0 |
if( sParse.pNewTable ){ |
111995
|
0 |
0 |
if( IsView(sParse.pNewTable) ){ |
112000
|
0 |
0 |
rc = (db->mallocFailed ? SQLITE_NOMEM : sParse.rc); |
112001
|
0 |
0 |
if( rc==SQLITE_OK ){ |
112008
|
0 |
0 |
for(i=0; inCol; i++){ |
112015
|
0 |
0 |
}else if( sParse.pNewIndex ){ |
112021
|
0 |
0 |
if( rc==SQLITE_OK ){ |
112027
|
0 |
0 |
if( rc==SQLITE_OK ){ |
112032
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
112033
|
0 |
0 |
if( sqlite3WritableSchema(db) && rc==SQLITE_ERROR ){ |
|
0 |
0 |
if( sqlite3WritableSchema(db) && rc==SQLITE_ERROR ){ |
112093
|
0 |
0 |
if( zDb && zInput ){ |
|
0 |
0 |
if( zDb && zInput ){ |
112097
|
0 |
0 |
if( bNoDQS ) db->flags &= ~(SQLITE_DqsDML|SQLITE_DqsDDL); |
112100
|
0 |
0 |
if( rc==SQLITE_OK ){ |
112101
|
0 |
0 |
if( isLegacy==0 && sParse.pNewTable && IsView(sParse.pNewTable) ){ |
|
0 |
0 |
if( isLegacy==0 && sParse.pNewTable && IsView(sParse.pNewTable) ){ |
|
0 |
0 |
if( isLegacy==0 && sParse.pNewTable && IsView(sParse.pNewTable) ){ |
112106
|
0 |
0 |
if( sParse.nErr ) rc = sParse.rc; |
112109
|
0 |
0 |
else if( sParse.pNewTrigger ){ |
112110
|
0 |
0 |
if( isLegacy==0 ){ |
112113
|
0 |
0 |
if( rc==SQLITE_OK ){ |
112116
|
0 |
0 |
if( i1==i2 ){ |
112124
|
0 |
0 |
if( rc!=SQLITE_OK && zWhen && !sqlite3WritableSchema(db) ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && zWhen && !sqlite3WritableSchema(db) ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && zWhen && !sqlite3WritableSchema(db) ){ |
112172
|
0 |
0 |
if( rc!=SQLITE_OK ) goto drop_column_done; |
112174
|
0 |
0 |
if( pTab==0 || pTab->nCol==1 || iCol>=pTab->nCol ){ |
|
0 |
0 |
if( pTab==0 || pTab->nCol==1 || iCol>=pTab->nCol ){ |
|
0 |
0 |
if( pTab==0 || pTab->nCol==1 || iCol>=pTab->nCol ){ |
112181
|
0 |
0 |
if( iColnCol-1 ){ |
112188
|
0 |
0 |
while( ALWAYS(pCol->t.z[0]!=0) && pCol->t.z[0]!=',' ) pCol->t.z--; |
|
0 |
0 |
while( ALWAYS(pCol->t.z[0]!=0) && pCol->t.z[0]!=',' ) pCol->t.z--; |
112200
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
112224
|
0 |
0 |
if( NEVER(db->mallocFailed) ) goto exit_drop_column; |
112226
|
0 |
0 |
if( !pTab ) goto exit_drop_column; |
112230
|
0 |
0 |
if( SQLITE_OK!=isAlterableTable(pParse, pTab) ) goto exit_drop_column; |
112231
|
0 |
0 |
if( SQLITE_OK!=isRealTable(pParse, pTab, 1) ) goto exit_drop_column; |
112235
|
0 |
0 |
if( zCol==0 ){ |
112240
|
0 |
0 |
if( iCol<0 ){ |
112247
|
0 |
0 |
if( pTab->aCol[iCol].colFlags & (COLFLAG_PRIMKEY|COLFLAG_UNIQUE) ){ |
112248
|
0 |
0 |
sqlite3ErrorMsg(pParse, "cannot drop %s column: \"%s\"", |
112256
|
0 |
0 |
if( pTab->nCol<=1 ){ |
112267
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, zCol) ){ |
112285
|
0 |
0 |
if( pParse->nErr==0 && (pTab->aCol[iCol].colFlags & COLFLAG_VIRTUAL)==0 ){ |
|
0 |
0 |
if( pParse->nErr==0 && (pTab->aCol[iCol].colFlags & COLFLAG_VIRTUAL)==0 ){ |
112298
|
0 |
0 |
if( HasRowid(pTab) ){ |
112304
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
112310
|
0 |
0 |
for(i=0; inCol; i++){ |
112311
|
0 |
0 |
if( i!=iCol && (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 ){ |
|
0 |
0 |
if( i!=iCol && (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 ){ |
112313
|
0 |
0 |
if( pPk ){ |
112316
|
0 |
0 |
if( iPosnKeyCol ) continue; |
112321
|
0 |
0 |
if( i==pTab->iPKey ){ |
112329
|
0 |
0 |
if( nField==0 ){ |
112336
|
0 |
0 |
if( pPk ){ |
112565
|
0 |
1 |
if( v==0 ) return; |
112573
|
3 |
1 |
for(i=0; i
|
112577
|
3 |
0 |
if( (pStat = sqlite3FindTable(db, zTab, pDb->zDbSName))==0 ){ |
112578
|
1 |
2 |
if( i
|
112595
|
0 |
0 |
if( zWhere ){ |
112612
|
1 |
1 |
for(i=0; i
|
112805
|
0 |
0 |
if( p==0 ){ |
113085
|
0 |
0 |
if( p->nRow==0 ){ |
113087
|
0 |
0 |
for(i=0; inCol; i++) p->current.anEq[i] = 1; |
113096
|
0 |
0 |
for(i=0; i
|
113099
|
0 |
0 |
for(i=iChng; inCol; i++){ |
113138
|
0 |
0 |
if( p->nLimit && p->nRow>(tRowcnt)p->nLimit*(p->nSkipAhead+1) ){ |
|
0 |
0 |
if( p->nLimit && p->nRow>(tRowcnt)p->nLimit*(p->nSkipAhead+1) ){ |
113231
|
0 |
0 |
sqlite3_str_appendf(&sStat, "%llu", |
113233
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
113236
|
0 |
0 |
if( iVal==2 && p->nRow*10 <= nDistinct*11 ) iVal = 1; |
|
0 |
0 |
if( iVal==2 && p->nRow*10 <= nDistinct*11 ) iVal = 1; |
113370
|
2 |
0 |
if( v==0 || NEVER(pTab==0) ){ |
|
0 |
2 |
if( v==0 || NEVER(pTab==0) ){ |
113373
|
0 |
2 |
if( !IsOrdinaryTable(pTab) ){ |
113377
|
1 |
1 |
if( sqlite3_strlike("sqlite\\_%", pTab->zName, '\\')==0 ){ |
113386
|
0 |
1 |
if( sqlite3AuthCheck(pParse, SQLITE_ANALYZE, pTab->zName, 0, |
113415
|
0 |
1 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
113422
|
0 |
0 |
if( pOnlyIdx && pOnlyIdx!=pIdx ) continue; |
|
0 |
0 |
if( pOnlyIdx && pOnlyIdx!=pIdx ) continue; |
113423
|
0 |
0 |
if( pIdx->pPartIdxWhere==0 ) needTableCnt = 0; |
113424
|
0 |
0 |
if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIdx) ){ |
|
0 |
0 |
if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIdx) ){ |
113431
|
0 |
0 |
nColTest = pIdx->uniqNotNull ? pIdx->nKeyCol-1 : nCol-1; |
113520
|
0 |
0 |
if( nColTest>0 ){ |
113524
|
0 |
0 |
if( aGotoChng==0 ) continue; |
113538
|
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) ){ |
113545
|
0 |
0 |
for(i=0; i
|
113567
|
0 |
0 |
for(i=0; i
|
113607
|
0 |
0 |
if( db->nAnalysisLimit ){ |
113677
|
1 |
0 |
if( pOnlyIdx==0 && needTableCnt ){ |
|
1 |
0 |
if( pOnlyIdx==0 && needTableCnt ){ |
113701
|
1 |
0 |
if( v ){ |
113724
|
2 |
1 |
for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){ |
113746
|
0 |
0 |
if( pOnlyIdx ){ |
113780
|
0 |
1 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ |
113785
|
1 |
0 |
if( pName1==0 ){ |
113787
|
2 |
1 |
for(i=0; inDb; i++){ |
113788
|
1 |
1 |
if( i==1 ) continue; /* Do not analyze the TEMP database */ |
113791
|
0 |
0 |
}else if( pName2->n==0 && (iDb = sqlite3FindDb(db, pName1))>=0 ){ |
|
0 |
0 |
}else if( pName2->n==0 && (iDb = sqlite3FindDb(db, pName1))>=0 ){ |
113797
|
0 |
0 |
if( iDb>=0 ){ |
113798
|
0 |
0 |
zDb = pName2->n ? db->aDb[iDb].zDbSName : 0; |
113800
|
0 |
0 |
if( z ){ |
113801
|
0 |
0 |
if( (pIdx = sqlite3FindIndex(db, z, zDb))!=0 ){ |
113803
|
0 |
0 |
}else if( (pTab = sqlite3LocateTable(pParse, 0, z, zDb))!=0 ){ |
113810
|
1 |
0 |
if( db->nSqlExec==0 && (v = sqlite3GetVdbe(pParse))!=0 ){ |
|
1 |
0 |
if( db->nSqlExec==0 && (v = sqlite3GetVdbe(pParse))!=0 ){ |
113847
|
0 |
0 |
for(i=0; *z && i
|
|
0 |
0 |
for(i=0; *z && i
|
113849
|
0 |
0 |
while( (c=z[0])>='0' && c<='9' ){ |
|
0 |
0 |
while( (c=z[0])>='0' && c<='9' ){ |
113862
|
0 |
0 |
if( *z==' ' ) z++; |
113871
|
0 |
0 |
while( z[0] ){ |
113872
|
0 |
0 |
if( sqlite3_strglob("unordered*", z)==0 ){ |
113874
|
0 |
0 |
}else if( sqlite3_strglob("sz=[0-9]*", z)==0 ){ |
113876
|
0 |
0 |
if( sz<2 ) sz = 2; |
113878
|
0 |
0 |
}else if( sqlite3_strglob("noskipscan*", z)==0 ){ |
113886
|
0 |
0 |
while( z[0]!=0 && z[0]!=' ' ) z++; |
|
0 |
0 |
while( z[0]!=0 && z[0]!=' ' ) z++; |
113887
|
0 |
0 |
while( z[0]==' ' ) z++; |
113912
|
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 ){ |
113916
|
0 |
0 |
if( pTable==0 ){ |
113919
|
0 |
0 |
if( argv[1]==0 ){ |
113921
|
0 |
0 |
}else if( sqlite3_stricmp(argv[0],argv[1])==0 ){ |
113928
|
0 |
0 |
if( pIndex ){ |
113944
|
0 |
0 |
if( pIndex->pPartIdxWhere==0 ){ |
114247
|
270 |
222 |
for(i=sqliteHashFirst(&pSchema->tblHash); i; i=sqliteHashNext(i)){ |
114251
|
1 |
222 |
for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){ |
114263
|
1 |
221 |
if( (pStat1 = sqlite3FindTable(db, "sqlite_stat1", sInfo.zDatabase)) |
114264
|
1 |
0 |
&& IsOrdinaryTable(pStat1) |
114268
|
0 |
1 |
if( zSql==0 ){ |
114278
|
1 |
222 |
for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){ |
114280
|
1 |
0 |
if( !pIdx->hasStat1 ) sqlite3DefaultRowEst(pIdx); |
114297
|
0 |
222 |
if( rc==SQLITE_NOMEM ){ |
114345
|
10 |
5 |
if( pExpr ){ |
114346
|
3 |
7 |
if( pExpr->op!=TK_ID ){ |
114362
|
1124 |
1079 |
|| (iDb==0 && sqlite3StrICmp("main", zName)==0) |
|
315 |
809 |
|| (iDb==0 && sqlite3StrICmp("main", zName)==0) |
|
0 |
315 |
|| (iDb==0 && sqlite3StrICmp("main", zName)==0) |
114402
|
0 |
5 |
if( zFile==0 ) zFile = ""; |
114403
|
0 |
5 |
if( zName==0 ) zName = ""; |
114411
|
0 |
5 |
if( REOPEN_AS_MEMDB(db) ){ |
114416
|
0 |
0 |
if( pVfs==0 ) return; |
114418
|
0 |
0 |
if( pNew->pBt ) sqlite3BtreeClose(pNew->pBt); |
114431
|
0 |
5 |
if( db->nDb>=db->aLimit[SQLITE_LIMIT_ATTACHED]+2 ){ |
114437
|
10 |
5 |
for(i=0; inDb; i++){ |
114439
|
0 |
10 |
if( sqlite3DbIsNamed(db, i, zName) ){ |
114448
|
5 |
0 |
if( db->aDb==db->aDbStatic ){ |
114450
|
0 |
5 |
if( aNew==0 ) return; |
114454
|
0 |
0 |
if( aNew==0 ) return; |
114466
|
0 |
5 |
if( rc!=SQLITE_OK ){ |
114467
|
0 |
0 |
if( rc==SQLITE_NOMEM ) sqlite3OomFault(db); |
114479
|
0 |
5 |
if( rc==SQLITE_CONSTRAINT ){ |
114482
|
5 |
0 |
}else if( rc==SQLITE_OK ){ |
114485
|
0 |
5 |
if( !pNew->pSchema ){ |
114487
|
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) ){ |
114504
|
5 |
0 |
if( rc==SQLITE_OK && pNew->zDbSName==0 ){ |
|
0 |
5 |
if( rc==SQLITE_OK && pNew->zDbSName==0 ){ |
114514
|
5 |
0 |
if( rc==SQLITE_OK ){ |
114518
|
5 |
0 |
if( !REOPEN_AS_MEMDB(db) ){ |
114533
|
0 |
5 |
if( rc ){ |
114534
|
0 |
0 |
if( !REOPEN_AS_MEMDB(db) ){ |
114537
|
0 |
0 |
if( db->aDb[iDb].pBt ){ |
114544
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){ |
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){ |
114548
|
0 |
0 |
}else if( zErrDyn==0 ){ |
114559
|
0 |
0 |
if( zErrDyn ){ |
114563
|
0 |
0 |
if( rc ) sqlite3_result_error_code(context, rc); |
114588
|
0 |
0 |
if( zName==0 ) zName = ""; |
114589
|
0 |
0 |
for(i=0; inDb; i++){ |
114591
|
0 |
0 |
if( pDb->pBt==0 ) continue; |
114592
|
0 |
0 |
if( sqlite3DbIsNamed(db, i, zName) ) break; |
114595
|
0 |
0 |
if( i>=db->nDb ){ |
114599
|
0 |
0 |
if( i<2 ){ |
114603
|
0 |
0 |
if( sqlite3BtreeTxnState(pDb->pBt)!=SQLITE_TXN_NONE |
114604
|
0 |
0 |
|| sqlite3BtreeIsInBackup(pDb->pBt) |
114614
|
0 |
0 |
while( pEntry ){ |
114616
|
0 |
0 |
if( pTrig->pTabSchema==pDb->pSchema ){ |
114651
|
0 |
5 |
if( pParse->nErr ) goto attach_end; |
114655
|
5 |
0 |
if( |
114656
|
5 |
0 |
SQLITE_OK!=resolveAttachExpr(&sName, pFilename) || |
114657
|
5 |
0 |
SQLITE_OK!=resolveAttachExpr(&sName, pDbname) || |
114664
|
5 |
0 |
if( ALWAYS(pAuthArg) ){ |
114666
|
5 |
0 |
if( pAuthArg->op==TK_STRING ){ |
114673
|
0 |
5 |
if(rc!=SQLITE_OK ){ |
114687
|
5 |
0 |
if( v ){ |
114749
|
0 |
0 |
if( !pFix->bTemp ) ExprSetProperty(pExpr, EP_FromDDL); |
114750
|
0 |
0 |
if( pExpr->op==TK_VARIABLE ){ |
114751
|
0 |
0 |
if( pFix->pParse->db->init.busy ){ |
114772
|
0 |
10 |
if( NEVER(pList==0) ) return WRC_Continue; |
114773
|
10 |
10 |
for(i=0, pItem=pList->a; inSrc; i++, pItem++){ |
114774
|
10 |
0 |
if( pFix->bTemp==0 ){ |
114775
|
0 |
10 |
if( pItem->zDatabase ){ |
114776
|
0 |
0 |
if( iDb!=sqlite3FindDbName(db, pItem->zDatabase) ){ |
114790
|
10 |
0 |
if( pList->a[i].fg.isUsing==0 |
114791
|
0 |
10 |
&& sqlite3WalkExpr(&pFix->w, pList->a[i].u3.pOn) |
114797
|
0 |
10 |
if( pSelect->pWith ){ |
114798
|
0 |
0 |
for(i=0; ipWith->nCte; i++){ |
114799
|
0 |
0 |
if( sqlite3WalkSelect(p, pSelect->pWith->a[i].pSelect) ){ |
114854
|
10 |
0 |
if( pList ){ |
114882
|
0 |
0 |
while( pStep ){ |
114883
|
0 |
0 |
if( sqlite3WalkSelect(&pFix->w, pStep->pSelect) |
114884
|
0 |
0 |
|| sqlite3WalkExpr(&pFix->w, pStep->pWhere) |
114885
|
0 |
0 |
|| sqlite3WalkExprList(&pFix->w, pStep->pExprList) |
114886
|
0 |
0 |
|| sqlite3FixSrcList(pFix, pStep->pFrom) |
114893
|
0 |
0 |
for(pUp=pStep->pUpsert; pUp; pUp=pUp->pNextUpsert){ |
114894
|
0 |
0 |
if( sqlite3WalkExprList(&pFix->w, pUp->pUpsertTarget) |
114895
|
0 |
0 |
|| sqlite3WalkExpr(&pFix->w, pUp->pUpsertTargetWhere) |
114896
|
0 |
0 |
|| sqlite3WalkExprList(&pFix->w, pUp->pUpsertSet) |
114897
|
0 |
0 |
|| sqlite3WalkExpr(&pFix->w, pUp->pUpsertWhere) |
114993
|
2 |
2 |
if( db->xAuth ) sqlite3ExpirePreparedStatements(db, 1); |
115026
|
0 |
0 |
if( db->init.busy ) return SQLITE_OK; |
115032
|
0 |
0 |
if( rc==SQLITE_DENY ){ |
115034
|
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); |
115037
|
0 |
0 |
}else if( rc!=SQLITE_IGNORE && rc!=SQLITE_OK ){ |
|
0 |
0 |
}else if( rc!=SQLITE_IGNORE && rc!=SQLITE_OK ){ |
115068
|
0 |
0 |
if( iDb<0 ){ |
115074
|
0 |
0 |
if( pExpr->op==TK_TRIGGER ){ |
115078
|
0 |
0 |
for(iSrc=0; iSrcnSrc; iSrc++){ |
115079
|
0 |
0 |
if( pExpr->iTable==pTabList->a[iSrc].iCursor ){ |
115086
|
0 |
0 |
if( pTab==0 ) return; |
115088
|
0 |
0 |
if( iCol>=0 ){ |
115091
|
0 |
0 |
}else if( pTab->iPKey>=0 ){ |
115098
|
0 |
0 |
if( SQLITE_IGNORE==sqlite3AuthReadCol(pParse, pTab->zName, zCol, iDb) ){ |
115123
|
4 |
9969 |
if( db->xAuth==0 || db->init.busy || IN_SPECIAL_PARSE ){ |
|
4 |
0 |
if( db->xAuth==0 || db->init.busy || IN_SPECIAL_PARSE ){ |
|
0 |
4 |
if( db->xAuth==0 || db->init.busy || IN_SPECIAL_PARSE ){ |
115143
|
2 |
2 |
if( rc==SQLITE_DENY ){ |
115146
|
0 |
2 |
}else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){ |
|
0 |
0 |
}else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){ |
115174
|
0 |
377 |
if( pContext->pParse ){ |
115245
|
0 |
0 |
pToplevel = sqlite3ParseToplevel(pParse); |
115246
|
0 |
0 |
for(i=0; inTableLock; i++){ |
115248
|
0 |
0 |
if( p->iDb==iDb && p->iTab==iTab ){ |
|
0 |
0 |
if( p->iDb==iDb && p->iTab==iTab ){ |
115249
|
0 |
0 |
p->isWriteLock = (p->isWriteLock || isWriteLock); |
|
0 |
0 |
p->isWriteLock = (p->isWriteLock || isWriteLock); |
115257
|
0 |
0 |
if( pToplevel->aTableLock ){ |
115275
|
2529 |
2450 |
if( iDb==1 ) return; |
115276
|
2450 |
0 |
if( !sqlite3BtreeSharable(pParse->db->aDb[iDb].pBt) ) return; |
115289
|
0 |
4863 |
for(i=0; inTableLock; i++){ |
115330
|
351 |
6118 |
if( pParse->nested ) return; |
115331
|
21 |
6097 |
if( pParse->nErr ){ |
115332
|
0 |
21 |
if( db->mallocFailed ) pParse->rc = SQLITE_NOMEM; |
115341
|
749 |
5348 |
if( v==0 ){ |
115342
|
749 |
0 |
if( db->init.busy ){ |
115347
|
0 |
0 |
if( v==0 ) pParse->rc = SQLITE_ERROR; |
115351
|
5348 |
0 |
if( v ){ |
115352
|
0 |
5348 |
if( pParse->bReturning ){ |
115358
|
0 |
0 |
if( pReturning->nRetCol ){ |
115364
|
0 |
0 |
for(i=0; inRetCol; i++){ |
115392
|
5348 |
0 |
if( db->mallocFailed==0 |
115393
|
864 |
4484 |
&& (DbMaskNonZero(pParse->cookieMask) || pParse->pConstExpr) |
|
379 |
485 |
&& (DbMaskNonZero(pParse->cookieMask) || pParse->pConstExpr) |
115402
|
5306 |
4527 |
if( DbMaskTest(pParse->cookieMask, iDb)==0 ) continue; |
115412
|
4040 |
487 |
if( db->init.busy==0 ) sqlite3VdbeChangeP5(v, 1); |
115415
|
4970 |
4863 |
}while( ++iDbnDb ); |
115417
|
22 |
4863 |
for(i=0; inVtabLock; i++){ |
115441
|
932 |
3931 |
if( pParse->pConstExpr ){ |
115444
|
1630 |
932 |
for(i=0; inExpr; i++){ |
115446
|
1630 |
0 |
if( iReg>0 ){ |
115452
|
0 |
4863 |
if( pParse->bReturning ){ |
115454
|
0 |
0 |
if( pRet->nRetCol ){ |
115468
|
5348 |
0 |
if( pParse->nErr==0 ){ |
115499
|
2 |
351 |
if( pParse->nErr ) return; |
115504
|
0 |
351 |
if( zSql==0 ){ |
115508
|
0 |
0 |
if( !db->mallocFailed ) pParse->rc = SQLITE_TOOBIG; |
115558
|
2410 |
4181 |
if( zDatabase ){ |
115559
|
2950 |
0 |
for(i=0; inDb; i++){ |
115560
|
2410 |
540 |
if( sqlite3StrICmp(zDatabase, db->aDb[i].zDbSName)==0 ) break; |
115562
|
0 |
2410 |
if( i>=db->nDb ){ |
115565
|
0 |
0 |
if( sqlite3StrICmp(zDatabase,"main")==0 ){ |
115572
|
1340 |
1070 |
if( p==0 && sqlite3StrNICmp(zName, "sqlite_", 7)==0 ){ |
|
767 |
573 |
if( p==0 && sqlite3StrNICmp(zName, "sqlite_", 7)==0 ){ |
115573
|
279 |
488 |
if( i==1 ){ |
115574
|
279 |
0 |
if( sqlite3StrICmp(zName+7, &PREFERRED_TEMP_SCHEMA_TABLE[7])==0 |
115575
|
279 |
0 |
|| sqlite3StrICmp(zName+7, &PREFERRED_SCHEMA_TABLE[7])==0 |
115576
|
63 |
216 |
|| sqlite3StrICmp(zName+7, &LEGACY_SCHEMA_TABLE[7])==0 |
115582
|
0 |
488 |
if( sqlite3StrICmp(zName+7, &PREFERRED_SCHEMA_TABLE[7])==0 ){ |
115591
|
2411 |
1770 |
if( p ) return p; |
115594
|
1203 |
567 |
if( p ) return p; |
115596
|
5 |
567 |
for(i=2; inDb; i++){ |
115599
|
0 |
5 |
if( p ) break; |
115601
|
567 |
0 |
if( p==0 && sqlite3StrNICmp(zName, "sqlite_", 7)==0 ){ |
|
216 |
351 |
if( p==0 && sqlite3StrNICmp(zName, "sqlite_", 7)==0 ){ |
115602
|
0 |
216 |
if( sqlite3StrICmp(zName+7, &PREFERRED_SCHEMA_TABLE[7])==0 ){ |
115604
|
0 |
216 |
}else if( sqlite3StrICmp(zName+7, &PREFERRED_TEMP_SCHEMA_TABLE[7])==0 ){ |
115634
|
266 |
4369 |
if( (db->mDbFlags & DBFLAG_SchemaKnownOk)==0 |
115635
|
0 |
266 |
&& SQLITE_OK!=sqlite3ReadSchema(pParse) |
115641
|
22 |
4613 |
if( p==0 ){ |
115646
|
22 |
0 |
if( pParse->disableVtab==0 && db->init.busy==0 ){ |
|
22 |
0 |
if( pParse->disableVtab==0 && db->init.busy==0 ){ |
115648
|
22 |
0 |
if( pMod==0 && sqlite3_strnicmp(zName, "pragma_", 7)==0 ){ |
|
0 |
22 |
if( pMod==0 && sqlite3_strnicmp(zName, "pragma_", 7)==0 ){ |
115651
|
0 |
22 |
if( pMod && sqlite3VtabEponymousTableInit(pParse, pMod) ){ |
|
0 |
0 |
if( pMod && sqlite3VtabEponymousTableInit(pParse, pMod) ){ |
115657
|
14 |
8 |
if( flags & LOCATE_NOERR ) return 0; |
115659
|
185 |
4428 |
}else if( IsVirtual(p) && pParse->disableVtab ){ |
|
0 |
185 |
}else if( IsVirtual(p) && pParse->disableVtab ){ |
115663
|
8 |
4613 |
if( p==0 ){ |
115664
|
0 |
8 |
const char *zMsg = flags & LOCATE_VIEW ? "no such view" : "no such table"; |
115665
|
0 |
8 |
if( zDbase ){ |
115693
|
10 |
4498 |
if( p->pSchema ){ |
115707
|
0 |
0 |
if( sqlite3StrNICmp(zName, "sqlite_", 7)==0 ){ |
115708
|
0 |
0 |
if( sqlite3StrICmp(zName+7, &LEGACY_SCHEMA_TABLE[7])==0 ){ |
115711
|
0 |
0 |
if( sqlite3StrICmp(zName+7, &LEGACY_TEMP_SCHEMA_TABLE[7])==0 ){ |
115735
|
2193 |
1032 |
for(i=OMIT_TEMPDB; inDb; i++){ |
115736
|
2157 |
36 |
int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ |
115739
|
2193 |
0 |
if( zDb && sqlite3DbIsNamed(db, j, zDb)==0 ) continue; |
|
1114 |
1079 |
if( zDb && sqlite3DbIsNamed(db, j, zDb)==0 ) continue; |
115742
|
47 |
1032 |
if( p ) break; |
115757
|
0 |
79 |
if( p->isResized ) sqlite3DbFree(db, (void *)p->azColl); |
115777
|
0 |
0 |
if( ALWAYS(pIndex) ){ |
115778
|
0 |
0 |
if( pIndex->pTable->pIndex==pIndex ){ |
115785
|
0 |
0 |
while( ALWAYS(p) && p->pNext!=pIndex ){ p = p->pNext; } |
|
0 |
0 |
while( ALWAYS(p) && p->pNext!=pIndex ){ p = p->pNext; } |
115786
|
0 |
0 |
if( ALWAYS(p && p->pNext==pIndex) ){ |
|
0 |
0 |
if( ALWAYS(p && p->pNext==pIndex) ){ |
115805
|
5 |
329 |
for(i=j=2; inDb; i++){ |
115807
|
5 |
0 |
if( pDb->pBt==0 ){ |
115812
|
0 |
0 |
if( j
|
115818
|
329 |
0 |
if( db->nDb<=2 && db->aDb!=db->aDbStatic ){ |
|
5 |
324 |
if( db->nDb<=2 && db->aDb!=db->aDbStatic ){ |
115834
|
0 |
0 |
if( iDb>=0 ){ |
115841
|
0 |
0 |
if( db->nSchemaLock==0 ){ |
115842
|
0 |
0 |
for(i=0; inDb; i++){ |
115843
|
0 |
0 |
if( DbHasProperty(db, i, DB_ResetWanted) ){ |
115857
|
28 |
14 |
for(i=0; inDb; i++){ |
115859
|
28 |
0 |
if( pDb->pSchema ){ |
115860
|
28 |
0 |
if( db->nSchemaLock==0 ){ |
115870
|
14 |
0 |
if( db->nSchemaLock==0 ){ |
115896
|
0 |
4 |
if( pCol->iDflt==0 |
115897
|
0 |
0 |
|| NEVER(pList==0) |
115898
|
0 |
0 |
|| NEVER(pList->nExpriDflt) |
115900
|
2 |
2 |
pCol->iDflt = pList==0 ? 1 : pList->nExpr+1; |
115914
|
4923 |
0 |
if( pCol->iDflt==0 ) return 0; |
115915
|
0 |
0 |
if( NEVER(!IsOrdinaryTable(pTab)) ) return 0; |
115916
|
0 |
0 |
if( NEVER(pTab->u.tab.pDfltList==0) ) return 0; |
115917
|
0 |
0 |
if( NEVER(pTab->u.tab.pDfltList->nExpriDflt) ) return 0; |
115934
|
33 |
52 |
if( pCol->colFlags & COLFLAG_HASTYPE ){ |
115939
|
85 |
0 |
if( zNew ){ |
115951
|
1678 |
47 |
if( (pCol->colFlags & COLFLAG_HASCOLL)==0 ) return 0; |
115953
|
311 |
47 |
while( *z ){ z++; } |
115954
|
47 |
0 |
if( pCol->colFlags & COLFLAG_HASTYPE ){ |
115955
|
188 |
47 |
do{ z++; }while( *z ); |
115968
|
1015 |
61 |
if( (pCol = pTable->aCol)!=0 ){ |
115969
|
3487 |
1015 |
for(i=0; inCol; i++, pCol++){ |
115974
|
984 |
31 |
if( IsOrdinaryTable(pTable) ){ |
115977
|
285 |
730 |
if( db==0 || db->pnBytesFreed==0 ){ |
|
279 |
6 |
if( db==0 || db->pnBytesFreed==0 ){ |
115980
|
978 |
31 |
if( IsOrdinaryTable(pTable) ){ |
116020
|
74 |
1076 |
for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){ |
116024
|
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) ){ |
116035
|
1015 |
61 |
if( IsOrdinaryTable(pTable) ){ |
116039
|
61 |
0 |
else if( IsVirtual(pTable) ){ |
116061
|
3114 |
5564 |
if( !pTable ) return; |
116062
|
4833 |
731 |
if( ((!db || db->pnBytesFreed==0) && (--pTable->nTabRef)>0) ) return; |
|
4827 |
6 |
if( ((!db || db->pnBytesFreed==0) && (--pTable->nTabRef)>0) ) return; |
|
4488 |
1070 |
if( ((!db || db->pnBytesFreed==0) && (--pTable->nTabRef)>0) ) return; |
116101
|
9114 |
118 |
if( pName ){ |
116118
|
292 |
5 |
if( p->nTab==0 ){ |
116131
|
309 |
0 |
if( zName ){ |
116133
|
630 |
0 |
for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){ |
116134
|
309 |
321 |
if( 0==sqlite3_stricmp(pDb->zDbSName, zName) ) break; |
116137
|
0 |
321 |
if( i==0 && 0==sqlite3_stricmp("main", zName) ) break; |
|
0 |
0 |
if( i==0 && 0==sqlite3_stricmp("main", zName) ) break; |
116184
|
161 |
672 |
if( pName2->n>0 ){ |
116185
|
0 |
161 |
if( db->init.busy ) { |
116191
|
0 |
161 |
if( iDb<0 ){ |
116236
|
1051 |
0 |
if( sqlite3WritableSchema(db) |
116237
|
1051 |
0 |
|| db->init.imposterTable |
116238
|
0 |
1051 |
|| !sqlite3Config.bExtraSchemaChecks |
116243
|
749 |
302 |
if( db->init.busy ){ |
116244
|
749 |
0 |
if( sqlite3_stricmp(zType, db->init.azInit[0]) |
116245
|
749 |
0 |
|| sqlite3_stricmp(zName, db->init.azInit[1]) |
116246
|
0 |
749 |
|| sqlite3_stricmp(zTblName, db->init.azInit[2]) |
116252
|
297 |
5 |
if( (pParse->nested==0 && 0==sqlite3StrNICmp(zName, "sqlite_", 7)) |
|
297 |
0 |
if( (pParse->nested==0 && 0==sqlite3StrNICmp(zName, "sqlite_", 7)) |
116253
|
1 |
301 |
|| (sqlite3ReadOnlyShadowTables(db) && sqlite3ShadowTableName(db, zName)) |
|
0 |
1 |
|| (sqlite3ReadOnlyShadowTables(db) && sqlite3ShadowTableName(db, zName)) |
116269
|
30 |
46 |
for(p=pTab->pIndex; p && !IsPrimaryKeyIndex(p); p=p->pNext){} |
|
4 |
26 |
for(p=pTab->pIndex; p && !IsPrimaryKeyIndex(p); p=p->pNext){} |
116281
|
284 |
53 |
for(i=0; inColumn; i++){ |
116282
|
106 |
178 |
if( iCol==pIdx->aiColumn[i] ) return i; |
116300
|
0 |
100 |
if( pTab->tabFlags & TF_HasVirtual ){ |
116302
|
0 |
0 |
for(i=0; i<=iCol; i++){ |
116303
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_VIRTUAL ) iCol++; |
116351
|
0 |
4669 |
if( (pTab->tabFlags & TF_HasVirtual)==0 || iCol<0 ) return iCol; |
|
0 |
0 |
if( (pTab->tabFlags & TF_HasVirtual)==0 || iCol<0 ) return iCol; |
116352
|
0 |
0 |
for(i=0, n=0; i
|
116353
|
0 |
0 |
if( (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 ) n++; |
116355
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_VIRTUAL ){ |
116376
|
2 |
0 |
if( v ){ |
116414
|
744 |
297 |
if( db->init.busy && db->init.newTnum==1 ){ |
|
437 |
307 |
if( db->init.busy && db->init.newTnum==1 ){ |
116417
|
216 |
221 |
zName = sqlite3DbStrDup(db, SCHEMA_TABLE(iDb)); |
116422
|
0 |
604 |
if( iDb<0 ) return; |
116423
|
25 |
579 |
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 ){ |
116429
|
25 |
579 |
if( !OMIT_TEMPDB && isTemp ) iDb = 1; |
116431
|
0 |
604 |
if( IN_RENAME_OBJECT ){ |
116436
|
0 |
1041 |
if( zName==0 ) return; |
116437
|
0 |
1041 |
if( sqlite3CheckObjectName(pParse, zName, isView?"view":"table", zName) ){ |
|
0 |
1041 |
if( sqlite3CheckObjectName(pParse, zName, isView?"view":"table", zName) ){ |
116440
|
247 |
794 |
if( db->init.iDb==1 ) isTemp = 1; |
116452
|
272 |
769 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ |
|
0 |
1041 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ |
116455
|
980 |
61 |
if( !isVirtual && sqlite3AuthCheck(pParse, (int)aCode[isTemp+2*isView], |
|
0 |
980 |
if( !isVirtual && sqlite3AuthCheck(pParse, (int)aCode[isTemp+2*isView], |
116469
|
1010 |
31 |
if( !IN_SPECIAL_PARSE ){ |
116471
|
0 |
1010 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ |
116475
|
0 |
1010 |
if( pTable ){ |
116476
|
0 |
0 |
if( !noErr ){ |
116477
|
0 |
0 |
sqlite3ErrorMsg(pParse, "%s %T already exists", |
116486
|
0 |
1010 |
if( sqlite3FindIndex(db, zName, zDb)!=0 ){ |
116493
|
0 |
1041 |
if( pTable==0 ){ |
116519
|
297 |
744 |
if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){ |
|
297 |
0 |
if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){ |
116528
|
29 |
268 |
if( isVirtual ){ |
116543
|
0 |
297 |
1 : SQLITE_MAX_FILE_FORMAT; |
116558
|
297 |
0 |
if( isView || isVirtual ){ |
|
29 |
268 |
if( isView || isVirtual ){ |
116637
|
0 |
0 |
if( pParse->pNewTrigger ){ |
116644
|
0 |
0 |
if( pRet==0 ){ |
116654
|
0 |
0 |
if( db->mallocFailed ) return; |
116667
|
0 |
0 |
if( sqlite3HashInsert(pHash, RETURNING_TRIGGER_NAME, &pRet->retTrig) |
116694
|
0 |
3341 |
if( (p = pParse->pNewTable)==0 ) return; |
116695
|
0 |
3341 |
if( p->nCol+1>db->aLimit[SQLITE_LIMIT_COLUMN] ){ |
116699
|
3341 |
0 |
if( !IN_RENAME_OBJECT ) sqlite3DequoteToken(&sName); |
116705
|
0 |
3341 |
if( sType.n>=16 |
116706
|
0 |
0 |
&& sqlite3_strnicmp(sType.z+(sType.n-6),"always",6)==0 |
116709
|
0 |
0 |
while( ALWAYS(sType.n>0) && sqlite3Isspace(sType.z[sType.n-1]) ) sType.n--; |
|
0 |
0 |
while( ALWAYS(sType.n>0) && sqlite3Isspace(sType.z[sType.n-1]) ) sType.n--; |
116710
|
0 |
0 |
if( sType.n>=9 |
116711
|
0 |
0 |
&& sqlite3_strnicmp(sType.z+(sType.n-9),"generated",9)==0 |
116714
|
0 |
0 |
while( sType.n>0 && sqlite3Isspace(sType.z[sType.n-1]) ) sType.n--; |
|
0 |
0 |
while( sType.n>0 && sqlite3Isspace(sType.z[sType.n-1]) ) sType.n--; |
116721
|
2973 |
368 |
if( sType.n>=3 ){ |
116723
|
15281 |
166 |
for(i=0; i
|
116724
|
6951 |
8330 |
if( sType.n==sqlite3StdTypeLen[i] |
116725
|
2807 |
4144 |
&& sqlite3_strnicmp(sType.z, sqlite3StdType[i], sType.n)==0 |
116730
|
1887 |
920 |
if( affinity<=SQLITE_AFF_TEXT ) szEst = 5; |
116737
|
0 |
3341 |
if( z==0 ) return; |
116738
|
0 |
3341 |
if( IN_RENAME_OBJECT ) sqlite3RenameTokenMap(pParse, (void*)z, &sName); |
116743
|
5393 |
3341 |
for(i=0; inCol; i++){ |
116744
|
4 |
5389 |
if( p->aCol[i].hName==hName && sqlite3StrICmp(z, p->aCol[i].zCnName)==0 ){ |
|
0 |
4 |
if( p->aCol[i].hName==hName && sqlite3StrICmp(z, p->aCol[i].zCnName)==0 ){ |
116751
|
0 |
3341 |
if( aNew==0 ){ |
116762
|
3173 |
168 |
if( sType.n==0 ){ |
116798
|
173 |
0 |
if( p==0 || NEVER(p->nCol<1) ) return; |
|
0 |
173 |
if( p==0 || NEVER(p->nCol<1) ) return; |
116805
|
0 |
173 |
if( pCol->colFlags & COLFLAG_UNIQUE ){ |
116807
|
0 |
0 |
for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){ |
116809
|
0 |
0 |
if( pIdx->aiColumn[0]==p->nCol-1 ){ |
116847
|
1445 |
166 |
while( zIn[0] ){ |
116850
|
126 |
1319 |
if( h==(('c'<<24)+('h'<<16)+('a'<<8)+'r') ){ /* CHAR */ |
116853
|
0 |
1319 |
}else if( h==(('c'<<24)+('l'<<16)+('o'<<8)+'b') ){ /* CLOB */ |
116855
|
0 |
1319 |
}else if( h==(('t'<<24)+('e'<<16)+('x'<<8)+'t') ){ /* TEXT */ |
116857
|
2 |
1317 |
}else if( h==(('b'<<24)+('l'<<16)+('o'<<8)+'b') /* BLOB */ |
116858
|
0 |
2 |
&& (aff==SQLITE_AFF_NUMERIC || aff==SQLITE_AFF_REAL) ){ |
|
0 |
0 |
&& (aff==SQLITE_AFF_NUMERIC || aff==SQLITE_AFF_REAL) ){ |
116860
|
0 |
2 |
if( zIn[0]=='(' ) zChar = zIn; |
116862
|
0 |
1317 |
}else if( h==(('r'<<24)+('e'<<16)+('a'<<8)+'l') /* REAL */ |
116863
|
0 |
0 |
&& aff==SQLITE_AFF_NUMERIC ){ |
116865
|
0 |
1317 |
}else if( h==(('f'<<24)+('l'<<16)+('o'<<8)+'a') /* FLOA */ |
116866
|
0 |
0 |
&& aff==SQLITE_AFF_NUMERIC ){ |
116868
|
0 |
1317 |
}else if( h==(('d'<<24)+('o'<<16)+('u'<<8)+'b') /* DOUB */ |
116869
|
0 |
0 |
&& aff==SQLITE_AFF_NUMERIC ){ |
116872
|
7 |
1310 |
}else if( (h&0x00FFFFFF)==(('i'<<16)+('n'<<8)+'t') ){ /* INT */ |
116880
|
168 |
5 |
if( pCol ){ |
116882
|
128 |
40 |
if( aff
|
116883
|
126 |
2 |
if( zChar ){ |
116884
|
269 |
27 |
while( zChar[0] ){ |
116885
|
99 |
170 |
if( sqlite3Isdigit(zChar[0]) ){ |
116902
|
0 |
168 |
if( v>255 ) v = 255; |
116928
|
4 |
0 |
if( p!=0 ){ |
116929
|
2 |
2 |
int isInit = db->init.busy && db->init.iDb!=1; |
|
2 |
0 |
int isInit = db->init.busy && db->init.iDb!=1; |
116931
|
0 |
4 |
if( !sqlite3ExprIsConstantOrFunction(pExpr, isInit) ){ |
116935
|
0 |
4 |
}else if( pCol->colFlags & COLFLAG_GENERATED ){ |
116955
|
0 |
4 |
if( IN_RENAME_OBJECT ){ |
116978
|
0 |
218 |
if( p->op==TK_STRING ){ |
116980
|
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 ){ |
116991
|
0 |
265 |
if( pCol->colFlags & COLFLAG_GENERATED ){ |
117029
|
0 |
220 |
if( pTab==0 ) goto primary_key_exit; |
117030
|
0 |
220 |
if( pTab->tabFlags & TF_HasPrimaryKey ){ |
117036
|
179 |
41 |
if( pList==0 ){ |
117043
|
86 |
41 |
for(i=0; i
|
117047
|
86 |
0 |
if( pCExpr->op==TK_ID ){ |
117051
|
159 |
0 |
for(iCol=0; iColnCol; iCol++){ |
117052
|
86 |
73 |
if( sqlite3StrICmp(zCName, pTab->aCol[iCol].zCnName)==0 ){ |
117061
|
189 |
31 |
if( nTerm==1 |
117062
|
189 |
0 |
&& pCol |
117063
|
167 |
22 |
&& pCol->eCType==COLTYPE_INTEGER |
117064
|
167 |
0 |
&& sortOrder!=SQLITE_SO_DESC |
117066
|
0 |
167 |
if( IN_RENAME_OBJECT && pList ){ |
|
0 |
0 |
if( IN_RENAME_OBJECT && pList ){ |
117074
|
6 |
161 |
if( pList ) pParse->iPkSortOrder = pList->a[0].fg.sortFlags; |
117076
|
0 |
53 |
}else if( autoInc ){ |
117104
|
6 |
0 |
if( pTab && !IN_DECLARE_VTAB |
|
6 |
0 |
if( pTab && !IN_DECLARE_VTAB |
117105
|
6 |
0 |
&& !sqlite3BtreeIsReadonly(db->aDb[db->init.iDb].pBt) |
117108
|
0 |
6 |
if( pParse->constraintName.n ){ |
117112
|
0 |
6 |
for(zStart++; sqlite3Isspace(zStart[0]); zStart++){} |
117113
|
0 |
6 |
while( sqlite3Isspace(zEnd[-1]) ){ zEnd--; } |
117135
|
0 |
0 |
if( (p = pParse->pNewTable)==0 || IN_RENAME_OBJECT ) return; |
|
0 |
0 |
if( (p = pParse->pNewTable)==0 || IN_RENAME_OBJECT ) return; |
117139
|
0 |
0 |
if( !zColl ) return; |
117141
|
0 |
0 |
if( sqlite3LocateCollSeq(pParse, zColl) ){ |
117149
|
0 |
0 |
for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){ |
117151
|
0 |
0 |
if( pIdx->aiColumn[0]==i ){ |
117167
|
0 |
0 |
if( pTab==0 ){ |
117172
|
0 |
0 |
if( IN_DECLARE_VTAB ){ |
117176
|
0 |
0 |
if( pCol->iDflt>0 ) goto generated_error; |
117177
|
0 |
0 |
if( pType ){ |
117178
|
0 |
0 |
if( pType->n==7 && sqlite3StrNICmp("virtual",pType->z,7)==0 ){ |
|
0 |
0 |
if( pType->n==7 && sqlite3StrNICmp("virtual",pType->z,7)==0 ){ |
117180
|
0 |
0 |
}else if( pType->n==6 && sqlite3StrNICmp("stored",pType->z,6)==0 ){ |
|
0 |
0 |
}else if( pType->n==6 && sqlite3StrNICmp("stored",pType->z,6)==0 ){ |
117186
|
0 |
0 |
if( eType==COLFLAG_VIRTUAL ) pTab->nNVCol--; |
117191
|
0 |
0 |
if( pCol->colFlags & COLFLAG_PRIMKEY ){ |
117248
|
0 |
0 |
for(n=0; *z; n++, z++){ |
117249
|
0 |
0 |
if( *z=='"' ){ n++; } |
117272
|
0 |
0 |
for(j=0; zIdent[j]; j++){ |
117273
|
0 |
0 |
if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break; |
|
0 |
0 |
if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break; |
117276
|
0 |
0 |
|| sqlite3KeywordCode(zIdent, j)!=TK_ID |
117277
|
0 |
0 |
|| zIdent[j]!=0 |
117278
|
0 |
0 |
|| j==0; |
|
0 |
0 |
|| j==0; |
117280
|
0 |
0 |
if( needQuote ) z[i++] = '"'; |
117281
|
0 |
0 |
for(j=0; zIdent[j]; j++){ |
117283
|
0 |
0 |
if( zIdent[j]=='"' ) z[i++] = '"'; |
117285
|
0 |
0 |
if( needQuote ) z[i++] = '"'; |
117301
|
0 |
0 |
for(pCol = p->aCol, i=0; inCol; i++, pCol++){ |
117305
|
0 |
0 |
if( n<50 ){ |
117316
|
0 |
0 |
if( zStmt==0 ){ |
117324
|
0 |
0 |
for(pCol=p->aCol, i=0; inCol; i++, pCol++){ |
117366
|
0 |
0 |
if( pIdx->nColumn>=N ) return SQLITE_OK; |
117370
|
0 |
0 |
if( zExtra==0 ) return SQLITE_NOMEM_BKPT; |
117394
|
3341 |
980 |
for(i=pTab->nCol, pTabCol=pTab->aCol; i>0; i--, pTabCol++){ |
117397
|
813 |
167 |
if( pTab->iPKey<0 ) wTable++; |
117408
|
211 |
79 |
for(i=0; inColumn; i++){ |
117411
|
132 |
79 |
wIndex += x<0 ? 1 : aCol[pIdx->aiColumn[i]].szEst; |
117421
|
0 |
0 |
while( nCol-- > 0 ){ |
117422
|
0 |
0 |
if( x==*(aiCol++) ){ |
117452
|
0 |
0 |
for(i=0; i
|
117454
|
0 |
0 |
if( pIdx->aiColumn[i]==j |
117455
|
0 |
0 |
&& sqlite3StrICmp(pIdx->azColl[i], pPk->azColl[iCol])==0 |
117485
|
211 |
79 |
for(j=pIdx->nColumn-1; j>=0; j--){ |
117487
|
132 |
79 |
if( x>=0 && (pTab->aCol[x].colFlags & COLFLAG_VIRTUAL)==0 ){ |
|
132 |
0 |
if( x>=0 && (pTab->aCol[x].colFlags & COLFLAG_VIRTUAL)==0 ){ |
117490
|
132 |
0 |
if( x
|
117532
|
0 |
0 |
if( !db->init.imposterTable ){ |
117533
|
0 |
0 |
for(i=0; inCol; i++){ |
117534
|
0 |
0 |
if( (pTab->aCol[i].colFlags & COLFLAG_PRIMKEY)!=0 |
117535
|
0 |
0 |
&& (pTab->aCol[i].notNull==OE_None) |
117547
|
0 |
0 |
if( pParse->u1.addrCrTab ){ |
117555
|
0 |
0 |
if( pTab->iPKey>=0 ){ |
117561
|
0 |
0 |
if( pList==0 ){ |
117565
|
0 |
0 |
if( IN_RENAME_OBJECT ){ |
117573
|
0 |
0 |
if( pParse->nErr ){ |
117589
|
0 |
0 |
for(i=j=1; inKeyCol; i++){ |
117590
|
0 |
0 |
if( isDupColumn(pPk, j, pPk, i) ){ |
117603
|
0 |
0 |
if( !db->init.imposterTable ) pPk->uniqNotNull = 1; |
117610
|
0 |
0 |
if( v && pPk->tnum>0 ){ |
|
0 |
0 |
if( v && pPk->tnum>0 ){ |
117621
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
117623
|
0 |
0 |
if( IsPrimaryKeyIndex(pIdx) ) continue; |
117624
|
0 |
0 |
for(i=n=0; i
|
117625
|
0 |
0 |
if( !isDupColumn(pIdx, pIdx->nKeyCol, pPk, i) ){ |
117630
|
0 |
0 |
if( n==0 ){ |
117635
|
0 |
0 |
if( resizeIndexObject(db, pIdx, pIdx->nKeyCol+n) ) return; |
117636
|
0 |
0 |
for(i=0, j=pIdx->nKeyCol; i
|
117637
|
0 |
0 |
if( !isDupColumn(pIdx, pIdx->nKeyCol, pPk, i) ){ |
117641
|
0 |
0 |
if( pPk->aSortOrder[i] ){ |
117655
|
0 |
0 |
for(i=0; inCol; i++){ |
117656
|
0 |
0 |
if( !hasColumn(pPk->aiColumn, nPk, i) |
117657
|
0 |
0 |
&& (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 ) nExtra++; |
117659
|
0 |
0 |
if( resizeIndexObject(db, pPk, nPk+nExtra) ) return; |
117660
|
0 |
0 |
for(i=0, j=nPk; inCol; i++){ |
117661
|
0 |
0 |
if( !hasColumn(pPk->aiColumn, j, i) |
117662
|
0 |
0 |
&& (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 |
117685
|
0 |
74 |
if( !IsVirtual(pTab) ) return 0; |
117687
|
0 |
74 |
if( sqlite3_strnicmp(zName, pTab->zName, nName)!=0 ) return 0; |
117688
|
0 |
74 |
if( zName[nName]!='_' ) return 0; |
117690
|
0 |
74 |
if( pMod==0 ) return 0; |
117691
|
0 |
74 |
if( pMod->pModule->iVersion<3 ) return 0; |
117692
|
0 |
74 |
if( pMod->pModule->xShadowName==0 ) return 0; |
117711
|
0 |
32 |
if( pMod==0 ) return; |
117712
|
0 |
32 |
if( NEVER(pMod->pModule==0) ) return; |
117713
|
21 |
11 |
if( pMod->pModule->iVersion<3 ) return; |
117714
|
0 |
11 |
if( pMod->pModule->xShadowName==0 ) return; |
117717
|
23 |
11 |
for(k=sqliteHashFirst(&pTab->pSchema->tblHash); k; k=sqliteHashNext(k)){ |
117720
|
4 |
19 |
if( !IsOrdinaryTable(pOther) ) continue; |
117721
|
6 |
13 |
if( pOther->tabFlags & TF_Shadow ) continue; |
117722
|
0 |
13 |
if( sqlite3StrNICmp(pOther->zName, pTab->zName, nName)==0 |
117723
|
0 |
0 |
&& pOther->zName[nName]=='_' |
117724
|
0 |
0 |
&& pMod->pModule->xShadowName(pOther->zName+nName+1) |
117744
|
355 |
626 |
if( zTail==0 ) return 0; |
117748
|
552 |
74 |
if( pTab==0 ) return 0; |
117749
|
0 |
74 |
if( !IsVirtual(pTab) ) return 0; |
117813
|
0 |
980 |
if( pEnd==0 && pSelect==0 ){ |
|
0 |
0 |
if( pEnd==0 && pSelect==0 ){ |
117817
|
0 |
980 |
if( p==0 ) return; |
117819
|
980 |
0 |
if( pSelect==0 && sqlite3ShadowTableName(db, p->zName) ){ |
|
74 |
906 |
if( pSelect==0 && sqlite3ShadowTableName(db, p->zName) ){ |
117832
|
712 |
268 |
if( db->init.busy ){ |
117833
|
712 |
0 |
if( pSelect || (!IsOrdinaryTable(p) && db->init.newTnum) ){ |
|
0 |
712 |
if( pSelect || (!IsOrdinaryTable(p) && db->init.newTnum) ){ |
|
0 |
0 |
if( pSelect || (!IsOrdinaryTable(p) && db->init.newTnum) ){ |
117838
|
437 |
275 |
if( p->tnum==1 ) p->tabFlags |= TF_Readonly; |
117850
|
0 |
980 |
if( tabOpts & TF_Strict ){ |
117853
|
0 |
0 |
for(ii=0; iinCol; ii++){ |
117855
|
0 |
0 |
if( pCol->eCType==COLTYPE_CUSTOM ){ |
117856
|
0 |
0 |
if( pCol->colFlags & COLFLAG_HASTYPE ){ |
117866
|
0 |
0 |
}else if( pCol->eCType==COLTYPE_ANY ){ |
117869
|
0 |
0 |
if( (pCol->colFlags & COLFLAG_PRIMKEY)!=0 |
117870
|
0 |
0 |
&& p->iPKey!=ii |
117871
|
0 |
0 |
&& pCol->notNull == OE_None |
117885
|
0 |
980 |
if( tabOpts & TF_WithoutRowid ){ |
117886
|
0 |
0 |
if( (p->tabFlags & TF_Autoincrement) ){ |
117891
|
0 |
0 |
if( (p->tabFlags & TF_HasPrimaryKey)==0 ){ |
117903
|
6 |
974 |
if( p->pCheck ){ |
117905
|
2 |
4 |
if( pParse->nErr ){ |
117916
|
0 |
980 |
if( p->tabFlags & TF_HasGenerated ){ |
117920
|
0 |
0 |
for(ii=0; iinCol; ii++){ |
117922
|
0 |
0 |
if( (colFlags & COLFLAG_GENERATED)!=0 ){ |
117926
|
0 |
0 |
if( sqlite3ResolveSelfReference(pParse, p, NC_GenCol, pX, 0) ){ |
117940
|
0 |
0 |
if( nNG==0 ){ |
117949
|
69 |
980 |
for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){ |
117959
|
268 |
712 |
if( !db->init.busy ){ |
117967
|
0 |
268 |
if( NEVER(v==0) ) return; |
117974
|
268 |
0 |
if( IsOrdinaryTable(p) ){ |
117999
|
0 |
268 |
if( pSelect ){ |
118008
|
0 |
0 |
if( IN_SPECIAL_PARSE ){ |
118023
|
0 |
0 |
if( pParse->nErr ) return; |
118025
|
0 |
0 |
if( pSelTab==0 ) return; |
118034
|
0 |
0 |
if( pParse->nErr ) return; |
118049
|
0 |
268 |
if( pSelect ){ |
118052
|
0 |
268 |
Token *pEnd2 = tabOpts ? &pParse->sLastToken : pEnd; |
118054
|
268 |
0 |
if( pEnd2->z[0]!=';' ) n += pEnd2->n; |
118083
|
5 |
263 |
if( (p->tabFlags & TF_Autoincrement)!=0 && !IN_SPECIAL_PARSE ){ |
|
5 |
0 |
if( (p->tabFlags & TF_Autoincrement)!=0 && !IN_SPECIAL_PARSE ){ |
118086
|
4 |
1 |
if( pDb->pSchema->pSeqTab==0 ){ |
118102
|
712 |
268 |
if( db->init.busy ){ |
118108
|
0 |
712 |
if( pOld ){ |
118121
|
4 |
708 |
if( strcmp(p->zName, "sqlite_sequence")==0 ){ |
118129
|
980 |
0 |
if( !pSelect && IsOrdinaryTable(p) ){ |
|
980 |
0 |
if( !pSelect && IsOrdinaryTable(p) ){ |
118131
|
931 |
49 |
if( pCons->z==0 ){ |
118162
|
0 |
0 |
if( pParse->nVar>0 ){ |
118168
|
0 |
0 |
if( p==0 || pParse->nErr ) goto create_view_fail; |
|
0 |
0 |
if( p==0 || pParse->nErr ) goto create_view_fail; |
118182
|
0 |
0 |
if( sqlite3FixSelect(&sFix, pSelect) ) goto create_view_fail; |
118190
|
0 |
0 |
if( IN_RENAME_OBJECT ){ |
118198
|
0 |
0 |
if( db->mallocFailed ) goto create_view_fail; |
118205
|
0 |
0 |
if( sEnd.z[0]!=';' ){ |
118212
|
0 |
0 |
while( sqlite3Isspace(z[n-1]) ){ n--; } |
118221
|
0 |
0 |
if( IN_RENAME_OBJECT ){ |
118250
|
185 |
3110 |
if( IsVirtual(pTable) ){ |
118262
|
3110 |
0 |
if( pTable->nCol>0 ) return 0; |
118279
|
0 |
0 |
if( pTable->nCol<0 ){ |
118294
|
0 |
0 |
if( pSel ){ |
118312
|
0 |
0 |
if( pSelTab==0 ){ |
118315
|
0 |
0 |
}else if( pTable->pCheck ){ |
118324
|
0 |
0 |
if( pParse->nErr==0 |
118325
|
0 |
0 |
&& pTable->nCol==pSel->pEList->nExpr |
118346
|
0 |
0 |
EnableLookaside; |
118352
|
0 |
0 |
if( db->mallocFailed ){ |
118367
|
7 |
0 |
if( !DbHasProperty(db, idx, DB_UnresetViews) ) return; |
118368
|
0 |
0 |
for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){ |
118370
|
0 |
0 |
if( IsView(pTab) ){ |
118406
|
0 |
0 |
for(pElem=sqliteHashFirst(pHash); pElem; pElem=sqliteHashNext(pElem)){ |
118408
|
0 |
0 |
if( pTab->tnum==iFrom ){ |
118413
|
0 |
0 |
for(pElem=sqliteHashFirst(pHash); pElem; pElem=sqliteHashNext(pElem)){ |
118415
|
0 |
0 |
if( pIdx->tnum==iFrom ){ |
118431
|
0 |
5 |
if( iTable<2 ) sqlite3ErrorMsg(pParse, "corrupt schema"); |
118482
|
5 |
5 |
if( iDestroyed==0 || iTab
|
|
0 |
5 |
if( iDestroyed==0 || iTab
|
118485
|
0 |
10 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
118488
|
0 |
0 |
if( (iDestroyed==0 || (iIdxiLargest ){ |
|
0 |
0 |
if( (iDestroyed==0 || (iIdxiLargest ){ |
|
0 |
0 |
if( (iDestroyed==0 || (iIdxiLargest ){ |
118492
|
5 |
5 |
if( iLargest==0 ){ |
118515
|
28 |
7 |
for(i=1; i<=4; i++){ |
118518
|
0 |
28 |
if( sqlite3FindTable(pParse->db, zTab, zDbName) ){ |
118541
|
2 |
5 |
if( IsVirtual(pTab) ){ |
118551
|
0 |
7 |
while( pTrigger ){ |
118564
|
0 |
7 |
if( pTab->tabFlags & TF_Autoincrement ){ |
118583
|
7 |
0 |
if( !isView && !IsVirtual(pTab) ){ |
|
5 |
2 |
if( !isView && !IsVirtual(pTab) ){ |
118590
|
2 |
5 |
if( IsVirtual(pTab) ){ |
118605
|
1 |
350 |
if( (db->flags & SQLITE_Defensive)!=0 |
118606
|
1 |
0 |
&& db->pVtabCtx==0 |
118607
|
1 |
0 |
&& db->nVdbeExec==0 |
118608
|
0 |
1 |
&& !sqlite3VtabInSync(db) |
|
0 |
0 |
&& !sqlite3VtabInSync(db) |
118620
|
0 |
7 |
if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 ){ |
118621
|
0 |
0 |
if( sqlite3StrNICmp(pTab->zName+7, "stat", 4)==0 ) return 0; |
118622
|
0 |
0 |
if( sqlite3StrNICmp(pTab->zName+7, "parameters", 10)==0 ) return 0; |
118625
|
0 |
7 |
if( (pTab->tabFlags & TF_Shadow)!=0 && sqlite3ReadOnlyShadowTables(db) ){ |
|
0 |
0 |
if( (pTab->tabFlags & TF_Shadow)!=0 && sqlite3ReadOnlyShadowTables(db) ){ |
118628
|
0 |
7 |
if( pTab->tabFlags & TF_Eponymous ){ |
118644
|
0 |
15 |
if( db->mallocFailed ){ |
118649
|
0 |
15 |
if( sqlite3ReadSchema(pParse) ) goto exit_drop_table; |
118650
|
2 |
13 |
if( noErr ) db->suppressErr++; |
118653
|
2 |
13 |
if( noErr ) db->suppressErr--; |
118655
|
8 |
7 |
if( pTab==0 ){ |
118656
|
2 |
6 |
if( noErr ){ |
118668
|
2 |
5 |
if( IsVirtual(pTab) && sqlite3ViewGetColumnNames(pParse, pTab) ){ |
|
0 |
2 |
if( IsVirtual(pTab) && sqlite3ViewGetColumnNames(pParse, pTab) ){ |
118674
|
0 |
7 |
const char *zTab = SCHEMA_TABLE(iDb); |
118677
|
0 |
7 |
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb)){ |
118680
|
0 |
7 |
if( isView ){ |
118681
|
0 |
0 |
if( !OMIT_TEMPDB && iDb==1 ){ |
118687
|
2 |
5 |
}else if( IsVirtual(pTab) ){ |
118692
|
0 |
5 |
if( !OMIT_TEMPDB && iDb==1 ){ |
118698
|
0 |
7 |
if( sqlite3AuthCheck(pParse, code, pTab->zName, zArg2, zDb) ){ |
118701
|
0 |
7 |
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){ |
118706
|
0 |
7 |
if( tableMayNotBeDropped(db, pTab) ){ |
118715
|
0 |
7 |
if( isView && !IsView(pTab) ){ |
|
0 |
0 |
if( isView && !IsView(pTab) ){ |
118719
|
7 |
0 |
if( !isView && IsView(pTab) ){ |
|
0 |
7 |
if( !isView && IsView(pTab) ){ |
118729
|
7 |
0 |
if( v ){ |
118731
|
7 |
0 |
if( !isView ){ |
118776
|
16 |
0 |
if( p==0 || IN_DECLARE_VTAB ) goto fk_end; |
|
16 |
0 |
if( p==0 || IN_DECLARE_VTAB ) goto fk_end; |
118777
|
12 |
4 |
if( pFromCol==0 ){ |
118779
|
0 |
12 |
if( NEVER(iCol<0) ) goto fk_end; |
118780
|
12 |
0 |
if( pToCol && pToCol->nExpr!=1 ){ |
|
0 |
12 |
if( pToCol && pToCol->nExpr!=1 ){ |
118787
|
4 |
0 |
}else if( pToCol && pToCol->nExpr!=pFromCol->nExpr ){ |
|
0 |
4 |
}else if( pToCol && pToCol->nExpr!=pFromCol->nExpr ){ |
118796
|
16 |
0 |
if( pToCol ){ |
118797
|
18 |
16 |
for(i=0; inExpr; i++){ |
118802
|
0 |
16 |
if( pFKey==0 ){ |
118810
|
0 |
16 |
if( IN_RENAME_OBJECT ){ |
118818
|
12 |
4 |
if( pFromCol==0 ){ |
118821
|
6 |
4 |
for(i=0; i
|
118823
|
16 |
0 |
for(j=0; jnCol; j++){ |
118824
|
6 |
10 |
if( sqlite3StrICmp(p->aCol[j].zCnName, pFromCol->a[i].zEName)==0 ){ |
118829
|
0 |
6 |
if( j>=p->nCol ){ |
118835
|
0 |
6 |
if( IN_RENAME_OBJECT ){ |
118840
|
16 |
0 |
if( pToCol ){ |
118841
|
18 |
16 |
for(i=0; i
|
118844
|
0 |
18 |
if( IN_RENAME_OBJECT ){ |
118860
|
0 |
16 |
if( pNextTo==pFKey ){ |
118864
|
0 |
16 |
if( pNextTo ){ |
118894
|
0 |
6 |
if( (pTab = pParse->pNewTable)==0 ) return; |
118895
|
0 |
6 |
if( NEVER(!IsOrdinaryTable(pTab)) ) return; |
118896
|
0 |
6 |
if( (pFKey = pTab->u.tab.pFKey)==0 ) return; |
118929
|
0 |
5 |
if( sqlite3AuthCheck(pParse, SQLITE_REINDEX, pIndex->zName, 0, |
118939
|
0 |
5 |
if( v==0 ) return; |
118940
|
5 |
0 |
if( memRootPage>=0 ){ |
118965
|
0 |
5 |
if( memRootPage<0 ) sqlite3VdbeAddOp2(v, OP_Clear, tnum, iDb); |
118968
|
5 |
0 |
sqlite3VdbeChangeP5(v, OPFLAG_BULKCSR|((memRootPage>=0)?OPFLAG_P2ISREG:0)); |
118971
|
2 |
3 |
if( IsUniqueIndex(pIndex) ){ |
118991
|
5 |
0 |
if( !pIndex->bAscKeyBug ){ |
119034
|
80 |
0 |
if( p ){ |
119053
|
59 |
187 |
if( pList ){ |
119055
|
112 |
59 |
for(i=0; inExpr; i++){ |
119056
|
0 |
112 |
if( pList->a[i].fg.bNulls ){ |
119058
|
0 |
0 |
sqlite3ErrorMsg(pParse, "unsupported use of NULLS %s", |
119059
|
0 |
0 |
(sf==0 || sf==3) ? "FIRST" : "LAST" |
119111
|
0 |
79 |
if( pParse->nErr ){ |
119115
|
0 |
79 |
if( IN_DECLARE_VTAB && idxType!=SQLITE_IDXTYPE_PRIMARYKEY ){ |
|
0 |
0 |
if( IN_DECLARE_VTAB && idxType!=SQLITE_IDXTYPE_PRIMARYKEY ){ |
119118
|
0 |
79 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ |
119121
|
0 |
79 |
if( sqlite3HasExplicitNulls(pParse, pList) ){ |
119128
|
10 |
69 |
if( pTblName!=0 ){ |
119136
|
0 |
10 |
if( iDb<0 ) goto exit_create_index; |
119144
|
5 |
5 |
if( !db->init.busy ){ |
119146
|
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 ){ |
119160
|
0 |
10 |
if( pTab==0 ) goto exit_create_index; |
119161
|
0 |
10 |
if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){ |
|
0 |
0 |
if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){ |
119167
|
0 |
10 |
if( !HasRowid(pTab) ) pPk = sqlite3PrimaryKeyIndex(pTab); |
119172
|
0 |
69 |
if( !pTab ) goto exit_create_index; |
119178
|
0 |
79 |
if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 |
119179
|
0 |
0 |
&& db->init.busy==0 |
119180
|
0 |
0 |
&& pTblName!=0 |
119189
|
0 |
79 |
if( IsView(pTab) ){ |
119195
|
0 |
79 |
if( IsVirtual(pTab) ){ |
119214
|
10 |
69 |
if( pName ){ |
119216
|
0 |
10 |
if( zName==0 ) goto exit_create_index; |
119218
|
0 |
10 |
if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName,"index",pTab->zName) ){ |
119221
|
10 |
0 |
if( !IN_RENAME_OBJECT ){ |
119222
|
5 |
5 |
if( !db->init.busy ){ |
119223
|
0 |
5 |
if( sqlite3FindTable(db, zName, 0)!=0 ){ |
119228
|
0 |
10 |
if( sqlite3FindIndex(db, zName, pDb->zDbSName)!=0 ){ |
119229
|
0 |
0 |
if( !ifNotExist ){ |
119242
|
2 |
69 |
for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){} |
119244
|
0 |
69 |
if( zName==0 ){ |
119253
|
0 |
69 |
if( IN_SPECIAL_PARSE ) zName[7]++; |
119259
|
79 |
0 |
if( !IN_RENAME_OBJECT ){ |
119261
|
2 |
77 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iDb), 0, zDb) ){ |
|
0 |
79 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iDb), 0, zDb) ){ |
119265
|
2 |
77 |
if( !OMIT_TEMPDB && iDb==1 ) i = SQLITE_CREATE_TEMP_INDEX; |
119266
|
0 |
79 |
if( sqlite3AuthCheck(pParse, i, zName, pTab->zName, zDb) ){ |
119276
|
26 |
53 |
if( pList==0 ){ |
119283
|
0 |
26 |
if( pList==0 ) goto exit_create_index; |
119288
|
0 |
53 |
if( pParse->nErr ) goto exit_create_index; |
119294
|
132 |
79 |
for(i=0; inExpr; i++){ |
119297
|
0 |
132 |
if( pExpr->op==TK_COLLATE ){ |
119307
|
0 |
79 |
nExtraCol = pPk ? pPk->nKeyCol : 1; |
119311
|
0 |
79 |
if( db->mallocFailed ){ |
119325
|
0 |
79 |
if( pPIWhere ){ |
119334
|
58 |
21 |
if( pDb->pSchema->file_format>=4 ){ |
119350
|
0 |
79 |
if( IN_RENAME_OBJECT ){ |
119354
|
132 |
79 |
for(i=0; inKeyCol; i++, pListItem++){ |
119361
|
0 |
132 |
if( pParse->nErr ) goto exit_create_index; |
119363
|
0 |
132 |
if( pCExpr->op!=TK_COLUMN ){ |
119364
|
0 |
0 |
if( pTab==pParse->pNewTable ){ |
119369
|
0 |
0 |
if( pIndex->aColExpr==0 ){ |
119379
|
0 |
132 |
if( j<0 ){ |
119382
|
104 |
28 |
if( pTab->aCol[j].notNull==0 ){ |
119385
|
0 |
132 |
if( pTab->aCol[j].colFlags & COLFLAG_VIRTUAL ){ |
119392
|
0 |
132 |
if( pListItem->pExpr->op==TK_COLLATE ){ |
119402
|
132 |
0 |
}else if( j>=0 ){ |
119405
|
132 |
0 |
if( !zColl ) zColl = sqlite3StrBINARY; |
119406
|
65 |
67 |
if( !db->init.busy && !sqlite3LocateCollSeq(pParse, zColl) ){ |
|
0 |
65 |
if( !db->init.busy && !sqlite3LocateCollSeq(pParse, zColl) ){ |
119418
|
0 |
79 |
if( pPk ){ |
119419
|
0 |
0 |
for(j=0; jnKeyCol; j++){ |
119422
|
0 |
0 |
if( isDupColumn(pIndex, pIndex->nKeyCol, pPk, j) ){ |
119438
|
10 |
69 |
if( pParse->pNewTable==0 ) estimateIndexWidth(pIndex); |
119445
|
10 |
69 |
if( pTblName!=0 && pIndex->nColumn>=pTab->nCol ){ |
|
6 |
4 |
if( pTblName!=0 && pIndex->nColumn>=pTab->nCol ){ |
119447
|
10 |
2 |
for(j=0; jnCol; j++){ |
119448
|
2 |
8 |
if( j==pTab->iPKey ) continue; |
119449
|
4 |
4 |
if( sqlite3TableColumnToIndex(pIndex,j)>=0 ) continue; |
119455
|
69 |
10 |
if( pTab==pParse->pNewTable ){ |
119478
|
2 |
69 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
119484
|
0 |
2 |
if( pIdx->nKeyCol!=pIndex->nKeyCol ) continue; |
119485
|
2 |
0 |
for(k=0; knKeyCol; k++){ |
119489
|
2 |
0 |
if( pIdx->aiColumn[k]!=pIndex->aiColumn[k] ) break; |
119492
|
0 |
0 |
if( sqlite3StrICmp(z1, z2) ) break; |
119494
|
0 |
2 |
if( k==pIdx->nKeyCol ){ |
119495
|
0 |
0 |
if( pIdx->onError!=pIndex->onError ){ |
119503
|
0 |
0 |
if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){ |
|
0 |
0 |
if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){ |
119507
|
0 |
0 |
if( pIdx->onError==OE_Default ){ |
119511
|
0 |
0 |
if( idxType==SQLITE_IDXTYPE_PRIMARYKEY ) pIdx->idxType = idxType; |
119512
|
0 |
0 |
if( IN_RENAME_OBJECT ){ |
119522
|
79 |
0 |
if( !IN_RENAME_OBJECT ){ |
119528
|
40 |
39 |
if( db->init.busy ){ |
119532
|
5 |
35 |
if( pTblName!=0 ){ |
119534
|
0 |
5 |
if( sqlite3IndexHasDuplicateRootPage(pIndex) ){ |
119542
|
0 |
40 |
if( p ){ |
119563
|
0 |
39 |
else if( HasRowid(pTab) || pTblName!=0 ){ |
|
0 |
0 |
else if( HasRowid(pTab) || pTblName!=0 ){ |
119569
|
0 |
39 |
if( v==0 ) goto exit_create_index; |
119586
|
5 |
34 |
if( pStart ){ |
119588
|
3 |
2 |
if( pName->z[n-1]==';' ) n--; |
119590
|
3 |
2 |
zStmt = sqlite3MPrintf(db, "CREATE%s INDEX %.*s", |
119613
|
5 |
34 |
if( pTblName ){ |
119624
|
39 |
40 |
if( db->init.busy || pTblName==0 ){ |
|
34 |
5 |
if( db->init.busy || pTblName==0 ){ |
119629
|
0 |
5 |
else if( IN_RENAME_OBJECT ){ |
119637
|
5 |
74 |
if( pIndex ) sqlite3FreeIndex(db, pIndex); |
119638
|
79 |
0 |
if( pTab ){ |
119645
|
88 |
79 |
for(ppFrom=&pTab->pIndex; (pThis = *ppFrom)!=0; ppFrom=&pThis->pNext){ |
119647
|
88 |
0 |
if( pThis->onError!=OE_Replace ) continue; |
119648
|
0 |
0 |
while( (pNext = pThis->pNext)!=0 && pNext->onError!=OE_Replace ){ |
|
0 |
0 |
while( (pNext = pThis->pNext)!=0 && pNext->onError!=OE_Replace ){ |
119696
|
78 |
2 |
int nCopy = MIN(ArraySize(aVal), pIdx->nKeyCol); |
119714
|
0 |
80 |
if( x<99 ){ |
119717
|
0 |
80 |
if( pIdx->pPartIdxWhere!=0 ){ x -= 10; assert( 10==sqlite3LogEst(2) ); } |
119723
|
2 |
80 |
for(i=nCopy+1; i<=pIdx->nKeyCol; i++){ |
119728
|
74 |
6 |
if( IsUniqueIndex(pIdx) ) a[pIdx->nKeyCol] = 0; |
119741
|
0 |
0 |
if( db->mallocFailed ){ |
119746
|
0 |
0 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ |
119750
|
0 |
0 |
if( pIndex==0 ){ |
119751
|
0 |
0 |
if( !ifExists ){ |
119760
|
0 |
0 |
if( pIndex->idxType!=SQLITE_IDXTYPE_APPDEF ){ |
119771
|
0 |
0 |
const char *zTab = SCHEMA_TABLE(iDb); |
119772
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){ |
119775
|
0 |
0 |
if( !OMIT_TEMPDB && iDb==1 ) code = SQLITE_DROP_TEMP_INDEX; |
119776
|
0 |
0 |
if( sqlite3AuthCheck(pParse, code, pIndex->zName, pTab->zName, zDb) ){ |
119784
|
0 |
0 |
if( v ){ |
119826
|
224 |
0 |
if( (n & (n-1))==0 ){ |
119827
|
9 |
215 |
sqlite3_int64 sz = (n==0) ? 1 : 2*n; |
119829
|
0 |
224 |
if( pNew==0 ){ |
119850
|
2294 |
88 |
if( pList==0 ){ |
119852
|
0 |
2294 |
if( pList==0 ) return 0; |
119857
|
0 |
88 |
if( pNew==0 ){ |
119865
|
0 |
2382 |
if( IN_RENAME_OBJECT && pList->a[i].zName ){ |
|
0 |
0 |
if( IN_RENAME_OBJECT && pList->a[i].zName ){ |
119876
|
405 |
2294 |
if( pList==0 ) return; |
119878
|
2382 |
2294 |
for(i=0; inId; i++){ |
119891
|
0 |
0 |
for(i=0; inId; i++){ |
119892
|
0 |
0 |
if( sqlite3StrICmp(pList->a[i].zName, zName)==0 ) return i; |
119944
|
11 |
0 |
if( (u32)pSrc->nSrc+nExtra>pSrc->nAlloc ){ |
119949
|
0 |
11 |
if( pSrc->nSrc+nExtra>=SQLITE_MAX_SRCLIST ){ |
119954
|
0 |
11 |
if( nAlloc>SQLITE_MAX_SRCLIST ) nAlloc = SQLITE_MAX_SRCLIST; |
119957
|
0 |
11 |
if( pNew==0 ){ |
119967
|
0 |
11 |
for(i=pSrc->nSrc-1; i>=iStart; i--){ |
119974
|
11 |
11 |
for(i=iStart; i
|
120030
|
4529 |
11 |
if( pList==0 ){ |
120032
|
0 |
4529 |
if( pList==0 ) return 0; |
120039
|
0 |
11 |
if( pNew==0 ){ |
120047
|
1799 |
2741 |
if( pDatabase && pDatabase->z==0 ){ |
|
826 |
973 |
if( pDatabase && pDatabase->z==0 ){ |
120050
|
973 |
3567 |
if( pDatabase ){ |
120067
|
1993 |
0 |
if( ALWAYS(pList) ){ |
120068
|
1452 |
1993 |
for(i=0, pItem=pList->a; inSrc; i++, pItem++){ |
120069
|
13 |
1439 |
if( pItem->iCursor>=0 ) continue; |
120071
|
35 |
1404 |
if( pItem->pSelect ){ |
120084
|
69 |
7755 |
if( pList==0 ) return; |
120085
|
4543 |
7755 |
for(pItem=pList->a, i=0; inSrc; i++, pItem++){ |
120086
|
973 |
3570 |
if( pItem->zDatabase ) sqlite3DbFreeNN(db, pItem->zDatabase); |
120088
|
29 |
4514 |
if( pItem->zAlias ) sqlite3DbFreeNN(db, pItem->zAlias); |
120089
|
0 |
4543 |
if( pItem->fg.isIndexedBy ) sqlite3DbFree(db, pItem->u1.zIndexedBy); |
120090
|
0 |
4543 |
if( pItem->fg.isTabFunc ) sqlite3ExprListDelete(db, pItem->u1.pFuncArg); |
120092
|
22 |
4521 |
if( pItem->pSelect ) sqlite3SelectDelete(db, pItem->pSelect); |
120093
|
0 |
4543 |
if( pItem->fg.isUsing ){ |
120095
|
0 |
4543 |
}else if( pItem->u3.pOn ){ |
120129
|
1426 |
11 |
if( !p && pOnUsing!=0 && (pOnUsing->pOn || pOnUsing->pUsing) ){ |
|
1426 |
0 |
if( !p && pOnUsing!=0 && (pOnUsing->pOn || pOnUsing->pUsing) ){ |
|
1426 |
0 |
if( !p && pOnUsing!=0 && (pOnUsing->pOn || pOnUsing->pUsing) ){ |
|
0 |
1426 |
if( !p && pOnUsing!=0 && (pOnUsing->pOn || pOnUsing->pUsing) ){ |
120130
|
0 |
0 |
sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s", |
120136
|
0 |
1437 |
if( p==0 ){ |
120143
|
0 |
1437 |
if( IN_RENAME_OBJECT && pItem->zName ){ |
|
0 |
0 |
if( IN_RENAME_OBJECT && pItem->zName ){ |
120144
|
0 |
0 |
Token *pToken = (ALWAYS(pDatabase) && pDatabase->z) ? pDatabase : pTable; |
|
0 |
0 |
Token *pToken = (ALWAYS(pDatabase) && pDatabase->z) ? pDatabase : pTable; |
120148
|
29 |
1408 |
if( pAlias->n ){ |
120151
|
35 |
1402 |
if( pSubquery ){ |
120153
|
0 |
35 |
if( pSubquery->selFlags & SF_NestedFrom ){ |
120159
|
0 |
1437 |
if( pOnUsing==0 ){ |
120161
|
0 |
1437 |
}else if( pOnUsing->pUsing ){ |
120182
|
377 |
0 |
if( p && pIndexedBy->n>0 ){ |
|
0 |
377 |
if( p && pIndexedBy->n>0 ){ |
120189
|
0 |
0 |
if( pIndexedBy->n==1 && !pIndexedBy->z ){ |
|
0 |
0 |
if( pIndexedBy->n==1 && !pIndexedBy->z ){ |
120208
|
0 |
0 |
if( p2 ){ |
120210
|
0 |
0 |
if( pNew==0 ){ |
120227
|
0 |
0 |
if( p ){ |
120263
|
1426 |
0 |
if( p && p->nSrc>1 ){ |
|
11 |
1415 |
if( p && p->nSrc>1 ){ |
120268
|
0 |
11 |
}while( (--i)>0 ); |
120273
|
0 |
11 |
if( allFlags & JT_RIGHT ){ |
120274
|
0 |
0 |
for(i=p->nSrc-1; ALWAYS(i>0) && (p->a[i].fg.jointype&JT_RIGHT)==0; i--){} |
|
0 |
0 |
for(i=p->nSrc-1; ALWAYS(i>0) && (p->a[i].fg.jointype&JT_RIGHT)==0; i--){} |
120279
|
0 |
0 |
}while( (--i)>=0 ); |
120295
|
0 |
139 |
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "BEGIN", 0, 0) ){ |
120299
|
0 |
139 |
if( !v ) return; |
120300
|
100 |
39 |
if( type!=TK_DEFERRED ){ |
120301
|
200 |
100 |
for(i=0; inDb; i++){ |
120304
|
118 |
82 |
if( pBt && sqlite3BtreeIsReadonly(pBt) ){ |
|
0 |
118 |
if( pBt && sqlite3BtreeIsReadonly(pBt) ){ |
120306
|
12 |
188 |
}else if( type==TK_EXCLUSIVE ){ |
120331
|
28 |
90 |
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, |
|
0 |
118 |
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, |
120336
|
118 |
0 |
if( v ){ |
120347
|
34 |
0 |
if( zName ){ |
120353
|
34 |
0 |
if( !v || sqlite3AuthCheck(pParse, SQLITE_SAVEPOINT, az[op], zName, 0) ){ |
|
0 |
34 |
if( !v || sqlite3AuthCheck(pParse, SQLITE_SAVEPOINT, az[op], zName, 0) ){ |
120367
|
33 |
2454 |
if( db->aDb[1].pBt==0 && !pParse->explain ){ |
|
33 |
0 |
if( db->aDb[1].pBt==0 && !pParse->explain ){ |
120378
|
0 |
33 |
if( rc!=SQLITE_OK ){ |
120386
|
0 |
33 |
if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize, 0, 0) ){ |
120405
|
4531 |
749 |
if( DbMaskTest(pToplevel->cookieMask, iDb)==0 ){ |
120407
|
2484 |
2047 |
if( !OMIT_TEMPDB && iDb==1 ){ |
120413
|
0 |
1860 |
sqlite3CodeVerifySchemaAtToplevel(sqlite3ParseToplevel(pParse), iDb); |
120424
|
173 |
76 |
for(i=0; inDb; i++){ |
120426
|
128 |
45 |
if( pDb->pBt && (!zDb || 0==sqlite3StrICmp(zDb, pDb->zDbSName)) ){ |
|
101 |
27 |
if( pDb->pBt && (!zDb || 0==sqlite3StrICmp(zDb, pDb->zDbSName)) ){ |
|
57 |
44 |
if( pDb->pBt && (!zDb || 0==sqlite3StrICmp(zDb, pDb->zDbSName)) ){ |
120446
|
0 |
3420 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
120460
|
0 |
45 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
120481
|
0 |
1212 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
120502
|
66 |
0 |
if( onError==OE_Abort ){ |
120524
|
0 |
26 |
if( pIdx->aColExpr ){ |
120527
|
37 |
26 |
for(j=0; jnKeyCol; j++){ |
120531
|
11 |
26 |
if( j ) sqlite3_str_append(&errMsg, ", ", 2); |
120538
|
19 |
7 |
sqlite3HaltConstraint(pParse, |
120555
|
34 |
0 |
if( pTab->iPKey>=0 ){ |
120575
|
0 |
0 |
for(i=0; inColumn; i++){ |
120578
|
0 |
0 |
if( pIndex->aiColumn[i]>=0 && 0==sqlite3StrICmp(z, zColl) ){ |
|
0 |
0 |
if( pIndex->aiColumn[i]>=0 && 0==sqlite3StrICmp(z, zColl) ){ |
120592
|
0 |
0 |
if( !IsVirtual(pTab) ){ |
120595
|
0 |
0 |
for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){ |
120596
|
0 |
0 |
if( zColl==0 || collationMatch(zColl, pIndex) ){ |
|
0 |
0 |
if( zColl==0 || collationMatch(zColl, pIndex) ){ |
120620
|
0 |
0 |
for(iDb=0, pDb=db->aDb; iDbnDb; iDb++, pDb++){ |
120622
|
0 |
0 |
for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){ |
120656
|
0 |
0 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ |
120660
|
0 |
0 |
if( pName1==0 ){ |
120663
|
0 |
0 |
}else if( NEVER(pName2==0) || pName2->z==0 ){ |
|
0 |
0 |
}else if( NEVER(pName2==0) || pName2->z==0 ){ |
120667
|
0 |
0 |
if( !zColl ) return; |
120669
|
0 |
0 |
if( pColl ){ |
120677
|
0 |
0 |
if( iDb<0 ) return; |
120679
|
0 |
0 |
if( z==0 ) return; |
120682
|
0 |
0 |
if( pTab ){ |
120689
|
0 |
0 |
if( pIndex ){ |
120709
|
0 |
82 |
if( pParse->nErr ) return 0; |
120710
|
6 |
76 |
if( pIdx->uniqNotNull ){ |
120715
|
82 |
0 |
if( pKey ){ |
120717
|
222 |
82 |
for(i=0; i
|
120719
|
1 |
221 |
pKey->aColl[i] = zColl==sqlite3StrBINARY ? 0 : |
120724
|
0 |
82 |
if( pParse->nErr ){ |
120726
|
0 |
0 |
if( pIdx->bNoQuery==0 ){ |
120761
|
0 |
0 |
if( db->mallocFailed ){ |
120808
|
0 |
0 |
if( pCte==0 ){ |
120815
|
0 |
0 |
if( zName && pWith ){ |
|
0 |
0 |
if( zName && pWith ){ |
120817
|
0 |
0 |
for(i=0; inCte; i++){ |
120818
|
0 |
0 |
if( sqlite3StrICmp(zName, pWith->a[i].zName)==0 ){ |
120824
|
0 |
0 |
if( pWith ){ |
120832
|
0 |
0 |
if( db->mallocFailed ){ |
120847
|
0 |
0 |
if( pWith ){ |
120849
|
0 |
0 |
for(i=0; inCte; i++){ |
120883
|
12 |
0 |
if( db->xCollNeeded ){ |
120885
|
0 |
12 |
if( !zExternal ) return; |
120890
|
0 |
12 |
if( db->xCollNeeded16 ){ |
120895
|
0 |
0 |
if( zExternal ){ |
120915
|
0 |
0 |
for(i=0; i<3; i++){ |
120917
|
0 |
0 |
if( pColl2->xCmp!=0 ){ |
120938
|
1606 |
720 |
if( pColl && pColl->xCmp==0 ){ |
|
0 |
1606 |
if( pColl && pColl->xCmp==0 ){ |
120942
|
0 |
0 |
if( !p ){ |
120973
|
1946 |
1745 |
if( 0==pColl && create ){ |
|
967 |
979 |
if( 0==pColl && create ){ |
120976
|
967 |
0 |
if( pColl ){ |
120992
|
0 |
967 |
if( pDel!=0 ){ |
121026
|
3691 |
1538 |
if( zName ){ |
121028
|
2712 |
979 |
if( pColl ) pColl += enc-1; |
121072
|
21 |
0 |
if( !p ){ |
121075
|
9 |
12 |
if( !p || !p->xCmp ){ |
|
0 |
9 |
if( !p || !p->xCmp ){ |
121082
|
21 |
0 |
if( p && !p->xCmp && synthCollSeq(db, p) ){ |
|
0 |
21 |
if( p && !p->xCmp && synthCollSeq(db, p) ){ |
|
0 |
0 |
if( p && !p->xCmp && synthCollSeq(db, p) ){ |
121086
|
0 |
21 |
if( p==0 ){ |
121120
|
66 |
0 |
if( !initbusy && (!pColl || !pColl->xCmp) ){ |
|
66 |
0 |
if( !initbusy && (!pColl || !pColl->xCmp) ){ |
|
0 |
66 |
if( !initbusy && (!pColl || !pColl->xCmp) ){ |
121165
|
2821 |
2061 |
if( p->nArg!=nArg ){ |
121166
|
6 |
2815 |
if( nArg==(-2) ) return (p->xSFunc==0) ? 0 : FUNC_PERFECT_MATCH; |
|
6 |
0 |
if( nArg==(-2) ) return (p->xSFunc==0) ? 0 : FUNC_PERFECT_MATCH; |
121167
|
2611 |
204 |
if( p->nArg>=0 ) return 0; |
121172
|
2061 |
204 |
if( p->nArg==nArg ){ |
121179
|
2265 |
0 |
if( enc==(p->funcFlags & SQLITE_FUNC_ENCMASK) ){ |
121181
|
0 |
0 |
}else if( (enc & p->funcFlags & 2)!=0 ){ |
121197
|
95659 |
21216 |
for(p=sqlite3BuiltinFunctions.a[h]; p; p=p->u.pHash){ |
121199
|
3090 |
92569 |
if( sqlite3StrICmp(p->zName, zFunc)==0 ){ |
121214
|
16170 |
550 |
for(i=0; i
|
121221
|
2530 |
13640 |
if( pOther ){ |
121274
|
3848 |
14891 |
while( p ){ |
121276
|
1673 |
2175 |
if( score>bestScore ){ |
121295
|
9803 |
5088 |
if( !createFlag && (pBest==0 || (db->mDbFlags & DBFLAG_PreferBuiltin)!=0) ){ |
|
1667 |
8136 |
if( !createFlag && (pBest==0 || (db->mDbFlags & DBFLAG_PreferBuiltin)!=0) ){ |
|
0 |
1667 |
if( !createFlag && (pBest==0 || (db->mDbFlags & DBFLAG_PreferBuiltin)!=0) ){ |
121299
|
1034 |
8136 |
while( p ){ |
121301
|
592 |
442 |
if( score>bestScore ){ |
121313
|
5088 |
9803 |
if( createFlag && bestScore
|
|
5082 |
6 |
if( createFlag && bestScore
|
|
5082 |
0 |
if( createFlag && bestScore
|
121321
|
44063 |
5082 |
for(z=(u8*)pBest->zName; *z; z++) *z = sqlite3UpperToLower[*z]; |
121323
|
0 |
5082 |
if( pOther==pBest ){ |
121332
|
7315 |
7576 |
if( pBest && (pBest->xSFunc || createFlag) ){ |
|
5088 |
2227 |
if( pBest && (pBest->xSFunc || createFlag) ){ |
|
5082 |
6 |
if( pBest && (pBest->xSFunc || createFlag) ){ |
121356
|
0 |
651 |
for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){ |
121361
|
731 |
651 |
for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){ |
121368
|
433 |
218 |
if( pSchema->schemaFlags & DB_SchemaLoaded ){ |
121380
|
316 |
311 |
if( pBt ){ |
121385
|
0 |
627 |
if( !p ){ |
121387
|
627 |
0 |
}else if ( 0==p->file_format ){ |
121436
|
3079 |
0 |
if( pTab ){ |
121438
|
0 |
3079 |
if( pItem->fg.isIndexedBy && sqlite3IndexedByLookup(pParse, pItem) ){ |
|
0 |
0 |
if( pItem->fg.isIndexedBy && sqlite3IndexedByLookup(pParse, pItem) ){ |
121472
|
22 |
3052 |
if( IsVirtual(pTab) ){ |
121475
|
2652 |
400 |
if( (pTab->tabFlags & (TF_Readonly|TF_Shadow))==0 ) return 0; |
121477
|
351 |
49 |
if( (pTab->tabFlags & TF_Readonly)!=0 ){ |
121478
|
349 |
2 |
return sqlite3WritableSchema(db)==0 && pParse->nested==0; |
|
3 |
346 |
return sqlite3WritableSchema(db)==0 && pParse->nested==0; |
121490
|
3 |
3071 |
if( tabIsReadOnly(pParse, pTab) ){ |
121495
|
3071 |
0 |
if( !viewOk && IsView(pTab) ){ |
|
0 |
3071 |
if( !viewOk && IsView(pTab) ){ |
121525
|
0 |
0 |
if( pFrom ){ |
121695
|
0 |
67 |
if( pParse->nErr ){ |
121707
|
0 |
67 |
if( pTab==0 ) goto delete_from_cleanup; |
121719
|
67 |
0 |
bComplex = pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0); |
|
0 |
67 |
bComplex = pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0); |
121745
|
0 |
67 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ){ |
121749
|
0 |
67 |
if( sqlite3IsReadOnly(pParse, pTab, (pTrigger?1:0)) ){ |
121757
|
2 |
65 |
if( rcauth==SQLITE_DENY ){ |
121766
|
10 |
65 |
for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){ |
121772
|
0 |
65 |
if( isView ){ |
121779
|
0 |
65 |
if( v==0 ){ |
121782
|
58 |
7 |
if( pParse->nested==0 ) sqlite3VdbeCountChanges(v); |
121789
|
0 |
65 |
if( isView ){ |
121804
|
0 |
65 |
if( sqlite3ResolveExprNames(&sNC, pWhere) ){ |
121811
|
0 |
65 |
if( (db->flags & SQLITE_CountRows)!=0 |
121812
|
0 |
0 |
&& !pParse->nested |
121813
|
0 |
0 |
&& !pParse->pTriggerTab |
121814
|
0 |
0 |
&& !pParse->bReturning |
121832
|
65 |
0 |
if( rcauth==SQLITE_OK |
121833
|
32 |
33 |
&& pWhere==0 |
121834
|
32 |
0 |
&& !bComplex |
121835
|
32 |
0 |
&& !IsVirtual(pTab) |
121842
|
32 |
0 |
if( HasRowid(pTab) ){ |
121843
|
0 |
32 |
sqlite3VdbeAddOp4(v, OP_Clear, pTab->tnum, iDb, memCnt ? memCnt : -1, |
121846
|
1 |
32 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
121849
|
1 |
0 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){ |
|
0 |
1 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){ |
121850
|
0 |
0 |
sqlite3VdbeChangeP3(v, -1, memCnt ? memCnt : -1); |
121857
|
0 |
33 |
if( sNC.ncFlags & NC_VarSelect ) bComplex = 1; |
121858
|
0 |
33 |
wcf |= (bComplex ? 0 : WHERE_ONEPASS_MULTIROW); |
121859
|
33 |
0 |
if( HasRowid(pTab) ){ |
121887
|
0 |
33 |
if( pWInfo==0 ) goto delete_from_cleanup; |
121891
|
28 |
5 |
if( eOnePass!=ONEPASS_SINGLE ) sqlite3MultiWrite(pParse); |
121892
|
9 |
24 |
if( sqlite3WhereUsesDeferredSeek(pWInfo) ){ |
121897
|
0 |
33 |
if( memCnt ){ |
121902
|
0 |
33 |
if( pPk ){ |
121903
|
0 |
0 |
for(i=0; i
|
121914
|
32 |
1 |
if( eOnePass!=ONEPASS_OFF ){ |
121920
|
0 |
32 |
if( aToOpen==0 ){ |
121926
|
32 |
0 |
if( aiCurOnePass[0]>=0 ) aToOpen[aiCurOnePass[0]-iTabCur] = 0; |
121927
|
9 |
23 |
if( aiCurOnePass[1]>=0 ) aToOpen[aiCurOnePass[1]-iTabCur] = 0; |
121928
|
0 |
32 |
if( addrEphOpen ) sqlite3VdbeChangeToNoop(v, addrEphOpen); |
121931
|
0 |
1 |
if( pPk ){ |
121951
|
33 |
0 |
if( !isView ){ |
121953
|
27 |
6 |
if( eOnePass==ONEPASS_MULTI ){ |
121961
|
27 |
6 |
if( eOnePass==ONEPASS_MULTI ){ |
121969
|
32 |
1 |
if( eOnePass!=ONEPASS_OFF ){ |
121971
|
32 |
0 |
if( !IsVirtual(pTab) && aToOpen[iDataCur-iTabCur] ){ |
|
0 |
32 |
if( !IsVirtual(pTab) && aToOpen[iDataCur-iTabCur] ){ |
121976
|
0 |
1 |
}else if( pPk ){ |
121978
|
0 |
0 |
if( IsVirtual(pTab) ){ |
121992
|
1 |
32 |
if( IsVirtual(pTab) ){ |
121997
|
0 |
1 |
if( eOnePass==ONEPASS_SINGLE ){ |
121999
|
0 |
0 |
if( sqlite3IsToplevel(pParse) ){ |
122014
|
32 |
1 |
if( eOnePass!=ONEPASS_OFF ){ |
122017
|
0 |
1 |
}else if( pPk ){ |
122030
|
58 |
7 |
if( pParse->nested==0 && pParse->pTriggerTab==0 ){ |
|
58 |
0 |
if( pParse->nested==0 && pParse->pTriggerTab==0 ){ |
122038
|
0 |
65 |
if( memCnt ){ |
122131
|
40 |
0 |
opSeek = HasRowid(pTab) ? OP_NotExists : OP_NotFound; |
122132
|
8 |
32 |
if( eMode==ONEPASS_OFF ){ |
122140
|
40 |
0 |
if( sqlite3FkRequired(pParse, pTab, 0, 0) || pTrigger ){ |
|
0 |
40 |
if( sqlite3FkRequired(pParse, pTab, 0, 0) || pTrigger ){ |
122157
|
0 |
0 |
for(iCol=0; iColnCol; iCol++){ |
122160
|
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) ){ |
122180
|
0 |
0 |
if( addrStart
|
122204
|
40 |
0 |
if( !IsView(pTab) ){ |
122208
|
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") ){ |
122211
|
32 |
8 |
if( eMode!=ONEPASS_OFF ){ |
122214
|
17 |
23 |
if( iIdxNoSeek>=0 && iIdxNoSeek!=iDataCur ){ |
|
17 |
0 |
if( iIdxNoSeek>=0 && iIdxNoSeek!=iDataCur ){ |
122217
|
27 |
13 |
if( eMode==ONEPASS_MULTI ) p5 |= OPFLAG_SAVEPOSITION; |
122273
|
0 |
347 |
pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab); |
122274
|
17 |
347 |
for(i=0, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){ |
122276
|
0 |
17 |
if( aRegIdx!=0 && aRegIdx[i]==0 ) continue; |
|
0 |
0 |
if( aRegIdx!=0 && aRegIdx[i]==0 ) continue; |
122277
|
0 |
17 |
if( pIdx==pPk ) continue; |
122278
|
17 |
0 |
if( iIdxCur+i==iIdxNoSeek ) continue; |
122282
|
0 |
0 |
sqlite3VdbeAddOp3(v, OP_IdxDelete, iIdxCur+i, r1, |
122336
|
5 |
1 |
if( piPartIdxLabel ){ |
122337
|
0 |
5 |
if( pIdx->pPartIdxWhere ){ |
122349
|
0 |
6 |
nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn; |
|
0 |
0 |
nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn; |
122351
|
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; |
122352
|
14 |
6 |
for(j=0; j
|
122353
|
0 |
14 |
if( pPrior |
122354
|
0 |
0 |
&& pPrior->aiColumn[j]==pIdx->aiColumn[j] |
122355
|
0 |
0 |
&& pPrior->aiColumn[j]!=XN_EXPR |
122361
|
8 |
6 |
if( pIdx->aiColumn[j]>=0 ){ |
122371
|
6 |
0 |
if( regOut ){ |
122384
|
0 |
5 |
if( iLabel ){ |
122450
|
0 |
0 |
mask = sqlite3_user_data(context)==0 ? 0 : -1; |
122455
|
0 |
0 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; |
122456
|
0 |
0 |
for(i=1; i
|
122457
|
0 |
0 |
if( sqlite3_value_type(argv[i])==SQLITE_NULL ) return; |
122458
|
0 |
0 |
if( (sqlite3MemCompare(argv[iBest], argv[i], pColl)^mask)>=0 ){ |
122524
|
0 |
14 |
if( z==0 ) return; |
122526
|
161 |
14 |
while( (c = *z)!=0 ){ |
122528
|
3 |
158 |
if( c>=0xc0 ){ |
122529
|
4 |
3 |
while( (*z & 0xc0)==0x80 ){ z++; z0++; } |
122554
|
0 |
0 |
if( iVal<0 ){ |
122555
|
0 |
0 |
if( iVal==SMALLEST_INT64 ){ |
122579
|
0 |
0 |
if( rVal<0 ) rVal = -rVal; |
122616
|
0 |
0 |
if( typeHaystack==SQLITE_NULL || typeNeedle==SQLITE_NULL ) return; |
|
0 |
0 |
if( typeHaystack==SQLITE_NULL || typeNeedle==SQLITE_NULL ) return; |
122619
|
0 |
0 |
if( nNeedle>0 ){ |
122620
|
0 |
0 |
if( typeHaystack==SQLITE_BLOB && typeNeedle==SQLITE_BLOB ){ |
|
0 |
0 |
if( typeHaystack==SQLITE_BLOB && typeNeedle==SQLITE_BLOB ){ |
122624
|
0 |
0 |
}else if( typeHaystack!=SQLITE_BLOB && typeNeedle!=SQLITE_BLOB ){ |
|
0 |
0 |
}else if( typeHaystack!=SQLITE_BLOB && typeNeedle!=SQLITE_BLOB ){ |
122631
|
0 |
0 |
if( zHaystack==0 ) goto endInstrOOM; |
122635
|
0 |
0 |
if( zNeedle==0 ) goto endInstrOOM; |
122639
|
0 |
0 |
if( zNeedle==0 || (nHaystack && zHaystack==0) ) goto endInstrOOM; |
|
0 |
0 |
if( zNeedle==0 || (nHaystack && zHaystack==0) ) goto endInstrOOM; |
|
0 |
0 |
if( zNeedle==0 || (nHaystack && zHaystack==0) ) goto endInstrOOM; |
122641
|
0 |
0 |
while( nNeedle<=nHaystack |
122642
|
0 |
0 |
&& (zHaystack[0]!=firstChar || memcmp(zHaystack, zNeedle, nNeedle)!=0) |
|
0 |
0 |
&& (zHaystack[0]!=firstChar || memcmp(zHaystack, zNeedle, nNeedle)!=0) |
122648
|
0 |
0 |
}while( isText && (zHaystack[0]&0xc0)==0x80 ); |
|
0 |
0 |
}while( isText && (zHaystack[0]&0xc0)==0x80 ); |
122650
|
0 |
0 |
if( nNeedle>nHaystack ) N = 0; |
122676
|
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 ){ |
122714
|
0 |
0 |
if( sqlite3_value_type(argv[1])==SQLITE_NULL |
122715
|
0 |
0 |
|| (argc==3 && sqlite3_value_type(argv[2])==SQLITE_NULL) |
|
0 |
0 |
|| (argc==3 && sqlite3_value_type(argv[2])==SQLITE_NULL) |
122721
|
0 |
0 |
if( p0type==SQLITE_BLOB ){ |
122724
|
0 |
0 |
if( z==0 ) return; |
122728
|
0 |
0 |
if( z==0 ) return; |
122730
|
0 |
0 |
if( p1<0 ){ |
122731
|
0 |
0 |
for(z2=z; *z2; len++){ |
122732
|
0 |
0 |
SQLITE_SKIP_UTF8(z2); |
|
0 |
0 |
SQLITE_SKIP_UTF8(z2); |
122744
|
0 |
0 |
if( argc==3 ){ |
122746
|
0 |
0 |
if( p2<0 ){ |
122753
|
0 |
0 |
if( p1<0 ){ |
122755
|
0 |
0 |
if( p1<0 ){ |
122757
|
0 |
0 |
if( p2<0 ) p2 = 0; |
122760
|
0 |
0 |
}else if( p1>0 ){ |
122762
|
0 |
0 |
}else if( p2>0 ){ |
122765
|
0 |
0 |
if( negP2 ){ |
122767
|
0 |
0 |
if( p1<0 ){ |
122773
|
0 |
0 |
if( p0type!=SQLITE_BLOB ){ |
122774
|
0 |
0 |
while( *z && p1 ){ |
|
0 |
0 |
while( *z && p1 ){ |
122775
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
122778
|
0 |
0 |
for(z2=z; *z2 && p2; p2--){ |
|
0 |
0 |
for(z2=z; *z2 && p2; p2--){ |
122779
|
0 |
0 |
SQLITE_SKIP_UTF8(z2); |
|
0 |
0 |
SQLITE_SKIP_UTF8(z2); |
122784
|
0 |
0 |
if( p1+p2>len ){ |
122786
|
0 |
0 |
if( p2<0 ) p2 = 0; |
122801
|
0 |
0 |
if( argc==2 ){ |
122802
|
0 |
0 |
if( SQLITE_NULL==sqlite3_value_type(argv[1]) ) return; |
122804
|
0 |
0 |
if( n>30 ) n = 30; |
122805
|
0 |
0 |
if( n<0 ) n = 0; |
122807
|
0 |
0 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; |
122813
|
0 |
0 |
if( r<-4503599627370496.0 || r>+4503599627370496.0 ){ |
|
0 |
0 |
if( r<-4503599627370496.0 || r>+4503599627370496.0 ){ |
122815
|
0 |
0 |
}else if( n==0 ){ |
122816
|
0 |
0 |
r = (double)((sqlite_int64)(r+(r<0?-0.5:+0.5))); |
122819
|
0 |
0 |
if( zBuf==0 ){ |
122843
|
0 |
20 |
if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
122848
|
0 |
20 |
if( !z ){ |
122867
|
20 |
0 |
if( z2 ){ |
122869
|
20 |
0 |
if( z1 ){ |
122870
|
100 |
20 |
for(i=0; i
|
122886
|
0 |
0 |
if( z2 ){ |
122888
|
0 |
0 |
if( z1 ){ |
122889
|
0 |
0 |
for(i=0; i
|
122918
|
0 |
0 |
if( r<0 ){ |
122946
|
0 |
0 |
if( n<1 ){ |
122950
|
0 |
0 |
if( p ){ |
123094
|
714 |
56 |
while( (c = Utf8Read(zPattern))!=0 ){ |
|
707 |
63 |
while( (c = Utf8Read(zPattern))!=0 ){ |
123095
|
149 |
558 |
if( c==matchAll ){ /* Match "*" */ |
123099
|
149 |
0 |
while( (c=Utf8Read(zPattern)) == matchAll |
|
0 |
149 |
while( (c=Utf8Read(zPattern)) == matchAll |
123100
|
0 |
149 |
|| (c == matchOne && matchOne!=0) ){ |
|
0 |
0 |
|| (c == matchOne && matchOne!=0) ){ |
123101
|
0 |
0 |
if( c==matchOne && sqlite3Utf8Read(&zString)==0 ){ |
|
0 |
0 |
if( c==matchOne && sqlite3Utf8Read(&zString)==0 ){ |
123105
|
22 |
127 |
if( c==0 ){ |
123107
|
0 |
127 |
}else if( c==matchOther ){ |
123108
|
0 |
0 |
if( pInfo->matchSet==0 ){ |
123110
|
0 |
0 |
if( c==0 ) return SQLITE_NOWILDCARDMATCH; |
123115
|
0 |
0 |
while( *zString ){ |
123117
|
0 |
0 |
if( bMatch!=SQLITE_NOMATCH ) return bMatch; |
123118
|
0 |
0 |
SQLITE_SKIP_UTF8(zString); |
|
0 |
0 |
SQLITE_SKIP_UTF8(zString); |
123133
|
127 |
0 |
if( c<=0x80 ){ |
123136
|
127 |
0 |
if( noCase ){ |
123146
|
110 |
216 |
if( zString[0]==0 ) break; |
123149
|
17 |
199 |
if( bMatch!=SQLITE_NOMATCH ) return bMatch; |
123153
|
0 |
0 |
while( (c2 = Utf8Read(zString))!=0 ){ |
|
0 |
0 |
while( (c2 = Utf8Read(zString))!=0 ){ |
123154
|
0 |
0 |
if( c2!=c ) continue; |
123156
|
0 |
0 |
if( bMatch!=SQLITE_NOMATCH ) return bMatch; |
123161
|
9 |
549 |
if( c==matchOther ){ |
123162
|
9 |
0 |
if( pInfo->matchSet==0 ){ |
123164
|
0 |
9 |
if( c==0 ) return SQLITE_NOMATCH; |
123171
|
0 |
0 |
if( c==0 ) return SQLITE_NOMATCH; |
123173
|
0 |
0 |
if( c2=='^' ){ |
123177
|
0 |
0 |
if( c2==']' ){ |
123178
|
0 |
0 |
if( c==']' ) seen = 1; |
123181
|
0 |
0 |
while( c2 && c2!=']' ){ |
|
0 |
0 |
while( c2 && c2!=']' ){ |
123182
|
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 ){ |
123184
|
0 |
0 |
if( c>=prior_c && c<=c2 ) seen = 1; |
|
0 |
0 |
if( c>=prior_c && c<=c2 ) seen = 1; |
123187
|
0 |
0 |
if( c==c2 ){ |
123194
|
0 |
0 |
if( c2==0 || (seen ^ invert)==0 ){ |
|
0 |
0 |
if( c2==0 || (seen ^ invert)==0 ){ |
123200
|
530 |
28 |
c2 = Utf8Read(zString); |
123201
|
236 |
322 |
if( c==c2 ) continue; |
123202
|
322 |
0 |
if( noCase && sqlite3Tolower(c)==sqlite3Tolower(c2) && c<0x80 && c2<0x80 ){ |
|
54 |
268 |
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 ){ |
123205
|
3 |
265 |
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; |
123279
|
0 |
132 |
if( nPat > db->aLimit[SQLITE_LIMIT_LIKE_PATTERN_LENGTH] ){ |
123283
|
0 |
132 |
if( argc==3 ){ |
123288
|
0 |
0 |
if( zEsc==0 ) return; |
123289
|
0 |
0 |
if( sqlite3Utf8CharLen((char*)zEsc, -1)!=1 ){ |
123295
|
0 |
0 |
if( escape==pInfo->matchAll || escape==pInfo->matchOne ){ |
|
0 |
0 |
if( escape==pInfo->matchAll || escape==pInfo->matchOne ){ |
123298
|
0 |
0 |
if( escape==pInfo->matchAll ) pInfo->matchAll = 0; |
123299
|
0 |
0 |
if( escape==pInfo->matchOne ) pInfo->matchOne = 0; |
123306
|
132 |
0 |
if( zA && zB ){ |
|
132 |
0 |
if( zA && zB ){ |
123327
|
0 |
0 |
if( sqlite3MemCompare(argv[0], argv[1], pColl)!=0 ){ |
123396
|
0 |
0 |
if( (zOptName = (const char*)sqlite3_value_text(argv[0]))!=0 ){ |
123448
|
0 |
0 |
if( zVal ){ |
123450
|
0 |
0 |
if( r1!=r2 ){ |
123466
|
0 |
0 |
if( pStr->accError==0 ){ |
123469
|
0 |
0 |
for(i=0; i
|
123513
|
0 |
0 |
if( str.accError!=SQLITE_OK ){ |
123530
|
0 |
0 |
if( z && z[0] ) sqlite3_result_int(context, sqlite3Utf8Read(&z)); |
|
0 |
0 |
if( z && z[0] ) sqlite3_result_int(context, sqlite3Utf8Read(&z)); |
123546
|
0 |
0 |
if( z==0 ){ |
123550
|
0 |
0 |
for(i=0; i
|
123554
|
0 |
0 |
if( x<0 || x>0x10ffff ) x = 0xfffd; |
|
0 |
0 |
if( x<0 || x>0x10ffff ) x = 0xfffd; |
123556
|
0 |
0 |
if( c<0x00080 ){ |
123558
|
0 |
0 |
}else if( c<0x00800 ){ |
123561
|
0 |
0 |
}else if( c<0x10000 ){ |
123593
|
0 |
0 |
if( zHex ){ |
123594
|
0 |
0 |
for(i=0; i
|
123617
|
0 |
1 |
if( n<0 ) n = 0; |
123619
|
0 |
1 |
if( rc ){ |
123651
|
0 |
0 |
if( zStr==0 ) return; |
123655
|
0 |
0 |
if( zPattern==0 ){ |
123660
|
0 |
0 |
if( zPattern[0]==0 ){ |
123668
|
0 |
0 |
if( zRep==0 ) return; |
123674
|
0 |
0 |
if( zOut==0 ){ |
123679
|
0 |
0 |
for(i=j=0; i<=loopLimit; i++){ |
123680
|
0 |
0 |
if( zStr[i]!=zPattern[0] || memcmp(&zStr[i], zPattern, nPattern) ){ |
|
0 |
0 |
if( zStr[i]!=zPattern[0] || memcmp(&zStr[i], zPattern, nPattern) ){ |
123683
|
0 |
0 |
if( nRep>nPattern ){ |
123687
|
0 |
0 |
if( nOut-1>db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
123693
|
0 |
0 |
if( (cntExpand&(cntExpand-1))==0 ){ |
123699
|
0 |
0 |
if( zOut==0 ){ |
123737
|
0 |
6 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ){ |
123741
|
0 |
6 |
if( zIn==0 ) return; |
123744
|
6 |
0 |
if( argc==1 ){ |
123751
|
0 |
0 |
}else if( (zCharSet = sqlite3_value_text(argv[1]))==0 ){ |
123755
|
0 |
0 |
for(z=zCharSet, nChar=0; *z; nChar++){ |
123756
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
123758
|
0 |
0 |
if( nChar>0 ){ |
123761
|
0 |
0 |
if( azChar==0 ){ |
123765
|
0 |
0 |
for(z=zCharSet, nChar=0; *z; nChar++){ |
123767
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
|
0 |
0 |
SQLITE_SKIP_UTF8(z); |
123772
|
6 |
0 |
if( nChar>0 ){ |
123774
|
6 |
0 |
if( flags & 1 ){ |
123775
|
6 |
0 |
while( nIn>0 ){ |
123777
|
6 |
6 |
for(i=0; i
|
123779
|
6 |
0 |
if( len<=nIn && memcmp(zIn, azChar[i], len)==0 ) break; |
|
0 |
6 |
if( len<=nIn && memcmp(zIn, azChar[i], len)==0 ) break; |
123781
|
6 |
0 |
if( i>=nChar ) break; |
123786
|
6 |
0 |
if( flags & 2 ){ |
123787
|
6 |
0 |
while( nIn>0 ){ |
123789
|
6 |
6 |
for(i=0; i
|
123791
|
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; |
123793
|
6 |
0 |
if( i>=nChar ) break; |
123797
|
0 |
6 |
if( zCharSet ){ |
123898
|
0 |
0 |
if( (db->flags & SQLITE_LoadExtFunc)==0 ){ |
123903
|
0 |
0 |
if( argc==2 ){ |
123908
|
0 |
0 |
if( zFile && sqlite3_load_extension(db, zFile, zProc, &zErrMsg) ){ |
|
0 |
0 |
if( zFile && sqlite3_load_extension(db, zFile, zProc, &zErrMsg) ){ |
123946
|
10 |
0 |
if( p && type!=SQLITE_NULL ){ |
|
10 |
0 |
if( p && type!=SQLITE_NULL ){ |
123948
|
10 |
0 |
if( type==SQLITE_INTEGER ){ |
123951
|
10 |
0 |
if( (p->approx|p->overflow)==0 && sqlite3AddInt64(&p->iSum, v) ){ |
|
0 |
10 |
if( (p->approx|p->overflow)==0 && sqlite3AddInt64(&p->iSum, v) ){ |
123970
|
0 |
0 |
if( ALWAYS(p) && type!=SQLITE_NULL ){ |
|
0 |
0 |
if( ALWAYS(p) && type!=SQLITE_NULL ){ |
123974
|
0 |
0 |
if( type==SQLITE_INTEGER && p->approx==0 ){ |
|
0 |
0 |
if( type==SQLITE_INTEGER && p->approx==0 ){ |
123989
|
5 |
0 |
if( p && p->cnt>0 ){ |
|
5 |
0 |
if( p && p->cnt>0 ){ |
123990
|
0 |
5 |
if( p->overflow ){ |
123992
|
0 |
5 |
}else if( p->approx ){ |
124002
|
0 |
0 |
if( p && p->cnt>0 ){ |
|
0 |
0 |
if( p && p->cnt>0 ){ |
124010
|
0 |
0 |
sqlite3_result_double(context, p ? p->rSum : (double)0); |
124031
|
251 |
56 |
if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && p ){ |
|
251 |
0 |
if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && p ){ |
|
307 |
0 |
if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && p ){ |
124047
|
40 |
4 |
sqlite3_result_int64(context, p ? p->n : 0); |
124054
|
0 |
0 |
if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && ALWAYS(p) ){ |
|
0 |
0 |
if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && ALWAYS(p) ){ |
|
0 |
0 |
if( (argc==0 || SQLITE_NULL!=sqlite3_value_type(argv[0])) && ALWAYS(p) ){ |
124078
|
0 |
27 |
if( !pBest ) return; |
124080
|
0 |
27 |
if( sqlite3_value_type(pArg)==SQLITE_NULL ){ |
124081
|
0 |
0 |
if( pBest->flags ) sqlite3SkipAccumulatorLoad(context); |
124082
|
0 |
27 |
}else if( pBest->flags ){ |
124096
|
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) ){ |
124109
|
27 |
41 |
if( pRes ){ |
124110
|
27 |
0 |
if( pRes->flags ){ |
124113
|
27 |
0 |
if( bValue==0 ) sqlite3VdbeMemRelease(pRes); |
124160
|
0 |
0 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; |
124162
|
0 |
0 |
if( pGCC ){ |
124166
|
0 |
0 |
if( argc==1 ){ |
124167
|
0 |
0 |
if( !firstTerm ){ |
124175
|
0 |
0 |
}else if( !firstTerm ){ |
124178
|
0 |
0 |
if( zSep ){ |
124185
|
0 |
0 |
if( nSep != pGCC->nFirstSepLength || pGCC->pnSepLengths != 0 ){ |
|
0 |
0 |
if( nSep != pGCC->nFirstSepLength || pGCC->pnSepLengths != 0 ){ |
124187
|
0 |
0 |
if( pnsl == 0 ){ |
124190
|
0 |
0 |
if( pnsl!=0 ){ |
124192
|
0 |
0 |
while( inFirstSepLength; |
124197
|
0 |
0 |
if( pnsl!=0 ){ |
124198
|
0 |
0 |
if( ALWAYS(pGCC->nAccum>0) ){ |
124216
|
0 |
0 |
if( zVal ) sqlite3_str_append(&pGCC->str, zVal, nVal); |
124229
|
0 |
0 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; |
124233
|
0 |
0 |
if( ALWAYS(pGCC) ){ |
124240
|
0 |
0 |
if( pGCC->pnSepLengths!=0 ){ |
124242
|
0 |
0 |
if( pGCC->nAccum>0 ){ |
124251
|
0 |
0 |
if( nVS>=(int)pGCC->str.nChar ){ |
124257
|
0 |
0 |
if( pGCC->str.nChar==0 ){ |
124270
|
0 |
0 |
if( pGCC ){ |
124281
|
0 |
0 |
if( pGCC ){ |
124283
|
0 |
0 |
if( pAccum->accError==SQLITE_TOOBIG ){ |
124285
|
0 |
0 |
}else if( pAccum->accError==SQLITE_NOMEM ){ |
124305
|
0 |
311 |
if( rc==SQLITE_NOMEM ){ |
124318
|
0 |
0 |
if( caseSensitive ){ |
124354
|
0 |
218 |
if( !pExpr->x.pList ){ |
124363
|
218 |
0 |
if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_LIKE)==0 ){ |
|
99 |
119 |
if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_LIKE)==0 ){ |
124376
|
119 |
0 |
if( nExpr<3 ){ |
124381
|
0 |
0 |
if( pEscape->op!=TK_STRING ) return 0; |
124384
|
0 |
0 |
if( zEscape[0]==0 || zEscape[1]!=0 ) return 0; |
|
0 |
0 |
if( zEscape[0]==0 || zEscape[1]!=0 ) return 0; |
124385
|
0 |
0 |
if( zEscape[0]==aWc[0] ) return 0; |
124386
|
0 |
0 |
if( zEscape[0]==aWc[1] ) return 0; |
124464
|
0 |
0 |
switch( sqlite3_value_numeric_type(argv[0]) ){ |
124468
|
0 |
0 |
if( x<=0.0 ) return; |
124473
|
0 |
0 |
if( argc==2 ){ |
124474
|
0 |
0 |
switch( sqlite3_value_numeric_type(argv[0]) ){ |
124478
|
0 |
0 |
if( b<=0.0 ) return; |
124480
|
0 |
0 |
if( x<=0.0 ) return; |
124525
|
0 |
0 |
if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return; |
|
0 |
0 |
if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return; |
124547
|
0 |
0 |
if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return; |
|
0 |
0 |
if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return; |
124549
|
0 |
0 |
if( type1!=SQLITE_INTEGER && type1!=SQLITE_FLOAT ) return; |
|
0 |
0 |
if( type1!=SQLITE_INTEGER && type1!=SQLITE_FLOAT ) return; |
124584
|
0 |
0 |
if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return; |
|
0 |
0 |
if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return; |
124586
|
0 |
0 |
sqlite3_result_int(context, x<0.0 ? -1 : x>0.0 ? +1 : 0); |
124984
|
10 |
0 |
if( nCol==1 ){ |
124992
|
10 |
0 |
if( pParent->iPKey>=0 ){ |
124993
|
0 |
10 |
if( !zKey ) return 0; |
124994
|
10 |
0 |
if( !sqlite3StrICmp(pParent->aCol[pParent->iPKey].zCnName, zKey) ){ |
124998
|
0 |
0 |
}else if( paiCol ){ |
125001
|
0 |
0 |
if( !aiCol ) return 1; |
125005
|
0 |
0 |
for(pIdx=pParent->pIndex; pIdx; pIdx=pIdx->pNext){ |
125006
|
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 ){ |
125011
|
0 |
0 |
if( zKey==0 ){ |
125015
|
0 |
0 |
if( IsPrimaryKeyIndex(pIdx) ){ |
125016
|
0 |
0 |
if( aiCol ){ |
125018
|
0 |
0 |
for(i=0; iaCol[i].iFrom; |
125028
|
0 |
0 |
for(i=0; i
|
125033
|
0 |
0 |
if( iCol<0 ) break; /* No foreign keys against expression indexes */ |
125039
|
0 |
0 |
if( !zDfltColl ) zDfltColl = sqlite3StrBINARY; |
125040
|
0 |
0 |
if( sqlite3StrICmp(pIdx->azColl[i], zDfltColl) ) break; |
125043
|
0 |
0 |
for(j=0; j
|
125044
|
0 |
0 |
if( sqlite3StrICmp(pFKey->aCol[j].zCol, zIdxCol)==0 ){ |
125045
|
0 |
0 |
if( aiCol ) aiCol[i] = pFKey->aCol[j].iFrom; |
125049
|
0 |
0 |
if( j==nCol ) break; |
125051
|
0 |
0 |
if( i==nCol ) break; /* pIdx is usable */ |
125056
|
0 |
0 |
if( !pIdx ){ |
125057
|
0 |
0 |
if( !pParse->disableTriggers ){ |
125125
|
2 |
8 |
if( nIncr<0 ){ |
125129
|
10 |
10 |
for(i=0; inCol; i++){ |
125134
|
10 |
0 |
if( isIgnore==0 ){ |
125135
|
10 |
0 |
if( pIdx==0 ){ |
125155
|
0 |
10 |
if( pTab==pFKey->pFrom && nIncr==1 ){ |
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr==1 ){ |
125172
|
0 |
0 |
for(i=0; i
|
125188
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr==1 ){ |
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr==1 ){ |
125190
|
0 |
0 |
for(i=0; i
|
125198
|
0 |
0 |
if( pIdx->aiColumn[i]==pTab->iPKey ){ |
125216
|
10 |
0 |
if( !pFKey->isDeferred && !(pParse->db->flags & SQLITE_DeferFKs) |
|
10 |
0 |
if( !pFKey->isDeferred && !(pParse->db->flags & SQLITE_DeferFKs) |
125217
|
10 |
0 |
&& !pParse->pToplevel |
125218
|
6 |
4 |
&& !pParse->isMultiWrite |
125228
|
2 |
2 |
if( nIncr>0 && pFKey->isDeferred==0 ){ |
|
2 |
0 |
if( nIncr>0 && pFKey->isDeferred==0 ){ |
125259
|
0 |
0 |
if( pExpr ){ |
125260
|
0 |
0 |
if( iCol>=0 && iCol!=pTab->iPKey ){ |
|
0 |
0 |
if( iCol>=0 && iCol!=pTab->iPKey ){ |
125265
|
0 |
0 |
if( zColl==0 ) zColl = db->pDfltColl->zName; |
125286
|
0 |
0 |
if( pExpr ){ |
125346
|
0 |
0 |
if( nIncr<0 ){ |
125359
|
0 |
0 |
for(i=0; inCol; i++){ |
125366
|
0 |
0 |
iCol = pIdx ? pIdx->aiColumn[i] : -1; |
125368
|
0 |
0 |
iCol = aiCol ? aiCol[i] : pFKey->aCol[0].iFrom; |
125390
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr>0 ){ |
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr>0 ){ |
125394
|
0 |
0 |
if( HasRowid(pTab) ){ |
125401
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
125423
|
0 |
0 |
if( pParse->nErr==0 ){ |
125426
|
0 |
0 |
if( pWInfo ){ |
125433
|
0 |
0 |
if( iFkIfZero ){ |
125465
|
0 |
32 |
if( p ){ |
125483
|
486 |
273 |
for(k=sqliteHashFirst(pHash); k; k=sqliteHashNext(k)){ |
125486
|
66 |
420 |
if( !IsOrdinaryTable(pTab) ) continue; |
125487
|
0 |
420 |
for(pFKey=pTab->u.tab.pFKey; pFKey; pFKey=pFKey->pNextFrom){ |
125513
|
0 |
7 |
if( (db->flags&SQLITE_ForeignKeys) && IsOrdinaryTable(pTab) ){ |
|
0 |
0 |
if( (db->flags&SQLITE_ForeignKeys) && IsOrdinaryTable(pTab) ){ |
125519
|
0 |
0 |
if( sqlite3FkReferences(pTab)==0 ){ |
125526
|
0 |
0 |
for(p=pTab->u.tab.pFKey; p; p=p->pNextFrom){ |
125527
|
0 |
0 |
if( p->isDeferred || (db->flags & SQLITE_DeferFKs) ) break; |
|
0 |
0 |
if( p->isDeferred || (db->flags & SQLITE_DeferFKs) ) break; |
125529
|
0 |
0 |
if( !p ) return; |
125547
|
0 |
0 |
if( (db->flags & SQLITE_DeferFKs)==0 ){ |
125555
|
0 |
0 |
if( iSkip ){ |
125581
|
6 |
0 |
for(i=0; inCol; i++){ |
125583
|
6 |
0 |
if( aChange[iChildKey]>=0 ) return 1; |
125584
|
0 |
0 |
if( iChildKey==pTab->iPKey && bChngRowid ) return 1; |
|
0 |
0 |
if( iChildKey==pTab->iPKey && bChngRowid ) return 1; |
125608
|
0 |
0 |
for(i=0; inCol; i++){ |
125611
|
0 |
0 |
for(iKey=0; iKeynCol; iKey++){ |
125612
|
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) ){ |
125614
|
0 |
0 |
if( zKey ){ |
125615
|
0 |
0 |
if( 0==sqlite3StrICmp(pCol->zCnName, zKey) ) return 1; |
125616
|
0 |
0 |
}else if( pCol->colFlags & COLFLAG_PRIMKEY ){ |
125631
|
0 |
8 |
Parse *pTop = sqlite3ParseToplevel(pParse); |
125632
|
0 |
8 |
if( pTop->pTriggerPrg ){ |
125634
|
0 |
0 |
if( (p==pFKey->apTrigger[0] && pFKey->aAction[0]==OE_SetNull) |
|
0 |
0 |
if( (p==pFKey->apTrigger[0] && pFKey->aAction[0]==OE_SetNull) |
125635
|
0 |
0 |
|| (p==pFKey->apTrigger[1] && pFKey->aAction[1]==OE_SetNull) |
|
0 |
0 |
|| (p==pFKey->apTrigger[1] && pFKey->aAction[1]==OE_SetNull) |
125681
|
2647 |
31 |
if( (db->flags&SQLITE_ForeignKeys)==0 ) return; |
125682
|
0 |
31 |
if( !IsOrdinaryTable(pTab) ) return; |
125689
|
10 |
31 |
for(pFKey=pTab->u.tab.pFKey; pFKey; pFKey=pFKey->pNextFrom){ |
125698
|
4 |
6 |
if( aChange |
125699
|
4 |
0 |
&& sqlite3_stricmp(pTab->zName, pFKey->zTo)!=0 |
125700
|
0 |
4 |
&& fkChildIsModified(pTab, pFKey, aChange, bChngRowid)==0 |
125709
|
0 |
10 |
if( pParse->disableTriggers ){ |
125714
|
10 |
0 |
if( !pTo || sqlite3FkLocateIndex(pParse, pTo, pFKey, &pIdx, &aiFree) ){ |
|
0 |
10 |
if( !pTo || sqlite3FkLocateIndex(pParse, pTo, pFKey, &pIdx, &aiFree) ){ |
125716
|
0 |
0 |
if( !isIgnoreErrors || db->mallocFailed ) return; |
|
0 |
0 |
if( !isIgnoreErrors || db->mallocFailed ) return; |
125717
|
0 |
0 |
if( pTo==0 ){ |
125727
|
0 |
0 |
for(i=0; inCol; i++){ |
125739
|
0 |
10 |
if( aiFree ){ |
125745
|
10 |
10 |
for(i=0; inCol; i++){ |
125746
|
0 |
10 |
if( aiCol[i]==pTab->iPKey ){ |
125754
|
0 |
10 |
if( db->xAuth ){ |
125756
|
0 |
0 |
char *zCol = pTo->aCol[pIdx ? pIdx->aiColumn[i] : pTo->iPKey].zCnName; |
125769
|
2 |
8 |
if( regOld!=0 ){ |
125775
|
8 |
2 |
if( regNew!=0 && !isSetNullAction(pParse, pFKey) ){ |
|
8 |
0 |
if( regNew!=0 && !isSetNullAction(pParse, pFKey) ){ |
125792
|
15 |
31 |
for(pFKey = sqlite3FkReferences(pTab); pFKey; pFKey=pFKey->pNextTo){ |
125797
|
0 |
15 |
if( aChange && fkParentIsModified(pTab, pFKey, aChange, bChngRowid)==0 ){ |
|
0 |
0 |
if( aChange && fkParentIsModified(pTab, pFKey, aChange, bChngRowid)==0 ){ |
125801
|
15 |
0 |
if( !pFKey->isDeferred && !(db->flags & SQLITE_DeferFKs) |
|
15 |
0 |
if( !pFKey->isDeferred && !(db->flags & SQLITE_DeferFKs) |
125802
|
15 |
0 |
&& !pParse->pToplevel && !pParse->isMultiWrite |
|
15 |
0 |
&& !pParse->pToplevel && !pParse->isMultiWrite |
125810
|
0 |
0 |
if( sqlite3FkLocateIndex(pParse, pTab, pFKey, &pIdx, &aiCol) ){ |
125811
|
0 |
0 |
if( !isIgnoreErrors || db->mallocFailed ) return; |
|
0 |
0 |
if( !isIgnoreErrors || db->mallocFailed ) return; |
125819
|
0 |
0 |
if( pSrc ){ |
125826
|
0 |
0 |
if( regNew!=0 ){ |
125829
|
0 |
0 |
if( regOld!=0 ){ |
125849
|
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 ){ |
125871
|
2 |
0 |
if( pParse->db->flags&SQLITE_ForeignKeys && IsOrdinaryTable(pTab) ){ |
|
2 |
0 |
if( pParse->db->flags&SQLITE_ForeignKeys && IsOrdinaryTable(pTab) ){ |
125874
|
2 |
2 |
for(p=pTab->u.tab.pFKey; p; p=p->pNextFrom){ |
125875
|
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); |
125877
|
0 |
2 |
for(p=sqlite3FkReferences(pTab); p; p=p->pNextTo){ |
125880
|
0 |
0 |
if( pIdx ){ |
125881
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
125883
|
0 |
0 |
mask |= COLUMN_MASK(pIdx->aiColumn[i]); |
125924
|
61 |
397 |
if( pParse->db->flags&SQLITE_ForeignKeys && IsOrdinaryTable(pTab) ){ |
|
61 |
0 |
if( pParse->db->flags&SQLITE_ForeignKeys && IsOrdinaryTable(pTab) ){ |
125925
|
44 |
17 |
if( !aChange ){ |
125929
|
29 |
15 |
bHaveFK = (sqlite3FkReferences(pTab) || pTab->u.tab.pFKey); |
|
8 |
21 |
bHaveFK = (sqlite3FkReferences(pTab) || pTab->u.tab.pFKey); |
125936
|
2 |
17 |
for(p=pTab->u.tab.pFKey; p; p=p->pNextFrom){ |
125937
|
2 |
0 |
if( fkChildIsModified(pTab, p, aChange, chngRowid) ){ |
125938
|
0 |
2 |
if( 0==sqlite3_stricmp(pTab->zName, p->zTo) ) eRet = 2; |
125944
|
0 |
17 |
for(p=sqlite3FkReferences(pTab); p; p=p->pNextTo){ |
125945
|
0 |
0 |
if( fkParentIsModified(pTab, p, aChange, chngRowid) ){ |
125946
|
0 |
0 |
if( p->aAction[1]!=OE_None ) return 2; |
125952
|
25 |
433 |
return bHaveFK ? eRet : 0; |
125996
|
0 |
0 |
if( action==OE_Restrict && (db->flags & SQLITE_DeferFKs) ){ |
|
0 |
0 |
if( action==OE_Restrict && (db->flags & SQLITE_DeferFKs) ){ |
126001
|
0 |
0 |
if( action!=OE_None && !pTrigger ){ |
|
0 |
0 |
if( action!=OE_None && !pTrigger ){ |
126013
|
0 |
0 |
if( sqlite3FkLocateIndex(pParse, pTab, pFKey, &pIdx, &aiCol) ) return 0; |
126016
|
0 |
0 |
for(i=0; inCol; i++){ |
126024
|
0 |
0 |
iFromCol = aiCol ? aiCol[i] : pFKey->aCol[0].iFrom; |
126029
|
0 |
0 |
pTab->aCol[pIdx ? pIdx->aiColumn[i] : pTab->iPKey].zCnName); |
126049
|
0 |
0 |
if( pChanges ){ |
126061
|
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) ){ |
126063
|
0 |
0 |
if( action==OE_Cascade ){ |
126067
|
0 |
0 |
}else if( action==OE_SetDflt ){ |
126070
|
0 |
0 |
if( pCol->colFlags & COLFLAG_GENERATED ){ |
126077
|
0 |
0 |
if( pDflt ){ |
126094
|
0 |
0 |
if( action==OE_Restrict ){ |
126106
|
0 |
0 |
if( pRaise ){ |
126126
|
0 |
0 |
if( pTrigger ){ |
126134
|
0 |
0 |
if( pWhen ){ |
126141
|
0 |
0 |
EnableLookaside; |
126147
|
0 |
0 |
if( db->mallocFailed==1 ){ |
126159
|
0 |
0 |
if( !pChanges ){ |
126171
|
0 |
0 |
pTrigger->op = (pChanges ? TK_UPDATE : TK_DELETE); |
126193
|
2 |
40 |
if( pParse->db->flags&SQLITE_ForeignKeys ){ |
126195
|
0 |
2 |
for(pFKey = sqlite3FkReferences(pTab); pFKey; pFKey=pFKey->pNextTo){ |
126196
|
0 |
0 |
if( aChange==0 || fkParentIsModified(pTab, pFKey, aChange, bChngRowid) ){ |
|
0 |
0 |
if( aChange==0 || fkParentIsModified(pTab, pFKey, aChange, bChngRowid) ){ |
126198
|
0 |
0 |
if( pAct ){ |
126218
|
16 |
1015 |
for(pFKey=pTab->u.tab.pFKey; pFKey; pFKey=pNext){ |
126222
|
8 |
8 |
if( !db || db->pnBytesFreed==0 ){ |
|
8 |
0 |
if( !db || db->pnBytesFreed==0 ){ |
126223
|
0 |
16 |
if( pFKey->pPrevTo ){ |
126227
|
0 |
16 |
const char *z = (p ? pFKey->pNextTo->zTo : pFKey->zTo); |
126230
|
0 |
16 |
if( pFKey->pNextTo ){ |
126293
|
4280 |
0 |
if( HasRowid(pTab) ){ |
126327
|
17 |
27 |
if( !pIdx->zColAff ){ |
126339
|
0 |
17 |
if( !pIdx->zColAff ){ |
126343
|
49 |
17 |
for(n=0; nnColumn; n++){ |
126346
|
32 |
17 |
if( x>=0 ){ |
126348
|
17 |
0 |
}else if( x==XN_ROWID ){ |
126355
|
0 |
49 |
if( aff
|
126356
|
43 |
6 |
if( aff>SQLITE_AFF_NUMERIC) aff = SQLITE_AFF_NUMERIC; |
126408
|
0 |
2981 |
if( pTab->tabFlags & TF_Strict ){ |
126409
|
0 |
0 |
if( iReg==0 ){ |
126428
|
361 |
2620 |
if( zColAff==0 ){ |
126431
|
0 |
361 |
if( !zColAff ){ |
126436
|
1303 |
361 |
for(i=j=0; inCol; i++){ |
126438
|
1303 |
0 |
if( (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 ){ |
126444
|
445 |
61 |
}while( j>=0 && zColAff[j]<=SQLITE_AFF_BLOB ); |
|
145 |
300 |
}while( j>=0 && zColAff[j]<=SQLITE_AFF_BLOB ); |
126449
|
554 |
2427 |
if( i ){ |
126450
|
20 |
534 |
if( iReg ){ |
126471
|
2 |
2 |
VTable *pVTab = IsVirtual(pTab) ? sqlite3GetVTable(p->db, pTab) : 0; |
126474
|
46 |
4 |
for(i=1; i
|
126477
|
0 |
46 |
if( pOp->opcode==OP_OpenRead && pOp->p3==iDb ){ |
|
0 |
0 |
if( pOp->opcode==OP_OpenRead && pOp->p3==iDb ){ |
126480
|
0 |
0 |
if( tnum==pTab->tnum ){ |
126483
|
0 |
0 |
for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){ |
126484
|
0 |
0 |
if( tnum==pIndex->tnum ){ |
126490
|
0 |
46 |
if( pOp->opcode==OP_VOpen && pOp->p4.pVtab==pVTab ){ |
|
0 |
0 |
if( pOp->opcode==OP_VOpen && pOp->p4.pVtab==pVTab ){ |
126504
|
0 |
0 |
if( pExpr->op==TK_COLUMN && pExpr->iColumn>=0 ){ |
|
0 |
0 |
if( pExpr->op==TK_COLUMN && pExpr->iColumn>=0 ){ |
126538
|
0 |
0 |
if( (pTab->tabFlags & TF_HasStored)!=0 ){ |
126540
|
0 |
0 |
if( pOp->opcode==OP_Affinity ){ |
126548
|
0 |
0 |
for(ii=jj=0; zP4[jj]; ii++){ |
126549
|
0 |
0 |
if( pTab->aCol[ii].colFlags & COLFLAG_VIRTUAL ){ |
126552
|
0 |
0 |
if( pTab->aCol[ii].colFlags & COLFLAG_STORED ){ |
126557
|
0 |
0 |
}else if( pOp->opcode==OP_TypeCheck ){ |
126569
|
0 |
0 |
for(i=0; inCol; i++){ |
126570
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_GENERATED ){ |
126591
|
0 |
0 |
for(i=0; inCol; i++){ |
126593
|
0 |
0 |
if( (pCol->colFlags & COLFLAG_NOTAVAIL)!=0 ){ |
126599
|
0 |
0 |
if( w.eCode & COLFLAG_NOTAVAIL ){ |
126610
|
0 |
0 |
}while( pRedo && eProgress ); |
|
0 |
0 |
}while( pRedo && eProgress ); |
126611
|
0 |
0 |
if( pRedo ){ |
126650
|
2 |
2695 |
if( (pTab->tabFlags & TF_Autoincrement)!=0 |
126651
|
2 |
0 |
&& (pParse->db->mDbFlags & DBFLAG_Vacuum)==0 |
126653
|
0 |
2 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
126660
|
2 |
0 |
if( pSeqTab==0 |
126661
|
2 |
0 |
|| !HasRowid(pSeqTab) |
126662
|
2 |
0 |
|| NEVER(IsVirtual(pSeqTab)) |
126663
|
0 |
2 |
|| pSeqTab->nCol!=2 |
126671
|
0 |
2 |
while( pInfo && pInfo->pTab!=pTab ){ pInfo = pInfo->pNext; } |
|
0 |
0 |
while( pInfo && pInfo->pTab!=pTab ){ pInfo = pInfo->pNext; } |
126672
|
2 |
0 |
if( pInfo==0 ){ |
126676
|
0 |
2 |
if( pParse->db->mallocFailed ) return 0; |
126707
|
2 |
4863 |
for(p = pParse->pAinc; p; p = p->pNext){ |
126730
|
0 |
2 |
if( aOp==0 ) break; |
126743
|
0 |
2 |
if( pParse->nTab==0 ) pParse->nTab = 1; |
126756
|
2 |
2693 |
if( memId>0 ){ |
126774
|
2 |
2 |
for(p = pParse->pAinc; p; p = p->pNext){ |
126794
|
0 |
2 |
if( aOp==0 ) break; |
126806
|
2 |
2719 |
if( pParse->pAinc ) autoIncrementEnd(pParse); |
126972
|
0 |
2697 |
if( pParse->nErr ){ |
126982
|
2697 |
0 |
if( pSelect && (pSelect->selFlags & SF_Values)!=0 && pSelect->pPrior==0 ){ |
|
2697 |
0 |
if( pSelect && (pSelect->selFlags & SF_Values)!=0 && pSelect->pPrior==0 ){ |
|
2693 |
4 |
if( pSelect && (pSelect->selFlags & SF_Values)!=0 && pSelect->pPrior==0 ){ |
126993
|
0 |
2697 |
if( pTab==0 ){ |
126998
|
0 |
2697 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, |
127032
|
0 |
2697 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ){ |
127038
|
0 |
2697 |
if( sqlite3IsReadOnly(pParse, pTab, tmask) ){ |
127045
|
0 |
2697 |
if( v==0 ) goto insert_cleanup; |
127046
|
2658 |
39 |
if( pParse->nested==0 ) sqlite3VdbeCountChanges(v); |
127047
|
2693 |
4 |
sqlite3BeginWriteOperation(pParse, pSelect || pTrigger, iDb); |
|
0 |
2693 |
sqlite3BeginWriteOperation(pParse, pSelect || pTrigger, iDb); |
127059
|
403 |
2294 |
if( pColumn==0 |
127060
|
2 |
401 |
&& pSelect!=0 |
127061
|
2 |
0 |
&& pTrigger==0 |
127062
|
0 |
2 |
&& xferOptimization(pParse, pTab, pSelect, onError, iDb) |
127080
|
21 |
2676 |
if( IsVirtual(pTab) ){ |
127106
|
2294 |
403 |
if( pColumn ){ |
127109
|
2382 |
2294 |
for(i=0; inId; i++){ |
127112
|
2382 |
2294 |
for(i=0; inId; i++){ |
127113
|
2555 |
0 |
for(j=0; jnCol; j++){ |
127114
|
2382 |
173 |
if( sqlite3StrICmp(pColumn->a[i].zName, pTab->aCol[j].zCnName)==0 ){ |
127116
|
53 |
2329 |
if( i!=j ) bIdListInOrder = 0; |
127117
|
19 |
2363 |
if( j==pTab->iPKey ){ |
127121
|
0 |
2382 |
if( pTab->aCol[j].colFlags & (COLFLAG_STORED|COLFLAG_VIRTUAL) ){ |
127131
|
0 |
2382 |
if( j>=pTab->nCol ){ |
127132
|
0 |
0 |
if( sqlite3IsRowid(pColumn->a[i].zName) && !withoutRowid ){ |
|
0 |
0 |
if( sqlite3IsRowid(pColumn->a[i].zName) && !withoutRowid ){ |
127150
|
4 |
2693 |
if( pSelect ){ |
127161
|
4 |
0 |
dest.iSdst = bIdListInOrder ? regData : 0; |
127166
|
4 |
0 |
if( rc || pParse->nErr ) goto insert_cleanup; |
|
4 |
0 |
if( rc || pParse->nErr ) goto insert_cleanup; |
127182
|
4 |
0 |
if( pTrigger || readsTable(pParse, iDb, pTab) ){ |
|
0 |
4 |
if( pTrigger || readsTable(pParse, iDb, pTab) ){ |
127186
|
0 |
4 |
if( useTempTable ){ |
127223
|
2693 |
0 |
if( pList ){ |
127225
|
2 |
2691 |
if( sqlite3ResolveExprListNames(&sNC, pList) ){ |
127237
|
401 |
2294 |
if( pColumn==0 && nColumn>0 ){ |
|
401 |
0 |
if( pColumn==0 && nColumn>0 ){ |
127240
|
33 |
368 |
if( ipkColumn>=0 && (pTab->tabFlags & TF_HasGenerated)!=0 ){ |
|
0 |
33 |
if( ipkColumn>=0 && (pTab->tabFlags & TF_HasGenerated)!=0 ){ |
127243
|
0 |
0 |
for(i=ipkColumn-1; i>=0; i--){ |
127244
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_GENERATED ){ |
127259
|
0 |
401 |
if( (pTab->tabFlags & (TF_HasGenerated|TF_HasHidden))!=0 ){ |
127260
|
0 |
0 |
for(i=0; inCol; i++){ |
127261
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_NOINSERT ) nHidden++; |
127264
|
0 |
401 |
if( nColumn!=(pTab->nCol-nHidden) ){ |
127271
|
2294 |
401 |
if( pColumn!=0 && nColumn!=pColumn->nId ){ |
|
0 |
2294 |
if( pColumn!=0 && nColumn!=pColumn->nId ){ |
127278
|
0 |
2695 |
if( (db->flags & SQLITE_CountRows)!=0 |
127279
|
0 |
0 |
&& !pParse->nested |
127280
|
0 |
0 |
&& !pParse->pTriggerTab |
127281
|
0 |
0 |
&& !pParse->bReturning |
127288
|
2695 |
0 |
if( !isView ){ |
127293
|
0 |
2695 |
if( aRegIdx==0 ){ |
127296
|
33 |
2695 |
for(i=0, pIdx=pTab->pIndex; ipNext, i++){ |
127304
|
0 |
2695 |
if( pUpsert ){ |
127306
|
0 |
0 |
if( IsVirtual(pTab) ){ |
127311
|
0 |
0 |
if( IsView(pTab) ){ |
127315
|
0 |
0 |
if( sqlite3HasExplicitNulls(pParse, pUpsert->pUpsertTarget) ){ |
127325
|
0 |
0 |
if( pNx->pUpsertTarget ){ |
127326
|
0 |
0 |
if( sqlite3UpsertAnalyzeTarget(pParse, pTabList, pNx) ){ |
127331
|
0 |
0 |
}while( pNx!=0 ); |
127337
|
0 |
2695 |
if( useTempTable ){ |
127349
|
4 |
2691 |
}else if( pSelect ){ |
127361
|
2 |
2 |
if( ipkColumn>=0 ){ |
127378
|
3233 |
2695 |
for(i=0; inCol; i++, iRegStore++){ |
127382
|
73 |
3160 |
if( i==pTab->iPKey ){ |
127390
|
51 |
3109 |
if( ((colFlags = pTab->aCol[i].colFlags) & COLFLAG_NOINSERT)!=0 ){ |
127392
|
0 |
51 |
if( (colFlags & COLFLAG_VIRTUAL)!=0 ){ |
127398
|
0 |
51 |
}else if( (colFlags & COLFLAG_STORED)!=0 ){ |
127403
|
0 |
0 |
if( tmask & TRIGGER_BEFORE ){ |
127407
|
0 |
51 |
}else if( pColumn==0 ){ |
127416
|
2418 |
742 |
if( pColumn ){ |
127418
|
2593 |
55 |
for(j=0; jnId && pColumn->a[j].u4.idx!=i; j++){} |
|
230 |
2363 |
for(j=0; jnId && pColumn->a[j].u4.idx!=i; j++){} |
127419
|
55 |
2363 |
if( j>=pColumn->nId ){ |
127428
|
0 |
742 |
}else if( nColumn==0 ){ |
127438
|
0 |
3105 |
if( useTempTable ){ |
127440
|
4 |
3101 |
}else if( pSelect ){ |
127441
|
0 |
4 |
if( regFromSelect!=regData ){ |
127453
|
0 |
2695 |
if( tmask & TRIGGER_BEFORE ){ |
127462
|
0 |
0 |
if( ipkColumn<0 ){ |
127467
|
0 |
0 |
if( useTempTable ){ |
127488
|
0 |
0 |
if( pTab->tabFlags & TF_HasGenerated ){ |
127500
|
0 |
0 |
if( !isView ){ |
127511
|
2695 |
0 |
if( !isView ){ |
127512
|
21 |
2674 |
if( IsVirtual(pTab) ){ |
127516
|
52 |
2643 |
if( ipkColumn>=0 ){ |
127518
|
0 |
52 |
if( useTempTable ){ |
127520
|
50 |
2 |
}else if( pSelect ){ |
127524
|
0 |
50 |
if( pIpk->op==TK_NULL && !IsVirtual(pTab) ){ |
|
0 |
0 |
if( pIpk->op==TK_NULL && !IsVirtual(pTab) ){ |
127534
|
52 |
0 |
if( !appendFlag ){ |
127536
|
52 |
0 |
if( !IsVirtual(pTab) ){ |
127546
|
2622 |
21 |
}else if( IsVirtual(pTab) || withoutRowid ){ |
|
0 |
2622 |
}else if( IsVirtual(pTab) || withoutRowid ){ |
127559
|
0 |
2695 |
if( pTab->tabFlags & TF_HasGenerated ){ |
127568
|
21 |
2674 |
if( IsVirtual(pTab) ){ |
127572
|
4 |
17 |
sqlite3VdbeChangeP5(v, onError==OE_Default ? OE_Abort : onError); |
127592
|
26 |
2648 |
bUseSeek = (isReplace==0 || !sqlite3VdbeHasSubProgram(v)); |
|
26 |
0 |
bUseSeek = (isReplace==0 || !sqlite3VdbeHasSubProgram(v)); |
127608
|
0 |
2695 |
if( regRowCount ){ |
127612
|
0 |
2695 |
if( pTrigger ){ |
127622
|
0 |
2695 |
if( useTempTable ){ |
127626
|
4 |
2691 |
}else if( pSelect ){ |
127647
|
2656 |
39 |
if( pParse->nested==0 && pParse->pTriggerTab==0 ){ |
|
2656 |
0 |
if( pParse->nested==0 && pParse->pTriggerTab==0 ){ |
127656
|
0 |
2695 |
if( regRowCount ){ |
127695
|
0 |
0 |
if( pExpr->op==TK_COLUMN ){ |
127697
|
0 |
0 |
if( pExpr->iColumn>=0 ){ |
127698
|
0 |
0 |
if( pWalker->u.aiCol[pExpr->iColumn]>=0 ){ |
127734
|
0 |
0 |
if( !chngRowid ){ |
127783
|
0 |
2981 |
if( pIter->eType ){ |
127794
|
0 |
33 |
if( pIter->eType ){ |
127796
|
0 |
0 |
if( i>=pIter->u.ax.nIdx ){ |
127952
|
2981 |
0 |
if( HasRowid(pTab) ){ |
127966
|
47 |
2934 |
if( pTab->tabFlags & TF_HasNotNull ){ |
127971
|
117 |
47 |
for(i=0; i
|
127976
|
17 |
100 |
if( onError==OE_None ) continue; /* No NOT NULL on this column */ |
127977
|
19 |
81 |
if( i==pTab->iPKey ){ |
127981
|
0 |
81 |
if( isGenerated && !b2ndPass ){ |
|
0 |
0 |
if( isGenerated && !b2ndPass ){ |
127985
|
0 |
81 |
if( aiChng && aiChng[i]<0 && !isGenerated ){ |
|
0 |
0 |
if( aiChng && aiChng[i]<0 && !isGenerated ){ |
|
0 |
0 |
if( aiChng && aiChng[i]<0 && !isGenerated ){ |
127989
|
0 |
81 |
if( overrideError!=OE_Default ){ |
127991
|
81 |
0 |
}else if( onError==OE_Default ){ |
127994
|
0 |
81 |
if( onError==OE_Replace ){ |
127995
|
0 |
0 |
if( b2ndPass /* REPLACE becomes ABORT on the 2nd pass */ |
127996
|
0 |
0 |
|| pCol->iDflt==0 /* REPLACE is ABORT if no DEFAULT value */ |
128005
|
0 |
81 |
}else if( b2ndPass && !isGenerated ){ |
|
0 |
0 |
}else if( b2ndPass && !isGenerated ){ |
128045
|
47 |
0 |
if( nGenerated==0 && nSeenReplace==0 ){ |
|
47 |
0 |
if( nGenerated==0 && nSeenReplace==0 ){ |
128051
|
0 |
0 |
if( b2ndPass ) break; /* Never need more than 2 passes */ |
128054
|
0 |
0 |
if( nSeenReplace>0 && (pTab->tabFlags & TF_HasGenerated)!=0 ){ |
|
0 |
0 |
if( nSeenReplace>0 && (pTab->tabFlags & TF_HasGenerated)!=0 ){ |
128068
|
0 |
2981 |
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ |
|
0 |
0 |
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ |
128071
|
0 |
0 |
onError = overrideError!=OE_Default ? overrideError : OE_Abort; |
128072
|
0 |
0 |
for(i=0; inExpr; i++){ |
128076
|
0 |
0 |
if( aiChng |
128077
|
0 |
0 |
&& !sqlite3ExprReferencesUpdatedColumn(pExpr, aiChng, pkChng) |
128083
|
0 |
0 |
if( bAffinityDone==0 ){ |
128090
|
0 |
0 |
if( !db->mallocFailed ){ |
128094
|
0 |
0 |
if( onError==OE_Ignore ){ |
128099
|
0 |
0 |
if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-26383-51744 */ |
128142
|
0 |
2981 |
if( pUpsert ){ |
128143
|
0 |
0 |
if( pUpsert->pUpsertTarget==0 ){ |
128146
|
0 |
0 |
if( pUpsert->isDoUpdate==0 ){ |
128155
|
0 |
0 |
}else if( pTab->pIndex!=0 ){ |
128163
|
0 |
0 |
for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){ |
128170
|
0 |
0 |
if( sIdxIter.u.ax.aIdx==0 ) return; /* OOM */ |
128173
|
0 |
0 |
for(i=0, pTerm=pUpsert; pTerm; pTerm=pTerm->pNextUpsert){ |
128174
|
0 |
0 |
if( pTerm->pUpsertTarget==0 ) break; |
128175
|
0 |
0 |
if( pTerm->pUpsertIdx==0 ) continue; /* Skip ON CONFLICT for the IPK */ |
128178
|
0 |
0 |
while( ALWAYS(pIdx!=0) && pIdx!=pTerm->pUpsertIdx ){ |
|
0 |
0 |
while( ALWAYS(pIdx!=0) && pIdx!=pTerm->pUpsertIdx ){ |
128182
|
0 |
0 |
if( bUsed[jj] ) continue; /* Duplicate ON CONFLICT clause ignored */ |
128188
|
0 |
0 |
for(jj=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, jj++){ |
128189
|
0 |
0 |
if( bUsed[jj] ) continue; |
128218
|
2937 |
44 |
if( (db->flags & (SQLITE_RecTriggers|SQLITE_ForeignKeys))==0 ){ |
128224
|
0 |
44 |
if( db->flags&SQLITE_RecTriggers ){ |
128226
|
0 |
0 |
regTrigCnt = pTrigger!=0 || sqlite3FkRequired(pParse, pTab, 0, 0); |
|
0 |
0 |
regTrigCnt = pTrigger!=0 || sqlite3FkRequired(pParse, pTab, 0, 0); |
128231
|
23 |
21 |
if( regTrigCnt ){ |
128245
|
52 |
2929 |
if( pkChng && pPk==0 ){ |
|
52 |
0 |
if( pkChng && pPk==0 ){ |
128250
|
18 |
34 |
if( overrideError!=OE_Default ){ |
128252
|
34 |
0 |
}else if( onError==OE_Default ){ |
128257
|
0 |
52 |
if( pUpsert ){ |
128259
|
0 |
0 |
if( pUpsertClause!=0 ){ |
128260
|
0 |
0 |
if( pUpsertClause->isDoUpdate==0 ){ |
128266
|
0 |
0 |
if( pUpsertClause!=pUpsert ){ |
128279
|
18 |
34 |
if( onError==OE_Replace /* IPK rule is REPLACE */ |
128280
|
0 |
18 |
&& onError!=overrideError /* Rules for other constraints are different */ |
128281
|
0 |
0 |
&& pTab->pIndex /* There exist other constraints */ |
128282
|
0 |
0 |
&& !upsertIpkDelay /* IPK check already deferred by UPSERT */ |
128288
|
0 |
52 |
if( isUpdate ){ |
128341
|
0 |
18 |
if( regTrigCnt ){ |
128357
|
0 |
18 |
if( pTab->pIndex ){ |
128378
|
0 |
52 |
if( pUpsert && pUpsertClause!=pUpsert ){ |
|
0 |
0 |
if( pUpsert && pUpsertClause!=pUpsert ){ |
128380
|
0 |
52 |
}else if( ipkTop ){ |
128393
|
33 |
2981 |
for(pIdx = indexIteratorFirst(&sIdxIter, &ix); |
128403
|
0 |
33 |
if( aRegIdx[ix]==0 ) continue; /* Skip indices that do not change */ |
128404
|
0 |
33 |
if( pUpsert ){ |
128406
|
0 |
0 |
if( upsertIpkDelay && pUpsertClause==pUpsert ){ |
|
0 |
0 |
if( upsertIpkDelay && pUpsertClause==pUpsert ){ |
128411
|
33 |
0 |
if( bAffinityDone==0 ){ |
128420
|
0 |
33 |
if( pIdx->pPartIdxWhere ){ |
128432
|
84 |
33 |
for(i=0; inColumn; i++){ |
128435
|
0 |
84 |
if( iField==XN_EXPR ){ |
128440
|
51 |
33 |
}else if( iField==XN_ROWID || iField==pTab->iPKey ){ |
|
0 |
51 |
}else if( iField==XN_ROWID || iField==pTab->iPKey ){ |
128464
|
0 |
33 |
if( isUpdate && pPk==pIdx && pkChng==0 ){ |
|
0 |
0 |
if( isUpdate && pPk==pIdx && pkChng==0 ){ |
|
0 |
0 |
if( isUpdate && pPk==pIdx && pkChng==0 ){ |
128471
|
1 |
32 |
if( onError==OE_None ){ |
128475
|
8 |
24 |
if( overrideError!=OE_Default ){ |
128477
|
23 |
1 |
}else if( onError==OE_Default ){ |
128482
|
0 |
32 |
if( pUpsertClause ){ |
128483
|
0 |
0 |
if( pUpsertClause->isDoUpdate==0 ){ |
128502
|
32 |
0 |
if( (ix==0 && pIdx->pNext==0) /* Condition 3 */ |
|
32 |
0 |
if( (ix==0 && pIdx->pNext==0) /* Condition 3 */ |
128503
|
0 |
32 |
&& pPk==pIdx /* Condition 2 */ |
128504
|
0 |
0 |
&& onError==OE_Replace /* Condition 1 */ |
128507
|
0 |
0 |
&& ( 0==(db->flags&SQLITE_ForeignKeys) || /* Condition 5 */ |
|
0 |
0 |
&& ( 0==(db->flags&SQLITE_ForeignKeys) || /* Condition 5 */ |
128508
|
0 |
0 |
(0==pTab->u.tab.pFKey && 0==sqlite3FkReferences(pTab))) |
128522
|
32 |
0 |
regR = pIdx==pPk ? regIdx : sqlite3GetTempRange(pParse, nPkField); |
128523
|
32 |
0 |
if( isUpdate || onError==OE_Replace ){ |
|
8 |
24 |
if( isUpdate || onError==OE_Replace ){ |
128524
|
8 |
0 |
if( HasRowid(pTab) ){ |
128528
|
0 |
8 |
if( isUpdate ){ |
128537
|
0 |
0 |
if( pIdx!=pPk ){ |
128538
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
128546
|
0 |
0 |
if( isUpdate ){ |
128556
|
0 |
0 |
int regCmp = (IsPrimaryKeyIndex(pIdx) ? regIdx : regR); |
128558
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
128562
|
0 |
0 |
if( i==(pPk->nKeyCol-1) ){ |
128610
|
0 |
8 |
if( regTrigCnt ){ |
128614
|
0 |
8 |
if( pTrigger && isUpdate ){ |
|
0 |
0 |
if( pTrigger && isUpdate ){ |
128620
|
0 |
8 |
if( pTrigger && isUpdate ){ |
|
0 |
0 |
if( pTrigger && isUpdate ){ |
128623
|
0 |
8 |
if( regTrigCnt ){ |
128635
|
0 |
0 |
if( pIdx->pPartIdxWhere ){ |
128644
|
0 |
0 |
while( nConflictCk>0 ){ |
128650
|
0 |
0 |
if( x.opcode!=OP_IdxRowid ){ |
128653
|
0 |
0 |
if( sqlite3OpcodeProperty[x.opcode]&OPFLG_JUMP ){ |
128658
|
0 |
0 |
zP4 = x.p4type==P4_INT32 ? SQLITE_INT_TO_PTR(x.p4.i) : x.p4.z; |
128676
|
32 |
0 |
if( regR!=regIdx ) sqlite3ReleaseTempRange(pParse, regR, nPkField); |
128677
|
0 |
32 |
if( pUpsertClause |
128678
|
0 |
0 |
&& upsertIpkReturn |
128679
|
0 |
0 |
&& sqlite3UpsertNextIsIPK(pUpsertClause) |
128688
|
0 |
2981 |
if( ipkTop ){ |
128698
|
0 |
2981 |
if( nReplaceTrig ){ |
128700
|
0 |
0 |
if( !pPk ){ |
128701
|
0 |
0 |
if( isUpdate ){ |
128716
|
2981 |
0 |
if( HasRowid(pTab) ){ |
128720
|
2948 |
33 |
if( !bAffinityDone ){ |
128810
|
33 |
2981 |
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ |
128815
|
0 |
33 |
if( aRegIdx[i]==0 ) continue; |
128816
|
0 |
33 |
if( pIdx->pPartIdxWhere ){ |
128820
|
33 |
0 |
pik_flags = (useSeekResult ? OPFLAG_USESEEKRESULT : 0); |
128821
|
27 |
6 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){ |
|
0 |
27 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){ |
128828
|
4 |
29 |
sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iIdxCur+i, aRegIdx[i], |
128833
|
0 |
2981 |
if( !HasRowid(pTab) ) return; |
128834
|
339 |
2642 |
if( pParse->nested ){ |
128838
|
7 |
2635 |
pik_flags |= (update_flags?update_flags:OPFLAG_LASTROWID); |
128840
|
2622 |
359 |
if( appendBias ){ |
128843
|
2674 |
307 |
if( useSeekResult ){ |
128847
|
2642 |
339 |
if( !pParse->nested ){ |
128892
|
22 |
3013 |
if( IsVirtual(pTab) ){ |
128902
|
2674 |
339 |
if( iBase<0 ) iBase = pParse->nTab; |
128904
|
2706 |
307 |
if( piDataCur ) *piDataCur = iDataCur; |
128905
|
3013 |
0 |
if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){ |
|
339 |
2674 |
if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){ |
|
7 |
332 |
if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){ |
128910
|
2706 |
307 |
if( piIdxCur ) *piIdxCur = iBase; |
128911
|
42 |
3013 |
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ |
128914
|
36 |
6 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){ |
|
0 |
36 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){ |
128915
|
0 |
0 |
if( piDataCur ) *piDataCur = iIdxCur; |
128918
|
9 |
33 |
if( aToOpen==0 || aToOpen[i+1] ){ |
|
0 |
9 |
if( aToOpen==0 || aToOpen[i+1] ){ |
128925
|
2674 |
339 |
if( iBase>pParse->nTab ) pParse->nTab = iBase; |
128957
|
0 |
0 |
if( pDest->nKeyCol!=pSrc->nKeyCol || pDest->nColumn!=pSrc->nColumn ){ |
|
0 |
0 |
if( pDest->nKeyCol!=pSrc->nKeyCol || pDest->nColumn!=pSrc->nColumn ){ |
128960
|
0 |
0 |
if( pDest->onError!=pSrc->onError ){ |
128963
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
128964
|
0 |
0 |
if( pSrc->aiColumn[i]!=pDest->aiColumn[i] ){ |
128967
|
0 |
0 |
if( pSrc->aiColumn[i]==XN_EXPR ){ |
128969
|
0 |
0 |
if( sqlite3ExprCompare(0, pSrc->aColExpr->a[i].pExpr, |
128974
|
0 |
0 |
if( pSrc->aSortOrder[i]!=pDest->aSortOrder[i] ){ |
128977
|
0 |
0 |
if( sqlite3_stricmp(pSrc->azColl[i],pDest->azColl[i])!=0 ){ |
128981
|
0 |
0 |
if( sqlite3ExprCompare(0, pSrc->pPartIdxWhere, pDest->pPartIdxWhere, -1) ){ |
129038
|
2 |
0 |
if( pParse->pWith || pSelect->pWith ){ |
|
0 |
2 |
if( pParse->pWith || pSelect->pWith ){ |
129045
|
2 |
0 |
if( IsVirtual(pDest) ){ |
129049
|
0 |
0 |
if( onError==OE_Default ){ |
129050
|
0 |
0 |
if( pDest->iPKey>=0 ) onError = pDest->keyConf; |
129051
|
0 |
0 |
if( onError==OE_Default ) onError = OE_Abort; |
129054
|
0 |
0 |
if( pSelect->pSrc->nSrc!=1 ){ |
129057
|
0 |
0 |
if( pSelect->pSrc->a[0].pSelect ){ |
129060
|
0 |
0 |
if( pSelect->pWhere ){ |
129063
|
0 |
0 |
if( pSelect->pOrderBy ){ |
129068
|
0 |
0 |
if( pSelect->pGroupBy ){ |
129071
|
0 |
0 |
if( pSelect->pLimit ){ |
129074
|
0 |
0 |
if( pSelect->pPrior ){ |
129077
|
0 |
0 |
if( pSelect->selFlags & SF_Distinct ){ |
129082
|
0 |
0 |
if( pEList->nExpr!=1 ){ |
129086
|
0 |
0 |
if( pEList->a[0].pExpr->op!=TK_ASTERISK ){ |
129096
|
0 |
0 |
if( pSrc==0 ){ |
129099
|
0 |
0 |
if( pSrc->tnum==pDest->tnum && pSrc->pSchema==pDest->pSchema ){ |
|
0 |
0 |
if( pSrc->tnum==pDest->tnum && pSrc->pSchema==pDest->pSchema ){ |
129103
|
0 |
0 |
if( HasRowid(pDest)!=HasRowid(pSrc) ){ |
129106
|
0 |
0 |
if( !IsOrdinaryTable(pSrc) ){ |
129109
|
0 |
0 |
if( pDest->nCol!=pSrc->nCol ){ |
129112
|
0 |
0 |
if( pDest->iPKey!=pSrc->iPKey ){ |
129115
|
0 |
0 |
if( (pDest->tabFlags & TF_Strict)!=0 && (pSrc->tabFlags & TF_Strict)==0 ){ |
|
0 |
0 |
if( (pDest->tabFlags & TF_Strict)!=0 && (pSrc->tabFlags & TF_Strict)==0 ){ |
129118
|
0 |
0 |
for(i=0; inCol; i++){ |
129145
|
0 |
0 |
if( (pDestCol->colFlags & COLFLAG_GENERATED) != |
129153
|
0 |
0 |
if( (pDestCol->colFlags & COLFLAG_GENERATED)!=0 ){ |
129154
|
0 |
0 |
if( sqlite3ExprCompare(0, |
129163
|
0 |
0 |
if( pDestCol->affinity!=pSrcCol->affinity ){ |
129166
|
0 |
0 |
if( sqlite3_stricmp(sqlite3ColumnColl(pDestCol), |
129170
|
0 |
0 |
if( pDestCol->notNull && !pSrcCol->notNull ){ |
|
0 |
0 |
if( pDestCol->notNull && !pSrcCol->notNull ){ |
129174
|
0 |
0 |
if( (pDestCol->colFlags & COLFLAG_GENERATED)==0 && i>0 ){ |
|
0 |
0 |
if( (pDestCol->colFlags & COLFLAG_GENERATED)==0 && i>0 ){ |
129181
|
0 |
0 |
if( (pDestExpr==0)!=(pSrcExpr==0) |
129182
|
0 |
0 |
|| (pDestExpr!=0 && strcmp(pDestExpr->u.zToken, |
|
0 |
0 |
|| (pDestExpr!=0 && strcmp(pDestExpr->u.zToken, |
129189
|
0 |
0 |
for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){ |
129190
|
0 |
0 |
if( IsUniqueIndex(pDestIdx) ){ |
129193
|
0 |
0 |
for(pSrcIdx=pSrc->pIndex; pSrcIdx; pSrcIdx=pSrcIdx->pNext){ |
129194
|
0 |
0 |
if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break; |
129196
|
0 |
0 |
if( pSrcIdx==0 ){ |
129199
|
0 |
0 |
if( pSrcIdx->tnum==pDestIdx->tnum && pSrc->pSchema==pDest->pSchema |
|
0 |
0 |
if( pSrcIdx->tnum==pDestIdx->tnum && pSrc->pSchema==pDest->pSchema |
129200
|
0 |
0 |
&& sqlite3FaultSim(411)==SQLITE_OK ){ |
129208
|
0 |
0 |
if( pDest->pCheck && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1) ){ |
|
0 |
0 |
if( pDest->pCheck && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1) ){ |
129221
|
0 |
0 |
if( (db->flags & SQLITE_ForeignKeys)!=0 && pDest->u.tab.pFKey!=0 ){ |
|
0 |
0 |
if( (db->flags & SQLITE_ForeignKeys)!=0 && pDest->u.tab.pFKey!=0 ){ |
129225
|
0 |
0 |
if( (db->flags & SQLITE_CountRows)!=0 ){ |
129247
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_Vacuum)==0 && ( |
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_Vacuum)==0 && ( |
129248
|
0 |
0 |
(pDest->iPKey<0 && pDest->pIndex!=0) /* (1) */ |
129249
|
0 |
0 |
|| destHasUniqueIdx /* (2) */ |
129250
|
0 |
0 |
|| (onError!=OE_Abort && onError!=OE_Rollback) /* (3) */ |
|
0 |
0 |
|| (onError!=OE_Abort && onError!=OE_Rollback) /* (3) */ |
129273
|
0 |
0 |
if( HasRowid(pSrc) ){ |
129277
|
0 |
0 |
if( pDest->iPKey>=0 ){ |
129279
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_Vacuum)==0 ){ |
129287
|
0 |
0 |
}else if( pDest->pIndex==0 && !(db->mDbFlags & DBFLAG_VacuumInto) ){ |
|
0 |
0 |
}else if( pDest->pIndex==0 && !(db->mDbFlags & DBFLAG_VacuumInto) ){ |
129294
|
0 |
0 |
if( db->mDbFlags & DBFLAG_Vacuum ){ |
129310
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_Vacuum)==0 ){ |
129322
|
0 |
0 |
for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){ |
129324
|
0 |
0 |
for(pSrcIdx=pSrc->pIndex; ALWAYS(pSrcIdx); pSrcIdx=pSrcIdx->pNext){ |
129325
|
0 |
0 |
if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break; |
129336
|
0 |
0 |
if( db->mDbFlags & DBFLAG_Vacuum ){ |
129351
|
0 |
0 |
for(i=0; inColumn; i++){ |
129353
|
0 |
0 |
if( sqlite3_stricmp(sqlite3StrBINARY, zColl) ) break; |
129355
|
0 |
0 |
if( i==pSrcIdx->nColumn ){ |
129360
|
0 |
0 |
}else if( !HasRowid(pSrc) && pDestIdx->idxType==SQLITE_IDXTYPE_PRIMARYKEY ){ |
|
0 |
0 |
}else if( !HasRowid(pSrc) && pDestIdx->idxType==SQLITE_IDXTYPE_PRIMARYKEY ){ |
129363
|
0 |
0 |
if( idxInsFlags!=(OPFLAG_USESEEKRESULT|OPFLAG_PREFORMAT) ){ |
129365
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_Vacuum)==0 |
129366
|
0 |
0 |
&& !HasRowid(pDest) |
129379
|
0 |
0 |
if( emptySrcTest ) sqlite3VdbeJumpHere(v, emptySrcTest); |
129382
|
0 |
0 |
if( emptyDestTest ){ |
129438
|
0 |
3554 |
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
129439
|
0 |
3554 |
if( zSql==0 ) zSql = ""; |
129443
|
7066 |
44 |
while( rc==SQLITE_OK && zSql[0] ){ |
|
3556 |
3510 |
while( rc==SQLITE_OK && zSql[0] ){ |
129450
|
9 |
3547 |
if( rc!=SQLITE_OK ){ |
129453
|
4 |
3543 |
if( !pStmt ){ |
129465
|
835 |
7055 |
if( xCallback && (SQLITE_ROW==rc || |
|
488 |
347 |
if( xCallback && (SQLITE_ROW==rc || |
|
488 |
0 |
if( xCallback && (SQLITE_ROW==rc || |
129466
|
187 |
301 |
(SQLITE_DONE==rc && !callbackIsInit |
129467
|
0 |
187 |
&& db->flags&SQLITE_NullCallback)) ){ |
129468
|
301 |
46 |
if( !callbackIsInit ){ |
129471
|
0 |
301 |
if( azCols==0 ){ |
129474
|
1505 |
301 |
for(i=0; i
|
129482
|
347 |
0 |
if( rc==SQLITE_ROW ){ |
129484
|
1735 |
347 |
for(i=0; i
|
129486
|
35 |
1700 |
if( !azVals[i] && sqlite3_column_type(pStmt, i)!=SQLITE_NULL ){ |
|
0 |
35 |
if( !azVals[i] && sqlite3_column_type(pStmt, i)!=SQLITE_NULL ){ |
129493
|
0 |
347 |
if( xCallback(pArg, nCol, azVals, azCols) ){ |
129505
|
3543 |
4347 |
if( rc!=SQLITE_ROW ){ |
129509
|
0 |
3543 |
while( sqlite3Isspace(zSql[0]) ) zSql++; |
129519
|
0 |
3554 |
if( pStmt ) sqlite3VdbeFinalize((Vdbe *)pStmt); |
129523
|
44 |
3510 |
if( rc!=SQLITE_OK && pzErrMsg ){ |
|
44 |
0 |
if( rc!=SQLITE_OK && pzErrMsg ){ |
129525
|
0 |
44 |
if( *pzErrMsg==0 ){ |
129529
|
2989 |
521 |
}else if( pzErrMsg ){ |
130807
|
0 |
0 |
if( pzErrMsg ) *pzErrMsg = 0; |
130816
|
0 |
0 |
if( (db->flags & SQLITE_LoadExtension)==0 ){ |
130817
|
0 |
0 |
if( pzErrMsg ){ |
130823
|
0 |
0 |
zEntry = zProc ? zProc : "sqlite3_extension_init"; |
130829
|
0 |
0 |
if( nMsg>SQLITE_MAX_PATHLEN ) goto extension_not_found; |
130833
|
0 |
0 |
for(ii=0; ii
|
|
0 |
0 |
for(ii=0; ii
|
130835
|
0 |
0 |
if( zAltFile==0 ) return SQLITE_NOMEM_BKPT; |
130840
|
0 |
0 |
if( handle==0 ) goto extension_not_found; |
130854
|
0 |
0 |
if( xInit==0 && zProc==0 ){ |
|
0 |
0 |
if( xInit==0 && zProc==0 ){ |
130858
|
0 |
0 |
if( zAltEntry==0 ){ |
130863
|
0 |
0 |
for(iFile=ncFile-1; iFile>=0 && !DirSep(zFile[iFile]); iFile--){} |
|
0 |
0 |
for(iFile=ncFile-1; iFile>=0 && !DirSep(zFile[iFile]); iFile--){} |
130865
|
0 |
0 |
if( sqlite3_strnicmp(zFile+iFile, "lib", 3)==0 ) iFile += 3; |
130866
|
0 |
0 |
for(iEntry=8; (c = zFile[iFile])!=0 && c!='.'; iFile++){ |
|
0 |
0 |
for(iEntry=8; (c = zFile[iFile])!=0 && c!='.'; iFile++){ |
130867
|
0 |
0 |
if( sqlite3Isalpha(c) ){ |
130875
|
0 |
0 |
if( xInit==0 ){ |
130876
|
0 |
0 |
if( pzErrMsg ){ |
130879
|
0 |
0 |
if( zErrmsg ){ |
130892
|
0 |
0 |
if( rc ){ |
130893
|
0 |
0 |
if( rc==SQLITE_OK_LOAD_PERMANENTLY ) return SQLITE_OK; |
130894
|
0 |
0 |
if( pzErrMsg ){ |
130904
|
0 |
0 |
if( aHandle==0 ){ |
130907
|
0 |
0 |
if( db->nExtension>0 ){ |
130917
|
0 |
0 |
if( pzErrMsg ){ |
130920
|
0 |
0 |
if( zErrmsg ){ |
130950
|
0 |
315 |
for(i=0; inExtension; i++){ |
130962
|
0 |
0 |
if( onoff ){ |
131012
|
0 |
0 |
if( rc ){ |
131023
|
0 |
0 |
for(i=0; i
|
131024
|
0 |
0 |
if( wsdAutoext.aExt[i]==xInit ) break; |
131026
|
0 |
0 |
if( i==wsdAutoext.nExt ){ |
131030
|
0 |
0 |
if( aNew==0 ){ |
131063
|
0 |
0 |
for(i=(int)wsdAutoext.nExt-1; i>=0; i--){ |
131064
|
0 |
0 |
if( wsdAutoext.aExt[i]==xInit ){ |
131080
|
0 |
0 |
if( sqlite3_initialize()==SQLITE_OK ) |
131107
|
311 |
0 |
if( wsdAutoext.nExt==0 ){ |
131111
|
0 |
0 |
for(i=0; go; i++){ |
131122
|
0 |
0 |
if( i>=wsdAutoext.nExt ){ |
131130
|
0 |
0 |
if( xInit && (rc = xInit(db, &zErrmsg, pThunk))!=0 ){ |
|
0 |
0 |
if( xInit && (rc = xInit(db, &zErrmsg, pThunk))!=0 ){ |
131856
|
2 |
17 |
if( sqlite3Isdigit(*z) ){ |
131860
|
25 |
0 |
for(i=0; i
|
131861
|
17 |
8 |
if( iLength[i]==n && sqlite3StrNICmp(&zText[iOffset[i]],z,n)==0 |
|
17 |
0 |
if( iLength[i]==n && sqlite3StrNICmp(&zText[iOffset[i]],z,n)==0 |
131862
|
17 |
0 |
&& (!omitFull || iValue[i]<=1) |
|
17 |
0 |
&& (!omitFull || iValue[i]<=1) |
131887
|
0 |
0 |
if( z ){ |
131888
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "exclusive") ) return PAGER_LOCKINGMODE_EXCLUSIVE; |
131889
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "normal") ) return PAGER_LOCKINGMODE_NORMAL; |
131903
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "none") ) return BTREE_AUTOVACUUM_NONE; |
131904
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "full") ) return BTREE_AUTOVACUUM_FULL; |
131905
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "incremental") ) return BTREE_AUTOVACUUM_INCR; |
131907
|
0 |
0 |
return (u8)((i>=0&&i<=2)?i:0); |
|
0 |
0 |
return (u8)((i>=0&&i<=2)?i:0); |
131918
|
0 |
0 |
if( z[0]>='0' && z[0]<='2' ){ |
|
0 |
0 |
if( z[0]>='0' && z[0]<='2' ){ |
131920
|
0 |
0 |
}else if( sqlite3StrICmp(z, "file")==0 ){ |
131922
|
0 |
0 |
}else if( sqlite3StrICmp(z, "memory")==0 ){ |
131937
|
0 |
0 |
if( db->aDb[1].pBt!=0 ){ |
131938
|
0 |
0 |
if( !db->autoCommit |
131939
|
0 |
0 |
|| sqlite3BtreeTxnState(db->aDb[1].pBt)!=SQLITE_TXN_NONE |
131962
|
0 |
0 |
if( db->temp_store==ts ) return SQLITE_OK; |
131963
|
0 |
0 |
if( invalidateTempStorage( pParse ) != SQLITE_OK ){ |
131979
|
185 |
18 |
sqlite3VdbeSetNumCols(v, n==0 ? 1 : n); |
131980
|
18 |
185 |
if( n==0 ){ |
131984
|
855 |
185 |
for(i=0, j=pPragma->iPragCName; i
|
132005
|
0 |
0 |
if( zValue ){ |
132018
|
19 |
0 |
if( db->autoCommit ){ |
132027
|
38 |
19 |
while( (n--) > 0 ){ |
132028
|
19 |
19 |
if( pDb->pBt ){ |
132080
|
0 |
2 |
if( eMode==ArraySize(azModeName) ) return 0; |
132091
|
1206 |
0 |
while( lwr<=upr ){ |
132094
|
219 |
987 |
if( rc==0 ) break; |
132095
|
337 |
650 |
if( rc<0 ){ |
132101
|
219 |
0 |
return lwr>upr ? 0 : &aPragmaName[mid]; |
132121
|
0 |
0 |
if( showInternFuncs ) mask = 0xffffffff; |
132122
|
0 |
0 |
for(; p; p=p->pNext){ |
132131
|
0 |
0 |
if( p->xSFunc==0 ) continue; |
132132
|
0 |
0 |
if( (p->funcFlags & SQLITE_FUNC_INTERNAL)!=0 |
132133
|
0 |
0 |
&& showInternFuncs==0 |
132137
|
0 |
0 |
if( p->xValue!=0 ){ |
132139
|
0 |
0 |
}else if( p->xFinalize!=0 ){ |
132204
|
0 |
219 |
if( v==0 ) return; |
132211
|
0 |
219 |
if( iDb<0 ) return; |
132217
|
3 |
216 |
if( iDb==1 && sqlite3OpenTempDatabase(pParse) ){ |
|
0 |
3 |
if( iDb==1 && sqlite3OpenTempDatabase(pParse) ){ |
132222
|
0 |
219 |
if( !zLeft ) return; |
132223
|
0 |
219 |
if( minusFlag ){ |
132230
|
109 |
110 |
zDb = pId2->n>0 ? pDb->zDbSName : 0; |
132231
|
0 |
219 |
if( sqlite3AuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, zDb) ){ |
132256
|
0 |
219 |
if( rc==SQLITE_OK ){ |
132263
|
0 |
219 |
if( rc!=SQLITE_NOTFOUND ){ |
132264
|
0 |
0 |
if( aFcntl[0] ){ |
132275
|
0 |
219 |
if( pPragma==0 ){ |
132282
|
116 |
103 |
if( (pPragma->mPragFlg & PragFlg_NeedSchema)!=0 ){ |
132283
|
0 |
116 |
if( sqlite3ReadSchema(pParse) ) goto pragma_out; |
132287
|
219 |
0 |
if( (pPragma->mPragFlg & PragFlg_NoColumns)==0 |
132288
|
34 |
185 |
&& ((pPragma->mPragFlg & PragFlg_NoColumns1)==0 || zRight==0) |
|
14 |
20 |
&& ((pPragma->mPragFlg & PragFlg_NoColumns1)==0 || zRight==0) |
132328
|
0 |
0 |
if( !zRight ){ |
132361
|
10 |
0 |
if( !zRight ){ |
132362
|
10 |
0 |
int size = ALWAYS(pBt) ? sqlite3BtreeGetPageSize(pBt) : 0; |
132369
|
0 |
0 |
if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize,0,0) ){ |
132388
|
0 |
0 |
if( zRight ){ |
132389
|
0 |
0 |
if( sqlite3_stricmp(zRight, "fast")==0 ){ |
132395
|
0 |
0 |
if( pId2->n==0 && b>=0 ){ |
|
0 |
0 |
if( pId2->n==0 && b>=0 ){ |
132397
|
0 |
0 |
for(ii=0; iinDb; ii++){ |
132428
|
0 |
0 |
if( sqlite3Tolower(zLeft[0])=='p' ){ |
132431
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight,&x)==0 ){ |
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight,&x)==0 ){ |
132432
|
0 |
0 |
if( x<0 ) x = 0; |
132433
|
0 |
0 |
else if( x>0xfffffffe ) x = 0xfffffffe; |
132451
|
0 |
0 |
if( pId2->n==0 && eMode==PAGER_LOCKINGMODE_QUERY ){ |
|
0 |
0 |
if( pId2->n==0 && eMode==PAGER_LOCKINGMODE_QUERY ){ |
132459
|
0 |
0 |
if( pId2->n==0 ){ |
132470
|
0 |
0 |
for(ii=2; iinDb; ii++){ |
132482
|
0 |
0 |
if( eMode==PAGER_LOCKINGMODE_EXCLUSIVE ){ |
132498
|
0 |
0 |
if( zRight==0 ){ |
132505
|
0 |
0 |
for(eMode=0; (zMode = sqlite3JournalModename(eMode))!=0; eMode++){ |
132506
|
0 |
0 |
if( sqlite3StrNICmp(zRight, zMode, n)==0 ) break; |
132508
|
0 |
0 |
if( !zMode ){ |
132513
|
0 |
0 |
if( eMode==PAGER_JOURNALMODE_OFF && (db->flags & SQLITE_Defensive)!=0 ){ |
|
0 |
0 |
if( eMode==PAGER_JOURNALMODE_OFF && (db->flags & SQLITE_Defensive)!=0 ){ |
132519
|
0 |
0 |
if( eMode==PAGER_JOURNALMODE_QUERY && pId2->n==0 ){ |
|
0 |
0 |
if( eMode==PAGER_JOURNALMODE_QUERY && pId2->n==0 ){ |
132524
|
0 |
0 |
for(ii=db->nDb-1; ii>=0; ii--){ |
132525
|
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) ){ |
132543
|
0 |
0 |
if( zRight ){ |
132545
|
0 |
0 |
if( iLimit<-1 ) iLimit = -1; |
132565
|
0 |
0 |
if( !zRight ){ |
132577
|
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) ){ |
132616
|
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 ){ |
132644
|
0 |
0 |
if( !zRight ){ |
132678
|
0 |
0 |
if( !zRight ){ |
132679
|
0 |
0 |
returnSingleInt(v, |
132684
|
0 |
0 |
if( sqlite3GetInt32(zRight, &size) ){ |
132687
|
0 |
0 |
if( sqlite3GetBoolean(zRight, size!=0) ){ |
132715
|
0 |
0 |
if( zRight ){ |
132718
|
0 |
0 |
if( sz<0 ) sz = sqlite3GlobalConfig.szMmap; |
132719
|
0 |
0 |
if( pId2->n==0 ) db->szMmap = sz; |
132720
|
0 |
0 |
for(ii=db->nDb-1; ii>=0; ii--){ |
132721
|
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) ){ |
132732
|
0 |
0 |
if( rc==SQLITE_OK ){ |
132734
|
0 |
0 |
}else if( rc!=SQLITE_NOTFOUND ){ |
132753
|
0 |
0 |
if( !zRight ){ |
132773
|
0 |
0 |
if( !zRight ){ |
132777
|
0 |
0 |
if( zRight[0] ){ |
132780
|
0 |
0 |
if( rc!=SQLITE_OK || res==0 ){ |
|
0 |
0 |
if( rc!=SQLITE_OK || res==0 ){ |
132786
|
0 |
0 |
if( SQLITE_TEMP_STORE==0 |
132793
|
0 |
0 |
if( zRight[0] ){ |
132893
|
0 |
0 |
if( !zRight ){ |
132896
|
0 |
0 |
if( !db->autoCommit ){ |
132899
|
0 |
0 |
}else if( iDb!=1 ){ |
132901
|
0 |
0 |
if( iLevel==0 ) iLevel = 1; |
132913
|
4 |
19 |
if( zRight==0 ){ |
132918
|
0 |
19 |
if( db->autoCommit==0 ){ |
132930
|
14 |
5 |
if( sqlite3GetBoolean(zRight, 0) ){ |
132934
|
0 |
5 |
if( mask==SQLITE_DeferFKs ) db->nDeferredImmCons = 0; |
132935
|
2 |
3 |
if( (mask & SQLITE_WriteSchema)!=0 |
132936
|
0 |
2 |
&& sqlite3_stricmp(zRight, "reset")==0 |
132970
|
74 |
0 |
case PragTyp_TABLE_INFO: if( zRight ){ |
132974
|
72 |
2 |
if( pTab ){ |
132981
|
147 |
72 |
for(i=0, pCol=pTab->aCol; inCol; i++, pCol++){ |
132984
|
0 |
147 |
if( pCol->colFlags & COLFLAG_NOINSERT ){ |
132985
|
0 |
0 |
if( pPragma->iArg==0 ){ |
132989
|
0 |
0 |
if( pCol->colFlags & COLFLAG_VIRTUAL ){ |
132991
|
0 |
0 |
}else if( pCol->colFlags & COLFLAG_STORED ){ |
132997
|
88 |
59 |
if( (pCol->colFlags & COLFLAG_PRIMKEY)==0 ){ |
132999
|
26 |
33 |
}else if( pPk==0 ){ |
133002
|
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++){} |
133008
|
147 |
0 |
sqlite3VdbeMultiLoad(v, 1, pPragma->iArg ? "issisii" : "issisi", |
|
0 |
147 |
sqlite3VdbeMultiLoad(v, 1, pPragma->iArg ? "issisii" : "issisi", |
133013
|
0 |
147 |
(isHidden>=2 || pColExpr==0) ? 0 : pColExpr->u.zToken, |
133038
|
0 |
0 |
for(ii=0; iinDb; ii++){ |
133042
|
0 |
0 |
if( zDb && sqlite3_stricmp(zDb, db->aDb[ii].zDbSName)!=0 ) continue; |
|
0 |
0 |
if( zDb && sqlite3_stricmp(zDb, db->aDb[ii].zDbSName)!=0 ) continue; |
133051
|
0 |
0 |
while( initNCol-- ){ |
133054
|
0 |
0 |
if( k==0 ){ initNCol = 0; break; } |
133056
|
0 |
0 |
if( pTab->nCol==0 ){ |
133058
|
0 |
0 |
if( zSql ){ |
133064
|
0 |
0 |
if( db->mallocFailed ){ |
133074
|
0 |
0 |
for(k=sqliteHashFirst(pHash); k; k=sqliteHashNext(k) ){ |
133077
|
0 |
0 |
if( zRight && sqlite3_stricmp(zRight, pTab->zName)!=0 ) continue; |
|
0 |
0 |
if( zRight && sqlite3_stricmp(zRight, pTab->zName)!=0 ) continue; |
133078
|
0 |
0 |
if( IsView(pTab) ){ |
133080
|
0 |
0 |
}else if( IsVirtual(pTab) ){ |
133082
|
0 |
0 |
}else if( pTab->tabFlags & TF_Shadow ){ |
133127
|
24 |
0 |
case PragTyp_INDEX_INFO: if( zRight ){ |
133131
|
12 |
12 |
if( pIdx==0 ){ |
133136
|
0 |
12 |
if( pTab && !HasRowid(pTab) ){ |
|
0 |
0 |
if( pTab && !HasRowid(pTab) ){ |
133140
|
12 |
12 |
if( pIdx ){ |
133144
|
0 |
12 |
if( pPragma->iArg ){ |
133156
|
16 |
12 |
for(i=0; i
|
133158
|
16 |
0 |
sqlite3VdbeMultiLoad(v, 1, "iisX", i, cnum, |
133160
|
0 |
16 |
if( pPragma->iArg ){ |
133172
|
4 |
0 |
case PragTyp_INDEX_LIST: if( zRight ){ |
133177
|
4 |
0 |
if( pTab ){ |
133181
|
16 |
4 |
for(pIdx=pTab->pIndex, i=0; pIdx; pIdx=pIdx->pNext, i++){ |
133197
|
165 |
69 |
for(i=0; inDb; i++){ |
133198
|
40 |
125 |
if( db->aDb[i].pBt==0 ) continue; |
133212
|
0 |
0 |
for(p=sqliteHashFirst(&db->aCollSeq); p; p=sqliteHashNext(p)){ |
133226
|
0 |
0 |
for(i=0; i
|
133227
|
0 |
0 |
for(p=sqlite3BuiltinFunctions.a[i]; p; p=p->u.pHash ){ |
133232
|
0 |
0 |
for(j=sqliteHashFirst(&db->aFunc); j; j=sqliteHashNext(j)){ |
133244
|
0 |
0 |
for(j=sqliteHashFirst(&db->aModule); j; j=sqliteHashNext(j)){ |
133254
|
0 |
0 |
for(i=0; i
|
133264
|
14 |
0 |
case PragTyp_FOREIGN_KEY_LIST: if( zRight ){ |
133268
|
14 |
0 |
if( pTab && IsOrdinaryTable(pTab) ){ |
|
14 |
0 |
if( pTab && IsOrdinaryTable(pTab) ){ |
133270
|
11 |
3 |
if( pFK ){ |
133275
|
16 |
11 |
while(pFK){ |
133277
|
18 |
16 |
for(j=0; jnCol; j++){ |
133318
|
0 |
0 |
while( k ){ |
133319
|
0 |
0 |
if( zRight ){ |
133326
|
0 |
0 |
if( pTab==0 || !IsOrdinaryTable(pTab) || pTab->u.tab.pFKey==0 ) continue; |
|
0 |
0 |
if( pTab==0 || !IsOrdinaryTable(pTab) || pTab->u.tab.pFKey==0 ) continue; |
|
0 |
0 |
if( pTab==0 || !IsOrdinaryTable(pTab) || pTab->u.tab.pFKey==0 ) continue; |
133331
|
0 |
0 |
if( pTab->nCol+regRow>pParse->nMem ) pParse->nMem = pTab->nCol + regRow; |
133335
|
0 |
0 |
for(i=1, pFK=pTab->u.tab.pFKey; pFK; i++, pFK=pFK->pNextFrom){ |
133337
|
0 |
0 |
if( pParent==0 ) continue; |
133341
|
0 |
0 |
if( x==0 ){ |
133342
|
0 |
0 |
if( pIdx==0 ){ |
133354
|
0 |
0 |
if( pFK ) break; |
133355
|
0 |
0 |
if( pParse->nTabnTab = i; |
133358
|
0 |
0 |
for(i=1, pFK=pTab->u.tab.pFKey; pFK; i++, pFK=pFK->pNextFrom){ |
133362
|
0 |
0 |
if( pParent ){ |
133372
|
0 |
0 |
if( regRow+pFK->nCol>pParse->nMem ) pParse->nMem = regRow+pFK->nCol; |
133373
|
0 |
0 |
for(j=0; jnCol; j++){ |
133374
|
0 |
0 |
int iCol = aiCols ? aiCols[j] : pFK->aCol[j].iFrom; |
133381
|
0 |
0 |
if( pIdx ){ |
133386
|
0 |
0 |
}else if( pParent ){ |
133394
|
0 |
0 |
if( HasRowid(pTab) ){ |
133417
|
0 |
0 |
if( zRight ){ |
133470
|
0 |
0 |
if( pId2->z==0 ) iDb = -1; |
133477
|
0 |
0 |
if( zRight ){ |
133478
|
0 |
0 |
if( sqlite3GetInt32(zRight, &mxErr) ){ |
133479
|
0 |
0 |
if( mxErr<=0 ){ |
133483
|
0 |
0 |
pObjTab = sqlite3LocateTable(pParse, 0, zRight, |
133490
|
0 |
0 |
for(i=0; inDb; i++){ |
133498
|
0 |
0 |
if( iDb>=0 && i!=iDb ) continue; |
|
0 |
0 |
if( iDb>=0 && i!=iDb ) continue; |
133509
|
0 |
0 |
for(cnt=0, x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){ |
133513
|
0 |
0 |
if( pObjTab && pObjTab!=pTab ) continue; |
|
0 |
0 |
if( pObjTab && pObjTab!=pTab ) continue; |
133514
|
0 |
0 |
if( HasRowid(pTab) ) cnt++; |
133515
|
0 |
0 |
for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){ cnt++; } |
133516
|
0 |
0 |
if( nIdx>mxIdx ) mxIdx = nIdx; |
133518
|
0 |
0 |
if( cnt==0 ) continue; |
133519
|
0 |
0 |
if( pObjTab ) cnt++; |
133521
|
0 |
0 |
if( aRoot==0 ) break; |
133523
|
0 |
0 |
if( pObjTab ) aRoot[++cnt] = 0; |
133524
|
0 |
0 |
for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){ |
133527
|
0 |
0 |
if( pObjTab && pObjTab!=pTab ) continue; |
|
0 |
0 |
if( pObjTab && pObjTab!=pTab ) continue; |
133528
|
0 |
0 |
if( HasRowid(pTab) ) aRoot[++cnt] = pTab->tnum; |
133529
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
133552
|
0 |
0 |
for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){ |
133561
|
0 |
0 |
if( !IsOrdinaryTable(pTab) ) continue; |
133562
|
0 |
0 |
if( pObjTab && pObjTab!=pTab ) continue; |
|
0 |
0 |
if( pObjTab && pObjTab!=pTab ) continue; |
133563
|
0 |
0 |
pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab); |
133570
|
0 |
0 |
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ |
133577
|
0 |
0 |
if( !isQuick ){ |
133586
|
0 |
0 |
for(j=0; jnCol; j++){ |
133590
|
0 |
0 |
if( j==pTab->iPKey ) continue; |
133591
|
0 |
0 |
if( pCol->notNull==0 && !bStrict ) continue; |
|
0 |
0 |
if( pCol->notNull==0 && !bStrict ) continue; |
133592
|
0 |
0 |
doError = bStrict ? sqlite3VdbeMakeLabel(pParse) : 0; |
133594
|
0 |
0 |
if( sqlite3VdbeGetOp(v,-1)->opcode==OP_Column ){ |
133597
|
0 |
0 |
if( pCol->notNull ){ |
133602
|
0 |
0 |
if( bStrict && pCol->eCType!=COLTYPE_ANY ){ |
|
0 |
0 |
if( bStrict && pCol->eCType!=COLTYPE_ANY ){ |
133609
|
0 |
0 |
if( (pTab->tabFlags & TF_Strict)!=0 |
133610
|
0 |
0 |
&& pCol->eCType!=COLTYPE_ANY |
133625
|
0 |
0 |
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ |
|
0 |
0 |
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ |
133627
|
0 |
0 |
if( db->mallocFailed==0 ){ |
133633
|
0 |
0 |
for(k=pCheck->nExpr-1; k>0; k--){ |
133648
|
0 |
0 |
if( !isQuick ){ /* Omit the remaining tests for quick_check */ |
133650
|
0 |
0 |
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ |
133653
|
0 |
0 |
if( pPk==pIdx ) continue; |
133672
|
0 |
0 |
if( IsUniqueIndex(pIdx) ){ |
133676
|
0 |
0 |
for(kk=0; kknKeyCol; kk++){ |
133679
|
0 |
0 |
if( iCol>=0 && pTab->aCol[iCol].notNull ) continue; |
|
0 |
0 |
if( iCol>=0 && pTab->aCol[iCol].notNull ) continue; |
133698
|
0 |
0 |
if( !isQuick ){ |
133700
|
0 |
0 |
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ |
133701
|
0 |
0 |
if( pPk==pIdx ) continue; |
133727
|
0 |
0 |
if( aOp ){ |
133779
|
0 |
0 |
if( !zRight ){ /* "PRAGMA encoding" */ |
133780
|
0 |
0 |
if( sqlite3ReadSchema(pParse) ) goto pragma_out; |
133791
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_EncodingFixed)==0 ){ |
133792
|
0 |
0 |
for(pEnc=&encnames[0]; pEnc->zName; pEnc++){ |
133793
|
0 |
0 |
if( 0==sqlite3StrICmp(zRight, pEnc->zName) ){ |
133794
|
0 |
0 |
u8 enc = pEnc->enc ? pEnc->enc : SQLITE_UTF16NATIVE; |
133800
|
0 |
0 |
if( !pEnc->zName ){ |
133845
|
1 |
0 |
if( zRight && (pPragma->mPragFlg & PragFlg_ReadOnly)==0 ){ |
|
1 |
0 |
if( zRight && (pPragma->mPragFlg & PragFlg_ReadOnly)==0 ){ |
133891
|
0 |
0 |
while( (zOpt = sqlite3_compileoption_get(i++))!=0 ){ |
133907
|
0 |
0 |
int iBt = (pId2->z?iDb:SQLITE_MAX_DB); |
133909
|
0 |
0 |
if( zRight ){ |
133910
|
0 |
0 |
if( sqlite3StrICmp(zRight, "full")==0 ){ |
133912
|
0 |
0 |
}else if( sqlite3StrICmp(zRight, "restart")==0 ){ |
133914
|
0 |
0 |
}else if( sqlite3StrICmp(zRight, "truncate")==0 ){ |
133933
|
0 |
0 |
if( zRight ){ |
133936
|
0 |
0 |
returnSingleInt(v, |
134020
|
0 |
0 |
if( zRight ){ |
134022
|
0 |
0 |
if( (opMask & 0x02)==0 ) break; |
134027
|
0 |
0 |
for(iDbLast = zDb?iDb:db->nDb-1; iDb<=iDbLast; iDb++){ |
|
0 |
0 |
for(iDbLast = zDb?iDb:db->nDb-1; iDb<=iDbLast; iDb++){ |
134028
|
0 |
0 |
if( iDb==1 ) continue; |
134031
|
0 |
0 |
for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){ |
134037
|
0 |
0 |
if( (pTab->tabFlags & TF_StatsUsed)==0 ) continue; |
134041
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
134042
|
0 |
0 |
if( !pIdx->hasStat1 ){ |
134047
|
0 |
0 |
if( szThreshold ){ |
134055
|
0 |
0 |
if( opMask & 0x01 ){ |
134079
|
0 |
0 |
if( zRight ){ |
134099
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK ){ |
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK ){ |
134119
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK ){ |
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK ){ |
134121
|
0 |
0 |
if( N>0 && (iPrior==0 || iPrior>N) ) sqlite3_hard_heap_limit64(N); |
|
0 |
0 |
if( N>0 && (iPrior==0 || iPrior>N) ) sqlite3_hard_heap_limit64(N); |
|
0 |
0 |
if( N>0 && (iPrior==0 || iPrior>N) ) sqlite3_hard_heap_limit64(N); |
134136
|
0 |
0 |
if( zRight |
134137
|
0 |
0 |
&& sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK |
134138
|
0 |
0 |
&& N>=0 |
134155
|
0 |
0 |
if( zRight |
134156
|
0 |
0 |
&& sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK /* IMP: R-40975-20399 */ |
134157
|
0 |
0 |
&& N>=0 |
134260
|
0 |
0 |
for(i=0, j=pPragma->iPragCName; inPragCName; i++, j++){ |
134264
|
0 |
0 |
if( i==0 ){ |
134269
|
0 |
0 |
if( pPragma->mPragFlg & PragFlg_Result1 ){ |
134273
|
0 |
0 |
if( pPragma->mPragFlg & (PragFlg_SchemaOpt|PragFlg_SchemaReq) ){ |
134281
|
0 |
0 |
if( rc==SQLITE_OK ){ |
134283
|
0 |
0 |
if( pTab==0 ){ |
134323
|
0 |
0 |
if( pTab->nHidden==0 ){ return SQLITE_OK; } |
134327
|
0 |
0 |
for(i=0; inConstraint; i++, pConstraint++){ |
134328
|
0 |
0 |
if( pConstraint->usable==0 ) continue; |
134329
|
0 |
0 |
if( pConstraint->op!=SQLITE_INDEX_CONSTRAINT_EQ ) continue; |
134330
|
0 |
0 |
if( pConstraint->iColumn < pTab->iHidden ) continue; |
134335
|
0 |
0 |
if( seen[0]==0 ){ |
134343
|
0 |
0 |
if( seen[1]==0 ) return SQLITE_OK; |
134356
|
0 |
0 |
if( pCsr==0 ) return SQLITE_NOMEM; |
134368
|
0 |
0 |
for(i=0; iazArg); i++){ |
134390
|
0 |
0 |
if( SQLITE_ROW!=sqlite3_step(pCsr->pPragma) ){ |
134417
|
0 |
0 |
for(i=0; i
|
134421
|
0 |
0 |
if( zText ){ |
134423
|
0 |
0 |
if( pCsr->azArg[j]==0 ){ |
134430
|
0 |
0 |
if( pCsr->azArg[1] ){ |
134434
|
0 |
0 |
if( pCsr->azArg[0] ){ |
134438
|
0 |
0 |
if( zSql==0 ) return SQLITE_NOMEM; |
134441
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
134466
|
0 |
0 |
if( iiHidden ){ |
134520
|
0 |
0 |
if( pName==0 ) return 0; |
134521
|
0 |
0 |
if( (pName->mPragFlg & (PragFlg_Result0|PragFlg_Result1))==0 ) return 0; |
134559
|
0 |
0 |
if( db->mallocFailed ){ |
134561
|
0 |
0 |
}else if( pData->pzErrMsg[0]!=0 ){ |
134563
|
0 |
0 |
}else if( pData->mInitFlags & (INITFLAG_AlterMask) ){ |
134575
|
0 |
0 |
}else if( db->flags & SQLITE_WriteSchema ){ |
134579
|
0 |
0 |
const char *zObj = azObj[1] ? azObj[1] : "?"; |
134581
|
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); |
134594
|
43 |
40 |
for(p=pIndex->pTable->pIndex; p; p=p->pNext){ |
134595
|
35 |
8 |
if( p->tnum==pIndex->tnum && p!=pIndex ) return 1; |
|
0 |
35 |
if( p->tnum==pIndex->tnum && p!=pIndex ) return 1; |
134635
|
0 |
784 |
if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */ |
134637
|
0 |
784 |
if( db->mallocFailed ){ |
134643
|
0 |
784 |
if( argv[3]==0 ){ |
134645
|
749 |
35 |
}else if( argv[4] |
134646
|
749 |
0 |
&& 'c'==sqlite3UpperToLower[(unsigned char)argv[4][0]] |
134647
|
749 |
0 |
&& 'r'==sqlite3UpperToLower[(unsigned char)argv[4][1]] ){ |
134665
|
749 |
0 |
if( sqlite3GetUInt32(argv[3], &db->init.newTnum)==0 |
134666
|
437 |
312 |
|| (db->init.newTnum>pData->mxPage && pData->mxPage>0) |
|
0 |
437 |
|| (db->init.newTnum>pData->mxPage && pData->mxPage>0) |
134668
|
0 |
0 |
if( sqlite3Config.bExtraSchemaChecks ){ |
134680
|
0 |
749 |
if( SQLITE_OK!=rc ){ |
134681
|
0 |
0 |
if( db->init.orphanTrigger ){ |
134684
|
0 |
0 |
if( rc > pData->rc ) pData->rc = rc; |
134685
|
0 |
0 |
if( rc==SQLITE_NOMEM ){ |
134687
|
0 |
0 |
}else if( rc!=SQLITE_INTERRUPT && (rc&0xFF)!=SQLITE_LOCKED ){ |
|
0 |
0 |
}else if( rc!=SQLITE_INTERRUPT && (rc&0xFF)!=SQLITE_LOCKED ){ |
134694
|
35 |
0 |
}else if( argv[1]==0 || (argv[4]!=0 && argv[4][0]!=0) ){ |
|
0 |
35 |
}else if( argv[1]==0 || (argv[4]!=0 && argv[4][0]!=0) ){ |
|
0 |
0 |
}else if( argv[1]==0 || (argv[4]!=0 && argv[4][0]!=0) ){ |
134705
|
0 |
35 |
if( pIndex==0 ){ |
134708
|
35 |
0 |
if( sqlite3GetUInt32(argv[3],&pIndex->tnum)==0 |
134709
|
35 |
0 |
|| pIndex->tnum<2 |
134710
|
35 |
0 |
|| pIndex->tnum>pData->mxPage |
134711
|
0 |
35 |
|| sqlite3IndexHasDuplicateRootPage(pIndex) |
134713
|
0 |
0 |
if( sqlite3Config.bExtraSchemaChecks ){ |
134757
|
216 |
221 |
azArg[1] = zSchemaTabName = SCHEMA_TABLE(iDb); |
134772
|
0 |
437 |
if( initData.rc ){ |
134780
|
216 |
221 |
if( pDb->pBt==0 ){ |
134791
|
197 |
24 |
if( sqlite3BtreeTxnState(pDb->pBt)==SQLITE_TXN_NONE ){ |
134793
|
0 |
197 |
if( rc!=SQLITE_OK ){ |
134817
|
1105 |
221 |
for(i=0; i
|
134820
|
0 |
221 |
if( (db->flags & SQLITE_ResetDatabase)!=0 ){ |
134830
|
35 |
186 |
if( meta[BTREE_TEXT_ENCODING-1] ){ /* text encoding */ |
134831
|
35 |
0 |
if( iDb==0 && (db->mDbFlags & DBFLAG_EncodingFixed)==0 ){ |
|
32 |
3 |
if( iDb==0 && (db->mDbFlags & DBFLAG_EncodingFixed)==0 ){ |
134836
|
0 |
32 |
if( encoding==0 ) encoding = SQLITE_UTF8; |
134843
|
0 |
3 |
if( (meta[BTREE_TEXT_ENCODING-1] & 3)!=ENC(db) ){ |
134853
|
218 |
3 |
if( pDb->pSchema->cache_size==0 ){ |
134856
|
218 |
0 |
if( size==0 ){ size = SQLITE_DEFAULT_CACHE_SIZE; } |
134871
|
186 |
35 |
if( pDb->pSchema->file_format==0 ){ |
134874
|
0 |
221 |
if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){ |
134885
|
216 |
5 |
if( iDb==0 && meta[BTREE_FILE_FORMAT-1]>=4 ){ |
|
35 |
181 |
if( iDb==0 && meta[BTREE_FILE_FORMAT-1]>=4 ){ |
134909
|
221 |
0 |
if( rc==SQLITE_OK ) rc = initData.rc; |
134912
|
221 |
0 |
if( rc==SQLITE_OK ){ |
134918
|
0 |
221 |
if( db->mallocFailed ){ |
134923
|
0 |
221 |
if( rc==SQLITE_OK || ((db->flags&SQLITE_NoSchemaError) && rc!=SQLITE_NOMEM)){ |
|
0 |
0 |
if( rc==SQLITE_OK || ((db->flags&SQLITE_NoSchemaError) && rc!=SQLITE_NOMEM)){ |
|
0 |
0 |
if( rc==SQLITE_OK || ((db->flags&SQLITE_NoSchemaError) && rc!=SQLITE_NOMEM)){ |
134943
|
197 |
24 |
if( openedTransaction ){ |
134949
|
0 |
437 |
if( rc ){ |
134950
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){ |
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){ |
134978
|
216 |
284 |
if( !DbHasProperty(db, 0, DB_SchemaLoaded) ){ |
134980
|
0 |
216 |
if( rc ) return rc; |
134983
|
576 |
500 |
for(i=db->nDb-1; i>0; i--){ |
134985
|
221 |
355 |
if( !DbHasProperty(db, i, DB_SchemaLoaded) ){ |
134987
|
0 |
221 |
if( rc ) return rc; |
134990
|
451 |
49 |
if( commit_internal ){ |
135004
|
482 |
1005 |
if( !db->init.busy ){ |
135006
|
0 |
482 |
if( rc!=SQLITE_OK ){ |
135009
|
482 |
0 |
}else if( db->noSharedCache ){ |
135030
|
20 |
10 |
for(iDb=0; iDbnDb; iDb++){ |
135033
|
10 |
10 |
if( pBt==0 ) continue; |
135038
|
10 |
0 |
if( sqlite3BtreeTxnState(pBt)==SQLITE_TXN_NONE ){ |
135040
|
10 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){ |
|
0 |
10 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){ |
135044
|
0 |
10 |
if( rc!=SQLITE_OK ) return; |
135053
|
0 |
10 |
if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){ |
135059
|
10 |
0 |
if( openedTransaction ){ |
135087
|
13286 |
35 |
if( pSchema ){ |
135090
|
13286 |
5777 |
if( db->aDb[i].pSchema==pSchema ){ |
135110
|
326 |
6162 |
while( pParse->pCleanup ){ |
135117
|
932 |
5230 |
if( pParse->pConstExpr ){ |
135122
|
5664 |
498 |
db->lookaside.sz = db->lookaside.bDisable ? 0 : db->lookaside.szTrue; |
135163
|
326 |
0 |
if( pCleanup ){ |
135194
|
0 |
62 |
if( db->mallocFailed ) sqlite3ErrorMsg(pParse, "out of memory"); |
135229
|
0 |
6100 |
if( db->mallocFailed ) sqlite3ErrorMsg(&sParse, "out of memory"); |
135235
|
98 |
6002 |
if( prepFlags & SQLITE_PREPARE_PERSISTENT ){ |
135264
|
0 |
6100 |
if( !db->noSharedCache ){ |
135265
|
0 |
0 |
for(i=0; inDb; i++) { |
135267
|
0 |
0 |
if( pBt ){ |
135270
|
0 |
0 |
if( rc ){ |
135282
|
0 |
6100 |
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) ){ |
135287
|
0 |
0 |
if( nBytes>mxLen ){ |
135293
|
0 |
0 |
if( zSqlCopy ){ |
135305
|
4932 |
1168 |
if( pzTail ){ |
135309
|
4864 |
1236 |
if( db->init.busy==0 ){ |
135312
|
0 |
6100 |
if( db->mallocFailed ){ |
135316
|
6092 |
8 |
if( sParse.rc!=SQLITE_OK && sParse.rc!=SQLITE_DONE ){ |
|
26 |
6066 |
if( sParse.rc!=SQLITE_OK && sParse.rc!=SQLITE_DONE ){ |
135317
|
10 |
16 |
if( sParse.checkSchema && db->init.busy==0 ){ |
|
10 |
0 |
if( sParse.checkSchema && db->init.busy==0 ){ |
135320
|
10 |
16 |
if( sParse.pVdbe ){ |
135325
|
26 |
0 |
if( sParse.zErrMsg ){ |
135340
|
0 |
6100 |
while( sParse.pTriggerPrg ){ |
135367
|
5351 |
0 |
if( !sqlite3SafetyCheckOk(db)||zSql==0 ){ |
|
0 |
5351 |
if( !sqlite3SafetyCheckOk(db)||zSql==0 ){ |
135378
|
26 |
5325 |
if( rc==SQLITE_OK || db->mallocFailed ) break; |
|
26 |
0 |
if( rc==SQLITE_OK || db->mallocFailed ) break; |
135379
|
0 |
0 |
}while( (rc==SQLITE_ERROR_RETRY && (cnt++)
|
135380
|
0 |
26 |
|| (rc==SQLITE_SCHEMA && (sqlite3ResetOneSchema(db,-1), cnt++)==0) ); |
|
0 |
26 |
|| (rc==SQLITE_SCHEMA && (sqlite3ResetOneSchema(db,-1), cnt++)==0) ); |
|
0 |
0 |
|| (rc==SQLITE_SCHEMA && (sqlite3ResetOneSchema(db,-1), cnt++)==0) ); |
135412
|
0 |
1 |
if( rc ){ |
135413
|
0 |
0 |
if( rc==SQLITE_NOMEM ){ |
135515
|
0 |
0 |
if( !sqlite3SafetyCheckOk(db)||zSql==0 ){ |
|
0 |
0 |
if( !sqlite3SafetyCheckOk(db)||zSql==0 ){ |
135518
|
0 |
0 |
if( nBytes>=0 ){ |
135521
|
0 |
0 |
for(sz=0; sz
|
|
0 |
0 |
for(sz=0; sz
|
|
0 |
0 |
for(sz=0; sz
|
135526
|
0 |
0 |
if( zSql8 ){ |
135530
|
0 |
0 |
if( zTail8 && pzTail ){ |
|
0 |
0 |
if( zTail8 && pzTail ){ |
135675
|
4654 |
4569 |
while( p ){ |
135684
|
0 |
4654 |
if( OK_IF_ALWAYS_TRUE(p->pWith) ) sqlite3WithDelete(db, p->pWith); |
135686
|
0 |
4654 |
if( OK_IF_ALWAYS_TRUE(p->pWinDefn) ){ |
135689
|
0 |
4654 |
while( p->pWin ){ |
135694
|
4654 |
0 |
if( bFree ) sqlite3DbFreeNN(db, p); |
135731
|
0 |
4651 |
if( pNew==0 ){ |
135735
|
2 |
4649 |
if( pEList==0 ){ |
135748
|
3223 |
1428 |
if( pSrc==0 ) pSrc = sqlite3DbMallocZero(pParse->db, sizeof(*pSrc)); |
135762
|
0 |
4651 |
if( pParse->db->mallocFailed ) { |
135776
|
4569 |
2693 |
if( OK_IF_ALWAYS_TRUE(p) ) clearSelect(db, p, 1); |
135783
|
0 |
2 |
while( p->pNext ) p = p->pNext; |
135873
|
16 |
0 |
for(i=0; i<3 && apAll[i]; i++){ |
|
8 |
8 |
for(i=0; i<3 && apAll[i]; i++){ |
135875
|
32 |
0 |
for(j=0; j
|
135876
|
16 |
16 |
if( p->n==aKeyword[j].nChar |
135877
|
8 |
8 |
&& sqlite3StrNICmp((char*)p->z, &zKeyText[aKeyword[j].i], p->n)==0 ){ |
135883
|
0 |
8 |
if( j>=ArraySize(aKeyword) ){ |
135888
|
8 |
0 |
if( |
135889
|
8 |
0 |
(jointype & (JT_INNER|JT_OUTER))==(JT_INNER|JT_OUTER) || |
135890
|
0 |
8 |
(jointype & JT_ERROR)!=0 || |
135895
|
0 |
0 |
if( pB==0 ){ zSp1++; } |
135896
|
0 |
0 |
if( pC==0 ){ zSp2++; } |
135912
|
0 |
0 |
for(pCol=pTab->aCol, i=0; inCol; pCol++, i++){ |
135913
|
0 |
0 |
if( pCol->hName==h && sqlite3StrICmp(pCol->zCnName, zCol)==0 ) return i; |
|
0 |
0 |
if( pCol->hName==h && sqlite3StrICmp(pCol->zCnName, zCol)==0 ) return i; |
135924
|
0 |
0 |
if( pItem->fg.isNestedFrom ){ |
135960
|
0 |
0 |
for(i=iStart; i<=iEnd; i++){ |
135962
|
0 |
0 |
if( iCol>=0 |
135963
|
0 |
0 |
&& (bIgnoreHidden==0 || IsHiddenColumn(&pSrc->a[i].pTab->aCol[iCol])==0) |
|
0 |
0 |
&& (bIgnoreHidden==0 || IsHiddenColumn(&pSrc->a[i].pTab->aCol[iCol])==0) |
135965
|
0 |
0 |
if( piTab ){ |
136004
|
72 |
80 |
while( p ){ |
136009
|
0 |
72 |
if( p->op==TK_FUNCTION ){ |
136011
|
0 |
0 |
if( p->x.pList ){ |
136013
|
0 |
0 |
for(i=0; ix.pList->nExpr; i++){ |
136038
|
316 |
610 |
while( p ){ |
136039
|
8 |
308 |
if( iTable<0 || (ExprHasProperty(p, EP_OuterON) && p->w.iJoin==iTable) ){ |
|
5 |
3 |
if( iTable<0 || (ExprHasProperty(p, EP_OuterON) && p->w.iJoin==iTable) ){ |
|
5 |
0 |
if( iTable<0 || (ExprHasProperty(p, EP_OuterON) && p->w.iJoin==iTable) ){ |
136041
|
5 |
308 |
if( iTable>=0 ) ExprSetProperty(p, EP_InnerON); |
136043
|
104 |
212 |
if( p->op==TK_COLUMN && p->iTable==iTable && !nullable ){ |
|
2 |
102 |
if( p->op==TK_COLUMN && p->iTable==iTable && !nullable ){ |
|
2 |
0 |
if( p->op==TK_COLUMN && p->iTable==iTable && !nullable ){ |
136046
|
96 |
220 |
if( p->op==TK_FUNCTION ){ |
136048
|
96 |
0 |
if( p->x.pList ){ |
136050
|
192 |
96 |
for(i=0; ix.pList->nExpr; i++){ |
136090
|
11 |
1958 |
for(i=0; inSrc-1; i++, pRight++, pLeft++){ |
136094
|
11 |
0 |
if( NEVER(pLeft->pTab==0 || pRightTab==0) ) continue; |
|
0 |
11 |
if( NEVER(pLeft->pTab==0 || pRightTab==0) ) continue; |
136095
|
4 |
7 |
joinType = (pRight->fg.jointype & JT_OUTER)!=0 ? EP_OuterON : EP_InnerON; |
136100
|
0 |
11 |
if( pRight->fg.jointype & JT_NATURAL ){ |
136102
|
0 |
0 |
if( pRight->fg.isUsing || pRight->u3.pOn ){ |
|
0 |
0 |
if( pRight->fg.isUsing || pRight->u3.pOn ){ |
136107
|
0 |
0 |
for(j=0; jnCol; j++){ |
136110
|
0 |
0 |
if( IsHiddenColumn(&pRightTab->aCol[j]) ) continue; |
136112
|
0 |
0 |
if( tableAndColumnIndex(pSrc, 0, i, zName, 0, 0, 1) ){ |
136114
|
0 |
0 |
if( pUsing ){ |
136121
|
0 |
0 |
if( pUsing ){ |
136126
|
0 |
0 |
if( pParse->nErr ) return 1; |
136136
|
0 |
11 |
if( pRight->fg.isUsing ){ |
136140
|
0 |
0 |
for(j=0; jnId; j++){ |
136151
|
0 |
0 |
if( iRightCol<0 |
136152
|
0 |
0 |
|| tableAndColumnIndex(pSrc, 0, i, zName, &iLeft, &iLeftCol, |
136161
|
0 |
0 |
if( (pSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){ |
136177
|
0 |
0 |
while( tableAndColumnIndex(pSrc, iLeft+1, i, zName, &iLeft, &iLeftCol, |
136179
|
0 |
0 |
if( pSrc->a[iLeft].fg.isUsing==0 |
136180
|
0 |
0 |
|| sqlite3IdListIndex(pSrc->a[iLeft].u3.pUsing, zName)<0 |
136190
|
0 |
0 |
if( pFuncArgs ){ |
136199
|
0 |
0 |
if( pEq ){ |
136212
|
8 |
3 |
else if( pRight->u3.pOn ){ |
136271
|
1 |
106 |
if( pSort->pDeferredRowLoad ){ |
136319
|
107 |
0 |
if( nPrefixReg ){ |
136327
|
0 |
107 |
iLimit = pSelect->iOffset ? pSelect->iOffset+1 : pSelect->iLimit; |
136329
|
19 |
88 |
sqlite3ExprCodeExprList(pParse, pSort->pOrderBy, regBase, regOrigData, |
136331
|
1 |
106 |
if( bSeq ){ |
136334
|
0 |
107 |
if( nPrefixReg==0 && nData>0 ){ |
|
0 |
0 |
if( nPrefixReg==0 && nData>0 ){ |
136337
|
18 |
89 |
if( nOBSat>0 ){ |
136349
|
0 |
18 |
if( bSeq ){ |
136357
|
0 |
18 |
if( pParse->db->mallocFailed ) return; |
136372
|
0 |
18 |
if( iLimit ){ |
136380
|
1 |
106 |
if( iLimit ){ |
136405
|
89 |
18 |
if( regRecord==0 ){ |
136408
|
106 |
1 |
if( pSort->sortFlags & SORTFLAG_UseSorter ){ |
136415
|
1 |
106 |
if( iSkip ){ |
136416
|
0 |
1 |
sqlite3VdbeChangeP2(v, iSkip, |
136429
|
0 |
1835 |
if( iOffset>0 ){ |
136501
|
0 |
0 |
for(i=0; i
|
136503
|
0 |
0 |
if( i
|
136568
|
4 |
0 |
if( pParse->nErr==0 |
136569
|
4 |
0 |
&& (eTnctType==WHERE_DISTINCT_UNIQUE || eTnctType==WHERE_DISTINCT_ORDERED) |
|
0 |
4 |
&& (eTnctType==WHERE_DISTINCT_UNIQUE || eTnctType==WHERE_DISTINCT_ORDERED) |
136573
|
0 |
0 |
if( sqlite3VdbeGetOp(v, iOpenEphAddr+1)->opcode==OP_Explain ){ |
136576
|
0 |
0 |
if( eTnctType==WHERE_DISTINCT_ORDERED ){ |
136713
|
1798 |
143 |
hasDistinct = pDistinct ? pDistinct->eTnctType : WHERE_DISTINCT_NOOP; |
136714
|
1798 |
143 |
if( pSort && pSort->pOrderBy==0 ) pSort = 0; |
|
1691 |
107 |
if( pSort && pSort->pOrderBy==0 ) pSort = 0; |
136715
|
1834 |
107 |
if( pSort==0 && !hasDistinct ){ |
|
1830 |
4 |
if( pSort==0 && !hasDistinct ){ |
136724
|
1836 |
105 |
if( pDest->iSdst==0 ){ |
136725
|
107 |
1729 |
if( pSort ){ |
136727
|
1 |
106 |
if( !(pSort->sortFlags & SORTFLAG_UseSorter) ) nPrefixReg++; |
136732
|
0 |
105 |
}else if( pDest->iSdst+nResultCol > pParse->nMem ){ |
136742
|
2 |
1939 |
if( srcTab>=0 ){ |
136743
|
2 |
2 |
for(i=0; i
|
136747
|
1939 |
0 |
}else if( eDest!=SRT_Exists ){ |
136756
|
1921 |
18 |
if( eDest==SRT_Mem || eDest==SRT_Output || eDest==SRT_Coroutine ){ |
|
114 |
1807 |
if( eDest==SRT_Mem || eDest==SRT_Output || eDest==SRT_Coroutine ){ |
|
105 |
9 |
if( eDest==SRT_Mem || eDest==SRT_Output || eDest==SRT_Coroutine ){ |
136761
|
107 |
1832 |
if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab && eDest!=SRT_Table ){ |
|
107 |
0 |
if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab && eDest!=SRT_Table ){ |
|
107 |
0 |
if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab && eDest!=SRT_Table ){ |
|
107 |
0 |
if( pSort && hasDistinct==0 && eDest!=SRT_EphemTab && eDest!=SRT_Table ){ |
136770
|
139 |
107 |
for(i=pSort->nOBSat; ipOrderBy->nExpr; i++){ |
136772
|
120 |
19 |
if( (j = pSort->pOrderBy->a[i].u.x.iOrderByCol)>0 ){ |
136794
|
261 |
107 |
for(i=0; inExpr; i++){ |
136795
|
120 |
141 |
if( pEList->a[i].u.x.iOrderByCol>0 |
136821
|
20 |
1919 |
if( p->iLimit |
136822
|
1 |
19 |
&& (ecelFlags & SQLITE_ECEL_OMITREF)!=0 |
136823
|
1 |
0 |
&& nPrefixReg>0 |
136838
|
4 |
1937 |
if( hasDistinct ){ |
136844
|
4 |
0 |
if( pSort==0 ){ |
136886
|
0 |
0 |
if( eDest==SRT_DistFifo ){ |
136899
|
0 |
0 |
if( pSort ){ |
136914
|
0 |
0 |
if( pSort ){ |
136928
|
0 |
0 |
if( i2<0 ){ |
136943
|
0 |
3 |
if( pSort ){ |
136975
|
0 |
18 |
if( pSort ){ |
136992
|
107 |
1807 |
if( pSort ){ |
136995
|
107 |
1700 |
}else if( eDest==SRT_Coroutine ){ |
137022
|
0 |
0 |
if( eDest==SRT_DistQueue ){ |
137031
|
0 |
0 |
if( eDest==SRT_DistQueue ){ |
137035
|
0 |
0 |
for(i=0; i
|
137043
|
0 |
0 |
if( addrTest ) sqlite3VdbeJumpHere(v, addrTest); |
137069
|
1834 |
107 |
if( pSort==0 && p->iLimit ){ |
|
19 |
1815 |
if( pSort==0 && p->iLimit ){ |
137081
|
737 |
0 |
if( p ){ |
137099
|
764 |
0 |
if( p ){ |
137102
|
737 |
27 |
if( p->nRef==0 ) sqlite3DbFreeNN(p->db, p); |
137110
|
27 |
0 |
if( p ){ |
137155
|
650 |
0 |
if( pInfo ){ |
137157
|
703 |
650 |
for(i=iStart, pItem=pList->a+iStart; i
|
137243
|
18 |
89 |
if( pSort->labelBkOut ){ |
137260
|
0 |
107 |
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 ){ |
137261
|
0 |
107 |
if( eDest==SRT_Mem && p->iOffset ){ |
|
0 |
0 |
if( eDest==SRT_Mem && p->iOffset ){ |
137268
|
0 |
0 |
if( eDest==SRT_EphemTab || eDest==SRT_Table ){ |
|
0 |
0 |
if( eDest==SRT_EphemTab || eDest==SRT_Table ){ |
137276
|
106 |
1 |
if( pSort->sortFlags & SORTFLAG_UseSorter ){ |
137279
|
18 |
88 |
if( pSort->labelBkOut ){ |
137284
|
18 |
88 |
if( addrOnce ) sqlite3VdbeJumpHere(v, addrOnce); |
137295
|
0 |
1 |
if( p->iOffset>0 ){ |
137299
|
261 |
107 |
for(i=0, iCol=nKey+bSeq-1; i
|
137303
|
141 |
120 |
if( aOutEx[i].u.x.iOrderByCol==0 ) iCol++; |
137336
|
261 |
107 |
for(i=nColumn-1; i>=0; i--){ |
137344
|
120 |
141 |
if( aOutEx[i].u.x.iOrderByCol ){ |
137379
|
0 |
0 |
if( i2<0 ){ |
137390
|
107 |
0 |
if( eDest==SRT_Output ){ |
137398
|
0 |
107 |
if( regRowid ){ |
137399
|
0 |
0 |
if( eDest==SRT_Set ){ |
137409
|
106 |
1 |
if( pSort->sortFlags & SORTFLAG_UseSorter ){ |
137414
|
18 |
89 |
if( pSort->regReturn ) sqlite3VdbeAddOp1(v, OP_Return, pSort->regReturn); |
137477
|
7564 |
0 |
while( pNC && !pTab ){ |
|
3782 |
3782 |
while( pNC && !pTab ){ |
137479
|
3787 |
0 |
for(j=0;jnSrc && pTabList->a[j].iCursor!=pExpr->iTable;j++); |
|
5 |
3782 |
for(j=0;jnSrc && pTabList->a[j].iCursor!=pExpr->iTable;j++); |
137480
|
3782 |
0 |
if( jnSrc ){ |
137488
|
0 |
3782 |
if( pTab==0 ){ |
137510
|
198 |
3584 |
if( pS ){ |
137515
|
198 |
0 |
if( iColpEList->nExpr |
137519
|
198 |
0 |
&& ALWAYS(iCol>=0) |
137537
|
101 |
3483 |
if( iCol<0 ) iCol = pTab->iPKey; |
137539
|
12 |
3572 |
if( iCol<0 ){ |
137547
|
3551 |
33 |
if( pNC->pParse && pTab->pSchema ){ |
|
3551 |
0 |
if( pNC->pParse && pTab->pSchema ){ |
137584
|
4494 |
146 |
if( pzOrigDb ){ |
137610
|
4296 |
1807 |
for(i=0; inExpr; i++){ |
137680
|
0 |
1807 |
if( pParse->explain ){ |
137685
|
0 |
1807 |
if( pParse->colNamesSet ) return; |
137687
|
0 |
1807 |
while( pSelect->pPrior ) pSelect = pSelect->pPrior; |
137695
|
1 |
1806 |
srcName = (db->flags & SQLITE_ShortColNames)!=0 || fullName; |
|
1 |
0 |
srcName = (db->flags & SQLITE_ShortColNames)!=0 || fullName; |
137697
|
4296 |
1807 |
for(i=0; inExpr; i++){ |
137704
|
4296 |
0 |
if( pEList->a[i].zEName && pEList->a[i].fg.eEName==ENAME_NAME ){ |
|
2806 |
1490 |
if( pEList->a[i].zEName && pEList->a[i].fg.eEName==ENAME_NAME ){ |
137708
|
1490 |
0 |
}else if( srcName && p->op==TK_COLUMN ){ |
|
866 |
624 |
}else if( srcName && p->op==TK_COLUMN ){ |
137713
|
86 |
780 |
if( iCol<0 ) iCol = pTab->iPKey; |
137715
|
12 |
854 |
if( iCol<0 ){ |
137720
|
0 |
866 |
if( fullName ){ |
137729
|
0 |
624 |
z = z==0 ? sqlite3MPrintf(db, "column%d", i+1) : sqlite3DbStrDup(db, z); |
137775
|
35 |
0 |
if( pEList ){ |
137779
|
0 |
35 |
if( NEVER(nCol>32767) ) nCol = 32767; |
137788
|
146 |
35 |
for(i=0, pCol=aCol; imallocFailed; i++, pCol++){ |
|
146 |
0 |
for(i=0, pCol=aCol; imallocFailed; i++, pCol++){ |
137793
|
146 |
0 |
if( (zName = pX->zEName)!=0 && pX->fg.eEName==ENAME_NAME ){ |
|
87 |
59 |
if( (zName = pX->zEName)!=0 && pX->fg.eEName==ENAME_NAME ){ |
137797
|
59 |
0 |
while( ALWAYS(pColExpr!=0) && pColExpr->op==TK_DOT ){ |
|
0 |
59 |
while( ALWAYS(pColExpr!=0) && pColExpr->op==TK_DOT ){ |
137801
|
0 |
59 |
if( pColExpr->op==TK_COLUMN |
137802
|
0 |
0 |
&& ALWAYS( ExprUseYTab(pColExpr) ) |
137803
|
0 |
0 |
&& ALWAYS( pColExpr->y.pTab!=0 ) |
137808
|
0 |
0 |
if( iCol<0 ) iCol = pTab->iPKey; |
137809
|
0 |
0 |
zName = iCol>=0 ? pTab->aCol[iCol].zCnName : "rowid"; |
137810
|
59 |
0 |
}else if( pColExpr->op==TK_ID ){ |
137818
|
146 |
0 |
if( zName && !sqlite3IsTrueOrFalse(zName) ){ |
|
146 |
0 |
if( zName && !sqlite3IsTrueOrFalse(zName) ){ |
137828
|
146 |
0 |
while( zName && (pCollide = sqlite3HashFind(&ht, zName))!=0 ){ |
|
0 |
146 |
while( zName && (pCollide = sqlite3HashFind(&ht, zName))!=0 ){ |
137829
|
0 |
0 |
if( pCollide->fg.bUsingTerm ){ |
137833
|
0 |
0 |
if( nName>0 ){ |
137834
|
0 |
0 |
for(j=nName-1; j>0 && sqlite3Isdigit(zName[j]); j--){} |
|
0 |
0 |
for(j=nName-1; j>0 && sqlite3Isdigit(zName[j]); j--){} |
137835
|
0 |
0 |
if( zName[j]==':' ) nName = j; |
137838
|
0 |
0 |
if( cnt>3 ) sqlite3_randomness(sizeof(cnt), &cnt); |
137842
|
0 |
146 |
if( pX->fg.bNoExpand ){ |
137846
|
146 |
0 |
if( zName && sqlite3HashInsert(&ht, zName, pX)==pX ){ |
|
0 |
146 |
if( zName && sqlite3HashInsert(&ht, zName, pX)==pX ){ |
137851
|
0 |
35 |
if( db->mallocFailed ){ |
137852
|
0 |
0 |
for(j=0; j
|
137891
|
0 |
35 |
if( db->mallocFailed ) return; |
137895
|
146 |
35 |
for(i=0, pCol=pTab->aCol; inCol; i++, pCol++){ |
137903
|
33 |
113 |
if( zType ){ |
137907
|
33 |
0 |
if( pCol->zCnName ){ |
137915
|
87 |
59 |
if( pCol->affinity<=SQLITE_AFF_NONE ) pCol->affinity = aff; |
137917
|
85 |
61 |
if( pColl ){ |
137939
|
0 |
0 |
if( pParse->nErr ) return 0; |
137940
|
0 |
0 |
while( pSelect->pPrior ) pSelect = pSelect->pPrior; |
137942
|
0 |
0 |
if( pTab==0 ){ |
137951
|
0 |
0 |
if( db->mallocFailed ){ |
137963
|
1395 |
5358 |
if( pParse->pVdbe ){ |
137966
|
5358 |
0 |
if( pParse->pToplevel==0 |
137967
|
5358 |
0 |
&& OptimizationEnabled(pParse->db,SQLITE_FactorOutConst) |
138005
|
0 |
1927 |
if( p->iLimit ) return; |
138013
|
20 |
1907 |
if( pLimit ){ |
138019
|
20 |
0 |
if( sqlite3ExprIsInteger(pLimit->pLeft, &n) ){ |
138022
|
0 |
20 |
if( n==0 ){ |
138024
|
20 |
0 |
}else if( n>=0 && p->nSelectRow>sqlite3LogEst((u64)n) ){ |
|
20 |
0 |
}else if( n>=0 && p->nSelectRow>sqlite3LogEst((u64)n) ){ |
138034
|
0 |
20 |
if( pLimit->pRight ){ |
138057
|
4 |
2 |
if( p->pPrior ){ |
138066
|
6 |
0 |
if( pRet==0 && ALWAYS(iColpEList->nExpr) ){ |
|
6 |
0 |
if( pRet==0 && ALWAYS(iColpEList->nExpr) ){ |
138083
|
0 |
0 |
int nOrderBy = ALWAYS(pOrderBy!=0) ? pOrderBy->nExpr : 0; |
138086
|
0 |
0 |
if( pRet ){ |
138088
|
0 |
0 |
for(i=0; i
|
138093
|
0 |
0 |
if( pTerm->flags & EP_Collate ){ |
138097
|
0 |
0 |
if( pColl==0 ) pColl = db->pDfltColl; |
138172
|
0 |
0 |
if( p->pWin ){ |
138179
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_RECURSIVE, 0, 0, 0) ) return; |
138193
|
0 |
0 |
for(i=0; ALWAYS(inSrc); i++){ |
138194
|
0 |
0 |
if( pSrc->a[i].fg.isRecursive ){ |
138204
|
0 |
0 |
if( p->op==TK_UNION ){ |
138205
|
0 |
0 |
eDest = pOrderBy ? SRT_DistQueue : SRT_DistFifo; |
138208
|
0 |
0 |
eDest = pOrderBy ? SRT_Queue : SRT_Fifo; |
138215
|
0 |
0 |
if( pOrderBy ){ |
138224
|
0 |
0 |
if( iDistinct ){ |
138239
|
0 |
0 |
for(pFirstRec=p; ALWAYS(pFirstRec!=0); pFirstRec=pFirstRec->pPrior){ |
138240
|
0 |
0 |
if( pFirstRec->selFlags & SF_Aggregate ){ |
138245
|
0 |
0 |
if( (pFirstRec->pPrior->selFlags & SF_Recursive)==0 ) break; |
138254
|
0 |
0 |
if( rc ) goto end_of_recursive_query; |
138261
|
0 |
0 |
if( pOrderBy ){ |
138273
|
0 |
0 |
if( regLimit ){ |
138337
|
0 |
14 |
if( p->pWin ) return -1; |
138339
|
4 |
10 |
if( p->pPrior==0 ) break; |
138344
|
0 |
4 |
ExplainQueryPlan((pParse, 0, "SCAN %d CONSTANT ROW%s", nRow, |
138346
|
14 |
4 |
while( p ){ |
138348
|
0 |
14 |
if( !bShowAll ) break; |
138361
|
0 |
0 |
while( p && (p->selFlags & SF_Recursive)!=0 ){ p = p->pPrior; } |
|
0 |
0 |
while( p && (p->selFlags & SF_Recursive)!=0 ){ p = p->pPrior; } |
138425
|
0 |
79 |
if( dest.eDest==SRT_EphemTab ){ |
138433
|
4 |
75 |
if( p->selFlags & SF_MultiValue ){ |
138435
|
4 |
0 |
if( rc>=0 ) goto multi_select_end; |
138446
|
0 |
75 |
if( (p->selFlags & SF_Recursive)!=0 && hasAnchor(p) ){ |
|
0 |
0 |
if( (p->selFlags & SF_Recursive)!=0 && hasAnchor(p) ){ |
138453
|
0 |
75 |
if( p->pOrderBy ){ |
138458
|
22 |
53 |
if( pPrior->pPrior==0 ){ |
138477
|
0 |
71 |
if( rc ){ |
138483
|
0 |
71 |
if( p->iLimit ){ |
138486
|
0 |
0 |
if( p->iOffset ){ |
138498
|
0 |
71 |
if( p->pLimit |
138499
|
0 |
0 |
&& sqlite3ExprIsInteger(p->pLimit->pLeft, &nLimit) |
138500
|
0 |
0 |
&& nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit) |
|
0 |
0 |
&& nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit) |
138504
|
0 |
71 |
if( addr ){ |
138521
|
2 |
2 |
if( dest.eDest==priorOp ){ |
138547
|
0 |
4 |
if( rc ){ |
138553
|
0 |
4 |
if( p->op==TK_EXCEPT ){ |
138572
|
4 |
0 |
if( p->op==TK_UNION ){ |
138585
|
2 |
2 |
if( dest.eDest!=priorOp && db->mallocFailed==0 ){ |
|
2 |
0 |
if( dest.eDest!=priorOp && db->mallocFailed==0 ){ |
138628
|
0 |
0 |
if( rc ){ |
138648
|
0 |
0 |
if( p->nSelectRow>pPrior->nSelectRow ){ |
138657
|
0 |
0 |
if( rc ) break; |
138680
|
22 |
53 |
if( p->pNext==0 ){ |
138685
|
0 |
75 |
if( pParse->nErr ) goto multi_select_end; |
138696
|
2 |
73 |
if( p->selFlags & SF_UsesEphemeral ){ |
138707
|
0 |
2 |
if( !pKeyInfo ){ |
138711
|
2 |
2 |
for(i=0, apColl=pKeyInfo->aColl; i
|
138713
|
2 |
0 |
if( 0==*apColl ){ |
138718
|
6 |
2 |
for(pLoop=p; pLoop; pLoop=pLoop->pPrior){ |
138719
|
8 |
0 |
for(i=0; i<2; i++){ |
138721
|
6 |
2 |
if( addr<0 ){ |
138739
|
0 |
79 |
if( pDelete ){ |
138753
|
0 |
0 |
if( p->selFlags & SF_Values ){ |
138801
|
0 |
0 |
if( regPrev ){ |
138811
|
0 |
0 |
if( pParse->db->mallocFailed ) return 0; |
138866
|
0 |
0 |
if( pDest->iSdst==0 ){ |
138892
|
0 |
0 |
if( p->iLimit ){ |
139053
|
0 |
0 |
if( op!=TK_ALL ){ |
139054
|
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++){ |
139056
|
0 |
0 |
for(j=0, pItem=pOrderBy->a; j
|
139059
|
0 |
0 |
if( pItem->u.x.iOrderByCol==i ) break; |
139061
|
0 |
0 |
if( j==nOrderBy ){ |
139063
|
0 |
0 |
if( pNew==0 ) return SQLITE_NOMEM_BKPT; |
139067
|
0 |
0 |
if( pOrderBy ) pOrderBy->a[nOrderBy++].u.x.iOrderByCol = (u16)i; |
139080
|
0 |
0 |
if( aPermute ){ |
139083
|
0 |
0 |
for(i=1, pItem=pOrderBy->a; i<=nOrderBy; i++, pItem++){ |
139098
|
0 |
0 |
if( op==TK_ALL ){ |
139107
|
0 |
0 |
if( pKeyDup ){ |
139109
|
0 |
0 |
for(i=0; i
|
139119
|
0 |
0 |
if( (op==TK_ALL || op==TK_UNION) |
|
0 |
0 |
if( (op==TK_ALL || op==TK_UNION) |
139120
|
0 |
0 |
&& OptimizationEnabled(db, SQLITE_BalancedMerge) |
139122
|
0 |
0 |
for(pSplit=p; pSplit->pPrior!=0 && pSplit->op==op; pSplit=pSplit->pPrior){ |
|
0 |
0 |
for(pSplit=p; pSplit->pPrior!=0 && pSplit->op==op; pSplit=pSplit->pPrior){ |
139127
|
0 |
0 |
if( nSelect<=3 ){ |
139131
|
0 |
0 |
for(i=2; ipPrior; } |
139145
|
0 |
0 |
if( p->iLimit && op==TK_ALL ){ |
|
0 |
0 |
if( p->iLimit && op==TK_ALL ){ |
139148
|
0 |
0 |
sqlite3VdbeAddOp2(v, OP_Copy, p->iOffset ? p->iOffset+1 : p->iLimit, |
139205
|
0 |
0 |
if( op==TK_ALL || op==TK_UNION ){ |
|
0 |
0 |
if( op==TK_ALL || op==TK_UNION ){ |
139216
|
0 |
0 |
if( op==TK_EXCEPT || op==TK_INTERSECT ){ |
|
0 |
0 |
if( op==TK_EXCEPT || op==TK_INTERSECT ){ |
139230
|
0 |
0 |
if( op==TK_INTERSECT ){ |
139232
|
0 |
0 |
if( p->nSelectRow > pPrior->nSelectRow ) p->nSelectRow = pPrior->nSelectRow; |
139249
|
0 |
0 |
if( op==TK_ALL ){ |
139251
|
0 |
0 |
}else if( op==TK_INTERSECT ){ |
139265
|
0 |
0 |
if( op==TK_ALL || op==TK_UNION ){ |
|
0 |
0 |
if( op==TK_ALL || op==TK_UNION ){ |
139292
|
0 |
0 |
if( pSplit->pPrior ){ |
139373
|
1126 |
740 |
if( pExpr==0 ) return 0; |
139374
|
0 |
740 |
if( ExprHasProperty(pExpr, EP_OuterON|EP_InnerON) |
139375
|
0 |
0 |
&& pExpr->w.iJoin==pSubst->iTable |
139380
|
325 |
415 |
if( pExpr->op==TK_COLUMN |
139381
|
233 |
92 |
&& pExpr->iTable==pSubst->iTable |
139382
|
233 |
0 |
&& !ExprHasProperty(pExpr, EP_FixedCol) |
139395
|
0 |
233 |
if( sqlite3ExprIsVector(pCopy) ){ |
139399
|
0 |
233 |
if( pSubst->isOuterJoin && pCopy->op!=TK_COLUMN ){ |
|
0 |
0 |
if( pSubst->isOuterJoin && pCopy->op!=TK_COLUMN ){ |
139409
|
0 |
233 |
if( db->mallocFailed ){ |
139413
|
0 |
233 |
if( pSubst->isOuterJoin ){ |
139416
|
0 |
233 |
if( ExprHasProperty(pExpr,EP_OuterON|EP_InnerON) ){ |
139422
|
0 |
233 |
if( pExpr->op==TK_TRUEFALSE ){ |
139430
|
82 |
151 |
if( pExpr->op!=TK_COLUMN && pExpr->op!=TK_COLLATE ){ |
|
82 |
0 |
if( pExpr->op!=TK_COLUMN && pExpr->op!=TK_COLLATE ){ |
139432
|
0 |
82 |
pExpr = sqlite3ExprAddCollateString(pSubst->pParse, pExpr, |
139440
|
0 |
507 |
if( pExpr->op==TK_IF_NULL_ROW && pExpr->iTable==pSubst->iTable ){ |
|
0 |
0 |
if( pExpr->op==TK_IF_NULL_ROW && pExpr->iTable==pSubst->iTable ){ |
139445
|
0 |
507 |
if( ExprUseXSelect(pExpr) ){ |
139451
|
0 |
507 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){ |
139466
|
510 |
219 |
if( pList==0 ) return; |
139467
|
603 |
219 |
for(i=0; inExpr; i++){ |
139479
|
35 |
26 |
if( !p ) return; |
139488
|
48 |
74 |
for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){ |
139490
|
0 |
48 |
if( pItem->fg.isTabFunc ){ |
139494
|
61 |
13 |
}while( doPrior && (p = p->pPrior)!=0 ); |
|
48 |
13 |
}while( doPrior && (p = p->pPrior)!=0 ); |
139508
|
260 |
198 |
if( pExpr->op!=TK_COLUMN ) return WRC_Continue; |
139510
|
92 |
106 |
if( pItem->iCursor!=pExpr->iTable ) return WRC_Continue; |
139511
|
0 |
106 |
if( pExpr->iColumn<0 ) return WRC_Continue; |
139520
|
0 |
13 |
if( NEVER(pSrcItem->pTab==0) ) return; |
139552
|
0 |
0 |
for(i=0, pItem=pSrc->a; inSrc; i++, pItem++){ |
139553
|
0 |
0 |
if( i!=iExcept ){ |
139556
|
0 |
0 |
if( !pItem->fg.isRecursive || aCsrMap[pItem->iCursor+1]==0 ){ |
|
0 |
0 |
if( !pItem->fg.isRecursive || aCsrMap[pItem->iCursor+1]==0 ){ |
139560
|
0 |
0 |
for(p=pItem->pSelect; p; p=p->pPrior){ |
139573
|
0 |
0 |
if( iCsr < aCsrMap[0] && aCsrMap[iCsr+1]>0 ){ |
|
0 |
0 |
if( iCsr < aCsrMap[0] && aCsrMap[iCsr+1]>0 ){ |
139584
|
0 |
0 |
if( op==TK_COLUMN || op==TK_IF_NULL_ROW ){ |
|
0 |
0 |
if( op==TK_COLUMN || op==TK_IF_NULL_ROW ){ |
139587
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_OuterON) ){ |
139829
|
0 |
35 |
if( OptimizationDisabled(db, SQLITE_QueryFlattener) ) return 0; |
139838
|
35 |
0 |
if( p->pWin || pSub->pWin ) return 0; /* Restriction (25) */ |
|
0 |
35 |
if( p->pWin || pSub->pWin ) return 0; /* Restriction (25) */ |
139848
|
0 |
35 |
if( pSub->pLimit && p->pLimit ) return 0; /* Restriction (13) */ |
|
0 |
0 |
if( pSub->pLimit && p->pLimit ) return 0; /* Restriction (13) */ |
139849
|
0 |
35 |
if( pSub->pLimit && pSub->pLimit->pRight ) return 0; /* Restriction (14) */ |
|
0 |
0 |
if( pSub->pLimit && pSub->pLimit->pRight ) return 0; /* Restriction (14) */ |
139850
|
0 |
35 |
if( (p->selFlags & SF_Compound)!=0 && pSub->pLimit ){ |
|
0 |
0 |
if( (p->selFlags & SF_Compound)!=0 && pSub->pLimit ){ |
139853
|
22 |
13 |
if( pSubSrc->nSrc==0 ) return 0; /* Restriction (7) */ |
139854
|
0 |
13 |
if( pSub->selFlags & SF_Distinct ) return 0; /* Restriction (4) */ |
139855
|
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) ){ |
139858
|
13 |
0 |
if( p->pOrderBy && pSub->pOrderBy ){ |
|
0 |
13 |
if( p->pOrderBy && pSub->pOrderBy ){ |
139861
|
0 |
13 |
if( isAgg && pSub->pOrderBy ) return 0; /* Restriction (16) */ |
|
0 |
0 |
if( isAgg && pSub->pOrderBy ) return 0; /* Restriction (16) */ |
139862
|
0 |
13 |
if( pSub->pLimit && p->pWhere ) return 0; /* Restriction (19) */ |
|
0 |
0 |
if( pSub->pLimit && p->pWhere ) return 0; /* Restriction (19) */ |
139863
|
0 |
13 |
if( pSub->pLimit && (p->selFlags & SF_Distinct)!=0 ){ |
|
0 |
0 |
if( pSub->pLimit && (p->selFlags & SF_Distinct)!=0 ){ |
139866
|
0 |
13 |
if( pSub->selFlags & (SF_Recursive) ){ |
139890
|
0 |
13 |
if( (pSubitem->fg.jointype & (JT_OUTER|JT_LTORJ))!=0 ){ |
139891
|
0 |
0 |
if( pSubSrc->nSrc>1 /* (3a) */ |
139892
|
0 |
0 |
|| isAgg /* (3c) */ |
139893
|
0 |
0 |
|| IsVirtual(pSubSrc->a[0].pTab) /* (3b) */ |
139894
|
0 |
0 |
|| (p->selFlags & SF_Distinct)!=0 /* (3d) */ |
139895
|
0 |
0 |
|| (pSubitem->fg.jointype & JT_RIGHT)!=0 /* (26) */ |
139912
|
0 |
13 |
if( iFrom>0 && (pSubSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){ |
|
0 |
0 |
if( iFrom>0 && (pSubSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){ |
139915
|
0 |
13 |
if( pSubitem->fg.isCte && pSubitem->u2.pCteUse->eM10d==M10d_Yes ){ |
|
0 |
0 |
if( pSubitem->fg.isCte && pSubitem->u2.pCteUse->eM10d==M10d_Yes ){ |
139936
|
0 |
13 |
if( pSubSrc->nSrc>=2 |
139937
|
0 |
0 |
&& (pSubSrc->a[pSubSrc->nSrc-1].fg.jointype & JT_OUTER)!=0 |
139939
|
0 |
0 |
if( (pSubitem->fg.jointype & JT_NATURAL)!=0 |
139940
|
0 |
0 |
|| pSubitem->fg.isUsing |
139941
|
0 |
0 |
|| NEVER(pSubitem->u3.pOn!=0) /* ON clause already shifted into WHERE */ |
139942
|
0 |
0 |
|| pSubitem->fg.isOn |
139953
|
0 |
13 |
if( pSub->pPrior ){ |
139954
|
0 |
0 |
if( pSub->pOrderBy ){ |
139957
|
0 |
0 |
if( isAgg || (p->selFlags & SF_Distinct)!=0 || isOuterJoin>0 ){ |
|
0 |
0 |
if( isAgg || (p->selFlags & SF_Distinct)!=0 || isOuterJoin>0 ){ |
|
0 |
0 |
if( isAgg || (p->selFlags & SF_Distinct)!=0 || isOuterJoin>0 ){ |
139960
|
0 |
0 |
for(pSub1=pSub; pSub1; pSub1=pSub1->pPrior){ |
139966
|
0 |
0 |
if( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))!=0 /* (17b) */ |
139967
|
0 |
0 |
|| (pSub1->pPrior && pSub1->op!=TK_ALL) /* (17a) */ |
|
0 |
0 |
|| (pSub1->pPrior && pSub1->op!=TK_ALL) /* (17a) */ |
139968
|
0 |
0 |
|| pSub1->pSrc->nSrc<1 /* (17c) */ |
139970
|
0 |
0 |
|| pSub1->pWin /* (17e) */ |
139975
|
0 |
0 |
if( iFrom>0 && (pSub1->pSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){ |
|
0 |
0 |
if( iFrom>0 && (pSub1->pSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){ |
139985
|
0 |
0 |
if( p->pOrderBy ){ |
139987
|
0 |
0 |
for(ii=0; iipOrderBy->nExpr; ii++){ |
139988
|
0 |
0 |
if( p->pOrderBy->a[ii].u.x.iOrderByCol==0 ) return 0; |
139993
|
0 |
0 |
if( (p->selFlags & SF_Recursive) ) return 0; |
139995
|
0 |
0 |
if( pSrc->nSrc>1 ){ |
139996
|
0 |
0 |
if( pParse->nSelect>500 ) return 0; |
139997
|
0 |
0 |
if( OptimizationDisabled(db, SQLITE_FlttnUnionAll) ) return 0; |
139999
|
0 |
0 |
if( aCsrMap ) aCsrMap[0] = pParse->nTab; |
140057
|
0 |
13 |
for(pSub=pSub->pPrior; pSub; pSub=pSub->pPrior){ |
140072
|
0 |
0 |
if( pNew==0 ){ |
140076
|
0 |
0 |
if( aCsrMap && ALWAYS(db->mallocFailed==0) ){ |
|
0 |
0 |
if( aCsrMap && ALWAYS(db->mallocFailed==0) ){ |
140080
|
0 |
0 |
if( pPrior ) pPrior->pNext = pNew; |
140089
|
0 |
13 |
if( db->mallocFailed ){ |
140101
|
13 |
0 |
if( ALWAYS(pSubitem->pTab!=0) ){ |
140103
|
13 |
0 |
if( pTabToDel->nTabRef==1 ){ |
140104
|
0 |
13 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
140129
|
13 |
13 |
for(pParent=p; pParent; pParent=pParent->pPrior, pSub=pSub->pPrior){ |
140138
|
13 |
0 |
if( pParent==p ){ |
140157
|
0 |
13 |
if( nSubSrc>1 ){ |
140159
|
0 |
0 |
if( pSrc==0 ) break; |
140166
|
13 |
13 |
for(i=0; i
|
140168
|
0 |
13 |
if( pItem->fg.isUsing ) sqlite3IdListDelete(db, pItem->u3.pUsing); |
140190
|
0 |
13 |
if( pSub->pOrderBy && (pParent->selFlags & SF_NoopOrderBy)==0 ){ |
|
0 |
0 |
if( pSub->pOrderBy && (pParent->selFlags & SF_NoopOrderBy)==0 ){ |
140202
|
0 |
0 |
for(i=0; inExpr; i++){ |
140211
|
0 |
13 |
if( isOuterJoin>0 ){ |
140214
|
0 |
13 |
if( pWhere ){ |
140215
|
0 |
0 |
if( pParent->pWhere ){ |
140221
|
13 |
0 |
if( db->mallocFailed==0 ){ |
140242
|
0 |
13 |
if( pSub->pLimit ){ |
140249
|
13 |
13 |
for(i=0; i
|
140306
|
0 |
311 |
if( ExprHasProperty(pColumn, EP_FixedCol) ) return; |
140307
|
0 |
311 |
if( sqlite3ExprAffinity(pValue)!=0 ) return; |
140308
|
0 |
311 |
if( !sqlite3IsBinary(sqlite3ExprCompareCollSeq(pConst->pParse,pExpr)) ){ |
140314
|
36 |
311 |
for(i=0; inConst; i++){ |
140317
|
36 |
0 |
if( pE2->iTable==pColumn->iTable |
140318
|
0 |
36 |
&& pE2->iColumn==pColumn->iColumn |
140323
|
3 |
308 |
if( sqlite3ExprAffinity(pColumn)==SQLITE_AFF_BLOB ){ |
140330
|
0 |
311 |
if( pConst->apExpr==0 ){ |
140346
|
0 |
981 |
if( NEVER(pExpr==0) ) return; |
140347
|
3 |
978 |
if( ExprHasProperty(pExpr, pConst->mExcludeOn) ){ |
140352
|
331 |
647 |
if( pExpr->op==TK_AND ){ |
140357
|
333 |
314 |
if( pExpr->op!=TK_EQ ) return; |
140362
|
2 |
312 |
if( pRight->op==TK_COLUMN && sqlite3ExprIsConstant(pLeft) ){ |
|
0 |
2 |
if( pRight->op==TK_COLUMN && sqlite3ExprIsConstant(pLeft) ){ |
140365
|
314 |
0 |
if( pLeft->op==TK_COLUMN && sqlite3ExprIsConstant(pRight) ){ |
|
311 |
3 |
if( pLeft->op==TK_COLUMN && sqlite3ExprIsConstant(pRight) ){ |
140385
|
0 |
1932 |
if( pConst->pOomFault[0] ) return WRC_Prune; |
140386
|
1376 |
556 |
if( pExpr->op!=TK_COLUMN ) return WRC_Continue; |
140387
|
2 |
554 |
if( ExprHasProperty(pExpr, EP_FixedCol|pConst->mExcludeOn) ){ |
140393
|
626 |
554 |
for(i=0; inConst; i++){ |
140395
|
314 |
312 |
if( pColumn==pExpr ) continue; |
140396
|
2 |
310 |
if( pColumn->iTable!=pExpr->iTable ) continue; |
140397
|
310 |
0 |
if( pColumn->iColumn!=pExpr->iColumn ) continue; |
140398
|
0 |
0 |
if( bIgnoreAffBlob && sqlite3ExprAffinity(pColumn)==SQLITE_AFF_BLOB ){ |
|
0 |
0 |
if( bIgnoreAffBlob && sqlite3ExprAffinity(pColumn)==SQLITE_AFF_BLOB ){ |
140407
|
0 |
0 |
if( pConst->pParse->db->mallocFailed ) return WRC_Prune; |
140435
|
21 |
1905 |
if( pConst->bHasAffBlob ){ |
140436
|
18 |
3 |
if( (pExpr->op>=TK_EQ && pExpr->op<=TK_GE) |
|
15 |
3 |
if( (pExpr->op>=TK_EQ && pExpr->op<=TK_GE) |
140437
|
0 |
18 |
|| pExpr->op==TK_IS |
140440
|
0 |
3 |
if( pConst->pOomFault[0] ) return WRC_Prune; |
140441
|
3 |
0 |
if( sqlite3ExprAffinity(pExpr->pLeft)!=SQLITE_AFF_TEXT ){ |
140514
|
319 |
0 |
if( ALWAYS(p->pSrc!=0) |
140515
|
313 |
6 |
&& p->pSrc->nSrc>0 |
140516
|
0 |
313 |
&& (p->pSrc->a[0].fg.jointype & JT_LTORJ)!=0 |
140526
|
275 |
44 |
if( x.nConst ){ |
140538
|
0 |
319 |
}while( x.nChng ); |
140648
|
3 |
22 |
if( pWhere==0 ) return 0; |
140649
|
0 |
22 |
if( pSubq->selFlags & (SF_Recursive|SF_MultiPart) ) return 0; |
140650
|
0 |
22 |
if( pSrc->fg.jointype & (JT_LTORJ|JT_RIGHT) ) return 0; |
140653
|
22 |
0 |
if( pSubq->pPrior ){ |
140655
|
101 |
22 |
for(pSel=pSubq; pSel; pSel=pSel->pPrior){ |
140656
|
0 |
101 |
if( pSel->pWin ) return 0; /* restriction (6b) */ |
140659
|
0 |
0 |
if( pSubq->pWin && pSubq->pWin->pPartition==0 ) return 0; |
|
0 |
0 |
if( pSubq->pWin && pSubq->pWin->pPartition==0 ) return 0; |
140676
|
0 |
22 |
if( pSubq->pLimit!=0 ){ |
140679
|
3 |
22 |
while( pWhere->op==TK_AND ){ |
140698
|
22 |
0 |
if( sqlite3ExprIsTableConstraint(pWhere, pSrc) ){ |
140701
|
101 |
22 |
while( pSubq ){ |
140712
|
0 |
101 |
if( pSubq->pWin && 0==pushDownWindowCheck(pParse, pSubq, pNew) ){ |
|
0 |
0 |
if( pSubq->pWin && 0==pushDownWindowCheck(pParse, pSubq, pNew) ){ |
140719
|
0 |
101 |
if( pSubq->selFlags & SF_Aggregate ){ |
140759
|
54 |
73 |
if( pEList==0 |
140760
|
54 |
0 |
|| pEList->nExpr!=1 |
140761
|
54 |
0 |
|| ExprHasProperty(pFunc, EP_WinFunc) |
140762
|
0 |
54 |
|| OptimizationDisabled(db, SQLITE_MinMaxOpt) |
140768
|
0 |
54 |
if( sqlite3StrICmp(zFunc, "min")==0 ){ |
140770
|
0 |
0 |
if( sqlite3ExprCanBeNull(pEList->a[0].pExpr) ){ |
140773
|
16 |
38 |
}else if( sqlite3StrICmp(zFunc, "max")==0 ){ |
140781
|
16 |
0 |
if( pOrderBy ) pOrderBy->a[0].fg.sortFlags = sortFlags; |
140808
|
99 |
28 |
if( p->pWhere |
140809
|
99 |
0 |
|| p->pEList->nExpr!=1 |
140810
|
99 |
0 |
|| p->pSrc->nSrc!=1 |
140811
|
99 |
0 |
|| p->pSrc->a[0].pSelect |
140812
|
99 |
0 |
|| pAggInfo->nFunc!=1 |
140813
|
0 |
99 |
|| p->pHaving |
140820
|
0 |
99 |
if( !IsOrdinaryTable(pTab) ) return 0; |
140823
|
0 |
99 |
if( pExpr->op!=TK_AGG_FUNCTION ) return 0; |
140824
|
0 |
99 |
if( pExpr->pAggInfo!=pAggInfo ) return 0; |
140825
|
90 |
9 |
if( (pAggInfo->aFunc[0].pFunc->funcFlags&SQLITE_FUNC_COUNT)==0 ) return 0; |
140829
|
0 |
9 |
if( ExprHasProperty(pExpr, EP_Distinct|EP_WinFunc) ) return 0; |
140848
|
0 |
0 |
for(pIdx=pTab->pIndex; |
140849
|
0 |
0 |
pIdx && sqlite3StrICmp(pIdx->zName, zIndexedBy); |
140852
|
0 |
0 |
if( !pIdx ){ |
140893
|
4 |
4 |
if( p->pPrior==0 ) return WRC_Continue; |
140894
|
4 |
0 |
if( p->pOrderBy==0 ) return WRC_Continue; |
140895
|
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){} |
140896
|
0 |
0 |
if( pX==0 ) return WRC_Continue; |
140904
|
0 |
0 |
if( a[0].u.x.iOrderByCol ) return WRC_Continue; |
140906
|
0 |
0 |
for(i=p->pOrderBy->nExpr-1; i>=0; i--){ |
140907
|
0 |
0 |
if( a[i].pExpr->flags & EP_Collate ) break; |
140909
|
0 |
0 |
if( i<0 ) return WRC_Continue; |
140916
|
0 |
0 |
if( pNew==0 ) return WRC_Abort; |
140919
|
0 |
0 |
if( pNewSrc==0 ) return WRC_Abort; |
140949
|
0 |
1257 |
if( pFrom->fg.isTabFunc ){ |
140976
|
0 |
0 |
for(p=pWith; p; p=p->pOuter){ |
140978
|
0 |
0 |
for(i=0; inCte; i++){ |
140979
|
0 |
0 |
if( sqlite3StrICmp(zName, p->a[i].zName)==0 ){ |
140984
|
0 |
0 |
if( p->bView ) break; |
141007
|
0 |
1958 |
if( pWith ){ |
141008
|
0 |
0 |
if( bFree ){ |
141012
|
0 |
0 |
if( pWith==0 ) return 0; |
141014
|
0 |
0 |
if( pParse->nErr==0 ){ |
141046
|
1404 |
0 |
if( pParse->pWith==0 ){ |
141050
|
0 |
0 |
if( pParse->nErr ){ |
141055
|
0 |
0 |
if( pFrom->zDatabase!=0 ){ |
141060
|
0 |
0 |
if( pFrom->fg.notCte ){ |
141069
|
0 |
0 |
if( pCte ){ |
141085
|
0 |
0 |
if( pCte->zCteErr ){ |
141089
|
0 |
0 |
if( cannotBeFunction(pParse, pFrom) ) return 2; |
141093
|
0 |
0 |
if( pTab==0 ) return 2; |
141095
|
0 |
0 |
if( pCteUse==0 ){ |
141097
|
0 |
0 |
if( pCteUse==0 |
141098
|
0 |
0 |
|| sqlite3ParserAddCleanup(pParse,sqlite3DbFree,pCteUse)==0 |
141112
|
0 |
0 |
if( db->mallocFailed ) return 2; |
141115
|
0 |
0 |
if( pFrom->fg.isIndexedBy ){ |
141122
|
0 |
0 |
if( pCteUse->nUse>=2 && pCteUse->eM10d==M10d_Any ){ |
|
0 |
0 |
if( pCteUse->nUse>=2 && pCteUse->eM10d==M10d_Any ){ |
141128
|
0 |
0 |
bMayRecursive = ( pSel->op==TK_ALL || pSel->op==TK_UNION ); |
|
0 |
0 |
bMayRecursive = ( pSel->op==TK_ALL || pSel->op==TK_UNION ); |
141129
|
0 |
0 |
while( bMayRecursive && pRecTerm->op==pSel->op ){ |
|
0 |
0 |
while( bMayRecursive && pRecTerm->op==pSel->op ){ |
141133
|
0 |
0 |
for(i=0; inSrc; i++){ |
141135
|
0 |
0 |
if( pItem->zDatabase==0 |
141136
|
0 |
0 |
&& pItem->zName!=0 |
141137
|
0 |
0 |
&& 0==sqlite3StrICmp(pItem->zName, pCte->zName) |
141142
|
0 |
0 |
if( pRecTerm->selFlags & SF_Recursive ){ |
141149
|
0 |
0 |
if( iRecTab<0 ) iRecTab = pParse->nTab++; |
141153
|
0 |
0 |
if( (pRecTerm->selFlags & SF_Recursive)==0 ) break; |
141160
|
0 |
0 |
if( pSel->selFlags & SF_Recursive ){ |
141170
|
0 |
0 |
if( rc ){ |
141175
|
0 |
0 |
if( sqlite3WalkSelect(pWalker, pSel) ){ |
141182
|
0 |
0 |
for(pLeft=pSel; pLeft->pPrior; pLeft=pLeft->pPrior); |
141184
|
0 |
0 |
if( pCte->pCols ){ |
141185
|
0 |
0 |
if( pEList && pEList->nExpr!=pCte->pCols->nExpr ){ |
|
0 |
0 |
if( pEList && pEList->nExpr!=pCte->pCols->nExpr ){ |
141196
|
0 |
0 |
if( bMayRecursive ){ |
141197
|
0 |
0 |
if( pSel->selFlags & SF_Recursive ){ |
141223
|
0 |
1958 |
if( OK_IF_ALWAYS_TRUE(pParse->pWith) && p->pPrior==0 ){ |
|
0 |
0 |
if( OK_IF_ALWAYS_TRUE(pParse->pWith) && p->pPrior==0 ){ |
141225
|
0 |
0 |
if( pWith!=0 ){ |
141246
|
0 |
35 |
if( pTab==0 ) return SQLITE_NOMEM; |
141248
|
2 |
33 |
if( pFrom->zAlias ){ |
141253
|
75 |
35 |
while( pSel->pPrior ){ pSel = pSel->pPrior; } |
141281
|
0 |
0 |
while( N>0 ){ |
141284
|
0 |
0 |
if( pBase->fg.isUsing==0 ) continue; |
141285
|
0 |
0 |
if( NEVER(pBase->u3.pUsing==0) ) continue; |
141286
|
0 |
0 |
if( sqlite3IdListIndex(pBase->u3.pUsing, zName)>=0 ) return 1; |
141328
|
0 |
1993 |
if( db->mallocFailed ){ |
141332
|
35 |
1958 |
if( (selFlags & SF_Expanded)!=0 ){ |
141335
|
0 |
1958 |
if( pWalker->eCode ){ |
141341
|
0 |
1958 |
if( pParse->pWith && (p->selFlags & SF_View) ){ |
|
0 |
0 |
if( pParse->pWith && (p->selFlags & SF_View) ){ |
141342
|
0 |
0 |
if( p->pWith==0 ){ |
141344
|
0 |
0 |
if( p->pWith==0 ){ |
141361
|
1439 |
1958 |
for(i=0, pFrom=pTabList->a; inSrc; i++, pFrom++){ |
141364
|
0 |
1439 |
if( pFrom->pTab ) continue; |
141366
|
35 |
1404 |
if( pFrom->zName==0 ){ |
141372
|
0 |
35 |
if( sqlite3WalkSelect(pWalker, pSel) ) return WRC_Abort; |
141373
|
0 |
35 |
if( sqlite3ExpandSubquery(pParse, pFrom) ) return WRC_Abort; |
141376
|
0 |
1404 |
}else if( (rc = resolveFromTermToCte(pParse, pWalker, pFrom))!=0 ){ |
141377
|
0 |
0 |
if( rc>1 ) return WRC_Abort; |
141385
|
0 |
1404 |
if( pTab==0 ) return WRC_Abort; |
141386
|
0 |
1404 |
if( pTab->nTabRef>=0xffff ){ |
141393
|
1257 |
147 |
if( !IsVirtual(pTab) && cannotBeFunction(pParse, pFrom) ){ |
|
0 |
1257 |
if( !IsVirtual(pTab) && cannotBeFunction(pParse, pFrom) ){ |
141397
|
147 |
1257 |
if( !IsOrdinaryTable(pTab) ){ |
141400
|
0 |
147 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ) return WRC_Abort; |
141402
|
0 |
147 |
if( IsView(pTab) ){ |
141403
|
0 |
0 |
if( (db->flags & SQLITE_EnableView)==0 |
141404
|
0 |
0 |
&& pTab->pSchema!=db->aDb[1].pSchema |
141412
|
147 |
0 |
else if( ALWAYS(IsVirtual(pTab)) |
141413
|
0 |
147 |
&& pFrom->fg.fromDDL |
141414
|
0 |
0 |
&& ALWAYS(pTab->u.vtab.p!=0) |
141415
|
0 |
0 |
&& pTab->u.vtab.p->eVtabRisk > ((db->flags & SQLITE_TrustedSchema)!=0) |
141433
|
0 |
1439 |
if( pFrom->fg.isIndexedBy && sqlite3IndexedByLookup(pParse, pFrom) ){ |
|
0 |
0 |
if( pFrom->fg.isIndexedBy && sqlite3IndexedByLookup(pParse, pFrom) ){ |
141441
|
1958 |
0 |
if( pParse->nErr || sqlite3ProcessJoin(pParse, p) ){ |
|
0 |
1958 |
if( pParse->nErr || sqlite3ProcessJoin(pParse, p) ){ |
141456
|
2560 |
1365 |
for(k=0; knExpr; k++){ |
141458
|
590 |
1970 |
if( pE->op==TK_ASTERISK ) break; |
141461
|
36 |
1934 |
if( pE->op==TK_DOT && pE->pRight->op==TK_ASTERISK ) break; |
|
3 |
33 |
if( pE->op==TK_DOT && pE->pRight->op==TK_ASTERISK ) break; |
141464
|
593 |
1365 |
if( knExpr ){ |
141474
|
1 |
592 |
&& (flags & SQLITE_ShortColNames)==0; |
|
1 |
0 |
&& (flags & SQLITE_ShortColNames)==0; |
141476
|
600 |
593 |
for(k=0; knExpr; k++){ |
141481
|
10 |
590 |
if( pE->op!=TK_ASTERISK |
141482
|
6 |
4 |
&& (pE->op!=TK_DOT || pRight->op!=TK_ASTERISK) |
|
3 |
3 |
&& (pE->op!=TK_DOT || pRight->op!=TK_ASTERISK) |
141487
|
7 |
0 |
if( pNew ){ |
141498
|
3 |
590 |
if( pE->op==TK_DOT ){ |
141503
|
593 |
593 |
for(i=0, pFrom=pTabList->a; inSrc; i++, pFrom++){ |
141511
|
593 |
0 |
if( (zTabName = pFrom->zAlias)==0 ){ |
141514
|
0 |
593 |
if( db->mallocFailed ) break; |
141516
|
0 |
593 |
if( pFrom->fg.isNestedFrom ){ |
141522
|
3 |
590 |
if( zTName && sqlite3StrICmp(zTName, zTabName)!=0 ){ |
|
0 |
3 |
if( zTName && sqlite3StrICmp(zTName, zTabName)!=0 ){ |
141527
|
580 |
13 |
zSchemaName = iDb>=0 ? db->aDb[iDb].zDbSName : "*"; |
141529
|
0 |
593 |
if( i+1nSrc |
141530
|
0 |
0 |
&& pFrom[1].fg.isUsing |
141531
|
0 |
0 |
&& (selFlags & SF_NestedFrom)!=0 |
141535
|
0 |
0 |
for(ii=0; iinId; ii++){ |
141539
|
0 |
0 |
if( pNew ){ |
141550
|
2774 |
593 |
for(j=0; jnCol; j++){ |
141555
|
9 |
2765 |
if( zTName |
141556
|
0 |
9 |
&& pNestedFrom |
141557
|
0 |
0 |
&& sqlite3MatchEName(&pNestedFrom->a[j], 0, zTName, 0)==0 |
141566
|
2774 |
0 |
if( (p->selFlags & SF_IncludeHidden)==0 |
141567
|
6 |
2768 |
&& IsHiddenColumn(&pTab->aCol[j]) |
141571
|
0 |
2768 |
if( (pTab->aCol[j].colFlags & COLFLAG_NOEXPAND)!=0 |
141572
|
0 |
0 |
&& zTName==0 |
141573
|
0 |
0 |
&& (selFlags & (SF_NestedFrom))==0 |
141579
|
0 |
2768 |
if( i>0 && zTName==0 && (selFlags & SF_NestedFrom)==0 ){ |
|
0 |
0 |
if( i>0 && zTName==0 && (selFlags & SF_NestedFrom)==0 ){ |
|
0 |
0 |
if( i>0 && zTName==0 && (selFlags & SF_NestedFrom)==0 ){ |
141580
|
0 |
0 |
if( pFrom->fg.isUsing |
141581
|
0 |
0 |
&& sqlite3IdListIndex(pFrom->u3.pUsing, zName)>=0 |
141589
|
0 |
2768 |
if( (pTabList->nSrc>1 |
141590
|
0 |
0 |
&& ( (pFrom->fg.jointype & JT_LTORJ)==0 |
141591
|
0 |
0 |
|| (selFlags & SF_NestedFrom)!=0 |
141592
|
0 |
0 |
|| !inAnyUsingClause(zName,pFrom,pTabList->nSrc-i-1) |
141595
|
0 |
2768 |
|| IN_RENAME_OBJECT |
141600
|
0 |
0 |
if( IN_RENAME_OBJECT && pE->pLeft ){ |
|
0 |
0 |
if( IN_RENAME_OBJECT && pE->pLeft ){ |
141603
|
0 |
0 |
if( zSchemaName ){ |
141611
|
0 |
2768 |
if( pNew==0 ){ |
141616
|
0 |
2768 |
if( (selFlags & SF_NestedFrom)!=0 && !IN_RENAME_OBJECT ){ |
|
0 |
0 |
if( (selFlags & SF_NestedFrom)!=0 && !IN_RENAME_OBJECT ){ |
141617
|
0 |
0 |
if( pNestedFrom ){ |
141626
|
0 |
0 |
if( (pFrom->fg.isUsing |
141627
|
0 |
0 |
&& sqlite3IdListIndex(pFrom->u3.pUsing, zName)>=0) |
141628
|
0 |
0 |
|| (pUsing && sqlite3IdListIndex(pUsing, zName)>=0) |
|
0 |
0 |
|| (pUsing && sqlite3IdListIndex(pUsing, zName)>=0) |
141629
|
0 |
0 |
|| (pTab->aCol[j].colFlags & COLFLAG_NOEXPAND)!=0 |
141633
|
3 |
2765 |
}else if( longNames ){ |
141642
|
0 |
593 |
if( !tableSeen ){ |
141643
|
0 |
0 |
if( zTName ){ |
141654
|
1958 |
0 |
if( p->pEList ){ |
141655
|
0 |
1958 |
if( p->pEList->nExpr>db->aLimit[SQLITE_LIMIT_COLUMN] ){ |
141659
|
673 |
1285 |
if( (elistFlags & (EP_HasFunc|EP_Subquery))!=0 ){ |
141699
|
2 |
1815 |
if( OK_IF_ALWAYS_TRUE(pParse->hasCompound) ){ |
141732
|
0 |
1952 |
if( p->selFlags & SF_HasTypeInfo ) return; |
141736
|
1439 |
1952 |
for(i=0, pFrom=pTabList->a; inSrc; i++, pFrom++){ |
141739
|
35 |
1404 |
if( (pTab->tabFlags & TF_Ephemeral)!=0 ){ |
141742
|
35 |
0 |
if( pSel ){ |
141743
|
75 |
35 |
while( pSel->pPrior ) pSel = pSel->pPrior; |
141791
|
0 |
2010 |
if( pParse->db->mallocFailed ) return; |
141792
|
193 |
1817 |
if( p->selFlags & SF_HasTypeInfo ) return; |
141794
|
0 |
1817 |
if( pParse->nErr ) return; |
141796
|
6 |
1811 |
if( pParse->nErr ) return; |
141815
|
0 |
138 |
if( nReg==0 ) return; |
141816
|
0 |
138 |
if( pParse->nErr ) return; |
141831
|
138 |
138 |
for(pFunc=pAggInfo->aFunc, i=0; inFunc; i++, pFunc++){ |
141832
|
0 |
138 |
if( pFunc->iDistinct>=0 ){ |
141835
|
0 |
0 |
if( pE->x.pList==0 || pE->x.pList->nExpr!=1 ){ |
|
0 |
0 |
if( pE->x.pList==0 || pE->x.pList->nExpr!=1 ){ |
141858
|
138 |
138 |
for(i=0, pF=pAggInfo->aFunc; inFunc; i++, pF++){ |
141862
|
62 |
76 |
sqlite3VdbeAddOp2(v, OP_AggFinal, pF->iMem, pList ? pList->nExpr : 0); |
141891
|
138 |
138 |
for(i=0, pF=pAggInfo->aFunc; inFunc; i++, pF++){ |
141899
|
0 |
138 |
if( ExprHasProperty(pF->pFExpr, EP_WinFunc) ){ |
141901
|
0 |
0 |
if( pAggInfo->nAccumulator |
141902
|
0 |
0 |
&& (pF->pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL) |
141903
|
0 |
0 |
&& regAcc |
141908
|
0 |
0 |
if( regHit==0 ) regHit = ++pParse->nMem; |
141921
|
62 |
76 |
if( pList ){ |
141929
|
0 |
138 |
if( pF->iDistinct>=0 && pList ){ |
|
0 |
0 |
if( pF->iDistinct>=0 && pList ){ |
141930
|
0 |
0 |
if( addrNext==0 ){ |
141936
|
16 |
122 |
if( pF->pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL ){ |
141941
|
24 |
8 |
for(j=0, pItem=pList->a; !pColl && j
|
|
16 |
8 |
for(j=0, pItem=pList->a; !pColl && j
|
141944
|
8 |
8 |
if( !pColl ){ |
141947
|
16 |
0 |
if( regHit==0 && pAggInfo->nAccumulator ) regHit = ++pParse->nMem; |
|
0 |
16 |
if( regHit==0 && pAggInfo->nAccumulator ) regHit = ++pParse->nMem; |
141954
|
0 |
138 |
if( addrNext ){ |
141958
|
138 |
0 |
if( regHit==0 && pAggInfo->nAccumulator ){ |
|
14 |
124 |
if( regHit==0 && pAggInfo->nAccumulator ){ |
141961
|
14 |
124 |
if( regHit ){ |
141964
|
15 |
138 |
for(i=0, pC=pAggInfo->aCol; inAccumulator; i++, pC++){ |
141969
|
14 |
124 |
if( addrHitTest ){ |
141984
|
0 |
9 |
if( pParse->explain==2 ){ |
141985
|
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))); |
141986
|
0 |
0 |
sqlite3VdbeExplain(pParse, 0, "SCAN %s%s%s", |
|
0 |
0 |
sqlite3VdbeExplain(pParse, 0, "SCAN %s%s%s", |
142009
|
6 |
0 |
if( pExpr->op!=TK_AND ){ |
142018
|
0 |
6 |
if( sqlite3ExprIsConstantOrGroupBy(pWalker->pParse, pExpr, pS->pGroupBy) |
142019
|
0 |
0 |
&& ExprAlwaysFalse(pExpr)==0 |
142020
|
0 |
0 |
&& pExpr->pAggInfo==0 |
142024
|
0 |
0 |
if( pNew ){ |
142078
|
0 |
0 |
if( pThis->pSelect->selFlags & SF_PushDown ) return 0; |
142079
|
0 |
0 |
for(pItem = pTabList->a; pItem
|
142081
|
0 |
0 |
if( pItem->pSelect==0 ) continue; |
142082
|
0 |
0 |
if( pItem->fg.viaCoroutine ) continue; |
142083
|
0 |
0 |
if( pItem->zName==0 ) continue; |
142086
|
0 |
0 |
if( pItem->pTab->pSchema!=pThis->pTab->pSchema ) continue; |
142087
|
0 |
0 |
if( sqlite3_stricmp(pItem->zName, pThis->zName)!=0 ) continue; |
142089
|
0 |
0 |
if( pItem->pTab->pSchema==0 && pThis->pSelect->selId!=pS1->selId ){ |
|
0 |
0 |
if( pItem->pTab->pSchema==0 && pThis->pSelect->selId!=pS1->selId ){ |
142094
|
0 |
0 |
if( pItem->pSelect->selFlags & SF_PushDown ){ |
142209
|
0 |
0 |
for(i=0; inSrc; i++){ |
142211
|
0 |
0 |
if( p1==p0 ) continue; |
142212
|
0 |
0 |
if( p0->pTab==p1->pTab && 0==sqlite3_stricmp(p0->zAlias, p1->zAlias) ){ |
|
0 |
0 |
if( p0->pTab==p1->pTab && 0==sqlite3_stricmp(p0->zAlias, p1->zAlias) ){ |
142215
|
0 |
0 |
if( p1->pSelect |
142216
|
0 |
0 |
&& (p1->pSelect->selFlags & SF_NestedFrom)!=0 |
142217
|
0 |
0 |
&& sameSrcAlias(p0, p1->pSelect->pSrc) |
142264
|
2010 |
0 |
if( p==0 || pParse->nErr ){ |
|
0 |
2010 |
if( p==0 || pParse->nErr ){ |
142268
|
0 |
2010 |
if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1; |
142284
|
8 |
2002 |
if( IgnorableDistinct(pDest) ){ |
142289
|
0 |
8 |
if( p->pOrderBy ){ |
142306
|
6 |
2004 |
if( pParse->nErr ){ |
142327
|
0 |
2004 |
if( p->selFlags & SF_UFSrcCheck ){ |
142329
|
0 |
0 |
if( sameSrcAlias(p0, p->pSrc) ){ |
142330
|
0 |
0 |
sqlite3ErrorMsg(pParse, |
142344
|
1807 |
197 |
if( pDest->eDest==SRT_Output ){ |
142349
|
0 |
2004 |
if( sqlite3WindowRewrite(pParse, p) ){ |
142369
|
3364 |
79 |
for(i=0; !p->pPrior && inSrc; i++){ |
|
1439 |
1925 |
for(i=0; !p->pPrior && inSrc; i++){ |
142382
|
4 |
1435 |
if( (pItem->fg.jointype & (JT_LEFT|JT_RIGHT))==JT_LEFT |
142383
|
1 |
3 |
&& sqlite3ExprImpliesNonNullRow(p->pWhere, pItem->iCursor) |
142384
|
1 |
0 |
&& OptimizationEnabled(db, SQLITE_SimplifyJoin) |
142395
|
1404 |
35 |
if( pSub==0 ) continue; |
142399
|
0 |
35 |
if( pTab->nCol!=pSub->pEList->nExpr ){ |
142412
|
0 |
35 |
if( (pSub->selFlags & SF_Aggregate)!=0 ) continue; |
142435
|
0 |
35 |
if( pSub->pOrderBy!=0 |
142436
|
0 |
0 |
&& (p->pOrderBy!=0 || pTabList->nSrc>1) /* Condition (5) */ |
|
0 |
0 |
&& (p->pOrderBy!=0 || pTabList->nSrc>1) /* Condition (5) */ |
142437
|
0 |
0 |
&& pSub->pLimit==0 /* Condition (1) */ |
142438
|
0 |
0 |
&& (pSub->selFlags & SF_OrderByReqd)==0 /* Condition (2) */ |
142439
|
0 |
0 |
&& (p->selFlags & SF_OrderByReqd)==0 /* Condition (3) and (4) */ |
142440
|
0 |
0 |
&& OptimizationEnabled(db, SQLITE_OmitOrderBy) |
142468
|
0 |
35 |
if( pSub->pOrderBy!=0 |
142469
|
0 |
0 |
&& i==0 |
142470
|
0 |
0 |
&& (p->selFlags & SF_ComplexResult)!=0 |
142471
|
0 |
0 |
&& (pTabList->nSrc==1 |
142472
|
0 |
0 |
|| (pTabList->a[1].fg.jointype&(JT_OUTER|JT_CROSS))!=0) |
142477
|
13 |
22 |
if( flattenSubquery(pParse, p, i, isAgg) ){ |
142478
|
0 |
13 |
if( pParse->nErr ) goto select_end; |
142483
|
0 |
35 |
if( db->mallocFailed ) goto select_end; |
142484
|
35 |
0 |
if( !IgnorableOrderby(pDest) ){ |
142494
|
79 |
1925 |
if( p->pPrior ){ |
142502
|
26 |
53 |
if( p->pNext==0 ) ExplainQueryPlanPop(pParse); |
142512
|
984 |
941 |
if( p->pWhere!=0 |
142513
|
319 |
665 |
&& p->pWhere->op==TK_AND |
142514
|
319 |
0 |
&& OptimizationEnabled(db, SQLITE_PropagateConst) |
142541
|
1426 |
1925 |
for(i=0; inSrc; i++){ |
142566
|
81 |
1345 |
if( pItem->colUsed==0 && pItem->zName!=0 ){ |
|
81 |
0 |
if( pItem->colUsed==0 && pItem->zName!=0 ){ |
142574
|
1404 |
22 |
if( pSub==0 ) continue; |
142591
|
22 |
0 |
if( OptimizationEnabled(db, SQLITE_PushDown) |
142592
|
0 |
22 |
&& (pItem->fg.isCte==0 |
142593
|
0 |
0 |
|| (pItem->u2.pCteUse->eM10d!=M10d_Yes && pItem->u2.pCteUse->nUse<2)) |
|
0 |
0 |
|| (pItem->u2.pCteUse->eM10d!=M10d_Yes && pItem->u2.pCteUse->nUse<2)) |
142621
|
22 |
0 |
if( i==0 |
142622
|
0 |
22 |
&& (pTabList->nSrc==1 |
142623
|
0 |
0 |
|| (pTabList->a[1].fg.jointype&(JT_OUTER|JT_CROSS))!=0) /* (1) */ |
142624
|
0 |
22 |
&& (pItem->fg.isCte==0 || pItem->u2.pCteUse->eM10d!=M10d_Yes) /* (2) */ |
|
0 |
0 |
&& (pItem->fg.isCte==0 || pItem->u2.pCteUse->eM10d!=M10d_Yes) /* (2) */ |
142625
|
22 |
0 |
&& (pTabList->a[0].fg.jointype & JT_LTORJ)==0 /* (3) */ |
142645
|
0 |
0 |
}else if( pItem->fg.isCte && pItem->u2.pCteUse->addrM9e>0 ){ |
|
0 |
0 |
}else if( pItem->fg.isCte && pItem->u2.pCteUse->addrM9e>0 ){ |
142652
|
0 |
0 |
if( pItem->iCursor!=pCteUse->iCur ){ |
142657
|
0 |
0 |
}else if( (pPrior = isSelfJoinView(pTabList, pItem))!=0 ){ |
142660
|
0 |
0 |
if( pPrior->addrFillSub ){ |
142676
|
0 |
0 |
if( pItem->fg.isCorrelated==0 ){ |
142689
|
0 |
0 |
if( onceAddr ) sqlite3VdbeJumpHere(v, onceAddr); |
142694
|
0 |
0 |
if( pItem->fg.isCte && pItem->fg.isCorrelated==0 ){ |
|
0 |
0 |
if( pItem->fg.isCte && pItem->fg.isCorrelated==0 ){ |
142702
|
0 |
22 |
if( db->mallocFailed ) goto select_end; |
142738
|
4 |
1921 |
if( (p->selFlags & (SF_Distinct|SF_Aggregate))==SF_Distinct |
142739
|
0 |
4 |
&& sqlite3ExprListCompare(sSort.pOrderBy, pEList, -1)==0 |
142741
|
0 |
0 |
&& p->pWin==0 |
142769
|
608 |
1317 |
if( sSort.pOrderBy ){ |
142785
|
0 |
1925 |
if( pDest->eDest==SRT_EphemTab ){ |
142787
|
0 |
0 |
if( p->selFlags & SF_NestedFrom ){ |
142790
|
0 |
0 |
for(ii=pEList->nExpr-1; ii>0 && pEList->a[ii].fg.bUsed==0; ii--){ |
|
0 |
0 |
for(ii=pEList->nExpr-1; ii>0 && pEList->a[ii].fg.bUsed==0; ii--){ |
142795
|
0 |
0 |
for(ii=0; iinExpr; ii++){ |
142796
|
0 |
0 |
if( pEList->a[ii].fg.bUsed==0 ) pEList->a[ii].pExpr->op = TK_NULL; |
142804
|
1925 |
0 |
if( (p->selFlags & SF_FixedLimit)==0 ){ |
142808
|
1905 |
20 |
if( p->iLimit==0 && sSort.addrSortIndex>=0 ){ |
|
607 |
1298 |
if( p->iLimit==0 && sSort.addrSortIndex>=0 ){ |
142815
|
4 |
1921 |
if( p->selFlags & SF_Distinct ){ |
142827
|
1778 |
147 |
if( !isAgg && pGroupBy==0 ){ |
|
1778 |
0 |
if( !isAgg && pGroupBy==0 ){ |
142829
|
4 |
1774 |
u16 wctrlFlags = (sDistinct.isTnct ? WHERE_WANT_DISTINCT : 0) |
142833
|
0 |
1778 |
if( pWin ){ |
142844
|
0 |
1778 |
if( pWInfo==0 ) goto select_end; |
142845
|
1777 |
1 |
if( sqlite3WhereOutputRowCount(pWInfo) < p->nSelectRow ){ |
142848
|
4 |
1774 |
if( sDistinct.isTnct && sqlite3WhereIsDistinct(pWInfo) ){ |
|
0 |
4 |
if( sDistinct.isTnct && sqlite3WhereIsDistinct(pWInfo) ){ |
142851
|
606 |
1172 |
if( sSort.pOrderBy ){ |
142854
|
500 |
106 |
if( sSort.nOBSat==sSort.pOrderBy->nExpr ){ |
142864
|
606 |
1172 |
if( sSort.addrSortIndex>=0 && sSort.pOrderBy==0 ){ |
|
500 |
106 |
if( sSort.addrSortIndex>=0 && sSort.pOrderBy==0 ){ |
142870
|
0 |
1778 |
if( pWin ){ |
142919
|
20 |
127 |
if( pGroupBy ){ |
142923
|
29 |
20 |
for(k=p->pEList->nExpr, pItem=p->pEList->a; k>0; k--, pItem++){ |
142926
|
20 |
20 |
for(k=pGroupBy->nExpr, pItem=pGroupBy->a; k>0; k--, pItem++){ |
142930
|
19 |
1 |
if( p->nSelectRow>66 ) p->nSelectRow = 66; |
142940
|
2 |
18 |
if( sSort.pOrderBy && pGroupBy->nExpr==sSort.pOrderBy->nExpr ){ |
|
2 |
0 |
if( sSort.pOrderBy && pGroupBy->nExpr==sSort.pOrderBy->nExpr ){ |
142947
|
2 |
2 |
for(ii=0; iinExpr; ii++){ |
142952
|
1 |
1 |
if( sqlite3ExprListCompare(pGroupBy, sSort.pOrderBy, -1)==0 ){ |
142969
|
147 |
0 |
if( pAggInfo ){ |
142974
|
0 |
147 |
if( db->mallocFailed ){ |
142984
|
20 |
127 |
pAggInfo->nSortingColumn = pGroupBy ? pGroupBy->nExpr : 0; |
142988
|
6 |
141 |
if( pHaving ){ |
142989
|
6 |
0 |
if( pGroupBy ){ |
142999
|
127 |
20 |
if( p->pGroupBy==0 && p->pHaving==0 && pAggInfo->nFunc==1 ){ |
|
127 |
0 |
if( p->pGroupBy==0 && p->pHaving==0 && pAggInfo->nFunc==1 ){ |
|
127 |
0 |
if( p->pGroupBy==0 && p->pHaving==0 && pAggInfo->nFunc==1 ){ |
143004
|
147 |
147 |
for(i=0; inFunc; i++){ |
143011
|
0 |
147 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){ |
143018
|
0 |
147 |
if( db->mallocFailed ) goto select_end; |
143045
|
20 |
127 |
if( pGroupBy ){ |
143059
|
20 |
0 |
if( pAggInfo->nFunc==1 |
143060
|
0 |
20 |
&& pAggInfo->aFunc[0].iDistinct>=0 |
143061
|
0 |
0 |
&& ALWAYS(pAggInfo->aFunc[0].pFExpr!=0) |
143062
|
0 |
0 |
&& ALWAYS(ExprUseXList(pAggInfo->aFunc[0].pFExpr)) |
143063
|
0 |
0 |
&& pAggInfo->aFunc[0].pFExpr->x.pList!=0 |
143069
|
0 |
0 |
distFlag = pDistinct ? (WHERE_WANT_DISTINCT|WHERE_AGG_DISTINCT) : 0; |
143107
|
0 |
20 |
pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, pGroupBy, pDistinct, |
|
1 |
19 |
pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, pGroupBy, pDistinct, |
143111
|
0 |
20 |
if( pWInfo==0 ){ |
143117
|
0 |
20 |
if( sqlite3WhereIsOrdered(pWInfo)==pGroupBy->nExpr ){ |
143134
|
0 |
20 |
explainTempTable(pParse, |
143135
|
0 |
0 |
(sDistinct.isTnct && (p->selFlags&SF_Distinct)==0) ? |
143142
|
23 |
20 |
for(i=0; inColumn; i++){ |
143143
|
9 |
14 |
if( pAggInfo->aCol[i].iSorterColumn>=j ){ |
143151
|
23 |
20 |
for(i=0; inColumn; i++){ |
143153
|
9 |
14 |
if( pCol->iSorterColumn>=j ){ |
143182
|
1 |
19 |
if( orderByGrp && OptimizationEnabled(db, SQLITE_GroupByOrder) |
|
1 |
0 |
if( orderByGrp && OptimizationEnabled(db, SQLITE_GroupByOrder) |
143183
|
0 |
1 |
&& (groupBySort || sqlite3WhereIsSorted(pWInfo)) |
|
0 |
0 |
&& (groupBySort || sqlite3WhereIsSorted(pWInfo)) |
143195
|
20 |
0 |
if( groupBySort ){ |
143199
|
20 |
20 |
for(j=0; jnExpr; j++){ |
143200
|
20 |
0 |
if( groupBySort ){ |
143239
|
20 |
0 |
if( groupBySort ){ |
143291
|
0 |
20 |
if( distFlag!=0 && eDist!=WHERE_DISTINCT_NOOP ){ |
|
0 |
0 |
if( distFlag!=0 && eDist!=WHERE_DISTINCT_NOOP ){ |
143298
|
9 |
118 |
if( (pTab = isSimpleCount(p, pAggInfo))!=0 ){ |
143331
|
0 |
9 |
if( !HasRowid(pTab) ) pBest = sqlite3PrimaryKeyIndex(pTab); |
143332
|
9 |
0 |
if( !p->pSrc->a[0].fg.notIndexed ){ |
143333
|
0 |
9 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
143334
|
0 |
0 |
if( pIdx->bUnordered==0 |
143335
|
0 |
0 |
&& pIdx->szIdxRowszTabRow |
143336
|
0 |
0 |
&& pIdx->pPartIdxWhere==0 |
143337
|
0 |
0 |
&& (!pBest || pIdx->szIdxRowszIdxRow) |
|
0 |
0 |
&& (!pBest || pIdx->szIdxRowszIdxRow) |
143343
|
0 |
9 |
if( pBest ){ |
143350
|
0 |
9 |
if( pKeyInfo ){ |
143371
|
0 |
118 |
if( pAggInfo->nAccumulator ){ |
143372
|
0 |
0 |
for(i=0; inFunc; i++){ |
143373
|
0 |
0 |
if( ExprHasProperty(pAggInfo->aFunc[i].pFExpr, EP_WinFunc) ){ |
143376
|
0 |
0 |
if( pAggInfo->aFunc[i].pFunc->funcFlags&SQLITE_FUNC_NEEDCOLL ){ |
143380
|
0 |
0 |
if( i==pAggInfo->nFunc ){ |
143384
|
118 |
0 |
}else if( pAggInfo->nFunc==1 && pAggInfo->aFunc[0].iDistinct>=0 ){ |
|
0 |
118 |
}else if( pAggInfo->nFunc==1 && pAggInfo->aFunc[0].iDistinct>=0 ){ |
143387
|
0 |
0 |
distFlag = pDistinct ? (WHERE_WANT_DISTINCT|WHERE_AGG_DISTINCT) : 0; |
143408
|
0 |
118 |
if( pWInfo==0 ){ |
143414
|
0 |
118 |
if( eDist!=WHERE_DISTINCT_NOOP ){ |
143416
|
0 |
0 |
if( pF ){ |
143421
|
0 |
118 |
if( regAcc ) sqlite3VdbeAddOp2(v, OP_Integer, 1, regAcc); |
143422
|
16 |
102 |
if( minMaxFlag ){ |
143439
|
4 |
1921 |
if( sDistinct.eTnctType==WHERE_DISTINCT_UNORDERED ){ |
143446
|
107 |
1818 |
if( sSort.pOrderBy ){ |
143447
|
18 |
89 |
explainTempTable(pParse, |
143547
|
0 |
0 |
if( p->nRow==0 && argv!=0 ){ |
|
0 |
0 |
if( p->nRow==0 && argv!=0 ){ |
143552
|
0 |
0 |
if( p->nData + need > p->nAlloc ){ |
143556
|
0 |
0 |
if( azNew==0 ) goto malloc_failed; |
143563
|
0 |
0 |
if( p->nRow==0 ){ |
143565
|
0 |
0 |
for(i=0; i
|
143567
|
0 |
0 |
if( z==0 ) goto malloc_failed; |
143570
|
0 |
0 |
}else if( (int)p->nColumn!=nCol ){ |
143581
|
0 |
0 |
if( argv!=0 ){ |
143582
|
0 |
0 |
for(i=0; i
|
143583
|
0 |
0 |
if( argv[i]==0 ){ |
143588
|
0 |
0 |
if( z==0 ) goto malloc_failed; |
143627
|
0 |
0 |
if( pnColumn ) *pnColumn = 0; |
143628
|
0 |
0 |
if( pnRow ) *pnRow = 0; |
143629
|
0 |
0 |
if( pzErrMsg ) *pzErrMsg = 0; |
143637
|
0 |
0 |
if( res.azResult==0 ){ |
143645
|
0 |
0 |
if( (rc&0xff)==SQLITE_ABORT ){ |
143647
|
0 |
0 |
if( res.zErrMsg ){ |
143648
|
0 |
0 |
if( pzErrMsg ){ |
143658
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
143662
|
0 |
0 |
if( res.nAlloc>res.nData ){ |
143665
|
0 |
0 |
if( azNew==0 ){ |
143673
|
0 |
0 |
if( pnColumn ) *pnColumn = res.nColumn; |
143674
|
0 |
0 |
if( pnRow ) *pnRow = res.nRow; |
143684
|
0 |
0 |
if( azResult ){ |
143689
|
0 |
0 |
for(i=1; i
|
|
0 |
0 |
for(i=1; i
|
143717
|
0 |
0 |
while( pTriggerStep ){ |
143756
|
0 |
7 |
while( p ){ |
143758
|
0 |
0 |
if( pTrig->pTabSchema==pTab->pSchema |
143759
|
0 |
0 |
&& pTrig->table |
143760
|
0 |
0 |
&& 0==sqlite3StrICmp(pTrig->table, pTab->zName) |
143761
|
0 |
0 |
&& pTrig->pTabSchema!=pTmpSchema |
143765
|
0 |
0 |
}else if( pTrig->op==TK_RETURNING ){ |
143824
|
0 |
0 |
if( isTemp ){ |
143826
|
0 |
0 |
if( pName2->n>0 ){ |
143835
|
0 |
0 |
if( iDb<0 ){ |
143839
|
0 |
0 |
if( !pTableName || db->mallocFailed ){ |
|
0 |
0 |
if( !pTableName || db->mallocFailed ){ |
143851
|
0 |
0 |
if( db->init.busy && iDb!=1 ){ |
|
0 |
0 |
if( db->init.busy && iDb!=1 ){ |
143862
|
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 |
143863
|
0 |
0 |
&& pTab->pSchema==db->aDb[1].pSchema ){ |
143868
|
0 |
0 |
if( db->mallocFailed ) goto trigger_cleanup; |
143871
|
0 |
0 |
if( sqlite3FixSrcList(&sFix, pTableName) ){ |
143875
|
0 |
0 |
if( !pTab ){ |
143879
|
0 |
0 |
if( IsVirtual(pTab) ){ |
143887
|
0 |
0 |
if( zName==0 ){ |
143891
|
0 |
0 |
if( sqlite3CheckObjectName(pParse, zName, "trigger", pTab->zName) ){ |
143895
|
0 |
0 |
if( !IN_RENAME_OBJECT ){ |
143896
|
0 |
0 |
if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash),zName) ){ |
143897
|
0 |
0 |
if( !noErr ){ |
143908
|
0 |
0 |
if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 ){ |
143916
|
0 |
0 |
if( IsView(pTab) && tr_tm!=TK_INSTEAD ){ |
|
0 |
0 |
if( IsView(pTab) && tr_tm!=TK_INSTEAD ){ |
143917
|
0 |
0 |
sqlite3ErrorMsg(pParse, "cannot create %s trigger on view: %S", |
143921
|
0 |
0 |
if( !IsView(pTab) && tr_tm==TK_INSTEAD ){ |
|
0 |
0 |
if( !IsView(pTab) && tr_tm==TK_INSTEAD ){ |
143928
|
0 |
0 |
if( !IN_RENAME_OBJECT ){ |
143932
|
0 |
0 |
const char *zDbTrig = isTemp ? db->aDb[1].zDbSName : zDb; |
143933
|
0 |
0 |
if( iTabDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER; |
|
0 |
0 |
if( iTabDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER; |
143934
|
0 |
0 |
if( sqlite3AuthCheck(pParse, code, zName, pTab->zName, zDbTrig) ){ |
143937
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iTabDb),0,zDb)){ |
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iTabDb),0,zDb)){ |
143948
|
0 |
0 |
if (tr_tm == TK_INSTEAD){ |
143954
|
0 |
0 |
if( pTrigger==0 ) goto trigger_cleanup; |
143961
|
0 |
0 |
pTrigger->tr_tm = tr_tm==TK_BEFORE ? TRIGGER_BEFORE : TRIGGER_AFTER; |
143962
|
0 |
0 |
if( IN_RENAME_OBJECT ){ |
143979
|
0 |
0 |
if( !pParse->pNewTrigger ){ |
143987
|
0 |
0 |
if( db->init.iDb==1 ){ |
144020
|
0 |
0 |
if( NEVER(pParse->nErr) || !pTrig ) goto triggerfinish_cleanup; |
|
0 |
0 |
if( NEVER(pParse->nErr) || !pTrig ) goto triggerfinish_cleanup; |
144024
|
0 |
0 |
while( pStepList ){ |
144030
|
0 |
0 |
if( sqlite3FixTriggerStep(&sFix, pTrig->step_list) |
144031
|
0 |
0 |
|| sqlite3FixExpr(&sFix, pTrig->pWhen) |
144037
|
0 |
0 |
if( IN_RENAME_OBJECT ){ |
144047
|
0 |
0 |
if( !db->init.busy ){ |
144054
|
0 |
0 |
if( sqlite3ReadOnlyShadowTables(db) ){ |
144056
|
0 |
0 |
for(pStep=pTrig->step_list; pStep; pStep=pStep->pNext){ |
144057
|
0 |
0 |
if( pStep->zTarget!=0 |
144058
|
0 |
0 |
&& sqlite3ShadowTableName(db, pStep->zTarget) |
144070
|
0 |
0 |
if( v==0 ) goto triggerfinish_cleanup; |
144085
|
0 |
0 |
if( db->init.busy ){ |
144091
|
0 |
0 |
if( pTrig ){ |
144093
|
0 |
0 |
}else if( pLink->pSchema==pLink->pTabSchema ){ |
144115
|
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] = ' '; |
144133
|
0 |
0 |
if( pTriggerStep==0 ) { |
144160
|
0 |
0 |
if( pParse->nErr ) return 0; |
144162
|
0 |
0 |
if( pTriggerStep ){ |
144169
|
0 |
0 |
if( IN_RENAME_OBJECT ){ |
144199
|
0 |
0 |
if( pTriggerStep ){ |
144200
|
0 |
0 |
if( IN_RENAME_OBJECT ){ |
144209
|
0 |
0 |
if( pUpsert ){ |
144242
|
0 |
0 |
if( pTriggerStep ){ |
144243
|
0 |
0 |
if( IN_RENAME_OBJECT ){ |
144279
|
0 |
0 |
if( pTriggerStep ){ |
144280
|
0 |
0 |
if( IN_RENAME_OBJECT ){ |
144296
|
0 |
0 |
if( pTrigger==0 || pTrigger->bReturning ) return; |
|
0 |
0 |
if( pTrigger==0 || pTrigger->bReturning ) return; |
144320
|
0 |
0 |
if( db->mallocFailed ) goto drop_trigger_cleanup; |
144321
|
0 |
0 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){ |
144329
|
0 |
0 |
for(i=OMIT_TEMPDB; inDb; i++){ |
144330
|
0 |
0 |
int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ |
144331
|
0 |
0 |
if( zDb && sqlite3DbIsNamed(db, j, zDb)==0 ) continue; |
|
0 |
0 |
if( zDb && sqlite3DbIsNamed(db, j, zDb)==0 ) continue; |
144334
|
0 |
0 |
if( pTrigger ) break; |
144336
|
0 |
0 |
if( !pTrigger ){ |
144337
|
0 |
0 |
if( !noErr ){ |
144374
|
0 |
0 |
if( pTable ){ |
144377
|
0 |
0 |
const char *zTab = SCHEMA_TABLE(iDb); |
144378
|
0 |
0 |
if( iDb==1 ) code = SQLITE_DROP_TEMP_TRIGGER; |
144388
|
0 |
0 |
if( (v = sqlite3GetVdbe(pParse))!=0 ){ |
144408
|
0 |
0 |
if( ALWAYS(pTrigger) ){ |
144409
|
0 |
0 |
if( pTrigger->pSchema==pTrigger->pTabSchema ){ |
144411
|
0 |
0 |
if( pTab ){ |
144413
|
0 |
0 |
for(pp=&pTab->pTrigger; *pp; pp=&((*pp)->pNext)){ |
144414
|
0 |
0 |
if( *pp==pTrigger ){ |
144437
|
0 |
0 |
if( pIdList==0 || NEVER(pEList==0) ) return 1; |
|
0 |
0 |
if( pIdList==0 || NEVER(pEList==0) ) return 1; |
144438
|
0 |
0 |
for(e=0; enExpr; e++){ |
144439
|
0 |
0 |
if( sqlite3IdListIndex(pIdList, pEList->a[e].zEName)>=0 ) return 1; |
144448
|
0 |
3074 |
if( NEVER(db->aDb[1].pSchema==0) ) return 0; |
144449
|
3074 |
0 |
if( sqliteHashFirst(&db->aDb[1].pSchema->trigHash)==0 ) return 0; |
144473
|
0 |
0 |
if( pList!=0 ){ |
144475
|
0 |
0 |
if( (pParse->db->flags & SQLITE_EnableTrigger)==0 |
144476
|
0 |
0 |
&& pTab->pTrigger!=0 |
144481
|
0 |
0 |
if( pList==pTab->pTrigger ){ |
144485
|
0 |
0 |
while( ALWAYS(p->pNext) && p->pNext!=pTab->pTrigger ) p = p->pNext; |
|
0 |
0 |
while( ALWAYS(p->pNext) && p->pNext!=pTab->pTrigger ) p = p->pNext; |
144490
|
0 |
0 |
if( p->op==op && checkColumnOverlap(p->pColumns, pChanges) ){ |
|
0 |
0 |
if( p->op==op && checkColumnOverlap(p->pColumns, pChanges) ){ |
144492
|
0 |
0 |
}else if( p->op==TK_RETURNING ){ |
144497
|
0 |
0 |
if( IsVirtual(pTab) ){ |
144498
|
0 |
0 |
if( op!=TK_INSERT ){ |
144499
|
0 |
0 |
sqlite3ErrorMsg(pParse, |
144508
|
0 |
0 |
}else if( p->bReturning && p->op==TK_INSERT && op==TK_UPDATE |
|
0 |
0 |
}else if( p->bReturning && p->op==TK_INSERT && op==TK_UPDATE |
|
0 |
0 |
}else if( p->bReturning && p->op==TK_INSERT && op==TK_UPDATE |
144509
|
0 |
0 |
&& sqlite3IsToplevel(pParse) ){ |
144514
|
0 |
0 |
}while( p ); |
144517
|
0 |
0 |
if( pMask ){ |
144520
|
0 |
0 |
return (mask ? pList : 0); |
144530
|
3074 |
0 |
if( (pTab->pTrigger==0 && !tempTriggersExist(pParse->db)) |
|
0 |
3074 |
if( (pTab->pTrigger==0 && !tempTriggersExist(pParse->db)) |
144531
|
0 |
0 |
|| pParse->disableTriggers |
144533
|
3007 |
67 |
if( pMask ) *pMask = 0; |
144559
|
0 |
0 |
if( pSrc ){ |
144562
|
0 |
0 |
if( pSchema!=db->aDb[1].pSchema ){ |
144565
|
0 |
0 |
if( pStep->pFrom ){ |
144567
|
0 |
0 |
if( pDup && pDup->nSrc>1 && !IN_RENAME_OBJECT ){ |
|
0 |
0 |
if( pDup && pDup->nSrc>1 && !IN_RENAME_OBJECT ){ |
|
0 |
0 |
if( pDup && pDup->nSrc>1 && !IN_RENAME_OBJECT ){ |
144593
|
0 |
0 |
if( pTerm->op==TK_ASTERISK ) return 1; |
144594
|
0 |
0 |
if( pTerm->op!=TK_DOT ) return 0; |
144597
|
0 |
0 |
if( pTerm->pRight->op!=TK_ASTERISK ) return 0; |
144617
|
0 |
0 |
for(i=0; inExpr; i++){ |
144619
|
0 |
0 |
if( NEVER(pOldExpr==0) ) continue; |
144620
|
0 |
0 |
if( isAsteriskTerm(pParse, pOldExpr) ){ |
144622
|
0 |
0 |
for(jj=0; jjnCol; jj++){ |
144624
|
0 |
0 |
if( IsHiddenColumn(pTab->aCol+jj) ) continue; |
144627
|
0 |
0 |
if( !db->mallocFailed ){ |
144636
|
0 |
0 |
if( !db->mallocFailed && ALWAYS(pList->a[i].zEName!=0) ){ |
|
0 |
0 |
if( !db->mallocFailed && ALWAYS(pList->a[i].zEName!=0) ){ |
144677
|
0 |
0 |
if( pParse->nErr==0 ){ |
144683
|
0 |
0 |
if( !db->mallocFailed ){ |
144686
|
0 |
0 |
if( pReturning->nRetCol==0 ){ |
144695
|
0 |
0 |
if( sqlite3ResolveExprListNames(&sNC, pNew)==SQLITE_OK |
144696
|
0 |
0 |
&& ALWAYS(!db->mallocFailed) |
144703
|
0 |
0 |
for(i=0; i
|
144707
|
0 |
0 |
if( sqlite3ExprAffinity(pCol)==SQLITE_AFF_REAL ){ |
144739
|
0 |
0 |
for(pStep=pStepList; pStep; pStep=pStep->pNext){ |
144753
|
0 |
0 |
pParse->eOrconf = (orconf==OE_Default)?pStep->orconf:(u8)orconf; |
144757
|
0 |
0 |
if( pStep->zSpan ){ |
144834
|
0 |
0 |
if( pTo->nErr==0 ){ |
144853
|
0 |
0 |
Parse *pTop = sqlite3ParseToplevel(pParse); |
144870
|
0 |
0 |
if( !pPrg ) return 0; |
144874
|
0 |
0 |
if( !pProgram ) return 0; |
144894
|
0 |
0 |
if( v ){ |
144904
|
0 |
0 |
if( pTrigger->zName ){ |
144914
|
0 |
0 |
if( pTrigger->pWhen ){ |
144916
|
0 |
0 |
if( db->mallocFailed==0 |
144917
|
0 |
0 |
&& SQLITE_OK==sqlite3ResolveExprNames(&sNC, pWhen) |
144929
|
0 |
0 |
if( iEndTrigger ){ |
144936
|
0 |
0 |
if( pParse->nErr==0 ){ |
144967
|
0 |
0 |
Parse *pRoot = sqlite3ParseToplevel(pParse); |
144976
|
0 |
0 |
for(pPrg=pRoot->pTriggerPrg; |
144977
|
0 |
0 |
pPrg && (pPrg->pTrigger!=pTrigger || pPrg->orconf!=orconf); |
|
0 |
0 |
pPrg && (pPrg->pTrigger!=pTrigger || pPrg->orconf!=orconf); |
144982
|
0 |
0 |
if( !pPrg ){ |
145011
|
0 |
0 |
if( pPrg ){ |
145012
|
0 |
0 |
int bRecursive = (p->zName && 0==(pParse->db->flags&SQLITE_RecTriggers)); |
|
0 |
0 |
int bRecursive = (p->zName && 0==(pParse->db->flags&SQLITE_RecTriggers)); |
145085
|
0 |
347 |
for(p=pTrigger; p; p=p->pNext){ |
145100
|
0 |
0 |
if( (p->op==op || (p->bReturning && p->op==TK_INSERT && op==TK_UPDATE)) |
|
0 |
0 |
if( (p->op==op || (p->bReturning && p->op==TK_INSERT && op==TK_UPDATE)) |
|
0 |
0 |
if( (p->op==op || (p->bReturning && p->op==TK_INSERT && op==TK_UPDATE)) |
|
0 |
0 |
if( (p->op==op || (p->bReturning && p->op==TK_INSERT && op==TK_UPDATE)) |
145101
|
0 |
0 |
&& p->tr_tm==tr_tm |
145102
|
0 |
0 |
&& checkColumnOverlap(p->pColumns, pChanges) |
145104
|
0 |
0 |
if( !p->bReturning ){ |
145106
|
0 |
0 |
}else if( sqlite3IsToplevel(pParse) ){ |
145147
|
309 |
0 |
const int op = pChanges ? TK_UPDATE : TK_DELETE; |
145152
|
0 |
309 |
for(p=pTrigger; p; p=p->pNext){ |
145153
|
0 |
0 |
if( p->op==op |
145154
|
0 |
0 |
&& (tr_tm&p->tr_tm) |
145155
|
0 |
0 |
&& checkColumnOverlap(p->pColumns,pChanges) |
145157
|
0 |
0 |
if( p->bReturning ){ |
145162
|
0 |
0 |
if( pPrg ){ |
145238
|
4721 |
0 |
if( !IsView(pTab) ){ |
145247
|
0 |
4721 |
if( pValue ){ |
145252
|
0 |
4721 |
if( pTab->aCol[i].affinity==SQLITE_AFF_REAL && !IsVirtual(pTab) ){ |
|
0 |
0 |
if( pTab->aCol[i].affinity==SQLITE_AFF_REAL && !IsVirtual(pTab) ){ |
145277
|
0 |
0 |
if( iIdxCol>=0 ){ |
145304
|
0 |
0 |
if( pIdx->pPartIdxWhere==0 ) return 0; |
145317
|
0 |
0 |
if( pRet ) pRet->iColumn = iCol+1; |
145398
|
0 |
0 |
if( pSrc ){ |
145404
|
0 |
0 |
if( pPk ){ |
145405
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
145414
|
0 |
0 |
eDest = IsVirtual(pTab) ? SRT_Table : SRT_Upfrom; |
145415
|
0 |
0 |
}else if( IsView(pTab) ){ |
145416
|
0 |
0 |
for(i=0; inCol; i++){ |
145421
|
0 |
0 |
eDest = IsVirtual(pTab) ? SRT_Table : SRT_Upfrom; |
145430
|
0 |
0 |
if( pChanges ){ |
145431
|
0 |
0 |
for(i=0; inExpr; i++){ |
145440
|
0 |
0 |
if( pSelect ) pSelect->selFlags |= SF_OrderByReqd; |
145442
|
0 |
0 |
dest.iSDParm2 = (pPk ? pPk->nKeyCol : -1); |
145526
|
0 |
310 |
if( pParse->nErr ){ |
145534
|
0 |
310 |
if( pTab==0 ) goto update_cleanup; |
145566
|
0 |
310 |
nChangeFrom = (pTabList->nSrc>1) ? pChanges->nExpr : 0; |
145579
|
0 |
310 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ){ |
145582
|
3 |
307 |
if( sqlite3IsReadOnly(pParse, pTab, tmask) ){ |
145593
|
0 |
307 |
pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab); |
145595
|
0 |
307 |
for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){ |
145596
|
0 |
0 |
if( pPk==pIdx ){ |
145601
|
0 |
307 |
if( pUpsert ){ |
145613
|
0 |
307 |
if( aXRef==0 ) goto update_cleanup; |
145618
|
1522 |
307 |
for(i=0; inCol; i++) aXRef[i] = -1; |
145629
|
0 |
307 |
if( v==0 ) goto update_cleanup; |
145638
|
1487 |
307 |
for(i=0; inExpr; i++){ |
145642
|
1487 |
0 |
if( nChangeFrom==0 && sqlite3ResolveExprNames(&sNC, pChanges->a[i].pExpr) ){ |
|
0 |
1487 |
if( nChangeFrom==0 && sqlite3ResolveExprNames(&sNC, pChanges->a[i].pExpr) ){ |
145645
|
4459 |
0 |
for(j=0; jnCol; j++){ |
145646
|
1487 |
2972 |
if( pTab->aCol[j].hName==hCol |
145647
|
1487 |
0 |
&& sqlite3StrICmp(pTab->aCol[j].zCnName, pChanges->a[i].zEName)==0 |
145649
|
0 |
1487 |
if( j==pTab->iPKey ){ |
145653
|
0 |
1487 |
}else if( pPk && (pTab->aCol[j].colFlags & COLFLAG_PRIMKEY)!=0 ){ |
|
0 |
0 |
}else if( pPk && (pTab->aCol[j].colFlags & COLFLAG_PRIMKEY)!=0 ){ |
145657
|
0 |
1487 |
else if( pTab->aCol[j].colFlags & COLFLAG_GENERATED ){ |
145670
|
0 |
1487 |
if( j>=pTab->nCol ){ |
145671
|
0 |
0 |
if( pPk==0 && sqlite3IsRowid(pChanges->a[i].zEName) ){ |
|
0 |
0 |
if( pPk==0 && sqlite3IsRowid(pChanges->a[i].zEName) ){ |
145685
|
1487 |
0 |
rc = sqlite3AuthCheck(pParse, SQLITE_UPDATE, pTab->zName, |
145688
|
0 |
1487 |
if( rc==SQLITE_DENY ){ |
145690
|
0 |
1487 |
}else if( rc==SQLITE_IGNORE ){ |
145709
|
0 |
307 |
if( pTab->tabFlags & TF_HasGenerated ){ |
145715
|
0 |
0 |
for(i=0; inCol; i++){ |
145716
|
0 |
0 |
if( aXRef[i]>=0 ) continue; |
145717
|
0 |
0 |
if( (pTab->aCol[i].colFlags & COLFLAG_GENERATED)==0 ) continue; |
145718
|
0 |
0 |
if( sqlite3ExprReferencesUpdatedColumn( |
145726
|
0 |
0 |
}while( bProgress ); |
145735
|
0 |
307 |
pTabList->a[0].colUsed = IsVirtual(pTab) ? ALLBITS : 0; |
145743
|
0 |
307 |
if( onError==OE_Replace ) bReplace = 1; |
145744
|
0 |
307 |
for(nAllIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nAllIdx++){ |
145746
|
0 |
0 |
if( chngKey || hasFK>1 || pIdx==pPk |
|
0 |
0 |
if( chngKey || hasFK>1 || pIdx==pPk |
|
0 |
0 |
if( chngKey || hasFK>1 || pIdx==pPk |
145747
|
0 |
0 |
|| indexWhereClauseMightChange(pIdx,aXRef,chngRowid) |
145753
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
145754
|
0 |
0 |
if( indexColumnIsBeingUpdated(pIdx, i, aXRef, chngRowid) ){ |
145757
|
0 |
0 |
if( onError==OE_Default && pIdx->onError==OE_Replace ){ |
|
0 |
0 |
if( onError==OE_Default && pIdx->onError==OE_Replace ){ |
145764
|
0 |
0 |
if( reg==0 ) aToOpen[nAllIdx+1] = 0; |
145768
|
0 |
307 |
if( bReplace ){ |
145774
|
7 |
300 |
if( pParse->nested==0 ) sqlite3VdbeCountChanges(v); |
145775
|
307 |
0 |
sqlite3BeginWriteOperation(pParse, pTrigger || hasFK, iDb); |
|
2 |
305 |
sqlite3BeginWriteOperation(pParse, pTrigger || hasFK, iDb); |
145778
|
307 |
0 |
if( !IsVirtual(pTab) ){ |
145787
|
307 |
0 |
if( chngPk || pTrigger || hasFK ){ |
|
307 |
0 |
if( chngPk || pTrigger || hasFK ){ |
|
2 |
305 |
if( chngPk || pTrigger || hasFK ){ |
145791
|
307 |
0 |
if( chngKey || pTrigger || hasFK ){ |
|
307 |
0 |
if( chngKey || pTrigger || hasFK ){ |
|
2 |
305 |
if( chngKey || pTrigger || hasFK ){ |
145799
|
0 |
307 |
if( isView ){ |
145807
|
307 |
0 |
if( nChangeFrom==0 && isView ){ |
|
0 |
307 |
if( nChangeFrom==0 && isView ){ |
145819
|
307 |
0 |
if( nChangeFrom==0 && sqlite3ResolveExprNames(&sNC, pWhere) ){ |
|
0 |
307 |
if( nChangeFrom==0 && sqlite3ResolveExprNames(&sNC, pWhere) ){ |
145825
|
0 |
307 |
if( IsVirtual(pTab) ){ |
145837
|
0 |
307 |
if( (db->flags&SQLITE_CountRows)!=0 |
145838
|
0 |
0 |
&& !pParse->pTriggerTab |
145839
|
0 |
0 |
&& !pParse->nested |
145840
|
0 |
0 |
&& !pParse->bReturning |
145841
|
0 |
0 |
&& pUpsert==0 |
145847
|
307 |
0 |
if( nChangeFrom==0 && HasRowid(pTab) ){ |
|
307 |
0 |
if( nChangeFrom==0 && HasRowid(pTab) ){ |
145853
|
0 |
0 |
nPk = pPk ? pPk->nKeyCol : 0; |
145858
|
0 |
0 |
if( pUpsert==0 ){ |
145859
|
0 |
0 |
int nEphCol = nPk + nChangeFrom + (isView ? pTab->nCol : 0); |
145861
|
0 |
0 |
if( pPk ) sqlite3VdbeAddOp3(v, OP_Null, 0, iPk, iPk+nPk-1); |
145863
|
0 |
0 |
if( pPk ){ |
145865
|
0 |
0 |
if( pKeyInfo ){ |
145870
|
0 |
0 |
if( nChangeFrom ){ |
145875
|
0 |
0 |
if( isView ) iDataCur = iEph; |
145881
|
0 |
307 |
if( nChangeFrom ){ |
145887
|
0 |
307 |
if( pUpsert ){ |
145906
|
7 |
300 |
if( !pParse->nested && !pTrigger && !hasFK && !chngKey && !bReplace ){ |
|
7 |
0 |
if( !pParse->nested && !pTrigger && !hasFK && !chngKey && !bReplace ){ |
|
5 |
2 |
if( !pParse->nested && !pTrigger && !hasFK && !chngKey && !bReplace ){ |
|
5 |
0 |
if( !pParse->nested && !pTrigger && !hasFK && !chngKey && !bReplace ){ |
|
5 |
0 |
if( !pParse->nested && !pTrigger && !hasFK && !chngKey && !bReplace ){ |
145910
|
0 |
307 |
if( pWInfo==0 ) goto update_cleanup; |
145924
|
12 |
295 |
if( eOnePass!=ONEPASS_SINGLE ){ |
145926
|
5 |
7 |
if( eOnePass==ONEPASS_MULTI ){ |
145928
|
0 |
5 |
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] ){ |
145936
|
307 |
0 |
if( HasRowid(pTab) ){ |
145941
|
7 |
300 |
if( eOnePass==ONEPASS_OFF ){ |
145945
|
300 |
0 |
if( ALWAYS(addrOpen) ) sqlite3VdbeChangeToNoop(v, addrOpen); |
145953
|
0 |
0 |
for(i=0; i
|
145958
|
0 |
0 |
if( eOnePass ){ |
145959
|
0 |
0 |
if( addrOpen ) sqlite3VdbeChangeToNoop(v, addrOpen); |
145970
|
307 |
0 |
if( pUpsert==0 ){ |
145971
|
307 |
0 |
if( nChangeFrom==0 && eOnePass!=ONEPASS_MULTI ){ |
|
302 |
5 |
if( nChangeFrom==0 && eOnePass!=ONEPASS_MULTI ){ |
145975
|
307 |
0 |
if( !isView ){ |
145979
|
300 |
7 |
if( eOnePass!=ONEPASS_OFF ){ |
145980
|
300 |
0 |
if( aiCurOnePass[0]>=0 ) aToOpen[aiCurOnePass[0]-iBaseCur] = 0; |
145981
|
0 |
300 |
if( aiCurOnePass[1]>=0 ) aToOpen[aiCurOnePass[1]-iBaseCur] = 0; |
145984
|
5 |
302 |
if( eOnePass==ONEPASS_MULTI && (nIdx-(aiCurOnePass[1]>=0))>0 ){ |
|
0 |
5 |
if( eOnePass==ONEPASS_MULTI && (nIdx-(aiCurOnePass[1]>=0))>0 ){ |
145989
|
0 |
307 |
if( addrOnce ){ |
145995
|
300 |
7 |
if( eOnePass!=ONEPASS_OFF ){ |
145996
|
0 |
300 |
if( aiCurOnePass[0]!=iDataCur |
145997
|
0 |
0 |
&& aiCurOnePass[1]!=iDataCur |
146006
|
5 |
295 |
if( eOnePass!=ONEPASS_SINGLE ){ |
146009
|
0 |
300 |
sqlite3VdbeAddOp2(v, OP_IsNull, pPk ? regKey : regOldRowid, labelBreak); |
146012
|
7 |
0 |
}else if( pPk || nChangeFrom ){ |
|
0 |
7 |
}else if( pPk || nChangeFrom ){ |
146016
|
0 |
0 |
if( nChangeFrom ){ |
146017
|
0 |
0 |
if( !isView ){ |
146018
|
0 |
0 |
if( pPk ){ |
146019
|
0 |
0 |
for(i=0; i
|
146052
|
0 |
307 |
if( chngRowid ){ |
146054
|
0 |
0 |
if( nChangeFrom==0 ){ |
146064
|
307 |
0 |
if( chngPk || hasFK || pTrigger ){ |
|
305 |
2 |
if( chngPk || hasFK || pTrigger ){ |
|
0 |
305 |
if( chngPk || hasFK || pTrigger ){ |
146065
|
2 |
0 |
u32 oldmask = (hasFK ? sqlite3FkOldmask(pParse, pTab) : 0); |
146069
|
6 |
2 |
for(i=0; inCol; i++){ |
146072
|
6 |
0 |
if( oldmask==0xffffffff |
146073
|
6 |
0 |
|| (i<32 && (oldmask & MASKBIT32(i))!=0) |
|
4 |
2 |
|| (i<32 && (oldmask & MASKBIT32(i))!=0) |
146074
|
2 |
2 |
|| (colFlags & COLFLAG_PRIMKEY)!=0 |
146082
|
2 |
0 |
if( chngRowid==0 && pPk==0 ){ |
|
2 |
0 |
if( chngRowid==0 && pPk==0 ){ |
146103
|
1522 |
307 |
for(i=0, k=regNew; inCol; i++, k++){ |
146104
|
2 |
1520 |
if( i==pTab->iPKey ){ |
146106
|
0 |
1520 |
}else if( (pTab->aCol[i].colFlags & COLFLAG_GENERATED)!=0 ){ |
146107
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_VIRTUAL ) k--; |
146110
|
1487 |
33 |
if( j>=0 ){ |
146111
|
0 |
1487 |
if( nChangeFrom ){ |
146112
|
0 |
0 |
int nOff = (isView ? pTab->nCol : nPk); |
146118
|
0 |
33 |
}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)) ){ |
146134
|
0 |
307 |
if( pTab->tabFlags & TF_HasGenerated ){ |
146144
|
0 |
307 |
if( tmask&TRIGGER_BEFORE ){ |
146149
|
0 |
0 |
if( !isView ){ |
146156
|
0 |
0 |
if( pPk ){ |
146173
|
0 |
0 |
for(i=0, k=regNew; inCol; i++, k++){ |
146174
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_GENERATED ){ |
146175
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_VIRTUAL ) k--; |
146176
|
0 |
0 |
}else if( aXRef[i]<0 && i!=pTab->iPKey ){ |
|
0 |
0 |
}else if( aXRef[i]<0 && i!=pTab->iPKey ){ |
146181
|
0 |
0 |
if( pTab->tabFlags & TF_HasGenerated ){ |
146190
|
307 |
0 |
if( !isView ){ |
146200
|
307 |
0 |
if( bReplace || chngKey ){ |
|
0 |
307 |
if( bReplace || chngKey ){ |
146201
|
0 |
0 |
if( pPk ){ |
146210
|
2 |
305 |
if( hasFK ){ |
146222
|
0 |
307 |
if( bFinishSeek ){ |
146249
|
307 |
0 |
if( hasFK>1 || chngKey ){ |
|
0 |
307 |
if( hasFK>1 || chngKey ){ |
146254
|
2 |
305 |
if( hasFK ){ |
146259
|
5 |
302 |
sqlite3CompleteInsertion( |
146268
|
2 |
305 |
if( hasFK ){ |
146275
|
0 |
307 |
if( regRowCount ){ |
146285
|
12 |
295 |
if( eOnePass==ONEPASS_SINGLE ){ |
146287
|
5 |
7 |
}else if( eOnePass==ONEPASS_MULTI ){ |
146300
|
7 |
300 |
if( pParse->nested==0 && pParse->pTriggerTab==0 && pUpsert==0 ){ |
|
7 |
0 |
if( pParse->nested==0 && pParse->pTriggerTab==0 && pUpsert==0 ){ |
|
7 |
0 |
if( pParse->nested==0 && pParse->pTriggerTab==0 && pUpsert==0 ){ |
146308
|
0 |
307 |
if( regRowCount ){ |
146389
|
0 |
0 |
if( pSrc->nSrc>1 ){ |
146393
|
0 |
0 |
if( HasRowid(pTab) ){ |
146394
|
0 |
0 |
if( pRowid ){ |
146405
|
0 |
0 |
if( aXRef[iPk]>=0 ){ |
146413
|
0 |
0 |
for(i=0; inCol; i++){ |
146414
|
0 |
0 |
if( aXRef[i]>=0 ){ |
146434
|
0 |
0 |
if( pWInfo==0 ) return; |
146437
|
0 |
0 |
for(i=0; inCol; i++){ |
146439
|
0 |
0 |
if( aXRef[i]>=0 ){ |
146446
|
0 |
0 |
if( HasRowid(pTab) ){ |
146448
|
0 |
0 |
if( pRowid ){ |
146469
|
0 |
0 |
if( eOnePass ){ |
146490
|
0 |
0 |
if( eOnePass==ONEPASS_OFF ){ |
146492
|
0 |
0 |
if( pSrc->nSrc==1 ){ |
146501
|
0 |
0 |
for(i=0; i
|
146507
|
0 |
0 |
sqlite3VdbeChangeP5(v, onError==OE_Default ? OE_Abort : onError); |
146512
|
0 |
0 |
if( eOnePass==ONEPASS_OFF ){ |
146554
|
0 |
0 |
}while( p ); |
146557
|
0 |
2697 |
if( p ) upsertDelete(db, p); |
146565
|
0 |
0 |
if( p==0 ) return 0; |
146588
|
0 |
0 |
if( pNew==0 ){ |
146640
|
0 |
0 |
for(; pUpsert && pUpsert->pUpsertTarget; |
|
0 |
0 |
for(; pUpsert && pUpsert->pUpsertTarget; |
146643
|
0 |
0 |
if( rc ) return rc; |
146645
|
0 |
0 |
if( rc ) return rc; |
146651
|
0 |
0 |
if( HasRowid(pTab) |
146652
|
0 |
0 |
&& pTarget->nExpr==1 |
146653
|
0 |
0 |
&& (pTerm = pTarget->a[0].pExpr)->op==TK_COLUMN |
146654
|
0 |
0 |
&& pTerm->iColumn==XN_ROWID |
146674
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
146676
|
0 |
0 |
if( !IsUniqueIndex(pIdx) ) continue; |
146677
|
0 |
0 |
if( pTarget->nExpr!=pIdx->nKeyCol ) continue; |
146678
|
0 |
0 |
if( pIdx->pPartIdxWhere ){ |
146679
|
0 |
0 |
if( pUpsert->pUpsertTargetWhere==0 ) continue; |
146680
|
0 |
0 |
if( sqlite3ExprCompare(pParse, pUpsert->pUpsertTargetWhere, |
146686
|
0 |
0 |
for(ii=0; ii
|
146689
|
0 |
0 |
if( pIdx->aiColumn[ii]==XN_EXPR ){ |
146693
|
0 |
0 |
if( pExpr->op!=TK_COLLATE ){ |
146702
|
0 |
0 |
for(jj=0; jj
|
146703
|
0 |
0 |
if( sqlite3ExprCompare(pParse,pTarget->a[jj].pExpr,pExpr,iCursor)<2 ){ |
146707
|
0 |
0 |
if( jj>=nn ){ |
146712
|
0 |
0 |
if( ii
|
146720
|
0 |
0 |
if( pUpsert->pUpsertIdx==0 ){ |
146722
|
0 |
0 |
if( nClause==0 && pUpsert->pNextUpsert==0 ){ |
|
0 |
0 |
if( nClause==0 && pUpsert->pNextUpsert==0 ){ |
146742
|
0 |
0 |
if( NEVER(pUpsert==0) ) return 0; |
146744
|
0 |
0 |
if( pNext==0 ) return 1; |
146745
|
0 |
0 |
if( pNext->pUpsertTarget==0 ) return 1; |
146746
|
0 |
0 |
if( pNext->pUpsertIdx==0 ) return 1; |
146757
|
0 |
0 |
while( |
146759
|
0 |
0 |
&& pUpsert->pUpsertTarget!=0 |
146760
|
0 |
0 |
&& pUpsert->pUpsertIdx!=pIdx |
146795
|
0 |
0 |
if( pIdx && iCur!=iDataCur ){ |
|
0 |
0 |
if( pIdx && iCur!=iDataCur ){ |
146796
|
0 |
0 |
if( HasRowid(pTab) ){ |
146807
|
0 |
0 |
for(i=0; i
|
146828
|
0 |
0 |
for(i=0; inCol; i++){ |
146829
|
0 |
0 |
if( pTab->aCol[i].affinity==SQLITE_AFF_REAL ){ |
146879
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
146880
|
0 |
0 |
while( SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){ |
146888
|
0 |
0 |
if( zSubSql |
146889
|
0 |
0 |
&& (strncmp(zSubSql,"CRE",3)==0 || strncmp(zSubSql,"INS",3)==0) |
|
0 |
0 |
&& (strncmp(zSubSql,"CRE",3)==0 || strncmp(zSubSql,"INS",3)==0) |
146892
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
146896
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
146897
|
0 |
0 |
if( rc ){ |
146910
|
0 |
0 |
if( z==0 ) return SQLITE_NOMEM; |
146949
|
0 |
0 |
if( v==0 ) goto build_vacuum_end; |
146950
|
0 |
0 |
if( pParse->nErr ) goto build_vacuum_end; |
146951
|
0 |
0 |
if( pNm ){ |
146956
|
0 |
0 |
if( iDb<0 ) goto build_vacuum_end; |
146967
|
0 |
0 |
if( iDb!=1 ){ |
146969
|
0 |
0 |
if( pInto && sqlite3ResolveSelfReference(pParse,0,0,pInto,0)==0 ){ |
|
0 |
0 |
if( pInto && sqlite3ResolveSelfReference(pParse,0,0,pInto,0)==0 ){ |
147006
|
0 |
0 |
if( !db->autoCommit ){ |
147010
|
0 |
0 |
if( db->nVdbeActive>1 ){ |
147015
|
0 |
0 |
if( pOut ){ |
147016
|
0 |
0 |
if( sqlite3_value_type(pOut)!=SQLITE_TEXT ){ |
147062
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
147067
|
0 |
0 |
if( pOut ){ |
147070
|
0 |
0 |
if( id->pMethods!=0 && (sqlite3OsFileSize(id, &sz)!=SQLITE_OK || sz>0) ){ |
|
0 |
0 |
if( id->pMethods!=0 && (sqlite3OsFileSize(id, &sz)!=SQLITE_OK || sz>0) ){ |
|
0 |
0 |
if( id->pMethods!=0 && (sqlite3OsFileSize(id, &sz)!=SQLITE_OK || sz>0) ){ |
147088
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
147089
|
0 |
0 |
rc = sqlite3BtreeBeginTrans(pMain, pOut==0 ? 2 : 0, 0); |
147090
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
147093
|
0 |
0 |
if( sqlite3PagerGetJournalMode(sqlite3BtreePager(pMain)) |
147095
|
0 |
0 |
&& pOut==0 |
147100
|
0 |
0 |
if( sqlite3BtreeSetPageSize(pTemp, sqlite3BtreeGetPageSize(pMain), nRes, 0) |
147101
|
0 |
0 |
|| (!isMemDb && sqlite3BtreeSetPageSize(pTemp, db->nextPagesize, nRes, 0)) |
|
0 |
0 |
|| (!isMemDb && sqlite3BtreeSetPageSize(pTemp, db->nextPagesize, nRes, 0)) |
147102
|
0 |
0 |
|| NEVER(db->mallocFailed) |
147109
|
0 |
0 |
sqlite3BtreeSetAutoVacuum(pTemp, db->nextAutovac>=0 ? db->nextAutovac : |
147123
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
147129
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
147145
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
147159
|
0 |
0 |
if( rc ) goto end_of_vacuum; |
147189
|
0 |
0 |
for(i=0; i
|
147194
|
0 |
0 |
if( NEVER(rc!=SQLITE_OK) ) goto end_of_vacuum; |
147197
|
0 |
0 |
if( pOut==0 ){ |
147200
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
147202
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum; |
147204
|
0 |
0 |
if( pOut==0 ){ |
147211
|
0 |
0 |
if( pOut==0 ){ |
147235
|
0 |
0 |
if( pDb ){ |
147300
|
0 |
3123 |
if( pModule==0 ){ |
147306
|
0 |
3123 |
if( pMod==0 ){ |
147320
|
0 |
3123 |
if( pDel ){ |
147321
|
0 |
0 |
if( pDel==pMod ){ |
147350
|
0 |
3123 |
if( rc!=SQLITE_OK && xDestroy ) xDestroy(pAux); |
|
0 |
0 |
if( rc!=SQLITE_OK && xDestroy ) xDestroy(pAux); |
147396
|
0 |
0 |
for(pThis=sqliteHashFirst(&db->aModule); pThis; pThis=pNext){ |
147399
|
0 |
0 |
if( azNames ){ |
147401
|
0 |
0 |
for(ii=0; azNames[ii]!=0 && strcmp(azNames[ii],pMod->zName)!=0; ii++){} |
|
0 |
0 |
for(ii=0; azNames[ii]!=0 && strcmp(azNames[ii],pMod->zName)!=0; ii++){} |
147402
|
0 |
0 |
if( azNames[ii]!=0 ) continue; |
147416
|
3103 |
31 |
if( pMod->nRefModule==0 ){ |
147417
|
1249 |
1854 |
if( pMod->xDestroy ){ |
147446
|
641 |
3 |
for(pVtab=pTab->u.vtab.p; pVtab && pVtab->db!=db; pVtab=pVtab->pNext); |
|
0 |
641 |
for(pVtab=pTab->u.vtab.p; pVtab && pVtab->db!=db; pVtab=pVtab->pNext); |
147463
|
31 |
265 |
if( pVTab->nRef==0 ){ |
147466
|
29 |
2 |
if( p ){ |
147496
|
2 |
63 |
while( pVTable ){ |
147500
|
2 |
0 |
if( db2==db ){ |
147530
|
29 |
3 |
for(ppVTab=&p->u.vtab.p; *ppVTab; ppVTab=&(*ppVTab)->pNext){ |
147531
|
29 |
0 |
if( (*ppVTab)->db==db ){ |
147567
|
0 |
6755 |
if( p ){ |
147574
|
0 |
0 |
}while( p ); |
147594
|
31 |
30 |
if( !db || db->pnBytesFreed==0 ) vtabDisconnectAll(0, p); |
|
31 |
0 |
if( !db || db->pnBytesFreed==0 ) vtabDisconnectAll(0, p); |
147595
|
61 |
0 |
if( p->u.vtab.azArg ){ |
147597
|
353 |
61 |
for(i=0; iu.vtab.nArg; i++){ |
147598
|
292 |
61 |
if( i!=1 ) sqlite3DbFree(db, p->u.vtab.azArg[i]); |
147617
|
0 |
353 |
if( pTable->u.vtab.nArg+3>=db->aLimit[SQLITE_LIMIT_COLUMN] ){ |
147621
|
0 |
353 |
if( azModuleArg==0 ){ |
147648
|
0 |
61 |
if( pTable==0 ) return; |
147671
|
61 |
0 |
if( pTable->u.vtab.azArg ){ |
147686
|
170 |
63 |
if( pParse->sArg.z && pParse->pNewTable ){ |
|
170 |
0 |
if( pParse->sArg.z && pParse->pNewTable ){ |
147702
|
0 |
61 |
if( pTab==0 ) return; |
147706
|
0 |
61 |
if( pTab->u.vtab.nArg<1 ) return; |
147714
|
29 |
32 |
if( !db->init.busy ){ |
147724
|
29 |
0 |
if( pEnd ){ |
147768
|
0 |
32 |
if( pOld ){ |
147793
|
170 |
178 |
if( pArg->z==0 ){ |
147828
|
1 |
32 |
for(pCtx=db->pVtabCtx; pCtx; pCtx=pCtx->pPrior){ |
147829
|
0 |
1 |
if( pCtx->pTab==pTab ){ |
147838
|
0 |
32 |
if( !zModuleName ){ |
147843
|
0 |
32 |
if( !pVTable ){ |
147865
|
0 |
32 |
if( rc==SQLITE_NOMEM ) sqlite3OomFault(db); |
147868
|
1 |
31 |
if( SQLITE_OK!=rc ){ |
147869
|
0 |
1 |
if( zErr==0 ){ |
147876
|
31 |
0 |
}else if( ALWAYS(pVTable->pVtab) ){ |
147883
|
0 |
31 |
if( sCtx.bDeclared==0 ){ |
147899
|
100 |
31 |
for(iCol=0; iColnCol; iCol++){ |
147904
|
233 |
72 |
for(i=0; i
|
147905
|
28 |
205 |
if( 0==sqlite3StrNICmp("hidden", &zType[i], 6) |
147906
|
0 |
28 |
&& (i==0 || zType[i-1]==' ') |
|
0 |
0 |
&& (i==0 || zType[i-1]==' ') |
147907
|
0 |
28 |
&& (zType[i+6]=='\0' || zType[i+6]==' ') |
|
0 |
0 |
&& (zType[i+6]=='\0' || zType[i+6]==' ') |
147912
|
28 |
72 |
if( i
|
147914
|
0 |
28 |
int nDel = 6 + (zType[i+6] ? 1 : 0); |
147915
|
28 |
28 |
for(j=i; (j+nDel)<=nType; j++){ |
147918
|
28 |
0 |
if( zType[i]=='\0' && i>0 ){ |
|
0 |
28 |
if( zType[i]=='\0' && i>0 ){ |
147951
|
182 |
3 |
if( sqlite3GetVTable(db, pTab) ){ |
147959
|
0 |
3 |
if( !pMod ){ |
147966
|
0 |
3 |
if( rc!=SQLITE_OK ){ |
147983
|
71 |
0 |
if( (db->nVTrans%ARRAY_INCR)==0 ){ |
147988
|
0 |
71 |
if( !aVTrans ){ |
148033
|
29 |
0 |
if( pMod==0 || pMod->pModule->xCreate==0 || pMod->pModule->xDestroy==0 ){ |
|
29 |
0 |
if( pMod==0 || pMod->pModule->xCreate==0 || pMod->pModule->xDestroy==0 ){ |
|
0 |
29 |
if( pMod==0 || pMod->pModule->xCreate==0 || pMod->pModule->xDestroy==0 ){ |
148042
|
28 |
1 |
if( rc==SQLITE_OK && ALWAYS(sqlite3GetVTable(db, pTab)) ){ |
|
28 |
0 |
if( rc==SQLITE_OK && ALWAYS(sqlite3GetVTable(db, pTab)) ){ |
148044
|
28 |
0 |
if( rc==SQLITE_OK ){ |
148071
|
31 |
0 |
if( !pCtx || pCtx->bDeclared ){ |
|
0 |
31 |
if( !pCtx || pCtx->bDeclared ){ |
148089
|
31 |
0 |
if( SQLITE_OK==sqlite3RunParser(&sParse, zCreateTable) |
148090
|
31 |
0 |
&& ALWAYS(sParse.pNewTable!=0) |
148091
|
31 |
0 |
&& ALWAYS(!db->mallocFailed) |
148092
|
31 |
0 |
&& IsOrdinaryTable(sParse.pNewTable) |
148095
|
31 |
0 |
if( !pTab->aCol ){ |
148106
|
0 |
31 |
if( !HasRowid(pNew) |
148107
|
0 |
0 |
&& pCtx->pVTable->pMod->pModule->xUpdate!=0 |
148108
|
0 |
0 |
&& sqlite3PrimaryKeyIndex(pNew)->nKeyCol!=1 |
148115
|
0 |
31 |
if( pIdx ){ |
148124
|
0 |
0 |
sqlite3ErrorWithMsg(db, SQLITE_ERROR, |
148131
|
31 |
0 |
if( sParse.pVdbe ){ |
148156
|
2 |
0 |
if( ALWAYS(pTab!=0) |
148157
|
2 |
0 |
&& ALWAYS(IsVirtual(pTab)) |
148158
|
2 |
0 |
&& ALWAYS(pTab->u.vtab.p!=0) |
148162
|
2 |
2 |
for(p=pTab->u.vtab.p; p; p=p->pNext){ |
148164
|
0 |
2 |
if( p->pVtab->nRef>0 ){ |
148170
|
0 |
2 |
if( xDestroy==0 ) xDestroy = p->pMod->pModule->xDisconnect; |
148175
|
2 |
0 |
if( rc==SQLITE_OK ){ |
148197
|
71 |
2995 |
if( db->aVTrans ){ |
148200
|
71 |
71 |
for(i=0; inVTrans; i++){ |
148203
|
71 |
0 |
if( p ){ |
148206
|
70 |
1 |
if( x ) x(p); |
148229
|
2449 |
0 |
for(i=0; rc==SQLITE_OK && inVTrans; i++){ |
|
71 |
2378 |
for(i=0; rc==SQLITE_OK && inVTrans; i++){ |
148232
|
71 |
0 |
if( pVtab && (x = pVtab->pModule->xSync)!=0 ){ |
|
70 |
1 |
if( pVtab && (x = pVtab->pModule->xSync)!=0 ){ |
148276
|
5 |
74 |
if( sqlite3VtabInSync(db) ){ |
|
0 |
5 |
if( sqlite3VtabInSync(db) ){ |
148279
|
31 |
48 |
if( !pVTab ){ |
148284
|
48 |
0 |
if( pModule->xBegin ){ |
148288
|
5 |
43 |
for(i=0; inVTrans; i++){ |
148289
|
5 |
0 |
if( db->aVTrans[i]==pVTab ){ |
148297
|
43 |
0 |
if( rc==SQLITE_OK ){ |
148299
|
43 |
0 |
if( rc==SQLITE_OK ){ |
148302
|
0 |
43 |
if( iSvpt && pModule->xSavepoint ){ |
|
0 |
0 |
if( iSvpt && pModule->xSavepoint ){ |
148332
|
2 |
133 |
if( db->aVTrans ){ |
148334
|
4 |
0 |
for(i=0; rc==SQLITE_OK && inVTrans; i++){ |
|
2 |
2 |
for(i=0; rc==SQLITE_OK && inVTrans; i++){ |
148337
|
2 |
0 |
if( pVTab->pVtab && pMod->iVersion>=2 ){ |
|
2 |
0 |
if( pVTab->pVtab && pMod->iVersion>=2 ){ |
148352
|
2 |
0 |
if( xMethod && pVTab->iSavepoint>iSavepoint ){ |
|
0 |
2 |
if( xMethod && pVTab->iSavepoint>iSavepoint ){ |
148390
|
0 |
677 |
if( NEVER(pExpr==0) ) return pDef; |
148391
|
511 |
166 |
if( pExpr->op!=TK_COLUMN ) return pDef; |
148394
|
0 |
166 |
if( pTab==0 ) return pDef; |
148395
|
137 |
29 |
if( !IsVirtual(pTab) ) return pDef; |
148400
|
0 |
29 |
if( pMod->xFindFunction==0 ) return pDef; |
148419
|
4 |
25 |
if( rc==0 ){ |
148427
|
0 |
25 |
if( pNew==0 ){ |
148446
|
0 |
22 |
Parse *pToplevel = sqlite3ParseToplevel(pParse); |
148451
|
0 |
22 |
for(i=0; inVtabLock; i++){ |
148452
|
0 |
0 |
if( pTab==pToplevel->apVtabLock[i] ) return; |
148456
|
22 |
0 |
if( apVtabLock ){ |
148485
|
0 |
0 |
if( pMod->pEpoTab ) return 1; |
148486
|
0 |
0 |
if( pModule->xCreate!=0 && pModule->xCreate!=pModule->xConnect ) return 0; |
|
0 |
0 |
if( pModule->xCreate!=0 && pModule->xCreate!=pModule->xConnect ) return 0; |
148488
|
0 |
0 |
if( pTab==0 ) return 0; |
148490
|
0 |
0 |
if( pTab->zName==0 ){ |
148505
|
0 |
0 |
if( rc ){ |
148519
|
0 |
3103 |
if( pTab!=0 ){ |
148564
|
0 |
10 |
if( !p ){ |
148571
|
10 |
0 |
p->pVTable->bConstraint = (u8)va_arg(ap, int); |
148590
|
0 |
10 |
if( rc!=SQLITE_OK ) sqlite3Error(db, rc); |
149284
|
0 |
0 |
if( i==XN_EXPR ) return ""; |
149285
|
0 |
0 |
if( i==XN_ROWID ) return "rowid"; |
149308
|
0 |
0 |
if( bAnd ) sqlite3_str_append(pStr, " AND ", 5); |
149310
|
0 |
0 |
if( nTerm>1 ) sqlite3_str_append(pStr, "(", 1); |
149311
|
0 |
0 |
for(i=0; i
|
149312
|
0 |
0 |
if( i ) sqlite3_str_append(pStr, ",", 1); |
149315
|
0 |
0 |
if( nTerm>1 ) sqlite3_str_append(pStr, ")", 1); |
149319
|
0 |
0 |
if( nTerm>1 ) sqlite3_str_append(pStr, "(", 1); |
149320
|
0 |
0 |
for(i=0; i
|
149321
|
0 |
0 |
if( i ) sqlite3_str_append(pStr, ",", 1); |
149324
|
0 |
0 |
if( nTerm>1 ) sqlite3_str_append(pStr, ")", 1); |
149347
|
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; |
149349
|
0 |
0 |
for(i=0; i
|
149351
|
0 |
0 |
if( i ) sqlite3_str_append(pStr, " AND ", 5); |
149352
|
0 |
0 |
sqlite3_str_appendf(pStr, i>=nSkip ? "%s=?" : "ANY(%s)", z); |
149356
|
0 |
0 |
if( pLoop->wsFlags&WHERE_BTM_LIMIT ){ |
149360
|
0 |
0 |
if( pLoop->wsFlags&WHERE_TOP_LIMIT ){ |
149383
|
0 |
1767 |
if( sqlite3ParseToplevel(pParse)->explain==2 ) |
|
0 |
1767 |
if( sqlite3ParseToplevel(pParse)->explain==2 ) |
149398
|
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; |
149401
|
0 |
0 |
|| ((flags&WHERE_VIRTUALTABLE)==0 && (pLoop->u.btree.nEq>0)) |
|
0 |
0 |
|| ((flags&WHERE_VIRTUALTABLE)==0 && (pLoop->u.btree.nEq>0)) |
149402
|
0 |
0 |
|| (wctrlFlags&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX)); |
|
0 |
0 |
|| (wctrlFlags&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX)); |
149406
|
0 |
0 |
sqlite3_str_appendf(&str, "%s %S", isSearch ? "SEARCH" : "SCAN", pItem); |
149407
|
0 |
0 |
if( (flags & (WHERE_IPK|WHERE_VIRTUALTABLE))==0 ){ |
149414
|
0 |
0 |
if( !HasRowid(pItem->pTab) && IsPrimaryKeyIndex(pIdx) ){ |
|
0 |
0 |
if( !HasRowid(pItem->pTab) && IsPrimaryKeyIndex(pIdx) ){ |
149415
|
0 |
0 |
if( isSearch ){ |
149418
|
0 |
0 |
}else if( flags & WHERE_PARTIALIDX ){ |
149420
|
0 |
0 |
}else if( flags & WHERE_AUTO_INDEX ){ |
149422
|
0 |
0 |
}else if( flags & WHERE_IDX_ONLY ){ |
149427
|
0 |
0 |
if( zFmt ){ |
149432
|
0 |
0 |
}else if( (flags & WHERE_IPK)!=0 && (flags & WHERE_CONSTRAINT)!=0 ){ |
|
0 |
0 |
}else if( (flags & WHERE_IPK)!=0 && (flags & WHERE_CONSTRAINT)!=0 ){ |
149442
|
0 |
0 |
if( flags&(WHERE_COLUMN_EQ|WHERE_COLUMN_IN) ){ |
149444
|
0 |
0 |
}else if( (flags&WHERE_BOTH_LIMIT)==WHERE_BOTH_LIMIT ){ |
149447
|
0 |
0 |
}else if( flags&WHERE_BTM_LIMIT ){ |
149456
|
0 |
0 |
else if( (flags & WHERE_VIRTUALTABLE)!=0 ){ |
149461
|
0 |
0 |
if( pItem->fg.jointype & JT_LEFT ){ |
149509
|
0 |
0 |
if( pLoop->wsFlags & WHERE_IPK ){ |
149511
|
0 |
0 |
if( pTab->iPKey>=0 ){ |
149517
|
0 |
0 |
for(i=pLoop->nSkip; iu.btree.nEq; i++){ |
149519
|
0 |
0 |
if( i>pLoop->nSkip ) sqlite3_str_append(&str, " AND ", 5); |
149606
|
877 |
3 |
while( (pTerm->wtFlags & TERM_CODED)==0 |
149607
|
0 |
877 |
&& (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_OuterON)) |
|
0 |
0 |
&& (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_OuterON)) |
149608
|
877 |
0 |
&& (pLevel->notReady & pTerm->prereqAll)==0 |
149610
|
105 |
772 |
if( nLoop && (pTerm->wtFlags & TERM_LIKE)!=0 ){ |
|
0 |
105 |
if( nLoop && (pTerm->wtFlags & TERM_LIKE)!=0 ){ |
149621
|
751 |
126 |
if( pTerm->iParent<0 ) break; |
149625
|
21 |
105 |
if( pTerm->nChild!=0 ) break; |
149643
|
0 |
62 |
if( zAff==0 ){ |
149653
|
67 |
6 |
while( n>0 && zAff[0]<=SQLITE_AFF_BLOB ){ |
|
11 |
56 |
while( n>0 && zAff[0]<=SQLITE_AFF_BLOB ){ |
149658
|
2 |
62 |
while( n>1 && zAff[n-1]<=SQLITE_AFF_BLOB ){ |
|
2 |
0 |
while( n>1 && zAff[n-1]<=SQLITE_AFF_BLOB ){ |
149663
|
56 |
6 |
if( n>0 ){ |
149684
|
38 |
38 |
for(i=0; i
|
149686
|
38 |
0 |
if( sqlite3CompareAffinity(p, zAff[i])==SQLITE_AFF_BLOB |
149687
|
2 |
36 |
|| sqlite3ExprNeedsNoAffinityChange(p, zAff[i]) |
149733
|
0 |
0 |
if( db->mallocFailed==0 ){ |
149746
|
0 |
0 |
for(i=iEq; inLTerm; i++){ |
149747
|
0 |
0 |
if( pLoop->aLTerm[i]->pExpr==pX ){ |
149751
|
0 |
0 |
if( pOrigRhs->a[iField].pExpr==0 ) continue; /* Duplicate PK column */ |
149763
|
0 |
0 |
if( pLhs && pLhs->nExpr==1 ){ |
|
0 |
0 |
if( pLhs && pLhs->nExpr==1 ){ |
149773
|
0 |
0 |
if( pSelect->pOrderBy ){ |
149782
|
0 |
0 |
for(i=0; inExpr; i++){ |
149827
|
5 |
587 |
if( pX->op==TK_EQ || pX->op==TK_IS ){ |
|
0 |
5 |
if( pX->op==TK_EQ || pX->op==TK_IS ){ |
149829
|
2 |
3 |
}else if( pX->op==TK_ISNULL ){ |
149842
|
0 |
3 |
if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0 |
149843
|
0 |
0 |
&& pLoop->u.btree.pIndex!=0 |
149844
|
0 |
0 |
&& pLoop->u.btree.pIndex->aSortOrder[iEq] |
149853
|
0 |
3 |
for(i=0; i
|
149854
|
0 |
0 |
if( pLoop->aLTerm[i] && pLoop->aLTerm[i]->pExpr==pX ){ |
|
0 |
0 |
if( pLoop->aLTerm[i] && pLoop->aLTerm[i]->pExpr==pX ){ |
149859
|
3 |
3 |
for(i=iEq;inLTerm; i++){ |
149861
|
3 |
0 |
if( pLoop->aLTerm[i]->pExpr==pX ) nEq++; |
149865
|
3 |
0 |
if( !ExprUseXSelect(pX) || pX->x.pSelect->pEList->nExpr==1 ){ |
|
3 |
0 |
if( !ExprUseXSelect(pX) || pX->x.pSelect->pEList->nExpr==1 ){ |
149869
|
0 |
0 |
if( pExpr->iTable==0 || !ExprHasProperty(pExpr, EP_Subrtn) ){ |
|
0 |
0 |
if( pExpr->iTable==0 || !ExprHasProperty(pExpr, EP_Subrtn) ){ |
149872
|
0 |
0 |
if( !db->mallocFailed ){ |
149886
|
0 |
3 |
if( eType==IN_INDEX_INDEX_DESC ){ |
149890
|
0 |
3 |
sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iTab, 0); |
149896
|
3 |
0 |
if( pLevel->u.in.nIn==0 ){ |
149899
|
0 |
3 |
if( iEq>0 && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)==0 ){ |
|
0 |
0 |
if( iEq>0 && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)==0 ){ |
149910
|
3 |
0 |
if( pIn ){ |
149913
|
3 |
3 |
for(i=iEq;inLTerm; i++){ |
149914
|
3 |
0 |
if( pLoop->aLTerm[i]->pExpr==pX ){ |
149916
|
0 |
3 |
if( eType==IN_INDEX_ROWID ){ |
149919
|
0 |
3 |
int iCol = aiMap ? aiMap[iMap++] : 0; |
149923
|
3 |
0 |
if( i==iEq ){ |
149925
|
0 |
3 |
pIn->eEndLoopOp = bRev ? OP_Prev : OP_Next; |
149926
|
0 |
3 |
if( iEq>0 ){ |
149941
|
0 |
3 |
if( iEq>0 |
149942
|
0 |
0 |
&& (pLoop->wsFlags & (WHERE_IN_SEEKSCAN|WHERE_VIRTUALTABLE))==0 |
149962
|
0 |
592 |
if( (pLevel->pWLoop->wsFlags & WHERE_TRANSCONS)==0 |
149963
|
0 |
0 |
|| (pTerm->eOperator & WO_EQUIV)==0 |
150051
|
0 |
44 |
if( nSkip ){ |
150054
|
0 |
0 |
sqlite3VdbeAddOp1(v, (bRev?OP_Last:OP_Rewind), iIdxCur); |
150060
|
0 |
0 |
pLevel->addrSkip = sqlite3VdbeAddOp4Int(v, (bRev?OP_SeekLT:OP_SeekGT), |
150065
|
0 |
0 |
for(j=0; j
|
150075
|
31 |
44 |
for(j=nSkip; j
|
150084
|
0 |
31 |
if( r1!=regBase+j ){ |
150085
|
0 |
0 |
if( nReg==1 ){ |
150093
|
31 |
44 |
for(j=nSkip; j
|
150095
|
0 |
31 |
if( pTerm->eOperator & WO_IN ){ |
150096
|
0 |
0 |
if( pTerm->pExpr->flags & EP_xIsSelect ){ |
150101
|
0 |
0 |
if( zAff ) zAff[j] = SQLITE_AFF_BLOB; |
150103
|
29 |
2 |
}else if( (pTerm->eOperator & WO_ISNULL)==0 ){ |
150105
|
29 |
0 |
if( (pTerm->wtFlags & TERM_IS)==0 && sqlite3ExprCanBeNull(pRight) ){ |
|
23 |
6 |
if( (pTerm->wtFlags & TERM_IS)==0 && sqlite3ExprCanBeNull(pRight) ){ |
150109
|
29 |
0 |
if( pParse->nErr==0 ){ |
150111
|
5 |
24 |
if( sqlite3CompareAffinity(pRight, zAff[j])==SQLITE_AFF_BLOB ){ |
150114
|
11 |
18 |
if( sqlite3ExprNeedsNoAffinityChange(pRight, zAff[j]) ){ |
150147
|
0 |
38 |
if( pTerm->wtFlags & TERM_LIKEOPT ){ |
150416
|
4 |
31 |
if( (pWInfo->wctrlFlags & (WHERE_OR_SUBCLAUSE|WHERE_RIGHT_JOIN)) |
150417
|
0 |
4 |
&& DbMaskAllZero(sqlite3ParseToplevel(pParse)->writeMask) |
|
4 |
0 |
&& DbMaskAllZero(sqlite3ParseToplevel(pParse)->writeMask) |
150422
|
4 |
0 |
if( ai ){ |
150424
|
4 |
4 |
for(i=0; inColumn-1; i++){ |
150430
|
4 |
0 |
if( x1>=0 ) ai[x2+1] = i+1; |
150448
|
172 |
6 |
if( p && sqlite3ExprIsVector(p) ){ |
|
0 |
172 |
if( p && sqlite3ExprIsVector(p) ){ |
150450
|
0 |
0 |
if( ExprUseXSelect(p) ){ |
150464
|
0 |
0 |
for(i=0; i
|
150494
|
0 |
0 |
if( pNew==0 ) return; |
150509
|
0 |
0 |
if( sqlite3ExprCompare(0, pExpr, pX->pIdxExpr, pX->iTabCur)==0 ){ |
150530
|
0 |
0 |
if( pExpr->op==TK_COLUMN ){ |
150532
|
0 |
0 |
if( pExpr->iTable==pX->iTabCur && pExpr->iColumn==pX->iTabCol ){ |
|
0 |
0 |
if( pExpr->iTable==pX->iTabCur && pExpr->iColumn==pX->iTabCol ){ |
150566
|
40 |
0 |
if( aColExpr==0 && !pIdx->bHasVCol ){ |
|
40 |
0 |
if( aColExpr==0 && !pIdx->bHasVCol ){ |
150578
|
0 |
0 |
for(iIdxCol=0; iIdxColnColumn; iIdxCol++){ |
150580
|
0 |
0 |
if( iRef==XN_EXPR ){ |
150583
|
0 |
0 |
if( sqlite3ExprIsConstant(x.pIdxExpr) ) continue; |
150586
|
0 |
0 |
}else if( iRef>=0 |
150587
|
0 |
0 |
&& (pTab->aCol[iRef].colFlags & COLFLAG_VIRTUAL)!=0 |
150588
|
0 |
0 |
&& ((pTab->aCol[iRef].colFlags & COLFLAG_HASCOLL)==0 |
150589
|
0 |
0 |
|| sqlite3StrICmp(sqlite3ColumnColl(&pTab->aCol[iRef]), |
150625
|
0 |
0 |
while( pTruth->op==TK_AND ){ |
150629
|
0 |
0 |
for(i=0, pTerm=pWC->a; inTerm; i++, pTerm++){ |
150631
|
0 |
0 |
if( pTerm->wtFlags & TERM_CODED ) continue; |
150633
|
0 |
0 |
if( sqlite3ExprCompare(0, pExpr, pTruth, iTabCur)==0 ){ |
150661
|
0 |
1 |
while( ++iLevel < pWInfo->nLevel ){ |
150664
|
0 |
0 |
if( pLevel->regFilter==0 ) continue; |
150665
|
0 |
0 |
if( pLevel->pWLoop->nSkip ) continue; |
150668
|
0 |
0 |
if( NEVER(pLoop->prereq & notReady) ) continue; |
150671
|
0 |
0 |
if( pLoop->wsFlags & WHERE_IPK ){ |
150774
|
11 |
1751 |
if( pLevel->iFrom>0 && (pTabItem[0].fg.jointype & JT_LEFT)!=0 ){ |
|
3 |
8 |
if( pLevel->iFrom>0 && (pTabItem[0].fg.jointype & JT_LEFT)!=0 ){ |
150782
|
11 |
1759 |
for(j=iLevel; j>0; j--){ |
150783
|
3 |
8 |
if( pWInfo->a[j].iLeftJoin ) break; |
150784
|
0 |
8 |
if( pWInfo->a[j].pRJ ) break; |
150789
|
22 |
1740 |
if( pTabItem->fg.viaCoroutine ){ |
150799
|
148 |
1592 |
if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)!=0 ){ |
150809
|
143 |
148 |
for(j=0; j
|
150812
|
0 |
143 |
if( NEVER(pTerm==0) ) continue; |
150813
|
3 |
140 |
if( pTerm->eOperator & WO_IN ){ |
150814
|
3 |
0 |
if( SMASKBIT32(j) & pLoop->u.vtab.mHandleIn ){ |
|
0 |
3 |
if( SMASKBIT32(j) & pLoop->u.vtab.mHandleIn ){ |
150826
|
0 |
140 |
if( pTerm->eMatchOp==SQLITE_INDEX_CONSTRAINT_OFFSET |
150827
|
0 |
0 |
&& pLoop->u.vtab.bOmitOffset |
150839
|
82 |
66 |
sqlite3VdbeAddOp4(v, OP_VFilter, iCur, addrNotFound, iReg, |
150846
|
0 |
148 |
if( db->mallocFailed ) pLoop->u.vtab.idxStr = 0; |
150848
|
0 |
148 |
pLevel->op = pWInfo->eOnePass ? OP_Noop : OP_VNext; |
150852
|
143 |
148 |
for(j=0; j
|
150854
|
143 |
0 |
if( j<16 && (pLoop->u.vtab.omitMask>>j)&1 ){ |
|
143 |
0 |
if( j<16 && (pLoop->u.vtab.omitMask>>j)&1 ){ |
150858
|
0 |
0 |
if( (pTerm->eOperator & WO_IN)!=0 |
150859
|
0 |
0 |
&& (SMASKBIT32(j) & pLoop->u.vtab.mHandleIn)==0 |
|
0 |
0 |
&& (SMASKBIT32(j) & pLoop->u.vtab.mHandleIn)==0 |
150860
|
0 |
0 |
&& !db->mallocFailed |
150872
|
0 |
0 |
for(iIn=0; ALWAYS(iInu.in.nIn); iIn++){ |
150874
|
0 |
0 |
if( (pOp->opcode==OP_Column && pOp->p3==iReg+j+2) |
|
0 |
0 |
if( (pOp->opcode==OP_Column && pOp->p3==iReg+j+2) |
150875
|
0 |
0 |
|| (pOp->opcode==OP_Rowid && pOp->p2==iReg+j+2) |
|
0 |
0 |
|| (pOp->opcode==OP_Rowid && pOp->p2==iReg+j+2) |
150887
|
0 |
0 |
if( !db->mallocFailed ){ |
150891
|
0 |
0 |
if( iFld>0 ){ |
150900
|
0 |
0 |
if( pRight ){ |
150922
|
1546 |
46 |
if( (pLoop->wsFlags & WHERE_IPK)!=0 |
150923
|
558 |
988 |
&& (pLoop->wsFlags & (WHERE_COLUMN_IN|WHERE_COLUMN_EQ))!=0 |
150937
|
295 |
263 |
if( iRowidReg!=iReleaseReg ) sqlite3ReleaseTempReg(pParse, iReleaseReg); |
150939
|
0 |
558 |
if( pLevel->regFilter ){ |
150948
|
988 |
46 |
}else if( (pLoop->wsFlags & WHERE_IPK)!=0 |
150949
|
0 |
988 |
&& (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0 |
150960
|
0 |
0 |
if( pLoop->wsFlags & WHERE_BTM_LIMIT ) pStart = pLoop->aLTerm[j++]; |
150961
|
0 |
0 |
if( pLoop->wsFlags & WHERE_TOP_LIMIT ) pEnd = pLoop->aLTerm[j++]; |
150963
|
0 |
0 |
if( bRev ){ |
150969
|
0 |
0 |
if( pStart ){ |
150992
|
0 |
0 |
if( sqlite3ExprIsVector(pX->pRight) ){ |
151017
|
0 |
0 |
sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iCur, addrHalt); |
151021
|
0 |
0 |
if( pEnd ){ |
151030
|
0 |
0 |
if( 0==sqlite3ExprIsVector(pX->pRight) |
151031
|
0 |
0 |
&& (pX->op==TK_LT || pX->op==TK_GT) |
|
0 |
0 |
&& (pX->op==TK_LT || pX->op==TK_GT) |
151033
|
0 |
0 |
testOp = bRev ? OP_Le : OP_Ge; |
151035
|
0 |
0 |
testOp = bRev ? OP_Lt : OP_Gt; |
151037
|
0 |
0 |
if( 0==sqlite3ExprIsVector(pX->pRight) ){ |
151042
|
0 |
0 |
pLevel->op = bRev ? OP_Prev : OP_Next; |
151046
|
0 |
0 |
if( testOp!=OP_Noop ){ |
151056
|
44 |
990 |
}else if( pLoop->wsFlags & WHERE_INDEXED ){ |
151133
|
20 |
24 |
if( pLoop->wsFlags & WHERE_BTM_LIMIT ){ |
151140
|
18 |
26 |
if( pLoop->wsFlags & WHERE_TOP_LIMIT ){ |
151144
|
0 |
18 |
if( (pRangeEnd->wtFlags & TERM_LIKEOPT)!=0 ){ |
151160
|
0 |
18 |
if( pRangeStart==0 ){ |
151162
|
0 |
0 |
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 ){ |
|
0 |
0 |
if( (j>=0 && pIdx->pTable->aCol[j].notNull==0) || j==XN_EXPR ){ |
151176
|
24 |
20 |
if( (pLoop->wsFlags & (WHERE_TOP_LIMIT|WHERE_BTM_LIMIT))==0 |
151177
|
0 |
24 |
&& (pLoop->wsFlags & WHERE_BIGNULL_SORT)!=0 |
151185
|
0 |
0 |
if( pLevel->iLeftJoin ){ |
151195
|
44 |
0 |
if( (nEqnColumn && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC)) ){ |
|
25 |
19 |
if( (nEqnColumn && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC)) ){ |
151201
|
1 |
43 |
if( iLevel>0 && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)!=0 ){ |
|
0 |
1 |
if( iLevel>0 && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)!=0 ){ |
151214
|
44 |
0 |
if( zStartAff && nTop ){ |
|
18 |
26 |
if( zStartAff && nTop ){ |
151217
|
0 |
44 |
addrNxt = (regBignull ? pLevel->addrBignull : pLevel->addrNxt); |
151223
|
20 |
24 |
startEq = !pRangeStart || pRangeStart->eOperator & (WO_LE|WO_GE); |
|
17 |
3 |
startEq = !pRangeStart || pRangeStart->eOperator & (WO_LE|WO_GE); |
151224
|
18 |
26 |
endEq = !pRangeEnd || pRangeEnd->eOperator & (WO_LE|WO_GE); |
|
17 |
1 |
endEq = !pRangeEnd || pRangeEnd->eOperator & (WO_LE|WO_GE); |
151225
|
24 |
20 |
start_constraints = pRangeStart || nEq>0; |
|
24 |
0 |
start_constraints = pRangeStart || nEq>0; |
151229
|
20 |
24 |
if( pRangeStart ){ |
151233
|
19 |
1 |
if( (pRangeStart->wtFlags & TERM_VNULL)==0 |
151234
|
17 |
2 |
&& sqlite3ExprCanBeNull(pRight) |
151239
|
20 |
0 |
if( zStartAff ){ |
151244
|
20 |
0 |
if( sqlite3ExprIsVector(pRight)==0 ){ |
151250
|
0 |
24 |
}else if( bSeekPastNull ){ |
151255
|
0 |
24 |
}else if( regBignull ){ |
151261
|
0 |
44 |
if( pLoop->nSkip>0 && nConstraint==pLoop->nSkip ){ |
|
0 |
0 |
if( pLoop->nSkip>0 && nConstraint==pLoop->nSkip ){ |
151266
|
0 |
44 |
if( regBignull ){ |
151270
|
1 |
43 |
if( pLevel->regFilter ){ |
151279
|
0 |
44 |
if( (pLoop->wsFlags & WHERE_IN_SEEKSCAN)!=0 && op==OP_SeekGE ){ |
|
0 |
0 |
if( (pLoop->wsFlags & WHERE_IN_SEEKSCAN)!=0 && op==OP_SeekGE ){ |
151303
|
0 |
44 |
if( regBignull ){ |
151308
|
0 |
0 |
op = aStartOp[(nConstraint>1)*4 + 2 + bRev]; |
151325
|
18 |
26 |
if( pRangeEnd ){ |
151327
|
0 |
18 |
if( addrSeekScan ){ |
151339
|
18 |
0 |
if( (pRangeEnd->wtFlags & TERM_VNULL)==0 |
151340
|
18 |
0 |
&& sqlite3ExprCanBeNull(pRight) |
151345
|
18 |
0 |
if( zEndAff ){ |
151354
|
18 |
0 |
if( sqlite3ExprIsVector(pRight)==0 ){ |
151359
|
0 |
26 |
}else if( bStopAtNull ){ |
151360
|
0 |
0 |
if( regBignull==0 ){ |
151370
|
44 |
0 |
if( pLevel->p2==0 ) pLevel->p2 = sqlite3VdbeCurrentAddr(v); |
151373
|
44 |
0 |
if( nConstraint ){ |
151374
|
0 |
44 |
if( regBignull ){ |
151386
|
0 |
44 |
if( addrSeekScan ) sqlite3VdbeJumpHere(v, addrSeekScan); |
151388
|
0 |
44 |
if( regBignull ){ |
151406
|
0 |
44 |
if( (pLoop->wsFlags & WHERE_IN_EARLYOUT)!=0 ){ |
151412
|
13 |
31 |
&& (pWInfo->wctrlFlags & (WHERE_OR_SUBCLAUSE|WHERE_RIGHT_JOIN))==0; |
|
9 |
4 |
&& (pWInfo->wctrlFlags & (WHERE_OR_SUBCLAUSE|WHERE_RIGHT_JOIN))==0; |
151413
|
35 |
9 |
if( omitTable ){ |
151415
|
35 |
0 |
}else if( HasRowid(pIdx->pTable) ){ |
151417
|
0 |
0 |
}else if( iCur!=iIdxCur ){ |
151420
|
0 |
0 |
for(j=0; jnKeyCol; j++){ |
151428
|
44 |
0 |
if( pLevel->iLeftJoin==0 ){ |
151446
|
40 |
4 |
if( (pWInfo->wctrlFlags & (WHERE_OR_SUBCLAUSE|WHERE_RIGHT_JOIN))==0 ){ |
151457
|
0 |
44 |
if( pIdx->pPartIdxWhere ){ |
151469
|
6 |
38 |
if( pLoop->wsFlags & WHERE_ONEROW ){ |
151471
|
25 |
13 |
}else if( bRev ){ |
151478
|
0 |
44 |
if( (pLoop->wsFlags & WHERE_CONSTRAINT)==0 ){ |
151483
|
9 |
35 |
if( omitTable ) pIdx = 0; |
151487
|
2 |
988 |
if( pLoop->wsFlags & WHERE_MULTI_OR ){ |
151558
|
0 |
2 |
if( pWInfo->nLevel>1 ){ |
151564
|
0 |
0 |
if( pOrTab==0 ) return notReady; |
151569
|
0 |
0 |
for(k=1; k<=nNotReady; k++){ |
151588
|
2 |
0 |
if( (pWInfo->wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ |
151589
|
2 |
0 |
if( HasRowid(pTab) ){ |
151630
|
1 |
1 |
if( pWC->nTerm>1 ){ |
151632
|
3 |
1 |
for(iTerm=0; iTermnTerm; iTerm++){ |
151634
|
1 |
2 |
if( &pWC->a[iTerm] == pTerm ) continue; |
151638
|
1 |
1 |
if( (pWC->a[iTerm].wtFlags & (TERM_VIRTUAL|TERM_CODED|TERM_SLICE))!=0 ){ |
151641
|
0 |
1 |
if( (pWC->a[iTerm].eOperator & WO_ALL)==0 ) continue; |
151642
|
0 |
1 |
if( ExprHasProperty(pExpr, EP_Subquery) ) continue; /* tag-20220303a */ |
151646
|
1 |
0 |
if( pAndExpr ){ |
151661
|
6 |
2 |
for(ii=0; iinTerm; ii++){ |
151663
|
5 |
1 |
if( pOrTerm->leftCursor==iCur || (pOrTerm->eOperator & WO_AND)!=0 ){ |
|
4 |
1 |
if( pOrTerm->leftCursor==iCur || (pOrTerm->eOperator & WO_AND)!=0 ){ |
151672
|
0 |
5 |
if( db->mallocFailed ){ |
151676
|
2 |
3 |
if( pAndExpr ){ |
151686
|
5 |
0 |
if( pSubWInfo ){ |
151698
|
5 |
0 |
if( (pWInfo->wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ |
151699
|
3 |
2 |
int iSet = ((ii==pOrWc->nTerm-1)?-1:ii); |
151700
|
5 |
0 |
if( HasRowid(pTab) ){ |
151713
|
0 |
0 |
for(iPk=0; iPk
|
151729
|
0 |
0 |
if( iSet ){ |
151733
|
0 |
0 |
if( iSet>=0 ){ |
151737
|
0 |
0 |
if( iSet ) sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT); |
151750
|
5 |
0 |
if( jmp1 ) sqlite3VdbeJumpHere(v, jmp1); |
151757
|
0 |
5 |
if( pSubWInfo->untestedTerms ) untestedTerms = 1; |
151773
|
4 |
1 |
if( (pSubLoop->wsFlags & WHERE_INDEXED)!=0 |
151774
|
3 |
1 |
&& (ii==0 || pSubLoop->u.btree.pIndex==pCov) |
|
1 |
2 |
&& (ii==0 || pSubLoop->u.btree.pIndex==pCov) |
151775
|
0 |
2 |
&& (HasRowid(pTab) || !IsPrimaryKeyIndex(pSubLoop->u.btree.pIndex)) |
|
0 |
0 |
&& (HasRowid(pTab) || !IsPrimaryKeyIndex(pSubLoop->u.btree.pIndex)) |
151782
|
5 |
0 |
if( sqlite3WhereUsesDeferredSeek(pSubWInfo) ){ |
151798
|
0 |
2 |
if( pCov ) pLevel->iIdxCur = iCovCur; |
151799
|
1 |
1 |
if( pAndExpr ){ |
151815
|
0 |
2 |
if( pWInfo->nLevel>1 ){ sqlite3StackFree(db, pOrTab); } |
151816
|
2 |
0 |
if( !untestedTerms ) disableTerm(pLevel, pTerm); |
151827
|
0 |
988 |
if( pTabItem->fg.isRecursive ){ |
151860
|
35 |
1727 |
iLoop = (pIdx ? 1 : 2); |
151863
|
1966 |
1764 |
for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){ |
151868
|
1076 |
890 |
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |
151869
|
14 |
876 |
if( (pTerm->prereqAll & pLevel->notReady)!=0 ){ |
151877
|
5 |
871 |
if( pTabItem->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT) ){ |
151878
|
2 |
3 |
if( !ExprHasProperty(pE,EP_OuterON|EP_InnerON) ){ |
151882
|
3 |
0 |
}else if( (pTabItem->fg.jointype & JT_LEFT)==JT_LEFT |
151883
|
0 |
3 |
&& !ExprHasProperty(pE,EP_OuterON) ){ |
151887
|
0 |
3 |
if( m & pLevel->notReady ){ |
151893
|
0 |
874 |
if( iLoop==1 && !sqlite3ExprCoveredByIndex(pE, pLevel->iTabCur, pIdx) ){ |
|
0 |
0 |
if( iLoop==1 && !sqlite3ExprCoveredByIndex(pE, pLevel->iTabCur, pIdx) ){ |
151897
|
872 |
2 |
if( iLoop<3 && (pTerm->wtFlags & TERM_VARSELECT) ){ |
|
2 |
870 |
if( iLoop<3 && (pTerm->wtFlags & TERM_VARSELECT) ){ |
151898
|
2 |
0 |
if( iNext==0 ) iNext = 3; |
151902
|
0 |
872 |
if( (pTerm->wtFlags & TERM_LIKECOND)!=0 ){ |
151912
|
0 |
0 |
if( x>0 ){ |
151913
|
0 |
0 |
skipLikeAddr = sqlite3VdbeAddOp1(v, (x&1)?OP_IfNot:OP_If,(int)(x>>1)); |
151930
|
0 |
872 |
if( skipLikeAddr ) sqlite3VdbeJumpHere(v, skipLikeAddr); |
151934
|
2 |
1762 |
}while( iLoop>0 ); |
151944
|
1660 |
1762 |
for(pTerm=pWC->a, j=pWC->nBase; j>0; j--, pTerm++){ |
151947
|
1644 |
16 |
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |
151948
|
3 |
13 |
if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) continue; |
151949
|
6 |
7 |
if( (pTerm->eOperator & WO_EQUIV)==0 ) continue; |
151950
|
2 |
5 |
if( pTerm->leftCursor!=iCur ) continue; |
151951
|
0 |
5 |
if( pTabItem->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT) ) continue; |
151964
|
5 |
0 |
if( pAlt==0 ) continue; |
151965
|
0 |
0 |
if( pAlt->wtFlags & (TERM_CODED) ) continue; |
151966
|
0 |
0 |
if( (pAlt->eOperator & WO_IN) |
151967
|
0 |
0 |
&& ExprUseXSelect(pAlt->pExpr) |
151968
|
0 |
0 |
&& (pAlt->pExpr->x.pSelect->pEList->nExpr>1) |
151985
|
0 |
1762 |
if( pLevel->pRJ ){ |
151998
|
0 |
0 |
if( HasRowid(pTab) ){ |
152007
|
0 |
0 |
for(iPk=0; iPk
|
152026
|
3 |
1759 |
if( pLevel->iLeftJoin ){ |
152030
|
3 |
0 |
if( pLevel->pRJ==0 ){ |
152035
|
0 |
1759 |
if( pLevel->pRJ ){ |
152054
|
6 |
3 |
for(pTerm=pWC->a, j=0; jnBase; j++, pTerm++){ |
152057
|
4 |
2 |
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; |
152058
|
0 |
2 |
if( (pTerm->prereqAll & pLevel->notReady)!=0 ){ |
152062
|
0 |
2 |
if( pTabItem->fg.jointype & JT_LTORJ ) continue; |
152107
|
0 |
0 |
for(k=0; k
|
152112
|
0 |
0 |
if( iIdxCur ){ |
152116
|
0 |
0 |
if( (pTabItem->fg.jointype & JT_LTORJ)==0 ){ |
152118
|
0 |
0 |
for(k=0; knTerm; k++){ |
152120
|
0 |
0 |
if( (pTerm->wtFlags & (TERM_VIRTUAL|TERM_SLICE))!=0 |
152121
|
0 |
0 |
&& pTerm->eOperator!=WO_ROWVAL |
152125
|
0 |
0 |
if( pTerm->prereqAll & ~mAll ) continue; |
152126
|
0 |
0 |
if( ExprHasProperty(pTerm->pExpr, EP_OuterON|EP_InnerON) ) continue; |
152139
|
0 |
0 |
if( pSubWInfo ){ |
152146
|
0 |
0 |
if( HasRowid(pTab) ){ |
152154
|
0 |
0 |
for(iPk=0; iPk
|
152238
|
0 |
2111 |
if( pWC->nTerm>=pWC->nSlot ){ |
152242
|
0 |
0 |
if( pWC->a==0 ){ |
152243
|
0 |
0 |
if( wtFlags & TERM_DYNAMIC ){ |
152253
|
1719 |
392 |
if( (wtFlags & TERM_VIRTUAL)==0 ) pWC->nBase = pWC->nTerm; |
152254
|
2111 |
0 |
if( p && ExprHasProperty(p, EP_Unlikely) ){ |
|
0 |
2111 |
if( p && ExprHasProperty(p, EP_Unlikely) ){ |
152278
|
2000 |
19 |
return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS; |
|
1663 |
337 |
return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS; |
|
226 |
1437 |
return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS; |
|
533 |
30 |
return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS; |
|
2 |
531 |
return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS; |
152286
|
19 |
0 |
if( pExpr->pLeft->op==TK_VECTOR |
152287
|
19 |
0 |
|| pExpr->pRight->op==TK_VECTOR |
152288
|
0 |
19 |
|| sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, pExpr->pRight) != |
152294
|
8 |
11 |
if( pExpr->op>=TK_GT ){ |
152311
|
19 |
1349 |
if( op==TK_IN ){ |
152313
|
22 |
1327 |
}else if( op==TK_ISNULL ){ |
152315
|
2 |
1325 |
}else if( op==TK_IS ){ |
152364
|
99 |
119 |
if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, (char*)wc) ){ |
152376
|
0 |
119 |
if( op==TK_VARIABLE && (db->flags & SQLITE_EnableQPSG)==0 ){ |
|
0 |
0 |
if( op==TK_VARIABLE && (db->flags & SQLITE_EnableQPSG)==0 ){ |
152380
|
0 |
0 |
if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){ |
|
0 |
0 |
if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){ |
152385
|
119 |
0 |
}else if( op==TK_STRING ){ |
152389
|
119 |
0 |
if( z ){ |
152393
|
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] ){ |
152395
|
0 |
366 |
if( c==wc[3] && z[cnt]!=0 ) cnt++; |
|
0 |
0 |
if( c==wc[3] && z[cnt]!=0 ) cnt++; |
152406
|
117 |
2 |
if( cnt!=0 && 255!=(u8)z[cnt-1] && (cnt>1 || z[0]!=wc[3]) ){ |
|
117 |
0 |
if( cnt!=0 && 255!=(u8)z[cnt-1] && (cnt>1 || z[0]!=wc[3]) ){ |
|
6 |
111 |
if( cnt!=0 && 255!=(u8)z[cnt-1] && (cnt>1 || z[0]!=wc[3]) ){ |
|
6 |
0 |
if( cnt!=0 && 255!=(u8)z[cnt-1] && (cnt>1 || z[0]!=wc[3]) ){ |
152410
|
6 |
111 |
*pisComplete = c==wc[0] && z[cnt+1]==0; |
|
6 |
0 |
*pisComplete = c==wc[0] && z[cnt+1]==0; |
152414
|
117 |
0 |
if( pPrefix ){ |
152420
|
366 |
117 |
for(iFrom=iTo=0; iFrom
|
152421
|
0 |
366 |
if( zNew[iFrom]==wc[3] ) iFrom++; |
152440
|
66 |
51 |
if( pLeft->op!=TK_COLUMN |
152441
|
63 |
3 |
|| sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT |
152442
|
63 |
0 |
|| (ALWAYS( ExprUseYTab(pLeft) ) |
152443
|
63 |
0 |
&& pLeft->y.pTab |
152444
|
0 |
63 |
&& IsVirtual(pLeft->y.pTab)) /* Might be numeric */ |
152449
|
54 |
0 |
if( isNum<=0 ){ |
152450
|
2 |
52 |
if( iTo==1 && zNew[0]=='-' ){ |
|
0 |
2 |
if( iTo==1 && zNew[0]=='-' ){ |
152458
|
0 |
54 |
if( isNum>0 ){ |
152469
|
0 |
117 |
if( op==TK_VARIABLE ){ |
152473
|
0 |
0 |
if( *pisComplete && pRight->u.zToken[1] ){ |
|
0 |
0 |
if( *pisComplete && pRight->u.zToken[1] ){ |
152532
|
218 |
1759 |
if( pExpr->op==TK_FUNCTION ){ |
152548
|
218 |
0 |
if( pList==0 || pList->nExpr!=2 ){ |
|
0 |
218 |
if( pList==0 || pList->nExpr!=2 ){ |
152562
|
167 |
51 |
if( ExprIsVtab(pCol) ){ |
|
167 |
0 |
if( ExprIsVtab(pCol) ){ |
|
85 |
82 |
if( ExprIsVtab(pCol) ){ |
152563
|
92 |
0 |
for(i=0; i
|
152565
|
85 |
7 |
if( sqlite3StrICmp(pExpr->u.zToken, aOp[i].zOp)==0 ){ |
152587
|
0 |
133 |
if( ExprIsVtab(pCol) ){ |
|
0 |
0 |
if( ExprIsVtab(pCol) ){ |
|
0 |
0 |
if( ExprIsVtab(pCol) ){ |
152597
|
0 |
0 |
if( pMod->xFindFunction!=0 ){ |
152599
|
0 |
0 |
if( i>=SQLITE_INDEX_CONSTRAINT_FUNCTION ){ |
152607
|
1520 |
239 |
}else if( pExpr->op==TK_NE || pExpr->op==TK_ISNOT || pExpr->op==TK_NOTNULL ){ |
|
1517 |
3 |
}else if( pExpr->op==TK_NE || pExpr->op==TK_ISNOT || pExpr->op==TK_NOTNULL ){ |
|
14 |
1503 |
}else if( pExpr->op==TK_NE || pExpr->op==TK_ISNOT || pExpr->op==TK_NOTNULL ){ |
152613
|
256 |
0 |
if( ExprIsVtab(pLeft) ){ |
|
256 |
0 |
if( ExprIsVtab(pLeft) ){ |
|
4 |
252 |
if( ExprIsVtab(pLeft) ){ |
152618
|
242 |
14 |
if( pRight && ExprIsVtab(pRight) ){ |
|
0 |
242 |
if( pRight && ExprIsVtab(pRight) ){ |
|
0 |
0 |
if( pRight && ExprIsVtab(pRight) ){ |
|
0 |
0 |
if( pRight && ExprIsVtab(pRight) ){ |
152624
|
239 |
17 |
if( pExpr->op==TK_NE ) *peOp2 = SQLITE_INDEX_CONSTRAINT_NE; |
152625
|
3 |
253 |
if( pExpr->op==TK_ISNOT ) *peOp2 = SQLITE_INDEX_CONSTRAINT_ISNOT; |
152626
|
14 |
242 |
if( pExpr->op==TK_NOTNULL ) *peOp2 = SQLITE_INDEX_CONSTRAINT_ISNOTNULL; |
152638
|
270 |
0 |
if( pDerived && ExprHasProperty(pBase, EP_OuterON|EP_InnerON) ){ |
|
0 |
270 |
if( pDerived && ExprHasProperty(pBase, EP_OuterON|EP_InnerON) ){ |
152659
|
0 |
0 |
if( pTerm->eOperator!=WO_AND ){ |
152660
|
0 |
0 |
return N==0 ? pTerm : 0; |
152662
|
0 |
0 |
if( Nu.pAndInfo->wc.nTerm ){ |
152700
|
0 |
0 |
if( (pOne->wtFlags | pTwo->wtFlags) & TERM_VNULL ) return; |
152701
|
0 |
0 |
if( (pOne->eOperator & (WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE))==0 ) return; |
152702
|
0 |
0 |
if( (pTwo->eOperator & (WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE))==0 ) return; |
152703
|
0 |
0 |
if( (eOp & (WO_EQ|WO_LT|WO_LE))!=eOp |
152704
|
0 |
0 |
&& (eOp & (WO_EQ|WO_GT|WO_GE))!=eOp ) return; |
152707
|
0 |
0 |
if( sqlite3ExprCompare(0,pOne->pExpr->pLeft, pTwo->pExpr->pLeft, -1) ) return; |
152708
|
0 |
0 |
if( sqlite3ExprCompare(0,pOne->pExpr->pRight, pTwo->pExpr->pRight,-1) )return; |
152710
|
0 |
0 |
if( (eOp & (eOp-1))!=0 ){ |
152711
|
0 |
0 |
if( eOp & (WO_LT|WO_LE) ){ |
152720
|
0 |
0 |
if( pNew==0 ) return; |
152721
|
0 |
0 |
for(op=TK_EQ; eOp!=(WO_EQ<<(op-TK_EQ)); op++){ assert( op
|
152840
|
0 |
5 |
if( pOrInfo==0 ) return; |
152847
|
0 |
5 |
if( db->mallocFailed ) return; |
152855
|
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++){ |
152856
|
9 |
6 |
if( (pOrTerm->eOperator & WO_SINGLE)==0 ){ |
152861
|
9 |
0 |
if( pAndInfo ){ |
152876
|
9 |
0 |
if( !db->mallocFailed ){ |
152877
|
30 |
9 |
for(j=0, pAndTerm=pAndWC->a; jnTerm; j++, pAndTerm++){ |
152879
|
8 |
22 |
if( allowedOp(pAndTerm->pExpr->op) |
152880
|
0 |
8 |
|| pAndTerm->eOperator==WO_AUX |
152888
|
3 |
3 |
}else if( pOrTerm->wtFlags & TERM_COPIED ){ |
152894
|
3 |
0 |
if( pOrTerm->wtFlags & TERM_VIRTUAL ){ |
152899
|
0 |
3 |
if( (pOrTerm->eOperator & WO_EQ)==0 ){ |
152914
|
5 |
0 |
if( indexable ){ |
152920
|
5 |
0 |
if( indexable && pOrWc->nTerm==2 ){ |
|
0 |
5 |
if( indexable && pOrWc->nTerm==2 ){ |
152923
|
0 |
0 |
while( (pOne = whereNthSubterm(&pOrWc->a[0],iOne++))!=0 ){ |
152926
|
0 |
0 |
while( (pTwo = whereNthSubterm(&pOrWc->a[1],iTwo++))!=0 ){ |
152953
|
0 |
5 |
if( chngToIN ){ |
152965
|
0 |
0 |
for(j=0; j<2 && !okToChngToIN; j++){ |
|
0 |
0 |
for(j=0; j<2 && !okToChngToIN; j++){ |
152968
|
0 |
0 |
for(i=pOrWc->nTerm-1; i>=0; i--, pOrTerm++){ |
152971
|
0 |
0 |
if( pOrTerm->leftCursor==iCursor ){ |
152977
|
0 |
0 |
if( (chngToIN & sqlite3WhereGetMask(&pWInfo->sMaskSet, |
152994
|
0 |
0 |
if( i<0 ){ |
153007
|
0 |
0 |
for(; i>=0 && okToChngToIN; i--, pOrTerm++){ |
|
0 |
0 |
for(; i>=0 && okToChngToIN; i--, pOrTerm++){ |
153010
|
0 |
0 |
if( pOrTerm->leftCursor!=iCursor ){ |
153012
|
0 |
0 |
}else if( pOrTerm->u.x.leftColumn!=iColumn || (iColumn==XN_EXPR |
|
0 |
0 |
}else if( pOrTerm->u.x.leftColumn!=iColumn || (iColumn==XN_EXPR |
153013
|
0 |
0 |
&& sqlite3ExprCompare(pParse, pOrTerm->pExpr->pLeft, pLeft, -1) |
153024
|
0 |
0 |
if( affRight!=0 && affRight!=affLeft ){ |
|
0 |
0 |
if( affRight!=0 && affRight!=affLeft ){ |
153037
|
0 |
0 |
if( okToChngToIN ){ |
153043
|
0 |
0 |
for(i=pOrWc->nTerm-1, pOrTerm=pOrWc->a; i>=0; i--, pOrTerm++){ |
153044
|
0 |
0 |
if( (pOrTerm->wtFlags & TERM_OK)==0 ) continue; |
153056
|
0 |
0 |
if( pNew ){ |
153092
|
0 |
19 |
if( !OptimizationEnabled(pParse->db, SQLITE_Transitive) ) return 0; |
153093
|
8 |
11 |
if( pExpr->op!=TK_EQ && pExpr->op!=TK_IS ) return 0; |
|
8 |
0 |
if( pExpr->op!=TK_EQ && pExpr->op!=TK_IS ) return 0; |
153094
|
0 |
11 |
if( ExprHasProperty(pExpr, EP_OuterON) ) return 0; |
153097
|
0 |
11 |
if( aff1!=aff2 |
153098
|
0 |
0 |
&& (!sqlite3IsNumericAffinity(aff1) || !sqlite3IsNumericAffinity(aff2)) |
|
0 |
0 |
&& (!sqlite3IsNumericAffinity(aff1) || !sqlite3IsNumericAffinity(aff2)) |
153103
|
11 |
0 |
if( sqlite3IsBinary(pColl) ) return 1; |
153114
|
5 |
10 |
while( pS ){ |
153121
|
5 |
0 |
if( ALWAYS(pSrc!=0) ){ |
153123
|
5 |
5 |
for(i=0; inSrc; i++){ |
153125
|
5 |
0 |
if( pSrc->a[i].fg.isUsing==0 ){ |
153128
|
0 |
5 |
if( pSrc->a[i].fg.isTabFunc ){ |
153160
|
4 |
16 |
for(i=0; mPrereq>1; i++, mPrereq>>=1){} |
153162
|
9 |
16 |
for(pIdx=pFrom->a[i].pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
153163
|
9 |
0 |
if( pIdx->aColExpr==0 ) continue; |
153164
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
153165
|
0 |
0 |
if( pIdx->aiColumn[i]!=XN_EXPR ) continue; |
153166
|
0 |
0 |
if( sqlite3ExprCompareSkip(pExpr, pIdx->aColExpr->a[i].pExpr, iCur)==0 ){ |
153188
|
0 |
2891 |
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)) ){ |
153194
|
1368 |
1523 |
if( pExpr->op==TK_COLUMN ){ |
153199
|
1507 |
16 |
if( mPrereq==0 ) return 0; /* No table references */ |
153200
|
0 |
16 |
if( (mPrereq&(mPrereq-1))!=0 ) return 0; /* Refs more than one table */ |
153244
|
0 |
1989 |
if( db->mallocFailed ){ |
153256
|
19 |
1970 |
if( op==TK_IN ){ |
153258
|
0 |
19 |
if( sqlite3ExprCheckIN(pParse, pExpr) ) return; |
153259
|
3 |
16 |
if( ExprUseXSelect(pExpr) ){ |
153267
|
1747 |
223 |
if( pExpr->pLeft==0 |
153268
|
1747 |
0 |
|| ExprHasProperty(pExpr, EP_xIsSelect|EP_IfNullRow) |
153269
|
18 |
1729 |
|| pExpr->x.pList!=0 |
153276
|
2 |
1987 |
if( pMaskSet->bVarSelect ) pTerm->wtFlags |= TERM_VARSELECT; |
153286
|
8 |
1981 |
if( ExprHasProperty(pExpr, EP_OuterON|EP_InnerON) ){ |
153288
|
3 |
5 |
if( ExprHasProperty(pExpr, EP_OuterON) ){ |
153292
|
0 |
3 |
if( (prereqAll>>1)>=x ){ |
153296
|
0 |
5 |
}else if( (prereqAll>>1)>=x ){ |
153303
|
0 |
0 |
if( ALWAYS(pSrc->nSrc>0) && (pSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){ |
|
0 |
0 |
if( ALWAYS(pSrc->nSrc>0) && (pSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){ |
153314
|
1466 |
523 |
if( allowedOp(op) ){ |
153318
|
1466 |
0 |
u16 opMask = (pTerm->prereqRight & prereqLeft)==0 ? WO_ALL : WO_EQUIV; |
153320
|
0 |
1466 |
if( pTerm->u.x.iField>0 ){ |
153327
|
1349 |
117 |
if( exprMightBeIndexed(pSrc, prereqLeft, aiCurCol, pLeft, op) ){ |
153333
|
2 |
1464 |
if( op==TK_IS ) pTerm->wtFlags |= TERM_IS; |
153334
|
1425 |
41 |
if( pRight |
153335
|
19 |
1406 |
&& exprMightBeIndexed(pSrc, pTerm->prereqRight, aiCurCol, pRight, op) |
153336
|
19 |
0 |
&& !ExprHasProperty(pRight, EP_FixedCol) |
153342
|
19 |
0 |
if( pTerm->leftCursor>=0 ){ |
153345
|
0 |
19 |
if( db->mallocFailed ){ |
153350
|
0 |
19 |
if( idxNew==0 ) return; |
153353
|
0 |
19 |
if( op==TK_IS ) pNew->wtFlags |= TERM_IS; |
153357
|
11 |
8 |
if( termIsEquivalence(pParse, pDup) ){ |
153374
|
22 |
1425 |
if( op==TK_ISNULL |
153375
|
22 |
0 |
&& !ExprHasProperty(pExpr,EP_OuterON) |
153376
|
0 |
22 |
&& 0==sqlite3ExprCanBeNull(pLeft) |
153403
|
18 |
505 |
else if( pExpr->op==TK_BETWEEN && pWC->op==TK_AND ){ |
|
18 |
0 |
else if( pExpr->op==TK_BETWEEN && pWC->op==TK_AND ){ |
153411
|
36 |
18 |
for(i=0; i<2; i++){ |
153431
|
5 |
500 |
else if( pExpr->op==TK_OR ){ |
153443
|
14 |
486 |
else if( pExpr->op==TK_NOTNULL ){ |
153444
|
14 |
0 |
if( pExpr->pLeft->op==TK_COLUMN |
153445
|
14 |
0 |
&& pExpr->pLeft->iColumn>=0 |
153446
|
14 |
0 |
&& !ExprHasProperty(pExpr, EP_OuterON) |
153459
|
14 |
0 |
if( idxNew ){ |
153488
|
218 |
268 |
else if( pExpr->op==TK_FUNCTION |
153489
|
218 |
0 |
&& pWC->op==TK_AND |
153490
|
117 |
101 |
&& isLikeOrGlob(pParse, pExpr, &pStr1, &isComplete, &noCase) |
153512
|
117 |
0 |
if( noCase && !pParse->db->mallocFailed ){ |
|
117 |
0 |
if( noCase && !pParse->db->mallocFailed ){ |
153516
|
366 |
117 |
for(i=0; (c = pStr1->u.zToken[i])!=0; i++){ |
153522
|
117 |
0 |
if( !db->mallocFailed ){ |
153526
|
117 |
0 |
if( noCase ){ |
153533
|
0 |
117 |
if( c=='A'-1 ) isComplete = 0; |
153538
|
117 |
0 |
zCollSeqName = noCase ? "NOCASE" : sqlite3StrBINARY; |
153556
|
6 |
111 |
if( isComplete ){ |
153573
|
887 |
1102 |
if( (pExpr->op==TK_EQ || pExpr->op==TK_IS) |
|
2 |
885 |
if( (pExpr->op==TK_EQ || pExpr->op==TK_IS) |
153574
|
0 |
1104 |
&& (nLeft = sqlite3ExprVectorSize(pExpr->pLeft))>1 |
153575
|
0 |
0 |
&& sqlite3ExprVectorSize(pExpr->pRight)==nLeft |
153576
|
0 |
0 |
&& ( (pExpr->pLeft->flags & EP_xIsSelect)==0 |
153577
|
0 |
0 |
|| (pExpr->pRight->flags & EP_xIsSelect)==0) |
153578
|
0 |
0 |
&& pWC->op==TK_AND |
153581
|
0 |
0 |
for(i=0; i
|
153606
|
19 |
1970 |
else if( pExpr->op==TK_IN |
153607
|
19 |
0 |
&& pTerm->u.x.iField==0 |
153608
|
0 |
19 |
&& pExpr->pLeft->op==TK_VECTOR |
153609
|
0 |
0 |
&& ALWAYS( ExprUseXSelect(pExpr) ) |
153610
|
0 |
0 |
&& pExpr->x.pSelect->pPrior==0 |
153612
|
0 |
0 |
&& pExpr->x.pSelect->pWin==0 |
153614
|
0 |
0 |
&& pWC->op==TK_AND |
153617
|
0 |
0 |
for(i=0; ipLeft); i++){ |
153636
|
1977 |
12 |
else if( pWC->op==TK_AND ){ |
153639
|
89 |
1977 |
while( res-- > 0 ){ |
153646
|
89 |
0 |
if( (prereqExpr & prereqColumn)==0 ){ |
153650
|
0 |
89 |
if( ExprHasProperty(pExpr, EP_OuterON) && pNewExpr ){ |
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_OuterON) && pNewExpr ){ |
153706
|
932 |
2095 |
if( pE2==0 ) return; |
153707
|
1719 |
376 |
if( pE2->op!=op ){ |
153738
|
0 |
0 |
if( sqlite3ExprIsInteger(pExpr, &iVal) && iVal>=0 ){ |
|
0 |
0 |
if( sqlite3ExprIsInteger(pExpr, &iVal) && iVal>=0 ){ |
153740
|
0 |
0 |
if( pVal==0 ) return; |
153746
|
0 |
0 |
if( pVal==0 ) return; |
153750
|
0 |
0 |
if( pNew ){ |
153781
|
1778 |
483 |
if( (p && p->pLimit) /* 1 */ |
|
1 |
1777 |
if( (p && p->pLimit) /* 1 */ |
153782
|
1 |
0 |
&& (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */ |
153783
|
1 |
0 |
&& (p->pSrc->nSrc==1 && IsVirtual(p->pSrc->a[0].pTab)) /* 3 */ |
|
0 |
1 |
&& (p->pSrc->nSrc==1 && IsVirtual(p->pSrc->a[0].pTab)) /* 3 */ |
153790
|
0 |
0 |
for(ii=0; iinTerm; ii++){ |
153791
|
0 |
0 |
if( pWC->a[ii].wtFlags & TERM_CODED ){ |
153798
|
0 |
0 |
if( pWC->a[ii].leftCursor!=iCsr ) return; |
153802
|
0 |
0 |
if( pOrderBy ){ |
153803
|
0 |
0 |
for(ii=0; iinExpr; ii++){ |
153805
|
0 |
0 |
if( pExpr->op!=TK_COLUMN ) return; |
153806
|
0 |
0 |
if( pExpr->iTable!=iCsr ) return; |
153807
|
0 |
0 |
if( pOrderBy->a[ii].fg.sortFlags & KEYINFO_ORDER_BIGNULL ) return; |
153815
|
0 |
0 |
if( p->iOffset>0 ){ |
153846
|
1343 |
932 |
if( pWC->nTerm>0 ){ |
153858
|
392 |
1719 |
if( a->wtFlags & TERM_DYNAMIC ){ |
153861
|
14 |
2097 |
if( a->wtFlags & (TERM_ORINFO|TERM_ANDINFO) ){ |
153862
|
5 |
9 |
if( a->wtFlags & TERM_ORINFO ){ |
153870
|
1343 |
768 |
if( a==aLast ) break; |
153913
|
0 |
1339 |
mask = (p->op==TK_IF_NULL_ROW) ? sqlite3WhereGetMask(pMaskSet, p->iTable) : 0; |
153914
|
556 |
783 |
if( p->pLeft ) mask |= sqlite3WhereExprUsageNN(pMaskSet, p->pLeft); |
153915
|
66 |
1273 |
if( p->pRight ){ |
153918
|
2 |
1271 |
}else if( ExprUseXSelect(p) ){ |
153919
|
2 |
0 |
if( ExprHasProperty(p, EP_VarSelect) ) pMaskSet->bVarSelect = 1; |
153921
|
258 |
1013 |
}else if( p->x.pList ){ |
153925
|
1099 |
240 |
if( (p->op==TK_FUNCTION || p->op==TK_AGG_FUNCTION) && ExprUseYWin(p) ){ |
|
2 |
1097 |
if( (p->op==TK_FUNCTION || p->op==TK_AGG_FUNCTION) && ExprUseYWin(p) ){ |
|
0 |
242 |
if( (p->op==TK_FUNCTION || p->op==TK_AGG_FUNCTION) && ExprUseYWin(p) ){ |
153935
|
2064 |
2995 |
if( p->op==TK_COLUMN && !ExprHasProperty(p, EP_FixedCol) ){ |
|
2064 |
0 |
if( p->op==TK_COLUMN && !ExprHasProperty(p, EP_FixedCol) ){ |
153937
|
1656 |
1339 |
}else if( ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){ |
153944
|
4196 |
527 |
return p ? sqlite3WhereExprUsageNN(pMaskSet,p) : 0; |
153949
|
297 |
10 |
if( pList ){ |
153950
|
569 |
297 |
for(i=0; inExpr; i++){ |
153971
|
1719 |
2275 |
for(i=pWC->nTerm-1; i>=0; i--){ |
153993
|
1762 |
0 |
if( pItem->fg.isTabFunc==0 ) return; |
153997
|
0 |
0 |
if( pArgs==0 ) return; |
153998
|
0 |
0 |
for(j=k=0; jnExpr; j++){ |
154001
|
0 |
0 |
while( knCol && (pTab->aCol[k].colFlags & COLFLAG_HIDDEN)==0 ){k++;} |
|
0 |
0 |
while( knCol && (pTab->aCol[k].colFlags & COLFLAG_HIDDEN)==0 ){k++;} |
154002
|
0 |
0 |
if( k>=pTab->nCol ){ |
154008
|
0 |
0 |
if( pColRef==0 ) return; |
154017
|
0 |
0 |
if( pItem->fg.jointype & (JT_LEFT|JT_LTORJ) ){ |
154126
|
606 |
0 |
if( !pWInfo->bOrderedInnerLoop ){ |
154133
|
0 |
0 |
return pInner->pRJ ? pWInfo->iContinue : pInner->addrNxt; |
154150
|
0 |
16 |
if( !pWInfo->bOrderedInnerLoop ) return; |
154151
|
0 |
16 |
if( pWInfo->nOBSat==0 ) return; |
154152
|
16 |
16 |
for(i=pWInfo->nLevel-1; i>=0; i--){ |
154154
|
0 |
16 |
if( (pInner->pWLoop->wsFlags & WHERE_COLUMN_IN)!=0 ){ |
154239
|
11 |
11 |
for(i=pSet->n, p=pSet->a; i>0; i--, p++){ |
154240
|
10 |
1 |
if( rRun<=p->rRun && (prereq & p->prereq)==prereq ){ |
|
10 |
0 |
if( rRun<=p->rRun && (prereq & p->prereq)==prereq ){ |
154243
|
1 |
0 |
if( p->rRun<=rRun && (p->prereq & prereq)==p->prereq ){ |
|
1 |
0 |
if( p->rRun<=rRun && (p->prereq & prereq)==p->prereq ){ |
154247
|
11 |
0 |
if( pSet->n
|
154252
|
0 |
0 |
for(i=1; in; i++){ |
154253
|
0 |
0 |
if( p->rRun>pSet->a[i].rRun ) p = pSet->a + i; |
154255
|
0 |
0 |
if( p->rRun<=rRun ) return 0; |
154260
|
10 |
11 |
if( p->nOut>nOut ) p->nOut = nOut; |
154273
|
4923 |
146 |
if( pMaskSet->ix[0]==iCursor ){ |
154276
|
61 |
85 |
for(i=1; in; i++){ |
154277
|
61 |
0 |
if( pMaskSet->ix[i]==iCursor ){ |
154289
|
3 |
0 |
if( pBlock ){ |
154299
|
3 |
0 |
if( pNew && pOld ){ |
|
0 |
3 |
if( pNew && pOld ){ |
154327
|
24 |
0 |
if( ALWAYS(p!=0) && p->op==TK_COLUMN && !ExprHasProperty(p, EP_FixedCol) ){ |
|
24 |
0 |
if( ALWAYS(p!=0) && p->op==TK_COLUMN && !ExprHasProperty(p, EP_FixedCol) ){ |
|
24 |
0 |
if( ALWAYS(p!=0) && p->op==TK_COLUMN && !ExprHasProperty(p, EP_FixedCol) ){ |
154354
|
5324 |
3849 |
for(pTerm=pWC->a+k; knTerm; k++, pTerm++){ |
154356
|
3508 |
1816 |
if( pTerm->leftCursor==iCur |
154357
|
1000 |
2508 |
&& pTerm->u.x.leftColumn==iColumn |
154358
|
0 |
1000 |
&& (iColumn!=XN_EXPR |
154359
|
0 |
0 |
|| sqlite3ExprCompareSkip(pTerm->pExpr->pLeft, |
154361
|
11 |
989 |
&& (pScan->iEquiv<=1 || !ExprHasProperty(pTerm->pExpr, EP_OuterON)) |
|
11 |
0 |
&& (pScan->iEquiv<=1 || !ExprHasProperty(pTerm->pExpr, EP_OuterON)) |
154363
|
24 |
976 |
if( (pTerm->eOperator & WO_EQUIV)!=0 |
154364
|
24 |
0 |
&& pScan->nEquivaiCur) |
154365
|
24 |
0 |
&& (pX = whereRightSubexprIsColumn(pTerm->pExpr))!=0 |
154368
|
24 |
13 |
for(j=0; jnEquiv; j++){ |
154369
|
11 |
13 |
if( pScan->aiCur[j]==pX->iTable |
154370
|
11 |
0 |
&& pScan->aiColumn[j]==pX->iColumn ){ |
154374
|
13 |
11 |
if( j==pScan->nEquiv ){ |
154380
|
705 |
295 |
if( (pTerm->eOperator & pScan->opMask)!=0 ){ |
154382
|
109 |
596 |
if( pScan->zCollName && (pTerm->eOperator & WO_ISNULL)==0 ){ |
|
104 |
5 |
if( pScan->zCollName && (pTerm->eOperator & WO_ISNULL)==0 ){ |
154386
|
0 |
104 |
if( !sqlite3IndexAffinityOk(pX, pScan->idxaff) ){ |
154391
|
0 |
104 |
if( pColl==0 ) pColl = pParse->db->pDfltColl; |
154392
|
0 |
104 |
if( sqlite3StrICmp(pColl->zName, pScan->zCollName) ){ |
154396
|
629 |
76 |
if( (pTerm->eOperator & (WO_EQ|WO_IS))!=0 |
154397
|
629 |
0 |
&& (pX = pTerm->pExpr->pRight, ALWAYS(pX!=0)) |
154398
|
24 |
605 |
&& pX->op==TK_COLUMN |
154399
|
11 |
13 |
&& pX->iTable==pScan->aiCur[0] |
154400
|
11 |
0 |
&& pX->iColumn==pScan->aiColumn[0] |
154425
|
43 |
3806 |
}while( pWC!=0 ); |
154426
|
3793 |
13 |
if( pScan->iEquiv>=pScan->nEquiv ) break; |
154482
|
1267 |
3109 |
if( pIdx ){ |
154485
|
995 |
272 |
if( iColumn==pIdx->pTable->iPKey ){ |
154487
|
184 |
88 |
}else if( iColumn>=0 ){ |
154490
|
0 |
88 |
}else if( iColumn==XN_EXPR ){ |
154496
|
0 |
3109 |
}else if( iColumn==XN_EXPR ){ |
154542
|
14 |
1504 |
while( p ){ |
154543
|
6 |
8 |
if( (p->prereqRight & notReady)==0 ){ |
154544
|
6 |
0 |
if( p->prereqRight==0 && (p->eOperator&op)!=0 ){ |
|
6 |
0 |
if( p->prereqRight==0 && (p->eOperator&op)!=0 ){ |
154548
|
0 |
0 |
if( pResult==0 ) pResult = p; |
154572
|
0 |
0 |
for(i=0; inExpr; i++){ |
154574
|
0 |
0 |
if( ALWAYS(p!=0) |
154575
|
0 |
0 |
&& (p->op==TK_COLUMN || p->op==TK_AGG_COLUMN) |
|
0 |
0 |
&& (p->op==TK_COLUMN || p->op==TK_AGG_COLUMN) |
154576
|
0 |
0 |
&& p->iColumn==pIdx->aiColumn[iCol] |
154577
|
0 |
0 |
&& p->iTable==iBase |
154580
|
0 |
0 |
if( 0==sqlite3StrICmp(pColl->zName, zColl) ){ |
154597
|
7 |
0 |
if( j>=0 ){ |
154599
|
0 |
0 |
}else if( j==(-1) ){ |
154629
|
4 |
0 |
if( pTabList->nSrc!=1 ) return 0; |
154637
|
0 |
0 |
for(i=0; inExpr; i++){ |
154639
|
0 |
0 |
if( NEVER(p==0) ) continue; |
154640
|
0 |
0 |
if( p->op!=TK_COLUMN && p->op!=TK_AGG_COLUMN ) continue; |
|
0 |
0 |
if( p->op!=TK_COLUMN && p->op!=TK_AGG_COLUMN ) continue; |
154641
|
0 |
0 |
if( p->iTable==iBase && p->iColumn<0 ) return 1; |
|
0 |
0 |
if( p->iTable==iBase && p->iColumn<0 ) return 1; |
154657
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
154658
|
0 |
0 |
if( !IsUniqueIndex(pIdx) ) continue; |
154659
|
0 |
0 |
if( pIdx->pPartIdxWhere ) continue; |
154660
|
0 |
0 |
for(i=0; inKeyCol; i++){ |
154661
|
0 |
0 |
if( 0==sqlite3WhereFindTerm(pWC, iBase, i, ~(Bitmask)0, WO_EQ, pIdx) ){ |
154662
|
0 |
0 |
if( findIndexCol(pParse, pDistinct, iBase, pIdx, i)<0 ) break; |
154663
|
0 |
0 |
if( indexColumnNotNull(pIdx, i)==0 ) break; |
154666
|
0 |
0 |
if( i==pIdx->nKeyCol ){ |
154680
|
2371 |
2 |
return N<=10 ? 0 : sqlite3LogEst(N) - 33; |
154705
|
0 |
22 |
if( pParse->db->mallocFailed ) return; |
154706
|
283 |
22 |
for(; iStart
|
154707
|
135 |
148 |
if( pOp->p1!=iTabCur ) continue; |
154708
|
91 |
57 |
if( pOp->opcode==OP_Column ){ |
154714
|
0 |
57 |
}else if( pOp->opcode==OP_Rowid ){ |
154786
|
401 |
709 |
if( pTerm->leftCursor!=pSrc->iCursor ) return 0; |
154787
|
194 |
515 |
if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) return 0; |
154789
|
0 |
515 |
if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0 ){ |
154794
|
0 |
0 |
if( !ExprHasProperty(pTerm->pExpr, EP_OuterON|EP_InnerON) |
154795
|
0 |
0 |
|| pTerm->pExpr->w.iJoin != pSrc->iCursor |
154800
|
0 |
515 |
if( (pTerm->prereqRight & notReady)!=0 ) return 0; |
154802
|
2 |
513 |
if( pTerm->u.x.leftColumn<0 ) return 0; |
154804
|
0 |
513 |
if( !sqlite3IndexAffinityOk(pTerm->pExpr, aff) ) return 0; |
154861
|
2 |
1 |
for(pTerm=pWC->a; pTerm
|
154866
|
1 |
1 |
if( (pTerm->wtFlags & TERM_VIRTUAL)==0 |
154867
|
0 |
1 |
&& sqlite3ExprIsTableConstraint(pExpr, pSrc) |
154872
|
1 |
1 |
if( termCanDriveIndex(pTerm, pSrc, notReady) ){ |
154877
|
1 |
0 |
cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol); |
154880
|
1 |
0 |
if( !sentWarning ){ |
154886
|
1 |
0 |
if( (idxCols & cMask)==0 ){ |
154887
|
0 |
1 |
if( whereLoopResize(pParse->db, pLoop, nKeyCol+1) ){ |
154912
|
2 |
1 |
for(i=0; i
|
154913
|
1 |
1 |
if( extraCols & MASKBIT(i) ) nKeyCol++; |
154915
|
0 |
1 |
if( pSrc->colUsed & MASKBIT(BMS-1) ){ |
154921
|
0 |
1 |
if( pIdx==0 ) goto end_auto_index_create; |
154927
|
2 |
1 |
for(pTerm=pWC->a; pTerm
|
154928
|
1 |
1 |
if( termCanDriveIndex(pTerm, pSrc, notReady) ){ |
154933
|
1 |
0 |
cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol); |
154936
|
1 |
0 |
if( (idxCols & cMask)==0 ){ |
154942
|
1 |
0 |
pIdx->azColl[n] = pColl ? pColl->zName : sqlite3StrBINARY; |
154951
|
2 |
1 |
for(i=0; i
|
154952
|
1 |
1 |
if( extraCols & MASKBIT(i) ){ |
154958
|
0 |
1 |
if( pSrc->colUsed & MASKBIT(BMS-1) ){ |
154959
|
0 |
0 |
for(i=BMS-1; inCol; i++){ |
154975
|
1 |
0 |
if( OptimizationEnabled(pParse->db, SQLITE_BloomFilter) ){ |
154982
|
0 |
1 |
if( pTabItem->fg.viaCoroutine ){ |
154992
|
0 |
1 |
if( pPartial ){ |
155001
|
1 |
0 |
if( pLevel->regFilter ){ |
155007
|
0 |
1 |
if( pPartial ) sqlite3VdbeResolveLabel(v, iContinue); |
155008
|
0 |
1 |
if( pTabItem->fg.viaCoroutine ){ |
155094
|
0 |
0 |
if( sz<10000 ){ |
155096
|
0 |
0 |
}else if( sz>10000000 ){ |
155103
|
0 |
0 |
for(pTerm=pWInfo->sWC.a; pTerm
|
155105
|
0 |
0 |
if( (pTerm->wtFlags & TERM_VIRTUAL)==0 |
155106
|
0 |
0 |
&& sqlite3ExprIsTableConstraint(pExpr, pItem) |
155111
|
0 |
0 |
if( pLoop->wsFlags & WHERE_IPK ){ |
155121
|
0 |
0 |
for(jj=0; jj
|
155134
|
0 |
0 |
if( OptimizationDisabled(pParse->db, SQLITE_BloomPulldown) ) break; |
155135
|
0 |
0 |
while( ++iLevel < pWInfo->nLevel ){ |
155139
|
0 |
0 |
if( pTabItem->fg.jointype & (JT_LEFT|JT_LTORJ) ) continue; |
155141
|
0 |
0 |
if( NEVER(pLoop==0) ) continue; |
155142
|
0 |
0 |
if( pLoop->prereq & notReady ) continue; |
155143
|
0 |
0 |
if( (pLoop->wsFlags & (WHERE_BLOOMFILTER|WHERE_COLUMN_IN)) |
155153
|
0 |
0 |
}while( iLevel < pWInfo->nLevel ); |
155195
|
263 |
148 |
for(i=nTerm=0, pTerm=pWC->a; inTerm; i++, pTerm++){ |
155197
|
104 |
159 |
if( pTerm->leftCursor != pSrc->iCursor ) continue; |
155198
|
3 |
156 |
if( pTerm->prereqRight & mUnusable ) continue; |
155204
|
0 |
156 |
if( (pTerm->eOperator & ~(WO_EQUIV))==0 ) continue; |
155205
|
3 |
153 |
if( pTerm->wtFlags & TERM_VNULL ) continue; |
155215
|
2 |
151 |
if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0 ){ |
155221
|
0 |
2 |
if( !ExprHasProperty(pTerm->pExpr, EP_OuterON|EP_InnerON) |
155222
|
0 |
0 |
|| pTerm->pExpr->w.iJoin != pSrc->iCursor |
155236
|
29 |
119 |
if( pOrderBy ){ |
155238
|
29 |
23 |
for(i=0; i
|
155243
|
0 |
29 |
if( sqlite3ExprIsConstant(pExpr) ){ |
155248
|
0 |
29 |
if( pOrderBy->a[i].fg.sortFlags & KEYINFO_ORDER_BIGNULL ) break; |
155251
|
29 |
0 |
if( pExpr->op==TK_COLUMN && pExpr->iTable==pSrc->iCursor ){ |
|
23 |
6 |
if( pExpr->op==TK_COLUMN && pExpr->iTable==pSrc->iCursor ){ |
155258
|
0 |
6 |
if( pExpr->op==TK_COLLATE |
155259
|
0 |
0 |
&& (pE2 = pExpr->pLeft)->op==TK_COLUMN |
155260
|
0 |
0 |
&& pE2->iTable==pSrc->iCursor |
155267
|
0 |
0 |
if( pE2->iColumn<0 ) continue; /* Collseq does not matter for rowid */ |
155269
|
0 |
0 |
if( zColl==0 ) zColl = sqlite3StrBINARY; |
155270
|
0 |
0 |
if( sqlite3_stricmp(pExpr->u.zToken, zColl)==0 ) continue; |
155276
|
23 |
6 |
if( i==n ){ |
155278
|
2 |
21 |
if( (pWInfo->wctrlFlags & WHERE_DISTINCTBY) ){ |
155279
|
0 |
2 |
eDistinct = 2 + ((pWInfo->wctrlFlags & WHERE_SORTBYGROUP)!=0); |
155280
|
0 |
21 |
}else if( pWInfo->wctrlFlags & WHERE_GROUPBY ){ |
155292
|
0 |
148 |
if( pIdxInfo==0 ){ |
155307
|
263 |
148 |
for(i=j=0, pTerm=pWC->a; inTerm; i++, pTerm++){ |
155309
|
112 |
151 |
if( (pTerm->wtFlags & TERM_OK)==0 ) continue; |
155313
|
3 |
148 |
if( op==WO_IN ){ |
155314
|
3 |
0 |
if( (pTerm->wtFlags & TERM_SLICE)==0 ){ |
155315
|
3 |
0 |
pHidden->mIn |= SMASKBIT32(j); |
155319
|
89 |
62 |
if( op==WO_AUX ){ |
155321
|
4 |
58 |
}else if( op & (WO_ISNULL|WO_IS) ){ |
155322
|
3 |
1 |
if( op==WO_ISNULL ){ |
155339
|
32 |
26 |
if( op & (WO_LT|WO_LE|WO_GT|WO_GE) |
155340
|
0 |
32 |
&& sqlite3ExprIsVector(pTerm->pExpr->pRight) |
155343
|
0 |
0 |
if( j<16 ) mNoOmit |= (1 << j); |
155344
|
0 |
0 |
if( op==WO_LT ) pIdxCons[j].op = WO_LE; |
155345
|
0 |
0 |
if( op==WO_GT ) pIdxCons[j].op = WO_GE; |
155353
|
23 |
148 |
for(i=j=0; i
|
155355
|
0 |
23 |
if( sqlite3ExprIsConstant(pExpr) ) continue; |
155380
|
151 |
148 |
for(i=0; inConstraint; i++){ |
155413
|
0 |
156 |
if( rc!=SQLITE_OK && rc!=SQLITE_CONSTRAINT ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_CONSTRAINT ){ |
155414
|
0 |
0 |
if( rc==SQLITE_NOMEM ){ |
155416
|
0 |
0 |
}else if( !pVtab->zErrMsg ){ |
155636
|
90 |
52 |
if( pTerm ){ |
155637
|
0 |
90 |
if( pTerm->truthProb<=0 ){ |
155639
|
86 |
4 |
}else if( (pTerm->wtFlags & TERM_VNULL)==0 ){ |
155956
|
52 |
19 |
if( pLower && pLower->truthProb>0 && pUpper && pUpper->truthProb>0 ){ |
|
52 |
0 |
if( pLower && pLower->truthProb>0 && pUpper && pUpper->truthProb>0 ){ |
|
19 |
33 |
if( pLower && pLower->truthProb>0 && pUpper && pUpper->truthProb>0 ){ |
|
19 |
0 |
if( pLower && pLower->truthProb>0 && pUpper && pUpper->truthProb>0 ){ |
155961
|
0 |
71 |
if( nNew<10 ) nNew = 10; |
155962
|
69 |
2 |
if( nNew
|
156213
|
765 |
4402 |
if( p->wsFlags & (WHERE_VIRTUALTABLE|WHERE_AUTO_INDEX) ){ |
156214
|
297 |
468 |
if( (p->wsFlags & WHERE_VIRTUALTABLE)!=0 && p->u.vtab.needFree ){ |
|
5 |
292 |
if( (p->wsFlags & WHERE_VIRTUALTABLE)!=0 && p->u.vtab.needFree ){ |
156218
|
468 |
292 |
}else if( (p->wsFlags & WHERE_AUTO_INDEX)!=0 && p->u.btree.pIndex!=0 ){ |
|
1 |
467 |
}else if( (p->wsFlags & WHERE_AUTO_INDEX)!=0 && p->u.btree.pIndex!=0 ){ |
156230
|
14 |
3383 |
if( p->aLTerm!=p->aLTermSpace ) sqlite3DbFreeNN(db, p->aLTerm); |
156240
|
2008 |
14 |
if( p->nLSlot>=n ) return SQLITE_OK; |
156243
|
0 |
14 |
if( paNew==0 ) return SQLITE_NOMEM_BKPT; |
156245
|
0 |
14 |
if( p->aLTerm!=p->aLTermSpace ) sqlite3DbFreeNN(db, p->aLTerm); |
156256
|
0 |
1770 |
if( whereLoopResize(db, pTo, pFrom->nLTerm) ){ |
156262
|
153 |
1617 |
if( pFrom->wsFlags & WHERE_VIRTUALTABLE ){ |
156264
|
468 |
1149 |
}else if( (pFrom->wsFlags & WHERE_AUTO_INDEX)!=0 ){ |
156284
|
1688 |
2261 |
while( pWInfo->pLoops ){ |
156290
|
3 |
2261 |
while( pWInfo->pMemToFree ){ |
156301
|
0 |
0 |
while( pWInfo->pExprMods ){ |
156333
|
65 |
67 |
if( pX->nLTerm-pX->nSkip >= pY->nLTerm-pY->nSkip ){ |
156336
|
66 |
1 |
if( pX->rRun>pY->rRun && pX->nOut>pY->nOut ) return 0; |
|
63 |
3 |
if( pX->rRun>pY->rRun && pX->nOut>pY->nOut ) return 0; |
156337
|
0 |
4 |
if( pY->nSkip > pX->nSkip ) return 0; |
156338
|
10 |
4 |
for(i=pX->nLTerm-1; i>=0; i--){ |
156339
|
0 |
10 |
if( pX->aLTerm[i]==0 ) continue; |
156340
|
30 |
0 |
for(j=pY->nLTerm-1; j>=0; j--){ |
156341
|
10 |
20 |
if( pY->aLTerm[j]==pX->aLTerm[i] ) break; |
156343
|
0 |
10 |
if( j<0 ) return 0; /* X not a subset of Y since term X[i] not used by Y */ |
156345
|
4 |
0 |
if( (pX->wsFlags&WHERE_IDX_ONLY)!=0 |
156346
|
0 |
4 |
&& (pY->wsFlags&WHERE_IDX_ONLY)==0 ){ |
156367
|
1741 |
119 |
if( (pTemplate->wsFlags & WHERE_INDEXED)==0 ) return; |
156368
|
203 |
119 |
for(; p; p=p->pNextLoop){ |
156369
|
0 |
203 |
if( p->iTab!=pTemplate->iTab ) continue; |
156370
|
135 |
68 |
if( (p->wsFlags & WHERE_INDEXED)==0 ) continue; |
156371
|
4 |
64 |
if( whereLoopCheaperProperSubset(p, pTemplate) ){ |
156380
|
0 |
64 |
}else if( whereLoopCheaperProperSubset(pTemplate, p) ){ |
156412
|
749 |
1697 |
for(p=(*ppPrev); p; ppPrev=&p->pNextLoop, p=*ppPrev){ |
156413
|
717 |
32 |
if( p->iTab!=pTemplate->iTab || p->iSortIdx!=pTemplate->iSortIdx ){ |
|
367 |
350 |
if( p->iTab!=pTemplate->iTab || p->iSortIdx!=pTemplate->iSortIdx ){ |
156433
|
254 |
96 |
if( (p->wsFlags & WHERE_AUTO_INDEX)!=0 |
156434
|
254 |
0 |
&& (pTemplate->nSkip)==0 |
156435
|
9 |
245 |
&& (pTemplate->wsFlags & WHERE_INDEXED)!=0 |
156436
|
9 |
0 |
&& (pTemplate->wsFlags & WHERE_COLUMN_EQ)!=0 |
156437
|
9 |
0 |
&& (p->prereq & pTemplate->prereq)==pTemplate->prereq |
156447
|
330 |
11 |
if( (p->prereq & pTemplate->prereq)==p->prereq /* (1) */ |
156448
|
134 |
196 |
&& p->rSetup<=pTemplate->rSetup /* (2a) */ |
156449
|
65 |
69 |
&& p->rRun<=pTemplate->rRun /* (2b) */ |
156450
|
64 |
1 |
&& p->nOut<=pTemplate->nOut /* (2c) */ |
156460
|
275 |
2 |
if( (p->prereq & pTemplate->prereq)==pTemplate->prereq /* (1) */ |
156461
|
73 |
202 |
&& p->rRun>=pTemplate->rRun /* (2a) */ |
156462
|
73 |
0 |
&& p->nOut>=pTemplate->nOut /* (2b) */ |
156502
|
0 |
1860 |
if( pBuilder->iPlanLimit==0 ){ |
156504
|
0 |
0 |
if( pBuilder->pOrSet ) pBuilder->pOrSet->n = 0; |
156514
|
26 |
1834 |
if( pBuilder->pOrSet!=0 ){ |
156515
|
18 |
8 |
if( pTemplate->nLTerm ){ |
156536
|
64 |
1770 |
if( ppPrev==0 ){ |
156566
|
1697 |
73 |
if( p==0 ){ |
156569
|
0 |
1697 |
if( p==0 ) return SQLITE_NOMEM_BKPT; |
156578
|
9 |
73 |
while( *ppTail ){ |
156580
|
0 |
9 |
if( ppTail==0 ) break; |
156582
|
0 |
9 |
if( pToDel==0 ) break; |
156594
|
1617 |
153 |
if( (p->wsFlags & WHERE_VIRTUALTABLE)==0 ){ |
156596
|
1147 |
470 |
if( pIndex && pIndex->idxType==SQLITE_IDXTYPE_IPK ){ |
|
1058 |
89 |
if( pIndex && pIndex->idxType==SQLITE_IDXTYPE_IPK ){ |
156643
|
1143 |
1190 |
for(i=pWC->nBase, pTerm=pWC->a; i>0; i--, pTerm++){ |
156645
|
12 |
1131 |
if( (pTerm->prereqAll & notAllowed)!=0 ) continue; |
156646
|
42 |
1089 |
if( (pTerm->prereqAll & pLoop->maskSelf)==0 ) continue; |
156647
|
8 |
1081 |
if( (pTerm->wtFlags & TERM_VIRTUAL)!=0 ) continue; |
156648
|
202 |
967 |
for(j=pLoop->nLTerm-1; j>=0; j--){ |
156650
|
0 |
202 |
if( pX==0 ) continue; |
156651
|
59 |
143 |
if( pX==pTerm ) break; |
156652
|
57 |
86 |
if( pX->iParent>=0 && (&pWC->a[pX->iParent])==pTerm ) break; |
|
55 |
2 |
if( pX->iParent>=0 && (&pWC->a[pX->iParent])==pTerm ) break; |
156654
|
967 |
114 |
if( j<0 ){ |
156655
|
967 |
0 |
if( pLoop->maskSelf==pTerm->prereqAll ){ |
156665
|
411 |
556 |
if( (pTerm->eOperator & 0x3f)!=0 |
156666
|
411 |
0 |
|| (pWC->pWInfo->pTabList->a[pLoop->iTab].fg.jointype |
156672
|
0 |
967 |
if( pTerm->truthProb<=0 ){ |
156680
|
528 |
439 |
if( (pTerm->eOperator&(WO_EQ|WO_IS))!=0 |
156686
|
41 |
487 |
if( sqlite3ExprIsInteger(pRight, &k) && k>=(-1) && k<=1 ){ |
|
41 |
0 |
if( sqlite3ExprIsInteger(pRight, &k) && k>=(-1) && k<=1 ){ |
|
31 |
10 |
if( sqlite3ExprIsInteger(pRight, &k) && k>=(-1) && k<=1 ){ |
156691
|
477 |
51 |
if( iReduce
|
156699
|
471 |
719 |
if( pLoop->nOut > nRow-iReduce ){ |
156732
|
0 |
71 |
for(i=1; i
|
156743
|
0 |
0 |
if( ExprUseXSelect(pRhs) ){ |
156753
|
0 |
0 |
if( pLhs->op!=TK_COLUMN |
156754
|
0 |
0 |
|| pLhs->iTable!=iCur |
156755
|
0 |
0 |
|| pLhs->iColumn!=pIdx->aiColumn[i+nEq] |
156756
|
0 |
0 |
|| pIdx->aSortOrder[i+nEq]!=pIdx->aSortOrder[nEq] |
156764
|
0 |
0 |
if( aff!=idxaff ) break; |
156767
|
0 |
0 |
if( pColl==0 ) break; |
156768
|
0 |
0 |
if( sqlite3StrICmp(pColl->zName, pIdx->azColl[i+nEq]) ) break; |
156822
|
0 |
1192 |
if( db->mallocFailed ) return SQLITE_NOMEM_BKPT; |
156829
|
33 |
1159 |
if( pNew->wsFlags & WHERE_BTM_LIMIT ){ |
156835
|
0 |
1192 |
if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE); |
156854
|
1295 |
0 |
for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){ |
|
103 |
1192 |
for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){ |
156862
|
98 |
5 |
if( (eOp==WO_ISNULL || (pTerm->wtFlags&TERM_VNULL)!=0) |
|
2 |
96 |
if( (eOp==WO_ISNULL || (pTerm->wtFlags&TERM_VNULL)!=0) |
156863
|
0 |
7 |
&& indexColumnNotNull(pProbe, saved_nEq) |
156867
|
0 |
103 |
if( pTerm->prereqRight & pNew->maskSelf ) continue; |
156871
|
0 |
103 |
if( pTerm->wtFlags & TERM_LIKEOPT && pTerm->eOperator==WO_LT ) continue; |
|
0 |
0 |
if( pTerm->wtFlags & TERM_LIKEOPT && pTerm->eOperator==WO_LT ) continue; |
156886
|
0 |
103 |
if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0 ){ |
156892
|
0 |
0 |
if( !ExprHasProperty(pTerm->pExpr, EP_OuterON|EP_InnerON) |
156893
|
0 |
0 |
|| pTerm->pExpr->w.iJoin != pSrc->iCursor |
156899
|
83 |
20 |
if( IsUniqueIndex(pProbe) && saved_nEq==pProbe->nKeyCol-1 ){ |
|
11 |
72 |
if( IsUniqueIndex(pProbe) && saved_nEq==pProbe->nKeyCol-1 ){ |
156909
|
0 |
103 |
if( whereLoopResize(db, pNew, pNew->nLTerm+1) ) break; /* OOM */ |
156919
|
0 |
103 |
if( eOp & WO_IN ){ |
156921
|
0 |
0 |
if( ExprUseXSelect(pExpr) ){ |
156931
|
0 |
0 |
for(i=0; inLTerm-1; i++){ |
156932
|
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; |
156934
|
0 |
0 |
}else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){ |
|
0 |
0 |
}else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){ |
156938
|
0 |
0 |
if( pProbe->hasStat1 && rLogSize>=10 ){ |
|
0 |
0 |
if( pProbe->hasStat1 && rLogSize>=10 ){ |
156964
|
0 |
0 |
if( x>=0 ){ |
156969
|
0 |
0 |
}else if( nInMul<2 && OptimizationEnabled(db, SQLITE_SeekScan) ){ |
|
0 |
0 |
}else if( nInMul<2 && OptimizationEnabled(db, SQLITE_SeekScan) ){ |
156984
|
27 |
76 |
}else if( eOp & (WO_EQ|WO_IS) ){ |
156988
|
25 |
2 |
if( iCol==XN_ROWID |
156989
|
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) |
156991
|
4 |
2 |
if( iCol==XN_ROWID || pProbe->uniqNotNull |
|
3 |
1 |
if( iCol==XN_ROWID || pProbe->uniqNotNull |
156992
|
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) |
156999
|
0 |
27 |
if( scan.iEquiv>1 ) pNew->wsFlags |= WHERE_TRANSCONS; |
157000
|
5 |
71 |
}else if( eOp & WO_ISNULL ){ |
157002
|
33 |
38 |
}else if( eOp & (WO_GT|WO_GE) ){ |
157011
|
0 |
33 |
if( pTerm->wtFlags & TERM_LIKEOPT ){ |
157018
|
0 |
0 |
if( whereLoopResize(db, pNew, pNew->nLTerm+1) ) break; /* OOM */ |
157033
|
19 |
19 |
pNew->aLTerm[pNew->nLTerm-2] : 0; |
157042
|
71 |
32 |
if( pNew->wsFlags & WHERE_COLUMN_RANGE ){ |
157051
|
0 |
32 |
if( pTerm->truthProb<=0 && pProbe->aiColumn[saved_nEq]>=0 ){ |
|
0 |
0 |
if( pTerm->truthProb<=0 && pProbe->aiColumn[saved_nEq]>=0 ){ |
157107
|
5 |
27 |
if( eOp & WO_ISNULL ){ |
157124
|
51 |
52 |
if( (pNew->wsFlags & (WHERE_IDX_ONLY|WHERE_IPK))==0 ){ |
157135
|
71 |
32 |
if( pNew->wsFlags & WHERE_COLUMN_RANGE ){ |
157141
|
65 |
38 |
if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 |
157142
|
63 |
2 |
&& pNew->u.btree.nEqnColumn |
157143
|
15 |
48 |
&& (pNew->u.btree.nEqnKeyCol || |
|
14 |
1 |
&& (pNew->u.btree.nEqnKeyCol || |
157173
|
1157 |
35 |
if( saved_nEq==saved_nSkip |
157174
|
52 |
1105 |
&& saved_nEq+1nKeyCol |
157175
|
35 |
17 |
&& saved_nEq==pNew->nLTerm |
157176
|
35 |
0 |
&& pProbe->noSkipScan==0 |
157177
|
0 |
35 |
&& pProbe->hasStat1!=0 |
157178
|
0 |
0 |
&& OptimizationEnabled(db, SQLITE_SkipScan) |
157179
|
0 |
0 |
&& pProbe->aiRowLogEst[saved_nEq+1]>=42 /* TUNING: Minimum for skip-scan */ |
157180
|
0 |
0 |
&& (rc = whereLoopResize(db, pNew, pNew->nLTerm+1))==SQLITE_OK |
157221
|
0 |
1130 |
if( pIndex->bUnordered ) return 0; |
157222
|
478 |
652 |
if( (pOB = pBuilder->pWInfo->pOrderBy)==0 ) return 0; |
157223
|
706 |
118 |
for(ii=0; iinExpr; ii++){ |
157225
|
0 |
706 |
if( NEVER(pExpr==0) ) continue; |
157226
|
706 |
0 |
if( pExpr->op==TK_COLUMN && pExpr->iTable==iCursor ){ |
|
701 |
5 |
if( pExpr->op==TK_COLUMN && pExpr->iTable==iCursor ){ |
157227
|
509 |
192 |
if( pExpr->iColumn<0 ) return 1; |
157228
|
200 |
167 |
for(jj=0; jjnKeyCol; jj++){ |
157229
|
25 |
175 |
if( pExpr->iColumn==pIndex->aiColumn[jj] ) return 1; |
157231
|
0 |
5 |
}else if( (aColExpr = pIndex->aColExpr)!=0 ){ |
157232
|
0 |
0 |
for(jj=0; jjnKeyCol; jj++){ |
157233
|
0 |
0 |
if( pIndex->aiColumn[jj]!=XN_EXPR ) continue; |
157234
|
0 |
0 |
if( sqlite3ExprCompareSkip(pExpr,aColExpr->a[jj].pExpr,iCursor)==0 ){ |
157256
|
0 |
0 |
if( jointype & JT_LTORJ ) return 0; |
157258
|
0 |
0 |
while( pWhere->op==TK_AND ){ |
157259
|
0 |
0 |
if( !whereUsablePartialIndex(iTab,jointype,pWC,pWhere->pLeft) ) return 0; |
157262
|
0 |
0 |
if( pParse->db->flags & SQLITE_EnableQPSG ) pParse = 0; |
157263
|
0 |
0 |
for(i=0, pTerm=pWC->a; inTerm; i++, pTerm++){ |
157266
|
0 |
0 |
if( (!ExprHasProperty(pExpr, EP_OuterON) || pExpr->w.iJoin==iTab) |
|
0 |
0 |
if( (!ExprHasProperty(pExpr, EP_OuterON) || pExpr->w.iJoin==iTab) |
157267
|
0 |
0 |
&& ((jointype & JT_OUTER)==0 || ExprHasProperty(pExpr, EP_OuterON)) |
|
0 |
0 |
&& ((jointype & JT_OUTER)==0 || ExprHasProperty(pExpr, EP_OuterON)) |
157268
|
0 |
0 |
&& sqlite3ExprImpliesExpr(pParse, pExpr, pWhere, iTab) |
157269
|
0 |
0 |
&& (pTerm->wtFlags & TERM_VNULL)==0 |
157340
|
0 |
1061 |
if( pSrc->fg.isIndexedBy ){ |
157344
|
0 |
1061 |
}else if( !HasRowid(pTab) ){ |
157364
|
1061 |
0 |
if( pSrc->fg.notIndexed==0 ){ |
157375
|
1053 |
8 |
if( !pBuilder->pOrSet /* Not part of an OR optimization */ |
157376
|
1048 |
5 |
&& (pWInfo->wctrlFlags & (WHERE_RIGHT_JOIN|WHERE_OR_SUBCLAUSE))==0 |
157377
|
1048 |
0 |
&& (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0 |
157378
|
1048 |
0 |
&& !pSrc->fg.isIndexedBy /* Has no INDEXED BY clause */ |
157379
|
1048 |
0 |
&& !pSrc->fg.notIndexed /* Has no NOT INDEXED clause */ |
157380
|
1048 |
0 |
&& HasRowid(pTab) /* Not WITHOUT ROWID table. (FIXME: Why not?) */ |
157381
|
1048 |
0 |
&& !pSrc->fg.isCorrelated /* Not a correlated subquery */ |
157382
|
1048 |
0 |
&& !pSrc->fg.isRecursive /* Not a recursive common table expression. */ |
157383
|
1048 |
0 |
&& (pSrc->fg.jointype & JT_RIGHT)==0 /* Not the right tab of a RIGHT JOIN */ |
157390
|
2168 |
0 |
for(pTerm=pWC->a; rc==SQLITE_OK && pTerm
|
|
1120 |
1048 |
for(pTerm=pWC->a; rc==SQLITE_OK && pTerm
|
157391
|
14 |
1106 |
if( pTerm->prereqRight & pNew->maskSelf ) continue; |
157392
|
511 |
595 |
if( termCanDriveIndex(pTerm, pSrc, 0) ){ |
157407
|
511 |
0 |
if( !IsView(pTab) && (pTab->tabFlags & TF_Ephemeral)==0 ){ |
|
510 |
1 |
if( !IsView(pTab) && (pTab->tabFlags & TF_Ephemeral)==0 ){ |
157413
|
0 |
511 |
if( pNew->rSetup<0 ) pNew->rSetup = 0; |
157430
|
2191 |
0 |
for(; rc==SQLITE_OK && pProbe; |
|
1130 |
1061 |
for(; rc==SQLITE_OK && pProbe; |
157431
|
1130 |
0 |
pProbe=(pSrc->fg.isIndexedBy ? 0 : pProbe->pNext), iSortIdx++ |
157433
|
0 |
1130 |
if( pProbe->pPartIdxWhere!=0 |
157434
|
0 |
0 |
&& !whereUsablePartialIndex(pSrc->iCursor, pSrc->fg.jointype, pWC, |
157440
|
0 |
1130 |
if( pProbe->bNoQuery ) continue; |
157456
|
1061 |
69 |
if( pProbe->idxType==SQLITE_IDXTYPE_IPK ){ |
157461
|
508 |
553 |
pNew->iSortIdx = b ? iSortIdx : 0; |
157483
|
0 |
1061 |
if( rc ) break; |
157486
|
14 |
55 |
if( pProbe->isCovering ){ |
157491
|
18 |
37 |
pNew->wsFlags = (m==0) ? (WHERE_IDX_ONLY|WHERE_INDEXED) : WHERE_INDEXED; |
157495
|
43 |
26 |
if( b |
157496
|
43 |
0 |
|| !HasRowid(pTab) |
157497
|
43 |
0 |
|| pProbe->pPartIdxWhere!=0 |
157498
|
43 |
0 |
|| pSrc->fg.isIndexedBy |
157499
|
23 |
20 |
|| ( m==0 |
157500
|
23 |
0 |
&& pProbe->bUnordered==0 |
157501
|
9 |
14 |
&& (pProbe->szIdxRowszTabRow) |
157502
|
0 |
9 |
&& (pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0 |
157503
|
0 |
0 |
&& sqlite3GlobalConfig.bUseCis |
157504
|
0 |
0 |
&& OptimizationEnabled(pWInfo->pParse->db, SQLITE_CoverIdxScan) |
157507
|
26 |
0 |
pNew->iSortIdx = b ? iSortIdx : 0; |
157513
|
17 |
9 |
if( m!=0 ){ |
157523
|
51 |
17 |
for(ii=0; iinTerm; ii++){ |
157525
|
0 |
51 |
if( !sqlite3ExprCoveredByIndex(pTerm->pExpr, iCur, pProbe) ){ |
157530
|
0 |
51 |
if( pTerm->truthProb<=0 ){ |
157534
|
0 |
51 |
if( pTerm->eOperator & (WO_EQ|WO_IS) ) nLookup -= 19; |
157542
|
0 |
26 |
if( (pSrc->fg.jointype & JT_RIGHT)!=0 && pProbe->aColExpr ){ |
|
0 |
0 |
if( (pSrc->fg.jointype & JT_RIGHT)!=0 && pProbe->aColExpr ){ |
157551
|
0 |
26 |
if( rc ) break; |
157557
|
43 |
1087 |
if( pBuilder->bldFlags1==SQLITE_BLDF1_INDEXED ){ |
157581
|
0 |
148 |
&& pTerm->eMatchOp<=SQLITE_INDEX_CONSTRAINT_OFFSET; |
|
0 |
0 |
&& pTerm->eMatchOp<=SQLITE_INDEX_CONSTRAINT_OFFSET; |
157633
|
159 |
156 |
for(i=0; i
|
157636
|
154 |
5 |
if( (pTerm->prereqRight & mUsable)==pTerm->prereqRight |
157637
|
151 |
3 |
&& (pTerm->eOperator & mExclude)==0 |
157638
|
0 |
151 |
&& (pbRetryLimit || !isLimitTerm(pTerm)) |
|
0 |
0 |
&& (pbRetryLimit || !isLimitTerm(pTerm)) |
157658
|
0 |
156 |
if( rc ){ |
157659
|
0 |
0 |
if( rc==SQLITE_CONSTRAINT ){ |
157675
|
159 |
156 |
for(i=0; i
|
157677
|
148 |
11 |
if( (iTerm = pUsage[i].argvIndex - 1)>=0 ){ |
157680
|
148 |
0 |
if( iTerm>=nConstraint |
157681
|
148 |
0 |
|| j<0 |
157682
|
148 |
0 |
|| j>=pWC->nTerm |
157683
|
148 |
0 |
|| pNew->aLTerm[iTerm]!=0 |
157684
|
0 |
148 |
|| pIdxCons->usable==0 |
157697
|
148 |
0 |
if( iTerm>mxTerm ) mxTerm = iTerm; |
157700
|
148 |
0 |
if( pUsage[i].omit ){ |
157701
|
148 |
0 |
if( i<16 && ((1<
|
|
148 |
0 |
if( i<16 && ((1<
|
157707
|
0 |
148 |
if( pTerm->eMatchOp==SQLITE_INDEX_CONSTRAINT_OFFSET ){ |
157711
|
148 |
0 |
if( SMASKBIT32(i) & pHidden->mHandleIn ){ |
|
0 |
148 |
if( SMASKBIT32(i) & pHidden->mHandleIn ){ |
157713
|
3 |
145 |
}else if( (pTerm->eOperator & WO_IN)!=0 ){ |
157725
|
0 |
148 |
if( isLimitTerm(pTerm) && *pbIn ){ |
|
0 |
0 |
if( isLimitTerm(pTerm) && *pbIn ){ |
157731
|
0 |
0 |
if( pIdxInfo->needToFreeIdxStr ){ |
157743
|
148 |
156 |
for(i=0; i<=mxTerm; i++){ |
157744
|
0 |
148 |
if( pNew->aLTerm[i]==0 ){ |
157757
|
0 |
156 |
pNew->u.vtab.isOrdered = (i8)(pIdxInfo->orderByConsumed ? |
157765
|
2 |
154 |
if( pIdxInfo->idxFlags & SQLITE_INDEX_SCAN_UNIQUE ){ |
157771
|
3 |
153 |
if( pNew->u.vtab.needFree ){ |
157800
|
0 |
0 |
if( iCons>=0 && iConsnConstraint ){ |
|
0 |
0 |
if( iCons>=0 && iConsnConstraint ){ |
157804
|
0 |
0 |
if( pX->pLeft ){ |
157807
|
0 |
0 |
zRet = (pC ? pC->zName : sqlite3StrBINARY); |
157819
|
0 |
0 |
u32 m = SMASKBIT32(iCons); |
157820
|
0 |
0 |
if( m & pHidden->mIn ){ |
157821
|
0 |
0 |
if( bHandle==0 ){ |
157823
|
0 |
0 |
}else if( bHandle>0 ){ |
157845
|
0 |
0 |
if( iCons<0 || iCons>=pIdxInfo->nConstraint ){ |
|
0 |
0 |
if( iCons<0 || iCons>=pIdxInfo->nConstraint ){ |
157848
|
0 |
0 |
if( pH->aRhs[iCons]==0 ){ |
157860
|
0 |
0 |
if( rc==SQLITE_OK && pVal==0 ){ /* IMP: R-19933-32160 */ |
|
0 |
0 |
if( rc==SQLITE_OK && pVal==0 ){ /* IMP: R-19933-32160 */ |
157954
|
0 |
148 |
if( p==0 ) return SQLITE_NOMEM_BKPT; |
157960
|
0 |
148 |
if( whereLoopResize(pParse->db, pNew, nConstraint) ){ |
157971
|
0 |
148 |
if( bRetry ){ |
157983
|
148 |
0 |
if( rc==SQLITE_OK && ((mBest = (pNew->prereq & ~mPrereq))!=0 || bIn) ){ |
|
143 |
5 |
if( rc==SQLITE_OK && ((mBest = (pNew->prereq & ~mPrereq))!=0 || bIn) ){ |
|
3 |
140 |
if( rc==SQLITE_OK && ((mBest = (pNew->prereq & ~mPrereq))!=0 || bIn) ){ |
157991
|
3 |
5 |
if( bIn ){ |
157997
|
3 |
0 |
if( mBestNoIn==0 ){ |
158005
|
13 |
0 |
while( rc==SQLITE_OK ){ |
158009
|
13 |
13 |
for(i=0; i
|
158013
|
5 |
8 |
if( mThis>mPrev && mThis
|
|
5 |
0 |
if( mThis>mPrev && mThis
|
158016
|
8 |
5 |
if( mNext==ALLBITS ) break; |
158017
|
0 |
5 |
if( mNext==mBest || mNext==mBestNoIn ) continue; |
|
0 |
0 |
if( mNext==mBest || mNext==mBestNoIn ) continue; |
158022
|
0 |
0 |
if( pNew->prereq==mPrereq ){ |
158024
|
0 |
0 |
if( bIn==0 ) seenZeroNoIN = 1; |
158031
|
8 |
0 |
if( rc==SQLITE_OK && seenZero==0 ){ |
|
5 |
3 |
if( rc==SQLITE_OK && seenZero==0 ){ |
158035
|
5 |
0 |
if( bIn==0 ) seenZeroNoIN = 1; |
158041
|
8 |
0 |
if( rc==SQLITE_OK && seenZeroNoIN==0 ){ |
|
0 |
8 |
if( rc==SQLITE_OK && seenZeroNoIN==0 ){ |
158048
|
0 |
148 |
if( p->needToFreeIdxStr ) sqlite3_free(p->idxStr); |
158083
|
0 |
11 |
if( pItem->fg.jointype & JT_RIGHT ) return SQLITE_OK; |
158085
|
26 |
11 |
for(pTerm=pWC->a; pTerm
|
|
26 |
0 |
for(pTerm=pWC->a; pTerm
|
158086
|
4 |
22 |
if( (pTerm->eOperator & WO_OR)!=0 |
158087
|
4 |
0 |
&& (pTerm->u.pOrInfo->indexable & pNew->maskSelf)!=0 |
158099
|
10 |
3 |
for(pOrTerm=pOrWC->a; pOrTerm
|
158100
|
6 |
4 |
if( (pOrTerm->eOperator & WO_AND)!=0 ){ |
158102
|
2 |
2 |
}else if( pOrTerm->leftCursor==iCur ){ |
158122
|
0 |
8 |
if( IsVirtual(pItem->pTab) ){ |
158129
|
8 |
0 |
if( rc==SQLITE_OK ){ |
158136
|
1 |
7 |
if( sCur.n==0 ){ |
158139
|
3 |
4 |
}else if( once ){ |
158146
|
4 |
4 |
for(i=0; i
|
158147
|
4 |
4 |
for(j=0; j
|
158161
|
7 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
3 |
4 |
for(i=0; rc==SQLITE_OK && i
|
158207
|
1201 |
1700 |
for(iTab=0, pItem=pTabList->a; pItem
|
158212
|
1201 |
0 |
if( bFirstPastRJ |
158213
|
3 |
1198 |
|| (pItem->fg.jointype & (JT_OUTER|JT_CROSS|JT_LTORJ))!=0 |
158225
|
0 |
3 |
if( pItem->fg.jointype & JT_LTORJ ) hasRightJoin = 1; |
158228
|
1198 |
0 |
}else if( !hasRightJoin ){ |
158232
|
148 |
1053 |
if( IsVirtual(pItem->pTab) ){ |
158234
|
4 |
148 |
for(p=&pItem[1]; p
|
158235
|
4 |
0 |
if( mUnusable || (p->fg.jointype & (JT_OUTER|JT_CROSS)) ){ |
|
3 |
1 |
if( mUnusable || (p->fg.jointype & (JT_OUTER|JT_CROSS)) ){ |
158245
|
1201 |
0 |
if( rc==SQLITE_OK && pBuilder->pWC->hasOr ){ |
|
3 |
1198 |
if( rc==SQLITE_OK && pBuilder->pWC->hasOr ){ |
158249
|
1201 |
0 |
if( rc || db->mallocFailed ){ |
|
0 |
1201 |
if( rc || db->mallocFailed ){ |
158250
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
158338
|
17 |
1420 |
if( nLoop && OptimizationDisabled(db, SQLITE_OrderByIdxJoin) ) return 0; |
|
0 |
17 |
if( nLoop && OptimizationDisabled(db, SQLITE_OrderByIdxJoin) ) return 0; |
158342
|
0 |
1437 |
if( nOrderBy>BMS-1 ) return 0; /* Cannot optimize overly large ORDER BYs */ |
158348
|
774 |
663 |
if( wctrlFlags & (WHERE_ORDERBY_LIMIT|WHERE_ORDERBY_MAX|WHERE_ORDERBY_MIN) ){ |
158351
|
2461 |
344 |
for(iLoop=0; isOrderDistinct && obSat
|
|
1447 |
1014 |
for(iLoop=0; isOrderDistinct && obSat
|
|
1447 |
0 |
for(iLoop=0; isOrderDistinct && obSat
|
158352
|
10 |
1437 |
if( iLoop>0 ) ready |= pLoop->maskSelf; |
158353
|
17 |
1430 |
if( iLoop
|
158355
|
10 |
7 |
if( wctrlFlags & WHERE_ORDERBY_LIMIT ) continue; |
158359
|
77 |
1360 |
if( pLoop->wsFlags & WHERE_VIRTUALTABLE ){ |
158360
|
0 |
77 |
if( pLoop->u.vtab.isOrdered |
158361
|
0 |
0 |
&& ((wctrlFlags&(WHERE_DISTINCTBY|WHERE_SORTBYGROUP))!=WHERE_DISTINCTBY) |
158366
|
4 |
1356 |
}else if( wctrlFlags & WHERE_DISTINCTBY ){ |
158376
|
1512 |
1360 |
for(i=0; i
|
158377
|
0 |
1512 |
if( MASKBIT(i) & obSat ) continue; |
158379
|
0 |
1512 |
if( NEVER(pOBExpr==0) ) continue; |
158380
|
0 |
1512 |
if( pOBExpr->op!=TK_COLUMN && pOBExpr->op!=TK_AGG_COLUMN ) continue; |
|
0 |
0 |
if( pOBExpr->op!=TK_COLUMN && pOBExpr->op!=TK_AGG_COLUMN ) continue; |
158381
|
7 |
1505 |
if( pOBExpr->iTable!=iCur ) continue; |
158384
|
1499 |
6 |
if( pTerm==0 ) continue; |
158385
|
0 |
6 |
if( pTerm->eOperator==WO_IN ){ |
158391
|
0 |
0 |
for(j=0; jnLTerm && pTerm!=pLoop->aLTerm[j]; j++){} |
|
0 |
0 |
for(j=0; jnLTerm && pTerm!=pLoop->aLTerm[j]; j++){} |
158392
|
0 |
0 |
if( j>=pLoop->nLTerm ) continue; |
158394
|
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 ){ |
158399
|
6 |
0 |
if( pColl2==0 || sqlite3StrICmp(pColl1->zName, pColl2->zName) ){ |
|
0 |
6 |
if( pColl2==0 || sqlite3StrICmp(pColl1->zName, pColl2->zName) ){ |
158407
|
1360 |
0 |
if( (pLoop->wsFlags & WHERE_ONEROW)==0 ){ |
158408
|
1307 |
53 |
if( pLoop->wsFlags & WHERE_IPK ){ |
158412
|
51 |
2 |
}else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered ){ |
|
0 |
51 |
}else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered ){ |
158425
|
50 |
1 |
&& (pLoop->wsFlags & WHERE_SKIPSCAN)==0; |
|
50 |
0 |
&& (pLoop->wsFlags & WHERE_SKIPSCAN)==0; |
158433
|
1424 |
1014 |
for(j=0; j
|
158439
|
16 |
1408 |
if( ju.btree.nEq && j>=pLoop->nSkip ){ |
|
16 |
0 |
if( ju.btree.nEq && j>=pLoop->nSkip ){ |
158454
|
16 |
0 |
if( (eOp & eqOpMask)!=0 ){ |
158455
|
0 |
16 |
if( eOp & (WO_ISNULL|WO_IS) ){ |
158462
|
0 |
0 |
}else if( ALWAYS(eOp & WO_IN) ){ |
158468
|
0 |
0 |
for(i=j+1; iu.btree.nEq; i++){ |
158469
|
0 |
0 |
if( pLoop->aLTerm[i]->pExpr==pX ){ |
158481
|
101 |
1307 |
if( pIndex ){ |
158484
|
16 |
85 |
if( iColumn==pIndex->pTable->iPKey ) iColumn = XN_ROWID; |
158493
|
1357 |
51 |
if( isOrderDistinct ){ |
158494
|
50 |
1307 |
if( iColumn>=0 |
158495
|
50 |
0 |
&& j>=pLoop->u.btree.nEq |
158496
|
50 |
0 |
&& pIndex->pTable->aCol[iColumn].notNull==0 |
158500
|
0 |
1357 |
if( iColumn==XN_EXPR ){ |
158509
|
1491 |
267 |
for(i=0; bOnce && i
|
|
1448 |
43 |
for(i=0; bOnce && i
|
158510
|
56 |
1392 |
if( MASKBIT(i) & obSat ) continue; |
158514
|
0 |
1392 |
if( NEVER(pOBExpr==0) ) continue; |
158515
|
1363 |
29 |
if( (wctrlFlags & (WHERE_GROUPBY|WHERE_DISTINCTBY))==0 ) bOnce = 0; |
158516
|
1392 |
0 |
if( iColumn>=XN_ROWID ){ |
158517
|
0 |
1392 |
if( pOBExpr->op!=TK_COLUMN && pOBExpr->op!=TK_AGG_COLUMN ) continue; |
|
0 |
0 |
if( pOBExpr->op!=TK_COLUMN && pOBExpr->op!=TK_AGG_COLUMN ) continue; |
158518
|
5 |
1387 |
if( pOBExpr->iTable!=iCur ) continue; |
158519
|
289 |
1098 |
if( pOBExpr->iColumn!=iColumn ) continue; |
158522
|
0 |
0 |
if( sqlite3ExprCompareSkip(pOBExpr, pIdxExpr, iCur) ){ |
158526
|
84 |
1014 |
if( iColumn!=XN_ROWID ){ |
158528
|
0 |
84 |
if( sqlite3StrICmp(pColl->zName, pIndex->azColl[j])!=0 ) continue; |
158530
|
2 |
1096 |
if( wctrlFlags & WHERE_DISTINCTBY ){ |
158536
|
1098 |
310 |
if( isMatch && (wctrlFlags & WHERE_GROUPBY)==0 ){ |
|
1098 |
0 |
if( isMatch && (wctrlFlags & WHERE_GROUPBY)==0 ){ |
158539
|
34 |
1064 |
if( revSet ){ |
158540
|
34 |
0 |
if( (rev ^ revIdx) |
158547
|
66 |
998 |
if( rev ) *pRevMask |= MASKBIT(iLoop); |
158551
|
1064 |
344 |
if( isMatch && (pOrderBy->a[i].fg.sortFlags & KEYINFO_ORDER_BIGNULL) ){ |
|
0 |
1064 |
if( isMatch && (pOrderBy->a[i].fg.sortFlags & KEYINFO_ORDER_BIGNULL) ){ |
158552
|
0 |
0 |
if( j==pLoop->u.btree.nEq ){ |
158558
|
1064 |
344 |
if( isMatch ){ |
158559
|
1014 |
50 |
if( iColumn==XN_ROWID ){ |
158566
|
50 |
294 |
if( j==0 || j
|
|
34 |
16 |
if( j==0 || j
|
158573
|
1014 |
344 |
if( distinctColumns ){ |
158580
|
1014 |
344 |
if( isOrderDistinct ){ |
158582
|
1016 |
1014 |
for(i=0; i
|
158585
|
1014 |
2 |
if( MASKBIT(i) & obSat ) continue; |
158588
|
0 |
2 |
if( mTerm==0 && !sqlite3ExprIsConstant(p) ) continue; |
|
0 |
0 |
if( mTerm==0 && !sqlite3ExprIsConstant(p) ) continue; |
158589
|
2 |
0 |
if( (mTerm&~orderDistinctMask)==0 ){ |
158595
|
1034 |
401 |
if( obSat==obDone ) return (i8)nOrderBy; |
158596
|
324 |
77 |
if( !isOrderDistinct ){ |
158597
|
150 |
288 |
for(i=nOrderBy-1; i>0; i--){ |
158598
|
150 |
0 |
Bitmask m = ALWAYS(i
|
158599
|
36 |
114 |
if( (obSat&m)==m ) return i; |
158683
|
0 |
133 |
if( (pWInfo->wctrlFlags & WHERE_USE_LIMIT)!=0 && pWInfo->iLimit
|
|
0 |
0 |
if( (pWInfo->wctrlFlags & WHERE_USE_LIMIT)!=0 && pWInfo->iLimit
|
158685
|
2 |
131 |
}else if( (pWInfo->wctrlFlags & WHERE_WANT_DISTINCT) ){ |
158688
|
2 |
0 |
if( nRow>10 ){ nRow -= 10; assert( 10==sqlite3LogEst(2) ); } |
158734
|
20 |
2326 |
mxChoice = (nLoop<=1) ? 1 : (nLoop==2 ? 5 : 10); |
|
20 |
0 |
mxChoice = (nLoop<=1) ? 1 : (nLoop==2 ? 5 : 10); |
158743
|
1292 |
1054 |
if( pWInfo->pOrderBy==0 || nRowEst==0 ){ |
|
646 |
646 |
if( pWInfo->pOrderBy==0 || nRowEst==0 ){ |
158753
|
0 |
2346 |
if( pSpace==0 ) return SQLITE_NOMEM_BKPT; |
158758
|
4852 |
2346 |
for(ii=mxChoice*2, pFrom=aTo; ii>0; ii--, pFrom++, pX += nLoop){ |
158761
|
646 |
1700 |
if( nOrderBy ){ |
158782
|
646 |
1700 |
if( nOrderBy ){ |
158789
|
0 |
646 |
aFrom[0].isOrdered = nLoop>0 ? -1 : nOrderBy; |
158795
|
1856 |
2346 |
for(iLoop=0; iLoop
|
158797
|
1872 |
1856 |
for(ii=0, pFrom=aFrom; ii
|
158798
|
2768 |
1872 |
for(pWLoop=pWInfo->pLoops; pWLoop; pWLoop=pWLoop->pNextLoop){ |
158806
|
36 |
2732 |
if( (pWLoop->prereq & ~pFrom->maskLoop)!=0 ) continue; |
158807
|
40 |
2692 |
if( (pWLoop->maskSelf & pFrom->maskLoop)!=0 ) continue; |
158808
|
748 |
1944 |
if( (pWLoop->wsFlags & WHERE_AUTO_INDEX)!=0 && pFrom->nRow<3 ){ |
|
740 |
8 |
if( (pWLoop->wsFlags & WHERE_AUTO_INDEX)!=0 && pFrom->nRow<3 ){ |
158823
|
687 |
1265 |
if( isOrdered<0 ){ |
158830
|
1917 |
35 |
if( isOrdered>=0 && isOrdered
|
|
146 |
1771 |
if( isOrdered>=0 && isOrdered
|
158831
|
133 |
13 |
if( aSortCost[isOrdered]==0 ){ |
158862
|
96 |
1876 |
for(jj=0, pTo=aTo; jj
|
158863
|
80 |
16 |
if( pTo->maskLoop==maskNew |
158864
|
76 |
4 |
&& ((pTo->isOrdered^isOrdered)&0x80)==0 |
158870
|
1876 |
76 |
if( jj>=nTo ){ |
158872
|
0 |
1876 |
if( nTo>=mxChoice |
158873
|
0 |
0 |
&& (rCost>mxCost || (rCost==mxCost && rUnsorted>=mxUnsorted)) |
|
0 |
0 |
&& (rCost>mxCost || (rCost==mxCost && rUnsorted>=mxUnsorted)) |
|
0 |
0 |
&& (rCost>mxCost || (rCost==mxCost && rUnsorted>=mxUnsorted)) |
158889
|
1876 |
0 |
if( nTo
|
158913
|
63 |
13 |
if( pTo->rCost
|
158914
|
5 |
58 |
|| (pTo->rCost==rCost |
158915
|
5 |
0 |
&& (pTo->nRow
|
158916
|
5 |
0 |
|| (pTo->nRow==nOut && pTo->rUnsorted<=rUnsorted) |
|
5 |
0 |
|| (pTo->nRow==nOut && pTo->rUnsorted<=rUnsorted) |
158959
|
1866 |
68 |
if( nTo>=mxChoice ){ |
158963
|
0 |
1866 |
for(jj=1, pTo=&aTo[1]; jj
|
158964
|
0 |
0 |
if( pTo->rCost>mxCost |
158965
|
0 |
0 |
|| (pTo->rCost==mxCost && pTo->rUnsorted>mxUnsorted) |
|
0 |
0 |
|| (pTo->rCost==mxCost && pTo->rUnsorted>mxUnsorted) |
158999
|
0 |
2346 |
if( nFrom==0 ){ |
159007
|
4 |
2346 |
for(ii=1; ii
|
159008
|
4 |
0 |
if( pFrom->rCost>aFrom[ii].rCost ) pFrom = &aFrom[ii]; |
159012
|
1856 |
2346 |
for(iLoop=0; iLoop
|
159018
|
8 |
2338 |
if( (pWInfo->wctrlFlags & WHERE_WANT_DISTINCT)!=0 |
159019
|
0 |
8 |
&& (pWInfo->wctrlFlags & WHERE_DISTINCTBY)==0 |
159020
|
0 |
0 |
&& pWInfo->eDistinct==WHERE_DISTINCT_NOOP |
159021
|
0 |
0 |
&& nRowEst |
159026
|
0 |
0 |
if( rc==pWInfo->pResultSet->nExpr ){ |
159031
|
1292 |
1054 |
if( pWInfo->pOrderBy ){ |
159033
|
8 |
1284 |
if( pWInfo->wctrlFlags & WHERE_DISTINCTBY ){ |
159034
|
0 |
8 |
if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){ |
159039
|
750 |
534 |
if( pWInfo->nOBSat<=0 ){ |
159041
|
750 |
0 |
if( nLoop>0 ){ |
159043
|
750 |
0 |
if( (wsFlags & WHERE_ONEROW)==0 |
159044
|
750 |
0 |
&& (wsFlags&(WHERE_IPK|WHERE_COLUMN_IN))!=(WHERE_IPK|WHERE_COLUMN_IN) |
159051
|
516 |
234 |
if( rc==pWInfo->pOrderBy->nExpr ){ |
159057
|
534 |
0 |
}else if( nLoop |
159058
|
534 |
0 |
&& pWInfo->nOBSat==1 |
159059
|
16 |
518 |
&& (pWInfo->wctrlFlags & (WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX))!=0 |
159064
|
2 |
1290 |
if( (pWInfo->wctrlFlags & WHERE_SORTBYGROUP) |
159065
|
0 |
2 |
&& pWInfo->nOBSat==pWInfo->pOrderBy->nExpr && nLoop>0 |
|
0 |
0 |
&& pWInfo->nOBSat==pWInfo->pOrderBy->nExpr && nLoop>0 |
159072
|
0 |
0 |
if( nOrder==pWInfo->pOrderBy->nExpr ){ |
159111
|
5 |
1735 |
if( pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE ) return 0; |
159115
|
136 |
1599 |
if( IsVirtual(pTab) ) return 0; |
159116
|
1599 |
0 |
if( pItem->fg.isIndexedBy || pItem->fg.notIndexed ){ |
|
0 |
1599 |
if( pItem->fg.isIndexedBy || pItem->fg.notIndexed ){ |
159127
|
556 |
1043 |
while( pTerm && pTerm->prereqRight ) pTerm = whereScanNext(&scan); |
|
0 |
556 |
while( pTerm && pTerm->prereqRight ) pTerm = whereScanNext(&scan); |
159128
|
556 |
1043 |
if( pTerm ){ |
159137
|
62 |
1038 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
159140
|
60 |
2 |
if( !IsUniqueIndex(pIdx) |
159141
|
60 |
0 |
|| pIdx->pPartIdxWhere!=0 |
159142
|
1 |
59 |
|| pIdx->nKeyCol>ArraySize(pLoop->aLTermSpace) |
159144
|
9 |
50 |
opMask = pIdx->uniqNotNull ? (WO_EQ|WO_IS) : WO_EQ; |
159145
|
75 |
5 |
for(j=0; jnKeyCol; j++){ |
159147
|
21 |
54 |
while( pTerm && pTerm->prereqRight ) pTerm = whereScanNext(&scan); |
|
0 |
21 |
while( pTerm && pTerm->prereqRight ) pTerm = whereScanNext(&scan); |
159148
|
54 |
21 |
if( pTerm==0 ) break; |
159152
|
54 |
5 |
if( j!=pIdx->nKeyCol ) continue; |
159154
|
5 |
0 |
if( pIdx->isCovering || (pItem->colUsed & pIdx->colNotIdxed)==0 ){ |
|
0 |
5 |
if( pIdx->isCovering || (pItem->colUsed & pIdx->colNotIdxed)==0 ){ |
159165
|
561 |
1038 |
if( pLoop->wsFlags ){ |
159172
|
0 |
561 |
if( pWInfo->pOrderBy ) pWInfo->nOBSat = pWInfo->pOrderBy->nExpr; |
159173
|
0 |
561 |
if( pWInfo->wctrlFlags & WHERE_WANT_DISTINCT ){ |
159176
|
0 |
561 |
if( scan.iEquiv>1 ) pLoop->wsFlags |= WHERE_TRANSCONS; |
159194
|
9 |
43 |
if( pExpr->op==TK_FUNCTION && ExprHasProperty(pExpr, EP_ConstFunc)==0 ){ |
|
0 |
9 |
if( pExpr->op==TK_FUNCTION && ExprHasProperty(pExpr, EP_ConstFunc)==0 ){ |
159284
|
8 |
2 |
if( pWInfo->pOrderBy ){ |
159287
|
10 |
10 |
for(i=pWInfo->nLevel-1; i>=1; i--){ |
159293
|
7 |
3 |
if( (pItem->fg.jointype & (JT_LEFT|JT_RIGHT))!=JT_LEFT ) continue; |
159294
|
2 |
1 |
if( (pWInfo->wctrlFlags & WHERE_WANT_DISTINCT)==0 |
159295
|
2 |
0 |
&& (pLoop->wsFlags & WHERE_ONEROW)==0 |
159299
|
0 |
1 |
if( (tabUsed & pLoop->maskSelf)!=0 ) continue; |
159301
|
1 |
0 |
for(pTerm=pWInfo->sWC.a; pTerm
|
159302
|
1 |
0 |
if( (pTerm->prereqAll & pLoop->maskSelf)!=0 ){ |
159303
|
0 |
1 |
if( !ExprHasProperty(pTerm->pExpr, EP_OuterON) |
159304
|
0 |
0 |
|| pTerm->pExpr->w.iJoin!=pItem->iCursor |
159310
|
1 |
0 |
if( pTerm
|
159313
|
0 |
0 |
for(pTerm=pWInfo->sWC.a; pTerm
|
159314
|
0 |
0 |
if( (pTerm->prereqAll & pLoop->maskSelf)!=0 ){ |
159318
|
0 |
0 |
if( i!=pWInfo->nLevel-1 ){ |
159355
|
11 |
11 |
for(i=1; inLevel; i++){ |
159358
|
0 |
11 |
if( (pLoop->wsFlags & reqFlags)==reqFlags |
159360
|
0 |
0 |
&& ALWAYS((pLoop->wsFlags & (WHERE_IPK|WHERE_INDEXED))!=0) |
159365
|
0 |
0 |
if( nSearch > pTab->nRowLogEst |
159366
|
0 |
0 |
&& (pTab->tabFlags & TF_HasStat1)!=0 |
159510
|
642 |
1619 |
if( pOrderBy && pOrderBy->nExpr>=BMS ) pOrderBy = 0; |
|
0 |
642 |
if( pOrderBy && pOrderBy->nExpr>=BMS ) pOrderBy = 0; |
159516
|
0 |
2261 |
if( pTabList->nSrc>BMS ){ |
159526
|
2256 |
5 |
nTabList = (wctrlFlags & WHERE_OR_SUBCLAUSE) ? 1 : pTabList->nSrc; |
159537
|
0 |
2261 |
if( db->mallocFailed ){ |
159582
|
510 |
1751 |
if( nTabList==0 ){ |
159583
|
0 |
510 |
if( pOrderBy ) pWInfo->nOBSat = pOrderBy->nExpr; |
159584
|
0 |
510 |
if( (wctrlFlags & WHERE_WANT_DISTINCT)!=0 |
159585
|
0 |
0 |
&& OptimizationEnabled(db, SQLITE_DistinctOpt) |
159609
|
11 |
1751 |
}while( (++ii)nSrc ); |
159625
|
0 |
2261 |
if( pParse->nErr ) goto whereBeginError; |
159638
|
1687 |
2261 |
for(ii=0; iinBase; ii++){ |
159640
|
0 |
1687 |
if( pT->wtFlags & TERM_VIRTUAL ) continue; |
159641
|
62 |
1625 |
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)) ){ |
159647
|
4 |
2257 |
if( wctrlFlags & WHERE_WANT_DISTINCT ){ |
159648
|
0 |
4 |
if( OptimizationDisabled(db, SQLITE_DistinctOpt) ){ |
159653
|
0 |
4 |
}else if( isDistinctRedundant(pParse, pTabList, &pWInfo->sWC, pResultSet) ){ |
159656
|
4 |
0 |
}else if( pOrderBy==0 ){ |
159688
|
1740 |
521 |
if( nTabList!=1 || whereShortCut(&sWLB)==0 ){ |
|
1179 |
561 |
if( nTabList!=1 || whereShortCut(&sWLB)==0 ){ |
159690
|
0 |
1700 |
if( rc ) goto whereBeginError; |
159715
|
0 |
1700 |
if( db->mallocFailed ) goto whereBeginError; |
159716
|
646 |
1054 |
if( pWInfo->pOrderBy ){ |
159718
|
0 |
646 |
if( db->mallocFailed ) goto whereBeginError; |
159721
|
1615 |
646 |
if( pWInfo->pOrderBy==0 && (db->flags & SQLITE_ReverseOrder)!=0 ){ |
|
0 |
1615 |
if( pWInfo->pOrderBy==0 && (db->flags & SQLITE_ReverseOrder)!=0 ){ |
159724
|
0 |
2261 |
if( pParse->nErr ){ |
159766
|
11 |
2250 |
if( pWInfo->nLevel>=2 |
159767
|
10 |
1 |
&& pResultSet!=0 /* these two combine to guarantee */ |
159768
|
10 |
0 |
&& 0==(wctrlFlags & WHERE_AGG_DISTINCT) /* condition (1) above */ |
159769
|
10 |
0 |
&& OptimizationEnabled(db, SQLITE_OmitNoopJoin) |
159779
|
11 |
2250 |
if( pWInfo->nLevel>=2 |
159780
|
11 |
0 |
&& OptimizationEnabled(db, SQLITE_BloomFilter) |
159814
|
340 |
1921 |
if( (wctrlFlags & WHERE_ONEPASS_DESIRED)!=0 ){ |
159818
|
40 |
300 |
if( bOnerow || ( |
|
33 |
7 |
if( bOnerow || ( |
159820
|
32 |
1 |
&& !IsVirtual(pTabList->a[0].pTab) |
159821
|
0 |
32 |
&& (0==(wsFlags & WHERE_MULTI_OR) || (wctrlFlags & WHERE_DUPLICATES_OK)) |
|
0 |
0 |
&& (0==(wsFlags & WHERE_MULTI_OR) || (wctrlFlags & WHERE_DUPLICATES_OK)) |
159823
|
300 |
32 |
pWInfo->eOnePass = bOnerow ? ONEPASS_SINGLE : ONEPASS_MULTI; |
159824
|
332 |
0 |
if( HasRowid(pTabList->a[0].pTab) && (wsFlags & WHERE_IDX_ONLY) ){ |
|
9 |
323 |
if( HasRowid(pTabList->a[0].pTab) && (wsFlags & WHERE_IDX_ONLY) ){ |
159825
|
9 |
0 |
if( wctrlFlags & WHERE_ONEPASS_MULTIROW ){ |
159836
|
1762 |
2261 |
for(ii=0, pLevel=pWInfo->a; ii
|
159845
|
1740 |
22 |
if( (pTab->tabFlags & TF_Ephemeral)!=0 || IsView(pTab) ){ |
|
1740 |
0 |
if( (pTab->tabFlags & TF_Ephemeral)!=0 || IsView(pTab) ){ |
159849
|
148 |
1592 |
if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)!=0 ){ |
159853
|
1592 |
0 |
}else if( IsVirtual(pTab) ){ |
159857
|
1580 |
12 |
if( ((pLoop->wsFlags & WHERE_IDX_ONLY)==0 |
159858
|
1 |
1579 |
&& (wctrlFlags & WHERE_OR_SUBCLAUSE)==0) |
159859
|
0 |
13 |
|| (pTabItem->fg.jointype & (JT_LTORJ|JT_RIGHT))!=0 |
159862
|
332 |
1247 |
if( pWInfo->eOnePass!=ONEPASS_OFF ){ |
159870
|
1247 |
332 |
if( pWInfo->eOnePass==ONEPASS_OFF |
159871
|
1247 |
0 |
&& pTab->nCol
|
159872
|
1247 |
0 |
&& (pTab->tabFlags & (TF_HasGenerated|TF_WithoutRowid))==0 |
159873
|
1246 |
1 |
&& (pLoop->wsFlags & (WHERE_AUTO_INDEX|WHERE_BLOOMFILTER))==0 |
159880
|
4237 |
1246 |
for(; b; b=b>>1, n++){} |
159899
|
43 |
1719 |
if( pLoop->wsFlags & WHERE_INDEXED ){ |
159905
|
0 |
43 |
if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIx) |
|
0 |
0 |
if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIx) |
159906
|
0 |
0 |
&& (wctrlFlags & WHERE_OR_SUBCLAUSE)!=0 |
159912
|
9 |
34 |
}else if( pWInfo->eOnePass!=ONEPASS_OFF ){ |
159916
|
9 |
0 |
while( ALWAYS(pJ) && pJ!=pIx ){ |
|
0 |
9 |
while( ALWAYS(pJ) && pJ!=pIx ){ |
159922
|
26 |
8 |
}else if( iAuxArg && (wctrlFlags & WHERE_OR_SUBCLAUSE)!=0 ){ |
|
4 |
22 |
}else if( iAuxArg && (wctrlFlags & WHERE_OR_SUBCLAUSE)!=0 ){ |
159932
|
43 |
0 |
if( op ){ |
159935
|
43 |
0 |
if( (pLoop->wsFlags & WHERE_CONSTRAINT)!=0 |
159936
|
23 |
20 |
&& (pLoop->wsFlags & (WHERE_COLUMN_RANGE|WHERE_SKIPSCAN))==0 |
159937
|
23 |
0 |
&& (pLoop->wsFlags & WHERE_BIGNULL_SORT)==0 |
159938
|
23 |
0 |
&& (pLoop->wsFlags & WHERE_IN_SEEKSCAN)==0 |
159939
|
23 |
0 |
&& (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)==0 |
159940
|
23 |
0 |
&& pWInfo->eDistinct!=WHERE_DISTINCT_ORDERED |
159962
|
1740 |
22 |
if( iDb>=0 ) sqlite3CodeVerifySchema(pParse, iDb); |
159963
|
0 |
1762 |
if( (pTabItem->fg.jointype & JT_RIGHT)!=0 |
159964
|
0 |
0 |
&& (pLevel->pRJ = sqlite3WhereMalloc(pWInfo, sizeof(WhereRightJoin)))!=0 |
159973
|
0 |
0 |
if( HasRowid(pTab) ){ |
159977
|
0 |
0 |
if( pInfo ){ |
159996
|
0 |
2261 |
if( db->mallocFailed ) goto whereBeginError; |
160002
|
1762 |
2261 |
for(ii=0; ii
|
160006
|
0 |
1762 |
if( pParse->nErr ) goto whereBeginError; |
160010
|
0 |
1762 |
if( pSrc->fg.isMaterialized ){ |
160011
|
0 |
0 |
if( pSrc->fg.isCorrelated ){ |
160019
|
1 |
1761 |
if( (wsFlags & (WHERE_AUTO_INDEX|WHERE_BLOOMFILTER))!=0 ){ |
160020
|
1 |
0 |
if( (wsFlags & WHERE_AUTO_INDEX)!=0 ){ |
160028
|
0 |
1 |
if( db->mallocFailed ) goto whereBeginError; |
160036
|
1760 |
2 |
if( (wsFlags&WHERE_MULTI_OR)==0 && (wctrlFlags&WHERE_OR_SUBCLAUSE)==0 ){ |
160048
|
0 |
0 |
if( pWInfo ){ |
160115
|
1762 |
2261 |
for(i=pWInfo->nLevel-1; i>=0; i--){ |
160118
|
0 |
1762 |
if( pLevel->pRJ ){ |
160130
|
1198 |
564 |
if( pLevel->op!=OP_Noop ){ |
160135
|
0 |
1198 |
if( pWInfo->eDistinct==WHERE_DISTINCT_ORDERED |
160136
|
0 |
0 |
&& i==pWInfo->nLevel-1 /* Ticket [ef9318757b152e3] 2017-10-21 */ |
160137
|
0 |
0 |
&& (pLoop->wsFlags & WHERE_INDEXED)!=0 |
160138
|
0 |
0 |
&& (pIdx = pLoop->u.btree.pIndex)->hasStat1 |
160139
|
0 |
0 |
&& (n = pLoop->u.btree.nDistinctCol)>0 |
160140
|
0 |
0 |
&& pIdx->aiRowLogEst[n]>=36 |
160144
|
0 |
0 |
for(j=0; j
|
160148
|
0 |
0 |
op = pLevel->op==OP_Prev ? OP_SeekLT : OP_SeekGT; |
160156
|
1198 |
0 |
if( pLevel->addrCont ) sqlite3VdbeResolveLabel(v, pLevel->addrCont); |
160163
|
0 |
1198 |
if( pLevel->regBignull ){ |
160169
|
0 |
1198 |
if( addrSeek ) sqlite3VdbeJumpHere(v, addrSeek); |
160171
|
564 |
0 |
}else if( pLevel->addrCont ){ |
160174
|
3 |
1759 |
if( (pLoop->wsFlags & WHERE_IN_ABLE)!=0 && pLevel->u.in.nIn>0 ){ |
|
3 |
0 |
if( (pLoop->wsFlags & WHERE_IN_ABLE)!=0 && pLevel->u.in.nIn>0 ){ |
160178
|
3 |
3 |
for(j=pLevel->u.in.nIn, pIn=&pLevel->u.in.aInLoop[j-1]; j>0; j--, pIn--){ |
160182
|
3 |
0 |
if( pIn->eEndLoopOp!=OP_Noop ){ |
160183
|
0 |
3 |
if( pIn->nPrefix ){ |
160186
|
0 |
0 |
&& (pLoop->wsFlags & WHERE_IN_EARLYOUT)!=0; |
|
0 |
0 |
&& (pLoop->wsFlags & WHERE_IN_EARLYOUT)!=0; |
160187
|
0 |
0 |
if( pLevel->iLeftJoin ){ |
160200
|
0 |
0 |
if( bEarlyOut ){ |
160221
|
0 |
1762 |
if( pLevel->pRJ ){ |
160225
|
0 |
1762 |
if( pLevel->addrSkip ){ |
160232
|
0 |
1762 |
if( pLevel->addrLikeRep ){ |
160238
|
3 |
1759 |
if( pLevel->iLeftJoin ){ |
160242
|
3 |
0 |
if( (ws & WHERE_IDX_ONLY)==0 ){ |
160246
|
3 |
0 |
if( (ws & WHERE_INDEXED) |
160247
|
0 |
3 |
|| ((ws & WHERE_MULTI_OR) && pLevel->u.pCoveringIdx) |
|
0 |
0 |
|| ((ws & WHERE_MULTI_OR) && pLevel->u.pCoveringIdx) |
160249
|
0 |
0 |
if( ws & WHERE_MULTI_OR ){ |
160257
|
0 |
3 |
if( pLevel->op==OP_Return ){ |
160269
|
0 |
2261 |
if( pWInfo->pExprMods ) whereUndoExprMods(pWInfo); |
160270
|
1762 |
2261 |
for(i=0, pLevel=pWInfo->a; inLevel; i++, pLevel++){ |
160283
|
0 |
1762 |
if( pLevel->pRJ ){ |
160292
|
22 |
1740 |
if( pTabItem->fg.viaCoroutine ){ |
160310
|
44 |
1696 |
if( pLoop->wsFlags & (WHERE_INDEXED|WHERE_IDX_ONLY) ){ |
160312
|
2 |
1694 |
}else if( pLoop->wsFlags & WHERE_MULTI_OR ){ |
160315
|
44 |
1696 |
if( pIdx |
160316
|
44 |
0 |
&& !db->mallocFailed |
160318
|
9 |
35 |
if( pWInfo->eOnePass==ONEPASS_OFF || !HasRowid(pIdx->pTable) ){ |
|
0 |
9 |
if( pWInfo->eOnePass==ONEPASS_OFF || !HasRowid(pIdx->pTable) ){ |
160338
|
129 |
416 |
if( pOp->p1!=pLevel->iTabCur ){ |
160340
|
100 |
29 |
}else if( pOp->opcode==OP_Column |
160352
|
0 |
100 |
if( !HasRowid(pTab) ){ |
160361
|
51 |
49 |
if( x>=0 ){ |
160381
|
4 |
25 |
}else if( pOp->opcode==OP_Rowid ){ |
160385
|
0 |
25 |
}else if( pOp->opcode==OP_IfNullRow ){ |
160392
|
501 |
44 |
}while( (++pOp)
|
160566
|
0 |
0 |
if( p ) (*p)++; |
160572
|
0 |
0 |
sqlite3_result_int64(pCtx, (p ? *p : 0)); |
160598
|
0 |
0 |
if( p ) p->nStep = 1; |
160605
|
0 |
0 |
if( p ){ |
160606
|
0 |
0 |
if( p->nStep ){ |
160630
|
0 |
0 |
if( p ){ |
160638
|
0 |
0 |
if( ((i64)fVal)!=fVal ) goto error_out; |
160645
|
0 |
0 |
if( iVal<=0 ) goto error_out; |
160648
|
0 |
0 |
if( iVal==p->nStep ){ |
160650
|
0 |
0 |
if( !p->pValue ){ |
160667
|
0 |
0 |
if( p && p->pValue ){ |
|
0 |
0 |
if( p && p->pValue ){ |
160683
|
0 |
0 |
if( p && p->pValue==0 ){ |
|
0 |
0 |
if( p && p->pValue==0 ){ |
160685
|
0 |
0 |
if( !p->pValue ){ |
160695
|
0 |
0 |
if( p && p->pValue ){ |
|
0 |
0 |
if( p && p->pValue ){ |
160717
|
0 |
0 |
if( p ){ |
160719
|
0 |
0 |
if( p->nValue==0 ){ |
160729
|
0 |
0 |
if( p ){ |
160750
|
0 |
0 |
if( p ){ |
160768
|
0 |
0 |
if( p ){ |
160770
|
0 |
0 |
if( p->nTotal>1 ){ |
160795
|
0 |
0 |
if( p ){ |
160813
|
0 |
0 |
if( p ){ |
160843
|
0 |
0 |
if( p ){ |
160844
|
0 |
0 |
if( p->nTotal==0 ){ |
160846
|
0 |
0 |
if( p->nParam<=0 ){ |
160869
|
0 |
0 |
if( p && p->nParam>0 ){ |
|
0 |
0 |
if( p && p->nParam>0 ){ |
160871
|
0 |
0 |
if( nSize==0 ){ |
160880
|
0 |
0 |
if( iRow
|
160909
|
0 |
0 |
if( p ){ |
160912
|
0 |
0 |
if( p->pVal==0 ){ |
160928
|
0 |
0 |
if( ALWAYS(p) ){ |
160930
|
0 |
0 |
if( p->nVal==0 ){ |
160939
|
0 |
0 |
if( p && p->pVal ){ |
|
0 |
0 |
if( p && p->pVal ){ |
160946
|
0 |
0 |
if( p && p->pVal ){ |
|
0 |
0 |
if( p && p->pVal ){ |
161046
|
0 |
0 |
for(p=pList; p; p=p->pNextWin){ |
161047
|
0 |
0 |
if( sqlite3StrICmp(p->zName, zName)==0 ) break; |
161049
|
0 |
0 |
if( p==0 ){ |
161078
|
0 |
0 |
if( pWin->zName && pWin->eFrmType==0 ){ |
|
0 |
0 |
if( pWin->zName && pWin->eFrmType==0 ){ |
161080
|
0 |
0 |
if( p==0 ) return; |
161092
|
0 |
0 |
if( (pWin->eFrmType==TK_RANGE) |
161093
|
0 |
0 |
&& (pWin->pStart || pWin->pEnd) |
|
0 |
0 |
&& (pWin->pStart || pWin->pEnd) |
161094
|
0 |
0 |
&& (pWin->pOrderBy==0 || pWin->pOrderBy->nExpr!=1) |
|
0 |
0 |
&& (pWin->pOrderBy==0 || pWin->pOrderBy->nExpr!=1) |
161100
|
0 |
0 |
if( pFunc->funcFlags & SQLITE_FUNC_WINDOW ){ |
161102
|
0 |
0 |
if( pWin->pFilter ){ |
161123
|
0 |
0 |
for(i=0; i
|
161124
|
0 |
0 |
if( pFunc->zName==aUp[i].zFunc ){ |
161132
|
0 |
0 |
if( pWin->eStart==TK_FOLLOWING ){ |
161172
|
0 |
0 |
if( p->pSubSelect ){ |
161173
|
0 |
0 |
if( pExpr->op!=TK_COLUMN ){ |
161178
|
0 |
0 |
for(i=0; i
|
161179
|
0 |
0 |
if( pExpr->iTable==p->pSrc->a[i].iCursor ) break; |
161181
|
0 |
0 |
if( i==nSrc ) return WRC_Continue; |
161188
|
0 |
0 |
if( !ExprHasProperty(pExpr, EP_WinFunc) ){ |
161192
|
0 |
0 |
for(pWin=p->pWin; pWin; pWin=pWin->pNextWin){ |
161193
|
0 |
0 |
if( pExpr->y.pWin==pWin ){ |
161204
|
0 |
0 |
if( pParse->db->mallocFailed ) return WRC_Abort; |
161205
|
0 |
0 |
if( p->pSub ){ |
161207
|
0 |
0 |
for(i=0; ipSub->nExpr; i++){ |
161208
|
0 |
0 |
if( 0==sqlite3ExprCompare(0, p->pSub->a[i].pExpr, pExpr, -1) ){ |
161214
|
0 |
0 |
if( iCol<0 ){ |
161216
|
0 |
0 |
if( pDup && pDup->op==TK_AGG_FUNCTION ) pDup->op = TK_FUNCTION; |
|
0 |
0 |
if( pDup && pDup->op==TK_AGG_FUNCTION ) pDup->op = TK_FUNCTION; |
161219
|
0 |
0 |
if( p->pSub ){ |
161228
|
0 |
0 |
pExpr->iColumn = (iCol<0 ? p->pSub->nExpr-1: iCol); |
161233
|
0 |
0 |
if( pParse->db->mallocFailed ) return WRC_Abort; |
161246
|
0 |
0 |
if( pSave==pSelect ){ |
161310
|
0 |
0 |
if( pAppend ){ |
161312
|
0 |
0 |
int nInit = pList ? pList->nExpr : 0; |
161313
|
0 |
0 |
for(i=0; inExpr; i++){ |
161317
|
0 |
0 |
if( db->mallocFailed ){ |
161321
|
0 |
0 |
if( bIntToNull ){ |
161325
|
0 |
0 |
if( sqlite3ExprIsInteger(pSub, &iDummy) ){ |
161332
|
0 |
0 |
if( pList ) pList->a[nInit+i].fg.sortFlags = pAppend->a[i].fg.sortFlags; |
161347
|
0 |
0 |
if( pExpr->op==TK_AGG_FUNCTION |
161348
|
0 |
0 |
&& pExpr->op2>=pWalker->walkerDepth |
161356
|
0 |
0 |
if( pExpr->op==TK_AGG_FUNCTION && pExpr->pAggInfo==0 ){ |
|
0 |
0 |
if( pExpr->op==TK_AGG_FUNCTION && pExpr->pAggInfo==0 ){ |
161373
|
0 |
2004 |
if( p->pWin |
161374
|
0 |
0 |
&& p->pPrior==0 |
161375
|
0 |
0 |
&& ALWAYS((p->selFlags & SF_WinRewrite)==0) |
161376
|
0 |
0 |
&& ALWAYS(!IN_RENAME_OBJECT) |
161396
|
0 |
0 |
if( pTab==0 ){ |
161401
|
0 |
0 |
if( (p->selFlags & SF_Aggregate)==0 ){ |
161419
|
0 |
0 |
if( pSort && p->pOrderBy && p->pOrderBy->nExpr<=pSort->nExpr ){ |
|
0 |
0 |
if( pSort && p->pOrderBy && p->pOrderBy->nExpr<=pSort->nExpr ){ |
|
0 |
0 |
if( pSort && p->pOrderBy && p->pOrderBy->nExpr<=pSort->nExpr ){ |
161422
|
0 |
0 |
if( sqlite3ExprListCompare(pSort, p->pOrderBy, -1)==0 ){ |
161437
|
0 |
0 |
pMWin->nBufferCol = (pSublist ? pSublist->nExpr : 0); |
161449
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){ |
161454
|
0 |
0 |
if( pWin->pWFunc->funcFlags & SQLITE_FUNC_SUBTYPE ){ |
161456
|
0 |
0 |
pWin->iArgCol = (pSublist ? pSublist->nExpr : 0); |
161459
|
0 |
0 |
pWin->iArgCol = (pSublist ? pSublist->nExpr : 0); |
161462
|
0 |
0 |
if( pWin->pFilter ){ |
161477
|
0 |
0 |
if( pSublist==0 ){ |
161493
|
0 |
0 |
if( p->pSrc ){ |
161500
|
0 |
0 |
if( pTab2==0 ){ |
161519
|
0 |
0 |
if( db->mallocFailed ) rc = SQLITE_NOMEM; |
161536
|
0 |
0 |
if( p->ppThis ){ |
161538
|
0 |
0 |
if( p->pNextWin ) p->pNextWin->ppThis = p->ppThis; |
161547
|
0 |
0 |
if( p ){ |
161564
|
0 |
0 |
while( p ){ |
161579
|
0 |
0 |
if( 0==sqlite3ExprIsConstant(pExpr) ){ |
161580
|
0 |
0 |
if( IN_RENAME_OBJECT ) sqlite3RenameExprUnmap(pParse, pExpr); |
161611
|
0 |
0 |
if( eType==0 ){ |
161630
|
0 |
0 |
if( (eStart==TK_CURRENT && eEnd==TK_PRECEDING) |
|
0 |
0 |
if( (eStart==TK_CURRENT && eEnd==TK_PRECEDING) |
161631
|
0 |
0 |
|| (eStart==TK_FOLLOWING && (eEnd==TK_PRECEDING || eEnd==TK_CURRENT)) |
|
0 |
0 |
|| (eStart==TK_FOLLOWING && (eEnd==TK_PRECEDING || eEnd==TK_CURRENT)) |
|
0 |
0 |
|| (eStart==TK_FOLLOWING && (eEnd==TK_PRECEDING || eEnd==TK_CURRENT)) |
161638
|
0 |
0 |
if( pWin==0 ) goto windowAllocErr; |
161642
|
0 |
0 |
if( eExclude==0 && OptimizationDisabled(pParse->db, SQLITE_WindowFunc) ){ |
|
0 |
0 |
if( eExclude==0 && OptimizationDisabled(pParse->db, SQLITE_WindowFunc) ){ |
161669
|
0 |
0 |
if( pWin ){ |
161672
|
0 |
0 |
if( pBase ){ |
161690
|
0 |
0 |
if( pWin->zBase ){ |
161693
|
0 |
0 |
if( pExist ){ |
161696
|
0 |
0 |
if( pWin->pPartition ){ |
161698
|
0 |
0 |
}else if( pExist->pOrderBy && pWin->pOrderBy ){ |
|
0 |
0 |
}else if( pExist->pOrderBy && pWin->pOrderBy ){ |
161700
|
0 |
0 |
}else if( pExist->bImplicitFrame==0 ){ |
161703
|
0 |
0 |
if( zErr ){ |
161709
|
0 |
0 |
if( pExist->pOrderBy ){ |
161724
|
0 |
0 |
if( p ){ |
161730
|
0 |
0 |
if( (p->flags & EP_Distinct) && pWin->eFrmType!=TK_FILTER ){ |
|
0 |
0 |
if( (p->flags & EP_Distinct) && pWin->eFrmType!=TK_FILTER ){ |
161747
|
0 |
0 |
if( pSel ){ |
161748
|
0 |
0 |
if( 0==pSel->pWin || 0==sqlite3WindowCompare(0, pSel->pWin, pWin, 0) ){ |
|
0 |
0 |
if( 0==pSel->pWin || 0==sqlite3WindowCompare(0, pSel->pWin, pWin, 0) ){ |
161750
|
0 |
0 |
if( pSel->pWin ){ |
161756
|
0 |
0 |
if( sqlite3ExprListCompare(pWin->pPartition, pSel->pWin->pPartition,-1) ){ |
161775
|
0 |
0 |
if( NEVER(p1==0) || NEVER(p2==0) ) return 1; |
|
0 |
0 |
if( NEVER(p1==0) || NEVER(p2==0) ) return 1; |
161776
|
0 |
0 |
if( p1->eFrmType!=p2->eFrmType ) return 1; |
161777
|
0 |
0 |
if( p1->eStart!=p2->eStart ) return 1; |
161778
|
0 |
0 |
if( p1->eEnd!=p2->eEnd ) return 1; |
161779
|
0 |
0 |
if( p1->eExclude!=p2->eExclude ) return 1; |
161780
|
0 |
0 |
if( sqlite3ExprCompare(pParse, p1->pStart, p2->pStart, -1) ) return 1; |
161781
|
0 |
0 |
if( sqlite3ExprCompare(pParse, p1->pEnd, p2->pEnd, -1) ) return 1; |
161782
|
0 |
0 |
if( (res = sqlite3ExprListCompare(p1->pPartition, p2->pPartition, -1)) ){ |
161785
|
0 |
0 |
if( (res = sqlite3ExprListCompare(p1->pOrderBy, p2->pOrderBy, -1)) ){ |
161788
|
0 |
0 |
if( bFilter ){ |
161789
|
0 |
0 |
if( (res = sqlite3ExprCompare(pParse, p1->pFilter, p2->pFilter, -1)) ){ |
161815
|
0 |
0 |
if( pMWin->pPartition ){ |
161825
|
0 |
0 |
if( pMWin->eExclude ){ |
161835
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){ |
161837
|
0 |
0 |
if( (p->funcFlags & SQLITE_FUNC_MINMAX) && pWin->eStart!=TK_UNBOUNDED ){ |
|
0 |
0 |
if( (p->funcFlags & SQLITE_FUNC_MINMAX) && pWin->eStart!=TK_UNBOUNDED ){ |
161853
|
0 |
0 |
if( pKeyInfo && pWin->pWFunc->zName[1]=='i' ){ |
|
0 |
0 |
if( pKeyInfo && pWin->pWFunc->zName[1]=='i' ){ |
161861
|
0 |
0 |
else if( p->zName==nth_valueName || p->zName==first_valueName ){ |
|
0 |
0 |
else if( p->zName==nth_valueName || p->zName==first_valueName ){ |
161869
|
0 |
0 |
else if( p->zName==leadName || p->zName==lagName ){ |
|
0 |
0 |
else if( p->zName==leadName || p->zName==lagName ){ |
161902
|
0 |
0 |
if( eCond>=WINDOW_STARTING_NUM ){ |
161940
|
0 |
0 |
return (pList ? pList->nExpr : 0); |
162035
|
0 |
0 |
if( pOrderBy ){ |
162038
|
0 |
0 |
int iColOff = pMWin->nBufferCol + (pPart ? pPart->nExpr : 0); |
162040
|
0 |
0 |
for(i=0; inExpr; i++){ |
162075
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){ |
162078
|
0 |
0 |
int nArg = pWin->bExprArgs ? 0 : windowArgCount(pWin); |
162087
|
0 |
0 |
for(i=0; i
|
162088
|
0 |
0 |
if( i!=1 || pFunc->zName!=nth_valueName ){ |
|
0 |
0 |
if( i!=1 || pFunc->zName!=nth_valueName ){ |
162096
|
0 |
0 |
if( pMWin->regStartRowid==0 |
162097
|
0 |
0 |
&& (pFunc->funcFlags & SQLITE_FUNC_MINMAX) |
162098
|
0 |
0 |
&& (pWin->eStart!=TK_UNBOUNDED) |
162102
|
0 |
0 |
if( bInverse==0 ){ |
162114
|
0 |
0 |
}else if( pWin->regApp ){ |
162120
|
0 |
0 |
}else if( pFunc->xSFunc!=noopStepFunc ){ |
162122
|
0 |
0 |
if( pWin->pFilter ){ |
162134
|
0 |
0 |
if( pWin->bExprArgs ){ |
162143
|
0 |
0 |
for(iEnd=sqlite3VdbeCurrentAddr(v); iOp
|
162145
|
0 |
0 |
if( pOp->opcode==OP_Column && pOp->p1==pMWin->iEphCsr ){ |
|
0 |
0 |
if( pOp->opcode==OP_Column && pOp->p1==pMWin->iEphCsr ){ |
162150
|
0 |
0 |
if( pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL ){ |
162157
|
0 |
0 |
sqlite3VdbeAddOp3(v, bInverse? OP_AggInverse : OP_AggStep, |
162161
|
0 |
0 |
if( pWin->bExprArgs ){ |
162164
|
0 |
0 |
if( addrIf ) sqlite3VdbeJumpHere(v, addrIf); |
162188
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){ |
162189
|
0 |
0 |
if( pMWin->regStartRowid==0 |
162190
|
0 |
0 |
&& (pWin->pWFunc->funcFlags & SQLITE_FUNC_MINMAX) |
162191
|
0 |
0 |
&& (pWin->eStart!=TK_UNBOUNDED) |
162198
|
0 |
0 |
}else if( pWin->regApp ){ |
162202
|
0 |
0 |
if( bFin ){ |
162242
|
0 |
0 |
nPeer = (pMWin->pOrderBy ? pMWin->pOrderBy->nExpr : 0); |
162249
|
0 |
0 |
if( nPeer ){ |
162257
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){ |
162268
|
0 |
0 |
if( pMWin->eExclude==TK_CURRENT ){ |
162271
|
0 |
0 |
}else if( pMWin->eExclude!=TK_NO ){ |
162276
|
0 |
0 |
if( pMWin->pOrderBy ){ |
162279
|
0 |
0 |
if( pMWin->eExclude==TK_TIES ){ |
162283
|
0 |
0 |
if( pKeyInfo ){ |
162293
|
0 |
0 |
if( addrEq ) sqlite3VdbeJumpHere(v, addrEq); |
162305
|
0 |
0 |
if( nPeer ){ |
162331
|
0 |
0 |
if( pMWin->regStartRowid ){ |
162337
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){ |
162340
|
0 |
0 |
if( pFunc->zName==nth_valueName |
162341
|
0 |
0 |
|| pFunc->zName==first_valueName |
162348
|
0 |
0 |
if( pFunc->zName==nth_valueName ){ |
162363
|
0 |
0 |
else if( pFunc->zName==leadName || pFunc->zName==lagName ){ |
|
0 |
0 |
else if( pFunc->zName==leadName || pFunc->zName==lagName ){ |
162370
|
0 |
0 |
if( nArg<3 ){ |
162376
|
0 |
0 |
if( nArg<2 ){ |
162377
|
0 |
0 |
int val = (pFunc->zName==leadName ? 1 : -1); |
162380
|
0 |
0 |
int op = (pFunc->zName==leadName ? OP_Add : OP_Subtract); |
162409
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){ |
162413
|
0 |
0 |
nArg = MAX(nArg, windowArgCount(pWin)); |
162414
|
0 |
0 |
if( pMWin->regStartRowid==0 ){ |
162415
|
0 |
0 |
if( pFunc->zName==nth_valueName || pFunc->zName==first_valueName ){ |
|
0 |
0 |
if( pFunc->zName==nth_valueName || pFunc->zName==first_valueName ){ |
162420
|
0 |
0 |
if( (pFunc->funcFlags & SQLITE_FUNC_MINMAX) && pWin->csrApp ){ |
|
0 |
0 |
if( (pFunc->funcFlags & SQLITE_FUNC_MINMAX) && pWin->csrApp ){ |
162438
|
0 |
0 |
if( pMWin->regStartRowid ) return 1; |
162439
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){ |
162441
|
0 |
0 |
if( (pFunc->zName==nth_valueName) |
162442
|
0 |
0 |
|| (pFunc->zName==first_valueName) |
162443
|
0 |
0 |
|| (pFunc->zName==leadName) |
162444
|
0 |
0 |
|| (pFunc->zName==lagName) |
162470
|
0 |
0 |
if( pOrderBy ){ |
162533
|
0 |
0 |
if( pOrderBy->a[0].fg.sortFlags & KEYINFO_ORDER_DESC ){ |
162566
|
0 |
0 |
if( pOrderBy->a[0].fg.sortFlags & KEYINFO_ORDER_BIGNULL ){ |
162588
|
0 |
0 |
if( op==OP_Gt || op==OP_Ge ){ |
|
0 |
0 |
if( op==OP_Gt || op==OP_Ge ){ |
162609
|
0 |
0 |
if( (op==OP_Ge && arith==OP_Add) || (op==OP_Le && arith==OP_Subtract) ){ |
|
0 |
0 |
if( (op==OP_Ge && arith==OP_Add) || (op==OP_Le && arith==OP_Subtract) ){ |
|
0 |
0 |
if( (op==OP_Ge && arith==OP_Add) || (op==OP_Le && arith==OP_Subtract) ){ |
|
0 |
0 |
if( (op==OP_Ge && arith==OP_Add) || (op==OP_Le && arith==OP_Subtract) ){ |
162660
|
0 |
0 |
if( op==WINDOW_AGGINVERSE && pMWin->eStart==TK_UNBOUNDED ){ |
|
0 |
0 |
if( op==WINDOW_AGGINVERSE && pMWin->eStart==TK_UNBOUNDED ){ |
162665
|
0 |
0 |
if( regCountdown>0 ){ |
162666
|
0 |
0 |
if( pMWin->eFrmType==TK_RANGE ){ |
162669
|
0 |
0 |
if( op==WINDOW_AGGINVERSE ){ |
162670
|
0 |
0 |
if( pMWin->eStart==TK_FOLLOWING ){ |
162690
|
0 |
0 |
if( op==WINDOW_RETURN_ROW && pMWin->regStartRowid==0 ){ |
|
0 |
0 |
if( op==WINDOW_RETURN_ROW && pMWin->regStartRowid==0 ){ |
162701
|
0 |
0 |
if( pMWin->eStart==pMWin->eEnd && regCountdown |
|
0 |
0 |
if( pMWin->eStart==pMWin->eEnd && regCountdown |
162702
|
0 |
0 |
&& pMWin->eFrmType==TK_RANGE |
162706
|
0 |
0 |
if( op==WINDOW_AGGINVERSE ){ |
162711
|
0 |
0 |
}else if( p->regRowid ){ |
162731
|
0 |
0 |
if( pMWin->regStartRowid ){ |
162743
|
0 |
0 |
if( pMWin->regStartRowid ){ |
162752
|
0 |
0 |
if( op==p->eDelete ){ |
162757
|
0 |
0 |
if( jumpOnEof ){ |
162764
|
0 |
0 |
if( bPeer ){ |
162769
|
0 |
0 |
if( bPeer ){ |
162770
|
0 |
0 |
int nReg = (pMWin->pOrderBy ? pMWin->pOrderBy->nExpr : 0); |
162771
|
0 |
0 |
int regTmp = (nReg ? sqlite3GetTempRange(pParse, nReg) : 0); |
162777
|
0 |
0 |
if( addrNextRange ){ |
162792
|
0 |
0 |
if( ALWAYS(p) ){ |
162794
|
0 |
0 |
if( pNew ){ |
162828
|
0 |
3 |
for(pWin=p; pWin; pWin=pWin->pNextWin){ |
162830
|
0 |
0 |
if( *pp==0 ) break; |
162850
|
0 |
0 |
if( pVal && sqlite3_value_int(pVal)>0 ){ |
|
0 |
0 |
if( pVal && sqlite3_value_int(pVal)>0 ){ |
163253
|
0 |
0 |
if( pMWin->eFrmType!=TK_RANGE |
163254
|
0 |
0 |
&& windowExprGtZero(pParse, pMWin->pStart) |
163260
|
0 |
0 |
if( windowCacheFrame(pMWin)==0 ){ |
163261
|
0 |
0 |
if( pMWin->eEnd==TK_PRECEDING ){ |
163262
|
0 |
0 |
if( pMWin->eFrmType!=TK_RANGE |
163263
|
0 |
0 |
&& windowExprGtZero(pParse, pMWin->pEnd) |
163288
|
0 |
0 |
if( pMWin->eStart==TK_PRECEDING || pMWin->eStart==TK_FOLLOWING ){ |
|
0 |
0 |
if( pMWin->eStart==TK_PRECEDING || pMWin->eStart==TK_FOLLOWING ){ |
163291
|
0 |
0 |
if( pMWin->eEnd==TK_PRECEDING || pMWin->eEnd==TK_FOLLOWING ){ |
|
0 |
0 |
if( pMWin->eEnd==TK_PRECEDING || pMWin->eEnd==TK_FOLLOWING ){ |
163298
|
0 |
0 |
if( pMWin->eFrmType!=TK_ROWS ){ |
163299
|
0 |
0 |
int nPeer = (pOrderBy ? pOrderBy->nExpr : 0); |
163301
|
0 |
0 |
if( pMWin->pPartition ) regNewPeer += pMWin->pPartition->nExpr; |
163311
|
0 |
0 |
for(iInput=0; iInput
|
163321
|
0 |
0 |
if( pMWin->pPartition ){ |
163347
|
0 |
0 |
if( regStart ){ |
163349
|
0 |
0 |
windowCheckValue(pParse, regStart, 0 + (pMWin->eFrmType==TK_RANGE?3:0)); |
163351
|
0 |
0 |
if( regEnd ){ |
163353
|
0 |
0 |
windowCheckValue(pParse, regEnd, 1 + (pMWin->eFrmType==TK_RANGE?3:0)); |
163356
|
0 |
0 |
if( pMWin->eFrmType!=TK_RANGE && pMWin->eStart==pMWin->eEnd && regStart ){ |
|
0 |
0 |
if( pMWin->eFrmType!=TK_RANGE && pMWin->eStart==pMWin->eEnd && regStart ){ |
|
0 |
0 |
if( pMWin->eFrmType!=TK_RANGE && pMWin->eStart==pMWin->eEnd && regStart ){ |
163357
|
0 |
0 |
int op = ((pMWin->eStart==TK_FOLLOWING) ? OP_Ge : OP_Le); |
163369
|
0 |
0 |
if( pMWin->eStart==TK_FOLLOWING && pMWin->eFrmType!=TK_RANGE && regEnd ){ |
|
0 |
0 |
if( pMWin->eStart==TK_FOLLOWING && pMWin->eFrmType!=TK_RANGE && regEnd ){ |
|
0 |
0 |
if( pMWin->eStart==TK_FOLLOWING && pMWin->eFrmType!=TK_RANGE && regEnd ){ |
163374
|
0 |
0 |
if( pMWin->eStart!=TK_UNBOUNDED ){ |
163382
|
0 |
0 |
if( regPeer && pOrderBy ){ |
|
0 |
0 |
if( regPeer && pOrderBy ){ |
163394
|
0 |
0 |
if( regPeer ){ |
163397
|
0 |
0 |
if( pMWin->eStart==TK_FOLLOWING ){ |
163399
|
0 |
0 |
if( pMWin->eEnd!=TK_UNBOUNDED ){ |
163400
|
0 |
0 |
if( pMWin->eFrmType==TK_RANGE ){ |
163414
|
0 |
0 |
if( pMWin->eEnd==TK_PRECEDING ){ |
163415
|
0 |
0 |
int bRPS = (pMWin->eStart==TK_PRECEDING && pMWin->eFrmType==TK_RANGE); |
|
0 |
0 |
int bRPS = (pMWin->eStart==TK_PRECEDING && pMWin->eFrmType==TK_RANGE); |
163417
|
0 |
0 |
if( bRPS ) windowCodeOp(&s, WINDOW_AGGINVERSE, regStart, 0); |
163419
|
0 |
0 |
if( !bRPS ) windowCodeOp(&s, WINDOW_AGGINVERSE, regStart, 0); |
163423
|
0 |
0 |
if( pMWin->eEnd!=TK_UNBOUNDED ){ |
163424
|
0 |
0 |
if( pMWin->eFrmType==TK_RANGE ){ |
163427
|
0 |
0 |
if( regEnd ){ |
163433
|
0 |
0 |
if( regEnd ){ |
163438
|
0 |
0 |
if( regEnd ){ |
163444
|
0 |
0 |
if( regEnd ) sqlite3VdbeJumpHere(v, addr); |
163454
|
0 |
0 |
if( pMWin->pPartition ){ |
163462
|
0 |
0 |
if( pMWin->eEnd==TK_PRECEDING ){ |
163463
|
0 |
0 |
int bRPS = (pMWin->eStart==TK_PRECEDING && pMWin->eFrmType==TK_RANGE); |
|
0 |
0 |
int bRPS = (pMWin->eStart==TK_PRECEDING && pMWin->eFrmType==TK_RANGE); |
163465
|
0 |
0 |
if( bRPS ) windowCodeOp(&s, WINDOW_AGGINVERSE, regStart, 0); |
163467
|
0 |
0 |
}else if( pMWin->eStart==TK_FOLLOWING ){ |
163473
|
0 |
0 |
if( pMWin->eFrmType==TK_RANGE ){ |
163478
|
0 |
0 |
if( pMWin->eEnd==TK_UNBOUNDED ){ |
163508
|
0 |
0 |
if( pMWin->pPartition ){ |
163509
|
0 |
0 |
if( pMWin->regStartRowid ){ |
163635
|
26 |
4538 |
if( p->pPrior ){ |
163643
|
26 |
85 |
if( pLoop==0 ) break; |
163645
|
85 |
0 |
if( pLoop->pOrderBy || pLoop->pLimit ){ |
|
0 |
85 |
if( pLoop->pOrderBy || pLoop->pLimit ){ |
163646
|
0 |
0 |
sqlite3ErrorMsg(pParse,"%s clause should come after %s not before", |
163652
|
22 |
4 |
if( (p->selFlags & SF_MultiValue)==0 && |
|
22 |
0 |
if( (p->selFlags & SF_MultiValue)==0 && |
163653
|
0 |
22 |
(mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 && |
163665
|
0 |
0 |
if( pSelect ){ |
163678
|
9851 |
0 |
if( p ){ |
163696
|
2523 |
7328 |
if( sqlite3Isquote(p->u.zToken[0]) ){ |
163702
|
0 |
9851 |
if( IN_RENAME_OBJECT ){ |
163714
|
33 |
0 |
if( pA && pY && pY->op==TK_NULL && !IN_RENAME_OBJECT ){ |
|
33 |
0 |
if( pA && pY && pY->op==TK_NULL && !IN_RENAME_OBJECT ){ |
|
28 |
5 |
if( pA && pY && pY->op==TK_NULL && !IN_RENAME_OBJECT ){ |
|
28 |
0 |
if( pA && pY && pY->op==TK_NULL && !IN_RENAME_OBJECT ){ |
163734
|
24 |
0 |
if( (hasCollate || sortOrder!=SQLITE_SO_UNDEFINED) |
|
0 |
24 |
if( (hasCollate || sortOrder!=SQLITE_SO_UNDEFINED) |
163735
|
0 |
0 |
&& pParse->db->init.busy==0 |
165996
|
12258 |
6482 |
while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser); |
166080
|
62296 |
163117 |
if( stateno>YY_MAX_SHIFT ) return stateno; |
166094
|
82514 |
80838 |
if( yy_lookahead[i]!=iLookAhead ){ |
166099
|
235 |
82279 |
if( iFallback!=0 ){ |
166115
|
348 |
81931 |
if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){ |
|
348 |
0 |
if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){ |
166176
|
0 |
0 |
while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); |
166226
|
0 |
80510 |
if( yypParser->yytos>yypParser->yystackEnd ){ |
166240
|
37813 |
42697 |
if( yyNewState > YY_MAX_SHIFT ){ |
167193
|
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 ){ |
167203
|
0 |
0 |
if( yymsp[0].minor.yy0.n==6 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"strict",6)==0 ){ |
|
0 |
0 |
if( yymsp[0].minor.yy0.n==6 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"strict",6)==0 ){ |
167267
|
0 |
0 |
if( p ){ |
167420
|
4564 |
0 |
if( p ){ |
167430
|
75 |
0 |
if( pRhs && pRhs->pPrior ){ |
|
0 |
75 |
if( pRhs && pRhs->pPrior ){ |
167438
|
75 |
0 |
if( pRhs ){ |
167441
|
75 |
0 |
if( ALWAYS(pLhs) ) pLhs->selFlags &= ~SF_MultiValue; |
167443
|
4 |
71 |
if( yymsp[-1].minor.yy394!=TK_ALL ) pParse->hasCompound = 1; |
167465
|
0 |
0 |
if( yymsp[-9].minor.yy47 ){ |
167481
|
10 |
0 |
if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue; |
167482
|
10 |
0 |
if( pRight ){ |
167508
|
316 |
1627 |
if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[0].minor.yy0, 1); |
167544
|
11 |
0 |
if( ALWAYS(yymsp[-1].minor.yy131 && yymsp[-1].minor.yy131->nSrc>0) ) yymsp[-1].minor.yy131->a[yymsp[-1].minor.yy131->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy394; |
|
11 |
0 |
if( ALWAYS(yymsp[-1].minor.yy131 && yymsp[-1].minor.yy131->nSrc>0) ) yymsp[-1].minor.yy131->a[yymsp[-1].minor.yy131->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy394; |
167571
|
0 |
0 |
if( yymsp[-5].minor.yy131==0 && yymsp[-1].minor.yy0.n==0 && yymsp[0].minor.yy561.pOn==0 && yymsp[0].minor.yy561.pUsing==0 ){ |
|
0 |
0 |
if( yymsp[-5].minor.yy131==0 && yymsp[-1].minor.yy0.n==0 && yymsp[0].minor.yy561.pOn==0 && yymsp[0].minor.yy561.pUsing==0 ){ |
|
0 |
0 |
if( yymsp[-5].minor.yy131==0 && yymsp[-1].minor.yy0.n==0 && yymsp[0].minor.yy561.pOn==0 && yymsp[0].minor.yy561.pUsing==0 ){ |
|
0 |
0 |
if( yymsp[-5].minor.yy131==0 && yymsp[-1].minor.yy0.n==0 && yymsp[0].minor.yy561.pOn==0 && yymsp[0].minor.yy561.pUsing==0 ){ |
167573
|
0 |
0 |
}else if( yymsp[-3].minor.yy131->nSrc==1 ){ |
167575
|
0 |
0 |
if( yymsp[-5].minor.yy131 ){ |
167581
|
0 |
0 |
if( pNew->pSelect && (pNew->pSelect->selFlags & SF_NestedFrom)!=0 ){ |
|
0 |
0 |
if( pNew->pSelect && (pNew->pSelect->selFlags & SF_NestedFrom)!=0 ){ |
167584
|
0 |
0 |
if( pOld->fg.isTabFunc ){ |
167609
|
0 |
15 |
if( IN_RENAME_OBJECT && yylhsminor.yy131 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy131->a[0].zName, &yymsp[0].minor.yy0); |
|
0 |
0 |
if( IN_RENAME_OBJECT && yylhsminor.yy131 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy131->a[0].zName, &yymsp[0].minor.yy0); |
167616
|
0 |
0 |
if( IN_RENAME_OBJECT && yylhsminor.yy131 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy131->a[0].zName, &yymsp[0].minor.yy0); |
|
0 |
0 |
if( IN_RENAME_OBJECT && yylhsminor.yy131 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy131->a[0].zName, &yymsp[0].minor.yy0); |
167629
|
0 |
0 |
if( yymsp[-4].minor.yy131 ) yymsp[-4].minor.yy131->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0); |
167635
|
0 |
0 |
if( yymsp[-2].minor.yy131 ) yymsp[-2].minor.yy131->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0); |
167738
|
0 |
310 |
if( yymsp[-1].minor.yy131 ){ |
167740
|
0 |
0 |
if( pFromClause->nSrc>1 ){ |
167840
|
0 |
4 |
if( IN_RENAME_OBJECT ){ |
167854
|
561 |
0 |
if( yylhsminor.yy528 ) yylhsminor.yy528->w.iOfst = (int)(yymsp[0].minor.yy0.z - pParse->zTail); |
167860
|
610 |
1398 |
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){ |
|
0 |
610 |
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){ |
167870
|
0 |
610 |
if( pParse->nested==0 ){ |
167875
|
610 |
0 |
if( yymsp[0].minor.yy528 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy528->iTable); |
167927
|
0 |
0 |
if( yymsp[-4].minor.yy528 ){ |
167929
|
0 |
0 |
if( ALWAYS(pList->nExpr) ){ |
167960
|
12 |
136 |
if( bNot ) yymsp[-2].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy528, 0); |
167961
|
148 |
0 |
if( yymsp[-2].minor.yy528 ) yymsp[-2].minor.yy528->flags |= EP_InfixFunc; |
167973
|
0 |
0 |
if( bNot ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0); |
167974
|
0 |
0 |
if( yymsp[-4].minor.yy528 ) yymsp[-4].minor.yy528->flags |= EP_InfixFunc; |
168013
|
0 |
1 |
yymsp[-1].minor.yy528 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy528, 0); |
168034
|
18 |
0 |
if( yymsp[-4].minor.yy528 ){ |
168039
|
0 |
18 |
if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0); |
168044
|
0 |
17 |
if( yymsp[-1].minor.yy322==0 ){ |
168054
|
0 |
0 |
yymsp[-4].minor.yy528 = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy394 ? "true" : "false"); |
168055
|
0 |
0 |
if( yymsp[-4].minor.yy528 ) sqlite3ExprIdToTrueFalse(yymsp[-4].minor.yy528); |
168058
|
1 |
16 |
if( yymsp[-1].minor.yy322->nExpr==1 && sqlite3ExprIsConstant(pRHS) && yymsp[-4].minor.yy528->op!=TK_VECTOR ){ |
|
1 |
0 |
if( yymsp[-1].minor.yy322->nExpr==1 && sqlite3ExprIsConstant(pRHS) && yymsp[-4].minor.yy528->op!=TK_VECTOR ){ |
|
1 |
0 |
if( yymsp[-1].minor.yy322->nExpr==1 && sqlite3ExprIsConstant(pRHS) && yymsp[-4].minor.yy528->op!=TK_VECTOR ){ |
168065
|
0 |
16 |
if( yymsp[-4].minor.yy528==0 ){ |
168067
|
0 |
16 |
}else if( yymsp[-4].minor.yy528->pLeft->op==TK_VECTOR ){ |
168070
|
0 |
0 |
if( pSelectRHS ){ |
168079
|
0 |
17 |
if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0); |
168093
|
0 |
1 |
if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0); |
168100
|
0 |
2 |
if( yymsp[0].minor.yy322 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy322); |
|
0 |
0 |
if( yymsp[0].minor.yy322 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy322); |
168103
|
0 |
2 |
if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0); |
168116
|
0 |
0 |
if( yymsp[-4].minor.yy528 ){ |
168117
|
0 |
0 |
yymsp[-4].minor.yy528->x.pList = yymsp[-1].minor.yy528 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[-1].minor.yy528) : yymsp[-2].minor.yy322; |
168155
|
0 |
10 |
if( IN_RENAME_OBJECT && pParse->pNewIndex ){ |
|
0 |
0 |
if( IN_RENAME_OBJECT && pParse->pNewIndex ){ |
168212
|
0 |
0 |
yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/ |
168295
|
0 |
0 |
if( yymsp[-3].minor.yy528 ){ |
168303
|
0 |
0 |
if( yymsp[-5].minor.yy528 ) { |
168430
|
0 |
0 |
if( ALWAYS(yymsp[-1].minor.yy41) ){ |
168522
|
0 |
0 |
if( yymsp[0].minor.yy41 ){ |
168534
|
0 |
0 |
if( yylhsminor.yy41 ){ |
168552
|
0 |
0 |
if( yymsp[-1].minor.yy41 ){ |
168685
|
3 |
0 |
if( TOKEN.z[0] ){ |
168779
|
144541 |
80872 |
if( yyact >= YY_MIN_REDUCE ){ |
168802
|
45767 |
98774 |
if( yyRuleInfoNRhs[yyruleno]==0 ){ |
168811
|
0 |
45767 |
if( yypParser->yytos>=yypParser->yystackEnd ){ |
168825
|
80510 |
362 |
}else if( yyact <= YY_MAX_SHIFTREDUCE ){ |
168831
|
359 |
3 |
}else if( yyact==YY_ACCEPT_ACTION ){ |
169412
|
38777 |
608 |
if( n>=2 ){ |
169414
|
42936 |
18893 |
for(i=((int)aKWHash[i])-1; i>=0; i=((int)aKWNext[i])-1){ |
169415
|
22699 |
20237 |
if( aKWLen[i]!=n ) continue; |
169418
|
188 |
20049 |
if( (z[0]&~0x20)!=zKW[0] ) continue; |
169419
|
140 |
19909 |
if( (z[1]&~0x20)!=zKW[1] ) continue; |
169421
|
62483 |
19884 |
while( j
|
|
62458 |
25 |
while( j
|
169429
|
25 |
19884 |
if( j
|
169590
|
0 |
0 |
if( i<0 || i>=SQLITE_N_KEYWORD ) return SQLITE_ERROR; |
|
0 |
0 |
if( i<0 || i>=SQLITE_N_KEYWORD ) return SQLITE_ERROR; |
169655
|
0 |
0 |
}while( t==TK_SPACE ); |
169656
|
0 |
0 |
if( t==TK_ID |
169657
|
0 |
0 |
|| t==TK_STRING |
169658
|
0 |
0 |
|| t==TK_JOIN_KW |
169659
|
0 |
0 |
|| t==TK_WINDOW |
169660
|
0 |
0 |
|| t==TK_OVER |
169661
|
0 |
0 |
|| sqlite3ParserFallback(t)==TK_ID |
169702
|
0 |
0 |
if( t!=TK_ID ) return TK_ID; |
169704
|
0 |
0 |
if( t!=TK_AS ) return TK_ID; |
169708
|
0 |
0 |
if( lastToken==TK_RP ){ |
169710
|
0 |
0 |
if( t==TK_LP || t==TK_ID ) return TK_OVER; |
|
0 |
0 |
if( t==TK_LP || t==TK_ID ) return TK_OVER; |
169715
|
0 |
0 |
if( lastToken==TK_RP && getToken(&z)==TK_LP ){ |
|
0 |
0 |
if( lastToken==TK_RP && getToken(&z)==TK_LP ){ |
169737
|
5696 |
38971 |
for(i=1; sqlite3Isspace(z[i]); i++){} |
169742
|
3 |
1 |
if( z[1]=='-' ){ |
169743
|
51 |
1 |
for(i=2; (c=z[i])!=0 && c!='\n'; i++){} |
|
49 |
2 |
for(i=2; (c=z[i])!=0 && c!='\n'; i++){} |
169746
|
0 |
1 |
}else if( z[1]=='>' ){ |
169748
|
0 |
0 |
return 2 + (z[2]=='>'); |
169774
|
1 |
0 |
if( z[1]!='*' || z[2]==0 ){ |
|
0 |
1 |
if( z[1]!='*' || z[2]==0 ){ |
169778
|
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++){} |
169779
|
1 |
0 |
if( c ) i++; |
169789
|
0 |
2661 |
return 1 + (z[1]=='='); |
169792
|
12 |
7 |
if( (c=z[1])=='=' ){ |
169795
|
0 |
7 |
}else if( c=='>' ){ |
169798
|
0 |
7 |
}else if( c=='<' ){ |
169807
|
14 |
20 |
if( (c=z[1])=='=' ){ |
169810
|
0 |
20 |
}else if( c=='>' ){ |
169819
|
0 |
245 |
if( z[1]!='=' ){ |
169828
|
0 |
0 |
if( z[1]!='|' ){ |
169853
|
50873 |
0 |
for(i=1; (c=z[i])!=0; i++){ |
169854
|
4311 |
46562 |
if( c==delim ){ |
169855
|
172 |
4139 |
if( z[i+1]==delim ){ |
169862
|
3176 |
963 |
if( c=='\'' ){ |
169865
|
963 |
0 |
}else if( c!=0 ){ |
169875
|
1228 |
0 |
if( !sqlite3Isdigit(z[1]) ) |
169892
|
2199 |
644 |
if( z[0]=='0' && (z[1]=='x' || z[1]=='X') && sqlite3Isxdigit(z[2]) ){ |
|
2199 |
0 |
if( z[0]=='0' && (z[1]=='x' || z[1]=='X') && sqlite3Isxdigit(z[2]) ){ |
|
0 |
2199 |
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]) ){ |
169893
|
0 |
0 |
for(i=3; sqlite3Isxdigit(z[i]); i++){} |
169897
|
3373 |
2843 |
for(i=0; sqlite3Isdigit(z[i]); i++){} |
169899
|
2166 |
677 |
if( z[i]=='.' ){ |
169901
|
32444 |
2166 |
while( sqlite3Isdigit(z[i]) ){ i++; } |
169904
|
2843 |
0 |
if( (z[i]=='e' || z[i]=='E') && |
|
0 |
2843 |
if( (z[i]=='e' || z[i]=='E') && |
|
0 |
0 |
if( (z[i]=='e' || z[i]=='E') && |
169906
|
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])) |
169910
|
0 |
0 |
while( sqlite3Isdigit(z[i]) ){ i++; } |
169914
|
0 |
2843 |
while( IdChar(z[i]) ){ |
169921
|
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++){} |
169922
|
6 |
0 |
*tokenType = c==']' ? TK_ID : TK_ILLEGAL; |
169927
|
13 |
1384 |
for(i=1; sqlite3Isdigit(z[i]); i++){} |
169936
|
977 |
306 |
for(i=1; (c=z[i])!=0; i++){ |
169937
|
655 |
322 |
if( IdChar(c) ){ |
169940
|
0 |
322 |
}else if( c=='(' && n>0 ){ |
|
0 |
0 |
}else if( c=='(' && n>0 ){ |
169943
|
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!=')' ); |
169944
|
0 |
0 |
if( c==')' ){ |
169950
|
0 |
322 |
}else if( c==':' && z[i+1]==':' ){ |
|
0 |
0 |
}else if( c==':' && z[i+1]==':' ){ |
169957
|
0 |
628 |
if( n==0 ) *tokenType = TK_ILLEGAL; |
169961
|
185126 |
40093 |
for(i=1; aiClass[z[i]]<=CC_KYWD; i++){} |
169962
|
708 |
39385 |
if( IdChar(z[i]) ){ |
169975
|
6 |
477 |
if( z[1]=='\'' ){ |
169977
|
327680 |
6 |
for(i=2; sqlite3Isxdigit(z[i]); i++){} |
169978
|
6 |
0 |
if( z[i]!='\'' || i%2 ){ |
|
0 |
6 |
if( z[i]!='\'' || i%2 ){ |
169980
|
0 |
0 |
while( z[i] && z[i]!='\'' ){ i++; } |
|
0 |
0 |
while( z[i] && z[i]!='\'' ){ i++; } |
169982
|
6 |
0 |
if( z[i] ) i++; |
169996
|
0 |
0 |
if( z[1]==0xbb && z[2]==0xbf ){ |
|
0 |
0 |
if( z[1]==0xbb && z[2]==0xbf ){ |
170012
|
3241 |
1190 |
while( IdChar(z[i]) ){ i++; } |
170036
|
5547 |
935 |
if( db->nVdbeActive==0 ){ |
170068
|
0 |
120190 |
if( mxSqlLen<0 ){ |
170074
|
46044 |
74146 |
if( tokenType>=TK_WINDOW ){ |
170082
|
0 |
46044 |
if( AtomicLoad(&db->u1.isInterrupted) ){ |
170087
|
38959 |
7085 |
if( tokenType==TK_SPACE ){ |
170091
|
7085 |
0 |
if( zSql[0]==0 ){ |
170094
|
359 |
6726 |
if( lastTokenParsed==TK_SEMI ){ |
170096
|
359 |
6367 |
}else if( lastTokenParsed==0 ){ |
170103
|
0 |
0 |
}else if( tokenType==TK_WINDOW ){ |
170106
|
0 |
0 |
}else if( tokenType==TK_OVER ){ |
170109
|
0 |
0 |
}else if( tokenType==TK_FILTER ){ |
170127
|
6123 |
74749 |
if( pParse->rc!=SQLITE_OK ) break; |
170142
|
0 |
6482 |
if( db->mallocFailed ){ |
170145
|
6456 |
26 |
if( pParse->zErrMsg || (pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE) ){ |
|
6097 |
359 |
if( pParse->zErrMsg || (pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE) ){ |
|
0 |
6097 |
if( pParse->zErrMsg || (pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE) ){ |
170146
|
0 |
26 |
if( pParse->zErrMsg==0 ){ |
170157
|
297 |
6185 |
if( pParse->pNewTable && !IN_SPECIAL_PARSE ){ |
|
266 |
31 |
if( pParse->pNewTable && !IN_SPECIAL_PARSE ){ |
170164
|
0 |
6482 |
if( pParse->pNewTrigger && !IN_RENAME_OBJECT ){ |
|
0 |
0 |
if( pParse->pNewTrigger && !IN_RENAME_OBJECT ){ |
170167
|
0 |
6482 |
if( pParse->pVList ) sqlite3DbFreeNN(db, pParse->pVList); |
170453
|
0 |
0 |
while( *zSql ){ |
170468
|
0 |
0 |
if( zSql[1]!='*' ){ |
170473
|
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++; } |
170474
|
0 |
0 |
if( zSql[0]==0 ) return 0; |
170480
|
0 |
0 |
if( zSql[1]!='-' ){ |
170484
|
0 |
0 |
while( *zSql && *zSql!='\n' ){ zSql++; } |
|
0 |
0 |
while( *zSql && *zSql!='\n' ){ zSql++; } |
170485
|
0 |
0 |
if( *zSql==0 ) return state==1; |
170491
|
0 |
0 |
while( *zSql && *zSql!=']' ){ zSql++; } |
|
0 |
0 |
while( *zSql && *zSql!=']' ){ zSql++; } |
170492
|
0 |
0 |
if( *zSql==0 ) return 0; |
170501
|
0 |
0 |
while( *zSql && *zSql!=c ){ zSql++; } |
|
0 |
0 |
while( *zSql && *zSql!=c ){ zSql++; } |
170502
|
0 |
0 |
if( *zSql==0 ) return 0; |
170510
|
0 |
0 |
if( IdChar((u8)*zSql) ){ |
170513
|
0 |
0 |
for(nId=1; IdChar(zSql[nId]); nId++){} |
170519
|
0 |
0 |
if( nId==6 && sqlite3StrNICmp(zSql, "create", 6)==0 ){ |
|
0 |
0 |
if( nId==6 && sqlite3StrNICmp(zSql, "create", 6)==0 ){ |
170527
|
0 |
0 |
if( nId==7 && sqlite3StrNICmp(zSql, "trigger", 7)==0 ){ |
|
0 |
0 |
if( nId==7 && sqlite3StrNICmp(zSql, "trigger", 7)==0 ){ |
170529
|
0 |
0 |
}else if( nId==4 && sqlite3StrNICmp(zSql, "temp", 4)==0 ){ |
|
0 |
0 |
}else if( nId==4 && sqlite3StrNICmp(zSql, "temp", 4)==0 ){ |
170531
|
0 |
0 |
}else if( nId==9 && sqlite3StrNICmp(zSql, "temporary", 9)==0 ){ |
|
0 |
0 |
}else if( nId==9 && sqlite3StrNICmp(zSql, "temporary", 9)==0 ){ |
170539
|
0 |
0 |
if( nId==3 && sqlite3StrNICmp(zSql, "end", 3)==0 ){ |
|
0 |
0 |
if( nId==3 && sqlite3StrNICmp(zSql, "end", 3)==0 ){ |
170543
|
0 |
0 |
if( nId==7 && sqlite3StrNICmp(zSql, "explain", 7)==0 ){ |
|
0 |
0 |
if( nId==7 && sqlite3StrNICmp(zSql, "explain", 7)==0 ){ |
170585
|
0 |
0 |
if( rc ) return rc; |
170590
|
0 |
0 |
if( zSql8 ){ |
170920
|
75456 |
880 |
if( sqlite3GlobalConfig.isInit ){ |
170934
|
0 |
880 |
if( rc ) return rc; |
170945
|
110 |
770 |
if( !sqlite3GlobalConfig.isMallocInit ){ |
170948
|
880 |
0 |
if( rc==SQLITE_OK ){ |
170950
|
110 |
770 |
if( !sqlite3GlobalConfig.pInitMutex ){ |
170953
|
110 |
0 |
if( sqlite3GlobalConfig.bCoreMutex && !sqlite3GlobalConfig.pInitMutex ){ |
|
0 |
110 |
if( sqlite3GlobalConfig.bCoreMutex && !sqlite3GlobalConfig.pInitMutex ){ |
170958
|
880 |
0 |
if( rc==SQLITE_OK ){ |
170966
|
0 |
880 |
if( rc!=SQLITE_OK ){ |
170984
|
880 |
0 |
if( sqlite3GlobalConfig.isInit==0 && sqlite3GlobalConfig.inProgress==0 ){ |
|
110 |
770 |
if( sqlite3GlobalConfig.isInit==0 && sqlite3GlobalConfig.inProgress==0 ){ |
170994
|
110 |
0 |
if( sqlite3GlobalConfig.isPCacheInit==0 ){ |
170997
|
110 |
0 |
if( rc==SQLITE_OK ){ |
171002
|
110 |
0 |
if( rc==SQLITE_OK ){ |
171006
|
110 |
0 |
if( rc==SQLITE_OK ){ |
171024
|
110 |
770 |
if( sqlite3GlobalConfig.nRefInitMutex<=0 ){ |
171079
|
0 |
0 |
if( sqlite3GlobalConfig.isInit ){ |
171088
|
0 |
0 |
if( sqlite3GlobalConfig.isPCacheInit ){ |
171092
|
0 |
0 |
if( sqlite3GlobalConfig.isMallocInit ){ |
171108
|
0 |
0 |
if( sqlite3GlobalConfig.isMutexInit ){ |
171131
|
0 |
220 |
if( sqlite3GlobalConfig.isInit ) return SQLITE_MISUSE_BKPT; |
171169
|
0 |
0 |
sqlite3GlobalConfig.mutex = *va_arg(ap, sqlite3_mutex_methods*); |
171176
|
0 |
0 |
*va_arg(ap, sqlite3_mutex_methods*) = sqlite3GlobalConfig.mutex; |
171187
|
110 |
0 |
sqlite3GlobalConfig.m = *va_arg(ap, sqlite3_mem_methods*); |
171195
|
0 |
0 |
if( sqlite3GlobalConfig.m.xMalloc==0 ) sqlite3MemSetDefault(); |
171196
|
0 |
0 |
*va_arg(ap, sqlite3_mem_methods*) = sqlite3GlobalConfig.m; |
171203
|
0 |
0 |
sqlite3GlobalConfig.bMemstat = va_arg(ap, int); |
171207
|
0 |
0 |
sqlite3GlobalConfig.bSmallMalloc = va_arg(ap, int); |
171215
|
0 |
0 |
sqlite3GlobalConfig.pPage = va_arg(ap, void*); |
171216
|
0 |
0 |
sqlite3GlobalConfig.szPage = va_arg(ap, int); |
171217
|
0 |
0 |
sqlite3GlobalConfig.nPage = va_arg(ap, int); |
171225
|
0 |
0 |
*va_arg(ap, int*) = |
171247
|
110 |
0 |
sqlite3GlobalConfig.pcache2 = *va_arg(ap, sqlite3_pcache_methods2*); |
171255
|
0 |
0 |
if( sqlite3GlobalConfig.pcache2.xInit==0 ){ |
171258
|
0 |
0 |
*va_arg(ap, sqlite3_pcache_methods2*) = sqlite3GlobalConfig.pcache2; |
171308
|
0 |
0 |
sqlite3GlobalConfig.szLookaside = va_arg(ap, int); |
171309
|
0 |
0 |
sqlite3GlobalConfig.nLookaside = va_arg(ap, int); |
171323
|
0 |
0 |
sqlite3GlobalConfig.xLog = va_arg(ap, LOGFUNC_t); |
171324
|
0 |
0 |
sqlite3GlobalConfig.pLogArg = va_arg(ap, void*); |
171338
|
0 |
0 |
sqlite3GlobalConfig.bOpenUri = va_arg(ap, int); |
171347
|
0 |
0 |
sqlite3GlobalConfig.bUseCis = va_arg(ap, int); |
171365
|
0 |
0 |
sqlite3_int64 szMmap = va_arg(ap, sqlite3_int64); |
171366
|
0 |
0 |
sqlite3_int64 mxMmap = va_arg(ap, sqlite3_int64); |
171375
|
0 |
0 |
if( mxMmap<0 || mxMmap>SQLITE_MAX_MMAP_SIZE ){ |
|
0 |
0 |
if( mxMmap<0 || mxMmap>SQLITE_MAX_MMAP_SIZE ){ |
171378
|
0 |
0 |
if( szMmap<0 ) szMmap = SQLITE_DEFAULT_MMAP_SIZE; |
171379
|
0 |
0 |
if( szMmap>mxMmap) szMmap = mxMmap; |
171396
|
0 |
0 |
sqlite3GlobalConfig.szPma = va_arg(ap, unsigned int); |
171401
|
0 |
0 |
sqlite3GlobalConfig.nStmtSpill = va_arg(ap, int); |
171418
|
0 |
0 |
sqlite3GlobalConfig.mxMemdbSize = va_arg(ap, sqlite3_int64); |
171450
|
0 |
311 |
if( sqlite3LookasideUsed(db,0)>0 ){ |
171457
|
0 |
311 |
if( db->lookaside.bMalloced ){ |
171464
|
0 |
311 |
if( sz<=(int)sizeof(LookasideSlot*) ) sz = 0; |
171465
|
0 |
311 |
if( cnt<0 ) cnt = 0; |
171466
|
311 |
0 |
if( sz==0 || cnt==0 ){ |
|
0 |
311 |
if( sz==0 || cnt==0 ){ |
171469
|
311 |
0 |
}else if( pBuf==0 ){ |
171473
|
311 |
0 |
if( pStart ) szAlloc = sqlite3MallocSize(pStart); |
171478
|
311 |
0 |
if( sz>=LOOKASIDE_SMALL*3 ){ |
171481
|
0 |
0 |
}else if( sz>=LOOKASIDE_SMALL*2 ){ |
171486
|
0 |
0 |
if( sz>0 ){ |
171497
|
311 |
0 |
if( pStart ){ |
171502
|
9330 |
311 |
for(i=0; i
|
171511
|
28923 |
311 |
for(i=0; i
|
171565
|
0 |
0 |
for(i=0; inDb; i++){ |
171567
|
0 |
0 |
if( pBt ){ |
171591
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
171593
|
0 |
0 |
if( pBt && sqlite3BtreeTxnState(pBt)==SQLITE_TXN_WRITE ){ |
|
0 |
0 |
if( pBt && sqlite3BtreeTxnState(pBt)==SQLITE_TXN_WRITE ){ |
171596
|
0 |
0 |
if( rc==SQLITE_BUSY ){ |
171604
|
0 |
0 |
return ((rc==SQLITE_OK && bSeenBusy) ? SQLITE_BUSY : rc); |
|
0 |
0 |
return ((rc==SQLITE_OK && bSeenBusy) ? SQLITE_BUSY : rc); |
171618
|
0 |
0 |
db->aDb[0].zDbSName = va_arg(ap,char*); |
171623
|
0 |
0 |
void *pBuf = va_arg(ap, void*); /* IMP: R-26835-10964 */ |
171624
|
0 |
0 |
int sz = va_arg(ap, int); /* IMP: R-47871-25994 */ |
171625
|
0 |
0 |
int cnt = va_arg(ap, int); /* IMP: R-04460-53386 */ |
171654
|
4398 |
0 |
for(i=0; i
|
171655
|
1008 |
3390 |
if( aFlagOp[i].op==op ){ |
171656
|
1008 |
0 |
int onoff = va_arg(ap, int); |
171657
|
1008 |
0 |
int *pRes = va_arg(ap, int*); |
171659
|
334 |
674 |
if( onoff>0 ){ |
171661
|
26 |
648 |
}else if( onoff==0 ){ |
171664
|
352 |
656 |
if( oldFlags!=db->flags ){ |
171667
|
700 |
308 |
if( pRes ){ |
171698
|
596 |
1109 |
if( rc==0 ){ |
171715
|
0 |
0 |
while( nKey1 && pK1[nKey1-1]==' ' ) nKey1--; |
|
0 |
0 |
while( nKey1 && pK1[nKey1-1]==' ' ) nKey1--; |
171716
|
0 |
0 |
while( nKey2 && pK2[nKey2-1]==' ' ) nKey2--; |
|
0 |
0 |
while( nKey2 && pK2[nKey2-1]==' ' ) nKey2--; |
171725
|
322 |
0 |
return p==0 || p->xCmp==binCollFunc; |
|
322 |
0 |
return p==0 || p->xCmp==binCollFunc; |
171745
|
0 |
0 |
if( 0==r ){ |
171817
|
13 |
545 |
while( db->pSavepoint ){ |
171837
|
2472 |
7666 |
if( pDestructor ){ |
171839
|
2472 |
0 |
if( pDestructor->nRef==0 ){ |
171855
|
657 |
326 |
for(i=0; inDb; i++){ |
171857
|
645 |
12 |
if( pSchema ){ |
171858
|
750 |
645 |
for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){ |
171860
|
32 |
718 |
if( IsVirtual(pTab) ) sqlite3VtabDisconnect(db, pTab); |
171864
|
3214 |
326 |
for(p=sqliteHashFirst(&db->aModule); p; p=sqliteHashNext(p)){ |
171866
|
0 |
3214 |
if( pMod->pEpoTab ){ |
171884
|
11 |
630 |
if( db->pVdbe ) return 1; |
171885
|
1270 |
630 |
for(j=0; jnDb; j++){ |
171887
|
694 |
576 |
if( pBt && sqlite3BtreeIsInBackup(pBt) ) return 1; |
|
0 |
694 |
if( pBt && sqlite3BtreeIsInBackup(pBt) ) return 1; |
171896
|
0 |
326 |
if( !db ){ |
171901
|
0 |
326 |
if( !sqlite3SafetyCheckSickOrOk(db) ){ |
171905
|
0 |
326 |
if( db->mTrace & SQLITE_TRACE_CLOSE ){ |
171924
|
326 |
0 |
if( !forceZombie && connectionIsBusy(db) ){ |
|
11 |
315 |
if( !forceZombie && connectionIsBusy(db) ){ |
171959
|
0 |
0 |
if( zSchema ){ |
171961
|
0 |
0 |
if( iDb<0 ) nDb--; |
171966
|
0 |
0 |
for(; iDb<=nDb; iDb++){ |
171968
|
0 |
0 |
int x = pBt!=0 ? sqlite3BtreeTxnState(pBt) : SQLITE_TXN_NONE; |
171969
|
0 |
0 |
if( x>iTxn ) iTxn = x; |
172004
|
315 |
1820 |
if( db->eOpenState!=SQLITE_STATE_ZOMBIE || connectionIsBusy(db) ){ |
|
0 |
315 |
if( db->eOpenState!=SQLITE_STATE_ZOMBIE || connectionIsBusy(db) ){ |
172025
|
635 |
315 |
for(j=0; jnDb; j++){ |
172027
|
347 |
288 |
if( pDb->pBt ){ |
172030
|
314 |
33 |
if( j!=1 ){ |
172036
|
309 |
6 |
if( db->aDb[1].pSchema ){ |
172051
|
4432 |
315 |
for(i=sqliteHashFirst(&db->aFunc); i; i=sqliteHashNext(i)){ |
172059
|
618 |
4432 |
}while( p ); |
172062
|
961 |
315 |
for(i=sqliteHashFirst(&db->aCollSeq); i; i=sqliteHashNext(i)){ |
172065
|
2883 |
961 |
for(j=0; j<3; j++){ |
172066
|
0 |
2883 |
if( pColl[j].xDel ){ |
172074
|
3103 |
315 |
for(i=sqliteHashFirst(&db->aModule); i; i=sqliteHashNext(i)){ |
172099
|
0 |
315 |
if( db->xAutovacDestr ){ |
172106
|
309 |
6 |
if( db->lookaside.bMalloced ){ |
172133
|
5 |
361 |
schemaChange = (db->mDbFlags & DBFLAG_SchemaChange)!=0 && db->init.busy==0; |
|
5 |
0 |
schemaChange = (db->mDbFlags & DBFLAG_SchemaChange)!=0 && db->init.busy==0; |
172135
|
737 |
366 |
for(i=0; inDb; i++){ |
172137
|
402 |
335 |
if( p ){ |
172138
|
44 |
358 |
if( sqlite3BtreeTxnState(p)==SQLITE_TXN_WRITE ){ |
172147
|
5 |
361 |
if( schemaChange ){ |
172159
|
2 |
364 |
if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){ |
|
0 |
2 |
if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){ |
|
0 |
0 |
if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){ |
172332
|
23 |
0 |
if( ALWAYS(rc>=0) && rc
|
|
23 |
0 |
if( ALWAYS(rc>=0) && rc
|
|
23 |
0 |
if( ALWAYS(rc>=0) && rc
|
172367
|
120 |
58 |
if( count < NDELAY ){ |
172374
|
14 |
164 |
if( prior + delay > tmout ){ |
172376
|
7 |
7 |
if( delay<=0 ) return 0; |
172404
|
180 |
0 |
if( p->xBusyHandler==0 || p->nBusy<0 ) return 0; |
|
2 |
178 |
if( p->xBusyHandler==0 || p->nBusy<0 ) return 0; |
172406
|
7 |
171 |
if( rc==0 ){ |
172454
|
2 |
2 |
if( nOps>0 ){ |
172476
|
321 |
2 |
if( ms>0 ){ |
172524
|
5088 |
0 |
if( zFunctionName==0 /* Must have a valid name */ |
172525
|
5040 |
48 |
|| (xSFunc!=0 && xFinal!=0) /* Not both xSFunc and xFinal */ |
|
5040 |
0 |
|| (xSFunc!=0 && xFinal!=0) /* Not both xSFunc and xFinal */ |
172526
|
5088 |
0 |
|| ((xFinal==0)!=(xStep==0)) /* Both or neither of xFinal and xStep */ |
172527
|
5088 |
0 |
|| ((xValue==0)!=(xInverse==0)) /* Both or neither of xValue, xInverse */ |
172528
|
5088 |
0 |
|| (nArg<-1 || nArg>SQLITE_MAX_FUNCTION_ARG) |
|
5088 |
0 |
|| (nArg<-1 || nArg>SQLITE_MAX_FUNCTION_ARG) |
172529
|
0 |
5088 |
|| (255
|
172563
|
0 |
0 |
if( rc==SQLITE_OK ){ |
172568
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
172592
|
6 |
5082 |
if( p && (p->funcFlags & SQLITE_FUNC_ENCMASK)==(u32)enc && p->nArg==nArg ){ |
|
6 |
0 |
if( p && (p->funcFlags & SQLITE_FUNC_ENCMASK)==(u32)enc && p->nArg==nArg ){ |
|
6 |
0 |
if( p && (p->funcFlags & SQLITE_FUNC_ENCMASK)==(u32)enc && p->nArg==nArg ){ |
172593
|
0 |
6 |
if( db->nVdbeActive ){ |
172601
|
42 |
5040 |
}else if( xSFunc==0 && xFinal==0 ){ |
|
0 |
42 |
}else if( xSFunc==0 && xFinal==0 ){ |
172609
|
0 |
5088 |
if( !p ){ |
172617
|
2488 |
2600 |
if( pDestructor ){ |
172624
|
5040 |
48 |
p->xSFunc = xSFunc ? xSFunc : xStep; |
172662
|
2488 |
2600 |
if( xDestroy ){ |
172664
|
0 |
2488 |
if( !pArg ){ |
172676
|
2488 |
2600 |
if( pArg && pArg->nRef==0 ){ |
|
0 |
2488 |
if( pArg && pArg->nRef==0 ){ |
172813
|
311 |
2488 |
if( rc ) return SQLITE_OK; |
172815
|
0 |
2488 |
if( zCopy==0 ) return SQLITE_NOMEM; |
172841
|
4 |
2 |
db->mTrace = xTrace ? SQLITE_TRACE_LEGACY : 0; |
172863
|
0 |
0 |
if( mTrace==0 ) xTrace = 0; |
172864
|
0 |
0 |
if( xTrace==0 ) mTrace = 0; |
172899
|
4 |
2 |
if( db->xProfile ) db->mTrace |= SQLITE_TRACE_XPROFILE; |
173020
|
0 |
0 |
if( db->xAutovacDestr ){ |
173044
|
0 |
0 |
if( nFrame>=SQLITE_PTR_TO_INT(pClientData) ){ |
173072
|
311 |
0 |
if( nFrame>0 ){ |
173130
|
0 |
0 |
if( pnLog ) *pnLog = -1; |
173131
|
0 |
0 |
if( pnCkpt ) *pnCkpt = -1; |
173137
|
0 |
0 |
if( eModeSQLITE_CHECKPOINT_TRUNCATE ){ |
|
0 |
0 |
if( eModeSQLITE_CHECKPOINT_TRUNCATE ){ |
173144
|
0 |
0 |
if( zDb && zDb[0] ){ |
|
0 |
0 |
if( zDb && zDb[0] ){ |
173149
|
0 |
0 |
if( iDb<0 ){ |
173161
|
0 |
0 |
if( db->nVdbeActive==0 ){ |
173214
|
0 |
0 |
for(i=0; inDb && rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; inDb && rc==SQLITE_OK; i++){ |
173215
|
0 |
0 |
if( i==iDb || iDb==SQLITE_MAX_DB ){ |
|
0 |
0 |
if( i==iDb || iDb==SQLITE_MAX_DB ){ |
173219
|
0 |
0 |
if( rc==SQLITE_BUSY ){ |
173226
|
0 |
0 |
return (rc==SQLITE_OK && bBusy) ? SQLITE_BUSY : rc; |
|
0 |
0 |
return (rc==SQLITE_OK && bBusy) ? SQLITE_BUSY : rc; |
173272
|
0 |
128 |
if( !db ){ |
173275
|
0 |
128 |
if( !sqlite3SafetyCheckSickOrOk(db) ){ |
173279
|
0 |
128 |
if( db->mallocFailed ){ |
173283
|
128 |
0 |
z = db->errCode ? (char*)sqlite3_value_text(db->pErr) : 0; |
173285
|
17 |
111 |
if( z==0 ){ |
173298
|
1 |
0 |
if( db && sqlite3SafetyCheckSickOrOk(db) && db->errCode ){ |
|
1 |
0 |
if( db && sqlite3SafetyCheckSickOrOk(db) && db->errCode ){ |
|
1 |
0 |
if( db && sqlite3SafetyCheckSickOrOk(db) && db->errCode ){ |
173322
|
0 |
0 |
if( !db ){ |
173325
|
0 |
0 |
if( !sqlite3SafetyCheckSickOrOk(db) ){ |
173329
|
0 |
0 |
if( db->mallocFailed ){ |
173333
|
0 |
0 |
if( z==0 ){ |
173354
|
947 |
0 |
if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
|
0 |
947 |
if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
173357
|
947 |
0 |
if( !db || db->mallocFailed ){ |
|
0 |
947 |
if( !db || db->mallocFailed ){ |
173363
|
0 |
0 |
if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
|
0 |
0 |
if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
173366
|
0 |
0 |
if( !db || db->mallocFailed ){ |
|
0 |
0 |
if( !db || db->mallocFailed ){ |
173372
|
0 |
0 |
return db ? db->iSysErrno : 0; |
173408
|
1601 |
0 |
if( enc2==SQLITE_UTF16 || enc2==SQLITE_UTF16_ALIGNED ){ |
|
0 |
1601 |
if( enc2==SQLITE_UTF16 || enc2==SQLITE_UTF16_ALIGNED ){ |
173411
|
1601 |
0 |
if( enc2SQLITE_UTF16BE ){ |
|
0 |
1601 |
if( enc2SQLITE_UTF16BE ){ |
173420
|
634 |
967 |
if( pColl && pColl->xCmp ){ |
|
0 |
634 |
if( pColl && pColl->xCmp ){ |
173421
|
0 |
0 |
if( db->nVdbeActive ){ |
173434
|
0 |
0 |
if( (pColl->enc & ~SQLITE_UTF16_ALIGNED)==enc2 ){ |
173437
|
0 |
0 |
for(j=0; j<3; j++){ |
173439
|
0 |
0 |
if( p->enc==pColl->enc ){ |
173440
|
0 |
0 |
if( p->xDel ){ |
173450
|
0 |
1601 |
if( pColl==0 ) return SQLITE_NOMEM_BKPT; |
173559
|
6 |
0 |
if( limitId<0 || limitId>=SQLITE_N_LIMIT ){ |
|
0 |
6 |
if( limitId<0 || limitId>=SQLITE_N_LIMIT ){ |
173563
|
2 |
4 |
if( newLimit>=0 ){ /* IMP: R-52476-28732 */ |
173564
|
0 |
2 |
if( newLimit>aHardLimit[limitId] ){ |
173566
|
0 |
2 |
}else if( newLimit<1 && limitId==SQLITE_LIMIT_LENGTH ){ |
|
0 |
0 |
}else if( newLimit<1 && limitId==SQLITE_LIMIT_LENGTH ){ |
173617
|
309 |
13 |
if( ((flags & SQLITE_OPEN_URI) /* IMP: R-48725-32206 */ |
173618
|
0 |
309 |
|| sqlite3GlobalConfig.bOpenUri) /* IMP: R-51689-46548 */ |
173619
|
13 |
0 |
&& nUri>=5 && memcmp(zUri, "file:", 5)==0 /* IMP: R-57884-37496 */ |
|
12 |
1 |
&& nUri>=5 && memcmp(zUri, "file:", 5)==0 /* IMP: R-57884-37496 */ |
173631
|
214 |
12 |
for(iIn=0; iIn
|
173633
|
0 |
12 |
if( !zFile ) return SQLITE_NOMEM_BKPT; |
173653
|
0 |
12 |
if( zUri[5]=='/' && zUri[6]=='/' ){ |
|
0 |
0 |
if( zUri[5]=='/' && zUri[6]=='/' ){ |
173655
|
0 |
0 |
while( zUri[iIn] && zUri[iIn]!='/' ) iIn++; |
|
0 |
0 |
while( zUri[iIn] && zUri[iIn]!='/' ) iIn++; |
173656
|
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)) ){ |
173676
|
154 |
12 |
while( (c = zUri[iIn])!=0 && c!='#' ){ |
|
154 |
0 |
while( (c = zUri[iIn])!=0 && c!='#' ){ |
173678
|
0 |
154 |
if( c=='%' |
173679
|
0 |
0 |
&& sqlite3Isxdigit(zUri[iIn]) |
173680
|
0 |
0 |
&& sqlite3Isxdigit(zUri[iIn+1]) |
173686
|
0 |
0 |
if( octet==0 ){ |
173692
|
0 |
0 |
while( (c = zUri[iIn])!=0 && c!='#' |
|
0 |
0 |
while( (c = zUri[iIn])!=0 && c!='#' |
173693
|
0 |
0 |
&& (eState!=0 || c!='?') |
|
0 |
0 |
&& (eState!=0 || c!='?') |
173694
|
0 |
0 |
&& (eState!=1 || (c!='=' && c!='&')) |
|
0 |
0 |
&& (eState!=1 || (c!='=' && c!='&')) |
|
0 |
0 |
&& (eState!=1 || (c!='=' && c!='&')) |
173695
|
0 |
0 |
&& (eState!=2 || c!='&') |
|
0 |
0 |
&& (eState!=2 || c!='&') |
173708
|
50 |
104 |
}else if( eState==1 && (c=='&' || c=='=') ){ |
|
50 |
0 |
}else if( eState==1 && (c=='&' || c=='=') ){ |
|
10 |
40 |
}else if( eState==1 && (c=='&' || c=='=') ){ |
173709
|
0 |
10 |
if( zFile[iOut-1]==0 ){ |
173711
|
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++; |
173714
|
0 |
10 |
if( c=='&' ){ |
173720
|
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=='&') ){ |
173726
|
0 |
12 |
if( eState==1 ) zFile[iOut++] = '\0'; |
173734
|
10 |
12 |
while( zOpt[0] ){ |
173739
|
0 |
10 |
if( nOpt==3 && memcmp("vfs", zOpt, 3)==0 ){ |
|
0 |
0 |
if( nOpt==3 && memcmp("vfs", zOpt, 3)==0 ){ |
173750
|
0 |
10 |
if( nOpt==5 && memcmp("cache", zOpt, 5)==0 ){ |
|
0 |
0 |
if( nOpt==5 && memcmp("cache", zOpt, 5)==0 ){ |
173762
|
10 |
0 |
if( nOpt==4 && memcmp("mode", zOpt, 4)==0 ){ |
|
10 |
0 |
if( nOpt==4 && memcmp("mode", zOpt, 4)==0 ){ |
173778
|
10 |
0 |
if( aMode ){ |
173781
|
18 |
0 |
for(i=0; aMode[i].z; i++){ |
173783
|
14 |
4 |
if( nVal==sqlite3Strlen30(z) && 0==memcmp(zVal, z, nVal) ){ |
|
10 |
4 |
if( nVal==sqlite3Strlen30(z) && 0==memcmp(zVal, z, nVal) ){ |
173788
|
0 |
10 |
if( mode==0 ){ |
173793
|
0 |
10 |
if( (mode & ~SQLITE_OPEN_MEMORY)>limit ){ |
173808
|
0 |
310 |
if( !zFile ) return SQLITE_NOMEM_BKPT; |
173811
|
307 |
3 |
if( nUri ){ |
173819
|
0 |
322 |
if( *ppVfs==0 ){ |
173824
|
0 |
322 |
if( rc!=SQLITE_OK ){ |
173839
|
260 |
0 |
while( ALWAYS(zFilename!=0) && zFilename[0] ){ |
|
28 |
232 |
while( ALWAYS(zFilename!=0) && zFilename[0] ){ |
173842
|
0 |
28 |
if( x==0 ) return zFilename; |
173874
|
0 |
317 |
if( rc ) return rc; |
173877
|
0 |
317 |
if( sqlite3GlobalConfig.bCoreMutex==0 ){ |
173879
|
0 |
317 |
}else if( flags & SQLITE_OPEN_NOMUTEX ){ |
173881
|
0 |
317 |
}else if( flags & SQLITE_OPEN_FULLMUTEX ){ |
173887
|
0 |
317 |
if( flags & SQLITE_OPEN_PRIVATECACHE ){ |
173889
|
0 |
317 |
}else if( sqlite3GlobalConfig.sharedCacheEnabled ){ |
173918
|
0 |
317 |
if( db==0 ) goto opendb_out; |
173919
|
317 |
0 |
if( isThreadsafe |
173925
|
0 |
317 |
if( db->mutex==0 ){ |
173935
|
0 |
317 |
db->errMask = (flags & SQLITE_OPEN_EXRESCODE)!=0 ? 0xffffffff : 0xff; |
174044
|
0 |
317 |
if( db->mallocFailed ){ |
174067
|
0 |
317 |
if( ((1<<(flags&7)) & 0x46)==0 ){ |
174072
|
0 |
317 |
if( rc!=SQLITE_OK ){ |
174073
|
0 |
0 |
if( rc==SQLITE_NOMEM ) sqlite3OomFault(db); |
174074
|
0 |
0 |
sqlite3ErrorWithMsg(db, rc, zErrMsg ? "%s" : 0, zErrMsg); |
174082
|
6 |
311 |
if( rc!=SQLITE_OK ){ |
174083
|
0 |
6 |
if( rc==SQLITE_IOERR_NOMEM ){ |
174091
|
311 |
0 |
if( !db->mallocFailed ){ |
174106
|
0 |
311 |
if( db->mallocFailed ){ |
174120
|
1866 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
1555 |
311 |
for(i=0; rc==SQLITE_OK && i
|
174127
|
311 |
0 |
if( rc==SQLITE_OK ){ |
174130
|
0 |
311 |
if( rc!=SQLITE_OK ){ |
174152
|
0 |
311 |
if( rc ) sqlite3Error(db, rc); |
174161
|
317 |
0 |
if( db ){ |
174168
|
0 |
317 |
if( (rc&0xff)==SQLITE_NOMEM ){ |
174171
|
6 |
311 |
}else if( rc!=SQLITE_OK ){ |
174224
|
0 |
0 |
if( rc ) return rc; |
174226
|
0 |
0 |
if( zFilename==0 ) zFilename = "\000\000"; |
174230
|
0 |
0 |
if( zFilename8 ){ |
174234
|
0 |
0 |
if( rc==SQLITE_OK && !DbHasProperty(*ppDb, 0, DB_SchemaLoaded) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && !DbHasProperty(*ppDb, 0, DB_SchemaLoaded) ){ |
174303
|
0 |
0 |
if( zName8 ){ |
174477
|
0 |
13 |
if( SQLITE_OK!=rc ){ |
174483
|
10 |
3 |
if( !pTab || IsView(pTab) ){ |
|
0 |
10 |
if( !pTab || IsView(pTab) ){ |
174489
|
10 |
0 |
if( zColumnName==0 ){ |
174492
|
22 |
2 |
for(iCol=0; iColnCol; iCol++){ |
174494
|
8 |
14 |
if( 0==sqlite3StrICmp(pCol->zCnName, zColumnName) ){ |
174498
|
2 |
8 |
if( iCol==pTab->nCol ){ |
174499
|
2 |
0 |
if( HasRowid(pTab) && sqlite3IsRowid(zColumnName) ){ |
|
0 |
2 |
if( HasRowid(pTab) && sqlite3IsRowid(zColumnName) ){ |
174501
|
0 |
0 |
pCol = iCol>=0 ? &pTab->aCol[iCol] : 0; |
174519
|
8 |
0 |
if( pCol ){ |
174524
|
3 |
5 |
autoinc = pTab->iPKey==iCol && (pTab->tabFlags & TF_Autoincrement)!=0; |
|
2 |
1 |
autoinc = pTab->iPKey==iCol && (pTab->tabFlags & TF_Autoincrement)!=0; |
174529
|
8 |
0 |
if( !zCollSeq ){ |
174540
|
12 |
1 |
if( pzDataType ) *pzDataType = zDataType; |
174541
|
12 |
1 |
if( pzCollSeq ) *pzCollSeq = zCollSeq; |
174542
|
12 |
1 |
if( pNotNull ) *pNotNull = notnull; |
174543
|
12 |
1 |
if( pPrimaryKey ) *pPrimaryKey = primarykey; |
174544
|
12 |
1 |
if( pAutoinc ) *pAutoinc = autoinc; |
174546
|
13 |
0 |
if( SQLITE_OK==rc && !pTab ){ |
|
5 |
8 |
if( SQLITE_OK==rc && !pTab ){ |
174552
|
5 |
8 |
sqlite3ErrorWithMsg(db, rc, (zErrMsg?"%s":0), zErrMsg); |
174566
|
0 |
0 |
if( pVfs==0 ) return 0; |
174583
|
0 |
0 |
db->errMask = onoff ? 0xffffffff : 0xff; |
174600
|
219 |
0 |
if( pBtree ){ |
174608
|
0 |
219 |
if( op==SQLITE_FCNTL_FILE_POINTER ){ |
174611
|
0 |
219 |
}else if( op==SQLITE_FCNTL_VFS_POINTER ){ |
174614
|
0 |
219 |
}else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){ |
174617
|
0 |
219 |
}else if( op==SQLITE_FCNTL_DATA_VERSION ){ |
174620
|
0 |
219 |
}else if( op==SQLITE_FCNTL_RESERVE_BYTES ){ |
174623
|
0 |
0 |
if( iNew>=0 && iNew<=255 ){ |
|
0 |
0 |
if( iNew>=0 && iNew<=255 ){ |
174690
|
0 |
0 |
int x = va_arg(ap, int); |
174692
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*); |
174694
|
0 |
0 |
if( db && (y = db->aDb[0].pSchema->schema_cookie)!=0 ){ x = y; } |
|
0 |
0 |
if( db && (y = db->aDb[0].pSchema->schema_cookie)!=0 ){ x = y; } |
174710
|
0 |
0 |
int sz = va_arg(ap, int); |
174711
|
0 |
0 |
int *aProg = va_arg(ap, int*); |
174737
|
0 |
0 |
sqlite3GlobalConfig.xTestCallback = va_arg(ap, sqlite3FaultFuncType); |
174752
|
0 |
0 |
xBenignBegin = va_arg(ap, void_function); |
174753
|
0 |
0 |
xBenignEnd = va_arg(ap, void_function); |
174774
|
0 |
0 |
unsigned int newVal = va_arg(ap, unsigned int); |
174775
|
0 |
0 |
if( newVal ) sqlite3PendingByte = newVal; |
174850
|
0 |
0 |
int x = va_arg(ap,int); |
174881
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*); |
174882
|
0 |
0 |
db->dbOptFlags = va_arg(ap, u32); |
174900
|
0 |
0 |
sqlite3GlobalConfig.bLocaltimeFault = va_arg(ap, int); |
174901
|
0 |
0 |
if( sqlite3GlobalConfig.bLocaltimeFault==2 ){ |
174903
|
0 |
0 |
sqlite3GlobalConfig.xAltLocaltime = va_arg(ap, sqlite3LocaltimeType); |
174916
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*); |
174930
|
0 |
0 |
sqlite3GlobalConfig.neverCorrupt = va_arg(ap, int); |
174947
|
0 |
0 |
sqlite3GlobalConfig.bExtraSchemaChecks = va_arg(ap, int); |
174957
|
0 |
0 |
sqlite3GlobalConfig.iOnceResetThreshold = va_arg(ap, int); |
174978
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*); |
174979
|
0 |
0 |
db->nMaxSorterMmap = va_arg(ap, int); |
174989
|
0 |
0 |
if( sqlite3GlobalConfig.isInit==0 ) rc = SQLITE_ERROR; |
175010
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*); |
175013
|
0 |
0 |
iDb = sqlite3FindDbName(db, va_arg(ap,const char*)); |
175014
|
0 |
0 |
if( iDb>=0 ){ |
175016
|
0 |
0 |
db->init.busy = db->init.imposterTable = va_arg(ap,int); |
175017
|
0 |
0 |
db->init.newTnum = va_arg(ap,int); |
175018
|
0 |
0 |
if( db->init.busy==0 && db->init.newTnum>0 ){ |
|
0 |
0 |
if( db->init.busy==0 && db->init.newTnum>0 ){ |
175053
|
0 |
0 |
sqlite3_context *pCtx = va_arg(ap, sqlite3_context*); |
175068
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*); |
175069
|
0 |
0 |
u64 *pn = va_arg(ap, sqlite3_uint64*); |
175085
|
0 |
0 |
int opTrace = va_arg(ap, int); |
175086
|
0 |
0 |
u32 *ptr = va_arg(ap, u32*); |
175106
|
0 |
0 |
double rIn = va_arg(ap, double); |
175108
|
0 |
0 |
int *pI1 = va_arg(ap,int*); |
175109
|
0 |
0 |
u64 *pU64 = va_arg(ap,u64*); |
175110
|
0 |
0 |
int *pI2 = va_arg(ap,int*); |
175162
|
0 |
554 |
while( zName[-1]!=0 || zName[-2]!=0 || zName[-3]!=0 || zName[-4]!=0 ){ |
|
0 |
554 |
while( zName[-1]!=0 || zName[-2]!=0 || zName[-3]!=0 || zName[-4]!=0 ){ |
|
0 |
554 |
while( zName[-1]!=0 || zName[-2]!=0 || zName[-3]!=0 || zName[-4]!=0 ){ |
|
0 |
554 |
while( zName[-1]!=0 || zName[-2]!=0 || zName[-3]!=0 || zName[-4]!=0 ){ |
175198
|
0 |
0 |
for(i=0; i
|
175202
|
0 |
0 |
if( p==0 ) return 0; |
175206
|
0 |
0 |
for(i=0; i
|
175224
|
0 |
322 |
if( p==0 ) return; |
175242
|
232 |
190 |
if( zFilename==0 || zParam==0 ) return 0; |
|
0 |
232 |
if( zFilename==0 || zParam==0 ) return 0; |
175251
|
0 |
0 |
if( zFilename==0 || N<0 ) return 0; |
|
0 |
0 |
if( zFilename==0 || N<0 ) return 0; |
175254
|
0 |
0 |
while( ALWAYS(zFilename) && zFilename[0] && (N--)>0 ){ |
|
0 |
0 |
while( ALWAYS(zFilename) && zFilename[0] && (N--)>0 ){ |
|
0 |
0 |
while( ALWAYS(zFilename) && zFilename[0] && (N--)>0 ){ |
175258
|
0 |
0 |
return zFilename[0] ? zFilename : 0; |
175267
|
0 |
410 |
return z ? sqlite3GetBoolean(z, bDflt) : bDflt; |
175280
|
0 |
0 |
if( z && sqlite3DecOrHexToI64(z, &v)==0 ){ |
|
0 |
0 |
if( z && sqlite3DecOrHexToI64(z, &v)==0 ){ |
175297
|
0 |
0 |
if( zFilename==0 ) return 0; |
175301
|
0 |
0 |
if( zFilename==0 ) return 0; |
175304
|
0 |
0 |
while( ALWAYS(zFilename) && zFilename[0] ){ |
|
0 |
0 |
while( ALWAYS(zFilename) && zFilename[0] ){ |
175315
|
0 |
0 |
if( zFilename ) zFilename += sqlite3Strlen30(zFilename) + 1; |
175324
|
122 |
110 |
int iDb = zDbName ? sqlite3FindDbName(db, zDbName) : 0; |
175325
|
232 |
0 |
return iDb<0 ? 0 : db->aDb[iDb].pBt; |
175339
|
0 |
0 |
if( N<0 || N>=db->nDb ){ |
|
0 |
0 |
if( N<0 || N>=db->nDb ){ |
175359
|
9 |
0 |
return pBt ? sqlite3BtreeGetFilename(pBt) : 0; |
175375
|
4 |
0 |
return pBt ? sqlite3BtreeIsReadonly(pBt) : -1; |
175533
|
0 |
0 |
if( sqlite3StrNICmp(zOptName, "SQLITE_", 7)==0 ) zOptName += 7; |
175538
|
0 |
0 |
for(i=0; i
|
175539
|
0 |
0 |
if( sqlite3StrNICmp(zOptName, azCompileOpt[i], n)==0 |
175540
|
0 |
0 |
&& sqlite3IsIdChar((unsigned char)azCompileOpt[i][n])==0 |
175556
|
704 |
0 |
if( N>=0 && N
|
|
688 |
16 |
if( N>=0 && N
|
177181
|
138456 |
340164 |
}while( vu!=0 ); |
177201
|
7182 |
1242 |
GETVARINT_INIT(a, p, 0, 0x00, 0x80, *v, 1); |
177202
|
1240 |
2 |
GETVARINT_STEP(a, p, 7, 0x7F, 0x4000, *v, 2); |
177203
|
2 |
0 |
GETVARINT_STEP(a, p, 14, 0x3FFF, 0x200000, *v, 3); |
177204
|
0 |
0 |
GETVARINT_STEP(a, p, 21, 0x1FFFFF, 0x10000000, *v, 4); |
177207
|
0 |
0 |
for(shift=28; shift<=63; shift+=7){ |
177210
|
0 |
0 |
if( (c & 0x80)==0 ) break; |
177241
|
0 |
0 |
for(shift=0; shift<=63; shift+=7){ |
177242
|
0 |
0 |
u64 c = p
|
177245
|
0 |
0 |
if( (c & 0x80)==0 ) break; |
177266
|
119 |
0 |
GETVARINT_STEP(a, ptr, 7, 0x7F, 0x4000, *pi, 2); |
177267
|
0 |
0 |
GETVARINT_STEP(a, ptr, 14, 0x3FFF, 0x200000, *pi, 3); |
177268
|
0 |
0 |
GETVARINT_STEP(a, ptr, 21, 0x1FFFFF, 0x10000000, *pi, 4); |
177284
|
614 |
38153 |
}while( v!=0 ); |
177306
|
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=='`' ){ |
177311
|
0 |
7 |
if( quote=='[' ) quote = ']'; |
177313
|
125 |
0 |
while( z[iIn] ){ |
177314
|
7 |
118 |
if( z[iIn]==quote ){ |
177315
|
7 |
0 |
if( z[iIn+1]!=quote ) break; |
177357
|
0 |
0 |
for(p = (*pp)-2; p>=pStart && *p&0x80; p--); |
|
0 |
0 |
for(p = (*pp)-2; p>=pStart && *p&0x80; p--); |
177377
|
360 |
9 |
for(i=0; iaStmt); i++){ |
177419
|
0 |
32 |
if( *pRc ) return; |
177423
|
0 |
32 |
if( zSql==0 ){ |
177441
|
0 |
0 |
fts3DbExec(&rc, db, |
177458
|
0 |
0 |
return (rc==SQLITE_OK ? fts3DisconnectMethod(pVtab) : rc); |
177472
|
9 |
0 |
if( *pRc==SQLITE_OK ){ |
177479
|
0 |
9 |
zLanguageid = (p->zLanguageid ? p->zLanguageid : "__langid"); |
177484
|
14 |
0 |
for(i=1; zCols && inColumn; i++){ |
|
5 |
9 |
for(i=1; zCols && inColumn; i++){ |
177493
|
9 |
0 |
if( !zCols || !zSql ){ |
|
0 |
9 |
if( !zCols || !zSql ){ |
177514
|
5 |
0 |
if( (*pRc)==SQLITE_OK ) p->bHasStat = 1; |
177531
|
6 |
2 |
if( p->zContentTbl==0 ){ |
177537
|
14 |
0 |
for(i=0; zContentCols && inColumn; i++){ |
|
8 |
6 |
for(i=0; zContentCols && inColumn; i++){ |
177541
|
0 |
6 |
if( zLanguageid && zContentCols ){ |
|
0 |
0 |
if( zLanguageid && zContentCols ){ |
177544
|
0 |
6 |
if( zContentCols==0 ) rc = SQLITE_NOMEM; |
177571
|
5 |
3 |
if( p->bHasDocsize ){ |
177578
|
5 |
3 |
if( p->bHasStat ){ |
177592
|
9 |
0 |
if( *pRc==SQLITE_OK ){ |
177598
|
0 |
9 |
if( !zSql ){ |
177602
|
9 |
0 |
if( rc==SQLITE_OK ){ |
177606
|
0 |
0 |
}else if( rc==SQLITE_AUTH ){ |
177633
|
51 |
3 |
while( *zCsr!='=' ){ |
177634
|
6 |
45 |
if( *zCsr=='\0' ) return 0; |
177640
|
3 |
0 |
if( zValue ){ |
177656
|
55 |
0 |
if( *pRc==SQLITE_OK ){ |
177662
|
55 |
0 |
if( z && *pz ){ |
|
37 |
18 |
if( z && *pz ){ |
177667
|
0 |
55 |
if( z==0 ) *pRc = SQLITE_NOMEM; |
177688
|
0 |
0 |
if( zRet ){ |
177692
|
0 |
0 |
for(i=0; zInput[i]; i++){ |
177693
|
0 |
0 |
if( zInput[i]=='"' ) *(z++) = '"'; |
177731
|
6 |
3 |
if( p->zContentTbl==0 ){ |
177732
|
6 |
0 |
if( !zFunc ){ |
177738
|
8 |
6 |
for(i=0; inColumn; i++){ |
177741
|
0 |
6 |
if( p->zLanguageid ){ |
177747
|
6 |
3 |
for(i=0; inColumn; i++){ |
177750
|
0 |
3 |
if( p->zLanguageid ){ |
177754
|
3 |
6 |
fts3Appendf(pRc, &zRet, " FROM '%q'.'%q%s' AS x", |
|
3 |
6 |
fts3Appendf(pRc, &zRet, " FROM '%q'.'%q%s' AS x", |
177788
|
9 |
0 |
if( !zFunc ){ |
177794
|
14 |
9 |
for(i=0; inColumn; i++){ |
177797
|
0 |
9 |
if( p->zLanguageid ){ |
177812
|
0 |
0 |
for(i=0; z[i]>='0' && z[i]<='9'; i++){ |
|
0 |
0 |
for(i=0; z[i]>='0' && z[i]<='9'; i++){ |
177814
|
0 |
0 |
if( iVal>0x7FFFFFFF ) return -1; |
177838
|
0 |
0 |
if( nInt>MAX_NPREFIX ){ |
177841
|
0 |
0 |
if( nByte==0 ){ |
177874
|
0 |
9 |
if( zParam && zParam[0] ){ |
|
0 |
0 |
if( zParam && zParam[0] ){ |
177877
|
0 |
0 |
for(p=zParam; *p; p++){ |
177878
|
0 |
0 |
if( *p==',' ) nIndex++; |
177884
|
0 |
9 |
if( !aIndex ){ |
177889
|
0 |
9 |
if( zParam ){ |
177892
|
0 |
0 |
for(i=1; i
|
177894
|
0 |
0 |
if( fts3GobbleInt(&p, &nPrefix) ) return SQLITE_ERROR; |
177896
|
0 |
0 |
if( nPrefix==0 ){ |
177949
|
0 |
2 |
if( !zSql ){ |
177953
|
0 |
2 |
if( rc!=SQLITE_OK ){ |
177959
|
2 |
0 |
if( rc==SQLITE_OK ){ |
177969
|
4 |
2 |
for(i=0; i
|
177976
|
0 |
2 |
if( azCol==0 ){ |
177980
|
4 |
2 |
for(i=0; i
|
178058
|
10 |
0 |
if( aCol ){ |
178062
|
10 |
0 |
if( azNotindexed ){ |
178065
|
10 |
0 |
if( !aCol || !azNotindexed ){ |
|
0 |
10 |
if( !aCol || !azNotindexed ){ |
178081
|
29 |
1 |
for(i=3; rc==SQLITE_OK && i
|
|
20 |
9 |
for(i=3; rc==SQLITE_OK && i
|
178087
|
20 |
0 |
if( !pTokenizer |
178088
|
11 |
9 |
&& strlen(z)>8 |
178089
|
6 |
5 |
&& 0==sqlite3_strnicmp(z, "tokenize", 8) |
178090
|
6 |
0 |
&& 0==sqlite3Fts3IsIdChar(z[8]) |
178096
|
9 |
5 |
else if( isFts4 && fts3IsSpecialColumn(z, &nKey, &zVal) ){ |
|
3 |
6 |
else if( isFts4 && fts3IsSpecialColumn(z, &nKey, &zVal) ){ |
178112
|
0 |
3 |
if( !zVal ){ |
178115
|
18 |
0 |
for(iOpt=0; iOpt
|
178117
|
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) ){ |
178123
|
0 |
0 |
if( strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "fts3", 4) ){ |
|
0 |
0 |
if( strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "fts3", 4) ){ |
178149
|
0 |
0 |
if( (strlen(zVal)!=3 || sqlite3_strnicmp(zVal, "asc", 3)) |
|
0 |
0 |
if( (strlen(zVal)!=3 || sqlite3_strnicmp(zVal, "asc", 3)) |
178150
|
0 |
0 |
&& (strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "desc", 4)) |
|
0 |
0 |
&& (strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "desc", 4)) |
178155
|
0 |
0 |
bDescIdx = (zVal[0]=='d' || zVal[0]=='D'); |
|
0 |
0 |
bDescIdx = (zVal[0]=='d' || zVal[0]=='D'); |
178200
|
9 |
1 |
if( rc==SQLITE_OK && zContent ){ |
|
3 |
6 |
if( rc==SQLITE_OK && zContent ){ |
178205
|
2 |
1 |
if( nCol==0 ){ |
178212
|
2 |
0 |
if( rc==SQLITE_OK && zLanguageid ){ |
|
0 |
2 |
if( rc==SQLITE_OK && zLanguageid ){ |
178214
|
0 |
0 |
for(j=0; j
|
178215
|
0 |
0 |
if( sqlite3_stricmp(zLanguageid, aCol[j])==0 ){ |
178217
|
0 |
0 |
for(k=j; k
|
178225
|
1 |
9 |
if( rc!=SQLITE_OK ) goto fts3_init_out; |
178227
|
0 |
9 |
if( nCol==0 ){ |
178234
|
4 |
5 |
if( pTokenizer==0 ){ |
178236
|
0 |
4 |
if( rc!=SQLITE_OK ) goto fts3_init_out; |
178241
|
0 |
9 |
if( rc==SQLITE_ERROR ){ |
178245
|
0 |
9 |
if( rc!=SQLITE_OK ) goto fts3_init_out; |
178256
|
0 |
9 |
if( p==0 ){ |
178267
|
6 |
3 |
p->bHasDocsize = (isFts4 && bNoDocsize==0); |
|
6 |
0 |
p->bHasDocsize = (isFts4 && bNoDocsize==0); |
178282
|
9 |
9 |
for(i=0; i
|
178297
|
14 |
9 |
for(iCol=0; iCol
|
178301
|
14 |
0 |
if( n>0 ){ |
178312
|
14 |
9 |
for(iCol=0; iCol
|
178314
|
0 |
14 |
for(i=0; i
|
178316
|
0 |
0 |
if( zNot && n==(int)strlen(zNot) |
|
0 |
0 |
if( zNot && n==(int)strlen(zNot) |
178317
|
0 |
0 |
&& 0==sqlite3_strnicmp(p->azColumn[iCol], zNot, n) |
178325
|
0 |
9 |
for(i=0; i
|
178326
|
0 |
0 |
if( azNotindexed[i] ){ |
178332
|
9 |
0 |
if( rc==SQLITE_OK && (zCompress==0)!=(zUncompress==0) ){ |
|
0 |
9 |
if( rc==SQLITE_OK && (zCompress==0)!=(zUncompress==0) ){ |
178333
|
0 |
0 |
char const *zMiss = (zCompress==0 ? "compress" : "uncompress"); |
178339
|
0 |
9 |
if( rc!=SQLITE_OK ) goto fts3_init_out; |
178344
|
8 |
1 |
if( isCreate ){ |
178351
|
3 |
6 |
if( !isFts4 && !isCreate ){ |
|
0 |
3 |
if( !isFts4 && !isCreate ){ |
178374
|
0 |
10 |
for(i=0; i
|
178377
|
1 |
9 |
if( rc!=SQLITE_OK ){ |
178378
|
0 |
1 |
if( p ){ |
178380
|
0 |
1 |
}else if( pTokenizer ){ |
178422
|
0 |
0 |
if( sqlite3_libversion_number()>=3008002 ){ |
178435
|
0 |
0 |
if( sqlite3_libversion_number()>=3008012 ){ |
178459
|
0 |
63 |
if( p->bLock ){ |
178469
|
63 |
63 |
for(i=0; inConstraint; i++){ |
178472
|
0 |
63 |
if( pCons->usable==0 ){ |
178473
|
0 |
0 |
if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH ){ |
178487
|
63 |
0 |
bDocid = (pCons->iColumn<0 || pCons->iColumn==p->nColumn+1); |
|
0 |
63 |
bDocid = (pCons->iColumn<0 || pCons->iColumn==p->nColumn+1); |
178490
|
63 |
0 |
if( iCons<0 && pCons->op==SQLITE_INDEX_CONSTRAINT_EQ && bDocid ){ |
|
1 |
62 |
if( iCons<0 && pCons->op==SQLITE_INDEX_CONSTRAINT_EQ && bDocid ){ |
|
0 |
1 |
if( iCons<0 && pCons->op==SQLITE_INDEX_CONSTRAINT_EQ && bDocid ){ |
178505
|
62 |
1 |
if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH |
178506
|
62 |
0 |
&& pCons->iColumn>=0 && pCons->iColumn<=p->nColumn |
|
62 |
0 |
&& pCons->iColumn>=0 && pCons->iColumn<=p->nColumn |
178514
|
1 |
62 |
if( pCons->op==SQLITE_INDEX_CONSTRAINT_EQ |
178515
|
0 |
1 |
&& pCons->iColumn==p->nColumn + 2 |
178520
|
0 |
63 |
if( bDocid ){ |
178536
|
0 |
63 |
if( pInfo->idxNum==FTS3_DOCID_SEARCH ) fts3SetUniqueFlag(pInfo); |
178539
|
62 |
1 |
if( iCons>=0 ){ |
178543
|
0 |
63 |
if( iLangidCons>=0 ){ |
178547
|
0 |
63 |
if( iDocidGe>=0 ){ |
178551
|
0 |
63 |
if( iDocidLe>=0 ){ |
178559
|
0 |
63 |
if( pInfo->nOrderBy==1 ){ |
178561
|
0 |
0 |
if( pOrder->iColumn<0 || pOrder->iColumn==p->nColumn+1 ){ |
|
0 |
0 |
if( pOrder->iColumn<0 || pOrder->iColumn==p->nColumn+1 ){ |
178562
|
0 |
0 |
if( pOrder->desc ){ |
178588
|
0 |
63 |
if( !pCsr ){ |
178603
|
30 |
159 |
if( pCsr->bSeekStmt ){ |
178605
|
30 |
0 |
if( p->pSeekStmt==0 ){ |
178652
|
30 |
44 |
if( pCsr->pStmt==0 ){ |
178655
|
22 |
8 |
if( p->pSeekStmt ){ |
178660
|
0 |
8 |
if( !zSql ) return SQLITE_NOMEM; |
178668
|
30 |
0 |
if( rc==SQLITE_OK ) pCsr->bSeekStmt = 1; |
178680
|
74 |
17 |
if( pCsr->isRequireSeek ){ |
178682
|
74 |
0 |
if( rc==SQLITE_OK ){ |
178687
|
74 |
0 |
if( SQLITE_ROW==sqlite3_step(pCsr->pStmt) ){ |
178693
|
0 |
0 |
if( rc==SQLITE_OK && ((Fts3Table *)pCsr->base.pVtab)->zContentTbl==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && ((Fts3Table *)pCsr->base.pVtab)->zContentTbl==0 ){ |
178704
|
0 |
17 |
if( rc!=SQLITE_OK && pContext ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && pContext ){ |
178757
|
0 |
57 |
if( zCsr>zEnd ){ |
178761
|
561 |
33 |
while( zCsr
|
|
537 |
24 |
while( zCsr
|
|
0 |
24 |
while( zCsr
|
178768
|
480 |
57 |
if( !isFirstTerm ){ |
178769
|
0 |
480 |
zCsr += fts3GetVarint32(zCsr, &nPrefix); |
178770
|
0 |
480 |
if( nPrefix>nBuffer ){ |
178776
|
0 |
537 |
zCsr += fts3GetVarint32(zCsr, &nSuffix); |
178779
|
537 |
0 |
if( nPrefix>zCsr-zNode || nSuffix>zEnd-zCsr || nSuffix==0 ){ |
|
537 |
0 |
if( nPrefix>zCsr-zNode || nSuffix>zEnd-zCsr || nSuffix==0 ){ |
|
0 |
537 |
if( nPrefix>zCsr-zNode || nSuffix>zEnd-zCsr || nSuffix==0 ){ |
178783
|
96 |
441 |
if( (i64)nPrefix+nSuffix>nAlloc ){ |
178787
|
0 |
96 |
if( !zNew ){ |
178808
|
537 |
0 |
if( piFirst && (cmp<0 || (cmp==0 && nBuffer>nTerm)) ){ |
|
500 |
37 |
if( piFirst && (cmp<0 || (cmp==0 && nBuffer>nTerm)) ){ |
|
4 |
496 |
if( piFirst && (cmp<0 || (cmp==0 && nBuffer>nTerm)) ){ |
|
0 |
4 |
if( piFirst && (cmp<0 || (cmp==0 && nBuffer>nTerm)) ){ |
178813
|
0 |
537 |
if( piLast && cmp<0 ){ |
|
0 |
0 |
if( piLast && cmp<0 ){ |
178821
|
20 |
37 |
if( piFirst ) *piFirst = (i64)iChild; |
178822
|
0 |
57 |
if( piLast ) *piLast = (i64)iChild; |
178865
|
0 |
57 |
fts3GetVarint32(zNode, &iHeight); |
178869
|
57 |
0 |
if( rc==SQLITE_OK && iHeight>1 ){ |
|
0 |
57 |
if( rc==SQLITE_OK && iHeight>1 ){ |
178873
|
0 |
0 |
if( piLeaf && piLeaf2 && (*piLeaf!=*piLeaf2) ){ |
|
0 |
0 |
if( piLeaf && piLeaf2 && (*piLeaf!=*piLeaf2) ){ |
|
0 |
0 |
if( piLeaf && piLeaf2 && (*piLeaf!=*piLeaf2) ){ |
178875
|
0 |
0 |
if( rc==SQLITE_OK ){ |
178883
|
0 |
0 |
if( rc==SQLITE_OK ){ |
178884
|
0 |
0 |
rc = sqlite3Fts3ReadBlock(p, piLeaf?*piLeaf:*piLeaf2, &zBlob, &nBlob, 0); |
178886
|
0 |
0 |
if( rc==SQLITE_OK ){ |
178888
|
0 |
0 |
fts3GetVarint32(zBlob, &iNewHeight); |
178889
|
0 |
0 |
if( iNewHeight>=iHeight ){ |
178943
|
20 |
192 |
while( *pEnd | c ){ |
178949
|
8 |
184 |
if( pp ){ |
178983
|
1580 |
172 |
while( 0xFE & (*pEnd | c) ){ |
178987
|
0 |
172 |
if( pp ){ |
179026
|
0 |
0 |
if( (**pp)&0xFE ){ |
179028
|
0 |
0 |
*pp += fts3GetVarint32((*pp), &iVal); |
179047
|
0 |
0 |
if( iCol ){ |
179072
|
0 |
0 |
while( *p1 || *p2 ){ |
|
0 |
0 |
while( *p1 || *p2 ){ |
179076
|
0 |
0 |
if( *p1==POS_COLUMN ){ |
179077
|
0 |
0 |
fts3GetVarint32(&p1[1], &iCol1); |
179078
|
0 |
0 |
if( iCol1==0 ) return FTS_CORRUPT_VTAB; |
179080
|
0 |
0 |
else if( *p1==POS_END ) iCol1 = 0x7fffffff; |
179083
|
0 |
0 |
if( *p2==POS_COLUMN ){ |
179084
|
0 |
0 |
fts3GetVarint32(&p2[1], &iCol2); |
179085
|
0 |
0 |
if( iCol2==0 ) return FTS_CORRUPT_VTAB; |
179087
|
0 |
0 |
else if( *p2==POS_END ) iCol2 = 0x7fffffff; |
179090
|
0 |
0 |
if( iCol1==iCol2 ){ |
179109
|
0 |
0 |
if( i1<2 || i2<2 ){ |
|
0 |
0 |
if( i1<2 || i2<2 ){ |
179115
|
0 |
0 |
if( i1==i2 ){ |
179118
|
0 |
0 |
}else if( i1
|
179123
|
0 |
0 |
}while( i1!=POSITION_LIST_END || i2!=POSITION_LIST_END ); |
|
0 |
0 |
}while( i1!=POSITION_LIST_END || i2!=POSITION_LIST_END ); |
179124
|
0 |
0 |
}else if( iCol1
|
179181
|
0 |
86 |
if( *p1==POS_COLUMN ){ |
179183
|
0 |
0 |
p1 += fts3GetVarint32(p1, &iCol1); |
179185
|
0 |
86 |
if( *p2==POS_COLUMN ){ |
179187
|
0 |
0 |
p2 += fts3GetVarint32(p2, &iCol2); |
179191
|
86 |
0 |
if( iCol1==iCol2 ){ |
179197
|
0 |
86 |
if( iCol1 ){ |
179204
|
86 |
0 |
if( iPos1<0 || iPos2<0 ) break; |
|
86 |
0 |
if( iPos1<0 || iPos2<0 ) break; |
179207
|
7659 |
142 |
if( iPos2==iPos1+nToken |
179208
|
0 |
7659 |
|| (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) |
179211
|
0 |
142 |
iSave = isSaveLeft ? iPos1 : iPos2; |
179216
|
7801 |
0 |
if( (!isSaveLeft && iPos2<=(iPos1+nToken)) || iPos2<=iPos1 ){ |
|
3007 |
4794 |
if( (!isSaveLeft && iPos2<=(iPos1+nToken)) || iPos2<=iPos1 ){ |
|
0 |
3007 |
if( (!isSaveLeft && iPos2<=(iPos1+nToken)) || iPos2<=iPos1 ){ |
179217
|
70 |
4724 |
if( (*p2&0xFE)==0 ) break; |
179220
|
16 |
2991 |
if( (*p1&0xFE)==0 ) break; |
179225
|
6 |
80 |
if( pSave ){ |
179233
|
0 |
86 |
if( 0==*p1 || 0==*p2 ) break; |
|
0 |
0 |
if( 0==*p1 || 0==*p2 ) break; |
179236
|
0 |
0 |
p1 += fts3GetVarint32(p1, &iCol1); |
179238
|
0 |
0 |
p2 += fts3GetVarint32(p2, &iCol2); |
179246
|
0 |
0 |
else if( iCol1
|
179248
|
0 |
0 |
if( 0==*p1 ) break; |
179250
|
0 |
0 |
p1 += fts3GetVarint32(p1, &iCol1); |
179253
|
0 |
0 |
if( 0==*p2 ) break; |
179255
|
0 |
0 |
p2 += fts3GetVarint32(p2, &iCol2); |
179263
|
6 |
80 |
if( *pp==p ){ |
179307
|
0 |
0 |
if( pTmp1!=aTmp && pTmp2!=aTmp2 ){ |
|
0 |
0 |
if( pTmp1!=aTmp && pTmp2!=aTmp2 ){ |
179309
|
0 |
0 |
}else if( pTmp1!=aTmp ){ |
179311
|
0 |
0 |
}else if( pTmp2!=aTmp2 ){ |
179350
|
8 |
8 |
if( *pp>=pEnd ){ |
179355
|
0 |
8 |
if( bDescIdx ){ |
179386
|
0 |
8 |
if( bDescIdx==0 || *pbFirst==0 ){ |
|
0 |
0 |
if( bDescIdx==0 || *pbFirst==0 ){ |
179478
|
0 |
4 |
if( !aOut ) return SQLITE_NOMEM; |
179483
|
4 |
8 |
while( p1 || p2 ){ |
|
4 |
4 |
while( p1 || p2 ){ |
179484
|
0 |
8 |
sqlite3_int64 iDiff = DOCID_CMP(i1, i2); |
|
8 |
0 |
sqlite3_int64 iDiff = DOCID_CMP(i1, i2); |
|
0 |
8 |
sqlite3_int64 iDiff = DOCID_CMP(i1, i2); |
179486
|
8 |
0 |
if( p2 && p1 && iDiff==0 ){ |
|
4 |
4 |
if( p2 && p1 && iDiff==0 ){ |
|
0 |
4 |
if( p2 && p1 && iDiff==0 ){ |
179489
|
0 |
0 |
if( rc ) break; |
179492
|
8 |
0 |
}else if( !p2 || (p1 && iDiff<0) ){ |
|
4 |
4 |
}else if( !p2 || (p1 && iDiff<0) ){ |
|
4 |
0 |
}else if( !p2 || (p1 && iDiff<0) ){ |
179505
|
0 |
4 |
if( rc!=SQLITE_OK ){ |
179548
|
0 |
0 |
if( bDescDoclist ){ |
179550
|
0 |
0 |
if( aOut==0 ) return SQLITE_NOMEM; |
179559
|
0 |
0 |
while( p1 && p2 ){ |
|
0 |
0 |
while( p1 && p2 ){ |
179560
|
0 |
0 |
sqlite3_int64 iDiff = DOCID_CMP(i1, i2); |
|
0 |
0 |
sqlite3_int64 iDiff = DOCID_CMP(i1, i2); |
|
0 |
0 |
sqlite3_int64 iDiff = DOCID_CMP(i1, i2); |
179561
|
0 |
0 |
if( iDiff==0 ){ |
179567
|
0 |
0 |
if( 0==fts3PoslistPhraseMerge(&p, nDist, 0, 1, &p1, &p2) ){ |
179574
|
0 |
0 |
}else if( iDiff<0 ){ |
179584
|
0 |
0 |
if( bDescDoclist ){ |
179611
|
0 |
0 |
if( *p!=0x01 ){ |
179612
|
0 |
0 |
if( *p==0x02 ){ |
179620
|
0 |
0 |
while( p
|
179624
|
0 |
0 |
if( *p==0x02 ){ |
179625
|
0 |
0 |
if( bWritten==0 ){ |
179635
|
0 |
0 |
if( bWritten ){ |
179660
|
128 |
8 |
for(i=0; iaaOutput); i++){ |
179661
|
8 |
120 |
if( pTS->aaOutput[i] ){ |
179662
|
8 |
0 |
if( !aOut ){ |
179673
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
179712
|
8 |
4 |
if( pTS->aaOutput[0]==0 ){ |
179731
|
8 |
0 |
if( pTS->aaOutput[0] ){ |
179742
|
8 |
0 |
for(iOut=0; iOutaaOutput); iOut++){ |
179743
|
4 |
4 |
if( pTS->aaOutput[iOut]==0 ){ |
179755
|
0 |
4 |
if( rc!=SQLITE_OK ){ |
179756
|
0 |
0 |
if( aMerge!=aDoclist ) sqlite3_free(aMerge); |
179760
|
0 |
4 |
if( aMerge!=aDoclist ) sqlite3_free(aMerge); |
179766
|
0 |
4 |
if( (iOut+1)==SizeofArray(pTS->aaOutput) ){ |
179783
|
148 |
311 |
if( (pCsr->nSegment%16)==0 ){ |
179787
|
0 |
148 |
if( !apNew ){ |
179825
|
156 |
0 |
if( iLevel<0 && p->aIndex && p->iPrevLangid==iLangid ){ |
|
155 |
1 |
if( iLevel<0 && p->aIndex && p->iPrevLangid==iLangid ){ |
|
155 |
0 |
if( iLevel<0 && p->aIndex && p->iPrevLangid==iLangid ){ |
179827
|
105 |
50 |
rc = sqlite3Fts3SegReaderPending(p, iIndex, zTerm, nTerm, isPrefix||isScan, &pSeg); |
|
0 |
105 |
rc = sqlite3Fts3SegReaderPending(p, iIndex, zTerm, nTerm, isPrefix||isScan, &pSeg); |
179828
|
155 |
0 |
if( rc==SQLITE_OK && pSeg ){ |
|
35 |
120 |
if( rc==SQLITE_OK && pSeg ){ |
179833
|
114 |
42 |
if( iLevel!=FTS3_SEGCURSOR_PENDING ){ |
179834
|
114 |
0 |
if( rc==SQLITE_OK ){ |
179838
|
538 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){ |
|
424 |
114 |
while( rc==SQLITE_OK && SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){ |
179850
|
57 |
367 |
if( iStartBlock && zTerm && zRoot ){ |
|
57 |
0 |
if( iStartBlock && zTerm && zRoot ){ |
|
57 |
0 |
if( iStartBlock && zTerm && zRoot ){ |
179851
|
0 |
57 |
sqlite3_int64 *pi = (isPrefix ? &iLeavesEndBlock : 0); |
179853
|
0 |
57 |
if( rc!=SQLITE_OK ) goto finished; |
179854
|
57 |
0 |
if( isPrefix==0 && isScan==0 ) iLeavesEndBlock = iStartBlock; |
|
57 |
0 |
if( isPrefix==0 && isScan==0 ) iLeavesEndBlock = iStartBlock; |
179857
|
392 |
32 |
rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1, |
|
389 |
3 |
rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1, |
179862
|
0 |
424 |
if( rc!=SQLITE_OK ) goto finished; |
179869
|
114 |
42 |
if( rc==SQLITE_DONE ) rc = rc2; |
179946
|
113 |
0 |
if( pSegcsr ){ |
179951
|
8 |
105 |
if( isPrefix ){ |
179952
|
8 |
0 |
for(i=1; bFound==0 && inIndex; i++){ |
|
0 |
8 |
for(i=1; bFound==0 && inIndex; i++){ |
179953
|
0 |
0 |
if( p->aIndex[i].nPrefix==nTerm ){ |
179962
|
8 |
0 |
for(i=1; bFound==0 && inIndex; i++){ |
|
0 |
8 |
for(i=1; bFound==0 && inIndex; i++){ |
179963
|
0 |
0 |
if( p->aIndex[i].nPrefix==nTerm+1 ){ |
179968
|
0 |
0 |
if( rc==SQLITE_OK ){ |
179977
|
113 |
0 |
if( bFound==0 ){ |
180017
|
8 |
0 |
| (pTok->isPrefix ? FTS3_SEGMENT_PREFIX : 0) |
180018
|
0 |
8 |
| (pTok->bFirst ? FTS3_SEGMENT_FIRST : 0) |
180019
|
8 |
0 |
| (iColumnnColumn ? FTS3_SEGMENT_COLUMN_FILTER : 0); |
180025
|
20 |
0 |
while( SQLITE_OK==rc |
180026
|
12 |
8 |
&& SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, pSegcsr)) |
180031
|
8 |
0 |
if( rc==SQLITE_OK ){ |
180034
|
8 |
0 |
if( rc==SQLITE_OK ){ |
180039
|
0 |
0 |
for(i=0; i
|
180060
|
0 |
0 |
if( aList ){ |
180063
|
0 |
0 |
while( p
|
180065
|
0 |
0 |
while( (*p++)&0x80 ); /* Skip docid varint */ |
180087
|
183 |
0 |
if( pCsr->eSearch==FTS3_DOCID_SEARCH || pCsr->eSearch==FTS3_FULLSCAN_SEARCH ){ |
|
11 |
172 |
if( pCsr->eSearch==FTS3_DOCID_SEARCH || pCsr->eSearch==FTS3_FULLSCAN_SEARCH ){ |
180090
|
1 |
10 |
if( SQLITE_ROW!=sqlite3_step(pCsr->pStmt) ){ |
180111
|
0 |
126 |
if( pVal ){ |
180113
|
0 |
0 |
if( eType==SQLITE_INTEGER ){ |
180158
|
0 |
63 |
if( p->bLock ){ |
180168
|
62 |
1 |
if( eSearch!=FTS3_FULLSCAN_SEARCH ) pCons = apVal[iIdx++]; |
180169
|
0 |
63 |
if( idxNum & FTS3_HAVE_LANGID ) pLangid = apVal[iIdx++]; |
180170
|
0 |
63 |
if( idxNum & FTS3_HAVE_DOCID_GE ) pDocidGe = apVal[iIdx++]; |
180171
|
0 |
63 |
if( idxNum & FTS3_HAVE_DOCID_LE ) pDocidLe = apVal[iIdx++]; |
180181
|
0 |
63 |
if( idxStr ){ |
180188
|
63 |
0 |
if( eSearch!=FTS3_DOCID_SEARCH && eSearch!=FTS3_FULLSCAN_SEARCH ){ |
|
62 |
1 |
if( eSearch!=FTS3_DOCID_SEARCH && eSearch!=FTS3_FULLSCAN_SEARCH ){ |
180192
|
0 |
62 |
if( zQuery==0 && sqlite3_value_type(pCons)!=SQLITE_NULL ){ |
|
0 |
0 |
if( zQuery==0 && sqlite3_value_type(pCons)!=SQLITE_NULL ){ |
180197
|
0 |
62 |
if( pLangid ) pCsr->iLangid = sqlite3_value_int(pLangid); |
180204
|
0 |
62 |
if( rc!=SQLITE_OK ){ |
180210
|
0 |
62 |
if( rc!=SQLITE_OK ) return rc; |
180220
|
1 |
62 |
if( eSearch==FTS3_FULLSCAN_SEARCH ){ |
180221
|
1 |
0 |
if( pDocidGe || pDocidLe ){ |
|
0 |
1 |
if( pDocidGe || pDocidLe ){ |
180222
|
0 |
0 |
zSql = sqlite3_mprintf( |
180228
|
0 |
1 |
zSql = sqlite3_mprintf("SELECT %s ORDER BY rowid %s", |
180232
|
1 |
0 |
if( zSql ){ |
180242
|
0 |
62 |
}else if( eSearch==FTS3_DOCID_SEARCH ){ |
180244
|
0 |
0 |
if( rc==SQLITE_OK ){ |
180248
|
0 |
63 |
if( rc!=SQLITE_OK ) return rc; |
180259
|
63 |
120 |
if( pCsr->isEof ){ |
180313
|
0 |
0 |
if( pCsr->pExpr ){ |
180316
|
0 |
0 |
}else if( p->zLanguageid==0 ){ |
180328
|
75 |
0 |
if( rc==SQLITE_OK && sqlite3_data_count(pCsr->pStmt)-1>iCol ){ |
|
75 |
0 |
if( rc==SQLITE_OK && sqlite3_data_count(pCsr->pStmt)-1>iCol ){ |
180384
|
41 |
0 |
if( rc==SQLITE_OK |
180385
|
5 |
36 |
&& p->nLeafAdd>(nMinMerge/16) |
180386
|
2 |
3 |
&& p->nAutoincrmerge && p->nAutoincrmerge!=0xff |
|
0 |
2 |
&& p->nAutoincrmerge && p->nAutoincrmerge!=0xff |
180395
|
0 |
0 |
if( A>(int)nMinMerge ) rc = sqlite3Fts3Incrmerge(p, A, p->nAutoincrmerge); |
180410
|
0 |
33 |
if( p->bHasStat==2 ){ |
180412
|
0 |
0 |
if( zTbl ){ |
180484
|
0 |
0 |
while( p>pStart && (c=*p--)==0 ); |
|
0 |
0 |
while( p>pStart && (c=*p--)==0 ); |
180489
|
0 |
0 |
while( p>pStart && (*p & 0x80) | c ){ |
|
0 |
0 |
while( p>pStart && (*p & 0x80) | c ){ |
180507
|
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]; } |
180508
|
0 |
0 |
while( *p++&0x80 ); |
180530
|
16 |
0 |
if( (*ppCsr)!=0 ){ |
180561
|
0 |
12 |
if( nVal>6 ){ |
180566
|
0 |
12 |
if( fts3FunctionArg(pContext, "snippet", apVal[0], &pCsr) ) return; |
180579
|
12 |
0 |
if( !zEllipsis || !zEnd || !zStart ){ |
|
12 |
0 |
if( !zEllipsis || !zEnd || !zStart ){ |
|
0 |
12 |
if( !zEllipsis || !zEnd || !zStart ){ |
180581
|
0 |
12 |
}else if( nToken==0 ){ |
180583
|
12 |
0 |
}else if( SQLITE_OK==fts3CursorSeek(pContext, pCsr) ){ |
180601
|
0 |
4 |
if( fts3FunctionArg(pContext, "offsets", apVal[0], &pCsr) ) return; |
180603
|
4 |
0 |
if( SQLITE_OK==fts3CursorSeek(pContext, pCsr) ){ |
180629
|
0 |
0 |
if( fts3FunctionArg(pContext, "optimize", apVal[0], &pCursor) ) return; |
180658
|
0 |
0 |
if( SQLITE_OK==fts3FunctionArg(pContext, "matchinfo", apVal[0], &pCsr) ){ |
180660
|
0 |
0 |
if( nVal>1 ){ |
180693
|
20 |
0 |
for(i=0; i
|
180694
|
16 |
4 |
if( strcmp(zName, aOverload[i].zName)==0 ){ |
180726
|
0 |
0 |
if( rc==SQLITE_OK ){ |
180730
|
0 |
0 |
if( p->zContentTbl==0 ){ |
180737
|
0 |
0 |
if( p->bHasDocsize ){ |
180743
|
0 |
0 |
if( p->bHasStat ){ |
180771
|
0 |
0 |
if( ((Fts3Table *)pVtab)->bIgnoreSavepoint==0 ){ |
180815
|
208 |
0 |
for(i=0; i
|
180816
|
68 |
140 |
if( sqlite3_stricmp(zName, azName[i])==0 ) return 1; |
180856
|
309 |
618 |
if( pHash->nRef<=0 ){ |
180911
|
0 |
311 |
if( rc!=SQLITE_OK ) return rc; |
180918
|
0 |
311 |
if( !pHash ){ |
180926
|
311 |
0 |
if( rc==SQLITE_OK ){ |
180927
|
311 |
0 |
if( sqlite3Fts3HashInsert(&pHash->hash, "simple", 7, (void *)pSimple) |
180928
|
311 |
0 |
|| sqlite3Fts3HashInsert(&pHash->hash, "porter", 7, (void *)pPorter) |
180931
|
0 |
311 |
|| sqlite3Fts3HashInsert(&pHash->hash, "unicode61", 10, (void *)pUnicode) |
180951
|
311 |
0 |
if( SQLITE_OK==rc |
180952
|
311 |
0 |
&& SQLITE_OK==(rc=sqlite3Fts3InitHashTable(db,&pHash->hash,"fts3_tokenizer")) |
180953
|
311 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1)) |
180954
|
311 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", 1)) |
180955
|
311 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 1)) |
180956
|
311 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 2)) |
180957
|
311 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "optimize", 1)) |
180963
|
311 |
0 |
if( rc==SQLITE_OK ){ |
180969
|
311 |
0 |
if( rc==SQLITE_OK ){ |
180979
|
0 |
0 |
if( pHash ){ |
181008
|
106 |
0 |
if( pExpr && SQLITE_OK==*pRc ){ |
|
106 |
0 |
if( pExpr && SQLITE_OK==*pRc ){ |
181009
|
84 |
22 |
if( pExpr->eType==FTSQUERY_PHRASE ){ |
181013
|
113 |
84 |
for(i=0; i
|
181018
|
0 |
113 |
if( rc!=SQLITE_OK ){ |
181053
|
0 |
8 |
if( pList==0 ){ |
181059
|
8 |
0 |
else if( p->iDoclistToken<0 ){ |
181064
|
0 |
0 |
else if( p->doclist.aAll==0 ){ |
181075
|
0 |
0 |
if( p->iDoclistToken
|
181097
|
8 |
0 |
if( iToken>p->iDoclistToken ) p->iDoclistToken = iToken; |
181115
|
16 |
0 |
for(iToken=0; rc==SQLITE_OK && iTokennToken; iToken++){ |
|
8 |
8 |
for(iToken=0; rc==SQLITE_OK && iTokennToken; iToken++){ |
181119
|
8 |
0 |
if( pToken->pSegcsr ){ |
181123
|
8 |
0 |
if( rc==SQLITE_OK ){ |
181149
|
0 |
0 |
char *aFree = (pPhrase->doclist.bFreeList ? pPhrase->doclist.pList : 0); |
181151
|
0 |
0 |
for(iToken=0; iTokennToken; iToken++){ |
181155
|
0 |
0 |
if( pDeferred ){ |
181159
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
181161
|
0 |
0 |
if( pList==0 ){ |
181168
|
0 |
0 |
}else if( aPoslist==0 ){ |
181182
|
0 |
0 |
if( nPoslist==0 ){ |
181194
|
0 |
0 |
if( iPrev>=0 ){ |
181196
|
0 |
0 |
if( nMaxUndeferred<0 ){ |
181207
|
0 |
0 |
if( nMaxUndeferred>iPrev ){ |
181218
|
0 |
0 |
if( !aOut ){ |
181225
|
0 |
0 |
if( fts3PoslistPhraseMerge(&aOut, nDistance, 0, 1, &p1, &p2) ){ |
181237
|
0 |
0 |
if( pPhrase->doclist.pList!=aFree ) sqlite3_free(aFree); |
181272
|
84 |
0 |
&& pCsr->bDesc==pTab->bDescIdx |
181273
|
84 |
0 |
&& p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 |
|
84 |
0 |
&& p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 |
|
84 |
0 |
&& p->nToken<=MAX_INCR_PHRASE_TOKENS && p->nToken>0 |
181278
|
189 |
8 |
for(i=0; bIncrOk==1 && inToken; i++){ |
|
113 |
76 |
for(i=0; bIncrOk==1 && inToken; i++){ |
181280
|
113 |
0 |
if( pToken->bFirst || (pToken->pSegcsr!=0 && !pToken->pSegcsr->bLookup) ){ |
|
113 |
0 |
if( pToken->bFirst || (pToken->pSegcsr!=0 && !pToken->pSegcsr->bLookup) ){ |
|
8 |
105 |
if( pToken->bFirst || (pToken->pSegcsr!=0 && !pToken->pSegcsr->bLookup) ){ |
181283
|
113 |
0 |
if( pToken->pSegcsr ) bHaveIncr = 1; |
181286
|
76 |
8 |
if( bIncrOk && bHaveIncr ){ |
|
76 |
0 |
if( bIncrOk && bHaveIncr ){ |
181288
|
58 |
18 |
int iCol = (p->iColumn >= pTab->nColumn ? -1 : p->iColumn); |
181289
|
181 |
0 |
for(i=0; rc==SQLITE_OK && inToken; i++){ |
|
105 |
76 |
for(i=0; rc==SQLITE_OK && inToken; i++){ |
181292
|
105 |
0 |
if( pSegcsr ){ |
181333
|
0 |
0 |
if( p==0 ){ |
181340
|
0 |
0 |
while( pDocid
|
181346
|
0 |
0 |
while( pDocid
|
|
0 |
0 |
while( pDocid
|
181347
|
0 |
0 |
iMul = (bDescIdx ? -1 : 1); |
181354
|
0 |
0 |
int iMul = (bDescIdx ? -1 : 1); |
181359
|
0 |
0 |
if( p==aDoclist ){ |
181388
|
0 |
0 |
if( p==0 ){ |
181393
|
0 |
0 |
while( p<&aDoclist[nDoclist] && *p==0 ) p++; |
|
0 |
0 |
while( p<&aDoclist[nDoclist] && *p==0 ) p++; |
181394
|
0 |
0 |
if( p>=&aDoclist[nDoclist] ){ |
181399
|
0 |
0 |
*piDocid += ((bDescIdx ? -1 : 1) * iVar); |
181418
|
12 |
8 |
if( pDL->pNextDocid ){ |
181425
|
20 |
0 |
if( pIter==0 || pIter>=(pEnd = pDL->aAll + pDL->nAll) ){ |
|
8 |
12 |
if( pIter==0 || pIter>=(pEnd = pDL->aAll + pDL->nAll) ){ |
181431
|
0 |
12 |
if( pTab->bDescIdx==0 || pDL->pNextDocid==0 ){ |
|
0 |
0 |
if( pTab->bDescIdx==0 || pDL->pNextDocid==0 ){ |
181446
|
4 |
8 |
while( pIter
|
|
0 |
4 |
while( pIter
|
181483
|
0 |
212 |
if( pPhrase->iDoclistToken==iToken ){ |
181494
|
212 |
0 |
if( pToken->pSegcsr ){ |
181499
|
18 |
194 |
if( p->pList==0 ) *pbEof = 1; |
181540
|
122 |
90 |
if( p->nToken==1 ){ |
181544
|
48 |
74 |
if( pDL->pList==0 ) bEof = 1; |
181553
|
96 |
18 |
while( bEof==0 ){ |
181559
|
278 |
0 |
for(i=0; rc==SQLITE_OK && inToken && bEof==0; i++){ |
|
200 |
78 |
for(i=0; rc==SQLITE_OK && inToken && bEof==0; i++){ |
|
182 |
18 |
for(i=0; rc==SQLITE_OK && inToken && bEof==0; i++){ |
181561
|
182 |
0 |
if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ |
|
86 |
96 |
if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ |
|
0 |
86 |
if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ |
|
86 |
0 |
if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ |
|
73 |
13 |
if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ |
|
13 |
73 |
if( a[i].bIgnore==0 && (bMaxSet==0 || DOCID_CMP(iMax, a[i].iDocid)<0) ){ |
181570
|
208 |
96 |
for(i=0; inToken; i++){ |
181571
|
238 |
0 |
while( rc==SQLITE_OK && bEof==0 |
|
194 |
44 |
while( rc==SQLITE_OK && bEof==0 |
181572
|
194 |
0 |
&& a[i].bIgnore==0 && DOCID_CMP(a[i].iDocid, iMax)<0 |
|
0 |
194 |
&& a[i].bIgnore==0 && DOCID_CMP(a[i].iDocid, iMax)<0 |
|
194 |
0 |
&& a[i].bIgnore==0 && DOCID_CMP(a[i].iDocid, iMax)<0 |
|
164 |
30 |
&& a[i].bIgnore==0 && DOCID_CMP(a[i].iDocid, iMax)<0 |
|
30 |
164 |
&& a[i].bIgnore==0 && DOCID_CMP(a[i].iDocid, iMax)<0 |
181575
|
0 |
30 |
if( DOCID_CMP(a[i].iDocid, iMax)>0 ){ |
|
26 |
4 |
if( DOCID_CMP(a[i].iDocid, iMax)>0 ){ |
|
17 |
9 |
if( DOCID_CMP(a[i].iDocid, iMax)>0 ){ |
|
4 |
26 |
if( DOCID_CMP(a[i].iDocid, iMax)>0 ){ |
181583
|
78 |
18 |
if( bEof==0 ){ |
181587
|
0 |
78 |
if( !aDoclist ) return SQLITE_NOMEM; |
181591
|
86 |
72 |
for(i=0; i<(p->nToken-1); i++){ |
181592
|
86 |
0 |
if( a[i].bIgnore==0 ){ |
181598
|
6 |
80 |
if( res==0 ) break; |
181602
|
72 |
6 |
if( i==(p->nToken-1) ){ |
181636
|
212 |
20 |
if( p->bIncr ){ |
181638
|
0 |
20 |
}else if( pCsr->bDesc!=pTab->bDescIdx && pDL->nAll ){ |
|
0 |
0 |
}else if( pCsr->bDesc!=pTab->bDescIdx && pDL->nAll ){ |
181671
|
106 |
0 |
if( pExpr && SQLITE_OK==*pRc ){ |
|
106 |
0 |
if( pExpr && SQLITE_OK==*pRc ){ |
181672
|
84 |
22 |
if( pExpr->eType==FTSQUERY_PHRASE ){ |
181674
|
84 |
0 |
if( nToken ){ |
181676
|
84 |
0 |
for(i=0; i
|
181677
|
84 |
0 |
if( pExpr->pPhrase->aToken[i].pDeferred==0 ) break; |
181685
|
0 |
22 |
pExpr->bDeferred = (pExpr->pLeft->bDeferred && pExpr->pRight->bDeferred); |
|
0 |
0 |
pExpr->bDeferred = (pExpr->pLeft->bDeferred && pExpr->pRight->bDeferred); |
181727
|
45 |
0 |
if( *pRc==SQLITE_OK ){ |
181728
|
31 |
14 |
if( pExpr->eType==FTSQUERY_PHRASE ){ |
181731
|
81 |
0 |
for(i=0; *pRc==SQLITE_OK && inToken; i++){ |
|
50 |
31 |
for(i=0; *pRc==SQLITE_OK && inToken; i++){ |
181740
|
12 |
2 |
}else if( pExpr->eType!=FTSQUERY_NOT ){ |
181746
|
2 |
10 |
if( pExpr->eType==FTSQUERY_OR ){ |
181752
|
2 |
10 |
if( pExpr->eType==FTSQUERY_OR ){ |
181775
|
0 |
0 |
if( pCsr->nRowAvg==0 ){ |
181795
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
181798
|
0 |
0 |
if( a ){ |
181801
|
0 |
0 |
while( a
|
181805
|
0 |
0 |
if( nDoc==0 || nByte==0 ){ |
|
0 |
0 |
if( nDoc==0 || nByte==0 ){ |
181855
|
9 |
16 |
if( pTab->zContentTbl ){ |
181862
|
38 |
16 |
for(ii=0; ii
|
181863
|
26 |
12 |
if( aTC[ii].pRoot==pRoot ){ |
181868
|
0 |
16 |
if( nOvfl==0 || nToken<2 ) return SQLITE_OK; |
|
0 |
0 |
if( nOvfl==0 || nToken<2 ) return SQLITE_OK; |
181897
|
0 |
0 |
for(ii=0; ii
|
|
0 |
0 |
for(ii=0; ii
|
181902
|
0 |
0 |
for(iTC=0; iTC
|
181903
|
0 |
0 |
if( aTC[iTC].pToken && aTC[iTC].pRoot==pRoot |
|
0 |
0 |
if( aTC[iTC].pToken && aTC[iTC].pRoot==pRoot |
181904
|
0 |
0 |
&& (!pTC || aTC[iTC].nOvflnOvfl) |
|
0 |
0 |
&& (!pTC || aTC[iTC].nOvflnOvfl) |
181911
|
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 ){ |
181924
|
0 |
0 |
if( ii<12 ) nLoad4 = nLoad4*4; |
181926
|
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) ){ |
181935
|
0 |
0 |
if( rc==SQLITE_OK ){ |
181940
|
0 |
0 |
if( rc==SQLITE_OK ){ |
181945
|
0 |
0 |
if( ii==0 || nCount
|
|
0 |
0 |
if( ii==0 || nCount
|
181978
|
62 |
0 |
if( rc==SQLITE_OK && nToken>1 && pTab->bFts4 ){ |
|
33 |
29 |
if( rc==SQLITE_OK && nToken>1 && pTab->bFts4 ){ |
|
21 |
12 |
if( rc==SQLITE_OK && nToken>1 && pTab->bFts4 ){ |
181985
|
0 |
21 |
if( !aTC ){ |
181997
|
21 |
0 |
if( rc==SQLITE_OK ){ |
181999
|
25 |
0 |
for(ii=0; rc==SQLITE_OK && ii
|
|
4 |
21 |
for(ii=0; rc==SQLITE_OK && ii
|
182017
|
72 |
244 |
if( pPhrase->doclist.bFreeList ){ |
182067
|
0 |
0 |
if( res ){ |
182070
|
0 |
0 |
if( nNew>=0 && nNew<=pPhrase->doclist.nList ){ |
|
0 |
0 |
if( nNew>=0 && nNew<=pPhrase->doclist.nList ){ |
182128
|
301 |
0 |
if( *pRc==SQLITE_OK ){ |
182140
|
0 |
45 |
if( pLeft->bDeferred ){ |
182146
|
0 |
45 |
}else if( pRight->bDeferred ){ |
182156
|
37 |
11 |
while( !pLeft->bEof && !pRight->bEof && *pRc==SQLITE_OK ){ |
|
34 |
3 |
while( !pLeft->bEof && !pRight->bEof && *pRc==SQLITE_OK ){ |
|
34 |
0 |
while( !pLeft->bEof && !pRight->bEof && *pRc==SQLITE_OK ){ |
182157
|
0 |
34 |
sqlite3_int64 iDiff = DOCID_CMP(pLeft->iDocid, pRight->iDocid); |
|
34 |
0 |
sqlite3_int64 iDiff = DOCID_CMP(pLeft->iDocid, pRight->iDocid); |
|
31 |
3 |
sqlite3_int64 iDiff = DOCID_CMP(pLeft->iDocid, pRight->iDocid); |
182158
|
31 |
3 |
if( iDiff==0 ) break; |
182159
|
3 |
0 |
if( iDiff<0 ){ |
182166
|
34 |
11 |
pExpr->bEof = (pLeft->bEof || pRight->bEof); |
|
3 |
31 |
pExpr->bEof = (pLeft->bEof || pRight->bEof); |
182167
|
0 |
45 |
if( pExpr->eType==FTSQUERY_NEAR && pExpr->bEof ){ |
|
0 |
0 |
if( pExpr->eType==FTSQUERY_NEAR && pExpr->bEof ){ |
182169
|
0 |
0 |
if( pRight->pPhrase->doclist.aAll ){ |
182171
|
0 |
0 |
while( *pRc==SQLITE_OK && pRight->bEof==0 ){ |
|
0 |
0 |
while( *pRc==SQLITE_OK && pRight->bEof==0 ){ |
182176
|
0 |
0 |
if( pLeft->pPhrase && pLeft->pPhrase->doclist.aAll ){ |
|
0 |
0 |
if( pLeft->pPhrase && pLeft->pPhrase->doclist.aAll ){ |
182178
|
0 |
0 |
while( *pRc==SQLITE_OK && pLeft->bEof==0 ){ |
|
0 |
0 |
while( *pRc==SQLITE_OK && pLeft->bEof==0 ){ |
182192
|
0 |
12 |
sqlite3_int64 iCmp = DOCID_CMP(pLeft->iDocid, pRight->iDocid); |
|
12 |
0 |
sqlite3_int64 iCmp = DOCID_CMP(pLeft->iDocid, pRight->iDocid); |
|
4 |
8 |
sqlite3_int64 iCmp = DOCID_CMP(pLeft->iDocid, pRight->iDocid); |
182197
|
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) ){ |
182199
|
4 |
4 |
}else if( pLeft->bEof || iCmp>0 ){ |
|
0 |
4 |
}else if( pLeft->bEof || iCmp>0 ){ |
182206
|
8 |
4 |
pExpr->bEof = (pLeft->bEof && pRight->bEof); |
|
4 |
4 |
pExpr->bEof = (pLeft->bEof && pRight->bEof); |
182207
|
0 |
12 |
iCmp = DOCID_CMP(pLeft->iDocid, pRight->iDocid); |
|
12 |
0 |
iCmp = DOCID_CMP(pLeft->iDocid, pRight->iDocid); |
|
0 |
12 |
iCmp = DOCID_CMP(pLeft->iDocid, pRight->iDocid); |
182208
|
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) ){ |
182221
|
4 |
8 |
if( pRight->bStart==0 ){ |
182227
|
8 |
4 |
if( pLeft->bEof==0 ){ |
182228
|
8 |
0 |
while( !*pRc |
182229
|
8 |
0 |
&& !pRight->bEof |
182230
|
0 |
8 |
&& DOCID_CMP(pLeft->iDocid, pRight->iDocid)>0 |
|
8 |
0 |
&& DOCID_CMP(pLeft->iDocid, pRight->iDocid)>0 |
|
4 |
4 |
&& DOCID_CMP(pLeft->iDocid, pRight->iDocid)>0 |
|
0 |
8 |
&& DOCID_CMP(pLeft->iDocid, pRight->iDocid)>0 |
182289
|
31 |
0 |
if( *pRc==SQLITE_OK |
182290
|
0 |
31 |
&& pExpr->eType==FTSQUERY_NEAR |
182291
|
0 |
0 |
&& (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) |
|
0 |
0 |
&& (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) |
182298
|
0 |
0 |
for(p=pExpr; p->pLeft; p=p->pLeft){ |
182304
|
0 |
0 |
if( !aTmp ){ |
182311
|
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){ |
182319
|
0 |
0 |
for(p=pExpr->pLeft; p && res; p=p->pLeft){ |
|
0 |
0 |
for(p=pExpr->pLeft; p && res; p=p->pLeft){ |
182325
|
0 |
0 |
p->eType==FTSQUERY_NEAR ? p->pRight->pPhrase : p->pPhrase |
182354
|
208 |
0 |
if( *pRc==SQLITE_OK ){ |
182360
|
31 |
0 |
&& fts3EvalTestExpr(pCsr, pExpr->pRight, pRc) |
182361
|
31 |
0 |
&& fts3EvalNearTest(pExpr, pRc) |
|
31 |
0 |
&& fts3EvalNearTest(pExpr, pRc) |
182379
|
0 |
31 |
if( bHit==0 |
182380
|
0 |
0 |
&& pExpr->eType==FTSQUERY_NEAR |
182381
|
0 |
0 |
&& (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) |
|
0 |
0 |
&& (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR) |
182384
|
0 |
0 |
for(p=pExpr; p->pPhrase==0; p=p->pLeft){ |
182385
|
0 |
0 |
if( p->pRight->iDocid==pCsr->iPrevId ){ |
182389
|
0 |
0 |
if( p->iDocid==pCsr->iPrevId ){ |
182399
|
4 |
4 |
bHit = bHit1 || bHit2; |
|
4 |
0 |
bHit = bHit1 || bHit2; |
182406
|
8 |
0 |
&& !fts3EvalTestExpr(pCsr, pExpr->pRight, pRc) |
|
4 |
4 |
&& !fts3EvalTestExpr(pCsr, pExpr->pRight, pRc) |
182412
|
0 |
161 |
if( pCsr->pDeferred && (pExpr->bDeferred || ( |
|
0 |
0 |
if( pCsr->pDeferred && (pExpr->bDeferred || ( |
|
0 |
0 |
if( pCsr->pDeferred && (pExpr->bDeferred || ( |
182413
|
0 |
0 |
pExpr->iDocid==pCsr->iPrevId && pExpr->pPhrase->doclist.pList |
182416
|
0 |
0 |
if( pExpr->bDeferred ){ |
182426
|
149 |
8 |
pExpr->bEof==0 && pExpr->iDocid==pCsr->iPrevId |
182427
|
157 |
4 |
&& pExpr->pPhrase->doclist.nList>0 |
|
149 |
0 |
&& pExpr->pPhrase->doclist.nList>0 |
182464
|
114 |
0 |
if( rc==SQLITE_OK ){ |
182472
|
0 |
114 |
if( pCsr->pDeferred ){ |
182474
|
0 |
0 |
if( rc==SQLITE_OK ){ |
182484
|
114 |
0 |
return (rc==SQLITE_OK && bMiss); |
|
4 |
110 |
return (rc==SQLITE_OK && bMiss); |
182495
|
0 |
172 |
if( pExpr==0 ){ |
182499
|
136 |
40 |
if( pCsr->isRequireSeek==0 ){ |
182508
|
114 |
62 |
}while( pCsr->isEof==0 && sqlite3Fts3EvalTestDeferred(pCsr, &rc) ); |
|
4 |
110 |
}while( pCsr->isEof==0 && sqlite3Fts3EvalTestDeferred(pCsr, &rc) ); |
182513
|
172 |
0 |
if( rc==SQLITE_OK && ( |
|
172 |
0 |
if( rc==SQLITE_OK && ( |
182514
|
172 |
0 |
(pCsr->bDesc==0 && pCsr->iPrevId>pCsr->iMaxDocid) |
182515
|
0 |
172 |
|| (pCsr->bDesc!=0 && pCsr->iPrevIdiMinDocid) |
|
0 |
0 |
|| (pCsr->bDesc!=0 && pCsr->iPrevIdiMinDocid) |
182537
|
0 |
0 |
if( pExpr && *pRc==SQLITE_OK ){ |
|
0 |
0 |
if( pExpr && *pRc==SQLITE_OK ){ |
182540
|
0 |
0 |
if( pPhrase ){ |
182542
|
0 |
0 |
if( pPhrase->bIncr ){ |
182544
|
0 |
0 |
for(i=0; inToken; i++){ |
182547
|
0 |
0 |
if( pToken->pSegcsr ){ |
182576
|
0 |
0 |
if( pExpr ){ |
182578
|
0 |
0 |
if( pPhrase && pPhrase->doclist.pList ){ |
|
0 |
0 |
if( pPhrase && pPhrase->doclist.pList ){ |
182585
|
0 |
0 |
while( 0xFE & (*p | c) ){ |
182586
|
0 |
0 |
if( (c&0x80)==0 ) iCnt++; |
182595
|
0 |
0 |
if( *p==0x00 ) break; |
182597
|
0 |
0 |
p += fts3GetVarint32(p, &iCol); |
182598
|
0 |
0 |
}while( iCol
|
182624
|
0 |
0 |
if( pExpr->aMI==0 ){ |
182635
|
0 |
0 |
while( pRoot->pParent && pRoot->pParent->eType==FTSQUERY_NEAR ){ |
|
0 |
0 |
while( pRoot->pParent && pRoot->pParent->eType==FTSQUERY_NEAR ){ |
182643
|
0 |
0 |
for(p=pRoot; p; p=p->pLeft){ |
182644
|
0 |
0 |
Fts3Expr *pE = (p->eType==FTSQUERY_PHRASE?p:p->pRight); |
182647
|
0 |
0 |
if( !pE->aMI ) return SQLITE_NOMEM; |
182653
|
0 |
0 |
while( pCsr->isEof==0 && rc==SQLITE_OK ){ |
|
0 |
0 |
while( pCsr->isEof==0 && rc==SQLITE_OK ){ |
182657
|
0 |
0 |
if( pCsr->isRequireSeek==0 ) sqlite3_reset(pCsr->pStmt); |
182667
|
0 |
0 |
&& pRoot->eType==FTSQUERY_NEAR |
182668
|
0 |
0 |
&& sqlite3Fts3EvalTestDeferred(pCsr, &rc) |
182669
|
0 |
0 |
); |
182671
|
0 |
0 |
if( rc==SQLITE_OK && pCsr->isEof==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pCsr->isEof==0 ){ |
182679
|
0 |
0 |
if( bEof ){ |
182692
|
0 |
0 |
if( pRoot->bEof ) rc = FTS_CORRUPT_VTAB; |
182693
|
0 |
0 |
}while( pRoot->iDocid!=iDocid && rc==SQLITE_OK ); |
|
0 |
0 |
}while( pRoot->iDocid!=iDocid && rc==SQLITE_OK ); |
182738
|
0 |
0 |
if( pExpr->bDeferred && pExpr->pParent->eType!=FTSQUERY_NEAR ){ |
|
0 |
0 |
if( pExpr->bDeferred && pExpr->pParent->eType!=FTSQUERY_NEAR ){ |
182740
|
0 |
0 |
for(iCol=0; iColnColumn; iCol++){ |
182746
|
0 |
0 |
if( rc==SQLITE_OK ){ |
182748
|
0 |
0 |
for(iCol=0; iColnColumn; iCol++){ |
182793
|
16 |
0 |
if( (pPhrase->iColumnnColumn && pPhrase->iColumn!=iCol) ){ |
|
0 |
16 |
if( (pPhrase->iColumnnColumn && pPhrase->iColumn!=iCol) ){ |
182799
|
16 |
0 |
if( iDocid!=pCsr->iPrevId || pExpr->bEof ){ |
|
0 |
16 |
if( iDocid!=pCsr->iPrevId || pExpr->bEof ){ |
182814
|
0 |
0 |
for(p=pExpr->pParent; p; p=p->pParent){ |
182815
|
0 |
0 |
if( p->eType==FTSQUERY_OR ) bOr = 1; |
182816
|
0 |
0 |
if( p->eType==FTSQUERY_NEAR ) pNear = p; |
182817
|
0 |
0 |
if( p->bEof ) bTreeEof = 1; |
182819
|
0 |
0 |
if( bOr==0 ) return SQLITE_OK; |
182824
|
0 |
0 |
if( pPhrase->bIncr ){ |
182827
|
0 |
0 |
while( rc==SQLITE_OK && !pNear->bEof ){ |
|
0 |
0 |
while( rc==SQLITE_OK && !pNear->bEof ){ |
182829
|
0 |
0 |
if( bEofSave==0 && pNear->iDocid==iDocid ) break; |
|
0 |
0 |
if( bEofSave==0 && pNear->iDocid==iDocid ) break; |
182832
|
0 |
0 |
if( rc==SQLITE_OK && pNear->bEof!=bEofSave ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pNear->bEof!=bEofSave ){ |
182836
|
0 |
0 |
if( bTreeEof ){ |
182837
|
0 |
0 |
while( rc==SQLITE_OK && !pNear->bEof ){ |
|
0 |
0 |
while( rc==SQLITE_OK && !pNear->bEof ){ |
182841
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
182844
|
0 |
0 |
for(p=pNear; p; p=p->pLeft){ |
182849
|
0 |
0 |
if( pTest->eType==FTSQUERY_NEAR ) pTest = pTest->pRight; |
182855
|
0 |
0 |
if( pCsr->bDesc==bDescDoclist ){ |
182856
|
0 |
0 |
bEof = !pPh->doclist.nAll || |
|
0 |
0 |
bEof = !pPh->doclist.nAll || |
182858
|
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 ){ |
|
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 ){ |
182865
|
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); |
182866
|
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 ){ |
|
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 ){ |
182876
|
0 |
0 |
if( bEof || iDocid!=pCsr->iPrevId ) bMatch = 0; |
|
0 |
0 |
if( bEof || iDocid!=pCsr->iPrevId ) bMatch = 0; |
182879
|
0 |
0 |
if( bMatch ){ |
182885
|
0 |
16 |
if( pIter==0 ) return SQLITE_OK; |
182887
|
0 |
16 |
if( *pIter==0x01 ){ |
182889
|
0 |
0 |
pIter += fts3GetVarint32(pIter, &iThis); |
182893
|
0 |
16 |
while( iThis
|
182895
|
0 |
0 |
if( *pIter==0x00 ) return SQLITE_OK; |
182897
|
0 |
0 |
pIter += fts3GetVarint32(pIter, &iThis); |
182899
|
0 |
16 |
if( *pIter==0x00 ){ |
182903
|
16 |
0 |
*ppOut = ((iCol==iThis)?pIter:0); |
182915
|
84 |
22 |
if( pPhrase ){ |
182920
|
113 |
84 |
for(i=0; inToken; i++){ |
183037
|
0 |
1 |
if( argc!=4 && argc!=5 ) goto bad_args; |
|
0 |
0 |
if( argc!=4 && argc!=5 ) goto bad_args; |
183041
|
0 |
1 |
if( argc==5 ){ |
183042
|
0 |
0 |
if( nDb==4 && 0==sqlite3_strnicmp("temp", zDb, 4) ){ |
|
0 |
0 |
if( nDb==4 && 0==sqlite3_strnicmp("temp", zDb, 4) ){ |
183055
|
0 |
1 |
if( rc!=SQLITE_OK ) return rc; |
183059
|
0 |
1 |
if( !p ) return SQLITE_NOMEM; |
183091
|
40 |
1 |
for(i=0; iaStmt); i++){ |
183120
|
0 |
1 |
if( pInfo->nOrderBy==1 |
183121
|
0 |
0 |
&& pInfo->aOrderBy[0].iColumn==0 |
183122
|
0 |
0 |
&& pInfo->aOrderBy[0].desc==0 |
183129
|
1 |
1 |
for(i=0; inConstraint; i++){ |
183130
|
1 |
0 |
if( pInfo->aConstraint[i].usable ){ |
183134
|
0 |
1 |
if( iCol==0 ){ |
183135
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_EQ ) iEq = i; |
183136
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_LT ) iLe = i; |
183137
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_LE ) iLe = i; |
183138
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_GT ) iGe = i; |
183139
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_GE ) iGe = i; |
183141
|
0 |
1 |
if( iCol==4 ){ |
183142
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_EQ ) iLangid = i; |
183147
|
0 |
1 |
if( iEq>=0 ){ |
183154
|
0 |
1 |
if( iGe>=0 ){ |
183159
|
0 |
1 |
if( iLe>=0 ){ |
183165
|
0 |
1 |
if( iLangid>=0 ){ |
183182
|
0 |
1 |
if( !pCsr ) return SQLITE_NOMEM; |
183206
|
2 |
7 |
if( nSize>pCsr->nStat ){ |
183211
|
0 |
2 |
if( aNew==0 ) return SQLITE_NOMEM; |
183232
|
9 |
7 |
for(pCsr->iCol++; pCsr->iColnStat; pCsr->iCol++){ |
183233
|
6 |
3 |
if( pCsr->aStat[pCsr->iCol].nDoc>0 ) return SQLITE_OK; |
183237
|
6 |
1 |
if( rc==SQLITE_ROW ){ |
183245
|
0 |
6 |
if( pCsr->zStop ){ |
183248
|
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) ){ |
183254
|
0 |
6 |
if( fts3auxGrowStatArray(pCsr, 2) ) return SQLITE_NOMEM; |
183259
|
24 |
6 |
while( i
|
183281
|
3 |
3 |
if( v>1 ){ |
183288
|
6 |
9 |
if( v==0 ){ /* 0x00. Next integer will be a docid. */ |
183290
|
3 |
6 |
}else if( v==1 ){ /* 0x01. Next integer will be a column number. */ |
183301
|
0 |
3 |
if( iCol<1 ){ |
183305
|
0 |
3 |
if( fts3auxGrowStatArray(pCsr, iCol+2) ) return SQLITE_NOMEM; |
183350
|
0 |
1 |
if( idxNum==FTS4AUX_EQ_CONSTRAINT ){ |
183354
|
0 |
1 |
if( idxNum & FTS4AUX_GE_CONSTRAINT ){ |
183357
|
0 |
1 |
if( idxNum & FTS4AUX_LE_CONSTRAINT ){ |
183361
|
0 |
1 |
if( iNext
|
183374
|
1 |
0 |
if( isScan ) pCsr->filter.flags |= FTS3_SEGMENT_SCAN; |
183376
|
1 |
0 |
if( iEq>=0 || iGe>=0 ){ |
|
0 |
1 |
if( iEq>=0 || iGe>=0 ){ |
183379
|
0 |
0 |
if( zStr ){ |
183381
|
0 |
0 |
if( pCsr->filter.zTerm==0 ) return SQLITE_NOMEM; |
183386
|
0 |
1 |
if( iLe>=0 ){ |
183388
|
0 |
0 |
if( pCsr->zStop==0 ) return SQLITE_NOMEM; |
183392
|
0 |
1 |
if( iLangid>=0 ){ |
183400
|
0 |
0 |
if( iLangVal<0 ) iLangVal = 0; |
183407
|
1 |
0 |
if( rc==SQLITE_OK ){ |
183411
|
1 |
0 |
if( rc==SQLITE_OK ) rc = fts3auxNextMethod(pCursor); |
183440
|
6 |
6 |
if( p->iCol ){ |
183633
|
107 |
49 |
return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; |
|
107 |
0 |
return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; |
|
107 |
0 |
return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; |
|
107 |
0 |
return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; |
|
107 |
0 |
return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; |
|
0 |
107 |
return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; |
183643
|
101 |
0 |
if( pRet ) memset(pRet, 0, nByte); |
183660
|
170 |
0 |
if( rc==SQLITE_OK ){ |
183662
|
0 |
170 |
if( pModule->iVersion>=1 ){ |
183664
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
183707
|
459 |
55 |
for(i=0; i
|
183708
|
459 |
0 |
if( sqlite3_fts3_enable_parentheses && (z[i]=='(' || z[i]==')') ) break; |
|
451 |
8 |
if( sqlite3_fts3_enable_parentheses && (z[i]=='(' || z[i]==')') ) break; |
183709
|
0 |
451 |
if( z[i]=='"' ) break; |
183714
|
63 |
0 |
if( rc==SQLITE_OK ){ |
183720
|
63 |
0 |
if( rc==SQLITE_OK ){ |
183723
|
0 |
63 |
if( !pRet ){ |
183734
|
27 |
36 |
if( iEnd
|
|
8 |
19 |
if( iEnd
|
183745
|
36 |
27 |
}else if( pParse->bFts4 && iStart>0 && z[iStart-1]=='^' ){ |
|
11 |
25 |
}else if( pParse->bFts4 && iStart>0 && z[iStart-1]=='^' ){ |
|
0 |
11 |
}else if( pParse->bFts4 && iStart>0 && z[iStart-1]=='^' ){ |
183755
|
0 |
0 |
}else if( i && rc==SQLITE_DONE ){ |
|
0 |
0 |
}else if( i && rc==SQLITE_DONE ){ |
183773
|
0 |
121 |
if( !pRet ){ |
183828
|
21 |
0 |
if( rc==SQLITE_OK ){ |
183830
|
71 |
21 |
for(ii=0; rc==SQLITE_OK; ii++){ |
183834
|
50 |
21 |
if( rc==SQLITE_OK ){ |
183838
|
0 |
50 |
if( !p ) goto no_mem; |
183841
|
0 |
50 |
if( !zTemp ) goto no_mem; |
183851
|
29 |
21 |
pToken->isPrefix = (iEnd
|
|
0 |
29 |
pToken->isPrefix = (iEnd
|
183852
|
29 |
21 |
pToken->bFirst = (iBegin>0 && zInput[iBegin-1]=='^'); |
|
0 |
29 |
pToken->bFirst = (iBegin>0 && zInput[iBegin-1]=='^'); |
183861
|
21 |
0 |
if( rc==SQLITE_DONE ){ |
183866
|
0 |
21 |
if( !p ) goto no_mem; |
183874
|
21 |
0 |
if( zTemp ){ |
183881
|
50 |
21 |
for(jj=0; jjpPhrase->nToken; jj++){ |
183892
|
0 |
0 |
if( pCursor ){ |
183940
|
141 |
62 |
while( nInput>0 && fts3isspace(*zInput) ){ |
|
34 |
107 |
while( nInput>0 && fts3isspace(*zInput) ){ |
183944
|
62 |
107 |
if( nInput==0 ){ |
183949
|
398 |
92 |
for(ii=0; ii<(int)(sizeof(aKeyword)/sizeof(struct Fts3Keyword)); ii++){ |
183952
|
0 |
398 |
if( (pKey->parenOnly & ~sqlite3_fts3_enable_parentheses)!=0 ){ |
183956
|
384 |
14 |
if( nInput>=pKey->n && 0==memcmp(zInput, pKey->z, pKey->n) ){ |
|
15 |
369 |
if( nInput>=pKey->n && 0==memcmp(zInput, pKey->z, pKey->n) ){ |
183962
|
0 |
15 |
if( pKey->eType==FTSQUERY_NEAR ){ |
183964
|
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' ){ |
183974
|
0 |
15 |
if( fts3isspace(cNext) |
183975
|
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 |
183978
|
0 |
15 |
if( !pRet ){ |
183999
|
21 |
71 |
if( *zInput=='"' ){ |
184000
|
315 |
0 |
for(ii=1; ii
|
|
294 |
21 |
for(ii=1; ii
|
184002
|
0 |
21 |
if( ii==nInput ){ |
184009
|
4 |
67 |
if( *zInput=='(' ){ |
184015
|
0 |
4 |
if( pParse->nNest>SQLITE_MAX_EXPR_DEPTH ) return SQLITE_ERROR; |
184020
|
4 |
63 |
}else if( *zInput==')' ){ |
184041
|
74 |
63 |
for(ii=0; iinCol; ii++){ |
184044
|
33 |
41 |
if( nInput>nStr && zInput[nStr]==':' |
|
0 |
33 |
if( nInput>nStr && zInput[nStr]==':' |
184045
|
0 |
0 |
&& sqlite3_strnicmp(zStr, zInput, nStr)==0 |
184103
|
0 |
22 |
while( pSplit->pParent && opPrecedence(pSplit->pParent)<=opPrecedence(pNew) ){ |
|
0 |
0 |
while( pSplit->pParent && opPrecedence(pSplit->pParent)<=opPrecedence(pNew) ){ |
184107
|
0 |
22 |
if( pSplit->pParent ){ |
184142
|
169 |
66 |
while( rc==SQLITE_OK ){ |
184148
|
103 |
66 |
if( rc==SQLITE_OK ){ |
184149
|
103 |
0 |
if( p ){ |
184173
|
19 |
84 |
isPhrase = (eType==FTSQUERY_PHRASE || p->pLeft); |
|
4 |
15 |
isPhrase = (eType==FTSQUERY_PHRASE || p->pLeft); |
184180
|
15 |
88 |
if( !isPhrase && isRequirePhrase ){ |
|
0 |
15 |
if( !isPhrase && isRequirePhrase ){ |
184186
|
88 |
15 |
if( isPhrase && !isRequirePhrase ){ |
|
7 |
81 |
if( isPhrase && !isRequirePhrase ){ |
184191
|
0 |
7 |
if( !pAnd ){ |
184210
|
37 |
66 |
if( pPrev && ( |
|
0 |
37 |
if( pPrev && ( |
184211
|
0 |
0 |
(eType==FTSQUERY_NEAR && !isPhrase && pPrev->eType!=FTSQUERY_PHRASE) |
|
0 |
0 |
(eType==FTSQUERY_NEAR && !isPhrase && pPrev->eType!=FTSQUERY_PHRASE) |
184212
|
15 |
22 |
|| (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) |
184219
|
88 |
15 |
if( isPhrase ){ |
184220
|
22 |
66 |
if( pRet ){ |
184241
|
66 |
0 |
if( rc==SQLITE_DONE && pRet && isRequirePhrase ){ |
|
66 |
0 |
if( rc==SQLITE_DONE && pRet && isRequirePhrase ){ |
|
0 |
66 |
if( rc==SQLITE_DONE && pRet && isRequirePhrase ){ |
184245
|
66 |
0 |
if( rc==SQLITE_DONE ){ |
184264
|
0 |
66 |
if( rc!=SQLITE_OK ){ |
184279
|
106 |
168 |
if( p ){ |
184280
|
0 |
106 |
if( nMaxDepth<0 ){ |
184284
|
106 |
0 |
if( rc==SQLITE_OK ){ |
184309
|
0 |
106 |
if( nMaxDepth==0 ){ |
184313
|
106 |
0 |
if( rc==SQLITE_OK ){ |
184314
|
92 |
14 |
if( (eType==FTSQUERY_AND || eType==FTSQUERY_OR) ){ |
|
4 |
88 |
if( (eType==FTSQUERY_AND || eType==FTSQUERY_OR) ){ |
184317
|
0 |
18 |
if( 0==apLeaf ){ |
184323
|
18 |
0 |
if( rc==SQLITE_OK ){ |
184328
|
18 |
18 |
for(p=pRoot; p->eType==eType; p=p->pLeft){ |
184340
|
18 |
18 |
if( pParent ){ |
184346
|
0 |
36 |
if( rc!=SQLITE_OK ) break; |
184348
|
54 |
36 |
for(iLvl=0; p && iLvl
|
|
54 |
0 |
for(iLvl=0; p && iLvl
|
184349
|
36 |
18 |
if( apLeaf[iLvl]==0 ){ |
184365
|
0 |
36 |
if( p ){ |
184372
|
18 |
18 |
if( pParent==0 ) break; |
184375
|
0 |
18 |
for(p=pParent->pRight; p->eType==eType; p=p->pLeft); |
184380
|
0 |
18 |
if( pParent->pParent ){ |
184393
|
18 |
0 |
if( rc==SQLITE_OK ){ |
184395
|
212 |
18 |
for(i=0; i
|
184396
|
18 |
194 |
if( apLeaf[i] ){ |
184397
|
18 |
0 |
if( p==0 ){ |
184419
|
0 |
0 |
for(i=0; i
|
184422
|
0 |
0 |
while( (pDel=pFree)!=0 ){ |
184431
|
4 |
84 |
}else if( eType==FTSQUERY_NOT ){ |
184441
|
4 |
0 |
if( rc==SQLITE_OK ){ |
184445
|
0 |
4 |
if( rc!=SQLITE_OK ){ |
184458
|
0 |
106 |
if( rc!=SQLITE_OK ){ |
184498
|
0 |
62 |
if( z==0 ){ |
184502
|
62 |
0 |
if( n<0 ){ |
184509
|
62 |
0 |
if( rc==SQLITE_OK && sParse.nNest ){ |
|
0 |
62 |
if( rc==SQLITE_OK && sParse.nNest ){ |
184557
|
62 |
0 |
if( rc==SQLITE_OK && *ppExpr ){ |
|
62 |
0 |
if( rc==SQLITE_OK && *ppExpr ){ |
184559
|
62 |
0 |
if( rc==SQLITE_OK ){ |
184564
|
0 |
62 |
if( rc!=SQLITE_OK ){ |
184567
|
0 |
0 |
if( rc==SQLITE_TOOBIG ){ |
184573
|
0 |
0 |
}else if( rc==SQLITE_ERROR ){ |
184601
|
22 |
0 |
for(p=pDel; p && (p->pLeft||p->pRight); p=(p->pLeft ? p->pLeft : p->pRight)){ |
|
84 |
127 |
for(p=pDel; p && (p->pLeft||p->pRight); p=(p->pLeft ? p->pLeft : p->pRight)){ |
|
22 |
62 |
for(p=pDel; p && (p->pLeft||p->pRight); p=(p->pLeft ? p->pLeft : p->pRight)){ |
|
0 |
62 |
for(p=pDel; p && (p->pLeft||p->pRight); p=(p->pLeft ? p->pLeft : p->pRight)){ |
184604
|
106 |
189 |
while( p ){ |
184607
|
44 |
62 |
if( pParent && p==pParent->pLeft && pParent->pRight ){ |
|
22 |
22 |
if( pParent && p==pParent->pLeft && pParent->pRight ){ |
|
22 |
0 |
if( pParent && p==pParent->pLeft && pParent->pRight ){ |
184609
|
22 |
0 |
while( p && (p->pLeft || p->pRight) ){ |
|
0 |
22 |
while( p && (p->pLeft || p->pRight) ){ |
|
0 |
22 |
while( p && (p->pLeft || p->pRight) ){ |
184611
|
0 |
0 |
p = (p->pLeft ? p->pLeft : p->pRight); |
184852
|
27943 |
0 |
if( p ){ |
184895
|
13763 |
352 |
while( elem ){ |
184897
|
13763 |
0 |
if( pH->copyKey && elem->pKey ){ |
|
13763 |
0 |
if( pH->copyKey && elem->pKey ){ |
184912
|
0 |
326387 |
if( nKey<=0 ) nKey = (int) strlen(z); |
184913
|
1705137 |
326387 |
while( nKey > 0 ){ |
184920
|
88783 |
292445 |
if( n1!=n2 ) return 1; |
184930
|
0 |
0 |
while( nKey-- > 0 ){ |
184936
|
0 |
0 |
if( n1!=n2 ) return 1; |
184953
|
305300 |
0 |
if( keyClass==FTS3_HASH_STRING ){ |
184968
|
304554 |
0 |
if( keyClass==FTS3_HASH_STRING ){ |
184985
|
11478 |
23781 |
if( pHead ){ |
184988
|
6977 |
4501 |
if( pHead->prev ){ pHead->prev->next = pNew; } |
184993
|
23380 |
401 |
if( pH->first ){ pH->first->prev = pNew; } |
185015
|
0 |
401 |
if( new_ht==0 ) return 1; |
185020
|
21488 |
401 |
for(elem=pH->first, pH->first=0; elem; elem = next_elem){ |
185042
|
304554 |
345 |
if( pH->ht ){ |
185047
|
381228 |
25923 |
while( count-- && elem ){ |
|
381228 |
0 |
while( count-- && elem ){ |
185048
|
278631 |
102597 |
if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){ |
185066
|
0 |
0 |
if( elem->prev ){ |
185071
|
0 |
0 |
if( elem->next ){ |
185075
|
0 |
0 |
if( pEntry->chain==elem ){ |
185079
|
0 |
0 |
if( pEntry->count<=0 ){ |
185082
|
0 |
0 |
if( pH->copyKey && elem->pKey ){ |
|
0 |
0 |
if( pH->copyKey && elem->pKey ){ |
185087
|
0 |
0 |
if( pH->count<=0 ){ |
185102
|
289891 |
0 |
if( pH==0 || pH->ht==0 ) return 0; |
|
138 |
289753 |
if( pH==0 || pH->ht==0 ) return 0; |
185119
|
277255 |
12531 |
return pElem ? pElem->data : 0; |
185156
|
1375 |
13771 |
if( elem ){ |
185158
|
0 |
1375 |
if( data==0 ){ |
185165
|
0 |
13771 |
if( data==0 ) return 0; |
185166
|
345 |
13426 |
if( (pH->htsize==0 && fts3Rehash(pH,8)) |
|
345 |
0 |
if( (pH->htsize==0 && fts3Rehash(pH,8)) |
185167
|
56 |
13715 |
|| (pH->count>=pH->htsize && fts3Rehash(pH, pH->htsize*2)) |
|
0 |
56 |
|| (pH->count>=pH->htsize && fts3Rehash(pH, pH->htsize*2)) |
185174
|
0 |
13771 |
if( new_elem==0 ) return data; |
185175
|
13771 |
0 |
if( pH->copyKey && pKey!=0 ){ |
|
13771 |
0 |
if( pH->copyKey && pKey!=0 ){ |
185177
|
0 |
13771 |
if( new_elem->pKey==0 ){ |
185267
|
0 |
0 |
if( t==NULL ) return SQLITE_NOMEM; |
185297
|
0 |
0 |
if( c==NULL ) return SQLITE_NOMEM; |
185300
|
0 |
0 |
if( zInput==0 ){ |
185302
|
0 |
0 |
}else if( nInput<0 ){ |
185351
|
0 |
0 |
if( x==0 ) return 0; |
185354
|
0 |
0 |
if( j<2 ) return j; |
185355
|
0 |
0 |
return z[1]==0 || isVowel(z + 1); |
|
0 |
0 |
return z[1]==0 || isVowel(z + 1); |
185360
|
0 |
0 |
if( x==0 ) return 0; |
185363
|
0 |
0 |
if( j<2 ) return 1-j; |
185387
|
0 |
0 |
while( isVowel(z) ){ z++; } |
185388
|
0 |
0 |
if( *z==0 ) return 0; |
185389
|
0 |
0 |
while( isConsonant(z) ){ z++; } |
185397
|
0 |
0 |
while( isVowel(z) ){ z++; } |
185398
|
0 |
0 |
if( *z==0 ) return 0; |
185399
|
0 |
0 |
while( isConsonant(z) ){ z++; } |
185400
|
0 |
0 |
if( *z==0 ) return 0; |
185401
|
0 |
0 |
while( isVowel(z) ){ z++; } |
185402
|
0 |
0 |
if( *z==0 ) return 1; |
185403
|
0 |
0 |
while( isConsonant(z) ){ z++; } |
185411
|
0 |
0 |
while( isVowel(z) ){ z++; } |
185412
|
0 |
0 |
if( *z==0 ) return 0; |
185413
|
0 |
0 |
while( isConsonant(z) ){ z++; } |
185414
|
0 |
0 |
if( *z==0 ) return 0; |
185415
|
0 |
0 |
while( isVowel(z) ){ z++; } |
185416
|
0 |
0 |
if( *z==0 ) return 0; |
185417
|
0 |
0 |
while( isConsonant(z) ){ z++; } |
185425
|
0 |
0 |
while( isConsonant(z) ){ z++; } |
185436
|
0 |
0 |
return isConsonant(z) && z[0]==z[1]; |
|
0 |
0 |
return isConsonant(z) && z[0]==z[1]; |
185449
|
0 |
0 |
isConsonant(z) && |
185450
|
0 |
0 |
z[0]!='w' && z[0]!='x' && z[0]!='y' && |
185451
|
0 |
0 |
isVowel(z+1) && |
|
0 |
0 |
isVowel(z+1) && |
185474
|
0 |
0 |
while( *zFrom && *zFrom==*z ){ z++; zFrom++; } |
|
0 |
0 |
while( *zFrom && *zFrom==*z ){ z++; zFrom++; } |
185475
|
0 |
0 |
if( *zFrom!=0 ) return 0; |
185476
|
0 |
0 |
if( xCond && !xCond(z) ) return 1; |
|
0 |
0 |
if( xCond && !xCond(z) ) return 1; |
185477
|
0 |
0 |
while( *zTo ){ |
185495
|
0 |
0 |
for(i=0; i
|
185497
|
0 |
0 |
if( c>='A' && c<='Z' ){ |
|
0 |
0 |
if( c>='A' && c<='Z' ){ |
185500
|
0 |
0 |
if( c>='0' && c<='9' ) hasDigit = 1; |
|
0 |
0 |
if( c>='0' && c<='9' ) hasDigit = 1; |
185504
|
0 |
0 |
mx = hasDigit ? 3 : 10; |
185505
|
0 |
0 |
if( nIn>mx*2 ){ |
185506
|
0 |
0 |
for(j=mx, i=nIn-mx; i
|
185543
|
0 |
0 |
if( nIn<3 || nIn>=(int)sizeof(zReverse)-7 ){ |
|
0 |
0 |
if( nIn<3 || nIn>=(int)sizeof(zReverse)-7 ){ |
185549
|
0 |
0 |
for(i=0, j=sizeof(zReverse)-6; i
|
185551
|
0 |
0 |
if( c>='A' && c<='Z' ){ |
|
0 |
0 |
if( c>='A' && c<='Z' ){ |
185553
|
0 |
0 |
}else if( c>='a' && c<='z' ){ |
|
0 |
0 |
}else if( c>='a' && c<='z' ){ |
185567
|
0 |
0 |
if( z[0]=='s' ){ |
185568
|
0 |
0 |
if( |
185569
|
0 |
0 |
!stem(&z, "sess", "ss", 0) && |
185570
|
0 |
0 |
!stem(&z, "sei", "i", 0) && |
185579
|
0 |
0 |
if( stem(&z, "dee", "ee", m_gt_0) ){ |
185581
|
0 |
0 |
}else if( |
185582
|
0 |
0 |
(stem(&z, "gni", "", hasVowel) || stem(&z, "de", "", hasVowel)) |
185583
|
0 |
0 |
&& z!=z2 |
185586
|
0 |
0 |
stem(&z, "lb", "ble", 0) || |
185589
|
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') ){ |
185591
|
0 |
0 |
}else if( m_eq_1(z) && star_oh(z) ){ |
|
0 |
0 |
}else if( m_eq_1(z) && star_oh(z) ){ |
185597
|
0 |
0 |
if( z[0]=='y' && hasVowel(z+1) ){ |
|
0 |
0 |
if( z[0]=='y' && hasVowel(z+1) ){ |
185604
|
0 |
0 |
if( !stem(&z, "lanoita", "ate", m_gt_0) ){ |
185609
|
0 |
0 |
if( !stem(&z, "icne", "ence", m_gt_0) ){ |
185620
|
0 |
0 |
if( !stem(&z, "ilb", "ble", m_gt_0) |
185621
|
0 |
0 |
&& !stem(&z, "illa", "al", m_gt_0) |
185622
|
0 |
0 |
&& !stem(&z, "iltne", "ent", m_gt_0) |
185623
|
0 |
0 |
&& !stem(&z, "ile", "e", m_gt_0) |
185629
|
0 |
0 |
if( !stem(&z, "noitazi", "ize", m_gt_0) |
185630
|
0 |
0 |
&& !stem(&z, "noita", "ate", m_gt_0) |
185636
|
0 |
0 |
if( !stem(&z, "msila", "al", m_gt_0) |
185637
|
0 |
0 |
&& !stem(&z, "ssenevi", "ive", m_gt_0) |
185638
|
0 |
0 |
&& !stem(&z, "ssenluf", "ful", m_gt_0) |
185644
|
0 |
0 |
if( !stem(&z, "itila", "al", m_gt_0) |
185645
|
0 |
0 |
&& !stem(&z, "itivi", "ive", m_gt_0) |
185655
|
0 |
0 |
if( !stem(&z, "etaci", "ic", m_gt_0) |
185656
|
0 |
0 |
&& !stem(&z, "evita", "", m_gt_0) |
185665
|
0 |
0 |
if( !stem(&z, "laci", "ic", m_gt_0) ){ |
185677
|
0 |
0 |
if( z[0]=='l' && m_gt_1(z+2) ){ |
|
0 |
0 |
if( z[0]=='l' && m_gt_1(z+2) ){ |
185682
|
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) ){ |
185687
|
0 |
0 |
if( z[0]=='r' && m_gt_1(z+2) ){ |
|
0 |
0 |
if( z[0]=='r' && m_gt_1(z+2) ){ |
185692
|
0 |
0 |
if( z[0]=='c' && m_gt_1(z+2) ){ |
|
0 |
0 |
if( z[0]=='c' && m_gt_1(z+2) ){ |
185697
|
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) ){ |
185702
|
0 |
0 |
if( z[0]=='t' ){ |
185703
|
0 |
0 |
if( z[2]=='a' ){ |
185704
|
0 |
0 |
if( m_gt_1(z+3) ){ |
185707
|
0 |
0 |
}else if( z[2]=='e' ){ |
185708
|
0 |
0 |
if( !stem(&z, "tneme", "", m_gt_1) |
185709
|
0 |
0 |
&& !stem(&z, "tnem", "", m_gt_1) |
185717
|
0 |
0 |
if( z[0]=='u' ){ |
185718
|
0 |
0 |
if( m_gt_1(z+2) ){ |
185721
|
0 |
0 |
}else if( z[3]=='s' || z[3]=='t' ){ |
|
0 |
0 |
}else if( z[3]=='s' || z[3]=='t' ){ |
185726
|
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) ){ |
185731
|
0 |
0 |
if( !stem(&z, "eta", "", m_gt_1) ){ |
185736
|
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) ){ |
185742
|
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) ){ |
185749
|
0 |
0 |
if( z[0]=='e' ){ |
185750
|
0 |
0 |
if( m_gt_1(z+1) ){ |
185752
|
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) ){ |
185758
|
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' ){ |
185767
|
0 |
0 |
while( *z ){ |
185803
|
0 |
0 |
while( c->iOffsetnInput ){ |
185807
|
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]) ){ |
185813
|
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]) ){ |
185817
|
0 |
0 |
if( c->iOffset>iStartOffset ){ |
185819
|
0 |
0 |
if( n>c->nAllocated ){ |
185823
|
0 |
0 |
if( !pNew ) return SQLITE_NOMEM; |
185944
|
307 |
0 |
if( argc==2 ){ |
185945
|
0 |
307 |
if( fts3TokenizerEnabled(context) || sqlite3_value_frombind(argv[1]) ){ |
|
0 |
0 |
if( fts3TokenizerEnabled(context) || sqlite3_value_frombind(argv[1]) ){ |
185948
|
307 |
0 |
if( zName==0 || n!=sizeof(pPtr) ){ |
|
0 |
307 |
if( zName==0 || n!=sizeof(pPtr) ){ |
185954
|
0 |
307 |
if( pOld==pPtr ){ |
185962
|
0 |
0 |
if( zName ){ |
185965
|
0 |
0 |
if( !pPtr ){ |
185972
|
0 |
307 |
if( fts3TokenizerEnabled(context) || sqlite3_value_frombind(argv[0]) ){ |
|
0 |
0 |
if( fts3TokenizerEnabled(context) || sqlite3_value_frombind(argv[0]) ){ |
185988
|
159 |
0 |
return (c&0x80 || isFtsIdChar[(int)(c)]); |
|
129 |
30 |
return (c&0x80 || isFtsIdChar[(int)(c)]); |
185997
|
28 |
28 |
while( z2==0 ){ |
186005
|
116 |
0 |
while( *++z2 && (*z2!=c || *++z2==c) ); |
|
112 |
4 |
while( *++z2 && (*z2!=c || *++z2==c) ); |
|
0 |
4 |
while( *++z2 && (*z2!=c || *++z2==c) ); |
186010
|
0 |
0 |
while( *z2 && z2[0]!=']' ) z2++; |
|
0 |
0 |
while( *z2 && z2[0]!=']' ) z2++; |
186011
|
0 |
0 |
if( *z2 ) z2++; |
186015
|
24 |
0 |
if( sqlite3Fts3IsIdChar(*z1) ){ |
186017
|
105 |
24 |
while( sqlite3Fts3IsIdChar(*z2) ) z2++; |
186042
|
0 |
10 |
if( !zCopy ) return SQLITE_NOMEM; |
186046
|
0 |
10 |
if( z==0 ){ |
186054
|
0 |
10 |
if( !m ){ |
186061
|
4 |
10 |
while( z
|
|
4 |
0 |
while( z
|
186064
|
0 |
4 |
if( !aNew ){ |
186077
|
1 |
9 |
if( rc!=SQLITE_OK ){ |
186360
|
311 |
0 |
if( SQLITE_OK==rc ){ |
186363
|
311 |
0 |
if( SQLITE_OK==rc ){ |
186438
|
315751 |
59 |
return c<0x80 && t->delim[c]; |
|
121105 |
194646 |
return c<0x80 && t->delim[c]; |
186441
|
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'); |
186454
|
0 |
5 |
if( t==NULL ) return SQLITE_NOMEM; |
186462
|
0 |
5 |
if( argc>1 ){ |
186464
|
0 |
0 |
for(i=0; i
|
186467
|
0 |
0 |
if( ch>=0x80 ){ |
186476
|
635 |
5 |
for(i=1; i<0x80; i++){ |
186477
|
325 |
310 |
t->delim[i] = !fts3_isalnum(i) ? -1 : 0; |
186509
|
0 |
66 |
if( c==NULL ) return SQLITE_NOMEM; |
186512
|
0 |
66 |
if( pInput==0 ){ |
186514
|
46 |
20 |
}else if( nBytes<0 ){ |
186555
|
34280 |
55 |
while( c->iOffsetnBytes ){ |
186559
|
121157 |
11 |
while( c->iOffsetnBytes && simpleDelim(t, p[c->iOffset]) ){ |
|
86888 |
34269 |
while( c->iOffsetnBytes && simpleDelim(t, p[c->iOffset]) ){ |
186565
|
194653 |
63 |
while( c->iOffsetnBytes && !simpleDelim(t, p[c->iOffset]) ){ |
|
160436 |
34217 |
while( c->iOffsetnBytes && !simpleDelim(t, p[c->iOffset]) ){ |
186569
|
34269 |
11 |
if( c->iOffset>iStartOffset ){ |
186571
|
67 |
34202 |
if( n>c->nTokenAllocated ){ |
186575
|
0 |
67 |
if( !pNew ) return SQLITE_NOMEM; |
186578
|
160436 |
34269 |
for(i=0; i
|
186583
|
157811 |
2625 |
c->pToken[i] = (char)((ch>='A' && ch<='Z') ? ch-'A'+'a' : ch); |
|
36994 |
120817 |
c->pToken[i] = (char)((ch>='A' && ch<='Z') ? ch-'A'+'a' : ch); |
186710
|
0 |
0 |
if( !p ){ |
186737
|
0 |
0 |
if( argc==0 ){ |
186744
|
0 |
0 |
for(i=0; i
|
186749
|
0 |
0 |
if( azDequote==0 ){ |
186753
|
0 |
0 |
for(i=0; i
|
186797
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
186802
|
0 |
0 |
if( rc==SQLITE_OK ){ |
186804
|
0 |
0 |
if( nDequote<1 ){ |
186813
|
0 |
0 |
if( rc==SQLITE_OK ){ |
186815
|
0 |
0 |
if( nDequote>1 ) azArg = (const char * const *)&azDequote[1]; |
186816
|
0 |
0 |
rc = pMod->xCreate((nDequote>1 ? nDequote-1 : 0), azArg, &pTok); |
186819
|
0 |
0 |
if( rc==SQLITE_OK ){ |
186821
|
0 |
0 |
if( pTab==0 ){ |
186826
|
0 |
0 |
if( rc==SQLITE_OK ){ |
186832
|
0 |
0 |
if( pTok ){ |
186864
|
0 |
0 |
for(i=0; inConstraint; i++){ |
186865
|
0 |
0 |
if( pInfo->aConstraint[i].usable |
186866
|
0 |
0 |
&& pInfo->aConstraint[i].iColumn==0 |
186867
|
0 |
0 |
&& pInfo->aConstraint[i].op==SQLITE_INDEX_CONSTRAINT_EQ |
186891
|
0 |
0 |
if( pCsr==0 ){ |
186905
|
0 |
0 |
if( pCsr->pCsr ){ |
186945
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
186947
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
186970
|
0 |
0 |
if( idxNum==1 ){ |
186974
|
0 |
0 |
if( pCsr->zInput==0 ){ |
186977
|
0 |
0 |
if( nByte>0 ) memcpy(pCsr->zInput, zByte, nByte); |
186980
|
0 |
0 |
if( rc==SQLITE_OK ){ |
186986
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
187484
|
81 |
460 |
if( !pStmt ){ |
187487
|
6 |
75 |
if( eStmt==SQL_CONTENT_INSERT ){ |
187489
|
1 |
74 |
}else if( eStmt==SQL_SELECT_CONTENT_BY_ROWID ){ |
187495
|
0 |
81 |
if( !zSql ){ |
187504
|
35 |
506 |
if( apVal ){ |
187507
|
112 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
77 |
35 |
for(i=0; rc==SQLITE_OK && i
|
187525
|
0 |
0 |
if( rc==SQLITE_OK ){ |
187528
|
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 ){ |
187530
|
0 |
0 |
if( rc==SQLITE_OK ) rc = FTS_CORRUPT_VTAB; |
187548
|
0 |
0 |
if( rc==SQLITE_OK ){ |
187550
|
0 |
0 |
if( sqlite3_step(pStmt)!=SQLITE_ROW |
187551
|
0 |
0 |
|| sqlite3_column_type(pStmt, 0)!=SQLITE_BLOB |
187554
|
0 |
0 |
if( rc==SQLITE_OK ) rc = FTS_CORRUPT_VTAB; |
187586
|
0 |
5 |
if( *pRC ) return; |
187588
|
5 |
0 |
if( rc==SQLITE_OK ){ |
187613
|
33 |
4 |
if( p->nPendingData==0 ){ |
187616
|
33 |
0 |
if( rc==SQLITE_OK ){ |
187695
|
114 |
0 |
if( iLevel<0 ){ |
187698
|
114 |
0 |
if( rc==SQLITE_OK ){ |
187707
|
0 |
0 |
if( rc==SQLITE_OK ){ |
187735
|
12531 |
289480 |
if( !p ){ |
187737
|
0 |
12531 |
if( !p ){ |
187744
|
1431 |
288049 |
else if( p->nData+FTS3_VARINT_MAX+1>p->nSpace ){ |
187747
|
0 |
1431 |
if( !p ){ |
187784
|
277245 |
12531 |
if( !p || p->iLastDocid!=iDocid ){ |
|
2840 |
274405 |
if( !p || p->iLastDocid!=iDocid ){ |
187785
|
2840 |
12531 |
u64 iDelta = (u64)iDocid - (u64)(p ? p->iLastDocid : 0); |
187786
|
2840 |
12531 |
if( p ){ |
187791
|
0 |
15371 |
if( SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, iDelta)) ){ |
187798
|
78 |
289698 |
if( iCol>0 && p->iLastCol!=iCol ){ |
|
78 |
0 |
if( iCol>0 && p->iLastCol!=iCol ){ |
187799
|
78 |
0 |
if( SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, 1)) |
187800
|
78 |
0 |
|| SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, iCol)) |
187807
|
286484 |
3292 |
if( iCol>=0 ){ |
187810
|
286484 |
0 |
if( rc==SQLITE_OK ){ |
187817
|
13906 |
275870 |
if( p!=*pp ){ |
187846
|
277245 |
12531 |
if( pList ){ |
187849
|
13906 |
275870 |
if( fts3PendingListAppend(&pList, p->iPrevDocid, iCol, iPos, &rc) ){ |
187850
|
0 |
13906 |
if( pList==fts3HashInsert(pHash, zToken, nToken, pList) ){ |
187859
|
289776 |
0 |
if( rc==SQLITE_OK ){ |
187899
|
0 |
70 |
if( zText==0 ){ |
187905
|
0 |
70 |
if( rc!=SQLITE_OK ){ |
187910
|
289846 |
0 |
while( SQLITE_OK==rc |
187911
|
289776 |
70 |
&& SQLITE_OK==(rc = xNext(pCsr, &zToken, &nToken, &iStart, &iEnd, &iPos)) |
187914
|
289776 |
0 |
if( iPos>=nWord ) nWord = iPos+1; |
187919
|
289776 |
0 |
if( iPos<0 || !zToken || nToken<=0 ){ |
|
289776 |
0 |
if( iPos<0 || !zToken || nToken<=0 ){ |
|
0 |
289776 |
if( iPos<0 || !zToken || nToken<=0 ){ |
187931
|
289776 |
0 |
for(i=1; rc==SQLITE_OK && inIndex; i++){ |
|
0 |
289776 |
for(i=1; rc==SQLITE_OK && inIndex; i++){ |
187933
|
0 |
0 |
if( nTokennPrefix ) continue; |
187942
|
0 |
70 |
return (rc==SQLITE_DONE ? SQLITE_OK : rc); |
187965
|
46 |
1 |
if( iDocidiPrevDocid |
187966
|
0 |
46 |
|| (iDocid==p->iPrevDocid && p->bPrevDelete==0) |
|
0 |
0 |
|| (iDocid==p->iPrevDocid && p->bPrevDelete==0) |
187967
|
46 |
0 |
|| p->iPrevLangid!=iLangid |
187968
|
0 |
46 |
|| p->nPendingData>p->nMaxPendingData |
187971
|
0 |
1 |
if( rc!=SQLITE_OK ) return rc; |
187984
|
43 |
43 |
for(i=0; inIndex; i++){ |
187987
|
12531 |
43 |
for(pElem=fts3HashFirst(pHash); pElem; pElem=fts3HashNext(pElem)){ |
188011
|
48 |
36 |
for(i=2; inColumn+2; i++){ |
188013
|
48 |
0 |
if( p->abNotindexed[iCol]==0 ){ |
188016
|
0 |
48 |
if( rc!=SQLITE_OK ){ |
188047
|
3 |
33 |
if( p->zContentTbl ){ |
188049
|
0 |
3 |
if( sqlite3_value_type(pRowid)==SQLITE_NULL ){ |
188052
|
0 |
3 |
if( sqlite3_value_type(pRowid)!=SQLITE_INTEGER ){ |
188068
|
33 |
0 |
if( rc==SQLITE_OK && p->zLanguageid ){ |
|
0 |
33 |
if( rc==SQLITE_OK && p->zLanguageid ){ |
188074
|
0 |
33 |
if( rc!=SQLITE_OK ) return rc; |
188086
|
0 |
33 |
if( SQLITE_NULL!=sqlite3_value_type(apVal[3+p->nColumn]) ){ |
188087
|
0 |
0 |
if( SQLITE_NULL==sqlite3_value_type(apVal[0]) |
188088
|
0 |
0 |
&& SQLITE_NULL!=sqlite3_value_type(apVal[1]) |
188094
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
188122
|
0 |
1 |
if( bContent ) fts3SqlExec(&rc, p, SQL_DELETE_ALL_CONTENT, 0); |
188125
|
1 |
0 |
if( p->bHasDocsize ){ |
188128
|
1 |
0 |
if( p->bHasStat ){ |
188139
|
0 |
11 |
if( p->zLanguageid ) iLangid = sqlite3_column_int(pSelect, p->nColumn+1); |
188159
|
0 |
1 |
if( *pRC ) return; |
188161
|
1 |
0 |
if( rc==SQLITE_OK ){ |
188162
|
1 |
0 |
if( SQLITE_ROW==sqlite3_step(pSelect) ){ |
188167
|
3 |
0 |
for(i=1; rc==SQLITE_OK && i<=p->nColumn; i++){ |
|
2 |
1 |
for(i=1; rc==SQLITE_OK && i<=p->nColumn; i++){ |
188169
|
2 |
0 |
if( p->abNotindexed[iCol]==0 ){ |
188175
|
0 |
1 |
if( rc!=SQLITE_OK ){ |
188226
|
34 |
0 |
if( rc==SQLITE_OK ){ |
188230
|
34 |
0 |
if( SQLITE_ROW==sqlite3_step(pNextIdx) ){ |
188236
|
34 |
0 |
if( rc==SQLITE_OK ){ |
188242
|
0 |
34 |
if( iNext>=MergeCount(p) ){ |
188293
|
87 |
16 |
if( p->pSegments ){ |
188296
|
6 |
10 |
if( 0==p->zSegmentsTbl ){ |
188298
|
0 |
6 |
if( 0==p->zSegmentsTbl ) return SQLITE_NOMEM; |
188305
|
103 |
0 |
if( rc==SQLITE_OK ){ |
188308
|
57 |
46 |
if( paBlob ){ |
188310
|
0 |
57 |
if( !aByte ){ |
188313
|
0 |
57 |
if( pnLoad && nByte>(FTS3_NODE_CHUNK_THRESHOLD) ){ |
|
0 |
0 |
if( pnLoad && nByte>(FTS3_NODE_CHUNK_THRESHOLD) ){ |
188319
|
0 |
57 |
if( rc!=SQLITE_OK ){ |
188326
|
0 |
0 |
}else if( rc==SQLITE_ERROR ){ |
188354
|
0 |
0 |
if( rc==SQLITE_OK ){ |
188357
|
0 |
0 |
if( pReader->nPopulate==pReader->nNode ){ |
188371
|
0 |
12973 |
while( pReader->pBlob && rc==SQLITE_OK |
|
0 |
0 |
while( pReader->pBlob && rc==SQLITE_OK |
188372
|
0 |
0 |
&& (pFrom - pReader->aNode + nByte)>pReader->nPopulate |
188383
|
59 |
263 |
if( !fts3SegReaderIsRootOnly(pSeg) ){ |
188406
|
459 |
18484 |
if( !pReader->aDoclist ){ |
188412
|
18851 |
92 |
if( !pNext || pNext>=&pReader->aNode[pReader->nNode] ){ |
|
12582 |
6269 |
if( !pNext || pNext>=&pReader->aNode[pReader->nNode] ){ |
188414
|
12566 |
108 |
if( fts3SegReaderIsPending(pReader) ){ |
188418
|
12532 |
34 |
if( pElem ){ |
188424
|
55 |
12477 |
if( (nTerm+1)>pReader->nTermAlloc ){ |
188427
|
0 |
55 |
if( !pReader->zTerm ) return SQLITE_NOMEM; |
188435
|
0 |
12532 |
if( !aCopy ) return SQLITE_NOMEM; |
188452
|
51 |
57 |
if( pReader->iCurrentBlock>=pReader->iLeafEndBlock ){ |
188456
|
0 |
57 |
rc = sqlite3Fts3ReadBlock( |
188460
|
0 |
57 |
if( rc!=SQLITE_OK ) return rc; |
188462
|
0 |
57 |
if( bIncr && pReader->nPopulatenNode ){ |
|
0 |
0 |
if( bIncr && pReader->nPopulatenNode ){ |
188472
|
0 |
6326 |
if( rc!=SQLITE_OK ) return rc; |
188476
|
0 |
6326 |
pNext += fts3GetVarint32(pNext, &nPrefix); |
188477
|
0 |
6326 |
pNext += fts3GetVarint32(pNext, &nSuffix); |
188478
|
6326 |
0 |
if( nSuffix<=0 |
188479
|
6326 |
0 |
|| (&pReader->aNode[pReader->nNode] - pNext)
|
188480
|
0 |
6326 |
|| nPrefix>pReader->nTerm |
188488
|
517 |
5809 |
if( (i64)nPrefix+nSuffix>(i64)pReader->nTermAlloc ){ |
188491
|
0 |
517 |
if( !zNew ){ |
188499
|
0 |
6326 |
if( rc!=SQLITE_OK ) return rc; |
188504
|
71 |
6255 |
pNext += fts3GetVarint32(pNext, &pReader->nDoclist); |
188512
|
6326 |
0 |
if( pReader->nDoclist > pReader->nNode-(pReader->aDoclist-pReader->aNode) |
188513
|
6326 |
0 |
|| (pReader->nPopulate==0 && pReader->aDoclist[pReader->nDoclist-1]) |
|
6326 |
0 |
|| (pReader->nPopulate==0 && pReader->aDoclist[pReader->nDoclist-1]) |
188514
|
0 |
6326 |
|| pReader->nDoclist==0 |
188529
|
0 |
158 |
if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){ |
|
0 |
0 |
if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){ |
188539
|
158 |
0 |
if( rc==SQLITE_OK ){ |
188569
|
0 |
318 |
if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){ |
|
0 |
0 |
if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){ |
188574
|
0 |
0 |
if( ppOffsetList ){ |
188582
|
0 |
0 |
if( bEof ){ |
188601
|
11769 |
318 |
while( *p | c ) c = *p++ & 0x80; |
188604
|
0 |
318 |
if( pReader->pBlob==0 || p<&pReader->aNode[pReader->nPopulate] ) break; |
|
0 |
0 |
if( pReader->pBlob==0 || p<&pReader->aNode[pReader->nPopulate] ) break; |
188606
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
188613
|
302 |
16 |
if( ppOffsetList ){ |
188619
|
163 |
155 |
while( p
|
|
0 |
163 |
while( p
|
188626
|
155 |
163 |
if( p>=pEnd ){ |
188630
|
163 |
0 |
if( rc==SQLITE_OK ){ |
188633
|
0 |
163 |
if( pTab->bDescIdx ){ |
188660
|
212 |
0 |
for(ii=0; rc==SQLITE_OK && iinSegment; ii++){ |
|
162 |
50 |
for(ii=0; rc==SQLITE_OK && iinSegment; ii++){ |
188662
|
162 |
0 |
if( !fts3SegReaderIsPending(pReader) |
188663
|
46 |
116 |
&& !fts3SegReaderIsRootOnly(pReader) |
188666
|
46 |
46 |
for(jj=pReader->iStartBlock; jj<=pReader->iLeafEndBlock; jj++){ |
188669
|
0 |
46 |
if( rc!=SQLITE_OK ) break; |
188670
|
0 |
46 |
if( (nBlob+35)>pgsz ){ |
188685
|
459 |
0 |
if( pReader ){ |
188687
|
92 |
367 |
if( !fts3SegReaderIsRootOnly(pReader) ){ |
188716
|
367 |
57 |
if( iStartLeaf==0 ){ |
188717
|
0 |
367 |
if( iEndLeaf!=0 ) return FTS_CORRUPT_VTAB; |
188722
|
0 |
424 |
if( !pReader ){ |
188732
|
367 |
57 |
if( nExtra ){ |
188737
|
367 |
0 |
if( nRoot ) memcpy(pReader->aNode, zRoot, nRoot); |
188762
|
5417 |
116533 |
if( c==0 ){ |
188803
|
50 |
105 |
if( bPrefix ){ |
188806
|
12531 |
50 |
for(pE=fts3HashFirst(pHash); pE; pE=fts3HashNext(pE)){ |
188809
|
0 |
12531 |
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)) ){ |
188810
|
805 |
11726 |
if( nElem==nAlloc ){ |
188816
|
0 |
805 |
if( !aElem2 ){ |
188832
|
34 |
16 |
if( nElem>1 ){ |
188845
|
1 |
104 |
if( pE ){ |
188851
|
35 |
120 |
if( nElem>0 ){ |
188855
|
0 |
35 |
if( !pReader ){ |
188865
|
50 |
105 |
if( bPrefix ){ |
188886
|
152 |
489 |
if( pLhs->aNode && pRhs->aNode ){ |
|
82 |
70 |
if( pLhs->aNode && pRhs->aNode ){ |
188888
|
13 |
69 |
if( rc2<0 ){ |
188893
|
51 |
31 |
if( rc==0 ){ |
188899
|
364 |
277 |
if( rc==0 ){ |
188919
|
146 |
70 |
if( rc==0 ){ |
188920
|
16 |
130 |
if( pLhs->iDocid==pRhs->iDocid ){ |
188923
|
82 |
48 |
rc = (pLhs->iDocid > pRhs->iDocid) ? 1 : -1; |
188931
|
0 |
0 |
if( rc==0 ){ |
188932
|
0 |
0 |
if( pLhs->iDocid==pRhs->iDocid ){ |
188935
|
0 |
0 |
rc = (pLhs->iDocid < pRhs->iDocid) ? 1 : -1; |
188956
|
6453 |
44 |
if( pSeg->aNode ){ |
188957
|
3177 |
3276 |
if( pSeg->nTerm>nTerm ){ |
188962
|
368 |
6085 |
if( res==0 ){ |
188985
|
12954 |
211 |
if( nSuspect==nSegment ) nSuspect--; |
188986
|
534 |
13165 |
for(i=nSuspect-1; i>=0; i--){ |
188988
|
857 |
376 |
for(j=i; j<(nSegment-1); j++){ |
188990
|
158 |
699 |
if( xCmp(apSegment[j], apSegment[j+1])<0 ) break; |
189016
|
140 |
0 |
if( rc==SQLITE_OK ){ |
189037
|
0 |
0 |
if( rc==SQLITE_OK ){ |
189038
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
189063
|
34 |
0 |
if( rc==SQLITE_OK ){ |
189068
|
0 |
34 |
if( nLeafData==0 ){ |
189072
|
0 |
34 |
if( !zEnd ) return SQLITE_NOMEM; |
189098
|
51177 |
2840 |
for(n=0; n
|
|
51177 |
0 |
for(n=0; n
|
|
41352 |
9825 |
for(n=0; n
|
189121
|
134 |
6 |
if( pTree ){ |
189133
|
0 |
134 |
if( nSuffix<=0 ) return FTS_CORRUPT_VTAB; |
189136
|
0 |
134 |
if( nReq<=p->nNodeSize || !pTree->zTerm ){ |
|
0 |
0 |
if( nReq<=p->nNodeSize || !pTree->zTerm ){ |
189138
|
0 |
134 |
if( nReq>p->nNodeSize ){ |
189148
|
0 |
0 |
if( !pTree->aData ){ |
189153
|
128 |
6 |
if( pTree->zTerm ){ |
189163
|
134 |
0 |
if( isCopyTerm ){ |
189164
|
11 |
123 |
if( pTree->nMalloc
|
189166
|
0 |
11 |
if( !zNew ){ |
189192
|
0 |
6 |
if( !pNew ){ |
189199
|
0 |
6 |
if( pTree ){ |
189202
|
0 |
0 |
if( pTree->pParent==0 ){ |
189261
|
6 |
0 |
if( !pTree->pParent ){ |
189271
|
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){ |
189279
|
0 |
0 |
if( rc==SQLITE_OK ){ |
189294
|
6 |
34 |
if( pTree ){ |
189297
|
6 |
6 |
while( p ){ |
189299
|
0 |
6 |
if( p->aData!=(char *)&p[1] ){ |
189333
|
34 |
12497 |
if( !pWriter ){ |
189339
|
0 |
34 |
if( !pWriter ) return SQLITE_NOMEM; |
189345
|
0 |
34 |
if( !pWriter->aData ) return SQLITE_NOMEM; |
189350
|
0 |
34 |
if( rc!=SQLITE_OK ) return rc; |
189351
|
34 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
189356
|
0 |
34 |
if( rc!=SQLITE_OK ) return rc; |
189366
|
0 |
12531 |
if( nSuffix<=0 ) return FTS_CORRUPT_VTAB; |
189375
|
12497 |
34 |
if( nData>0 && nData+nReq>p->nNodeSize ){ |
|
134 |
12363 |
if( nData>0 && nData+nReq>p->nNodeSize ){ |
189379
|
0 |
134 |
if( pWriter->iFree==LARGEST_INT64 ) return FTS_CORRUPT_VTAB; |
189381
|
0 |
134 |
if( rc!=SQLITE_OK ) return rc; |
189398
|
0 |
134 |
if( rc!=SQLITE_OK ) return rc; |
189418
|
0 |
12531 |
if( nReq>pWriter->nSize ){ |
189420
|
0 |
0 |
if( !aNew ) return SQLITE_NOMEM; |
189442
|
12531 |
0 |
if( isCopyTerm ){ |
189443
|
59 |
12472 |
if( nTerm>pWriter->nMalloc ){ |
189445
|
0 |
59 |
if( !zNew ){ |
189476
|
6 |
28 |
if( pWriter->pTree ){ |
189484
|
6 |
0 |
if( rc==SQLITE_OK ){ |
189488
|
6 |
0 |
if( rc==SQLITE_OK ){ |
189506
|
34 |
8 |
if( pWriter ){ |
189527
|
1 |
0 |
if( p->zContentTbl ){ |
189533
|
0 |
0 |
if( rc==SQLITE_OK ){ |
189534
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
189568
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
189573
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
189597
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
189604
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
189620
|
0 |
0 |
if( pSeg->iStartBlock ){ |
189623
|
0 |
0 |
if( rc==SQLITE_OK ){ |
189659
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
189662
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
189667
|
0 |
0 |
if( iLevel==FTS3_SEGCURSOR_ALL ){ |
189669
|
0 |
0 |
if( rc==SQLITE_OK ){ |
189677
|
0 |
0 |
if( rc==SQLITE_OK ){ |
189684
|
0 |
0 |
if( rc==SQLITE_OK ){ |
189719
|
9062 |
111 |
while( p
|
|
9055 |
7 |
while( p
|
189721
|
111 |
7 |
if( iCol==iCurrent ){ |
189728
|
0 |
7 |
if( nList<=0 ){ |
189732
|
0 |
7 |
p += fts3GetVarint32(p, &iCurrent); |
189735
|
99 |
12 |
if( bZero && (pEnd - &pList[nList])>0){ |
|
0 |
99 |
if( bZero && (pEnd - &pList[nList])>0){ |
189754
|
41 |
12493 |
if( nList>pMsr->nBuffer ){ |
189758
|
0 |
41 |
if( !pNew ) return SQLITE_NOMEM; |
189777
|
0 |
334 |
p->bDescIdx ? fts3SegReaderDoclistCmpRev : fts3SegReaderDoclistCmp |
189780
|
4 |
330 |
if( nMerge==0 ){ |
189789
|
62 |
284 |
if( pSeg->pOffsetList==0 ){ |
189801
|
300 |
0 |
while( rc==SQLITE_OK |
189802
|
166 |
134 |
&& j
|
189803
|
103 |
63 |
&& apSegment[j]->pOffsetList |
189804
|
16 |
87 |
&& apSegment[j]->iDocid==iDocid |
189809
|
0 |
284 |
if( rc!=SQLITE_OK ) return rc; |
189812
|
268 |
16 |
if( nList>0 && fts3SegReaderIsPending(apSegment[0]) ){ |
|
3 |
265 |
if( nList>0 && fts3SegReaderIsPending(apSegment[0]) ){ |
189814
|
0 |
3 |
if( rc!=SQLITE_OK ) return rc; |
189819
|
99 |
185 |
if( pMsr->iColFilter>=0 ){ |
189823
|
268 |
16 |
if( nList>0 ){ |
189850
|
607 |
0 |
for(i=0; pCsr->bRestart==0 && inSegment; i++){ |
|
459 |
148 |
for(i=0; pCsr->bRestart==0 && inSegment; i++){ |
189855
|
0 |
6394 |
if( rc!=SQLITE_OK ) return rc; |
189856
|
6357 |
37 |
}while( zTerm && (res = fts3SegReaderTermCmp(pSeg, zTerm, nTerm))<0 ); |
|
5935 |
422 |
}while( zTerm && (res = fts3SegReaderTermCmp(pSeg, zTerm, nTerm))<0 ); |
189858
|
389 |
70 |
if( pSeg->bLookup && res!=0 ){ |
|
214 |
175 |
if( pSeg->bLookup && res!=0 ){ |
189887
|
0 |
105 |
p->bDescIdx ? fts3SegReaderDoclistCmpRev : fts3SegReaderDoclistCmp |
189895
|
0 |
105 |
if( rc!=SQLITE_OK ) return rc; |
189898
|
218 |
27 |
for(i=0; i
|
189900
|
140 |
78 |
if( !pSeg->aNode || fts3SegReaderTermCmp(pSeg, zTerm, nTerm) ){ |
|
140 |
0 |
if( !pSeg->aNode || fts3SegReaderTermCmp(pSeg, zTerm, nTerm) ){ |
189907
|
140 |
105 |
for(i=0; inAdvance; i++){ |
189909
|
0 |
140 |
if( rc!=SQLITE_OK ) return rc; |
189941
|
0 |
0 |
for(i=0; inSegment; i++){ |
189951
|
9 |
27 |
if( nReq>pCsr->nBuffer ){ |
189955
|
0 |
9 |
if( !aNew ){ |
189981
|
0 |
12592 |
p->bDescIdx ? fts3SegReaderDoclistCmpRev : fts3SegReaderDoclistCmp |
189984
|
0 |
12592 |
if( pCsr->nSegment==0 ) return SQLITE_OK; |
189993
|
12549 |
12592 |
for(i=0; inAdvance; i++){ |
189995
|
0 |
12549 |
if( pSeg->bLookup ){ |
190000
|
0 |
12549 |
if( rc!=SQLITE_OK ) return rc; |
190007
|
35 |
12557 |
if( apSegment[0]->aNode==0 ) break; |
190019
|
20 |
12537 |
if( pFilter->zTerm && !isScan ){ |
|
20 |
0 |
if( pFilter->zTerm && !isScan ){ |
190020
|
16 |
4 |
if( pCsr->nTermnTerm |
190021
|
0 |
16 |
|| (!isPrefix && pCsr->nTerm>pFilter->nTerm) |
|
0 |
0 |
|| (!isPrefix && pCsr->nTerm>pFilter->nTerm) |
190022
|
12 |
4 |
|| memcmp(pCsr->zTerm, pFilter->zTerm, pFilter->nTerm) |
190029
|
18 |
12531 |
while( nMerge
|
190030
|
13 |
5 |
&& apSegment[nMerge]->aNode |
190031
|
0 |
13 |
&& apSegment[nMerge]->nTerm==pCsr->nTerm |
190032
|
0 |
0 |
&& 0==memcmp(pCsr->zTerm, apSegment[nMerge]->zTerm, pCsr->nTerm) |
190038
|
12549 |
0 |
if( nMerge==1 |
190039
|
12531 |
18 |
&& !isIgnoreEmpty |
190040
|
12531 |
0 |
&& !isFirst |
190041
|
0 |
12531 |
&& (p->bDescIdx==0 || fts3SegReaderIsPending(apSegment[0])==0) |
|
0 |
0 |
&& (p->bDescIdx==0 || fts3SegReaderIsPending(apSegment[0])==0) |
190044
|
12531 |
0 |
if( fts3SegReaderIsPending(apSegment[0]) ){ |
190051
|
12531 |
0 |
if( rc==SQLITE_OK ) rc = SQLITE_ROW; |
190060
|
18 |
18 |
for(i=0; i
|
190064
|
18 |
18 |
while( apSegment[0]->pOffsetList ){ |
190072
|
0 |
18 |
while( j
|
190073
|
0 |
0 |
&& apSegment[j]->pOffsetList |
190074
|
0 |
0 |
&& apSegment[j]->iDocid==iDocid |
190080
|
12 |
6 |
if( isColFilter ){ |
190084
|
18 |
0 |
if( !isIgnoreEmpty || nList>0 ){ |
|
18 |
0 |
if( !isIgnoreEmpty || nList>0 ){ |
190089
|
0 |
18 |
if( p->bDescIdx && nDoclist>0 ){ |
|
0 |
0 |
if( p->bDescIdx && nDoclist>0 ){ |
190090
|
0 |
0 |
if( iPrev<=iDocid ) return FTS_CORRUPT_VTAB; |
190093
|
0 |
18 |
if( nDoclist>0 && iPrev>=iDocid ) return FTS_CORRUPT_VTAB; |
|
0 |
0 |
if( nDoclist>0 && iPrev>=iDocid ) return FTS_CORRUPT_VTAB; |
190097
|
18 |
0 |
nByte = sqlite3Fts3VarintLen(iDelta) + (isRequirePos?nList+1:0); |
190101
|
0 |
18 |
if( rc ) return rc; |
190103
|
0 |
18 |
if( isFirst ){ |
190108
|
0 |
0 |
if( nWrite ){ |
190115
|
18 |
0 |
if( isRequirePos ){ |
190125
|
18 |
0 |
if( nDoclist>0 ){ |
190127
|
0 |
18 |
if( rc ) return rc; |
190135
|
0 |
12549 |
}while( rc==SQLITE_OK ); |
190144
|
157 |
8 |
if( pCsr ){ |
190146
|
459 |
157 |
for(i=0; inSegment; i++){ |
190175
|
0 |
0 |
if( zText ){ |
190179
|
0 |
0 |
for(i=0; zText[i]>='0' && zText[i]<='9'; i++){ |
|
0 |
0 |
for(i=0; zText[i]>='0' && zText[i]<='9'; i++){ |
190183
|
0 |
0 |
while( zText[i]==' ' ) i++; |
190185
|
0 |
0 |
if( zText[i]=='-' ){ |
190189
|
0 |
0 |
for(/* no-op */; zText[i]>='0' && zText[i]<='9'; i++){ |
|
0 |
0 |
for(/* no-op */; zText[i]>='0' && zText[i]<='9'; i++){ |
190211
|
34 |
0 |
if( rc==SQLITE_OK ){ |
190223
|
0 |
34 |
while( SQLITE_ROW==sqlite3_step(pRange) ){ |
190226
|
0 |
0 |
if( nSize<=0 || nSize>nLimit ){ |
|
0 |
0 |
if( nSize<=0 || nSize>nLimit ){ |
190239
|
0 |
34 |
if( bOk ){ |
190244
|
0 |
0 |
if( rc==SQLITE_OK ){ |
190247
|
0 |
0 |
if( rc==SQLITE_OK ){ |
190251
|
0 |
0 |
if( rc==SQLITE_OK ){ |
190263
|
0 |
0 |
while( SQLITE_ROW==sqlite3_step(pRange) ){ |
190269
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
190275
|
0 |
0 |
if( rc==SQLITE_OK ){ |
190280
|
0 |
0 |
if( rc==SQLITE_OK ){ |
190326
|
42 |
0 |
if( rc!=SQLITE_OK || csr.nSegment==0 ) goto finished; |
|
34 |
8 |
if( rc!=SQLITE_OK || csr.nSegment==0 ) goto finished; |
190328
|
0 |
34 |
if( iLevel!=FTS3_SEGCURSOR_PENDING ){ |
190330
|
0 |
0 |
if( rc!=SQLITE_OK ) goto finished; |
190333
|
0 |
34 |
if( iLevel==FTS3_SEGCURSOR_ALL ){ |
190338
|
0 |
0 |
if( csr.nSegment==1 && 0==fts3SegReaderIsPending(csr.apSegment[0]) ){ |
|
0 |
0 |
if( csr.nSegment==1 && 0==fts3SegReaderIsPending(csr.apSegment[0]) ){ |
190353
|
0 |
34 |
bIgnoreEmpty = (iLevel!=FTS3_SEGCURSOR_PENDING) && (iNewLevel>iMaxLevel); |
|
0 |
0 |
bIgnoreEmpty = (iLevel!=FTS3_SEGCURSOR_PENDING) && (iNewLevel>iMaxLevel); |
190355
|
0 |
34 |
if( rc!=SQLITE_OK ) goto finished; |
190365
|
0 |
34 |
filter.flags |= (bIgnoreEmpty ? FTS3_SEGMENT_IGNORE_EMPTY : 0); |
190368
|
12565 |
0 |
while( SQLITE_OK==rc ){ |
190370
|
34 |
12531 |
if( rc!=SQLITE_ROW ) break; |
190374
|
0 |
34 |
if( rc!=SQLITE_OK ) goto finished; |
190377
|
0 |
34 |
if( iLevel!=FTS3_SEGCURSOR_PENDING ){ |
190381
|
0 |
0 |
if( rc!=SQLITE_OK ) goto finished; |
190383
|
34 |
0 |
if( pWriter ){ |
190385
|
34 |
0 |
if( rc==SQLITE_OK ){ |
190386
|
0 |
34 |
if( iLevel==FTS3_SEGCURSOR_PENDING || iNewLevel
|
|
0 |
0 |
if( iLevel==FTS3_SEGCURSOR_PENDING || iNewLevel
|
190406
|
84 |
0 |
for(i=0; rc==SQLITE_OK && inIndex; i++){ |
|
42 |
42 |
for(i=0; rc==SQLITE_OK && inIndex; i++){ |
190408
|
0 |
42 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
190415
|
42 |
0 |
if( rc==SQLITE_OK && p->bHasStat |
|
23 |
19 |
if( rc==SQLITE_OK && p->bHasStat |
190416
|
9 |
14 |
&& p->nAutoincrmerge==0xff && p->nLeafAdd>0 |
|
5 |
4 |
&& p->nAutoincrmerge==0xff && p->nLeafAdd>0 |
190420
|
5 |
0 |
if( rc==SQLITE_OK ){ |
190423
|
0 |
5 |
if( rc==SQLITE_ROW ){ |
190425
|
0 |
0 |
if( p->nAutoincrmerge==1 ) p->nAutoincrmerge = 8; |
190426
|
5 |
0 |
}else if( rc==SQLITE_DONE ){ |
190445
|
124 |
52 |
for(i=j=0; i
|
190461
|
17 |
0 |
if( nBuf && (zBuf[nBuf-1]&0x80)==0 ){ |
|
17 |
0 |
if( nBuf && (zBuf[nBuf-1]&0x80)==0 ){ |
190463
|
58 |
17 |
for(i=j=0; i
|
|
58 |
0 |
for(i=j=0; i
|
190469
|
0 |
17 |
while( i
|
190487
|
0 |
30 |
if( *pRC ) return; |
190489
|
0 |
30 |
if( pBlob==0 ){ |
190495
|
0 |
30 |
if( rc ){ |
190537
|
0 |
22 |
if( *pRC ) return; |
190539
|
0 |
22 |
if( a==0 ){ |
190545
|
0 |
22 |
if( rc ){ |
190551
|
17 |
5 |
if( sqlite3_step(pStmt)==SQLITE_ROW ){ |
190559
|
0 |
22 |
if( rc!=SQLITE_OK ){ |
190564
|
1 |
21 |
if( nChng<0 && a[0]<(u32)(-nChng) ){ |
|
0 |
1 |
if( nChng<0 && a[0]<(u32)(-nChng) ){ |
190569
|
54 |
22 |
for(i=0; inColumn+1; i++){ |
190571
|
0 |
54 |
if( x+aSzIns[i] < aSzDel[i] ){ |
190580
|
0 |
22 |
if( rc ){ |
190603
|
0 |
0 |
if( rc==SQLITE_OK ){ |
190606
|
0 |
0 |
if( rc==SQLITE_OK ){ |
190610
|
0 |
0 |
while( sqlite3_step(pAllLangid)==SQLITE_ROW ){ |
190613
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inIndex; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inIndex; i++){ |
190615
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
190622
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
190627
|
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; |
190644
|
1 |
0 |
if( rc==SQLITE_OK ){ |
190653
|
0 |
1 |
if( !zSql ){ |
190660
|
1 |
0 |
if( rc==SQLITE_OK ){ |
190663
|
0 |
1 |
if( aSz==0 ){ |
190672
|
11 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ |
|
10 |
1 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ |
190677
|
30 |
0 |
for(iCol=0; rc==SQLITE_OK && iColnColumn; iCol++){ |
|
20 |
10 |
for(iCol=0; rc==SQLITE_OK && iColnColumn; iCol++){ |
190678
|
20 |
0 |
if( p->abNotindexed[iCol]==0 ){ |
190684
|
10 |
0 |
if( p->bHasDocsize ){ |
190687
|
0 |
10 |
if( rc!=SQLITE_OK ){ |
190692
|
30 |
10 |
for(iCol=0; iCol<=p->nColumn; iCol++){ |
190697
|
1 |
0 |
if( p->bFts4 ){ |
190702
|
1 |
0 |
if( pStmt ){ |
190704
|
1 |
0 |
if( rc==SQLITE_OK ){ |
190735
|
0 |
0 |
if( pCsr->apSegment==0 ){ |
190741
|
0 |
0 |
if( rc==SQLITE_OK ){ |
190746
|
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
|
190758
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
190837
|
0 |
0 |
if( *pRc==SQLITE_OK && nMin>pBlob->nAlloc ){ |
|
0 |
0 |
if( *pRc==SQLITE_OK && nMin>pBlob->nAlloc ){ |
190840
|
0 |
0 |
if( a ){ |
190866
|
0 |
0 |
if( p->iChild && bFirst==0 ) p->iChild++; |
|
0 |
0 |
if( p->iChild && bFirst==0 ) p->iChild++; |
190867
|
0 |
0 |
if( p->iOff>=p->nNode ){ |
190871
|
0 |
0 |
if( bFirst==0 ){ |
190872
|
0 |
0 |
p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &nPrefix); |
190874
|
0 |
0 |
p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &nSuffix); |
190876
|
0 |
0 |
if( nPrefix>p->term.n || nSuffix>p->nNode-p->iOff || nSuffix==0 ){ |
|
0 |
0 |
if( nPrefix>p->term.n || nSuffix>p->nNode-p->iOff || nSuffix==0 ){ |
|
0 |
0 |
if( nPrefix>p->term.n || nSuffix>p->nNode-p->iOff || nSuffix==0 ){ |
190880
|
0 |
0 |
if( rc==SQLITE_OK && ALWAYS(p->term.a!=0) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && ALWAYS(p->term.a!=0) ){ |
190884
|
0 |
0 |
if( p->iChild==0 ){ |
190885
|
0 |
0 |
p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &p->nDoclist); |
190886
|
0 |
0 |
if( (p->nNode-p->iOff)nDoclist ){ |
190919
|
0 |
0 |
if( aNode && aNode[0] ){ |
|
0 |
0 |
if( aNode && aNode[0] ){ |
190926
|
0 |
0 |
return aNode ? nodeReaderNext(p) : SQLITE_OK; |
190949
|
0 |
0 |
for(iLayer=1; ALWAYS(iLayer
|
190963
|
0 |
0 |
if(nSuffix<=0 ) return FTS_CORRUPT_VTAB; |
190967
|
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 ){ |
190973
|
0 |
0 |
if( pBlk->n==0 ){ |
190975
|
0 |
0 |
if( rc==SQLITE_OK ){ |
190983
|
0 |
0 |
if( rc==SQLITE_OK ){ |
190984
|
0 |
0 |
if( pNode->key.n ){ |
191011
|
0 |
0 |
if( rc!=SQLITE_OK || iNextPtr==0 ) return rc; |
|
0 |
0 |
if( rc!=SQLITE_OK || iNextPtr==0 ) return rc; |
191062
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
191066
|
0 |
0 |
if( nSuffix<=0 ) return FTS_CORRUPT_VTAB; |
191070
|
0 |
0 |
if( bFirst==0 ){ |
191077
|
0 |
0 |
if( aDoclist ){ |
191112
|
0 |
0 |
if(nSuffix<=0 ) return FTS_CORRUPT_VTAB; |
191121
|
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 ){ |
191137
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191154
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191155
|
0 |
0 |
if( pLeaf->block.n==0 ){ |
191194
|
0 |
0 |
for(iRoot=FTS_MAX_APPENDABLE_HEIGHT-1; iRoot>=0; iRoot--){ |
191196
|
0 |
0 |
if( pNode->block.n>0 ) break; |
191204
|
0 |
0 |
if( iRoot<0 ) return; |
191221
|
0 |
0 |
if( iRoot==0 ){ |
191224
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191235
|
0 |
0 |
for(i=0; i
|
191237
|
0 |
0 |
if( pNode->block.n>0 && rc==SQLITE_OK ){ |
|
0 |
0 |
if( pNode->block.n>0 && rc==SQLITE_OK ){ |
191245
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191246
|
0 |
0 |
rc = fts3WriteSegdir(p, |
191277
|
0 |
0 |
if( nCmp && ALWAYS(zLhs) && ALWAYS(zRhs) ){ |
|
0 |
0 |
if( nCmp && ALWAYS(zLhs) && ALWAYS(zRhs) ){ |
|
0 |
0 |
if( nCmp && ALWAYS(zLhs) && ALWAYS(zRhs) ){ |
191282
|
0 |
0 |
if( res==0 ) res = nLhs - nRhs; |
191306
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191308
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pCheck) ) bRes = 1; |
191343
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191355
|
0 |
0 |
if( sqlite3_step(pSelect)==SQLITE_ROW ){ |
191359
|
0 |
0 |
if( pWriter->nLeafData<0 ){ |
191365
|
0 |
0 |
if( aRoot==0 ){ |
191367
|
0 |
0 |
return nRoot ? SQLITE_NOMEM : FTS_CORRUPT_VTAB; |
191377
|
0 |
0 |
if( rc==SQLITE_OK && bAppendable ){ |
|
0 |
0 |
if( rc==SQLITE_OK && bAppendable ){ |
191382
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191384
|
0 |
0 |
for(rc = nodeReaderInit(&reader, aLeaf, nLeaf); |
191385
|
0 |
0 |
rc==SQLITE_OK && reader.aNode; |
191390
|
0 |
0 |
if( fts3TermCmp(zKey, nKey, reader.term.a, reader.term.n)<=0 ){ |
191398
|
0 |
0 |
if( rc==SQLITE_OK && bAppendable ){ |
|
0 |
0 |
if( rc==SQLITE_OK && bAppendable ){ |
191404
|
0 |
0 |
if( nHeight<1 || nHeight>=FTS_MAX_APPENDABLE_HEIGHT ){ |
|
0 |
0 |
if( nHeight<1 || nHeight>=FTS_MAX_APPENDABLE_HEIGHT ){ |
191415
|
0 |
0 |
for(i=nHeight+1; i
|
191424
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191430
|
0 |
0 |
for(i=nHeight; i>=0 && rc==SQLITE_OK; i--){ |
|
0 |
0 |
for(i=nHeight; i>=0 && rc==SQLITE_OK; i--){ |
191434
|
0 |
0 |
if( pNode->block.a){ |
191436
|
0 |
0 |
while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader); |
|
0 |
0 |
while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader); |
191438
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191440
|
0 |
0 |
if( reader.term.n>0 ){ |
191444
|
0 |
0 |
if( i>0 ){ |
191453
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191467
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
191491
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191542
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191545
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pLeafEst) ){ |
191550
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
191554
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191555
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pFirstBlock) ){ |
191562
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
191568
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
191575
|
0 |
0 |
for(i=0; i
|
191601
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191629
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191632
|
0 |
0 |
while( SQLITE_ROW==sqlite3_step(pSelect) ){ |
191633
|
0 |
0 |
if( nIdx>=nAlloc ){ |
191637
|
0 |
0 |
if( !aNew ){ |
191646
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
191649
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191652
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191658
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
191659
|
0 |
0 |
if( aIdx[i]!=i ){ |
191674
|
0 |
0 |
if( iChild ){ |
191704
|
0 |
0 |
if( nNode<1 ) return FTS_CORRUPT_VTAB; |
191709
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
191713
|
0 |
0 |
for(rc = nodeReaderInit(&reader, aNode, nNode); |
191714
|
0 |
0 |
rc==SQLITE_OK && reader.aNode; |
191717
|
0 |
0 |
if( pNew->n==0 ){ |
191719
|
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; |
191727
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
191729
|
0 |
0 |
if( pNew->n==0 ){ |
191765
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191769
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pFetch) ){ |
191776
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
191779
|
0 |
0 |
while( rc==SQLITE_OK && iBlock ){ |
|
0 |
0 |
while( rc==SQLITE_OK && iBlock ){ |
191785
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191788
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191795
|
0 |
0 |
if( rc==SQLITE_OK && iNewStart ){ |
|
0 |
0 |
if( rc==SQLITE_OK && iNewStart ){ |
191798
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191806
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191809
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191845
|
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--){ |
191851
|
0 |
0 |
for(j=0; ALWAYS(jnSegment); j++){ |
191853
|
0 |
0 |
if( pSeg->iIdx==i ) break; |
191857
|
0 |
0 |
if( pSeg->aNode==0 ){ |
191860
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191875
|
0 |
0 |
if( rc==SQLITE_OK && nRem!=pCsr->nSegment ){ |
|
0 |
0 |
if( rc==SQLITE_OK && nRem!=pCsr->nSegment ){ |
191891
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191916
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191919
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pSelect) ){ |
191922
|
0 |
0 |
if( aHint ){ |
191924
|
0 |
0 |
if( rc==SQLITE_OK ){ |
191925
|
0 |
0 |
if( ALWAYS(pHint->a!=0) ) memcpy(pHint->a, aHint, nHint); |
191931
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
191953
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
191972
|
0 |
0 |
if( (pHint->a[i] & 0x80) ) return FTS_CORRUPT_VTAB; |
191973
|
0 |
0 |
while( i>0 && (pHint->a[i-1] & 0x80) ) i--; |
|
0 |
0 |
while( i>0 && (pHint->a[i-1] & 0x80) ) i--; |
191974
|
0 |
0 |
if( i==0 ) return FTS_CORRUPT_VTAB; |
191976
|
0 |
0 |
while( i>0 && (pHint->a[i-1] & 0x80) ) i--; |
|
0 |
0 |
while( i>0 && (pHint->a[i-1] & 0x80) ) i--; |
191980
|
0 |
0 |
i += fts3GetVarint32(&pHint->a[i], pnInput); |
191982
|
0 |
0 |
if( i!=nHint ) return FTS_CORRUPT_VTAB; |
192011
|
0 |
0 |
if( !pWriter ) return SQLITE_NOMEM; |
192016
|
0 |
0 |
while( rc==SQLITE_OK && nRem>0 ){ |
|
0 |
0 |
while( rc==SQLITE_OK && nRem>0 ){ |
192030
|
0 |
0 |
if( sqlite3_step(pFindLevel)==SQLITE_ROW ){ |
192044
|
0 |
0 |
if( rc==SQLITE_OK && hint.n ){ |
|
0 |
0 |
if( rc==SQLITE_OK && hint.n ){ |
192050
|
0 |
0 |
if( nSeg<0 || (iAbsLevel % nMod) >= (iHintAbsLevel % nMod) ){ |
|
0 |
0 |
if( nSeg<0 || (iAbsLevel % nMod) >= (iHintAbsLevel % nMod) ){ |
192071
|
0 |
0 |
if( nSeg<=0 ) break; |
192074
|
0 |
0 |
if( iAbsLevel<0 || iAbsLevel>(nMod<<32) ){ |
|
0 |
0 |
if( iAbsLevel<0 || iAbsLevel>(nMod<<32) ){ |
192088
|
0 |
0 |
if( rc==SQLITE_OK ){ |
192091
|
0 |
0 |
if( iIdx==0 || (bUseHint && iIdx==1) ){ |
|
0 |
0 |
if( iIdx==0 || (bUseHint && iIdx==1) ){ |
|
0 |
0 |
if( iIdx==0 || (bUseHint && iIdx==1) ){ |
192094
|
0 |
0 |
if( bIgnore ){ |
192100
|
0 |
0 |
if( rc==SQLITE_OK ){ |
192103
|
0 |
0 |
if( SQLITE_OK==rc && pCsr->nSegment==nSeg |
|
0 |
0 |
if( SQLITE_OK==rc && pCsr->nSegment==nSeg |
192104
|
0 |
0 |
&& SQLITE_OK==(rc = sqlite3Fts3SegReaderStart(p, pCsr, pFilter)) |
192108
|
0 |
0 |
if( rc==SQLITE_OK ){ |
192110
|
0 |
0 |
}else if( rc!=SQLITE_ROW ){ |
192114
|
0 |
0 |
if( bUseHint && iIdx>0 ){ |
|
0 |
0 |
if( bUseHint && iIdx>0 ){ |
192122
|
0 |
0 |
if( rc==SQLITE_OK && pWriter->nLeafEst ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pWriter->nLeafEst ){ |
192124
|
0 |
0 |
if( bEmpty==0 ){ |
192127
|
0 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts3SegReaderStep(p, pCsr); |
192128
|
0 |
0 |
if( pWriter->nWork>=nRem && rc==SQLITE_ROW ) rc = SQLITE_OK; |
|
0 |
0 |
if( pWriter->nWork>=nRem && rc==SQLITE_ROW ) rc = SQLITE_OK; |
192129
|
0 |
0 |
}while( rc==SQLITE_ROW ); |
192133
|
0 |
0 |
if( rc==SQLITE_OK ){ |
192136
|
0 |
0 |
if( nSeg!=0 ){ |
192143
|
0 |
0 |
if( nSeg!=0 ){ |
192147
|
0 |
0 |
if( nSeg==0 && pWriter->bNoLeafData==0 ){ |
|
0 |
0 |
if( nSeg==0 && pWriter->bNoLeafData==0 ){ |
192156
|
0 |
0 |
if( bDirtyHint && rc==SQLITE_OK ){ |
|
0 |
0 |
if( bDirtyHint && rc==SQLITE_OK ){ |
192176
|
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'; |
192204
|
0 |
0 |
if( z[0]==',' && z[1]!='\0' ){ |
|
0 |
0 |
if( z[0]==',' && z[1]!='\0' ){ |
192209
|
0 |
0 |
if( z[0]!='\0' || nMin<2 ){ |
|
0 |
0 |
if( z[0]!='\0' || nMin<2 ){ |
192213
|
0 |
0 |
if( !p->bHasStat ){ |
192217
|
0 |
0 |
if( rc==SQLITE_OK ){ |
192240
|
0 |
0 |
if( p->nAutoincrmerge==1 || p->nAutoincrmerge>MergeCount(p) ){ |
|
0 |
0 |
if( p->nAutoincrmerge==1 || p->nAutoincrmerge>MergeCount(p) ){ |
192243
|
0 |
0 |
if( !p->bHasStat ){ |
192246
|
0 |
0 |
if( rc ) return rc; |
192249
|
0 |
0 |
if( rc ) return rc; |
192277
|
0 |
0 |
for(i=0; i
|
192312
|
0 |
0 |
if( rc==SQLITE_OK ){ |
192316
|
0 |
0 |
if( rc==SQLITE_OK ){ |
192317
|
0 |
0 |
while( SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, &csr)) ){ |
192326
|
0 |
0 |
while( pCsr
|
192329
|
0 |
0 |
if( pCsr
|
192330
|
0 |
0 |
if( iVal==0 || iVal==1 ){ |
|
0 |
0 |
if( iVal==0 || iVal==1 ){ |
192333
|
0 |
0 |
if( iVal ){ |
192337
|
0 |
0 |
if( p->bDescIdx ){ |
192377
|
0 |
0 |
if( rc==SQLITE_OK ){ |
192381
|
0 |
0 |
while( rc==SQLITE_OK && sqlite3_step(pAllLangid)==SQLITE_ROW ){ |
|
0 |
0 |
while( rc==SQLITE_OK && sqlite3_step(pAllLangid)==SQLITE_ROW ){ |
192384
|
0 |
0 |
for(i=0; inIndex; i++){ |
192389
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
192393
|
0 |
0 |
if( rc==SQLITE_OK ){ |
192399
|
0 |
0 |
if( !zSql ){ |
192406
|
0 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ |
|
0 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ |
192411
|
0 |
0 |
for(iCol=0; rc==SQLITE_OK && iColnColumn; iCol++){ |
|
0 |
0 |
for(iCol=0; rc==SQLITE_OK && iColnColumn; iCol++){ |
192412
|
0 |
0 |
if( p->abNotindexed[iCol]==0 ){ |
192417
|
0 |
0 |
while( rc==SQLITE_OK ){ |
192424
|
0 |
0 |
if( rc==SQLITE_OK ){ |
192429
|
0 |
0 |
for(i=1; inIndex; i++){ |
192430
|
0 |
0 |
if( p->aIndex[i].nPrefix<=nToken ){ |
192438
|
0 |
0 |
if( pT ) pModule->xClose(pT); |
192439
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
192488
|
0 |
0 |
if( rc==SQLITE_OK && bOk==0 ) rc = FTS_CORRUPT_VTAB; |
|
0 |
0 |
if( rc==SQLITE_OK && bOk==0 ) rc = FTS_CORRUPT_VTAB; |
192505
|
0 |
1 |
if( !zVal ){ |
192507
|
0 |
1 |
}else if( nVal==8 && 0==sqlite3_strnicmp(zVal, "optimize", 8) ){ |
|
0 |
0 |
}else if( nVal==8 && 0==sqlite3_strnicmp(zVal, "optimize", 8) ){ |
192509
|
1 |
0 |
}else if( nVal==7 && 0==sqlite3_strnicmp(zVal, "rebuild", 7) ){ |
|
1 |
0 |
}else if( nVal==7 && 0==sqlite3_strnicmp(zVal, "rebuild", 7) ){ |
192511
|
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) ){ |
192513
|
0 |
0 |
}else if( nVal>6 && 0==sqlite3_strnicmp(zVal, "merge=", 6) ){ |
|
0 |
0 |
}else if( nVal>6 && 0==sqlite3_strnicmp(zVal, "merge=", 6) ){ |
192515
|
0 |
0 |
}else if( nVal>10 && 0==sqlite3_strnicmp(zVal, "automerge=", 10) ){ |
|
0 |
0 |
}else if( nVal>10 && 0==sqlite3_strnicmp(zVal, "automerge=", 10) ){ |
192548
|
0 |
114 |
for(pDef=pCsr->pDeferred; pDef; pDef=pDef->pNext){ |
192561
|
0 |
189 |
for(pDef=pCsr->pDeferred; pDef; pDef=pNext){ |
192579
|
0 |
0 |
if( pCsr->pDeferred ){ |
192591
|
0 |
0 |
for(i=0; inColumn && rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; inColumn && rc==SQLITE_OK; i++){ |
192592
|
0 |
0 |
if( p->abNotindexed[i]==0 ){ |
192597
|
0 |
0 |
while( rc==SQLITE_OK ){ |
192604
|
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){ |
192606
|
0 |
0 |
if( (pDef->iCol>=p->nColumn || pDef->iCol==i) |
|
0 |
0 |
if( (pDef->iCol>=p->nColumn || pDef->iCol==i) |
192607
|
0 |
0 |
&& (pPT->bFirst==0 || iPos==0) |
|
0 |
0 |
&& (pPT->bFirst==0 || iPos==0) |
192608
|
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
|
192609
|
0 |
0 |
&& (0==memcmp(zToken, pPT->z, pPT->n)) |
192615
|
0 |
0 |
if( pTC ) pModule->xClose(pTC); |
192616
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
192620
|
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){ |
192621
|
0 |
0 |
if( pDef->pList ){ |
192642
|
0 |
0 |
if( p->pList==0 ){ |
192647
|
0 |
0 |
if( !pRet ) return SQLITE_NOMEM; |
192667
|
0 |
0 |
if( !pDeferred ){ |
192698
|
1 |
0 |
if( bFound && rc==SQLITE_OK ){ |
|
1 |
0 |
if( bFound && rc==SQLITE_OK ){ |
192701
|
1 |
0 |
if( rc==SQLITE_OK ){ |
192702
|
0 |
1 |
if( isEmpty ){ |
192711
|
0 |
1 |
if( p->zContentTbl==0 ){ |
192714
|
1 |
0 |
if( p->bHasDocsize ){ |
192764
|
37 |
1 |
if( nArg>1 |
192765
|
37 |
0 |
&& sqlite3_value_type(apVal[0])==SQLITE_NULL |
192766
|
1 |
36 |
&& sqlite3_value_type(apVal[p->nColumn+2])!=SQLITE_NULL |
192772
|
36 |
1 |
if( nArg>1 && sqlite3_value_int(apVal[2 + p->nColumn + 2])<0 ){ |
|
0 |
36 |
if( nArg>1 && sqlite3_value_int(apVal[2 + p->nColumn + 2])<0 ){ |
192779
|
0 |
37 |
if( aSzDel==0 ){ |
192787
|
0 |
37 |
if( rc!=SQLITE_OK ) goto update_out; |
192798
|
36 |
1 |
if( nArg>1 && p->zContentTbl==0 ){ |
|
33 |
3 |
if( nArg>1 && p->zContentTbl==0 ){ |
192801
|
33 |
0 |
if( sqlite3_value_type(pNewRowid)==SQLITE_NULL ){ |
192807
|
0 |
0 |
|| sqlite3_value_int64(apVal[0])!=sqlite3_value_int64(pNewRowid) |
192826
|
0 |
0 |
if( sqlite3_vtab_on_conflict(p->db)==SQLITE_REPLACE ){ |
192834
|
0 |
37 |
if( rc!=SQLITE_OK ){ |
192839
|
1 |
36 |
if( sqlite3_value_type(apVal[0])!=SQLITE_NULL ){ |
192845
|
36 |
1 |
if( nArg>1 && rc==SQLITE_OK ){ |
|
36 |
0 |
if( nArg>1 && rc==SQLITE_OK ){ |
192847
|
36 |
0 |
if( bInsertDone==0 ){ |
192849
|
0 |
36 |
if( rc==SQLITE_CONSTRAINT && p->zContentTbl==0 ){ |
|
0 |
0 |
if( rc==SQLITE_CONSTRAINT && p->zContentTbl==0 ){ |
192853
|
36 |
0 |
if( rc==SQLITE_OK ){ |
192856
|
36 |
0 |
if( rc==SQLITE_OK ){ |
192860
|
20 |
16 |
if( p->bHasDocsize ){ |
192866
|
21 |
16 |
if( p->bFts4 ){ |
192884
|
0 |
0 |
if( rc==SQLITE_OK ){ |
192886
|
0 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_DONE ){ |
|
0 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_DONE ){ |
192888
|
0 |
0 |
if( rc2!=SQLITE_OK ) rc = rc2; |
193043
|
0 |
0 |
if( pRet ){ |
193062
|
0 |
0 |
if( (u32*)p==&pBuf->aMatchinfo[1] ){ |
193068
|
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 ){ |
193077
|
0 |
0 |
if( p->aRef[1]==0 ){ |
193082
|
0 |
0 |
else if( p->aRef[2]==0 ){ |
193088
|
0 |
0 |
if( aOut ){ |
193090
|
0 |
0 |
if( p->bGlobal ) memcpy(aOut, &p->aMatchinfo[1], p->nElem*sizeof(u32)); |
193107
|
0 |
189 |
if( p ){ |
193110
|
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 ){ |
193143
|
48 |
16 |
*pp += fts3GetVarint32(*pp, &iVal); |
193159
|
0 |
32 |
if( eType!=FTSQUERY_PHRASE ){ |
193162
|
0 |
0 |
if( rc==SQLITE_OK && eType!=FTSQUERY_NOT ){ |
|
0 |
0 |
if( rc==SQLITE_OK && eType!=FTSQUERY_NOT ){ |
193229
|
12 |
4 |
if( pnPhrase ) *pnPhrase = sCtx.nPhrase; |
193230
|
4 |
12 |
if( pnToken ) *pnToken = sCtx.nToken; |
193252
|
44 |
0 |
if( pIter ){ |
193255
|
44 |
32 |
while( iIter
|
193256
|
12 |
32 |
if( 0==(*pIter & 0xFE) ){ |
193275
|
12 |
28 |
if( pIter->iCurrent<0 ){ |
193285
|
12 |
12 |
for(i=0; inPhrase; i++){ |
193293
|
28 |
28 |
for(i=0; inPhrase; i++){ |
193295
|
16 |
12 |
if( pPhrase->pHead && pPhrase->iHead
|
|
16 |
0 |
if( pPhrase->pHead && pPhrase->iHead
|
193299
|
12 |
16 |
if( iEnd==0x7FFFFFFF ){ |
193304
|
16 |
16 |
for(i=0; inPhrase; i++){ |
193332
|
28 |
28 |
for(i=0; inPhrase; i++){ |
193334
|
28 |
0 |
if( pPhrase->pTail ){ |
193338
|
28 |
16 |
while( iCsr<(iStart+pIter->nSnippet) && iCsr>=iStart ){ |
|
28 |
0 |
while( iCsr<(iStart+pIter->nSnippet) && iCsr>=iStart ){ |
193344
|
0 |
28 |
if( (mCover|mCovered)&mPhrase ){ |
193351
|
76 |
28 |
for(j=0; jnToken; j++){ |
193355
|
12 |
16 |
if( 0==(*pCsr & 0x0FE) ) break; |
193381
|
12 |
0 |
if( pCsr ){ |
193385
|
0 |
12 |
if( iFirst<0 ){ |
193439
|
0 |
12 |
if( rc!=SQLITE_OK ){ |
193448
|
0 |
12 |
if( !sIter.aPhrase ){ |
193461
|
12 |
0 |
if( rc==SQLITE_OK ){ |
193464
|
12 |
12 |
for(i=0; i
|
193465
|
12 |
0 |
if( sIter.aPhrase[i].pHead ){ |
193474
|
28 |
12 |
while( !fts3SnippetNextCandidate(&sIter) ){ |
193481
|
12 |
16 |
if( iScore>iBestScore ){ |
193507
|
72 |
260 |
if( nAppend<0 ){ |
193515
|
24 |
308 |
if( pStr->n+nAppend+1>=pStr->nAlloc ){ |
193518
|
0 |
24 |
if( !zNew ){ |
193565
|
12 |
0 |
if( hlmask ){ |
193570
|
20 |
12 |
for(nLeft=0; !(hlmask & ((u64)1 << nLeft)); nLeft++); |
193571
|
132 |
12 |
for(nRight=0; !(hlmask & ((u64)1 << (nSnippet-1-nRight))); nRight++); |
193582
|
0 |
12 |
if( nDesired>0 ){ |
193594
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
193597
|
0 |
0 |
while( rc==SQLITE_OK && iCurrent<(nSnippet+nDesired) ){ |
|
0 |
0 |
while( rc==SQLITE_OK && iCurrent<(nSnippet+nDesired) ){ |
193602
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_DONE ){ return rc; } |
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_DONE ){ return rc; } |
193606
|
0 |
0 |
if( nShift>0 ){ |
193644
|
0 |
12 |
if( zDoc==0 ){ |
193645
|
0 |
0 |
if( sqlite3_column_type(pCsr->pStmt, iCol)!=SQLITE_NULL ){ |
193655
|
0 |
12 |
if( rc!=SQLITE_OK ){ |
193659
|
148 |
0 |
while( rc==SQLITE_OK ){ |
193678
|
4 |
144 |
if( rc!=SQLITE_OK ){ |
193679
|
4 |
0 |
if( rc==SQLITE_DONE ){ |
193688
|
0 |
144 |
if( iCurrent
|
193690
|
12 |
132 |
if( !isShiftDone ){ |
193701
|
12 |
0 |
if( rc==SQLITE_OK ){ |
193702
|
12 |
0 |
if( iPos>0 || iFragment>0 ){ |
|
0 |
12 |
if( iPos>0 || iFragment>0 ){ |
193704
|
0 |
12 |
}else if( iBegin ){ |
193708
|
12 |
0 |
if( rc!=SQLITE_OK || iCurrent
|
|
0 |
12 |
if( rc!=SQLITE_OK || iCurrent
|
193711
|
8 |
136 |
if( iCurrent>=(iPos+nSnippet) ){ |
193712
|
8 |
0 |
if( isLast ){ |
193721
|
124 |
12 |
if( iCurrent>iPos ) rc = fts3StringAppend(pOut, &zDoc[iEnd], iBegin-iEnd); |
193722
|
136 |
0 |
if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zOpen, -1); |
|
28 |
108 |
if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zOpen, -1); |
193723
|
136 |
0 |
if( rc==SQLITE_OK ) rc = fts3StringAppend(pOut, &zDoc[iBegin], iFin-iBegin); |
193724
|
136 |
0 |
if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zClose, -1); |
|
28 |
108 |
if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zClose, -1); |
193753
|
0 |
0 |
while( 0xFE & (*pEnd | c) ){ |
193755
|
0 |
0 |
if( !c ) nEntry++; |
193776
|
0 |
0 |
if( p->flag==FTS3_MATCHINFO_LHITS ){ |
193782
|
0 |
0 |
if( pIter ) while( 1 ){ |
193784
|
0 |
0 |
if( (pPhrase->iColumn>=pTab->nColumn || pPhrase->iColumn==iCol) ){ |
|
0 |
0 |
if( (pPhrase->iColumn>=pTab->nColumn || pPhrase->iColumn==iCol) ){ |
193785
|
0 |
0 |
if( p->flag==FTS3_MATCHINFO_LHITS ){ |
193787
|
0 |
0 |
}else if( nHit ){ |
193792
|
0 |
0 |
if( *pIter!=0x01 ) break; |
193794
|
0 |
0 |
pIter += fts3GetVarint32(pIter, &iCol); |
193795
|
0 |
0 |
if( iCol>=p->nCol ) return FTS_CORRUPT_VTAB; |
193809
|
0 |
0 |
if( pExpr->bEof==0 && pExpr->iDocid==p->pCursor->iPrevId ){ |
|
0 |
0 |
if( pExpr->bEof==0 && pExpr->iDocid==p->pCursor->iPrevId ){ |
193810
|
0 |
0 |
if( pExpr->pLeft ){ |
193812
|
0 |
0 |
if( rc==SQLITE_OK ) rc = fts3ExprLHitGather(pExpr->pRight, p); |
193873
|
0 |
0 |
for(i=0; inCol && rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; inCol && rc==SQLITE_OK; i++){ |
193876
|
0 |
0 |
if( pCsr ){ |
193891
|
0 |
0 |
if( (cArg==FTS3_MATCHINFO_NPHRASE) |
193892
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_NCOL) |
193893
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_NDOC && pTab->bFts4) |
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_NDOC && pTab->bFts4) |
193894
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_AVGLENGTH && pTab->bFts4) |
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_AVGLENGTH && pTab->bFts4) |
193895
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LENGTH && pTab->bHasDocsize) |
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LENGTH && pTab->bHasDocsize) |
193896
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LCS) |
193897
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_HITS) |
193898
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LHITS) |
193899
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LHITS_BM) |
193954
|
0 |
0 |
if( !*ppStmt ){ |
193956
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
193963
|
0 |
0 |
if( a==0 ){ |
193968
|
0 |
0 |
if( nDoc<=0 || a>pEnd ){ |
|
0 |
0 |
if( nDoc<=0 || a>pEnd ){ |
193973
|
0 |
0 |
if( paLen ) *paLen = a; |
193974
|
0 |
0 |
if( ppEnd ) *ppEnd = pEnd; |
194018
|
0 |
0 |
if( NEVER(pIter==0) ) return 1; |
194021
|
0 |
0 |
if( iRead==0 || iRead==1 ){ |
|
0 |
0 |
if( iRead==0 || iRead==1 ){ |
194054
|
0 |
0 |
if( !aIter ) return SQLITE_NOMEM; |
194057
|
0 |
0 |
for(i=0; inPhrase; i++){ |
194063
|
0 |
0 |
for(iCol=0; iColnCol; iCol++){ |
194067
|
0 |
0 |
for(i=0; inPhrase; i++){ |
194070
|
0 |
0 |
if( rc!=SQLITE_OK ) goto matchinfo_lcs_out; |
194071
|
0 |
0 |
if( pIt->pRead ){ |
194074
|
0 |
0 |
if( pIt->pRead==0 ){ |
194082
|
0 |
0 |
while( nLive>0 ){ |
194086
|
0 |
0 |
for(i=0; inPhrase; i++){ |
194088
|
0 |
0 |
if( pIter->pRead==0 ){ |
194092
|
0 |
0 |
if( pAdv==0 || pIter->iPosiPos ){ |
|
0 |
0 |
if( pAdv==0 || pIter->iPosiPos ){ |
194095
|
0 |
0 |
if( nThisLcs==0 || pIter->iPos==pIter[-1].iPos ){ |
|
0 |
0 |
if( nThisLcs==0 || pIter->iPos==pIter[-1].iPos ){ |
194100
|
0 |
0 |
if( nThisLcs>nLcs ) nLcs = nThisLcs; |
194103
|
0 |
0 |
if( fts3LcsIteratorAdvance(pAdv) ) nLive--; |
194142
|
0 |
0 |
for(i=0; rc==SQLITE_OK && zArg[i]; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && zArg[i]; i++){ |
194146
|
0 |
0 |
if( bGlobal ) pInfo->aMatchinfo[0] = pInfo->nPhrase; |
194150
|
0 |
0 |
if( bGlobal ) pInfo->aMatchinfo[0] = pInfo->nCol; |
194154
|
0 |
0 |
if( bGlobal ){ |
194162
|
0 |
0 |
if( bGlobal ){ |
194168
|
0 |
0 |
if( rc==SQLITE_OK ){ |
194170
|
0 |
0 |
for(iCol=0; iColnCol; iCol++){ |
194174
|
0 |
0 |
if( a>pEnd ){ |
194188
|
0 |
0 |
if( rc==SQLITE_OK ){ |
194192
|
0 |
0 |
for(iCol=0; iColnCol; iCol++){ |
194195
|
0 |
0 |
if( a>pEnd ){ |
194208
|
0 |
0 |
if( rc==SQLITE_OK ){ |
194226
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
194227
|
0 |
0 |
if( bGlobal ){ |
194228
|
0 |
0 |
if( pCsr->pDeferred ){ |
194230
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
194234
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
194273
|
0 |
0 |
if( pCsr->pMIBuffer && strcmp(pCsr->pMIBuffer->zMatchinfo, zArg) ){ |
|
0 |
0 |
if( pCsr->pMIBuffer && strcmp(pCsr->pMIBuffer->zMatchinfo, zArg) ){ |
194283
|
0 |
0 |
if( pCsr->pMIBuffer==0 ){ |
194292
|
0 |
0 |
for(i=0; zArg[i]; i++){ |
194294
|
0 |
0 |
if( fts3MatchinfoCheck(pTab, zArg[i], &zErr) ){ |
194304
|
0 |
0 |
if( !pCsr->pMIBuffer ) rc = SQLITE_NOMEM; |
194310
|
0 |
0 |
if( rc==SQLITE_OK ){ |
194312
|
0 |
0 |
if( xDestroyOut==0 ){ |
194317
|
0 |
0 |
if( rc==SQLITE_OK ){ |
194321
|
0 |
0 |
if( bGlobal ){ |
194326
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
194328
|
0 |
0 |
if( xDestroyOut ) xDestroyOut(aOut); |
194364
|
0 |
12 |
if( !pCsr->pExpr ){ |
194370
|
0 |
12 |
if( nToken<-64 ) nToken = -64; |
194371
|
0 |
12 |
if( nToken>+64 ) nToken = +64; |
194379
|
12 |
0 |
if( nToken>=0 ){ |
194385
|
12 |
12 |
for(iSnip=0; iSnip
|
194396
|
12 |
12 |
for(iRead=0; iReadnColumn; iRead++){ |
194399
|
0 |
12 |
if( iCol>=0 && iRead!=iCol ) continue; |
|
0 |
0 |
if( iCol>=0 && iRead!=iCol ) continue; |
194403
|
0 |
12 |
if( rc!=SQLITE_OK ){ |
194406
|
12 |
0 |
if( iS>iBestScore ){ |
194419
|
0 |
12 |
if( mSeen==mCovered || nSnippet==SizeofArray(aSnippet) ) break; |
|
0 |
0 |
if( mSeen==mCovered || nSnippet==SizeofArray(aSnippet) ) break; |
194424
|
12 |
12 |
for(i=0; i
|
|
12 |
0 |
for(i=0; i
|
194432
|
0 |
12 |
if( rc!=SQLITE_OK ){ |
194472
|
4 |
0 |
if( pList ){ |
194477
|
4 |
4 |
for(iTerm=0; iTerm
|
194502
|
0 |
4 |
if( !pCsr->pExpr ){ |
194512
|
0 |
4 |
if( rc!=SQLITE_OK ) goto offsets_out; |
194516
|
0 |
4 |
if( 0==sCtx.aTerm ){ |
194526
|
4 |
4 |
for(iCol=0; iColnColumn; iCol++){ |
194542
|
0 |
4 |
if( rc!=SQLITE_OK ) goto offsets_out; |
194552
|
0 |
4 |
if( zDoc==0 ){ |
194553
|
0 |
0 |
if( sqlite3_column_type(pCsr->pStmt, iCol+1)==SQLITE_NULL ){ |
194564
|
0 |
4 |
if( rc!=SQLITE_OK ) goto offsets_out; |
194567
|
8 |
4 |
while( rc==SQLITE_OK ){ |
194572
|
8 |
8 |
for(i=0; i
|
194574
|
4 |
4 |
if( pT->pList && (pT->iPos-pT->iOff)
|
|
4 |
0 |
if( pT->pList && (pT->iPos-pT->iOff)
|
194580
|
4 |
4 |
if( !pTerm ){ |
194585
|
4 |
0 |
if( 0==(0xFE&*pTerm->pList) ){ |
194590
|
12 |
0 |
while( rc==SQLITE_OK && iCurrent
|
|
8 |
4 |
while( rc==SQLITE_OK && iCurrent
|
194593
|
4 |
0 |
if( rc==SQLITE_OK ){ |
194599
|
0 |
0 |
}else if( rc==SQLITE_DONE && pTab->zContentTbl==0 ){ |
|
0 |
0 |
}else if( rc==SQLITE_DONE && pTab->zContentTbl==0 ){ |
194604
|
4 |
0 |
if( rc==SQLITE_DONE ){ |
194609
|
0 |
4 |
if( rc!=SQLITE_OK ) goto offsets_out; |
194616
|
0 |
4 |
if( rc!=SQLITE_OK ){ |
194636
|
0 |
0 |
if( zArg ){ |
194642
|
0 |
0 |
if( !pCsr->pExpr ){ |
194760
|
0 |
0 |
if( pTokenizer ){ |
194799
|
0 |
0 |
while( z
|
194800
|
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); |
194802
|
0 |
0 |
if( sqlite3FtsUnicodeIsalnum((int)iCode)!=bAlnum |
194803
|
0 |
0 |
&& sqlite3FtsUnicodeIsdiacritic((int)iCode)==0 |
194809
|
0 |
0 |
if( nEntry ){ |
194814
|
0 |
0 |
if( aNew==0 ) return SQLITE_NOMEM; |
194818
|
0 |
0 |
while( z
|
194819
|
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); |
194820
|
0 |
0 |
if( sqlite3FtsUnicodeIsalnum((int)iCode)!=bAlnum |
194821
|
0 |
0 |
&& sqlite3FtsUnicodeIsdiacritic((int)iCode)==0 |
194824
|
0 |
0 |
for(i=0; i
|
|
0 |
0 |
for(i=0; i
|
194825
|
0 |
0 |
for(j=nNew; j>i; j--) aNew[j] = aNew[j-1]; |
194841
|
0 |
0 |
if( p->nException>0 ){ |
194846
|
0 |
0 |
while( iHi>=iLo ){ |
194848
|
0 |
0 |
if( iCode==a[iTest] ){ |
194850
|
0 |
0 |
}else if( iCode>a[iTest] ){ |
194883
|
0 |
0 |
if( pNew==NULL ) return SQLITE_NOMEM; |
194887
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
194891
|
0 |
0 |
if( n==19 && memcmp("remove_diacritics=1", z, 19)==0 ){ |
|
0 |
0 |
if( n==19 && memcmp("remove_diacritics=1", z, 19)==0 ){ |
194894
|
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 ){ |
194897
|
0 |
0 |
else if( n==19 && memcmp("remove_diacritics=2", z, 19)==0 ){ |
|
0 |
0 |
else if( n==19 && memcmp("remove_diacritics=2", z, 19)==0 ){ |
194900
|
0 |
0 |
else if( n>=11 && memcmp("tokenchars=", z, 11)==0 ){ |
|
0 |
0 |
else if( n>=11 && memcmp("tokenchars=", z, 11)==0 ){ |
194903
|
0 |
0 |
else if( n>=11 && memcmp("separators=", z, 11)==0 ){ |
|
0 |
0 |
else if( n>=11 && memcmp("separators=", z, 11)==0 ){ |
194912
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
194935
|
0 |
0 |
if( pCsr==0 ){ |
194941
|
0 |
0 |
if( aInput==0 ){ |
194944
|
0 |
0 |
}else if( nInput<0 ){ |
194990
|
0 |
0 |
while( z
|
194991
|
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); |
194992
|
0 |
0 |
if( unicodeIsAlnum(p, (int)iCode) ) break; |
194995
|
0 |
0 |
if( zStart>=zTerm ) return SQLITE_DONE; |
195002
|
0 |
0 |
if( (zOut-pCsr->zToken)>=(pCsr->nAlloc-4) ){ |
195004
|
0 |
0 |
if( !zNew ) return SQLITE_NOMEM; |
195013
|
0 |
0 |
if( iOut ){ |
195014
|
0 |
0 |
WRITE_UTF8(zOut, iOut); |
|
0 |
0 |
WRITE_UTF8(zOut, iOut); |
|
0 |
0 |
WRITE_UTF8(zOut, iOut); |
195018
|
0 |
0 |
if( z>=zTerm ) break; |
195019
|
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); |
195021
|
0 |
0 |
|| sqlite3FtsUnicodeIsdiacritic((int)iCode) |
195022
|
0 |
0 |
); |
195185
|
0 |
0 |
if( (unsigned int)c<128 ){ |
195187
|
0 |
0 |
}else if( (unsigned int)c<(1<<22) ){ |
195192
|
0 |
0 |
while( iHi>=iLo ){ |
195194
|
0 |
0 |
if( key >= aEntry[iTest] ){ |
195265
|
0 |
0 |
while( iHi>=iLo ){ |
195267
|
0 |
0 |
if( key >= aDia[iTest] ){ |
195275
|
0 |
0 |
if( bComplex==0 && (aChar[iRes] & 0x80) ) return c; |
|
0 |
0 |
if( bComplex==0 && (aChar[iRes] & 0x80) ) return c; |
195276
|
0 |
0 |
return (c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : ((int)aChar[iRes] & 0x7F); |
195287
|
0 |
0 |
if( c<768 || c>817 ) return 0; |
|
0 |
0 |
if( c<768 || c>817 ) return 0; |
195288
|
0 |
0 |
return (c < 768+32) ? |
195399
|
0 |
0 |
if( c<128 ){ |
195400
|
0 |
0 |
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
|
0 |
0 |
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
195401
|
0 |
0 |
}else if( c<65536 ){ |
195408
|
0 |
0 |
while( iHi>=iLo ){ |
195411
|
0 |
0 |
if( cmp>=0 ){ |
195421
|
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)) ){ |
195426
|
0 |
0 |
if( eRemoveDiacritic ){ |
195431
|
0 |
0 |
else if( c>=66560 && c<66600 ){ |
|
0 |
0 |
else if( c>=66560 && c<66600 ){ |
195616
|
0 |
0 |
if( !p->bStatic ) sqlite3_free(p->zBuf); |
195633
|
0 |
0 |
u64 nTotal = NnAlloc ? p->nAlloc*2 : p->nAlloc+N+10; |
195635
|
0 |
0 |
if( p->bStatic ){ |
195636
|
0 |
0 |
if( p->bErr ) return 1; |
195638
|
0 |
0 |
if( zNew==0 ){ |
195647
|
0 |
0 |
if( zNew==0 ){ |
195660
|
0 |
0 |
if( N==0 ) return; |
195661
|
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; |
195670
|
0 |
0 |
if( (p->nUsed + N >= p->nAlloc) && jsonGrow(p, N) ) return; |
|
0 |
0 |
if( (p->nUsed + N >= p->nAlloc) && jsonGrow(p, N) ) return; |
195680
|
0 |
0 |
if( p->nUsed>=p->nAlloc && jsonGrow(p,1)!=0 ) return; |
|
0 |
0 |
if( p->nUsed>=p->nAlloc && jsonGrow(p,1)!=0 ) return; |
195689
|
0 |
0 |
if( p->nUsed==0 ) return; |
195691
|
0 |
0 |
if( c!='[' && c!='{' ) jsonAppendChar(p, ','); |
|
0 |
0 |
if( c!='[' && c!='{' ) jsonAppendChar(p, ','); |
195701
|
0 |
0 |
if( zIn==0 || ((N+p->nUsed+2 >= p->nAlloc) && jsonGrow(p,N+2)!=0) ) return; |
|
0 |
0 |
if( zIn==0 || ((N+p->nUsed+2 >= p->nAlloc) && jsonGrow(p,N+2)!=0) ) return; |
|
0 |
0 |
if( zIn==0 || ((N+p->nUsed+2 >= p->nAlloc) && jsonGrow(p,N+2)!=0) ) return; |
195703
|
0 |
0 |
for(i=0; i
|
195705
|
0 |
0 |
if( c=='"' || c=='\\' ){ |
|
0 |
0 |
if( c=='"' || c=='\\' ){ |
195707
|
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; |
195709
|
0 |
0 |
}else if( c<=0x1f ){ |
195720
|
0 |
0 |
if( aSpecial[c] ){ |
195724
|
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; |
195761
|
0 |
0 |
if( sqlite3_value_subtype(pValue)==JSON_SUBTYPE ){ |
195769
|
0 |
0 |
if( p->bErr==0 ){ |
195783
|
0 |
0 |
if( p->bErr==0 ){ |
195784
|
0 |
0 |
sqlite3_result_text64(p->pCtx, p->zBuf, p->nUsed, |
195806
|
0 |
0 |
return pNode->eType>=JSON_ARRAY ? pNode->n+1 : 1; |
195841
|
0 |
0 |
if( pNode->jnFlags & (JNODE_REPLACE|JNODE_PATCH) ){ |
195842
|
0 |
0 |
if( (pNode->jnFlags & JNODE_REPLACE)!=0 && ALWAYS(aReplace!=0) ){ |
|
0 |
0 |
if( (pNode->jnFlags & JNODE_REPLACE)!=0 && ALWAYS(aReplace!=0) ){ |
195865
|
0 |
0 |
if( pNode->jnFlags & JNODE_RAW ){ |
195882
|
0 |
0 |
while( j<=pNode->n ){ |
195883
|
0 |
0 |
if( (pNode[j].jnFlags & JNODE_REMOVE)==0 ){ |
195889
|
0 |
0 |
if( (pNode->jnFlags & JNODE_APPEND)==0 ) break; |
195901
|
0 |
0 |
while( j<=pNode->n ){ |
195902
|
0 |
0 |
if( (pNode[j+1].jnFlags & JNODE_REMOVE)==0 ){ |
195910
|
0 |
0 |
if( (pNode->jnFlags & JNODE_APPEND)==0 ) break; |
195994
|
0 |
0 |
if( z[0]=='-' ){ z++; } |
195995
|
0 |
0 |
while( z[0]>='0' && z[0]<='9' ){ |
|
0 |
0 |
while( z[0]>='0' && z[0]<='9' ){ |
195997
|
0 |
0 |
if( i>=LARGEST_INT64/10 ){ |
195998
|
0 |
0 |
if( i>LARGEST_INT64/10 ) goto int_as_real; |
195999
|
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; |
196000
|
0 |
0 |
if( v==9 ) goto int_as_real; |
196001
|
0 |
0 |
if( v==8 ){ |
196002
|
0 |
0 |
if( pNode->u.zJContent[0]=='-' ){ |
196012
|
0 |
0 |
if( pNode->u.zJContent[0]=='-' ){ i = -i; } |
196043
|
0 |
0 |
if( (pNode->jnFlags & JNODE_ESCAPE)==0 ){ |
196058
|
0 |
0 |
if( zOut==0 ){ |
196062
|
0 |
0 |
for(i=1, j=0; i
|
196064
|
0 |
0 |
if( c!='\\' ){ |
196068
|
0 |
0 |
if( c=='u' ){ |
196071
|
0 |
0 |
if( v==0 ) break; |
196072
|
0 |
0 |
if( v<=0x7f ){ |
196074
|
0 |
0 |
}else if( v<=0x7ff ){ |
196079
|
0 |
0 |
if( (v&0xfc00)==0xd800 |
196080
|
0 |
0 |
&& i
|
196081
|
0 |
0 |
&& z[i+1]=='\\' |
196082
|
0 |
0 |
&& z[i+2]=='u' |
196083
|
0 |
0 |
&& ((vlo = jsonHexToInt4(z+i+3))&0xfc00)==0xdc00 |
196099
|
0 |
0 |
if( c=='b' ){ |
196101
|
0 |
0 |
}else if( c=='f' ){ |
196103
|
0 |
0 |
}else if( c=='n' ){ |
196105
|
0 |
0 |
}else if( c=='r' ){ |
196107
|
0 |
0 |
}else if( c=='t' ){ |
196152
|
0 |
0 |
if( pParse->oom ) return -1; |
196155
|
0 |
0 |
if( pNew==0 ){ |
196177
|
0 |
0 |
if( pParse->aNode==0 || pParse->nNode>=pParse->nAlloc ){ |
|
0 |
0 |
if( pParse->aNode==0 || pParse->nNode>=pParse->nAlloc ){ |
196194
|
0 |
0 |
for(i=0; i<4; i++) if( !sqlite3Isxdigit(z[i]) ) return 0; |
|
0 |
0 |
for(i=0; i<4; i++) if( !sqlite3Isxdigit(z[i]) ) return 0; |
196213
|
0 |
0 |
while( fast_isspace(z[i]) ){ i++; } |
196214
|
0 |
0 |
if( (c = z[i])=='{' ){ |
196217
|
0 |
0 |
if( iThis<0 ) return -1; |
196219
|
0 |
0 |
while( fast_isspace(z[j]) ){ j++; } |
196220
|
0 |
0 |
if( ++pParse->iDepth > JSON_MAX_DEPTH ) return -1; |
196222
|
0 |
0 |
if( x<0 ){ |
196224
|
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; |
196227
|
0 |
0 |
if( pParse->oom ) return -1; |
196229
|
0 |
0 |
if( pNode->eType!=JSON_STRING ) return -1; |
196232
|
0 |
0 |
while( fast_isspace(z[j]) ){ j++; } |
196233
|
0 |
0 |
if( z[j]!=':' ) return -1; |
196237
|
0 |
0 |
if( x<0 ) return -1; |
196239
|
0 |
0 |
while( fast_isspace(z[j]) ){ j++; } |
196241
|
0 |
0 |
if( c==',' ) continue; |
196242
|
0 |
0 |
if( c!='}' ) return -1; |
196247
|
0 |
0 |
}else if( c=='[' ){ |
196250
|
0 |
0 |
if( iThis<0 ) return -1; |
196253
|
0 |
0 |
while( fast_isspace(z[j]) ){ j++; } |
196254
|
0 |
0 |
if( ++pParse->iDepth > JSON_MAX_DEPTH ) return -1; |
196257
|
0 |
0 |
if( x<0 ){ |
196258
|
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; |
196262
|
0 |
0 |
while( fast_isspace(z[j]) ){ j++; } |
196264
|
0 |
0 |
if( c==',' ) continue; |
196265
|
0 |
0 |
if( c!=']' ) return -1; |
196270
|
0 |
0 |
}else if( c=='"' ){ |
196276
|
0 |
0 |
if( (c & ~0x1f)==0 ){ |
196280
|
0 |
0 |
if( c=='\\' ){ |
196282
|
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' |
196283
|
0 |
0 |
|| c=='n' || c=='r' || c=='t' |
|
0 |
0 |
|| c=='n' || c=='r' || c=='t' |
|
0 |
0 |
|| c=='n' || c=='r' || c=='t' |
196284
|
0 |
0 |
|| (c=='u' && jsonIs4Hex(z+j+1)) ){ |
|
0 |
0 |
|| (c=='u' && jsonIs4Hex(z+j+1)) ){ |
196289
|
0 |
0 |
}else if( c=='"' ){ |
196295
|
0 |
0 |
if( !pParse->oom ) pParse->aNode[pParse->nNode-1].jnFlags = jnFlags; |
196297
|
0 |
0 |
}else if( c=='n' |
196298
|
0 |
0 |
&& strncmp(z+i,"null",4)==0 |
196299
|
0 |
0 |
&& !sqlite3Isalnum(z[i+4]) ){ |
196302
|
0 |
0 |
}else if( c=='t' |
196303
|
0 |
0 |
&& strncmp(z+i,"true",4)==0 |
196304
|
0 |
0 |
&& !sqlite3Isalnum(z[i+4]) ){ |
196307
|
0 |
0 |
}else if( c=='f' |
196308
|
0 |
0 |
&& strncmp(z+i,"false",5)==0 |
196309
|
0 |
0 |
&& !sqlite3Isalnum(z[i+5]) ){ |
196312
|
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') ){ |
196317
|
0 |
0 |
if( c<='0' ){ |
196318
|
0 |
0 |
j = c=='-' ? i+1 : i; |
196319
|
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; |
196324
|
0 |
0 |
if( c>='0' && c<='9' ) continue; |
|
0 |
0 |
if( c>='0' && c<='9' ) continue; |
196325
|
0 |
0 |
if( c=='.' ){ |
196326
|
0 |
0 |
if( z[j-1]=='-' ) return -1; |
196327
|
0 |
0 |
if( seenDP ) return -1; |
196331
|
0 |
0 |
if( c=='e' || c=='E' ){ |
|
0 |
0 |
if( c=='e' || c=='E' ){ |
196332
|
0 |
0 |
if( z[j-1]<'0' ) return -1; |
196333
|
0 |
0 |
if( seenE ) return -1; |
196336
|
0 |
0 |
if( c=='+' || c=='-' ){ |
|
0 |
0 |
if( c=='+' || c=='-' ){ |
196340
|
0 |
0 |
if( c<'0' || c>'9' ) return -1; |
|
0 |
0 |
if( c<'0' || c>'9' ) return -1; |
196345
|
0 |
0 |
if( z[j-1]<'0' ) return -1; |
196346
|
0 |
0 |
jsonParseAddNode(pParse, seenDP ? JSON_REAL : JSON_INT, |
196349
|
0 |
0 |
}else if( c=='}' ){ |
196351
|
0 |
0 |
}else if( c==']' ){ |
196353
|
0 |
0 |
}else if( c==0 ){ |
196374
|
0 |
0 |
if( zJson==0 ) return 1; |
196377
|
0 |
0 |
if( pParse->oom ) i = -1; |
196378
|
0 |
0 |
if( i>0 ){ |
196380
|
0 |
0 |
while( fast_isspace(zJson[i]) ) i++; |
196381
|
0 |
0 |
if( zJson[i] ) i = -1; |
196383
|
0 |
0 |
if( i<=0 ){ |
196384
|
0 |
0 |
if( pCtx!=0 ){ |
196385
|
0 |
0 |
if( pParse->oom ){ |
196406
|
0 |
0 |
for(j=1; j<=pNode->n; j += jsonNodeSize(pNode+j)){ |
196412
|
0 |
0 |
for(j=1; j<=pNode->n; j += jsonNodeSize(pNode+j+1)+1){ |
196431
|
0 |
0 |
if( aUp==0 ){ |
196466
|
0 |
0 |
if( zJson==0 ) return 0; |
196467
|
0 |
0 |
for(iKey=0; iKey
|
196469
|
0 |
0 |
if( p==0 ){ |
196473
|
0 |
0 |
if( pMatch==0 |
196474
|
0 |
0 |
&& p->nJson==nJson |
196475
|
0 |
0 |
&& memcmp(p->zJson,zJson,nJson)==0 |
196479
|
0 |
0 |
}else if( p->iHold
|
196483
|
0 |
0 |
if( p->iHold>iMaxHold ){ |
196487
|
0 |
0 |
if( pMatch ){ |
196493
|
0 |
0 |
if( p==0 ){ |
196500
|
0 |
0 |
if( jsonParse(p, pErrCtx, p->zJson) ){ |
196517
|
0 |
0 |
if( pNode->jnFlags & JNODE_RAW ){ |
196518
|
0 |
0 |
if( pNode->n!=nKey ) return 0; |
196521
|
0 |
0 |
if( pNode->n!=nKey+2 ) return 0; |
196548
|
0 |
0 |
if( zPath[0]==0 ) return pRoot; |
196549
|
0 |
0 |
if( pRoot->jnFlags & JNODE_REPLACE ) return 0; |
196550
|
0 |
0 |
if( zPath[0]=='.' ){ |
196551
|
0 |
0 |
if( pRoot->eType!=JSON_OBJECT ) return 0; |
196553
|
0 |
0 |
if( zPath[0]=='"' ){ |
196555
|
0 |
0 |
for(i=1; zPath[i] && zPath[i]!='"'; i++){} |
|
0 |
0 |
for(i=1; zPath[i] && zPath[i]!='"'; i++){} |
196557
|
0 |
0 |
if( zPath[i] ){ |
196566
|
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++){} |
196568
|
0 |
0 |
if( nKey==0 ){ |
196575
|
0 |
0 |
while( j<=pRoot->n ){ |
196576
|
0 |
0 |
if( jsonLabelCompare(pRoot+j, zKey, nKey) ){ |
196582
|
0 |
0 |
if( (pRoot->jnFlags & JNODE_APPEND)==0 ) break; |
196588
|
0 |
0 |
if( pApnd ){ |
196595
|
0 |
0 |
if( pParse->oom ) return 0; |
196596
|
0 |
0 |
if( pNode ){ |
196606
|
0 |
0 |
}else if( zPath[0]=='[' ){ |
196609
|
0 |
0 |
while( sqlite3Isdigit(zPath[j]) ){ |
196613
|
0 |
0 |
if( j<2 || zPath[j]!=']' ){ |
|
0 |
0 |
if( j<2 || zPath[j]!=']' ){ |
196614
|
0 |
0 |
if( zPath[1]=='#' ){ |
196617
|
0 |
0 |
if( pRoot->eType!=JSON_ARRAY ) return 0; |
196619
|
0 |
0 |
while( j<=pBase->n ){ |
196620
|
0 |
0 |
if( (pBase[j].jnFlags & JNODE_REMOVE)==0 ) i++; |
196623
|
0 |
0 |
if( (pBase->jnFlags & JNODE_APPEND)==0 ) break; |
196630
|
0 |
0 |
if( zPath[2]=='-' && sqlite3Isdigit(zPath[3]) ){ |
|
0 |
0 |
if( zPath[2]=='-' && sqlite3Isdigit(zPath[3]) ){ |
196636
|
0 |
0 |
}while( sqlite3Isdigit(zPath[j]) ); |
196637
|
0 |
0 |
if( x>i ) return 0; |
196640
|
0 |
0 |
if( zPath[j]!=']' ){ |
196649
|
0 |
0 |
if( pRoot->eType!=JSON_ARRAY ) return 0; |
196653
|
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) ){ |
196654
|
0 |
0 |
if( (pRoot[j].jnFlags & JNODE_REMOVE)==0 ) i--; |
196657
|
0 |
0 |
if( (pRoot->jnFlags & JNODE_APPEND)==0 ) break; |
196663
|
0 |
0 |
if( j<=pRoot->n ){ |
196666
|
0 |
0 |
if( i==0 && pApnd ){ |
|
0 |
0 |
if( i==0 && pApnd ){ |
196671
|
0 |
0 |
if( pParse->oom ) return 0; |
196672
|
0 |
0 |
if( pNode ){ |
196698
|
0 |
0 |
if( zPath[0]==0 ){ |
196700
|
0 |
0 |
return pParse->oom ? 0 : &pParse->aNode[pParse->nNode-1]; |
196702
|
0 |
0 |
if( zPath[0]=='.' ){ |
196704
|
0 |
0 |
}else if( strncmp(zPath,"[0]",3)==0 ){ |
196709
|
0 |
0 |
if( pParse->oom ) return 0; |
196741
|
0 |
0 |
if( zPath==0 ) return 0; |
196742
|
0 |
0 |
if( zPath[0]!='$' ){ |
196748
|
0 |
0 |
if( zErr==0 ) return pNode; |
196754
|
0 |
0 |
if( zMsg ){ |
196785
|
0 |
0 |
for(i=2; i<=n; i += jsonNodeSize(&pNode[i])+1){ |
196899
|
0 |
0 |
for(i=0; i
|
196927
|
0 |
0 |
if( p==0 ) return; |
196929
|
0 |
0 |
if( argc==2 ){ |
196935
|
0 |
0 |
if( pNode==0 ){ |
196938
|
0 |
0 |
if( pNode->eType==JSON_ARRAY ){ |
196940
|
0 |
0 |
for(i=1; i<=pNode->n; n++){ |
196987
|
0 |
0 |
if( argc<2 ) return; |
196989
|
0 |
0 |
if( p==0 ) return; |
196990
|
0 |
0 |
if( argc==2 ){ |
196993
|
0 |
0 |
if( zPath==0 ) return; |
196994
|
0 |
0 |
if( flags & JSON_ABPATH ){ |
196995
|
0 |
0 |
if( zPath[0]!='$' ){ |
197005
|
0 |
0 |
if( sqlite3Isdigit(zPath[0]) ){ |
197010
|
0 |
0 |
jsonAppendRaw(&jx, "$.", 1 + (zPath[0]!='[')); |
197014
|
0 |
0 |
pNode = jx.bErr ? 0 : jsonLookup(p, jx.zBuf, 0, ctx); |
197019
|
0 |
0 |
if( pNode ){ |
197020
|
0 |
0 |
if( flags & JSON_JSON ){ |
197029
|
0 |
0 |
if( p->nErr==0 && pNode ) jsonReturn(pNode, ctx, 0); |
|
0 |
0 |
if( p->nErr==0 && pNode ) jsonReturn(pNode, ctx, 0); |
197037
|
0 |
0 |
for(i=1; i
|
197040
|
0 |
0 |
if( p->nErr ) break; |
197042
|
0 |
0 |
if( pNode ){ |
197048
|
0 |
0 |
if( i==argc ){ |
197067
|
0 |
0 |
if( pPatch->eType!=JSON_OBJECT ){ |
197073
|
0 |
0 |
if( pTarget->eType!=JSON_OBJECT ){ |
197078
|
0 |
0 |
for(i=1; in; i += jsonNodeSize(&pPatch[i+1])+1){ |
197087
|
0 |
0 |
for(j=1; jn; j += jsonNodeSize(&pTarget[j+1])+1 ){ |
197091
|
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 ){ |
197092
|
0 |
0 |
if( pTarget[j+1].jnFlags & (JNODE_REMOVE|JNODE_PATCH) ) break; |
197093
|
0 |
0 |
if( pPatch[i+1].eType==JSON_NULL ){ |
197097
|
0 |
0 |
if( pNew==0 ) return 0; |
197099
|
0 |
0 |
if( pNew!=&pTarget[j+1] ){ |
197113
|
0 |
0 |
if( j>=pTarget->n && pPatch[i+1].eType!=JSON_NULL ){ |
|
0 |
0 |
if( j>=pTarget->n && pPatch[i+1].eType!=JSON_NULL ){ |
197118
|
0 |
0 |
if( pParse->oom ) return 0; |
197151
|
0 |
0 |
if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; |
197152
|
0 |
0 |
if( jsonParse(&y, ctx, (const char*)sqlite3_value_text(argv[1])) ){ |
197158
|
0 |
0 |
if( pResult ){ |
197183
|
0 |
0 |
if( argc&1 ){ |
197190
|
0 |
0 |
for(i=0; i
|
197191
|
0 |
0 |
if( sqlite3_value_type(argv[i])!=SQLITE_TEXT ){ |
197225
|
0 |
0 |
if( argc<1 ) return; |
197226
|
0 |
0 |
if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; |
197228
|
0 |
0 |
for(i=1; i<(u32)argc; i++){ |
197230
|
0 |
0 |
if( zPath==0 ) goto remove_done; |
197232
|
0 |
0 |
if( x.nErr ) goto remove_done; |
197233
|
0 |
0 |
if( pNode ) pNode->jnFlags |= JNODE_REMOVE; |
197235
|
0 |
0 |
if( (x.aNode[0].jnFlags & JNODE_REMOVE)==0 ){ |
197258
|
0 |
0 |
if( argc<1 ) return; |
197259
|
0 |
0 |
if( (argc&1)==0 ) { |
197263
|
0 |
0 |
if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; |
197265
|
0 |
0 |
for(i=1; i<(u32)argc; i+=2){ |
197268
|
0 |
0 |
if( x.nErr ) goto replace_err; |
197269
|
0 |
0 |
if( pNode ){ |
197277
|
0 |
0 |
if( x.aNode[0].jnFlags & JNODE_REPLACE ){ |
197312
|
0 |
0 |
if( argc<1 ) return; |
197313
|
0 |
0 |
if( (argc&1)==0 ) { |
197314
|
0 |
0 |
jsonWrongNumArgs(ctx, bIsSet ? "set" : "insert"); |
197317
|
0 |
0 |
if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return; |
197319
|
0 |
0 |
for(i=1; i<(u32)argc; i+=2){ |
197323
|
0 |
0 |
if( x.oom ){ |
197326
|
0 |
0 |
}else if( x.nErr ){ |
197328
|
0 |
0 |
}else if( pNode && (bApnd || bIsSet) ){ |
|
0 |
0 |
}else if( pNode && (bApnd || bIsSet) ){ |
|
0 |
0 |
}else if( pNode && (bApnd || bIsSet) ){ |
197336
|
0 |
0 |
if( x.aNode[0].jnFlags & JNODE_REPLACE ){ |
197363
|
0 |
0 |
if( p==0 ) return; |
197364
|
0 |
0 |
if( argc==2 ){ |
197370
|
0 |
0 |
if( pNode ){ |
197409
|
0 |
0 |
if( pStr ){ |
197410
|
0 |
0 |
if( pStr->zBuf==0 ){ |
197413
|
0 |
0 |
}else if( pStr->nUsed>1 ){ |
197423
|
0 |
0 |
if( pStr ){ |
197426
|
0 |
0 |
if( pStr->bErr ){ |
197427
|
0 |
0 |
if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); |
197429
|
0 |
0 |
}else if( isFinal ){ |
197430
|
0 |
0 |
sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, |
197473
|
0 |
0 |
if( NEVER(!pStr) ) return; |
197476
|
0 |
0 |
for(i=1; inUsed && ((c = z[i])!=',' || inStr || nNest); i++){ |
|
0 |
0 |
for(i=1; inUsed && ((c = z[i])!=',' || inStr || nNest); i++){ |
|
0 |
0 |
for(i=1; inUsed && ((c = z[i])!=',' || inStr || nNest); i++){ |
|
0 |
0 |
for(i=1; inUsed && ((c = z[i])!=',' || inStr || nNest); i++){ |
197477
|
0 |
0 |
if( c=='"' ){ |
197479
|
0 |
0 |
}else if( c=='\\' ){ |
197481
|
0 |
0 |
}else if( !inStr ){ |
197482
|
0 |
0 |
if( c=='{' || c=='[' ) nNest++; |
|
0 |
0 |
if( c=='{' || c=='[' ) nNest++; |
197483
|
0 |
0 |
if( c=='}' || c==']' ) nNest--; |
|
0 |
0 |
if( c=='}' || c==']' ) nNest--; |
197486
|
0 |
0 |
if( inUsed ){ |
197514
|
0 |
0 |
if( pStr ){ |
197515
|
0 |
0 |
if( pStr->zBuf==0 ){ |
197518
|
0 |
0 |
}else if( pStr->nUsed>1 ){ |
197532
|
0 |
0 |
if( pStr ){ |
197534
|
0 |
0 |
if( pStr->bErr ){ |
197535
|
0 |
0 |
if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx); |
197537
|
0 |
0 |
}else if( isFinal ){ |
197538
|
0 |
0 |
sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed, |
197610
|
0 |
0 |
if( rc==SQLITE_OK ){ |
197612
|
0 |
0 |
if( pNew==0 ) return SQLITE_NOMEM; |
197631
|
0 |
0 |
if( pCur==0 ) return SQLITE_NOMEM; |
197640
|
0 |
0 |
if( rc==SQLITE_OK ){ |
197679
|
0 |
0 |
if( p->bRecursive ){ |
197680
|
0 |
0 |
if( p->sParse.aNode[p->i].jnFlags & JNODE_LABEL ) p->i++; |
197683
|
0 |
0 |
if( p->iiEnd ){ |
197687
|
0 |
0 |
if( pUp->eType==JSON_ARRAY ){ |
197691
|
0 |
0 |
if( iUp==p->i-1 ){ |
197736
|
0 |
0 |
if( nn>2 && sqlite3Isalpha(z[1]) ){ |
|
0 |
0 |
if( nn>2 && sqlite3Isalpha(z[1]) ){ |
197737
|
0 |
0 |
for(jj=2; jj
|
|
0 |
0 |
for(jj=2; jj
|
197738
|
0 |
0 |
if( jj==nn-1 ){ |
197755
|
0 |
0 |
if( i==0 ){ |
197763
|
0 |
0 |
if( pUp->eType==JSON_ARRAY ){ |
197769
|
0 |
0 |
if( (pNode->jnFlags & JNODE_LABEL)==0 ) pNode--; |
197784
|
0 |
0 |
if( p->i==0 ) break; |
197785
|
0 |
0 |
if( p->eType==JSON_OBJECT ){ |
197787
|
0 |
0 |
}else if( p->eType==JSON_ARRAY ){ |
197789
|
0 |
0 |
if( p->bRecursive ){ |
197790
|
0 |
0 |
if( p->iRowid==0 ) break; |
197801
|
0 |
0 |
if( pThis->jnFlags & JNODE_LABEL ) pThis++; |
197806
|
0 |
0 |
if( pThis->jnFlags & JNODE_LABEL ) pThis++; |
197811
|
0 |
0 |
if( pThis->jnFlags & JNODE_LABEL ) pThis++; |
197812
|
0 |
0 |
if( pThis->eType>=JSON_ARRAY ) break; |
197822
|
0 |
0 |
if( p->i>p->iBegin && p->bRecursive ){ |
|
0 |
0 |
if( p->i>p->iBegin && p->bRecursive ){ |
197830
|
0 |
0 |
if( p->bRecursive ){ |
197833
|
0 |
0 |
if( p->zRoot ){ |
197838
|
0 |
0 |
if( p->eType==JSON_ARRAY ){ |
197840
|
0 |
0 |
}else if( p->eType==JSON_OBJECT ){ |
197848
|
0 |
0 |
if( p->bRecursive ){ |
197861
|
0 |
0 |
if( zRoot==0 ) zRoot = "$"; |
197902
|
0 |
0 |
for(i=0; inConstraint; i++, pConstraint++){ |
197905
|
0 |
0 |
if( pConstraint->iColumn < JEACH_JSON ) continue; |
197910
|
0 |
0 |
if( pConstraint->usable==0 ){ |
197912
|
0 |
0 |
}else if( pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){ |
197917
|
0 |
0 |
if( (unusableMask & ~idxMask)!=0 ){ |
197922
|
0 |
0 |
if( aIdx[0]<0 ){ |
197932
|
0 |
0 |
if( aIdx[1]<0 ){ |
197958
|
0 |
0 |
if( idxNum==0 ) return SQLITE_OK; |
197960
|
0 |
0 |
if( z==0 ) return SQLITE_OK; |
197963
|
0 |
0 |
if( p->zJson==0 ) return SQLITE_NOMEM; |
197965
|
0 |
0 |
if( jsonParse(&p->sParse, 0, p->zJson) ){ |
197967
|
0 |
0 |
if( p->sParse.oom==0 ){ |
197970
|
0 |
0 |
if( cur->pVtab->zErrMsg ) rc = SQLITE_ERROR; |
197974
|
0 |
0 |
}else if( p->bRecursive && jsonParseFindParents(&p->sParse) ){ |
|
0 |
0 |
}else if( p->bRecursive && jsonParseFindParents(&p->sParse) ){ |
197979
|
0 |
0 |
if( idxNum==3 ){ |
197982
|
0 |
0 |
if( zRoot==0 ) return SQLITE_OK; |
197985
|
0 |
0 |
if( p->zRoot==0 ) return SQLITE_NOMEM; |
197987
|
0 |
0 |
if( zRoot[0]!='$' ){ |
197992
|
0 |
0 |
if( zErr ){ |
197996
|
0 |
0 |
return cur->pVtab->zErrMsg ? SQLITE_ERROR : SQLITE_NOMEM; |
197997
|
0 |
0 |
}else if( pNode==0 ){ |
198005
|
0 |
0 |
if( p->eType>=JSON_ARRAY ){ |
198010
|
0 |
0 |
if( p->bRecursive ){ |
198012
|
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 ){ |
198135
|
622 |
311 |
for(i=0; i
|
|
622 |
0 |
for(i=0; i
|
198748
|
0 |
15 |
if( p ){ |
198776
|
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); |
198796
|
15 |
0 |
if( pNode->iNode!=0 ){ |
198798
|
0 |
15 |
for( ; (*pp)!=pNode; pp = &(*pp)->pNext){ assert(*pp); } |
198813
|
0 |
0 |
if( pNode ){ |
198829
|
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 ){ |
198851
|
18 |
15 |
if( (pNode = nodeHashLookup(pRtree, iNode))!=0 ){ |
198852
|
0 |
18 |
if( pParent && pParent!=pNode->pParent ){ |
|
0 |
0 |
if( pParent && pParent!=pNode->pParent ){ |
198861
|
0 |
15 |
if( pRtree->pNodeBlob ){ |
198866
|
0 |
0 |
if( rc ){ |
198868
|
0 |
0 |
if( rc==SQLITE_NOMEM ) return SQLITE_NOMEM; |
198871
|
15 |
0 |
if( pRtree->pNodeBlob==0 ){ |
198873
|
0 |
15 |
if( zTab==0 ) return SQLITE_NOMEM; |
198878
|
0 |
15 |
if( rc ){ |
198883
|
0 |
0 |
if( rc==SQLITE_ERROR ){ |
198887
|
15 |
0 |
}else if( pRtree->iNodeSize==sqlite3_blob_bytes(pRtree->pNodeBlob) ){ |
198889
|
0 |
15 |
if( !pNode ){ |
198910
|
15 |
0 |
if( rc==SQLITE_OK && pNode && iNode==1 ){ |
|
15 |
0 |
if( rc==SQLITE_OK && pNode && iNode==1 ){ |
|
15 |
0 |
if( rc==SQLITE_OK && pNode && iNode==1 ){ |
198912
|
0 |
15 |
if( pRtree->iDepth>RTREE_MAX_DEPTH ){ |
198922
|
15 |
0 |
if( pNode && rc==SQLITE_OK ){ |
|
15 |
0 |
if( pNode && rc==SQLITE_OK ){ |
198923
|
0 |
15 |
if( NCELL(pNode)>((pRtree->iNodeSize-4)/pRtree->nBytesPerCell) ){ |
198929
|
15 |
0 |
if( rc==SQLITE_OK ){ |
198930
|
15 |
0 |
if( pNode!=0 ){ |
198939
|
0 |
0 |
if( pNode ){ |
198961
|
28 |
7 |
for(ii=0; iinDim2; ii++){ |
198997
|
7 |
0 |
if( nCell
|
199011
|
7 |
8 |
if( pNode->isDirty ){ |
199013
|
7 |
0 |
if( pNode->iNode ){ |
199023
|
0 |
7 |
if( pNode->iNode==0 && rc==SQLITE_OK ){ |
|
0 |
0 |
if( pNode->iNode==0 && rc==SQLITE_OK ){ |
199037
|
33 |
88 |
if( pNode ){ |
199041
|
15 |
18 |
if( pNode->nRef==0 ){ |
199043
|
15 |
0 |
if( pNode->iNode==1 ){ |
199046
|
0 |
15 |
if( pNode->pParent ){ |
199049
|
15 |
0 |
if( rc==SQLITE_OK ){ |
199107
|
0 |
0 |
}while( iinDim2 ); |
199157
|
1 |
15 |
if( pRtree->nBusy==0 ){ |
199198
|
0 |
0 |
if( !zCreate ){ |
199205
|
0 |
0 |
if( rc==SQLITE_OK ){ |
199221
|
8 |
0 |
if( pCsr ){ |
199240
|
6 |
10 |
if( pCsr->aConstraint ){ |
199242
|
24 |
6 |
for(i=0; inConstraint; i++){ |
199244
|
0 |
24 |
if( pInfo ){ |
199245
|
0 |
0 |
if( pInfo->xDelUser ) pInfo->xDelUser(pInfo->pUser); |
199252
|
80 |
16 |
for(ii=0; iiaNode[ii]); |
199354
|
0 |
0 |
if( pConstraint->op==RTREE_QUERY && pSearch->iLevel==1 ){ |
|
0 |
0 |
if( pConstraint->op==RTREE_QUERY && pSearch->iLevel==1 ){ |
199359
|
0 |
0 |
if( eInt==0 ){ |
199388
|
0 |
0 |
if( pConstraint->op==RTREE_MATCH ){ |
199392
|
0 |
0 |
if( eWithin==0 ) *peWithin = NOT_WITHIN; |
199400
|
0 |
0 |
if( pInfo->eWithin<*peWithin ) *peWithin = pInfo->eWithin; |
199401
|
0 |
0 |
if( pInfo->rScore<*prScore || *prScore
|
|
0 |
0 |
if( pInfo->rScore<*prScore || *prScore
|
199434
|
0 |
0 |
RTREE_DECODE_COORD(eInt, pCellData, val); |
199436
|
0 |
0 |
if( p->u.rValue>=val ){ |
199438
|
0 |
0 |
RTREE_DECODE_COORD(eInt, pCellData, val); |
199440
|
0 |
0 |
if( p->u.rValue<=val ) return; |
199445
|
0 |
0 |
RTREE_DECODE_COORD(eInt, pCellData, val); |
199447
|
0 |
0 |
if( p->u.rValue>=val ) return; |
199452
|
0 |
0 |
RTREE_DECODE_COORD(eInt, pCellData, val); |
199454
|
0 |
0 |
if( p->u.rValue<=val ) return; |
199483
|
119 |
0 |
RTREE_DECODE_COORD(eInt, pCellData, xN); |
199487
|
40 |
15 |
case RTREE_LE: if( xN <= p->u.rValue ) return; break; |
199488
|
0 |
0 |
case RTREE_LT: if( xN < p->u.rValue ) return; break; |
199489
|
55 |
9 |
case RTREE_GE: if( xN >= p->u.rValue ) return; break; |
199490
|
0 |
0 |
case RTREE_GT: if( xN > p->u.rValue ) return; break; |
199491
|
0 |
0 |
default: if( xN == p->u.rValue ) return; break; |
199509
|
3 |
0 |
for(ii=0; ii
|
199510
|
2 |
1 |
if( nodeGetRowid(pRtree, pNode, ii)==iRowid ){ |
199525
|
0 |
0 |
if( ALWAYS(pParent) ){ |
199547
|
0 |
0 |
if( pA->rScorerScore ) return -1; |
199548
|
0 |
0 |
if( pA->rScore>pB->rScore ) return +1; |
199549
|
0 |
0 |
if( pA->iLeveliLevel ) return -1; |
199550
|
0 |
0 |
if( pA->iLevel>pB->iLevel ) return +1; |
199563
|
0 |
0 |
if( i
|
199564
|
0 |
0 |
if( j>=RTREE_CACHE_SZ ){ |
199579
|
57 |
47 |
return pCur->bPoint ? &pCur->sPoint : pCur->nPoint ? pCur->aPoint : 0; |
|
31 |
16 |
return pCur->bPoint ? &pCur->sPoint : pCur->nPoint ? pCur->aPoint : 0; |
199590
|
18 |
34 |
if( pCur->aNode[ii]==0 ){ |
199592
|
0 |
18 |
id = ii ? pCur->aPoint[0].id : pCur->sPoint.id; |
199608
|
5 |
0 |
if( pCur->nPoint>=pCur->nPointAlloc ){ |
199611
|
0 |
5 |
if( pNew==0 ) return 0; |
199620
|
0 |
5 |
while( i>0 ){ |
199624
|
0 |
0 |
if( rtreeSearchPointCompare(pNew, pParent)>=0 ) break; |
199644
|
18 |
8 |
if( pFirst==0 |
199645
|
18 |
0 |
|| pFirst->rScore>rScore |
199646
|
18 |
0 |
|| (pFirst->rScore==rScore && pFirst->iLevel>iLevel) |
|
18 |
0 |
|| (pFirst->rScore==rScore && pFirst->iLevel>iLevel) |
199648
|
5 |
21 |
if( pCur->bPoint ){ |
199651
|
0 |
5 |
if( pNew==0 ) return 0; |
199654
|
5 |
0 |
if( ALWAYS(ii
|
199708
|
26 |
0 |
if( p->aNode[i] ){ |
199712
|
21 |
5 |
if( p->bPoint ){ |
199715
|
5 |
0 |
}else if( ALWAYS(p->nPoint) ){ |
199719
|
5 |
0 |
if( n
|
199724
|
0 |
5 |
while( (j = i*2+1)
|
199726
|
0 |
0 |
if( kaPoint[k], &p->aPoint[j])<0 ){ |
|
0 |
0 |
if( kaPoint[k], &p->aPoint[j])<0 ){ |
199727
|
0 |
0 |
if( rtreeSearchPointCompare(&p->aPoint[k], &p->aPoint[i])<0 ){ |
199734
|
0 |
0 |
if( rtreeSearchPointCompare(&p->aPoint[j], &p->aPoint[i])<0 ){ |
199765
|
42 |
8 |
while( (p = rtreeSearchPointFirst(pCur))!=0 && p->iLevel>0 ){ |
|
24 |
18 |
while( (p = rtreeSearchPointFirst(pCur))!=0 && p->iLevel>0 ){ |
199768
|
0 |
24 |
if( rc ) return rc; |
199772
|
42 |
6 |
while( p->iCell
|
199775
|
119 |
18 |
for(ii=0; ii
|
199777
|
0 |
119 |
if( pConstraint->op>=RTREE_MATCH ){ |
199780
|
0 |
0 |
if( rc ) return rc; |
199781
|
119 |
0 |
}else if( p->iLevel==1 ){ |
199786
|
24 |
95 |
if( eWithin==NOT_WITHIN ){ |
199792
|
24 |
18 |
if( eWithin==NOT_WITHIN ) continue; |
199795
|
0 |
18 |
if( x.iLevel ){ |
199797
|
0 |
0 |
for(ii=0; iinPoint; ii++){ |
199798
|
0 |
0 |
if( pCur->aPoint[ii].id==x.id ){ |
199808
|
0 |
18 |
if( p->iCell>=nCell ){ |
199812
|
18 |
0 |
if( rScore
|
199814
|
0 |
18 |
if( p==0 ) return SQLITE_NOMEM; |
199821
|
6 |
18 |
if( p->iCell>=nCell ){ |
199839
|
0 |
20 |
if( pCsr->bAuxValid ){ |
199856
|
0 |
0 |
if( rc==SQLITE_OK && ALWAYS(p) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && ALWAYS(p) ){ |
199873
|
0 |
28 |
if( rc ) return rc; |
199874
|
0 |
28 |
if( NEVER(p==0) ) return SQLITE_OK; |
199875
|
20 |
8 |
if( i==0 ){ |
199877
|
8 |
0 |
}else if( i<=pRtree->nDim2 ){ |
199880
|
0 |
8 |
if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ |
199889
|
0 |
0 |
if( !pCsr->bAuxValid ){ |
199890
|
0 |
0 |
if( pCsr->pReadAux==0 ){ |
199893
|
0 |
0 |
if( rc ) return rc; |
199898
|
0 |
0 |
if( rc==SQLITE_ROW ){ |
199902
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
199928
|
2 |
0 |
if( sqlite3_step(pRtree->pReadRowid)==SQLITE_ROW ){ |
199930
|
2 |
0 |
if( piNode ) *piNode = iNode; |
199950
|
0 |
0 |
if( pSrc==0 ) return SQLITE_ERROR; |
199953
|
0 |
0 |
if( !pInfo ) return SQLITE_NOMEM; |
199962
|
0 |
0 |
if( pBlob->cb.xGeom ){ |
199993
|
2 |
6 |
if( idxNum==1 ){ |
200000
|
0 |
2 |
if( eType==SQLITE_INTEGER |
200001
|
0 |
0 |
|| (eType==SQLITE_FLOAT && sqlite3_value_double(argv[0])==iRowid) |
|
0 |
0 |
|| (eType==SQLITE_FLOAT && sqlite3_value_double(argv[0])==iRowid) |
200008
|
2 |
0 |
if( rc==SQLITE_OK && pLeaf!=0 ){ |
|
2 |
0 |
if( rc==SQLITE_OK && pLeaf!=0 ){ |
200025
|
6 |
0 |
if( rc==SQLITE_OK && argc>0 ){ |
|
6 |
0 |
if( rc==SQLITE_OK && argc>0 ){ |
200028
|
0 |
6 |
if( !pCsr->aConstraint ){ |
200035
|
24 |
6 |
for(ii=0; ii
|
200040
|
0 |
24 |
if( p->op>=RTREE_MATCH ){ |
200046
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
200052
|
0 |
24 |
}else if( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT ){ |
|
0 |
0 |
}else if( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT ){ |
200060
|
0 |
0 |
if( eType==SQLITE_NULL ){ |
200062
|
0 |
0 |
}else if( p->op==RTREE_LT || p->op==RTREE_LE ){ |
|
0 |
0 |
}else if( p->op==RTREE_LT || p->op==RTREE_LE ){ |
200071
|
6 |
0 |
if( rc==SQLITE_OK ){ |
200075
|
0 |
6 |
if( NEVER(pNew==0) ){ /* Because pCsr->bPoint was FALSE */ |
200143
|
26 |
8 |
for(ii=0; iinConstraint; ii++){ |
200144
|
0 |
26 |
if( pIdxInfo->aConstraint[ii].op==SQLITE_INDEX_CONSTRAINT_MATCH ){ |
200150
|
26 |
6 |
for(ii=0; iinConstraint && iIdx<(int)(sizeof(zIdxStr)-1); ii++){ |
|
26 |
0 |
for(ii=0; iinConstraint && iIdx<(int)(sizeof(zIdxStr)-1); ii++){ |
200153
|
26 |
0 |
if( bMatch==0 && p->usable |
|
26 |
0 |
if( bMatch==0 && p->usable |
200154
|
2 |
24 |
&& p->iColumn<=0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ |
|
2 |
0 |
&& p->iColumn<=0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ |
200158
|
0 |
2 |
for(jj=0; jj
|
200178
|
24 |
0 |
if( p->usable |
200179
|
24 |
0 |
&& ((p->iColumn>0 && p->iColumn<=pRtree->nDim2) |
|
0 |
24 |
&& ((p->iColumn>0 && p->iColumn<=pRtree->nDim2) |
200180
|
0 |
0 |
|| p->op==SQLITE_INDEX_CONSTRAINT_MATCH) |
200192
|
24 |
0 |
if( op ){ |
200203
|
6 |
0 |
if( iIdx>0 && 0==(pIdxInfo->idxStr = sqlite3_mprintf("%s", zIdxStr)) ){ |
|
0 |
6 |
if( iIdx>0 && 0==(pIdxInfo->idxStr = sqlite3_mprintf("%s", zIdxStr)) ){ |
200221
|
0 |
0 |
if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ |
200251
|
0 |
0 |
margin += (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii])); |
|
0 |
0 |
margin += (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii])); |
200253
|
0 |
0 |
}while( ii>=0 ); |
200262
|
0 |
0 |
if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ |
200264
|
0 |
0 |
p1->aCoord[ii].f = MIN(p1->aCoord[ii].f, p2->aCoord[ii].f); |
200265
|
0 |
0 |
p1->aCoord[ii+1].f = MAX(p1->aCoord[ii+1].f, p2->aCoord[ii+1].f); |
200267
|
0 |
0 |
}while( iinDim2 ); |
200273
|
0 |
0 |
}while( iinDim2 ); |
200284
|
0 |
0 |
for(ii=0; iinDim2; ii+=2){ |
200287
|
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)) |
200288
|
0 |
0 |
|| ( isInt && (a2[0].ia1[1].i)) |
|
0 |
0 |
|| ( isInt && (a2[0].ia1[1].i)) |
|
0 |
0 |
|| ( isInt && (a2[0].ia1[1].i)) |
200316
|
0 |
0 |
for(ii=0; ii
|
200319
|
0 |
0 |
for(jj=0; jjnDim2; jj+=2){ |
200321
|
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])); |
200322
|
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])); |
200323
|
0 |
0 |
if( x2
|
200351
|
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++){ |
200368
|
0 |
0 |
for(iCell=0; iCell
|
200375
|
0 |
0 |
if( iCell==0||growth
|
|
0 |
0 |
if( iCell==0||growth
|
|
0 |
0 |
if( iCell==0||growth
|
|
0 |
0 |
if( iCell==0||growth
|
200378
|
0 |
0 |
if( bBest ){ |
200408
|
0 |
7 |
while( p->pParent ){ |
200414
|
0 |
0 |
if( NEVER(cnt>100) ){ |
200419
|
0 |
0 |
if( NEVER(rc!=SQLITE_OK) ){ |
200425
|
0 |
0 |
if( !cellContains(pRtree, &cell, pCell) ){ |
200481
|
0 |
0 |
if( nIdx>1 ){ |
200496
|
0 |
0 |
while( iLeft
|
|
0 |
0 |
while( iLeft
|
200497
|
0 |
0 |
if( iLeft==nLeft ){ |
200500
|
0 |
0 |
}else if( iRight==nRight ){ |
200506
|
0 |
0 |
if( fLeft
|
200549
|
0 |
0 |
if( nIdx>1 ){ |
200564
|
0 |
0 |
while( iLeft
|
|
0 |
0 |
while( iLeft
|
200565
|
0 |
0 |
RtreeDValue xleft1 = DCOORD(aCell[aLeft[iLeft]].aCoord[iDim*2]); |
200566
|
0 |
0 |
RtreeDValue xleft2 = DCOORD(aCell[aLeft[iLeft]].aCoord[iDim*2+1]); |
200567
|
0 |
0 |
RtreeDValue xright1 = DCOORD(aCell[aRight[iRight]].aCoord[iDim*2]); |
200568
|
0 |
0 |
RtreeDValue xright2 = DCOORD(aCell[aRight[iRight]].aCoord[iDim*2+1]); |
200569
|
0 |
0 |
if( (iLeft!=nLeft) && ((iRight==nRight) |
|
0 |
0 |
if( (iLeft!=nLeft) && ((iRight==nRight) |
200570
|
0 |
0 |
|| (xleft1
|
200571
|
0 |
0 |
|| (xleft1==xright1 && xleft2
|
|
0 |
0 |
|| (xleft1==xright1 && xleft2
|
200620
|
0 |
0 |
if( !aaSorted ){ |
200626
|
0 |
0 |
for(ii=0; iinDim; ii++){ |
200629
|
0 |
0 |
for(jj=0; jj
|
200635
|
0 |
0 |
for(ii=0; iinDim; ii++){ |
200642
|
0 |
0 |
for( |
200655
|
0 |
0 |
for(kk=1; kk<(nCell-1); kk++){ |
200656
|
0 |
0 |
if( kk
|
200666
|
0 |
0 |
if( (nLeft==RTREE_MINCELLS(pRtree)) |
200667
|
0 |
0 |
|| (overlap
|
200668
|
0 |
0 |
|| (overlap==fBestOverlap && area
|
|
0 |
0 |
|| (overlap==fBestOverlap && area
|
200676
|
0 |
0 |
if( ii==0 || margin
|
|
0 |
0 |
if( ii==0 || margin
|
200685
|
0 |
0 |
for(ii=0; ii
|
200686
|
0 |
0 |
RtreeNode *pTarget = (ii
|
200687
|
0 |
0 |
RtreeCell *pBbox = (ii
|
200705
|
0 |
0 |
xSetMapping = ((iHeight==0)?rowidWrite:parentWrite); |
200706
|
0 |
0 |
if( iHeight>0 ){ |
200709
|
0 |
0 |
for(p=pNode; p; p=p->pParent){ |
200710
|
0 |
0 |
if( p==pChild ) return SQLITE_CORRUPT_VTAB; |
200712
|
0 |
0 |
if( pChild ){ |
200718
|
0 |
0 |
if( NEVER(pNode==0) ) return SQLITE_ERROR; |
200746
|
0 |
0 |
if( !aCell ){ |
200752
|
0 |
0 |
for(i=0; i
|
200759
|
0 |
0 |
if( pNode->iNode==1 ){ |
200771
|
0 |
0 |
if( !pLeft || !pRight ){ |
|
0 |
0 |
if( !pLeft || !pRight ){ |
200781
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
200790
|
0 |
0 |
if( SQLITE_OK!=(rc = nodeWrite(pRtree, pRight)) |
200791
|
0 |
0 |
|| (0==pLeft->iNode && SQLITE_OK!=(rc = nodeWrite(pRtree, pLeft))) |
|
0 |
0 |
|| (0==pLeft->iNode && SQLITE_OK!=(rc = nodeWrite(pRtree, pLeft))) |
200799
|
0 |
0 |
if( pNode->iNode==1 ){ |
200801
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
200808
|
0 |
0 |
if( ALWAYS(rc==SQLITE_OK) ){ |
200813
|
0 |
0 |
if( NEVER(rc!=SQLITE_OK) ){ |
200817
|
0 |
0 |
if( (rc = rtreeInsertCell(pRtree, pRight->pParent, &rightbbox, iHeight+1)) ){ |
200821
|
0 |
0 |
for(i=0; i
|
200824
|
0 |
0 |
if( iRowid==pCell->iRowid ){ |
200827
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
200831
|
0 |
0 |
if( pNode->iNode==1 ){ |
200832
|
0 |
0 |
for(i=0; i
|
200835
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
200839
|
0 |
0 |
}else if( newCellIsRight==0 ){ |
200843
|
0 |
0 |
if( rc==SQLITE_OK ){ |
200847
|
0 |
0 |
if( rc==SQLITE_OK ){ |
200873
|
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 ){ |
200877
|
0 |
0 |
if( rc==SQLITE_ROW ){ |
200887
|
0 |
0 |
for(pTest=pLeaf; pTest && pTest->iNode!=iNode; pTest=pTest->pParent); |
|
0 |
0 |
for(pTest=pLeaf; pTest && pTest->iNode!=iNode; pTest=pTest->pParent); |
200888
|
0 |
0 |
if( pTest==0 ){ |
200893
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
200894
|
0 |
0 |
if( rc==SQLITE_OK && !pChild->pParent ){ |
|
0 |
0 |
if( rc==SQLITE_OK && !pChild->pParent ){ |
200915
|
0 |
0 |
if( rc==SQLITE_OK ){ |
200922
|
0 |
0 |
if( rc==SQLITE_OK ){ |
200925
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
200932
|
0 |
0 |
if( SQLITE_OK!=(rc = sqlite3_reset(pRtree->pDeleteNode)) ){ |
200939
|
0 |
0 |
if( SQLITE_OK!=(rc = sqlite3_reset(pRtree->pDeleteParent)) ){ |
200958
|
0 |
0 |
if( pParent ){ |
200963
|
0 |
0 |
for(ii=1; ii
|
200970
|
0 |
0 |
if( rc==SQLITE_OK ){ |
200986
|
0 |
0 |
if( SQLITE_OK!=(rc = fixLeafParent(pRtree, pNode)) ){ |
201002
|
0 |
0 |
if( pParent ){ |
201003
|
0 |
0 |
if( NCELL(pNode)
|
201044
|
0 |
0 |
if( !aCell ){ |
201051
|
0 |
0 |
for(ii=0; ii
|
201052
|
0 |
0 |
if( ii==(nCell-1) ){ |
201058
|
0 |
0 |
for(iDim=0; iDimnDim; iDim++){ |
201059
|
0 |
0 |
aCenterCoord[iDim] += DCOORD(aCell[ii].aCoord[iDim*2]); |
201060
|
0 |
0 |
aCenterCoord[iDim] += DCOORD(aCell[ii].aCoord[iDim*2+1]); |
201063
|
0 |
0 |
for(iDim=0; iDimnDim; iDim++){ |
201067
|
0 |
0 |
for(ii=0; ii
|
201069
|
0 |
0 |
for(iDim=0; iDimnDim; iDim++){ |
201070
|
0 |
0 |
RtreeDValue coord = (DCOORD(aCell[ii].aCoord[iDim*2+1]) - |
201071
|
0 |
0 |
DCOORD(aCell[ii].aCoord[iDim*2])); |
201079
|
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++){ |
201082
|
0 |
0 |
if( p->iRowid==pCell->iRowid ){ |
201083
|
0 |
0 |
if( iHeight==0 ){ |
201090
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201093
|
0 |
0 |
for(; rc==SQLITE_OK && ii
|
|
0 |
0 |
for(; rc==SQLITE_OK && ii
|
201100
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201104
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201125
|
0 |
7 |
if( iHeight>0 ){ |
201127
|
0 |
0 |
if( pChild ){ |
201133
|
0 |
7 |
if( nodeInsertCell(pRtree, pNode, pCell) ){ |
201134
|
0 |
0 |
if( iHeight<=pRtree->iReinsertHeight || pNode->iNode==1){ |
|
0 |
0 |
if( iHeight<=pRtree->iReinsertHeight || pNode->iNode==1){ |
201142
|
7 |
0 |
if( ALWAYS(rc==SQLITE_OK) ){ |
201143
|
7 |
0 |
if( iHeight==0 ){ |
201158
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii
|
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii
|
201167
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201171
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201208
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201217
|
0 |
0 |
if( rc==SQLITE_OK && pLeaf ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pLeaf ){ |
201220
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201224
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201230
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201244
|
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 ){ |
201249
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201253
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
201254
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201262
|
0 |
0 |
for(pLeaf=pRtree->pDeleted; pLeaf; pLeaf=pRtree->pDeleted){ |
201263
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201272
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201295
|
0 |
0 |
if( f>d ){ |
201296
|
0 |
0 |
f = (float)(d*(d<0 ? RNDAWAY : RNDTOWARDS)); |
201303
|
0 |
0 |
if( f
|
201304
|
0 |
0 |
f = (float)(d*(d<0 ? RNDTOWARDS : RNDAWAY)); |
201330
|
0 |
0 |
if( zSql ){ |
201337
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201338
|
0 |
0 |
if( iCol==0 ){ |
201353
|
0 |
0 |
return (rc==SQLITE_OK ? SQLITE_CONSTRAINT : rc); |
201372
|
0 |
7 |
if( pRtree->nNodeRef ){ |
201394
|
7 |
0 |
if( nData>1 ){ |
201398
|
0 |
7 |
if( nn > pRtree->nDim2 ) nn = pRtree->nDim2; |
201409
|
0 |
7 |
if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ |
201410
|
0 |
0 |
for(ii=0; ii
|
201413
|
0 |
0 |
if( cell.aCoord[ii].f>cell.aCoord[ii+1].f ){ |
201421
|
14 |
7 |
for(ii=0; ii
|
201424
|
0 |
14 |
if( cell.aCoord[ii].i>cell.aCoord[ii+1].i ){ |
201433
|
7 |
0 |
if( sqlite3_value_type(aData[2])!=SQLITE_NULL ){ |
201435
|
0 |
7 |
if( sqlite3_value_type(aData[0])==SQLITE_NULL |
201436
|
0 |
0 |
|| sqlite3_value_int64(aData[0])!=cell.iRowid |
201442
|
0 |
7 |
if( SQLITE_ROW==steprc ){ |
201443
|
0 |
0 |
if( sqlite3_vtab_on_conflict(pRtree->db)==SQLITE_REPLACE ){ |
201459
|
0 |
7 |
if( sqlite3_value_type(aData[0])!=SQLITE_NULL ){ |
201467
|
7 |
0 |
if( rc==SQLITE_OK && nData>1 ){ |
|
7 |
0 |
if( rc==SQLITE_OK && nData>1 ){ |
201472
|
0 |
7 |
if( bHaveRowid==0 ){ |
201477
|
7 |
0 |
if( rc==SQLITE_OK ){ |
201480
|
7 |
0 |
if( rc==SQLITE_OK ){ |
201485
|
7 |
0 |
if( rc==SQLITE_OK ){ |
201489
|
7 |
0 |
if( rc==SQLITE_OK && pRtree->nAux ){ |
|
0 |
7 |
if( rc==SQLITE_OK && pRtree->nAux ){ |
201493
|
0 |
0 |
for(jj=0; jjnAux; jj++){ |
201541
|
0 |
0 |
if( zSql ){ |
201588
|
1 |
0 |
if( rc!=SQLITE_OK ){ |
201590
|
0 |
1 |
return rc==SQLITE_ERROR ? SQLITE_OK : rc; |
201593
|
0 |
0 |
if( zSql==0 ){ |
201597
|
0 |
0 |
if( rc==SQLITE_OK ){ |
201598
|
0 |
0 |
if( sqlite3_step(p)==SQLITE_ROW ) nRow = sqlite3_column_int64(p, 0); |
201617
|
12 |
0 |
for(i=0; i
|
201618
|
6 |
6 |
if( sqlite3_stricmp(zName, azName[i])==0 ) return 1; |
201681
|
1 |
0 |
if( isCreate ){ |
201688
|
0 |
1 |
for(ii=0; iinAux; ii++){ |
201701
|
0 |
1 |
if( !zCreate ){ |
201706
|
0 |
1 |
if( rc!=SQLITE_OK ){ |
201721
|
8 |
1 |
for(i=0; i
|
|
8 |
0 |
for(i=0; i
|
201724
|
1 |
7 |
if( i!=3 || pRtree->nAux==0 ){ |
|
1 |
0 |
if( i!=3 || pRtree->nAux==0 ){ |
201733
|
8 |
0 |
if( zSql ){ |
201740
|
0 |
1 |
if( pRtree->nAux ){ |
201744
|
0 |
0 |
if( pRtree->zReadAuxSql==0 ){ |
201751
|
0 |
0 |
for(ii=0; iinAux; ii++){ |
201752
|
0 |
0 |
if( ii ) sqlite3_str_append(p, ",", 1); |
201764
|
0 |
0 |
if( zSql==0 ){ |
201785
|
1 |
0 |
if( zSql ){ |
201788
|
1 |
0 |
if( rc==SQLITE_OK ){ |
201789
|
1 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
201821
|
1 |
0 |
if( isCreate ){ |
201825
|
1 |
0 |
if( rc==SQLITE_OK ){ |
201827
|
1 |
0 |
if( (4+pRtree->nBytesPerCell*RTREE_MAXCELLS)iNodeSize ){ |
201839
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
201841
|
0 |
0 |
}else if( pRtree->iNodeSize<(512-64) ){ |
201897
|
1 |
0 |
if( argc<6 || argc>RTREE_MAX_AUX_COLUMN+3 ){ |
|
0 |
1 |
if( argc<6 || argc>RTREE_MAX_AUX_COLUMN+3 ){ |
201898
|
0 |
0 |
*pzErr = sqlite3_mprintf("%s", aErrMsg[2 + (argc>=6)]); |
201908
|
0 |
1 |
if( !pRtree ){ |
201928
|
4 |
1 |
for(ii=4; ii
|
201930
|
0 |
4 |
if( zArg[0]=='+' ){ |
201933
|
0 |
4 |
}else if( pRtree->nAux>0 ){ |
201944
|
0 |
1 |
if( !zSql ){ |
201946
|
0 |
1 |
}else if( ii
|
201949
|
0 |
1 |
}else if( SQLITE_OK!=(rc = sqlite3_declare_vtab(db, zSql)) ){ |
201953
|
0 |
1 |
if( rc ) goto rtreeInit_fail; |
201955
|
0 |
1 |
if( pRtree->nDim<1 ){ |
201957
|
0 |
1 |
}else if( pRtree->nDim2>RTREE_MAX_DIMENSIONS*2 ){ |
201959
|
0 |
1 |
}else if( pRtree->nDim2 % 2 ){ |
201964
|
0 |
1 |
if( iErr ){ |
201972
|
0 |
1 |
if( rc ) goto rtreeInit_fail; |
201974
|
0 |
1 |
if( rc ){ |
201983
|
0 |
0 |
if( rc==SQLITE_OK ) rc = SQLITE_ERROR; |
202019
|
0 |
0 |
if( tree.nDim<1 || tree.nDim>5 ) return; |
|
0 |
0 |
if( tree.nDim<1 || tree.nDim>5 ) return; |
202023
|
0 |
0 |
if( node.zData==0 ) return; |
202025
|
0 |
0 |
if( nData<4 ) return; |
202026
|
0 |
0 |
if( nData
|
202029
|
0 |
0 |
for(ii=0; ii
|
202034
|
0 |
0 |
if( ii>0 ) sqlite3_str_append(pOut, " ", 1); |
202036
|
0 |
0 |
for(jj=0; jj
|
202061
|
0 |
0 |
if( sqlite3_value_type(apArg[0])!=SQLITE_BLOB |
202062
|
0 |
0 |
|| sqlite3_value_bytes(apArg[0])<2 |
202068
|
0 |
0 |
if( zBlob ){ |
202104
|
0 |
0 |
if( pCheck->rc==SQLITE_OK ) pCheck->rc = rc; |
202126
|
0 |
0 |
if( pCheck->rc==SQLITE_OK ){ |
202127
|
0 |
0 |
if( z==0 ){ |
202147
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pCheck->nErr
|
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pCheck->nErr
|
202149
|
0 |
0 |
if( z==0 ){ |
202152
|
0 |
0 |
pCheck->zReport = sqlite3_mprintf("%z%s%z", |
202155
|
0 |
0 |
if( pCheck->zReport==0 ){ |
202181
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pCheck->pGetNode==0 ){ |
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pCheck->pGetNode==0 ){ |
202188
|
0 |
0 |
if( pCheck->rc==SQLITE_OK ){ |
202190
|
0 |
0 |
if( sqlite3_step(pCheck->pGetNode)==SQLITE_ROW ){ |
202194
|
0 |
0 |
if( pRet==0 ){ |
202202
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pRet==0 ){ |
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pRet==0 ){ |
202236
|
0 |
0 |
if( pCheck->aCheckMapping[bLeaf]==0 ){ |
202241
|
0 |
0 |
if( pCheck->rc!=SQLITE_OK ) return; |
202246
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
202247
|
0 |
0 |
rtreeCheckAppendMsg(pCheck, "Mapping (%lld -> %lld) missing from %s table", |
202250
|
0 |
0 |
}else if( rc==SQLITE_ROW ){ |
202252
|
0 |
0 |
if( ii!=iVal ){ |
202253
|
0 |
0 |
rtreeCheckAppendMsg(pCheck, |
202285
|
0 |
0 |
for(i=0; inDim; i++){ |
202290
|
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 ){ |
202296
|
0 |
0 |
if( pParent ){ |
202300
|
0 |
0 |
if( (pCheck->bInt ? c1.i
|
|
0 |
0 |
if( (pCheck->bInt ? c1.i
|
|
0 |
0 |
if( (pCheck->bInt ? c1.i
|
202301
|
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) |
202333
|
0 |
0 |
if( aNode ){ |
202334
|
0 |
0 |
if( nNode<4 ){ |
202341
|
0 |
0 |
if( aParent==0 ){ |
202343
|
0 |
0 |
if( iDepth>RTREE_MAX_DEPTH ){ |
202350
|
0 |
0 |
if( (4 + nCell*(8 + pCheck->nDim*2*4))>nNode ){ |
202356
|
0 |
0 |
for(i=0; i
|
202361
|
0 |
0 |
if( iDepth>0 ){ |
202384
|
0 |
0 |
if( pCheck->rc==SQLITE_OK ){ |
202389
|
0 |
0 |
if( pCount ){ |
202390
|
0 |
0 |
if( sqlite3_step(pCount)==SQLITE_ROW ){ |
202392
|
0 |
0 |
if( nActual!=nExpect ){ |
202427
|
0 |
0 |
if( sqlite3_get_autocommit(db) ){ |
202433
|
0 |
0 |
if( check.rc==SQLITE_OK ){ |
202435
|
0 |
0 |
if( pStmt ){ |
202439
|
0 |
0 |
if( check.rc!=SQLITE_NOMEM ){ |
202446
|
0 |
0 |
if( pStmt ){ |
202449
|
0 |
0 |
if( check.nDim<1 ){ |
202451
|
0 |
0 |
}else if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
202455
|
0 |
0 |
if( rc!=SQLITE_CORRUPT ) check.rc = rc; |
202459
|
0 |
0 |
if( check.nDim>=1 ){ |
202460
|
0 |
0 |
if( check.rc==SQLITE_OK ){ |
202473
|
0 |
0 |
if( bEnd ){ |
202475
|
0 |
0 |
if( check.rc==SQLITE_OK ) check.rc = rc; |
202519
|
0 |
0 |
if( nArg!=1 && nArg!=2 ){ |
|
0 |
0 |
if( nArg!=1 && nArg!=2 ){ |
202528
|
0 |
0 |
if( nArg==1 ){ |
202535
|
0 |
0 |
if( rc==SQLITE_OK ){ |
202536
|
0 |
0 |
sqlite3_result_text(ctx, zReport ? zReport : "ok", -1, SQLITE_TRANSIENT); |
204377
|
311 |
0 |
if( rc==SQLITE_OK ){ |
204380
|
311 |
0 |
if( rc==SQLITE_OK ){ |
204383
|
311 |
0 |
if( rc==SQLITE_OK ){ |
204391
|
311 |
0 |
if( rc==SQLITE_OK ){ |
204413
|
0 |
0 |
if( pInfo->xDestructor ) pInfo->xDestructor(pInfo->pContext); |
204423
|
0 |
0 |
for(i=0; inParam; i++){ |
204452
|
0 |
0 |
if( !pBlob ){ |
204460
|
0 |
0 |
for(i=0; i
|
204462
|
0 |
0 |
if( pBlob->apSqlParam[i]==0 ) memErr = 1; |
204469
|
0 |
0 |
if( memErr ){ |
204491
|
0 |
0 |
if( !pGeomCtx ) return SQLITE_NOMEM; |
204516
|
0 |
0 |
if( !pGeomCtx ){ |
204517
|
0 |
0 |
if( xDestructor ) xDestructor(pContext); |
220463
|
0 |
0 |
if( fts5yypParser ){ |
220558
|
0 |
0 |
while( pParser->fts5yytos>pParser->fts5yystack ) fts5yy_pop_parser_stack(pParser); |
220578
|
0 |
0 |
if( p==0 ) return; |
220642
|
0 |
0 |
if( stateno>fts5YY_MAX_SHIFT ) return stateno; |
220656
|
0 |
0 |
if( fts5yy_lookahead[i]!=iLookAhead ){ |
220738
|
0 |
0 |
while( fts5yypParser->fts5yytos>fts5yypParser->fts5yystack ) fts5yy_pop_parser_stack(fts5yypParser); |
220788
|
0 |
0 |
if( fts5yypParser->fts5yytos>fts5yypParser->fts5yystackEnd ){ |
220802
|
0 |
0 |
if( fts5yyNewState > fts5YY_MAX_SHIFT ){ |
221211
|
0 |
0 |
if( fts5yyact >= fts5YY_MIN_REDUCE ){ |
221234
|
0 |
0 |
if( fts5yyRuleInfoNRhs[fts5yyruleno]==0 ){ |
221243
|
0 |
0 |
if( fts5yypParser->fts5yytos>=fts5yypParser->fts5yystackEnd ){ |
221257
|
0 |
0 |
}else if( fts5yyact <= fts5YY_MAX_SHIFTREDUCE ){ |
221263
|
0 |
0 |
}else if( fts5yyact==fts5YY_ACCEPT_ACTION ){ |
221456
|
0 |
0 |
while( rc==SQLITE_OK && pIter->iInstnInst ){ |
|
0 |
0 |
while( rc==SQLITE_OK && pIter->iInstnInst ){ |
221459
|
0 |
0 |
if( rc==SQLITE_OK ){ |
221460
|
0 |
0 |
if( ic==pIter->iCol ){ |
221462
|
0 |
0 |
if( pIter->iStart<0 ){ |
221465
|
0 |
0 |
}else if( io<=pIter->iEnd ){ |
221466
|
0 |
0 |
if( iEnd>pIter->iEnd ) pIter->iEnd = iEnd; |
221496
|
0 |
0 |
if( rc==SQLITE_OK ){ |
221536
|
0 |
0 |
if( *pRc==SQLITE_OK && z ){ |
|
0 |
0 |
if( *pRc==SQLITE_OK && z ){ |
221537
|
0 |
0 |
if( n<0 ) n = (int)strlen(z); |
221539
|
0 |
0 |
if( p->zOut==0 ) *pRc = SQLITE_NOMEM; |
221560
|
0 |
0 |
if( tflags & FTS5_TOKEN_COLOCATED ) return SQLITE_OK; |
221563
|
0 |
0 |
if( p->iRangeEnd>0 ){ |
221564
|
0 |
0 |
if( iPosiRangeStart || iPos>p->iRangeEnd ) return SQLITE_OK; |
|
0 |
0 |
if( iPosiRangeStart || iPos>p->iRangeEnd ) return SQLITE_OK; |
221565
|
0 |
0 |
if( p->iRangeStart && iPos==p->iRangeStart ) p->iOff = iStartOff; |
|
0 |
0 |
if( p->iRangeStart && iPos==p->iRangeStart ) p->iOff = iStartOff; |
221568
|
0 |
0 |
if( iPos==p->iter.iStart ){ |
221574
|
0 |
0 |
if( iPos==p->iter.iEnd ){ |
221575
|
0 |
0 |
if( p->iRangeEnd && p->iter.iStartiRangeStart ){ |
|
0 |
0 |
if( p->iRangeEnd && p->iter.iStartiRangeStart ){ |
221581
|
0 |
0 |
if( rc==SQLITE_OK ){ |
221586
|
0 |
0 |
if( p->iRangeEnd>0 && iPos==p->iRangeEnd ){ |
|
0 |
0 |
if( p->iRangeEnd>0 && iPos==p->iRangeEnd ){ |
221589
|
0 |
0 |
if( iPos>=p->iter.iStart && iPositer.iEnd ){ |
|
0 |
0 |
if( iPos>=p->iter.iStart && iPositer.iEnd ){ |
221611
|
0 |
0 |
if( nVal!=3 ){ |
221623
|
0 |
0 |
if( ctx.zIn ){ |
221624
|
0 |
0 |
if( rc==SQLITE_OK ){ |
221628
|
0 |
0 |
if( rc==SQLITE_OK ){ |
221633
|
0 |
0 |
if( rc==SQLITE_OK ){ |
221638
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
221664
|
0 |
0 |
if( p->nFirstAlloc==p->nFirst ){ |
221665
|
0 |
0 |
int nNew = p->nFirstAlloc ? p->nFirstAlloc*2 : 64; |
221669
|
0 |
0 |
if( aNew==0 ) return SQLITE_NOMEM; |
221695
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ){ |
221697
|
0 |
0 |
if( p->iPos>0 ){ |
221700
|
0 |
0 |
for(i=iStartOff-1; i>=0; i--){ |
221702
|
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; |
221704
|
0 |
0 |
if( i!=iStartOff-1 && (c=='.' || c==':') ){ |
|
0 |
0 |
if( i!=iStartOff-1 && (c=='.' || c==':') ){ |
|
0 |
0 |
if( i!=iStartOff-1 && (c=='.' || c==':') ){ |
221738
|
0 |
0 |
for(i=0; i
|
|
0 |
0 |
for(i=0; i
|
221740
|
0 |
0 |
if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff
|
|
0 |
0 |
if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff
|
|
0 |
0 |
if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff
|
|
0 |
0 |
if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff
|
221741
|
0 |
0 |
nScore += (aSeen[ip] ? 1 : 1000); |
221743
|
0 |
0 |
if( iFirst<0 ) iFirst = iOff; |
221749
|
0 |
0 |
if( piPos ){ |
221751
|
0 |
0 |
if( (iAdj+nToken)>nDocsize ) iAdj = nDocsize - nToken; |
221752
|
0 |
0 |
if( iAdj<0 ) iAdj = 0; |
221766
|
0 |
0 |
return zRet ? zRet : ""; |
221795
|
0 |
0 |
if( nVal!=5 ){ |
221812
|
0 |
0 |
if( aSeen==0 ){ |
221815
|
0 |
0 |
if( rc==SQLITE_OK ){ |
221820
|
0 |
0 |
for(i=0; i
|
221821
|
0 |
0 |
if( iCol<0 || iCol==i ){ |
|
0 |
0 |
if( iCol<0 || iCol==i ){ |
221828
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
221832
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
221834
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
221836
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii
|
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii
|
221843
|
0 |
0 |
if( ic!=i ) continue; |
221844
|
0 |
0 |
if( io>nDocsize ) rc = FTS5_CORRUPT; |
221845
|
0 |
0 |
if( rc!=SQLITE_OK ) continue; |
221850
|
0 |
0 |
if( rc==SQLITE_OK && nScore>nBestScore ){ |
|
0 |
0 |
if( rc==SQLITE_OK && nScore>nBestScore ){ |
221857
|
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 ){ |
221858
|
0 |
0 |
for(jj=0; jj<(sFinder.nFirst-1); jj++){ |
221859
|
0 |
0 |
if( sFinder.aFirst[jj+1]>io ) break; |
221862
|
0 |
0 |
if( sFinder.aFirst[jj]
|
221868
|
0 |
0 |
nScore += (sFinder.aFirst[jj]==0 ? 120 : 100); |
221869
|
0 |
0 |
if( rc==SQLITE_OK && nScore>nBestScore ){ |
|
0 |
0 |
if( rc==SQLITE_OK && nScore>nBestScore ){ |
221881
|
0 |
0 |
if( rc==SQLITE_OK ){ |
221884
|
0 |
0 |
if( rc==SQLITE_OK && nColSize==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && nColSize==0 ){ |
221887
|
0 |
0 |
if( ctx.zIn ){ |
221888
|
0 |
0 |
if( rc==SQLITE_OK ){ |
221895
|
0 |
0 |
if( iBestStart>0 ){ |
221901
|
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
|
221905
|
0 |
0 |
if( rc==SQLITE_OK ){ |
221908
|
0 |
0 |
if( ctx.iRangeEnd>=(nColSize-1) ){ |
221914
|
0 |
0 |
if( rc==SQLITE_OK ){ |
221967
|
0 |
0 |
if( p==0 ){ |
221978
|
0 |
0 |
if( p==0 ){ |
221988
|
0 |
0 |
if( rc==SQLITE_OK ) rc = pApi->xRowCount(pFts, &nRow); |
221990
|
0 |
0 |
if( rc==SQLITE_OK ) rc = pApi->xColumnTotalSize(pFts, -1, &nToken); |
221991
|
0 |
0 |
if( rc==SQLITE_OK ) p->avgdl = (double)nToken / (double)nRow; |
221994
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
221997
|
0 |
0 |
if( rc==SQLITE_OK ){ |
222012
|
0 |
0 |
if( idf<=0.0 ) idf = 1e-6; |
222017
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
222022
|
0 |
0 |
if( rc!=SQLITE_OK ) p = 0; |
222051
|
0 |
0 |
if( rc==SQLITE_OK ){ |
222056
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
222059
|
0 |
0 |
if( rc==SQLITE_OK ){ |
222060
|
0 |
0 |
double w = (nVal > ic) ? sqlite3_value_double(apVal[ic]) : 1.0; |
222066
|
0 |
0 |
if( rc==SQLITE_OK ){ |
222074
|
0 |
0 |
if( rc==SQLITE_OK ){ |
222075
|
0 |
0 |
for(i=0; inPhrase; i++){ |
222101
|
1244 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
933 |
311 |
for(i=0; rc==SQLITE_OK && i
|
222131
|
0 |
0 |
if( (u32)pBuf->nSpace
|
222132
|
0 |
0 |
u64 nNew = pBuf->nSpace ? pBuf->nSpace : 64; |
222134
|
0 |
0 |
while( nNew
|
222138
|
0 |
0 |
if( pNew==0 ){ |
222155
|
0 |
0 |
if( fts5BufferGrow(pRc, pBuf, 9) ) return; |
|
0 |
0 |
if( fts5BufferGrow(pRc, pBuf, 9) ) return; |
222181
|
0 |
0 |
if( nData ){ |
222182
|
0 |
0 |
if( fts5BufferGrow(pRc, pBuf, nData) ) return; |
|
0 |
0 |
if( fts5BufferGrow(pRc, pBuf, nData) ) return; |
222216
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
222223
|
0 |
0 |
if( zTmp==0 ){ |
222234
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
222239
|
0 |
0 |
if( zRet==0 ){ |
222284
|
0 |
0 |
if( i>=n ){ |
222291
|
0 |
0 |
fts5FastGetVarint32(a, i, iVal); |
222292
|
0 |
0 |
if( iVal<=1 ){ |
222293
|
0 |
0 |
if( iVal==0 ){ |
222297
|
0 |
0 |
fts5FastGetVarint32(a, i, iVal); |
222300
|
0 |
0 |
fts5FastGetVarint32(a, i, iVal); |
222301
|
0 |
0 |
if( iVal<2 ){ |
222322
|
0 |
0 |
if( sqlite3Fts5PoslistNext64(pIter->a, pIter->n, &pIter->i, &pIter->iPos) ){ |
222350
|
0 |
0 |
if( iPos>=*piPrev ){ |
222352
|
0 |
0 |
if( (iPos & colmask) != (*piPrev & colmask) ){ |
222368
|
0 |
0 |
if( fts5BufferGrow(&rc, pBuf, 5+5+5) ) return rc; |
|
0 |
0 |
if( fts5BufferGrow(&rc, pBuf, 5+5+5) ) return rc; |
222375
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
222377
|
0 |
0 |
if( pRet==0 ){ |
222378
|
0 |
0 |
if( nByte>0 ) *pRc = SQLITE_NOMEM; |
222396
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
222397
|
0 |
0 |
if( nIn<0 ){ |
222401
|
0 |
0 |
if( zRet ){ |
222434
|
0 |
0 |
return (t & 0x80) || aBareword[(int)t]; |
|
0 |
0 |
return (t & 0x80) || aBareword[(int)t]; |
222466
|
0 |
0 |
if( p ){ |
222475
|
0 |
0 |
for(i=nTerm-1; i>=0; i--){ |
222481
|
0 |
0 |
for(pEntry=p->apHash[hash]; pEntry; pEntry=pEntry->pNext){ |
222482
|
0 |
0 |
if( pEntry->iIdx==iIdx |
222483
|
0 |
0 |
&& pEntry->nTerm==nTerm |
222484
|
0 |
0 |
&& memcmp(pEntry->pTerm, pTerm, nTerm)==0 |
222491
|
0 |
0 |
if( pEntry==0 ){ |
222493
|
0 |
0 |
if( pEntry ){ |
222508
|
0 |
0 |
if( p ){ |
222510
|
0 |
0 |
for(i=0; iapHash); i++){ |
222512
|
0 |
0 |
while( pEntry ){ |
222554
|
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=='`'); |
222564
|
0 |
0 |
if( p ){ |
222565
|
0 |
0 |
while( fts5_iswhitespace(*p) ){ p++; } |
222577
|
0 |
0 |
while ( sqlite3Fts5IsBareword(*p) ) p++; |
222578
|
0 |
0 |
if( p==pIn ) p = 0; |
222583
|
0 |
0 |
return (a>='0' && a<='9'); |
|
0 |
0 |
return (a>='0' && a<='9'); |
222592
|
0 |
0 |
if( sqlite3_strnicmp("null", p, 4)==0 ){ |
222601
|
0 |
0 |
if( *p=='\'' ){ |
222603
|
0 |
0 |
while( (*p>='a' && *p<='f') |
|
0 |
0 |
while( (*p>='a' && *p<='f') |
222604
|
0 |
0 |
|| (*p>='A' && *p<='F') |
|
0 |
0 |
|| (*p>='A' && *p<='F') |
222605
|
0 |
0 |
|| (*p>='0' && *p<='9') |
|
0 |
0 |
|| (*p>='0' && *p<='9') |
222609
|
0 |
0 |
if( *p=='\'' && 0==((p-pIn)%2) ){ |
|
0 |
0 |
if( *p=='\'' && 0==((p-pIn)%2) ){ |
222621
|
0 |
0 |
while( p ){ |
222622
|
0 |
0 |
if( *p=='\'' ){ |
222624
|
0 |
0 |
if( *p!='\'' ) break; |
222627
|
0 |
0 |
if( *p==0 ) p = 0; |
222633
|
0 |
0 |
if( *p=='+' || *p=='-' ) p++; |
|
0 |
0 |
if( *p=='+' || *p=='-' ) p++; |
222634
|
0 |
0 |
while( fts5_isdigit(*p) ) p++; |
222639
|
0 |
0 |
if( *p=='.' && fts5_isdigit(p[1]) ){ |
|
0 |
0 |
if( *p=='.' && fts5_isdigit(p[1]) ){ |
222641
|
0 |
0 |
while( fts5_isdigit(*p) ) p++; |
222643
|
0 |
0 |
if( p==pIn ) p = 0; |
222672
|
0 |
0 |
if( q=='[' ) q = ']'; |
222674
|
0 |
0 |
while( z[iIn] ){ |
222675
|
0 |
0 |
if( z[iIn]==q ){ |
222676
|
0 |
0 |
if( z[iIn+1]!=q ){ |
222714
|
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=='`' ){ |
222735
|
0 |
0 |
for(i=0; aEnum[i].zName; i++){ |
222736
|
0 |
0 |
if( sqlite3_strnicmp(aEnum[i].zName, zEnum, nEnum)==0 ){ |
222737
|
0 |
0 |
if( iVal>=0 ) return SQLITE_ERROR; |
222764
|
0 |
0 |
if( sqlite3_strnicmp("prefix", zCmd, nCmd)==0 ){ |
222768
|
0 |
0 |
if( pConfig->aPrefix==0 ){ |
222770
|
0 |
0 |
if( rc ) return rc; |
222777
|
0 |
0 |
while( p[0]==' ' ) p++; |
222778
|
0 |
0 |
if( bFirst==0 && p[0]==',' ){ |
|
0 |
0 |
if( bFirst==0 && p[0]==',' ){ |
222780
|
0 |
0 |
while( p[0]==' ' ) p++; |
222781
|
0 |
0 |
}else if( p[0]=='\0' ){ |
222784
|
0 |
0 |
if( p[0]<'0' || p[0]>'9' ){ |
|
0 |
0 |
if( p[0]<'0' || p[0]>'9' ){ |
222790
|
0 |
0 |
if( pConfig->nPrefix==FTS5_MAX_PREFIX_INDEXES ){ |
222798
|
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 ){ |
222803
|
0 |
0 |
if( nPre<=0 || nPre>=1000 ){ |
|
0 |
0 |
if( nPre<=0 || nPre>=1000 ){ |
222817
|
0 |
0 |
if( sqlite3_strnicmp("tokenize", zCmd, nCmd)==0 ){ |
222824
|
0 |
0 |
if( azArg && pSpace ){ |
|
0 |
0 |
if( azArg && pSpace ){ |
222825
|
0 |
0 |
if( pConfig->pTok ){ |
222829
|
0 |
0 |
for(nArg=0; p && *p; nArg++){ |
|
0 |
0 |
for(nArg=0; p && *p; nArg++){ |
222831
|
0 |
0 |
if( *p2=='\'' ){ |
222836
|
0 |
0 |
if( p ){ |
222844
|
0 |
0 |
if( p==0 ){ |
222861
|
0 |
0 |
if( sqlite3_strnicmp("content", zCmd, nCmd)==0 ){ |
222862
|
0 |
0 |
if( pConfig->eContent!=FTS5_CONTENT_NORMAL ){ |
222866
|
0 |
0 |
if( zArg[0] ){ |
222876
|
0 |
0 |
if( sqlite3_strnicmp("content_rowid", zCmd, nCmd)==0 ){ |
222877
|
0 |
0 |
if( pConfig->zContentRowid ){ |
222886
|
0 |
0 |
if( sqlite3_strnicmp("columnsize", zCmd, nCmd)==0 ){ |
222887
|
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' ){ |
222896
|
0 |
0 |
if( sqlite3_strnicmp("detail", zCmd, nCmd)==0 ){ |
222904
|
0 |
0 |
if( (rc = fts5ConfigSetEnum(aDetail, zArg, &pConfig->eDetail)) ){ |
222954
|
0 |
0 |
if( zOut==0 ){ |
222958
|
0 |
0 |
if( fts5_isopenquote(zOut[0]) ){ |
222964
|
0 |
0 |
if( zRet ){ |
222970
|
0 |
0 |
if( zRet==0 ){ |
222986
|
0 |
0 |
if( 0==sqlite3_stricmp(zCol, FTS5_RANK_NAME) |
222987
|
0 |
0 |
|| 0==sqlite3_stricmp(zCol, FTS5_ROWID_NAME) |
222991
|
0 |
0 |
}else if( zArg ){ |
222992
|
0 |
0 |
if( 0==sqlite3_stricmp(zArg, "unindexed") ){ |
223013
|
0 |
0 |
if( p->eContent!=FTS5_CONTENT_NONE ){ |
223014
|
0 |
0 |
for(i=0; inCol; i++){ |
223015
|
0 |
0 |
if( p->eContent==FTS5_CONTENT_EXTERNAL ){ |
223054
|
0 |
0 |
if( pRet==0 ) return SQLITE_NOMEM; |
223061
|
0 |
0 |
pRet->abUnindexed = pRet->azCol ? (u8*)&pRet->azCol[nArg] : 0; |
223069
|
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 ){ |
223074
|
0 |
0 |
for(i=3; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=3; rc==SQLITE_OK && i
|
223084
|
0 |
0 |
if( z && *z=='=' ){ |
|
0 |
0 |
if( z && *z=='=' ){ |
223088
|
0 |
0 |
if( bMustBeCol ) z = 0; |
223091
|
0 |
0 |
if( z && z[0] ){ |
|
0 |
0 |
if( z && z[0] ){ |
223094
|
0 |
0 |
if( z && z[0] ) z = 0; |
|
0 |
0 |
if( z && z[0] ) z = 0; |
223097
|
0 |
0 |
if( rc==SQLITE_OK ){ |
223098
|
0 |
0 |
if( z==0 ){ |
223102
|
0 |
0 |
if( bOption ){ |
223103
|
0 |
0 |
rc = fts5ConfigParseSpecial(pGlobal, pRet, |
|
0 |
0 |
rc = fts5ConfigParseSpecial(pGlobal, pRet, |
223122
|
0 |
0 |
if( rc==SQLITE_OK && pRet->pTok==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pRet->pTok==0 ){ |
223127
|
0 |
0 |
if( rc==SQLITE_OK && pRet->zContent==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pRet->zContent==0 ){ |
223132
|
0 |
0 |
if( pRet->eContent==FTS5_CONTENT_NORMAL ){ |
223134
|
0 |
0 |
}else if( pRet->bColumnsize ){ |
223138
|
0 |
0 |
if( zTail ){ |
223145
|
0 |
0 |
if( rc==SQLITE_OK && pRet->zContentRowid==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pRet->zContentRowid==0 ){ |
223150
|
0 |
0 |
if( rc==SQLITE_OK ){ |
223154
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
223165
|
0 |
0 |
if( pConfig ){ |
223167
|
0 |
0 |
if( pConfig->pTok ){ |
223172
|
0 |
0 |
for(i=0; inCol; i++){ |
223197
|
0 |
0 |
for(i=0; zSql && inCol; i++){ |
|
0 |
0 |
for(i=0; zSql && inCol; i++){ |
223198
|
0 |
0 |
const char *zSep = (i==0?"":", "); |
223206
|
0 |
0 |
if( zSql ){ |
223244
|
0 |
0 |
if( pText==0 ) return SQLITE_OK; |
223263
|
0 |
0 |
if( p==0 || *p==')' ) break; |
|
0 |
0 |
if( p==0 || *p==')' ) break; |
223264
|
0 |
0 |
if( *p!=',' ){ |
223297
|
0 |
0 |
if( p==0 ){ |
223304
|
0 |
0 |
if( p ){ |
223306
|
0 |
0 |
if( zRank ) memcpy(zRank, pRank, p-pRank); |
223311
|
0 |
0 |
if( rc==SQLITE_OK ){ |
223313
|
0 |
0 |
if( *p!='(' ) rc = SQLITE_ERROR; |
223316
|
0 |
0 |
if( rc==SQLITE_OK ){ |
223320
|
0 |
0 |
if( *p!=')' ){ |
223322
|
0 |
0 |
if( p==0 ){ |
223326
|
0 |
0 |
if( zRankArgs ) memcpy(zRankArgs, pArgs, p-pArgs); |
223332
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
223350
|
0 |
0 |
if( 0==sqlite3_stricmp(zKey, "pgsz") ){ |
223352
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ |
223355
|
0 |
0 |
if( pgsz<32 || pgsz>FTS5_MAX_PAGE_SIZE ){ |
|
0 |
0 |
if( pgsz<32 || pgsz>FTS5_MAX_PAGE_SIZE ){ |
223362
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "hashsize") ){ |
223364
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ |
223367
|
0 |
0 |
if( nHashSize<=0 ){ |
223374
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "automerge") ){ |
223376
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ |
223379
|
0 |
0 |
if( nAutomerge<0 || nAutomerge>64 ){ |
|
0 |
0 |
if( nAutomerge<0 || nAutomerge>64 ){ |
223382
|
0 |
0 |
if( nAutomerge==1 ) nAutomerge = FTS5_DEFAULT_AUTOMERGE; |
223387
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "usermerge") ){ |
223389
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ |
223392
|
0 |
0 |
if( nUsermerge<2 || nUsermerge>16 ){ |
|
0 |
0 |
if( nUsermerge<2 || nUsermerge>16 ){ |
223399
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "crisismerge") ){ |
223401
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){ |
223404
|
0 |
0 |
if( nCrisisMerge<0 ){ |
223407
|
0 |
0 |
if( nCrisisMerge<=1 ) nCrisisMerge = FTS5_DEFAULT_CRISISMERGE; |
223408
|
0 |
0 |
if( nCrisisMerge>=FTS5_MAX_SEGMENT ) nCrisisMerge = FTS5_MAX_SEGMENT-1; |
223413
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "rank") ){ |
223418
|
0 |
0 |
if( rc==SQLITE_OK ){ |
223423
|
0 |
0 |
}else if( rc==SQLITE_ERROR ){ |
223451
|
0 |
0 |
if( zSql ){ |
223457
|
0 |
0 |
if( rc==SQLITE_OK ){ |
223458
|
0 |
0 |
while( SQLITE_ROW==sqlite3_step(p) ){ |
223461
|
0 |
0 |
if( 0==sqlite3_stricmp(zK, "version") ){ |
223471
|
0 |
0 |
if( rc==SQLITE_OK && iVersion!=FTS5_CURRENT_VERSION ){ |
|
0 |
0 |
if( rc==SQLITE_OK && iVersion!=FTS5_CURRENT_VERSION ){ |
223473
|
0 |
0 |
if( pConfig->pzErrmsg ){ |
223482
|
0 |
0 |
if( rc==SQLITE_OK ){ |
223624
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){ |
223633
|
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'; |
223648
|
0 |
0 |
while( fts5ExprIsspace(*z) ) z++; |
223670
|
0 |
0 |
if( z2[0]=='"' ){ |
223672
|
0 |
0 |
if( z2[0]!='"' ) break; |
223674
|
0 |
0 |
if( z2[0]=='\0' ){ |
223685
|
0 |
0 |
if( sqlite3Fts5IsBareword(z[0])==0 ){ |
223690
|
0 |
0 |
for(z2=&z[1]; sqlite3Fts5IsBareword(*z2); z2++); |
223692
|
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; |
223693
|
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; |
223694
|
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; |
223726
|
0 |
0 |
if( pEngine==0 ){ return SQLITE_NOMEM; } |
223732
|
0 |
0 |
}while( sParse.rc==SQLITE_OK && t!=FTS5_EOF ); |
|
0 |
0 |
}while( sParse.rc==SQLITE_OK && t!=FTS5_EOF ); |
223737
|
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 ){ |
223740
|
0 |
0 |
if( pColset ){ |
223748
|
0 |
0 |
if( sParse.rc==SQLITE_OK ){ |
223750
|
0 |
0 |
if( pNew==0 ){ |
223754
|
0 |
0 |
if( !sParse.pExpr ){ |
223757
|
0 |
0 |
if( pNew->pRoot ){ |
223794
|
0 |
0 |
if( zExpr==0 ){ |
223802
|
0 |
0 |
if( bGlob==0 ){ |
223812
|
0 |
0 |
while( i<=nText ){ |
223813
|
0 |
0 |
if( i==nText |
223814
|
0 |
0 |
|| zText[i]==aSpec[0] || zText[i]==aSpec[1] || zText[i]==aSpec[2] |
|
0 |
0 |
|| zText[i]==aSpec[0] || zText[i]==aSpec[1] || zText[i]==aSpec[2] |
|
0 |
0 |
|| zText[i]==aSpec[0] || zText[i]==aSpec[1] || zText[i]==aSpec[2] |
223816
|
0 |
0 |
if( i-iFirst>=3 ){ |
223819
|
0 |
0 |
for(jj=iFirst; jj
|
223821
|
0 |
0 |
if( zText[jj]=='"' ) zExpr[iOut++] = '"'; |
223826
|
0 |
0 |
if( zText[i]==aSpec[2] ){ |
223828
|
0 |
0 |
if( zText[i-1]=='^' ) i++; |
223829
|
0 |
0 |
while( i
|
|
0 |
0 |
while( i
|
223835
|
0 |
0 |
if( iOut>0 ){ |
223837
|
0 |
0 |
if( pConfig->eDetail!=FTS5_DETAIL_FULL ){ |
223839
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_NONE ){ |
223858
|
0 |
0 |
if( p ){ |
223860
|
0 |
0 |
for(i=0; inChild; i++){ |
223872
|
0 |
0 |
if( p ){ |
223883
|
0 |
0 |
if( *pp1 ){ |
223890
|
0 |
0 |
if( sParse.rc==SQLITE_OK ){ |
223894
|
0 |
0 |
if( ap==0 ){ |
223899
|
0 |
0 |
for(i=0; inPhrase; i++){ |
223927
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){ |
223928
|
0 |
0 |
if( 0==sqlite3Fts5IterEof(p->pIter) ){ |
223930
|
0 |
0 |
if( bRetValid==0 || (bDesc!=(iRowid
|
|
0 |
0 |
if( bRetValid==0 || (bDesc!=(iRowid
|
223937
|
0 |
0 |
if( pbEof && bRetValid==0 ) *pbEof = 1; |
|
0 |
0 |
if( pbEof && bRetValid==0 ) *pbEof = 1; |
223958
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){ |
223960
|
0 |
0 |
if( sqlite3Fts5IterEof(pIter)==0 && pIter->iRowid==iRowid ){ |
|
0 |
0 |
if( sqlite3Fts5IterEof(pIter)==0 && pIter->iRowid==iRowid ){ |
223961
|
0 |
0 |
if( pIter->nData==0 ) continue; |
223962
|
0 |
0 |
if( nIter==nAlloc ){ |
223965
|
0 |
0 |
if( aNew==0 ){ |
223971
|
0 |
0 |
if( aIter!=aStatic ) sqlite3_free(aIter); |
223980
|
0 |
0 |
if( nIter==1 ){ |
223990
|
0 |
0 |
for(i=0; i
|
223991
|
0 |
0 |
if( aIter[i].bEof==0 ){ |
223992
|
0 |
0 |
if( aIter[i].iPos==iPrev ){ |
223993
|
0 |
0 |
if( sqlite3Fts5PoslistReaderNext(&aIter[i]) ) continue; |
223995
|
0 |
0 |
if( aIter[i].iPos
|
224000
|
0 |
0 |
if( iMin==FTS5_LARGEST_INT64 || rc!=SQLITE_OK ) break; |
|
0 |
0 |
if( iMin==FTS5_LARGEST_INT64 || rc!=SQLITE_OK ) break; |
224004
|
0 |
0 |
if( rc==SQLITE_OK ){ |
224011
|
0 |
0 |
if( aIter!=aStatic ) sqlite3_free(aIter); |
224043
|
0 |
0 |
if( pPhrase->nTerm>ArraySize(aStatic) ){ |
224046
|
0 |
0 |
if( !aIter ) return SQLITE_NOMEM; |
224051
|
0 |
0 |
for(i=0; inTerm; i++){ |
224056
|
0 |
0 |
if( pTerm->pSynonym ){ |
224059
|
0 |
0 |
if( rc ){ |
224063
|
0 |
0 |
if( a==buf.p ) bFlag = 1; |
224070
|
0 |
0 |
if( aIter[i].bEof ) goto ismatch_out; |
224078
|
0 |
0 |
for(i=0; inTerm; i++){ |
224081
|
0 |
0 |
if( pPos->iPos!=iAdj ){ |
224083
|
0 |
0 |
while( pPos->iPos
|
224084
|
0 |
0 |
if( sqlite3Fts5PoslistReaderNext(pPos) ) goto ismatch_out; |
224086
|
0 |
0 |
if( pPos->iPos>iAdj ) iPos = pPos->iPos-i; |
224089
|
0 |
0 |
}while( bMatch==0 ); |
224092
|
0 |
0 |
if( bFirst==0 || FTS5_POS2OFFSET(iPos)==0 ){ |
|
0 |
0 |
if( bFirst==0 || FTS5_POS2OFFSET(iPos)==0 ){ |
224094
|
0 |
0 |
if( rc!=SQLITE_OK ) goto ismatch_out; |
224097
|
0 |
0 |
for(i=0; inTerm; i++){ |
224098
|
0 |
0 |
if( sqlite3Fts5PoslistReaderNext(&aIter[i]) ) goto ismatch_out; |
224104
|
0 |
0 |
for(i=0; inTerm; i++){ |
224105
|
0 |
0 |
if( aIter[i].bFlag ) sqlite3_free((u8*)aIter[i].a); |
224107
|
0 |
0 |
if( aIter!=aStatic ) sqlite3_free(aIter); |
224124
|
0 |
0 |
if( sqlite3Fts5PoslistNext64(p->a, p->n, &p->i, &p->iLookahead) ){ |
224178
|
0 |
0 |
if( pNear->nPhrase>ArraySize(aStatic) ){ |
224184
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
224197
|
0 |
0 |
for(i=0; inPhrase; i++){ |
224214
|
0 |
0 |
for(i=0; inPhrase; i++){ |
224217
|
0 |
0 |
if( pPos->iPosiPos>iMax ){ |
|
0 |
0 |
if( pPos->iPosiPos>iMax ){ |
224219
|
0 |
0 |
while( pPos->iPos
|
224220
|
0 |
0 |
if( fts5LookaheadReaderNext(pPos) ) goto ismatch_out; |
224222
|
0 |
0 |
if( pPos->iPos>iMax ) iMax = pPos->iPos; |
224225
|
0 |
0 |
}while( bMatch==0 ); |
224228
|
0 |
0 |
for(i=0; inPhrase; i++){ |
224231
|
0 |
0 |
if( a[i].pOut->n==0 || iPos!=pWriter->iPrev ){ |
|
0 |
0 |
if( a[i].pOut->n==0 || iPos!=pWriter->iPrev ){ |
224238
|
0 |
0 |
for(i=0; inPhrase; i++){ |
224239
|
0 |
0 |
if( a[i].reader.iLookahead < iMin ){ |
224244
|
0 |
0 |
if( fts5LookaheadReaderNext(&a[iAdv].reader) ) goto ismatch_out; |
224250
|
0 |
0 |
if( a!=aStatic ) sqlite3_free(a); |
224275
|
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
|
224277
|
0 |
0 |
if( rc || sqlite3Fts5IterEof(pIter) ){ |
|
0 |
0 |
if( rc || sqlite3Fts5IterEof(pIter) ){ |
224301
|
0 |
0 |
for(p=pTerm; rc==SQLITE_OK && p; p=p->pSynonym){ |
|
0 |
0 |
for(p=pTerm; rc==SQLITE_OK && p; p=p->pSynonym){ |
224302
|
0 |
0 |
if( sqlite3Fts5IterEof(p->pIter)==0 ){ |
224304
|
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
|
224310
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
224328
|
0 |
0 |
if( pExpr->pConfig->eDetail!=FTS5_DETAIL_FULL ){ |
224332
|
0 |
0 |
for(pTerm=&pPhrase->aTerm[0]; pTerm; pTerm=pTerm->pSynonym){ |
224334
|
0 |
0 |
if( sqlite3Fts5IterEof(pIter)==0 ){ |
224335
|
0 |
0 |
if( pIter->iRowid==pNode->iRowid && pIter->nData>0 ){ |
|
0 |
0 |
if( pIter->iRowid==pNode->iRowid && pIter->nData>0 ){ |
224347
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inPhrase; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inPhrase; i++){ |
224349
|
0 |
0 |
if( pPhrase->nTerm>1 || pPhrase->aTerm[0].pSynonym |
|
0 |
0 |
if( pPhrase->nTerm>1 || pPhrase->aTerm[0].pSynonym |
224350
|
0 |
0 |
|| pNear->pColset || pPhrase->aTerm[0].bFirst |
|
0 |
0 |
|| pNear->pColset || pPhrase->aTerm[0].bFirst |
224354
|
0 |
0 |
if( bMatch==0 ) break; |
224362
|
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)) ){ |
224387
|
0 |
0 |
for(i=0; inPhrase; i++){ |
224389
|
0 |
0 |
if( pPhrase->nTerm==0 ){ |
224394
|
0 |
0 |
for(j=0; jnTerm; j++){ |
224399
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){ |
224401
|
0 |
0 |
if( p->pIter ){ |
224408
|
0 |
0 |
(pExpr->bDesc ? FTS5INDEX_QUERY_DESC : 0), |
224413
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
224414
|
0 |
0 |
if( 0==sqlite3Fts5IterEof(p->pIter) ){ |
224419
|
0 |
0 |
if( bHit==0 ){ |
224447
|
0 |
0 |
if( pExpr->bDesc==0 ){ |
224448
|
0 |
0 |
if( iLhs
|
224451
|
0 |
0 |
if( iLhs>iRhs ) return -1; |
224460
|
0 |
0 |
for(i=0; inChild; i++){ |
224466
|
0 |
0 |
if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){ |
|
0 |
0 |
if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){ |
224469
|
0 |
0 |
for(i=0; inPhrase; i++){ |
224475
|
0 |
0 |
for(i=0; inChild; i++){ |
224500
|
0 |
0 |
if( p2->bEof ) return -1; |
224501
|
0 |
0 |
if( p1->bEof ) return +1; |
224539
|
0 |
0 |
if( pLeft->aTerm[0].pSynonym ){ |
224547
|
0 |
0 |
for(i=0; inPhrase; i++){ |
224549
|
0 |
0 |
for(j=0; jnTerm; j++){ |
224551
|
0 |
0 |
if( pTerm->pSynonym ){ |
224553
|
0 |
0 |
if( iRowid==iLast ) continue; |
224555
|
0 |
0 |
if( fts5ExprSynonymAdvanceto(pTerm, bDesc, &iLast, &rc) ){ |
224562
|
0 |
0 |
if( pIter->iRowid==iLast || pIter->bEof ) continue; |
|
0 |
0 |
if( pIter->iRowid==iLast || pIter->bEof ) continue; |
224564
|
0 |
0 |
if( fts5ExprAdvanceto(pIter, bDesc, &iLast, &rc, &pNode->bEof) ){ |
224570
|
0 |
0 |
}while( bMatch==0 ); |
224573
|
0 |
0 |
pNode->bNomatch = ((0==fts5ExprNearTest(&rc, pExpr, pNode)) && rc==SQLITE_OK); |
|
0 |
0 |
pNode->bNomatch = ((0==fts5ExprNearTest(&rc, pExpr, pNode)) && rc==SQLITE_OK); |
224596
|
0 |
0 |
if( pTerm->pSynonym ){ |
224605
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){ |
224606
|
0 |
0 |
if( sqlite3Fts5IterEof(p->pIter)==0 ){ |
224608
|
0 |
0 |
if( ii==iRowid |
224609
|
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) |
224611
|
0 |
0 |
if( bFromValid ){ |
224616
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
224617
|
0 |
0 |
if( sqlite3Fts5IterEof(p->pIter)==0 ){ |
224628
|
0 |
0 |
pNode->bEof = (rc || bEof); |
|
0 |
0 |
pNode->bEof = (rc || bEof); |
224633
|
0 |
0 |
if( bFromValid ){ |
224639
|
0 |
0 |
pNode->bEof = (rc || sqlite3Fts5IterEof(pIter)); |
|
0 |
0 |
pNode->bEof = (rc || sqlite3Fts5IterEof(pIter)); |
224642
|
0 |
0 |
if( pNode->bEof==0 ){ |
224668
|
0 |
0 |
if( pExpr->pConfig->eDetail==FTS5_DETAIL_FULL ){ |
224689
|
0 |
0 |
if( bFromValid ){ |
224694
|
0 |
0 |
if( rc==SQLITE_OK && sqlite3Fts5IterEof(pIter)==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && sqlite3Fts5IterEof(pIter)==0 ){ |
224710
|
0 |
0 |
for(i=1; inChild; i++){ |
224713
|
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) ){ |
224731
|
0 |
0 |
for(i=0; inChild; i++){ |
224734
|
0 |
0 |
if( p1->bEof==0 ){ |
224735
|
0 |
0 |
if( (p1->iRowid==iLast) |
224736
|
0 |
0 |
|| (bFromValid && fts5RowidCmp(pExpr, p1->iRowid, iFrom)<0) |
|
0 |
0 |
|| (bFromValid && fts5RowidCmp(pExpr, p1->iRowid, iFrom)<0) |
224739
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
224767
|
0 |
0 |
for(iChild=0; iChildnChild; iChild++){ |
224770
|
0 |
0 |
if( cmp>0 ){ |
224773
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
224784
|
0 |
0 |
if( pChild->bEof ){ |
224788
|
0 |
0 |
}else if( iLast!=pChild->iRowid ){ |
224793
|
0 |
0 |
if( pChild->bNomatch ){ |
224797
|
0 |
0 |
}while( bMatch==0 ); |
224799
|
0 |
0 |
if( pAnd->bNomatch && pAnd!=pExpr->pRoot ){ |
|
0 |
0 |
if( pAnd->bNomatch && pAnd!=pExpr->pRoot ){ |
224813
|
0 |
0 |
if( rc==SQLITE_OK ){ |
224830
|
0 |
0 |
while( rc==SQLITE_OK && p1->bEof==0 ){ |
|
0 |
0 |
while( rc==SQLITE_OK && p1->bEof==0 ){ |
224832
|
0 |
0 |
if( cmp>0 ){ |
224837
|
0 |
0 |
if( cmp || p2->bNomatch ) break; |
|
0 |
0 |
if( cmp || p2->bNomatch ) break; |
224843
|
0 |
0 |
if( p1->bEof ){ |
224856
|
0 |
0 |
if( rc==SQLITE_OK ){ |
224859
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
224875
|
0 |
0 |
if( pNode->bEof==0 ){ |
224920
|
0 |
0 |
if( Fts5NodeIsString(pNode) ){ |
|
0 |
0 |
if( Fts5NodeIsString(pNode) ){ |
224923
|
0 |
0 |
}else if( pNode->xNext==0 ){ |
224928
|
0 |
0 |
for(i=0; inChild && rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; inChild && rc==SQLITE_OK; i++){ |
224938
|
0 |
0 |
if( nEof>0 ) fts5ExprSetEof(pNode); |
224942
|
0 |
0 |
if( pNode->nChild==nEof ) fts5ExprSetEof(pNode); |
224952
|
0 |
0 |
if( rc==SQLITE_OK ){ |
224984
|
0 |
0 |
if( rc==SQLITE_OK |
224985
|
0 |
0 |
&& 0==pRoot->bEof |
224986
|
0 |
0 |
&& fts5RowidCmp(p, pRoot->iRowid, iFirst)<0 |
224992
|
0 |
0 |
while( pRoot->bNomatch && rc==SQLITE_OK ){ |
|
0 |
0 |
while( pRoot->bNomatch && rc==SQLITE_OK ){ |
225012
|
0 |
0 |
}while( pRoot->bNomatch ); |
225013
|
0 |
0 |
if( fts5RowidCmp(p, pRoot->iRowid, iLast)>0 ){ |
225037
|
0 |
0 |
if( pPhrase ){ |
225039
|
0 |
0 |
for(i=0; inTerm; i++){ |
225045
|
0 |
0 |
for(pSyn=pTerm->pSynonym; pSyn; pSyn=pNext){ |
225052
|
0 |
0 |
if( pPhrase->poslist.nSpace>0 ) fts5BufferFree(&pPhrase->poslist); |
225062
|
0 |
0 |
if( pPhrase && pPhrase->nTerm ){ |
|
0 |
0 |
if( pPhrase && pPhrase->nTerm ){ |
225083
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){ |
225084
|
0 |
0 |
if( pPhrase==0 ){ |
225087
|
0 |
0 |
if( pNear==0 ){ |
225091
|
0 |
0 |
if( pRet==0 ){ |
225096
|
0 |
0 |
}else if( (pNear->nPhrase % SZALLOC)==0 ){ |
225102
|
0 |
0 |
if( pRet==0 ){ |
225110
|
0 |
0 |
if( pRet==0 ){ |
225115
|
0 |
0 |
if( pRet->nPhrase>0 ){ |
225121
|
0 |
0 |
if( pPhrase->nTerm==0 ){ |
225126
|
0 |
0 |
}else if( pLast->nTerm==0 ){ |
225163
|
0 |
0 |
if( pCtx->rc!=SQLITE_OK ) return pCtx->rc; |
225164
|
0 |
0 |
if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE; |
225166
|
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) ){ |
225170
|
0 |
0 |
if( pSyn==0 ){ |
225181
|
0 |
0 |
if( pPhrase==0 || (pPhrase->nTerm % SZALLOC)==0 ){ |
|
0 |
0 |
if( pPhrase==0 || (pPhrase->nTerm % SZALLOC)==0 ){ |
225183
|
0 |
0 |
int nNew = SZALLOC + (pPhrase ? pPhrase->nTerm : 0); |
225188
|
0 |
0 |
if( pNew==0 ){ |
225191
|
0 |
0 |
if( pPhrase==0 ) memset(pNew, 0, sizeof(Fts5ExprPhrase)); |
225197
|
0 |
0 |
if( rc==SQLITE_OK ){ |
225220
|
0 |
0 |
if( pNear ){ |
225222
|
0 |
0 |
for(i=0; inPhrase; i++){ |
225236
|
0 |
0 |
if( (pParse->nPhrase % 8)==0 ){ |
225240
|
0 |
0 |
if( apNew==0 ){ |
225269
|
0 |
0 |
if( rc==SQLITE_OK ){ |
225270
|
0 |
0 |
int flags = FTS5_TOKENIZE_QUERY | (bPrefix ? FTS5_TOKENIZE_PREFIX : 0); |
225277
|
0 |
0 |
if( rc || (rc = sCtx.rc) ){ |
|
0 |
0 |
if( rc || (rc = sCtx.rc) ){ |
225283
|
0 |
0 |
if( pAppend==0 ){ |
225284
|
0 |
0 |
if( parseGrowPhraseArray(pParse) ){ |
225291
|
0 |
0 |
if( sCtx.pPhrase==0 ){ |
225295
|
0 |
0 |
}else if( sCtx.pPhrase->nTerm ){ |
225320
|
0 |
0 |
if( rc==SQLITE_OK ){ |
225324
|
0 |
0 |
if( rc==SQLITE_OK ){ |
225328
|
0 |
0 |
if( rc==SQLITE_OK ){ |
225332
|
0 |
0 |
if( rc==SQLITE_OK ){ |
225334
|
0 |
0 |
if( pColsetOrig ){ |
225339
|
0 |
0 |
if( pColset ){ |
225346
|
0 |
0 |
if( pOrig->nTerm ){ |
225348
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inTerm; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inTerm; i++){ |
225351
|
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){ |
225357
|
0 |
0 |
if( rc==SQLITE_OK ){ |
225368
|
0 |
0 |
if( rc==SQLITE_OK && ALWAYS(sCtx.pPhrase) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && ALWAYS(sCtx.pPhrase) ){ |
225378
|
0 |
0 |
if( pOrig->nTerm==1 |
225379
|
0 |
0 |
&& pOrig->aTerm[0].pSynonym==0 |
225380
|
0 |
0 |
&& pOrig->aTerm[0].bFirst==0 |
225405
|
0 |
0 |
if( pTok->n!=4 || memcmp("NEAR", pTok->p, 4) ){ |
|
0 |
0 |
if( pTok->n!=4 || memcmp("NEAR", pTok->p, 4) ){ |
225417
|
0 |
0 |
if( pNear ){ |
225420
|
0 |
0 |
if( p->n ){ |
225421
|
0 |
0 |
for(i=0; in; i++){ |
225423
|
0 |
0 |
if( c<'0' || c>'9' ){ |
|
0 |
0 |
if( c<'0' || c>'9' ){ |
225452
|
0 |
0 |
int nCol = p ? p->nCol : 0; /* Num. columns already in colset object */ |
225459
|
0 |
0 |
if( pNew==0 ){ |
225464
|
0 |
0 |
for(i=0; i
|
225465
|
0 |
0 |
if( aiCol[i]==iCol ) return pNew; |
225466
|
0 |
0 |
if( aiCol[i]>iCol ) break; |
225468
|
0 |
0 |
for(j=nCol; j>i; j--){ |
225495
|
0 |
0 |
if( pRet ){ |
225498
|
0 |
0 |
for(i=0; i
|
225499
|
0 |
0 |
if( iOld>=p->nCol || p->aiCol[iOld]!=i ){ |
|
0 |
0 |
if( iOld>=p->nCol || p->aiCol[iOld]!=i ){ |
225521
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){ |
225524
|
0 |
0 |
for(iCol=0; iColnCol; iCol++){ |
225525
|
0 |
0 |
if( 0==sqlite3_stricmp(pConfig->azCol[iCol], z) ) break; |
225527
|
0 |
0 |
if( iCol==pConfig->nCol ){ |
225535
|
0 |
0 |
if( pRet==0 ){ |
225553
|
0 |
0 |
if( pOrig ){ |
225556
|
0 |
0 |
if( pRet ){ |
225573
|
0 |
0 |
while( iInnCol && iMergenCol ){ |
|
0 |
0 |
while( iInnCol && iMergenCol ){ |
225575
|
0 |
0 |
if( iDiff==0 ){ |
225579
|
0 |
0 |
}else if( iDiff>0 ){ |
225600
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){ |
225605
|
0 |
0 |
if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){ |
|
0 |
0 |
if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){ |
225607
|
0 |
0 |
if( pNear->pColset ){ |
225609
|
0 |
0 |
if( pNear->pColset->nCol==0 ){ |
225613
|
0 |
0 |
}else if( *ppFree ){ |
225622
|
0 |
0 |
for(i=0; inChild; i++){ |
225638
|
0 |
0 |
if( pParse->pConfig->eDetail==FTS5_DETAIL_NONE ){ |
225652
|
0 |
0 |
if( pNear->nPhrase==1 && pNear->apPhrase[0]->nTerm==1 |
|
0 |
0 |
if( pNear->nPhrase==1 && pNear->apPhrase[0]->nTerm==1 |
225653
|
0 |
0 |
&& pNear->apPhrase[0]->aTerm[0].pSynonym==0 |
225654
|
0 |
0 |
&& pNear->apPhrase[0]->aTerm[0].bFirst==0 |
225682
|
0 |
0 |
if( p->eType!=FTS5_NOT && pSub->eType==p->eType ){ |
|
0 |
0 |
if( p->eType!=FTS5_NOT && pSub->eType==p->eType ){ |
225717
|
0 |
0 |
if( pRet ){ |
225722
|
0 |
0 |
for(ii=0; ii
|
225726
|
0 |
0 |
if( pPhrase ){ |
225727
|
0 |
0 |
if( parseGrowPhraseArray(pParse) ){ |
225742
|
0 |
0 |
if( pParse->rc ){ |
225766
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){ |
225773
|
0 |
0 |
if( eType==FTS5_STRING && pNear==0 ) return 0; |
|
0 |
0 |
if( eType==FTS5_STRING && pNear==0 ) return 0; |
225774
|
0 |
0 |
if( eType!=FTS5_STRING && pLeft==0 ) return pRight; |
|
0 |
0 |
if( eType!=FTS5_STRING && pLeft==0 ) return pRight; |
225775
|
0 |
0 |
if( eType!=FTS5_STRING && pRight==0 ) return pLeft; |
|
0 |
0 |
if( eType!=FTS5_STRING && pRight==0 ) return pLeft; |
225777
|
0 |
0 |
if( eType==FTS5_STRING |
225778
|
0 |
0 |
&& pParse->bPhraseToAnd |
225779
|
0 |
0 |
&& pNear->apPhrase[0]->nTerm>1 |
225783
|
0 |
0 |
if( eType==FTS5_NOT ){ |
225785
|
0 |
0 |
}else if( eType==FTS5_AND || eType==FTS5_OR ){ |
|
0 |
0 |
}else if( eType==FTS5_AND || eType==FTS5_OR ){ |
225787
|
0 |
0 |
if( pLeft->eType==eType ) nChild += pLeft->nChild-1; |
225788
|
0 |
0 |
if( pRight->eType==eType ) nChild += pRight->nChild-1; |
225794
|
0 |
0 |
if( pRet ){ |
225798
|
0 |
0 |
if( eType==FTS5_STRING ){ |
225800
|
0 |
0 |
for(iPhrase=0; iPhrasenPhrase; iPhrase++){ |
225802
|
0 |
0 |
if( pNear->apPhrase[iPhrase]->nTerm==0 ){ |
225808
|
0 |
0 |
if( pParse->pConfig->eDetail!=FTS5_DETAIL_FULL ){ |
225810
|
0 |
0 |
if( pNear->nPhrase!=1 |
225811
|
0 |
0 |
|| pPhrase->nTerm>1 |
225812
|
0 |
0 |
|| (pPhrase->nTerm>0 && pPhrase->aTerm[0].bFirst) |
|
0 |
0 |
|| (pPhrase->nTerm>0 && pPhrase->aTerm[0].bFirst) |
225814
|
0 |
0 |
sqlite3Fts5ParseError(pParse, |
225830
|
0 |
0 |
if( pRet==0 ){ |
225847
|
0 |
0 |
if( pParse->rc ){ |
225862
|
0 |
0 |
if( pLeft->eType==FTS5_AND ){ |
225872
|
0 |
0 |
if( pRight->eType==FTS5_EOF ){ |
225878
|
0 |
0 |
else if( pPrev->eType==FTS5_EOF ){ |
225881
|
0 |
0 |
if( pPrev==pLeft ){ |
226314
|
0 |
0 |
return (pExpr ? pExpr->nPhrase : 0); |
226321
|
0 |
0 |
if( iPhrase<0 || iPhrase>=pExpr->nPhrase ) return 0; |
|
0 |
0 |
if( iPhrase<0 || iPhrase>=pExpr->nPhrase ) return 0; |
226333
|
0 |
0 |
if( pNode->bEof==0 && pNode->iRowid==pExpr->pRoot->iRowid ){ |
|
0 |
0 |
if( pNode->bEof==0 && pNode->iRowid==pExpr->pRoot->iRowid ){ |
226361
|
0 |
0 |
if( pRet ){ |
226364
|
0 |
0 |
for(i=0; inPhrase; i++){ |
226368
|
0 |
0 |
if( bLive && |
|
0 |
0 |
if( bLive && |
226369
|
0 |
0 |
(pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof) |
|
0 |
0 |
(pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof) |
226392
|
0 |
0 |
for(i=0; inCol; i++){ |
226393
|
0 |
0 |
if( pColset->aiCol[i]==iCol ) return 1; |
226412
|
0 |
0 |
if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE; |
226413
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ) p->iOff++; |
226414
|
0 |
0 |
for(i=0; inPhrase; i++){ |
226416
|
0 |
0 |
if( p->aPopulator[i].bOk==0 ) continue; |
226417
|
0 |
0 |
for(pTerm=&pExpr->apExprPhrase[i]->aTerm[0]; pTerm; pTerm=pTerm->pSynonym){ |
226419
|
0 |
0 |
if( (nTerm==nToken || (nTermbPrefix)) |
|
0 |
0 |
if( (nTerm==nToken || (nTermbPrefix)) |
|
0 |
0 |
if( (nTerm==nToken || (nTermbPrefix)) |
226420
|
0 |
0 |
&& memcmp(pTerm->zTerm, pToken, nTerm)==0 |
226425
|
0 |
0 |
if( rc ) return rc; |
226446
|
0 |
0 |
for(i=0; inPhrase; i++){ |
226449
|
0 |
0 |
if( (pColset && 0==fts5ExprColsetTest(pColset, iCol)) |
|
0 |
0 |
if( (pColset && 0==fts5ExprColsetTest(pColset, iCol)) |
226450
|
0 |
0 |
|| aPopulator[i].bMiss |
226464
|
0 |
0 |
if( pNode->eType==FTS5_TERM || pNode->eType==FTS5_STRING ){ |
|
0 |
0 |
if( pNode->eType==FTS5_TERM || pNode->eType==FTS5_STRING ){ |
226468
|
0 |
0 |
for(i=0; inChild; i++){ |
226484
|
0 |
0 |
for(i=0; inChild; i++){ |
226485
|
0 |
0 |
if( fts5ExprCheckPoslists(pNode->apChild[i], iRowid)==0 ){ |
226496
|
0 |
0 |
for(i=0; inChild; i++){ |
226497
|
0 |
0 |
if( fts5ExprCheckPoslists(pNode->apChild[i], iRowid) ){ |
226506
|
0 |
0 |
if( 0==fts5ExprCheckPoslists(pNode->apChild[0], iRowid) |
226507
|
0 |
0 |
|| 0!=fts5ExprCheckPoslists(pNode->apChild[1], iRowid) |
226538
|
0 |
0 |
if( pNode->bEof==0 |
226539
|
0 |
0 |
&& pNode->iRowid==pExpr->pRoot->iRowid |
226540
|
0 |
0 |
&& pPhrase->poslist.n>0 |
226543
|
0 |
0 |
if( pTerm->pSynonym ){ |
226649
|
0 |
0 |
if( pNew==0 ){ |
226660
|
0 |
0 |
if( pNew->aSlot==0 ){ |
226675
|
0 |
0 |
if( pHash ){ |
226687
|
0 |
0 |
for(i=0; inSlot; i++){ |
226690
|
0 |
0 |
for(pSlot=pHash->aSlot[i]; pSlot; pSlot=pNext){ |
226702
|
0 |
0 |
for(i=n-1; i>=0; i--){ |
226711
|
0 |
0 |
for(i=n-1; i>=0; i--){ |
226728
|
0 |
0 |
if( !apNew ) return SQLITE_NOMEM; |
226731
|
0 |
0 |
for(i=0; inSlot; i++){ |
226732
|
0 |
0 |
while( apOld[i] ){ |
226755
|
0 |
0 |
if( p->iSzPoslist ){ |
226756
|
0 |
0 |
u8 *pPtr = p2 ? (u8*)p2 : (u8*)p; |
226758
|
0 |
0 |
if( pHash->eDetail==FTS5_DETAIL_NONE ){ |
226760
|
0 |
0 |
if( p->bDel ){ |
226762
|
0 |
0 |
if( p->bContent ){ |
226771
|
0 |
0 |
if( nPos<=127 ){ |
226782
|
0 |
0 |
if( p2==0 ){ |
226818
|
0 |
0 |
for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ |
226820
|
0 |
0 |
if( zKey[0]==bByte |
226821
|
0 |
0 |
&& p->nKey==nToken |
226822
|
0 |
0 |
&& memcmp(&zKey[1], pToken, nToken)==0 |
226829
|
0 |
0 |
if( p==0 ){ |
226833
|
0 |
0 |
if( nByte<128 ) nByte = 128; |
226836
|
0 |
0 |
if( (pHash->nEntry*2)>=pHash->nSlot ){ |
226838
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
226844
|
0 |
0 |
if( !p ) return SQLITE_NOMEM; |
226863
|
0 |
0 |
if( pHash->eDetail!=FTS5_DETAIL_NONE ){ |
226865
|
0 |
0 |
p->iCol = (pHash->eDetail==FTS5_DETAIL_FULL ? 0 : -1); |
226880
|
0 |
0 |
if( (p->nAlloc - p->nData) < (9 + 4 + 1 + 3 + 5) ){ |
226885
|
0 |
0 |
if( pNew==0 ) return SQLITE_NOMEM; |
226887
|
0 |
0 |
for(pp=&pHash->aSlot[iHash]; *pp!=p; pp=&(*pp)->pHashNext); |
226899
|
0 |
0 |
if( iRowid!=p->iRowid ){ |
226906
|
0 |
0 |
if( pHash->eDetail!=FTS5_DETAIL_NONE ){ |
226908
|
0 |
0 |
p->iCol = (pHash->eDetail==FTS5_DETAIL_FULL ? 0 : -1); |
226913
|
0 |
0 |
if( iCol>=0 ){ |
226914
|
0 |
0 |
if( pHash->eDetail==FTS5_DETAIL_NONE ){ |
226919
|
0 |
0 |
if( iCol!=p->iCol ){ |
226920
|
0 |
0 |
if( pHash->eDetail==FTS5_DETAIL_FULL ){ |
226932
|
0 |
0 |
if( bNew ){ |
226962
|
0 |
0 |
while( p1 || p2 ){ |
|
0 |
0 |
while( p1 || p2 ){ |
226963
|
0 |
0 |
if( p1==0 ){ |
226966
|
0 |
0 |
}else if( p2==0 ){ |
226973
|
0 |
0 |
while( zKey1[i]==zKey2[i] ) i++; |
226975
|
0 |
0 |
if( ((u8)zKey1[i])>((u8)zKey2[i]) ){ |
227012
|
0 |
0 |
if( !ap ) return SQLITE_NOMEM; |
227015
|
0 |
0 |
for(iSlot=0; iSlotnSlot; iSlot++){ |
227017
|
0 |
0 |
for(pIter=pHash->aSlot[iSlot]; pIter; pIter=pIter->pHashNext){ |
227018
|
0 |
0 |
if( pTerm==0 |
227019
|
0 |
0 |
|| (pIter->nKey+1>=nTerm && 0==memcmp(fts5EntryKey(pIter), pTerm, nTerm)) |
|
0 |
0 |
|| (pIter->nKey+1>=nTerm && 0==memcmp(fts5EntryKey(pIter), pTerm, nTerm)) |
227023
|
0 |
0 |
for(i=0; ap[i]; i++){ |
227033
|
0 |
0 |
for(i=0; i
|
227057
|
0 |
0 |
for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ |
227060
|
0 |
0 |
if( nTerm==p->nKey+1 && memcmp(zKey, pTerm, nTerm)==0 ) break; |
|
0 |
0 |
if( nTerm==p->nKey+1 && memcmp(zKey, pTerm, nTerm)==0 ) break; |
227063
|
0 |
0 |
if( p ){ |
227067
|
0 |
0 |
if( pRet ){ |
227107
|
0 |
0 |
if( (p = pHash->pScan) ){ |
227727
|
0 |
0 |
res = fts5Memcmp(pLeft->p, pRight->p, nCmp); |
227728
|
0 |
0 |
return (res==0 ? (pLeft->n - pRight->n) : res); |
227741
|
0 |
0 |
if( p->pReader ){ |
227756
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
227759
|
0 |
0 |
if( p->pReader ){ |
227768
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
227771
|
0 |
0 |
if( rc==SQLITE_ABORT ) rc = SQLITE_OK; |
227776
|
0 |
0 |
if( p->pReader==0 && rc==SQLITE_OK ){ |
|
0 |
0 |
if( p->pReader==0 && rc==SQLITE_OK ){ |
227788
|
0 |
0 |
if( rc==SQLITE_ERROR ) rc = FTS5_CORRUPT; |
227790
|
0 |
0 |
if( rc==SQLITE_OK ){ |
227795
|
0 |
0 |
if( pRet ){ |
227802
|
0 |
0 |
if( rc==SQLITE_OK ){ |
227805
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
227834
|
0 |
0 |
if( pRet ){ |
227835
|
0 |
0 |
if( pRet->nn<4 || pRet->szLeaf>pRet->nn ){ |
|
0 |
0 |
if( pRet->nn<4 || pRet->szLeaf>pRet->nn ){ |
227849
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
227850
|
0 |
0 |
if( zSql ){ |
227867
|
0 |
0 |
if( p->rc!=SQLITE_OK ) return; |
227869
|
0 |
0 |
if( p->pWriter==0 ){ |
227875
|
0 |
0 |
if( p->rc ) return; |
227891
|
0 |
0 |
if( p->rc!=SQLITE_OK ) return; |
227893
|
0 |
0 |
if( p->pDeleter==0 ){ |
227899
|
0 |
0 |
if( fts5IndexPrepareStmt(p, &p->pDeleter, zSql) ) return; |
227915
|
0 |
0 |
if( p->pIdxDeleter==0 ){ |
227922
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
227934
|
0 |
0 |
if( pStruct && 0>=(--pStruct->nRef) ){ |
|
0 |
0 |
if( pStruct && 0>=(--pStruct->nRef) ){ |
227937
|
0 |
0 |
for(i=0; inLevel; i++){ |
227953
|
0 |
0 |
if( p ){ |
227958
|
0 |
0 |
if( p->pStruct!=(Fts5Structure*)pStruct ){ |
227972
|
0 |
0 |
if( *pRc==SQLITE_OK && p->nRef>1 ){ |
|
0 |
0 |
if( *pRc==SQLITE_OK && p->nRef>1 ){ |
227976
|
0 |
0 |
if( pNew ){ |
227979
|
0 |
0 |
for(i=0; inLevel; i++) pNew->aLevel[i].aSeg = 0; |
227980
|
0 |
0 |
for(i=0; inLevel; i++){ |
227984
|
0 |
0 |
if( pLvl->aSeg==0 ){ |
227985
|
0 |
0 |
for(i=0; inLevel; i++){ |
228027
|
0 |
0 |
if( piCookie ) *piCookie = sqlite3Fts5Get32(pData); |
228034
|
0 |
0 |
if( nLevel>FTS5_MAX_SEGMENT || nLevel<0 |
|
0 |
0 |
if( nLevel>FTS5_MAX_SEGMENT || nLevel<0 |
228035
|
0 |
0 |
|| nSegment>FTS5_MAX_SEGMENT || nSegment<0 |
|
0 |
0 |
|| nSegment>FTS5_MAX_SEGMENT || nSegment<0 |
228045
|
0 |
0 |
if( pRet ){ |
228051
|
0 |
0 |
for(iLvl=0; rc==SQLITE_OK && iLvl
|
|
0 |
0 |
for(iLvl=0; rc==SQLITE_OK && iLvl
|
228056
|
0 |
0 |
if( i>=nData ){ |
228061
|
0 |
0 |
if( nTotalnMerge ) rc = FTS5_CORRUPT; |
228068
|
0 |
0 |
if( rc==SQLITE_OK ){ |
228070
|
0 |
0 |
for(iSeg=0; iSeg
|
228072
|
0 |
0 |
if( i>=nData ){ |
228079
|
0 |
0 |
if( pSeg->pgnoLastpgnoFirst ){ |
228084
|
0 |
0 |
if( iLvl>0 && pLvl[-1].nMerge && nTotal==0 ) rc = FTS5_CORRUPT; |
|
0 |
0 |
if( iLvl>0 && pLvl[-1].nMerge && nTotal==0 ) rc = FTS5_CORRUPT; |
|
0 |
0 |
if( iLvl>0 && pLvl[-1].nMerge && nTotal==0 ) rc = FTS5_CORRUPT; |
228085
|
0 |
0 |
if( iLvl==nLevel-1 && pLvl->nMerge ) rc = FTS5_CORRUPT; |
|
0 |
0 |
if( iLvl==nLevel-1 && pLvl->nMerge ) rc = FTS5_CORRUPT; |
228088
|
0 |
0 |
if( nSegment!=0 && rc==SQLITE_OK ) rc = FTS5_CORRUPT; |
|
0 |
0 |
if( nSegment!=0 && rc==SQLITE_OK ) rc = FTS5_CORRUPT; |
228090
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
228106
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
228115
|
0 |
0 |
if( pStruct ){ |
228136
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
228143
|
0 |
0 |
if( aNew ){ |
228144
|
0 |
0 |
if( bInsert==0 ){ |
228165
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
228169
|
0 |
0 |
if( p->rc==SQLITE_OK && (pConfig->pgsz==0 || pConfig->iCookie!=iCookie) ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && (pConfig->pgsz==0 || pConfig->iCookie!=iCookie) ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && (pConfig->pgsz==0 || pConfig->iCookie!=iCookie) ){ |
228173
|
0 |
0 |
if( p->rc!=SQLITE_OK ){ |
228185
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
228186
|
0 |
0 |
if( p->pDataVersion==0 ){ |
228190
|
0 |
0 |
if( p->rc ) return 0; |
228193
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(p->pDataVersion) ){ |
228215
|
0 |
0 |
if( p->pStruct==0 ){ |
228217
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
228245
|
0 |
0 |
if( p->rc!=SQLITE_OK ) return 0; |
228253
|
0 |
0 |
if( p->pStruct ){ |
228296
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
228306
|
0 |
0 |
if( iCookie<0 ) iCookie = 0; |
228308
|
0 |
0 |
if( 0==sqlite3Fts5BufferSize(&p->rc, &buf, 4+9+9+9) ){ |
228316
|
0 |
0 |
for(iLvl=0; iLvlnLevel; iLvl++){ |
228323
|
0 |
0 |
for(iSeg=0; iSegnSeg; iSeg++){ |
228368
|
0 |
0 |
if( pOut->nMerge==0 ){ |
228369
|
0 |
0 |
for(il=iPromote+1; ilnLevel; il++){ |
228371
|
0 |
0 |
if( pLvl->nMerge ) return; |
228372
|
0 |
0 |
for(is=pLvl->nSeg-1; is>=0; is--){ |
228374
|
0 |
0 |
if( sz>szPromote ) return; |
228376
|
0 |
0 |
if( p->rc ) return; |
228407
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
228415
|
0 |
0 |
if( nSeg==0 ) return; |
228420
|
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--); |
228421
|
0 |
0 |
if( iTst>=0 ){ |
228426
|
0 |
0 |
for(i=0; inSeg; i++){ |
228428
|
0 |
0 |
if( sz>szMax ) szMax = sz; |
228430
|
0 |
0 |
if( szMax>=szSeg ){ |
228440
|
0 |
0 |
if( iPromote<0 ){ |
228456
|
0 |
0 |
if( pLvl->iOff==0 ){ |
228464
|
0 |
0 |
for(iOff=pLvl->iOff; iOffnn; iOff++){ |
228465
|
0 |
0 |
if( pData->p[iOff] ) break; |
228468
|
0 |
0 |
if( iOffnn ){ |
228489
|
0 |
0 |
if( fts5DlidxLvlNext(pLvl) ){ |
228490
|
0 |
0 |
if( (iLvl+1) < pIter->nLvl ){ |
228492
|
0 |
0 |
if( pLvl[1].bEof==0 ){ |
228498
|
0 |
0 |
if( pLvl->pData ) fts5DlidxLvlNext(pLvl); |
228522
|
0 |
0 |
for(i=0; inLvl; i++){ |
228530
|
0 |
0 |
return p->rc!=SQLITE_OK || pIter->aLvl[0].bEof; |
|
0 |
0 |
return p->rc!=SQLITE_OK || pIter->aLvl[0].bEof; |
228537
|
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--){ |
228539
|
0 |
0 |
while( fts5DlidxLvlNext(pLvl)==0 ); |
228542
|
0 |
0 |
if( i>0 ){ |
228560
|
0 |
0 |
if( iOff<=pLvl->iFirstOff ){ |
228573
|
0 |
0 |
iLimit = (iOff>9 ? iOff-9 : 0); |
228574
|
0 |
0 |
for(iOff--; iOff>iLimit; iOff--){ |
228575
|
0 |
0 |
if( (a[iOff-1] & 0x80)==0 ) break; |
228583
|
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--){ |
228586
|
0 |
0 |
if( ii>=pLvl->iFirstOff && (a[ii] & 0x80) ){ |
|
0 |
0 |
if( ii>=pLvl->iFirstOff && (a[ii] & 0x80) ){ |
228591
|
0 |
0 |
if( (ii-8)>=pLvl->iFirstOff ){ |
228593
|
0 |
0 |
for(j=1; j<=8 && (a[ii-j] & 0x80); j++); |
|
0 |
0 |
for(j=1; j<=8 && (a[ii-j] & 0x80); j++); |
228596
|
0 |
0 |
if( bZero==0 ) nZero--; |
228609
|
0 |
0 |
if( fts5DlidxLvlPrev(pLvl) ){ |
228610
|
0 |
0 |
if( (iLvl+1) < pIter->nLvl ){ |
228612
|
0 |
0 |
if( pLvl[1].bEof==0 ){ |
228618
|
0 |
0 |
if( pLvl->pData ){ |
228619
|
0 |
0 |
while( fts5DlidxLvlNext(pLvl)==0 ); |
228636
|
0 |
0 |
if( pIter ){ |
228638
|
0 |
0 |
for(i=0; inLvl; i++){ |
228655
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){ |
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){ |
228660
|
0 |
0 |
if( pNew==0 ){ |
228668
|
0 |
0 |
if( pLvl->pData && (pLvl->pData->p[0] & 0x0001)==0 ){ |
|
0 |
0 |
if( pLvl->pData && (pLvl->pData->p[0] & 0x0001)==0 ){ |
228675
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
228677
|
0 |
0 |
if( bRev==0 ){ |
228684
|
0 |
0 |
if( p->rc!=SQLITE_OK ){ |
228710
|
0 |
0 |
if( pIter->pNextLeaf ){ |
228713
|
0 |
0 |
}else if( pIter->iLeafPgno<=pSeg->pgnoLast ){ |
228722
|
0 |
0 |
if( pLeaf ){ |
228724
|
0 |
0 |
if( fts5LeafIsTermless(pLeaf) ){ |
228743
|
0 |
0 |
fts5FastGetVarint32(p, n, nSz); |
228762
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
228765
|
0 |
0 |
if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){ |
228769
|
0 |
0 |
if( iOffpLeaf->p[iOff]==0 ){ |
|
0 |
0 |
if( iOffpLeaf->p[iOff]==0 ){ |
228772
|
0 |
0 |
if( iOffpLeaf->p[iOff]==0 ){ |
|
0 |
0 |
if( iOffpLeaf->p[iOff]==0 ){ |
228781
|
0 |
0 |
fts5FastGetVarint32(pIter->pLeaf->p, iOff, nSz); |
228795
|
0 |
0 |
if( iOff>=pIter->pLeaf->szLeaf ){ |
228797
|
0 |
0 |
if( pIter->pLeaf==0 ){ |
228798
|
0 |
0 |
if( p->rc==SQLITE_OK ) p->rc = FTS5_CORRUPT; |
228829
|
0 |
0 |
if( iOff+nNew>pIter->pLeaf->szLeaf || nKeep>pIter->term.n || nNew==0 ){ |
|
0 |
0 |
if( iOff+nNew>pIter->pLeaf->szLeaf || nKeep>pIter->term.n || nNew==0 ){ |
|
0 |
0 |
if( iOff+nNew>pIter->pLeaf->szLeaf || nKeep>pIter->term.n || nNew==0 ){ |
228841
|
0 |
0 |
if( pIter->iPgidxOff>=pIter->pLeaf->nn ){ |
228857
|
0 |
0 |
if( pIter->flags & FTS5_SEGITER_REVERSE ){ |
228859
|
0 |
0 |
}else if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){ |
228879
|
0 |
0 |
if( pSeg->pgnoFirst==0 ){ |
228889
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
228897
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
228930
|
0 |
0 |
if( n>pIter->iEndofDoclist ){ |
228938
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ){ |
228940
|
0 |
0 |
if( i
|
|
0 |
0 |
if( i
|
228942
|
0 |
0 |
if( i
|
|
0 |
0 |
if( i
|
228950
|
0 |
0 |
if( i>=n ) break; |
228955
|
0 |
0 |
if( iRowidOffset>=pIter->nRowidOffset ){ |
228958
|
0 |
0 |
if( aNew==0 ){ |
228982
|
0 |
0 |
while( p->rc==SQLITE_OK && pIter->iLeafPgno>pIter->iTermLeafPgno ){ |
|
0 |
0 |
while( p->rc==SQLITE_OK && pIter->iLeafPgno>pIter->iTermLeafPgno ){ |
228988
|
0 |
0 |
if( pNew ){ |
228992
|
0 |
0 |
if( pIter->iLeafPgno==pIter->iTermLeafPgno ){ |
228994
|
0 |
0 |
if( pIter->iTermLeafOffsetszLeaf ){ |
229001
|
0 |
0 |
if( iRowidOff ){ |
229002
|
0 |
0 |
if( iRowidOff>=pNew->szLeaf ){ |
229011
|
0 |
0 |
if( pIter->pLeaf ){ |
229021
|
0 |
0 |
if( pIter->pLeaf ){ |
229034
|
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); |
229051
|
0 |
0 |
if( pIter->iRowidOffset>0 ){ |
229060
|
0 |
0 |
if( p->pConfig->eDetail!=FTS5_DETAIL_NONE ){ |
229091
|
0 |
0 |
if( pIter->pSeg && iOff>=pIter->pLeaf->szLeaf ){ |
|
0 |
0 |
if( pIter->pSeg && iOff>=pIter->pLeaf->szLeaf ){ |
229093
|
0 |
0 |
if( p->rc || pIter->pLeaf==0 ) return; |
|
0 |
0 |
if( p->rc || pIter->pLeaf==0 ) return; |
229098
|
0 |
0 |
if( iOffiEndofDoclist ){ |
229104
|
0 |
0 |
}else if( (pIter->flags & FTS5_SEGITER_ONETERM)==0 ){ |
229105
|
0 |
0 |
if( pIter->pSeg ){ |
229107
|
0 |
0 |
if( iOff!=fts5LeafFirstTermOff(pIter->pLeaf) ){ |
229118
|
0 |
0 |
if( pList==0 ) goto next_none_eof; |
229127
|
0 |
0 |
if( pbNewTerm ) *pbNewTerm = 1; |
229170
|
0 |
0 |
if( iOff
|
229173
|
0 |
0 |
if( iOff>=pIter->iEndofDoclist ){ |
229175
|
0 |
0 |
if( iOff!=fts5LeafFirstTermOff(pLeaf) ){ |
229186
|
0 |
0 |
}else if( pIter->pSeg==0 ){ |
229191
|
0 |
0 |
if( 0==(pIter->flags & FTS5_SEGITER_ONETERM) ){ |
229195
|
0 |
0 |
if( pList==0 ){ |
229211
|
0 |
0 |
while( iOff==0 ){ |
229214
|
0 |
0 |
if( pLeaf==0 ) break; |
229216
|
0 |
0 |
if( (iOff = fts5LeafFirstRowidOff(pLeaf)) && iOffszLeaf ){ |
|
0 |
0 |
if( (iOff = fts5LeafFirstRowidOff(pLeaf)) && iOffszLeaf ){ |
229220
|
0 |
0 |
if( pLeaf->nn>pLeaf->szLeaf ){ |
229226
|
0 |
0 |
else if( pLeaf->nn>pLeaf->szLeaf ){ |
229235
|
0 |
0 |
if( iOff>pLeaf->szLeaf ){ |
229243
|
0 |
0 |
if( pIter->pLeaf ){ |
229244
|
0 |
0 |
if( bNewTerm ){ |
229245
|
0 |
0 |
if( pIter->flags & FTS5_SEGITER_ONETERM ){ |
229251
|
0 |
0 |
if( pbNewTerm ) *pbNewTerm = 1; |
229259
|
0 |
0 |
fts5FastGetVarint32(pIter->pLeaf->p, pIter->iLeafOffset, nSz); |
229284
|
0 |
0 |
if( pDlidx ){ |
229295
|
0 |
0 |
if( pIter->iTermLeafPgno==pIter->iLeafPgno ){ |
229300
|
0 |
0 |
fts5IndexSkipVarint(pLeaf->p, iPoslist); |
|
0 |
0 |
fts5IndexSkipVarint(pLeaf->p, iPoslist); |
229306
|
0 |
0 |
if( pIter->iEndofDoclist>=pLeaf->szLeaf ){ |
229312
|
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++){ |
229315
|
0 |
0 |
if( pNew ){ |
229319
|
0 |
0 |
if( iRowid ){ |
229324
|
0 |
0 |
if( bTermless==0 ) break; |
229339
|
0 |
0 |
if( pLast ){ |
229345
|
0 |
0 |
if( iOff>pLast->szLeaf ){ |
229352
|
0 |
0 |
if( fts5LeafIsTermless(pLast) ){ |
229379
|
0 |
0 |
if( pIter->iTermLeafPgno==pIter->iLeafPgno |
229380
|
0 |
0 |
&& pIter->iEndofDoclistszLeaf |
229424
|
0 |
0 |
if( iOff>n ){ |
229432
|
0 |
0 |
fts5FastGetVarint32(a, iOff, nNew); |
229433
|
0 |
0 |
if( nKeep
|
229438
|
0 |
0 |
if( nKeep==nMatch ){ |
229442
|
0 |
0 |
for(i=0; i
|
229443
|
0 |
0 |
if( a[iOff+i]!=pTerm[nMatch+i] ) break; |
229447
|
0 |
0 |
if( (u32)nTerm==nMatch ){ |
229448
|
0 |
0 |
if( i==nNew ){ |
229453
|
0 |
0 |
}else if( ipTerm[nMatch] ){ |
|
0 |
0 |
}else if( ipTerm[nMatch] ){ |
229458
|
0 |
0 |
if( iPgidx>=n ){ |
229467
|
0 |
0 |
if( iOff>=n ){ |
229473
|
0 |
0 |
fts5FastGetVarint32(a, iOff, nKeep); |
229477
|
0 |
0 |
if( bGe==0 ){ |
229481
|
0 |
0 |
}else if( bEndOfPage ){ |
229484
|
0 |
0 |
if( pIter->pLeaf==0 ) return; |
229486
|
0 |
0 |
if( fts5LeafIsTermless(pIter->pLeaf)==0 ){ |
229489
|
0 |
0 |
if( iOff<4 || (i64)iOff>=pIter->pLeaf->szLeaf ){ |
|
0 |
0 |
if( iOff<4 || (i64)iOff>=pIter->pLeaf->szLeaf ){ |
229504
|
0 |
0 |
if( (i64)iOff+nNew>n || nNew<1 ){ |
|
0 |
0 |
if( (i64)iOff+nNew>n || nNew<1 ){ |
229515
|
0 |
0 |
if( iPgidx>=n ){ |
229529
|
0 |
0 |
if( p->pIdxSelect==0 ){ |
229567
|
0 |
0 |
if( p->rc ) return; |
229570
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pIdxSelect) ){ |
229578
|
0 |
0 |
if( iPgpgnoFirst ){ |
229586
|
0 |
0 |
if( pIter->pLeaf ){ |
229590
|
0 |
0 |
if( p->rc==SQLITE_OK && bGe==0 ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && bGe==0 ){ |
229592
|
0 |
0 |
if( pIter->pLeaf ){ |
229593
|
0 |
0 |
if( flags & FTS5INDEX_QUERY_DESC ){ |
229596
|
0 |
0 |
if( bDlidx ){ |
229599
|
0 |
0 |
if( flags & FTS5INDEX_QUERY_DESC ){ |
229644
|
0 |
0 |
if( pTerm==0 || (flags & FTS5INDEX_QUERY_SCAN) ){ |
|
0 |
0 |
if( pTerm==0 || (flags & FTS5INDEX_QUERY_SCAN) ){ |
229649
|
0 |
0 |
n = (z ? (int)strlen((const char*)z) : 0); |
229650
|
0 |
0 |
if( pList ){ |
229652
|
0 |
0 |
if( pLeaf ){ |
229660
|
0 |
0 |
if( pLeaf ){ |
229668
|
0 |
0 |
if( pLeaf ){ |
229675
|
0 |
0 |
if( flags & FTS5INDEX_QUERY_DESC ){ |
229804
|
0 |
0 |
if( iOut>=(pIter->nSeg/2) ){ |
229815
|
0 |
0 |
if( p1->pLeaf==0 ){ /* If p1 is at EOF */ |
229817
|
0 |
0 |
}else if( p2->pLeaf==0 ){ /* If p2 is at EOF */ |
229821
|
0 |
0 |
if( res==0 ){ |
229825
|
0 |
0 |
if( p1->iRowid==p2->iRowid ){ |
229829
|
0 |
0 |
res = ((p1->iRowid > p2->iRowid)==pIter->bRev) ? -1 : +1; |
229832
|
0 |
0 |
if( res<0 ){ |
229854
|
0 |
0 |
if( iLeafPgno>pIter->pSeg->pgnoLast ){ |
229863
|
0 |
0 |
if( p->rc==SQLITE_OK && ALWAYS(pIter->pLeaf!=0) ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && ALWAYS(pIter->pLeaf!=0) ){ |
229869
|
0 |
0 |
if( iOff<4 || iOff>=n ){ |
|
0 |
0 |
if( iOff<4 || iOff>=n ){ |
229899
|
0 |
0 |
if( bRev==0 ){ |
229900
|
0 |
0 |
while( !fts5DlidxIterEof(p, pDlidx) && iMatch>fts5DlidxIterRowid(pDlidx) ){ |
|
0 |
0 |
while( !fts5DlidxIterEof(p, pDlidx) && iMatch>fts5DlidxIterRowid(pDlidx) ){ |
229905
|
0 |
0 |
if( iLeafPgno>pIter->iLeafPgno ){ |
229912
|
0 |
0 |
while( !fts5DlidxIterEof(p, pDlidx) && iMatch
|
|
0 |
0 |
while( !fts5DlidxIterEof(p, pDlidx) && iMatch
|
229919
|
0 |
0 |
if( iLeafPgnoiLeafPgno ){ |
229927
|
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); |
229928
|
0 |
0 |
if( pIter->pLeaf==0 ) break; |
229929
|
0 |
0 |
if( bRev==0 && pIter->iRowid>=iMatch ) break; |
|
0 |
0 |
if( bRev==0 && pIter->iRowid>=iMatch ) break; |
229930
|
0 |
0 |
if( bRev!=0 && pIter->iRowid<=iMatch ) break; |
|
0 |
0 |
if( bRev!=0 && pIter->iRowid<=iMatch ) break; |
229932
|
0 |
0 |
}while( p->rc==SQLITE_OK ); |
229940
|
0 |
0 |
if( pIter ){ |
229942
|
0 |
0 |
for(i=0; inSeg; i++){ |
229957
|
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){ |
229959
|
0 |
0 |
if( (iEq = fts5MultiIterDoCompare(pIter, i)) ){ |
229985
|
0 |
0 |
if( pNew->iRowid==pIter->iSwitchRowid |
229986
|
0 |
0 |
|| (pNew->iRowidiSwitchRowid)==pIter->bRev |
229990
|
0 |
0 |
pIter->iSwitchRowid = pIter->bRev ? SMALLEST_INT64 : LARGEST_INT64; |
229997
|
0 |
0 |
if( pRes->bTermEq ){ |
229998
|
0 |
0 |
if( pNew->iRowid==pOther->iRowid ){ |
230000
|
0 |
0 |
}else if( (pOther->iRowid>pNew->iRowid)==pIter->bRev ){ |
230003
|
0 |
0 |
}else if( (pOther->iRowid>pIter->iSwitchRowid)==pIter->bRev ){ |
230008
|
0 |
0 |
if( i==1 ) break; |
230042
|
0 |
0 |
while( p->rc==SQLITE_OK ){ |
230047
|
0 |
0 |
if( bUseFrom && pSeg->pDlidx ){ |
|
0 |
0 |
if( bUseFrom && pSeg->pDlidx ){ |
230053
|
0 |
0 |
if( pSeg->pLeaf==0 || bNewTerm |
|
0 |
0 |
if( pSeg->pLeaf==0 || bNewTerm |
230054
|
0 |
0 |
|| fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg) |
230059
|
0 |
0 |
if( pSeg->pLeaf==0 ) return; |
230064
|
0 |
0 |
if( pIter->bSkipEmpty==0 || pSeg->nPos ){ |
|
0 |
0 |
if( pIter->bSkipEmpty==0 || pSeg->nPos ){ |
230078
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
230087
|
0 |
0 |
if( pSeg->pLeaf==0 || bNewTerm |
|
0 |
0 |
if( pSeg->pLeaf==0 || bNewTerm |
230088
|
0 |
0 |
|| fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg) |
230096
|
0 |
0 |
}while( fts5MultiIterIsEmpty(p, pIter) ); |
230111
|
0 |
0 |
for(nSlot=2; nSlot
|
230117
|
0 |
0 |
if( pNew ){ |
230133
|
0 |
0 |
if( nChunk>0 ){ |
230158
|
0 |
0 |
for(i=0; inCol; i++){ |
230159
|
0 |
0 |
if( pColset->aiCol[i]==iCol ) return 1; |
230172
|
0 |
0 |
if( nChunk>0 ){ |
230174
|
0 |
0 |
while( i
|
230179
|
0 |
0 |
if( fts5IndexColsetTest(pCtx->pColset, iVal) ){ |
230195
|
0 |
0 |
if( nChunk>0 ){ |
230201
|
0 |
0 |
if( pCtx->eState==2 ){ |
230203
|
0 |
0 |
fts5FastGetVarint32(pChunk, i, iCol); |
230204
|
0 |
0 |
if( fts5IndexColsetTest(pCtx->pColset, iCol) ){ |
230213
|
0 |
0 |
while( i
|
|
0 |
0 |
while( i
|
230214
|
0 |
0 |
while( pChunk[i] & 0x80 ) i++; |
230217
|
0 |
0 |
if( pCtx->eState ){ |
230220
|
0 |
0 |
if( i
|
230224
|
0 |
0 |
if( i>=nChunk ){ |
230227
|
0 |
0 |
fts5FastGetVarint32(pChunk, i, iCol); |
230229
|
0 |
0 |
if( pCtx->eState ){ |
230235
|
0 |
0 |
}while( i
|
230255
|
0 |
0 |
if( (pSeg->flags & FTS5_SEGITER_REVERSE)==0 ){ |
230263
|
0 |
0 |
if( nRem<=0 ){ |
230265
|
0 |
0 |
}else if( pSeg->pSeg==0 ){ |
230271
|
0 |
0 |
if( pData==0 ) break; |
230274
|
0 |
0 |
if( pgno==pgnoSave ){ |
230297
|
0 |
0 |
if( 0==fts5BufferGrow(&p->rc, pBuf, pSeg->nPos+FTS5_DATA_ZERO_PADDING) ){ |
|
0 |
0 |
if( 0==fts5BufferGrow(&p->rc, pBuf, pSeg->nPos+FTS5_DATA_ZERO_PADDING) ){ |
230301
|
0 |
0 |
if( pColset==0 ){ |
230304
|
0 |
0 |
if( p->pConfig->eDetail==FTS5_DETAIL_FULL ){ |
230340
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
230347
|
0 |
0 |
if( pColset->nCol>1 && sqlite3Fts5BufferSize(pRc, &pIter->poslist, nPos) ){ |
|
0 |
0 |
if( pColset->nCol>1 && sqlite3Fts5BufferSize(pRc, &pIter->poslist, nPos) ){ |
230352
|
0 |
0 |
while( pColset->aiCol[i]
|
230354
|
0 |
0 |
if( i==pColset->nCol ){ |
230363
|
0 |
0 |
while( p
|
|
0 |
0 |
while( p
|
230364
|
0 |
0 |
while( *p++ & 0x80 ); |
230367
|
0 |
0 |
if( pColset->aiCol[i]==iCurrent ){ |
230368
|
0 |
0 |
if( pColset->nCol==1 ){ |
230375
|
0 |
0 |
if( p>=pEnd ){ |
230382
|
0 |
0 |
if( iCurrent & 0x80 ){ |
230411
|
0 |
0 |
if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){ |
230462
|
0 |
0 |
if( pSeg->iLeafOffset+pSeg->nPos>pSeg->pLeaf->szLeaf ){ |
230476
|
0 |
0 |
while( a
|
230478
|
0 |
0 |
while( *aiCol
|
230480
|
0 |
0 |
if( aiCol==aiColEnd ) goto setoutputs_col_out; |
230482
|
0 |
0 |
if( *aiCol==iPrev ){ |
230504
|
0 |
0 |
if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){ |
230524
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
230526
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_NONE ){ |
230530
|
0 |
0 |
else if( pIter->pColset==0 ){ |
230534
|
0 |
0 |
else if( pIter->pColset->nCol==0 ){ |
230538
|
0 |
0 |
else if( pConfig->eDetail==FTS5_DETAIL_FULL ){ |
230544
|
0 |
0 |
if( pConfig->nCol<=100 ){ |
230585
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
230586
|
0 |
0 |
if( iLevel<0 ){ |
230595
|
0 |
0 |
if( pNew==0 ){ |
230602
|
0 |
0 |
if( (flags & FTS5INDEX_QUERY_NOOUTPUT)==0 ){ |
230607
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
230608
|
0 |
0 |
if( iLevel<0 ){ |
230610
|
0 |
0 |
if( p->pHash ){ |
230615
|
0 |
0 |
for(pLvl=&pStruct->aLevel[0]; pLvl
|
230616
|
0 |
0 |
for(iSeg=pLvl->nSeg-1; iSeg>=0; iSeg--){ |
230619
|
0 |
0 |
if( pTerm==0 ){ |
230628
|
0 |
0 |
for(iSeg=nSeg-1; iSeg>=0; iSeg--){ |
230639
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
230640
|
0 |
0 |
for(iIter=pNew->nSeg-1; iIter>0; iIter--){ |
230642
|
0 |
0 |
if( (iEq = fts5MultiIterDoCompare(pNew, iIter)) ){ |
230644
|
0 |
0 |
if( p->rc==SQLITE_OK ) pSeg->xNext(p, pSeg, 0); |
230651
|
0 |
0 |
if( pNew->bSkipEmpty && fts5MultiIterIsEmpty(p, pNew) ){ |
|
0 |
0 |
if( pNew->bSkipEmpty && fts5MultiIterIsEmpty(p, pNew) ){ |
230653
|
0 |
0 |
}else if( pNew->base.bEof==0 ){ |
230680
|
0 |
0 |
if( pNew ){ |
230684
|
0 |
0 |
if( pData->szLeaf>0 ){ |
230689
|
0 |
0 |
if( bDesc ){ |
230717
|
0 |
0 |
return (p->rc || pIter->base.bEof); |
|
0 |
0 |
return (p->rc || pIter->base.bEof); |
230741
|
0 |
0 |
if( fts5MultiIterEof(p, pIter) ) break; |
230743
|
0 |
0 |
if( pIter->bRev==0 && iRowid>=iMatch ) break; |
|
0 |
0 |
if( pIter->bRev==0 && iRowid>=iMatch ) break; |
230744
|
0 |
0 |
if( pIter->bRev!=0 && iRowid<=iMatch ) break; |
|
0 |
0 |
if( pIter->bRev!=0 && iRowid<=iMatch ) break; |
230770
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
230771
|
0 |
0 |
if( pStruct->nSegment>=FTS5_MAX_SEGMENT ){ |
230781
|
0 |
0 |
for(iLvl=0; iLvlnLevel; iLvl++){ |
230782
|
0 |
0 |
for(iSeg=0; iSegaLevel[iLvl].nSeg; iSeg++){ |
230784
|
0 |
0 |
if( iId<=FTS5_MAX_SEGMENT && iId>0 ){ |
|
0 |
0 |
if( iId<=FTS5_MAX_SEGMENT && iId>0 ){ |
230790
|
0 |
0 |
for(i=0; aUsed[i]==0xFFFFFFFF; i++); |
230792
|
0 |
0 |
for(iSegid=0; mask & ((u32)1 << iSegid); iSegid++); |
230826
|
0 |
0 |
if( p->pHash ){ |
230841
|
0 |
0 |
for(i=0; i
|
230842
|
0 |
0 |
if( pOld[i]!=pNew[i] ) break; |
230854
|
0 |
0 |
for(i=0; inDlidx; i++){ |
230856
|
0 |
0 |
if( pDlidx->buf.n==0 ) break; |
230857
|
0 |
0 |
if( bFlush ){ |
230878
|
0 |
0 |
if( p->rc==SQLITE_OK && nLvl>=pWriter->nDlidx ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && nLvl>=pWriter->nDlidx ){ |
230882
|
0 |
0 |
if( aDlidx==0 ){ |
230904
|
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 ){ |
230927
|
0 |
0 |
if( pWriter->iBtPage==0 ) return; |
230930
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
230931
|
0 |
0 |
const char *z = (pWriter->btterm.n>0?(const char*)pWriter->btterm.p:""); |
230958
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
230974
|
0 |
0 |
if( pWriter->bFirstRowidInPage && pWriter->aDlidx[0].buf.n>0 ){ |
|
0 |
0 |
if( pWriter->bFirstRowidInPage && pWriter->aDlidx[0].buf.n>0 ){ |
231006
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){ |
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){ |
231010
|
0 |
0 |
if( pDlidx->buf.n>=p->pConfig->pgsz ){ |
231023
|
0 |
0 |
if( p->rc==SQLITE_OK && pDlidx[1].buf.n==0 ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && pDlidx[1].buf.n==0 ){ |
231042
|
0 |
0 |
if( pDlidx->bPrevValid ){ |
231045
|
0 |
0 |
i64 iPgno = (i==0 ? pWriter->writer.pgno : pDlidx[-1].pgno); |
231069
|
0 |
0 |
if( pWriter->bFirstTermInPage ){ |
231119
|
0 |
0 |
if( (pPage->buf.n + pPgidx->n + nTerm + 2)>=p->pConfig->pgsz ){ |
231120
|
0 |
0 |
if( pPage->buf.n>4 ){ |
231122
|
0 |
0 |
if( p->rc!=SQLITE_OK ) return; |
231124
|
0 |
0 |
fts5BufferGrow(&p->rc, &pPage->buf, nTerm+FTS5_DATA_PADDING); |
231137
|
0 |
0 |
if( pWriter->bFirstTermInPage ){ |
231139
|
0 |
0 |
if( pPage->pgno!=1 ){ |
231154
|
0 |
0 |
if( pPage->term.n ){ |
231158
|
0 |
0 |
if( p->rc!=SQLITE_OK ) return; |
231190
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
231193
|
0 |
0 |
if( (pPage->buf.n + pPage->pgidx.n)>=p->pConfig->pgsz ){ |
231200
|
0 |
0 |
if( pWriter->bFirstRowidInPage ){ |
231206
|
0 |
0 |
if( pWriter->bFirstRowidInDoclist || pWriter->bFirstRowidInPage ){ |
|
0 |
0 |
if( pWriter->bFirstRowidInDoclist || pWriter->bFirstRowidInPage ){ |
231229
|
0 |
0 |
while( p->rc==SQLITE_OK |
231230
|
0 |
0 |
&& (pPage->buf.n + pPage->pgidx.n + n)>=p->pConfig->pgsz |
231234
|
0 |
0 |
while( nCopy
|
231243
|
0 |
0 |
if( n>0 ){ |
231259
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
231261
|
0 |
0 |
if( pLeaf->buf.n>4 ){ |
231265
|
0 |
0 |
if( pLeaf->pgno>1 ){ |
231274
|
0 |
0 |
for(i=0; inDlidx; i++){ |
231302
|
0 |
0 |
if( p->pIdxWriter==0 ){ |
231310
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
231331
|
0 |
0 |
for(i=0; inSeg && p->rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; inSeg && p->rc==SQLITE_OK; i++){ |
231333
|
0 |
0 |
if( pSeg->pSeg==0 ){ |
231335
|
0 |
0 |
}else if( pSeg->pLeaf==0 ){ |
231350
|
0 |
0 |
if( pData ){ |
231351
|
0 |
0 |
if( iOff>pData->szLeaf ){ |
231359
|
0 |
0 |
fts5BufferGrow(&p->rc, &buf, pData->nn); |
231364
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
231371
|
0 |
0 |
if( pSeg->iLeafPgno==pSeg->iTermLeafPgno |
231372
|
0 |
0 |
&& pSeg->iEndofDoclistszLeaf |
231373
|
0 |
0 |
&& pSeg->iPgidxOff<=pData->nn |
231415
|
0 |
0 |
int nRem = pnRem ? *pnRem : 0; /* Output leaf pages left to write */ |
231430
|
0 |
0 |
if( pLvl->nMerge ){ |
231444
|
0 |
0 |
if( iLvl==pStruct->nLevel-1 ){ |
231449
|
0 |
0 |
if( p->rc ) return; |
231465
|
0 |
0 |
bOldest = (pLvlOut->nSeg==1 && pStruct->nLevel==iLvl+2); |
|
0 |
0 |
bOldest = (pLvlOut->nSeg==1 && pStruct->nLevel==iLvl+2); |
231468
|
0 |
0 |
for(fts5MultiIterNew(p, pStruct, flags, 0, 0, 0, iLvl, nInput, &pIter); |
231478
|
0 |
0 |
if( nTerm!=term.n || fts5Memcmp(pTerm, term.p, nTerm) ){ |
|
0 |
0 |
if( nTerm!=term.n || fts5Memcmp(pTerm, term.p, nTerm) ){ |
|
0 |
0 |
if( nTerm!=term.n || fts5Memcmp(pTerm, term.p, nTerm) ){ |
231479
|
0 |
0 |
if( pnRem && writer.nLeafWritten>nRem ){ |
|
0 |
0 |
if( pnRem && writer.nLeafWritten>nRem ){ |
231487
|
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; |
231489
|
0 |
0 |
if( p->rc==SQLITE_OK && bTermWritten==0 ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && bTermWritten==0 ){ |
231499
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ){ |
231500
|
0 |
0 |
if( pSegIter->bDel ){ |
231502
|
0 |
0 |
if( pSegIter->nPos>0 ){ |
231519
|
0 |
0 |
if( fts5MultiIterEof(p, pIter) ){ |
231523
|
0 |
0 |
for(i=0; i
|
231528
|
0 |
0 |
if( pLvl->nSeg!=nInput ){ |
231535
|
0 |
0 |
if( pSeg->pgnoLast==0 ){ |
231547
|
0 |
0 |
if( pnRem ) *pnRem -= writer.nLeafWritten; |
231564
|
0 |
0 |
while( nRem>0 && p->rc==SQLITE_OK ){ |
|
0 |
0 |
while( nRem>0 && p->rc==SQLITE_OK ){ |
231571
|
0 |
0 |
for(iLvl=0; iLvlnLevel; iLvl++){ |
231573
|
0 |
0 |
if( pLvl->nMerge ){ |
231574
|
0 |
0 |
if( pLvl->nMerge>nBest ){ |
231580
|
0 |
0 |
if( pLvl->nSeg>nBest ){ |
231593
|
0 |
0 |
if( nBestaLevel[iBestLvl].nMerge==0 ){ |
|
0 |
0 |
if( nBestaLevel[iBestLvl].nMerge==0 ){ |
231598
|
0 |
0 |
if( p->rc==SQLITE_OK && pStruct->aLevel[iBestLvl].nMerge==0 ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && pStruct->aLevel[iBestLvl].nMerge==0 ){ |
231619
|
0 |
0 |
if( p->rc==SQLITE_OK && p->pConfig->nAutomerge>0 && ALWAYS((*ppStruct)!=0) ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && p->pConfig->nAutomerge>0 && ALWAYS((*ppStruct)!=0) ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && p->pConfig->nAutomerge>0 && ALWAYS((*ppStruct)!=0) ){ |
231644
|
0 |
0 |
while( p->rc==SQLITE_OK && pStruct->aLevel[iLvl].nSeg>=nCrisis ){ |
|
0 |
0 |
while( p->rc==SQLITE_OK && pStruct->aLevel[iLvl].nSeg>=nCrisis ){ |
231674
|
0 |
0 |
if( ret
|
231677
|
0 |
0 |
if( (ret + i) > nMax ) break; |
231703
|
0 |
0 |
if( iSegid ){ |
231723
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
231726
|
0 |
0 |
while( p->rc==SQLITE_OK && 0==sqlite3Fts5HashScanEof(pHash) ){ |
|
0 |
0 |
while( p->rc==SQLITE_OK && 0==sqlite3Fts5HashScanEof(pHash) ){ |
231734
|
0 |
0 |
if( p->rc!=SQLITE_OK ) break; |
231737
|
0 |
0 |
if( pgsz>=(pBuf->n + pPgidx->n + nDoclist + 1) ){ |
231748
|
0 |
0 |
while( p->rc==SQLITE_OK && iOff
|
|
0 |
0 |
while( p->rc==SQLITE_OK && iOff
|
231752
|
0 |
0 |
if( writer.bFirstRowidInPage ){ |
231757
|
0 |
0 |
if( p->rc!=SQLITE_OK ) break; |
231763
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ){ |
231764
|
0 |
0 |
if( iOff
|
|
0 |
0 |
if( iOff
|
231767
|
0 |
0 |
if( iOff
|
|
0 |
0 |
if( iOff
|
231772
|
0 |
0 |
if( (pBuf->n + pPgidx->n)>=pgsz ){ |
231780
|
0 |
0 |
if( (pBuf->n + pPgidx->n + nCopy) <= pgsz ){ |
231790
|
0 |
0 |
while( p->rc==SQLITE_OK ){ |
231793
|
0 |
0 |
if( (nCopy - iPos)<=nSpace ){ |
231801
|
0 |
0 |
if( (pBuf->n + pPgidx->n)>=pgsz ){ |
231804
|
0 |
0 |
if( iPos>=nCopy ) break; |
231815
|
0 |
0 |
if( p->rc==SQLITE_OK ) sqlite3Fts5HashScanNext(pHash); |
231822
|
0 |
0 |
if( pStruct->nLevel==0 ){ |
231826
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
231847
|
0 |
0 |
if( p->nPendingData ){ |
231873
|
0 |
0 |
if( nSeg<2 ) return 0; |
231874
|
0 |
0 |
for(i=0; inLevel; i++){ |
231876
|
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) ){ |
231886
|
0 |
0 |
if( pNew ){ |
231894
|
0 |
0 |
if( pLvl->aSeg ){ |
231900
|
0 |
0 |
for(iLvl=pStruct->nLevel-1; iLvl>=0; iLvl--){ |
231901
|
0 |
0 |
for(iSeg=0; iSegaLevel[iLvl].nSeg; iSeg++){ |
231925
|
0 |
0 |
if( pStruct ){ |
231931
|
0 |
0 |
if( pNew ){ |
231933
|
0 |
0 |
for(iLvl=0; pNew->aLevel[iLvl].nSeg==0; iLvl++){} |
231934
|
0 |
0 |
while( p->rc==SQLITE_OK && pNew->aLevel[iLvl].nSeg>0 ){ |
|
0 |
0 |
while( p->rc==SQLITE_OK && pNew->aLevel[iLvl].nSeg>0 ){ |
231952
|
0 |
0 |
if( pStruct ){ |
231955
|
0 |
0 |
if( nMerge<0 ){ |
231962
|
0 |
0 |
if( pStruct && pStruct->nLevel ){ |
|
0 |
0 |
if( pStruct && pStruct->nLevel ){ |
231963
|
0 |
0 |
if( fts5IndexMerge(p, &pStruct, nMerge, nMin) ){ |
231991
|
0 |
0 |
if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nByte) ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nByte) ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nByte) ){ |
232004
|
0 |
0 |
if( p>=pIter->aEof ){ |
232013
|
0 |
0 |
if( p[0] & 0x80 ){ |
232023
|
0 |
0 |
if( &pIter->aPoslist[pIter->nPoslist]>pIter->aEof ){ |
232034
|
0 |
0 |
if( pBuf->n>0 ){ |
232076
|
0 |
0 |
if( i>=pBuf->n ){ |
232107
|
0 |
0 |
if( p->rc ) return; |
232111
|
0 |
0 |
while( i1>=0 || i2>=0 ){ |
|
0 |
0 |
while( i1>=0 || i2>=0 ){ |
232112
|
0 |
0 |
if( i1>=0 && (i2<0 || iRowid1
|
|
0 |
0 |
if( i1>=0 && (i2<0 || iRowid1
|
|
0 |
0 |
if( i1>=0 && (i2<0 || iRowid1
|
232121
|
0 |
0 |
if( i1>=0 && iRowid1==iRowid2 ){ |
|
0 |
0 |
if( i1>=0 && iRowid1==iRowid2 ){ |
232145
|
0 |
0 |
if( p->iter.aPoslist ){ |
232147
|
0 |
0 |
while( *pp && p->iter.iRowid>(*pp)->iter.iRowid ){ |
|
0 |
0 |
while( *pp && p->iter.iRowid>(*pp)->iter.iRowid ){ |
232159
|
0 |
0 |
if( p->iPos>=0 ){ |
232161
|
0 |
0 |
while( *pp && p->iPos>(*pp)->iPos ){ |
|
0 |
0 |
while( *pp && p->iPos>(*pp)->iPos ){ |
232198
|
0 |
0 |
for(i=0; i
|
232203
|
0 |
0 |
if( nOut==0 ) return; |
232218
|
0 |
0 |
if( sqlite3Fts5BufferSize(&p->rc, &out, nOut) ) return; |
232220
|
0 |
0 |
while( pHead ){ |
232223
|
0 |
0 |
if( pHead->pNext && iLastRowid==pHead->pNext->iter.iRowid ){ |
|
0 |
0 |
if( pHead->pNext && iLastRowid==pHead->pNext->iter.iRowid ){ |
232233
|
0 |
0 |
while( pSave && pSave->iter.iRowid==iLastRowid ){ |
|
0 |
0 |
while( pSave && pSave->iter.iRowid==iLastRowid ){ |
232245
|
0 |
0 |
if( pHead==0 || pHead->pNext==0 ){ |
|
0 |
0 |
if( pHead==0 || pHead->pNext==0 ){ |
232253
|
0 |
0 |
if( sqlite3Fts5BufferSize(&p->rc, &tmp, nTmp+nMerge*10) ){ |
232264
|
0 |
0 |
while( pHead->pNext ){ |
232266
|
0 |
0 |
if( pThis->iPos!=iPrev ){ |
232274
|
0 |
0 |
if( pHead->iPos!=iPrev ){ |
232282
|
0 |
0 |
if( tmp.n+nTail>nTmp-FTS5_DATA_ZERO_PADDING ){ |
232283
|
0 |
0 |
if( p->rc==SQLITE_OK ) p->rc = FTS5_CORRUPT; |
232288
|
0 |
0 |
if( nTail>0 ){ |
232293
|
0 |
0 |
for(i=0; i
|
232295
|
0 |
0 |
if( pX->iter.aPoslist && pX->iter.iRowid==iLastRowid ){ |
|
0 |
0 |
if( pX->iter.aPoslist && pX->iter.iRowid==iLastRowid ){ |
232334
|
0 |
0 |
if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){ |
232347
|
0 |
0 |
if( aBuf && pStruct ){ |
|
0 |
0 |
if( aBuf && pStruct ){ |
232359
|
0 |
0 |
if( iIdx!=0 ){ |
232365
|
0 |
0 |
for(; |
232371
|
0 |
0 |
if( p1->base.nData ){ |
232382
|
0 |
0 |
for( /* no-op */ ; |
232392
|
0 |
0 |
if( bNewTerm ){ |
232393
|
0 |
0 |
if( nTerm
|
|
0 |
0 |
if( nTerm
|
232396
|
0 |
0 |
if( p1->base.nData==0 ) continue; |
232398
|
0 |
0 |
if( p1->base.iRowid<=iLastRowid && doclist.n>0 ){ |
|
0 |
0 |
if( p1->base.iRowid<=iLastRowid && doclist.n>0 ){ |
232399
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && doclist.n; i++){ |
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && doclist.n; i++){ |
232403
|
0 |
0 |
for(iStore=i1; iStore
|
232404
|
0 |
0 |
if( aBuf[iStore].n==0 ){ |
232410
|
0 |
0 |
if( iStore==i1+nMerge ){ |
232412
|
0 |
0 |
for(iStore=i1; iStore
|
232425
|
0 |
0 |
for(i=0; i
|
232427
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
232430
|
0 |
0 |
for(iFree=i; iFree
|
232437
|
0 |
0 |
if( pData ){ |
232440
|
0 |
0 |
if( doclist.n ) memcpy(pData->p, doclist.p, doclist.n); |
232459
|
0 |
0 |
if( p->pHash==0 ){ |
232464
|
0 |
0 |
if( iRowidiWriteRowid |
232465
|
0 |
0 |
|| (iRowid==p->iWriteRowid && p->bDelete==0) |
|
0 |
0 |
|| (iRowid==p->iWriteRowid && p->bDelete==0) |
232466
|
0 |
0 |
|| (p->nPendingData > p->pConfig->nHashSize) |
232532
|
0 |
0 |
if( rc==SQLITE_OK ){ |
232536
|
0 |
0 |
if( p->zDataTbl && bCreate ){ |
|
0 |
0 |
if( p->zDataTbl && bCreate ){ |
232540
|
0 |
0 |
if( rc==SQLITE_OK ){ |
232546
|
0 |
0 |
if( rc==SQLITE_OK ){ |
232553
|
0 |
0 |
if( rc ){ |
232565
|
0 |
0 |
if( p ){ |
232593
|
0 |
0 |
for(i=0; i
|
232594
|
0 |
0 |
if( n>=nByte ) return 0; /* Input contains fewer than nChar chars */ |
232595
|
0 |
0 |
if( (unsigned char)p[n++]>=0xc0 ){ |
232596
|
0 |
0 |
if( n>=nByte ) return 0; |
232597
|
0 |
0 |
while( (p[n] & 0xc0)==0x80 ){ |
232599
|
0 |
0 |
if( n>=nByte ){ |
232600
|
0 |
0 |
if( i+1==nChar ) break; |
232616
|
0 |
0 |
while( i
|
232617
|
0 |
0 |
if( (unsigned char)pIn[i++]>=0xc0 ){ |
232618
|
0 |
0 |
while( i
|
|
0 |
0 |
while( i
|
232653
|
0 |
0 |
for(i=0; inPrefix && rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; inPrefix && rc==SQLITE_OK; i++){ |
232656
|
0 |
0 |
if( nByte ){ |
232685
|
0 |
0 |
if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){ |
232688
|
0 |
0 |
if( nToken>0 ) memcpy(&buf.p[1], pToken, nToken); |
232706
|
0 |
0 |
if( flags & FTS5INDEX_QUERY_PREFIX ){ |
232708
|
0 |
0 |
for(iIdx=1; iIdx<=pConfig->nPrefix; iIdx++){ |
232710
|
0 |
0 |
if( nIdxChar==nChar ) break; |
232711
|
0 |
0 |
if( nIdxChar==nChar+1 ) iPrefixIdx = iIdx; |
232715
|
0 |
0 |
if( iIdx<=pConfig->nPrefix ){ |
232719
|
0 |
0 |
if( pStruct ){ |
232729
|
0 |
0 |
if( pRet==0 ){ |
232734
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
232736
|
0 |
0 |
if( pSeg->pLeaf ) pRet->xSetOutputs(pRet, pSeg); |
232741
|
0 |
0 |
if( p->rc ){ |
232776
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
232778
|
0 |
0 |
if( pSeg->pLeaf && pSeg->term.p[0]!=FTS5_MAIN_PREFIX ){ |
|
0 |
0 |
if( pSeg->pLeaf && pSeg->term.p[0]!=FTS5_MAIN_PREFIX ){ |
232807
|
0 |
0 |
return (z ? &z[1] : 0); |
232814
|
0 |
0 |
if( pIndexIter ){ |
232835
|
0 |
0 |
if( p->rc==SQLITE_OK && pData->nn ){ |
|
0 |
0 |
if( p->rc==SQLITE_OK && pData->nn ){ |
232839
|
0 |
0 |
for(iCol=0; inn && iCol
|
|
0 |
0 |
for(iCol=0; inn && iCol
|
232885
|
0 |
0 |
if( rc==SQLITE_OK ){ |
232922
|
0 |
0 |
if( iIdx>=0 ) ret += (ret<<3) + (FTS5_MAIN_PREFIX + iIdx); |
232923
|
0 |
0 |
for(i=0; i
|
233139
|
0 |
0 |
for(i=iFirst; p->rc==SQLITE_OK && i<=iLast; i++){ |
|
0 |
0 |
for(i=iFirst; p->rc==SQLITE_OK && i<=iLast; i++){ |
233141
|
0 |
0 |
if( pLeaf ){ |
233142
|
0 |
0 |
if( !fts5LeafIsTermless(pLeaf) ) p->rc = FTS5_CORRUPT; |
233143
|
0 |
0 |
if( i>=iNoRowid && 0!=fts5LeafFirstRowidOff(pLeaf) ) p->rc = FTS5_CORRUPT; |
|
0 |
0 |
if( i>=iNoRowid && 0!=fts5LeafFirstRowidOff(pLeaf) ) p->rc = FTS5_CORRUPT; |
233157
|
0 |
0 |
while( iinn && p->rc==SQLITE_OK ){ |
|
0 |
0 |
while( iinn && p->rc==SQLITE_OK ){ |
233166
|
0 |
0 |
if( iOff>=pLeaf->szLeaf ){ |
233168
|
0 |
0 |
}else if( iTermOff==nIncr ){ |
233171
|
0 |
0 |
if( (iOff+nByte)>pLeaf->szLeaf ){ |
233180
|
0 |
0 |
if( nKeep>buf1.n || (iOff+nByte)>pLeaf->szLeaf ){ |
|
0 |
0 |
if( nKeep>buf1.n || (iOff+nByte)>pLeaf->szLeaf ){ |
233187
|
0 |
0 |
if( p->rc==SQLITE_OK ){ |
233189
|
0 |
0 |
if( res<=0 ) p->rc = FTS5_CORRUPT; |
233209
|
0 |
0 |
if( pSeg->pgnoFirst==0 ) return; |
233218
|
0 |
0 |
while( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ |
|
0 |
0 |
while( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ |
233229
|
0 |
0 |
if( iIdxLeafpgnoFirst ) continue; |
233232
|
0 |
0 |
if( pLeaf==0 ) break; |
233238
|
0 |
0 |
if( pLeaf->nn<=pLeaf->szLeaf ){ |
233248
|
0 |
0 |
if( iRowidOff>=iOff || iOff>=pLeaf->szLeaf ){ |
|
0 |
0 |
if( iRowidOff>=iOff || iOff>=pLeaf->szLeaf ){ |
233252
|
0 |
0 |
res = fts5Memcmp(&pLeaf->p[iOff], zIdxTerm, MIN(nTerm, nIdxTerm)); |
233253
|
0 |
0 |
if( res==0 ) res = nTerm - nIdxTerm; |
233254
|
0 |
0 |
if( res<0 ) p->rc = FTS5_CORRUPT; |
233260
|
0 |
0 |
if( p->rc ) break; |
233267
|
0 |
0 |
if( p->rc ) break; |
233270
|
0 |
0 |
if( bIdxDlidx ){ |
233277
|
0 |
0 |
for(pDlidx=fts5DlidxIterInit(p, 0, iSegid, iIdxLeaf); |
233283
|
0 |
0 |
for(iPg=iPrevLeaf+1; iPg
|
233286
|
0 |
0 |
if( pLeaf ){ |
233287
|
0 |
0 |
if( fts5LeafFirstRowidOff(pLeaf)!=0 ) p->rc = FTS5_CORRUPT; |
233297
|
0 |
0 |
if( pLeaf ){ |
233301
|
0 |
0 |
if( iRowidOff>=pLeaf->szLeaf ){ |
233305
|
0 |
0 |
if( iRowid!=fts5DlidxIterRowid(pDlidx) ) p->rc = FTS5_CORRUPT; |
233323
|
0 |
0 |
if( p->rc==SQLITE_OK ) p->rc = rc2; |
233361
|
0 |
0 |
if( pStruct==0 ){ |
233367
|
0 |
0 |
for(iLvl=0; iLvlnLevel; iLvl++){ |
233368
|
0 |
0 |
for(iSeg=0; iSegaLevel[iLvl].nSeg; iSeg++){ |
233387
|
0 |
0 |
for(fts5MultiIterNew(p, pStruct, flags, 0, 0, 0, -1, 0, &pIter); |
233400
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ){ |
233401
|
0 |
0 |
if( 0==fts5MultiIterIsEmpty(p, pIter) ){ |
233408
|
0 |
0 |
while( 0==sqlite3Fts5PoslistNext64(poslist.p, poslist.n, &iOff, &iPos) ){ |
233418
|
0 |
0 |
if( p->rc==SQLITE_OK && bUseCksum && cksum!=cksum2 ) p->rc = FTS5_CORRUPT; |
|
0 |
0 |
if( p->rc==SQLITE_OK && bUseCksum && cksum!=cksum2 ) p->rc = FTS5_CORRUPT; |
|
0 |
0 |
if( p->rc==SQLITE_OK && bUseCksum && cksum!=cksum2 ) p->rc = FTS5_CORRUPT; |
233935
|
0 |
0 |
if( fts5IndexDataVersion(p)!=p->iStructVersion ){ |
234257
|
0 |
0 |
if( pTab ){ |
234279
|
0 |
0 |
if( rc==SQLITE_OK ){ |
234313
|
0 |
0 |
if( rc==SQLITE_OK ){ |
234317
|
0 |
0 |
if( rc==SQLITE_OK ){ |
234323
|
0 |
0 |
if( rc==SQLITE_OK ){ |
234328
|
0 |
0 |
if( rc==SQLITE_OK ){ |
234335
|
0 |
0 |
if( rc==SQLITE_OK ){ |
234340
|
0 |
0 |
if( rc==SQLITE_OK ){ |
234348
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
234415
|
0 |
0 |
if( pConfig->ePattern==FTS5_PATTERN_GLOB && p->op==FTS5_PATTERN_GLOB ){ |
|
0 |
0 |
if( pConfig->ePattern==FTS5_PATTERN_GLOB && p->op==FTS5_PATTERN_GLOB ){ |
234418
|
0 |
0 |
if( pConfig->ePattern==FTS5_PATTERN_LIKE |
234419
|
0 |
0 |
&& (p->op==FTS5_PATTERN_LIKE || p->op==FTS5_PATTERN_GLOB) |
|
0 |
0 |
&& (p->op==FTS5_PATTERN_LIKE || p->op==FTS5_PATTERN_GLOB) |
234511
|
0 |
0 |
if( pConfig->bLock ){ |
234519
|
0 |
0 |
if( idxStr==0 ) return SQLITE_NOMEM; |
234523
|
0 |
0 |
for(i=0; inConstraint; i++){ |
234526
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_MATCH |
234527
|
0 |
0 |
|| (p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol>=nCol) |
|
0 |
0 |
|| (p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol>=nCol) |
234530
|
0 |
0 |
if( p->usable==0 || iCol<0 ){ |
|
0 |
0 |
if( p->usable==0 || iCol<0 ){ |
234538
|
0 |
0 |
if( iCol==nCol+1 ){ |
234539
|
0 |
0 |
if( bSeenRank ) continue; |
234542
|
0 |
0 |
}else if( iCol>=0 ){ |
234552
|
0 |
0 |
}else if( p->usable ){ |
234553
|
0 |
0 |
if( iCol>=0 && iCol
|
|
0 |
0 |
if( iCol>=0 && iCol
|
|
0 |
0 |
if( iCol>=0 && iCol
|
234555
|
0 |
0 |
idxStr[iIdxStr++] = p->op==FTS5_PATTERN_LIKE ? 'L' : 'G'; |
234560
|
0 |
0 |
}else if( bSeenEq==0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol<0 ){ |
|
0 |
0 |
}else if( bSeenEq==0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol<0 ){ |
|
0 |
0 |
}else if( bSeenEq==0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol<0 ){ |
234568
|
0 |
0 |
if( bSeenEq==0 ){ |
234569
|
0 |
0 |
for(i=0; inConstraint; i++){ |
234571
|
0 |
0 |
if( p->iColumn<0 && p->usable ){ |
|
0 |
0 |
if( p->iColumn<0 && p->usable ){ |
234573
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_LT || op==SQLITE_INDEX_CONSTRAINT_LE ){ |
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_LT || op==SQLITE_INDEX_CONSTRAINT_LE ){ |
234574
|
0 |
0 |
if( bSeenLt ) continue; |
234579
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_GT || op==SQLITE_INDEX_CONSTRAINT_GE ){ |
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_GT || op==SQLITE_INDEX_CONSTRAINT_GE ){ |
234580
|
0 |
0 |
if( bSeenGt ) continue; |
234591
|
0 |
0 |
if( pInfo->nOrderBy==1 ){ |
234593
|
0 |
0 |
if( iSort==(pConfig->nCol+1) && bSeenMatch ){ |
|
0 |
0 |
if( iSort==(pConfig->nCol+1) && bSeenMatch ){ |
234595
|
0 |
0 |
}else if( iSort==-1 ){ |
234598
|
0 |
0 |
if( BitFlagTest(idxFlags, FTS5_BI_ORDER_RANK|FTS5_BI_ORDER_ROWID) ){ |
234600
|
0 |
0 |
if( pInfo->aOrderBy[0].desc ){ |
234607
|
0 |
0 |
if( bSeenEq ){ |
234608
|
0 |
0 |
pInfo->estimatedCost = bSeenMatch ? 100.0 : 10.0; |
234609
|
0 |
0 |
if( bSeenMatch==0 ) fts5SetUniqueFlag(pInfo); |
234610
|
0 |
0 |
}else if( bSeenLt && bSeenGt ){ |
|
0 |
0 |
}else if( bSeenLt && bSeenGt ){ |
234611
|
0 |
0 |
pInfo->estimatedCost = bSeenMatch ? 500.0 : 250000.0; |
234612
|
0 |
0 |
}else if( bSeenLt || bSeenGt ){ |
|
0 |
0 |
}else if( bSeenLt || bSeenGt ){ |
234613
|
0 |
0 |
pInfo->estimatedCost = bSeenMatch ? 750.0 : 750000.0; |
234615
|
0 |
0 |
pInfo->estimatedCost = bSeenMatch ? 1000.0 : 1000000.0; |
234624
|
0 |
0 |
for(pCsr=pTab->pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){ |
234625
|
0 |
0 |
if( pCsr->base.pVtab==(sqlite3_vtab*)pTab ) return SQLITE_OK; |
234641
|
0 |
0 |
if( rc==SQLITE_OK ){ |
234644
|
0 |
0 |
if( pCsr ){ |
234660
|
0 |
0 |
if( pCsr->ePlan==FTS5_PLAN_SCAN ){ |
234687
|
0 |
0 |
if( pCsr->pStmt ){ |
234691
|
0 |
0 |
if( pCsr->pSorter ){ |
234697
|
0 |
0 |
if( pCsr->ePlan!=FTS5_PLAN_SOURCE ){ |
234701
|
0 |
0 |
for(pData=pCsr->pAuxdata; pData; pData=pNext){ |
234703
|
0 |
0 |
if( pData->xDelete ) pData->xDelete(pData->pPtr); |
234710
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_FREE_ZRANK) ){ |
234725
|
0 |
0 |
if( pCursor ){ |
234732
|
0 |
0 |
for(pp=&pTab->pGlobal->pCsr; (*pp)!=pCsr; pp=&(*pp)->pNext); |
234745
|
0 |
0 |
if( rc==SQLITE_DONE ){ |
234748
|
0 |
0 |
}else if( rc==SQLITE_ROW ){ |
234761
|
0 |
0 |
if( nBlob>0 ){ |
234762
|
0 |
0 |
for(i=0; i<(pSorter->nIdx-1); i++){ |
234785
|
0 |
0 |
for(pCsr=pTab->pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){ |
234786
|
0 |
0 |
if( pCsr->ePlan==FTS5_PLAN_MATCH |
234787
|
0 |
0 |
&& pCsr->base.pVtab==(sqlite3_vtab*)pTab |
234809
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_RESEEK) ){ |
234815
|
0 |
0 |
if( rc==SQLITE_OK && iRowid!=sqlite3Fts5ExprRowid(pCsr->pExpr) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && iRowid!=sqlite3Fts5ExprRowid(pCsr->pExpr) ){ |
234821
|
0 |
0 |
if( sqlite3Fts5ExprEof(pCsr->pExpr) ){ |
234847
|
0 |
0 |
if( pCsr->ePlan<3 ){ |
234849
|
0 |
0 |
if( (rc = fts5CursorReseek(pCsr, &bSkip)) || bSkip ) return rc; |
|
0 |
0 |
if( (rc = fts5CursorReseek(pCsr, &bSkip)) || bSkip ) return rc; |
234871
|
0 |
0 |
if( rc!=SQLITE_ROW ){ |
234874
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
234904
|
0 |
0 |
if( zSql==0 ){ |
234909
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
234936
|
0 |
0 |
if( pSorter==0 ) return SQLITE_NOMEM; |
234947
|
0 |
0 |
rc = fts5PrepareStatement(&pSorter->pStmt, pConfig, |
|
0 |
0 |
rc = fts5PrepareStatement(&pSorter->pStmt, pConfig, |
|
0 |
0 |
rc = fts5PrepareStatement(&pSorter->pStmt, pConfig, |
234956
|
0 |
0 |
if( rc==SQLITE_OK ){ |
234963
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
234976
|
0 |
0 |
if( sqlite3Fts5ExprEof(pExpr) ){ |
234998
|
0 |
0 |
while( z[0]==' ' ) z++; |
234999
|
0 |
0 |
for(n=0; z[n] && z[n]!=' '; n++); |
|
0 |
0 |
for(n=0; z[n] && z[n]!=' '; n++); |
235004
|
0 |
0 |
if( n==5 && 0==sqlite3_strnicmp("reads", z, n) ){ |
|
0 |
0 |
if( n==5 && 0==sqlite3_strnicmp("reads", z, n) ){ |
235007
|
0 |
0 |
else if( n==2 && 0==sqlite3_strnicmp("id", z, n) ){ |
|
0 |
0 |
else if( n==2 && 0==sqlite3_strnicmp("id", z, n) ){ |
235027
|
0 |
0 |
for(pAux=pTab->pGlobal->pAux; pAux; pAux=pAux->pNext){ |
235028
|
0 |
0 |
if( sqlite3_stricmp(zName, pAux->zFunc)==0 ) return pAux; |
235044
|
0 |
0 |
if( zRankArgs ){ |
235046
|
0 |
0 |
if( zSql ){ |
235052
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235053
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){ |
235058
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235060
|
0 |
0 |
for(i=0; inRankArg; i++){ |
235073
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235075
|
0 |
0 |
if( pAux==0 ){ |
235093
|
0 |
0 |
if( pRank ){ |
235098
|
0 |
0 |
if( z==0 ){ |
235099
|
0 |
0 |
if( sqlite3_value_type(pRank)==SQLITE_NULL ) rc = SQLITE_ERROR; |
235103
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235107
|
0 |
0 |
}else if( rc==SQLITE_ERROR ){ |
235113
|
0 |
0 |
if( pConfig->zRank ){ |
235125
|
0 |
0 |
if( pVal ){ |
235127
|
0 |
0 |
if( eType==SQLITE_INTEGER ){ |
235168
|
0 |
0 |
if( pConfig->bLock ){ |
235175
|
0 |
0 |
if( pCsr->ePlan ){ |
235192
|
0 |
0 |
for(i=0; i
|
235199
|
0 |
0 |
if( zText==0 ) zText = ""; |
235204
|
0 |
0 |
}while( idxStr[iIdxStr]>='0' && idxStr[iIdxStr]<='9' ); |
|
0 |
0 |
}while( idxStr[iIdxStr]>='0' && idxStr[iIdxStr]<='9' ); |
235206
|
0 |
0 |
if( zText[0]=='*' ){ |
235215
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235219
|
0 |
0 |
if( rc!=SQLITE_OK ) goto filter_out; |
235232
|
0 |
0 |
}while( idxStr[iIdxStr]>='0' && idxStr[iIdxStr]<='9' ); |
|
0 |
0 |
}while( idxStr[iIdxStr]>='0' && idxStr[iIdxStr]<='9' ); |
235233
|
0 |
0 |
if( zText ){ |
235236
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235240
|
0 |
0 |
if( rc!=SQLITE_OK ) goto filter_out; |
235261
|
0 |
0 |
if( pRowidEq ){ |
235264
|
0 |
0 |
if( bDesc ){ |
235272
|
0 |
0 |
if( pTab->pSortCsr ){ |
235283
|
0 |
0 |
if( pTab->pSortCsr->bDesc ){ |
235293
|
0 |
0 |
}else if( pCsr->pExpr ){ |
235295
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235296
|
0 |
0 |
if( bOrderByRank ){ |
235304
|
0 |
0 |
}else if( pConfig->zContent==0 ){ |
235312
|
0 |
0 |
pCsr->ePlan = (pRowidEq ? FTS5_PLAN_ROWID : FTS5_PLAN_SCAN); |
235316
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235317
|
0 |
0 |
if( pRowidEq!=0 ){ |
235351
|
0 |
0 |
if( pCsr->pSorter ){ |
235399
|
0 |
0 |
if( pCsr->pStmt==0 ){ |
235402
|
0 |
0 |
rc = sqlite3Fts5StorageStmt( |
235409
|
0 |
0 |
if( rc==SQLITE_OK && CsrFlagTest(pCsr, FTS5CSR_REQUIRE_CONTENT) ){ |
|
0 |
0 |
if( rc==SQLITE_OK && CsrFlagTest(pCsr, FTS5CSR_REQUIRE_CONTENT) ){ |
235417
|
0 |
0 |
if( rc==SQLITE_ROW ){ |
235422
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235424
|
0 |
0 |
}else if( pTab->pConfig->pzErrmsg ){ |
235466
|
0 |
0 |
if( 0==sqlite3_stricmp("delete-all", zCmd) ){ |
235467
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
235476
|
0 |
0 |
}else if( 0==sqlite3_stricmp("rebuild", zCmd) ){ |
235477
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NONE ){ |
235485
|
0 |
0 |
}else if( 0==sqlite3_stricmp("optimize", zCmd) ){ |
235487
|
0 |
0 |
}else if( 0==sqlite3_stricmp("merge", zCmd) ){ |
235490
|
0 |
0 |
}else if( 0==sqlite3_stricmp("integrity-check", zCmd) ){ |
235499
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235502
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235503
|
0 |
0 |
if( bError ){ |
235519
|
0 |
0 |
if( eType1==SQLITE_INTEGER ){ |
235533
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235536
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235582
|
0 |
0 |
if( eType0==SQLITE_NULL |
235583
|
0 |
0 |
&& sqlite3_value_type(apVal[2+pConfig->nCol])!=SQLITE_NULL |
235587
|
0 |
0 |
if( pConfig->eContent!=FTS5_CONTENT_NORMAL |
235588
|
0 |
0 |
&& 0==sqlite3_stricmp("delete", z) |
235607
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
235616
|
0 |
0 |
if( eType0==SQLITE_INTEGER && fts5IsContentless(pTab) ){ |
|
0 |
0 |
if( eType0==SQLITE_INTEGER && fts5IsContentless(pTab) ){ |
235617
|
0 |
0 |
pTab->p.base.zErrMsg = sqlite3_mprintf( |
235625
|
0 |
0 |
else if( nArg==1 ){ |
235634
|
0 |
0 |
if( eType1!=SQLITE_INTEGER && eType1!=SQLITE_NULL ){ |
|
0 |
0 |
if( eType1!=SQLITE_INTEGER && eType1!=SQLITE_NULL ){ |
235638
|
0 |
0 |
else if( eType0!=SQLITE_INTEGER ){ |
235640
|
0 |
0 |
if( eConflict==SQLITE_REPLACE && eType1==SQLITE_INTEGER ){ |
|
0 |
0 |
if( eConflict==SQLITE_REPLACE && eType1==SQLITE_INTEGER ){ |
235651
|
0 |
0 |
if( eType1==SQLITE_INTEGER && iOld!=iNew ){ |
|
0 |
0 |
if( eType1==SQLITE_INTEGER && iOld!=iNew ){ |
235652
|
0 |
0 |
if( eConflict==SQLITE_REPLACE ){ |
235654
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235660
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235663
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235784
|
0 |
0 |
if( fts5IsContentless((Fts5FullTable*)(pCsr->base.pVtab)) |
235785
|
0 |
0 |
|| pCsr->ePlan==FTS5_PLAN_SPECIAL |
235791
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235809
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_POSLIST) ){ |
235811
|
0 |
0 |
if( pConfig->eDetail!=FTS5_DETAIL_FULL ){ |
235815
|
0 |
0 |
if( aPopulator==0 ) rc = SQLITE_NOMEM; |
235816
|
0 |
0 |
for(i=0; inCol && rc==SQLITE_OK; i++){ |
|
0 |
0 |
for(i=0; inCol && rc==SQLITE_OK; i++){ |
235819
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235827
|
0 |
0 |
if( pCsr->pSorter ){ |
235834
|
0 |
0 |
if( pCsr->pSorter && pConfig->eDetail==FTS5_DETAIL_FULL ){ |
|
0 |
0 |
if( pCsr->pSorter && pConfig->eDetail==FTS5_DETAIL_FULL ){ |
235836
|
0 |
0 |
int i1 = (iPhrase==0 ? 0 : pSorter->aIdx[iPhrase-1]); |
235858
|
0 |
0 |
if( pCsr->aInstIter==0 ){ |
235864
|
0 |
0 |
if( aIter ){ |
235869
|
0 |
0 |
for(i=0; i
|
|
0 |
0 |
for(i=0; i
|
235873
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235878
|
0 |
0 |
if( rc==SQLITE_OK ){ |
235882
|
0 |
0 |
for(i=0; i
|
235883
|
0 |
0 |
if( (aIter[i].bEof==0) |
235884
|
0 |
0 |
&& (iBest<0 || aIter[i].iPos
|
|
0 |
0 |
&& (iBest<0 || aIter[i].iPos
|
235889
|
0 |
0 |
if( iBest<0 ) break; |
235892
|
0 |
0 |
if( nInst>=pCsr->nInstAlloc ){ |
235893
|
0 |
0 |
int nNewSize = pCsr->nInstAlloc ? pCsr->nInstAlloc*2 : 32; |
235897
|
0 |
0 |
if( aInst ){ |
235911
|
0 |
0 |
if( aInst[1]<0 || aInst[1]>=nCol ){ |
|
0 |
0 |
if( aInst[1]<0 || aInst[1]>=nCol ){ |
235928
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_INST)==0 |
235929
|
0 |
0 |
|| SQLITE_OK==(rc = fts5CacheInstArray(pCsr)) ){ |
235944
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_INST)==0 |
235945
|
0 |
0 |
|| SQLITE_OK==(rc = fts5CacheInstArray(pCsr)) |
235947
|
0 |
0 |
if( iIdx<0 || iIdx>=pCsr->nInstCount ){ |
|
0 |
0 |
if( iIdx<0 || iIdx>=pCsr->nInstCount ){ |
235979
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ){ |
235991
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_DOCSIZE) ){ |
235992
|
0 |
0 |
if( pConfig->bColumnsize ){ |
235995
|
0 |
0 |
}else if( pConfig->zContent==0 ){ |
235997
|
0 |
0 |
for(i=0; inCol; i++){ |
235998
|
0 |
0 |
if( pConfig->abUnindexed[i]==0 ){ |
236004
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inCol; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inCol; i++){ |
236005
|
0 |
0 |
if( pConfig->abUnindexed[i]==0 ){ |
236010
|
0 |
0 |
if( rc==SQLITE_OK ){ |
236020
|
0 |
0 |
if( iCol<0 ){ |
236023
|
0 |
0 |
for(i=0; inCol; i++){ |
236026
|
0 |
0 |
}else if( iColnCol ){ |
236048
|
0 |
0 |
for(pData=pCsr->pAuxdata; pData; pData=pData->pNext){ |
236049
|
0 |
0 |
if( pData->pAux==pCsr->pAux ) break; |
236052
|
0 |
0 |
if( pData ){ |
236053
|
0 |
0 |
if( pData->xDelete ){ |
236059
|
0 |
0 |
if( pData==0 ){ |
236060
|
0 |
0 |
if( xDelete ) xDelete(pPtr); |
236078
|
0 |
0 |
for(pData=pCsr->pAuxdata; pData; pData=pData->pNext){ |
236079
|
0 |
0 |
if( pData->pAux==pCsr->pAux ) break; |
236082
|
0 |
0 |
if( pData ){ |
236084
|
0 |
0 |
if( bClear ){ |
236099
|
0 |
0 |
if( pIter->a>=pIter->b ){ |
236105
|
0 |
0 |
if( iVal==1 ){ |
236124
|
0 |
0 |
if( rc==SQLITE_OK ){ |
236126
|
0 |
0 |
pIter->b = (pIter->a ? &pIter->a[n] : 0); |
236142
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){ |
236143
|
0 |
0 |
if( pIter->a>=pIter->b ){ |
236153
|
0 |
0 |
if( pIter->a>=pIter->b ){ |
236157
|
0 |
0 |
if( pIter->a[0]==0x01 ) break; |
236174
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){ |
236177
|
0 |
0 |
if( pSorter ){ |
236178
|
0 |
0 |
int i1 = (iPhrase==0 ? 0 : pSorter->aIdx[iPhrase-1]); |
236184
|
0 |
0 |
if( rc==SQLITE_OK ){ |
236186
|
0 |
0 |
pIter->b = (pIter->a ? &pIter->a[n] : 0); |
236193
|
0 |
0 |
if( rc==SQLITE_OK ){ |
236195
|
0 |
0 |
pIter->b = (pIter->a ? &pIter->a[n] : 0); |
236196
|
0 |
0 |
if( n<=0 ){ |
236198
|
0 |
0 |
}else if( pIter->a[0]==0x01 ){ |
236252
|
0 |
0 |
if( rc==SQLITE_OK ){ |
236260
|
0 |
0 |
if( rc==SQLITE_OK ){ |
236261
|
0 |
0 |
for(rc = fts5CursorFirst(pTab, pNew, 0); |
236262
|
0 |
0 |
rc==SQLITE_OK && CsrFlagTest(pNew, FTS5CSR_EOF)==0; |
236266
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
236267
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
236292
|
0 |
0 |
for(pCsr=pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){ |
236293
|
0 |
0 |
if( pCsr->iCsrId==iCsrId ) break; |
236313
|
0 |
0 |
if( pCsr==0 || pCsr->ePlan==0 ){ |
|
0 |
0 |
if( pCsr==0 || pCsr->ePlan==0 ){ |
236333
|
0 |
0 |
if( pCsr ){ |
236365
|
0 |
0 |
for(i=0; i<(nPhrase-1); i++){ |
236372
|
0 |
0 |
for(i=0; i
|
236383
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<(nPhrase-1); i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<(nPhrase-1); i++){ |
236391
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
236423
|
0 |
0 |
if( pCsr->ePlan==FTS5_PLAN_SPECIAL ){ |
236424
|
0 |
0 |
if( iCol==pConfig->nCol ){ |
236429
|
0 |
0 |
if( iCol==pConfig->nCol ){ |
236435
|
0 |
0 |
}else if( iCol==pConfig->nCol+1 ){ |
236438
|
0 |
0 |
if( pCsr->ePlan==FTS5_PLAN_SOURCE ){ |
236440
|
0 |
0 |
}else if( |
236442
|
0 |
0 |
|| pCsr->ePlan==FTS5_PLAN_SORTED_MATCH |
236444
|
0 |
0 |
if( pCsr->pRank || SQLITE_OK==(rc = fts5FindRankFunction(pCsr)) ){ |
|
0 |
0 |
if( pCsr->pRank || SQLITE_OK==(rc = fts5FindRankFunction(pCsr)) ){ |
236448
|
0 |
0 |
}else if( !fts5IsContentless(pTab) ){ |
236451
|
0 |
0 |
if( rc==SQLITE_OK ){ |
236476
|
0 |
0 |
if( pAux ){ |
236549
|
933 |
0 |
if( rc==SQLITE_OK ){ |
236557
|
933 |
0 |
if( pAux ){ |
236595
|
1244 |
0 |
if( pNew ){ |
236604
|
311 |
933 |
if( pNew->pNext==0 ){ |
236620
|
0 |
0 |
if( zName==0 ){ |
236623
|
0 |
0 |
for(pMod=pGlobal->pTok; pMod; pMod=pMod->pNext){ |
236624
|
0 |
0 |
if( sqlite3_stricmp(zName, pMod->zName)==0 ) break; |
236645
|
0 |
0 |
if( pMod ){ |
236666
|
0 |
0 |
pMod = fts5LocateTokenizer(pGlobal, nArg==0 ? 0 : azArg[0]); |
236667
|
0 |
0 |
if( pMod==0 ){ |
236672
|
0 |
0 |
rc = pMod->x.xCreate( |
|
0 |
0 |
rc = pMod->x.xCreate( |
236676
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
236677
|
0 |
0 |
if( pzErr ) *pzErr = sqlite3_mprintf("error in tokenizer constructor"); |
236685
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
236698
|
927 |
309 |
for(pAux=pGlobal->pAux; pAux; pAux=pNextAux){ |
236700
|
0 |
927 |
if( pAux->xDestroy ) pAux->xDestroy(pAux->pUserData); |
236704
|
1236 |
309 |
for(pTok=pGlobal->pTok; pTok; pTok=pNextTok){ |
236706
|
0 |
1236 |
if( pTok->xDestroy ) pTok->xDestroy(pTok->pUserData); |
236723
|
0 |
0 |
if( ppApi ) *ppApi = &pGlobal->api; |
236748
|
0 |
0 |
for(i=0; i
|
236749
|
0 |
0 |
if( sqlite3_stricmp(zName, azName[i])==0 ) return 1; |
236786
|
0 |
311 |
if( pGlobal==0 ){ |
236797
|
311 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5IndexInit(db); |
236798
|
311 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5ExprInit(pGlobal, db); |
236799
|
311 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5AuxInit(&pGlobal->api); |
236800
|
311 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5TokenizerInit(&pGlobal->api); |
236801
|
311 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5VocabInit(pGlobal, db); |
236802
|
311 |
0 |
if( rc==SQLITE_OK ){ |
236807
|
311 |
0 |
if( rc==SQLITE_OK ){ |
236938
|
0 |
0 |
if( p->aStmt[eStmt]==0 ){ |
236986
|
0 |
0 |
if( zBind ){ |
236987
|
0 |
0 |
for(i=0; i
|
237003
|
0 |
0 |
if( zSql==0 ){ |
237007
|
0 |
0 |
if( eStmt>FTS5_STMT_LOOKUP ) f |= SQLITE_PREPARE_NO_VTAB; |
237012
|
0 |
0 |
if( rc!=SQLITE_OK && pzErrMsg ){ |
|
0 |
0 |
if( rc!=SQLITE_OK && pzErrMsg ){ |
237037
|
0 |
0 |
if( zSql==0 ){ |
237061
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
237067
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
237082
|
0 |
0 |
if( *pRc==SQLITE_OK ){ |
237097
|
0 |
0 |
if( pConfig->bColumnsize ){ |
237100
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
237120
|
0 |
0 |
rc = fts5ExecPrintf(pConfig->db, &zErr, "CREATE TABLE %Q.'%q_%q'(%s)%s", |
237127
|
0 |
0 |
if( zErr ){ |
237159
|
0 |
0 |
if( !p ) return SQLITE_NOMEM; |
237166
|
0 |
0 |
if( bCreate ){ |
237167
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
237170
|
0 |
0 |
if( zDefn==0 ){ |
237177
|
0 |
0 |
for(i=0; inCol; i++){ |
237186
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
237191
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237196
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237201
|
0 |
0 |
if( rc ){ |
237213
|
0 |
0 |
if( p ){ |
237217
|
0 |
0 |
for(i=0; iaStmt); i++){ |
237247
|
0 |
0 |
if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE; |
237248
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){ |
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){ |
237271
|
0 |
0 |
if( apVal==0 ){ |
237273
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
237275
|
0 |
0 |
if( sqlite3_step(pSeek)!=SQLITE_ROW ){ |
237283
|
0 |
0 |
for(iCol=1; rc==SQLITE_OK && iCol<=pConfig->nCol; iCol++){ |
|
0 |
0 |
for(iCol=1; rc==SQLITE_OK && iCol<=pConfig->nCol; iCol++){ |
237284
|
0 |
0 |
if( pConfig->abUnindexed[iCol-1]==0 ){ |
237289
|
0 |
0 |
if( pSeek ){ |
237292
|
0 |
0 |
}else if( ALWAYS(apVal) ){ |
237303
|
0 |
0 |
if( p->aTotalSize[iCol-1]<0 ){ |
237308
|
0 |
0 |
if( rc==SQLITE_OK && p->nTotalRow<1 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && p->nTotalRow<1 ){ |
237315
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
237334
|
0 |
0 |
if( p->pConfig->bColumnsize ){ |
237337
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237360
|
0 |
0 |
if( p->bTotalsValid==0 ){ |
237382
|
0 |
0 |
for(i=0; i
|
237385
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237405
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237410
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
237412
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237420
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
237421
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237424
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237450
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
237459
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237462
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237478
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237482
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237486
|
0 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pScan) ){ |
|
0 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pScan) ){ |
237491
|
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++){ |
237493
|
0 |
0 |
if( pConfig->abUnindexed[ctx.iCol]==0 ){ |
237508
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237514
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
237517
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237546
|
0 |
0 |
if( p->pConfig->bColumnsize ){ |
237549
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237555
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237574
|
0 |
0 |
if( pConfig->eContent!=FTS5_CONTENT_NORMAL ){ |
237575
|
0 |
0 |
if( sqlite3_value_type(apVal[1])==SQLITE_INTEGER ){ |
237584
|
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++){ |
237587
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237614
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237617
|
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++){ |
237619
|
0 |
0 |
if( pConfig->abUnindexed[ctx.iCol]==0 ){ |
237635
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237651
|
0 |
0 |
if( zSql==0 ){ |
237656
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237657
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pCnt) ){ |
237702
|
0 |
0 |
if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE; |
237704
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){ |
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){ |
237727
|
0 |
0 |
if( rc==SQLITE_OK && bPresent==0 ){ |
|
0 |
0 |
if( rc==SQLITE_OK && bPresent==0 ){ |
237733
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && iipConfig->nPrefix; ii++){ |
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && iipConfig->nPrefix; ii++){ |
237736
|
0 |
0 |
if( nByte ){ |
237738
|
0 |
0 |
if( bPresent==0 ){ |
237767
|
0 |
0 |
if( !aTotalSize ) return SQLITE_NOMEM; |
237772
|
0 |
0 |
|| (pConfig->eContent==FTS5_CONTENT_EXTERNAL && iArg) |
|
0 |
0 |
|| (pConfig->eContent==FTS5_CONTENT_EXTERNAL && iArg) |
|
0 |
0 |
|| (pConfig->eContent==FTS5_CONTENT_EXTERNAL && iArg) |
237774
|
0 |
0 |
if( bUseCksum ){ |
237778
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237780
|
0 |
0 |
while( SQLITE_ROW==sqlite3_step(pScan) ){ |
237784
|
0 |
0 |
if( pConfig->bColumnsize ){ |
237787
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eDetail==FTS5_DETAIL_NONE ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eDetail==FTS5_DETAIL_NONE ){ |
237790
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inCol; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inCol; i++){ |
237791
|
0 |
0 |
if( pConfig->abUnindexed[i] ) continue; |
237794
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){ |
237797
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237807
|
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] ){ |
237811
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){ |
237819
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
237822
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2; |
237826
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237829
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inCol; i++){ |
|
0 |
0 |
for(i=0; rc==SQLITE_OK && inCol; i++){ |
237830
|
0 |
0 |
if( p->aTotalSize[i]!=aTotalSize[i] ) rc = FTS5_CORRUPT; |
237836
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){ |
237839
|
0 |
0 |
if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT; |
|
0 |
0 |
if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT; |
237841
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){ |
237844
|
0 |
0 |
if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT; |
|
0 |
0 |
if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT; |
237851
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237875
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237896
|
0 |
0 |
if( p->aStmt[eStmt]==0 ){ |
237910
|
0 |
0 |
for(i=0; i
|
237911
|
0 |
0 |
if( iOff>=nBlob ) return 1; |
237932
|
0 |
0 |
if( pLookup ){ |
237936
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pLookup) ){ |
237939
|
0 |
0 |
if( 0==fts5StorageDecodeSizeArray(aCol, nCol, aBlob, nBlob) ){ |
237944
|
0 |
0 |
if( bCorrupt && rc==SQLITE_OK ){ |
|
0 |
0 |
if( bCorrupt && rc==SQLITE_OK ){ |
237956
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237958
|
0 |
0 |
if( iCol<0 ){ |
237960
|
0 |
0 |
for(i=0; ipConfig->nCol; i++){ |
237963
|
0 |
0 |
}else if( iColpConfig->nCol ){ |
237974
|
0 |
0 |
if( rc==SQLITE_OK ){ |
237981
|
0 |
0 |
if( p->nTotalRow<=0 ) rc = FTS5_CORRUPT; |
237992
|
0 |
0 |
if( p->bTotalsValid ){ |
237996
|
0 |
0 |
if( rc==SQLITE_OK ){ |
238016
|
0 |
0 |
if( rc==SQLITE_OK ){ |
238018
|
0 |
0 |
if( pVal ){ |
238027
|
0 |
0 |
if( rc==SQLITE_OK && pVal ){ |
|
0 |
0 |
if( rc==SQLITE_OK && pVal ){ |
238030
|
0 |
0 |
if( rc==SQLITE_OK ){ |
238083
|
0 |
0 |
for(i=0; zArg[i]; i++){ |
238084
|
0 |
0 |
if( (zArg[i] & 0x80)==0 ){ |
238108
|
0 |
0 |
if( nArg%2 ){ |
238112
|
0 |
0 |
if( p==0 ){ |
238118
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
238120
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "tokenchars") ){ |
238123
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "separators") ){ |
238129
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
238143
|
0 |
0 |
for(i=0; i
|
238145
|
0 |
0 |
if( c>='A' && c<='Z' ) c += 32; |
|
0 |
0 |
if( c>='A' && c<='Z' ) c += 32; |
238172
|
0 |
0 |
while( is
|
|
0 |
0 |
while( is
|
238176
|
0 |
0 |
while( is
|
|
0 |
0 |
while( is
|
|
0 |
0 |
while( is
|
238179
|
0 |
0 |
if( is==nText ) break; |
238183
|
0 |
0 |
while( ie
|
|
0 |
0 |
while( ie
|
|
0 |
0 |
while( ie
|
238189
|
0 |
0 |
if( nByte>nFold ){ |
238190
|
0 |
0 |
if( pFold!=aFold ) sqlite3_free(pFold); |
238192
|
0 |
0 |
if( pFold==0 ){ |
238205
|
0 |
0 |
if( pFold!=aFold ) sqlite3_free(pFold); |
238206
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
238294
|
0 |
0 |
if( n>0 ){ |
238297
|
0 |
0 |
if( aNew ){ |
238301
|
0 |
0 |
while( zCsr
|
238304
|
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); |
238305
|
0 |
0 |
if( iCode<128 ){ |
238311
|
0 |
0 |
if( bToken!=bTokenChars && sqlite3Fts5UnicodeIsdiacritic(iCode)==0 ){ |
|
0 |
0 |
if( bToken!=bTokenChars && sqlite3Fts5UnicodeIsdiacritic(iCode)==0 ){ |
238313
|
0 |
0 |
for(i=0; i
|
238314
|
0 |
0 |
if( (u32)aNew[i]>iCode ) break; |
238336
|
0 |
0 |
if( p->nException>0 ){ |
238341
|
0 |
0 |
while( iHi>=iLo ){ |
238343
|
0 |
0 |
if( iCode==a[iTest] ){ |
238345
|
0 |
0 |
}else if( iCode>a[iTest] ){ |
238360
|
0 |
0 |
if( pTok ){ |
238372
|
0 |
0 |
while( *z ){ |
238373
|
0 |
0 |
while( *z==' ' || *z=='\t' ) z++; |
|
0 |
0 |
while( *z==' ' || *z=='\t' ) z++; |
238374
|
0 |
0 |
if( *z && sqlite3Fts5UnicodeCatParse(z, p->aCategory) ){ |
|
0 |
0 |
if( *z && sqlite3Fts5UnicodeCatParse(z, p->aCategory) ){ |
238377
|
0 |
0 |
while( *z!=' ' && *z!='\t' && *z!='\0' ) z++; |
|
0 |
0 |
while( *z!=' ' && *z!='\t' && *z!='\0' ) z++; |
|
0 |
0 |
while( *z!=' ' && *z!='\t' && *z!='\0' ) z++; |
238397
|
0 |
0 |
if( nArg%2 ){ |
238401
|
0 |
0 |
if( p ){ |
238409
|
0 |
0 |
if( p->aFold==0 ){ |
238414
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
238415
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "categories") ){ |
238420
|
0 |
0 |
if( rc==SQLITE_OK ){ |
238424
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
238426
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "remove_diacritics") ){ |
238427
|
0 |
0 |
if( (zArg[0]!='0' && zArg[0]!='1' && zArg[0]!='2') || zArg[1] ){ |
|
0 |
0 |
if( (zArg[0]!='0' && zArg[0]!='1' && zArg[0]!='2') || zArg[1] ){ |
|
0 |
0 |
if( (zArg[0]!='0' && zArg[0]!='1' && zArg[0]!='2') || zArg[1] ){ |
|
0 |
0 |
if( (zArg[0]!='0' && zArg[0]!='1' && zArg[0]!='2') || zArg[1] ){ |
238437
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "tokenchars") ){ |
238440
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "separators") ){ |
238443
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "categories") ){ |
238453
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
238497
|
0 |
0 |
while( rc==SQLITE_OK ){ |
238505
|
0 |
0 |
if( zCsr>=zTerm ) goto tokenize_done; |
238506
|
0 |
0 |
if( *zCsr & 0x80 ) { |
238510
|
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); |
238511
|
0 |
0 |
if( fts5UnicodeIsAlnum(p, iCode) ){ |
238515
|
0 |
0 |
if( a[*zCsr] ){ |
238525
|
0 |
0 |
while( zCsr
|
238529
|
0 |
0 |
if( zOut>pEnd ){ |
238531
|
0 |
0 |
if( aFold==0 ){ |
238543
|
0 |
0 |
if( *zCsr & 0x80 ){ |
238546
|
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); |
238547
|
0 |
0 |
if( fts5UnicodeIsAlnum(p,iCode)||sqlite3Fts5UnicodeIsdiacritic(iCode) ){ |
|
0 |
0 |
if( fts5UnicodeIsAlnum(p,iCode)||sqlite3Fts5UnicodeIsdiacritic(iCode) ){ |
238550
|
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); |
238554
|
0 |
0 |
}else if( a[*zCsr]==0 ){ |
238559
|
0 |
0 |
if( *zCsr>='A' && *zCsr<='Z' ){ |
|
0 |
0 |
if( *zCsr>='A' && *zCsr<='Z' ){ |
238574
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK; |
238597
|
0 |
0 |
if( pTok ){ |
238599
|
0 |
0 |
if( p->pTokenizer ){ |
238620
|
0 |
0 |
if( nArg>0 ){ |
238625
|
0 |
0 |
if( pRet ){ |
238631
|
0 |
0 |
if( rc==SQLITE_OK ){ |
238632
|
0 |
0 |
int nArg2 = (nArg>0 ? nArg-1 : 0); |
238633
|
0 |
0 |
const char **azArg2 = (nArg2 ? &azArg[1] : 0); |
238637
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
238689
|
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') |
238698
|
0 |
0 |
for(i=0; i
|
238699
|
0 |
0 |
if( 0==(bCons = !fts5PorterIsVowel(zStem[i], bCons)) ) break; |
238703
|
0 |
0 |
for(i++; i
|
238704
|
0 |
0 |
if( (bCons = !fts5PorterIsVowel(zStem[i], bCons)) ) return i+1; |
238718
|
0 |
0 |
if( n && fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){ |
|
0 |
0 |
if( n && fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){ |
238728
|
0 |
0 |
if( n && 0==fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){ |
|
0 |
0 |
if( n && 0==fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){ |
238736
|
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' ){ |
238742
|
0 |
0 |
for(i=0; i
|
238754
|
0 |
0 |
return (zStem[nStem-1]=='s' || zStem[nStem-1]=='t') |
238755
|
0 |
0 |
&& fts5Porter_MGt1(zStem, nStem); |
|
0 |
0 |
&& fts5Porter_MGt1(zStem, nStem); |
238761
|
0 |
0 |
for(i=0; i
|
238762
|
0 |
0 |
if( fts5PorterIsVowel(zStem[i], i>0) ){ |
238781
|
0 |
0 |
if( nBuf>2 && 0==memcmp("al", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
if( nBuf>2 && 0==memcmp("al", &aBuf[nBuf-2], 2) ){ |
238782
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-2) ){ |
238789
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ance", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ance", &aBuf[nBuf-4], 4) ){ |
238790
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){ |
238793
|
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) ){ |
238794
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){ |
238801
|
0 |
0 |
if( nBuf>2 && 0==memcmp("er", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
if( nBuf>2 && 0==memcmp("er", &aBuf[nBuf-2], 2) ){ |
238802
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-2) ){ |
238809
|
0 |
0 |
if( nBuf>2 && 0==memcmp("ic", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
if( nBuf>2 && 0==memcmp("ic", &aBuf[nBuf-2], 2) ){ |
238810
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-2) ){ |
238817
|
0 |
0 |
if( nBuf>4 && 0==memcmp("able", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("able", &aBuf[nBuf-4], 4) ){ |
238818
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){ |
238821
|
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) ){ |
238822
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){ |
238829
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ant", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ant", &aBuf[nBuf-3], 3) ){ |
238830
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
238833
|
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) ){ |
238834
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-5) ){ |
238837
|
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) ){ |
238838
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){ |
238841
|
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) ){ |
238842
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
238849
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ion", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ion", &aBuf[nBuf-3], 3) ){ |
238850
|
0 |
0 |
if( fts5Porter_MGt1_and_S_or_T(aBuf, nBuf-3) ){ |
238853
|
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) ){ |
238854
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-2) ){ |
238861
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ism", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ism", &aBuf[nBuf-3], 3) ){ |
238862
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
238869
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ate", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ate", &aBuf[nBuf-3], 3) ){ |
238870
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
238873
|
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) ){ |
238874
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
238881
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ous", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ous", &aBuf[nBuf-3], 3) ){ |
238882
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
238889
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ive", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ive", &aBuf[nBuf-3], 3) ){ |
238890
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
238897
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ize", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ize", &aBuf[nBuf-3], 3) ){ |
238898
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){ |
238915
|
0 |
0 |
if( nBuf>2 && 0==memcmp("at", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
if( nBuf>2 && 0==memcmp("at", &aBuf[nBuf-2], 2) ){ |
238923
|
0 |
0 |
if( nBuf>2 && 0==memcmp("bl", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
if( nBuf>2 && 0==memcmp("bl", &aBuf[nBuf-2], 2) ){ |
238931
|
0 |
0 |
if( nBuf>2 && 0==memcmp("iz", &aBuf[nBuf-2], 2) ){ |
|
0 |
0 |
if( nBuf>2 && 0==memcmp("iz", &aBuf[nBuf-2], 2) ){ |
238949
|
0 |
0 |
if( nBuf>7 && 0==memcmp("ational", &aBuf[nBuf-7], 7) ){ |
|
0 |
0 |
if( nBuf>7 && 0==memcmp("ational", &aBuf[nBuf-7], 7) ){ |
238950
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){ |
238954
|
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) ){ |
238955
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-6) ){ |
238963
|
0 |
0 |
if( nBuf>4 && 0==memcmp("enci", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("enci", &aBuf[nBuf-4], 4) ){ |
238964
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
238968
|
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) ){ |
238969
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
238977
|
0 |
0 |
if( nBuf>4 && 0==memcmp("izer", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("izer", &aBuf[nBuf-4], 4) ){ |
238978
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
238986
|
0 |
0 |
if( nBuf>4 && 0==memcmp("logi", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("logi", &aBuf[nBuf-4], 4) ){ |
238987
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
238995
|
0 |
0 |
if( nBuf>3 && 0==memcmp("bli", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("bli", &aBuf[nBuf-3], 3) ){ |
238996
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-3) ){ |
239000
|
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) ){ |
239001
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
239005
|
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) ){ |
239006
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
239010
|
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) ){ |
239011
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-3) ){ |
239015
|
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) ){ |
239016
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
239024
|
0 |
0 |
if( nBuf>7 && 0==memcmp("ization", &aBuf[nBuf-7], 7) ){ |
|
0 |
0 |
if( nBuf>7 && 0==memcmp("ization", &aBuf[nBuf-7], 7) ){ |
239025
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){ |
239029
|
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) ){ |
239030
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
239034
|
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) ){ |
239035
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
239043
|
0 |
0 |
if( nBuf>5 && 0==memcmp("alism", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
if( nBuf>5 && 0==memcmp("alism", &aBuf[nBuf-5], 5) ){ |
239044
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
239048
|
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) ){ |
239049
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){ |
239053
|
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) ){ |
239054
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){ |
239058
|
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) ){ |
239059
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){ |
239067
|
0 |
0 |
if( nBuf>5 && 0==memcmp("aliti", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
if( nBuf>5 && 0==memcmp("aliti", &aBuf[nBuf-5], 5) ){ |
239068
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
239072
|
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) ){ |
239073
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
239077
|
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) ){ |
239078
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-6) ){ |
239096
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ical", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ical", &aBuf[nBuf-4], 4) ){ |
239097
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
239105
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ness", &aBuf[nBuf-4], 4) ){ |
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ness", &aBuf[nBuf-4], 4) ){ |
239106
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){ |
239113
|
0 |
0 |
if( nBuf>5 && 0==memcmp("icate", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
if( nBuf>5 && 0==memcmp("icate", &aBuf[nBuf-5], 5) ){ |
239114
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
239118
|
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) ){ |
239119
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
239127
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ful", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ful", &aBuf[nBuf-3], 3) ){ |
239128
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-3) ){ |
239135
|
0 |
0 |
if( nBuf>5 && 0==memcmp("ative", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
if( nBuf>5 && 0==memcmp("ative", &aBuf[nBuf-5], 5) ){ |
239136
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
239143
|
0 |
0 |
if( nBuf>5 && 0==memcmp("alize", &aBuf[nBuf-5], 5) ){ |
|
0 |
0 |
if( nBuf>5 && 0==memcmp("alize", &aBuf[nBuf-5], 5) ){ |
239144
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){ |
239162
|
0 |
0 |
if( nBuf>3 && 0==memcmp("eed", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("eed", &aBuf[nBuf-3], 3) ){ |
239163
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-3) ){ |
239167
|
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) ){ |
239168
|
0 |
0 |
if( fts5Porter_Vowel(aBuf, nBuf-2) ){ |
239176
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ing", &aBuf[nBuf-3], 3) ){ |
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ing", &aBuf[nBuf-3], 3) ){ |
239177
|
0 |
0 |
if( fts5Porter_Vowel(aBuf, nBuf-3) ){ |
239195
|
0 |
0 |
if( aBuf[nBuf-1]=='s' ){ |
239196
|
0 |
0 |
if( aBuf[nBuf-2]=='e' ){ |
239197
|
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') |
239198
|
0 |
0 |
|| (nBuf>3 && aBuf[nBuf-3]=='i' ) |
|
0 |
0 |
|| (nBuf>3 && aBuf[nBuf-3]=='i' ) |
239205
|
0 |
0 |
else if( aBuf[nBuf-2]!='s' ){ |
239224
|
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; |
239231
|
0 |
0 |
if( fts5PorterStep1B(aBuf, &nBuf) ){ |
239232
|
0 |
0 |
if( fts5PorterStep1B2(aBuf, &nBuf)==0 ){ |
239234
|
0 |
0 |
if( fts5PorterIsVowel(c, 0)==0 |
239235
|
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] |
239238
|
0 |
0 |
}else if( fts5Porter_MEq1(aBuf, nBuf) && fts5Porter_Ostar(aBuf, nBuf) ){ |
|
0 |
0 |
}else if( fts5Porter_MEq1(aBuf, nBuf) && fts5Porter_Ostar(aBuf, nBuf) ){ |
239245
|
0 |
0 |
if( aBuf[nBuf-1]=='y' && fts5Porter_Vowel(aBuf, nBuf-1) ){ |
|
0 |
0 |
if( aBuf[nBuf-1]=='y' && fts5Porter_Vowel(aBuf, nBuf-1) ){ |
239256
|
0 |
0 |
if( aBuf[nBuf-1]=='e' ){ |
239257
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-1) |
239258
|
0 |
0 |
|| (fts5Porter_MEq1(aBuf, nBuf-1) && !fts5Porter_Ostar(aBuf, nBuf-1)) |
|
0 |
0 |
|| (fts5Porter_MEq1(aBuf, nBuf-1) && !fts5Porter_Ostar(aBuf, nBuf-1)) |
239265
|
0 |
0 |
if( nBuf>1 && aBuf[nBuf-1]=='l' |
|
0 |
0 |
if( nBuf>1 && aBuf[nBuf-1]=='l' |
239266
|
0 |
0 |
&& aBuf[nBuf-2]=='l' && fts5Porter_MGt1(aBuf, nBuf-1) |
|
0 |
0 |
&& aBuf[nBuf-2]=='l' && fts5Porter_MGt1(aBuf, nBuf-1) |
239324
|
0 |
0 |
if( pNew==0 ){ |
239329
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i
|
239331
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "case_sensitive") ){ |
239332
|
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] ){ |
239341
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
239373
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
239374
|
0 |
0 |
if( iCode==0 ) break; |
239376
|
0 |
0 |
if( zIn
|
239377
|
0 |
0 |
if( p->bFold ) iCode = sqlite3Fts5UnicodeFold(iCode, 0); |
239378
|
0 |
0 |
WRITE_UTF8(zOut, iCode); |
|
0 |
0 |
WRITE_UTF8(zOut, iCode); |
|
0 |
0 |
WRITE_UTF8(zOut, iCode); |
239379
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
239380
|
0 |
0 |
if( iCode==0 ) break; |
239384
|
0 |
0 |
if( zIn
|
239385
|
0 |
0 |
if( p->bFold ) iCode = sqlite3Fts5UnicodeFold(iCode, 0); |
239386
|
0 |
0 |
WRITE_UTF8(zOut, iCode); |
|
0 |
0 |
WRITE_UTF8(zOut, iCode); |
|
0 |
0 |
WRITE_UTF8(zOut, iCode); |
239387
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
|
0 |
0 |
READ_UTF8(zIn, zEof, iCode); |
239388
|
0 |
0 |
if( iCode==0 ) break; |
239389
|
0 |
0 |
if( p->bFold ) iCode = sqlite3Fts5UnicodeFold(iCode, 0); |
239390
|
0 |
0 |
WRITE_UTF8(zOut, iCode); |
|
0 |
0 |
WRITE_UTF8(zOut, iCode); |
|
0 |
0 |
WRITE_UTF8(zOut, iCode); |
239395
|
0 |
0 |
if( rc!=SQLITE_OK ) break; |
239417
|
0 |
0 |
if( xCreate==fts5TriCreate ){ |
239419
|
0 |
0 |
return p->bFold ? FTS5_PATTERN_LIKE : FTS5_PATTERN_GLOB; |
239441
|
1555 |
0 |
for(i=0; rc==SQLITE_OK && i
|
|
1244 |
311 |
for(i=0; rc==SQLITE_OK && i
|
239531
|
0 |
0 |
while( iHi>=iLo ){ |
239533
|
0 |
0 |
if( key >= aDia[iTest] ){ |
239541
|
0 |
0 |
if( bComplex==0 && (aChar[iRes] & 0x80) ) return c; |
|
0 |
0 |
if( bComplex==0 && (aChar[iRes] & 0x80) ) return c; |
239542
|
0 |
0 |
return (c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : ((int)aChar[iRes] & 0x7F); |
239553
|
0 |
0 |
if( c<768 || c>817 ) return 0; |
|
0 |
0 |
if( c<768 || c>817 ) return 0; |
239554
|
0 |
0 |
return (c < 768+32) ? |
239665
|
0 |
0 |
if( c<128 ){ |
239666
|
0 |
0 |
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
|
0 |
0 |
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A'); |
239667
|
0 |
0 |
}else if( c<65536 ){ |
239674
|
0 |
0 |
while( iHi>=iLo ){ |
239677
|
0 |
0 |
if( cmp>=0 ){ |
239687
|
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)) ){ |
239692
|
0 |
0 |
if( eRemoveDiacritic ){ |
239697
|
0 |
0 |
else if( c>=66560 && c<66600 ){ |
|
0 |
0 |
else if( c>=66560 && c<66600 ){ |
240193
|
0 |
0 |
if( iCode>=(1<<20) ){ |
240199
|
0 |
0 |
while( iHi>iLo ){ |
240202
|
0 |
0 |
if( iKey>=aFts5UnicodeMap[iTest] ){ |
240210
|
0 |
0 |
if( iRes<0 ) return 0; |
240211
|
0 |
0 |
if( iKey>=(aFts5UnicodeMap[iRes]+(aFts5UnicodeData[iRes]>>5)) ) return 0; |
240213
|
0 |
0 |
if( ret!=30 ) return ret; |
240214
|
0 |
0 |
return ((iKey - aFts5UnicodeMap[iRes]) & 0x01) ? 5 : 9; |
240220
|
0 |
0 |
while( i<128 ){ |
240223
|
0 |
0 |
for(; i<128 && i
|
|
0 |
0 |
for(; i<128 && i
|
240261
|
0 |
0 |
if (!(a&0x80)) |
240272
|
0 |
0 |
if (!(b&0x80)) |
240286
|
0 |
0 |
if (!(a&0x80)) |
240338
|
0 |
0 |
if (!(a&0x80)) |
240347
|
0 |
0 |
if (!(b&0x80)) |
240364
|
0 |
0 |
if (!(a&0x80)) |
240380
|
0 |
0 |
if (!(b&0x80)) |
240404
|
0 |
0 |
if (!(a&0x80)) |
240425
|
0 |
0 |
if (!(b&0x80)) |
240441
|
0 |
0 |
if (!(a&0x80)) |
240458
|
0 |
0 |
if (!(b&0x80)) |
240530
|
0 |
0 |
if( v & (((u64)0xff000000)<<32) ){ |
240533
|
0 |
0 |
for(i=7; i>=0; i--){ |
240543
|
0 |
0 |
}while( v!=0 ); |
240546
|
0 |
0 |
for(i=0, j=n-1; j>=0; j--, i++){ |
240553
|
0 |
0 |
if( v<=0x7f ){ |
240557
|
0 |
0 |
if( v<=0x3fff ){ |
240571
|
0 |
0 |
if( iVal<(1 << 14) ) return 2; |
240572
|
0 |
0 |
if( iVal<(1 << 21) ) return 3; |
240573
|
0 |
0 |
if( iVal<(1 << 28) ) return 4; |
240683
|
0 |
0 |
if( rc==SQLITE_OK ){ |
240685
|
0 |
0 |
if( sqlite3_stricmp(zCopy, "col")==0 ){ |
240689
|
0 |
0 |
if( sqlite3_stricmp(zCopy, "row")==0 ){ |
240692
|
0 |
0 |
if( sqlite3_stricmp(zCopy, "instance")==0 ){ |
240763
|
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); |
240765
|
0 |
0 |
if( argc!=5 && bDb==0 ){ |
|
0 |
0 |
if( argc!=5 && bDb==0 ){ |
240770
|
0 |
0 |
const char *zDb = bDb ? argv[3] : argv[1]; |
240771
|
0 |
0 |
const char *zTab = bDb ? argv[4] : argv[3]; |
240772
|
0 |
0 |
const char *zType = bDb ? argv[5] : argv[4]; |
240778
|
0 |
0 |
if( rc==SQLITE_OK ){ |
240785
|
0 |
0 |
if( pRet ){ |
240853
|
0 |
0 |
for(i=0; inConstraint; i++){ |
240855
|
0 |
0 |
if( p->usable==0 ) continue; |
240856
|
0 |
0 |
if( p->iColumn==0 ){ /* term column */ |
240857
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_EQ ) iTermEq = i; |
240858
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_LE ) iTermLe = i; |
240859
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_LT ) iTermLe = i; |
240860
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_GE ) iTermGe = i; |
240861
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_GT ) iTermGe = i; |
240865
|
0 |
0 |
if( iTermEq>=0 ){ |
240871
|
0 |
0 |
if( iTermGe>=0 ){ |
240876
|
0 |
0 |
if( iTermLe>=0 ){ |
240888
|
0 |
0 |
if( pInfo->nOrderBy==1 |
240889
|
0 |
0 |
&& pInfo->aOrderBy[0].iColumn==0 |
240890
|
0 |
0 |
&& pInfo->aOrderBy[0].desc==0 |
240913
|
0 |
0 |
if( pTab->bBusy ){ |
240923
|
0 |
0 |
if( zSql ){ |
240928
|
0 |
0 |
if( rc==SQLITE_ERROR ) rc = SQLITE_OK; |
240931
|
0 |
0 |
if( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){ |
|
0 |
0 |
if( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){ |
240937
|
0 |
0 |
if( rc==SQLITE_OK ){ |
240938
|
0 |
0 |
if( pFts5==0 ){ |
240941
|
0 |
0 |
if( rc==SQLITE_OK ){ |
240952
|
0 |
0 |
if( rc==SQLITE_OK ){ |
240957
|
0 |
0 |
if( pCsr ){ |
240998
|
0 |
0 |
if( sqlite3Fts5IterEof(pCsr->pIter) ){ |
241004
|
0 |
0 |
if( pCsr->nLeTerm>=0 ){ |
241007
|
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
|
241026
|
0 |
0 |
while( eDetail==FTS5_DETAIL_NONE |
241027
|
0 |
0 |
|| sqlite3Fts5PoslistNext64(pIter->pData, pIter->nData, po, pp) |
241033
|
0 |
0 |
if( rc==SQLITE_OK ){ |
241035
|
0 |
0 |
if( pCsr->bEof || eDetail==FTS5_DETAIL_NONE ) break; |
|
0 |
0 |
if( pCsr->bEof || eDetail==FTS5_DETAIL_NONE ) break; |
241037
|
0 |
0 |
if( rc ){ |
241056
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc; |
241059
|
0 |
0 |
if( pTab->eType==FTS5_VOCAB_INSTANCE ){ |
241063
|
0 |
0 |
if( pTab->eType==FTS5_VOCAB_COL ){ |
241064
|
0 |
0 |
for(pCsr->iCol++; pCsr->iColiCol++){ |
241065
|
0 |
0 |
if( pCsr->aDoc[pCsr->iCol] ) break; |
241069
|
0 |
0 |
if( pTab->eType!=FTS5_VOCAB_COL || pCsr->iCol>=nCol ){ |
|
0 |
0 |
if( pTab->eType!=FTS5_VOCAB_COL || pCsr->iCol>=nCol ){ |
241070
|
0 |
0 |
if( sqlite3Fts5IterEof(pCsr->pIter) ){ |
241078
|
0 |
0 |
if( pCsr->nLeTerm>=0 ){ |
241081
|
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
|
241093
|
0 |
0 |
while( rc==SQLITE_OK ){ |
241104
|
0 |
0 |
if( eDetail==FTS5_DETAIL_FULL ){ |
241105
|
0 |
0 |
while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff, &iPos) ){ |
241113
|
0 |
0 |
if( eDetail==FTS5_DETAIL_FULL ){ |
241115
|
0 |
0 |
while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff, &iPos) ){ |
241117
|
0 |
0 |
if( iCol!=ii ){ |
241118
|
0 |
0 |
if( ii>=nCol ){ |
241127
|
0 |
0 |
}else if( eDetail==FTS5_DETAIL_COLUMNS ){ |
241128
|
0 |
0 |
while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff,&iPos) ){ |
241130
|
0 |
0 |
if( iPos>=nCol ){ |
241147
|
0 |
0 |
if( rc==SQLITE_OK ){ |
241150
|
0 |
0 |
if( pTab->eType==FTS5_VOCAB_INSTANCE ) break; |
241152
|
0 |
0 |
if( rc==SQLITE_OK ){ |
241154
|
0 |
0 |
if( nTerm!=pCsr->term.n |
241155
|
0 |
0 |
|| (nTerm>0 && memcmp(zTerm, pCsr->term.p, nTerm)) |
|
0 |
0 |
|| (nTerm>0 && memcmp(zTerm, pCsr->term.p, nTerm)) |
241159
|
0 |
0 |
if( sqlite3Fts5IterEof(pCsr->pIter) ) break; |
241165
|
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 ){ |
241166
|
0 |
0 |
for(/* noop */; pCsr->iColaDoc[pCsr->iCol]==0; pCsr->iCol++); |
|
0 |
0 |
for(/* noop */; pCsr->iColaDoc[pCsr->iCol]==0; pCsr->iCol++); |
241167
|
0 |
0 |
if( pCsr->iCol==nCol ){ |
241201
|
0 |
0 |
if( idxNum & FTS5_VOCAB_TERM_EQ ) pEq = apVal[iVal++]; |
241202
|
0 |
0 |
if( idxNum & FTS5_VOCAB_TERM_GE ) pGe = apVal[iVal++]; |
241203
|
0 |
0 |
if( idxNum & FTS5_VOCAB_TERM_LE ) pLe = apVal[iVal++]; |
241205
|
0 |
0 |
if( pEq ){ |
241210
|
0 |
0 |
if( pGe ){ |
241214
|
0 |
0 |
if( pLe ){ |
241216
|
0 |
0 |
if( zCopy==0 ) zCopy = ""; |
241219
|
0 |
0 |
if( pCsr->zLeTerm==0 ){ |
241227
|
0 |
0 |
if( rc==SQLITE_OK ){ |
241230
|
0 |
0 |
if( rc==SQLITE_OK ){ |
241234
|
0 |
0 |
if( rc==SQLITE_OK && eType==FTS5_VOCAB_INSTANCE ){ |
|
0 |
0 |
if( rc==SQLITE_OK && eType==FTS5_VOCAB_INSTANCE ){ |
241237
|
0 |
0 |
if( rc==SQLITE_OK && !pCsr->bEof |
|
0 |
0 |
if( rc==SQLITE_OK && !pCsr->bEof |
241238
|
0 |
0 |
&& (eType!=FTS5_VOCAB_INSTANCE |
241239
|
0 |
0 |
|| pCsr->pFts5->pConfig->eDetail!=FTS5_DETAIL_NONE) |
241266
|
0 |
0 |
if( iCol==0 ){ |
241270
|
0 |
0 |
}else if( eType==FTS5_VOCAB_COL ){ |
241272
|
0 |
0 |
if( iCol==1 ){ |
241273
|
0 |
0 |
if( eDetail!=FTS5_DETAIL_NONE ){ |
241277
|
0 |
0 |
}else if( iCol==2 ){ |
241282
|
0 |
0 |
}else if( eType==FTS5_VOCAB_ROW ){ |
241284
|
0 |
0 |
if( iCol==1 ){ |
241297
|
0 |
0 |
if( eDetail==FTS5_DETAIL_FULL ){ |
241299
|
0 |
0 |
}else if( eDetail==FTS5_DETAIL_COLUMNS ){ |
241302
|
0 |
0 |
if( ii>=0 && iipFts5->pConfig->nCol ){ |
|
0 |
0 |
if( ii>=0 && iipFts5->pConfig->nCol ){ |
241310
|
0 |
0 |
if( eDetail==FTS5_DETAIL_FULL ){ |
241319
|
0 |
0 |
if( iVal>0 ) sqlite3_result_int64(pCtx, iVal); |