line |
true |
false |
branch |
23315
|
76864 |
189959 |
if( wsdStat.nowValue[op]>wsdStat.mxValue[op] ){
|
23345
|
792 |
136423 |
if( newValue>wsdStat.mxValue[op] ){
|
23361
|
11 |
0 |
if( op<0 || op>=ArraySize(wsdStat.nowValue) ){
|
|
0 |
11 |
if( op<0 || op>=ArraySize(wsdStat.nowValue) ){
|
23367
|
3 |
8 |
pMutex = statMutex[op] ? sqlite3Pcache1Mutex() : sqlite3MallocMutex();
|
23371
|
0 |
11 |
if( resetFlag ){
|
23385
|
11 |
0 |
if( rc==0 ){
|
23397
|
244 |
1252 |
while( p ){
|
23414
|
2 |
311 |
if( pHighwater ) *pHighwater = db->lookaside.nSlot - nInit;
|
23438
|
0 |
2 |
if( resetFlag ){
|
23440
|
0 |
0 |
if( p ){
|
23441
|
0 |
0 |
while( p->pNext ) p = p->pNext;
|
23448
|
0 |
0 |
if( p ){
|
23449
|
0 |
0 |
while( p->pNext ) p = p->pNext;
|
23469
|
0 |
6 |
if( resetFlag ){
|
23485
|
4 |
2 |
for(i=0; i<db->nDb; i++){
|
23487
|
2 |
2 |
if( pBt ){
|
23490
|
0 |
2 |
if( op==SQLITE_DBSTATUS_CACHE_USED_SHARED ){
|
23515
|
4 |
2 |
for(i=0; i<db->nDb; i++){
|
23517
|
4 |
0 |
if( ALWAYS(pSchema!=0) ){
|
23531
|
0 |
4 |
for(p=sqliteHashFirst(&pSchema->trigHash); p; p=sqliteHashNext(p)){
|
23534
|
6 |
4 |
for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){
|
23560
|
0 |
2 |
for(pVdbe=db->pVdbe; pVdbe; pVdbe=pVdbe->pVNext){
|
23588
|
12 |
6 |
for(i=0; i<db->nDb; i++){
|
23589
|
6 |
6 |
if( db->aDb[i].pBt ){
|
23607
|
0 |
0 |
*pCurrent = db->nDeferredImmCons>0 || db->nDeferredCons>0;
|
|
0 |
0 |
*pCurrent = db->nDeferredImmCons>0 || db->nDeferredCons>0;
|
23749
|
0 |
0 |
while( N-- ){
|
23750
|
0 |
0 |
if( !sqlite3Isdigit(*zDate) ){
|
23756
|
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) ){
|
23759
|
0 |
0 |
*va_arg(ap,int*) = val;
|
23763
|
0 |
0 |
}while( nextC );
|
23789
|
0 |
0 |
while( sqlite3Isspace(*zDate) ){ zDate++; }
|
23792
|
0 |
0 |
if( c=='-' ){
|
23794
|
0 |
0 |
}else if( c=='+' ){
|
23796
|
0 |
0 |
}else if( c=='Z' || c=='z' ){
|
|
0 |
0 |
}else if( c=='Z' || c=='z' ){
|
23803
|
0 |
0 |
if( getDigits(zDate, "20b:20e", &nHr, &nMn)!=2 ){
|
23809
|
0 |
0 |
while( sqlite3Isspace(*zDate) ){ zDate++; }
|
23824
|
0 |
0 |
if( getDigits(zDate, "20c:20e", &h, &m)!=2 ){
|
23828
|
0 |
0 |
if( *zDate==':' ){
|
23830
|
0 |
0 |
if( getDigits(zDate, "20e", &s)!=1 ){
|
23834
|
0 |
0 |
if( *zDate=='.' && sqlite3Isdigit(zDate[1]) ){
|
|
0 |
0 |
if( *zDate=='.' && sqlite3Isdigit(zDate[1]) ){
|
23837
|
0 |
0 |
while( sqlite3Isdigit(*zDate) ){
|
23853
|
0 |
0 |
if( parseTimezone(zDate, p) ) return 1;
|
23875
|
0 |
0 |
if( p->validJD ) return;
|
23876
|
0 |
0 |
if( p->validYMD ){
|
23885
|
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 ){
|
23889
|
0 |
0 |
if( M<=2 ){
|
23899
|
0 |
0 |
if( p->validHMS ){
|
23901
|
0 |
0 |
if( p->validTZ ){
|
23925
|
0 |
0 |
if( zDate[0]=='-' ){
|
23931
|
0 |
0 |
if( getDigits(zDate, "40f-21a-21d", &Y, &M, &D)!=3 ){
|
23935
|
0 |
0 |
while( sqlite3Isspace(*zDate) || 'T'==*(u8*)zDate ){ zDate++; }
|
|
0 |
0 |
while( sqlite3Isspace(*zDate) || 'T'==*(u8*)zDate ){ zDate++; }
|
23936
|
0 |
0 |
if( parseHhMmSs(zDate, p)==0 ){
|
23938
|
0 |
0 |
}else if( *zDate==0 ){
|
23945
|
0 |
0 |
p->Y = neg ? -Y : Y;
|
23948
|
0 |
0 |
if( p->validTZ ){
|
23961
|
0 |
0 |
if( p->iJD>0 ){
|
23978
|
0 |
0 |
if( r>=0.0 && r<5373484.5 ){
|
|
0 |
0 |
if( r>=0.0 && r<5373484.5 ){
|
24006
|
0 |
0 |
if( parseYyyyMmDd(zDate,p)==0 ){
|
24008
|
0 |
0 |
}else if( parseHhMmSs(zDate, p)==0 ){
|
24010
|
0 |
0 |
}else if( sqlite3StrICmp(zDate,"now")==0 && sqlite3NotPureFunc(context) ){
|
|
0 |
0 |
}else if( sqlite3StrICmp(zDate,"now")==0 && sqlite3NotPureFunc(context) ){
|
24012
|
0 |
0 |
}else if( sqlite3AtoF(zDate, &r, sqlite3Strlen30(zDate), SQLITE_UTF8)>0 ){
|
24015
|
0 |
0 |
}else if( (sqlite3StrICmp(zDate,"subsec")==0
|
24016
|
0 |
0 |
|| sqlite3StrICmp(zDate,"subsecond")==0)
|
24017
|
0 |
0 |
&& sqlite3NotPureFunc(context) ){
|
24039
|
0 |
0 |
return iJD>=0 && iJD<=INT_464269060799999;
|
|
0 |
0 |
return iJD>=0 && iJD<=INT_464269060799999;
|
24047
|
0 |
0 |
if( p->validYMD ) return;
|
24048
|
0 |
0 |
if( !p->validJD ){
|
24052
|
0 |
0 |
}else if( !validJulianDay(p->iJD) ){
|
24065
|
0 |
0 |
p->M = E<14 ? E-1 : E-13;
|
24066
|
0 |
0 |
p->Y = p->M>2 ? C - 4716 : C - 4715;
|
24076
|
0 |
0 |
if( p->validHMS ) return;
|
24151
|
0 |
0 |
if( sqlite3GlobalConfig.bLocaltimeFault ){
|
24152
|
0 |
0 |
if( sqlite3GlobalConfig.xAltLocaltime!=0
|
24153
|
0 |
0 |
&& 0==sqlite3GlobalConfig.xAltLocaltime((const void*)t,(void*)pTm)
|
24161
|
0 |
0 |
if( pX ) *pTm = *pX;
|
24203
|
0 |
0 |
if( p->iJD<2108667600*(i64)100000 /* 1970-01-01 */
|
24204
|
0 |
0 |
|| p->iJD>2130141456*(i64)100000 /* 2038-01-18 */
|
24222
|
0 |
0 |
if( osLocaltime(&t, &sLocal) ){
|
24305
|
0 |
0 |
if( sqlite3_stricmp(z, "auto")==0 ){
|
24306
|
0 |
0 |
if( idx>1 ) return 1; /* IMP: R-33611-57934 */
|
24307
|
0 |
0 |
if( !p->rawS || p->validJD ){
|
|
0 |
0 |
if( !p->rawS || p->validJD ){
|
24310
|
0 |
0 |
}else if( p->s>=-21086676*(i64)10000 /* -4713-11-24 12:00:00 */
|
24311
|
0 |
0 |
&& p->s<=(25340230*(i64)10000)+799 /* 9999-12-31 23:59:59 */
|
24332
|
0 |
0 |
if( sqlite3_stricmp(z, "julianday")==0 ){
|
24333
|
0 |
0 |
if( idx>1 ) return 1; /* IMP: R-31176-64601 */
|
24334
|
0 |
0 |
if( p->validJD && p->rawS ){
|
|
0 |
0 |
if( p->validJD && p->rawS ){
|
24348
|
0 |
0 |
if( sqlite3_stricmp(z, "localtime")==0 && sqlite3NotPureFunc(pCtx) ){
|
|
0 |
0 |
if( sqlite3_stricmp(z, "localtime")==0 && sqlite3NotPureFunc(pCtx) ){
|
24361
|
0 |
0 |
if( sqlite3_stricmp(z, "unixepoch")==0 && p->rawS ){
|
|
0 |
0 |
if( sqlite3_stricmp(z, "unixepoch")==0 && p->rawS ){
|
24362
|
0 |
0 |
if( idx>1 ) return 1; /* IMP: R-49255-55373 */
|
24364
|
0 |
0 |
if( r>=0.0 && r<464269060800000.0 ){
|
|
0 |
0 |
if( r>=0.0 && r<464269060800000.0 ){
|
24373
|
0 |
0 |
else if( sqlite3_stricmp(z, "utc")==0 && sqlite3NotPureFunc(pCtx) ){
|
|
0 |
0 |
else if( sqlite3_stricmp(z, "utc")==0 && sqlite3NotPureFunc(pCtx) ){
|
24374
|
0 |
0 |
if( p->tzSet==0 ){
|
24390
|
0 |
0 |
if( rc ) return rc;
|
24393
|
0 |
0 |
}while( iErr && cnt++<3 );
|
|
0 |
0 |
}while( iErr && cnt++<3 );
|
24412
|
0 |
0 |
if( sqlite3_strnicmp(z, "weekday ", 8)==0
|
24413
|
0 |
0 |
&& sqlite3AtoF(&z[8], &r, sqlite3Strlen30(&z[8]), SQLITE_UTF8)>0
|
24414
|
0 |
0 |
&& r>=0.0 && r<7.0 && (n=(int)r)==r ){
|
|
0 |
0 |
&& r>=0.0 && r<7.0 && (n=(int)r)==r ){
|
|
0 |
0 |
&& r>=0.0 && r<7.0 && (n=(int)r)==r ){
|
24421
|
0 |
0 |
if( Z>n ) Z -= 7;
|
24441
|
0 |
0 |
if( sqlite3_strnicmp(z, "start of ", 9)!=0 ){
|
24442
|
0 |
0 |
if( sqlite3_stricmp(z, "subsec")==0
|
24443
|
0 |
0 |
|| sqlite3_stricmp(z, "subsecond")==0
|
24450
|
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;
|
24459
|
0 |
0 |
if( sqlite3_stricmp(z,"month")==0 ){
|
24462
|
0 |
0 |
}else if( sqlite3_stricmp(z,"year")==0 ){
|
24466
|
0 |
0 |
}else if( sqlite3_stricmp(z,"day")==0 ){
|
24485
|
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++){}
|
24486
|
0 |
0 |
if( sqlite3AtoF(z, &r, n, SQLITE_UTF8)<=0 ){
|
24490
|
0 |
0 |
if( z[n]==':' ){
|
24499
|
0 |
0 |
if( !sqlite3Isdigit(*z2) ) z2++;
|
24501
|
0 |
0 |
if( parseHhMmSs(z2, &tx) ) break;
|
24506
|
0 |
0 |
if( z[0]=='-' ) tx.iJD = -tx.iJD;
|
24517
|
0 |
0 |
while( sqlite3Isspace(*z) ) z++;
|
24519
|
0 |
0 |
if( n>10 || n<3 ) break;
|
|
0 |
0 |
if( n>10 || n<3 ) break;
|
24520
|
0 |
0 |
if( sqlite3UpperToLower[(u8)z[n-1]]=='s' ) n--;
|
24523
|
0 |
0 |
rRounder = r<0 ? -0.5 : +0.5;
|
24524
|
0 |
0 |
for(i=0; i<ArraySize(aXformType); i++){
|
24525
|
0 |
0 |
if( aXformType[i].nName==n
|
24526
|
0 |
0 |
&& sqlite3_strnicmp(aXformType[i].zName, z, n)==0
|
24527
|
0 |
0 |
&& r>-aXformType[i].rLimit && r<aXformType[i].rLimit
|
|
0 |
0 |
&& r>-aXformType[i].rLimit && r<aXformType[i].rLimit
|
24535
|
0 |
0 |
x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12;
|
24587
|
0 |
0 |
if( argc==0 ){
|
24588
|
0 |
0 |
if( !sqlite3NotPureFunc(context) ) return 1;
|
24591
|
0 |
0 |
if( (eType = sqlite3_value_type(argv[0]))==SQLITE_FLOAT
|
24592
|
0 |
0 |
|| eType==SQLITE_INTEGER ){
|
24596
|
0 |
0 |
if( !z || parseDateOrTime(context, (char*)z, p) ){
|
|
0 |
0 |
if( !z || parseDateOrTime(context, (char*)z, p) ){
|
24600
|
0 |
0 |
for(i=1; i<argc; i++){
|
24603
|
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;
|
24606
|
0 |
0 |
if( p->isError || !validJulianDay(p->iJD) ) return 1;
|
|
0 |
0 |
if( p->isError || !validJulianDay(p->iJD) ) return 1;
|
24627
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){
|
24645
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){
|
24647
|
0 |
0 |
if( x.useSubsec ){
|
24666
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){
|
24671
|
0 |
0 |
if( Y<0 ) Y = -Y;
|
24689
|
0 |
0 |
if( x.useSubsec ){
|
24706
|
0 |
0 |
if( x.Y<0 ){
|
24726
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){
|
24736
|
0 |
0 |
if( x.useSubsec ){
|
24768
|
0 |
0 |
if( isDate(context, argc, argv, &x)==0 ){
|
24773
|
0 |
0 |
if( Y<0 ) Y = -Y;
|
24785
|
0 |
0 |
if( x.Y<0 ){
|
24825
|
0 |
0 |
if( argc==0 ) return;
|
24827
|
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;
|
24833
|
0 |
0 |
for(i=j=0; zFmt[i]; i++){
|
24834
|
0 |
0 |
if( zFmt[i]!='%' ) continue;
|
24835
|
0 |
0 |
if( j<i ) sqlite3_str_append(&sRes, zFmt+j, (int)(i-j));
|
24845
|
0 |
0 |
if( s>59.999 ) s = 59.999;
|
24862
|
0 |
0 |
if( zFmt[i]=='W' ){
|
24884
|
0 |
0 |
if( x.useSubsec ){
|
24916
|
0 |
0 |
if( j<i ) sqlite3_str_append(&sRes, zFmt+j, (int)(i-j));
|
25118
|
1216 |
2178 |
if( pId->pMethods ){
|
25136
|
270 |
0 |
return flags ? id->pMethods->xSync(id, flags) : SQLITE_OK;
|
25165
|
1185 |
327 |
if( id->pMethods==0 ) return SQLITE_NOTFOUND;
|
25193
|
563 |
260 |
if( id->pMethods ) (void)id->pMethods->xFileControl(id, op, pArg);
|
25198
|
0 |
0 |
return (xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE);
|
25201
|
0 |
941 |
if( NEVER(id->pMethods==0) ) return 0;
|
25271
|
92 |
0 |
return pVfs->xDelete!=0 ? pVfs->xDelete(pVfs, zPath, dirSync) : SQLITE_OK;
|
25309
|
0 |
100 |
if( sqlite3Config.iPrngSeed ){
|
25311
|
0 |
0 |
if( ALWAYS(nByte>(signed)sizeof(unsigned)) ) nByte = sizeof(unsigned int);
|
25323
|
6 |
0 |
return pVfs->xGetLastError ? pVfs->xGetLastError(pVfs, 0, 0) : 0;
|
25333
|
12 |
0 |
if( pVfs->iVersion>=2 && pVfs->xCurrentTimeInt64 ){
|
|
12 |
0 |
if( pVfs->iVersion>=2 && pVfs->xCurrentTimeInt64 ){
|
25353
|
0 |
0 |
if( pFile ){
|
25355
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
25382
|
0 |
110 |
if( p==0 ) return SQLITE_NOMEM_BKPT;
|
25404
|
0 |
532 |
if( rc ) return 0;
|
25410
|
532 |
0 |
for(pVfs = vfsList; pVfs; pVfs=pVfs->pNext){
|
25411
|
527 |
5 |
if( zVfs==0 ) break;
|
25412
|
5 |
0 |
if( strcmp(zVfs, pVfs->zName)==0 ) break;
|
25423
|
550 |
0 |
if( pVfs==0 ){
|
25425
|
0 |
550 |
}else if( vfsList==pVfs ){
|
25427
|
440 |
110 |
}else if( vfsList ){
|
25429
|
660 |
440 |
while( p->pNext && p->pNext!=pVfs ){
|
|
660 |
0 |
while( p->pNext && p->pNext!=pVfs ){
|
25432
|
0 |
440 |
if( p->pNext==pVfs ){
|
25447
|
0 |
550 |
if( rc ) return rc;
|
25456
|
440 |
110 |
if( makeDflt || vfsList==0 ){
|
|
0 |
440 |
if( makeDflt || vfsList==0 ){
|
25475
|
0 |
0 |
if( rc ) return rc;
|
25561
|
0 |
2853 |
if( wsdHooks.xBenignBegin ){
|
25567
|
0 |
2853 |
if( wsdHooks.xBenignEnd ){
|
25780
|
129608 |
0 |
if( p ){
|
25853
|
5944 |
0 |
if( p ){
|
27961
|
110 |
770 |
if( !sqlite3GlobalConfig.mutex.xMutexAlloc ){
|
27970
|
110 |
0 |
if( sqlite3GlobalConfig.bCoreMutex ){
|
28007
|
0 |
0 |
if( sqlite3GlobalConfig.mutex.xMutexEnd ){
|
28023
|
97 |
0 |
if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
|
|
0 |
97 |
if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;
|
28024
|
0 |
97 |
if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
|
|
0 |
0 |
if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0;
|
28031
|
0 |
3939 |
if( !sqlite3GlobalConfig.bCoreMutex ){
|
28043
|
520 |
0 |
if( p ){
|
28054
|
335728 |
0 |
if( p ){
|
28066
|
0 |
0 |
if( p ){
|
28080
|
335728 |
0 |
if( p ){
|
28494
|
427 |
0 |
if( p ){
|
28515
|
97 |
0 |
if( p ){
|
28647
|
0 |
0 |
if( pthread_mutex_trylock(&p->mutex)==0 ){
|
29314
|
0 |
0 |
if( rc ) return -1;
|
29318
|
0 |
0 |
if( n<0 ){
|
29322
|
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) ){
|
29327
|
0 |
0 |
AtomicStore(&mem0.nearlyFull, n>0 && n<=nUsed);
|
|
0 |
0 |
AtomicStore(&mem0.nearlyFull, n>0 && n<=nUsed);
|
29330
|
0 |
0 |
if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff));
|
29334
|
0 |
0 |
if( n<0 ) n = 0;
|
29354
|
0 |
0 |
if( rc ) return -1;
|
29358
|
0 |
0 |
if( n>=0 ){
|
29360
|
0 |
0 |
if( n<mem0.alarmThreshold || mem0.alarmThreshold==0 ){
|
|
0 |
0 |
if( n<mem0.alarmThreshold || mem0.alarmThreshold==0 ){
|
29374
|
110 |
0 |
if( sqlite3GlobalConfig.m.xMalloc==0 ){
|
29378
|
0 |
110 |
if( sqlite3GlobalConfig.pPage==0 || sqlite3GlobalConfig.szPage<512
|
|
0 |
0 |
if( sqlite3GlobalConfig.pPage==0 || sqlite3GlobalConfig.szPage<512
|
29379
|
0 |
0 |
|| sqlite3GlobalConfig.nPage<=0 ){
|
29384
|
0 |
110 |
if( rc!=SQLITE_OK ) memset(&mem0, 0, sizeof(mem0));
|
29401
|
0 |
0 |
if( sqlite3GlobalConfig.m.xShutdown ){
|
29431
|
5939 |
0 |
if( mem0.alarmThreshold<=0 ) return;
|
29455
|
0 |
129608 |
if( mem0.alarmThreshold>0 ){
|
29457
|
0 |
0 |
if( nUsed >= mem0.alarmThreshold - nFull ){
|
29460
|
0 |
0 |
if( mem0.hardLimit ){
|
29462
|
0 |
0 |
if( nUsed >= mem0.hardLimit - nFull ){
|
29478
|
129608 |
0 |
if( p ){
|
29513
|
129608 |
0 |
if( n==0 || n>SQLITE_MAX_ALLOCATION_SIZE ){
|
|
0 |
129608 |
if( n==0 || n>SQLITE_MAX_ALLOCATION_SIZE ){
|
29515
|
129608 |
0 |
}else if( sqlite3GlobalConfig.bMemstat ){
|
29533
|
0 |
7856 |
if( sqlite3_initialize() ) return 0;
|
29535
|
7856 |
0 |
return n<=0 ? 0 : sqlite3Malloc(n);
|
29539
|
0 |
56800 |
if( sqlite3_initialize() ) return 0;
|
29549
|
3227 |
648 |
return SQLITE_WITHIN(p, db->lookaside.pStart, db->lookaside.pTrueEnd);
|
|
405 |
2822 |
return SQLITE_WITHIN(p, db->lookaside.pStart, db->lookaside.pTrueEnd);
|
29565
|
24 |
381 |
return p<db->lookaside.pMiddle ? db->lookaside.szTrue : LOOKASIDE_SMALL;
|
29581
|
34736 |
132 |
if( db ){
|
29582
|
29106 |
5630 |
if( ((uptr)p)<(uptr)(db->lookaside.pTrueEnd) ){
|
29584
|
23262 |
5844 |
if( ((uptr)p)>=(uptr)(db->lookaside.pMiddle) ){
|
29589
|
5128 |
716 |
if( ((uptr)p)>=(uptr)(db->lookaside.pStart) ){
|
29600
|
0 |
16 |
return p ? sqlite3GlobalConfig.m.xSize(p) : 0;
|
29607
|
28463 |
129342 |
if( p==0 ) return; /* IMP: R-49053-54554 */
|
29610
|
129342 |
0 |
if( sqlite3GlobalConfig.bMemstat ){
|
29637
|
28521 |
633 |
if( db ){
|
29638
|
17944 |
10577 |
if( ((uptr)p)<(uptr)(db->lookaside.pEnd) ){
|
29640
|
7763 |
10181 |
if( ((uptr)p)>=(uptr)(db->lookaside.pMiddle) ){
|
29651
|
859 |
9322 |
if( ((uptr)p)>=(uptr)(db->lookaside.pStart) ){
|
29662
|
40 |
19859 |
if( db->pnBytesFreed ){
|
29677
|
106712 |
21340 |
if( ((uptr)p)<(uptr)(db->lookaside.pEnd) ){
|
29679
|
83858 |
22854 |
if( ((uptr)p)>=(uptr)(db->lookaside.pMiddle) ){
|
29690
|
20054 |
2800 |
if( ((uptr)p)>=(uptr)(db->lookaside.pStart) ){
|
29701
|
6 |
24134 |
if( db->pnBytesFreed ){
|
29712
|
25375 |
8680 |
if( p ) sqlite3DbFreeNN(db, p);
|
29723
|
1135 |
6015 |
if( pOld==0 ){
|
29726
|
0 |
6015 |
if( nBytes==0 ){
|
29730
|
0 |
6015 |
if( nBytes>=0x7fffff00 ){
|
29739
|
71 |
5944 |
if( nOld==nNew ){
|
29741
|
5944 |
0 |
}else if( sqlite3GlobalConfig.bMemstat ){
|
29746
|
5939 |
5 |
if( nDiff>0 && (nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED)) >=
|
|
5939 |
0 |
if( nDiff>0 && (nUsed = sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED)) >=
|
29749
|
0 |
5939 |
if( mem0.hardLimit>0 && nUsed >= mem0.hardLimit - nDiff ){
|
|
0 |
0 |
if( mem0.hardLimit>0 && nUsed >= mem0.hardLimit - nDiff ){
|
29761
|
5944 |
0 |
if( pNew ){
|
29779
|
0 |
108 |
if( sqlite3_initialize() ) return 0;
|
29781
|
0 |
108 |
if( n<0 ) n = 0; /* IMP: R-26507-47431 */
|
29786
|
0 |
3345 |
if( sqlite3_initialize() ) return 0;
|
29797
|
3875 |
0 |
if( p ){
|
29811
|
14085 |
0 |
if( p ) memset(p, 0, (size_t)n);
|
29823
|
0 |
37490 |
if( !p ) sqlite3OomFault(db);
|
29853
|
56430 |
4362 |
if( db ) return sqlite3DbMallocRawNN(db, n);
|
29864
|
35402 |
114624 |
if( n>db->lookaside.sz ){
|
29865
|
780 |
34622 |
if( !db->lookaside.bDisable ){
|
29867
|
0 |
34622 |
}else if( db->mallocFailed ){
|
29873
|
94480 |
20144 |
if( n<=LOOKASIDE_SMALL ){
|
29874
|
77987 |
16493 |
if( (pBuf = db->lookaside.pSmallFree)!=0 ){
|
29878
|
13636 |
2857 |
}else if( (pBuf = db->lookaside.pSmallInit)!=0 ){
|
29885
|
18912 |
4089 |
if( (pBuf = db->lookaside.pFree)!=0 ){
|
29889
|
2001 |
2088 |
}else if( (pBuf = db->lookaside.pInit)!=0 ){
|
29916
|
12512 |
4384 |
if( p==0 ) return sqlite3DbMallocRawNN(db, n);
|
29918
|
1562 |
2822 |
if( ((uptr)p)<(uptr)db->lookaside.pEnd ){
|
29920
|
822 |
740 |
if( ((uptr)p)>=(uptr)db->lookaside.pMiddle ){
|
29921
|
441 |
381 |
if( n<=LOOKASIDE_SMALL ) return p;
|
29924
|
92 |
648 |
if( ((uptr)p)>=(uptr)db->lookaside.pStart ){
|
29925
|
68 |
24 |
if( n<=db->lookaside.szTrue ) return p;
|
29934
|
3875 |
0 |
if( db->mallocFailed==0 ){
|
29935
|
405 |
3470 |
if( isLookaside(db, p) ){
|
29937
|
405 |
0 |
if( pNew ){
|
29946
|
0 |
3470 |
if( !pNew ){
|
29963
|
0 |
5442 |
if( !pNew ){
|
29979
|
398 |
4403 |
if( z==0 ){
|
29984
|
4403 |
0 |
if( zNew ){
|
29994
|
21180 |
147 |
zNew = z ? sqlite3DbMallocRawNN(db, n+1) : 0;
|
29995
|
21180 |
147 |
if( zNew ){
|
30014
|
0 |
1631 |
while( sqlite3Isspace(zStart[0]) ) zStart++;
|
30016
|
1304 |
1631 |
while( sqlite3Isspace(zStart[n-1]) ) n--;
|
30043
|
0 |
0 |
if( db->mallocFailed==0 && db->bBenignMalloc==0 ){
|
|
0 |
0 |
if( db->mallocFailed==0 && db->bBenignMalloc==0 ){
|
30045
|
0 |
0 |
if( db->nVdbeExec>0 ){
|
30049
|
0 |
0 |
if( db->pParse ){
|
30053
|
0 |
0 |
for(pParse=db->pParse->pOuterParse; pParse; pParse = pParse->pOuterParse){
|
30070
|
0 |
0 |
if( db->mallocFailed && db->nVdbeExec==0 ){
|
|
0 |
0 |
if( db->mallocFailed && db->nVdbeExec==0 ){
|
30074
|
0 |
0 |
EnableLookaside;
|
30082
|
138 |
0 |
if( db->mallocFailed || rc==SQLITE_IOERR_NOMEM ){
|
|
0 |
138 |
if( db->mallocFailed || rc==SQLITE_IOERR_NOMEM ){
|
30109
|
40837 |
0 |
if( db->mallocFailed || rc ){
|
|
138 |
40699 |
if( db->mallocFailed || rc ){
|
30251
|
0 |
30 |
if( (*cnt)<=0 ) return '0';
|
30270
|
0 |
0 |
if( *msd>=10 ) *msd /= 10;
|
30281
|
0 |
0 |
if( p->mxAlloc ) sqlite3_str_reset(p);
|
30282
|
0 |
0 |
if( eError==SQLITE_TOOBIG ) sqlite3ErrorToParser(p->db, eError);
|
30289
|
0 |
0 |
if( p->nArg<=p->nUsed ) return 0;
|
30293
|
0 |
0 |
if( p->nArg<=p->nUsed ) return 0.0;
|
30297
|
0 |
0 |
if( p->nArg<=p->nUsed ) return 0;
|
30312
|
0 |
118 |
if( pAccum->accError ) return 0;
|
30313
|
38 |
80 |
if( n>pAccum->nAlloc && n>pAccum->mxAlloc ){
|
|
0 |
38 |
if( n>pAccum->nAlloc && n>pAccum->mxAlloc ){
|
30318
|
0 |
118 |
if( z==0 ){
|
30389
|
0 |
4802 |
if( (pAccum->printfFlags & SQLITE_PRINTF_SQLFUNC)!=0 ){
|
30390
|
0 |
0 |
pArgList = va_arg(ap, PrintfArguments*);
|
30395
|
9194 |
3612 |
for(; (c=(*fmt))!=0; ++fmt){
|
30396
|
6169 |
3025 |
if( c!='%' ){
|
30401
|
65688 |
1190 |
do{ fmt++; }while( *fmt && *fmt != '%' );
|
|
60709 |
4979 |
do{ fmt++; }while( *fmt && *fmt != '%' );
|
30404
|
1190 |
4979 |
if( *fmt==0 ) break;
|
30406
|
0 |
8004 |
if( (c=(*++fmt))==0 ){
|
30430
|
68 |
0 |
if( c=='l' ){
|
30440
|
0 |
0 |
while( (c = *++fmt)>='0' && c<='9' ){
|
|
0 |
0 |
while( (c = *++fmt)>='0' && c<='9' ){
|
30450
|
0 |
0 |
if( c!='.' && c!='l' ){
|
|
0 |
0 |
if( c!='.' && c!='l' ){
|
30458
|
0 |
0 |
if( bArgList ){
|
30461
|
0 |
0 |
width = va_arg(ap,int);
|
30463
|
0 |
0 |
if( width<0 ){
|
30465
|
0 |
0 |
width = width >= -2147483647 ? -width : 0;
|
30472
|
0 |
0 |
if( (c = fmt[1])!='.' && c!='l' ){
|
|
0 |
0 |
if( (c = fmt[1])!='.' && c!='l' ){
|
30480
|
282 |
2 |
if( c=='*' ){
|
30481
|
0 |
282 |
if( bArgList ){
|
30484
|
282 |
0 |
precision = va_arg(ap,int);
|
30486
|
0 |
282 |
if( precision<0 ){
|
30487
|
0 |
0 |
precision = precision >= -2147483647 ? -precision : -1;
|
30492
|
6 |
0 |
while( c>='0' && c<='9' ){
|
|
4 |
2 |
while( c>='0' && c<='9' ){
|
30504
|
0 |
284 |
if( c=='l' ){
|
30512
|
41 |
8004 |
}while( !done && (c=(*++fmt))!=0 );
|
|
41 |
0 |
}while( !done && (c=(*++fmt))!=0 );
|
30517
|
26566 |
0 |
for(idx=0; idx<ArraySize(fmtinfo); idx++){
|
30518
|
8004 |
18562 |
if( c==fmtinfo[idx].fmttype ){
|
30554
|
764 |
33 |
if( infop->flags & FLAG_SIGNED ){
|
30556
|
0 |
764 |
if( bArgList ){
|
30558
|
68 |
696 |
}else if( flag_long ){
|
30559
|
68 |
0 |
if( flag_long==2 ){
|
30560
|
68 |
0 |
v = va_arg(ap,i64) ;
|
30562
|
0 |
0 |
v = va_arg(ap,long int);
|
30565
|
193 |
503 |
v = va_arg(ap,int);
|
30567
|
0 |
764 |
if( v<0 ){
|
30578
|
0 |
33 |
if( bArgList ){
|
30580
|
0 |
33 |
}else if( flag_long ){
|
30581
|
0 |
0 |
if( flag_long==2 ){
|
30582
|
0 |
0 |
longvalue = va_arg(ap,u64);
|
30584
|
0 |
0 |
longvalue = va_arg(ap,unsigned long int);
|
30587
|
33 |
0 |
longvalue = va_arg(ap,unsigned int);
|
30591
|
48 |
749 |
if( longvalue==0 ) flag_alternateform = 0;
|
30592
|
0 |
797 |
if( flag_zeropad && precision<width-(prefix!=0) ){
|
|
0 |
0 |
if( flag_zeropad && precision<width-(prefix!=0) ){
|
30595
|
797 |
0 |
if( precision<etBUFSIZE-10-etBUFSIZE/3 ){
|
30601
|
0 |
0 |
if( cThousand ) n += precision/3;
|
30603
|
0 |
0 |
if( zOut==0 ) return;
|
30607
|
0 |
797 |
if( xtype==etORDINAL ){
|
30610
|
0 |
0 |
if( x>=4 || (longvalue/10)%10==1 ){
|
|
0 |
0 |
if( x>=4 || (longvalue/10)%10==1 ){
|
30622
|
79 |
797 |
}while( longvalue>0 );
|
30625
|
0 |
797 |
while( precision>length ){
|
30629
|
0 |
797 |
if( cThousand ){
|
30633
|
0 |
0 |
for(idx=0; nn>0; idx++){
|
30636
|
0 |
0 |
if( ix==0 ){
|
30643
|
0 |
797 |
if( prefix ) *(--bufpt) = prefix; /* Add sign */
|
30644
|
0 |
797 |
if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */
|
|
0 |
0 |
if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */
|
30648
|
0 |
0 |
for(; (x=(*pre))!=0; pre++) *(--bufpt) = x;
|
30655
|
0 |
2 |
if( bArgList ){
|
30658
|
2 |
0 |
realvalue = va_arg(ap,double);
|
30663
|
0 |
2 |
if( precision<0 ) precision = 6; /* Set default precision */
|
30665
|
0 |
2 |
if( precision>SQLITE_FP_PRECISION_LIMIT ){
|
30669
|
0 |
2 |
if( realvalue<0.0 ){
|
30676
|
2 |
0 |
if( xtype==etGENERIC && precision>0 ) precision--;
|
|
2 |
0 |
if( xtype==etGENERIC && precision>0 ) precision--;
|
30678
|
2 |
0 |
if( realvalue<1.0e+16
|
30679
|
0 |
2 |
&& realvalue==(LONGDOUBLE_TYPE)(longvalue = (u64)realvalue)
|
30682
|
0 |
0 |
for(msd=1; msd*10<=longvalue; msd *= 10, exp++){}
|
30683
|
0 |
0 |
if( exp>precision && xtype!=etFLOAT ){
|
|
0 |
0 |
if( exp>precision && xtype!=etFLOAT ){
|
30686
|
0 |
0 |
while( kk-- > 0 ){ rnd /= 10; }
|
30694
|
2 |
2 |
while( idx>=10 ){ rounder *= 1.0e-10; idx -= 10; }
|
30695
|
0 |
2 |
if( xtype==etFLOAT ){
|
30701
|
0 |
0 |
if( precision+(ex/3) < 15 ) rounder += realvalue*3e-16;
|
30704
|
0 |
2 |
if( sqlite3IsNaN((double)realvalue) ){
|
30705
|
0 |
0 |
if( flag_zeropad ){
|
30716
|
2 |
0 |
if( ALWAYS(realvalue>0.0) ){
|
30718
|
0 |
2 |
while( realvalue>=1e100*scale && exp<=350){ scale*=1e100;exp+=100;}
|
|
0 |
0 |
while( realvalue>=1e100*scale && exp<=350){ scale*=1e100;exp+=100;}
|
30719
|
0 |
2 |
while( realvalue>=1e10*scale && exp<=350 ){ scale*=1e10; exp+=10; }
|
|
0 |
0 |
while( realvalue>=1e10*scale && exp<=350 ){ scale*=1e10; exp+=10; }
|
30720
|
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++; }
|
30722
|
0 |
2 |
while( realvalue<1e-8 ){ realvalue *= 1e8; exp-=8; }
|
30723
|
0 |
2 |
while( realvalue<1.0 ){ realvalue *= 10.0; exp--; }
|
30724
|
0 |
2 |
if( exp>350 ){
|
30725
|
0 |
0 |
if( flag_zeropad ){
|
30732
|
0 |
0 |
length = 3+(prefix!=0);
|
30736
|
2 |
0 |
if( xtype!=etFLOAT ){
|
30738
|
0 |
2 |
if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; }
|
30747
|
2 |
0 |
if( xtype==etGENERIC ){
|
30749
|
2 |
0 |
if( exp<-4 || exp>precision ){
|
|
0 |
2 |
if( exp<-4 || exp>precision ){
|
30758
|
0 |
2 |
if( xtype==etEXP ){
|
30768
|
0 |
2 |
if( cThousand && e2>0 ) szBufNeeded += (e2+2)/3;
|
|
0 |
0 |
if( cThousand && e2>0 ) szBufNeeded += (e2+2)/3;
|
30769
|
0 |
2 |
if( szBufNeeded > etBUFSIZE ){
|
30771
|
0 |
0 |
if( bufpt==0 ) return;
|
30777
|
0 |
2 |
if( prefix ){
|
30781
|
0 |
2 |
if( e2<0 ){
|
30783
|
0 |
2 |
}else if( msd>0 ){
|
30784
|
0 |
0 |
for(; e2>=0; e2--){
|
30786
|
0 |
0 |
if( cThousand && (e2%3)==0 && e2>1 ) *(bufpt++) = ',';
|
|
0 |
0 |
if( cThousand && (e2%3)==0 && e2>1 ) *(bufpt++) = ',';
|
|
0 |
0 |
if( cThousand && (e2%3)==0 && e2>1 ) *(bufpt++) = ',';
|
30789
|
14 |
2 |
for(; e2>=0; e2--){
|
30791
|
0 |
14 |
if( cThousand && (e2%3)==0 && e2>1 ) *(bufpt++) = ',';
|
|
0 |
0 |
if( cThousand && (e2%3)==0 && e2>1 ) *(bufpt++) = ',';
|
|
0 |
0 |
if( cThousand && (e2%3)==0 && e2>1 ) *(bufpt++) = ',';
|
30795
|
2 |
0 |
if( flag_dp ){
|
30800
|
0 |
2 |
for(e2++; e2<0; precision--, e2++){
|
30805
|
0 |
2 |
if( msd>0 ){
|
30806
|
0 |
0 |
while( (precision--)>0 ){
|
30810
|
16 |
2 |
while( (precision--)>0 ){
|
30815
|
2 |
0 |
if( flag_rtz && flag_dp ){
|
|
2 |
0 |
if( flag_rtz && flag_dp ){
|
30816
|
14 |
2 |
while( bufpt[-1]=='0' ) *(--bufpt) = 0;
|
30818
|
0 |
2 |
if( bufpt[-1]=='.' ){
|
30819
|
0 |
0 |
if( flag_altform2 ){
|
30827
|
0 |
2 |
if( xtype==etEXP ){
|
30829
|
0 |
0 |
if( exp<0 ){
|
30834
|
0 |
0 |
if( exp>=100 ){
|
30851
|
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){
|
30854
|
0 |
0 |
for(i=width; i>=nPad; i--){
|
30858
|
0 |
0 |
while( nPad-- ) bufpt[i++] = '0';
|
30864
|
0 |
0 |
if( !bArgList ){
|
30865
|
0 |
0 |
*(va_arg(ap,int*)) = pAccum->nChar;
|
30875
|
0 |
0 |
if( bArgList ){
|
30878
|
0 |
0 |
if( bufpt ){
|
30880
|
0 |
0 |
if( (c&0xc0)==0xc0 ){
|
30881
|
0 |
0 |
while( length<4 && (bufpt[0]&0xc0)==0x80 ){
|
|
0 |
0 |
while( length<4 && (bufpt[0]&0xc0)==0x80 ){
|
30889
|
0 |
0 |
unsigned int ch = va_arg(ap,unsigned int);
|
30890
|
0 |
0 |
if( ch<0x00080 ){
|
30893
|
0 |
0 |
}else if( ch<0x00800 ){
|
30897
|
0 |
0 |
}else if( ch<0x10000 ){
|
30910
|
0 |
0 |
if( precision>1 ){
|
30913
|
0 |
0 |
if( width>1 && !flag_leftjustify ){
|
|
0 |
0 |
if( width>1 && !flag_leftjustify ){
|
30919
|
0 |
0 |
while( precision > 1 ){
|
30921
|
0 |
0 |
if( nPrior > precision-1 ) nPrior = precision - 1;
|
30923
|
0 |
0 |
if( nCopyBytes + pAccum->nChar >= pAccum->nAlloc ){
|
30926
|
0 |
0 |
if( pAccum->accError ) break;
|
30938
|
0 |
4740 |
if( bArgList ){
|
30942
|
4740 |
0 |
bufpt = va_arg(ap,char*);
|
30944
|
1 |
4739 |
if( bufpt==0 ){
|
30946
|
16 |
4723 |
}else if( xtype==etDYNSTRING ){
|
30947
|
16 |
0 |
if( pAccum->nChar==0
|
30948
|
16 |
0 |
&& pAccum->mxAlloc
|
30949
|
16 |
0 |
&& width==0
|
30950
|
16 |
0 |
&& precision<0
|
30951
|
16 |
0 |
&& pAccum->accError==0
|
30966
|
278 |
4446 |
if( precision>=0 ){
|
30967
|
0 |
278 |
if( flag_altform2 ){
|
30971
|
0 |
0 |
while( precision-- > 0 && z[0] ){
|
|
0 |
0 |
while( precision-- > 0 && z[0] ){
|
30972
|
0 |
0 |
SQLITE_SKIP_UTF8(z);
|
|
0 |
0 |
SQLITE_SKIP_UTF8(z);
|
30976
|
12588 |
278 |
for(length=0; length<precision && bufpt[length]; length++){}
|
|
12588 |
0 |
for(length=0; length<precision && bufpt[length]; length++){}
|
30982
|
0 |
7117 |
if( flag_altform2 && width>0 ){
|
|
0 |
0 |
if( flag_altform2 && width>0 ){
|
30985
|
0 |
0 |
while( ii>=0 ) if( (bufpt[ii--] & 0xc0)==0x80 ) width++;
|
|
0 |
0 |
while( ii>=0 ) if( (bufpt[ii--] & 0xc0)==0x80 ) width++;
|
30994
|
495 |
1898 |
char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */
|
30997
|
0 |
2393 |
if( bArgList ){
|
31000
|
2119 |
274 |
escarg = va_arg(ap,char*);
|
31003
|
34 |
2359 |
if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
|
|
34 |
0 |
if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
|
31010
|
35413 |
4 |
for(i=n=0; k!=0 && (ch=escarg[i])!=0; i++, k--){
|
|
33024 |
2389 |
for(i=n=0; k!=0 && (ch=escarg[i])!=0; i++, k--){
|
31011
|
102 |
32922 |
if( ch==q ) n++;
|
31012
|
0 |
33024 |
if( flag_altform2 && (ch&0xc0)==0xc0 ){
|
|
0 |
0 |
if( flag_altform2 && (ch&0xc0)==0xc0 ){
|
31013
|
0 |
0 |
while( (escarg[i+1]&0xc0)==0x80 ){ i++; }
|
31016
|
2359 |
34 |
needQuote = !isnull && xtype==etSQLESCAPE2;
|
|
1419 |
940 |
needQuote = !isnull && xtype==etSQLESCAPE2;
|
31018
|
118 |
2275 |
if( n>etBUFSIZE ){
|
31020
|
0 |
118 |
if( bufpt==0 ) return;
|
31025
|
1419 |
974 |
if( needQuote ) bufpt[j++] = q;
|
31027
|
33024 |
2393 |
for(i=0; i<k; i++){
|
31029
|
102 |
32922 |
if( ch==q ) bufpt[j++] = ch;
|
31031
|
1419 |
974 |
if( needQuote ) bufpt[j++] = q;
|
31037
|
0 |
38 |
if( (pAccum->printfFlags & SQLITE_PRINTF_INTERNAL)==0 ) return;
|
31038
|
6 |
32 |
if( flag_alternateform ){
|
31040
|
6 |
0 |
Expr *pExpr = va_arg(ap,Expr*);
|
31041
|
6 |
0 |
if( ALWAYS(pExpr) && ALWAYS(!ExprHasProperty(pExpr,EP_IntValue)) ){
|
|
6 |
0 |
if( ALWAYS(pExpr) && ALWAYS(!ExprHasProperty(pExpr,EP_IntValue)) ){
|
31047
|
32 |
0 |
Token *pToken = va_arg(ap, Token*);
|
31049
|
32 |
0 |
if( pToken && pToken->n ){
|
|
32 |
0 |
if( pToken && pToken->n ){
|
31059
|
0 |
34 |
if( (pAccum->printfFlags & SQLITE_PRINTF_INTERNAL)==0 ) return;
|
31060
|
34 |
0 |
pItem = va_arg(ap, SrcItem*);
|
31062
|
0 |
34 |
if( pItem->zAlias && !flag_altform2 ){
|
|
0 |
0 |
if( pItem->zAlias && !flag_altform2 ){
|
31064
|
1 |
33 |
}else if( pItem->zName ){
|
31065
|
0 |
1 |
if( pItem->zDatabase ){
|
31070
|
0 |
33 |
}else if( pItem->zAlias ){
|
31075
|
0 |
33 |
if( pSel->selFlags & SF_NestedFrom ){
|
31098
|
0 |
8004 |
if( width>0 ){
|
31099
|
0 |
0 |
if( !flag_leftjustify ) sqlite3_str_appendchar(pAccum, width, ' ');
|
31101
|
0 |
0 |
if( flag_leftjustify ) sqlite3_str_appendchar(pAccum, width, ' ');
|
31106
|
118 |
7886 |
if( zExtra ){
|
31125
|
0 |
32 |
if( NEVER(db==0) ) return;
|
31126
|
29 |
3 |
if( db->errByteOffset!=(-2) ) return;
|
31128
|
0 |
3 |
if( NEVER(pParse==0) ) return;
|
31130
|
0 |
3 |
if( NEVER(zText==0) ) return;
|
31132
|
3 |
0 |
if( SQLITE_WITHIN(z,zText,zEnd) ){
|
|
3 |
0 |
if( SQLITE_WITHIN(z,zText,zEnd) ){
|
31142
|
12 |
0 |
while( pExpr
|
31143
|
0 |
12 |
&& (ExprHasProperty(pExpr,EP_OuterON|EP_InnerON) || pExpr->w.iOfst<=0)
|
|
0 |
12 |
&& (ExprHasProperty(pExpr,EP_OuterON|EP_InnerON) || pExpr->w.iOfst<=0)
|
31147
|
0 |
12 |
if( pExpr==0 ) return;
|
31161
|
0 |
1073 |
if( p->accError ){
|
31166
|
0 |
1073 |
if( p->mxAlloc==0 ){
|
31170
|
251 |
822 |
char *zOld = isMalloced(p) ? p->zText : 0;
|
31172
|
1073 |
0 |
if( szNew+p->nChar<=p->mxAlloc ){
|
31177
|
0 |
1073 |
if( szNew > p->mxAlloc ){
|
31184
|
954 |
119 |
if( p->db ){
|
31189
|
1073 |
0 |
if( zNew ){
|
31191
|
822 |
251 |
if( !isMalloced(p) && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar);
|
|
788 |
34 |
if( !isMalloced(p) && p->nChar>0 ) memcpy(zNew, p->zText, p->nChar);
|
31210
|
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 ){
|
31213
|
0 |
0 |
while( (N--)>0 ) p->zText[p->nChar++] = c;
|
31226
|
1073 |
0 |
if( N>0 ){
|
31241
|
1073 |
13272 |
if( p->nChar+N >= p->nAlloc ){
|
31243
|
13150 |
122 |
}else if( N ){
|
31267
|
3826 |
0 |
if( zText ){
|
31277
|
4664 |
0 |
if( p->zText ){
|
31279
|
4664 |
0 |
if( p->mxAlloc>0 && !isMalloced(p) ){
|
|
3826 |
838 |
if( p->mxAlloc>0 && !isMalloced(p) ){
|
31291
|
0 |
0 |
if( p->accError ){
|
31294
|
0 |
0 |
}else if( isMalloced(p) ){
|
31316
|
2 |
0 |
if( p!=0 && p!=&sqlite3OomStr ){
|
|
2 |
0 |
if( p!=0 && p!=&sqlite3OomStr ){
|
31327
|
0 |
0 |
return p ? p->accError : SQLITE_NOMEM;
|
31332
|
0 |
0 |
return p ? p->nChar : 0;
|
31337
|
0 |
0 |
if( p==0 || p->nChar==0 ) return 0;
|
|
0 |
0 |
if( p==0 || p->nChar==0 ) return 0;
|
31346
|
0 |
0 |
if( isMalloced(p) ){
|
31382
|
2 |
0 |
if( p ){
|
31383
|
2 |
0 |
sqlite3StrAccumInit(p, 0, 0, 0,
|
31405
|
0 |
1748 |
if( acc.accError==SQLITE_NOMEM ){
|
31440
|
0 |
2881 |
if( sqlite3_initialize() ) return 0;
|
31456
|
0 |
2793 |
if( sqlite3_initialize() ) return 0;
|
31479
|
0 |
0 |
if( n<=0 ) return zBuf;
|
31495
|
0 |
122 |
if( n<=0 ) return zBuf;
|
31540
|
0 |
93 |
if( sqlite3GlobalConfig.xLog ){
|
32933
|
1370 |
137 |
for(i=0; i<10; i++){
|
32943
|
2192 |
137 |
for(i=0; i<16; i++) out[i] = x[i]+in[i];
|
32970
|
0 |
1110 |
if( sqlite3_initialize() ) return;
|
32978
|
1087 |
23 |
if( N<=0 || pBuf==0 ){
|
|
0 |
1087 |
if( N<=0 || pBuf==0 ){
|
32987
|
100 |
987 |
if( wsdPrng.s[0]==0 ){
|
32993
|
0 |
100 |
if( NEVER(pVfs==0) ){
|
33005
|
1087 |
137 |
if( N<=wsdPrng.n ){
|
33010
|
0 |
137 |
if( wsdPrng.n>0 ){
|
33116
|
0 |
0 |
if( p==0 ) return SQLITE_NOMEM_BKPT;
|
33124
|
0 |
0 |
if( sqlite3FaultSim(200) ){
|
33129
|
0 |
0 |
if( rc ){
|
33142
|
0 |
0 |
if( NEVER(p==0) ) return SQLITE_NOMEM_BKPT;
|
33143
|
0 |
0 |
if( p->done ){
|
33482
|
84 |
9 |
if( c>=0xc0 ){
|
33484
|
126 |
84 |
while( (*(*pz) & 0xc0)==0x80 ){
|
33487
|
84 |
0 |
if( c<0x80
|
33488
|
84 |
0 |
|| (c&0xFFFFF800)==0xD800
|
33489
|
0 |
84 |
|| (c&0xFFFFFFFE)==0xFFFE ){ c = 0xFFFD; }
|
33537
|
0 |
0 |
if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){
|
|
0 |
0 |
if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){
|
33541
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
33547
|
0 |
0 |
while( zIn<zTerm ){
|
33558
|
0 |
0 |
if( desiredEnc==SQLITE_UTF8 ){
|
33584
|
0 |
0 |
if( !zOut ){
|
33589
|
0 |
0 |
if( pMem->enc==SQLITE_UTF8 ){
|
33590
|
0 |
0 |
if( desiredEnc==SQLITE_UTF16LE ){
|
33592
|
0 |
0 |
while( zIn<zTerm ){
|
33593
|
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);
|
33594
|
0 |
0 |
WRITE_UTF16LE(z, c);
|
33599
|
0 |
0 |
while( zIn<zTerm ){
|
33600
|
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);
|
33601
|
0 |
0 |
WRITE_UTF16BE(z, c);
|
33608
|
0 |
0 |
if( pMem->enc==SQLITE_UTF16LE ){
|
33610
|
0 |
0 |
while( zIn<zTerm ){
|
33613
|
0 |
0 |
if( c>=0xd800 && c<0xe000 ){
|
|
0 |
0 |
if( c>=0xd800 && c<0xe000 ){
|
33628
|
0 |
0 |
if( zIn<zTerm ){
|
33635
|
0 |
0 |
WRITE_UTF8(z, c);
|
|
0 |
0 |
WRITE_UTF8(z, c);
|
|
0 |
0 |
WRITE_UTF8(z, c);
|
33639
|
0 |
0 |
while( zIn<zTerm ){
|
33642
|
0 |
0 |
if( c>=0xd800 && c<0xe000 ){
|
|
0 |
0 |
if( c>=0xd800 && c<0xe000 ){
|
33657
|
0 |
0 |
if( zIn<zTerm ){
|
33664
|
0 |
0 |
WRITE_UTF8(z, c);
|
|
0 |
0 |
WRITE_UTF8(z, c);
|
|
0 |
0 |
WRITE_UTF8(z, c);
|
33709
|
0 |
0 |
if( pMem->n>1 ){
|
33712
|
0 |
0 |
if( b1==0xFE && b2==0xFF ){
|
|
0 |
0 |
if( b1==0xFE && b2==0xFF ){
|
33715
|
0 |
0 |
if( b1==0xFF && b2==0xFE ){
|
|
0 |
0 |
if( b1==0xFF && b2==0xFE ){
|
33720
|
0 |
0 |
if( bom ){
|
33722
|
0 |
0 |
if( rc==SQLITE_OK ){
|
33746
|
0 |
0 |
if( nByte>=0 ){
|
33752
|
0 |
0 |
while( *z!=0 && z<zTerm ){
|
|
0 |
0 |
while( *z!=0 && z<zTerm ){
|
33753
|
0 |
0 |
SQLITE_SKIP_UTF8(z);
|
|
0 |
0 |
SQLITE_SKIP_UTF8(z);
|
33802
|
0 |
0 |
if( db->mallocFailed ){
|
33823
|
0 |
0 |
while( n<nChar ){
|
33826
|
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;
|
33911
|
0 |
2158 |
return xCallback ? xCallback(iTest) : SQLITE_OK;
|
33927
|
0 |
222 |
rc = IsNaN(y);
|
|
0 |
0 |
rc = IsNaN(y);
|
33945
|
737 |
60108 |
if( z==0 ) return 0;
|
33957
|
239 |
3588 |
if( pCol->colFlags & COLFLAG_HASTYPE ){
|
33959
|
3364 |
224 |
}else if( pCol->eCType ){
|
33973
|
218 |
8 |
if( db->pErr ) sqlite3ValueSetNull(db->pErr);
|
33985
|
5900 |
8 |
if( err_code || db->pErr ){
|
|
218 |
5682 |
if( err_code || db->pErr ){
|
34000
|
359 |
5715 |
if( db->pErr ) sqlite3ValueSetNull(db->pErr);
|
34008
|
0 |
340 |
if( rc==SQLITE_IOERR_NOMEM ) return;
|
34010
|
334 |
6 |
if( rc==SQLITE_CANTOPEN || rc==SQLITE_IOERR ){
|
|
0 |
334 |
if( rc==SQLITE_CANTOPEN || rc==SQLITE_IOERR ){
|
34031
|
39 |
42 |
if( zFormat==0 ){
|
34033
|
33 |
9 |
}else if( db->pErr || (db->pErr = sqlite3ValueNew(db))!=0 ){
|
|
33 |
0 |
}else if( db->pErr || (db->pErr = sqlite3ValueNew(db))!=0 ){
|
34048
|
0 |
969 |
if( AtomicLoad(&db->u1.isInterrupted) ){
|
34053
|
4 |
965 |
if( db->xProgress && (++p->nProgressSteps)>=db->nProgressOps ){
|
|
0 |
4 |
if( db->xProgress && (++p->nProgressSteps)>=db->nProgressOps ){
|
34054
|
0 |
0 |
if( db->xProgress(db->pProgressArg) ){
|
34083
|
19 |
9 |
if( db->errByteOffset<-1 ) db->errByteOffset = -1;
|
34084
|
2 |
26 |
if( db->suppressErr ){
|
34086
|
0 |
2 |
if( db->mallocFailed ){
|
34106
|
0 |
0 |
if( db==0 || (pParse = db->pParse)==0 ) return errCode;
|
|
0 |
0 |
if( db==0 || (pParse = db->pParse)==0 ) return errCode;
|
34132
|
0 |
16657 |
if( z==0 ) return;
|
34134
|
12818 |
3839 |
if( !sqlite3Isquote(quote) ) return;
|
34135
|
4 |
3835 |
if( quote=='[' ) quote = ']';
|
34138
|
3947 |
42573 |
if( z[i]==quote ){
|
34139
|
108 |
3839 |
if( z[i+1]==quote ){
|
34154
|
67 |
2332 |
p->flags |= p->u.zToken[0]=='"' ? EP_Quoted|EP_DblQuoted : EP_Quoted;
|
34171
|
85 |
6229 |
if( p->n<2 ) return;
|
34172
|
6123 |
106 |
if( !sqlite3Isquote(p->z[0]) ) return;
|
34173
|
674 |
104 |
for(i=1; i<p->n-1; i++){
|
34174
|
2 |
672 |
if( sqlite3Isquote(p->z[i]) ) return;
|
34202
|
0 |
7034 |
if( zLeft==0 ){
|
34203
|
0 |
0 |
return zRight ? -1 : 0;
|
34204
|
0 |
7034 |
}else if( zRight==0 ){
|
34217
|
309715 |
192080 |
if( c==x ){
|
34218
|
30867 |
278848 |
if( c==0 ) break;
|
34221
|
183915 |
8165 |
if( c ) break;
|
34230
|
0 |
9631 |
if( zLeft==0 ){
|
34231
|
0 |
0 |
return zRight ? -1 : 0;
|
34232
|
0 |
9631 |
}else if( zRight==0 ){
|
34237
|
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++; }
|
34238
|
5704 |
3927 |
return N<0 ? 0 : UpperToLower[*a] - UpperToLower[*b];
|
34246
|
0 |
11076 |
if( z==0 ) return 0;
|
34247
|
56150 |
11076 |
while( z[0] ){
|
34284
|
7923 |
925 |
if( E & 1 ) r *= x;
|
34286
|
2170 |
6678 |
if( E==0 ) break;
|
34342
|
0 |
2708 |
if( length==0 ) return 0;
|
34344
|
2708 |
0 |
if( enc==SQLITE_UTF8 ){
|
34354
|
0 |
0 |
for(i=3-enc; i<length && z[i]==0; i+=2){}
|
|
0 |
0 |
for(i=3-enc; i<length && z[i]==0; i+=2){}
|
34355
|
0 |
0 |
if( i<length ) eType = -100;
|
34361
|
2708 |
0 |
while( z<zEnd && sqlite3Isspace(*z) ) z+=incr;
|
|
0 |
2708 |
while( z<zEnd && sqlite3Isspace(*z) ) z+=incr;
|
34362
|
0 |
2708 |
if( z>=zEnd ) return 0;
|
34365
|
4 |
2704 |
if( *z=='-' ){
|
34368
|
0 |
2704 |
}else if( *z=='+' ){
|
34373
|
5065 |
392 |
while( z<zEnd && sqlite3Isdigit(*z) ){
|
|
2749 |
2316 |
while( z<zEnd && sqlite3Isdigit(*z) ){
|
34376
|
0 |
2749 |
if( s>=((LARGEST_INT64-9)/10) ){
|
34379
|
0 |
0 |
while( z<zEnd && sqlite3Isdigit(*z) ){ z+=incr; d++; }
|
|
0 |
0 |
while( z<zEnd && sqlite3Isdigit(*z) ){ z+=incr; d++; }
|
34382
|
392 |
2316 |
if( z>=zEnd ) goto do_atof_calc;
|
34385
|
2170 |
146 |
if( *z=='.' ){
|
34390
|
32420 |
2170 |
while( z<zEnd && sqlite3Isdigit(*z) ){
|
|
32420 |
0 |
while( z<zEnd && sqlite3Isdigit(*z) ){
|
34391
|
32420 |
0 |
if( s<((LARGEST_INT64-9)/10) ){
|
34399
|
2170 |
146 |
if( z>=zEnd ) goto do_atof_calc;
|
34402
|
146 |
0 |
if( *z=='e' || *z=='E' ){
|
|
0 |
146 |
if( *z=='e' || *z=='E' ){
|
34410
|
0 |
0 |
if( z>=zEnd ) goto do_atof_calc; /*PREVENTS-HARMLESS-OVERREAD*/
|
34413
|
0 |
0 |
if( *z=='-' ){
|
34416
|
0 |
0 |
}else if( *z=='+' ){
|
34420
|
0 |
0 |
while( z<zEnd && sqlite3Isdigit(*z) ){
|
|
0 |
0 |
while( z<zEnd && sqlite3Isdigit(*z) ){
|
34421
|
0 |
0 |
e = e<10000 ? (e*10 + (*z - '0')) : 10000;
|
34428
|
180 |
0 |
while( z<zEnd && sqlite3Isspace(*z) ) z+=incr;
|
|
34 |
146 |
while( z<zEnd && sqlite3Isspace(*z) ) z+=incr;
|
34433
|
2170 |
538 |
if( e<0 ) {
|
34440
|
140 |
2568 |
if( s==0 ) {
|
34442
|
0 |
140 |
result = sign<0 ? -(double)0 : (double)0;
|
34450
|
2170 |
398 |
while( e>0 ){ /*OPTIMIZATION-IF-TRUE*/
|
34451
|
0 |
2170 |
if( esign>0 ){
|
34452
|
0 |
0 |
if( s>=(LARGEST_INT64/10) ) break; /*OPTIMIZATION-IF-FALSE*/
|
34455
|
2170 |
0 |
if( s%10!=0 ) break; /*OPTIMIZATION-IF-FALSE*/
|
34462
|
4 |
2564 |
s = sign<0 ? -s : s;
|
34464
|
398 |
2170 |
if( e==0 ){ /*OPTIMIZATION-IF-TRUE*/
|
34468
|
0 |
2170 |
if( e>307 ){ /*OPTIMIZATION-IF-TRUE*/
|
34469
|
0 |
0 |
if( e<342 ){ /*OPTIMIZATION-IF-TRUE*/
|
34471
|
0 |
0 |
if( esign<0 ){
|
34479
|
0 |
0 |
if( esign<0 ){
|
34491
|
2170 |
0 |
if( esign<0 ){
|
34504
|
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 ){
|
34506
|
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 ){
|
34531
|
0 |
355 |
if( v<0 ){
|
34532
|
0 |
0 |
x = (v==SMALLEST_INT64) ? ((u64)1)<<63 : (u64)-v;
|
34541
|
355 |
24 |
if( x==0 ) break;
|
34544
|
0 |
355 |
if( v<0 ) zTemp[--i] = '-';
|
34568
|
0 |
0 |
for(i=0; c==0 && i<18; i++){
|
|
0 |
0 |
for(i=0; c==0 && i<18; i++){
|
34571
|
0 |
0 |
if( c==0 ){
|
34607
|
478 |
0 |
if( enc==SQLITE_UTF8 ){
|
34613
|
0 |
0 |
for(i=3-enc; i<length && zNum[i]==0; i+=2){}
|
|
0 |
0 |
for(i=3-enc; i<length && zNum[i]==0; i+=2){}
|
34618
|
478 |
0 |
while( zNum<zEnd && sqlite3Isspace(*zNum) ) zNum+=incr;
|
|
0 |
478 |
while( zNum<zEnd && sqlite3Isspace(*zNum) ) zNum+=incr;
|
34619
|
478 |
0 |
if( zNum<zEnd ){
|
34620
|
0 |
478 |
if( *zNum=='-' ){
|
34623
|
0 |
478 |
}else if( *zNum=='+' ){
|
34628
|
845 |
0 |
while( zNum<zEnd && zNum[0]=='0' ){ zNum+=incr; } /* Skip leading zeros. */
|
|
367 |
478 |
while( zNum<zEnd && zNum[0]=='0' ){ zNum+=incr; } /* Skip leading zeros. */
|
34629
|
743 |
54 |
for(i=0; &zNum[i]<zEnd && (c=zNum[i])>='0' && c<='9'; i+=incr){
|
|
319 |
424 |
for(i=0; &zNum[i]<zEnd && (c=zNum[i])>='0' && c<='9'; i+=incr){
|
|
319 |
0 |
for(i=0; &zNum[i]<zEnd && (c=zNum[i])>='0' && c<='9'; i+=incr){
|
34635
|
0 |
478 |
if( u>LARGEST_INT64 ){
|
34640
|
0 |
0 |
*pNum = neg ? SMALLEST_INT64 : LARGEST_INT64;
|
34641
|
0 |
478 |
}else if( neg ){
|
34647
|
367 |
111 |
if( i==0 && zStart==zNum ){ /* No digits */
|
|
0 |
367 |
if( i==0 && zStart==zNum ){ /* No digits */
|
34649
|
0 |
478 |
}else if( nonNum ){ /* UTF16 with high-order bytes non-zero */
|
34651
|
424 |
54 |
}else if( &zNum[i]<zEnd ){ /* Extra bytes at the end */
|
34654
|
424 |
424 |
if( !sqlite3Isspace(zNum[jj]) ){
|
34659
|
424 |
0 |
}while( &zNum[jj]<zEnd );
|
34661
|
478 |
0 |
if( i<19*incr ){
|
34667
|
0 |
0 |
c = i>19*incr ? 1 : compare2pow63(zNum, incr);
|
34668
|
0 |
0 |
if( c<0 ){
|
34673
|
0 |
0 |
*pNum = neg ? SMALLEST_INT64 : LARGEST_INT64;
|
34674
|
0 |
0 |
if( c>0 ){
|
34681
|
0 |
0 |
return neg ? rc : 3;
|
34701
|
0 |
12 |
if( z[0]=='0'
|
34702
|
0 |
0 |
&& (z[1]=='x' || z[1]=='X')
|
|
0 |
0 |
&& (z[1]=='x' || z[1]=='X')
|
34706
|
0 |
0 |
for(i=2; z[i]=='0'; i++){}
|
34707
|
0 |
0 |
for(k=i; sqlite3Isxdigit(z[k]); k++){
|
34711
|
0 |
0 |
if( k-i>16 ) return 2;
|
34712
|
0 |
0 |
if( z[k]!=0 ) return 1;
|
34735
|
0 |
1229 |
if( zNum[0]=='-' ){
|
34738
|
0 |
1229 |
}else if( zNum[0]=='+' ){
|
34742
|
39 |
1190 |
else if( zNum[0]=='0'
|
34743
|
39 |
0 |
&& (zNum[1]=='x' || zNum[1]=='X')
|
|
0 |
39 |
&& (zNum[1]=='x' || zNum[1]=='X')
|
34744
|
0 |
0 |
&& sqlite3Isxdigit(zNum[2])
|
34748
|
0 |
0 |
while( zNum[0]=='0' ) zNum++;
|
34749
|
0 |
0 |
for(i=0; i<8 && sqlite3Isxdigit(zNum[i]); i++){
|
|
0 |
0 |
for(i=0; i<8 && sqlite3Isxdigit(zNum[i]); i++){
|
34752
|
0 |
0 |
if( (u&0x80000000)==0 && sqlite3Isxdigit(zNum[i])==0 ){
|
|
0 |
0 |
if( (u&0x80000000)==0 && sqlite3Isxdigit(zNum[i])==0 ){
|
34760
|
0 |
1229 |
if( !sqlite3Isdigit(zNum[0]) ) return 0;
|
34761
|
39 |
1229 |
while( zNum[0]=='0' ) zNum++;
|
34762
|
2984 |
0 |
for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){
|
|
1755 |
1229 |
for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){
|
|
1755 |
0 |
for(i=0; i<11 && (c = zNum[i] - '0')>=0 && c<=9; i++){
|
34772
|
0 |
1229 |
if( i>10 ){
|
34776
|
12 |
1217 |
if( v-neg>2147483647 ){
|
34779
|
0 |
1217 |
if( neg ){
|
34805
|
808 |
784 |
for(i=0; sqlite3Isdigit(z[i]); i++){
|
34807
|
0 |
808 |
if( v>4294967296LL ){ *pI = 0; return 0; }
|
34809
|
784 |
0 |
if( i==0 || z[i]!=0 ){ *pI = 0; return 0; }
|
|
0 |
784 |
if( i==0 || z[i]!=0 ){ *pI = 0; return 0; }
|
34846
|
0 |
43 |
if( v & (((u64)0xff000000)<<32) ){
|
34849
|
0 |
0 |
for(i=7; i>=0; i--){
|
34859
|
86 |
43 |
}while( v!=0 );
|
34862
|
129 |
43 |
for(i=0, j=n-1; j>=0; j--, i++){
|
34868
|
2168 |
2420 |
if( v<=0x7f ){
|
34872
|
2377 |
43 |
if( v<=0x3fff ){
|
34900
|
4584 |
380 |
if( ((signed char*)p)[0]>=0 ){
|
34904
|
380 |
0 |
if( ((signed char*)p)[1]>=0 ){
|
34918
|
0 |
0 |
if (!(a&0x80))
|
34934
|
0 |
0 |
if (!(b&0x80))
|
34958
|
0 |
0 |
if (!(a&0x80))
|
34980
|
0 |
0 |
if (!(b&0x80))
|
34996
|
0 |
0 |
if (!(a&0x80))
|
35013
|
0 |
0 |
if (!(b&0x80))
|
35078
|
471 |
28 |
if (!(b&0x80))
|
35092
|
28 |
0 |
if (!(a&0x80))
|
35118
|
0 |
0 |
if( (v64 & SQLITE_MAX_U32)!=v64 ){
|
35182
|
495 |
8854 |
for(i=1; (v >>= 7)!=0; i++){ assert( i<10 ); }
|
35256
|
6 |
0 |
if( zBlob ){
|
35257
|
163840 |
6 |
for(i=0; i<n; i+=2){
|
35294
|
0 |
8905 |
if( db==0 ){
|
35299
|
0 |
8905 |
if( eOpenState!=SQLITE_STATE_OPEN ){
|
35300
|
0 |
0 |
if( sqlite3SafetyCheckSickOrOk(db) ){
|
35312
|
1390 |
12 |
if( eOpenState!=SQLITE_STATE_SICK &&
|
|
6 |
1384 |
if( eOpenState!=SQLITE_STATE_SICK &&
|
35313
|
0 |
6 |
eOpenState!=SQLITE_STATE_OPEN &&
|
35391
|
219 |
0 |
if( x>=0 ) return x;
|
35392
|
0 |
0 |
if( x==(int)0x80000000 ) return 0x7fffffff;
|
35445
|
2650 |
2165 |
if( a>=b ){
|
35446
|
1779 |
871 |
if( a>b+49 ) return a;
|
35447
|
4 |
867 |
if( a>b+31 ) return a+1;
|
35450
|
1876 |
289 |
if( b>a+49 ) return b;
|
35451
|
76 |
213 |
if( b>a+31 ) return b+1;
|
35463
|
344 |
3504 |
if( x<8 ){
|
35464
|
124 |
220 |
if( x<2 ) return 0;
|
35465
|
417 |
220 |
while( x<8 ){ y -= 10; x <<= 1; }
|
35487
|
84 |
72 |
if( x<=1 ) return 0;
|
35488
|
72 |
0 |
if( x<=2000000000 ) return sqlite3LogEst((u64)x);
|
35501
|
0 |
0 |
if( n>=5 ) n -= 2;
|
35502
|
0 |
0 |
else if( n>=1 ) n -= 1;
|
35503
|
0 |
0 |
if( x>60 ) return (u64)LARGEST_INT64;
|
35504
|
0 |
0 |
return x>=3 ? (n+8)<<(x-3) : (n+8)>>(3-x);
|
35556
|
8 |
22 |
if( pIn==0 || pIn[1]+nInt > pIn[0] ){
|
|
0 |
8 |
if( pIn==0 || pIn[1]+nInt > pIn[0] ){
|
35558
|
0 |
22 |
sqlite3_int64 nAlloc = (pIn ? 2*(sqlite3_int64)pIn[0] : 10) + nInt;
|
35560
|
0 |
22 |
if( pOut==0 ) return pIn;
|
35561
|
22 |
0 |
if( pIn==0 ) pOut[1] = 2;
|
35583
|
3 |
32 |
if( pIn==0 ) return 0;
|
35587
|
32 |
8 |
if( pIn[i]==iVal ) return (char*)&pIn[i+2];
|
35589
|
8 |
0 |
}while( i<mx );
|
35599
|
13 |
12 |
if( pIn==0 ) return 0;
|
35604
|
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];
|
35606
|
2 |
5 |
}while( i<mx );
|
35753
|
9413 |
3598 |
while( elem ){
|
35767
|
100915 |
12457 |
while( (c = (unsigned char)*z++)!=0 ){ /*OPTIMIZATION-IF-TRUE*/
|
35787
|
7605 |
7507 |
if( pEntry ){
|
35788
|
1641 |
5964 |
pHead = pEntry->count ? pEntry->chain : 0;
|
35794
|
1641 |
13471 |
if( pHead ){
|
35797
|
1631 |
10 |
if( pHead->prev ){ pHead->prev->next = pNew; }
|
35802
|
11392 |
2079 |
if( pH->first ){ pH->first->prev = pNew; }
|
35820
|
0 |
624 |
if( new_size*sizeof(struct _ht)>SQLITE_MALLOC_SOFT_LIMIT ){
|
35823
|
0 |
624 |
if( new_size==pH->htsize ) return 0;
|
35838
|
0 |
624 |
if( new_ht==0 ) return 0;
|
35843
|
5616 |
624 |
for(elem=pH->first, pH->first=0; elem; elem = next_elem){
|
35866
|
6217 |
32554 |
if( pH->ht ){ /*OPTIMIZATION-IF-TRUE*/
|
35877
|
10215 |
28556 |
if( pHash ) *pHash = h;
|
35878
|
89768 |
28116 |
while( count ){
|
35880
|
10655 |
79113 |
if( sqlite3StrICmp(elem->pKey,pKey)==0 ){
|
35898
|
2 |
21 |
if( elem->prev ){
|
35903
|
9 |
14 |
if( elem->next ){
|
35906
|
0 |
23 |
if( pH->ht ){
|
35908
|
0 |
0 |
if( pEntry->chain==elem ){
|
35916
|
14 |
9 |
if( pH->count==0 ){
|
35955
|
645 |
9570 |
if( elem->data ){
|
35957
|
23 |
622 |
if( data==0 ){
|
35965
|
74 |
9496 |
if( data==0 ) return 0;
|
35967
|
0 |
9496 |
if( new_elem==0 ) return data;
|
35971
|
1989 |
7507 |
if( pH->count>=10 && pH->count > 2*pH->htsize ){
|
|
624 |
1365 |
if( pH->count>=10 && pH->count > 2*pH->htsize ){
|
35972
|
624 |
0 |
if( rehash(pH, pH->count*2) ){
|
35977
|
1989 |
7507 |
insertElement(pH, pH->ht ? &pH->ht[h] : 0, new_elem);
|
37774
|
92 |
0 |
return osGeteuid() ? 0 : osFchown(fd,uid,gid);
|
37795
|
0 |
0 |
if( zName==0 ){
|
37800
|
0 |
0 |
for(i=0; i<sizeof(aSyscall)/sizeof(aSyscall[0]); i++){
|
37801
|
0 |
0 |
if( aSyscall[i].pDefault ){
|
37809
|
0 |
0 |
for(i=0; i<sizeof(aSyscall)/sizeof(aSyscall[0]); i++){
|
37810
|
0 |
0 |
if( strcmp(zName, aSyscall[i].zName)==0 ){
|
37811
|
0 |
0 |
if( aSyscall[i].pDefault==0 ){
|
37815
|
0 |
0 |
if( pNewFunc==0 ) pNewFunc = aSyscall[i].pDefault;
|
37836
|
0 |
0 |
for(i=0; i<sizeof(aSyscall)/sizeof(aSyscall[0]); i++){
|
37837
|
0 |
0 |
if( strcmp(zName, aSyscall[i].zName)==0 ) return aSyscall[i].pCurrent;
|
37852
|
0 |
0 |
if( zName ){
|
37853
|
0 |
0 |
for(i=0; i<ArraySize(aSyscall)-1; i++){
|
37854
|
0 |
0 |
if( strcmp(zName, aSyscall[i].zName)==0 ) break;
|
37857
|
0 |
0 |
for(i++; i<ArraySize(aSyscall); i++){
|
37858
|
0 |
0 |
if( aSyscall[i].pCurrent!=0 ) return aSyscall[i].zName;
|
37891
|
92 |
305 |
mode_t m2 = m ? m : SQLITE_DEFAULT_FILE_PERMISSIONS;
|
37898
|
9 |
388 |
if( fd<0 ){
|
37899
|
0 |
9 |
if( errno==EINTR ) continue;
|
37902
|
388 |
0 |
if( fd>=SQLITE_MINIMUM_FILE_DESCRIPTOR ) break;
|
37903
|
0 |
0 |
if( (f & (O_EXCL|O_CREAT))==(O_EXCL|O_CREAT) ){
|
37910
|
0 |
0 |
if( osOpen("/dev/null", O_RDONLY, m)<0 ) break;
|
37912
|
388 |
9 |
if( fd>=0 ){
|
37913
|
92 |
296 |
if( m!=0 ){
|
37915
|
92 |
0 |
if( osFstat(fd, &statbuf)==0
|
37916
|
92 |
0 |
&& statbuf.st_size==0
|
37917
|
0 |
92 |
&& (statbuf.st_mode&0777)!=m
|
38066
|
0 |
0 |
do{ rc = osFtruncate(h,sz); }while( rc<0 && errno==EINTR );
|
|
0 |
0 |
do{ rc = osFtruncate(h,sz); }while( rc<0 && errno==EINTR );
|
38482
|
0 |
6 |
if( zPath==0 ) zPath = "";
|
38505
|
0 |
386 |
if( osClose(h) ){
|
38506
|
0 |
0 |
unixLogErrorAtLine(SQLITE_IOERR_CLOSE, "close",
|
38527
|
0 |
366 |
for(p=pInode->pUnused; p; p=pNext){
|
38545
|
104 |
0 |
if( ALWAYS(pInode) ){
|
38547
|
95 |
9 |
if( pInode->nRef==0 ){
|
38552
|
0 |
95 |
if( pInode->pPrev ){
|
38559
|
0 |
95 |
if( pInode->pNext ){
|
38595
|
0 |
106 |
if( rc!=0 ){
|
38637
|
9 |
97 |
while( pInode && memcmp(&fileId, &pInode->fileId, sizeof(fileId)) ){
|
|
0 |
9 |
while( pInode && memcmp(&fileId, &pInode->fileId, sizeof(fileId)) ){
|
38640
|
97 |
9 |
if( pInode==0 ){
|
38642
|
0 |
97 |
if( pInode==0 ){
|
38647
|
97 |
0 |
if( sqlite3GlobalConfig.bCoreMutex ){
|
38649
|
0 |
97 |
if( pInode->pLockMutex==0 ){
|
38658
|
0 |
97 |
if( inodeList ) inodeList->pPrev = pInode;
|
38677
|
0 |
334 |
|| (u64)buf.st_ino!=pFile->pInode->fileId.ino);
|
38696
|
92 |
210 |
if( pFile->ctrlFlags & UNIXFILE_NOLOCK ) return;
|
38699
|
0 |
210 |
if( rc!=0 ){
|
38703
|
0 |
210 |
if( buf.st_nlink==0 ){
|
38707
|
0 |
210 |
if( buf.st_nlink>1 ){
|
38711
|
0 |
210 |
if( fileHasMoved(pFile) ){
|
38736
|
65 |
87 |
if( pFile->pInode->eFileLock>SHARED_LOCK ){
|
38743
|
87 |
65 |
if( !reserved && !pFile->pInode->bProcessLock ){
|
|
87 |
0 |
if( !reserved && !pFile->pInode->bProcessLock ){
|
38749
|
0 |
87 |
if( osFcntl(pFile->h, F_GETLK, &lock) ){
|
38752
|
87 |
0 |
} else if( lock.l_type!=F_UNLCK ){
|
38830
|
0 |
1662 |
if( (pFile->ctrlFlags & (UNIXFILE_EXCL|UNIXFILE_RDONLY))==UNIXFILE_EXCL ){
|
38831
|
0 |
0 |
if( pInode->bProcessLock==0 ){
|
38839
|
0 |
0 |
if( rc<0 ) return rc;
|
38932
|
0 |
710 |
if( pFile->eFileLock>=eFileLock ){
|
38955
|
156 |
554 |
if( (pFile->eFileLock!=pInode->eFileLock &&
|
|
130 |
26 |
if( (pFile->eFileLock!=pInode->eFileLock &&
|
38956
|
65 |
65 |
(pInode->eFileLock>=PENDING_LOCK || eFileLock>SHARED_LOCK))
|
38966
|
336 |
283 |
if( eFileLock==SHARED_LOCK &&
|
|
336 |
0 |
if( eFileLock==SHARED_LOCK &&
|
38967
|
65 |
271 |
(pInode->eFileLock==SHARED_LOCK || pInode->eFileLock==RESERVED_LOCK) ){
|
38984
|
283 |
271 |
if( eFileLock==SHARED_LOCK
|
38985
|
97 |
186 |
|| (eFileLock==EXCLUSIVE_LOCK && pFile->eFileLock==RESERVED_LOCK)
|
|
97 |
0 |
|| (eFileLock==EXCLUSIVE_LOCK && pFile->eFileLock==RESERVED_LOCK)
|
38989
|
0 |
368 |
if( unixFileLock(pFile, &lock) ){
|
38992
|
0 |
0 |
if( rc!=SQLITE_BUSY ){
|
38996
|
97 |
271 |
}else if( eFileLock==EXCLUSIVE_LOCK ){
|
39006
|
271 |
283 |
if( eFileLock==SHARED_LOCK ){
|
39014
|
0 |
271 |
if( unixFileLock(pFile, &lock) ){
|
39023
|
0 |
271 |
if( unixFileLock(pFile, &lock) && rc==SQLITE_OK ){
|
|
0 |
0 |
if( unixFileLock(pFile, &lock) && rc==SQLITE_OK ){
|
39029
|
0 |
271 |
if( rc ){
|
39030
|
0 |
0 |
if( rc!=SQLITE_BUSY ){
|
39039
|
97 |
186 |
}else if( eFileLock==EXCLUSIVE_LOCK && pInode->nShared>1 ){
|
|
0 |
97 |
}else if( eFileLock==EXCLUSIVE_LOCK && pInode->nShared>1 ){
|
39052
|
186 |
97 |
if( eFileLock==RESERVED_LOCK ){
|
39060
|
87 |
196 |
if( unixFileLock(pFile, &lock) ){
|
39063
|
0 |
87 |
if( rc!=SQLITE_BUSY ){
|
39086
|
467 |
87 |
if( rc==SQLITE_OK ){
|
39137
|
210 |
435 |
if( pFile->eFileLock<=eFileLock ){
|
39143
|
99 |
336 |
if( pFile->eFileLock>SHARED_LOCK ){
|
39167
|
99 |
0 |
if( eFileLock==SHARED_LOCK ){
|
39216
|
0 |
99 |
if( unixFileLock(pFile, &lock) ){
|
39233
|
99 |
0 |
if( unixFileLock(pFile, &lock)==0 ){
|
39241
|
336 |
99 |
if( eFileLock==NO_LOCK ){
|
39247
|
271 |
65 |
if( pInode->nShared==0 ){
|
39251
|
271 |
0 |
if( unixFileLock(pFile, &lock)==0 ){
|
39267
|
271 |
65 |
if( pInode->nLock==0 ) closePendingFds(pFile);
|
39272
|
435 |
0 |
if( rc==SQLITE_OK ){
|
39312
|
196 |
0 |
if( pFile->h>=0 ){
|
39358
|
0 |
104 |
if( pInode->nLock ){
|
39506
|
0 |
0 |
if( pFile->eFileLock > NO_LOCK ){
|
39519
|
0 |
0 |
if( rc<0 ){
|
39522
|
0 |
0 |
if( EEXIST == tErrno ){
|
39526
|
0 |
0 |
if( rc!=SQLITE_BUSY ){
|
39558
|
0 |
0 |
if( pFile->eFileLock==eFileLock ){
|
39565
|
0 |
0 |
if( eFileLock==SHARED_LOCK ){
|
39573
|
0 |
0 |
if( rc<0 ){
|
39575
|
0 |
0 |
if( tErrno==ENOENT ){
|
40523
|
406 |
181 |
if( got==cnt ) break;
|
40524
|
0 |
181 |
if( got<0 ){
|
40525
|
0 |
0 |
if( errno==EINTR ){ got = 1; continue; }
|
40529
|
0 |
181 |
}else if( got>0 ){
|
40535
|
0 |
181 |
}while( got>0 );
|
40571
|
0 |
587 |
if( offset<pFile->mmapSize ){
|
40572
|
0 |
0 |
if( offset+amt <= pFile->mmapSize ){
|
40586
|
406 |
181 |
if( got==amt ){
|
40588
|
0 |
181 |
}else if( got<0 ){
|
40596
|
0 |
0 |
switch( pFile->lastErrno ){
|
40639
|
0 |
833 |
do{ rc = (int)osPwrite(fd, pBuf, nBuf, iOff); }while( rc<0 && errno==EINTR );
|
|
0 |
0 |
do{ rc = (int)osPwrite(fd, pBuf, nBuf, iOff); }while( rc<0 && errno==EINTR );
|
40657
|
0 |
833 |
if( rc<0 ) *piErrno = errno;
|
40737
|
0 |
833 |
while( (wrote = seekAndWrite(pFile, offset, pBuf, amt))<amt && wrote>0 ){
|
|
0 |
0 |
while( (wrote = seekAndWrite(pFile, offset, pBuf, amt))<amt && wrote>0 ){
|
40745
|
0 |
833 |
if( amt>wrote ){
|
40746
|
0 |
0 |
if( wrote<0 && pFile->lastErrno!=ENOSPC ){
|
|
0 |
0 |
if( wrote<0 && pFile->lastErrno!=ENOSPC ){
|
40915
|
1746 |
0 |
for(ii=(int)strlen(zDirname); ii>0 && zDirname[ii]!='/'; ii--);
|
|
1656 |
90 |
for(ii=(int)strlen(zDirname); ii>0 && zDirname[ii]!='/'; ii--);
|
40916
|
90 |
0 |
if( ii>0 ){
|
40919
|
0 |
0 |
if( zDirname[0]!='/' ) zDirname[0] = '.';
|
40927
|
90 |
0 |
if( fd>=0 ) return SQLITE_OK;
|
40967
|
0 |
270 |
if( rc ){
|
40976
|
90 |
180 |
if( pFile->ctrlFlags & UNIXFILE_DIRSYNC ){
|
40981
|
90 |
0 |
if( rc==SQLITE_OK ){
|
41007
|
0 |
0 |
if( pFile->szChunk>0 ){
|
41012
|
0 |
0 |
if( rc ){
|
41034
|
0 |
0 |
if( nByte<pFile->mmapSize ){
|
41052
|
0 |
342 |
if( rc!=0 ){
|
41064
|
0 |
342 |
if( *pSize==1 ) *pSize = 0;
|
41085
|
0 |
29 |
if( pFile->szChunk>0 ){
|
41089
|
0 |
0 |
if( osFstat(pFile->h, &buf) ){
|
41094
|
0 |
0 |
if( nSize>(i64)buf.st_size ){
|
41120
|
0 |
0 |
for(/*no-op*/; iWrite<nSize+nBlk-1; iWrite+=nBlk ){
|
41121
|
0 |
0 |
if( iWrite>=nSize ) iWrite = nSize - 1;
|
41123
|
0 |
0 |
if( nWrite!=1 ) return SQLITE_IOERR_WRITE;
|
41130
|
0 |
29 |
if( pFile->mmapSizeMax>0 && nByte>pFile->mmapSize ){
|
|
0 |
0 |
if( pFile->mmapSizeMax>0 && nByte>pFile->mmapSize ){
|
41132
|
0 |
0 |
if( pFile->szChunk<=0 ){
|
41133
|
0 |
0 |
if( robust_ftruncate(pFile->h, nByte) ){
|
41154
|
0 |
0 |
if( *pArg<0 ){
|
41156
|
0 |
0 |
}else if( (*pArg)==0 ){
|
41223
|
0 |
0 |
if( zTFile ){
|
41245
|
0 |
322 |
if( newLimit>sqlite3GlobalConfig.mxMmap ){
|
41257
|
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 ){
|
41259
|
0 |
0 |
if( pFile->mmapSize>0 ){
|
41309
|
106 |
835 |
if( pFd->sectorSize==0 ){
|
41322
|
106 |
0 |
if( pFd->ctrlFlags & UNIXFILE_PSOW ){
|
41549
|
0 |
0 |
if( pFile->pShm){
|
41560
|
0 |
0 |
if( osFcntl(pShmNode->hShm, F_GETLK, &f)<0 ){
|
41599
|
0 |
0 |
if( pShmNode->hShm>=0 ){
|
41607
|
0 |
0 |
if( res==-1 ){
|
41667
|
0 |
0 |
if( pgsz<shmsz ) return 1;
|
41680
|
0 |
0 |
if( p && ALWAYS(p->nRef==0) ){
|
|
0 |
0 |
if( p && ALWAYS(p->nRef==0) ){
|
41685
|
0 |
0 |
for(i=0; i<p->nRegion; i+=nShmPerMap){
|
41686
|
0 |
0 |
if( p->hShm>=0 ){
|
41693
|
0 |
0 |
if( p->hShm>=0 ){
|
41737
|
0 |
0 |
if( osFcntl(pShmNode->hShm, F_GETLK, &lock)!=0 ) {
|
41739
|
0 |
0 |
}else if( lock.l_type==F_UNLCK ){
|
41740
|
0 |
0 |
if( pShmNode->isReadonly ){
|
41750
|
0 |
0 |
if( rc==SQLITE_OK && robust_ftruncate(pShmNode->hShm, 3) ){
|
|
0 |
0 |
if( rc==SQLITE_OK && robust_ftruncate(pShmNode->hShm, 3) ){
|
41754
|
0 |
0 |
}else if( lock.l_type==F_WRLCK ){
|
41758
|
0 |
0 |
if( rc==SQLITE_OK ){
|
41810
|
0 |
0 |
if( p==0 ) return SQLITE_NOMEM_BKPT;
|
41821
|
0 |
0 |
if( pShmNode==0 ){
|
41831
|
0 |
0 |
if( osFstat(pDbFd->h, &sStat) ){
|
41842
|
0 |
0 |
if( pShmNode==0 ){
|
41859
|
0 |
0 |
if( sqlite3GlobalConfig.bCoreMutex ){
|
41861
|
0 |
0 |
if( pShmNode->pShmMutex==0 ){
|
41867
|
0 |
0 |
if( pInode->bProcessLock==0 ){
|
41868
|
0 |
0 |
if( 0==sqlite3_uri_boolean(pDbFd->zPath, "readonly_shm", 0) ){
|
41872
|
0 |
0 |
if( pShmNode->hShm<0 ){
|
41875
|
0 |
0 |
if( pShmNode->hShm<0 ){
|
41889
|
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;
|
41957
|
0 |
0 |
if( pDbFd->pShm==0 ){
|
41959
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
41965
|
0 |
0 |
if( pShmNode->isUnlocked ){
|
41967
|
0 |
0 |
if( rc!=SQLITE_OK ) goto shmpage_out;
|
41978
|
0 |
0 |
if( pShmNode->nRegion<nReqRegion ){
|
41985
|
0 |
0 |
if( pShmNode->hShm>=0 ){
|
41990
|
0 |
0 |
if( osFstat(pShmNode->hShm, &sStat) ){
|
41995
|
0 |
0 |
if( sStat.st_size<nByte ){
|
41999
|
0 |
0 |
if( !bExtend ){
|
42016
|
0 |
0 |
for(iPg=(sStat.st_size/pgsz); iPg<(nByte/pgsz); iPg++){
|
42018
|
0 |
0 |
if( seekAndWriteFd(pShmNode->hShm, iPg*pgsz + pgsz-1,"",1,&x)!=1 ){
|
42032
|
0 |
0 |
if( !apNew ){
|
42037
|
0 |
0 |
while( pShmNode->nRegion<nReqRegion ){
|
42041
|
0 |
0 |
if( pShmNode->hShm>=0 ){
|
42042
|
0 |
0 |
pMem = osMmap(0, nMap,
|
42046
|
0 |
0 |
if( pMem==MAP_FAILED ){
|
42052
|
0 |
0 |
if( pMem==0 ){
|
42059
|
0 |
0 |
for(i=0; i<nShmPerMap; i++){
|
42067
|
0 |
0 |
if( pShmNode->nRegion>iRegion ){
|
42072
|
0 |
0 |
if( pShmNode->isReadonly && rc==SQLITE_OK ) rc = SQLITE_READONLY;
|
|
0 |
0 |
if( pShmNode->isReadonly && rc==SQLITE_OK ) rc = SQLITE_READONLY;
|
42131
|
0 |
0 |
if( p==0 ) return SQLITE_IOERR_SHMLOCK;
|
42133
|
0 |
0 |
if( NEVER(pShmNode==0) ) return SQLITE_IOERR_SHMLOCK;
|
42174
|
0 |
0 |
if( flags & SQLITE_SHM_UNLOCK ){
|
42175
|
0 |
0 |
if( (p->exclMask|p->sharedMask) & mask ){
|
42179
|
0 |
0 |
for(ii=ofst; ii<ofst+n; ii++){
|
42180
|
0 |
0 |
if( aLock[ii]>((p->sharedMask & (1<<ii)) ? 1 : 0) ){
|
42185
|
0 |
0 |
if( bUnlock ){
|
42187
|
0 |
0 |
if( rc==SQLITE_OK ){
|
42190
|
0 |
0 |
}else if( ALWAYS(p->sharedMask & (1<<ofst)) ){
|
42196
|
0 |
0 |
if( rc==SQLITE_OK ){
|
42201
|
0 |
0 |
}else if( flags & SQLITE_SHM_SHARED ){
|
42204
|
0 |
0 |
if( (p->sharedMask & mask)==0 ){
|
42205
|
0 |
0 |
if( aLock[ofst]<0 ){
|
42207
|
0 |
0 |
}else if( aLock[ofst]==0 ){
|
42212
|
0 |
0 |
if( rc==SQLITE_OK ){
|
42221
|
0 |
0 |
for(ii=ofst; ii<ofst+n; ii++){
|
42223
|
0 |
0 |
if( ALWAYS((p->exclMask & (1<<ii))==0) && aLock[ii] ){
|
|
0 |
0 |
if( ALWAYS((p->exclMask & (1<<ii))==0) && aLock[ii] ){
|
42231
|
0 |
0 |
if( rc==SQLITE_OK ){
|
42233
|
0 |
0 |
if( rc==SQLITE_OK ){
|
42236
|
0 |
0 |
for(ii=ofst; ii<ofst+n; ii++){
|
42285
|
0 |
0 |
if( p==0 ) return SQLITE_OK;
|
42294
|
0 |
0 |
for(pp=&pShmNode->pFirst; (*pp)!=p; pp = &(*pp)->pNext){}
|
42308
|
0 |
0 |
if( pShmNode->nRef==0 ){
|
42309
|
0 |
0 |
if( deleteFlag && pShmNode->hShm>=0 ){
|
|
0 |
0 |
if( deleteFlag && pShmNode->hShm>=0 ){
|
42333
|
0 |
196 |
if( pFd->pMapRegion ){
|
42378
|
0 |
0 |
if( pOrig ){
|
42388
|
0 |
0 |
if( nReuse!=nOrig ){
|
42408
|
0 |
0 |
if( pNew==MAP_FAILED || pNew==0 ){
|
|
0 |
0 |
if( pNew==MAP_FAILED || pNew==0 ){
|
42414
|
0 |
0 |
if( pNew==0 ){
|
42418
|
0 |
0 |
if( pNew==MAP_FAILED ){
|
42451
|
0 |
0 |
if( pFd->nFetchOut>0 ) return SQLITE_OK;
|
42453
|
0 |
0 |
if( nMap<0 ){
|
42455
|
0 |
0 |
if( osFstat(pFd->h, &statbuf) ){
|
42460
|
0 |
0 |
if( nMap>pFd->mmapSizeMax ){
|
42465
|
0 |
0 |
if( nMap!=pFd->mmapSize ){
|
42492
|
0 |
0 |
if( pFd->mmapSizeMax>0 ){
|
42493
|
0 |
0 |
if( pFd->pMapRegion==0 ){
|
42495
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
42497
|
0 |
0 |
if( pFd->mmapSize >= iOff+nAmt ){
|
42529
|
0 |
0 |
if( p ){
|
42870
|
8 |
190 |
if( sqlite3_uri_boolean(((ctrlFlags & UNIXFILE_URI) ? zFilename : 0),
|
|
198 |
0 |
if( sqlite3_uri_boolean(((ctrlFlags & UNIXFILE_URI) ? zFilename : 0),
|
42874
|
0 |
198 |
if( strcmp(pVfs->zName,"unix-excl")==0 ){
|
42886
|
92 |
106 |
if( ctrlFlags & UNIXFILE_NOLOCK ){
|
42898
|
106 |
92 |
if( pLockingStyle == &posixIoMethods
|
42905
|
0 |
106 |
if( rc!=SQLITE_OK ){
|
42958
|
0 |
92 |
else if( pLockingStyle == &dotlockIoMethods ){
|
42967
|
0 |
0 |
if( zLockFile==0 ){
|
43008
|
0 |
198 |
if( rc!=SQLITE_OK ){
|
43009
|
0 |
0 |
if( h>=0 ) robust_close(pNew, h, __LINE__);
|
43048
|
0 |
0 |
if( zDir!=0
|
43049
|
0 |
0 |
&& osStat(zDir, &buf)==0
|
43050
|
0 |
0 |
&& S_ISDIR(buf.st_mode)
|
43051
|
0 |
0 |
&& osAccess(zDir, 03)==0
|
43055
|
0 |
0 |
if( i>=sizeof(azTempDirs)/sizeof(azTempDirs[0]) ) break;
|
43080
|
0 |
0 |
if( zDir==0 ){
|
43090
|
0 |
0 |
if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ){
|
|
0 |
0 |
if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ){
|
43094
|
0 |
0 |
}while( osAccess(zBuf,0)==0 );
|
43146
|
9 |
103 |
if( inodeList!=0 && 0==osStat(zPath, &sStat) ){
|
|
9 |
0 |
if( inodeList!=0 && 0==osStat(zPath, &sStat) ){
|
43150
|
9 |
0 |
while( pInode && (pInode->fileId.dev!=sStat.st_dev
|
|
0 |
9 |
while( pInode && (pInode->fileId.dev!=sStat.st_dev
|
43151
|
0 |
9 |
|| pInode->fileId.ino!=(u64)sStat.st_ino) ){
|
43154
|
9 |
0 |
if( pInode ){
|
43159
|
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));
|
43161
|
0 |
9 |
if( pUnused ){
|
43183
|
92 |
0 |
if( 0==osStat(zFile, &sStat) ){
|
43225
|
92 |
112 |
if( flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) ){
|
43248
|
736 |
0 |
while( nDb>0 && zPath[nDb]!='.' ){
|
|
736 |
0 |
while( nDb>0 && zPath[nDb]!='.' ){
|
43249
|
92 |
644 |
if( zPath[nDb]=='-' ){
|
43257
|
0 |
112 |
}else if( flags & SQLITE_OPEN_DELETEONCLOSE ){
|
43259
|
12 |
100 |
}else if( flags & SQLITE_OPEN_URI ){
|
43265
|
0 |
12 |
if( z ){
|
43325
|
192 |
12 |
int isNewJrnl = (isCreate && (
|
|
192 |
0 |
int isNewJrnl = (isCreate && (
|
43327
|
100 |
92 |
|| eType==SQLITE_OPEN_MAIN_JOURNAL
|
43328
|
0 |
100 |
|| eType==SQLITE_OPEN_WAL
|
43368
|
23 |
181 |
if( randomnessPid!=osGetpid(0) ){
|
43379
|
112 |
92 |
if( eType==SQLITE_OPEN_MAIN_DB ){
|
43382
|
0 |
112 |
if( pUnused ){
|
43386
|
0 |
112 |
if( !pUnused ){
|
43397
|
0 |
92 |
}else if( !zName ){
|
43401
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
43415
|
6 |
198 |
if( isReadonly ) openFlags |= O_RDONLY;
|
43416
|
198 |
6 |
if( isReadWrite ) openFlags |= O_RDWR;
|
43417
|
192 |
12 |
if( isCreate ) openFlags |= O_CREAT;
|
43418
|
0 |
204 |
if( isExclusive ) openFlags |= (O_EXCL|O_NOFOLLOW);
|
43421
|
204 |
0 |
if( fd<0 ){
|
43426
|
0 |
204 |
if( rc!=SQLITE_OK ){
|
43434
|
6 |
198 |
if( fd<0 ){
|
43435
|
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) ){
|
43439
|
6 |
0 |
}else if( errno!=EISDIR && isReadWrite ){
|
|
3 |
3 |
}else if( errno!=EISDIR && isReadWrite ){
|
43449
|
6 |
198 |
if( fd<0 ){
|
43451
|
6 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
43467
|
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 ){
|
43472
|
106 |
92 |
if( pOutFlags ){
|
43476
|
106 |
92 |
if( p->pPreallocatedUnused ){
|
43482
|
0 |
198 |
if( isDelete ){
|
43516
|
0 |
198 |
if( isDelete ) ctrlFlags |= UNIXFILE_DELETE;
|
43517
|
3 |
195 |
if( isReadonly ) ctrlFlags |= UNIXFILE_RDONLY;
|
43519
|
92 |
106 |
if( noLock ) ctrlFlags |= UNIXFILE_NOLOCK;
|
43520
|
92 |
106 |
if( isNewJrnl ) ctrlFlags |= UNIXFILE_DIRSYNC;
|
43521
|
8 |
190 |
if( flags & SQLITE_OPEN_URI ) ctrlFlags |= UNIXFILE_URI;
|
43562
|
6 |
198 |
if( rc!=SQLITE_OK ){
|
43581
|
0 |
92 |
if( osUnlink(zPath)==(-1) ){
|
43582
|
0 |
0 |
if( errno==ENOENT
|
43594
|
0 |
92 |
if( (dirSync & 1)!=0 ){
|
43597
|
0 |
0 |
if( rc==SQLITE_OK ){
|
43598
|
0 |
0 |
if( full_fsync(fd,0,0) ){
|
43635
|
672 |
0 |
if( flags==SQLITE_ACCESS_EXISTS ){
|
43637
|
152 |
520 |
*pResOut = 0==osStat(zPath, &buf) &&
|
|
152 |
0 |
*pResOut = 0==osStat(zPath, &buf) &&
|
43638
|
152 |
0 |
(!S_ISREG(buf.st_mode) || buf.st_size>0);
|
43670
|
88 |
440 |
if( zName[0]=='.' ){
|
43671
|
0 |
88 |
if( nName==1 ) return;
|
43672
|
0 |
88 |
if( zName[1]=='.' && nName==2 ){
|
|
0 |
0 |
if( zName[1]=='.' && nName==2 ){
|
43673
|
0 |
0 |
if( pPath->nUsed>1 ){
|
43675
|
0 |
0 |
while( pPath->zOut[--pPath->nUsed]!='/' ){}
|
43680
|
0 |
528 |
if( pPath->nUsed + nName + 2 >= pPath->nOut ){
|
43688
|
528 |
0 |
if( pPath->rc==SQLITE_OK ){
|
43693
|
60 |
468 |
if( osLstat(zIn, &buf)!=0 ){
|
43694
|
0 |
60 |
if( errno!=ENOENT ){
|
43697
|
0 |
468 |
}else if( S_ISLNK(buf.st_mode) ){
|
43700
|
0 |
0 |
if( pPath->nSymlink++ > SQLITE_MAX_SYMLINK ){
|
43705
|
0 |
0 |
if( got<=0 || got>=(ssize_t)sizeof(zLnk)-2 ){
|
|
0 |
0 |
if( got<=0 || got>=(ssize_t)sizeof(zLnk)-2 ){
|
43710
|
0 |
0 |
if( zLnk[0]=='/' ){
|
43731
|
4653 |
200 |
while( zPath[i] && zPath[i]!='/' ){ i++; }
|
|
4213 |
440 |
while( zPath[i] && zPath[i]!='/' ){ i++; }
|
43732
|
528 |
112 |
if( i>j ){
|
43736
|
440 |
200 |
}while( zPath[i++] );
|
43761
|
88 |
24 |
if( zPath[0]!='/' ){
|
43763
|
0 |
88 |
if( osGetcwd(zPwd, sizeof(zPwd)-2)==0 ){
|
43770
|
112 |
0 |
if( path.rc || path.nUsed<2 ) return SQLITE_CANTOPEN_BKPT;
|
|
0 |
112 |
if( path.rc || path.nUsed<2 ) return SQLITE_CANTOPEN_BKPT;
|
43771
|
0 |
112 |
if( path.nSymlink ) return SQLITE_OK_SYMLINK;
|
43798
|
0 |
0 |
if( zErr ){
|
43862
|
0 |
100 |
if( fd<0 ){
|
43870
|
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 );
|
45269
|
440 |
110 |
for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){
|
51738
|
0 |
0 |
if( p->zFName ){
|
51744
|
0 |
0 |
for(i=0; ALWAYS(i<memdb_g.nMemStore); i++){
|
51745
|
0 |
0 |
if( memdb_g.apMemStore[i]==p ){
|
51747
|
0 |
0 |
if( p->nRef==1 ){
|
51749
|
0 |
0 |
if( memdb_g.nMemStore==0 ){
|
51762
|
0 |
0 |
if( p->nRef<=0 ){
|
51763
|
0 |
0 |
if( p->mFlags & SQLITE_DESERIALIZE_FREEONCLOSE ){
|
51786
|
0 |
0 |
if( iOfst+iAmt>p->sz ){
|
51788
|
0 |
0 |
if( iOfst<p->sz ) memcpy(zBuf, p->aData+iOfst, p->sz - iOfst);
|
51802
|
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) ){
|
51805
|
0 |
0 |
if( newSz>p->szMax ){
|
51809
|
0 |
0 |
if( newSz>p->szMax ) newSz = p->szMax;
|
51811
|
0 |
0 |
if( pNew==0 ) return SQLITE_IOERR_NOMEM;
|
51828
|
0 |
0 |
if( NEVER(p->mFlags & SQLITE_DESERIALIZE_READONLY) ){
|
51834
|
0 |
0 |
if( iOfst+iAmt>p->sz ){
|
51836
|
0 |
0 |
if( iOfst+iAmt>p->szAlloc
|
51837
|
0 |
0 |
&& (rc = memdbEnlarge(p, iOfst+iAmt))!=SQLITE_OK
|
51842
|
0 |
0 |
if( iOfst>p->sz ) memset(p->aData+p->sz, 0, iOfst-p->sz);
|
51861
|
0 |
0 |
if( size>p->sz ){
|
51898
|
0 |
0 |
if( eLock<=pThis->eLock ) return SQLITE_OK;
|
51905
|
0 |
0 |
if( eLock>SQLITE_LOCK_SHARED && (p->mFlags & SQLITE_DESERIALIZE_READONLY) ){
|
|
0 |
0 |
if( eLock>SQLITE_LOCK_SHARED && (p->mFlags & SQLITE_DESERIALIZE_READONLY) ){
|
51911
|
0 |
0 |
if( p->nWrLock>0 ){
|
51922
|
0 |
0 |
if( ALWAYS(pThis->eLock==SQLITE_LOCK_SHARED) ){
|
51923
|
0 |
0 |
if( p->nWrLock>0 ){
|
51935
|
0 |
0 |
if( p->nRdLock>1 ){
|
51937
|
0 |
0 |
}else if( pThis->eLock==SQLITE_LOCK_SHARED ){
|
51944
|
0 |
0 |
if( rc==SQLITE_OK ) pThis->eLock = eLock;
|
51955
|
0 |
0 |
if( eLock>=pThis->eLock ) return SQLITE_OK;
|
51959
|
0 |
0 |
if( eLock==SQLITE_LOCK_SHARED ){
|
51960
|
0 |
0 |
if( ALWAYS(pThis->eLock>SQLITE_LOCK_SHARED) ){
|
51964
|
0 |
0 |
if( pThis->eLock>SQLITE_LOCK_SHARED ){
|
51994
|
0 |
0 |
if( op==SQLITE_FCNTL_VFSNAME ){
|
51998
|
0 |
0 |
if( op==SQLITE_FCNTL_SIZE_LIMIT ){
|
52000
|
0 |
0 |
if( iLimit<p->sz ){
|
52001
|
0 |
0 |
if( iLimit<0 ){
|
52044
|
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 ){
|
52082
|
0 |
0 |
if( szName>1 && (zName[0]=='/' || zName[0]=='\\') ){
|
|
0 |
0 |
if( szName>1 && (zName[0]=='/' || zName[0]=='\\') ){
|
|
0 |
0 |
if( szName>1 && (zName[0]=='/' || zName[0]=='\\') ){
|
52088
|
0 |
0 |
for(i=0; i<memdb_g.nMemStore; i++){
|
52089
|
0 |
0 |
if( strcmp(memdb_g.apMemStore[i]->zFName,zName)==0 ){
|
52094
|
0 |
0 |
if( p==0 ){
|
52097
|
0 |
0 |
if( p==0 ){
|
52103
|
0 |
0 |
if( apNew==0 ){
|
52116
|
0 |
0 |
if( p->pMutex==0 ){
|
52131
|
0 |
0 |
if( p==0 ){
|
52139
|
0 |
0 |
if( pOutFlags!=0 ){
|
52264
|
0 |
0 |
if( rc ) return 0;
|
52265
|
0 |
0 |
if( p->base.pMethods!=&memdb_io_methods ) return 0;
|
52268
|
0 |
0 |
if( pStore->zFName!=0 ) p = 0;
|
52299
|
0 |
0 |
if( zSchema==0 ) zSchema = db->aDb[0].zDbSName;
|
52302
|
0 |
0 |
if( piSize ) *piSize = -1;
|
52303
|
0 |
0 |
if( iDb<0 ) return 0;
|
52304
|
0 |
0 |
if( p ){
|
52307
|
0 |
0 |
if( piSize ) *piSize = pStore->sz;
|
52308
|
0 |
0 |
if( mFlags & SQLITE_SERIALIZE_NOCOPY ){
|
52312
|
0 |
0 |
if( pOut ) memcpy(pOut, pStore->aData, pStore->sz);
|
52317
|
0 |
0 |
if( pBt==0 ) return 0;
|
52320
|
0 |
0 |
rc = zSql ? sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0) : SQLITE_NOMEM;
|
52322
|
0 |
0 |
if( rc ) return 0;
|
52324
|
0 |
0 |
if( rc!=SQLITE_ROW ){
|
52328
|
0 |
0 |
if( piSize ) *piSize = sz;
|
52329
|
0 |
0 |
if( mFlags & SQLITE_SERIALIZE_NOCOPY ){
|
52333
|
0 |
0 |
if( pOut ){
|
52337
|
0 |
0 |
for(pgno=1; pgno<=nPage; pgno++){
|
52341
|
0 |
0 |
if( rc==SQLITE_OK ){
|
52380
|
0 |
0 |
if( zSchema==0 ) zSchema = db->aDb[0].zDbSName;
|
52383
|
0 |
0 |
if( iDb<2 && iDb!=0 ){
|
|
0 |
0 |
if( iDb<2 && iDb!=0 ){
|
52388
|
0 |
0 |
if( zSql==0 ){
|
52394
|
0 |
0 |
if( rc ) goto end_deserialize;
|
52399
|
0 |
0 |
if( rc!=SQLITE_DONE ){
|
52404
|
0 |
0 |
if( p==0 ){
|
52413
|
0 |
0 |
if( pStore->szMax<sqlite3GlobalConfig.mxMemdbSize ){
|
52422
|
0 |
0 |
if( pData && (mFlags & SQLITE_DESERIALIZE_FREEONCLOSE)!=0 ){
|
|
0 |
0 |
if( pData && (mFlags & SQLITE_DESERIALIZE_FREEONCLOSE)!=0 ){
|
52443
|
0 |
110 |
if( NEVER(pLower==0) ) return SQLITE_ERROR;
|
52450
|
0 |
110 |
if( sz<sizeof(MemFile) ) sz = sizeof(MemFile); /*NO_TEST*/
|
52576
|
1144 |
0 |
if( p ){
|
52590
|
1179 |
1677 |
if( i>=p->iSize ) return 0;
|
52591
|
0 |
1677 |
while( p->iDivisor ){
|
52595
|
0 |
0 |
if (!p) {
|
52599
|
1677 |
0 |
if( p->iSize<=BITVEC_NBIT ){
|
52603
|
0 |
0 |
while( p->u.aHash[h] ){
|
52604
|
0 |
0 |
if( p->u.aHash[h]==i ) return 1;
|
52611
|
1 |
28 |
return p!=0 && sqlite3BitvecTestNotNull(p,i);
|
|
0 |
1 |
return p!=0 && sqlite3BitvecTestNotNull(p,i);
|
52628
|
0 |
1374 |
if( p==0 ) return SQLITE_OK;
|
52632
|
0 |
1374 |
while((p->iSize > BITVEC_NBIT) && p->iDivisor) {
|
|
0 |
0 |
while((p->iSize > BITVEC_NBIT) && p->iDivisor) {
|
52635
|
0 |
0 |
if( p->u.apSub[bin]==0 ){
|
52637
|
0 |
0 |
if( p->u.apSub[bin]==0 ) return SQLITE_NOMEM_BKPT;
|
52641
|
1374 |
0 |
if( p->iSize<=BITVEC_NBIT ){
|
52649
|
0 |
0 |
if( !p->u.aHash[h] ){
|
52650
|
0 |
0 |
if (p->nSet<(BITVEC_NINT-1)) {
|
52659
|
0 |
0 |
if( p->u.aHash[h]==i ) return SQLITE_OK;
|
52661
|
0 |
0 |
if( h>=BITVEC_NINT ) h = 0;
|
52662
|
0 |
0 |
} while( p->u.aHash[h] );
|
52667
|
0 |
0 |
if( p->nSet>=BITVEC_MXHASH ){
|
52671
|
0 |
0 |
if( aiValues==0 ){
|
52678
|
0 |
0 |
for(j=0; j<BITVEC_NINT; j++){
|
52679
|
0 |
0 |
if( aiValues[j] ) rc |= sqlite3BitvecSet(p, aiValues[j]);
|
52698
|
0 |
0 |
if( p==0 ) return;
|
52701
|
0 |
0 |
while( p->iDivisor ){
|
52705
|
0 |
0 |
if (!p) {
|
52709
|
0 |
0 |
if( p->iSize<=BITVEC_NBIT ){
|
52717
|
0 |
0 |
for(j=0; j<BITVEC_NINT; j++){
|
52718
|
0 |
0 |
if( aiValues[j] && aiValues[j]!=(i+1) ){
|
|
0 |
0 |
if( aiValues[j] && aiValues[j]!=(i+1) ){
|
52721
|
0 |
0 |
while( p->u.aHash[h] ){
|
52723
|
0 |
0 |
if( h>=BITVEC_NINT ) h = 0;
|
52735
|
3989 |
1144 |
if( p==0 ) return;
|
52736
|
0 |
1144 |
if( p->iDivisor ){
|
52738
|
0 |
0 |
for(i=0; i<BITVEC_NPTR; i++){
|
52806
|
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;
|
52814
|
0 |
0 |
while( (op = aOp[pc])!=0 ){
|
52815
|
0 |
0 |
switch( op ){
|
52832
|
0 |
0 |
if( (--aOp[pc+1]) > 0 ) nx = 0;
|
52835
|
0 |
0 |
if( (op & 1)!=0 ){
|
52837
|
0 |
0 |
if( op!=5 ){
|
52838
|
0 |
0 |
if( sqlite3BitvecSet(pBitvec, i+1) ) goto bitvec_end;
|
52854
|
0 |
0 |
for(i=1; i<=sz; i++){
|
52855
|
0 |
0 |
if( (TESTBIT(pV,i))!=sqlite3BitvecTest(pBitvec,i) ){
|
53062
|
8978 |
2340 |
if( addRemove & PCACHE_DIRTYLIST_REMOVE ){
|
53067
|
1826 |
7152 |
if( p->pSynced==pPage ){
|
53071
|
6796 |
2182 |
if( pPage->pDirtyNext ){
|
53077
|
4352 |
4626 |
if( pPage->pDirtyPrev ){
|
53087
|
1649 |
2977 |
if( p->pDirty==0 ){ /*OPTIMIZATION-IF-TRUE*/
|
53093
|
8978 |
2340 |
if( addRemove & PCACHE_DIRTYLIST_ADD ){
|
53096
|
7329 |
1649 |
if( pPage->pDirtyNext ){
|
53101
|
231 |
1418 |
if( p->bPurgeable ){
|
53113
|
2206 |
6772 |
if( !p->pSynced
|
53114
|
1270 |
936 |
&& 0==(pPage->flags&PGHDR_NEED_SYNC) /*OPTIMIZATION-IF-FALSE*/
|
53127
|
823 |
5051 |
if( p->pCache->bPurgeable ){
|
53139
|
366 |
584 |
if( p->szCache>=0 ){
|
53150
|
0 |
584 |
if( n>1000000000 ) n = 1000000000;
|
53161
|
110 |
0 |
if( sqlite3GlobalConfig.pcache2.xInit==0 ){
|
53171
|
0 |
0 |
if( sqlite3GlobalConfig.pcache2.xShutdown ){
|
53222
|
366 |
366 |
if( pCache->szPage ){
|
53228
|
0 |
366 |
if( pNew==0 ) return SQLITE_NOMEM_BKPT;
|
53230
|
0 |
366 |
if( pCache->pCache ){
|
53312
|
0 |
0 |
if( pCache->eCreate==2 ) return 0;
|
53314
|
0 |
0 |
if( sqlite3PcachePagecount(pCache)>pCache->szSpill ){
|
53324
|
0 |
0 |
for(pPg=pCache->pSynced;
|
53325
|
0 |
0 |
pPg && (pPg->nRef || (pPg->flags&PGHDR_NEED_SYNC));
|
|
0 |
0 |
pPg && (pPg->nRef || (pPg->flags&PGHDR_NEED_SYNC));
|
53329
|
0 |
0 |
if( !pPg ){
|
53330
|
0 |
0 |
for(pPg=pCache->pDirtyTail; pPg && pPg->nRef; pPg=pPg->pDirtyPrev);
|
|
0 |
0 |
for(pPg=pCache->pDirtyTail; pPg && pPg->nRef; pPg=pPg->pDirtyPrev);
|
53332
|
0 |
0 |
if( pPg ){
|
53344
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){
|
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){
|
53350
|
0 |
0 |
return *ppPage==0 ? SQLITE_NOMEM_BKPT : SQLITE_OK;
|
53398
|
1334 |
11621 |
if( !pPgHdr->pPage ){
|
53414
|
10454 |
1172 |
if( (--p->nRef)==0 ){
|
53415
|
3816 |
6638 |
if( p->flags&PGHDR_CLEAN ){
|
53442
|
0 |
0 |
if( p->flags&PGHDR_DIRTY ){
|
53456
|
2340 |
175 |
if( p->flags & (PGHDR_CLEAN|PGHDR_DONT_WRITE) ){ /*OPTIMIZATION-IF-FALSE*/
|
53458
|
2340 |
0 |
if( p->flags & PGHDR_CLEAN ){
|
53482
|
2058 |
282 |
if( p->nRef==0 ){
|
53493
|
2251 |
1012 |
while( (p = pCache->pDirty)!=0 ){
|
53504
|
432 |
271 |
for(p=pCache->pDirty; p; p=p->pDirtyNext){
|
53515
|
217 |
90 |
for(p=pCache->pDirty; p; p=p->pDirtyNext){
|
53532
|
0 |
0 |
if( pOther ){
|
53541
|
0 |
0 |
if( (p->flags&PGHDR_DIRTY) && (p->flags&PGHDR_NEED_SYNC) ){
|
|
0 |
0 |
if( (p->flags&PGHDR_DIRTY) && (p->flags&PGHDR_NEED_SYNC) ){
|
53557
|
1568 |
366 |
if( pCache->pCache ){
|
53561
|
521 |
1568 |
for(p=pCache->pDirty; p; p=pNext){
|
53568
|
89 |
432 |
if( p->pgno>pgno ){
|
53573
|
388 |
1180 |
if( pgno==0 && pCache->nRefSum ){
|
|
5 |
383 |
if( pgno==0 && pCache->nRefSum ){
|
53576
|
5 |
0 |
if( ALWAYS(pPage1) ){ /* Page 1 is always available in cache, because
|
53611
|
91 |
89 |
if( pA->pgno<pB->pgno ){
|
53615
|
69 |
22 |
if( pA==0 ){
|
53623
|
58 |
31 |
if( pB==0 ){
|
53647
|
217 |
90 |
while( pIn ){
|
53651
|
333 |
0 |
for(i=0; ALWAYS(i<N_SORT_BUCKET-1); i++){
|
53652
|
217 |
116 |
if( a[i]==0 ){
|
53660
|
0 |
217 |
if( NEVER(i==N_SORT_BUCKET-1) ){
|
53668
|
2790 |
90 |
for(i=1; i<N_SORT_BUCKET; i++){
|
53669
|
2702 |
88 |
if( a[i]==0 ) continue;
|
53670
|
11 |
77 |
p = p ? pcacheMergeDirtyList(p, a[i]) : a[i];
|
53680
|
217 |
90 |
for(p=pCache->pDirty; p; p=p->pDirtyNext){
|
53738
|
0 |
0 |
if( mxPage ){
|
53739
|
0 |
0 |
if( mxPage<0 ){
|
53745
|
0 |
0 |
if( res<p->szSpill ) res = p->szSpill;
|
53771
|
0 |
0 |
for(pDirty=pCache->pDirty; pDirty; pDirty=pDirty->pDirtyNext) nDirty++;
|
53772
|
0 |
0 |
return nCache ? (int)(((i64)nDirty * 100) / nCache) : 0;
|
54075
|
110 |
0 |
if( pcache1.isInit ){
|
54077
|
110 |
0 |
if( pBuf==0 ) sz = n = 0;
|
54078
|
110 |
0 |
if( n==0 ) sz = 0;
|
54082
|
110 |
0 |
pcache1.nReserve = n>90 ? 10 : (n/10 + 1);
|
54086
|
0 |
110 |
while( n-- ){
|
54103
|
0 |
274 |
if( pcache1.nInitPage==0 ) return 0;
|
54105
|
171 |
103 |
if( pCache->nMax<3 ) return 0;
|
54107
|
103 |
0 |
if( pcache1.nInitPage>0 ){
|
54112
|
0 |
103 |
if( szBulk > pCache->szAlloc*(i64)pCache->nMax ){
|
54117
|
103 |
0 |
if( zBulk ){
|
54129
|
1957 |
103 |
}while( --nBulk );
|
54146
|
0 |
1663 |
if( nByte<=pcache1.szSlot ){
|
54149
|
0 |
0 |
if( p ){
|
54159
|
1663 |
0 |
if( p==0 ){
|
54165
|
1663 |
0 |
if( p ){
|
54182
|
372 |
1659 |
if( p==0 ) return;
|
54183
|
1659 |
0 |
if( SQLITE_WITHIN(p, pcache1.pStart, pcache1.pEnd) ){
|
|
0 |
1659 |
if( SQLITE_WITHIN(p, pcache1.pStart, pcache1.pEnd) ){
|
54236
|
1190 |
144 |
if( pCache->pFree || (pCache->nPage==0 && pcache1InitBulk(pCache)) ){
|
|
274 |
916 |
if( pCache->pFree || (pCache->nPage==0 && pcache1InitBulk(pCache)) ){
|
|
103 |
171 |
if( pCache->pFree || (pCache->nPage==0 && pcache1InitBulk(pCache)) ){
|
54250
|
8 |
1079 |
if( benignMalloc ){ sqlite3BeginBenignMalloc(); }
|
54252
|
8 |
1079 |
if( benignMalloc ){ sqlite3EndBenignMalloc(); }
|
54256
|
0 |
1087 |
if( pPg==0 ) return 0;
|
54276
|
243 |
1087 |
if( p->isBulkLocal ){
|
54320
|
0 |
147 |
if( pcache1.nSlot && (pCache->szPage+pCache->szExtra)<=pcache1.szSlot ){
|
|
0 |
0 |
if( pcache1.nSlot && (pCache->szPage+pCache->szExtra)<=pcache1.szSlot ){
|
54344
|
366 |
2 |
if( nNew<256 ){
|
54349
|
2 |
366 |
if( p->nHash ){ sqlite3BeginBenignMalloc(); }
|
54351
|
2 |
366 |
if( p->nHash ){ sqlite3EndBenignMalloc(); }
|
54353
|
368 |
0 |
if( apNew ){
|
54354
|
512 |
368 |
for(i=0; i<p->nHash; i++){
|
54357
|
512 |
512 |
while( (pPage = pNext)!=0 ){
|
54409
|
0 |
0 |
for(pp=&pCache->apHash[h]; (*pp)!=pPage; pp=&(*pp)->pNext);
|
54413
|
0 |
0 |
if( freeFlag ) pcache1FreePage(pPage);
|
54424
|
0 |
729 |
while( pGroup->nPurgeable>pGroup->nMaxPage
|
54425
|
0 |
0 |
&& (p=pGroup->lru.pLruPrev)->isAnchor==0
|
54432
|
682 |
47 |
if( pCache->nPage==0 && pCache->pBulk ){
|
|
101 |
581 |
if( pCache->nPage==0 && pCache->pBulk ){
|
54454
|
288 |
0 |
if( pCache->iMaxKey - iLimit < pCache->nHash ){
|
54473
|
1330 |
1349 |
while( (pPage = *pp)!=0 ){
|
54474
|
1330 |
0 |
if( pPage->iKey>=iLimit ){
|
54477
|
251 |
1079 |
if( PAGE_IS_UNPINNED(pPage) ) pcache1PinPage(pPage);
|
54484
|
288 |
1061 |
if( h==iStop ) break;
|
54520
|
0 |
110 |
|| sqlite3GlobalConfig.bCoreMutex>0;
|
|
0 |
0 |
|| sqlite3GlobalConfig.bCoreMutex>0;
|
54526
|
110 |
0 |
if( sqlite3GlobalConfig.bCoreMutex ){
|
54531
|
110 |
0 |
if( pcache1.separateCache
|
54532
|
110 |
0 |
&& sqlite3GlobalConfig.nPage!=0
|
54533
|
110 |
0 |
&& sqlite3GlobalConfig.pPage==0
|
54573
|
366 |
0 |
if( pCache ){
|
54574
|
366 |
0 |
if( pcache1.separateCache ){
|
54581
|
366 |
0 |
if( pGroup->lru.isAnchor==0 ){
|
54591
|
159 |
207 |
if( bPurgeable ){
|
54600
|
0 |
366 |
if( pCache->nHash==0 ){
|
54617
|
365 |
585 |
if( pCache->bPurgeable ){
|
54621
|
0 |
365 |
if( n > 0x7fff0000 - pGroup->nMaxPage + pCache->nMax ){
|
54640
|
0 |
0 |
if( pCache->bPurgeable ){
|
54687
|
104 |
1230 |
if( createFlag==1 && (
|
|
104 |
0 |
if( createFlag==1 && (
|
54689
|
104 |
0 |
|| nPinned>=pCache->n90pct
|
54690
|
0 |
104 |
|| (pcache1UnderMemoryPressure(pCache) && pCache->nRecyclable<nPinned)
|
|
0 |
0 |
|| (pcache1UnderMemoryPressure(pCache) && pCache->nRecyclable<nPinned)
|
54695
|
2 |
1332 |
if( pCache->nPage>=pCache->nHash ) pcache1ResizeHash(pCache);
|
54699
|
255 |
1079 |
if( pCache->bPurgeable
|
54700
|
43 |
212 |
&& !pGroup->lru.pLruPrev->isAnchor
|
54701
|
43 |
0 |
&& ((pCache->nPage+1>=pCache->nMax) || pcache1UnderMemoryPressure(pCache))
|
|
0 |
43 |
&& ((pCache->nPage+1>=pCache->nMax) || pcache1UnderMemoryPressure(pCache))
|
54709
|
0 |
0 |
if( pOther->szAlloc != pCache->szAlloc ){
|
54720
|
1334 |
0 |
if( !pPage ){
|
54724
|
1334 |
0 |
if( pPage ){
|
54735
|
1326 |
8 |
if( iKey>pCache->iMaxKey ){
|
54811
|
10294 |
1334 |
while( pPage && pPage->iKey!=iKey ){ pPage = pPage->pNext; }
|
|
2 |
10292 |
while( pPage && pPage->iKey!=iKey ){ pPage = pPage->pNext; }
|
54817
|
10292 |
1334 |
if( pPage ){
|
54818
|
568 |
9724 |
if( PAGE_IS_UNPINNED(pPage) ){
|
54823
|
1334 |
0 |
}else if( createFlag ){
|
54895
|
823 |
0 |
if( reuseUnlikely || pGroup->nPurgeable>pGroup->nMaxPage ){
|
|
0 |
823 |
if( reuseUnlikely || pGroup->nPurgeable>pGroup->nMaxPage ){
|
54931
|
0 |
0 |
while( (*pp)!=pPage ){
|
54941
|
0 |
0 |
if( iNew>pCache->iMaxKey ){
|
54958
|
288 |
1280 |
if( iLimit<=pCache->iMaxKey ){
|
54975
|
0 |
364 |
if( pCache->nPage ) pcache1TruncateUnsafe(pCache, 0);
|
55214
|
8 |
0 |
if( p ){
|
55237
|
1 |
9 |
for(pChunk=p->pChunk; pChunk; pChunk = pNextChunk){
|
55269
|
1 |
10 |
if( p->nFresh==0 ){ /*OPTIMIZATION-IF-FALSE*/
|
55274
|
0 |
1 |
if( pNew==0 ){
|
55300
|
0 |
11 |
if( pEntry==0 ) return;
|
55304
|
6 |
5 |
if( pLast ){
|
55305
|
0 |
6 |
if( rowid<=pLast->v ){ /*OPTIMIZATION-IF-FALSE*/
|
55335
|
0 |
0 |
if( pA->v<=pB->v ){
|
55336
|
0 |
0 |
if( pA->v<pB->v ) pTail = pTail->pRight = pA;
|
55338
|
0 |
0 |
if( pA==0 ){
|
55345
|
0 |
0 |
if( pB==0 ){
|
55363
|
0 |
0 |
while( pIn ){
|
55366
|
0 |
0 |
for(i=0; aBucket[i]; i++){
|
55374
|
0 |
0 |
for(i=1; i<sizeof(aBucket)/sizeof(aBucket[0]); i++){
|
55375
|
0 |
0 |
if( aBucket[i]==0 ) continue;
|
55376
|
0 |
0 |
pIn = pIn ? rowSetEntryMerge(pIn, aBucket[i]) : aBucket[i];
|
55393
|
0 |
0 |
if( pIn->pLeft ){
|
55400
|
0 |
0 |
if( pIn->pRight ){
|
55428
|
0 |
0 |
if( *ppList==0 ){ /*OPTIMIZATION-IF-TRUE*/
|
55432
|
0 |
0 |
if( iDepth>1 ){ /*OPTIMIZATION-IF-TRUE*/
|
55438
|
0 |
0 |
if( p==0 ){ /*OPTIMIZATION-IF-FALSE*/
|
55467
|
0 |
0 |
for(iDepth=1; pList; iDepth++){
|
55495
|
2 |
0 |
if( (p->rsFlags & ROWSET_NEXT)==0 ){ /*OPTIMIZATION-IF-FALSE*/
|
55496
|
0 |
2 |
if( (p->rsFlags & ROWSET_SORTED)==0 ){ /*OPTIMIZATION-IF-FALSE*/
|
55503
|
1 |
1 |
if( p->pEntry ){
|
55506
|
1 |
0 |
if( p->pEntry==0 ){ /*OPTIMIZATION-IF-TRUE*/
|
55533
|
6 |
6 |
if( iBatch!=pRowSet->iBatch ){ /*OPTIMIZATION-IF-FALSE*/
|
55535
|
0 |
6 |
if( p ){
|
55537
|
0 |
0 |
if( (pRowSet->rsFlags & ROWSET_SORTED)==0 ){ /*OPTIMIZATION-IF-FALSE*/
|
55541
|
0 |
0 |
for(pTree = pRowSet->pForest; pTree; pTree=pTree->pRight){
|
55543
|
0 |
0 |
if( pTree->pLeft==0 ){
|
55553
|
0 |
0 |
if( pTree==0 ){
|
55555
|
0 |
0 |
if( pTree ){
|
55571
|
0 |
12 |
for(pTree = pRowSet->pForest; pTree; pTree=pTree->pRight){
|
55573
|
0 |
0 |
while( p ){
|
55574
|
0 |
0 |
if( p->v<iRowid ){
|
55576
|
0 |
0 |
}else if( p->v>iRowid ){
|
56794
|
17 |
705 |
if( pPager->errCode ){
|
56797
|
0 |
705 |
}else if( USEFETCH(pPager) ){
|
56819
|
437 |
328 |
for(i=0; i<pPager->nSavepoint; i++){
|
56821
|
367 |
70 |
if( p->nOrig>=pgno && 0==sqlite3BitvecTestNotNull(p->pInSavepoint, pgno) ){
|
|
55 |
312 |
if( p->nOrig>=pgno && 0==sqlite3BitvecTestNotNull(p->pInSavepoint, pgno) ){
|
56822
|
0 |
55 |
for(i=i+1; i<pPager->nSavepoint; i++){
|
56850
|
274 |
0 |
if( rc==SQLITE_OK ){
|
56887
|
541 |
313 |
if( isOpen(pPager->fd) ){
|
56889
|
541 |
0 |
rc = pPager->noLock ? SQLITE_OK : sqlite3OsUnlock(pPager->fd, eLock);
|
56890
|
541 |
0 |
if( pPager->eLock!=UNKNOWN_LOCK ){
|
56913
|
2127 |
710 |
if( pPager->eLock<eLock || pPager->eLock==UNKNOWN_LOCK ){
|
|
0 |
2127 |
if( pPager->eLock<eLock || pPager->eLock==UNKNOWN_LOCK ){
|
56914
|
710 |
0 |
rc = pPager->noLock ? SQLITE_OK : sqlite3OsLock(pPager->fd, eLock);
|
56915
|
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) ){
|
57056
|
62 |
0 |
if( SQLITE_OK!=(rc = sqlite3OsFileSize(pJrnl, &szJ))
|
57057
|
62 |
0 |
|| szJ<16
|
57058
|
62 |
0 |
|| SQLITE_OK!=(rc = read32bits(pJrnl, szJ-16, &len))
|
57059
|
36 |
26 |
|| len>=nSuper
|
57060
|
36 |
0 |
|| len>szJ-16
|
57061
|
0 |
36 |
|| len==0
|
57062
|
0 |
0 |
|| SQLITE_OK!=(rc = read32bits(pJrnl, szJ-12, &cksum))
|
57063
|
0 |
0 |
|| SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, aMagic, 8, szJ-8))
|
57064
|
0 |
0 |
|| memcmp(aMagic, aJournalMagic, 8)
|
57065
|
0 |
0 |
|| SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, zSuper, len, szJ-16-len))
|
57071
|
0 |
0 |
for(u=0; u<len; u++){
|
57074
|
0 |
0 |
if( cksum ){
|
57106
|
121 |
1118 |
if( c ){
|
57140
|
0 |
0 |
if( pPager->journalOff ){
|
57144
|
0 |
0 |
if( doTruncate || iLimit==0 ){
|
|
0 |
0 |
if( doTruncate || iLimit==0 ){
|
57150
|
0 |
0 |
if( rc==SQLITE_OK && !pPager->noSync ){
|
|
0 |
0 |
if( rc==SQLITE_OK && !pPager->noSync ){
|
57160
|
0 |
0 |
if( rc==SQLITE_OK && iLimit>0 ){
|
|
0 |
0 |
if( rc==SQLITE_OK && iLimit>0 ){
|
57163
|
0 |
0 |
if( rc==SQLITE_OK && sz>iLimit ){
|
|
0 |
0 |
if( rc==SQLITE_OK && sz>iLimit ){
|
57195
|
1087 |
0 |
if( nHeader>JOURNAL_HDR_SZ(pPager) ){
|
57203
|
0 |
1087 |
for(ii=0; ii<pPager->nSavepoint; ii++){
|
57204
|
0 |
0 |
if( pPager->aSavepoint[ii].iHdrOffset==0 ){
|
57232
|
92 |
995 |
if( pPager->noSync || (pPager->journalMode==PAGER_JOURNALMODE_MEMORY)
|
|
92 |
0 |
if( pPager->noSync || (pPager->journalMode==PAGER_JOURNALMODE_MEMORY)
|
57233
|
0 |
92 |
|| (sqlite3OsDeviceCharacteristics(pPager->fd)&SQLITE_IOCAP_SAFE_APPEND)
|
57277
|
2174 |
0 |
for(nWrite=0; rc==SQLITE_OK&&nWrite<JOURNAL_HDR_SZ(pPager); nWrite+=nHeader){
|
|
1087 |
1087 |
for(nWrite=0; rc==SQLITE_OK&&nWrite<JOURNAL_HDR_SZ(pPager); nWrite+=nHeader){
|
57322
|
31 |
31 |
if( pPager->journalOff+JOURNAL_HDR_SZ(pPager) > journalSize ){
|
57332
|
31 |
0 |
if( isHot || iHdrOff!=pPager->journalHdr ){
|
|
0 |
31 |
if( isHot || iHdrOff!=pPager->journalHdr ){
|
57334
|
0 |
0 |
if( rc ){
|
57337
|
0 |
0 |
if( memcmp(aMagic, aJournalMagic, sizeof(aMagic))!=0 ){
|
57346
|
31 |
0 |
if( SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+8, pNRec))
|
57347
|
31 |
0 |
|| SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+12, &pPager->cksumInit))
|
57348
|
0 |
31 |
|| SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+16, pDbSize))
|
57353
|
31 |
0 |
if( pPager->journalOff==0 ){
|
57358
|
31 |
0 |
if( SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+20, &iSectorSize))
|
57359
|
0 |
31 |
|| SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+24, &iPageSize))
|
57368
|
0 |
31 |
if( iPageSize==0 ){
|
57377
|
31 |
0 |
if( iPageSize<512 || iSectorSize<32
|
|
31 |
0 |
if( iPageSize<512 || iSectorSize<32
|
57378
|
31 |
0 |
|| iPageSize>SQLITE_MAX_PAGE_SIZE || iSectorSize>MAX_SECTOR_SIZE
|
|
31 |
0 |
|| iPageSize>SQLITE_MAX_PAGE_SIZE || iSectorSize>MAX_SECTOR_SIZE
|
57379
|
31 |
0 |
|| ((iPageSize-1)&iPageSize)!=0 || ((iSectorSize-1)&iSectorSize)!=0
|
|
0 |
31 |
|| ((iPageSize-1)&iPageSize)!=0 || ((iSectorSize-1)&iSectorSize)!=0
|
57439
|
0 |
90 |
if( !zSuper
|
57440
|
0 |
0 |
|| pPager->journalMode==PAGER_JOURNALMODE_MEMORY
|
57441
|
0 |
0 |
|| !isOpen(pPager->jfd)
|
57449
|
0 |
0 |
for(nSuper=0; zSuper[nSuper]; nSuper++){
|
57457
|
0 |
0 |
if( pPager->fullSync ){
|
57465
|
0 |
0 |
if( (0 != (rc = write32bits(pPager->jfd, iHdrOff, PAGER_SJ_PGNO(pPager))))
|
57466
|
0 |
0 |
|| (0 != (rc = sqlite3OsWrite(pPager->jfd, zSuper, nSuper, iHdrOff+4)))
|
57467
|
0 |
0 |
|| (0 != (rc = write32bits(pPager->jfd, iHdrOff+4+nSuper, nSuper)))
|
57468
|
0 |
0 |
|| (0 != (rc = write32bits(pPager->jfd, iHdrOff+4+nSuper+4, cksum)))
|
57469
|
0 |
0 |
|| (0 != (rc = sqlite3OsWrite(pPager->jfd, aJournalMagic, 8,
|
57486
|
0 |
0 |
if( SQLITE_OK==(rc = sqlite3OsFileSize(pPager->jfd, &jrnlSize))
|
57487
|
0 |
0 |
&& jrnlSize>pPager->journalOff
|
57517
|
1 |
3937 |
for(ii=0; ii<pPager->nSavepoint; ii++){
|
57520
|
3083 |
854 |
if( !pPager->exclusiveMode || sqlite3JournalIsInMemory(pPager->sjfd) ){
|
|
17 |
3066 |
if( !pPager->exclusiveMode || sqlite3JournalIsInMemory(pPager->sjfd) ){
|
57538
|
133 |
2362 |
for(ii=0; ii<pPager->nSavepoint; ii++){
|
57540
|
63 |
70 |
if( pgno<=p->nOrig ){
|
57577
|
0 |
2744 |
if( pagerUseWal(pPager) ){
|
57581
|
702 |
2042 |
}else if( !pPager->exclusiveMode ){
|
57583
|
442 |
260 |
int iDc = isOpen(pPager->fd)?sqlite3OsDeviceCharacteristics(pPager->fd):0;
|
57596
|
0 |
702 |
if( 0==(iDc & SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN)
|
57597
|
0 |
0 |
|| 1!=(pPager->journalMode & 5)
|
57608
|
0 |
702 |
if( rc!=SQLITE_OK && pPager->eState==PAGER_ERROR ){
|
|
0 |
0 |
if( rc!=SQLITE_OK && pPager->eState==PAGER_ERROR ){
|
57626
|
17 |
2727 |
if( pPager->errCode ){
|
57627
|
0 |
17 |
if( pPager->tempFile==0 ){
|
57634
|
0 |
17 |
if( USEFETCH(pPager) ) sqlite3OsUnfetch(pPager->fd, 0, 0);
|
57671
|
1123 |
0 |
if( rc2==SQLITE_FULL || rc2==SQLITE_IOERR ){
|
|
0 |
1123 |
if( rc2==SQLITE_FULL || rc2==SQLITE_IOERR ){
|
57698
|
189 |
1237 |
if( pPager->tempFile==0 ) return 1;
|
57699
|
74 |
1163 |
if( !bCommit ) return 0;
|
57700
|
1163 |
0 |
if( !isOpen(pPager->fd) ) return 0;
|
57776
|
389 |
1140 |
if( pPager->eState<PAGER_WRITER_LOCKED && pPager->eLock<RESERVED_LOCK ){
|
|
336 |
53 |
if( pPager->eState<PAGER_WRITER_LOCKED && pPager->eLock<RESERVED_LOCK ){
|
57784
|
1087 |
106 |
if( isOpen(pPager->jfd) ){
|
57788
|
995 |
92 |
if( sqlite3JournalIsInMemory(pPager->jfd) ){
|
57791
|
0 |
92 |
}else if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE ){
|
57792
|
0 |
0 |
if( pPager->journalOff==0 ){
|
57796
|
0 |
0 |
if( rc==SQLITE_OK && pPager->fullSync ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pPager->fullSync ){
|
57806
|
92 |
0 |
}else if( pPager->journalMode==PAGER_JOURNALMODE_PERSIST
|
57807
|
0 |
92 |
|| (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL)
|
|
0 |
0 |
|| (pPager->exclusiveMode && pPager->journalMode!=PAGER_JOURNALMODE_WAL)
|
57809
|
0 |
0 |
rc = zeroJournalHdr(pPager, hasSuper||pPager->tempFile);
|
|
0 |
0 |
rc = zeroJournalHdr(pPager, hasSuper||pPager->tempFile);
|
57824
|
92 |
0 |
if( bDelete ){
|
57844
|
1193 |
0 |
if( rc==SQLITE_OK ){
|
57845
|
370 |
823 |
if( MEMDB || pagerFlushOnCommit(pPager, bCommit) ){
|
|
99 |
271 |
if( MEMDB || pagerFlushOnCommit(pPager, bCommit) ){
|
57853
|
0 |
1193 |
if( pagerUseWal(pPager) ){
|
57860
|
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 ){
|
57871
|
1193 |
0 |
if( rc==SQLITE_OK && bCommit ){
|
|
1079 |
114 |
if( rc==SQLITE_OK && bCommit ){
|
57873
|
1079 |
0 |
if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
|
57876
|
152 |
1041 |
if( !pPager->exclusiveMode
|
57877
|
0 |
152 |
&& (!pagerUseWal(pPager) || sqlite3WalExclusiveMode(pPager->pWal, 0))
|
|
0 |
0 |
&& (!pagerUseWal(pPager) || sqlite3WalExclusiveMode(pPager->pWal, 0))
|
57884
|
1193 |
0 |
return (rc==SQLITE_OK?rc2:rc);
|
57905
|
2518 |
17 |
if( pPager->eState!=PAGER_ERROR && pPager->eState!=PAGER_OPEN ){
|
|
2414 |
104 |
if( pPager->eState!=PAGER_ERROR && pPager->eState!=PAGER_OPEN ){
|
57907
|
0 |
2414 |
if( pPager->eState>=PAGER_WRITER_LOCKED ){
|
57911
|
389 |
2025 |
}else if( !pPager->exclusiveMode ){
|
57941
|
26720 |
1336 |
while( i>0 ){
|
58023
|
28 |
1 |
jfd = isMainJrnl ? pPager->jfd : pPager->sjfd;
|
58025
|
0 |
29 |
if( rc!=SQLITE_OK ) return rc;
|
58027
|
0 |
29 |
if( rc!=SQLITE_OK ) return rc;
|
58035
|
29 |
0 |
if( pgno==0 || pgno==PAGER_SJ_PGNO(pPager) ){
|
|
0 |
29 |
if( pgno==0 || pgno==PAGER_SJ_PGNO(pPager) ){
|
58039
|
29 |
0 |
if( pgno>(Pgno)pPager->dbSize || sqlite3BitvecTest(pDone, pgno) ){
|
|
0 |
29 |
if( pgno>(Pgno)pPager->dbSize || sqlite3BitvecTest(pDone, pgno) ){
|
58042
|
28 |
1 |
if( isMainJrnl ){
|
58044
|
0 |
28 |
if( rc ) return rc;
|
58045
|
28 |
0 |
if( !isSavepnt && pager_cksum(pPager, (u8*)aData)!=cksum ){
|
|
0 |
28 |
if( !isSavepnt && pager_cksum(pPager, (u8*)aData)!=cksum ){
|
58053
|
1 |
28 |
if( pDone && (rc = sqlite3BitvecSet(pDone, pgno))!=SQLITE_OK ){
|
|
0 |
1 |
if( pDone && (rc = sqlite3BitvecSet(pDone, pgno))!=SQLITE_OK ){
|
58059
|
1 |
28 |
if( pgno==1 && pPager->nReserve!=((u8*)aData)[20] ){
|
|
0 |
1 |
if( pgno==1 && pPager->nReserve!=((u8*)aData)[20] ){
|
58098
|
0 |
29 |
if( pagerUseWal(pPager) ){
|
58109
|
28 |
1 |
if( isMainJrnl ){
|
58110
|
2 |
26 |
isSynced = pPager->noSync || (*pOffset <= pPager->journalHdr);
|
|
0 |
2 |
isSynced = pPager->noSync || (*pOffset <= pPager->journalHdr);
|
58112
|
1 |
0 |
isSynced = (pPg==0 || 0==(pPg->flags & PGHDR_NEED_SYNC));
|
|
0 |
1 |
isSynced = (pPg==0 || 0==(pPg->flags & PGHDR_NEED_SYNC));
|
58114
|
2 |
27 |
if( isOpen(pPager->fd)
|
58115
|
2 |
0 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN)
|
|
0 |
2 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN)
|
58116
|
0 |
0 |
&& isSynced
|
58130
|
0 |
0 |
if( pgno>pPager->dbFileSize ){
|
58133
|
0 |
0 |
if( pPager->pBackup ){
|
58136
|
1 |
28 |
}else if( !isMainJrnl && pPg==0 ){
|
|
0 |
1 |
}else if( !isMainJrnl && pPg==0 ){
|
58159
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
58162
|
29 |
0 |
if( pPg ){
|
58181
|
1 |
28 |
if( pgno==1 ){
|
58248
|
0 |
0 |
if( !pSuper ){
|
58256
|
0 |
0 |
if( rc!=SQLITE_OK ) goto delsuper_out;
|
58264
|
0 |
0 |
if( rc!=SQLITE_OK ) goto delsuper_out;
|
58267
|
0 |
0 |
if( !zFree ){
|
58275
|
0 |
0 |
if( rc!=SQLITE_OK ) goto delsuper_out;
|
58280
|
0 |
0 |
while( (zJournal-zSuperJournal)<nSuperJournal ){
|
58283
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
58286
|
0 |
0 |
if( exists ){
|
58297
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
58303
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
58307
|
0 |
0 |
c = zSuperPtr[0]!=0 && strcmp(zSuperPtr, zSuper)==0;
|
|
0 |
0 |
c = zSuperPtr[0]!=0 && strcmp(zSuperPtr, zSuper)==0;
|
58308
|
0 |
0 |
if( c ){
|
58321
|
0 |
0 |
if( pSuper ){
|
58357
|
2 |
29 |
if( isOpen(pPager->fd)
|
58358
|
2 |
0 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN)
|
|
0 |
2 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN)
|
58366
|
0 |
0 |
if( rc==SQLITE_OK && currentSize!=newSize ){
|
|
0 |
0 |
if( rc==SQLITE_OK && currentSize!=newSize ){
|
58367
|
0 |
0 |
if( currentSize>newSize ){
|
58369
|
0 |
0 |
}else if( (currentSize+szPage)<=newSize ){
|
58377
|
0 |
0 |
if( rc==SQLITE_OK ){
|
58391
|
0 |
0 |
if( iRet<32 ){
|
58393
|
0 |
0 |
}else if( iRet>MAX_SECTOR_SIZE ){
|
58426
|
211 |
289 |
if( pPager->tempFile
|
58427
|
211 |
0 |
|| (sqlite3OsDeviceCharacteristics(pPager->fd) &
|
58514
|
0 |
31 |
if( rc!=SQLITE_OK ){
|
58531
|
31 |
0 |
if( rc==SQLITE_OK && zSuper[0] ){
|
|
0 |
31 |
if( rc==SQLITE_OK && zSuper[0] ){
|
58535
|
31 |
0 |
if( rc!=SQLITE_OK || !res ){
|
|
31 |
0 |
if( rc!=SQLITE_OK || !res ){
|
58552
|
31 |
31 |
if( rc!=SQLITE_OK ){
|
58553
|
31 |
0 |
if( rc==SQLITE_DONE ){
|
58564
|
29 |
2 |
if( nRec==0xffffffff ){
|
58583
|
7 |
24 |
if( nRec==0 && !isHot &&
|
|
7 |
0 |
if( nRec==0 && !isHot &&
|
|
7 |
0 |
if( nRec==0 && !isHot &&
|
58591
|
31 |
0 |
if( pPager->journalOff==JOURNAL_HDR_SZ(pPager) ){
|
58593
|
0 |
31 |
if( rc!=SQLITE_OK ){
|
58597
|
0 |
31 |
if( pPager->mxPgno<mxPg ){
|
58605
|
28 |
31 |
for(u=0; u<nRec; u++){
|
58606
|
0 |
28 |
if( needPagerReset ){
|
58611
|
28 |
0 |
if( rc==SQLITE_OK ){
|
58614
|
0 |
0 |
if( rc==SQLITE_DONE ){
|
58617
|
0 |
0 |
}else if( rc==SQLITE_IOERR_SHORT_READ ){
|
58640
|
31 |
0 |
if( rc==SQLITE_OK ){
|
58663
|
31 |
0 |
if( rc==SQLITE_OK ){
|
58672
|
31 |
0 |
if( rc==SQLITE_OK
|
58673
|
31 |
0 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN)
|
|
0 |
31 |
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN)
|
58677
|
31 |
0 |
if( rc==SQLITE_OK ){
|
58681
|
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 ){
|
58690
|
0 |
31 |
if( isHot && nPlayback ){
|
|
0 |
0 |
if( isHot && nPlayback ){
|
58726
|
0 |
88 |
if( pagerUseWal(pPager) ){
|
58728
|
0 |
0 |
if( rc ) return rc;
|
58730
|
0 |
88 |
if( iFrame ){
|
58737
|
0 |
88 |
if( rc==SQLITE_IOERR_SHORT_READ ){
|
58742
|
45 |
43 |
if( pPg->pgno==1 ){
|
58743
|
0 |
45 |
if( rc ){
|
58781
|
0 |
180 |
if( NEVER(pPg==0) ) return;
|
58814
|
0 |
0 |
if( pPg ){
|
58815
|
0 |
0 |
if( sqlite3PcachePageRefcount(pPg)==1 ){
|
58819
|
0 |
0 |
if( rc==SQLITE_OK ){
|
58856
|
0 |
0 |
while( pList && rc==SQLITE_OK ){
|
|
0 |
0 |
while( pList && rc==SQLITE_OK ){
|
58894
|
0 |
0 |
if( isCommit ){
|
58901
|
0 |
0 |
for(p=pList; (*ppNext = p)!=0; p=p->pDirty){
|
58902
|
0 |
0 |
if( p->pgno<=nTruncate ){
|
58913
|
0 |
0 |
if( pList->pgno==1 ) pager_write_changecounter(pList);
|
58917
|
0 |
0 |
if( rc==SQLITE_OK && pPager->pBackup ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pPager->pBackup ){
|
58918
|
0 |
0 |
for(p=pList; p; p=p->pDirty){
|
58956
|
0 |
0 |
if( rc!=SQLITE_OK || changed ){
|
|
0 |
0 |
if( rc!=SQLITE_OK || changed ){
|
58958
|
0 |
0 |
if( USEFETCH(pPager) ) sqlite3OsUnfetch(pPager->fd, 0, 0);
|
58994
|
336 |
0 |
if( nPage==0 && ALWAYS(isOpen(pPager->fd)) ){
|
|
336 |
0 |
if( nPage==0 && ALWAYS(isOpen(pPager->fd)) ){
|
58997
|
0 |
336 |
if( rc!=SQLITE_OK ){
|
59007
|
0 |
336 |
if( nPage>pPager->mxPgno ){
|
59039
|
336 |
0 |
if( !pPager->tempFile ){
|
59044
|
336 |
0 |
if( rc==SQLITE_OK ){
|
59045
|
0 |
336 |
if( isWal ){
|
59049
|
0 |
0 |
if( rc ) return rc;
|
59050
|
0 |
0 |
if( nPage==0 ){
|
59056
|
0 |
336 |
}else if( pPager->journalMode==PAGER_JOURNALMODE_WAL ){
|
59111
|
1 |
0 |
if( pSavepoint ){
|
59113
|
0 |
1 |
if( !pDone ){
|
59121
|
1 |
0 |
pPager->dbSize = pSavepoint ? pSavepoint->nOrig : pPager->dbOrigSize;
|
59124
|
0 |
1 |
if( !pSavepoint && pagerUseWal(pPager) ){
|
|
0 |
0 |
if( !pSavepoint && pagerUseWal(pPager) ){
|
59143
|
1 |
0 |
if( pSavepoint && !pagerUseWal(pPager) ){
|
|
1 |
0 |
if( pSavepoint && !pagerUseWal(pPager) ){
|
59144
|
0 |
1 |
iHdrOff = pSavepoint->iHdrOffset ? pSavepoint->iHdrOffset : szJ;
|
59146
|
1 |
0 |
while( rc==SQLITE_OK && pPager->journalOff<iHdrOff ){
|
|
0 |
1 |
while( rc==SQLITE_OK && pPager->journalOff<iHdrOff ){
|
59159
|
1 |
0 |
while( rc==SQLITE_OK && pPager->journalOff<szJ ){
|
|
0 |
1 |
while( rc==SQLITE_OK && pPager->journalOff<szJ ){
|
59171
|
0 |
0 |
if( nJRec==0
|
59172
|
0 |
0 |
&& pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff
|
59176
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii<nJRec && pPager->journalOff<szJ; ii++){
|
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii<nJRec && pPager->journalOff<szJ; ii++){
|
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii<nJRec && pPager->journalOff<szJ; ii++){
|
59187
|
1 |
0 |
if( pSavepoint ){
|
59191
|
0 |
1 |
if( pagerUseWal(pPager) ){
|
59194
|
2 |
0 |
for(ii=pSavepoint->iSubRec; rc==SQLITE_OK && ii<pPager->nSubRec; ii++){
|
|
1 |
1 |
for(ii=pSavepoint->iSubRec; rc==SQLITE_OK && ii<pPager->nSubRec; ii++){
|
59202
|
1 |
0 |
if( rc==SQLITE_OK ){
|
59231
|
322 |
875 |
if( isOpen(fd) && fd->pMethods->iVersion>=3 ){
|
|
322 |
0 |
if( isOpen(fd) && fd->pMethods->iVersion>=3 ){
|
59312
|
284 |
106 |
if( pPager->tempFile ){
|
59321
|
284 |
106 |
if( pPager->noSync ){
|
59323
|
0 |
106 |
}else if( pgFlags & PAGER_FULLFSYNC ){
|
59329
|
106 |
284 |
if( pPager->fullSync ){
|
59332
|
0 |
390 |
if( (pgFlags & PAGER_CKPT_FULLFSYNC) && !pPager->noSync ){
|
|
0 |
0 |
if( (pgFlags & PAGER_CKPT_FULLFSYNC) && !pPager->noSync ){
|
59335
|
390 |
0 |
if( pgFlags & PAGER_CACHESPILL ){
|
59464
|
261 |
570 |
if( (pPager->memDb==0 || pPager->dbSize==0)
|
|
216 |
45 |
if( (pPager->memDb==0 || pPager->dbSize==0)
|
59465
|
769 |
17 |
&& sqlite3PcacheRefCount(pPager->pPCache)==0
|
59466
|
430 |
339 |
&& pageSize && pageSize!=(u32)pPager->pageSize
|
|
366 |
64 |
&& pageSize && pageSize!=(u32)pPager->pageSize
|
59471
|
260 |
106 |
if( pPager->eState>PAGER_OPEN && isOpen(pPager->fd) ){
|
|
0 |
260 |
if( pPager->eState>PAGER_OPEN && isOpen(pPager->fd) ){
|
59474
|
366 |
0 |
if( rc==SQLITE_OK ){
|
59478
|
0 |
366 |
if( !pNew ){
|
59485
|
366 |
0 |
if( rc==SQLITE_OK ){
|
59489
|
366 |
0 |
if( rc==SQLITE_OK ){
|
59501
|
831 |
0 |
if( rc==SQLITE_OK ){
|
59502
|
428 |
403 |
if( nReserve<0 ) nReserve = pPager->nReserve;
|
59530
|
0 |
0 |
if( mxPage>0 ){
|
59590
|
106 |
260 |
if( isOpen(pPager->fd) ){
|
59593
|
79 |
27 |
if( rc==SQLITE_IOERR_SHORT_READ ){
|
59643
|
26 |
1519 |
}while( rc==SQLITE_BUSY && pPager->xBusyHandler(pPager->pBusyHandlerArg) );
|
|
24 |
2 |
}while( rc==SQLITE_BUSY && pPager->xBusyHandler(pPager->pBusyHandlerArg) );
|
59732
|
0 |
0 |
if( !pPager->noSync ){
|
59735
|
0 |
0 |
if( rc==SQLITE_OK ){
|
59760
|
0 |
0 |
if( pPager->pMmapFreelist ){
|
59768
|
0 |
0 |
if( p==0 ){
|
59812
|
0 |
364 |
for(p=pPager->pMmapFreelist; p; p=pNext){
|
59827
|
461 |
196 |
if( pPager->tempFile ) return SQLITE_OK;
|
59828
|
72 |
124 |
if( pPager->dbSize==0 ) return SQLITE_OK;
|
59831
|
0 |
124 |
if( rc==SQLITE_NOTFOUND ){
|
59836
|
124 |
0 |
}else if( rc==SQLITE_OK && bHasMoved ){
|
|
0 |
124 |
}else if( rc==SQLITE_OK && bHasMoved ){
|
59870
|
364 |
0 |
if( db && 0==(db->flags & SQLITE_NoCkptOnClose)
|
|
364 |
0 |
if( db && 0==(db->flags & SQLITE_NoCkptOnClose)
|
59871
|
364 |
0 |
&& SQLITE_OK==databaseIsUnmoved(pPager)
|
59880
|
207 |
157 |
if( MEMDB ){
|
59894
|
0 |
157 |
if( isOpen(pPager->jfd) ){
|
59975
|
0 |
90 |
if( rc!=SQLITE_OK ) return rc;
|
59977
|
90 |
0 |
if( !pPager->noSync ){
|
59979
|
90 |
0 |
if( isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_MEMORY ){
|
|
90 |
0 |
if( isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_MEMORY ){
|
59983
|
90 |
0 |
if( 0==(iDc&SQLITE_IOCAP_SAFE_APPEND) ){
|
60015
|
0 |
90 |
if( rc==SQLITE_OK && 0==memcmp(aMagic, aJournalMagic, 8) ){
|
|
0 |
0 |
if( rc==SQLITE_OK && 0==memcmp(aMagic, aJournalMagic, 8) ){
|
60019
|
90 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_IOERR_SHORT_READ ){
|
|
0 |
90 |
if( rc!=SQLITE_OK && rc!=SQLITE_IOERR_SHORT_READ ){
|
60034
|
90 |
0 |
if( pPager->fullSync && 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){
|
|
90 |
0 |
if( pPager->fullSync && 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){
|
60038
|
0 |
90 |
if( rc!=SQLITE_OK ) return rc;
|
60044
|
0 |
90 |
if( rc!=SQLITE_OK ) return rc;
|
60046
|
90 |
0 |
if( 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){
|
60050
|
0 |
90 |
(pPager->syncFlags==SQLITE_SYNC_FULL?SQLITE_SYNC_DATAONLY:0)
|
60052
|
0 |
90 |
if( rc!=SQLITE_OK ) return rc;
|
60056
|
0 |
90 |
if( newHdr && 0==(iDc&SQLITE_IOCAP_SAFE_APPEND) ){
|
|
0 |
0 |
if( newHdr && 0==(iDc&SQLITE_IOCAP_SAFE_APPEND) ){
|
60059
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
60121
|
0 |
90 |
if( !isOpen(pPager->fd) ){
|
60130
|
90 |
0 |
if( rc==SQLITE_OK
|
60131
|
29 |
61 |
&& pPager->dbHintSize<pPager->dbSize
|
60132
|
1 |
28 |
&& (pList->pDirty || pList->pgno>pPager->dbHintSize)
|
|
1 |
0 |
&& (pList->pDirty || pList->pgno>pPager->dbHintSize)
|
60139
|
307 |
0 |
while( rc==SQLITE_OK && pList ){
|
|
217 |
90 |
while( rc==SQLITE_OK && pList ){
|
60150
|
217 |
0 |
if( pgno<=pPager->dbSize && 0==(pList->flags&PGHDR_DONT_WRITE) ){
|
|
216 |
1 |
if( pgno<=pPager->dbSize && 0==(pList->flags&PGHDR_DONT_WRITE) ){
|
60155
|
90 |
126 |
if( pList->pgno==1 ) pager_write_changecounter(pList);
|
60166
|
90 |
126 |
if( pgno==1 ){
|
60169
|
73 |
143 |
if( pgno>pPager->dbFileSize ){
|
60201
|
25 |
30 |
if( !isOpen(pPager->sjfd) ){
|
60206
|
8 |
17 |
if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){
|
|
0 |
8 |
if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){
|
60228
|
55 |
0 |
if( pPager->journalMode!=PAGER_JOURNALMODE_OFF ){
|
60242
|
55 |
0 |
if( rc==SQLITE_OK ){
|
60249
|
55 |
0 |
if( rc==SQLITE_OK ){
|
60254
|
55 |
0 |
if( rc==SQLITE_OK ){
|
60262
|
55 |
328 |
if( subjRequiresPage(pPg) ){
|
60311
|
0 |
0 |
if( NEVER(pPager->errCode) ) return SQLITE_OK;
|
60315
|
0 |
0 |
if( pPager->doNotSpill
|
60316
|
0 |
0 |
&& ((pPager->doNotSpill & (SPILLFLAG_ROLLBACK|SPILLFLAG_OFF))!=0
|
60317
|
0 |
0 |
|| (pPg->flags & PGHDR_NEED_SYNC)!=0)
|
60324
|
0 |
0 |
if( pagerUseWal(pPager) ){
|
60327
|
0 |
0 |
if( rc==SQLITE_OK ){
|
60340
|
0 |
0 |
if( pPg->flags&PGHDR_NEED_SYNC
|
60341
|
0 |
0 |
|| pPager->eState==PAGER_WRITER_CACHEMOD
|
60347
|
0 |
0 |
if( rc==SQLITE_OK ){
|
60354
|
0 |
0 |
if( rc==SQLITE_OK ){
|
60367
|
0 |
0 |
if( !MEMDB ){
|
60370
|
0 |
0 |
while( rc==SQLITE_OK && pList ){
|
|
0 |
0 |
while( rc==SQLITE_OK && pList ){
|
60372
|
0 |
0 |
if( pList->nRef==0 ){
|
60451
|
207 |
165 |
if( flags & PAGER_MEMORY ){
|
60453
|
207 |
0 |
if( zFilename && zFilename[0] ){
|
|
207 |
0 |
if( zFilename && zFilename[0] ){
|
60455
|
0 |
207 |
if( zPathname==0 ) return SQLITE_NOMEM_BKPT;
|
60466
|
115 |
257 |
if( zFilename && zFilename[0] ){
|
|
112 |
3 |
if( zFilename && zFilename[0] ){
|
60470
|
0 |
112 |
if( zPathname==0 ){
|
60475
|
0 |
112 |
if( rc!=SQLITE_OK ){
|
60476
|
0 |
0 |
if( rc==SQLITE_OK_SYMLINK ){
|
60477
|
0 |
0 |
if( vfsFlags & SQLITE_OPEN_NOFOLLOW ){
|
60486
|
10 |
112 |
while( *z ){
|
60492
|
112 |
0 |
if( rc==SQLITE_OK && nPathname+8>pVfs->mxPathname ){
|
|
0 |
112 |
if( rc==SQLITE_OK && nPathname+8>pVfs->mxPathname ){
|
60501
|
0 |
112 |
if( rc!=SQLITE_OK ){
|
60567
|
0 |
372 |
if( !pPtr ){
|
60582
|
319 |
53 |
if( nPathname>0 ){
|
60584
|
112 |
207 |
if( zUri ){
|
60593
|
319 |
53 |
if( nPathname>0 ){
|
60607
|
319 |
53 |
if( nPathname>0 ){
|
60621
|
319 |
53 |
if( nPathname ) sqlite3DbFree(0, zPathname);
|
60627
|
115 |
257 |
if( zFilename && zFilename[0] ){
|
|
112 |
3 |
if( zFilename && zFilename[0] ){
|
60644
|
106 |
6 |
if( rc==SQLITE_OK ){
|
60646
|
103 |
3 |
if( !readOnly ){
|
60649
|
0 |
103 |
if( szPageDflt<pPager->sectorSize ){
|
60650
|
0 |
0 |
if( pPager->sectorSize>SQLITE_MAX_DEFAULT_PAGE_SIZE ){
|
60671
|
106 |
0 |
if( (iDc & SQLITE_IOCAP_IMMUTABLE)!=0
|
60672
|
0 |
106 |
|| sqlite3_uri_boolean(pPager->zFilename, "immutable", 0) ){
|
60699
|
366 |
6 |
if( rc==SQLITE_OK ){
|
60706
|
366 |
6 |
if( rc==SQLITE_OK ){
|
60709
|
159 |
207 |
rc = sqlite3PcacheOpen(szPageDflt, nExtra, !memDb,
|
60715
|
6 |
366 |
if( rc!=SQLITE_OK ){
|
60752
|
17 |
349 |
if( !useJournal ){
|
60754
|
142 |
207 |
}else if( memDb || memJM ){
|
|
0 |
142 |
}else if( memDb || memJM ){
|
60775
|
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 ){
|
60829
|
336 |
0 |
if( !jrnlOpen ){
|
60832
|
336 |
0 |
if( rc==SQLITE_OK && exists ){
|
|
152 |
184 |
if( rc==SQLITE_OK && exists ){
|
60844
|
152 |
0 |
if( rc==SQLITE_OK && !locked ){
|
|
0 |
152 |
if( rc==SQLITE_OK && !locked ){
|
60849
|
0 |
0 |
if( rc==SQLITE_OK ){
|
60858
|
0 |
0 |
if( nPage==0 && !jrnlOpen ){
|
|
0 |
0 |
if( nPage==0 && !jrnlOpen ){
|
60860
|
0 |
0 |
if( pagerLockDb(pPager, RESERVED_LOCK)==SQLITE_OK ){
|
60862
|
0 |
0 |
if( !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK);
|
60872
|
0 |
0 |
if( !jrnlOpen ){
|
60876
|
0 |
0 |
if( rc==SQLITE_OK ){
|
60879
|
0 |
0 |
if( rc==SQLITE_IOERR_SHORT_READ ){
|
60882
|
0 |
0 |
if( !jrnlOpen ){
|
60886
|
0 |
0 |
}else if( rc==SQLITE_CANTOPEN ){
|
60946
|
2380 |
0 |
if( !pagerUseWal(pPager) && pPager->eState==PAGER_OPEN ){
|
|
338 |
2042 |
if( !pagerUseWal(pPager) && pPager->eState==PAGER_OPEN ){
|
60953
|
2 |
336 |
if( rc!=SQLITE_OK ){
|
60961
|
336 |
0 |
if( pPager->eLock<=SHARED_LOCK ){
|
60964
|
0 |
336 |
if( rc!=SQLITE_OK ){
|
60967
|
0 |
336 |
if( bHotJournal ){
|
60968
|
0 |
0 |
if( pPager->readOnly ){
|
60989
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
61006
|
0 |
0 |
if( !isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){
|
|
0 |
0 |
if( !isOpen(pPager->jfd) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){
|
61011
|
0 |
0 |
if( rc==SQLITE_OK && bExists ){
|
|
0 |
0 |
if( rc==SQLITE_OK && bExists ){
|
61017
|
0 |
0 |
if( rc==SQLITE_OK && fout&SQLITE_OPEN_READONLY ){
|
|
0 |
0 |
if( rc==SQLITE_OK && fout&SQLITE_OPEN_READONLY ){
|
61032
|
0 |
0 |
if( isOpen(pPager->jfd) ){
|
61035
|
0 |
0 |
if( rc==SQLITE_OK ){
|
61039
|
0 |
0 |
}else if( !pPager->exclusiveMode ){
|
61043
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
61070
|
336 |
0 |
if( !pPager->tempFile && pPager->hasHeldSharedLock ){
|
|
283 |
53 |
if( !pPager->tempFile && pPager->hasHeldSharedLock ){
|
61091
|
12 |
271 |
if( rc!=SQLITE_OK ){
|
61092
|
0 |
12 |
if( rc!=SQLITE_IOERR_SHORT_READ ){
|
61098
|
11 |
272 |
if( memcmp(pPager->dbFileVers, dbFileVers, sizeof(dbFileVers))!=0 ){
|
61107
|
0 |
11 |
if( USEFETCH(pPager) ){
|
61122
|
0 |
2378 |
if( pagerUseWal(pPager) ){
|
61127
|
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 ){
|
61132
|
2 |
2378 |
if( rc!=SQLITE_OK ){
|
61152
|
2378 |
44 |
if( sqlite3PcacheRefCount(pPager->pPCache)==0 ){
|
61231
|
0 |
11592 |
if( pgno==0 ) return SQLITE_CORRUPT_BKPT;
|
61233
|
0 |
11592 |
if( pBase==0 ){
|
61236
|
0 |
0 |
if( rc!=SQLITE_OK ) goto pager_acquire_err;
|
61237
|
0 |
0 |
if( pBase==0 ){
|
61248
|
10258 |
1334 |
if( pPg->pPager && !noContent ){
|
|
10257 |
1 |
if( pPg->pPager && !noContent ){
|
61262
|
0 |
1335 |
if( pgno==PAGER_SJ_PGNO(pPager) ){
|
61270
|
162 |
1173 |
if( !isOpen(pPager->fd) || pPager->dbSize<pgno || noContent ){
|
|
89 |
73 |
if( !isOpen(pPager->fd) || pPager->dbSize<pgno || noContent ){
|
|
1 |
88 |
if( !isOpen(pPager->fd) || pPager->dbSize<pgno || noContent ){
|
61271
|
0 |
1247 |
if( pgno>pPager->mxPgno ){
|
61273
|
0 |
0 |
if( pgno<=pPager->dbSize ){
|
61279
|
999 |
248 |
if( noContent ){
|
61287
|
1 |
998 |
if( pgno<=pPager->dbOrigSize ){
|
61301
|
0 |
88 |
if( rc!=SQLITE_OK ){
|
61311
|
0 |
0 |
if( pPg ){
|
61336
|
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))
|
61345
|
0 |
0 |
if( pgno<=1 && pgno==0 ){
|
|
0 |
0 |
if( pgno<=1 && pgno==0 ){
|
61353
|
0 |
0 |
if( bMmapOk && pagerUseWal(pPager) ){
|
|
0 |
0 |
if( bMmapOk && pagerUseWal(pPager) ){
|
61355
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
61360
|
0 |
0 |
if( bMmapOk && iFrame==0 ){
|
|
0 |
0 |
if( bMmapOk && iFrame==0 ){
|
61365
|
0 |
0 |
if( rc==SQLITE_OK && pData ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pData ){
|
61366
|
0 |
0 |
if( pPager->eState>PAGER_READER || pPager->tempFile ){
|
|
0 |
0 |
if( pPager->eState>PAGER_READER || pPager->tempFile ){
|
61369
|
0 |
0 |
if( pPg==0 ){
|
61374
|
0 |
0 |
if( pPg ){
|
61380
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
61434
|
0 |
29 |
if( pPage==0 ) return 0;
|
61455
|
0 |
9175 |
if( pPg->flags & PGHDR_MMAP ){
|
61465
|
979 |
0 |
if( pPg ) sqlite3PagerUnrefNotNull(pPg);
|
61510
|
0 |
1104 |
if( NEVER(pPager->errCode) ) return pPager->errCode;
|
61512
|
1104 |
0 |
if( !pagerUseWal(pPager) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){
|
|
1087 |
17 |
if( !pagerUseWal(pPager) && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){
|
61514
|
0 |
1087 |
if( pPager->pInJournal==0 ){
|
61519
|
1087 |
0 |
if( !isOpen(pPager->jfd) ){
|
61520
|
794 |
293 |
if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY ){
|
61526
|
201 |
92 |
if( pPager->tempFile ){
|
61538
|
293 |
0 |
if( rc==SQLITE_OK ){
|
61551
|
1087 |
0 |
if( rc==SQLITE_OK ){
|
61561
|
0 |
1104 |
if( rc!=SQLITE_OK ){
|
61593
|
0 |
1292 |
if( pPager->errCode ) return pPager->errCode;
|
61597
|
1292 |
0 |
if( pPager->eState==PAGER_READER ){
|
61600
|
0 |
1292 |
if( pagerUseWal(pPager) ){
|
61604
|
0 |
0 |
if( pPager->exclusiveMode && sqlite3WalExclusiveMode(pPager->pWal, -1) ){
|
|
0 |
0 |
if( pPager->exclusiveMode && sqlite3WalExclusiveMode(pPager->pWal, -1) ){
|
61606
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
61625
|
1140 |
152 |
if( rc==SQLITE_OK && exFlag ){
|
|
14 |
1126 |
if( rc==SQLITE_OK && exFlag ){
|
61630
|
1140 |
152 |
if( rc==SQLITE_OK ){
|
61685
|
0 |
1308 |
if( rc!=SQLITE_OK ) return rc;
|
61687
|
0 |
1308 |
if( rc!=SQLITE_OK ) return rc;
|
61689
|
0 |
1308 |
if( rc!=SQLITE_OK ) return rc;
|
61742
|
1104 |
1411 |
if( pPager->eState==PAGER_WRITER_LOCKED ){
|
61744
|
0 |
1104 |
if( rc!=SQLITE_OK ) return rc;
|
61757
|
2488 |
27 |
if( pPager->pInJournal!=0
|
61758
|
2487 |
1 |
&& sqlite3BitvecTestNotNull(pPager->pInJournal, pPg->pgno)==0
|
61761
|
1308 |
1179 |
if( pPg->pgno<=pPager->dbOrigSize ){
|
61763
|
0 |
1308 |
if( rc!=SQLITE_OK ){
|
61767
|
1179 |
0 |
if( pPager->eState!=PAGER_WRITER_DBMOD ){
|
61786
|
60 |
2455 |
if( pPager->nSavepoint>0 ){
|
61791
|
1206 |
1309 |
if( pPager->dbSize<pPg->pgno ){
|
61833
|
0 |
0 |
if( pPg->pgno>nPageCount ){
|
61835
|
0 |
0 |
}else if( (pg1+nPagePerSector-1)>nPageCount ){
|
61844
|
0 |
0 |
for(ii=0; ii<nPage && rc==SQLITE_OK; ii++){
|
|
0 |
0 |
for(ii=0; ii<nPage && rc==SQLITE_OK; ii++){
|
61847
|
0 |
0 |
if( pg==pPg->pgno || !sqlite3BitvecTest(pPager->pInJournal, pg) ){
|
|
0 |
0 |
if( pg==pPg->pgno || !sqlite3BitvecTest(pPager->pInJournal, pg) ){
|
61848
|
0 |
0 |
if( pg!=PAGER_SJ_PGNO(pPager) ){
|
61850
|
0 |
0 |
if( rc==SQLITE_OK ){
|
61852
|
0 |
0 |
if( pPage->flags&PGHDR_NEED_SYNC ){
|
61858
|
0 |
0 |
}else if( (pPage = sqlite3PagerLookup(pPager, pg))!=0 ){
|
61859
|
0 |
0 |
if( pPage->flags&PGHDR_NEED_SYNC ){
|
61872
|
0 |
0 |
if( rc==SQLITE_OK && needSync ){
|
|
0 |
0 |
if( rc==SQLITE_OK && needSync ){
|
61874
|
0 |
0 |
for(ii=0; ii<nPage; ii++){
|
61876
|
0 |
0 |
if( pPage ){
|
61907
|
4983 |
2515 |
if( (pPg->flags & PGHDR_WRITEABLE)!=0 && pPager->dbSize>=pPg->pgno ){
|
|
4983 |
0 |
if( (pPg->flags & PGHDR_WRITEABLE)!=0 && pPager->dbSize>=pPg->pgno ){
|
61908
|
323 |
4660 |
if( pPager->nSavepoint ) return subjournalPageIfRequired(pPg);
|
61910
|
0 |
2515 |
}else if( pPager->errCode ){
|
61912
|
0 |
2515 |
}else if( pPager->sectorSize > (u32)pPager->pageSize ){
|
61953
|
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 ){
|
62011
|
90 |
0 |
if( !pPager->changeCountDone && pPager->dbSize>0 ){
|
|
90 |
0 |
if( !pPager->changeCountDone && pPager->dbSize>0 ){
|
62025
|
90 |
0 |
if( !DIRECT_MODE && ALWAYS(rc==SQLITE_OK) ){
|
62029
|
90 |
0 |
if( rc==SQLITE_OK ){
|
62072
|
90 |
0 |
if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
|
62073
|
90 |
0 |
if( rc==SQLITE_OK && !pPager->noSync ){
|
|
90 |
0 |
if( rc==SQLITE_OK && !pPager->noSync ){
|
62094
|
1169 |
0 |
if( rc==SQLITE_OK ){
|
62100
|
1169 |
0 |
if( 0==pagerUseWal(pPager) ){
|
62148
|
0 |
1079 |
if( NEVER(pPager->errCode) ) return pPager->errCode;
|
62151
|
0 |
1079 |
if( sqlite3FaultSim(400) ) return SQLITE_IOERR;
|
62157
|
23 |
1056 |
if( pPager->eState<PAGER_WRITER_CACHEMOD ) return SQLITE_OK;
|
62161
|
966 |
90 |
if( 0==pagerFlushOnCommit(pPager, 1) ){
|
62168
|
0 |
90 |
if( pagerUseWal(pPager) ){
|
62171
|
0 |
0 |
if( pList==0 ){
|
62179
|
0 |
0 |
if( ALWAYS(pList) ){
|
62183
|
0 |
0 |
if( rc==SQLITE_OK ){
|
62260
|
0 |
90 |
if( rc!=SQLITE_OK ) goto commit_phase_one_exit;
|
62267
|
0 |
90 |
if( rc!=SQLITE_OK ) goto commit_phase_one_exit;
|
62281
|
0 |
90 |
if( rc!=SQLITE_OK ) goto commit_phase_one_exit;
|
62313
|
0 |
90 |
if( rc!=SQLITE_OK ){
|
62325
|
0 |
90 |
if( pPager->dbSize>pPager->dbFileSize ){
|
62329
|
0 |
0 |
if( rc!=SQLITE_OK ) goto commit_phase_one_exit;
|
62333
|
90 |
0 |
if( !noSync ){
|
62341
|
1056 |
0 |
if( rc==SQLITE_OK && !pagerUseWal(pPager) ){
|
|
1056 |
0 |
if( rc==SQLITE_OK && !pagerUseWal(pPager) ){
|
62369
|
0 |
1079 |
if( NEVER(pPager->errCode) ) return pPager->errCode;
|
62389
|
23 |
1056 |
if( pPager->eState==PAGER_WRITER_LOCKED
|
62390
|
16 |
7 |
&& pPager->exclusiveMode
|
62391
|
0 |
16 |
&& pPager->journalMode==PAGER_JOURNALMODE_PERSIST
|
62438
|
0 |
61 |
if( pPager->eState==PAGER_ERROR ) return pPager->errCode;
|
62439
|
0 |
61 |
if( pPager->eState<=PAGER_READER ) return SQLITE_OK;
|
62441
|
0 |
61 |
if( pagerUseWal(pPager) ){
|
62445
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
62446
|
31 |
30 |
}else if( !isOpen(pPager->jfd) || pPager->eState==PAGER_WRITER_LOCKED ){
|
|
0 |
31 |
}else if( !isOpen(pPager->jfd) || pPager->eState==PAGER_WRITER_LOCKED ){
|
62449
|
17 |
13 |
if( !MEMDB && eState>PAGER_WRITER_LOCKED ){
|
|
17 |
0 |
if( !MEMDB && eState>PAGER_WRITER_LOCKED ){
|
62558
|
0 |
6 |
if( reset ){
|
62567
|
97 |
6 |
return pPager->tempFile || pPager->memVfs;
|
|
0 |
97 |
return pPager->tempFile || pPager->memVfs;
|
62597
|
0 |
55 |
if( !aNew ){
|
62604
|
55 |
55 |
for(ii=nCurrent; ii<nSavepoint; ii++){
|
62606
|
55 |
0 |
if( isOpen(pPager->jfd) && pPager->journalOff>0 ){
|
|
55 |
0 |
if( isOpen(pPager->jfd) && pPager->journalOff>0 ){
|
62614
|
0 |
55 |
if( !aNew[ii].pInSavepoint ){
|
62617
|
0 |
55 |
if( pagerUseWal(pPager) ){
|
62630
|
55 |
3759 |
if( nSavepoint>pPager->nSavepoint && pPager->useJournal ){
|
|
55 |
0 |
if( nSavepoint>pPager->nSavepoint && pPager->useJournal ){
|
62678
|
55 |
0 |
if( rc==SQLITE_OK && iSavepoint<pPager->nSavepoint ){
|
|
55 |
0 |
if( rc==SQLITE_OK && iSavepoint<pPager->nSavepoint ){
|
62687
|
54 |
55 |
for(ii=nNew; ii<pPager->nSavepoint; ii++){
|
62694
|
54 |
1 |
if( op==SAVEPOINT_RELEASE ){
|
62696
|
54 |
0 |
if( pRel->bTruncateOnRelease && isOpen(pPager->sjfd) ){
|
|
54 |
0 |
if( pRel->bTruncateOnRelease && isOpen(pPager->sjfd) ){
|
62698
|
54 |
0 |
if( sqlite3JournalIsInMemory(pPager->sjfd) ){
|
62711
|
1 |
0 |
else if( pagerUseWal(pPager) || isOpen(pPager->jfd) ){
|
|
1 |
0 |
else if( pagerUseWal(pPager) || isOpen(pPager->jfd) ){
|
62712
|
1 |
0 |
PagerSavepoint *pSavepoint = (nNew==0)?0:&pPager->aSavepoint[nNew-1];
|
62751
|
2510 |
0 |
if( nullIfMemDb && (pPager->memDb || sqlite3IsMemdb(pPager->pVfs)) ){
|
|
361 |
2149 |
if( nullIfMemDb && (pPager->memDb || sqlite3IsMemdb(pPager->pVfs)) ){
|
|
0 |
361 |
if( nullIfMemDb && (pPager->memDb || sqlite3IsMemdb(pPager->pVfs)) ){
|
62782
|
0 |
0 |
return pPager->pWal ? sqlite3WalFile(pPager->pWal) : pPager->jfd;
|
62835
|
0 |
0 |
if( pPager->tempFile ){
|
62837
|
0 |
0 |
if( rc ) return rc;
|
62858
|
0 |
0 |
if( (pPg->flags & PGHDR_DIRTY)!=0
|
62859
|
0 |
0 |
&& SQLITE_OK!=(rc = subjournalPageIfRequired(pPg))
|
62875
|
0 |
0 |
if( (pPg->flags&PGHDR_NEED_SYNC) && !isCommit ){
|
|
0 |
0 |
if( (pPg->flags&PGHDR_NEED_SYNC) && !isCommit ){
|
62890
|
0 |
0 |
if( pPgOld ){
|
62891
|
0 |
0 |
if( NEVER(pPgOld->nRef>1) ){
|
62896
|
0 |
0 |
if( pPager->tempFile ){
|
62913
|
0 |
0 |
if( pPager->tempFile && pPgOld ){
|
|
0 |
0 |
if( pPager->tempFile && pPgOld ){
|
62918
|
0 |
0 |
if( needSyncPgno ){
|
62935
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
62936
|
0 |
0 |
if( needSyncPgno<=pPager->dbOrigSize ){
|
62996
|
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) ){
|
63042
|
2 |
0 |
if( MEMDB ){
|
63044
|
0 |
2 |
if( eMode!=PAGER_JOURNALMODE_MEMORY && eMode!=PAGER_JOURNALMODE_OFF ){
|
|
0 |
0 |
if( eMode!=PAGER_JOURNALMODE_MEMORY && eMode!=PAGER_JOURNALMODE_OFF ){
|
63049
|
0 |
2 |
if( eMode!=eOld ){
|
63067
|
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 ){
|
63077
|
0 |
0 |
if( pPager->eLock>=RESERVED_LOCK ){
|
63083
|
0 |
0 |
if( state==PAGER_OPEN ){
|
63086
|
0 |
0 |
if( pPager->eState==PAGER_READER ){
|
63090
|
0 |
0 |
if( rc==SQLITE_OK ){
|
63093
|
0 |
0 |
if( rc==SQLITE_OK && state==PAGER_READER ){
|
|
0 |
0 |
if( rc==SQLITE_OK && state==PAGER_READER ){
|
63095
|
0 |
0 |
}else if( state==PAGER_OPEN ){
|
63100
|
0 |
0 |
}else if( eMode==PAGER_JOURNALMODE_OFF ){
|
63123
|
0 |
2 |
if( pPager->eState>=PAGER_WRITER_CACHEMOD ) return 0;
|
63124
|
0 |
2 |
if( NEVER(isOpen(pPager->jfd) && pPager->journalOff>0) ) return 0;
|
|
0 |
0 |
if( NEVER(isOpen(pPager->jfd) && pPager->journalOff>0) ) return 0;
|
63135
|
0 |
0 |
if( iLimit>=-1 ){
|
63158
|
0 |
0 |
if( pPager->tempFile==0 ) pager_reset(pPager);
|
63179
|
0 |
0 |
if( pPager->pWal==0 && pPager->journalMode==PAGER_JOURNALMODE_WAL ){
|
|
0 |
0 |
if( pPager->pWal==0 && pPager->journalMode==PAGER_JOURNALMODE_WAL ){
|
63191
|
0 |
0 |
if( pPager->pWal ){
|
63192
|
0 |
0 |
rc = sqlite3WalCheckpoint(pPager->pWal, db, eMode,
|
63212
|
0 |
0 |
if( pPager->noLock ) return 0;
|
63213
|
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);
|
63227
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
63253
|
0 |
0 |
if( pPager->exclusiveMode ){
|
63260
|
0 |
0 |
if( rc==SQLITE_OK ){
|
63299
|
0 |
0 |
if( !pPager->tempFile && !pPager->pWal ){
|
|
0 |
0 |
if( !pPager->tempFile && !pPager->pWal ){
|
63300
|
0 |
0 |
if( !sqlite3PagerWalSupported(pPager) ) return SQLITE_CANTOPEN;
|
63306
|
0 |
0 |
if( rc==SQLITE_OK ){
|
63335
|
0 |
0 |
if( !pPager->pWal ){
|
63338
|
0 |
0 |
if( rc==SQLITE_OK ){
|
63343
|
0 |
0 |
if( rc==SQLITE_OK && logexists ){
|
|
0 |
0 |
if( rc==SQLITE_OK && logexists ){
|
63351
|
0 |
0 |
if( rc==SQLITE_OK && pPager->pWal ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pPager->pWal ){
|
63353
|
0 |
0 |
if( rc==SQLITE_OK ){
|
63358
|
0 |
0 |
if( rc && !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK);
|
|
0 |
0 |
if( rc && !pPager->exclusiveMode ) pagerUnlockDb(pPager, SHARED_LOCK);
|
64125
|
0 |
0 |
if( pWal->nWiData<=iPage ){
|
64129
|
0 |
0 |
if( !apNew ){
|
64141
|
0 |
0 |
if( pWal->exclusiveMode==WAL_HEAPMEMORY_MODE ){
|
64143
|
0 |
0 |
if( !pWal->apWiData[iPage] ) rc = SQLITE_NOMEM_BKPT;
|
64152
|
0 |
0 |
if( rc==SQLITE_OK ){
|
64153
|
0 |
0 |
if( iPage>0 && sqlite3FaultSim(600) ) rc = SQLITE_NOMEM;
|
|
0 |
0 |
if( iPage>0 && sqlite3FaultSim(600) ) rc = SQLITE_NOMEM;
|
64154
|
0 |
0 |
}else if( (rc&0xff)==SQLITE_READONLY ){
|
64156
|
0 |
0 |
if( rc==SQLITE_READONLY ){
|
64171
|
0 |
0 |
if( pWal->nWiData<=iPage || (*ppPage = pWal->apWiData[iPage])==0 ){
|
|
0 |
0 |
if( pWal->nWiData<=iPage || (*ppPage = pWal->apWiData[iPage])==0 ){
|
64225
|
0 |
0 |
if( aIn ){
|
64237
|
0 |
0 |
if( !nativeCksum ){
|
64242
|
0 |
0 |
}while( aData<aEnd );
|
64243
|
0 |
0 |
}else if( nByte%64==0 ){
|
64261
|
0 |
0 |
}while( aData<aEnd );
|
64266
|
0 |
0 |
}while( aData<aEnd );
|
64279
|
0 |
0 |
if( pWal->exclusiveMode!=WAL_HEAPMEMORY_MODE ){
|
64341
|
0 |
0 |
if( pWal->iReCksum==0 ){
|
64375
|
0 |
0 |
if( memcmp(&pWal->hdr.aSalt, &aFrame[8], 8)!=0 ){
|
64382
|
0 |
0 |
if( pgno==0 ){
|
64394
|
0 |
0 |
if( aCksum[0]!=sqlite3Get4byte(&aFrame[16])
|
64395
|
0 |
0 |
|| aCksum[1]!=sqlite3Get4byte(&aFrame[20])
|
64441
|
0 |
0 |
if( pWal->exclusiveMode ) return SQLITE_OK;
|
64450
|
0 |
0 |
if( pWal->exclusiveMode ) return;
|
64457
|
0 |
0 |
if( pWal->exclusiveMode ) return SQLITE_OK;
|
64466
|
0 |
0 |
if( pWal->exclusiveMode ) return;
|
64523
|
0 |
0 |
if( pLoc->aPgno ){
|
64525
|
0 |
0 |
if( iHash==0 ){
|
64531
|
0 |
0 |
}else if( NEVER(rc==SQLITE_OK) ){
|
64560
|
0 |
0 |
if( iHash==0 ){
|
64589
|
0 |
0 |
if( pWal->hdr.mxFrame==0 ) return;
|
64598
|
0 |
0 |
if( NEVER(i) ) return; /* Defense-in-depth, in case (1) above is wrong */
|
64605
|
0 |
0 |
for(i=0; i<HASHTABLE_NSLOT; i++){
|
64606
|
0 |
0 |
if( sLoc.aHash[i]>iLimit ){
|
64649
|
0 |
0 |
if( rc==SQLITE_OK ){
|
64660
|
0 |
0 |
if( idx==1 ){
|
64672
|
0 |
0 |
if( sLoc.aPgno[idx-1] ){
|
64679
|
0 |
0 |
for(iKey=walHash(iPage); sLoc.aHash[iKey]; iKey=walNextHash(iKey)){
|
64680
|
0 |
0 |
if( (nCollide--)==0 ) return SQLITE_CORRUPT_BKPT;
|
64747
|
0 |
0 |
if( rc ){
|
64756
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
64760
|
0 |
0 |
if( nSize>WAL_HDRSIZE ){
|
64775
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
64786
|
0 |
0 |
if( (magic&0xFFFFFFFE)!=WAL_MAGIC
|
64787
|
0 |
0 |
|| szPage&(szPage-1)
|
64788
|
0 |
0 |
|| szPage>SQLITE_MAX_PAGE_SIZE
|
64789
|
0 |
0 |
|| szPage<512
|
64802
|
0 |
0 |
if( pWal->hdr.aFrameCksum[0]!=sqlite3Get4byte(&aBuf[24])
|
64803
|
0 |
0 |
|| pWal->hdr.aFrameCksum[1]!=sqlite3Get4byte(&aBuf[28])
|
64811
|
0 |
0 |
if( version!=WAL_MAX_VERSION ){
|
64819
|
0 |
0 |
if( !aFrame ){
|
64828
|
0 |
0 |
for(iPg=0; iPg<=(u32)walFramePage(iLastFrame); iPg++){
|
64832
|
0 |
0 |
u32 iFirst = 1 + (iPg==0?0:HASHTABLE_NPAGE_ONE+(iPg-1)*HASHTABLE_NPAGE);
|
64836
|
0 |
0 |
if( aShare==0 ) break;
|
64839
|
0 |
0 |
for(iFrame=iFirst; iFrame<=iLast; iFrame++){
|
64846
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
64848
|
0 |
0 |
if( !isValid ) break;
|
64850
|
0 |
0 |
if( NEVER(rc!=SQLITE_OK) ) break;
|
64853
|
0 |
0 |
if( nTruncate ){
|
64864
|
0 |
0 |
nHdr = (iPg==0 ? WALINDEX_HDR_SIZE : 0);
|
64894
|
0 |
0 |
if( iFrame<=iLast ) break;
|
64901
|
0 |
0 |
if( rc==SQLITE_OK ){
|
64916
|
0 |
0 |
for(i=1; i<WAL_NREADER; i++){
|
64918
|
0 |
0 |
if( rc==SQLITE_OK ){
|
64919
|
0 |
0 |
if( i==1 && pWal->hdr.mxFrame ){
|
|
0 |
0 |
if( i==1 && pWal->hdr.mxFrame ){
|
64925
|
0 |
0 |
}else if( rc!=SQLITE_BUSY ){
|
64935
|
0 |
0 |
if( pWal->hdr.nPage ){
|
64953
|
0 |
0 |
if( pWal->exclusiveMode==WAL_HEAPMEMORY_MODE || pWal->bShmUnreliable ){
|
|
0 |
0 |
if( pWal->exclusiveMode==WAL_HEAPMEMORY_MODE || pWal->bShmUnreliable ){
|
64955
|
0 |
0 |
for(i=0; i<pWal->nWiData; i++){
|
64960
|
0 |
0 |
if( pWal->exclusiveMode!=WAL_HEAPMEMORY_MODE ){
|
65043
|
0 |
0 |
if( !pRet ){
|
65055
|
0 |
0 |
pRet->exclusiveMode = (bNoShm ? WAL_HEAPMEMORY_MODE: WAL_NORMAL_MODE);
|
65060
|
0 |
0 |
if( rc==SQLITE_OK && flags&SQLITE_OPEN_READONLY ){
|
|
0 |
0 |
if( rc==SQLITE_OK && flags&SQLITE_OPEN_READONLY ){
|
65064
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
65070
|
0 |
0 |
if( iDC & SQLITE_IOCAP_SEQUENTIAL ){ pRet->syncHeader = 0; }
|
65071
|
0 |
0 |
if( iDC & SQLITE_IOCAP_POWERSAFE_OVERWRITE ){
|
65084
|
0 |
0 |
if( pWal ) pWal->mxWalSize = iLimit;
|
65108
|
0 |
0 |
for(i=p->nSegment-1; i>=0; i--){
|
65110
|
0 |
0 |
while( pSegment->iNext<pSegment->nEntry ){
|
65112
|
0 |
0 |
if( iPg>iMin ){
|
65113
|
0 |
0 |
if( iPg<iRet ){
|
65165
|
0 |
0 |
while( iRight<nRight || iLeft<nLeft ){
|
|
0 |
0 |
while( iRight<nRight || iLeft<nLeft ){
|
65169
|
0 |
0 |
if( (iLeft<nLeft)
|
65170
|
0 |
0 |
&& (iRight>=nRight || aContent[aLeft[iLeft]]<aContent[aRight[iRight]])
|
|
0 |
0 |
&& (iRight>=nRight || aContent[aLeft[iLeft]]<aContent[aRight[iRight]])
|
65179
|
0 |
0 |
if( iLeft<nLeft && aContent[aLeft[iLeft]]==dbpage ) iLeft++;
|
|
0 |
0 |
if( iLeft<nLeft && aContent[aLeft[iLeft]]==dbpage ) iLeft++;
|
65229
|
0 |
0 |
for(iList=0; iList<nList; iList++){
|
65232
|
0 |
0 |
for(iSub=0; iList & (1<<iSub); iSub++){
|
65244
|
0 |
0 |
for(iSub++; iSub<ArraySize(aSub); iSub++){
|
65245
|
0 |
0 |
if( nList & (1<<iSub) ){
|
65308
|
0 |
0 |
if( !p ){
|
65317
|
0 |
0 |
aTmp = (ht_slot *)sqlite3_malloc64(
|
65320
|
0 |
0 |
if( !aTmp ){
|
65324
|
0 |
0 |
for(i=walFramePage(nBackfill+1); rc==SQLITE_OK && i<nSegment; i++){
|
|
0 |
0 |
for(i=walFramePage(nBackfill+1); rc==SQLITE_OK && i<nSegment; i++){
|
65328
|
0 |
0 |
if( rc==SQLITE_OK ){
|
65333
|
0 |
0 |
if( (i+1)==nSegment ){
|
65341
|
0 |
0 |
for(j=0; j<nEntry; j++){
|
65353
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
65460
|
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) );
|
65507
|
0 |
0 |
for(i=2; i<WAL_NREADER; i++) pInfo->aReadMark[i] = READMARK_NOT_USED;
|
65565
|
0 |
0 |
if( pInfo->nBackfill<pWal->hdr.mxFrame ){
|
65578
|
0 |
0 |
for(i=1; i<WAL_NREADER; i++){
|
65580
|
0 |
0 |
if( mxSafeFrame>y ){
|
65583
|
0 |
0 |
if( rc==SQLITE_OK ){
|
65584
|
0 |
0 |
u32 iMark = (i==1 ? mxSafeFrame : READMARK_NOT_USED);
|
65587
|
0 |
0 |
}else if( rc==SQLITE_BUSY ){
|
65597
|
0 |
0 |
if( pInfo->nBackfill<mxSafeFrame ){
|
65602
|
0 |
0 |
if( pIter
|
65603
|
0 |
0 |
&& (rc = walBusyLock(pWal,xBusy,pBusyArg,WAL_READ_LOCK(0),1))==SQLITE_OK
|
65615
|
0 |
0 |
if( rc==SQLITE_OK ){
|
65620
|
0 |
0 |
if( rc==SQLITE_OK && nSize<nReq ){
|
|
0 |
0 |
if( rc==SQLITE_OK && nSize<nReq ){
|
65621
|
0 |
0 |
if( (nSize+65536+(i64)pWal->hdr.mxFrame*szPage)<nReq ){
|
65635
|
0 |
0 |
while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){
|
|
0 |
0 |
while( rc==SQLITE_OK && 0==walIteratorNext(pIter, &iDbpage, &iFrame) ){
|
65638
|
0 |
0 |
if( AtomicLoad(&db->u1.isInterrupted) ){
|
65639
|
0 |
0 |
rc = db->mallocFailed ? SQLITE_NOMEM_BKPT : SQLITE_INTERRUPT;
|
65642
|
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 ){
|
65648
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
65652
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
65657
|
0 |
0 |
if( rc==SQLITE_OK ){
|
65658
|
0 |
0 |
if( mxSafeFrame==walIndexHdr(pWal)->mxFrame ){
|
65662
|
0 |
0 |
if( rc==SQLITE_OK ){
|
65666
|
0 |
0 |
if( rc==SQLITE_OK ){
|
65675
|
0 |
0 |
if( rc==SQLITE_BUSY ){
|
65687
|
0 |
0 |
if( rc==SQLITE_OK && eMode!=SQLITE_CHECKPOINT_PASSIVE ){
|
|
0 |
0 |
if( rc==SQLITE_OK && eMode!=SQLITE_CHECKPOINT_PASSIVE ){
|
65689
|
0 |
0 |
if( pInfo->nBackfill<pWal->hdr.mxFrame ){
|
65691
|
0 |
0 |
}else if( eMode>=SQLITE_CHECKPOINT_RESTART ){
|
65696
|
0 |
0 |
if( rc==SQLITE_OK ){
|
65697
|
0 |
0 |
if( eMode==SQLITE_CHECKPOINT_TRUNCATE ){
|
65733
|
0 |
0 |
if( rx==SQLITE_OK && (sz > nMax ) ){
|
|
0 |
0 |
if( rx==SQLITE_OK && (sz > nMax ) ){
|
65737
|
0 |
0 |
if( rx ){
|
65753
|
0 |
364 |
if( pWal ){
|
65764
|
0 |
0 |
if( zBuf!=0
|
65765
|
0 |
0 |
&& SQLITE_OK==(rc = sqlite3OsLock(pWal->pDbFd, SQLITE_LOCK_EXCLUSIVE))
|
65767
|
0 |
0 |
if( pWal->exclusiveMode==WAL_NORMAL_MODE ){
|
65773
|
0 |
0 |
if( rc==SQLITE_OK ){
|
65778
|
0 |
0 |
if( bPersist!=1 ){
|
65783
|
0 |
0 |
}else if( pWal->mxWalSize>=0 ){
|
65797
|
0 |
0 |
if( isDelete ){
|
65855
|
0 |
0 |
if( memcmp(&h1, &h2, sizeof(h1))!=0 ){
|
65858
|
0 |
0 |
if( h1.isInit==0 ){
|
65862
|
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] ){
|
65866
|
0 |
0 |
if( memcmp(&pWal->hdr, &h1, sizeof(WalIndexHdr)) ){
|
65906
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
65908
|
0 |
0 |
if( rc==SQLITE_READONLY_CANTINIT ){
|
65936
|
0 |
0 |
badHdr = (page0 ? walIndexTryHdr(pWal, pChanged) : 1);
|
65941
|
0 |
0 |
if( badHdr ){
|
65942
|
0 |
0 |
if( pWal->bShmUnreliable==0 && (pWal->readOnly & WAL_SHM_RDONLY) ){
|
|
0 |
0 |
if( pWal->bShmUnreliable==0 && (pWal->readOnly & WAL_SHM_RDONLY) ){
|
65943
|
0 |
0 |
if( SQLITE_OK==(rc = walLockShared(pWal, WAL_WRITE_LOCK)) ){
|
65949
|
0 |
0 |
if( bWriteLock || SQLITE_OK==(rc = walLockWriter(pWal)) ){
|
|
0 |
0 |
if( bWriteLock || SQLITE_OK==(rc = walLockWriter(pWal)) ){
|
65951
|
0 |
0 |
if( SQLITE_OK==(rc = walIndexPage(pWal, 0, &page0)) ){
|
65953
|
0 |
0 |
if( badHdr ){
|
65962
|
0 |
0 |
if( bWriteLock==0 ){
|
65974
|
0 |
0 |
if( badHdr==0 && pWal->hdr.iVersion!=WALINDEX_MAX_VERSION ){
|
|
0 |
0 |
if( badHdr==0 && pWal->hdr.iVersion!=WALINDEX_MAX_VERSION ){
|
65977
|
0 |
0 |
if( pWal->bShmUnreliable ){
|
65978
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
65985
|
0 |
0 |
if( rc==SQLITE_IOERR_SHORT_READ ) rc = WAL_RETRY;
|
66039
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
66040
|
0 |
0 |
if( rc==SQLITE_BUSY ) rc = WAL_RETRY;
|
66069
|
0 |
0 |
if( rc!=SQLITE_READONLY_CANTINIT ){
|
66070
|
0 |
0 |
rc = (rc==SQLITE_READONLY ? WAL_RETRY : rc);
|
66084
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
66087
|
0 |
0 |
if( szWal<WAL_HDRSIZE ){
|
66095
|
0 |
0 |
rc = (pWal->hdr.mxFrame==0 ? SQLITE_OK : WAL_RETRY);
|
66101
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
66104
|
0 |
0 |
if( memcmp(&pWal->hdr.aSalt, &aBuf[16], 8) ){
|
66117
|
0 |
0 |
if( aFrame==0 ){
|
66129
|
0 |
0 |
for(iOffset=walFrameOffset(pWal->hdr.mxFrame+1, pWal->szPage);
|
66138
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
66139
|
0 |
0 |
if( !walDecodeFrame(pWal, &pgno, &nTruncate, aData, aFrame) ) break;
|
66144
|
0 |
0 |
if( nTruncate ){
|
66154
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
66156
|
0 |
0 |
for(i=0; i<pWal->nWiData; i++){
|
66247
|
0 |
0 |
if( cnt>5 ){
|
66249
|
0 |
0 |
if( cnt>100 ){
|
66253
|
0 |
0 |
if( cnt>=10 ) nDelay = (cnt-9)*(cnt-9)*39;
|
66257
|
0 |
0 |
if( !useWal ){
|
66259
|
0 |
0 |
if( pWal->bShmUnreliable==0 ){
|
66262
|
0 |
0 |
if( rc==SQLITE_BUSY ){
|
66271
|
0 |
0 |
if( pWal->apWiData[0]==0 ){
|
66280
|
0 |
0 |
}else if( SQLITE_OK==(rc = walLockShared(pWal, WAL_RECOVER_LOCK)) ){
|
66283
|
0 |
0 |
}else if( rc==SQLITE_BUSY ){
|
66287
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
66290
|
0 |
0 |
else if( pWal->bShmUnreliable ){
|
66298
|
0 |
0 |
if( !useWal && AtomicLoad(&pInfo->nBackfill)==pWal->hdr.mxFrame
|
|
0 |
0 |
if( !useWal && AtomicLoad(&pInfo->nBackfill)==pWal->hdr.mxFrame
|
66308
|
0 |
0 |
if( rc==SQLITE_OK ){
|
66309
|
0 |
0 |
if( memcmp((void *)walIndexHdr(pWal), &pWal->hdr, sizeof(WalIndexHdr)) ){
|
66328
|
0 |
0 |
}else if( rc!=SQLITE_BUSY ){
|
66346
|
0 |
0 |
for(i=1; i<WAL_NREADER; i++){
|
66348
|
0 |
0 |
if( mxReadMark<=thisMark && thisMark<=mxFrame ){
|
|
0 |
0 |
if( mxReadMark<=thisMark && thisMark<=mxFrame ){
|
66354
|
0 |
0 |
if( (pWal->readOnly & WAL_SHM_RDONLY)==0
|
66355
|
0 |
0 |
&& (mxReadMark<mxFrame || mxI==0)
|
|
0 |
0 |
&& (mxReadMark<mxFrame || mxI==0)
|
66357
|
0 |
0 |
for(i=1; i<WAL_NREADER; i++){
|
66359
|
0 |
0 |
if( rc==SQLITE_OK ){
|
66365
|
0 |
0 |
}else if( rc!=SQLITE_BUSY ){
|
66370
|
0 |
0 |
if( mxI==0 ){
|
66372
|
0 |
0 |
return rc==SQLITE_BUSY ? WAL_RETRY : SQLITE_READONLY_CANTINIT;
|
66376
|
0 |
0 |
if( rc ){
|
66377
|
0 |
0 |
return rc==SQLITE_BUSY ? WAL_RETRY : rc;
|
66415
|
0 |
0 |
if( AtomicLoad(pInfo->aReadMark+mxI)!=mxReadMark
|
66416
|
0 |
0 |
|| memcmp((void *)walIndexHdr(pWal), &pWal->hdr, sizeof(WalIndexHdr))
|
66555
|
0 |
0 |
}while( rc==WAL_RETRY );
|
66628
|
0 |
0 |
if( pWal->readLock>=0 ){
|
66661
|
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) ){
|
66692
|
0 |
0 |
for(iHash=walFramePage(iLast); iHash>=iMinHash; iHash--){
|
66700
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
66705
|
0 |
0 |
while( (iH = AtomicLoad(&sLoc.aHash[iKey]))!=0 ){
|
66707
|
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 ){
|
66711
|
0 |
0 |
if( (nCollide--)==0 ){
|
66716
|
0 |
0 |
if( iRead ) break;
|
66767
|
0 |
336 |
if( pWal && ALWAYS(pWal->readLock>=0) ){
|
|
0 |
0 |
if( pWal && ALWAYS(pWal->readLock>=0) ){
|
66805
|
0 |
0 |
if( pWal->readOnly ){
|
66813
|
0 |
0 |
if( rc ){
|
66822
|
0 |
0 |
if( memcmp(&pWal->hdr, (void *)walIndexHdr(pWal), sizeof(WalIndexHdr))!=0 ){
|
66836
|
0 |
0 |
if( pWal->writeLock ){
|
66859
|
0 |
0 |
if( ALWAYS(pWal->writeLock) ){
|
66868
|
0 |
0 |
for(iFrame=pWal->hdr.mxFrame+1;
|
66869
|
0 |
0 |
ALWAYS(rc==SQLITE_OK) && iFrame<=iMax;
|
66886
|
0 |
0 |
if( iMax!=pWal->hdr.mxFrame ) walCleanupHash(pWal);
|
66917
|
0 |
0 |
if( aWalData[3]!=pWal->nCkpt ){
|
66926
|
0 |
0 |
if( aWalData[0]<pWal->hdr.mxFrame ){
|
66952
|
0 |
0 |
if( pWal->readLock==0 ){
|
66955
|
0 |
0 |
if( pInfo->nBackfill>0 ){
|
66959
|
0 |
0 |
if( rc==SQLITE_OK ){
|
66971
|
0 |
0 |
}else if( rc!=SQLITE_BUSY ){
|
66981
|
0 |
0 |
}while( rc==WAL_RETRY );
|
67018
|
0 |
0 |
if( iOffset<p->iSyncPoint && iOffset+iAmt>=p->iSyncPoint ){
|
|
0 |
0 |
if( iOffset<p->iSyncPoint && iOffset+iAmt>=p->iSyncPoint ){
|
67021
|
0 |
0 |
if( rc ) return rc;
|
67027
|
0 |
0 |
if( iAmt==0 || rc ) return rc;
|
|
0 |
0 |
if( iAmt==0 || rc ) return rc;
|
67048
|
0 |
0 |
if( rc ) return rc;
|
67071
|
0 |
0 |
if( aBuf==0 ) return SQLITE_NOMEM_BKPT;
|
67079
|
0 |
0 |
if( pWal->iReCksum==1 ){
|
67090
|
0 |
0 |
for(; rc==SQLITE_OK && iRead<=iLast; iRead++){
|
|
0 |
0 |
for(; rc==SQLITE_OK && iRead<=iLast; iRead++){
|
67093
|
0 |
0 |
if( rc==SQLITE_OK ){
|
67145
|
0 |
0 |
if( memcmp(&pWal->hdr, (void *)pLive, sizeof(WalIndexHdr))!=0 ){
|
67152
|
0 |
0 |
if( SQLITE_OK!=(rc = walRestartLog(pWal)) ){
|
67161
|
0 |
0 |
if( iFrame==0 ){
|
67169
|
0 |
0 |
if( pWal->nCkpt==0 ) sqlite3_randomness(8, pWal->hdr.aSalt);
|
67183
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
67194
|
0 |
0 |
if( pWal->syncHeader ){
|
67196
|
0 |
0 |
if( rc ) return rc;
|
67199
|
0 |
0 |
if( (int)pWal->szPage!=szPage ){
|
67213
|
0 |
0 |
for(p=pList; p; p=p->pDirty){
|
67220
|
0 |
0 |
if( iFirst && (p->pDirty || isCommit==0) ){
|
|
0 |
0 |
if( iFirst && (p->pDirty || isCommit==0) ){
|
|
0 |
0 |
if( iFirst && (p->pDirty || isCommit==0) ){
|
67224
|
0 |
0 |
if( iWrite>=iFirst ){
|
67227
|
0 |
0 |
if( pWal->iReCksum==0 || iWrite<pWal->iReCksum ){
|
|
0 |
0 |
if( pWal->iReCksum==0 || iWrite<pWal->iReCksum ){
|
67232
|
0 |
0 |
if( rc ) return rc;
|
67240
|
0 |
0 |
nDbSize = (isCommit && p->pDirty==0) ? nTruncate : 0;
|
|
0 |
0 |
nDbSize = (isCommit && p->pDirty==0) ? nTruncate : 0;
|
67242
|
0 |
0 |
if( rc ) return rc;
|
67249
|
0 |
0 |
if( isCommit && pWal->iReCksum ){
|
|
0 |
0 |
if( isCommit && pWal->iReCksum ){
|
67251
|
0 |
0 |
if( rc ) return rc;
|
67268
|
0 |
0 |
if( isCommit && WAL_SYNC_FLAGS(sync_flags)!=0 ){
|
|
0 |
0 |
if( isCommit && WAL_SYNC_FLAGS(sync_flags)!=0 ){
|
67270
|
0 |
0 |
if( pWal->padToSectorBoundary ){
|
67275
|
0 |
0 |
while( iOffset<w.iSyncPoint ){
|
67277
|
0 |
0 |
if( rc ) return rc;
|
67283
|
0 |
0 |
if( bSync ){
|
67293
|
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 ){
|
67295
|
0 |
0 |
if( walFrameOffset(iFrame+nExtra+1, szPage)>pWal->mxWalSize ){
|
67308
|
0 |
0 |
for(p=pList; p && rc==SQLITE_OK; p=p->pDirty){
|
|
0 |
0 |
for(p=pList; p && rc==SQLITE_OK; p=p->pDirty){
|
67309
|
0 |
0 |
if( (p->flags & PGHDR_WAL_APPEND)==0 ) continue;
|
67314
|
0 |
0 |
while( rc==SQLITE_OK && nExtra>0 ){
|
|
0 |
0 |
while( rc==SQLITE_OK && nExtra>0 ){
|
67320
|
0 |
0 |
if( rc==SQLITE_OK ){
|
67326
|
0 |
0 |
if( isCommit ){
|
67331
|
0 |
0 |
if( isCommit ){
|
67375
|
0 |
0 |
if( pWal->readOnly ) return SQLITE_READONLY;
|
67394
|
0 |
0 |
if( rc==SQLITE_OK ){
|
67406
|
0 |
0 |
if( eMode!=SQLITE_CHECKPOINT_PASSIVE ){
|
67408
|
0 |
0 |
if( rc==SQLITE_OK ){
|
67410
|
0 |
0 |
}else if( rc==SQLITE_BUSY ){
|
67420
|
0 |
0 |
if( rc==SQLITE_OK ){
|
67424
|
0 |
0 |
if( isChanged && pWal->pDbFd->pMethods->iVersion>=3 ){
|
|
0 |
0 |
if( isChanged && pWal->pDbFd->pMethods->iVersion>=3 ){
|
67430
|
0 |
0 |
if( rc==SQLITE_OK ){
|
67432
|
0 |
0 |
if( pWal->hdr.mxFrame && walPagesize(pWal)!=nBuf ){
|
|
0 |
0 |
if( pWal->hdr.mxFrame && walPagesize(pWal)!=nBuf ){
|
67439
|
0 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_BUSY ){
|
|
0 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_BUSY ){
|
67440
|
0 |
0 |
if( pnLog ) *pnLog = (int)pWal->hdr.mxFrame;
|
67441
|
0 |
0 |
if( pnCkpt ) *pnCkpt = (int)(walCkptInfo(pWal)->nBackfill);
|
67445
|
0 |
0 |
if( isChanged ){
|
67460
|
0 |
0 |
if( pWal->ckptLock ){
|
67468
|
0 |
0 |
return (rc==SQLITE_OK && eMode!=eMode2 ? SQLITE_BUSY : rc);
|
|
0 |
0 |
return (rc==SQLITE_OK && eMode!=eMode2 ? SQLITE_BUSY : rc);
|
67478
|
0 |
3828 |
if( pWal ){
|
67523
|
0 |
0 |
if( op==0 ){
|
67524
|
0 |
0 |
if( pWal->exclusiveMode!=WAL_NORMAL_MODE ){
|
67526
|
0 |
0 |
if( walLockShared(pWal, WAL_READ_LOCK(pWal->readLock))!=SQLITE_OK ){
|
67534
|
0 |
0 |
}else if( op>0 ){
|
67552
|
0 |
0 |
return (pWal && pWal->exclusiveMode==WAL_HEAPMEMORY_MODE );
|
|
0 |
0 |
return (pWal && pWal->exclusiveMode==WAL_HEAPMEMORY_MODE );
|
68497
|
26541 |
0 |
if( !p->sharable ) return;
|
68499
|
0 |
0 |
if( p->locked ) return;
|
68516
|
0 |
0 |
if( sqlite3_mutex_try(p->pBt->mutex)==SQLITE_OK ){
|
68527
|
0 |
0 |
for(pLater=p->pNext; pLater; pLater=pLater->pNext){
|
68531
|
0 |
0 |
if( pLater->locked ){
|
68536
|
0 |
0 |
for(pLater=p->pNext; pLater; pLater=pLater->pNext){
|
68537
|
0 |
0 |
if( pLater->wantToLock ){
|
68549
|
0 |
26524 |
if( p->sharable ){
|
68552
|
0 |
0 |
if( p->wantToLock==0 ){
|
68595
|
649 |
322 |
for(i=0; i<db->nDb; i++){
|
68597
|
323 |
326 |
if( p && p->sharable ){
|
|
0 |
323 |
if( p && p->sharable ){
|
68605
|
322 |
5788 |
if( db->noSharedCache==0 ) btreeEnterAll(db);
|
68611
|
0 |
0 |
for(i=0; i<db->nDb; i++){
|
68613
|
0 |
0 |
if( p ) sqlite3BtreeLeave(p);
|
68617
|
0 |
6110 |
if( db->noSharedCache==0 ) btreeLeaveAll(db);
|
69021
|
2233 |
0 |
if( !p->sharable ){
|
69028
|
0 |
0 |
if( pBt->pWriter!=p && (pBt->btsFlags & BTS_EXCLUSIVE)!=0 ){
|
|
0 |
0 |
if( pBt->pWriter!=p && (pBt->btsFlags & BTS_EXCLUSIVE)!=0 ){
|
69033
|
0 |
0 |
for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){
|
69045
|
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 ){
|
69047
|
0 |
0 |
if( eLock==WRITE_LOCK ){
|
69097
|
0 |
0 |
for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){
|
69098
|
0 |
0 |
if( pIter->iTable==iTable && pIter->pBtree==p ){
|
|
0 |
0 |
if( pIter->iTable==iTable && pIter->pBtree==p ){
|
69107
|
0 |
0 |
if( !pLock ){
|
69109
|
0 |
0 |
if( !pLock ){
|
69123
|
0 |
0 |
if( eLock>pLock->eLock ){
|
69148
|
0 |
2226 |
while( *ppIter ){
|
69152
|
0 |
0 |
if( pLock->pBtree==p ){
|
69155
|
0 |
0 |
if( pLock->iTable!=1 ){
|
69164
|
1140 |
1086 |
if( pBt->pWriter==p ){
|
69167
|
0 |
1086 |
}else if( pBt->nTransaction==2 ){
|
69186
|
0 |
292 |
if( pBt->pWriter==p ){
|
69190
|
0 |
0 |
for(pLock=pBt->pLock; pLock; pLock=pLock->pNext){
|
69240
|
0 |
0 |
for(p=pBt->pCursor; p; p=p->pNext){
|
69269
|
31 |
17 |
for(p=pBtree->pBt->pCursor; p; p=p->pNext){
|
69270
|
14 |
17 |
if( (p->curFlags & BTCF_Incrblob)!=0 ){
|
69272
|
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) ){
|
69321
|
1 |
0 |
if( !pBt->pHasContent ){
|
69324
|
0 |
1 |
if( !pBt->pHasContent ){
|
69328
|
1 |
0 |
if( rc==SQLITE_OK && pgno<=sqlite3BitvecSize(pBt->pHasContent) ){
|
|
1 |
0 |
if( rc==SQLITE_OK && pgno<=sqlite3BitvecSize(pBt->pHasContent) ){
|
69343
|
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));
|
69360
|
5741 |
453 |
if( pCur->iPage>=0 ){
|
69361
|
1450 |
5741 |
for(i=0; i<pCur->iPage; i++){
|
69388
|
72 |
0 |
if( pCur->curIntKey ){
|
69401
|
0 |
0 |
if( pKey ){
|
69403
|
0 |
0 |
if( rc==SQLITE_OK ){
|
69431
|
0 |
54 |
if( pCur->curFlags & BTCF_Pinned ){
|
69434
|
0 |
54 |
if( pCur->eState==CURSOR_SKIPNEXT ){
|
69441
|
54 |
0 |
if( rc==SQLITE_OK ){
|
69478
|
243 |
785 |
for(p=pBt->pCursor; p; p=p->pNext){
|
69479
|
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;
|
69481
|
119 |
785 |
if( p ) return saveCursorsOnList(p, iRoot, pExcept);
|
69482
|
0 |
785 |
if( pExcept ) pExcept->curFlags &= ~BTCF_Multiple;
|
69497
|
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) ){
|
69498
|
78 |
54 |
if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){
|
|
0 |
78 |
if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){
|
69500
|
0 |
54 |
if( SQLITE_OK!=rc ){
|
69509
|
13 |
119 |
}while( p );
|
69538
|
0 |
18 |
if( pKey ){
|
69542
|
0 |
0 |
if( pIdxKey==0 ) return SQLITE_NOMEM_BKPT;
|
69544
|
0 |
0 |
if( pIdxKey->nField==0 || pIdxKey->nField>pKeyInfo->nAllField ){
|
|
0 |
0 |
if( pIdxKey->nField==0 || pIdxKey->nField>pKeyInfo->nAllField ){
|
69569
|
0 |
18 |
if( pCur->eState==CURSOR_FAULT ){
|
69573
|
0 |
18 |
if( sqlite3FaultSim(410) ){
|
69578
|
18 |
0 |
if( rc==SQLITE_OK ){
|
69582
|
18 |
0 |
if( skipNext ) pCur->skipNext = skipNext;
|
69583
|
18 |
0 |
if( pCur->skipNext && pCur->eState==CURSOR_VALID ){
|
|
10 |
8 |
if( pCur->skipNext && pCur->eState==CURSOR_VALID ){
|
69644
|
0 |
0 |
rc = restoreCursorPosition(pCur);
|
69645
|
0 |
0 |
if( rc ){
|
69649
|
0 |
0 |
if( pCur->eState!=CURSOR_VALID ){
|
69708
|
0 |
0 |
if( pgno<2 ) return 0;
|
69712
|
0 |
0 |
if( ret==PENDING_BYTE_PAGE(pBt) ){
|
69735
|
0 |
0 |
if( *pRC ) return;
|
69742
|
0 |
0 |
if( key==0 ){
|
69748
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
69752
|
0 |
0 |
if( ((char*)sqlite3PagerGetExtra(pDbPage))[0]!=0 ){
|
69760
|
0 |
0 |
if( offset<0 ){
|
69767
|
0 |
0 |
if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){
|
|
0 |
0 |
if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){
|
69770
|
0 |
0 |
if( rc==SQLITE_OK ){
|
69798
|
0 |
0 |
if( rc!=0 ){
|
69804
|
0 |
0 |
if( offset<0 ){
|
69811
|
0 |
0 |
if( pPgno ) *pPgno = get4byte(&pPtrmap[offset+1]);
|
69814
|
0 |
0 |
if( *pEType<1 || *pEType>5 ) return SQLITE_CORRUPT_PGNO(iPtrmap);
|
|
0 |
0 |
if( *pEType<1 || *pEType>5 ) return SQLITE_CORRUPT_PGNO(iPtrmap);
|
69869
|
2 |
50 |
if( surplus <= maxLocal ){
|
69884
|
0 |
0 |
if( nPayload<=maxLocal ){
|
69891
|
0 |
0 |
return ( surplus <= maxLocal ) ? surplus : minLocal;
|
69948
|
354 |
11250 |
if( nPayload>=0x80 ){
|
69953
|
44 |
354 |
}while( (*pIter)>=0x80 && pIter<pEnd );
|
|
44 |
0 |
}while( (*pIter)>=0x80 && pIter<pEnd );
|
69965
|
5365 |
6239 |
if( iKey>=0x80 ){
|
69968
|
0 |
5365 |
if( x>=0x80 ){
|
69970
|
0 |
0 |
if( x>=0x80 ){
|
69972
|
0 |
0 |
if( x>=0x80 ){
|
69974
|
0 |
0 |
if( x>=0x80 ){
|
69976
|
0 |
0 |
if( x>=0x80 ){
|
69978
|
0 |
0 |
if( x>=0x80 ){
|
69980
|
0 |
0 |
if( x>=0x80 ){
|
70001
|
11552 |
52 |
if( nPayload<=pPage->maxLocal ){
|
70006
|
2 |
11550 |
if( pInfo->nSize<4 ) pInfo->nSize = 4;
|
70025
|
0 |
529 |
if( nPayload>=0x80 ){
|
70030
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter<pEnd );
|
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter<pEnd );
|
70038
|
529 |
0 |
if( nPayload<=pPage->maxLocal ){
|
70043
|
1 |
528 |
if( pInfo->nSize<4 ) pInfo->nSize = 4;
|
70087
|
0 |
0 |
if( nSize>=0x80 ){
|
70092
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter<pEnd );
|
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter<pEnd );
|
70097
|
0 |
0 |
if( nSize<=pPage->maxLocal ){
|
70105
|
0 |
0 |
if( nSize>pPage->maxLocal ){
|
70129
|
0 |
0 |
if( nSize>=0x80 ){
|
70134
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter<pEnd );
|
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter<pEnd );
|
70139
|
0 |
0 |
if( nSize<=pPage->maxLocal ){
|
70141
|
0 |
0 |
if( nSize<4 ) nSize = 4;
|
70147
|
0 |
0 |
if( nSize>pPage->maxLocal ){
|
70172
|
0 |
0 |
while( (*pIter++)&0x80 && pIter<pEnd );
|
|
0 |
0 |
while( (*pIter++)&0x80 && pIter<pEnd );
|
70191
|
134 |
24 |
if( nSize>=0x80 ){
|
70196
|
0 |
134 |
}while( *(pIter)>=0x80 && pIter<pEnd );
|
|
0 |
0 |
}while( *(pIter)>=0x80 && pIter<pEnd );
|
70202
|
6 |
152 |
if( (*pIter++)&0x80
|
70203
|
0 |
6 |
&& (*pIter++)&0x80
|
70204
|
0 |
0 |
&& (*pIter++)&0x80
|
70205
|
0 |
0 |
&& (*pIter++)&0x80
|
70206
|
0 |
0 |
&& (*pIter++)&0x80
|
70207
|
0 |
0 |
&& (*pIter++)&0x80
|
70208
|
0 |
0 |
&& (*pIter++)&0x80
|
70209
|
0 |
0 |
&& (*pIter++)&0x80 ){ pIter++; }
|
70212
|
150 |
8 |
if( nSize<=pPage->maxLocal ){
|
70214
|
0 |
150 |
if( nSize<4 ) nSize = 4;
|
70220
|
8 |
0 |
if( nSize>pPage->maxLocal ){
|
70247
|
0 |
0 |
if( *pRC ) return;
|
70250
|
0 |
0 |
if( info.nLocal<info.nPayload ){
|
70252
|
0 |
0 |
if( SQLITE_WITHIN(pSrc->aDataEnd, pCell, pCell+info.nLocal) ){
|
|
0 |
0 |
if( SQLITE_WITHIN(pSrc->aDataEnd, pCell, pCell+info.nLocal) ){
|
70310
|
0 |
0 |
if( (int)data[hdr+7]<=nMaxFrag ){
|
70312
|
0 |
0 |
if( iFree>usableSize-4 ) return SQLITE_CORRUPT_PAGE(pPage);
|
70313
|
0 |
0 |
if( iFree ){
|
70315
|
0 |
0 |
if( iFree2>usableSize-4 ) return SQLITE_CORRUPT_PAGE(pPage);
|
70316
|
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) ){
|
70322
|
0 |
0 |
if( top>=iFree ){
|
70325
|
0 |
0 |
if( iFree2 ){
|
70326
|
0 |
0 |
if( iFree+sz>iFree2 ) return SQLITE_CORRUPT_PAGE(pPage);
|
70328
|
0 |
0 |
if( iFree2+sz2 > usableSize ) return SQLITE_CORRUPT_PAGE(pPage);
|
70331
|
0 |
0 |
}else if( iFree+sz>usableSize ){
|
70338
|
0 |
0 |
for(pAddr=&data[cellOffset]; pAddr<pEnd; pAddr+=2){
|
70340
|
0 |
0 |
if( pc<iFree ){ put2byte(pAddr, pc+sz); }
|
70341
|
0 |
0 |
else if( pc<iFree2 ){ put2byte(pAddr, pc+sz2); }
|
70351
|
0 |
0 |
if( nCell>0 ){
|
70355
|
0 |
0 |
for(i=0; i<nCell; i++){
|
70364
|
0 |
0 |
if( pc>iCellLast ){
|
70370
|
0 |
0 |
if( cbrk<iCellStart || pc+size>usableSize ){
|
|
0 |
0 |
if( cbrk<iCellStart || pc+size>usableSize ){
|
70384
|
0 |
0 |
if( data[hdr+7]+cbrk-iCellFirst!=pPage->nFree ){
|
70421
|
58 |
36 |
while( pc<=maxPC ){
|
70427
|
32 |
26 |
if( (x = size - nByte)>=0 ){
|
70430
|
32 |
0 |
if( x<4 ){
|
70433
|
0 |
32 |
if( aData[hdr+7]>57 ) return 0;
|
70440
|
0 |
0 |
}else if( x+pc > maxPC ){
|
70454
|
26 |
0 |
if( pc<=iAddr ){
|
70455
|
0 |
26 |
if( pc ){
|
70462
|
0 |
36 |
if( pc>maxPC+nByte-4 ){
|
70508
|
0 |
3717 |
if( gap>top ){
|
|
0 |
140 |
if( gap>top ){
|
70509
|
0 |
0 |
if( top==0 && pPage->pBt->usableSize==65536 ){
|
|
0 |
0 |
if( top==0 && pPage->pBt->usableSize==65536 ){
|
|
0 |
0 |
if( top==0 && pPage->pBt->usableSize==65536 ){
|
|
0 |
0 |
if( top==0 && pPage->pBt->usableSize==65536 ){
|
70514
|
0 |
3717 |
}else if( top>(int)pPage->pBt->usableSize ){
|
|
0 |
140 |
}else if( top>(int)pPage->pBt->usableSize ){
|
70525
|
3623 |
94 |
if( (data[hdr+2] || data[hdr+1]) && gap+2<=top ){
|
|
0 |
3623 |
if( (data[hdr+2] || data[hdr+1]) && gap+2<=top ){
|
|
94 |
0 |
if( (data[hdr+2] || data[hdr+1]) && gap+2<=top ){
|
|
140 |
0 |
if( (data[hdr+2] || data[hdr+1]) && gap+2<=top ){
|
|
0 |
140 |
if( (data[hdr+2] || data[hdr+1]) && gap+2<=top ){
|
|
0 |
0 |
if( (data[hdr+2] || data[hdr+1]) && gap+2<=top ){
|
70531
|
0 |
32 |
if( g2<=gap ){
|
|
0 |
0 |
if( g2<=gap ){
|
70536
|
0 |
62 |
}else if( rc ){
|
|
0 |
0 |
}else if( rc ){
|
70545
|
0 |
3685 |
if( gap+2+nByte>top ){
|
|
0 |
140 |
if( gap+2+nByte>top ){
|
70549
|
0 |
0 |
if( rc ) return rc;
|
|
0 |
0 |
if( rc ) return rc;
|
70605
|
289 |
2 |
if( data[iPtr+1]==0 && data[iPtr]==0 ){
|
|
289 |
0 |
if( data[iPtr+1]==0 && data[iPtr]==0 ){
|
70608
|
0 |
2 |
while( (iFreeBlk = get2byte(&data[iPtr]))<iStart ){
|
70609
|
0 |
0 |
if( iFreeBlk<=iPtr ){
|
70610
|
0 |
0 |
if( iFreeBlk==0 ) break; /* TH3: corrupt082.100 */
|
70615
|
0 |
2 |
if( iFreeBlk>pPage->pBt->usableSize-4 ){ /* TH3: corrupt081.100 */
|
70626
|
2 |
0 |
if( iFreeBlk && iEnd+3>=iFreeBlk ){
|
|
2 |
0 |
if( iFreeBlk && iEnd+3>=iFreeBlk ){
|
70628
|
0 |
2 |
if( iEnd>iFreeBlk ) return SQLITE_CORRUPT_PAGE(pPage);
|
70630
|
0 |
2 |
if( iEnd > pPage->pBt->usableSize ){
|
70641
|
0 |
2 |
if( iPtr>hdr+1 ){
|
70643
|
0 |
0 |
if( iPtrEnd+3>=iStart ){
|
70644
|
0 |
0 |
if( iPtrEnd>iStart ) return SQLITE_CORRUPT_PAGE(pPage);
|
70650
|
0 |
2 |
if( nFrag>data[hdr+7] ) return SQLITE_CORRUPT_PAGE(pPage);
|
70655
|
0 |
291 |
if( pPage->pBt->btsFlags & BTS_FAST_SECURE ){
|
70660
|
227 |
64 |
if( iStart<=x ){
|
70664
|
0 |
227 |
if( iStart<x ) return SQLITE_CORRUPT_PAGE(pPage);
|
70665
|
0 |
227 |
if( iPtr!=hdr+1 ) return SQLITE_CORRUPT_PAGE(pPage);
|
70697
|
767 |
8 |
if( flagByte>=(PTF_ZERODATA | PTF_LEAF) ){
|
70700
|
716 |
51 |
if( flagByte==(PTF_LEAFDATA | PTF_INTKEY | PTF_LEAF) ){
|
70707
|
51 |
0 |
}else if( flagByte==(PTF_ZERODATA | PTF_LEAF) ){
|
70724
|
0 |
8 |
if( flagByte==(PTF_ZERODATA) ){
|
70731
|
8 |
0 |
}else if( flagByte==(PTF_LEAFDATA | PTF_INTKEY) ){
|
70788
|
0 |
48 |
if( pc>0 ){
|
70790
|
0 |
0 |
if( pc<top ){
|
70797
|
0 |
0 |
if( pc>iCellLast ){
|
70804
|
0 |
0 |
if( next<=pc+size+3 ) break;
|
70807
|
0 |
0 |
if( next>0 ){
|
70811
|
0 |
0 |
if( pc+size>(unsigned int)usableSize ){
|
70824
|
48 |
0 |
if( nFree>usableSize || nFree<iCellFirst ){
|
|
0 |
48 |
if( nFree>usableSize || nFree<iCellFirst ){
|
70850
|
0 |
0 |
if( !pPage->leaf ) iCellLast--;
|
70851
|
0 |
0 |
for(i=0; i<pPage->nCell; i++){
|
70855
|
0 |
0 |
if( pc<iCellFirst || pc>iCellLast ){
|
|
0 |
0 |
if( pc<iCellFirst || pc>iCellLast ){
|
70860
|
0 |
0 |
if( pc+sz>usableSize ){
|
70892
|
0 |
109 |
if( decodeFlags(pPage, data[0]) ){
|
70905
|
0 |
109 |
if( pPage->nCell>MX_CELL(pBt) ){
|
70919
|
0 |
109 |
if( pBt->db->flags & SQLITE_CellSizeCk ){
|
70940
|
0 |
666 |
if( pBt->btsFlags & BTS_FAST_SECURE ){
|
70944
|
7 |
659 |
first = hdr + ((flags&PTF_LEAF)==0 ? 12 : 8);
|
70968
|
1327 |
2203 |
if( pgno!=pPage->pgno ){
|
70973
|
285 |
1042 |
pPage->hdrOffset = pgno==1 ? 100 : 0;
|
71002
|
17 |
3429 |
if( rc ) return rc;
|
71016
|
0 |
0 |
if( pDbPage ){
|
71061
|
0 |
7465 |
if( pgno>btreePagecount(pBt) ){
|
71066
|
0 |
7465 |
if( rc ){
|
71070
|
101 |
7364 |
if( (*ppPage)->isInit==0 ){
|
71073
|
0 |
101 |
if( rc!=SQLITE_OK ){
|
71082
|
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) ){
|
71091
|
0 |
0 |
if( pCur ){
|
71116
|
902 |
2028 |
if( pPage ) releasePageNotNull(pPage);
|
71145
|
1001 |
0 |
if( rc==SQLITE_OK ){
|
71146
|
0 |
1001 |
if( sqlite3PagerPageRefcount((*ppPage)->pDbPage)>1 ){
|
71171
|
29 |
0 |
if( pPage->isInit ){
|
71174
|
1 |
28 |
if( sqlite3PagerPageRefcount(pData)>1 ){
|
71233
|
322 |
50 |
const int isTempDb = zFilename==0 || zFilename[0]==0;
|
|
3 |
319 |
const int isTempDb = zFilename==0 || zFilename[0]==0;
|
71241
|
115 |
207 |
const int isMemdb = (zFilename && strcmp(zFilename, ":memory:")==0)
|
71242
|
53 |
112 |
|| (isTempDb && sqlite3TempInMemory(db))
|
|
53 |
0 |
|| (isTempDb && sqlite3TempInMemory(db))
|
71243
|
322 |
50 |
|| (vfsFlags & SQLITE_OPEN_MEMORY)!=0;
|
|
0 |
165 |
|| (vfsFlags & SQLITE_OPEN_MEMORY)!=0;
|
71257
|
207 |
165 |
if( isMemdb ){
|
71260
|
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) ){
|
71264
|
0 |
372 |
if( !p ){
|
71279
|
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) ){
|
71280
|
0 |
112 |
if( vfsFlags & SQLITE_OPEN_SHAREDCACHE ){
|
71287
|
0 |
0 |
if( !zFullPathname ){
|
71291
|
0 |
0 |
if( isMemdb ){
|
71296
|
0 |
0 |
if( rc ){
|
71297
|
0 |
0 |
if( rc==SQLITE_OK_SYMLINK ){
|
71312
|
0 |
0 |
for(pBt=GLOBAL(BtShared*,sqlite3SharedCacheList); pBt; pBt=pBt->pNext){
|
71314
|
0 |
0 |
if( 0==strcmp(zFullPathname, sqlite3PagerFilename(pBt->pPager, 0))
|
71315
|
0 |
0 |
&& sqlite3PagerVfs(pBt->pPager)==pVfs ){
|
71317
|
0 |
0 |
for(iDb=db->nDb-1; iDb>=0; iDb--){
|
71319
|
0 |
0 |
if( pExisting && pExisting->pBt==pBt ){
|
|
0 |
0 |
if( pExisting && pExisting->pBt==pBt ){
|
71347
|
372 |
0 |
if( pBt==0 ){
|
71360
|
0 |
372 |
if( pBt==0 ){
|
71366
|
366 |
6 |
if( rc==SQLITE_OK ){
|
71370
|
6 |
366 |
if( rc!=SQLITE_OK ){
|
71380
|
5 |
361 |
if( sqlite3PagerIsreadonly(pBt->pPager) ) pBt->btsFlags |= BTS_READ_ONLY;
|
71390
|
27 |
339 |
if( pBt->pageSize<512 || pBt->pageSize>SQLITE_MAX_PAGE_SIZE
|
|
27 |
0 |
if( pBt->pageSize<512 || pBt->pageSize>SQLITE_MAX_PAGE_SIZE
|
71391
|
0 |
27 |
|| ((pBt->pageSize-1)&pBt->pageSize)!=0 ){
|
71400
|
289 |
50 |
if( zFilename && !isMemdb ){
|
|
82 |
207 |
if( zFilename && !isMemdb ){
|
71418
|
0 |
366 |
if( rc ) goto btree_open_out;
|
71426
|
0 |
366 |
if( p->sharable ){
|
71429
|
0 |
0 |
if( SQLITE_THREADSAFE && sqlite3GlobalConfig.bCoreMutex ){
|
71431
|
0 |
0 |
if( pBt->mutex==0 ){
|
71449
|
0 |
366 |
if( p->sharable ){
|
71452
|
0 |
0 |
for(i=0; i<db->nDb; i++){
|
71453
|
0 |
0 |
if( (pSib = db->aDb[i].pBt)!=0 && pSib->sharable ){
|
|
0 |
0 |
if( (pSib = db->aDb[i].pBt)!=0 && pSib->sharable ){
|
71454
|
0 |
0 |
while( pSib->pPrev ){ pSib = pSib->pPrev; }
|
71455
|
0 |
0 |
if( (uptr)p->pBt<(uptr)pSib->pBt ){
|
71460
|
0 |
0 |
while( pSib->pNext && (uptr)pSib->pNext->pBt<(uptr)p->pBt ){
|
|
0 |
0 |
while( pSib->pNext && (uptr)pSib->pNext->pBt<(uptr)p->pBt ){
|
71465
|
0 |
0 |
if( p->pNext ){
|
71478
|
6 |
366 |
if( rc!=SQLITE_OK ){
|
71479
|
6 |
0 |
if( pBt && pBt->pPager ){
|
|
0 |
6 |
if( pBt && pBt->pPager ){
|
71492
|
366 |
0 |
if( sqlite3BtreeSchema(p, 0, 0)==0 ){
|
71497
|
106 |
260 |
if( pFile->pMethods ){
|
71501
|
0 |
372 |
if( mutexOpen ){
|
71525
|
0 |
0 |
if( pBt->nRef<=0 ){
|
71526
|
0 |
0 |
if( GLOBAL(BtShared*,sqlite3SharedCacheList)==pBt ){
|
71530
|
0 |
0 |
while( ALWAYS(pList) && pList->pNext!=pBt ){
|
|
0 |
0 |
while( ALWAYS(pList) && pList->pNext!=pBt ){
|
71533
|
0 |
0 |
if( ALWAYS(pList) ){
|
71561
|
0 |
210 |
if( pBt->pTmpSpace==0 ){
|
71592
|
208 |
160 |
if( pBt->pTmpSpace ){
|
71634
|
0 |
364 |
if( !p->sharable || removeFromSharingList(pBt) ){
|
|
0 |
0 |
if( !p->sharable || removeFromSharingList(pBt) ){
|
71642
|
314 |
50 |
if( pBt->xFreeSchema && pBt->pSchema ){
|
|
314 |
0 |
if( pBt->xFreeSchema && pBt->pSchema ){
|
71653
|
0 |
364 |
if( p->pPrev ) p->pPrev->pNext = p->pNext;
|
71654
|
0 |
364 |
if( p->pNext ) p->pNext->pPrev = p->pPrev;
|
71762
|
0 |
41 |
if( nReserve<x ) nReserve = x;
|
71763
|
4 |
37 |
if( pBt->btsFlags & BTS_PAGESIZE_FIXED ){
|
71768
|
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 &&
|
71772
|
0 |
4 |
if( nReserve>32 && pageSize==512 ) pageSize = 1024;
|
|
0 |
0 |
if( nReserve>32 && pageSize==512 ) pageSize = 1024;
|
71778
|
0 |
37 |
if( iFix ) pBt->btsFlags |= BTS_PAGESIZE_FIXED;
|
71860
|
0 |
10 |
if( p==0 ) return 0;
|
71864
|
5 |
5 |
if( newFlag>=0 ){
|
71888
|
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 ){
|
71910
|
0 |
0 |
(!p->pBt->autoVacuum)?BTREE_AUTOVACUUM_NONE:
|
71911
|
0 |
0 |
(!p->pBt->incrVacuum)?BTREE_AUTOVACUUM_FULL:
|
71968
|
2 |
2378 |
if( rc!=SQLITE_OK ) return rc;
|
71970
|
0 |
2378 |
if( rc!=SQLITE_OK ) return rc;
|
71977
|
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 ){
|
71980
|
0 |
2378 |
if( (pBt->db->flags & SQLITE_ResetDatabase)!=0 ){
|
71983
|
1975 |
403 |
if( nPage>0 ){
|
71991
|
0 |
1975 |
if( memcmp(page1, zMagicHeader, 16)!=0 ){
|
72003
|
0 |
1975 |
if( page1[18]>2 ){
|
72006
|
0 |
1975 |
if( page1[19]>2 ){
|
72018
|
0 |
1975 |
if( page1[19]==2 && (pBt->btsFlags & BTS_NO_WAL)==0 ){
|
|
0 |
0 |
if( page1[19]==2 && (pBt->btsFlags & BTS_NO_WAL)==0 ){
|
72021
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
72025
|
0 |
0 |
if( isOpen==0 ){
|
72042
|
0 |
1975 |
if( memcmp(&page1[21], "\100\040\040",3)!=0 ){
|
72051
|
1975 |
0 |
if( ((pageSize-1)&pageSize)!=0
|
72052
|
1975 |
0 |
|| pageSize>SQLITE_MAX_PAGE_SIZE
|
72053
|
1975 |
0 |
|| pageSize<=256
|
72067
|
0 |
1975 |
if( (u32)pageSize!=pBt->pageSize ){
|
72082
|
0 |
1975 |
if( nPage>nPageFile ){
|
72083
|
0 |
0 |
if( sqlite3WritableSchema(pBt->db)==0 ){
|
72093
|
0 |
1975 |
if( usableSize<480 ){
|
72121
|
2378 |
0 |
if( pBt->maxLocal>127 ){
|
72172
|
3091 |
6044 |
if( pBt->inTransaction==TRANS_NONE && pBt->pPage1!=0 ){
|
|
2378 |
713 |
if( pBt->inTransaction==TRANS_NONE && pBt->pPage1!=0 ){
|
72192
|
995 |
200 |
if( pBt->nPage>0 ){
|
72199
|
0 |
200 |
if( rc ) return rc;
|
72286
|
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) ){
|
72291
|
0 |
2235 |
if( (p->db->flags & SQLITE_ResetDatabase)
|
72292
|
0 |
0 |
&& sqlite3PagerIsreadonly(pPager)==0
|
72298
|
4 |
2231 |
if( (pBt->btsFlags & BTS_READ_ONLY)!=0 && wrflag ){
|
|
2 |
2 |
if( (pBt->btsFlags & BTS_READ_ONLY)!=0 && wrflag ){
|
72310
|
1147 |
1086 |
if( (wrflag && pBt->inTransaction==TRANS_WRITE)
|
|
1147 |
0 |
if( (wrflag && pBt->inTransaction==TRANS_WRITE)
|
72311
|
0 |
2233 |
|| (pBt->btsFlags & BTS_PENDING)!=0
|
72314
|
14 |
2219 |
}else if( wrflag>1 ){
|
72316
|
0 |
14 |
for(pIter=pBt->pLock; pIter; pIter=pIter->pNext){
|
72317
|
0 |
0 |
if( pIter->pBtree!=p ){
|
72323
|
0 |
2233 |
if( pBlock ){
|
72335
|
0 |
2233 |
if( SQLITE_OK!=rc ) goto trans_begun;
|
72338
|
437 |
1796 |
if( pBt->nPage==0 ) pBt->btsFlags |= BTS_INITIALLY_EMPTY;
|
72359
|
2380 |
2378 |
while( pBt->pPage1==0 && SQLITE_OK==(rc = lockBtree(pBt)) );
|
|
2378 |
2 |
while( pBt->pPage1==0 && SQLITE_OK==(rc = lockBtree(pBt)) );
|
72361
|
2378 |
2 |
if( rc==SQLITE_OK && wrflag ){
|
|
1292 |
1086 |
if( rc==SQLITE_OK && wrflag ){
|
72362
|
0 |
1292 |
if( (pBt->btsFlags & BTS_READ_ONLY)!=0 ){
|
72366
|
1140 |
152 |
if( rc==SQLITE_OK ){
|
72368
|
0 |
152 |
}else if( rc==SQLITE_BUSY_SNAPSHOT && pBt->inTransaction==TRANS_NONE ){
|
|
0 |
0 |
}else if( rc==SQLITE_BUSY_SNAPSHOT && pBt->inTransaction==TRANS_NONE ){
|
72377
|
154 |
2226 |
if( rc!=SQLITE_OK ){
|
72382
|
154 |
2226 |
btreeInvokeBusyHandler(pBt) );
|
72388
|
2226 |
7 |
if( rc==SQLITE_OK ){
|
72389
|
2226 |
0 |
if( p->inTrans==TRANS_NONE ){
|
72392
|
0 |
2226 |
if( p->sharable ){
|
72400
|
1140 |
1086 |
p->inTrans = (wrflag?TRANS_WRITE:TRANS_READ);
|
72401
|
2226 |
0 |
if( p->inTrans>pBt->inTransaction ){
|
72404
|
1140 |
1086 |
if( wrflag ){
|
72410
|
14 |
1126 |
if( wrflag>1 ) pBt->btsFlags |= BTS_EXCLUSIVE;
|
72419
|
0 |
1140 |
if( pBt->nPage!=get4byte(&pPage1->aData[28]) ){
|
72421
|
0 |
0 |
if( rc==SQLITE_OK ){
|
72429
|
5793 |
9 |
if( rc==SQLITE_OK ){
|
72430
|
5561 |
232 |
if( pSchemaVersion ){
|
72433
|
3760 |
2033 |
if( wrflag ){
|
72462
|
0 |
0 |
rc = pPage->isInit ? SQLITE_OK : btreeInitPage(pPage);
|
72463
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
72466
|
0 |
0 |
for(i=0; i<nCell; i++){
|
72471
|
0 |
0 |
if( !pPage->leaf ){
|
72477
|
0 |
0 |
if( !pPage->leaf ){
|
72502
|
0 |
0 |
if( eType==PTRMAP_OVERFLOW2 ){
|
72504
|
0 |
0 |
if( get4byte(pPage->aData)!=iFrom ){
|
72513
|
0 |
0 |
rc = pPage->isInit ? SQLITE_OK : btreeInitPage(pPage);
|
72514
|
0 |
0 |
if( rc ) return rc;
|
72517
|
0 |
0 |
for(i=0; i<nCell; i++){
|
72519
|
0 |
0 |
if( eType==PTRMAP_OVERFLOW1 ){
|
72522
|
0 |
0 |
if( info.nLocal<info.nPayload ){
|
72523
|
0 |
0 |
if( pCell+info.nSize > pPage->aData+pPage->pBt->usableSize ){
|
72526
|
0 |
0 |
if( iFrom==get4byte(pCell+info.nSize-4) ){
|
72532
|
0 |
0 |
if( pCell+4 > pPage->aData+pPage->pBt->usableSize ){
|
72535
|
0 |
0 |
if( get4byte(pCell)==iFrom ){
|
72542
|
0 |
0 |
if( i==nCell ){
|
72580
|
0 |
0 |
if( iDbPage<3 ) return SQLITE_CORRUPT_BKPT;
|
72586
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
72599
|
0 |
0 |
if( eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE ){
|
|
0 |
0 |
if( eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE ){
|
72601
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
72606
|
0 |
0 |
if( nextOvfl!=0 ){
|
72608
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
72618
|
0 |
0 |
if( eType!=PTRMAP_ROOTPAGE ){
|
72620
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
72624
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
72630
|
0 |
0 |
if( rc==SQLITE_OK ){
|
72664
|
0 |
0 |
if( !PTRMAP_ISPAGE(pBt, iLastPg) && iLastPg!=PENDING_BYTE_PAGE(pBt) ){
|
|
0 |
0 |
if( !PTRMAP_ISPAGE(pBt, iLastPg) && iLastPg!=PENDING_BYTE_PAGE(pBt) ){
|
72669
|
0 |
0 |
if( nFreeList==0 ){
|
72674
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
72677
|
0 |
0 |
if( eType==PTRMAP_ROOTPAGE ){
|
72681
|
0 |
0 |
if( eType==PTRMAP_FREEPAGE ){
|
72682
|
0 |
0 |
if( bCommit==0 ){
|
72691
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
72704
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
72715
|
0 |
0 |
if( bCommit==0 ){
|
72723
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
72728
|
0 |
0 |
if( iFreePg>dbSize ){
|
72732
|
0 |
0 |
}while( bCommit && iFreePg>nFin );
|
|
0 |
0 |
}while( bCommit && iFreePg>nFin );
|
72737
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
72743
|
0 |
0 |
if( bCommit==0 ){
|
72746
|
0 |
0 |
}while( iLastPg==PENDING_BYTE_PAGE(pBt) || PTRMAP_ISPAGE(pBt, iLastPg) );
|
|
0 |
0 |
}while( iLastPg==PENDING_BYTE_PAGE(pBt) || PTRMAP_ISPAGE(pBt, iLastPg) );
|
72766
|
0 |
0 |
if( nOrig>PENDING_BYTE_PAGE(pBt) && nFin<PENDING_BYTE_PAGE(pBt) ){
|
|
0 |
0 |
if( nOrig>PENDING_BYTE_PAGE(pBt) && nFin<PENDING_BYTE_PAGE(pBt) ){
|
72769
|
0 |
0 |
while( PTRMAP_ISPAGE(pBt, nFin) || nFin==PENDING_BYTE_PAGE(pBt) ){
|
|
0 |
0 |
while( PTRMAP_ISPAGE(pBt, nFin) || nFin==PENDING_BYTE_PAGE(pBt) ){
|
72790
|
0 |
0 |
if( !pBt->autoVacuum ){
|
72797
|
0 |
0 |
if( nOrig<nFin || nFree>=nOrig ){
|
|
0 |
0 |
if( nOrig<nFin || nFree>=nOrig ){
|
72799
|
0 |
0 |
}else if( nFree>0 ){
|
72801
|
0 |
0 |
if( rc==SQLITE_OK ){
|
72805
|
0 |
0 |
if( rc==SQLITE_OK ){
|
72836
|
0 |
0 |
if( !pBt->incrVacuum ){
|
72844
|
0 |
0 |
if( PTRMAP_ISPAGE(pBt, nOrig) || nOrig==PENDING_BYTE_PAGE(pBt) ){
|
|
0 |
0 |
if( PTRMAP_ISPAGE(pBt, nOrig) || nOrig==PENDING_BYTE_PAGE(pBt) ){
|
72854
|
0 |
0 |
if( db->xAutovacPages ){
|
72856
|
0 |
0 |
for(iDb=0; ALWAYS(iDb<db->nDb); iDb++){
|
72857
|
0 |
0 |
if( db->aDb[iDb].pBt==p ) break;
|
72866
|
0 |
0 |
if( nVac>nFree ){
|
72869
|
0 |
0 |
if( nVac==0 ){
|
72876
|
0 |
0 |
if( nFin>nOrig ) return SQLITE_CORRUPT_BKPT;
|
72877
|
0 |
0 |
if( nFin<nOrig ){
|
72880
|
0 |
0 |
for(iFree=nOrig; iFree>nFin && rc==SQLITE_OK; iFree--){
|
|
0 |
0 |
for(iFree=nOrig; iFree>nFin && rc==SQLITE_OK; iFree--){
|
72883
|
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 ){
|
72885
|
0 |
0 |
if( nVac==nFree ){
|
72893
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
72934
|
1071 |
1977 |
if( p->inTrans==TRANS_WRITE ){
|
72938
|
0 |
1071 |
if( pBt->autoVacuum ){
|
72940
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
72945
|
0 |
1071 |
if( pBt->bDoTruncate ){
|
72967
|
2518 |
711 |
if( p->inTrans>TRANS_NONE && db->nVdbeRead>1 ){
|
|
292 |
2226 |
if( p->inTrans>TRANS_NONE && db->nVdbeRead>1 ){
|
72978
|
2226 |
711 |
if( p->inTrans!=TRANS_NONE ){
|
72981
|
2226 |
0 |
if( 0==pBt->nTransaction ){
|
73023
|
601 |
2455 |
if( p->inTrans==TRANS_NONE ) return SQLITE_OK;
|
73030
|
1079 |
1376 |
if( p->inTrans==TRANS_WRITE ){
|
73036
|
0 |
1079 |
if( rc!=SQLITE_OK && bCleanup==0 ){
|
|
0 |
0 |
if( rc!=SQLITE_OK && bCleanup==0 ){
|
73057
|
207 |
0 |
if( rc==SQLITE_OK ){
|
73095
|
29 |
1 |
if( pBtree ){
|
73097
|
0 |
29 |
for(p=pBtree->pBt->pCursor; p; p=p->pNext){
|
73098
|
0 |
0 |
if( writeOnly && (p->curFlags & BTCF_WriteFlag)==0 ){
|
|
0 |
0 |
if( writeOnly && (p->curFlags & BTCF_WriteFlag)==0 ){
|
73099
|
0 |
0 |
if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){
|
|
0 |
0 |
if( p->eState==CURSOR_VALID || p->eState==CURSOR_SKIPNEXT ){
|
73101
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
73125
|
5 |
94 |
if( nPage==0 ) sqlite3PagerPagecount(pBt->pPager, &nPage);
|
73149
|
746 |
28 |
if( tripCode==SQLITE_OK ){
|
73151
|
0 |
746 |
if( rc ) writeOnly = 0;
|
73155
|
28 |
746 |
if( tripCode ){
|
73158
|
0 |
28 |
if( rc2!=SQLITE_OK ) rc = rc2;
|
73162
|
61 |
713 |
if( p->inTrans==TRANS_WRITE ){
|
73167
|
0 |
61 |
if( rc2!=SQLITE_OK ){
|
73174
|
44 |
17 |
if( btreeGetPage(pBt, 1, &pPage1, 0)==SQLITE_OK ){
|
73239
|
57 |
3 |
if( p && p->inTrans==TRANS_WRITE ){
|
|
55 |
2 |
if( p && p->inTrans==TRANS_WRITE ){
|
73244
|
1 |
54 |
if( op==SAVEPOINT_ROLLBACK ){
|
73247
|
55 |
0 |
if( rc==SQLITE_OK ){
|
73250
|
55 |
0 |
if( rc==SQLITE_OK ){
|
73251
|
0 |
55 |
if( iSavepoint<0 && (pBt->btsFlags & BTS_INITIALLY_EMPTY)!=0 ){
|
|
0 |
0 |
if( iSavepoint<0 && (pBt->btsFlags & BTS_INITIALLY_EMPTY)!=0 ){
|
73338
|
1200 |
4844 |
if( iTable<=1 ){
|
73339
|
0 |
1200 |
if( iTable<1 ){
|
73341
|
200 |
1000 |
}else if( btreePagecount(pBt)==0 ){
|
73357
|
802 |
6044 |
for(pX=pBt->pCursor; pX; pX=pX->pNext){
|
73358
|
495 |
307 |
if( pX->pgnoRoot==iTable ){
|
73366
|
4155 |
1889 |
if( wrFlag ){
|
73369
|
210 |
3945 |
if( pBt->pTmpSpace==0 ) return allocateTempSpace(pBt);
|
73395
|
0 |
6044 |
if( p->sharable ){
|
73432
|
6044 |
0 |
if( pBtree ){
|
73436
|
5738 |
306 |
if( pBt->pCursor==pCur ){
|
73441
|
306 |
6 |
if( pPrev->pNext==pCur ){
|
73446
|
6 |
0 |
}while( ALWAYS(pPrev) );
|
73452
|
17 |
6027 |
if( (pBt->openFlags & BTREE_SINGLE) && pBt->pCursor==0 ){
|
|
17 |
0 |
if( (pBt->openFlags & BTREE_SINGLE) && pBt->pCursor==0 ){
|
73492
|
11603 |
1365 |
if( pCur->info.nSize==0 ){
|
73629
|
0 |
0 |
if( pBt->autoVacuum ){
|
73634
|
0 |
0 |
while( PTRMAP_ISPAGE(pBt, iGuess) || iGuess==PENDING_BYTE_PAGE(pBt) ){
|
|
0 |
0 |
while( PTRMAP_ISPAGE(pBt, iGuess) || iGuess==PENDING_BYTE_PAGE(pBt) ){
|
73638
|
0 |
0 |
if( iGuess<=btreePagecount(pBt) ){
|
73640
|
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 ){
|
73649
|
0 |
0 |
if( rc==SQLITE_OK ){
|
73650
|
0 |
0 |
rc = btreeGetPage(pBt, ovfl, &pPage, (ppPage==0) ? PAGER_GET_READONLY : 0);
|
73652
|
0 |
0 |
if( rc==SQLITE_OK ){
|
73658
|
0 |
0 |
if( ppPage ){
|
73663
|
0 |
0 |
return (rc==SQLITE_DONE ? SQLITE_OK : rc);
|
73684
|
0 |
655 |
if( eOp ){
|
73687
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
73746
|
0 |
87 |
if( pCur->ix>=pPage->nCell ){
|
73756
|
0 |
87 |
if( (uptr)(aPayload - pPage->aData) > (pBt->usableSize - pCur->info.nLocal) ){
|
73766
|
87 |
0 |
if( offset<pCur->info.nLocal ){
|
73768
|
19 |
68 |
if( a+offset>pCur->info.nLocal ){
|
73780
|
87 |
0 |
if( rc==SQLITE_OK && amt>0 ){
|
|
19 |
68 |
if( rc==SQLITE_OK && amt>0 ){
|
73793
|
19 |
0 |
if( (pCur->curFlags & BTCF_ValidOvfl)==0 ){
|
73795
|
7 |
12 |
if( pCur->aOverflow==0
|
73796
|
0 |
7 |
|| nOvfl*(int)sizeof(Pgno) > sqlite3MallocSize(pCur->aOverflow)
|
73801
|
0 |
12 |
if( aNew==0 ){
|
73814
|
0 |
0 |
if( pCur->aOverflow[offset/ovflSize] ){
|
73822
|
568 |
0 |
while( nextPage ){
|
73824
|
0 |
568 |
if( nextPage > pBt->nPage ) return SQLITE_CORRUPT_BKPT;
|
73830
|
0 |
568 |
if( offset>=ovflSize ){
|
73839
|
0 |
0 |
if( pCur->aOverflow[iIdx+1] ){
|
73850
|
549 |
19 |
if( a + offset > ovflSize ){
|
73887
|
568 |
0 |
rc = sqlite3PagerGet(pBt->pPager, nextPage, &pDbPage,
|
73890
|
568 |
0 |
if( rc==SQLITE_OK ){
|
73899
|
19 |
549 |
if( amt==0 ) return rc;
|
73902
|
0 |
549 |
if( rc ) break;
|
73907
|
68 |
0 |
if( rc==SQLITE_OK && amt>0 ){
|
|
0 |
68 |
if( rc==SQLITE_OK && amt>0 ){
|
73951
|
0 |
0 |
if ( pCur->eState==CURSOR_INVALID ){
|
73956
|
0 |
0 |
return rc ? rc : accessPayload(pCur, offset, amt, pBuf, 0);
|
73959
|
72 |
0 |
if( pCur->eState==CURSOR_VALID ){
|
74001
|
0 |
9286 |
if( amt>(int)(pCur->pPage->aDataEnd - pCur->info.pPayload) ){
|
74045
|
0 |
1686 |
if( pCur->iPage>=(BTCURSOR_MAX_DEPTH-1) ){
|
74140
|
825 |
5941 |
if( pCur->iPage>=0 ){
|
74141
|
85 |
740 |
if( pCur->iPage ){
|
74143
|
0 |
85 |
while( --pCur->iPage ){
|
74149
|
200 |
5741 |
}else if( pCur->pgnoRoot==0 ){
|
74154
|
0 |
5741 |
if( pCur->eState>=CURSOR_REQUIRESEEK ){
|
74155
|
0 |
0 |
if( pCur->eState==CURSOR_FAULT ){
|
74163
|
0 |
5741 |
if( rc!=SQLITE_OK ){
|
74184
|
6481 |
0 |
if( pRoot->isInit==0 || (pCur->pKeyInfo==0)!=pRoot->intKey ){
|
|
0 |
6481 |
if( pRoot->isInit==0 || (pCur->pKeyInfo==0)!=pRoot->intKey ){
|
74193
|
5682 |
884 |
if( pRoot->nCell>0 ){
|
74195
|
0 |
884 |
}else if( !pRoot->leaf ){
|
74197
|
0 |
0 |
if( pRoot->pgno!=1 ) return SQLITE_CORRUPT_BKPT;
|
74222
|
965 |
0 |
while( rc==SQLITE_OK && !(pPage = pCur->pPage)->leaf ){
|
|
12 |
953 |
while( rc==SQLITE_OK && !(pPage = pCur->pPage)->leaf ){
|
74247
|
1437 |
2856 |
while( !(pPage = pCur->pPage)->leaf ){
|
74251
|
0 |
1437 |
if( rc ) return rc;
|
74269
|
939 |
277 |
if( rc==SQLITE_OK ){
|
74273
|
277 |
0 |
}else if( rc==SQLITE_EMPTY ){
|
74287
|
2856 |
370 |
if( rc==SQLITE_OK ){
|
74291
|
2856 |
0 |
if( rc==SQLITE_OK ){
|
74296
|
370 |
0 |
}else if( rc==SQLITE_EMPTY ){
|
74308
|
2 |
3225 |
if( CURSOR_VALID==pCur->eState && (pCur->curFlags & BTCF_AtLast)!=0 ){
|
|
1 |
1 |
if( CURSOR_VALID==pCur->eState && (pCur->curFlags & BTCF_AtLast)!=0 ){
|
74366
|
3254 |
1604 |
if( pCur->eState==CURSOR_VALID && (pCur->curFlags & BTCF_ValidNKey)!=0 ){
|
|
3248 |
6 |
if( pCur->eState==CURSOR_VALID && (pCur->curFlags & BTCF_ValidNKey)!=0 ){
|
74367
|
0 |
3248 |
if( pCur->info.nKey==intKey ){
|
74371
|
2899 |
349 |
if( pCur->info.nKey<intKey ){
|
74372
|
2850 |
49 |
if( (pCur->curFlags & BTCF_AtLast)!=0 ){
|
74380
|
2 |
47 |
if( pCur->info.nKey+1==intKey ){
|
74383
|
2 |
0 |
if( rc==SQLITE_OK ){
|
74385
|
2 |
0 |
if( pCur->info.nKey==intKey ){
|
74388
|
0 |
0 |
}else if( rc!=SQLITE_DONE ){
|
74400
|
381 |
1625 |
if( rc ){
|
74401
|
381 |
0 |
if( rc==SQLITE_EMPTY ){
|
74436
|
3985 |
979 |
if( pPage->intKeyLeaf ){
|
74437
|
386 |
3985 |
while( 0x80 <= *(pCell++) ){
|
74438
|
0 |
386 |
if( pCell>=pPage->aDataEnd ){
|
74444
|
3344 |
1620 |
if( nCellKey<intKey ){
|
74446
|
469 |
2875 |
if( lwr>upr ){ c = -1; break; }
|
74447
|
236 |
1384 |
}else if( nCellKey>intKey ){
|
74449
|
3 |
233 |
if( lwr>upr ){ c = +1; break; }
|
74453
|
66 |
1318 |
if( !pPage->leaf ){
|
74469
|
307 |
165 |
if( pPage->leaf ){
|
74477
|
165 |
66 |
if( lwr>=pPage->nCell ){
|
74484
|
0 |
231 |
if( rc ) break;
|
74520
|
4 |
0 |
if( nCell<=pPage->max1bytePayload ){
|
74526
|
0 |
0 |
}else if( !(pCell[1] & 0x80)
|
74527
|
0 |
0 |
&& (nCell = ((nCell&0x7f)<<7) + pCell[1])<=pPage->maxLocal
|
74548
|
0 |
12 |
for(i=0; i<pCur->iPage; i++){
|
74550
|
0 |
0 |
if( pCur->aiIdx[i]<pPage->nCell ) return 0;
|
74617
|
12 |
271 |
if( pCur->eState==CURSOR_VALID
|
74618
|
12 |
0 |
&& pCur->pPage->leaf
|
74619
|
12 |
0 |
&& cursorOnLastPage(pCur)
|
74622
|
4 |
8 |
if( pCur->ix==pCur->pPage->nCell-1
|
74623
|
0 |
4 |
&& (c = indexCellCompare(pCur, pCur->ix, pIdxKey, xRecordCompare))<=0
|
74624
|
0 |
0 |
&& pIdxKey->errCode==SQLITE_OK
|
74629
|
0 |
12 |
if( pCur->iPage>0
|
74630
|
0 |
0 |
&& indexCellCompare(pCur, 0, pIdxKey, xRecordCompare)<=0
|
74631
|
0 |
0 |
&& pIdxKey->errCode==SQLITE_OK
|
74634
|
0 |
0 |
if( !pCur->pPage->isInit ){
|
74643
|
40 |
243 |
if( rc ){
|
74644
|
40 |
0 |
if( rc==SQLITE_EMPTY ){
|
74689
|
553 |
0 |
if( nCell<=pPage->max1bytePayload ){
|
74695
|
0 |
0 |
}else if( !(pCell[1] & 0x80)
|
74696
|
0 |
0 |
&& (nCell = ((nCell&0x7f)<<7) + pCell[1])<=pPage->maxLocal
|
74721
|
0 |
0 |
if( nCell<2 || nCell/pCur->pBt->usableSize>pCur->pBt->nPage ){
|
|
0 |
0 |
if( nCell<2 || nCell/pCur->pBt->usableSize>pCur->pBt->nPage ){
|
74726
|
0 |
0 |
if( pCellKey==0 ){
|
74734
|
0 |
0 |
if( rc ){
|
74745
|
517 |
36 |
if( c<0 ){
|
74747
|
33 |
3 |
}else if( c>0 ){
|
74754
|
0 |
3 |
if( pIdxKey->errCode ) rc = SQLITE_CORRUPT_BKPT;
|
74757
|
240 |
310 |
if( lwr>upr ) break;
|
74763
|
240 |
0 |
if( pPage->leaf ){
|
74770
|
0 |
0 |
if( lwr>=pPage->nCell ){
|
74777
|
0 |
0 |
if( rc ) break;
|
74816
|
0 |
0 |
if( NEVER(pCur->eState!=CURSOR_VALID) ) return -1;
|
74817
|
0 |
0 |
if( NEVER(pCur->pPage->leaf==0) ) return -1;
|
74820
|
0 |
0 |
for(i=0; i<pCur->iPage; i++){
|
74852
|
18 |
743 |
if( pCur->eState!=CURSOR_VALID ){
|
74854
|
18 |
0 |
rc = restoreCursorPosition(pCur);
|
74855
|
0 |
18 |
if( rc!=SQLITE_OK ){
|
74858
|
8 |
10 |
if( CURSOR_INVALID==pCur->eState ){
|
74861
|
10 |
0 |
if( pCur->eState==CURSOR_SKIPNEXT ){
|
74863
|
3 |
7 |
if( pCur->skipNext>0 ) return SQLITE_OK;
|
74869
|
0 |
750 |
if( sqlite3FaultSim(412) ) pPage->isInit = 0;
|
74870
|
0 |
750 |
if( !pPage->isInit ){
|
74874
|
749 |
1 |
if( idx>=pPage->nCell ){
|
74875
|
6 |
743 |
if( !pPage->leaf ){
|
74877
|
0 |
6 |
if( rc ) return rc;
|
74881
|
729 |
18 |
if( pCur->iPage==0 ){
|
74887
|
4 |
14 |
}while( pCur->ix>=pPage->nCell );
|
74888
|
14 |
0 |
if( pPage->intKey ){
|
74894
|
1 |
0 |
if( pPage->leaf ){
|
74907
|
18 |
6994 |
if( pCur->eState!=CURSOR_VALID ) return btreeNext(pCur);
|
74909
|
743 |
6251 |
if( (++pCur->ix)>=pPage->nCell ){
|
74913
|
6243 |
8 |
if( pPage->leaf ){
|
74947
|
0 |
113 |
if( pCur->eState!=CURSOR_VALID ){
|
74948
|
0 |
0 |
rc = restoreCursorPosition(pCur);
|
74949
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
74952
|
0 |
0 |
if( CURSOR_INVALID==pCur->eState ){
|
74955
|
0 |
0 |
if( CURSOR_SKIPNEXT==pCur->eState ){
|
74957
|
0 |
0 |
if( pCur->skipNext<0 ) return SQLITE_OK;
|
74963
|
0 |
113 |
if( !pPage->leaf ){
|
74966
|
0 |
0 |
if( rc ) return rc;
|
74969
|
113 |
0 |
while( pCur->ix==0 ){
|
74970
|
113 |
0 |
if( pCur->iPage==0 ){
|
74981
|
0 |
0 |
if( pPage->intKey && !pPage->leaf ){
|
|
0 |
0 |
if( pPage->intKey && !pPage->leaf ){
|
74995
|
424 |
0 |
if( pCur->eState!=CURSOR_VALID
|
74996
|
311 |
113 |
|| pCur->ix==0
|
74997
|
0 |
311 |
|| pCur->pPage->leaf==0
|
75050
|
0 |
1000 |
if( n>=mxPage ){
|
75053
|
2 |
998 |
if( n>0 ){
|
75064
|
0 |
2 |
if( eMode==BTALLOC_EXACT ){
|
75065
|
0 |
0 |
if( nearby<=mxPage ){
|
75070
|
0 |
0 |
if( rc ) return rc;
|
75071
|
0 |
0 |
if( eType==PTRMAP_FREEPAGE ){
|
75075
|
0 |
2 |
}else if( eMode==BTALLOC_LE ){
|
75084
|
0 |
2 |
if( rc ) return rc;
|
75094
|
0 |
2 |
if( pPrevTrunk ){
|
75106
|
2 |
0 |
if( iTrunk>mxPage || nSearch++ > n ){
|
|
0 |
2 |
if( iTrunk>mxPage || nSearch++ > n ){
|
75111
|
0 |
2 |
if( rc ){
|
75120
|
1 |
1 |
if( k==0 && !searchList ){
|
|
1 |
0 |
if( k==0 && !searchList ){
|
75126
|
0 |
1 |
if( rc ){
|
75134
|
0 |
1 |
}else if( k>(u32)(pBt->usableSize/4 - 2) ){
|
75139
|
0 |
1 |
}else if( searchList
|
75140
|
0 |
0 |
&& (nearby==iTrunk || (iTrunk<nearby && eMode==BTALLOC_LE))
|
|
0 |
0 |
&& (nearby==iTrunk || (iTrunk<nearby && eMode==BTALLOC_LE))
|
|
0 |
0 |
&& (nearby==iTrunk || (iTrunk<nearby && eMode==BTALLOC_LE))
|
75149
|
0 |
0 |
if( rc ){
|
75152
|
0 |
0 |
if( k==0 ){
|
75153
|
0 |
0 |
if( !pPrevTrunk ){
|
75157
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
75169
|
0 |
0 |
if( iNewTrunk>mxPage ){
|
75175
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
75179
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
75187
|
0 |
0 |
if( !pPrevTrunk ){
|
75192
|
0 |
0 |
if( rc ){
|
75201
|
1 |
0 |
}else if( k>0 ){
|
75206
|
1 |
0 |
if( nearby>0 ){
|
75209
|
0 |
1 |
if( eMode==BTALLOC_LE ){
|
75210
|
0 |
0 |
for(i=0; i<k; i++){
|
75212
|
0 |
0 |
if( iPage<=nearby ){
|
75220
|
0 |
1 |
for(i=1; i<k; i++){
|
75222
|
0 |
0 |
if( d2<dist ){
|
75234
|
1 |
0 |
if( iPage>mxPage || iPage<2 ){
|
|
0 |
1 |
if( iPage>mxPage || iPage<2 ){
|
75239
|
0 |
1 |
if( !searchList
|
75240
|
0 |
0 |
|| (iPage==nearby || (iPage<nearby && eMode==BTALLOC_LE))
|
|
0 |
0 |
|| (iPage==nearby || (iPage<nearby && eMode==BTALLOC_LE))
|
|
0 |
0 |
|| (iPage==nearby || (iPage<nearby && eMode==BTALLOC_LE))
|
75248
|
0 |
1 |
if( rc ) goto end_allocate_page;
|
75249
|
0 |
1 |
if( closest<k-1 ){
|
75255
|
1 |
0 |
if( rc==SQLITE_OK ){
|
75257
|
0 |
1 |
if( rc!=SQLITE_OK ){
|
75267
|
0 |
2 |
}while( searchList );
|
75290
|
0 |
998 |
if( rc ) return rc;
|
75292
|
0 |
998 |
if( pBt->nPage==PENDING_BYTE_PAGE(pBt) ) pBt->nPage++;
|
75295
|
0 |
998 |
if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt, pBt->nPage) ){
|
|
0 |
0 |
if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt, pBt->nPage) ){
|
75304
|
0 |
0 |
if( rc==SQLITE_OK ){
|
75308
|
0 |
0 |
if( rc ) return rc;
|
75310
|
0 |
0 |
if( pBt->nPage==PENDING_BYTE_PAGE(pBt) ){ pBt->nPage++; }
|
75318
|
0 |
998 |
if( rc ) return rc;
|
75320
|
0 |
998 |
if( rc!=SQLITE_OK ){
|
75361
|
5 |
0 |
if( iPage<2 || iPage>pBt->nPage ){
|
|
0 |
5 |
if( iPage<2 || iPage>pBt->nPage ){
|
75364
|
5 |
0 |
if( pMemPage ){
|
75373
|
0 |
5 |
if( rc ) goto freepage_out;
|
75377
|
0 |
5 |
if( pBt->btsFlags & BTS_SECURE_DELETE ){
|
75381
|
0 |
0 |
if( (!pPage && ((rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0) )
|
|
0 |
0 |
if( (!pPage && ((rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0) )
|
75382
|
0 |
0 |
|| ((rc = sqlite3PagerWrite(pPage->pDbPage))!=0)
|
75392
|
0 |
5 |
if( ISAUTOVACUUM(pBt) ){
|
75394
|
0 |
0 |
if( rc ) goto freepage_out;
|
75404
|
1 |
4 |
if( nFree!=0 ){
|
75408
|
0 |
1 |
if( iTrunk>btreePagecount(pBt) ){
|
75413
|
0 |
1 |
if( rc!=SQLITE_OK ){
|
75419
|
0 |
1 |
if( nLeaf > (u32)pBt->usableSize/4 - 2 ){
|
75423
|
1 |
0 |
if( nLeaf < (u32)pBt->usableSize/4 - 8 ){
|
75444
|
1 |
0 |
if( rc==SQLITE_OK ){
|
75447
|
1 |
0 |
if( pPage && (pBt->btsFlags & BTS_SECURE_DELETE)==0 ){
|
|
1 |
0 |
if( pPage && (pBt->btsFlags & BTS_SECURE_DELETE)==0 ){
|
75463
|
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)) ){
|
75467
|
0 |
4 |
if( rc!=SQLITE_OK ){
|
75476
|
5 |
0 |
if( pPage ){
|
75484
|
5 |
0 |
if( (*pRC)==SQLITE_OK ){
|
75507
|
0 |
0 |
if( pCell + pInfo->nSize > pPage->aDataEnd ){
|
75519
|
0 |
0 |
while( nOvfl-- ){
|
75522
|
0 |
0 |
if( ovflPgno<2 || ovflPgno>btreePagecount(pBt) ){
|
|
0 |
0 |
if( ovflPgno<2 || ovflPgno>btreePagecount(pBt) ){
|
75528
|
0 |
0 |
if( nOvfl ){
|
75530
|
0 |
0 |
if( rc ) return rc;
|
75533
|
0 |
0 |
if( ( pOvfl || ((pOvfl = btreePageLookup(pBt, ovflPgno))!=0) )
|
|
0 |
0 |
if( ( pOvfl || ((pOvfl = btreePageLookup(pBt, ovflPgno))!=0) )
|
75534
|
0 |
0 |
&& sqlite3PagerPageRefcount(pOvfl->pDbPage)!=1
|
75551
|
0 |
0 |
if( pOvfl ){
|
75554
|
0 |
0 |
if( rc ) return rc;
|
75613
|
3979 |
87 |
if( pPage->intKey ){
|
75618
|
3772 |
207 |
nHeader += putVarint32(&pCell[nHeader], nPayload);
|
75624
|
87 |
0 |
nHeader += putVarint32(&pCell[nHeader], nPayload);
|
75629
|
4043 |
23 |
if( nPayload<=pPage->maxLocal ){
|
75635
|
5 |
4038 |
if( n<4 ) n = 4;
|
75651
|
21 |
2 |
if( n > pPage->maxLocal ) n = mn;
|
75685
|
572 |
23 |
if( n>spaceLeft ) n = spaceLeft;
|
75696
|
595 |
0 |
if( nSrc>=n ){
|
75698
|
0 |
0 |
}else if( nSrc>0 ){
|
75705
|
23 |
572 |
if( nPayload<=0 ) break;
|
75710
|
572 |
0 |
if( spaceLeft==0 ){
|
75714
|
0 |
572 |
if( pBt->autoVacuum ){
|
75718
|
0 |
0 |
PTRMAP_ISPAGE(pBt, pgnoOvfl) || pgnoOvfl==PENDING_BYTE_PAGE(pBt)
|
75719
|
0 |
0 |
);
|
75734
|
0 |
572 |
if( pBt->autoVacuum && rc==SQLITE_OK ){
|
|
0 |
0 |
if( pBt->autoVacuum && rc==SQLITE_OK ){
|
75735
|
0 |
0 |
u8 eType = (pgnoPtrmap?PTRMAP_OVERFLOW2:PTRMAP_OVERFLOW1);
|
75737
|
0 |
0 |
if( rc ){
|
75742
|
0 |
572 |
if( rc ){
|
75784
|
0 |
291 |
if( *pRC ) return;
|
75798
|
0 |
291 |
if( pc+sz > pPage->pBt->usableSize ){
|
75803
|
0 |
291 |
if( rc ){
|
75808
|
174 |
117 |
if( pPage->nCell==0 ){
|
75863
|
140 |
0 |
if( pPage->nOverflow || sz+2>pPage->nFree ){
|
|
0 |
140 |
if( pPage->nOverflow || sz+2>pPage->nFree ){
|
75864
|
0 |
0 |
if( pTemp ){
|
75886
|
0 |
140 |
if( NEVER(rc!=SQLITE_OK) ){
|
75893
|
0 |
140 |
if( rc ){ return rc; }
|
75912
|
0 |
140 |
if( (++data[pPage->hdrOffset+4])==0 ) data[pPage->hdrOffset+3]++;
|
75915
|
0 |
140 |
if( pPage->pBt->autoVacuum ){
|
75921
|
0 |
0 |
if( rc2 ) return rc2;
|
75958
|
140 |
3717 |
if( sz+2>pPage->nFree ){
|
75976
|
0 |
3717 |
if( rc!=SQLITE_OK ){
|
75983
|
0 |
3717 |
if( rc ){ return rc; }
|
75996
|
6 |
3711 |
if( (++data[pPage->hdrOffset+4])==0 ) data[pPage->hdrOffset+3]++;
|
75999
|
0 |
3717 |
if( pPage->pBt->autoVacuum ){
|
76005
|
0 |
0 |
if( rc2 ) return rc2;
|
76113
|
0 |
0 |
while( N>0 ){
|
76115
|
0 |
0 |
if( szCell[idx]==0 ){
|
76137
|
0 |
0 |
if( p->szCell[N] ) return p->szCell[N];
|
76175
|
0 |
140 |
if( NEVER(j>(u32)usableSize) ){ j = 0; }
|
76178
|
0 |
140 |
for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
|
|
0 |
0 |
for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
|
76186
|
46 |
94 |
if( SQLITE_WITHIN(pCell,aData+j,pEnd) ){
|
|
0 |
46 |
if( SQLITE_WITHIN(pCell,aData+j,pEnd) ){
|
76187
|
0 |
0 |
if( ((uptr)(pCell+sz))>(uptr)pEnd ) return SQLITE_CORRUPT_BKPT;
|
76189
|
47 |
93 |
}else if( (uptr)(pCell+sz)>(uptr)pSrcEnd
|
76190
|
0 |
47 |
&& (uptr)(pCell)<(uptr)pSrcEnd
|
76198
|
0 |
140 |
if( pData < pCellptr ) return SQLITE_CORRUPT_BKPT;
|
76202
|
140 |
0 |
if( i>=iEnd ) break;
|
76203
|
0 |
0 |
if( pCArray->ixNx[k]<=i ){
|
76260
|
0 |
0 |
if( iEnd<=iFirst ) return 0;
|
76261
|
0 |
0 |
for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
|
|
0 |
0 |
for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
|
76268
|
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 ){
|
76269
|
0 |
0 |
if( (pData - pBegin)<sz ) return 1;
|
76279
|
0 |
0 |
if( (uptr)(pCArray->apCell[i]+sz)>(uptr)pEnd
|
76280
|
0 |
0 |
&& (uptr)(pCArray->apCell[i])<(uptr)pEnd
|
76290
|
0 |
0 |
if( i>=iEnd ) break;
|
76291
|
0 |
0 |
if( pCArray->ixNx[k]<=i ){
|
76325
|
0 |
0 |
for(i=iFirst; i<iEnd; i++){
|
76327
|
0 |
0 |
if( SQLITE_WITHIN(pCell, pStart, pEnd) ){
|
|
0 |
0 |
if( SQLITE_WITHIN(pCell, pStart, pEnd) ){
|
76337
|
0 |
0 |
for(j=0; j<nFree; j++){
|
76338
|
0 |
0 |
if( aOfst[j]==iAfter ){
|
76341
|
0 |
0 |
}else if( aAfter[j]==iOfst ){
|
76346
|
0 |
0 |
if( j>=nFree ){
|
76347
|
0 |
0 |
if( nFree>=(int)(sizeof(aOfst)/sizeof(aOfst[0])) ){
|
76348
|
0 |
0 |
for(j=0; j<nFree; j++){
|
76355
|
0 |
0 |
if( &aData[iAfter]>pEnd ) return 0;
|
76361
|
0 |
0 |
for(j=0; j<nFree; j++){
|
76403
|
0 |
0 |
if( iOld<iNew ){
|
76405
|
0 |
0 |
if( NEVER(nShift>nCell) ) return SQLITE_CORRUPT_BKPT;
|
76409
|
0 |
0 |
if( iNewEnd < iOldEnd ){
|
76416
|
0 |
0 |
if( pData<pBegin ) goto editpage_fail;
|
76417
|
0 |
0 |
if( NEVER(pData>pPg->aDataEnd) ) goto editpage_fail;
|
76420
|
0 |
0 |
if( iNew<iOld ){
|
76426
|
0 |
0 |
if( pageInsertArray(
|
76434
|
0 |
0 |
for(i=0; i<pPg->nOverflow; i++){
|
76436
|
0 |
0 |
if( iCell>=0 && iCell<nNew ){
|
|
0 |
0 |
if( iCell>=0 && iCell<nNew ){
|
76438
|
0 |
0 |
if( nCell>iCell ){
|
76443
|
0 |
0 |
if( pageInsertArray(
|
76453
|
0 |
0 |
if( pageInsertArray(
|
76518
|
0 |
140 |
if( pPage->nCell==0 ) return SQLITE_CORRUPT_BKPT; /* dbfuzz001.test */
|
76528
|
140 |
0 |
if( rc==SQLITE_OK ){
|
76546
|
0 |
140 |
if( NEVER(rc) ){
|
76561
|
0 |
140 |
if( ISAUTOVACUUM(pBt) ){
|
76563
|
0 |
0 |
if( szCell>pNew->minLocal ){
|
76583
|
134 |
140 |
while( (*(pCell++)&0x80) && pCell<pStop );
|
|
134 |
0 |
while( (*(pCell++)&0x80) && pCell<pStop );
|
76585
|
6 |
140 |
while( ((*(pOut++) = *(pCell++))&0x80) && pCell<pStop );
|
|
6 |
0 |
while( ((*(pOut++) = *(pCell++))&0x80) && pCell<pStop );
|
76588
|
140 |
0 |
if( rc==SQLITE_OK ){
|
76664
|
7 |
0 |
if( (*pRC)==SQLITE_OK ){
|
76669
|
0 |
7 |
int const iToHdr = ((pTo->pgno==1) ? 100 : 0);
|
76690
|
7 |
0 |
if( rc==SQLITE_OK ) rc = btreeComputeFreeSpace(pTo);
|
76691
|
0 |
7 |
if( rc!=SQLITE_OK ){
|
76699
|
0 |
7 |
if( ISAUTOVACUUM(pBt) ){
|
76793
|
0 |
0 |
if( !aOvflSpace ){
|
76810
|
0 |
0 |
if( i<2 ){
|
76814
|
0 |
0 |
if( iParentIdx==0 ){
|
76816
|
0 |
0 |
}else if( iParentIdx==i ){
|
76824
|
0 |
0 |
if( (i+nxDiv-pParent->nOverflow)==pParent->nCell ){
|
76831
|
0 |
0 |
if( rc==SQLITE_OK ){
|
76834
|
0 |
0 |
if( rc ){
|
76838
|
0 |
0 |
if( apOld[i]->nFree<0 ){
|
76840
|
0 |
0 |
if( rc ){
|
76846
|
0 |
0 |
if( (i--)==0 ) break;
|
76848
|
0 |
0 |
if( pParent->nOverflow && i+nxDiv==pParent->aiOvfl[0] ){
|
|
0 |
0 |
if( pParent->nOverflow && i+nxDiv==pParent->aiOvfl[0] ){
|
76870
|
0 |
0 |
if( pBt->btsFlags & BTS_FAST_SECURE ){
|
76876
|
0 |
0 |
if( (iOff+szNew[i])<=(int)pBt->usableSize ){
|
76899
|
0 |
0 |
if( b.apCell==0 ){
|
76926
|
0 |
0 |
for(i=0; i<nOld; i++){
|
76938
|
0 |
0 |
if( pOld->aData[0]!=apOld[0]->aData[0] ){
|
76961
|
0 |
0 |
if( pOld->nOverflow>0 ){
|
76962
|
0 |
0 |
if( NEVER(limit<pOld->aiOvfl[0]) ){
|
76967
|
0 |
0 |
for(j=0; j<limit; j++){
|
76972
|
0 |
0 |
for(k=0; k<pOld->nOverflow; k++){
|
76979
|
0 |
0 |
while( piCell<piEnd ){
|
76988
|
0 |
0 |
if( i<nOld-1 && !leafData){
|
|
0 |
0 |
if( i<nOld-1 && !leafData){
|
77001
|
0 |
0 |
if( !pOld->leaf ){
|
77009
|
0 |
0 |
while( b.szCell[b.nCell]<4 ){
|
77039
|
0 |
0 |
for(i=k=0; i<nOld; i++, k++){
|
77043
|
0 |
0 |
if( k && b.ixNx[k]==b.ixNx[k-1] ){
|
|
0 |
0 |
if( k && b.ixNx[k]==b.ixNx[k-1] ){
|
77046
|
0 |
0 |
if( !leafData ){
|
77053
|
0 |
0 |
for(j=0; j<p->nOverflow; j++){
|
77059
|
0 |
0 |
for(i=0; i<k; i++){
|
77061
|
0 |
0 |
while( szNew[i]>usableSpace ){
|
77062
|
0 |
0 |
if( i+1>=k ){
|
77064
|
0 |
0 |
if( k>NB+2 ){ rc = SQLITE_CORRUPT_BKPT; goto balance_cleanup; }
|
77070
|
0 |
0 |
if( !leafData ){
|
77071
|
0 |
0 |
if( cntNew[i]<b.nCell ){
|
77080
|
0 |
0 |
while( cntNew[i]<b.nCell ){
|
77082
|
0 |
0 |
if( szNew[i]+sz>usableSpace ) break;
|
77085
|
0 |
0 |
if( !leafData ){
|
77086
|
0 |
0 |
if( cntNew[i]<b.nCell ){
|
77094
|
0 |
0 |
if( cntNew[i]>=b.nCell ){
|
77096
|
0 |
0 |
}else if( cntNew[i] <= (i>0 ? cntNew[i-1] : 0) ){
|
|
0 |
0 |
}else if( cntNew[i] <= (i>0 ? cntNew[i-1] : 0) ){
|
77113
|
0 |
0 |
for(i=k-1; i>0; i--){
|
77128
|
0 |
0 |
if( szRight!=0
|
77129
|
0 |
0 |
&& (bBulk || szRight+szD+2 > szLeft-(szR+(i==k-1?0:2)))){
|
|
0 |
0 |
&& (bBulk || szRight+szD+2 > szLeft-(szR+(i==k-1?0:2)))){
|
|
0 |
0 |
&& (bBulk || szRight+szD+2 > szLeft-(szR+(i==k-1?0:2)))){
|
77137
|
0 |
0 |
}while( r>=0 );
|
77140
|
0 |
0 |
if( cntNew[i-1] <= (i>1 ? cntNew[i-2] : 0) ){
|
|
0 |
0 |
if( cntNew[i-1] <= (i>1 ? cntNew[i-2] : 0) ){
|
77164
|
0 |
0 |
for(i=0; i<k; i++){
|
77166
|
0 |
0 |
if( i<nOld ){
|
77171
|
0 |
0 |
if( sqlite3PagerPageRefcount(pNew->pDbPage)!=1+(i==(iParentIdx-nxDiv))
|
|
0 |
0 |
if( sqlite3PagerPageRefcount(pNew->pDbPage)!=1+(i==(iParentIdx-nxDiv))
|
77172
|
0 |
0 |
&& rc==SQLITE_OK
|
77176
|
0 |
0 |
if( rc ) goto balance_cleanup;
|
77179
|
0 |
0 |
rc = allocateBtreePage(pBt, &pNew, &pgno, (bBulk ? 1 : pgno), 0);
|
77180
|
0 |
0 |
if( rc ) goto balance_cleanup;
|
77187
|
0 |
0 |
if( ISAUTOVACUUM(pBt) ){
|
77189
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
77208
|
0 |
0 |
for(i=0; i<nNew; i++){
|
77213
|
0 |
0 |
for(i=0; i<nNew-1; i++){
|
77215
|
0 |
0 |
for(j=i+1; j<nNew; j++){
|
77216
|
0 |
0 |
if( apNew[j]->pgno < apNew[iB]->pgno ) iB = j;
|
77224
|
0 |
0 |
if( iB!=i ){
|
77259
|
0 |
0 |
if( (pageFlags & PTF_LEAF)==0 && nOld!=nNew ){
|
|
0 |
0 |
if( (pageFlags & PTF_LEAF)==0 && nOld!=nNew ){
|
77260
|
0 |
0 |
MemPage *pOld = (nNew>nOld ? apNew : apOld)[nOld-1];
|
77280
|
0 |
0 |
if( ISAUTOVACUUM(pBt) ){
|
77287
|
0 |
0 |
for(i=0; i<b.nCell; i++){
|
77289
|
0 |
0 |
while( i==cntOldNext ){
|
77293
|
0 |
0 |
pOld = iOld<nNew ? apNew[iOld] : apOld[iOld];
|
77296
|
0 |
0 |
if( i==cntNew[iNew] ){
|
77298
|
0 |
0 |
if( !leafData ) continue;
|
77307
|
0 |
0 |
if( iOld>=nNew
|
77308
|
0 |
0 |
|| pNew->pgno!=aPgno[iOld]
|
77309
|
0 |
0 |
|| !SQLITE_WITHIN(pCell,pOld->aData,pOld->aDataEnd)
|
|
0 |
0 |
|| !SQLITE_WITHIN(pCell,pOld->aData,pOld->aDataEnd)
|
77311
|
0 |
0 |
if( !leafCorrection ){
|
77314
|
0 |
0 |
if( cachedCellSize(&b,i)>pNew->minLocal ){
|
77317
|
0 |
0 |
if( rc ) goto balance_cleanup;
|
77323
|
0 |
0 |
for(i=0; i<nNew-1; i++){
|
77336
|
0 |
0 |
if( !pNew->leaf ){
|
77338
|
0 |
0 |
}else if( leafData ){
|
77363
|
0 |
0 |
if( b.szCell[j]==4 ){
|
77371
|
0 |
0 |
for(k=0; b.ixNx[k]<=j && ALWAYS(k<NB*2); k++){}
|
|
0 |
0 |
for(k=0; b.ixNx[k]<=j && ALWAYS(k<NB*2); k++){}
|
77373
|
0 |
0 |
if( SQLITE_WITHIN(pSrcEnd, pCell, pCell+sz) ){
|
|
0 |
0 |
if( SQLITE_WITHIN(pSrcEnd, pCell, pCell+sz) ){
|
77378
|
0 |
0 |
if( rc!=SQLITE_OK ) goto balance_cleanup;
|
77404
|
0 |
0 |
for(i=1-nNew; i<nNew; i++){
|
77407
|
0 |
0 |
if( abDone[iPg] ) continue; /* Skip pages already processed */
|
77408
|
0 |
0 |
if( i>=0 /* On the upwards pass, or... */
|
77409
|
0 |
0 |
|| cntOld[iPg-1]>=cntNew[iPg-1] /* Condition (1) is true */
|
77423
|
0 |
0 |
if( iPg==0 ){
|
77427
|
0 |
0 |
iOld = iPg<nOld ? (cntOld[iPg-1] + !leafData) : b.nCell;
|
77433
|
0 |
0 |
if( rc ) goto balance_cleanup;
|
77447
|
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 ){
|
77473
|
0 |
0 |
}else if( ISAUTOVACUUM(pBt) && !leafCorrection ){
|
|
0 |
0 |
}else if( ISAUTOVACUUM(pBt) && !leafCorrection ){
|
77477
|
0 |
0 |
for(i=0; i<nNew; i++){
|
77489
|
0 |
0 |
for(i=nNew; i<nOld; i++){
|
77509
|
0 |
0 |
for(i=0; i<nOld; i++){
|
77512
|
0 |
0 |
for(i=0; i<nNew; i++){
|
77553
|
7 |
0 |
if( rc==SQLITE_OK ){
|
77556
|
0 |
7 |
if( ISAUTOVACUUM(pBt) ){
|
77560
|
0 |
7 |
if( rc ){
|
77599
|
7 |
7 |
for(pOther=pCur->pBt->pCursor; pOther; pOther=pOther->pNext){
|
77600
|
0 |
7 |
if( pOther!=pCur
|
77601
|
0 |
0 |
&& pOther->eState==CURSOR_VALID
|
77602
|
0 |
0 |
&& pOther->pPage==pCur->pPage
|
77632
|
0 |
308 |
if( NEVER(pPage->nFree<0) && btreeComputeFreeSpace(pPage) ) break;
|
|
0 |
0 |
if( NEVER(pPage->nFree<0) && btreeComputeFreeSpace(pPage) ) break;
|
77633
|
161 |
147 |
if( pPage->nOverflow==0 && pPage->nFree*3<=(int)pCur->pBt->usableSize*2 ){
|
|
161 |
0 |
if( pPage->nOverflow==0 && pPage->nFree*3<=(int)pCur->pBt->usableSize*2 ){
|
77639
|
168 |
140 |
}else if( (iPage = pCur->iPage)==0 ){
|
77640
|
7 |
161 |
if( pPage->nOverflow && (rc = anotherValidCursor(pCur))==SQLITE_OK ){
|
|
7 |
0 |
if( pPage->nOverflow && (rc = anotherValidCursor(pCur))==SQLITE_OK ){
|
77649
|
7 |
0 |
if( rc==SQLITE_OK ){
|
77660
|
0 |
140 |
}else if( sqlite3PagerPageRefcount(pPage->pDbPage)>1 ){
|
77670
|
140 |
0 |
if( rc==SQLITE_OK && pParent->nFree<0 ){
|
|
0 |
140 |
if( rc==SQLITE_OK && pParent->nFree<0 ){
|
77673
|
140 |
0 |
if( rc==SQLITE_OK ){
|
77675
|
140 |
0 |
if( pPage->intKeyLeaf
|
77676
|
140 |
0 |
&& pPage->nOverflow==1
|
77677
|
140 |
0 |
&& pPage->aiOvfl[0]==pPage->nCell
|
77678
|
140 |
0 |
&& pParent->pgno!=1
|
77679
|
140 |
0 |
&& pParent->nCell==iIdx
|
77720
|
0 |
0 |
if( pFree ){
|
77743
|
147 |
0 |
}while( rc==SQLITE_OK );
|
77745
|
0 |
161 |
if( pFree ){
|
77762
|
0 |
3 |
if( nData<=0 ){
|
77765
|
0 |
0 |
for(i=0; i<iAmt && pDest[i]==0; i++){}
|
|
0 |
0 |
for(i=0; i<iAmt && pDest[i]==0; i++){}
|
77766
|
0 |
0 |
if( i<iAmt ){
|
77768
|
0 |
0 |
if( rc ) return rc;
|
77772
|
0 |
3 |
if( nData<iAmt ){
|
77777
|
0 |
0 |
if( rc ) return rc;
|
77780
|
3 |
0 |
if( memcmp(pDest, ((u8*)pX->pData) + iOffset, iAmt)!=0 ){
|
77782
|
0 |
3 |
if( rc ) return rc;
|
77815
|
0 |
0 |
if( rc ) return rc;
|
77826
|
0 |
0 |
if( rc ) return rc;
|
77827
|
0 |
0 |
if( sqlite3PagerPageRefcount(pPage->pDbPage)!=1 || pPage->isInit ){
|
|
0 |
0 |
if( sqlite3PagerPageRefcount(pPage->pDbPage)!=1 || pPage->isInit ){
|
77830
|
0 |
0 |
if( iOffset+ovflPageSize<(u32)nTotal ){
|
77839
|
0 |
0 |
if( rc ) return rc;
|
77841
|
0 |
0 |
}while( iOffset<nTotal );
|
77853
|
3 |
0 |
if( pCur->info.pPayload + pCur->info.nLocal > pPage->aDataEnd
|
77854
|
0 |
3 |
|| pCur->info.pPayload < pPage->aData + pPage->cellOffset
|
77858
|
3 |
0 |
if( pCur->info.nLocal==nTotal ){
|
77928
|
119 |
3950 |
if( pCur->curFlags & BTCF_Multiple ){
|
77930
|
0 |
119 |
if( rc ) return rc;
|
77931
|
0 |
119 |
if( loc && pCur->iPage<0 ){
|
|
0 |
0 |
if( loc && pCur->iPage<0 ){
|
77944
|
0 |
4069 |
if( pCur->eState>=CURSOR_REQUIRESEEK ){
|
77948
|
0 |
0 |
if( rc && rc!=SQLITE_EMPTY ) return rc;
|
|
0 |
0 |
if( rc && rc!=SQLITE_EMPTY ) return rc;
|
77964
|
3982 |
87 |
if( pCur->pKeyInfo==0 ){
|
77968
|
16 |
3966 |
if( p->hasIncrblobCur ){
|
77987
|
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 ){
|
77991
|
267 |
24 |
if( pCur->info.nSize!=0
|
77992
|
3 |
264 |
&& pCur->info.nPayload==(u32)pX->nData+pX->nZero
|
77998
|
3346 |
345 |
}else if( loc==0 ){
|
78005
|
0 |
3346 |
if( rc ) return rc;
|
78020
|
26 |
61 |
if( loc==0 && (flags & BTREE_SAVEPOSITION)==0 ){
|
|
26 |
0 |
if( loc==0 && (flags & BTREE_SAVEPOSITION)==0 ){
|
78021
|
26 |
0 |
if( pX->nMem ){
|
78033
|
0 |
26 |
if( rc ) return rc;
|
78040
|
0 |
87 |
if( loc==0 ){
|
78042
|
0 |
0 |
if( pCur->info.nKey==pX->nKey ){
|
78057
|
38 |
4028 |
if( pPage->nFree<0 ){
|
78058
|
0 |
38 |
if( NEVER(pCur->eState>CURSOR_INVALID) ){
|
78064
|
0 |
38 |
if( rc ) return rc;
|
78074
|
0 |
4066 |
if( flags & BTREE_PREFORMAT ){
|
78077
|
0 |
0 |
if( szNew<4 ) szNew = 4;
|
78078
|
0 |
0 |
if( ISAUTOVACUUM(p->pBt) && szNew>pPage->maxLocal ){
|
|
0 |
0 |
if( ISAUTOVACUUM(p->pBt) && szNew>pPage->maxLocal ){
|
78081
|
0 |
0 |
if( info.nPayload!=info.nLocal ){
|
78084
|
0 |
0 |
if( NEVER(rc) ) goto end_insert;
|
78089
|
0 |
4066 |
if( rc ) goto end_insert;
|
78095
|
479 |
3587 |
if( loc==0 ){
|
78098
|
0 |
479 |
if( idx>=pPage->nCell ){
|
78102
|
0 |
479 |
if( rc ){
|
78106
|
0 |
479 |
if( !pPage->leaf ){
|
78109
|
0 |
479 |
BTREE_CLEAR_CELL(rc, pPage, oldCell, info);
|
78112
|
209 |
270 |
if( info.nSize==szNew && info.nLocal==info.nPayload
|
|
209 |
0 |
if( info.nSize==szNew && info.nLocal==info.nPayload
|
78113
|
0 |
209 |
&& (!ISAUTOVACUUM(p->pBt) || szNew<pPage->minLocal)
|
|
0 |
0 |
&& (!ISAUTOVACUUM(p->pBt) || szNew<pPage->minLocal)
|
78125
|
0 |
209 |
if( oldCell < pPage->aData+pPage->hdrOffset+10 ){
|
78128
|
0 |
209 |
if( oldCell+szNew > pPage->aDataEnd ){
|
78135
|
0 |
270 |
if( rc ) goto end_insert;
|
78136
|
3573 |
14 |
}else if( loc<0 && pPage->nCell>0 ){
|
|
3174 |
399 |
}else if( loc<0 && pPage->nCell>0 ){
|
78167
|
140 |
3717 |
if( pPage->nOverflow ){
|
78178
|
0 |
140 |
if( (flags & BTREE_SAVEPOSITION) && rc==SQLITE_OK ){
|
|
0 |
0 |
if( (flags & BTREE_SAVEPOSITION) && rc==SQLITE_OK ){
|
78180
|
0 |
0 |
if( pCur->pKeyInfo ){
|
78183
|
0 |
0 |
if( pCur->pKey==0 ){
|
78222
|
0 |
0 |
if( pSrc->info.nPayload<0x80 ){
|
78227
|
0 |
0 |
if( pDest->pKeyInfo==0 ) aOut += putVarint(aOut, iKey);
|
78230
|
0 |
0 |
if( aIn+nIn>pSrc->pPage->aDataEnd ){
|
78234
|
0 |
0 |
if( nIn==nRem && nIn<pDest->pPage->maxLocal ){
|
|
0 |
0 |
if( nIn==nRem && nIn<pDest->pPage->maxLocal ){
|
78249
|
0 |
0 |
if( nOut<pSrc->info.nPayload ){
|
78254
|
0 |
0 |
if( nRem>nIn ){
|
78255
|
0 |
0 |
if( aIn+nIn+4>pSrc->pPage->aDataEnd ){
|
78265
|
0 |
0 |
if( nIn>0 ){
|
78273
|
0 |
0 |
if( nOut>0 ){
|
78277
|
0 |
0 |
if( rc==SQLITE_OK ){
|
78284
|
0 |
0 |
}while( rc==SQLITE_OK && nOut>0 );
|
|
0 |
0 |
}while( rc==SQLITE_OK && nOut>0 );
|
78286
|
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) ){
|
78291
|
0 |
0 |
if( ISAUTOVACUUM(pBt) && pPageOut ){
|
|
0 |
0 |
if( ISAUTOVACUUM(pBt) && pPageOut ){
|
78296
|
0 |
0 |
if( pPageOut ){
|
78303
|
0 |
0 |
}while( nRem>0 && rc==SQLITE_OK );
|
|
0 |
0 |
}while( nRem>0 && rc==SQLITE_OK );
|
78346
|
0 |
21 |
if( pCur->eState!=CURSOR_VALID ){
|
78347
|
0 |
0 |
if( pCur->eState>=CURSOR_REQUIRESEEK ){
|
78350
|
0 |
0 |
if( rc || pCur->eState!=CURSOR_VALID ) return rc;
|
|
0 |
0 |
if( rc || pCur->eState!=CURSOR_VALID ) return rc;
|
78360
|
0 |
21 |
if( pPage->nCell<=iCellIdx ){
|
78364
|
3 |
18 |
if( pPage->nFree<0 && btreeComputeFreeSpace(pPage) ){
|
|
0 |
3 |
if( pPage->nFree<0 && btreeComputeFreeSpace(pPage) ){
|
78367
|
0 |
21 |
if( pCell<&pPage->aCellIdx[pPage->nCell] ){
|
78388
|
18 |
3 |
if( bPreserve ){
|
78389
|
18 |
0 |
if( !pPage->leaf
|
78390
|
0 |
18 |
|| (pPage->nFree+pPage->xCellSize(pPage,pCell)+2) >
|
78392
|
0 |
0 |
|| pPage->nCell==1 /* See dbfuzz001.test for a test case */
|
78397
|
0 |
18 |
if( rc ) return rc;
|
78410
|
0 |
21 |
if( !pPage->leaf ){
|
78413
|
0 |
0 |
if( rc ) return rc;
|
78418
|
0 |
21 |
if( pCur->curFlags & BTCF_Multiple ){
|
78420
|
0 |
0 |
if( rc ) return rc;
|
78425
|
20 |
1 |
if( pCur->pKeyInfo==0 && p->hasIncrblobCur ){
|
|
1 |
19 |
if( pCur->pKeyInfo==0 && p->hasIncrblobCur ){
|
78433
|
0 |
21 |
if( rc ) return rc;
|
78434
|
0 |
21 |
BTREE_CLEAR_CELL(rc, pPage, pCell, info);
|
78436
|
0 |
21 |
if( rc ) return rc;
|
78443
|
0 |
21 |
if( !pPage->leaf ){
|
78449
|
0 |
0 |
if( pLeaf->nFree<0 ){
|
78451
|
0 |
0 |
if( rc ) return rc;
|
78453
|
0 |
0 |
if( iCellDepth<pCur->iPage-1 ){
|
78459
|
0 |
0 |
if( pCell<&pLeaf->aData[4] ) return SQLITE_CORRUPT_BKPT;
|
78465
|
0 |
0 |
if( rc==SQLITE_OK ){
|
78469
|
0 |
0 |
if( rc ) return rc;
|
78489
|
0 |
21 |
if( pCur->pPage->nFree*3<=(int)pCur->pBt->usableSize*2 ){
|
78496
|
21 |
0 |
if( rc==SQLITE_OK && pCur->iPage>iCellDepth ){
|
|
0 |
21 |
if( rc==SQLITE_OK && pCur->iPage>iCellDepth ){
|
78499
|
0 |
0 |
while( pCur->iPage>iCellDepth ){
|
78506
|
21 |
0 |
if( rc==SQLITE_OK ){
|
78507
|
0 |
21 |
if( bPreserve>1 ){
|
78512
|
0 |
0 |
if( iCellIdx>=pPage->nCell ){
|
78520
|
18 |
3 |
if( bPreserve ){
|
78524
|
10 |
11 |
if( rc==SQLITE_EMPTY ) rc = SQLITE_OK;
|
78558
|
0 |
281 |
if( pBt->autoVacuum ){
|
78574
|
0 |
0 |
if( pgnoRoot>btreePagecount(pBt) ){
|
78582
|
0 |
0 |
while( pgnoRoot==PTRMAP_PAGENO(pBt, pgnoRoot) ||
|
|
0 |
0 |
while( pgnoRoot==PTRMAP_PAGENO(pBt, pgnoRoot) ||
|
78593
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
78597
|
0 |
0 |
if( pgnoMove!=pgnoRoot ){
|
78612
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
78618
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
78622
|
0 |
0 |
if( eType==PTRMAP_ROOTPAGE || eType==PTRMAP_FREEPAGE ){
|
|
0 |
0 |
if( eType==PTRMAP_ROOTPAGE || eType==PTRMAP_FREEPAGE ){
|
78625
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
78635
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
78639
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
78643
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
78653
|
0 |
0 |
if( rc ){
|
78664
|
0 |
0 |
if( NEVER(rc) ){
|
78671
|
0 |
281 |
if( rc ) return rc;
|
78675
|
232 |
49 |
if( createTabFlags & BTREE_INTKEY ){
|
78712
|
0 |
38 |
if( pgno>btreePagecount(pBt) ){
|
78716
|
0 |
38 |
if( rc ) return rc;
|
78717
|
38 |
0 |
if( (pBt->openFlags & BTREE_SINGLE)==0
|
78718
|
0 |
38 |
&& sqlite3PagerPageRefcount(pPage->pDbPage) != (1 + (pgno==1))
|
|
0 |
38 |
&& sqlite3PagerPageRefcount(pPage->pDbPage) != (1 + (pgno==1))
|
78724
|
30 |
38 |
for(i=0; i<pPage->nCell; i++){
|
78726
|
0 |
30 |
if( !pPage->leaf ){
|
78728
|
0 |
0 |
if( rc ) goto cleardatabasepage_out;
|
78730
|
0 |
30 |
BTREE_CLEAR_CELL(rc, pPage, pCell, info);
|
78731
|
0 |
30 |
if( rc ) goto cleardatabasepage_out;
|
78733
|
0 |
38 |
if( !pPage->leaf ){
|
78735
|
0 |
0 |
if( rc ) goto cleardatabasepage_out;
|
78736
|
0 |
0 |
if( pPage->intKey ) pnChange = 0;
|
78738
|
33 |
5 |
if( pnChange ){
|
78742
|
0 |
38 |
if( freePageFlag ){
|
78744
|
38 |
0 |
}else if( (rc = sqlite3PagerWrite(pPage->pDbPage))==0 ){
|
78773
|
38 |
0 |
if( SQLITE_OK==rc ){
|
78777
|
0 |
38 |
if( p->hasIncrblobCur ){
|
78823
|
0 |
5 |
if( iTable>btreePagecount(pBt) ){
|
78828
|
0 |
5 |
if( rc ) return rc;
|
78830
|
0 |
5 |
if( NEVER(rc) ){
|
78841
|
0 |
5 |
if( pBt->autoVacuum ){
|
78845
|
0 |
0 |
if( iTable==maxRootPgno ){
|
78851
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
78862
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
78867
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
78874
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
78886
|
0 |
0 |
while( maxRootPgno==PENDING_BYTE_PAGE(pBt)
|
78887
|
0 |
0 |
|| PTRMAP_ISPAGE(pBt, maxRootPgno) ){
|
78938
|
0 |
1376 |
if( idx==BTREE_DATA_VERSION ){
|
78969
|
632 |
0 |
if( rc==SQLITE_OK ){
|
78972
|
0 |
632 |
if( idx==BTREE_INCR_VACUUM ){
|
78996
|
6 |
4 |
if( rc==SQLITE_EMPTY ){
|
79004
|
4 |
0 |
while( rc==SQLITE_OK && !AtomicLoad(&db->u1.isInterrupted) ){
|
|
4 |
0 |
while( rc==SQLITE_OK && !AtomicLoad(&db->u1.isInterrupted) ){
|
79013
|
0 |
4 |
if( pPage->leaf || !pPage->intKey ){
|
|
0 |
0 |
if( pPage->leaf || !pPage->intKey ){
|
79027
|
4 |
0 |
if( pPage->leaf ){
|
79029
|
4 |
0 |
if( pCur->iPage==0 ){
|
79035
|
0 |
0 |
}while ( pCur->ix>=pCur->pPage->nCell );
|
79045
|
0 |
0 |
if( iIdx==pPage->nCell ){
|
79071
|
0 |
0 |
if( pCheck->nErr==0 ) pCheck->nErr++;
|
79080
|
0 |
0 |
if( AtomicLoad(&db->u1.isInterrupted) ){
|
79086
|
0 |
0 |
if( db->xProgress ){
|
79089
|
0 |
0 |
if( (pCheck->nStep % db->nProgressOps)==0
|
79090
|
0 |
0 |
&& db->xProgress(db->pProgressArg)
|
79110
|
0 |
0 |
if( !pCheck->mxErr ) return;
|
79114
|
0 |
0 |
if( pCheck->errMsg.nChar ){
|
79117
|
0 |
0 |
if( pCheck->zPfx ){
|
79123
|
0 |
0 |
if( pCheck->errMsg.accError==SQLITE_NOMEM ){
|
79158
|
0 |
0 |
if( iPage>pCheck->nPage || iPage==0 ){
|
|
0 |
0 |
if( iPage>pCheck->nPage || iPage==0 ){
|
79162
|
0 |
0 |
if( getPageReferenced(pCheck, iPage) ){
|
79187
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
79188
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ) checkOom(pCheck);
|
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ) checkOom(pCheck);
|
79193
|
0 |
0 |
if( ePtrmapType!=eType || iPtrmapParent!=iParent ){
|
|
0 |
0 |
if( ePtrmapType!=eType || iPtrmapParent!=iParent ){
|
79214
|
0 |
0 |
while( iPage!=0 && pCheck->mxErr ){
|
|
0 |
0 |
while( iPage!=0 && pCheck->mxErr ){
|
79217
|
0 |
0 |
if( checkRef(pCheck, iPage) ) break;
|
79219
|
0 |
0 |
if( sqlite3PagerGet(pCheck->pPager, (Pgno)iPage, &pOvflPage, 0) ){
|
79224
|
0 |
0 |
if( isFreeList ){
|
79227
|
0 |
0 |
if( pCheck->pBt->autoVacuum ){
|
79231
|
0 |
0 |
if( n>pCheck->pBt->usableSize/4-2 ){
|
79236
|
0 |
0 |
for(i=0; i<(int)n; i++){
|
79239
|
0 |
0 |
if( pCheck->pBt->autoVacuum ){
|
79254
|
0 |
0 |
if( pCheck->pBt->autoVacuum && N>0 ){
|
|
0 |
0 |
if( pCheck->pBt->autoVacuum && N>0 ){
|
79263
|
0 |
0 |
if( N && nErrAtStart==pCheck->nErr ){
|
|
0 |
0 |
if( N && nErrAtStart==pCheck->nErr ){
|
79264
|
0 |
0 |
checkAppendMsg(pCheck,
|
79299
|
0 |
0 |
while( (j = i/2)>0 && aHeap[j]>aHeap[i] ){
|
|
0 |
0 |
while( (j = i/2)>0 && aHeap[j]>aHeap[i] ){
|
79308
|
0 |
0 |
if( (x = aHeap[0])==0 ) return 0;
|
79314
|
0 |
0 |
while( (j = i*2)<=aHeap[0] ){
|
79315
|
0 |
0 |
if( aHeap[j]>aHeap[j+1] ) j++;
|
79316
|
0 |
0 |
if( aHeap[i]<aHeap[j] ) break;
|
79375
|
0 |
0 |
if( pCheck->mxErr==0 ) goto end_of_check;
|
79378
|
0 |
0 |
if( iPage==0 ) return 0;
|
79379
|
0 |
0 |
if( checkRef(pCheck, iPage) ) return 0;
|
79382
|
0 |
0 |
if( (rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0 ){
|
79392
|
0 |
0 |
if( (rc = btreeInitPage(pPage))!=0 ){
|
79398
|
0 |
0 |
if( (rc = btreeComputeFreeSpace(pPage))!=0 ){
|
79422
|
0 |
0 |
if( !pPage->leaf ){
|
79426
|
0 |
0 |
if( pBt->autoVacuum ){
|
79442
|
0 |
0 |
for(i=nCell-1; i>=0 && pCheck->mxErr; i--){
|
|
0 |
0 |
for(i=nCell-1; i>=0 && pCheck->mxErr; i--){
|
79450
|
0 |
0 |
if( pc<contentOffset || pc>usableSize-4 ){
|
|
0 |
0 |
if( pc<contentOffset || pc>usableSize-4 ){
|
79458
|
0 |
0 |
if( pc+info.nSize>usableSize ){
|
79465
|
0 |
0 |
if( pPage->intKey ){
|
79466
|
0 |
0 |
if( keyCanBeEqual ? (info.nKey > maxKey) : (info.nKey >= maxKey) ){
|
|
0 |
0 |
if( keyCanBeEqual ? (info.nKey > maxKey) : (info.nKey >= maxKey) ){
|
79474
|
0 |
0 |
if( info.nPayload>info.nLocal ){
|
79481
|
0 |
0 |
if( pBt->autoVacuum ){
|
79488
|
0 |
0 |
if( !pPage->leaf ){
|
79492
|
0 |
0 |
if( pBt->autoVacuum ){
|
79498
|
0 |
0 |
if( d2!=depth ){
|
79512
|
0 |
0 |
if( doCoverageCheck && pCheck->mxErr>0 ){
|
|
0 |
0 |
if( doCoverageCheck && pCheck->mxErr>0 ){
|
79516
|
0 |
0 |
if( !pPage->leaf ){
|
79519
|
0 |
0 |
for(i=nCell-1; i>=0; i--){
|
79533
|
0 |
0 |
while( i>0 ){
|
79565
|
0 |
0 |
while( btreeHeapPull(heap,&x) ){
|
79566
|
0 |
0 |
if( (prev&0xffff)>=(x>>16) ){
|
79581
|
0 |
0 |
if( heap[0]==0 && nFrag!=data[hdr+7] ){
|
|
0 |
0 |
if( heap[0]==0 && nFrag!=data[hdr+7] ){
|
79589
|
0 |
0 |
if( !doCoverageCheck ) pPage->isInit = savedIsInit;
|
79641
|
0 |
0 |
if( aRoot[0]==0 ){
|
79644
|
0 |
0 |
if( aRoot[1]!=1 ) bCkFreelist = 0;
|
79659
|
0 |
0 |
if( sCheck.nPage==0 ){
|
79664
|
0 |
0 |
if( !sCheck.aPgRef ){
|
79669
|
0 |
0 |
if( sCheck.heap==0 ){
|
79675
|
0 |
0 |
if( i<=sCheck.nPage ) setPageReferenced(&sCheck, i);
|
79679
|
0 |
0 |
if( bCkFreelist ){
|
79689
|
0 |
0 |
if( !bPartial ){
|
79690
|
0 |
0 |
if( pBt->autoVacuum ){
|
79693
|
0 |
0 |
for(i=0; (int)i<nRoot; i++) if( mx<aRoot[i] ) mx = aRoot[i];
|
|
0 |
0 |
for(i=0; (int)i<nRoot; i++) if( mx<aRoot[i] ) mx = aRoot[i];
|
79695
|
0 |
0 |
if( mx!=mxInHdr ){
|
79701
|
0 |
0 |
}else if( get4byte(&pBt->pPage1->aData[64])!=0 ){
|
79710
|
0 |
0 |
for(i=0; (int)i<nRoot && sCheck.mxErr; i++){
|
|
0 |
0 |
for(i=0; (int)i<nRoot && sCheck.mxErr; i++){
|
79712
|
0 |
0 |
if( aRoot[i]==0 ) continue;
|
79714
|
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 ){
|
79724
|
0 |
0 |
if( !bPartial ){
|
79725
|
0 |
0 |
for(i=1; i<=sCheck.nPage && sCheck.mxErr; i++){
|
|
0 |
0 |
for(i=1; i<=sCheck.nPage && sCheck.mxErr; i++){
|
79735
|
0 |
0 |
(PTRMAP_PAGENO(pBt, i)!=i || !pBt->autoVacuum) ){
|
79739
|
0 |
0 |
(PTRMAP_PAGENO(pBt, i)==i && pBt->autoVacuum) ){
|
79752
|
0 |
0 |
if( sCheck.nErr==0 ){
|
79796
|
3490 |
2014 |
return p ? p->inTrans : 0;
|
79810
|
0 |
0 |
if( p ){
|
79813
|
0 |
0 |
if( pBt->inTransaction!=TRANS_NONE ){
|
79856
|
682 |
0 |
if( !pBt->pSchema && nBytes ){
|
|
316 |
366 |
if( !pBt->pSchema && nBytes ){
|
79889
|
0 |
31 |
if( p->sharable ){
|
79896
|
0 |
0 |
if( rc==SQLITE_OK ){
|
79922
|
0 |
0 |
rc = restoreCursorPosition(pCsr);
|
79923
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
79927
|
0 |
0 |
if( pCsr->eState!=CURSOR_VALID ){
|
79949
|
0 |
0 |
if( (pCsr->curFlags & BTCF_WriteFlag)==0 ){
|
79985
|
0 |
0 |
if( iVersion==1 ) pBt->btsFlags |= BTS_NO_WAL;
|
79988
|
0 |
0 |
if( rc==SQLITE_OK ){
|
79990
|
0 |
0 |
if( aData[18]!=(u8)iVersion || aData[19]!=(u8)iVersion ){
|
|
0 |
0 |
if( aData[18]!=(u8)iVersion || aData[19]!=(u8)iVersion ){
|
79992
|
0 |
0 |
if( rc==SQLITE_OK ){
|
79994
|
0 |
0 |
if( rc==SQLITE_OK ){
|
80032
|
0 |
0 |
if( pBt->inTransaction==TRANS_NONE ){
|
80142
|
0 |
16 |
if( i==1 ){
|
80146
|
0 |
0 |
if( sqlite3OpenTempDatabase(&sParse) ){
|
80152
|
0 |
0 |
if( rc ){
|
80157
|
0 |
16 |
if( i<0 ){
|
80182
|
0 |
8 |
if( sqlite3BtreeTxnState(p)!=SQLITE_TXN_NONE ){
|
80223
|
0 |
8 |
if( pSrcDb==pDestDb ){
|
80234
|
0 |
8 |
if( !p ){
|
80240
|
8 |
0 |
if( p ){
|
80248
|
8 |
0 |
if( 0==p->pSrc || 0==p->pDest
|
|
8 |
0 |
if( 0==p->pSrc || 0==p->pDest
|
80249
|
0 |
8 |
|| checkReadTransaction(pDestDb, p->pDest)!=SQLITE_OK
|
80260
|
8 |
0 |
if( p ){
|
80275
|
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));
|
80308
|
40 |
0 |
for(iOff=iEnd-(i64)nSrcPgsz; rc==SQLITE_OK && iOff<iEnd; iOff+=nDestPgsz){
|
|
20 |
20 |
for(iOff=iEnd-(i64)nSrcPgsz; rc==SQLITE_OK && iOff<iEnd; iOff+=nDestPgsz){
|
80311
|
0 |
20 |
if( iDest==PENDING_BYTE_PAGE(p->pDest->pBt) ) continue;
|
80312
|
20 |
0 |
if( SQLITE_OK==(rc = sqlite3PagerGet(pDestPager, iDest, &pDestPg, 0))
|
80313
|
20 |
0 |
&& SQLITE_OK==(rc = sqlite3PagerWrite(pDestPg))
|
80328
|
8 |
12 |
if( iOff==0 && bUpdate==0 ){
|
|
8 |
0 |
if( iOff==0 && bUpdate==0 ){
|
80349
|
0 |
0 |
if( rc==SQLITE_OK && iCurrent>iSize ){
|
|
0 |
0 |
if( rc==SQLITE_OK && iCurrent>iSize ){
|
80382
|
8 |
0 |
if( p->pDestDb ){
|
80387
|
8 |
0 |
if( !isFatalError(rc) ){
|
80397
|
8 |
0 |
if( p->pDestDb && p->pSrc->pBt->inTransaction==TRANS_WRITE ){
|
|
0 |
8 |
if( p->pDestDb && p->pSrc->pBt->inTransaction==TRANS_WRITE ){
|
80407
|
8 |
0 |
if( rc==SQLITE_OK && SQLITE_TXN_NONE==sqlite3BtreeTxnState(p->pSrc) ){
|
|
8 |
0 |
if( rc==SQLITE_OK && SQLITE_TXN_NONE==sqlite3BtreeTxnState(p->pSrc) ){
|
80418
|
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 ){
|
80423
|
8 |
0 |
if( SQLITE_OK==rc && p->bDestLocked==0
|
|
8 |
0 |
if( SQLITE_OK==rc && p->bDestLocked==0
|
80424
|
8 |
0 |
&& SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2,
|
80435
|
8 |
0 |
if( SQLITE_OK==rc
|
80436
|
8 |
0 |
&& (destMode==PAGER_JOURNALMODE_WAL || sqlite3PagerIsMemdb(pDestPager))
|
|
6 |
2 |
&& (destMode==PAGER_JOURNALMODE_WAL || sqlite3PagerIsMemdb(pDestPager))
|
80437
|
0 |
6 |
&& pgszSrc!=pgszDest
|
80447
|
0 |
28 |
for(ii=0; (nPage<0 || ii<nPage) && p->iNext<=(Pgno)nSrcPage && !rc; ii++){
|
|
0 |
0 |
for(ii=0; (nPage<0 || ii<nPage) && p->iNext<=(Pgno)nSrcPage && !rc; ii++){
|
|
20 |
8 |
for(ii=0; (nPage<0 || ii<nPage) && p->iNext<=(Pgno)nSrcPage && !rc; ii++){
|
|
20 |
0 |
for(ii=0; (nPage<0 || ii<nPage) && p->iNext<=(Pgno)nSrcPage && !rc; ii++){
|
80449
|
20 |
0 |
if( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) ){
|
80452
|
20 |
0 |
if( rc==SQLITE_OK ){
|
80459
|
8 |
0 |
if( rc==SQLITE_OK ){
|
80462
|
8 |
0 |
if( p->iNext>(Pgno)nSrcPage ){
|
80464
|
0 |
0 |
}else if( !p->isAttached ){
|
80474
|
8 |
0 |
if( rc==SQLITE_DONE ){
|
80475
|
0 |
8 |
if( nSrcPage==0 ){
|
80479
|
8 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_DONE ){
|
|
8 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_DONE ){
|
80482
|
8 |
0 |
if( rc==SQLITE_OK ){
|
80483
|
8 |
0 |
if( p->pDestDb ){
|
80486
|
0 |
8 |
if( destMode==PAGER_JOURNALMODE_WAL ){
|
80490
|
8 |
0 |
if( rc==SQLITE_OK ){
|
80506
|
0 |
8 |
if( pgszSrc<pgszDest ){
|
80509
|
0 |
0 |
if( nDestTruncate==(int)PENDING_BYTE_PAGE(p->pDest->pBt) ){
|
80517
|
0 |
8 |
if( pgszSrc<pgszDest ){
|
80548
|
0 |
0 |
for(iPg=nDestTruncate; rc==SQLITE_OK && iPg<=(Pgno)nDstPage; iPg++){
|
|
0 |
0 |
for(iPg=nDestTruncate; rc==SQLITE_OK && iPg<=(Pgno)nDstPage; iPg++){
|
80549
|
0 |
0 |
if( iPg!=PENDING_BYTE_PAGE(p->pDest->pBt) ){
|
80552
|
0 |
0 |
if( rc==SQLITE_OK ){
|
80558
|
0 |
0 |
if( rc==SQLITE_OK ){
|
80564
|
0 |
0 |
for(
|
80566
|
0 |
0 |
rc==SQLITE_OK && iOff<iEnd;
|
80572
|
0 |
0 |
if( rc==SQLITE_OK ){
|
80578
|
0 |
0 |
if( rc==SQLITE_OK ){
|
80583
|
0 |
0 |
if( rc==SQLITE_OK ){
|
80592
|
8 |
0 |
if( SQLITE_OK==rc
|
80593
|
8 |
0 |
&& SQLITE_OK==(rc = sqlite3BtreeCommitPhaseTwo(p->pDest, 0))
|
80605
|
8 |
0 |
if( bCloseTrans ){
|
80612
|
0 |
8 |
if( rc==SQLITE_IOERR_NOMEM ){
|
80617
|
8 |
0 |
if( p->pDestDb ){
|
80634
|
0 |
8 |
if( p==0 ) return SQLITE_OK;
|
80638
|
8 |
0 |
if( p->pDestDb ){
|
80643
|
8 |
0 |
if( p->pDestDb ){
|
80646
|
0 |
8 |
if( p->isAttached ){
|
80649
|
0 |
0 |
while( *pp!=p ){
|
80660
|
0 |
8 |
rc = (p->rc==SQLITE_DONE) ? SQLITE_OK : p->rc;
|
80661
|
8 |
0 |
if( p->pDestDb ){
|
80668
|
8 |
0 |
if( p->pDestDb ){
|
80726
|
0 |
0 |
if( !isFatalError(p->rc) && iPage<p->iNext ){
|
|
0 |
0 |
if( !isFatalError(p->rc) && iPage<p->iNext ){
|
80737
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
80741
|
0 |
0 |
}while( (p = p->pNext)!=0 );
|
80744
|
0 |
216 |
if( pBackup ) backupUpdate(pBackup, iPage, aData);
|
80760
|
0 |
1707 |
for(p=pBackup; p; p=p->pNext){
|
80784
|
0 |
0 |
if( pFd->pMethods ){
|
80787
|
0 |
0 |
if( rc==SQLITE_NOTFOUND ) rc = SQLITE_OK;
|
80788
|
0 |
0 |
if( rc ) goto copy_finished;
|
80812
|
0 |
0 |
if( rc==SQLITE_OK ){
|
80937
|
355 |
2 |
if( p->flags & MEM_Int ){
|
80950
|
0 |
2 |
sqlite3_str_appendf(&acc, "%!.15g",
|
81038
|
774 |
3611 |
if( !(pMem->flags&MEM_Str) ){
|
81042
|
3611 |
0 |
if( pMem->enc==desiredEnc ){
|
81083
|
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 ){
|
81084
|
282 |
0 |
if( pMem->db ){
|
81088
|
0 |
0 |
if( pMem->zMalloc==0 ) sqlite3_free(pMem->z);
|
81093
|
165 |
26956 |
if( pMem->szMalloc>0 ) sqlite3DbFreeNN(pMem->db, pMem->zMalloc);
|
81096
|
0 |
27403 |
if( pMem->zMalloc==0 ){
|
81105
|
314 |
27089 |
if( bPreserve && pMem->z ){
|
|
314 |
0 |
if( bPreserve && pMem->z ){
|
81109
|
4 |
27399 |
if( (pMem->flags&MEM_Dyn)!=0 ){
|
81135
|
23892 |
5514 |
if( pMem->szMalloc<szNew ){
|
81154
|
0 |
596 |
if( sqlite3VdbeMemGrow(pMem, pMem->n+3, 1) ){
|
81174
|
193 |
701 |
if( (pMem->flags & (MEM_Str|MEM_Blob))!=0 ){
|
81175
|
0 |
193 |
if( ExpandBlob(pMem) ) return SQLITE_NOMEM;
|
|
0 |
0 |
if( ExpandBlob(pMem) ) return SQLITE_NOMEM;
|
81176
|
97 |
96 |
if( pMem->szMalloc==0 || pMem->z!=pMem->zMalloc ){
|
|
97 |
0 |
if( pMem->szMalloc==0 || pMem->z!=pMem->zMalloc ){
|
81178
|
0 |
193 |
if( rc ) return rc;
|
81205
|
0 |
0 |
if( nByte<=0 ){
|
81206
|
0 |
0 |
if( (pMem->flags & MEM_Blob)==0 ) return SQLITE_OK;
|
81209
|
0 |
0 |
if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){
|
81230
|
0 |
403 |
if( (pMem->flags & (MEM_Term|MEM_Str))!=MEM_Str ){
|
81263
|
0 |
357 |
if( sqlite3VdbeMemClearAndResize(pMem, nByte) ){
|
81273
|
4 |
353 |
if( bForce ) pMem->flags &= ~(MEM_Int|MEM_Real|MEM_IntReal);
|
81305
|
138 |
81 |
if( pMem->szMalloc>0 ) sqlite3DbFreeNN(pMem->db, pMem->zMalloc);
|
81349
|
0 |
120 |
if( p->flags&MEM_Agg ){
|
81354
|
120 |
0 |
if( p->flags&MEM_Dyn ){
|
81370
|
110 |
477 |
if( VdbeMemDynamic(p) ){
|
81373
|
461 |
126 |
if( p->szMalloc ){
|
81392
|
6111 |
110 |
if( VdbeMemDynamic(p) || p->szMalloc ){
|
|
461 |
5650 |
if( VdbeMemDynamic(p) || p->szMalloc ){
|
81402
|
0 |
925 |
if( p->szMalloc ) vdbeMemClear(p);
|
81425
|
0 |
4 |
if( r<=(double)minInt ){
|
81427
|
0 |
4 |
}else if( r>=(double)maxInt ){
|
81457
|
3337 |
544 |
if( flags & (MEM_Int|MEM_IntReal) ){
|
81460
|
0 |
544 |
}else if( flags & MEM_Real ){
|
81462
|
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 ){
|
81485
|
226 |
24 |
if( pMem->flags & MEM_Real ){
|
81487
|
24 |
0 |
}else if( pMem->flags & (MEM_Int|MEM_IntReal) ){
|
81490
|
0 |
0 |
}else if( pMem->flags & (MEM_Str|MEM_Blob) ){
|
81504
|
489 |
340 |
if( pMem->flags & (MEM_Int|MEM_IntReal) ) return pMem->u.i!=0;
|
81505
|
128 |
212 |
if( pMem->flags & MEM_Null ) return ifNull;
|
81520
|
0 |
4 |
if( pMem->flags & MEM_IntReal ){
|
81535
|
0 |
4 |
if( pMem->u.r==ix && ix>SMALLEST_INT64 && ix<LARGEST_INT64 ){
|
|
0 |
0 |
if( pMem->u.r==ix && ix>SMALLEST_INT64 && ix<LARGEST_INT64 ){
|
|
0 |
0 |
if( pMem->u.r==ix && ix>SMALLEST_INT64 && ix<LARGEST_INT64 ){
|
81582
|
390 |
0 |
|| (memcmp(&r1, &r2, sizeof(r1))==0
|
|
390 |
0 |
|| (memcmp(&r1, &r2, sizeof(r1))==0
|
81583
|
390 |
0 |
&& i >= -2251799813685248LL && i < 2251799813685248LL);
|
|
390 |
0 |
&& i >= -2251799813685248LL && i < 2251799813685248LL);
|
81591
|
0 |
390 |
if( r<=(double)SMALLEST_INT64 ) return SMALLEST_INT64;
|
81592
|
0 |
390 |
if( r>=(double)LARGEST_INT64) return LARGEST_INT64;
|
81610
|
0 |
0 |
if( (pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Null))==0 ){
|
81616
|
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)
|
81617
|
0 |
0 |
|| sqlite3RealSameAsInt(pMem->u.r, (ix = sqlite3RealToI64(pMem->u.r)))
|
81638
|
0 |
3 |
if( pMem->flags & MEM_Null ) return SQLITE_OK;
|
81641
|
0 |
0 |
if( (pMem->flags & MEM_Blob)==0 ){
|
81644
|
0 |
0 |
if( pMem->flags & MEM_Str ) MemSetTypeFlag(pMem, MEM_Blob);
|
81669
|
0 |
0 |
if( encoding!=SQLITE_UTF8 ) pMem->n &= ~1;
|
81702
|
10 |
5513 |
if( VdbeMemDynamic(pMem) ){
|
81721
|
0 |
1 |
if( n<0 ) n = 0;
|
81758
|
0 |
1647 |
if( VdbeMemDynamic(pMem) ){
|
81781
|
16 |
0 |
pMem->u.zPType = zPType ? zPType : "";
|
81785
|
0 |
16 |
pMem->xDel = xDestructor ? xDestructor : sqlite3NoopDestructor;
|
81795
|
220 |
0 |
if( !sqlite3IsNaN(val) ){
|
81827
|
0 |
8 |
if( p==0 ) return SQLITE_NOMEM;
|
81840
|
3202 |
1113 |
if( p->flags & (MEM_Str|MEM_Blob) ){
|
81842
|
0 |
3202 |
if( p->flags & MEM_Zero ){
|
81902
|
0 |
1030 |
if( VdbeMemDynamic(pTo) ){ vdbeClrCopy(pTo,pFrom,srcType); return; }
|
81904
|
884 |
146 |
if( (pFrom->flags&MEM_Static)==0 ){
|
81919
|
0 |
158 |
if( VdbeMemDynamic(pTo) ) vdbeMemClearExternAndSetNull(pTo);
|
81922
|
104 |
54 |
if( pTo->flags&(MEM_Str|MEM_Blob) ){
|
81923
|
75 |
29 |
if( 0==(pFrom->flags&MEM_Static) ){
|
81988
|
3139 |
22731 |
if( !z ){
|
81993
|
22731 |
0 |
if( pMem->db ){
|
81998
|
19713 |
3018 |
if( nByte<0 ){
|
82000
|
19713 |
0 |
if( enc==SQLITE_UTF8 ){
|
82003
|
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){}
|
82006
|
1138 |
1880 |
}else if( enc==0 ){
|
82012
|
0 |
22731 |
if( nByte>iLimit ){
|
82013
|
0 |
0 |
if( xDel && xDel!=SQLITE_TRANSIENT ){
|
|
0 |
0 |
if( xDel && xDel!=SQLITE_TRANSIENT ){
|
82014
|
0 |
0 |
if( xDel==SQLITE_DYNAMIC ){
|
82028
|
19980 |
2751 |
if( xDel==SQLITE_TRANSIENT ){
|
82030
|
17793 |
2187 |
if( flags&MEM_Term ){
|
82031
|
17793 |
0 |
nAlloc += (enc==SQLITE_UTF8?1:2);
|
82036
|
198 |
19782 |
if( sqlite3VdbeMemClearAndResize(pMem, (int)MAX(nAlloc,32)) ){
|
|
0 |
19980 |
if( sqlite3VdbeMemClearAndResize(pMem, (int)MAX(nAlloc,32)) ){
|
82043
|
666 |
2085 |
if( xDel==SQLITE_DYNAMIC ){
|
82048
|
1985 |
100 |
flags |= ((xDel==SQLITE_STATIC)?MEM_Static:MEM_Dyn);
|
82057
|
0 |
22731 |
if( enc>SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){
|
|
0 |
0 |
if( enc>SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){
|
82089
|
0 |
15 |
if( sqlite3BtreeMaxRecordSize(pCur)<offset+amt ){
|
82092
|
15 |
0 |
if( SQLITE_OK==(rc = sqlite3VdbeMemClearAndResize(pMem, amt+1)) ){
|
82094
|
15 |
0 |
if( rc==SQLITE_OK ){
|
82121
|
925 |
0 |
if( amt<=available ){
|
82142
|
403 |
353 |
if( pVal->flags & (MEM_Blob|MEM_Str) ){
|
82143
|
0 |
403 |
if( ExpandBlob(pVal) ) return 0;
|
|
0 |
0 |
if( ExpandBlob(pVal) ) return 0;
|
82145
|
0 |
403 |
if( pVal->enc != (enc & ~SQLITE_UTF16_ALIGNED) ){
|
82148
|
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)) ){
|
82150
|
0 |
0 |
if( sqlite3VdbeMemMakeWriteable(pVal)!=SQLITE_OK ){
|
82161
|
756 |
0 |
if( pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) ){
|
82180
|
17 |
9257 |
if( !pVal ) return 0;
|
82184
|
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 ){
|
82188
|
35 |
756 |
if( pVal->flags&MEM_Null ){
|
82199
|
47 |
0 |
if( p ){
|
82405
|
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;
|
82406
|
0 |
0 |
if( op==TK_REGISTER ) op = pExpr->op2;
|
82414
|
0 |
0 |
if( op==TK_CAST ){
|
82420
|
0 |
0 |
if( *ppVal ){
|
82437
|
0 |
0 |
if( op==TK_UMINUS
|
82438
|
0 |
0 |
&& (pExpr->pLeft->op==TK_INTEGER || pExpr->pLeft->op==TK_FLOAT) ){
|
|
0 |
0 |
&& (pExpr->pLeft->op==TK_INTEGER || pExpr->pLeft->op==TK_FLOAT) ){
|
82445
|
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 ){
|
82447
|
0 |
0 |
if( pVal==0 ) goto no_mem;
|
82448
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_IntValue) ){
|
82452
|
0 |
0 |
if( zVal==0 ) goto no_mem;
|
82455
|
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 ){
|
82461
|
0 |
0 |
if( pVal->flags & (MEM_Int|MEM_IntReal|MEM_Real) ){
|
82466
|
0 |
0 |
if( enc!=SQLITE_UTF8 ){
|
82469
|
0 |
0 |
}else if( op==TK_UMINUS ) {
|
82471
|
0 |
0 |
if( SQLITE_OK==valueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal,pCtx)
|
82472
|
0 |
0 |
&& pVal!=0
|
82475
|
0 |
0 |
if( pVal->flags & MEM_Real ){
|
82477
|
0 |
0 |
}else if( pVal->u.i==SMALLEST_INT64 ){
|
82489
|
0 |
0 |
}else if( op==TK_NULL ){
|
82491
|
0 |
0 |
if( pVal==0 ) goto no_mem;
|
82495
|
0 |
0 |
else if( op==TK_BLOB ){
|
82501
|
0 |
0 |
if( !pVal ) goto no_mem;
|
82514
|
0 |
0 |
else if( op==TK_TRUEFALSE ){
|
82517
|
0 |
0 |
if( pVal ){
|
82558
|
0 |
0 |
return pExpr ? valueFromExpr(db, pExpr, enc, affinity, ppVal, 0) : 0;
|
82787
|
118 |
0 |
if( v ) sqlite3VdbeMemSetStr((Mem *)v, z, n, enc, xDel);
|
82794
|
538 |
47 |
if( !v ) return;
|
82805
|
0 |
0 |
return valueToText(pVal, enc)!=0 ? pVal->n : 0;
|
82810
|
3426 |
775 |
if( (p->flags & MEM_Str)!=0 && pVal->enc==enc ){
|
|
3426 |
0 |
if( (p->flags & MEM_Str)!=0 && pVal->enc==enc ){
|
82813
|
0 |
775 |
if( (p->flags & MEM_Str)!=0 && enc!=SQLITE_UTF8 && pVal->enc!=SQLITE_UTF8 ){
|
|
0 |
0 |
if( (p->flags & MEM_Str)!=0 && enc!=SQLITE_UTF8 && pVal->enc!=SQLITE_UTF8 ){
|
|
0 |
0 |
if( (p->flags & MEM_Str)!=0 && enc!=SQLITE_UTF8 && pVal->enc!=SQLITE_UTF8 ){
|
82816
|
775 |
0 |
if( (p->flags & MEM_Blob)!=0 ){
|
82817
|
0 |
775 |
if( p->flags & MEM_Zero ){
|
82823
|
0 |
0 |
if( p->flags & MEM_Null ) return 0;
|
82857
|
0 |
5389 |
if( p==0 ) return 0;
|
82860
|
1167 |
4222 |
if( db->pVdbe ){
|
82899
|
24 |
4840 |
if( p==0 ) return;
|
82901
|
11 |
4829 |
if( (prepFlags & SQLITE_PREPARE_SAVESQL)==0 ){
|
83008
|
41 |
5389 |
: (sqlite3_int64)(1024/sizeof(Op)));
|
83013
|
0 |
5430 |
if( nNew > p->db->aLimit[SQLITE_LIMIT_VDBE_OP] ){
|
83021
|
5430 |
0 |
if( pNew ){
|
83026
|
5430 |
0 |
return (pNew ? SQLITE_OK : SQLITE_NOMEM_BKPT);
|
83067
|
0 |
5430 |
if( growOpArray(p, 1) ) return 1;
|
83078
|
5430 |
64932 |
if( p->nOpAlloc<=i ){
|
83149
|
1545 |
306 |
for(i=0; (c = zTypes[i])!=0; i++){
|
83150
|
847 |
698 |
if( c=='s' ){
|
83151
|
594 |
253 |
const char *z = va_arg(ap, const char*);
|
83152
|
147 |
700 |
sqlite3VdbeAddOp4(p, z==0 ? OP_Null : OP_String8, 0, iDest+i, 0, z, 0);
|
83153
|
682 |
16 |
}else if( c=='i' ){
|
83154
|
372 |
310 |
sqlite3VdbeAddOp2(p, OP_Integer, va_arg(ap, int), iDest+i);
|
83207
|
0 |
700 |
if( pCtx==0 ){
|
83218
|
0 |
700 |
addr = sqlite3VdbeAddOp4(v, eCallCtx ? OP_PureFunc : OP_Function,
|
83239
|
2192 |
0 |
if( p4copy ) memcpy(p4copy, zP4, 8);
|
83250
|
1986 |
0 |
if( pParse->addrExplain==0 ) return 0;
|
83277
|
0 |
814 |
if( pParse->explain==2 || IS_STMT_SCANSTATUS(pParse->db) )
|
83292
|
0 |
0 |
if( bPush){
|
83321
|
612 |
302 |
for(j=0; j<p->db->nDb; j++) sqlite3VdbeUsesBtree(p, j);
|
83337
|
9409 |
0 |
if( p->db->mallocFailed==0 ){
|
83398
|
0 |
4790 |
if( p->aLabel==0 ){
|
83405
|
0 |
4790 |
if( nNewSize>=100 && (nNewSize/100)>(p->nLabelAlloc/100) ){
|
|
0 |
0 |
if( nNewSize>=100 && (nNewSize/100)>(p->nLabelAlloc/100) ){
|
83423
|
4790 |
6433 |
if( p->nLabelAlloc + p->nLabel < 0 ){
|
83443
|
0 |
0 |
for(i=1; ALWAYS(i<p->nOp); i++){
|
83444
|
0 |
0 |
if( ALWAYS(p->aOp[i].opcode==OP_Expire) ){
|
83664
|
21578 |
43513 |
if( pOp->opcode<=SQLITE_MX_JUMP_OPCODE ){
|
83669
|
3225 |
1534 |
if( pOp->p2!=0 ) p->readOnly = 0;
|
83692
|
22 |
0 |
if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2;
|
83700
|
119 |
29 |
if( n>nMaxArgs ) nMaxArgs = n;
|
83706
|
3546 |
7579 |
if( pOp->p2<0 ){
|
83727
|
4768 |
611 |
if( aLabel ){
|
83910
|
0 |
36 |
if( p->nOp + nOp > p->nOpAlloc && growOpArray(p, nOp) ){
|
|
0 |
0 |
if( p->nOp + nOp > p->nOpAlloc && growOpArray(p, nOp) ){
|
83914
|
222 |
36 |
for(i=0; i<nOp; i++, aOp++, pOut++){
|
83919
|
41 |
181 |
if( (sqlite3OpcodeProperty[aOp->opcode] & OPFLG_JUMP)!=0 && aOp->p2>0 ){
|
|
41 |
0 |
if( (sqlite3OpcodeProperty[aOp->opcode] & OPFLG_JUMP)!=0 && aOp->p2>0 ){
|
84057
|
12349 |
0 |
if( p->nOp>0 ) p->aOp[p->nOp-1].p5 = p5;
|
84067
|
22 |
0 |
if( pOp->p3==iDest && pOp->opcode==OP_Column ){
|
|
18 |
4 |
if( pOp->p3==iDest && pOp->opcode==OP_Column ){
|
84094
|
27 |
14 |
if( addr==p->nOp-1 ){
|
84115
|
25 |
951 |
if( (pDef->funcFlags & SQLITE_FUNC_EPHEM)!=0 ){
|
84124
|
0 |
0 |
if( p->szMalloc ) sqlite3DbFree(db, p->zMalloc);
|
84143
|
6568 |
147 |
if( p4 ) sqlite3DbNNFreeNN(db, p4);
|
84147
|
762 |
0 |
if( db->pnBytesFreed==0 ) sqlite3KeyInfoUnref((KeyInfo*)p4);
|
84161
|
0 |
0 |
if( db->pnBytesFreed==0 ){
|
84169
|
192 |
0 |
if( db->pnBytesFreed==0 ) sqlite3VtabUnlock((VTable *)p4);
|
84183
|
5389 |
0 |
if( aOp ){
|
84186
|
8144 |
56983 |
if( pOp->p4type <= P4_FREE_IF_LE ) freeP4(db, pOp->p4type, pOp->p4.p);
|
84190
|
5389 |
59738 |
if( pOp==aOp ) break;
|
84219
|
0 |
770 |
if( p->db->mallocFailed ) return 0;
|
84234
|
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 ){
|
84299
|
1246 |
3953 |
if( pOp->p4type ){
|
84304
|
1246 |
3953 |
if( n<0 ){
|
84307
|
3371 |
582 |
if( n==0 ) n = sqlite3Strlen30(zP4);
|
84319
|
0 |
11913 |
if( db->mallocFailed ){
|
84320
|
0 |
0 |
if( n!=P4_VTAB ) freeP4(db, n, (void*)*(char**)&zP4);
|
84325
|
1771 |
10142 |
if( addr<0 ){
|
84329
|
7960 |
3953 |
if( n>=0 || pOp->p4type ){
|
|
1246 |
6714 |
if( n>=0 || pOp->p4type ){
|
84333
|
1246 |
5468 |
if( n==P4_INT32 ){
|
84338
|
5378 |
90 |
}else if( zP4!=0 ){
|
84342
|
192 |
5186 |
if( n==P4_VTAB ) sqlite3VtabLock((VTable*)zP4);
|
84359
|
0 |
3140 |
if( p->db->mallocFailed ){
|
84381
|
77 |
0 |
if( pKeyInfo ) sqlite3VdbeAppendP4(v, pKeyInfo, P4_KEYINFO);
|
84447
|
0 |
7032 |
if( p->db->mallocFailed ){
|
84662
|
0 |
0 |
for(j=0; j<pKeyInfo->nKeyField; j++){
|
84664
|
0 |
0 |
const char *zColl = pColl ? pColl->zName : "";
|
84665
|
0 |
0 |
if( strcmp(zColl, "BINARY")==0 ) zColl = "B";
|
84666
|
0 |
0 |
sqlite3_str_appendf(&x, ",%s%s%s",
|
|
0 |
0 |
sqlite3_str_appendf(&x, ",%s%s%s",
|
84712
|
0 |
0 |
if( pMem->flags & MEM_Str ){
|
84714
|
0 |
0 |
}else if( pMem->flags & (MEM_Int|MEM_IntReal) ){
|
84716
|
0 |
0 |
}else if( pMem->flags & MEM_Real ){
|
84718
|
0 |
0 |
}else if( pMem->flags & MEM_Null ){
|
84738
|
0 |
0 |
for(i=1; i<=n; i++){
|
84739
|
0 |
0 |
sqlite3_str_appendf(&x, "%c%u", (i==1 ? '[' : ','), ai[i]);
|
84756
|
0 |
0 |
if( zP4 ) sqlite3_str_appendall(&x, zP4);
|
84757
|
0 |
0 |
if( (x.accError & SQLITE_NOMEM)!=0 ){
|
84776
|
2753 |
2917 |
if( i!=1 && sqlite3BtreeSharable(p->db->aDb[i].pBt) ){
|
|
0 |
2753 |
if( i!=1 && sqlite3BtreeSharable(p->db->aDb[i].pBt) ){
|
84808
|
5692 |
0 |
if( DbMaskAllZero(p->lockMask) ) return; /* The common case */
|
84812
|
0 |
0 |
for(i=0; i<nDb; i++){
|
84813
|
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) ){
|
84832
|
0 |
0 |
for(i=0; i<nDb; i++){
|
84833
|
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) ){
|
84839
|
5692 |
0 |
if( DbMaskAllZero(p->lockMask) ) return; /* The common case */
|
84893
|
7943 |
4825 |
if( N>0 ){
|
84902
|
47705 |
7943 |
}while( (--N)>0 );
|
84915
|
13653 |
0 |
if( p && N ){
|
|
8828 |
4825 |
if( p && N ){
|
84918
|
0 |
8828 |
if( db->pnBytesFreed ){
|
84920
|
0 |
0 |
if( p->szMalloc ) sqlite3DbFree(db, p->zMalloc);
|
84921
|
0 |
0 |
}while( (++p)<pEnd );
|
84942
|
51 |
63258 |
if( p->flags&(MEM_Agg|MEM_Dyn) ){
|
84946
|
33381 |
29877 |
}else if( p->szMalloc ){
|
84956
|
54481 |
8828 |
}while( (++p)<pEnd );
|
85020
|
0 |
0 |
if( pSub!=0 ){
|
85021
|
0 |
0 |
if( pSub->flags&MEM_Blob ){
|
85027
|
0 |
0 |
for(i=0; i<nSub; i++){
|
85034
|
0 |
0 |
if( i>=nRow ){
|
85039
|
0 |
0 |
if( i<p->nOp ){
|
85050
|
0 |
0 |
for(j=0; i>=apSub[j]->nOp; j++){
|
85062
|
0 |
0 |
if( pSub!=0 && aOp[i].p4type==P4_SUBPROGRAM ){
|
|
0 |
0 |
if( pSub!=0 && aOp[i].p4type==P4_SUBPROGRAM ){
|
85065
|
0 |
0 |
for(j=0; j<nSub; j++){
|
85066
|
0 |
0 |
if( apSub[j]==aOp[i].p4.pProgram ) break;
|
85068
|
0 |
0 |
if( j==nSub ){
|
85070
|
0 |
0 |
if( p->rc!=SQLITE_OK ){
|
85081
|
0 |
0 |
if( eMode==0 ) break;
|
85092
|
0 |
0 |
if( aOp[i].opcode==OP_Explain ) break;
|
85093
|
0 |
0 |
if( aOp[i].opcode==OP_Init && iPc>1 ) break;
|
|
0 |
0 |
if( aOp[i].opcode==OP_Init && iPc>1 ) break;
|
85113
|
0 |
0 |
for(i=0; i<p->nChildCsr; i++){
|
85114
|
0 |
0 |
if( apCsr[i] ) sqlite3VdbeFreeCursorNN(p->v, apCsr[i]);
|
85148
|
0 |
0 |
int bListSubprogs = (p->explain==1 || (db->flags & SQLITE_TriggerEQP)!=0);
|
|
0 |
0 |
int bListSubprogs = (p->explain==1 || (db->flags & SQLITE_TriggerEQP)!=0);
|
85162
|
0 |
0 |
if( p->rc==SQLITE_NOMEM ){
|
85169
|
0 |
0 |
if( bListSubprogs ){
|
85183
|
0 |
0 |
if( rc==SQLITE_OK ){
|
85185
|
0 |
0 |
if( AtomicLoad(&db->u1.isInterrupted) ){
|
85191
|
0 |
0 |
if( p->explain==2 ){
|
85218
|
0 |
0 |
if( db->mallocFailed ){
|
85310
|
21955 |
1125 |
if( pBuf==0 ){
|
85312
|
21516 |
439 |
if( nByte <= p->nFree ){
|
85413
|
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 */
|
85427
|
335 |
5044 |
p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort);
|
|
310 |
25 |
p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort);
|
85428
|
0 |
5379 |
if( pParse->explain ){
|
85434
|
0 |
0 |
if( nMem<10 ) nMem = 10;
|
85436
|
0 |
0 |
if( pParse->explain==2 ){
|
85445
|
0 |
0 |
for(i=iFirst; i<mx; i++){
|
85467
|
391 |
4988 |
if( x.nNeeded ){
|
85470
|
391 |
0 |
if( !db->mallocFailed ){
|
85478
|
0 |
5379 |
if( db->mallocFailed ){
|
85498
|
677 |
235 |
if( pCx ) sqlite3VdbeFreeCursorNN(p,pCx);
|
85529
|
7256 |
6264 |
for(i=0; i<p->nCursor; i++){
|
85531
|
5878 |
1378 |
if( pC ){
|
85570
|
0 |
6264 |
if( p->pFrame ){
|
85572
|
0 |
0 |
for(pFrame=p->pFrame; pFrame->pParent; pFrame=pFrame->pParent);
|
85580
|
0 |
6264 |
while( p->pDelFrame ){
|
85587
|
0 |
6264 |
if( p->pAuxData ) sqlite3VdbeDeleteAuxData(p->db, &p->pAuxData, -1, 0);
|
85601
|
4 |
2006 |
if( p->nResColumn ){
|
85608
|
0 |
2010 |
if( p->aColName==0 ) return;
|
85633
|
0 |
22353 |
if( p->db->mallocFailed ){
|
85679
|
7233 |
0 |
for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
|
|
4855 |
2378 |
for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
|
85681
|
1079 |
3776 |
if( sqlite3BtreeTxnState(pBt)==SQLITE_TXN_WRITE ){
|
85697
|
878 |
201 |
if( db->aDb[i].safety_level!=PAGER_SYNCHRONOUS_OFF
|
85698
|
95 |
783 |
&& aMJNeeded[sqlite3PagerGetJournalMode(pPager)]
|
85699
|
95 |
0 |
&& sqlite3PagerIsMemdb(pPager)==0
|
85708
|
0 |
2378 |
if( rc!=SQLITE_OK ){
|
85713
|
1061 |
1317 |
if( needXcommit && db->xCommitCallback ){
|
|
10 |
1051 |
if( needXcommit && db->xCommitCallback ){
|
85715
|
4 |
6 |
if( rc ){
|
85729
|
323 |
2051 |
if( 0==sqlite3Strlen30(sqlite3BtreeGetFilename(db->aDb[0].pBt))
|
85730
|
323 |
0 |
|| nTrans<=1
|
85732
|
7221 |
0 |
for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
|
|
4847 |
2374 |
for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
|
85734
|
2833 |
2014 |
if( pBt ){
|
85744
|
7221 |
0 |
for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
|
|
4847 |
2374 |
for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
|
85746
|
2833 |
2014 |
if( pBt ){
|
85750
|
2374 |
0 |
if( rc==SQLITE_OK ){
|
85773
|
0 |
0 |
if( zSuper==0 ) return SQLITE_NOMEM_BKPT;
|
85777
|
0 |
0 |
if( retryCount ){
|
85778
|
0 |
0 |
if( retryCount>100 ){
|
85782
|
0 |
0 |
}else if( retryCount==1 ){
|
85795
|
0 |
0 |
}while( rc==SQLITE_OK && res );
|
|
0 |
0 |
}while( rc==SQLITE_OK && res );
|
85796
|
0 |
0 |
if( rc==SQLITE_OK ){
|
85803
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
85814
|
0 |
0 |
for(i=0; i<db->nDb; i++){
|
85816
|
0 |
0 |
if( sqlite3BtreeTxnState(pBt)==SQLITE_TXN_WRITE ){
|
85818
|
0 |
0 |
if( zFile==0 ){
|
85824
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
85836
|
0 |
0 |
if( 0==(sqlite3OsDeviceCharacteristics(pSuperJrnl)&SQLITE_IOCAP_SEQUENTIAL)
|
85837
|
0 |
0 |
&& SQLITE_OK!=(rc = sqlite3OsSync(pSuperJrnl, SQLITE_SYNC_NORMAL))
|
85855
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
|
85857
|
0 |
0 |
if( pBt ){
|
85863
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
85875
|
0 |
0 |
if( rc ){
|
85888
|
0 |
0 |
for(i=0; i<db->nDb; i++){
|
85890
|
0 |
0 |
if( pBt ){
|
85956
|
108 |
54 |
for(i=0; i<db->nDb; i++){
|
85959
|
54 |
54 |
if( pBt ){
|
85960
|
0 |
54 |
if( eOp==SAVEPOINT_ROLLBACK ){
|
85963
|
54 |
0 |
if( rc2==SQLITE_OK ){
|
85966
|
54 |
0 |
if( rc==SQLITE_OK ){
|
85974
|
54 |
0 |
if( rc==SQLITE_OK ){
|
85975
|
0 |
54 |
if( eOp==SAVEPOINT_ROLLBACK ){
|
85978
|
54 |
0 |
if( rc==SQLITE_OK ){
|
85986
|
0 |
54 |
if( eOp==SAVEPOINT_ROLLBACK ){
|
85993
|
108 |
3187 |
if( p->db->nStatement && p->iStatement ){
|
|
54 |
54 |
if( p->db->nStatement && p->iStatement ){
|
86013
|
2587 |
5654 |
if( (deferred && (db->nDeferredCons+db->nDeferredImmCons)>0)
|
|
2587 |
0 |
if( (deferred && (db->nDeferredCons+db->nDeferredImmCons)>0)
|
86014
|
5654 |
2587 |
|| (!deferred && p->nFkConstraint>0)
|
|
1 |
5653 |
|| (!deferred && p->nFkConstraint>0)
|
86019
|
0 |
1 |
if( (p->prepFlags & SQLITE_PREPARE_SAVESQL)==0 ) return SQLITE_ERROR;
|
86060
|
0 |
6264 |
if( db->mallocFailed ){
|
86068
|
5692 |
572 |
if( p->bIsReader ){
|
86077
|
38 |
5654 |
if( p->rc ){
|
86080
|
38 |
0 |
|| mrc==SQLITE_IOERR
|
86081
|
38 |
0 |
|| mrc==SQLITE_INTERRUPT
|
86082
|
38 |
0 |
|| mrc==SQLITE_FULL;
|
|
0 |
38 |
|| mrc==SQLITE_FULL;
|
86086
|
0 |
5692 |
if( isSpecialError ){
|
86099
|
0 |
0 |
if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){
|
|
0 |
0 |
if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){
|
86100
|
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 ){
|
86115
|
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) ){
|
86125
|
547 |
5145 |
if( !sqlite3VtabInSync(db)
|
|
259 |
288 |
if( !sqlite3VtabInSync(db)
|
86126
|
2812 |
2592 |
&& db->autoCommit
|
86127
|
2397 |
415 |
&& db->nVdbeWrite==(p->readOnly==0)
|
86129
|
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) ){
|
86131
|
0 |
2378 |
if( rc!=SQLITE_OK ){
|
86132
|
0 |
0 |
if( NEVER(p->readOnly) ){
|
86137
|
0 |
2378 |
}else if( db->flags & SQLITE_CorruptRdOnly ){
|
86147
|
0 |
2378 |
if( rc==SQLITE_BUSY && p->readOnly ){
|
|
0 |
0 |
if( rc==SQLITE_BUSY && p->readOnly ){
|
86150
|
4 |
2374 |
}else if( rc!=SQLITE_OK ){
|
86160
|
0 |
19 |
}else if( p->rc==SQLITE_SCHEMA && db->nVdbeActive>1 ){
|
|
0 |
0 |
}else if( p->rc==SQLITE_SCHEMA && db->nVdbeActive>1 ){
|
86167
|
3295 |
0 |
}else if( eStatementOp==0 ){
|
86168
|
20 |
3275 |
if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){
|
|
0 |
20 |
if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){
|
86170
|
20 |
0 |
}else if( p->errorAction==OE_Abort ){
|
86186
|
3295 |
2397 |
if( eStatementOp ){
|
86188
|
0 |
3295 |
if( rc ){
|
86189
|
0 |
0 |
if( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_CONSTRAINT ){
|
|
0 |
0 |
if( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_CONSTRAINT ){
|
86204
|
3354 |
2338 |
if( p->changeCntOn ){
|
86205
|
3354 |
0 |
if( eStatementOp!=SAVEPOINT_ROLLBACK ){
|
86219
|
3728 |
2536 |
if( !p->readOnly ) db->nVdbeWrite--;
|
86220
|
5692 |
572 |
if( p->bIsReader ) db->nVdbeRead--;
|
86226
|
0 |
6264 |
if( db->mallocFailed ){
|
86239
|
7 |
6257 |
return (p->rc==SQLITE_BUSY ? SQLITE_BUSY : SQLITE_OK);
|
86262
|
76 |
375 |
if( p->zErrMsg ){
|
86265
|
14 |
62 |
if( db->pErr==0 ) db->pErr = sqlite3ValueNew(db);
|
86269
|
363 |
12 |
}else if( db->pErr ){
|
86321
|
541 |
7126 |
if( p->eVdbeState==VDBE_RUN_STATE ) sqlite3VdbeHalt(p);
|
86328
|
6264 |
1403 |
if( p->pc>=0 ){
|
86330
|
5863 |
401 |
if( db->pErr || p->zErrMsg ){
|
|
0 |
5863 |
if( db->pErr || p->zErrMsg ){
|
86347
|
38 |
7629 |
if( p->zErrMsg ){
|
86405
|
3575 |
10 |
if( p->eVdbeState>=VDBE_READY_STATE ){
|
86430
|
0 |
6 |
while( *pp ){
|
86432
|
0 |
0 |
if( (iOp<0)
|
86433
|
0 |
0 |
|| (pAux->iAuxOp==iOp
|
86434
|
0 |
0 |
&& pAux->iAuxArg>=0
|
86435
|
0 |
0 |
&& (pAux->iAuxArg>31 || !(mask & MASKBIT32(pAux->iAuxArg))))
|
|
0 |
0 |
&& (pAux->iAuxArg>31 || !(mask & MASKBIT32(pAux->iAuxArg))))
|
86438
|
0 |
0 |
if( pAux->xDeleteAux ){
|
86461
|
2006 |
3383 |
if( p->aColName ){
|
86465
|
0 |
5389 |
for(pSub=p->pProgram; pSub; pSub=pNext){
|
86470
|
5379 |
10 |
if( p->eVdbeState!=VDBE_INIT_STATE ){
|
86472
|
22 |
5357 |
if( p->pVList ) sqlite3DbNNFreeNN(db, p->pVList);
|
86473
|
391 |
4988 |
if( p->pFree ) sqlite3DbNNFreeNN(db, p->pFree);
|
86476
|
4840 |
549 |
if( p->zSql ) sqlite3DbNNFreeNN(db, p->zSql);
|
86509
|
5389 |
0 |
if( db->pnBytesFreed==0 ){
|
86512
|
1100 |
4289 |
if( p->pVNext ){
|
86533
|
0 |
430 |
if( rc ) return rc;
|
86534
|
0 |
430 |
if( res!=0 ) return SQLITE_CORRUPT_BKPT;
|
86557
|
0 |
0 |
if( isDifferentRow ) p->nullRow = 1;
|
86567
|
0 |
1118 |
if( sqlite3BtreeCursorHasMoved(p->uc.pCursor) ){
|
86712
|
632 |
20293 |
if( serial_type>=128 ){
|
86802
|
84 |
62992 |
if( serial_type==6 ){
|
86826
|
0 |
62992 |
pMem->flags = IsNaN(x) ? MEM_Null : MEM_Real;
|
|
0 |
0 |
pMem->flags = IsNaN(x) ? MEM_Null : MEM_Real;
|
86942
|
0 |
213 |
if( !p ) return 0;
|
86970
|
20204 |
0 |
idx = getVarint32(aKey, szHdr);
|
86973
|
20214 |
0 |
while( idx<szHdr && d<=(u32)nKey ){
|
|
20214 |
0 |
while( idx<szHdr && d<=(u32)nKey ){
|
86976
|
20214 |
0 |
idx += getVarint32(&aKey[idx], serial_type);
|
86985
|
20204 |
10 |
if( (++u)>=p->nField ) break;
|
86987
|
0 |
20204 |
if( d>(u32)nKey && u ){
|
|
0 |
0 |
if( d>(u32)nKey && u ){
|
87158
|
2373 |
0 |
if( pMem1->enc==pColl->enc ){
|
87173
|
0 |
0 |
if( (v1==0 || v2==0) ){
|
|
0 |
0 |
if( (v1==0 || v2==0) ){
|
87174
|
0 |
0 |
if( prcErr ) *prcErr = SQLITE_NOMEM_BKPT;
|
87191
|
0 |
0 |
for(i=0; i<n; i++){
|
87192
|
0 |
0 |
if( z[i] ) return 0;
|
87214
|
0 |
191 |
if( (pB1->flags|pB2->flags) & MEM_Zero ){
|
87215
|
0 |
0 |
if( pB1->flags & pB2->flags & MEM_Zero ){
|
87217
|
0 |
0 |
}else if( pB1->flags & MEM_Zero ){
|
87218
|
0 |
0 |
if( !isAllZero(pB2->z, pB2->n) ) return -1;
|
87221
|
0 |
0 |
if( !isAllZero(pB1->z, pB1->n) ) return +1;
|
87226
|
0 |
191 |
if( c ) return c;
|
87241
|
0 |
0 |
if( x<r ) return -1;
|
87242
|
0 |
0 |
if( x>r ) return +1; /*NO_TEST*/ /* work around bugs in gcov */
|
87280
|
25 |
2409 |
if( combined_flags&MEM_Null ){
|
87286
|
541 |
1868 |
if( combined_flags&(MEM_Int|MEM_Real|MEM_IntReal) ){
|
87290
|
405 |
136 |
if( (f1 & f2 & (MEM_Int|MEM_IntReal))!=0 ){
|
87293
|
44 |
361 |
if( pMem1->u.i < pMem2->u.i ) return -1;
|
87294
|
21 |
340 |
if( pMem1->u.i > pMem2->u.i ) return +1;
|
87297
|
0 |
136 |
if( (f1 & f2 & MEM_Real)!=0 ){
|
87298
|
0 |
0 |
if( pMem1->u.r < pMem2->u.r ) return -1;
|
87299
|
0 |
0 |
if( pMem1->u.r > pMem2->u.r ) return +1;
|
87302
|
16 |
120 |
if( (f1&(MEM_Int|MEM_IntReal))!=0 ){
|
87305
|
0 |
16 |
if( (f2&MEM_Real)!=0 ){
|
87307
|
0 |
16 |
}else if( (f2&(MEM_Int|MEM_IntReal))!=0 ){
|
87308
|
0 |
0 |
if( pMem1->u.i < pMem2->u.i ) return -1;
|
87309
|
0 |
0 |
if( pMem1->u.i > pMem2->u.i ) return +1;
|
87315
|
120 |
0 |
if( (f1&MEM_Real)!=0 ){
|
87316
|
0 |
120 |
if( (f2&(MEM_Int|MEM_IntReal))!=0 ){
|
87330
|
1868 |
0 |
if( combined_flags&MEM_Str ){
|
87331
|
0 |
1868 |
if( (f1 & MEM_Str)==0 ){
|
87334
|
0 |
1868 |
if( (f2 & MEM_Str)==0 ){
|
87348
|
1677 |
191 |
if( pColl ){
|
87440
|
60 |
36120 |
if( bSkip ){
|
87442
|
60 |
0 |
if( s1<0x80 ){
|
87452
|
36120 |
0 |
if( (szHdr1 = aKey1[0])<0x80 ){
|
87460
|
0 |
36180 |
if( d1>(unsigned)nKey1 ){
|
87475
|
543 |
35656 |
if( pRhs->flags & (MEM_Int|MEM_IntReal) ){
|
87480
|
0 |
543 |
if( serial_type>=10 ){
|
87481
|
0 |
0 |
rc = serial_type==10 ? -1 : +1;
|
87482
|
8 |
535 |
}else if( serial_type==0 ){
|
87484
|
0 |
535 |
}else if( serial_type==7 ){
|
87490
|
96 |
439 |
if( lhs<rhs ){
|
87492
|
4 |
435 |
}else if( lhs>rhs ){
|
87499
|
34912 |
744 |
else if( pRhs->flags & MEM_Real ){
|
87501
|
0 |
34912 |
if( serial_type>=10 ){
|
87506
|
0 |
0 |
rc = serial_type==10 ? -1 : +1;
|
87507
|
0 |
34912 |
}else if( serial_type==0 ){
|
87511
|
34912 |
0 |
if( serial_type==7 ){
|
87512
|
17588 |
17324 |
if( mem1.u.r<pRhs->u.r ){
|
87514
|
17324 |
0 |
}else if( mem1.u.r>pRhs->u.r ){
|
87524
|
702 |
42 |
else if( pRhs->flags & MEM_Str ){
|
87525
|
0 |
702 |
getVarint32NR(&aKey1[idx1], serial_type);
|
87527
|
6 |
696 |
if( serial_type<12 ){
|
87529
|
0 |
696 |
}else if( !(serial_type & 0x01) ){
|
87535
|
696 |
0 |
if( (d1+mem1.n) > (unsigned)nKey1
|
87536
|
0 |
696 |
|| (pKeyInfo = pPKey2->pKeyInfo)->nAllField<=i
|
87540
|
696 |
0 |
}else if( pKeyInfo->aColl[i] ){
|
87551
|
0 |
0 |
if( rc==0 ) rc = mem1.n - pRhs->n;
|
87557
|
0 |
42 |
else if( pRhs->flags & MEM_Blob ){
|
87559
|
0 |
0 |
getVarint32NR(&aKey1[idx1], serial_type);
|
87561
|
0 |
0 |
if( serial_type<12 || (serial_type & 0x01) ){
|
|
0 |
0 |
if( serial_type<12 || (serial_type & 0x01) ){
|
87567
|
0 |
0 |
if( (d1+nStr) > (unsigned)nKey1 ){
|
87570
|
0 |
0 |
}else if( pRhs->flags & MEM_Zero ){
|
87571
|
0 |
0 |
if( !isAllZero((const char*)&aKey1[d1],nStr) ){
|
87579
|
0 |
0 |
if( rc==0 ) rc = nStr - pRhs->n;
|
87587
|
15 |
27 |
rc = (serial_type!=0 && serial_type!=10);
|
|
15 |
0 |
rc = (serial_type!=0 && serial_type!=10);
|
87590
|
35672 |
527 |
if( rc!=0 ){
|
87592
|
17448 |
18224 |
if( sortFlags ){
|
87593
|
0 |
17448 |
if( (sortFlags & KEYINFO_ORDER_BIGNULL)==0
|
87594
|
0 |
0 |
|| ((sortFlags & KEYINFO_ORDER_DESC)
|
87595
|
0 |
0 |
!=(serial_type==0 || (pRhs->flags&MEM_Null)))
|
|
0 |
0 |
!=(serial_type==0 || (pRhs->flags&MEM_Null)))
|
87606
|
508 |
19 |
if( i==pPKey2->nField ) break;
|
87609
|
0 |
19 |
if( d1>(unsigned)nKey1 ) break;
|
87611
|
0 |
19 |
if( idx1>=(unsigned)szHdr1 ){
|
87719
|
378 |
114 |
if( v>lhs ){
|
87721
|
2 |
112 |
}else if( v<lhs ){
|
87723
|
55 |
57 |
}else if( pPKey2->nField>1 ){
|
87759
|
2 |
11 |
if( serial_type<12 ){
|
87760
|
0 |
2 |
if( serial_type<0 ){
|
87762
|
0 |
0 |
if( serial_type>=12 ) goto vrcs_restart;
|
87766
|
0 |
11 |
}else if( !(serial_type & 0x01) ){
|
87774
|
0 |
11 |
if( (szHdr + nStr) > nKey1 ){
|
87781
|
0 |
11 |
if( res>0 ){
|
87783
|
1 |
10 |
}else if( res<0 ){
|
87787
|
4 |
6 |
if( res==0 ){
|
87788
|
0 |
4 |
if( pPKey2->nField>1 ){
|
87794
|
0 |
6 |
}else if( res>0 ){
|
87828
|
283 |
0 |
if( p->pKeyInfo->nAllField<=13 ){
|
87830
|
0 |
283 |
if( p->pKeyInfo->aSortFlags[0] ){
|
87831
|
0 |
0 |
if( p->pKeyInfo->aSortFlags[0] & KEYINFO_ORDER_BIGNULL ){
|
87840
|
234 |
49 |
if( (flags & MEM_Int) ){
|
87847
|
33 |
16 |
if( (flags & (MEM_Real|MEM_IntReal|MEM_Null|MEM_Blob))==0
|
87848
|
15 |
18 |
&& p->pKeyInfo->aColl[0]==0
|
87888
|
0 |
450 |
if( rc ){
|
87893
|
0 |
450 |
getVarint32NR((u8*)m.z, szHdr);
|
87898
|
450 |
0 |
if( unlikely(szHdr<3 || szHdr>(unsigned)m.n) ){
|
|
450 |
0 |
if( unlikely(szHdr<3 || szHdr>(unsigned)m.n) ){
|
87904
|
0 |
450 |
getVarint32NR((u8*)&m.z[szHdr-1], typeRowid);
|
87913
|
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) ){
|
87918
|
0 |
450 |
if( unlikely((u32)m.n<szHdr+lenRowid) ){
|
87964
|
0 |
0 |
if( nCellKey<=0 || nCellKey>0x7fffffff ){
|
|
0 |
0 |
if( nCellKey<=0 || nCellKey>0x7fffffff ){
|
87970
|
0 |
0 |
if( rc ){
|
88016
|
211 |
850 |
for(p = db->pVdbe; p; p=p->pVNext){
|
88045
|
0 |
0 |
if( v ){
|
88048
|
0 |
0 |
if( 0==(pMem->flags & MEM_Null) ){
|
88050
|
0 |
0 |
if( pRet ){
|
88068
|
0 |
0 |
if( iVar>=32 ){
|
88090
|
0 |
0 |
if( pOp->opcode==OP_PureFunc ){
|
88093
|
0 |
0 |
if( pOp->p5 & NC_IsCheck ){
|
88095
|
0 |
0 |
}else if( pOp->p5 & NC_GenCol ){
|
88130
|
0 |
2123 |
if( pVtab->zErrMsg ){
|
88276
|
0 |
0 |
return p==0 || p->expired;
|
|
0 |
0 |
return p==0 || p->expired;
|
88286
|
0 |
17873 |
if( p->db==0 ){
|
88294
|
0 |
16069 |
if( p==0 ){
|
88317
|
6 |
0 |
if( db->xProfile ){
|
88321
|
0 |
6 |
if( db->mTrace & SQLITE_TRACE_PROFILE ){
|
88347
|
1266 |
1804 |
if( pStmt==0 ){
|
88354
|
0 |
1804 |
if( vdbeSafety(v) ) return SQLITE_MISUSE_BKPT;
|
88356
|
0 |
1804 |
checkProfileCallback(db, v);
|
88376
|
104 |
2288 |
if( pStmt==0 ){
|
88382
|
0 |
2288 |
checkProfileCallback(db, v);
|
88403
|
0 |
0 |
for(i=0; i<p->nVar; i++){
|
88408
|
0 |
0 |
if( p->expmask ){
|
88422
|
782 |
0 |
if( p->flags & (MEM_Blob|MEM_Str) ){
|
88423
|
0 |
782 |
if( ExpandBlob(p)!=SQLITE_OK ){
|
|
0 |
0 |
if( ExpandBlob(p)!=SQLITE_OK ){
|
88428
|
780 |
2 |
return p->n ? p->z : 0;
|
88450
|
0 |
0 |
return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
|
88454
|
16 |
0 |
if( (p->flags&(MEM_TypeMask|MEM_Term|MEM_Subtype)) ==
|
88456
|
16 |
0 |
&& zPType!=0
|
88457
|
16 |
0 |
&& p->eSubtype=='p'
|
88458
|
16 |
0 |
&& strcmp(p->u.zPType, zPType)==0
|
88585
|
0 |
0 |
if( pOrig==0 ) return 0;
|
88587
|
0 |
0 |
if( pNew==0 ) return 0;
|
88592
|
0 |
0 |
if( pNew->flags&(MEM_Str|MEM_Blob) ){
|
88595
|
0 |
0 |
if( sqlite3VdbeMemMakeWriteable(pNew)!=SQLITE_OK ){
|
88599
|
0 |
0 |
}else if( pNew->flags & MEM_Null ){
|
88634
|
0 |
1274 |
if( rc ){
|
88635
|
0 |
0 |
if( rc==SQLITE_TOOBIG ){
|
88646
|
0 |
1274 |
if( sqlite3VdbeMemTooBig(pOut) ){
|
88656
|
0 |
0 |
if( xDel==0 ){
|
88658
|
0 |
0 |
}else if( xDel==SQLITE_TRANSIENT ){
|
88684
|
0 |
0 |
if( n>0x7fffffff ){
|
88754
|
0 |
0 |
if( enc!=SQLITE_UTF8 ){
|
88755
|
0 |
0 |
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
|
88758
|
0 |
0 |
if( n>0x7fffffff ){
|
88798
|
0 |
102 |
if( sqlite3VdbeMemTooBig(pOut) ){
|
88808
|
0 |
1 |
if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){
|
88820
|
0 |
0 |
pCtx->isError = errCode ? errCode : -1;
|
88824
|
0 |
0 |
if( pCtx->pOut->flags & MEM_Null ){
|
88853
|
0 |
0 |
if( pCtx->pOut->flags & MEM_Int ){
|
88869
|
6400 |
3120 |
for(i=0; i<db->nDb; i++){
|
88871
|
3828 |
2572 |
if( pBt ){
|
88876
|
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 ){
|
88901
|
6265 |
6663 |
if( p->eVdbeState!=VDBE_RUN_STATE ){
|
88903
|
6265 |
0 |
if( p->eVdbeState==VDBE_READY_STATE ){
|
88904
|
1 |
6264 |
if( p->expired ){
|
88907
|
1 |
0 |
if( (p->prepFlags & SQLITE_PREPARE_SAVESQL)!=0 ){
|
88922
|
5174 |
1090 |
if( db->nVdbeActive==0 ){
|
88931
|
8 |
6256 |
if( (db->mTrace & (SQLITE_TRACE_PROFILE|SQLITE_TRACE_XPROFILE))!=0
|
88932
|
6 |
2 |
&& !db->init.busy && p->zSql ){
|
|
6 |
0 |
&& !db->init.busy && p->zSql ){
|
88940
|
3728 |
2536 |
if( p->readOnly==0 ) db->nVdbeWrite++;
|
88941
|
5692 |
572 |
if( p->bIsReader ) db->nVdbeRead++;
|
88946
|
0 |
0 |
if( ALWAYS(p->eVdbeState==VDBE_HALT_STATE) ){
|
88981
|
0 |
12927 |
if( p->explain ){
|
88991
|
7197 |
5730 |
if( rc==SQLITE_ROW ){
|
88999
|
6 |
5724 |
checkProfileCallback(db, p);
|
89002
|
5681 |
49 |
if( rc==SQLITE_DONE && db->autoCommit ){
|
|
3120 |
2561 |
if( rc==SQLITE_DONE && db->autoCommit ){
|
89005
|
0 |
3120 |
if( p->rc!=SQLITE_OK ){
|
89008
|
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 ){
|
89018
|
0 |
5730 |
if( SQLITE_NOMEM==sqlite3ApiExit(p->db, p->rc) ){
|
89020
|
0 |
0 |
if( (p->prepFlags & SQLITE_PREPARE_SAVESQL)!=0 ) rc = p->rc;
|
89043
|
0 |
12927 |
if( vdbeSafetyNotNull(v) ){
|
89048
|
1 |
12927 |
while( (rc = sqlite3Step(v))==SQLITE_SCHEMA
|
89049
|
1 |
0 |
&& cnt++ < SQLITE_MAX_SCHEMA_RETRY ){
|
89052
|
0 |
1 |
if( rc!=SQLITE_OK ){
|
89063
|
0 |
0 |
if( !db->mallocFailed ){
|
89073
|
0 |
1 |
if( savedPc>=0 ){
|
89154
|
0 |
0 |
if( pVal==0 ) return SQLITE_MISUSE;
|
89155
|
0 |
0 |
if( (pVal->flags & MEM_Dyn)==0 || pVal->xDel!=sqlite3VdbeValueListFree ){
|
|
0 |
0 |
if( (pVal->flags & MEM_Dyn)==0 || pVal->xDel!=sqlite3VdbeValueListFree ){
|
89164
|
0 |
0 |
if( bNext ){
|
89170
|
0 |
0 |
if( sqlite3BtreeEof(pRhs->pCsr) ) rc = SQLITE_DONE;
|
89172
|
0 |
0 |
if( rc==SQLITE_OK ){
|
89178
|
0 |
0 |
if( rc==SQLITE_OK ){
|
89182
|
0 |
0 |
int iOff = 1 + getVarint32(&zBuf[1], iSerial);
|
89185
|
0 |
0 |
if( (pOut->flags & MEM_Ephem)!=0 && sqlite3VdbeMemMakeWriteable(pOut) ){
|
|
0 |
0 |
if( (pOut->flags & MEM_Ephem)!=0 && sqlite3VdbeMemMakeWriteable(pOut) ){
|
89228
|
0 |
0 |
if( *piTime==0 ){
|
89230
|
0 |
0 |
if( rc ) *piTime = 0;
|
89242
|
81 |
138 |
if( nByte<=0 ){
|
89249
|
138 |
0 |
if( pMem->z ){
|
89265
|
219 |
500 |
if( (p->pMem->flags & MEM_Agg)==0 ){
|
89291
|
0 |
0 |
for(pAuxData=pCtx->pVdbe->pAuxData; pAuxData; pAuxData=pAuxData->pNextAux){
|
89292
|
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) ){
|
89326
|
0 |
0 |
for(pAuxData=pVdbe->pAuxData; pAuxData; pAuxData=pAuxData->pNextAux){
|
89327
|
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) ){
|
89331
|
0 |
0 |
if( pAuxData==0 ){
|
89333
|
0 |
0 |
if( !pAuxData ) goto failed;
|
89338
|
0 |
0 |
if( pCtx->isError==0 ) pCtx->isError = -1;
|
89339
|
0 |
0 |
}else if( pAuxData->xDeleteAux ){
|
89348
|
0 |
0 |
if( xDelete ){
|
89374
|
5398 |
4 |
return pVm ? pVm->nResColumn : 0;
|
89383
|
75 |
0 |
if( pVm==0 || pVm->pResultRow==0 ) return 0;
|
|
0 |
75 |
if( pVm==0 || pVm->pResultRow==0 ) return 0;
|
89435
|
0 |
13649 |
if( pVm==0 ) return (Mem*)columnNullValue();
|
89438
|
13647 |
2 |
if( pVm->pResultRow!=0 && i<pVm->nResColumn && i>=0 ){
|
|
13647 |
0 |
if( pVm->pResultRow!=0 && i<pVm->nResColumn && i>=0 ){
|
|
13647 |
0 |
if( pVm->pResultRow!=0 && i<pVm->nResColumn && i>=0 ){
|
89473
|
13649 |
0 |
if( p ){
|
89527
|
0 |
75 |
if( pOut->flags&MEM_Static ){
|
89584
|
3740 |
0 |
if( N<n && N>=0 ){
|
|
3740 |
0 |
if( N<n && N>=0 ){
|
89589
|
0 |
3740 |
if( useUtf16 ){
|
89600
|
0 |
3740 |
if( db->mallocFailed > prior_mallocFailed ){
|
89708
|
0 |
3142 |
if( vdbeSafetyNotNull(p) ){
|
89712
|
0 |
3142 |
if( p->eVdbeState!=VDBE_READY_STATE ){
|
89719
|
0 |
3142 |
if( i>=(unsigned int)p->nVar ){
|
89739
|
0 |
3142 |
if( p->expmask!=0 && (p->expmask & (i>=31 ? 0x80000000 : (u32)1<<i))!=0 ){
|
|
0 |
0 |
if( p->expmask!=0 && (p->expmask & (i>=31 ? 0x80000000 : (u32)1<<i))!=0 ){
|
|
0 |
0 |
if( p->expmask!=0 && (p->expmask & (i>=31 ? 0x80000000 : (u32)1<<i))!=0 ){
|
89761
|
1852 |
0 |
if( rc==SQLITE_OK ){
|
89762
|
1852 |
0 |
if( zData!=0 ){
|
89765
|
1852 |
0 |
if( rc==SQLITE_OK && encoding!=0 ){
|
|
1300 |
552 |
if( rc==SQLITE_OK && encoding!=0 ){
|
89768
|
0 |
1852 |
if( rc ){
|
89774
|
0 |
0 |
}else if( xDel!=SQLITE_STATIC && xDel!=SQLITE_TRANSIENT ){
|
|
0 |
0 |
}else if( xDel!=SQLITE_STATIC && xDel!=SQLITE_TRANSIENT ){
|
89810
|
2 |
0 |
if( rc==SQLITE_OK ){
|
89823
|
1005 |
0 |
if( rc==SQLITE_OK ){
|
89833
|
283 |
0 |
if( rc==SQLITE_OK ){
|
89848
|
0 |
0 |
if( rc==SQLITE_OK ){
|
89851
|
0 |
0 |
}else if( xDestructor ){
|
89874
|
0 |
0 |
if( enc!=SQLITE_UTF8 ){
|
89875
|
0 |
0 |
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
|
89900
|
0 |
0 |
rc = sqlite3_bind_double(pStmt, i,
|
89906
|
0 |
0 |
if( pValue->flags & MEM_Zero ){
|
89929
|
0 |
0 |
if( rc==SQLITE_OK ){
|
89943
|
0 |
0 |
if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
|
89960
|
1515 |
7 |
return p ? p->nVar : 0;
|
89971
|
0 |
4 |
if( p==0 ) return 0;
|
89981
|
7 |
0 |
if( p==0 || zName==0 ) return 0;
|
|
0 |
7 |
if( p==0 || zName==0 ) return 0;
|
89998
|
0 |
1 |
for(i=0; i<pFrom->nVar; i++){
|
90021
|
0 |
0 |
if( pFrom->nVar!=pTo->nVar ){
|
90025
|
0 |
0 |
if( pTo->expmask ){
|
90029
|
0 |
0 |
if( pFrom->expmask ){
|
90043
|
0 |
0 |
return pStmt ? ((Vdbe*)pStmt)->db : 0;
|
90051
|
0 |
0 |
return pStmt ? ((Vdbe*)pStmt)->readOnly : 1;
|
90059
|
0 |
0 |
return pStmt ? ((Vdbe*)pStmt)->explain : 0;
|
90067
|
0 |
0 |
return v!=0 && v->eVdbeState==VDBE_RUN_STATE;
|
|
0 |
0 |
return v!=0 && v->eVdbeState==VDBE_RUN_STATE;
|
90085
|
0 |
0 |
if( pStmt==0 ){
|
90108
|
0 |
6 |
if( op==SQLITE_STMTSTATUS_MEMUSED ){
|
90121
|
0 |
6 |
if( resetFlag ) pVdbe->aCounter[op] = 0;
|
90131
|
1678 |
0 |
return p ? p->zSql : 0;
|
90149
|
0 |
0 |
if( zSql ){
|
90582
|
44 |
4 |
while( zSql[0] ){
|
90585
|
4 |
40 |
if( tokenType==TK_VARIABLE ){
|
90637
|
0 |
6 |
if( db->nVdbeExec>1 ){
|
90638
|
0 |
0 |
while( *zRawSql ){
|
90640
|
0 |
0 |
while( *(zRawSql++)!='\n' && *zRawSql );
|
|
0 |
0 |
while( *(zRawSql++)!='\n' && *zRawSql );
|
90645
|
2 |
4 |
}else if( p->nVar==0 ){
|
90648
|
8 |
0 |
while( zRawSql[0] ){
|
90654
|
4 |
4 |
if( nToken==0 ) break;
|
90655
|
4 |
0 |
if( zRawSql[0]=='?' ){
|
90656
|
0 |
4 |
if( nToken>1 ){
|
90676
|
0 |
4 |
if( pVar->flags & MEM_Null ){
|
90678
|
0 |
4 |
}else if( pVar->flags & (MEM_Int|MEM_IntReal) ){
|
90680
|
0 |
4 |
}else if( pVar->flags & MEM_Real ){
|
90682
|
4 |
0 |
}else if( pVar->flags & MEM_Str ){
|
90686
|
0 |
4 |
if( enc!=SQLITE_UTF8 ){
|
90690
|
0 |
0 |
if( SQLITE_NOMEM==sqlite3VdbeChangeEncoding(&utf8, SQLITE_UTF8) ){
|
90711
|
0 |
4 |
if( enc!=SQLITE_UTF8 ) sqlite3VdbeMemRelease(&utf8);
|
90713
|
0 |
0 |
}else if( pVar->flags & MEM_Zero ){
|
90723
|
0 |
0 |
for(i=0; i<nOut; i++){
|
90735
|
0 |
6 |
if( out.accError ) sqlite3_str_reset(&out);
|
91009
|
1213 |
5544 |
Mem *pMem = iCur>0 ? &p->aMem[p->nMem-iCur] : p->aMem;
|
91013
|
6044 |
713 |
nByte =
|
91018
|
202 |
6555 |
if( p->apCsr[iCur] ){ /*OPTIMIZATION-IF-FALSE*/
|
91030
|
6552 |
205 |
if( pMem->szMalloc<nByte ){
|
91031
|
194 |
6358 |
if( pMem->szMalloc>0 ){
|
91035
|
0 |
6552 |
if( pMem->zMalloc==0 ){
|
91047
|
6044 |
713 |
if( eCurType==CURTYPE_BTREE ){
|
91064
|
390 |
0 |
if( sqlite3RealSameAsInt(rValue,iValue) ){
|
91092
|
38 |
394 |
if( rc<=0 ) return;
|
91093
|
390 |
4 |
if( rc==1 && alsoAnInt(pRec, rValue, &pRec->u.i) ){
|
|
390 |
0 |
if( rc==1 && alsoAnInt(pRec, rValue, &pRec->u.i) ){
|
91098
|
4 |
0 |
if( bTryForInt ) sqlite3VdbeIntegerAffinity(pRec);
|
91135
|
2166 |
1369 |
if( affinity>=SQLITE_AFF_NUMERIC ){
|
91138
|
1117 |
1049 |
if( (pRec->flags & MEM_Int)==0 ){ /*OPTIMIZATION-IF-FALSE*/
|
91139
|
1117 |
0 |
if( (pRec->flags & (MEM_Real|MEM_IntReal))==0 ){
|
91140
|
312 |
805 |
if( pRec->flags & MEM_Str ) applyNumericAffinity(pRec,1);
|
91141
|
0 |
0 |
}else if( affinity<=SQLITE_AFF_REAL ){
|
91145
|
1359 |
10 |
}else if( affinity==SQLITE_AFF_TEXT ){
|
91151
|
41 |
1318 |
if( 0==(pRec->flags&MEM_Str) ){ /*OPTIMIZATION-IF-FALSE*/
|
91152
|
4 |
37 |
if( (pRec->flags&(MEM_Real|MEM_Int|MEM_IntReal)) ){
|
91171
|
26 |
10 |
if( eType==SQLITE_TEXT ){
|
91202
|
0 |
2 |
if( ExpandBlob(pMem) ){
|
|
0 |
0 |
if( ExpandBlob(pMem) ){
|
91207
|
0 |
2 |
if( rc<=0 ){
|
91208
|
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 ){
|
91214
|
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 ){
|
91231
|
2 |
2 |
if( pMem->flags & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Null) ){
|
91404
|
9 |
16888 |
if( VdbeMemDynamic(pOut) ){ /*OPTIMIZATION-IF-FALSE*/
|
91421
|
0 |
0 |
for(i=pOp->p3, mx=i+pOp->p4.i; i<mx; i++){
|
91423
|
0 |
0 |
if( p->flags & (MEM_Int|MEM_IntReal) ){
|
91425
|
0 |
0 |
}else if( p->flags & MEM_Real ){
|
91427
|
0 |
0 |
}else if( p->flags & (MEM_Str|MEM_Blob) ){
|
91486
|
0 |
13014 |
if( DbMaskNonZero(p->lockMask) ){
|
91490
|
4014 |
9000 |
if( db->xProgress ){
|
91498
|
0 |
13014 |
if( p->rc==SQLITE_NOMEM ){
|
91510
|
0 |
13014 |
if( AtomicLoad(&db->u1.isInterrupted) ) goto abort_due_to_interrupt;
|
91700
|
0 |
19610 |
if( AtomicLoad(&db->u1.isInterrupted) ) goto abort_due_to_interrupt;
|
91708
|
240 |
19610 |
while( nVmStep>=nProgressLimit && db->xProgress!=0 ){
|
|
240 |
0 |
while( nVmStep>=nProgressLimit && db->xProgress!=0 ){
|
91711
|
0 |
240 |
if( db->xProgress(db->pProgressArg) ){
|
91762
|
239 |
81 |
if( pIn1->flags & MEM_Int ){
|
91790
|
22 |
26 |
if( pOp->p2==0 ) break;
|
91860
|
88 |
0 |
if( (pIn3->flags & MEM_Null)==0 ) break;
|
91908
|
0 |
5453 |
if( p->pFrame && pOp->p1==SQLITE_OK ){
|
|
0 |
0 |
if( p->pFrame && pOp->p1==SQLITE_OK ){
|
91915
|
0 |
0 |
if( pOp->p2==OE_Ignore ){
|
91931
|
4 |
5449 |
if( p->rc ){
|
91932
|
4 |
0 |
if( pOp->p5 ){
|
91940
|
3 |
1 |
if( pOp->p4.z ){
|
91951
|
0 |
5453 |
if( rc==SQLITE_BUSY ){
|
91956
|
5 |
5448 |
rc = p->rc ? SQLITE_ERROR : SQLITE_DONE;
|
92015
|
0 |
3027 |
if( encoding!=SQLITE_UTF8 ){
|
92018
|
0 |
0 |
if( rc ) goto too_big;
|
92019
|
0 |
0 |
if( SQLITE_OK!=sqlite3VdbeChangeEncoding(pOut, encoding) ) goto no_mem;
|
92024
|
0 |
0 |
if( pOp->p4type==P4_DYNAMIC ){
|
92032
|
0 |
3027 |
if( pOp->p1>db->aLimit[SQLITE_LIMIT_LENGTH] ){
|
92062
|
0 |
3222 |
if( pOp->p3>0 ){
|
92066
|
0 |
0 |
if( pIn3->u.i==pOp->p5 ) pOut->flags = MEM_Blob|MEM_Static|MEM_Term;
|
92113
|
0 |
1666 |
pOut->flags = nullFlag = pOp->p1 ? (MEM_Null|MEM_Cleared) : MEM_Null;
|
92118
|
819 |
1666 |
while( cnt>0 ){
|
92154
|
0 |
267 |
if( pOp->p4.z==0 ){
|
92156
|
0 |
0 |
if( sqlite3VdbeMemExpandBlob(pOut) ) goto no_mem;
|
92179
|
0 |
2939 |
if( sqlite3VdbeMemTooBig(pVar) ){
|
92183
|
0 |
2939 |
if( VdbeMemDynamic(pOut) ) sqlite3VdbeMemSetNull(pOut);
|
92229
|
0 |
149 |
Deephemeralize(pOut);
|
|
0 |
0 |
Deephemeralize(pOut);
|
92233
|
0 |
149 |
}while( --n );
|
92260
|
819 |
57 |
Deephemeralize(pOut);
|
|
0 |
819 |
Deephemeralize(pOut);
|
92261
|
0 |
876 |
if( (pOut->flags & MEM_Subtype)!=0 && (pOp->p5 & 0x0002)!=0 ){
|
|
0 |
0 |
if( (pOut->flags & MEM_Subtype)!=0 && (pOp->p5 & 0x0002)!=0 ){
|
92268
|
876 |
0 |
if( (n--)==0 ) break;
|
92328
|
0 |
0 |
if( (rc = sqlite3VdbeCheckFk(p,0))!=SQLITE_OK ){
|
92366
|
0 |
7284 |
if( db->mallocFailed ) goto no_mem;
|
92367
|
0 |
7284 |
if( db->mTrace & SQLITE_TRACE_ROW ){
|
92401
|
0 |
0 |
if( (flags1 | pIn2->flags) & MEM_Null ){
|
92405
|
0 |
0 |
if( (flags1 & (MEM_Str|MEM_Blob))==0 ){
|
92406
|
0 |
0 |
if( sqlite3VdbeMemStringify(pIn1,encoding,0) ) goto no_mem;
|
92408
|
0 |
0 |
}else if( (flags1 & MEM_Zero)!=0 ){
|
92409
|
0 |
0 |
if( sqlite3VdbeMemExpandBlob(pIn1) ) goto no_mem;
|
92413
|
0 |
0 |
if( (flags2 & (MEM_Str|MEM_Blob))==0 ){
|
92414
|
0 |
0 |
if( sqlite3VdbeMemStringify(pIn2,encoding,0) ) goto no_mem;
|
92416
|
0 |
0 |
}else if( (flags2 & MEM_Zero)!=0 ){
|
92417
|
0 |
0 |
if( sqlite3VdbeMemExpandBlob(pIn2) ) goto no_mem;
|
92421
|
0 |
0 |
if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
|
92424
|
0 |
0 |
if( sqlite3VdbeMemGrow(pOut, (int)nByte+2, pOut==pIn2) ){
|
92428
|
0 |
0 |
if( pOut!=pIn2 ){
|
92436
|
0 |
0 |
if( encoding>SQLITE_UTF8 ) nByte &= ~1;
|
92501
|
38 |
43 |
if( (type1 & type2 & MEM_Int)!=0 ){
|
92506
|
0 |
40 |
case OP_Add: if( sqlite3AddInt64(&iB,iA) ) goto fp_math; break;
|
92507
|
0 |
0 |
case OP_Subtract: if( sqlite3SubInt64(&iB,iA) ) goto fp_math; break;
|
92508
|
0 |
0 |
case OP_Multiply: if( sqlite3MulInt64(&iB,iA) ) goto fp_math; break;
|
92510
|
0 |
0 |
if( iA==0 ) goto arithmetic_result_is_null;
|
92511
|
0 |
0 |
if( iA==-1 && iB==SMALLEST_INT64 ) goto fp_math;
|
|
0 |
0 |
if( iA==-1 && iB==SMALLEST_INT64 ) goto fp_math;
|
92516
|
0 |
0 |
if( iA==0 ) goto arithmetic_result_is_null;
|
92517
|
0 |
0 |
if( iA==-1 ) iA = 1;
|
92524
|
41 |
2 |
}else if( ((type1 | type2) & MEM_Null)!=0 ){
|
92529
|
2 |
0 |
if( (type1 & type2 & MEM_Int)!=0 ) goto int_math;
|
92539
|
0 |
0 |
if( rA==(double)0 ) goto arithmetic_result_is_null;
|
92546
|
0 |
0 |
if( iA==0 ) goto arithmetic_result_is_null;
|
92547
|
0 |
0 |
if( iA==-1 ) iA = 1;
|
92556
|
0 |
0 |
if( sqlite3IsNaN(rB) ){
|
92587
|
0 |
27 |
if( pOp->p1 ){
|
92635
|
0 |
0 |
if( (pIn1->flags | pIn2->flags) & MEM_Null ){
|
92642
|
0 |
0 |
if( op==OP_BitAnd ){
|
92644
|
0 |
0 |
}else if( op==OP_BitOr ){
|
92646
|
0 |
0 |
}else if( iB!=0 ){
|
92650
|
0 |
0 |
if( iB<0 ){
|
92653
|
0 |
0 |
iB = iB>(-64) ? -iB : 64;
|
92656
|
0 |
0 |
if( iB>=64 ){
|
92657
|
0 |
0 |
iA = (iA>=0 || op==OP_ShiftLeft) ? 0 : -1;
|
|
0 |
0 |
iA = (iA>=0 || op==OP_ShiftLeft) ? 0 : -1;
|
92660
|
0 |
0 |
if( op==OP_ShiftLeft ){
|
92665
|
0 |
0 |
if( iA<0 ) uA |= ((((u64)0xffffffff)<<32)|0xffffffff) << (64-iB);
|
92700
|
114 |
267 |
if( (pIn1->flags & MEM_Int)==0 ){
|
92702
|
4 |
110 |
if( (pIn1->flags & MEM_Int)==0 ){
|
92704
|
4 |
0 |
if( pOp->p2==0 ){
|
92729
|
0 |
0 |
if( pIn1->flags & (MEM_Int|MEM_IntReal) ){
|
92764
|
0 |
3 |
rc = ExpandBlob(pIn1);
|
92765
|
0 |
3 |
if( rc ) goto abort_due_to_error;
|
92767
|
0 |
3 |
if( rc ) goto abort_due_to_error;
|
92881
|
283 |
2101 |
if( (flags1 & flags3 & MEM_Int)!=0 ){
|
92883
|
225 |
58 |
if( pIn3->u.i > pIn1->u.i ){
|
92884
|
0 |
225 |
if( sqlite3aGTb[pOp->opcode] ){
|
92890
|
21 |
37 |
}else if( pIn3->u.i < pIn1->u.i ){
|
92891
|
20 |
1 |
if( sqlite3aLTb[pOp->opcode] ){
|
92898
|
9 |
28 |
if( sqlite3aEQb[pOp->opcode] ){
|
92908
|
49 |
2052 |
if( (flags1 | flags3)&MEM_Null ){
|
92910
|
12 |
37 |
if( pOp->p5 & SQLITE_NULLEQ ){
|
92918
|
2 |
10 |
if( (flags1&flags3&MEM_Null)!=0
|
92919
|
2 |
0 |
&& (flags3&MEM_Cleared)==0
|
92923
|
0 |
10 |
res = ((flags3 & MEM_Null) ? -1 : +1); /* Operands are not equal */
|
92931
|
16 |
21 |
if( pOp->p5 & SQLITE_JUMPIFNULL ){
|
92942
|
94 |
1958 |
if( affinity>=SQLITE_AFF_NUMERIC ){
|
92943
|
94 |
0 |
if( (flags1 | flags3)&MEM_Str ){
|
92944
|
94 |
0 |
if( (flags1 & (MEM_Int|MEM_IntReal|MEM_Real|MEM_Str))==MEM_Str ){
|
92949
|
0 |
94 |
if( (flags3 & (MEM_Int|MEM_IntReal|MEM_Real|MEM_Str))==MEM_Str ){
|
92953
|
1109 |
849 |
}else if( affinity==SQLITE_AFF_TEXT && ((flags1 | flags3) & MEM_Str)!=0 ){
|
|
1109 |
0 |
}else if( affinity==SQLITE_AFF_TEXT && ((flags1 | flags3) & MEM_Str)!=0 ){
|
92954
|
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 ){
|
92961
|
0 |
0 |
if( NEVER(pIn1==pIn3) ) flags3 = flags1 | MEM_Str;
|
92963
|
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 ){
|
92984
|
988 |
1076 |
if( res<0 ){
|
92986
|
739 |
337 |
}else if( res==0 ){
|
93001
|
1059 |
1005 |
if( res2 ){
|
93033
|
0 |
0 |
if( iCompare==0 ) goto jump_to_p2;
|
93090
|
382 |
0 |
if( (pOp->p5 & OPFLAG_PERMUTE)==0 ){
|
93116
|
382 |
347 |
for(i=0; i<n; i++){
|
93117
|
0 |
382 |
idx = aPermute ? aPermute[i] : (u32)i;
|
93127
|
35 |
347 |
if( iCompare ){
|
93128
|
0 |
35 |
if( (pKeyInfo->aSortFlags[i] & KEYINFO_ORDER_BIGNULL)
|
93129
|
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))
|
93133
|
0 |
35 |
if( bRev ) iCompare = -iCompare;
|
93152
|
35 |
347 |
if( iCompare<0 ){
|
93154
|
347 |
0 |
}else if( iCompare==0 ){
|
93189
|
0 |
0 |
if( pOp->opcode==OP_And ){
|
93197
|
0 |
0 |
if( v1==2 ){
|
93245
|
0 |
0 |
if( (pIn1->flags & MEM_Null)==0 ){
|
93264
|
0 |
0 |
if( (pIn1->flags & MEM_Null)==0 ){
|
93291
|
0 |
322 |
if( p->pFrame ){
|
93293
|
0 |
0 |
if( (p->pFrame->aOnce[iAddr/8] & (1<<(iAddr & 7)))!=0 ){
|
93299
|
0 |
322 |
if( p->aOp[0].p1==pOp->p1 ){
|
93319
|
203 |
302 |
if( c ) goto jump_to_p2;
|
93333
|
239 |
85 |
if( c ) goto jump_to_p2;
|
93345
|
95 |
648 |
if( (pIn1->flags & MEM_Null)!=0 ){
|
93389
|
0 |
0 |
if( pOp->p1>=0 ){
|
93393
|
0 |
0 |
if( pOp->p3<pC->nHdrParsed ){
|
93395
|
0 |
0 |
if( serialType>=12 ){
|
93396
|
0 |
0 |
if( serialType&1 ){
|
93438
|
0 |
0 |
if( typeMask & pOp->p5 ){
|
93452
|
0 |
0 |
if( (aMem[pOp->p1].flags & MEM_Null)!=0
|
93453
|
0 |
0 |
|| (aMem[pOp->p3].flags & MEM_Null)!=0
|
93470
|
545 |
118 |
if( (pIn1->flags & MEM_Null)==0 ){
|
93490
|
0 |
0 |
if( pC && pC->nullRow ){
|
|
0 |
0 |
if( pC && pC->nullRow ){
|
93588
|
13286 |
7038 |
if( pC->cacheStatus!=p->cacheCtr ){ /*OPTIMIZATION-IF-FALSE*/
|
93589
|
4925 |
8361 |
if( pC->nullRow ){
|
93590
|
4925 |
0 |
if( pC->eCurType==CURTYPE_PSEUDO && pC->seekResult>0 ){
|
|
4925 |
0 |
if( pC->eCurType==CURTYPE_PSEUDO && pC->seekResult>0 ){
|
93606
|
429 |
7932 |
if( pC->deferredMoveto ){
|
93609
|
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 ){
|
93615
|
0 |
429 |
if( rc ) goto abort_due_to_error;
|
93616
|
0 |
7932 |
}else if( sqlite3BtreeCursorHasMoved(pCrsr) ){
|
93618
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
93630
|
13286 |
0 |
if( (aOffset[0] = pC->aRow[0])<0x80 ){
|
93637
|
0 |
13286 |
if( pC->szRow<aOffset[0] ){ /*OPTIMIZATION-IF-FALSE*/
|
93654
|
0 |
0 |
if( aOffset[0] > 98307 || aOffset[0] > pC->payloadSize ){
|
|
0 |
0 |
if( aOffset[0] > 98307 || aOffset[0] > pC->payloadSize ){
|
93676
|
0 |
7038 |
}else if( sqlite3BtreeCursorHasMoved(pC->uc.pCursor) ){
|
93678
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
93685
|
3086 |
3952 |
if( pC->nHdrParsed<=p2 ){
|
93689
|
3086 |
0 |
if( pC->iHdrOffset<aOffset[0] ){
|
93691
|
0 |
3086 |
if( pC->aRow==0 ){
|
93694
|
0 |
0 |
if( rc!=SQLITE_OK ) goto abort_due_to_error;
|
93708
|
21166 |
499 |
if( (pC->aType[i] = t = zHdr[0])<0x80 ){
|
93717
|
5411 |
16254 |
}while( (u32)i<=p2 && zHdr<zEndHdr );
|
|
5293 |
118 |
}while( (u32)i<=p2 && zHdr<zEndHdr );
|
93724
|
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))
|
93725
|
0 |
16372 |
|| (offset64 > pC->payloadSize)
|
93727
|
0 |
0 |
if( aOffset[0]==0 ){
|
93731
|
0 |
0 |
if( pC->aRow==0 ) sqlite3VdbeMemRelease(&sMem);
|
93738
|
0 |
16372 |
if( pC->aRow==0 ) sqlite3VdbeMemRelease(&sMem);
|
93747
|
118 |
16254 |
if( pC->nHdrParsed<=p2 ){
|
93750
|
0 |
118 |
if( pOp->p4type==P4_MEM ){
|
93770
|
0 |
20206 |
if( VdbeMemDynamic(pDest) ){
|
93774
|
20191 |
15 |
if( pC->szRow>=aOffset[p2+1] ){
|
93778
|
12885 |
7306 |
if( t<12 ){
|
93788
|
2915 |
4391 |
if( pDest->szMalloc < len+2 ){
|
93789
|
0 |
2915 |
if( len>db->aLimit[SQLITE_LIMIT_LENGTH] ) goto too_big;
|
93791
|
0 |
2915 |
if( sqlite3VdbeMemGrow(pDest, len+2, 0) ) goto no_mem;
|
93803
|
0 |
15 |
if( ((pOp->p5 & (OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG))!=0
|
93804
|
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))
|
93805
|
0 |
15 |
|| (len = sqlite3VdbeSerialTypeLen(t))==0
|
93822
|
0 |
15 |
if( len>db->aLimit[SQLITE_LIMIT_LENGTH] ) goto too_big;
|
93824
|
0 |
15 |
if( rc!=SQLITE_OK ) goto abort_due_to_error;
|
93836
|
0 |
0 |
if( aOp[0].p3>0 ){
|
93882
|
0 |
0 |
for(i=0; i<pTab->nCol; i++){
|
93883
|
0 |
0 |
if( aCol[i].colFlags & COLFLAG_GENERATED ){
|
93884
|
0 |
0 |
if( aCol[i].colFlags & COLFLAG_VIRTUAL ) continue;
|
93885
|
0 |
0 |
if( pOp->p3 ){ pIn1++; continue; }
|
93889
|
0 |
0 |
if( (pIn1->flags & MEM_Null)==0 ){
|
93892
|
0 |
0 |
if( (pIn1->flags & MEM_Blob)==0 ) goto vdbe_type_error;
|
93897
|
0 |
0 |
if( (pIn1->flags & MEM_Int)==0 ) goto vdbe_type_error;
|
93901
|
0 |
0 |
if( (pIn1->flags & MEM_Str)==0 ) goto vdbe_type_error;
|
93907
|
0 |
0 |
if( pIn1->flags & MEM_Int ){
|
93916
|
0 |
0 |
if( pIn1->u.i<=140737488355327LL && pIn1->u.i>=-140737488355328LL){
|
|
0 |
0 |
if( pIn1->u.i<=140737488355327LL && pIn1->u.i>=-140737488355328LL){
|
93924
|
0 |
0 |
}else if( (pIn1->flags & (MEM_Real|MEM_IntReal))==0 ){
|
93970
|
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 ){
|
93979
|
0 |
0 |
if( pIn1->u.i<=140737488355327LL && pIn1->u.i>=-140737488355328LL ){
|
|
0 |
0 |
if( pIn1->u.i<=140737488355327LL && pIn1->u.i>=-140737488355328LL ){
|
93990
|
388 |
158 |
if( zAffinity[0]==0 ) break;
|
94072
|
1057 |
7677 |
if( zAffinity ){
|
94076
|
0 |
2823 |
if( zAffinity[0]==SQLITE_AFF_REAL && (pRec->flags & MEM_Int) ){
|
|
0 |
0 |
if( zAffinity[0]==SQLITE_AFF_REAL && (pRec->flags & MEM_Int) ){
|
94084
|
1766 |
1057 |
}while( zAffinity[0] );
|
94130
|
939 |
12767 |
if( pRec->flags & MEM_Null ){
|
94131
|
0 |
939 |
if( pRec->flags & MEM_Zero ){
|
94146
|
2696 |
10071 |
}else if( pRec->flags & (MEM_Int|MEM_IntReal) ){
|
94152
|
101 |
2595 |
if( i<0 ){
|
94163
|
2448 |
248 |
if( uu<=127 ){
|
94164
|
1421 |
1027 |
if( (i&1)==i && p->minWriteFileFormat>=4 ){
|
|
1421 |
0 |
if( (i&1)==i && p->minWriteFileFormat>=4 ){
|
94170
|
78 |
170 |
}else if( uu<=32767 ){
|
94173
|
8 |
162 |
}else if( uu<=8388607 ){
|
94176
|
30 |
132 |
}else if( uu<=2147483647 ){
|
94179
|
48 |
84 |
}else if( uu<=140737488355327LL ){
|
94184
|
0 |
84 |
if( pRec->flags & MEM_IntReal ){
|
94196
|
6162 |
3909 |
}else if( pRec->flags & MEM_Real ){
|
94205
|
1 |
3908 |
if( pRec->flags & MEM_Zero ){
|
94207
|
0 |
1 |
if( nData ){
|
94208
|
0 |
0 |
if( sqlite3VdbeMemExpandBlob(pRec) ) goto no_mem;
|
94218
|
8734 |
4972 |
if( pRec==pData0 ) break;
|
94228
|
8734 |
0 |
if( nHdr<=126 ){
|
94235
|
0 |
0 |
if( nVarint<sqlite3VarintLen(nHdr) ) nHdr++;
|
94244
|
4740 |
3994 |
if( nByte+nZero<=pOut->szMalloc ){
|
94251
|
0 |
3994 |
if( nByte+nZero>db->aLimit[SQLITE_LIMIT_LENGTH] ){
|
94254
|
0 |
3994 |
if( sqlite3VdbeMemClearAndResize(pOut, (int)nByte) ){
|
94260
|
1 |
8733 |
if( nZero ){
|
94269
|
8734 |
0 |
if( nHdr<0x80 ){
|
94282
|
8376 |
5330 |
if( serial_type<=7 ){
|
94284
|
7437 |
939 |
if( serial_type==0 ){
|
94289
|
6162 |
1275 |
if( serial_type==7 ){
|
94300
|
7437 |
44146 |
if( i==0 ) break;
|
94305
|
4928 |
402 |
}else if( serial_type<0x80 ){
|
94307
|
3503 |
1425 |
if( serial_type>=14 && pRec->n>0 ){
|
|
3503 |
0 |
if( serial_type>=14 && pRec->n>0 ){
|
94314
|
401 |
1 |
if( pRec->n ){
|
94320
|
8734 |
4972 |
if( pRec==pLast ) break;
|
94348
|
0 |
10 |
if( pOp->p3 ){
|
94353
|
0 |
10 |
if( rc ) goto abort_due_to_error;
|
94389
|
24 |
10 |
if( p1==SAVEPOINT_BEGIN ){
|
94390
|
0 |
24 |
if( db->nVdbeWrite>0 ){
|
94407
|
0 |
24 |
if( rc!=SQLITE_OK ) goto abort_due_to_error;
|
94412
|
24 |
0 |
if( pNew ){
|
94418
|
13 |
11 |
if( db->autoCommit ){
|
94438
|
12 |
0 |
for(
|
94440
|
2 |
10 |
pSavepoint && sqlite3StrICmp(pSavepoint->zName, zName);
|
94445
|
0 |
10 |
if( !pSavepoint ){
|
94448
|
0 |
10 |
}else if( db->nVdbeWrite>0 && p1==SAVEPOINT_RELEASE ){
|
|
0 |
0 |
}else if( db->nVdbeWrite>0 && p1==SAVEPOINT_RELEASE ){
|
94461
|
8 |
2 |
int isTransaction = pSavepoint->pNext==0 && db->isTransactionSavepoint;
|
|
7 |
1 |
int isTransaction = pSavepoint->pNext==0 && db->isTransactionSavepoint;
|
94462
|
7 |
3 |
if( isTransaction && p1==SAVEPOINT_RELEASE ){
|
|
7 |
0 |
if( isTransaction && p1==SAVEPOINT_RELEASE ){
|
94463
|
0 |
7 |
if( (rc = sqlite3VdbeCheckFk(p, 1))!=SQLITE_OK ){
|
94467
|
0 |
7 |
if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){
|
94474
|
0 |
7 |
if( rc ){
|
94482
|
1 |
2 |
if( p1==SAVEPOINT_ROLLBACK ){
|
94484
|
2 |
1 |
for(ii=0; ii<db->nDb; ii++){
|
94488
|
0 |
2 |
if( rc!=SQLITE_OK ) goto abort_due_to_error;
|
94494
|
6 |
3 |
for(ii=0; ii<db->nDb; ii++){
|
94496
|
0 |
6 |
if( rc!=SQLITE_OK ){
|
94500
|
1 |
2 |
if( isSchemaChange ){
|
94506
|
0 |
10 |
if( rc ) goto abort_due_to_error;
|
94510
|
2 |
10 |
while( db->pSavepoint!=pSavepoint ){
|
94521
|
9 |
1 |
if( p1==SAVEPOINT_RELEASE ){
|
94525
|
2 |
7 |
if( !isTransaction ){
|
94534
|
7 |
3 |
if( !isTransaction || p1==SAVEPOINT_ROLLBACK ){
|
|
0 |
7 |
if( !isTransaction || p1==SAVEPOINT_ROLLBACK ){
|
94536
|
0 |
3 |
if( rc!=SQLITE_OK ) goto abort_due_to_error;
|
94540
|
0 |
34 |
if( rc ) goto abort_due_to_error;
|
94541
|
7 |
27 |
if( p->eVdbeState==VDBE_HALT_STATE ){
|
94568
|
230 |
20 |
if( desiredAutoCommit!=db->autoCommit ){
|
94569
|
28 |
202 |
if( iRollback ){
|
94573
|
90 |
112 |
}else if( desiredAutoCommit && db->nVdbeWrite>0 ){
|
|
0 |
90 |
}else if( desiredAutoCommit && db->nVdbeWrite>0 ){
|
94581
|
0 |
202 |
}else if( (rc = sqlite3VdbeCheckFk(p, 1))!=SQLITE_OK ){
|
94586
|
0 |
230 |
if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){
|
94593
|
226 |
4 |
if( p->rc==SQLITE_OK ){
|
94600
|
0 |
20 |
sqlite3VdbeError(p,
|
94601
|
0 |
0 |
(!desiredAutoCommit)?"cannot start a transaction within a transaction":(
|
94657
|
3819 |
1818 |
if( pOp->p2 && (db->flags & (SQLITE_QueryOnly|SQLITE_CorruptRdOnly))!=0 ){
|
|
0 |
3819 |
if( pOp->p2 && (db->flags & (SQLITE_QueryOnly|SQLITE_CorruptRdOnly))!=0 ){
|
94658
|
0 |
0 |
if( db->flags & SQLITE_QueryOnly ){
|
94671
|
5562 |
75 |
if( pBt ){
|
94675
|
9 |
5553 |
if( rc!=SQLITE_OK ){
|
94676
|
7 |
2 |
if( (rc&0xff)==SQLITE_BUSY ){
|
94684
|
276 |
5277 |
if( p->usesStmtJournal
|
94685
|
276 |
0 |
&& pOp->p2
|
94686
|
249 |
27 |
&& (db->autoCommit==0 || db->nVdbeRead>1)
|
|
27 |
222 |
&& (db->autoCommit==0 || db->nVdbeRead>1)
|
94689
|
54 |
0 |
if( p->iStatement==0 ){
|
94696
|
54 |
0 |
if( rc==SQLITE_OK ){
|
94708
|
5628 |
0 |
if( rc==SQLITE_OK
|
94709
|
4954 |
674 |
&& pOp->p5
|
94710
|
4954 |
0 |
&& (iMeta!=pOp->p3 || pDb->pSchema->iGeneration!=pOp->p4.i)
|
|
0 |
4954 |
&& (iMeta!=pOp->p3 || pDb->pSchema->iGeneration!=pOp->p4.i)
|
94732
|
0 |
0 |
if( db->aDb[pOp->p1].pSchema->schema_cookie!=iMeta ){
|
94743
|
0 |
5628 |
if( rc ) goto abort_due_to_error;
|
94806
|
273 |
351 |
if( pOp->p2==BTREE_SCHEMA_VERSION ){
|
94811
|
175 |
176 |
}else if( pOp->p2==BTREE_FILE_FORMAT ){
|
94815
|
87 |
537 |
if( pOp->p1==1 ){
|
94821
|
0 |
624 |
if( rc ) goto abort_due_to_error;
|
94922
|
9 |
2 |
if( pCur && pCur->pgnoRoot==(u32)pOp->p2 ){
|
|
9 |
0 |
if( pCur && pCur->pgnoRoot==(u32)pOp->p2 ){
|
94938
|
0 |
6027 |
if( p->expired==1 ){
|
94952
|
4138 |
1889 |
if( pOp->opcode==OP_OpenWrite ){
|
94956
|
3543 |
595 |
if( pDb->pSchema->file_format < p->minWriteFileFormat ){
|
94962
|
6 |
6021 |
if( pOp->p5 & OPFLAG_P2ISREG ){
|
94977
|
287 |
5740 |
if( pOp->p4type==P4_KEYINFO ){
|
94982
|
5740 |
0 |
}else if( pOp->p4type==P4_INT32 ){
|
94989
|
0 |
6027 |
if( pCur==0 ) goto no_mem;
|
95012
|
0 |
6036 |
if( rc ) goto abort_due_to_error;
|
95033
|
0 |
0 |
if( pCx==0 ) goto no_mem;
|
95099
|
7 |
10 |
if( pOp->p3>0 ){
|
95109
|
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) ){
|
95119
|
0 |
17 |
if( pCx==0 ) goto no_mem;
|
95124
|
17 |
0 |
if( rc==SQLITE_OK ){
|
95126
|
17 |
0 |
if( rc==SQLITE_OK ){
|
95132
|
10 |
7 |
if( (pCx->pKeyInfo = pKeyInfo = pOp->p4.pKeyInfo)!=0 ){
|
95136
|
10 |
0 |
if( rc==SQLITE_OK ){
|
95152
|
0 |
17 |
if( rc ){
|
95157
|
0 |
17 |
if( rc ) goto abort_due_to_error;
|
95178
|
0 |
262 |
if( pCx==0 ) goto no_mem;
|
95183
|
0 |
262 |
if( rc ) goto abort_due_to_error;
|
95199
|
114 |
312 |
if( (pC->seqCount++)==0 ){
|
95227
|
0 |
257 |
if( pCx==0 ) goto no_mem;
|
95393
|
0 |
195 |
if( pC->isTable ){
|
95404
|
0 |
0 |
if( (flags3 & (MEM_Int|MEM_Real|MEM_IntReal|MEM_Str))==MEM_Str ){
|
95413
|
0 |
0 |
if( (newType & (MEM_Int|MEM_IntReal))==0 ){
|
95415
|
0 |
0 |
if( (newType & MEM_Real)==0 ){
|
95416
|
0 |
0 |
if( (newType & MEM_Null) || oc>=OP_SeekGE ){
|
|
0 |
0 |
if( (newType & MEM_Null) || oc>=OP_SeekGE ){
|
95421
|
0 |
0 |
if( rc!=SQLITE_OK ) goto abort_due_to_error;
|
95434
|
0 |
0 |
if( c>0 ){
|
95438
|
0 |
0 |
if( (oc & 0x0001)==(OP_SeekGT & 0x0001) ) oc--;
|
95443
|
0 |
0 |
else if( c<0 ){
|
95447
|
0 |
0 |
if( (oc & 0x0001)==(OP_SeekLT & 0x0001) ) oc++;
|
95452
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
95461
|
41 |
154 |
if( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ) ){
|
95486
|
188 |
7 |
r.default_rc = ((1 & (oc - OP_SeekLT)) ? -1 : +1);
|
95504
|
0 |
195 |
if( rc!=SQLITE_OK ){
|
95507
|
41 |
154 |
if( eqOnly && r.eqSeen==0 ){
|
|
8 |
33 |
if( eqOnly && r.eqSeen==0 ){
|
95515
|
13 |
174 |
if( oc>=OP_SeekGE ){ assert( oc==OP_SeekGE || oc==OP_SeekGT );
|
95516
|
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) ){
|
95519
|
1 |
3 |
if( rc!=SQLITE_OK ){
|
95520
|
1 |
0 |
if( rc==SQLITE_DONE ){
|
95532
|
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) ){
|
95535
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
95536
|
0 |
0 |
if( rc==SQLITE_DONE ){
|
95553
|
10 |
185 |
if( res ){
|
95555
|
33 |
152 |
}else if( eqOnly ){
|
95664
|
0 |
0 |
if( !sqlite3BtreeCursorIsValidNN(pC->uc.pCursor) ){
|
95690
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
95691
|
0 |
0 |
if( res>0 && pOp->p5==0 ){
|
|
0 |
0 |
if( res>0 && pOp->p5==0 ){
|
95703
|
0 |
0 |
if( res>=0 ){
|
95714
|
0 |
0 |
if( nStep<=0 ){
|
95726
|
0 |
0 |
if( rc ){
|
95727
|
0 |
0 |
if( rc==SQLITE_DONE ){
|
95760
|
0 |
0 |
if( pC->seekHit<pOp->p2 ){
|
95767
|
0 |
0 |
}else if( pC->seekHit>pOp->p3 ){
|
95790
|
0 |
0 |
if( pCur==0 || pCur->nullRow ){
|
|
0 |
0 |
if( pCur==0 || pCur->nullRow ){
|
95896
|
0 |
0 |
if( pC->seekHit>=pOp->p4.i ) break;
|
95925
|
62 |
0 |
if( r.nField>0 ){
|
95941
|
0 |
0 |
rc = ExpandBlob(r.aMem);
|
95943
|
0 |
0 |
if( rc ) goto no_mem;
|
95945
|
0 |
0 |
if( pIdxKey==0 ) goto no_mem;
|
95951
|
0 |
62 |
if( rc!=SQLITE_OK ){
|
95958
|
4 |
58 |
if( pOp->opcode==OP_Found ){
|
95960
|
0 |
4 |
if( alreadyExists ) goto jump_to_p2;
|
95962
|
55 |
3 |
if( !alreadyExists ){
|
95966
|
3 |
0 |
if( pOp->opcode==OP_NoConflict ){
|
95970
|
3 |
3 |
for(ii=0; ii<r.nField; ii++){
|
95971
|
0 |
3 |
if( r.aMem[ii].flags & MEM_Null ){
|
95978
|
0 |
3 |
if( pOp->opcode==OP_IfNoHope ){
|
96043
|
52 |
515 |
if( (pIn3->flags & (MEM_Int|MEM_IntReal))==0 ){
|
96051
|
0 |
52 |
if( (x.flags & MEM_Int)==0 ) goto jump_to_p2;
|
96081
|
365 |
699 |
if( res!=0 ){
|
96083
|
0 |
365 |
if( pOp->p2==0 ){
|
96089
|
0 |
699 |
if( rc ) goto abort_due_to_error;
|
96171
|
3189 |
0 |
if( !pC->useRandomRowid ){
|
96173
|
0 |
3189 |
if( rc!=SQLITE_OK ){
|
96176
|
336 |
2853 |
if( res ){
|
96181
|
0 |
2853 |
if( v>=MAX_ROWID ){
|
96190
|
192 |
2997 |
if( pOp->p3 ){
|
96193
|
0 |
192 |
if( p->pFrame ){
|
96194
|
0 |
0 |
for(pFrame=p->pFrame; pFrame->pParent; pFrame=pFrame->pParent);
|
96209
|
192 |
0 |
if( pMem->u.i==MAX_ROWID || pC->useRandomRowid ){
|
|
0 |
192 |
if( pMem->u.i==MAX_ROWID || pC->useRandomRowid ){
|
96213
|
0 |
192 |
if( v<pMem->u.i+1 ){
|
96219
|
0 |
3189 |
if( pC->useRandomRowid ){
|
96232
|
0 |
0 |
&& (res==0)
|
96233
|
0 |
0 |
&& (++cnt<100));
|
|
0 |
0 |
&& (++cnt<100));
|
96234
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
96235
|
0 |
0 |
if( res==0 ){
|
96313
|
3227 |
755 |
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){
|
|
60 |
3167 |
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){
|
96338
|
3227 |
755 |
if( pOp->p5 & OPFLAG_NCHANGE ){
|
96340
|
3221 |
6 |
if( pOp->p5 & OPFLAG_LASTROWID ) db->lastRowid = x.nKey;
|
96345
|
3260 |
722 |
seekResult = ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0);
|
96346
|
1 |
3981 |
if( pData->flags & MEM_Zero ){
|
96361
|
0 |
3982 |
if( rc ) goto abort_due_to_error;
|
96362
|
60 |
3922 |
if( pTab ){
|
96365
|
0 |
60 |
db->xUpdateCallback(db->pUpdateArg,
|
96393
|
0 |
0 |
iKey = pOp->p3 ? aMem[pOp->p3].u.i : 0;
|
96395
|
0 |
0 |
if( rc!=SQLITE_OK ) goto abort_due_to_error;
|
96468
|
13 |
8 |
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){
|
|
0 |
13 |
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){
|
96473
|
0 |
0 |
if( (pOp->p5 & OPFLAG_SAVEPOSITION)!=0 && pC->isTable ){
|
|
0 |
0 |
if( (pOp->p5 & OPFLAG_SAVEPOSITION)!=0 && pC->isTable ){
|
96520
|
0 |
21 |
if( rc ) goto abort_due_to_error;
|
96523
|
13 |
8 |
if( opflags & OPFLAG_NCHANGE ){
|
96525
|
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) ){
|
96575
|
0 |
1 |
if( rc ) goto abort_due_to_error;
|
96576
|
1 |
0 |
if( res ) goto jump_to_p2;
|
96601
|
0 |
4922 |
if( rc ) goto abort_due_to_error;
|
96662
|
0 |
0 |
if( n>(u32)db->aLimit[SQLITE_LIMIT_LENGTH] ){
|
96667
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
96668
|
0 |
0 |
if( !pOp->p3 ) Deephemeralize(pOut);
|
|
0 |
0 |
if( !pOp->p3 ) Deephemeralize(pOut);
|
|
0 |
0 |
if( !pOp->p3 ) Deephemeralize(pOut);
|
96695
|
0 |
769 |
if( pC->nullRow ){
|
96698
|
12 |
757 |
}else if( pC->deferredMoveto ){
|
96701
|
89 |
668 |
}else if( pC->eCurType==CURTYPE_VTAB ){
|
96708
|
0 |
89 |
if( rc ) goto abort_due_to_error;
|
96714
|
0 |
668 |
if( rc ) goto abort_due_to_error;
|
96715
|
0 |
668 |
if( pC->nullRow ){
|
96739
|
0 |
5 |
if( pC==0 ){
|
96743
|
0 |
0 |
if( pC==0 ) goto no_mem;
|
96751
|
3 |
2 |
if( pC->eCurType==CURTYPE_BTREE ){
|
96799
|
2 |
36 |
if( pOp->opcode==OP_SeekEnd ){
|
96802
|
0 |
2 |
if( sqlite3BtreeCursorIsValidNN(pCrsr) ){
|
96810
|
0 |
38 |
if( rc ) goto abort_due_to_error;
|
96811
|
34 |
4 |
if( pOp->p2>0 ){
|
96813
|
33 |
1 |
if( res ) goto jump_to_p2;
|
96835
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
96836
|
0 |
0 |
if( res==0 ){
|
96838
|
0 |
0 |
if( ALWAYS(sz>=0) && sqlite3LogEst((u64)sz)<pOp->p3 ) res = 1;
|
|
0 |
0 |
if( ALWAYS(sz>=0) && sqlite3LogEst((u64)sz)<pOp->p3 ) res = 1;
|
96841
|
0 |
0 |
if( res ) goto jump_to_p2;
|
96908
|
262 |
1216 |
if( isSorter(pC) ){
|
96918
|
0 |
1478 |
if( rc ) goto abort_due_to_error;
|
96920
|
1478 |
0 |
if( pOp->p2>0 ){
|
96922
|
327 |
1151 |
if( res ) goto jump_to_p2;
|
97022
|
11277 |
1055 |
if( rc==SQLITE_OK ){
|
97030
|
0 |
1055 |
if( rc!=SQLITE_DONE ) goto abort_due_to_error;
|
97075
|
0 |
87 |
if( pOp->p5 & OPFLAG_NCHANGE ) p->nChange++;
|
97078
|
0 |
87 |
rc = ExpandBlob(pIn2);
|
97079
|
0 |
87 |
if( rc ) goto abort_due_to_error;
|
97084
|
66 |
21 |
rc = sqlite3BtreeInsert(pC->uc.pCursor, &x,
|
97090
|
0 |
87 |
if( rc) goto abort_due_to_error;
|
97112
|
0 |
4926 |
rc = ExpandBlob(pIn2);
|
97113
|
0 |
4926 |
if( rc ) goto abort_due_to_error;
|
97115
|
0 |
4926 |
if( rc) goto abort_due_to_error;
|
97154
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
97155
|
0 |
0 |
if( res==0 ){
|
97157
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
97158
|
0 |
0 |
}else if( pOp->p5 && !sqlite3WritableSchema(db) ){
|
|
0 |
0 |
}else if( pOp->p5 && !sqlite3WritableSchema(db) ){
|
97218
|
0 |
450 |
if( rc!=SQLITE_OK ) goto abort_due_to_error;
|
97220
|
450 |
0 |
if( !pC->nullRow ){
|
97223
|
0 |
450 |
if( rc!=SQLITE_OK ){
|
97226
|
440 |
10 |
if( pOp->opcode==OP_DeferredSeek ){
|
97264
|
1 |
0 |
if( pC->deferredMoveto ){
|
97266
|
0 |
1 |
if( rc ) goto abort_due_to_error;
|
97333
|
16 |
459 |
if( pOp->opcode<OP_IdxLT ){
|
97363
|
475 |
0 |
if( nCellKey<=0 || nCellKey>0x7fffffff ){
|
|
0 |
475 |
if( nCellKey<=0 || nCellKey>0x7fffffff ){
|
97369
|
0 |
475 |
if( rc ) goto abort_due_to_error;
|
97376
|
460 |
15 |
if( (pOp->opcode&1)==(OP_IdxLT&1) ){
|
97385
|
42 |
433 |
if( res>0 ) goto jump_to_p2;
|
97425
|
0 |
5 |
if( db->nVdbeRead > db->nVDestroy+1 ){
|
97436
|
0 |
5 |
if( rc ) goto abort_due_to_error;
|
97438
|
0 |
5 |
if( iMoved!=0 ){
|
97474
|
32 |
1 |
if( pOp->p3 ){
|
97476
|
0 |
32 |
if( pOp->p3>0 ){
|
97482
|
0 |
33 |
if( rc ) goto abort_due_to_error;
|
97500
|
0 |
0 |
if( isSorter(pC) ){
|
97506
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
97534
|
0 |
271 |
if( rc ) goto abort_due_to_error;
|
97548
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
97584
|
0 |
266 |
if( pOp->p4.z==0 ){
|
97602
|
0 |
266 |
if( zSql==0 ){
|
97611
|
266 |
0 |
if( rc==SQLITE_OK ) rc = initData.rc;
|
97612
|
266 |
0 |
if( rc==SQLITE_OK && initData.nInitRow==0 ){
|
|
0 |
266 |
if( rc==SQLITE_OK && initData.nInitRow==0 ){
|
97622
|
0 |
266 |
if( rc ){
|
97624
|
0 |
0 |
if( rc==SQLITE_NOMEM ){
|
97642
|
0 |
1 |
if( rc ) goto abort_due_to_error;
|
97732
|
0 |
0 |
if( nErr==0 ){
|
97734
|
0 |
0 |
}else if( rc ){
|
97759
|
1 |
0 |
if( (pIn1->flags & MEM_Blob)==0 ){
|
97760
|
0 |
1 |
if( sqlite3VdbeMemSetRowSet(pIn1) ) goto no_mem;
|
97780
|
2 |
0 |
if( (pIn1->flags & MEM_Blob)==0
|
97781
|
1 |
1 |
|| sqlite3RowSetNext((RowSet*)pIn1->z, &val)==0
|
97830
|
7 |
9 |
if( (pIn1->flags & MEM_Blob)==0 ){
|
97831
|
0 |
7 |
if( sqlite3VdbeMemSetRowSet(pIn1) ) goto no_mem;
|
97836
|
12 |
4 |
if( iSet ){
|
97839
|
0 |
12 |
if( exists ) goto jump_to_p2;
|
97841
|
10 |
6 |
if( iSet>=0 ){
|
97890
|
0 |
0 |
if( pOp->p5 ){
|
97892
|
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);
|
97893
|
0 |
0 |
if( pFrame ) break;
|
97896
|
0 |
0 |
if( p->nFrame>=db->aLimit[SQLITE_LIMIT_TRIGGER_DEPTH] ){
|
97906
|
0 |
0 |
if( (pRt->flags&MEM_Blob)==0 ){
|
97914
|
0 |
0 |
if( pProgram->nCsr==0 ) nMem++;
|
97920
|
0 |
0 |
if( !pFrame ){
|
97945
|
0 |
0 |
for(pMem=VdbeFrameMem(pFrame); pMem!=pEnd; pMem++){
|
98025
|
0 |
1 |
if( db->flags & SQLITE_DeferFKs ){
|
98027
|
0 |
1 |
}else if( pOp->p1 ){
|
98048
|
0 |
2 |
if( pOp->p1 ){
|
98050
|
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;
|
98053
|
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;
|
98073
|
0 |
192 |
if( p->pFrame ){
|
98074
|
0 |
0 |
for(pFrame=p->pFrame; pFrame->pParent; pFrame=pFrame->pParent);
|
98083
|
0 |
192 |
if( pIn1->u.i<pIn2->u.i){
|
98104
|
42 |
50 |
if( pIn1->u.i>0 ){
|
98137
|
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) ){
|
98164
|
3 |
2 |
if( pIn1->u.i ){
|
98165
|
3 |
0 |
if( pIn1->u.i>0 ) pIn1->u.i--;
|
98180
|
78 |
0 |
if( pIn1->u.i>SMALLEST_INT64 ) pIn1->u.i--;
|
98182
|
78 |
0 |
if( pIn1->u.i==0 ) goto jump_to_p2;
|
98238
|
0 |
91 |
if( pCtx==0 ) goto no_mem;
|
98283
|
91 |
409 |
if( pCtx->pMem != pMem ){
|
98285
|
41 |
91 |
for(i=pCtx->argc-1; i>=0; i--) pCtx->argv[i] = &aMem[pOp->p2+i];
|
98300
|
0 |
500 |
if( pOp->p1 ){
|
98306
|
0 |
500 |
if( pCtx->isError ){
|
98307
|
0 |
0 |
if( pCtx->isError>0 ){
|
98311
|
0 |
0 |
if( pCtx->skipFlag ){
|
98314
|
0 |
0 |
if( i ) sqlite3VdbeMemSetInt64(&aMem[i], 1);
|
98320
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
98361
|
0 |
219 |
if( pOp->p3 ){
|
98371
|
0 |
219 |
if( rc ){
|
98407
|
0 |
0 |
if( rc ){
|
98408
|
0 |
0 |
if( rc!=SQLITE_BUSY ) goto abort_due_to_error;
|
98412
|
0 |
0 |
for(i=0, pMem = &aMem[pOp->p3]; i<3; i++, pMem++){
|
98456
|
2 |
0 |
if( eNew==PAGER_JOURNALMODE_QUERY ) eNew = eOld;
|
98458
|
0 |
2 |
if( !sqlite3PagerOkToChangeJournalMode(pPager) ) eNew = eOld;
|
98466
|
0 |
2 |
if( eNew==PAGER_JOURNALMODE_WAL
|
98467
|
0 |
0 |
&& (sqlite3Strlen30(zFilename)==0 /* Temp file */
|
98468
|
0 |
0 |
|| !sqlite3PagerWalSupported(pPager)) /* No shared-memory support */
|
98473
|
0 |
2 |
if( (eNew!=eOld)
|
98474
|
0 |
0 |
&& (eOld==PAGER_JOURNALMODE_WAL || eNew==PAGER_JOURNALMODE_WAL)
|
|
0 |
0 |
&& (eOld==PAGER_JOURNALMODE_WAL || eNew==PAGER_JOURNALMODE_WAL)
|
98476
|
0 |
0 |
if( !db->autoCommit || db->nVdbeRead>1 ){
|
|
0 |
0 |
if( !db->autoCommit || db->nVdbeRead>1 ){
|
98478
|
0 |
0 |
sqlite3VdbeError(p,
|
98485
|
0 |
0 |
if( eOld==PAGER_JOURNALMODE_WAL ){
|
98492
|
0 |
0 |
if( rc==SQLITE_OK ){
|
98495
|
0 |
0 |
}else if( eOld==PAGER_JOURNALMODE_MEMORY ){
|
98505
|
0 |
0 |
if( rc==SQLITE_OK ){
|
98506
|
0 |
0 |
rc = sqlite3BtreeSetVersion(pBt, (eNew==PAGER_JOURNALMODE_WAL ? 2 : 1));
|
98512
|
0 |
2 |
if( rc ) eNew = eOld;
|
98520
|
0 |
2 |
if( rc ) goto abort_due_to_error;
|
98537
|
0 |
0 |
rc = sqlite3RunVacuum(&p->zErrMsg, db, pOp->p1,
|
98539
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
98560
|
0 |
0 |
if( rc ){
|
98561
|
0 |
0 |
if( rc!=SQLITE_DONE ) goto abort_due_to_error;
|
98587
|
54 |
224 |
if( !pOp->p1 ){
|
98643
|
31 |
0 |
if( isWriteLock || 0==(db->flags&SQLITE_ReadUncommit) ){
|
|
31 |
0 |
if( isWriteLock || 0==(db->flags&SQLITE_ReadUncommit) ){
|
98649
|
0 |
31 |
if( rc ){
|
98650
|
0 |
0 |
if( (rc&0xFF)==SQLITE_LOCKED ){
|
98675
|
48 |
31 |
if( pVTab ) sqlite3VtabImportErrmsg(p, pVTab->pVtab);
|
98676
|
0 |
79 |
if( rc ) goto abort_due_to_error;
|
98701
|
29 |
0 |
if( zTab ){
|
98705
|
1 |
28 |
if( rc ) goto abort_due_to_error;
|
98721
|
0 |
2 |
if( rc ) goto abort_due_to_error;
|
98743
|
194 |
0 |
if( pVtab==0 || NEVER(pVtab->pModule==0) ){
|
|
0 |
194 |
if( pVtab==0 || NEVER(pVtab->pModule==0) ){
|
98750
|
0 |
194 |
if( rc ) goto abort_due_to_error;
|
98757
|
194 |
0 |
if( pCur ){
|
98786
|
0 |
0 |
if( pRhs==0 ) goto no_mem;
|
98848
|
202 |
204 |
for(i = 0; i<nArg; i++){
|
98853
|
0 |
204 |
if( rc ) goto abort_due_to_error;
|
98857
|
28 |
176 |
if( res ) goto jump_to_p2;
|
98888
|
2 |
1131 |
if( pCur->nullRow ){
|
98900
|
0 |
1131 |
if( pOp->p5 & OPFLAG_NOCHNG ){
|
98909
|
0 |
1131 |
if( sContext.isError>0 ){
|
98917
|
0 |
1131 |
if( rc ) goto abort_due_to_error;
|
98938
|
1 |
337 |
if( pCur->nullRow ){
|
98953
|
0 |
337 |
if( rc ) goto abort_due_to_error;
|
98956
|
221 |
116 |
if( !res ){
|
98989
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
98991
|
0 |
0 |
if( isLegacy==0 ) db->flags &= ~(u64)SQLITE_LegacyAlter;
|
98994
|
0 |
0 |
if( rc ) goto abort_due_to_error;
|
99040
|
0 |
50 |
if( db->mallocFailed ) goto no_mem;
|
99043
|
50 |
0 |
if( pVtab==0 || NEVER(pVtab->pModule==0) ){
|
|
0 |
50 |
if( pVtab==0 || NEVER(pVtab->pModule==0) ){
|
99050
|
50 |
0 |
if( ALWAYS(pModule->xUpdate) ){
|
99054
|
302 |
50 |
for(i=0; i<nArg; i++){
|
99064
|
50 |
0 |
if( rc==SQLITE_OK && pOp->p1 ){
|
|
49 |
1 |
if( rc==SQLITE_OK && pOp->p1 ){
|
99068
|
0 |
50 |
if( (rc&0xff)==SQLITE_CONSTRAINT && pOp->p4.pVtab->bConstraint ){
|
|
0 |
0 |
if( (rc&0xff)==SQLITE_CONSTRAINT && pOp->p4.pVtab->bConstraint ){
|
99069
|
0 |
0 |
if( pOp->p5==OE_Ignore ){
|
99072
|
0 |
0 |
p->errorAction = ((pOp->p5==OE_Replace) ? OE_Abort : pOp->p5);
|
99077
|
0 |
50 |
if( rc ) goto abort_due_to_error;
|
99112
|
0 |
0 |
if( pOp->p3 ){
|
99114
|
0 |
0 |
if( newMax < (unsigned)pOp->p3 ) newMax = (unsigned)pOp->p3;
|
99180
|
669 |
411 |
if( pCtx->pOut != pOut ){
|
99184
|
1143 |
669 |
for(i=pCtx->argc-1; i>=0; i--) pCtx->argv[i] = &aMem[pOp->p2+i];
|
99200
|
6 |
1074 |
if( pCtx->isError ){
|
99201
|
6 |
0 |
if( pCtx->isError>0 ){
|
99207
|
6 |
0 |
if( rc ) goto abort_due_to_error;
|
99291
|
0 |
0 |
if( (pIn1->z[h/8] & (1<<(h&7)))==0 ){
|
99349
|
10 |
6254 |
if( (db->mTrace & (SQLITE_TRACE_STMT|SQLITE_TRACE_LEGACY))!=0
|
99350
|
10 |
0 |
&& p->minWriteFileFormat!=254 /* tag-20220401a */
|
99351
|
0 |
10 |
&& (zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0
|
|
6 |
4 |
&& (zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0
|
99354
|
6 |
0 |
if( db->mTrace & SQLITE_TRACE_LEGACY ){
|
99360
|
0 |
0 |
if( db->nVdbeExec>1 ){
|
99387
|
0 |
6264 |
if( pOp->p1>=sqlite3GlobalConfig.iOnceResetThreshold ){
|
99388
|
0 |
0 |
if( pOp->opcode==OP_Trace ) break;
|
99389
|
0 |
0 |
for(i=1; i<p->nOp; i++){
|
99390
|
0 |
0 |
if( p->aOp[i].opcode==OP_Once ) p->aOp[i].p1 = 0;
|
99555
|
0 |
33 |
if( db->mallocFailed ){
|
99557
|
0 |
33 |
}else if( rc==SQLITE_IOERR_CORRUPTFS ){
|
99573
|
6 |
27 |
if( p->zErrMsg==0 && rc!=SQLITE_IOERR_NOMEM ){
|
|
6 |
0 |
if( p->zErrMsg==0 && rc!=SQLITE_IOERR_NOMEM ){
|
99581
|
33 |
0 |
if( p->eVdbeState==VDBE_RUN_STATE ) sqlite3VdbeHalt(p);
|
99582
|
0 |
33 |
if( rc==SQLITE_IOERR_NOMEM ) sqlite3OomFault(db);
|
99583
|
0 |
33 |
if( rc==SQLITE_CORRUPT && db->autoCommit==0 ){
|
|
0 |
0 |
if( rc==SQLITE_CORRUPT && db->autoCommit==0 ){
|
99587
|
0 |
33 |
if( resetSchemaOnFault>0 ){
|
99608
|
80 |
13014 |
while( nVmStep>=nProgressLimit && db->xProgress!=0 ){
|
|
80 |
0 |
while( nVmStep>=nProgressLimit && db->xProgress!=0 ){
|
99610
|
0 |
80 |
if( db->xProgress(db->pProgressArg) ){
|
99618
|
0 |
13014 |
if( DbMaskNonZero(p->lockMask) ){
|
99722
|
87 |
31 |
if( v->pc>4 ){
|
99729
|
118 |
0 |
if( rc==SQLITE_ROW ){
|
99734
|
118 |
0 |
type = pC->nHdrParsed>p->iCol ? pC->aType[p->iCol] : 0;
|
99737
|
0 |
118 |
if( type<12 ){
|
99738
|
0 |
0 |
zErr = sqlite3MPrintf(p->db, "cannot open value of type %s",
|
99739
|
0 |
0 |
type==0?"null": type==7?"real": "integer"
|
99752
|
118 |
0 |
if( rc==SQLITE_ROW ){
|
99754
|
0 |
0 |
}else if( p->pStmt ){
|
99757
|
0 |
0 |
if( rc==SQLITE_OK ){
|
99810
|
0 |
31 |
if( !pBlob ) goto blob_open_out;
|
99816
|
31 |
0 |
if( pTab && IsVirtual(pTab) ){
|
|
0 |
31 |
if( pTab && IsVirtual(pTab) ){
|
99820
|
31 |
0 |
if( pTab && !HasRowid(pTab) ){
|
|
0 |
31 |
if( pTab && !HasRowid(pTab) ){
|
99825
|
31 |
0 |
if( pTab && IsView(pTab) ){
|
|
0 |
31 |
if( pTab && IsView(pTab) ){
|
99830
|
0 |
31 |
if( !pTab ){
|
99831
|
0 |
0 |
if( sParse.zErrMsg ){
|
99844
|
62 |
0 |
for(iCol=0; iCol<pTab->nCol; iCol++) {
|
99845
|
31 |
31 |
if( sqlite3StrICmp(pTab->aCol[iCol].zCnName, zColumn)==0 ){
|
99849
|
0 |
31 |
if( iCol==pTab->nCol ){
|
99860
|
0 |
31 |
if( wrFlag ){
|
99864
|
0 |
0 |
if( db->flags&SQLITE_ForeignKeys ){
|
99871
|
0 |
0 |
for(pFKey=pTab->u.tab.pFKey; pFKey; pFKey=pFKey->pNextFrom){
|
99873
|
0 |
0 |
for(j=0; j<pFKey->nCol; j++){
|
99874
|
0 |
0 |
if( pFKey->aCol[j].iFrom==iCol ){
|
99881
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
99883
|
0 |
0 |
for(j=0; j<pIdx->nKeyCol; j++){
|
99885
|
0 |
0 |
if( pIdx->aiColumn[j]==iCol || pIdx->aiColumn[j]==XN_EXPR ){
|
|
0 |
0 |
if( pIdx->aiColumn[j]==iCol || pIdx->aiColumn[j]==XN_EXPR ){
|
99890
|
0 |
0 |
if( zFault ){
|
99901
|
31 |
0 |
if( pBlob->pStmt ){
|
99942
|
31 |
0 |
if( db->mallocFailed==0 ){
|
99953
|
31 |
0 |
if( db->mallocFailed==0 ){
|
99958
|
0 |
31 |
if( wrFlag ) aOp[1].opcode = OP_OpenWrite;
|
99983
|
0 |
31 |
if( db->mallocFailed ){
|
99987
|
31 |
0 |
if( (++nAttempt)>=SQLITE_MAX_SCHEMA_RETRY || rc!=SQLITE_SCHEMA ) break;
|
|
0 |
31 |
if( (++nAttempt)>=SQLITE_MAX_SCHEMA_RETRY || rc!=SQLITE_SCHEMA ) break;
|
99992
|
31 |
0 |
if( rc==SQLITE_OK && db->mallocFailed==0 ){
|
|
31 |
0 |
if( rc==SQLITE_OK && db->mallocFailed==0 ){
|
99995
|
0 |
0 |
if( pBlob && pBlob->pStmt ) sqlite3VdbeFinalize((Vdbe *)pBlob->pStmt);
|
|
0 |
0 |
if( pBlob && pBlob->pStmt ) sqlite3VdbeFinalize((Vdbe *)pBlob->pStmt);
|
99998
|
0 |
31 |
sqlite3ErrorWithMsg(db, rc, (zErr ? "%s" : (char*)0), zErr);
|
100015
|
31 |
660 |
if( p ){
|
100043
|
0 |
72 |
if( p==0 ) return SQLITE_MISUSE_BKPT;
|
100048
|
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 ){
|
100051
|
0 |
72 |
}else if( v==0 ){
|
100090
|
0 |
72 |
if( rc==SQLITE_ABORT ){
|
100125
|
118 |
0 |
return (p && p->pStmt) ? p->nByte : 0;
|
|
118 |
0 |
return (p && p->pStmt) ? p->nByte : 0;
|
100143
|
0 |
87 |
if( p==0 ) return SQLITE_MISUSE_BKPT;
|
100147
|
0 |
87 |
if( p->pStmt==0 ){
|
100156
|
0 |
87 |
if( rc!=SQLITE_OK ){
|
100157
|
0 |
0 |
sqlite3ErrorWithMsg(db, rc, (zErr ? "%s" : (char*)0), zErr);
|
100644
|
0 |
0 |
if( pReadr->aMap ) sqlite3OsUnfetch(pReadr->pFd, 0, pReadr->aMap);
|
100666
|
0 |
0 |
if( p->aMap ){
|
100678
|
0 |
0 |
if( iBuf==0 ){
|
100683
|
0 |
0 |
if( (p->iEof - p->iReadOff) > (i64)p->nBuffer ){
|
100693
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
100697
|
0 |
0 |
if( nByte<=nAvail ){
|
100710
|
0 |
0 |
if( p->nAlloc<nByte ){
|
100713
|
0 |
0 |
while( nByte>nNew ) nNew = nNew*2;
|
100715
|
0 |
0 |
if( !aNew ) return SQLITE_NOMEM_BKPT;
|
100728
|
0 |
0 |
while( nRem>0 ){
|
100734
|
0 |
0 |
if( nRem>p->nBuffer ) nCopy = p->nBuffer;
|
100736
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
100755
|
0 |
0 |
if( p->aMap ){
|
100759
|
0 |
0 |
if( iBuf && (p->nBuffer-iBuf)>=9 ){
|
|
0 |
0 |
if( iBuf && (p->nBuffer-iBuf)>=9 ){
|
100766
|
0 |
0 |
if( rc ) return rc;
|
100768
|
0 |
0 |
}while( (a[0]&0x80)!=0 );
|
100787
|
0 |
0 |
if( pFile->iEof<=(i64)(pTask->pSorter->db->nMaxSorterMmap) ){
|
100789
|
0 |
0 |
if( pFd->pMethods->iVersion>=3 ){
|
100812
|
0 |
0 |
if( sqlite3FaultSim(201) ) return SQLITE_IOERR_READ;
|
100813
|
0 |
0 |
if( pReadr->aMap ){
|
100822
|
0 |
0 |
if( rc==SQLITE_OK && pReadr->aMap==0 ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pReadr->aMap==0 ){
|
100825
|
0 |
0 |
if( pReadr->aBuffer==0 ){
|
100827
|
0 |
0 |
if( pReadr->aBuffer==0 ) rc = SQLITE_NOMEM_BKPT;
|
100830
|
0 |
0 |
if( rc==SQLITE_OK && iBuf ){
|
|
0 |
0 |
if( rc==SQLITE_OK && iBuf ){
|
100832
|
0 |
0 |
if( (pReadr->iReadOff + nRead) > pReadr->iEof ){
|
100854
|
0 |
0 |
if( pReadr->iReadOff>=pReadr->iEof ){
|
100857
|
0 |
0 |
if( pIncr ){
|
100859
|
0 |
0 |
if( rc==SQLITE_OK && pIncr->bEof==0 ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pIncr->bEof==0 ){
|
100867
|
0 |
0 |
if( bEof ){
|
100875
|
0 |
0 |
if( rc==SQLITE_OK ){
|
100878
|
0 |
0 |
if( rc==SQLITE_OK ){
|
100911
|
0 |
0 |
if( rc==SQLITE_OK ){
|
100918
|
0 |
0 |
if( rc==SQLITE_OK ){
|
100936
|
5 |
0 |
if( *pbKey2Cached==0 ){
|
100963
|
20198 |
15394 |
if( !*pbKey2Cached ){
|
100990
|
0 |
103 |
getVarint32NR(&p1[1], n1);
|
100991
|
0 |
103 |
getVarint32NR(&p2[1], n2);
|
100993
|
34 |
69 |
if( res==0 ){
|
100997
|
34 |
69 |
if( res==0 ){
|
100998
|
5 |
29 |
if( pTask->pSorter->pKeyInfo->nKeyField>1 ){
|
101005
|
0 |
69 |
if( pTask->pSorter->pKeyInfo->aSortFlags[0] ){
|
101034
|
233 |
360 |
if( s1==s2 ){
|
101040
|
233 |
0 |
for(i=0; i<n; i++){
|
101041
|
233 |
0 |
if( (res = v1[i] - v2[i])!=0 ){
|
101042
|
0 |
233 |
if( ((v1[0] ^ v2[0]) & 0x80)!=0 ){
|
101043
|
0 |
0 |
res = v1[0] & 0x80 ? -1 : +1;
|
101048
|
140 |
220 |
}else if( s1>7 && s2>7 ){
|
|
104 |
36 |
}else if( s1>7 && s2>7 ){
|
101051
|
220 |
36 |
if( s2>7 ){
|
101053
|
36 |
0 |
}else if( s1>7 ){
|
101060
|
220 |
36 |
if( res>0 ){
|
101061
|
0 |
220 |
if( *v1 & 0x80 ) res = -1;
|
101063
|
0 |
36 |
if( *v2 & 0x80 ) res = +1;
|
101067
|
0 |
593 |
if( res==0 ){
|
101068
|
0 |
0 |
if( pTask->pSorter->pKeyInfo->nKeyField>1 ){
|
101073
|
2 |
591 |
}else if( pTask->pSorter->pKeyInfo->aSortFlags[0] ){
|
101120
|
262 |
0 |
if( sqlite3TempInMemory(db) || sqlite3GlobalConfig.bCoreMutex==0 ){
|
|
0 |
262 |
if( sqlite3TempInMemory(db) || sqlite3GlobalConfig.bCoreMutex==0 ){
|
101143
|
0 |
262 |
if( pSorter==0 ){
|
101150
|
5 |
257 |
if( nField && nWorker==0 ){
|
|
5 |
0 |
if( nField && nWorker==0 ){
|
101160
|
262 |
262 |
for(i=0; i<pSorter->nTask; i++){
|
101165
|
262 |
0 |
if( !sqlite3TempInMemory(db) ){
|
101171
|
261 |
1 |
if( mxCache<0 ){
|
101183
|
262 |
0 |
if( sqlite3GlobalConfig.bSmallMalloc==0 ){
|
101187
|
0 |
262 |
if( !pSorter->list.aMemory ) rc = SQLITE_NOMEM_BKPT;
|
101191
|
262 |
0 |
if( pKeyInfo->nAllField<13
|
101192
|
257 |
5 |
&& (pKeyInfo->aColl[0]==0 || pKeyInfo->aColl[0]==db->pDfltColl)
|
|
241 |
16 |
&& (pKeyInfo->aColl[0]==0 || pKeyInfo->aColl[0]==db->pDfltColl)
|
101193
|
246 |
0 |
&& (pKeyInfo->aSortFlags[0] & KEYINFO_ORDER_BIGNULL)==0
|
101209
|
0 |
262 |
for(p=pRecord; p; p=pNext){
|
101224
|
0 |
262 |
if( pTask->list.aMemory ){
|
101232
|
0 |
262 |
if( pTask->file.pFd ){
|
101235
|
0 |
262 |
if( pTask->file2.pFd ){
|
101287
|
0 |
262 |
if( pTask->pThread ){
|
101330
|
262 |
262 |
for(i=pSorter->nTask-1; i>=0; i--){
|
101333
|
262 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
101356
|
0 |
0 |
while( N<nReader ) N += N;
|
101359
|
0 |
0 |
pNew = sqlite3FaultSim(100) ? 0 : (MergeEngine*)sqlite3MallocZero(nByte);
|
101360
|
0 |
0 |
if( pNew ){
|
101374
|
0 |
262 |
if( pMerger ){
|
101375
|
0 |
0 |
for(i=0; i<pMerger->nTree; i++){
|
101387
|
0 |
0 |
if( pIncr ){
|
101389
|
0 |
0 |
if( pIncr->bUseThread ){
|
101391
|
0 |
0 |
if( pIncr->aFile[0].pFd ) sqlite3OsCloseFree(pIncr->aFile[0].pFd);
|
101392
|
0 |
0 |
if( pIncr->aFile[1].pFd ) sqlite3OsCloseFree(pIncr->aFile[1].pFd);
|
101408
|
0 |
262 |
if( pSorter->pReader ){
|
101416
|
262 |
262 |
for(i=0; i<pSorter->nTask; i++){
|
101421
|
0 |
262 |
if( pSorter->list.aMemory==0 ){
|
101440
|
262 |
0 |
if( pSorter ){
|
101459
|
0 |
0 |
if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){
|
|
0 |
0 |
if( nByte<=(i64)(db->nMaxSorterMmap) && pFd->pMethods->iVersion>=3 ){
|
101465
|
0 |
0 |
if( p ) sqlite3OsUnfetch(pFd, 0, p);
|
101483
|
0 |
0 |
if( sqlite3FaultSim(202) ) return SQLITE_IOERR_ACCESS;
|
101489
|
0 |
0 |
if( rc==SQLITE_OK ){
|
101492
|
0 |
0 |
if( nExtend>0 ){
|
101505
|
212 |
0 |
if( pTask->pUnpacked==0 ){
|
101507
|
0 |
212 |
if( pTask->pUnpacked==0 ) return SQLITE_NOMEM_BKPT;
|
101534
|
17685 |
18603 |
if( res<=0 ){
|
101538
|
2244 |
15441 |
if( p1==0 ){
|
101547
|
2470 |
16133 |
if( p2==0 ){
|
101561
|
148 |
64 |
if( p->typeMask==SORTER_TYPE_INTEGER ){
|
101563
|
38 |
26 |
}else if( p->typeMask==SORTER_TYPE_TEXT ){
|
101581
|
0 |
212 |
if( rc!=SQLITE_OK ) return rc;
|
101587
|
4926 |
212 |
while( p ){
|
101589
|
4926 |
0 |
if( pList->aMemory ){
|
101590
|
212 |
4714 |
if( (u8*)p==pList->aMemory ){
|
101601
|
4639 |
4926 |
for(i=0; aSlot[i]; i++){
|
101610
|
13568 |
212 |
for(i=0; i<ArraySize(aSlot); i++){
|
101611
|
13281 |
287 |
if( aSlot[i]==0 ) continue;
|
101612
|
75 |
212 |
p = p ? vdbeSorterMerge(pTask, p, aSlot[i]) : aSlot[i];
|
101633
|
0 |
0 |
if( !p->aBuffer ){
|
101649
|
0 |
0 |
while( nRem>0 && p->eFWErr==0 ){
|
|
0 |
0 |
while( nRem>0 && p->eFWErr==0 ){
|
101651
|
0 |
0 |
if( nCopy>(p->nBuffer - p->iBufEnd) ){
|
101657
|
0 |
0 |
if( p->iBufEnd==p->nBuffer ){
|
101682
|
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 ){
|
101736
|
0 |
0 |
if( pTask->file.pFd==0 ){
|
101744
|
0 |
0 |
if( rc==SQLITE_OK ){
|
101749
|
0 |
0 |
if( rc==SQLITE_OK ){
|
101753
|
0 |
0 |
if( rc==SQLITE_OK ){
|
101761
|
0 |
0 |
for(p=pList->pList; p; p=pNext){
|
101765
|
0 |
0 |
if( pList->aMemory==0 ) sqlite3_free(p);
|
101796
|
0 |
0 |
if( rc==SQLITE_OK ){
|
101807
|
0 |
0 |
for(i=(pMerger->nTree+iPrev)/2; i>0; i=i/2){
|
101810
|
0 |
0 |
if( pReadr1->pFd==0 ){
|
101812
|
0 |
0 |
}else if( pReadr2->pFd==0 ){
|
101835
|
0 |
0 |
if( iRes<0 || (iRes==0 && pReadr1<pReadr2) ){
|
|
0 |
0 |
if( iRes<0 || (iRes==0 && pReadr1<pReadr2) ){
|
|
0 |
0 |
if( iRes<0 || (iRes==0 && pReadr1<pReadr2) ){
|
101840
|
0 |
0 |
if( pReadr1->pFd ) bCached = 0;
|
101848
|
0 |
0 |
return (rc==SQLITE_OK ? pTask->pUnpacked->errCode : rc);
|
101891
|
0 |
0 |
for(i=0; i<nWorker; i++){
|
101894
|
0 |
0 |
if( pTask->bDone ){
|
101897
|
0 |
0 |
if( rc!=SQLITE_OK || pTask->pThread==0 ) break;
|
|
0 |
0 |
if( rc!=SQLITE_OK || pTask->pThread==0 ) break;
|
101900
|
0 |
0 |
if( rc==SQLITE_OK ){
|
101901
|
0 |
0 |
if( i==nWorker ){
|
101920
|
0 |
0 |
if( aMem ){
|
101923
|
0 |
0 |
}else if( pSorter->list.aMemory ){
|
101925
|
0 |
0 |
if( !pSorter->list.aMemory ) return SQLITE_NOMEM_BKPT;
|
101953
|
0 |
4926 |
getVarint32NR((const u8*)&pVal->z[1], t);
|
101954
|
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 ){
|
101956
|
364 |
4006 |
}else if( t>10 && (t & 0x01) ){
|
|
364 |
0 |
}else if( t>10 && (t & 0x01) ){
|
101982
|
4926 |
0 |
if( pSorter->mxPmaSize ){
|
101983
|
4926 |
0 |
if( pSorter->list.aMemory ){
|
101984
|
4714 |
212 |
bFlush = pSorter->iMemory && (pSorter->iMemory+nReq) > pSorter->mxPmaSize;
|
|
0 |
4714 |
bFlush = pSorter->iMemory && (pSorter->iMemory+nReq) > pSorter->mxPmaSize;
|
101988
|
0 |
0 |
|| (pSorter->list.szPMA > pSorter->mnPmaSize && sqlite3HeapNearlyFull())
|
|
0 |
0 |
|| (pSorter->list.szPMA > pSorter->mnPmaSize && sqlite3HeapNearlyFull())
|
|
0 |
0 |
|| (pSorter->list.szPMA > pSorter->mnPmaSize && sqlite3HeapNearlyFull())
|
101991
|
0 |
4926 |
if( bFlush ){
|
102000
|
301 |
4625 |
if( nPMA>pSorter->mxKeysize ){
|
102004
|
4926 |
0 |
if( pSorter->list.aMemory ){
|
102007
|
19 |
4907 |
if( nMin>pSorter->nMemory ){
|
102011
|
17 |
2 |
if( pSorter->list.pList ){
|
102014
|
6 |
19 |
while( nNew < nMin ) nNew = nNew*2;
|
102015
|
0 |
19 |
if( nNew > pSorter->mxPmaSize ) nNew = pSorter->mxPmaSize;
|
102016
|
0 |
19 |
if( nNew < nMin ) nNew = nMin;
|
102018
|
0 |
19 |
if( !aNew ) return SQLITE_NOMEM_BKPT;
|
102019
|
17 |
2 |
if( iListOff>=0 ){
|
102028
|
4714 |
212 |
if( pSorter->list.pList ){
|
102033
|
0 |
0 |
if( pNew==0 ){
|
102064
|
0 |
0 |
while( rc==SQLITE_OK ){
|
102072
|
0 |
0 |
if( pReader->pFd==0 ) break;
|
102073
|
0 |
0 |
if( (iEof + nKey + sqlite3VarintLen(nKey))>(iStart + pIncr->mxSz) ) break;
|
102083
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
102131
|
0 |
0 |
if( pIncr->bUseThread ){
|
102134
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102140
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102141
|
0 |
0 |
if( pIncr->aFile[0].iEof==pIncr->iStartOff ){
|
102152
|
0 |
0 |
if( pIncr->aFile[0].iEof==pIncr->iStartOff ){
|
102172
|
0 |
0 |
IncrMerger *pIncr = *ppOut = (IncrMerger*)
|
102174
|
0 |
0 |
if( pIncr ){
|
102216
|
0 |
0 |
if( iOut>=(pMerger->nTree/2) ){
|
102227
|
0 |
0 |
if( p1->pFd==0 ){
|
102229
|
0 |
0 |
}else if( p2->pFd==0 ){
|
102239
|
0 |
0 |
if( res<=0 ){
|
102307
|
0 |
0 |
for(i=0; i<nTree; i++){
|
102308
|
0 |
0 |
if( SQLITE_MAX_WORKER_THREADS>0 && eMode==INCRINIT_ROOT ){
|
102320
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
102323
|
0 |
0 |
for(i=pMerger->nTree-1; i>0; i--){
|
102376
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102379
|
0 |
0 |
if( pIncr->bUseThread ){
|
102381
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102387
|
0 |
0 |
if( pTask->file2.pFd==0 ){
|
102392
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102401
|
0 |
0 |
if( rc==SQLITE_OK && pIncr->bUseThread ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pIncr->bUseThread ){
|
102417
|
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) ){
|
102453
|
0 |
0 |
if( pIncr ){
|
102456
|
0 |
0 |
if( pIncr->bUseThread ){
|
102492
|
0 |
0 |
if( pNew==0 ) rc = SQLITE_NOMEM_BKPT;
|
102494
|
0 |
0 |
for(i=0; i<nPMA && rc==SQLITE_OK; i++){
|
|
0 |
0 |
for(i=0; i<nPMA && rc==SQLITE_OK; i++){
|
102501
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
102522
|
0 |
0 |
while( nDiv < (i64)nPMA ){
|
102552
|
0 |
0 |
for(i=1; i<nDepth; i++){
|
102556
|
0 |
0 |
for(i=1; i<nDepth && rc==SQLITE_OK; i++){
|
|
0 |
0 |
for(i=1; i<nDepth && rc==SQLITE_OK; i++){
|
102560
|
0 |
0 |
if( pReadr->pIncr==0 ){
|
102562
|
0 |
0 |
if( pNew==0 ){
|
102568
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102574
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102606
|
0 |
0 |
if( pSorter->nTask>1 ){
|
102608
|
0 |
0 |
if( pMain==0 ) rc = SQLITE_NOMEM_BKPT;
|
102612
|
0 |
0 |
for(iTask=0; rc==SQLITE_OK && iTask<pSorter->nTask; iTask++){
|
|
0 |
0 |
for(iTask=0; rc==SQLITE_OK && iTask<pSorter->nTask; iTask++){
|
102615
|
0 |
0 |
if( SQLITE_MAX_WORKER_THREADS==0 || pTask->nPMA ){
|
102620
|
0 |
0 |
if( pTask->nPMA<=SORTER_MAX_MERGE_COUNT ){
|
102626
|
0 |
0 |
if( pRoot==0 ) rc = SQLITE_NOMEM_BKPT;
|
102627
|
0 |
0 |
for(i=0; i<pTask->nPMA && rc==SQLITE_OK; i += SORTER_MAX_MERGE_COUNT){
|
|
0 |
0 |
for(i=0; i<pTask->nPMA && rc==SQLITE_OK; i += SORTER_MAX_MERGE_COUNT){
|
102633
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102639
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102641
|
0 |
0 |
if( pMain!=0 ){
|
102655
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
102680
|
0 |
0 |
for(i=0; i<pSorter->nTask; i++){
|
102686
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102689
|
0 |
0 |
if( pSorter->bUseThreads ){
|
102694
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102697
|
0 |
0 |
if( pReadr==0 ) rc = SQLITE_NOMEM_BKPT;
|
102699
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102701
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102703
|
0 |
0 |
for(iTask=0; iTask<(pSorter->nTask-1); iTask++){
|
102705
|
0 |
0 |
if( (pIncr = pMain->aReadr[iTask].pIncr) ){
|
102710
|
0 |
0 |
for(iTask=0; rc==SQLITE_OK && iTask<pSorter->nTask; iTask++){
|
|
0 |
0 |
for(iTask=0; rc==SQLITE_OK && iTask<pSorter->nTask; iTask++){
|
102730
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102742
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
102765
|
262 |
0 |
if( pSorter->bUsePMA==0 ){
|
102766
|
212 |
50 |
if( pSorter->list.pList ){
|
102790
|
0 |
0 |
if( rc==SQLITE_OK ){
|
102813
|
0 |
4916 |
if( pSorter->bUsePMA ){
|
102818
|
0 |
0 |
if( pSorter->bUseThreads ){
|
102820
|
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;
|
102828
|
0 |
0 |
if( rc==SQLITE_OK && res ) rc = SQLITE_DONE;
|
|
0 |
0 |
if( rc==SQLITE_OK && res ) rc = SQLITE_DONE;
|
102834
|
0 |
4916 |
if( pSorter->list.aMemory==0 ) vdbeSorterRecordFree(db, pFree);
|
102835
|
4710 |
206 |
rc = pSorter->list.pList ? SQLITE_OK : SQLITE_DONE;
|
102849
|
0 |
4923 |
if( pSorter->bUsePMA ){
|
102852
|
0 |
0 |
if( pSorter->bUseThreads ){
|
102878
|
0 |
4922 |
if( sqlite3VdbeMemClearAndResize(pOut, nKey) ){
|
102920
|
1 |
0 |
if( r2==0 ){
|
102922
|
0 |
1 |
if( r2==0 ) return SQLITE_NOMEM_BKPT;
|
102929
|
1 |
1 |
for(i=0; i<nKeyCol; i++){
|
102930
|
0 |
1 |
if( r2->aMem[i].flags & MEM_Null ){
|
103470
|
0 |
283 |
if( (iAmt+iOfst)>p->endpoint.iOffset ){
|
103474
|
172 |
111 |
if( p->readpoint.iOffset!=iOfst || iOfst==0 ){
|
|
1 |
171 |
if( p->readpoint.iOffset!=iOfst || iOfst==0 ){
|
103476
|
288 |
0 |
for(pChunk=p->pFirst;
|
103477
|
176 |
112 |
ALWAYS(pChunk) && (iOff+p->nChunkSize)<=iOfst;
|
103495
|
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 );
|
103496
|
283 |
0 |
p->readpoint.iOffset = pChunk ? iOfst+iAmt : 0;
|
103508
|
5170 |
1074 |
for(pIter=pFirst; pIter; pIter=pNext){
|
103524
|
0 |
0 |
if( rc==SQLITE_OK ){
|
103528
|
0 |
0 |
for(pIter=copy.pFirst; pIter; pIter=pIter->pNext){
|
103529
|
0 |
0 |
if( iOff + nChunk > copy.endpoint.iOffset ){
|
103533
|
0 |
0 |
if( rc ) break;
|
103536
|
0 |
0 |
if( rc==SQLITE_OK ){
|
103541
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
103571
|
748 |
3846 |
if( p->nSpill>0 && (iAmt+iOfst)>p->nSpill ){
|
|
0 |
748 |
if( p->nSpill>0 && (iAmt+iOfst)>p->nSpill ){
|
103573
|
0 |
0 |
if( rc==SQLITE_OK ){
|
103587
|
3552 |
1042 |
if( iOfst>0 && iOfst!=p->endpoint.iOffset ){
|
|
0 |
3552 |
if( iOfst>0 && iOfst!=p->endpoint.iOffset ){
|
103590
|
1042 |
3552 |
if( iOfst==0 && p->pFirst ){
|
|
0 |
1042 |
if( iOfst==0 && p->pFirst ){
|
103594
|
8722 |
4594 |
while( nWrite>0 ){
|
103600
|
5170 |
3552 |
if( iChunkOffset==0 ){
|
103603
|
0 |
5170 |
if( !pNew ){
|
103607
|
4128 |
1042 |
if( pChunk ){
|
103635
|
54 |
0 |
if( size<p->endpoint.iOffset ){
|
103637
|
46 |
8 |
if( size==0 ){
|
103642
|
40 |
0 |
for(pIter=p->pFirst; ALWAYS(pIter) && iOff<size; pIter=pIter->pNext){
|
|
32 |
8 |
for(pIter=p->pFirst; ALWAYS(pIter) && iOff<size; pIter=pIter->pNext){
|
103645
|
8 |
0 |
if( ALWAYS(pIter) ){
|
103741
|
92 |
1020 |
if( nSpill==0 ){
|
103745
|
209 |
811 |
if( nSpill>0 ){
|
103842
|
0 |
0 |
for(pWin=pList; pWin; pWin=pWin->pNextWin){
|
103845
|
0 |
0 |
if( rc ) return WRC_Abort;
|
103847
|
0 |
0 |
if( rc ) return WRC_Abort;
|
103849
|
0 |
0 |
if( rc ) return WRC_Abort;
|
103851
|
0 |
0 |
if( rc ) return WRC_Abort;
|
103853
|
0 |
0 |
if( rc ) return WRC_Abort;
|
103854
|
0 |
0 |
if( bOneOnly ) break;
|
103885
|
9775 |
36320 |
if( rc ) return rc & WRC_Abort;
|
103886
|
11581 |
24739 |
if( !ExprHasProperty(pExpr,(EP_TokenOnly|EP_Leaf)) ){
|
103888
|
6017 |
5564 |
if( pExpr->pLeft && walkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort;
|
|
17 |
6000 |
if( pExpr->pLeft && walkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort;
|
103889
|
5443 |
6121 |
if( pExpr->pRight ){
|
103893
|
89 |
6032 |
}else if( ExprUseXSelect(pExpr) ){
|
103895
|
26 |
63 |
if( sqlite3WalkSelect(pWalker, pExpr->x.pSelect) ) return WRC_Abort;
|
103897
|
2008 |
4024 |
if( pExpr->x.pList ){
|
103898
|
219 |
1789 |
if( sqlite3WalkExprList(pWalker, pExpr->x.pList) ) return WRC_Abort;
|
103901
|
0 |
5813 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){
|
103902
|
0 |
0 |
if( walkWindowList(pWalker, pExpr->y.pWin, 1) ) return WRC_Abort;
|
103912
|
34635 |
10254 |
return pExpr ? walkExpr(pWalker,pExpr) : WRC_Continue;
|
103922
|
8084 |
6958 |
if( p ){
|
103923
|
15971 |
7859 |
for(i=p->nExpr, pItem=p->a; i>0; i--, pItem++){
|
103924
|
225 |
15746 |
if( sqlite3WalkExpr(pWalker, pItem->pExpr) ) return WRC_Abort;
|
103947
|
0 |
4015 |
if( sqlite3WalkExprList(pWalker, p->pEList) ) return WRC_Abort;
|
103948
|
0 |
4015 |
if( sqlite3WalkExpr(pWalker, p->pWhere) ) return WRC_Abort;
|
103949
|
0 |
4015 |
if( sqlite3WalkExprList(pWalker, p->pGroupBy) ) return WRC_Abort;
|
103950
|
0 |
4015 |
if( sqlite3WalkExpr(pWalker, p->pHaving) ) return WRC_Abort;
|
103951
|
0 |
4015 |
if( sqlite3WalkExprList(pWalker, p->pOrderBy) ) return WRC_Abort;
|
103952
|
0 |
4015 |
if( sqlite3WalkExpr(pWalker, p->pLimit) ) return WRC_Abort;
|
103954
|
0 |
4015 |
if( p->pWinDefn ){
|
103956
|
0 |
0 |
if( pWalker->xSelectCallback2==sqlite3WalkWinDefnDummyCallback
|
103957
|
0 |
0 |
|| ((pParse = pWalker->pParse)!=0 && IN_RENAME_OBJECT)
|
|
0 |
0 |
|| ((pParse = pWalker->pParse)!=0 && IN_RENAME_OBJECT)
|
103959
|
0 |
0 |
|| pWalker->xSelectCallback2==sqlite3SelectPopWith
|
103985
|
4015 |
0 |
if( ALWAYS(pSrc) ){
|
103986
|
2951 |
4015 |
for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){
|
103987
|
85 |
2866 |
if( pItem->pSelect && sqlite3WalkSelect(pWalker, pItem->pSelect) ){
|
|
0 |
85 |
if( pItem->pSelect && sqlite3WalkSelect(pWalker, pItem->pSelect) ){
|
103990
|
0 |
2951 |
if( pItem->fg.isTabFunc
|
103991
|
0 |
0 |
&& sqlite3WalkExprList(pWalker, pItem->u1.pFuncArg)
|
104019
|
147 |
5748 |
if( p==0 ) return WRC_Continue;
|
104020
|
0 |
5748 |
if( pWalker->xSelectCallback==0 ) return WRC_Continue;
|
104023
|
1955 |
4015 |
if( rc ) return rc & WRC_Abort;
|
104024
|
4015 |
0 |
if( sqlite3WalkSelectExpr(pWalker, p)
|
104025
|
0 |
4015 |
|| sqlite3WalkSelectFrom(pWalker, p)
|
104029
|
3920 |
95 |
if( pWalker->xSelectCallback2 ){
|
104033
|
222 |
3793 |
}while( p!=0 );
|
104111
|
0 |
0 |
if( pExpr->op==TK_AGG_FUNCTION ) pExpr->op2 += pWalker->u.n;
|
104115
|
0 |
164 |
if( N>0 ){
|
104159
|
0 |
164 |
if( db->mallocFailed ){
|
104165
|
0 |
164 |
if( pExpr->op==TK_COLLATE ){
|
104172
|
0 |
164 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){
|
104173
|
0 |
0 |
if( ALWAYS(pExpr->y.pWin!=0) ){
|
104196
|
0 |
0 |
if( pItem->fg.eEName!=ENAME_TAB ) return 0;
|
104198
|
0 |
0 |
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){}
|
|
0 |
0 |
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){}
|
104199
|
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) ){
|
104203
|
0 |
0 |
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){}
|
|
0 |
0 |
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){}
|
104204
|
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) ){
|
104208
|
0 |
0 |
if( zCol && sqlite3StrICmp(zSpan, zCol)!=0 ){
|
|
0 |
0 |
if( zCol && sqlite3StrICmp(zSpan, zCol)!=0 ){
|
104218
|
2 |
19 |
if( db->init.busy ) return 1; /* Always support for legacy schemas */
|
104219
|
4 |
15 |
if( pTopNC->ncFlags & NC_IsDDL ){
|
104221
|
0 |
4 |
if( sqlite3WritableSchema(db) && (db->flags & SQLITE_DqsDML)!=0 ){
|
|
0 |
0 |
if( sqlite3WritableSchema(db) && (db->flags & SQLITE_DqsDML)!=0 ){
|
104243
|
0 |
5204 |
if( (pExTab->tabFlags & TF_HasGenerated)!=0
|
104244
|
0 |
0 |
&& (pExTab->aCol[n].colFlags & COLFLAG_GENERATED)!=0
|
104248
|
0 |
0 |
return pExTab->nCol>=BMS ? ALLBITS : MASKBIT(pExTab->nCol)-1;
|
104252
|
0 |
5204 |
if( n>=BMS ) n = BMS-1;
|
104270
|
0 |
0 |
if( pNew ){
|
104291
|
0 |
0 |
if( sqlite3StrNICmp(zTab, "sqlite_", 7)!=0 ) return 0;
|
104293
|
0 |
0 |
if( strcmp(zLegacy+7, &LEGACY_TEMP_SCHEMA_TABLE[7])==0 ){
|
104294
|
0 |
0 |
if( sqlite3StrICmp(zTab+7, &PREFERRED_TEMP_SCHEMA_TABLE[7])==0 ){
|
104297
|
0 |
0 |
if( pSchema==0 ) return 0;
|
104298
|
0 |
0 |
if( sqlite3StrICmp(zTab+7, &LEGACY_SCHEMA_TABLE[7])==0 ) return 1;
|
104299
|
0 |
0 |
if( sqlite3StrICmp(zTab+7, &PREFERRED_SCHEMA_TABLE[7])==0 ) return 1;
|
104301
|
0 |
0 |
if( sqlite3StrICmp(zTab+7, &PREFERRED_SCHEMA_TABLE[7])==0 ) return 1;
|
104368
|
4 |
6254 |
if( zDb ){
|
104371
|
0 |
4 |
if( (pNC->ncFlags & (NC_PartIdx|NC_IsCheck))!=0 ){
|
104378
|
8 |
0 |
for(i=0; i<db->nDb; i++){
|
104380
|
4 |
4 |
if( sqlite3StrICmp(db->aDb[i].zDbSName,zDb)==0 ){
|
104385
|
0 |
4 |
if( i==db->nDb && sqlite3StrICmp("main", zDb)==0 ){
|
|
0 |
0 |
if( i==db->nDb && sqlite3StrICmp("main", zDb)==0 ){
|
104400
|
6256 |
14 |
if( pSrcList ){
|
104401
|
6309 |
6256 |
for(i=0, pItem=pSrcList->a; i<pSrcList->nSrc; i++, pItem++){
|
104407
|
0 |
6309 |
if( pItem->fg.isNestedFrom ){
|
104419
|
0 |
0 |
for(j=0; j<pEList->nExpr; j++){
|
104420
|
0 |
0 |
if( !sqlite3MatchEName(&pEList->a[j], zCol, zTab, zDb) ){
|
104423
|
0 |
0 |
if( cnt>0 ){
|
104424
|
0 |
0 |
if( pItem->fg.isUsing==0
|
104425
|
0 |
0 |
|| sqlite3IdListIndex(pItem->u3.pUsing, zCol)<0
|
104433
|
0 |
0 |
if( (pItem->fg.jointype & JT_RIGHT)==0 ){
|
104437
|
0 |
0 |
if( (pItem->fg.jointype & JT_LEFT)==0 ){
|
104453
|
0 |
0 |
if( pEList->a[j].fg.bUsingTerm ) break;
|
104455
|
0 |
0 |
if( hit || zTab==0 ) continue;
|
|
0 |
0 |
if( hit || zTab==0 ) continue;
|
104458
|
139 |
6170 |
if( zTab ){
|
104459
|
8 |
131 |
if( zDb ){
|
104460
|
4 |
4 |
if( pTab->pSchema!=pSchema ) continue;
|
104461
|
0 |
4 |
if( pSchema==0 && strcmp(zDb,"*")!=0 ) continue;
|
|
0 |
0 |
if( pSchema==0 && strcmp(zDb,"*")!=0 ) continue;
|
104463
|
108 |
27 |
if( pItem->zAlias!=0 ){
|
104464
|
38 |
70 |
if( sqlite3StrICmp(zTab, pItem->zAlias)!=0 ){
|
104467
|
10 |
17 |
}else if( sqlite3StrICmp(zTab, pTab->zName)!=0 ){
|
104468
|
10 |
0 |
if( pTab->tnum!=1 ) continue;
|
104469
|
0 |
0 |
if( !isValidSchemaTableName(zTab, pTab, pSchema) ) continue;
|
104472
|
0 |
87 |
if( IN_RENAME_OBJECT && pItem->zAlias ){
|
|
0 |
0 |
if( IN_RENAME_OBJECT && pItem->zAlias ){
|
104477
|
17447 |
910 |
for(j=0, pCol=pTab->aCol; j<pTab->nCol; j++, pCol++){
|
104478
|
5347 |
12100 |
if( pCol->hName==hCol
|
104479
|
5347 |
0 |
&& sqlite3StrICmp(pCol->zCnName, zCol)==0
|
104481
|
0 |
5347 |
if( cnt>0 ){
|
104482
|
0 |
0 |
if( pItem->fg.isUsing==0
|
104483
|
0 |
0 |
|| sqlite3IdListIndex(pItem->u3.pUsing, zCol)<0
|
104491
|
0 |
0 |
if( (pItem->fg.jointype & JT_RIGHT)==0 ){
|
104495
|
0 |
0 |
if( (pItem->fg.jointype & JT_LEFT)==0 ){
|
104508
|
5096 |
251 |
pExpr->iColumn = j==pTab->iPKey ? -1 : (i16)j;
|
104509
|
0 |
5347 |
if( pItem->fg.isNestedFrom ){
|
104515
|
897 |
5360 |
if( 0==cnt && VisibleRowid(pTab) ){
|
|
890 |
7 |
if( 0==cnt && VisibleRowid(pTab) ){
|
104520
|
6237 |
19 |
if( pMatch ){
|
104524
|
7 |
6230 |
if( (pMatch->fg.jointype & (JT_LEFT|JT_LTORJ))!=0 ){
|
104537
|
923 |
5347 |
if( cnt==0 && zDb==0 ){
|
|
923 |
0 |
if( cnt==0 && zDb==0 ){
|
104540
|
0 |
923 |
if( pParse->pTriggerTab!=0 ){
|
104543
|
0 |
0 |
if( pParse->bReturning ){
|
104544
|
0 |
0 |
if( (pNC->ncFlags & NC_UBaseReg)!=0
|
104545
|
0 |
0 |
&& ALWAYS(zTab==0
|
|
0 |
0 |
&& ALWAYS(zTab==0
|
104551
|
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 ){
|
104554
|
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 ){
|
104561
|
264 |
659 |
if( (pNC->ncFlags & NC_UUpsert)!=0 && zTab!=0 ){
|
|
0 |
264 |
if( (pNC->ncFlags & NC_UUpsert)!=0 && zTab!=0 ){
|
104563
|
0 |
0 |
if( pUpsert && sqlite3StrICmp("excluded",zTab)==0 ){
|
|
0 |
0 |
if( pUpsert && sqlite3StrICmp("excluded",zTab)==0 ){
|
104570
|
0 |
923 |
if( pTab ){
|
104575
|
0 |
0 |
for(iCol=0, pCol=pTab->aCol; iCol<pTab->nCol; iCol++, pCol++){
|
104576
|
0 |
0 |
if( pCol->hName==hCol
|
104577
|
0 |
0 |
&& sqlite3StrICmp(pCol->zCnName, zCol)==0
|
104579
|
0 |
0 |
if( iCol==pTab->iPKey ){
|
104585
|
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) ){
|
104589
|
0 |
0 |
if( iCol<pTab->nCol ){
|
104593
|
0 |
0 |
if( pExpr->iTable==EXCLUDED_TABLE_NUMBER ){
|
104596
|
0 |
0 |
if( IN_RENAME_OBJECT ){
|
104610
|
0 |
0 |
if( pParse->bReturning ){
|
104620
|
0 |
0 |
if( iCol<0 ){
|
104622
|
0 |
0 |
}else if( pExpr->iTable==0 ){
|
104625
|
0 |
0 |
pParse->oldmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<<iCol));
|
104629
|
0 |
0 |
pParse->newmask |= (iCol>=32 ? 0xffffffff : (((u32)1)<<iCol));
|
104642
|
923 |
5347 |
if( cnt==0
|
104643
|
890 |
33 |
&& cntTab==1
|
104644
|
890 |
0 |
&& pMatch
|
104645
|
890 |
0 |
&& (pNC->ncFlags & (NC_IdxExpr|NC_GenCol))==0
|
104646
|
883 |
7 |
&& sqlite3IsRowid(zCol)
|
104647
|
883 |
0 |
&& ALWAYS(VisibleRowid(pMatch->pTab))
|
104672
|
40 |
6230 |
if( cnt==0
|
104673
|
20 |
20 |
&& (pNC->ncFlags & NC_UEList)!=0
|
104674
|
8 |
12 |
&& zTab==0
|
104678
|
16 |
1 |
for(j=0; j<pEList->nExpr; j++){
|
104680
|
9 |
7 |
if( pEList->a[j].fg.eEName==ENAME_NAME
|
104681
|
7 |
2 |
&& sqlite3_stricmp(zAs, zCol)==0
|
104688
|
7 |
0 |
if( (pNC->ncFlags&NC_AllowAgg)==0 && ExprHasProperty(pOrig, EP_Agg) ){
|
|
0 |
7 |
if( (pNC->ncFlags&NC_AllowAgg)==0 && ExprHasProperty(pOrig, EP_Agg) ){
|
104692
|
0 |
7 |
if( ExprHasProperty(pOrig, EP_Win)
|
104693
|
0 |
0 |
&& ((pNC->ncFlags&NC_AllowWin)==0 || pNC!=pTopNC )
|
|
0 |
0 |
&& ((pNC->ncFlags&NC_AllowWin)==0 || pNC!=pTopNC )
|
104698
|
0 |
7 |
if( sqlite3ExprVectorSize(pOrig)!=1 ){
|
104706
|
0 |
7 |
if( IN_RENAME_OBJECT ){
|
104717
|
6230 |
33 |
if( cnt ) break;
|
104720
|
12 |
21 |
}while( pNC );
|
104733
|
21 |
6230 |
if( cnt==0 && zTab==0 ){
|
|
21 |
0 |
if( cnt==0 && zTab==0 ){
|
104735
|
21 |
0 |
if( ExprHasProperty(pExpr,EP_DblQuoted)
|
104736
|
17 |
4 |
&& areDoubleQuotedStringsEnabled(db, pTopNC)
|
104761
|
0 |
4 |
if( sqlite3ExprIdToTrueFalse(pExpr) ){
|
104775
|
4 |
6230 |
if( cnt!=1 ){
|
104777
|
0 |
4 |
if( pFJMatch ){
|
104778
|
0 |
0 |
if( pFJMatch->nExpr==cnt-1 ){
|
104779
|
0 |
0 |
if( ExprHasProperty(pExpr,EP_Leaf) ){
|
104798
|
4 |
0 |
zErr = cnt==0 ? "no such column" : "ambiguous column name";
|
104799
|
0 |
4 |
if( zDb ){
|
104801
|
0 |
4 |
}else if( zTab ){
|
104813
|
2881 |
3353 |
if( !ExprHasProperty(pExpr,(EP_TokenOnly|EP_Leaf)) ){
|
104835
|
5100 |
1134 |
if( pExpr->iColumn>=0 && pMatch!=0 ){
|
|
5098 |
2 |
if( pExpr->iColumn>=0 && pMatch!=0 ){
|
104841
|
6237 |
4 |
if( cnt==1 ){
|
104844
|
0 |
6237 |
if( pParse->db->xAuth
|
104845
|
0 |
0 |
&& (pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER)
|
|
0 |
0 |
&& (pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER)
|
104855
|
6237 |
12 |
if( pTopNC==pNC ) break;
|
104870
|
0 |
0 |
if( p ){
|
104876
|
0 |
0 |
if( p->y.pTab->iPKey==iCol ){
|
104880
|
0 |
0 |
if( (pTab->tabFlags & TF_HasGenerated)!=0
|
104881
|
0 |
0 |
&& (pTab->aCol[iCol].colFlags & COLFLAG_GENERATED)!=0
|
104885
|
0 |
0 |
pItem->colUsed = pTab->nCol>=64 ? ALLBITS : MASKBIT(pTab->nCol)-1;
|
104920
|
0 |
0 |
if( pNC->ncFlags & NC_IdxExpr ) zIn = "index expressions";
|
104922
|
0 |
0 |
else if( pNC->ncFlags & NC_IsCheck ) zIn = "CHECK constraints";
|
104925
|
0 |
0 |
else if( pNC->ncFlags & NC_GenCol ) zIn = "generated columns";
|
104928
|
0 |
0 |
if( pExpr ) pExpr->op = TK_NULL;
|
104942
|
0 |
0 |
if( p->op!=TK_FLOAT ) return -1;
|
104946
|
0 |
0 |
if( r>1.0 ) return -1;
|
105019
|
40 |
28 |
for(i=0, p=pNC; p && i<ArraySize(anRef); p=p->pNext, i++){
|
|
40 |
0 |
for(i=0, p=pNC; p && i<ArraySize(anRef); p=p->pNext, i++){
|
105023
|
0 |
28 |
if( 0==sqlite3ExprCanBeNull(pExpr->pLeft) && !IN_RENAME_OBJECT ){
|
|
0 |
0 |
if( 0==sqlite3ExprCanBeNull(pExpr->pLeft) && !IN_RENAME_OBJECT ){
|
105030
|
0 |
0 |
for(i=0, p=pNC; p && i<ArraySize(anRef); p=p->pNext, i++){
|
|
0 |
0 |
for(i=0, p=pNC; p && i<ArraySize(anRef); p=p->pNext, i++){
|
105054
|
6171 |
87 |
if( pExpr->op==TK_ID ){
|
105063
|
0 |
87 |
sqlite3ResolveNotValid(pParse, pNC, "the \".\" operator",
|
105066
|
83 |
4 |
if( pRight->op==TK_ID ){
|
105079
|
0 |
87 |
if( IN_RENAME_OBJECT ){
|
105091
|
739 |
103 |
int n = pList ? pList->nExpr : 0; /* Number of arguments */
|
105100
|
0 |
842 |
Window *pWin = (IsWindowFunc(pExpr) ? pExpr->y.pWin : 0);
|
|
0 |
0 |
Window *pWin = (IsWindowFunc(pExpr) ? pExpr->y.pWin : 0);
|
105105
|
6 |
836 |
if( pDef==0 ){
|
105107
|
6 |
0 |
if( pDef==0 ){
|
105114
|
0 |
836 |
if( pDef->funcFlags & SQLITE_FUNC_UNLIKELY ){
|
105116
|
0 |
0 |
if( n==2 ){
|
105118
|
0 |
0 |
if( pExpr->iTable<0 ){
|
105134
|
0 |
0 |
pExpr->iTable = pDef->zName[0]=='u' ? 8388608 : 125829120;
|
105140
|
0 |
836 |
if( auth!=SQLITE_OK ){
|
105141
|
0 |
0 |
if( auth==SQLITE_DENY ){
|
105151
|
187 |
649 |
if( pDef->funcFlags & (SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG) ){
|
105158
|
649 |
187 |
if( (pDef->funcFlags & SQLITE_FUNC_CONSTANT)==0 ){
|
105165
|
0 |
649 |
sqlite3ResolveNotValid(pParse, pNC, "non-deterministic functions",
|
105170
|
0 |
187 |
if( pNC->ncFlags & NC_FromDDL ) ExprSetProperty(pExpr, EP_FromDDL);
|
105172
|
0 |
836 |
if( (pDef->funcFlags & SQLITE_FUNC_INTERNAL)!=0
|
105173
|
0 |
0 |
&& pParse->nested==0
|
105174
|
0 |
0 |
&& (pParse->db->mDbFlags & DBFLAG_InternalFunc)==0
|
105183
|
664 |
172 |
if( (pDef->funcFlags & (SQLITE_FUNC_DIRECT|SQLITE_FUNC_UNSAFE))!=0
|
105184
|
664 |
0 |
&& !IN_RENAME_OBJECT
|
105190
|
842 |
0 |
if( 0==IN_RENAME_OBJECT ){
|
105196
|
836 |
6 |
if( pDef && pDef->xValue==0 && pWin ){
|
|
779 |
57 |
if( pDef && pDef->xValue==0 && pWin ){
|
|
0 |
779 |
if( pDef && pDef->xValue==0 && pWin ){
|
105201
|
147 |
695 |
}else if(
|
105202
|
147 |
0 |
(is_agg && (pNC->ncFlags & NC_AllowAgg)==0)
|
105203
|
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)
|
105204
|
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)
|
105207
|
0 |
0 |
if( (pDef->funcFlags & SQLITE_FUNC_WINDOW) || pWin ){
|
|
0 |
0 |
if( (pDef->funcFlags & SQLITE_FUNC_WINDOW) || pWin ){
|
105223
|
6 |
836 |
else if( no_such_func && pParse->db->init.busy==0
|
|
6 |
0 |
else if( no_such_func && pParse->db->init.busy==0
|
105230
|
0 |
836 |
}else if( wrong_num_args ){
|
105236
|
689 |
147 |
else if( is_agg==0 && ExprHasProperty(pExpr, EP_WinFunc) ){
|
|
0 |
689 |
else if( is_agg==0 && ExprHasProperty(pExpr, EP_WinFunc) ){
|
105244
|
147 |
695 |
if( is_agg ){
|
105249
|
147 |
0 |
pNC->ncFlags &= ~(NC_AllowWin | (!pWin ? NC_AllowAgg : 0));
|
105256
|
0 |
0 |
else if( ExprHasProperty(pExpr, EP_WinFunc) ){
|
105261
|
147 |
695 |
if( is_agg ){
|
105263
|
0 |
147 |
if( pWin ){
|
105266
|
0 |
0 |
if( IN_RENAME_OBJECT==0 ){
|
105267
|
0 |
0 |
sqlite3WindowUpdate(pParse, pSel ? pSel->pWinDefn : 0, pWin, pDef);
|
105268
|
0 |
0 |
if( pParse->db->mallocFailed ) break;
|
105282
|
0 |
147 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){
|
105287
|
147 |
0 |
while( pNC2
|
105288
|
0 |
147 |
&& sqlite3ReferencesSrcList(pParse, pExpr, pNC2->pSrcList)==0
|
105294
|
147 |
0 |
if( pNC2 && pDef ){
|
|
147 |
0 |
if( pNC2 && pDef ){
|
105317
|
21 |
16 |
if( ExprUseXSelect(pExpr) ){
|
105323
|
0 |
21 |
if( pNC->ncFlags & NC_SelfRef ){
|
105329
|
2 |
19 |
if( nRef!=pNC->nRef ){
|
105341
|
0 |
1388 |
sqlite3ResolveNotValid(pParse, pNC, "parameters",
|
105351
|
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) ){
|
105353
|
0 |
0 |
if( rc==WRC_Abort ) return WRC_Abort;
|
105354
|
0 |
0 |
if( pRight->op==TK_TRUEFALSE ){
|
105370
|
0 |
1385 |
if( pParse->db->mallocFailed ) break;
|
105373
|
18 |
1367 |
if( pExpr->op==TK_BETWEEN ){
|
105376
|
18 |
0 |
if( nRight==nLeft ){
|
105383
|
0 |
1385 |
if( nLeft!=nRight ){
|
105400
|
6 |
8943 |
return pParse->nErr ? WRC_Abort : WRC_Continue;
|
105424
|
657 |
1 |
if( pE->op==TK_ID ){
|
105428
|
2820 |
582 |
for(i=0; i<pEList->nExpr; i++){
|
105429
|
2608 |
212 |
if( pEList->a[i].fg.eEName==ENAME_NAME
|
105430
|
75 |
2533 |
&& sqlite3_stricmp(pEList->a[i].zEName, zCol)==0
|
105485
|
0 |
0 |
if( rc ) return 0;
|
105491
|
0 |
0 |
for(i=0; i<pEList->nExpr; i++){
|
105492
|
0 |
0 |
if( sqlite3ExprCompare(0, pEList->a[i].pExpr, pE, -1)<2 ){
|
105543
|
26 |
0 |
if( pOrderBy==0 ) return 0;
|
105545
|
0 |
0 |
if( pOrderBy->nExpr>db->aLimit[SQLITE_LIMIT_COLUMN] ){
|
105549
|
0 |
0 |
for(i=0; i<pOrderBy->nExpr; i++){
|
105553
|
0 |
0 |
while( pSelect->pPrior ){
|
105557
|
0 |
0 |
while( pSelect && moreToDo ){
|
|
0 |
0 |
while( pSelect && moreToDo ){
|
105562
|
0 |
0 |
for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){
|
105565
|
0 |
0 |
if( pItem->fg.done ) continue;
|
105567
|
0 |
0 |
if( NEVER(pE==0) ) continue;
|
105568
|
0 |
0 |
if( sqlite3ExprIsInteger(pE, &iCol) ){
|
105569
|
0 |
0 |
if( iCol<=0 || iCol>pEList->nExpr ){
|
|
0 |
0 |
if( iCol<=0 || iCol>pEList->nExpr ){
|
105575
|
0 |
0 |
if( iCol==0 ){
|
105588
|
0 |
0 |
if( !db->mallocFailed ){
|
105591
|
0 |
0 |
if( IN_RENAME_OBJECT && iCol>0 ){
|
|
0 |
0 |
if( IN_RENAME_OBJECT && iCol>0 ){
|
105598
|
0 |
0 |
if( iCol>0 ){
|
105601
|
0 |
0 |
if( !IN_RENAME_OBJECT ){
|
105603
|
0 |
0 |
if( pNew==0 ) return 1;
|
105606
|
0 |
0 |
if( pItem->pExpr==pE ){
|
105611
|
0 |
0 |
while( pParent->pLeft->op==TK_COLLATE ) pParent = pParent->pLeft;
|
105625
|
0 |
0 |
for(i=0; i<pOrderBy->nExpr; i++){
|
105626
|
0 |
0 |
if( pOrderBy->a[i].fg.done==0 ){
|
105656
|
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;
|
105657
|
0 |
628 |
if( pOrderBy->nExpr>db->aLimit[SQLITE_LIMIT_COLUMN] ){
|
105663
|
678 |
628 |
for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){
|
105664
|
157 |
521 |
if( pItem->u.x.iOrderByCol ){
|
105665
|
0 |
157 |
if( pItem->u.x.iOrderByCol>pEList->nExpr ){
|
105681
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){
|
105693
|
0 |
82 |
if( pSelect->pWin ){
|
105738
|
678 |
628 |
for(i=0, pItem=pOrderBy->a; i<pOrderBy->nExpr; i++, pItem++){
|
105741
|
0 |
678 |
if( NEVER(pE2==0) ) continue;
|
105742
|
658 |
20 |
if( zType[0]!='G' ){
|
105744
|
75 |
583 |
if( iCol>0 ){
|
105753
|
0 |
603 |
if( sqlite3ExprIsInteger(pE2, &iCol) ){
|
105757
|
0 |
0 |
if( iCol<1 || iCol>0xffff ){
|
|
0 |
0 |
if( iCol<1 || iCol>0xffff ){
|
105767
|
0 |
603 |
if( sqlite3ResolveExprNames(pNC, pE) ){
|
105770
|
2682 |
603 |
for(j=0; j<pSelect->pEList->nExpr; j++){
|
105771
|
82 |
2600 |
if( sqlite3ExprCompare(0, pE, pSelect->pEList->a[j].pExpr, -1)==0 ){
|
105799
|
21 |
1873 |
if( p->selFlags & SF_Resolved ){
|
105814
|
0 |
1873 |
if( (p->selFlags & SF_Expanded)==0 ){
|
105816
|
0 |
0 |
return pParse->nErr ? WRC_Abort : WRC_Prune;
|
105822
|
1958 |
1867 |
while( p ){
|
105835
|
0 |
1958 |
if( sqlite3ResolveExprNames(&sNC, p->pLimit) ){
|
105845
|
0 |
1958 |
if( p->selFlags & SF_Converted ){
|
105855
|
1439 |
1958 |
for(i=0; i<p->pSrc->nSrc; i++){
|
105857
|
35 |
1404 |
if( pItem->pSelect && (pItem->pSelect->selFlags & SF_Resolved)==0 ){
|
|
35 |
0 |
if( pItem->pSelect && (pItem->pSelect->selFlags & SF_Resolved)==0 ){
|
105858
|
0 |
35 |
int nRef = pOuterNC ? pOuterNC->nRef : 0;
|
105861
|
0 |
35 |
if( pItem->zName ) pParse->zAuthContext = pItem->zName;
|
105864
|
0 |
35 |
if( pParse->nErr ) return WRC_Abort;
|
105873
|
0 |
35 |
if( pOuterNC ){
|
105888
|
6 |
1952 |
if( sqlite3ResolveExprListNames(&sNC, p->pEList) ) return WRC_Abort;
|
105896
|
1932 |
20 |
if( pGroupBy || (sNC.ncFlags & NC_HasAgg)!=0 ){
|
|
127 |
1805 |
if( pGroupBy || (sNC.ncFlags & NC_HasAgg)!=0 ){
|
105915
|
6 |
1946 |
if( p->pHaving ){
|
105916
|
0 |
6 |
if( (p->selFlags & SF_Aggregate)==0 ){
|
105920
|
0 |
6 |
if( sqlite3ResolveExprNames(&sNC, p->pHaving) ) return WRC_Abort;
|
105922
|
0 |
1952 |
if( sqlite3ResolveExprNames(&sNC, p->pWhere) ) return WRC_Abort;
|
105925
|
1439 |
1952 |
for(i=0; i<p->pSrc->nSrc; i++){
|
105927
|
0 |
1439 |
if( pItem->fg.isTabFunc
|
105928
|
0 |
0 |
&& sqlite3ResolveExprListNames(&sNC, pItem->u1.pFuncArg)
|
105935
|
0 |
1952 |
if( IN_RENAME_OBJECT ){
|
105937
|
0 |
0 |
for(pWin=p->pWinDefn; pWin; pWin=pWin->pNextWin){
|
105938
|
0 |
0 |
if( sqlite3ResolveExprListNames(&sNC, pWin->pOrderBy)
|
105939
|
0 |
0 |
|| sqlite3ResolveExprListNames(&sNC, pWin->pPartition)
|
105958
|
0 |
1952 |
if( p->selFlags & SF_Converted ){
|
105974
|
608 |
1344 |
if( p->pOrderBy!=0
|
105975
|
608 |
0 |
&& isCompound<=nCompound /* Defer right-most ORDER BY of a compound */
|
105976
|
0 |
608 |
&& resolveOrderGroupBy(&sNC, p, p->pOrderBy, "ORDER")
|
105980
|
0 |
1952 |
if( db->mallocFailed ){
|
105988
|
20 |
1932 |
if( pGroupBy ){
|
105991
|
20 |
0 |
if( resolveOrderGroupBy(&sNC, p, pGroupBy, "GROUP") || db->mallocFailed ){
|
|
0 |
20 |
if( resolveOrderGroupBy(&sNC, p, pGroupBy, "GROUP") || db->mallocFailed ){
|
105994
|
20 |
20 |
for(i=0, pItem=pGroupBy->a; i<pGroupBy->nExpr; i++, pItem++){
|
105995
|
0 |
20 |
if( ExprHasProperty(pItem->pExpr, EP_Agg) ){
|
106005
|
85 |
1867 |
if( p->pNext && p->pEList->nExpr!=p->pNext->pEList->nExpr ){
|
|
0 |
85 |
if( p->pNext && p->pEList->nExpr!=p->pNext->pEList->nExpr ){
|
106019
|
26 |
1841 |
if( isCompound && resolveCompoundOrderBy(pParse, pLeftmost) ){
|
|
0 |
26 |
if( isCompound && resolveCompoundOrderBy(pParse, pLeftmost) ){
|
106081
|
3032 |
3301 |
if( pExpr==0 ) return SQLITE_OK;
|
106086
|
3301 |
0 |
w.xSelectCallback = (pNC->ncFlags & NC_NoSelect) ? 0 : resolveSelectStep;
|
106091
|
0 |
3301 |
if( sqlite3ExprCheckHeight(w.pParse, w.pParse->nHeight) ){
|
106105
|
3301 |
0 |
return pNC->nNcErr>0 || w.pParse->nErr>0;
|
|
0 |
3301 |
return pNC->nNcErr>0 || w.pParse->nErr>0;
|
106120
|
0 |
4657 |
if( pList==0 ) return WRC_Continue;
|
106128
|
7896 |
4647 |
for(i=0; i<pList->nExpr; i++){
|
106130
|
0 |
7896 |
if( pExpr==0 ) continue;
|
106133
|
0 |
7896 |
if( sqlite3ExprCheckHeight(w.pParse, w.pParse->nHeight) ){
|
106145
|
141 |
7755 |
if( pNC->ncFlags & (NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg) ){
|
106151
|
10 |
7886 |
if( w.pParse->nErr>0 ) return WRC_Abort;
|
106219
|
138 |
0 |
if( pTab ){
|
106224
|
136 |
2 |
if( pTab->pSchema!=pParse->db->aDb[1].pSchema ){
|
106233
|
0 |
138 |
if( (rc = sqlite3ResolveExprNames(&sNC, pExpr))!=SQLITE_OK ) return rc;
|
106234
|
6 |
132 |
if( pList ) rc = sqlite3ResolveExprListNames(&sNC, pList);
|
106264
|
1941 |
10 |
if( iCol<0 || NEVER(iCol>=pTab->nCol) ) return SQLITE_AFF_INTEGER;
|
|
0 |
1941 |
if( iCol<0 || NEVER(iCol>=pTab->nCol) ) return SQLITE_AFF_INTEGER;
|
106288
|
1824 |
1951 |
if( op==TK_COLUMN || (op==TK_AGG_COLUMN && pExpr->y.pTab!=0) ){
|
|
0 |
1824 |
if( op==TK_COLUMN || (op==TK_AGG_COLUMN && pExpr->y.pTab!=0) ){
|
|
0 |
0 |
if( op==TK_COLUMN || (op==TK_AGG_COLUMN && pExpr->y.pTab!=0) ){
|
106293
|
2 |
1822 |
if( op==TK_SELECT ){
|
106301
|
2 |
1820 |
if( op==TK_CAST ){
|
106306
|
0 |
1820 |
if( op==TK_SELECT_COLUMN ){
|
106314
|
0 |
1820 |
if( op==TK_VECTOR ){
|
106318
|
5 |
1815 |
if( ExprHasProperty(pExpr, EP_Skip|EP_IfNullRow) ){
|
106326
|
10 |
1805 |
if( op!=TK_REGISTER || (op = pExpr->op2)==TK_REGISTER ) break;
|
|
10 |
0 |
if( op!=TK_REGISTER || (op = pExpr->op2)==TK_REGISTER ) break;
|
106342
|
119 |
26 |
while( pExpr ){
|
106375
|
0 |
53 |
if( aff>=SQLITE_AFF_NUMERIC ) return 0x05;
|
106376
|
53 |
0 |
if( aff==SQLITE_AFF_TEXT ) return 0x06;
|
106385
|
0 |
0 |
for(ii=1; ii<pList->nExpr; ii+=2){
|
106388
|
0 |
0 |
if( pList->nExpr % 2 ){
|
106415
|
356 |
0 |
if( pCollName->n>0 ){
|
106417
|
356 |
0 |
if( pNew ){
|
106440
|
3507 |
41 |
while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){
|
|
341 |
3166 |
while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){
|
106453
|
10448 |
932 |
while( pExpr && ExprHasProperty(pExpr, EP_Skip|EP_Unlikely) ){
|
|
133 |
10315 |
while( pExpr && ExprHasProperty(pExpr, EP_Skip|EP_Unlikely) ){
|
106454
|
0 |
133 |
if( ExprHasProperty(pExpr, EP_Unlikely) ){
|
106485
|
2712 |
0 |
while( p ){
|
106487
|
0 |
2712 |
if( op==TK_REGISTER ) op = p->op2;
|
106488
|
16 |
2696 |
if( (op==TK_AGG_COLUMN && p->y.pTab!=0)
|
|
0 |
16 |
if( (op==TK_AGG_COLUMN && p->y.pTab!=0)
|
106489
|
251 |
2445 |
|| op==TK_COLUMN || op==TK_TRIGGER
|
|
0 |
251 |
|| op==TK_COLUMN || op==TK_TRIGGER
|
106494
|
1923 |
538 |
if( (j = p->iColumn)>=0 ){
|
106500
|
249 |
2 |
if( op==TK_CAST || op==TK_UPLUS ){
|
|
0 |
249 |
if( op==TK_CAST || op==TK_UPLUS ){
|
106504
|
0 |
249 |
if( op==TK_VECTOR ){
|
106509
|
21 |
228 |
if( op==TK_COLLATE ){
|
106514
|
0 |
228 |
if( p->flags & EP_Collate ){
|
106515
|
0 |
0 |
if( p->pLeft && (p->pLeft->flags & EP_Collate)!=0 ){
|
|
0 |
0 |
if( p->pLeft && (p->pLeft->flags & EP_Collate)!=0 ){
|
106521
|
0 |
0 |
if( ExprUseXList(p) && p->x.pList!=0 && !db->mallocFailed ){
|
|
0 |
0 |
if( ExprUseXList(p) && p->x.pList!=0 && !db->mallocFailed ){
|
|
0 |
0 |
if( ExprUseXList(p) && p->x.pList!=0 && !db->mallocFailed ){
|
106523
|
0 |
0 |
for(i=0; i<p->x.pList->nExpr; i++){
|
106524
|
0 |
0 |
if( ExprHasProperty(p->x.pList->a[i].pExpr, EP_Collate) ){
|
106536
|
0 |
2710 |
if( sqlite3CheckCollSeq(pParse, pColl) ){
|
106554
|
503 |
290 |
if( p==0 ) p = pParse->db->pDfltColl;
|
106575
|
765 |
683 |
if( aff1>SQLITE_AFF_NONE && aff2>SQLITE_AFF_NONE ){
|
|
34 |
731 |
if( aff1>SQLITE_AFF_NONE && aff2>SQLITE_AFF_NONE ){
|
106579
|
15 |
19 |
if( sqlite3IsNumericAffinity(aff1) || sqlite3IsNumericAffinity(aff2) ){
|
|
0 |
15 |
if( sqlite3IsNumericAffinity(aff1) || sqlite3IsNumericAffinity(aff2) ){
|
106587
|
683 |
731 |
return (aff1<=SQLITE_AFF_NONE ? aff2 : aff1) | SQLITE_AFF_NONE;
|
106602
|
617 |
0 |
if( pExpr->pRight ){
|
106604
|
0 |
0 |
}else if( ExprUseXSelect(pExpr) ){
|
106606
|
0 |
0 |
}else if( aff==0 ){
|
106620
|
37 |
580 |
if( aff<SQLITE_AFF_TEXT ){
|
106623
|
399 |
181 |
if( aff==SQLITE_AFF_TEXT ){
|
106662
|
0 |
1235 |
if( pLeft->flags & EP_Collate ){
|
106664
|
1235 |
0 |
}else if( pRight && (pRight->flags & EP_Collate)!=0 ){
|
|
0 |
1235 |
}else if( pRight && (pRight->flags & EP_Collate)!=0 ){
|
106668
|
32 |
1203 |
if( !pColl ){
|
106684
|
0 |
433 |
if( ExprHasProperty(p, EP_Commuted) ){
|
106708
|
0 |
761 |
if( pParse->nErr ) return 0;
|
106709
|
0 |
761 |
if( isCommuted ){
|
106742
|
269 |
5071 |
if( op==TK_REGISTER ) op = pExpr->op2;
|
106743
|
0 |
5340 |
if( op==TK_VECTOR ){
|
106746
|
2 |
5338 |
}else if( op==TK_SELECT ){
|
106771
|
0 |
60 |
if( sqlite3ExprIsVector(pVector) ){
|
106773
|
0 |
0 |
if( pVector->op==TK_SELECT || pVector->op2==TK_SELECT ){
|
|
0 |
0 |
if( pVector->op==TK_SELECT || pVector->op2==TK_SELECT ){
|
106812
|
0 |
0 |
if( pVector->op==TK_SELECT ){
|
106831
|
0 |
0 |
if( pRet ){
|
106837
|
0 |
0 |
if( pVector->op==TK_VECTOR ){
|
106842
|
0 |
0 |
if( IN_RENAME_OBJECT ){
|
106864
|
0 |
0 |
if( pExpr->op==TK_SELECT ){
|
106899
|
0 |
0 |
if( op==TK_REGISTER ){
|
106903
|
0 |
0 |
if( op==TK_SELECT ){
|
106908
|
0 |
0 |
if( op==TK_VECTOR ){
|
106947
|
0 |
0 |
if( pParse->nErr ) return;
|
106948
|
0 |
0 |
if( nLeft!=sqlite3ExprVectorSize(pRight) ){
|
106962
|
0 |
0 |
if( op==TK_LE ) opx = TK_LT;
|
106963
|
0 |
0 |
if( op==TK_GE ) opx = TK_GT;
|
106964
|
0 |
0 |
if( op==TK_NE ) opx = TK_EQ;
|
106975
|
0 |
0 |
if( addrCmp ) sqlite3VdbeJumpHere(v, addrCmp);
|
106988
|
0 |
0 |
if( (opx==TK_LT || opx==TK_GT) && i<nLeft-1 ){
|
|
0 |
0 |
if( (opx==TK_LT || opx==TK_GT) && i<nLeft-1 ){
|
|
0 |
0 |
if( (opx==TK_LT || opx==TK_GT) && i<nLeft-1 ){
|
106993
|
0 |
0 |
if( p5==SQLITE_NULLEQ ){
|
106998
|
0 |
0 |
if( i==nLeft-1 ){
|
107001
|
0 |
0 |
if( opx==TK_EQ ){
|
107006
|
0 |
0 |
if( i==nLeft-2 ) opx = op;
|
107011
|
0 |
0 |
if( op==TK_NE ){
|
107025
|
0 |
14973 |
if( nHeight>mxHeight ){
|
107044
|
1652 |
146 |
if( p ){
|
107045
|
806 |
846 |
if( p->nHeight>*pnHeight ){
|
107051
|
862 |
88 |
if( p ){
|
107053
|
1603 |
862 |
for(i=0; i<p->nExpr; i++){
|
107060
|
65 |
65 |
for(p=pSelect; p; p=p->pPrior){
|
107081
|
19 |
860 |
int nHeight = p->pLeft ? p->pLeft->nHeight : 0;
|
107082
|
0 |
879 |
if( NEVER(p->pRight) && p->pRight->nHeight>nHeight ){
|
|
0 |
0 |
if( NEVER(p->pRight) && p->pRight->nHeight>nHeight ){
|
107085
|
21 |
858 |
if( ExprUseXSelect(p) ){
|
107087
|
755 |
103 |
}else if( p->x.pList ){
|
107103
|
0 |
879 |
if( pParse->nErr ) return;
|
107162
|
5281 |
14 |
if( pToken ){
|
107163
|
579 |
4702 |
if( op!=TK_INTEGER || pToken->z==0
|
|
579 |
0 |
if( op!=TK_INTEGER || pToken->z==0
|
107164
|
12 |
567 |
|| sqlite3GetInt32(pToken->z, &iValue)==0 ){
|
107170
|
5295 |
0 |
if( pNew ){
|
107174
|
5281 |
14 |
if( pToken ){
|
107175
|
567 |
4714 |
if( nExtra==0 ){
|
107176
|
529 |
38 |
pNew->flags |= EP_IntValue|EP_Leaf|(iValue?EP_IsTrue:EP_IsFalse);
|
107181
|
4124 |
590 |
if( pToken->n ) memcpy(pNew->u.zToken, pToken->z, pToken->n);
|
107183
|
897 |
3817 |
if( dequote && sqlite3Isquote(pNew->u.zToken[0]) ){
|
|
0 |
897 |
if( dequote && sqlite3Isquote(pNew->u.zToken[0]) ){
|
107222
|
0 |
2900 |
if( pRoot==0 ){
|
107229
|
2254 |
646 |
if( pRight ){
|
107238
|
2241 |
659 |
if( pLeft ){
|
107242
|
153 |
2088 |
if( pLeft->nHeight>=pRoot->nHeight ){
|
107265
|
2897 |
0 |
if( p ){
|
107283
|
21 |
0 |
if( pExpr ){
|
107316
|
0 |
0 |
for(ii=0; ii<pEList->nExpr; ii++){
|
107320
|
0 |
0 |
if( pExpr->op==TK_VECTOR ){
|
107326
|
0 |
0 |
if( nExprElem!=nElem ){
|
107327
|
0 |
0 |
sqlite3ErrorMsg(pParse, "IN(...) element has %d term%s - expected %d",
|
107335
|
0 |
0 |
if( pSel ){
|
107336
|
0 |
0 |
if( pRet ){
|
107344
|
0 |
0 |
if( pRet && pRet->pPrior ){
|
|
0 |
0 |
if( pRet && pRet->pPrior ){
|
107361
|
75 |
361 |
if( pLeft==0 ){
|
107363
|
0 |
361 |
}else if( pRight==0 ){
|
107367
|
0 |
361 |
if( (f&(EP_OuterON|EP_InnerON|EP_IsFalse))==EP_IsFalse
|
107368
|
0 |
0 |
&& !IN_RENAME_OBJECT
|
107393
|
0 |
842 |
if( pNew==0 ){
|
107399
|
739 |
103 |
if( pList
|
107400
|
0 |
739 |
&& pList->nExpr > pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG]
|
107401
|
0 |
0 |
&& !pParse->nested
|
107409
|
0 |
842 |
if( eDistinct==SF_Distinct ) ExprSetProperty(pNew, EP_Distinct);
|
107431
|
0 |
1155 |
if( ExprHasProperty(pExpr, EP_FromDDL) ){
|
107432
|
0 |
0 |
if( (pDef->funcFlags & SQLITE_FUNC_DIRECT)!=0
|
107433
|
0 |
0 |
|| (pParse->db->flags & SQLITE_TrustedSchema)==0
|
107468
|
0 |
1398 |
if( pExpr==0 ) return;
|
107474
|
1367 |
31 |
if( z[1]==0 ){
|
107480
|
13 |
18 |
if( z[0]=='?' ){
|
107485
|
13 |
0 |
if( n==2 ){ /*OPTIMIZATION-IF-TRUE*/
|
107495
|
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] ){
|
107502
|
13 |
0 |
if( x>pParse->nVar ){
|
107505
|
0 |
0 |
}else if( sqlite3VListNumToName(pParse->pVList, x)==0 ){
|
107514
|
17 |
1 |
if( x==0 ){
|
107519
|
30 |
1 |
if( doAdd ){
|
107524
|
2 |
1396 |
if( x>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){
|
107548
|
5322 |
15970 |
if( !ExprHasProperty(p, (EP_TokenOnly|EP_Leaf)) ){
|
107551
|
2746 |
2576 |
if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft);
|
|
2746 |
0 |
if( p->pLeft && p->op!=TK_SELECT_COLUMN ) sqlite3ExprDeleteNN(db, p->pLeft);
|
107552
|
2178 |
3144 |
if( p->pRight ){
|
107555
|
21 |
3123 |
}else if( ExprUseXSelect(p) ){
|
107561
|
0 |
3123 |
if( ExprHasProperty(p, EP_WinFunc) ){
|
107567
|
21288 |
4 |
if( !ExprHasProperty(p, EP_Static) ){
|
107572
|
16368 |
18826 |
if( p ) sqlite3ExprDeleteNN(db, p);
|
107579
|
0 |
0 |
if( p==0 ){
|
107581
|
0 |
0 |
}else if( p->pOn ){
|
107583
|
0 |
0 |
}else if( p->pUsing ){
|
107608
|
0 |
0 |
if( p ){
|
107609
|
0 |
0 |
if( IN_RENAME_OBJECT ){
|
107622
|
0 |
3396 |
if( ExprHasProperty(p, EP_TokenOnly) ) return EXPR_TOKENONLYSIZE;
|
107623
|
0 |
3396 |
if( ExprHasProperty(p, EP_Reduced) ) return EXPR_REDUCEDSIZE;
|
107666
|
24 |
6792 |
if( 0==flags || p->op==TK_SELECT_COLUMN
|
|
24 |
0 |
if( 0==flags || p->op==TK_SELECT_COLUMN
|
107668
|
0 |
24 |
|| ExprHasProperty(p, EP_WinFunc)
|
107676
|
12 |
12 |
if( p->pLeft || p->x.pList ){
|
|
0 |
12 |
if( p->pLeft || p->x.pList ){
|
107693
|
3315 |
97 |
if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){
|
|
3193 |
122 |
if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){
|
107714
|
3404 |
12 |
if( p ){
|
107716
|
8 |
3396 |
if( flags&EXPRDUP_REDUCE ){
|
107742
|
4 |
3400 |
if( pzBuffer ){
|
107752
|
3404 |
0 |
if( pNew ){
|
107761
|
3309 |
95 |
if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){
|
|
3187 |
122 |
if( !ExprHasProperty(p, EP_IntValue) && p->u.zToken ){
|
107766
|
8 |
3396 |
if( dupFlags ){
|
107772
|
0 |
3396 |
if( nSize<EXPR_FULLSIZE ){
|
107787
|
3187 |
217 |
if( nToken ){
|
107792
|
578 |
2826 |
if( 0==((p->flags|pNew->flags) & (EP_TokenOnly|EP_Leaf)) ){
|
107794
|
0 |
578 |
if( ExprUseXSelect(p) ){
|
107802
|
8 |
3396 |
if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly|EP_WinFunc) ){
|
107804
|
4 |
4 |
if( !ExprHasProperty(pNew, EP_TokenOnly|EP_Leaf) ){
|
107806
|
4 |
0 |
exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc) : 0;
|
107808
|
0 |
4 |
exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc) : 0;
|
107811
|
0 |
8 |
if( ExprHasProperty(p, EP_WinFunc) ){
|
107816
|
4 |
4 |
if( pzBuffer ){
|
107820
|
574 |
2822 |
if( !ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){
|
107821
|
0 |
574 |
if( pNew->op==TK_SELECT_COLUMN ){
|
107843
|
0 |
3 |
if( p ){
|
107846
|
0 |
0 |
if( pRet ){
|
107849
|
0 |
0 |
for(i=0; i<p->nCte; i++){
|
107871
|
0 |
0 |
if( pExpr->op==TK_FUNCTION && ExprHasProperty(pExpr, EP_WinFunc) ){
|
|
0 |
0 |
if( pExpr->op==TK_FUNCTION && ExprHasProperty(pExpr, EP_WinFunc) ){
|
107915
|
3400 |
946 |
return p ? exprDup(db, p, flags, 0) : 0;
|
107925
|
377 |
226 |
if( p==0 ) return 0;
|
107927
|
0 |
226 |
if( pNew==0 ) return 0;
|
107932
|
395 |
226 |
for(i=0; i<p->nExpr; i++, pItem++, pOldItem++){
|
107936
|
395 |
0 |
if( pOldExpr
|
107937
|
0 |
395 |
&& pOldExpr->op==TK_SELECT_COLUMN
|
107938
|
0 |
0 |
&& (pNewExpr = pItem->pExpr)!=0
|
107940
|
0 |
0 |
if( pNewExpr->pRight ){
|
107945
|
0 |
0 |
if( pOldExpr->pLeft!=pPriorSelectColOld ){
|
107974
|
0 |
3 |
if( p==0 ) return 0;
|
107975
|
3 |
0 |
nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0);
|
107977
|
0 |
3 |
if( pNew==0 ) return 0;
|
107979
|
3 |
3 |
for(i=0; i<p->nSrc; i++){
|
107991
|
0 |
3 |
if( pNewItem->fg.isIndexedBy ){
|
107995
|
0 |
3 |
if( pNewItem->fg.isCte ){
|
107998
|
0 |
3 |
if( pNewItem->fg.isTabFunc ){
|
108003
|
3 |
0 |
if( pTab ){
|
108007
|
0 |
3 |
if( pOldItem->fg.isUsing ){
|
108021
|
0 |
0 |
if( p==0 ) return 0;
|
108024
|
0 |
0 |
if( pNew==0 ) return 0;
|
108027
|
0 |
0 |
for(i=0; i<p->nId; i++){
|
108042
|
3 |
6 |
for(p=pDup; p; p=p->pPrior){
|
108044
|
0 |
3 |
if( pNew==0 ) break;
|
108065
|
0 |
3 |
if( p->pWin && db->mallocFailed==0 ) gatherSelectWindows(pNew);
|
|
0 |
0 |
if( p->pWin && db->mallocFailed==0 ) gatherSelectWindows(pNew);
|
108068
|
0 |
3 |
if( db->mallocFailed ){
|
108115
|
0 |
7972 |
if( pList==0 ){
|
108136
|
0 |
875 |
if( pNew==0 ){
|
108154
|
7972 |
5644 |
if( pList==0 ){
|
108157
|
875 |
4769 |
if( pList->nAlloc<pList->nExpr+1 ){
|
108186
|
0 |
0 |
int iFirst = pList ? pList->nExpr : 0;
|
108189
|
0 |
0 |
if( NEVER(pColumns==0) ) goto vector_append_error;
|
108190
|
0 |
0 |
if( pExpr==0 ) goto vector_append_error;
|
108197
|
0 |
0 |
if( pExpr->op!=TK_SELECT && pColumns->nId!=(n=sqlite3ExprVectorSize(pExpr)) ){
|
|
0 |
0 |
if( pExpr->op!=TK_SELECT && pColumns->nId!=(n=sqlite3ExprVectorSize(pExpr)) ){
|
108203
|
0 |
0 |
for(i=0; i<pColumns->nId; i++){
|
108206
|
0 |
0 |
if( pSubExpr==0 ) continue;
|
108208
|
0 |
0 |
if( pList ){
|
108215
|
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) ){
|
108241
|
0 |
796 |
if( p==0 ) return;
|
108256
|
746 |
50 |
if( iSortOrder==SQLITE_SO_UNDEFINED ){
|
108261
|
0 |
796 |
if( eNulls!=SQLITE_SO_UNDEFINED ){
|
108263
|
0 |
0 |
if( iSortOrder!=eNulls ){
|
108285
|
1681 |
0 |
if( pList ){
|
108292
|
1681 |
0 |
if( dequote ){
|
108297
|
0 |
1681 |
if( IN_RENAME_OBJECT ){
|
108320
|
1943 |
0 |
if( pList ){
|
108323
|
1627 |
316 |
if( pItem->zEName==0 ){
|
108342
|
332 |
0 |
if( pEList && pEList->nExpr>mx ){
|
|
0 |
332 |
if( pEList && pEList->nExpr>mx ){
|
108357
|
6079 |
7932 |
if( pItem->zEName ) sqlite3DbNNFreeNN(db, pItem->zEName);
|
108359
|
5813 |
8198 |
}while( --i>0 );
|
108363
|
8198 |
17845 |
if( pList ) exprListDeleteNN(db, pList);
|
108374
|
1270 |
755 |
for(i=0; i<pList->nExpr; i++){
|
108404
|
0 |
146 |
if( sqlite3StrICmp(zIn, "true")==0 ) return EP_IsTrue;
|
108405
|
0 |
146 |
if( sqlite3StrICmp(zIn, "false")==0 ) return EP_IsFalse;
|
108418
|
0 |
4 |
if( !ExprHasProperty(pExpr, EP_Quoted|EP_IntValue)
|
108419
|
0 |
0 |
&& (v = sqlite3IsTrueOrFalse(pExpr->u.zToken))!=0
|
108456
|
36 |
16 |
if( pExpr->op==TK_AND || pExpr->op==TK_OR ){
|
|
6 |
30 |
if( pExpr->op==TK_AND || pExpr->op==TK_OR ){
|
108459
|
22 |
0 |
if( ExprAlwaysTrue(pLeft) || ExprAlwaysFalse(pRight) ){
|
|
0 |
22 |
if( ExprAlwaysTrue(pLeft) || ExprAlwaysFalse(pRight) ){
|
108460
|
0 |
0 |
pExpr = pExpr->op==TK_AND ? pRight : pLeft;
|
108461
|
22 |
0 |
}else if( ExprAlwaysTrue(pRight) || ExprAlwaysFalse(pLeft) ){
|
|
0 |
22 |
}else if( ExprAlwaysTrue(pRight) || ExprAlwaysFalse(pLeft) ){
|
108462
|
0 |
0 |
pExpr = pExpr->op==TK_AND ? pLeft : pRight;
|
108500
|
4032 |
1764 |
if( pWalker->eCode==2 && ExprHasProperty(pExpr, EP_OuterON) ){
|
|
12 |
4020 |
if( pWalker->eCode==2 && ExprHasProperty(pExpr, EP_OuterON) ){
|
108510
|
871 |
0 |
if( (pWalker->eCode>=4 || ExprHasProperty(pExpr,EP_ConstFunc))
|
|
360 |
511 |
if( (pWalker->eCode>=4 || ExprHasProperty(pExpr,EP_ConstFunc))
|
108511
|
360 |
0 |
&& !ExprHasProperty(pExpr, EP_WinFunc)
|
108513
|
0 |
360 |
if( pWalker->eCode==5 ) ExprSetProperty(pExpr, EP_FromDDL);
|
108522
|
0 |
0 |
if( sqlite3ExprIdToTrueFalse(pExpr) ){
|
108533
|
0 |
1428 |
if( ExprHasProperty(pExpr, EP_FixedCol) && pWalker->eCode!=2 ){
|
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_FixedCol) && pWalker->eCode!=2 ){
|
108536
|
23 |
1405 |
if( pWalker->eCode==3 && pExpr->iTable==pWalker->u.iCur ){
|
|
22 |
1 |
if( pWalker->eCode==3 && pExpr->iTable==pWalker->u.iCur ){
|
108549
|
0 |
1385 |
if( pWalker->eCode==5 ){
|
108554
|
0 |
1385 |
}else if( pWalker->eCode==4 ){
|
108666
|
0 |
23 |
if( pSrc->fg.jointype & JT_LTORJ ){
|
108669
|
0 |
23 |
if( pSrc->fg.jointype & JT_LEFT ){
|
108670
|
0 |
0 |
if( !ExprHasProperty(pExpr, EP_OuterON) ) return 0; /* rule (4a) */
|
108671
|
0 |
0 |
if( pExpr->w.iJoin!=pSrc->iCursor ) return 0; /* rule (4b) */
|
108673
|
0 |
23 |
if( ExprHasProperty(pExpr, EP_OuterON) ) return 0; /* rule (5) */
|
108675
|
0 |
23 |
if( ExprHasProperty(pExpr, EP_OuterON|EP_InnerON) /* (6a) */
|
108676
|
0 |
0 |
&& (pSrcList->a[0].fg.jointype & JT_LTORJ)!=0 /* Fast pre-test of (6b) */
|
108679
|
0 |
0 |
for(jj=0; jj<iSrc; jj++){
|
108680
|
0 |
0 |
if( pExpr->w.iJoin==pSrcList->a[jj].iCursor ){
|
108681
|
0 |
0 |
if( (pSrcList->a[jj].fg.jointype & JT_LTORJ)!=0 ){
|
108701
|
12 |
12 |
for(i=0; i<pGroupBy->nExpr; i++){
|
108703
|
0 |
12 |
if( sqlite3ExprCompare(0, pExpr, p, -1)<2 ){
|
108705
|
0 |
0 |
if( sqlite3IsBinary(pColl) ){
|
108712
|
0 |
12 |
if( ExprUseXSelect(pExpr) ){
|
108802
|
0 |
1152 |
if( NEVER(p==0) ) return 0; /* Used to only happen following on OOM */
|
108809
|
61 |
1091 |
if( p->flags & EP_IntValue ){
|
108820
|
0 |
0 |
if( sqlite3ExprIsInteger(p->pLeft, &v) ){
|
108849
|
0 |
116 |
while( p->op==TK_UPLUS || p->op==TK_UMINUS ){
|
|
0 |
116 |
while( p->op==TK_UPLUS || p->op==TK_UMINUS ){
|
108854
|
0 |
116 |
if( op==TK_REGISTER ) op = p->op2;
|
108863
|
52 |
0 |
return ExprHasProperty(p, EP_CanBeNull) ||
|
108864
|
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 */
|
108866
|
50 |
0 |
&& p->y.pTab->aCol!=0 /* Possible due to prior error */
|
108867
|
50 |
0 |
&& p->y.pTab->aCol[p->iColumn].notNull==0);
|
108886
|
5 |
62 |
if( aff==SQLITE_AFF_BLOB ) return 1;
|
108887
|
0 |
62 |
while( p->op==TK_UPLUS || p->op==TK_UMINUS ){
|
|
0 |
62 |
while( p->op==TK_UPLUS || p->op==TK_UMINUS ){
|
108888
|
0 |
0 |
if( p->op==TK_UMINUS ) unaryMinus = 1;
|
108892
|
0 |
62 |
if( op==TK_REGISTER ) op = p->op2;
|
108901
|
0 |
0 |
return !unaryMinus && aff==SQLITE_AFF_TEXT;
|
|
0 |
0 |
return !unaryMinus && aff==SQLITE_AFF_TEXT;
|
108908
|
4 |
0 |
return aff>=SQLITE_AFF_NUMERIC && p->iColumn<0;
|
|
2 |
2 |
return aff>=SQLITE_AFF_NUMERIC && p->iColumn<0;
|
108920
|
0 |
892 |
if( sqlite3StrICmp(z, "_ROWID_")==0 ) return 1;
|
108921
|
883 |
9 |
if( sqlite3StrICmp(z, "ROWID")==0 ) return 1;
|
108922
|
0 |
9 |
if( sqlite3StrICmp(z, "OID")==0 ) return 1;
|
108940
|
16 |
3 |
if( !ExprUseXSelect(pX) ) return 0; /* Not a subquery */
|
108941
|
0 |
3 |
if( ExprHasProperty(pX, EP_VarSelect) ) return 0; /* Correlated subq */
|
108943
|
0 |
3 |
if( p->pPrior ) return 0; /* Not a compound SELECT */
|
108944
|
0 |
3 |
if( p->selFlags & (SF_Distinct|SF_Aggregate) ){
|
108950
|
0 |
3 |
if( p->pLimit ) return 0; /* Has no LIMIT clause */
|
108951
|
1 |
2 |
if( p->pWhere ) return 0; /* Has no WHERE clause */
|
108954
|
0 |
2 |
if( pSrc->nSrc!=1 ) return 0; /* Single term in FROM clause */
|
108955
|
0 |
2 |
if( pSrc->a[0].pSelect ) return 0; /* FROM is not a subquery or view */
|
108959
|
2 |
0 |
if( IsVirtual(pTab) ) return 0; /* FROM clause not a virtual table */
|
108963
|
0 |
0 |
for(i=0; i<pEList->nExpr; i++){
|
108965
|
0 |
0 |
if( pRes->op!=TK_COLUMN ) return 0;
|
109115
|
0 |
19 |
if( prRhsHasNull && ExprUseXSelect(pX) ){
|
|
0 |
0 |
if( prRhsHasNull && ExprUseXSelect(pX) ){
|
109118
|
0 |
0 |
for(i=0; i<pEList->nExpr; i++){
|
109119
|
0 |
0 |
if( sqlite3ExprCanBeNull(pEList->a[i].pExpr) ) break;
|
109121
|
0 |
0 |
if( i==pEList->nExpr ){
|
109129
|
19 |
0 |
if( pParse->nErr==0 && (p = isCandidateForInOpt(pX))!=0 ){
|
|
0 |
19 |
if( pParse->nErr==0 && (p = isCandidateForInOpt(pX))!=0 ){
|
109148
|
0 |
0 |
if( nExpr==1 && pEList->a[0].pExpr->iColumn<0 ){
|
|
0 |
0 |
if( nExpr==1 && pEList->a[0].pExpr->iColumn<0 ){
|
109167
|
0 |
0 |
for(i=0; i<nExpr && affinity_ok; i++){
|
|
0 |
0 |
for(i=0; i<nExpr && affinity_ok; i++){
|
109189
|
0 |
0 |
if( affinity_ok ){
|
109191
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx && eType==0; pIdx=pIdx->pNext){
|
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx && eType==0; pIdx=pIdx->pNext){
|
109194
|
0 |
0 |
if( pIdx->nColumn<nExpr ) continue;
|
109195
|
0 |
0 |
if( pIdx->pPartIdxWhere!=0 ) continue;
|
109200
|
0 |
0 |
if( pIdx->nColumn>=BMS-1 ) continue;
|
109201
|
0 |
0 |
if( mustBeUnique ){
|
109202
|
0 |
0 |
if( pIdx->nKeyCol>nExpr
|
109203
|
0 |
0 |
||(pIdx->nColumn>nExpr && !IsUniqueIndex(pIdx))
|
|
0 |
0 |
||(pIdx->nColumn>nExpr && !IsUniqueIndex(pIdx))
|
109210
|
0 |
0 |
for(i=0; i<nExpr; i++){
|
109216
|
0 |
0 |
for(j=0; j<nExpr; j++){
|
109217
|
0 |
0 |
if( pIdx->aiColumn[j]!=pRhs->iColumn ) continue;
|
109219
|
0 |
0 |
if( pReq!=0 && sqlite3StrICmp(pReq->zName, pIdx->azColl[j])!=0 ){
|
|
0 |
0 |
if( pReq!=0 && sqlite3StrICmp(pReq->zName, pIdx->azColl[j])!=0 ){
|
109224
|
0 |
0 |
if( j==nExpr ) break;
|
109226
|
0 |
0 |
if( mCol & colUsed ) break; /* Each column used only once */
|
109228
|
0 |
0 |
if( aiMap ) aiMap[i] = j;
|
109232
|
0 |
0 |
if( colUsed==(MASKBIT(nExpr)-1) ){
|
109243
|
0 |
0 |
if( prRhsHasNull ){
|
109250
|
0 |
0 |
if( nExpr==1 ){
|
109268
|
19 |
0 |
if( eType==0
|
109269
|
16 |
3 |
&& (inFlags & IN_INDEX_NOOP_OK)
|
109270
|
16 |
0 |
&& ExprUseXList(pX)
|
109271
|
16 |
0 |
&& (!sqlite3InRhsIsConstant(pX) || pX->x.pList->nExpr<=2)
|
|
16 |
0 |
&& (!sqlite3InRhsIsConstant(pX) || pX->x.pList->nExpr<=2)
|
109278
|
3 |
16 |
if( eType==0 ){
|
109285
|
3 |
0 |
if( inFlags & IN_INDEX_LOOP ){
|
109287
|
0 |
0 |
}else if( prRhsHasNull ){
|
109292
|
0 |
3 |
if( rMayHaveNull ){
|
109298
|
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 ){
|
109301
|
16 |
16 |
for(i=0; i<n; i++) aiMap[i] = i;
|
109320
|
3 |
16 |
Select *pSelect = ExprUseXSelect(pExpr) ? pExpr->x.pSelect : 0;
|
109325
|
19 |
0 |
if( zRet ){
|
109327
|
19 |
19 |
for(i=0; i<nVal; i++){
|
109330
|
3 |
16 |
if( pSelect ){
|
109350
|
0 |
0 |
if( pParse->nErr==0 ){
|
109370
|
0 |
0 |
if( ExprUseXSelect(pExpr) ){
|
109427
|
3 |
0 |
if( !ExprHasProperty(pExpr, EP_VarSelect) && pParse->iSelfTab==0 ){
|
|
3 |
0 |
if( !ExprHasProperty(pExpr, EP_VarSelect) && pParse->iSelfTab==0 ){
|
109432
|
0 |
3 |
if( ExprHasProperty(pExpr, EP_Subrtn) ){
|
109434
|
0 |
0 |
if( ExprUseXSelect(pExpr) ){
|
109476
|
3 |
0 |
if( ExprUseXSelect(pExpr) ){
|
109485
|
3 |
0 |
ExplainQueryPlan((pParse, 1, "%sLIST SUBQUERY %d",
|
109490
|
3 |
0 |
if( ALWAYS(pEList->nExpr==nVal) ){
|
109501
|
3 |
0 |
rc = pParse->db->mallocFailed ? 1 :sqlite3Select(pParse, pCopy, &dest);
|
109504
|
0 |
3 |
if( rc ){
|
109512
|
3 |
3 |
for(i=0; i<nVal; i++){
|
109519
|
0 |
0 |
}else if( ALWAYS(pExpr->x.pList!=0) ){
|
109533
|
0 |
0 |
if( affinity<=SQLITE_AFF_NONE ){
|
109535
|
0 |
0 |
}else if( affinity==SQLITE_AFF_REAL ){
|
109538
|
0 |
0 |
if( pKeyInfo ){
|
109546
|
0 |
0 |
for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){
|
109554
|
0 |
0 |
if( addrOnce && !sqlite3ExprIsConstant(pE2) ){
|
|
0 |
0 |
if( addrOnce && !sqlite3ExprIsConstant(pE2) ){
|
109569
|
3 |
0 |
if( pKeyInfo ){
|
109572
|
3 |
0 |
if( addrOnce ){
|
109615
|
0 |
18 |
if( pParse->nErr ) return 0;
|
109624
|
0 |
18 |
if( ExprHasProperty(pExpr, EP_Subrtn) ){
|
109650
|
16 |
2 |
if( !ExprHasProperty(pExpr, EP_VarSelect) ){
|
109664
|
16 |
2 |
ExplainQueryPlan2(addrExplain, (pParse, 1, "%sSCALAR SUBQUERY %d",
|
109667
|
18 |
0 |
nReg = pExpr->op==TK_SELECT ? pSel->pEList->nExpr : 1;
|
109670
|
18 |
0 |
if( pExpr->op==TK_SELECT ){
|
109681
|
0 |
18 |
if( pSel->pLimit ){
|
109686
|
0 |
0 |
if( pLimit ){
|
109699
|
0 |
18 |
if( sqlite3Select(pParse, pSel, &dest) ){
|
109706
|
16 |
2 |
if( addrOnce ){
|
109732
|
3 |
32 |
if( ExprUseXSelect(pIn) && !pParse->db->mallocFailed ){
|
|
3 |
0 |
if( ExprUseXSelect(pIn) && !pParse->db->mallocFailed ){
|
109733
|
0 |
3 |
if( nVector!=pIn->x.pSelect->pEList->nExpr ){
|
109737
|
0 |
32 |
}else if( nVector!=1 ){
|
109798
|
0 |
16 |
if( sqlite3ExprCheckIN(pParse, pExpr) ) return;
|
109804
|
0 |
16 |
if( pParse->db->mallocFailed ) goto sqlite3ExprCodeIN_oom_error;
|
109813
|
0 |
16 |
eType = sqlite3FindInIndex(pParse, pExpr,
|
109847
|
16 |
16 |
for(i=0; i<nVector && aiMap[i]==i; i++){} /* Are LHS fields reordered? */
|
|
16 |
0 |
for(i=0; i<nVector && aiMap[i]==i; i++){} /* Are LHS fields reordered? */
|
109848
|
16 |
0 |
if( i==nVector ){
|
109854
|
0 |
0 |
for(i=0; i<nVector; i++){
|
109865
|
16 |
0 |
if( eType==IN_INDEX_NOOP ){
|
109875
|
0 |
16 |
if( destIfNull!=destIfFalse ){
|
109879
|
32 |
16 |
for(ii=0; ii<pList->nExpr; ii++){
|
109881
|
0 |
32 |
if( regCkNull && sqlite3ExprCanBeNull(pList->a[ii].pExpr) ){
|
|
0 |
0 |
if( regCkNull && sqlite3ExprCanBeNull(pList->a[ii].pExpr) ){
|
109885
|
16 |
16 |
if( ii<pList->nExpr-1 || destIfNull!=destIfFalse ){
|
|
0 |
16 |
if( ii<pList->nExpr-1 || destIfNull!=destIfFalse ){
|
109886
|
16 |
0 |
int op = rLhs!=r2 ? OP_Eq : OP_NotNull;
|
109895
|
16 |
0 |
int op = rLhs!=r2 ? OP_Ne : OP_IsNull;
|
109904
|
0 |
16 |
if( regCkNull ){
|
109917
|
0 |
0 |
if( destIfNull==destIfFalse ){
|
109922
|
0 |
0 |
for(i=0; i<nVector; i++){
|
109924
|
0 |
0 |
if( pParse->nErr ) goto sqlite3ExprCodeIN_oom_error;
|
109925
|
0 |
0 |
if( sqlite3ExprCanBeNull(p) ){
|
109935
|
0 |
0 |
if( eType==IN_INDEX_ROWID ){
|
109944
|
0 |
0 |
if( destIfFalse==destIfNull ){
|
109958
|
0 |
0 |
if( rRhsHasNull && nVector==1 ){
|
|
0 |
0 |
if( rRhsHasNull && nVector==1 ){
|
109966
|
0 |
0 |
if( destIfFalse==destIfNull ) sqlite3VdbeGoto(v, destIfFalse);
|
109975
|
0 |
0 |
if( destStep6 ) sqlite3VdbeResolveLabel(v, destStep6);
|
109978
|
0 |
0 |
if( nVector>1 ){
|
109985
|
0 |
0 |
for(i=0; i<nVector; i++){
|
109998
|
0 |
0 |
if( nVector>1 ){
|
110012
|
0 |
16 |
if( rLhs!=rLhsOrig ) sqlite3ReleaseTempReg(pParse, rLhs);
|
110030
|
2166 |
0 |
if( ALWAYS(z!=0) ){
|
110034
|
0 |
2166 |
if( negateFlag ) value = -value;
|
110049
|
543 |
12 |
if( pExpr->flags & EP_IntValue ){
|
110052
|
1 |
542 |
if( negFlag ) i = -i;
|
110060
|
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)){
|
110065
|
0 |
0 |
if( sqlite3_strnicmp(z,"0x",2)==0 ){
|
110066
|
0 |
0 |
sqlite3ErrorMsg(pParse, "hex literal too big: %s%#T",
|
110075
|
0 |
12 |
if( negFlag ){ value = c==3 ? SMALLEST_INT64 : -value; }
|
|
0 |
0 |
if( negFlag ){ value = c==3 ? SMALLEST_INT64 : -value; }
|
110093
|
0 |
14 |
if( iTabCol==XN_EXPR ){
|
110121
|
0 |
0 |
if( pParse->iSelfTab>0 ){
|
110127
|
0 |
0 |
if( pCol->affinity>=SQLITE_AFF_TEXT ){
|
110130
|
0 |
0 |
if( iAddr ) sqlite3VdbeJumpHere(v, iAddr);
|
110131
|
0 |
0 |
if( pParse->nErr>nErr ) pParse->db->errByteOffset = -1;
|
110149
|
4723 |
160 |
if( iCol<0 || iCol==pTab->iPKey ){
|
|
2 |
4721 |
if( iCol<0 || iCol==pTab->iPKey ){
|
110155
|
214 |
4507 |
if( IsVirtual(pTab) ){
|
110159
|
0 |
4507 |
}else if( (pCol = &pTab->aCol[iCol])->colFlags & COLFLAG_VIRTUAL ){
|
110161
|
0 |
0 |
if( pCol->colFlags & COLFLAG_BUSY ){
|
110174
|
0 |
4507 |
}else if( !HasRowid(pTab) ){
|
110205
|
17 |
4777 |
if( p5 ){
|
110207
|
17 |
0 |
if( pOp->opcode==OP_Column ) pOp->p5 = p5;
|
110227
|
0 |
0 |
if( NEVER(p==0) ) return;
|
110247
|
16 |
0 |
if( nResult==1 ){
|
110251
|
0 |
0 |
if( p->op==TK_SELECT ){
|
110262
|
0 |
0 |
for(i=0; i<nResult; i++){
|
110275
|
0 |
8 |
if( sqlite3VdbeGetLastOp(v)->opcode==OP_Copy ){
|
110306
|
8 |
8 |
for(i=1; i<nFarg; i++){
|
110370
|
0 |
0 |
if( pA1->op==TK_COLUMN ){
|
110392
|
0 |
0 |
sqlite3VdbeLoadString(v, target,
|
110414
|
0 |
0 |
for(p=pParse->pIdxEpr; p; p=p->pIENext){
|
110417
|
0 |
0 |
if( iDataCur<0 ) continue;
|
110418
|
0 |
0 |
if( pParse->iSelfTab ){
|
110419
|
0 |
0 |
if( p->iDataCur!=pParse->iSelfTab-1 ) continue;
|
110422
|
0 |
0 |
if( sqlite3ExprCompare(0, pExpr, p->pExpr, iDataCur)!=0 ) continue;
|
110425
|
0 |
0 |
if( (exprAff<=SQLITE_AFF_BLOB && p->aff!=SQLITE_AFF_BLOB)
|
|
0 |
0 |
if( (exprAff<=SQLITE_AFF_BLOB && p->aff!=SQLITE_AFF_BLOB)
|
110426
|
0 |
0 |
|| (exprAff==SQLITE_AFF_TEXT && p->aff!=SQLITE_AFF_TEXT)
|
|
0 |
0 |
|| (exprAff==SQLITE_AFF_TEXT && p->aff!=SQLITE_AFF_TEXT)
|
110427
|
0 |
0 |
|| (exprAff>=SQLITE_AFF_NUMERIC && p->aff!=SQLITE_AFF_NUMERIC)
|
|
0 |
0 |
|| (exprAff>=SQLITE_AFF_NUMERIC && p->aff!=SQLITE_AFF_NUMERIC)
|
110435
|
0 |
0 |
if( p->bMaybeNullRow ){
|
110485
|
66 |
13152 |
if( pExpr==0 ){
|
110487
|
0 |
13152 |
}else if( pParse->pIdxEpr!=0
|
110488
|
0 |
0 |
&& !ExprHasProperty(pExpr, EP_Leaf)
|
110489
|
0 |
0 |
&& (r1 = sqlite3IndexedExprLookup(pParse, pExpr, target))>=0
|
110502
|
0 |
101 |
if( pExpr->iAgg>=pAggInfo->nColumn ){
|
110515
|
15 |
86 |
if( !pAggInfo->directMode ){
|
110517
|
23 |
63 |
}else if( pAggInfo->useSortingIdx ){
|
110521
|
23 |
0 |
if( pTab==0 ){
|
110523
|
23 |
0 |
}else if( pCol->iColumn<0 ){
|
110528
|
0 |
23 |
if( pTab->aCol[pCol->iColumn].affinity==SQLITE_AFF_REAL ){
|
110533
|
0 |
63 |
}else if( pExpr->y.pTab==0 ){
|
110545
|
0 |
4794 |
if( ExprHasProperty(pExpr, EP_FixedCol) ){
|
110557
|
0 |
0 |
if( aff>SQLITE_AFF_BLOB ){
|
110566
|
0 |
4794 |
if( iTab<0 ){
|
110567
|
0 |
0 |
if( pParse->iSelfTab<0 ){
|
110583
|
0 |
0 |
if( iCol<0 ){
|
110590
|
0 |
0 |
if( pCol->colFlags & COLFLAG_GENERATED ){
|
110591
|
0 |
0 |
if( pCol->colFlags & COLFLAG_BUSY ){
|
110597
|
0 |
0 |
if( pCol->colFlags & COLFLAG_NOTAVAIL ){
|
110604
|
0 |
0 |
if( pCol->affinity==SQLITE_AFF_REAL ){
|
110674
|
31 |
1357 |
if( pExpr->u.zToken[1]!=0 ){
|
110698
|
0 |
0 |
op = (op==TK_IS) ? TK_EQ : TK_NE;
|
110708
|
0 |
0 |
if( sqlite3ExprIsVector(pLeft) ){
|
110723
|
0 |
0 |
if( p5==SQLITE_NULLEQ ){
|
110766
|
1 |
0 |
if( pLeft->op==TK_INTEGER ){
|
110770
|
0 |
0 |
}else if( pLeft->op==TK_FLOAT ){
|
110825
|
147 |
0 |
if( pInfo==0
|
110826
|
147 |
0 |
|| NEVER(pExpr->iAgg<0)
|
110827
|
0 |
147 |
|| NEVER(pExpr->iAgg>=pInfo->nFunc)
|
110848
|
0 |
760 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){
|
110853
|
646 |
114 |
if( ConstFactorOk(pParse) && sqlite3ExprIsConstantNotJoin(pExpr) ){
|
|
57 |
589 |
if( ConstFactorOk(pParse) && sqlite3ExprIsConstantNotJoin(pExpr) ){
|
110861
|
685 |
18 |
nFarg = pFarg ? pFarg->nExpr : 0;
|
110870
|
703 |
0 |
if( pDef==0 || pDef->xFinalize!=0 ){
|
|
0 |
703 |
if( pDef==0 || pDef->xFinalize!=0 ){
|
110874
|
8 |
695 |
if( pDef->funcFlags & SQLITE_FUNC_INLINE ){
|
110879
|
491 |
204 |
}else if( pDef->funcFlags & (SQLITE_FUNC_DIRECT|SQLITE_FUNC_UNSAFE) ){
|
110883
|
1180 |
695 |
for(i=0; i<nFarg; i++){
|
110884
|
1180 |
0 |
if( i<32 && sqlite3ExprIsConstant(pFarg->a[i].pExpr) ){
|
|
984 |
196 |
if( i<32 && sqlite3ExprIsConstant(pFarg->a[i].pExpr) ){
|
110888
|
0 |
1180 |
if( (pDef->funcFlags & SQLITE_FUNC_NEEDCOLL)!=0 && !pColl ){
|
|
0 |
0 |
if( (pDef->funcFlags & SQLITE_FUNC_NEEDCOLL)!=0 && !pColl ){
|
110892
|
677 |
18 |
if( pFarg ){
|
110893
|
585 |
92 |
if( constMask ){
|
110905
|
35 |
642 |
if( (pDef->funcFlags & (SQLITE_FUNC_LENGTH|SQLITE_FUNC_TYPEOF))!=0 ){
|
110910
|
18 |
17 |
if( exprOp==TK_COLUMN || exprOp==TK_AGG_COLUMN ){
|
|
0 |
18 |
if( exprOp==TK_COLUMN || exprOp==TK_AGG_COLUMN ){
|
110937
|
488 |
207 |
if( nFarg>=2 && ExprHasProperty(pExpr, EP_InfixFunc) ){
|
|
148 |
340 |
if( nFarg>=2 && ExprHasProperty(pExpr, EP_InfixFunc) ){
|
110939
|
529 |
18 |
}else if( nFarg>0 ){
|
110943
|
0 |
695 |
if( pDef->funcFlags & SQLITE_FUNC_NEEDCOLL ){
|
110944
|
0 |
0 |
if( !pColl ) pColl = db->pDfltColl;
|
110949
|
677 |
18 |
if( nFarg ){
|
110950
|
92 |
585 |
if( constMask==0 ){
|
110964
|
0 |
18 |
if( pParse->db->mallocFailed ){
|
110966
|
18 |
0 |
}else if( op==TK_SELECT
|
110967
|
18 |
0 |
&& ALWAYS( ExprUseXSelect(pExpr) )
|
110968
|
0 |
18 |
&& (nCol = pExpr->x.pSelect->pEList->nExpr)!=1
|
110979
|
0 |
0 |
if( pLeft->iTable==0 || pParse->withinRJSubrtn > pLeft->op2 ){
|
|
0 |
0 |
if( pLeft->iTable==0 || pParse->withinRJSubrtn > pLeft->op2 ){
|
110985
|
0 |
0 |
if( pExpr->iTable!=n ){
|
111021
|
77 |
40 |
if( !ExprHasProperty(pExpr, EP_Collate) ){
|
111095
|
0 |
0 |
if( iCol>=0 && pTab->aCol[iCol].affinity==SQLITE_AFF_REAL ){
|
|
0 |
0 |
if( iCol>=0 && pTab->aCol[iCol].affinity==SQLITE_AFF_REAL ){
|
111117
|
0 |
0 |
if( pAggInfo ){
|
111119
|
0 |
0 |
if( !pAggInfo->directMode ){
|
111123
|
0 |
0 |
if( pExpr->pAggInfo->useSortingIdx ){
|
111187
|
0 |
0 |
if( (pX = pExpr->pLeft)!=0 ){
|
111189
|
0 |
0 |
if( db->mallocFailed ){
|
111206
|
0 |
0 |
for(i=0; i<nExpr-1; i=i+2){
|
111207
|
0 |
0 |
if( pX ){
|
111221
|
0 |
0 |
if( (nExpr&1)!=0 ){
|
111238
|
0 |
0 |
if( !pParse->pTriggerTab && !pParse->nested ){
|
|
0 |
0 |
if( !pParse->pTriggerTab && !pParse->nested ){
|
111243
|
0 |
0 |
if( pExpr->affExpr==OE_Abort ){
|
111247
|
0 |
0 |
if( pExpr->affExpr==OE_Ignore ){
|
111252
|
0 |
0 |
sqlite3HaltConstraint(pParse,
|
111291
|
904 |
858 |
if( regDest<0 && p ){
|
|
357 |
547 |
if( regDest<0 && p ){
|
111294
|
466 |
333 |
for(pItem=p->a, i=p->nExpr; i>0; pItem++, i--){
|
111295
|
349 |
117 |
if( pItem->fg.reusable
|
111296
|
24 |
325 |
&& sqlite3ExprCompare(0,pItem->pExpr,pExpr,-1)==0
|
111303
|
1683 |
55 |
if( pExpr!=0 && ExprHasProperty(pExpr, EP_HasFunc) ){
|
|
108 |
1575 |
if( pExpr!=0 && ExprHasProperty(pExpr, EP_HasFunc) ){
|
111309
|
108 |
0 |
if( !pParse->db->mallocFailed ){
|
111310
|
108 |
0 |
if( regDest<0 ) regDest = ++pParse->nMem;
|
111318
|
1630 |
0 |
if( p ){
|
111321
|
772 |
858 |
if( regDest<0 ) regDest = ++pParse->nMem;
|
111345
|
1767 |
20 |
if( ConstFactorOk(pParse)
|
111346
|
1767 |
0 |
&& ALWAYS(pExpr!=0)
|
111347
|
1757 |
10 |
&& pExpr->op!=TK_REGISTER
|
111348
|
847 |
910 |
&& sqlite3ExprIsConstantNotJoin(pExpr)
|
111355
|
906 |
34 |
if( r2==r1 ){
|
111376
|
0 |
3433 |
if( pParse->pVdbe==0 ) return;
|
111378
|
235 |
3198 |
if( inReg!=target ){
|
111380
|
235 |
0 |
if( ALWAYS(pExpr)
|
111381
|
235 |
0 |
&& (ExprHasProperty(pExpr,EP_Subquery) || pExpr->op==TK_REGISTER)
|
|
235 |
0 |
&& (ExprHasProperty(pExpr,EP_Subquery) || pExpr->op==TK_REGISTER)
|
111399
|
0 |
0 |
if( !db->mallocFailed ) sqlite3ExprCode(pParse, pExpr, target);
|
111410
|
55 |
0 |
if( pParse->okConstFactor && sqlite3ExprIsConstantNotJoin(pExpr) ){
|
|
55 |
0 |
if( pParse->okConstFactor && sqlite3ExprIsConstantNotJoin(pExpr) ){
|
111446
|
2776 |
29 |
u8 copyOp = (flags & SQLITE_ECEL_DUP) ? OP_Copy : OP_SCopy;
|
111452
|
108 |
2697 |
if( !ConstFactorOk(pParse) ) flags &= ~SQLITE_ECEL_FACTOR;
|
111453
|
6070 |
2805 |
for(pItem=pList->a, i=0; i<n; i++, pItem++){
|
111461
|
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 ){
|
111462
|
120 |
0 |
if( flags & SQLITE_ECEL_OMITREF ){
|
111468
|
999 |
4951 |
}else if( (flags & SQLITE_ECEL_FACTOR)!=0
|
111469
|
803 |
196 |
&& sqlite3ExprIsConstantNotJoin(pExpr)
|
111474
|
212 |
4935 |
if( inReg!=target+i ){
|
111476
|
212 |
0 |
if( copyOp==OP_Copy
|
111477
|
8 |
204 |
&& (pOp=sqlite3VdbeGetLastOp(v))->opcode==OP_Copy
|
111478
|
1 |
7 |
&& pOp->p1+pOp->p3+1==inReg
|
111479
|
1 |
0 |
&& pOp->p2+pOp->p3+1==target+i
|
111480
|
1 |
0 |
&& pOp->p5==0 /* The do-not-merge flag must be clear */
|
111532
|
0 |
0 |
if( db->mallocFailed==0 ){
|
111543
|
0 |
0 |
if( xJump ){
|
111592
|
0 |
18 |
if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */
|
111593
|
0 |
18 |
if( NEVER(pExpr==0) ) return; /* No way this can happen */
|
111600
|
0 |
3 |
if( pAlt!=pExpr ){
|
111602
|
2 |
1 |
}else if( op==TK_AND ){
|
111629
|
0 |
0 |
if( isTrue ^ isNot ){
|
111630
|
0 |
0 |
sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest,
|
111633
|
0 |
0 |
sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest,
|
111642
|
0 |
0 |
op = (op==TK_IS) ? TK_EQ : TK_NE;
|
111651
|
0 |
2 |
if( sqlite3ExprIsVector(pExpr->pLeft) ) goto default_expr;
|
111691
|
0 |
0 |
int destIfNull = jumpIfNull ? dest : destIfFalse;
|
111700
|
0 |
12 |
if( ExprAlwaysTrue(pExpr) ){
|
111702
|
12 |
0 |
}else if( ExprAlwaysFalse(pExpr) ){
|
111735
|
0 |
1093 |
if( NEVER(v==0) ) return; /* Existence of VDBE checked by caller */
|
111736
|
141 |
952 |
if( pExpr==0 ) return;
|
111774
|
0 |
5 |
if( pAlt!=pExpr ){
|
111776
|
3 |
2 |
}else if( pExpr->op==TK_AND ){
|
111803
|
0 |
0 |
if( isTrue ^ isNot ){
|
111805
|
0 |
0 |
sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest,
|
111810
|
0 |
0 |
sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest,
|
111819
|
1 |
2 |
op = (pExpr->op==TK_IS) ? TK_NE : TK_EQ;
|
111828
|
0 |
759 |
if( sqlite3ExprIsVector(pExpr->pLeft) ) goto default_expr;
|
111865
|
16 |
0 |
if( jumpIfNull ){
|
111877
|
0 |
139 |
if( ExprAlwaysFalse(pExpr) ){
|
111879
|
139 |
0 |
}else if( ExprAlwaysTrue(pExpr) ){
|
111903
|
0 |
0 |
if( db->mallocFailed==0 ){
|
111932
|
0 |
0 |
if( pR ){
|
111936
|
0 |
0 |
if( pL ){
|
111937
|
0 |
0 |
if( sqlite3_value_type(pL)==SQLITE_TEXT ){
|
111985
|
3068 |
5393 |
if( pA==0 || pB==0 ){
|
|
0 |
3068 |
if( pA==0 || pB==0 ){
|
111986
|
5393 |
0 |
return pB==pA ? 0 : 2;
|
111988
|
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) ){
|
111992
|
0 |
3068 |
if( combinedFlags & EP_IntValue ){
|
111993
|
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 ){
|
111998
|
2991 |
77 |
if( pA->op!=pB->op || pA->op==TK_RAISE ){
|
|
0 |
2991 |
if( pA->op!=pB->op || pA->op==TK_RAISE ){
|
111999
|
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 ){
|
112002
|
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 ){
|
112005
|
0 |
61 |
if( pA->op==TK_AGG_COLUMN && pB->op==TK_COLUMN
|
|
0 |
0 |
if( pA->op==TK_AGG_COLUMN && pB->op==TK_COLUMN
|
112006
|
0 |
0 |
&& pB->iTable<0 && pA->iTable==iTab
|
|
0 |
0 |
&& pB->iTable<0 && pA->iTable==iTab
|
112015
|
2981 |
10 |
if( pA->u.zToken ){
|
112016
|
2981 |
0 |
if( pA->op==TK_FUNCTION || pA->op==TK_AGG_FUNCTION ){
|
|
1 |
2980 |
if( pA->op==TK_FUNCTION || pA->op==TK_AGG_FUNCTION ){
|
112017
|
0 |
1 |
if( sqlite3StrICmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
|
112020
|
0 |
1 |
if( ExprHasProperty(pA,EP_WinFunc)!=ExprHasProperty(pB,EP_WinFunc) ){
|
112023
|
0 |
1 |
if( ExprHasProperty(pA,EP_WinFunc) ){
|
112024
|
0 |
0 |
if( sqlite3WindowCompare(pParse, pA->y.pWin, pB->y.pWin, 1)!=0 ){
|
112029
|
0 |
2980 |
}else if( pA->op==TK_NULL ){
|
112031
|
0 |
2980 |
}else if( pA->op==TK_COLLATE ){
|
112032
|
0 |
0 |
if( sqlite3_stricmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
|
112034
|
2978 |
2 |
if( pB->u.zToken!=0
|
112035
|
318 |
2660 |
&& pA->op!=TK_COLUMN
|
112036
|
318 |
0 |
&& pA->op!=TK_AGG_COLUMN
|
112037
|
292 |
26 |
&& strcmp(pA->u.zToken,pB->u.zToken)!=0
|
112042
|
0 |
2699 |
if( (pA->flags & (EP_Distinct|EP_Commuted))
|
112044
|
2699 |
0 |
if( ALWAYS((combinedFlags & EP_TokenOnly)==0) ){
|
112045
|
0 |
2699 |
if( combinedFlags & EP_xIsSelect ) return 2;
|
112046
|
2699 |
0 |
if( (combinedFlags & EP_FixedCol)==0
|
112047
|
0 |
2699 |
&& sqlite3ExprCompare(pParse, pA->pLeft, pB->pLeft, iTab) ) return 2;
|
112048
|
0 |
2699 |
if( sqlite3ExprCompare(pParse, pA->pRight, pB->pRight, iTab) ) return 2;
|
112049
|
0 |
2699 |
if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList, iTab) ) return 2;
|
112050
|
2675 |
24 |
if( pA->op!=TK_STRING
|
112051
|
2675 |
0 |
&& pA->op!=TK_TRUEFALSE
|
112052
|
2675 |
0 |
&& ALWAYS((combinedFlags & EP_Reduced)==0)
|
112054
|
2567 |
108 |
if( pA->iColumn!=pB->iColumn ) return 2;
|
112055
|
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;
|
112056
|
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 ){
|
112082
|
2702 |
3 |
if( pA==0 && pB==0 ) return 0;
|
|
2698 |
4 |
if( pA==0 && pB==0 ) return 0;
|
112083
|
3 |
4 |
if( pA==0 || pB==0 ) return 1;
|
|
0 |
3 |
if( pA==0 || pB==0 ) return 1;
|
112084
|
0 |
3 |
if( pA->nExpr!=pB->nExpr ) return 1;
|
112085
|
3 |
2 |
for(i=0; i<pA->nExpr; i++){
|
112089
|
0 |
3 |
if( pA->a[i].fg.sortFlags!=pB->a[i].fg.sortFlags ) return 1;
|
112090
|
1 |
2 |
if( (res = sqlite3ExprCompare(0, pExprA, pExprB, iTab)) ) return res;
|
112121
|
0 |
0 |
if( sqlite3ExprCompare(pParse, p, pNN, iTab)==0 ){
|
112126
|
0 |
0 |
if( seenNot && ExprHasProperty(p, EP_xIsSelect) ) return 0;
|
|
0 |
0 |
if( seenNot && ExprHasProperty(p, EP_xIsSelect) ) return 0;
|
112136
|
0 |
0 |
if( seenNot ) return 0;
|
112137
|
0 |
0 |
if( exprImpliesNotNull(pParse, pList->a[0].pExpr, pNN, iTab, 1)
|
112138
|
0 |
0 |
|| exprImpliesNotNull(pParse, pList->a[1].pExpr, pNN, iTab, 1)
|
112162
|
0 |
0 |
if( exprImpliesNotNull(pParse, p->pRight, pNN, iTab, seenNot) ) return 1;
|
112172
|
0 |
0 |
if( seenNot ) return 0;
|
112173
|
0 |
0 |
if( p->op2!=TK_IS ) return 0;
|
112215
|
0 |
0 |
if( sqlite3ExprCompare(pParse, pE1, pE2, iTab)==0 ){
|
112218
|
0 |
0 |
if( pE2->op==TK_OR
|
112219
|
0 |
0 |
&& (sqlite3ExprImpliesExpr(pParse, pE1, pE2->pLeft, iTab)
|
112220
|
0 |
0 |
|| sqlite3ExprImpliesExpr(pParse, pE1, pE2->pRight, iTab) )
|
112224
|
0 |
0 |
if( pE2->op==TK_NOTNULL
|
112225
|
0 |
0 |
&& exprImpliesNotNull(pParse, pE1, pE2->pLeft, iTab, 0)
|
112244
|
3 |
4 |
if( ExprHasProperty(pExpr, EP_OuterON) ) return WRC_Prune;
|
112268
|
1 |
0 |
if( pWalker->u.iCur==pExpr->iTable ){
|
112275
|
0 |
0 |
if( pWalker->eCode==0 ){
|
112277
|
0 |
0 |
if( pWalker->eCode ){
|
112285
|
0 |
0 |
if( sqlite3WalkExpr(pWalker, pExpr->pLeft)==WRC_Abort ){
|
112312
|
1 |
0 |
if( (pLeft->op==TK_COLUMN
|
112313
|
1 |
0 |
&& ALWAYS(pLeft->y.pTab!=0)
|
112314
|
0 |
1 |
&& IsVirtual(pLeft->y.pTab))
|
112315
|
0 |
0 |
|| (pRight->op==TK_COLUMN
|
112316
|
0 |
0 |
&& ALWAYS(pRight->y.pTab!=0)
|
112317
|
0 |
0 |
&& IsVirtual(pRight->y.pTab))
|
112353
|
0 |
8 |
if( p==0 ) return 0;
|
112354
|
1 |
7 |
if( p->op==TK_NOTNULL ){
|
112357
|
4 |
6 |
while( p->op==TK_AND ){
|
112358
|
1 |
3 |
if( sqlite3ExprImpliesNonNullRow(p->pLeft, iTab) ) return 1;
|
112389
|
51 |
119 |
if( pExpr->op==TK_COLUMN
|
112390
|
51 |
0 |
&& pExpr->iTable==pWalker->u.pIdxCover->iCur
|
112391
|
0 |
51 |
&& sqlite3TableColumnToIndex(pWalker->u.pIdxCover->pIdx, pExpr->iColumn)<0
|
112449
|
0 |
0 |
if( pSrc->nSrc==0 ) return WRC_Continue;
|
112453
|
0 |
0 |
if( piNew==0 ){
|
112459
|
0 |
0 |
for(i=0; i<pSrc->nSrc; i++, j++){
|
112467
|
0 |
0 |
if( p->nExclude ){
|
112482
|
0 |
62 |
if( pExpr->op==TK_COLUMN
|
112483
|
0 |
0 |
|| pExpr->op==TK_AGG_COLUMN
|
112488
|
62 |
0 |
int nSrc = pSrc ? pSrc->nSrc : 0;
|
112489
|
62 |
0 |
for(i=0; i<nSrc; i++){
|
112490
|
62 |
0 |
if( pExpr->iTable==pSrc->a[i].iCursor ){
|
112495
|
0 |
0 |
for(i=0; i<p->nExclude && p->aiExclude[i]!=pExpr->iTable; i++){}
|
|
0 |
0 |
for(i=0; i<p->nExclude && p->aiExclude[i]!=pExpr->iTable; i++){}
|
112496
|
0 |
0 |
if( i>=p->nExclude ){
|
112534
|
0 |
147 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){
|
112538
|
0 |
147 |
if( x.aiExclude ) sqlite3DbNNFreeNN(pParse->db, x.aiExclude);
|
112539
|
62 |
85 |
if( w.eCode & 0x01 ){
|
112541
|
0 |
85 |
}else if( w.eCode ){
|
112560
|
78 |
0 |
if( ALWAYS(!ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced))
|
112561
|
0 |
78 |
&& pExpr->pAggInfo!=0
|
112568
|
0 |
0 |
if( pExpr->op!=TK_AGG_FUNCTION ){
|
112569
|
0 |
0 |
if( iAgg<pAggInfo->nColumn
|
112570
|
0 |
0 |
&& pAggInfo->aCol[iAgg].pCExpr==pExpr
|
112573
|
0 |
0 |
if( pExpr ){
|
112580
|
0 |
0 |
if( ALWAYS(iAgg<pAggInfo->nFunc)
|
112581
|
0 |
0 |
&& pAggInfo->aFunc[iAgg].pFExpr==pExpr
|
112584
|
0 |
0 |
if( pExpr ){
|
112654
|
11 |
77 |
for(k=0; k<pAggInfo->nColumn; k++, pCol++){
|
112655
|
9 |
2 |
if( pCol->iTable==pExpr->iTable
|
112656
|
1 |
8 |
&& pCol->iColumn==pExpr->iColumn
|
112657
|
1 |
0 |
&& pExpr->op!=TK_IF_NULL_ROW
|
112663
|
0 |
77 |
if( k<0 ){
|
112675
|
23 |
54 |
if( pAggInfo->pGroupBy && pExpr->op!=TK_IF_NULL_ROW ){
|
|
23 |
0 |
if( pAggInfo->pGroupBy && pExpr->op!=TK_IF_NULL_ROW ){
|
112680
|
23 |
9 |
for(j=0; j<n; j++, pTerm++){
|
112682
|
23 |
0 |
if( pE->op==TK_COLUMN
|
112683
|
22 |
1 |
&& pE->iTable==pExpr->iTable
|
112684
|
14 |
8 |
&& pE->iColumn==pExpr->iColumn
|
112691
|
63 |
14 |
if( pCol->iSorterColumn<0 ){
|
112698
|
78 |
0 |
if( pExpr->op==TK_COLUMN ){
|
112723
|
15 |
0 |
if( (pNC->ncFlags & NC_InAggFunc)==0 ) break;
|
112724
|
0 |
0 |
if( pParse->pIdxEpr==0 ) break;
|
112725
|
0 |
0 |
for(pIEpr=pParse->pIdxEpr; pIEpr; pIEpr=pIEpr->pIENext){
|
112727
|
0 |
0 |
if( iDataCur<0 ) continue;
|
112728
|
0 |
0 |
if( sqlite3ExprCompare(0, pExpr, pIEpr->pExpr, iDataCur)==0 ) break;
|
112730
|
0 |
0 |
if( pIEpr==0 ) break;
|
112731
|
0 |
0 |
if( NEVER(!ExprUseYTab(pExpr)) ) break;
|
112732
|
0 |
0 |
for(i=0; i<pSrcList->nSrc; i++){
|
112733
|
0 |
0 |
if( pSrcList->a[0].iCursor==pIEpr->iDataCur ) break;
|
112735
|
0 |
0 |
if( i>=pSrcList->nSrc ) break;
|
112736
|
0 |
0 |
if( NEVER(pExpr->pAggInfo!=0) ) break; /* Resolved by outer context */
|
112737
|
0 |
0 |
if( pParse->nErr ){ return WRC_Abort; }
|
112748
|
0 |
0 |
if( pParse->nErr ){ return WRC_Abort; }
|
112764
|
78 |
0 |
if( ALWAYS(pSrcList!=0) ){
|
112766
|
79 |
0 |
for(i=0; i<pSrcList->nSrc; i++, pItem++){
|
112768
|
78 |
1 |
if( pExpr->iTable==pItem->iCursor ){
|
112777
|
148 |
0 |
if( (pNC->ncFlags & NC_InAggFunc)==0
|
112778
|
148 |
0 |
&& pWalker->walkerDepth==pExpr->op2
|
112784
|
1 |
147 |
for(i=0; i<pAggInfo->nFunc; i++, pItem++){
|
112785
|
0 |
1 |
if( pItem->pFExpr==pExpr ) break;
|
112786
|
1 |
0 |
if( sqlite3ExprCompare(0, pItem->pFExpr, pExpr, -1)==0 ){
|
112790
|
147 |
1 |
if( i>=pAggInfo->nFunc ){
|
112795
|
147 |
0 |
if( i>=0 ){
|
112800
|
62 |
85 |
pItem->pFunc = sqlite3FindFunction(pParse->db,
|
112803
|
0 |
147 |
if( pExpr->flags & EP_Distinct ){
|
112855
|
211 |
230 |
if( pList ){
|
112856
|
220 |
211 |
for(pItem=pList->a, i=0; i<pList->nExpr; i++, pItem++){
|
112866
|
791 |
417 |
if( pParse->nTempReg==0 ){
|
112877
|
1436 |
1142 |
if( iReg ){
|
112879
|
1436 |
0 |
if( pParse->nTempReg<ArraySize(pParse->aTempReg) ){
|
112890
|
192 |
173 |
if( nReg==1 ) return sqlite3GetTempReg(pParse);
|
112893
|
1 |
172 |
if( nReg<=n ){
|
112903
|
192 |
96 |
if( nReg==1 ){
|
112908
|
20 |
76 |
if( nReg>pParse->nRangeReg ){
|
112932
|
1 |
1 |
if( pParse->nMem<iReg ) pParse->nMem = iReg;
|
113022
|
0 |
0 |
if( 0==sqlite3StrNICmp(pTab->zName, "sqlite_", 7)
|
113024
|
0 |
0 |
|| (pTab->tabFlags & TF_Eponymous)!=0
|
113025
|
0 |
0 |
|| ( (pTab->tabFlags & TF_Shadow)!=0
|
113026
|
0 |
0 |
&& sqlite3ReadOnlyShadowTables(pParse->db)
|
113061
|
0 |
0 |
if( bTemp==0 ){
|
113087
|
0 |
0 |
if( bTemp==0 ){
|
113103
|
0 |
0 |
if( v ){
|
113106
|
0 |
0 |
if( iDb!=1 ) sqlite3VdbeAddParseSchemaOp(pParse->pVdbe, 1, 0, p5);
|
113129
|
0 |
0 |
if( NEVER(db->mallocFailed) ) goto exit_rename_table;
|
113134
|
0 |
0 |
if( !pTab ) goto exit_rename_table;
|
113140
|
0 |
0 |
if( !zName ) goto exit_rename_table;
|
113145
|
0 |
0 |
if( sqlite3FindTable(db, zName, zDb)
|
113146
|
0 |
0 |
|| sqlite3FindIndex(db, zName, zDb)
|
113147
|
0 |
0 |
|| sqlite3IsShadowTableOf(db, pTab, zName)
|
113157
|
0 |
0 |
if( SQLITE_OK!=isAlterableTable(pParse, pTab) ){
|
113160
|
0 |
0 |
if( SQLITE_OK!=sqlite3CheckObjectName(pParse,zName,"table",zName) ){
|
113165
|
0 |
0 |
if( IsView(pTab) ){
|
113173
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){
|
113179
|
0 |
0 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ){
|
113182
|
0 |
0 |
if( IsVirtual(pTab) ){
|
113184
|
0 |
0 |
if( pVTab->pVtab->pModule->xRename==0 ){
|
113195
|
0 |
0 |
if( v==0 ){
|
113236
|
0 |
0 |
if( sqlite3FindTable(db, "sqlite_sequence", zDb) ){
|
113246
|
0 |
0 |
if( iDb!=1 ){
|
113264
|
0 |
0 |
if( pVTab ){
|
113318
|
0 |
0 |
if( pParse->nErr ) return;
|
113334
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){
|
113344
|
0 |
0 |
if( pCol->colFlags & COLFLAG_PRIMKEY ){
|
113348
|
0 |
0 |
if( pNew->pIndex ){
|
113353
|
0 |
0 |
if( (pCol->colFlags & COLFLAG_GENERATED)==0 ){
|
113359
|
0 |
0 |
if( pDflt && pDflt->pLeft->op==TK_NULL ){
|
|
0 |
0 |
if( pDflt && pDflt->pLeft->op==TK_NULL ){
|
113363
|
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 ){
|
113367
|
0 |
0 |
if( pCol->notNull && !pDflt ){
|
|
0 |
0 |
if( pCol->notNull && !pDflt ){
|
113376
|
0 |
0 |
if( pDflt ){
|
113381
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
113385
|
0 |
0 |
if( !pVal ){
|
113391
|
0 |
0 |
}else if( pCol->colFlags & COLFLAG_STORED ){
|
113398
|
0 |
0 |
if( zCol ){
|
113400
|
0 |
0 |
while( zEnd>zCol && (*zEnd==';' || sqlite3Isspace(*zEnd)) ){
|
|
0 |
0 |
while( zEnd>zCol && (*zEnd==';' || sqlite3Isspace(*zEnd)) ){
|
|
0 |
0 |
while( zEnd>zCol && (*zEnd==';' || sqlite3Isspace(*zEnd)) ){
|
113419
|
0 |
0 |
if( v ){
|
113437
|
0 |
0 |
if( pNew->pCheck!=0
|
113438
|
0 |
0 |
|| (pCol->notNull && (pCol->colFlags & COLFLAG_GENERATED)!=0)
|
|
0 |
0 |
|| (pCol->notNull && (pCol->colFlags & COLFLAG_GENERATED)!=0)
|
113479
|
0 |
0 |
if( db->mallocFailed ) goto exit_begin_add_column;
|
113481
|
0 |
0 |
if( !pTab ) goto exit_begin_add_column;
|
113484
|
0 |
0 |
if( IsVirtual(pTab) ){
|
113491
|
0 |
0 |
if( IsView(pTab) ){
|
113495
|
0 |
0 |
if( SQLITE_OK!=isAlterableTable(pParse, pTab) ){
|
113512
|
0 |
0 |
if( !pNew ) goto exit_begin_add_column;
|
113521
|
0 |
0 |
if( !pNew->aCol || !pNew->zName ){
|
|
0 |
0 |
if( !pNew->aCol || !pNew->zName ){
|
113526
|
0 |
0 |
for(i=0; i<pNew->nCol; i++){
|
113554
|
0 |
0 |
if( IsView(pTab) ){
|
113559
|
0 |
0 |
if( IsVirtual(pTab) ){
|
113563
|
0 |
0 |
if( zType ){
|
113564
|
0 |
0 |
sqlite3ErrorMsg(pParse, "cannot %s %s \"%s\"",
|
113598
|
0 |
0 |
if( !pTab ) goto exit_rename_column;
|
113601
|
0 |
0 |
if( SQLITE_OK!=isAlterableTable(pParse, pTab) ) goto exit_rename_column;
|
113602
|
0 |
0 |
if( SQLITE_OK!=isRealTable(pParse, pTab, 0) ) goto exit_rename_column;
|
113611
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, 0) ){
|
113619
|
0 |
0 |
if( !zOld ) goto exit_rename_column;
|
113620
|
0 |
0 |
for(iCol=0; iCol<pTab->nCol; iCol++){
|
113621
|
0 |
0 |
if( 0==sqlite3StrICmp(pTab->aCol[iCol].zCnName, zOld) ) break;
|
113623
|
0 |
0 |
if( iCol==pTab->nCol ){
|
113638
|
0 |
0 |
if( !zNew ) goto exit_rename_column;
|
113768
|
0 |
0 |
if( ALWAYS(pParse->eParseMode!=PARSE_MODE_UNMAP) ){
|
113770
|
0 |
0 |
if( pNew ){
|
113789
|
0 |
0 |
for(p=pParse->pRename; p; p=p->pNext){
|
113790
|
0 |
0 |
if( p->p==pFrom ){
|
113803
|
0 |
0 |
if( ExprUseYTab(pExpr) ){
|
113815
|
0 |
0 |
if( pWith ){
|
113820
|
0 |
0 |
if( (pWith->a[0].pSelect->selFlags & SF_Expanded)==0 ){
|
113829
|
0 |
0 |
for(i=0; i<pWith->nCte; i++){
|
113834
|
0 |
0 |
if( pCopy ) sqlite3SelectPrep(sNC.pParse, p, &sNC);
|
113835
|
0 |
0 |
if( sNC.pParse->db->mallocFailed ) return;
|
113839
|
0 |
0 |
if( pCopy && pParse->pWith==pCopy ){
|
|
0 |
0 |
if( pCopy && pParse->pWith==pCopy ){
|
113854
|
0 |
0 |
for(ii=0; ii<pIdList->nId; ii++){
|
113865
|
0 |
0 |
if( pParse->nErr ) return WRC_Abort;
|
113868
|
0 |
0 |
if( p->selFlags & (SF_View|SF_CopyCte) ){
|
113871
|
0 |
0 |
if( ALWAYS(p->pEList) ){
|
113873
|
0 |
0 |
for(i=0; i<pList->nExpr; i++){
|
113874
|
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 ){
|
113879
|
0 |
0 |
if( ALWAYS(p->pSrc) ){ /* Every Select as a SrcList, even if it is empty */
|
113881
|
0 |
0 |
for(i=0; i<pSrc->nSrc; i++){
|
113883
|
0 |
0 |
if( pSrc->a[i].fg.isUsing==0 ){
|
113915
|
0 |
0 |
if( pEList ){
|
113922
|
0 |
0 |
for(i=0; i<pEList->nExpr; i++){
|
113923
|
0 |
0 |
if( ALWAYS(pEList->a[i].fg.eEName==ENAME_NAME) ){
|
113936
|
0 |
0 |
for(p=pToken; p; p=pNext){
|
113957
|
0 |
0 |
if( NEVER(pPtr==0) ){
|
113960
|
0 |
0 |
for(pp=&pParse->pRename; (*pp); pp=&(*pp)->pNext){
|
113961
|
0 |
0 |
if( (*pp)->p==pPtr ){
|
113963
|
0 |
0 |
if( pCtx ){
|
113981
|
0 |
0 |
if( p->selFlags & (SF_View|SF_CopyCte) ){
|
114001
|
0 |
0 |
if( pExpr->op==TK_TRIGGER
|
114002
|
0 |
0 |
&& pExpr->iColumn==p->iCol
|
114003
|
0 |
0 |
&& pWalker->pParse->pTriggerTab==p->pTab
|
114006
|
0 |
0 |
}else if( pExpr->op==TK_COLUMN
|
114007
|
0 |
0 |
&& pExpr->iColumn==p->iCol
|
114008
|
0 |
0 |
&& ALWAYS(ExprUseYTab(pExpr))
|
114009
|
0 |
0 |
&& p->pTab==pExpr->y.pTab
|
114030
|
0 |
0 |
for(pToken=pBest->pNext; pToken; pToken=pToken->pNext){
|
114031
|
0 |
0 |
if( pToken->t.z>pBest->t.z ) pBest = pToken;
|
114033
|
0 |
0 |
for(pp=&pCtx->pList; *pp!=pBest; pp=&(*pp)->pNext);
|
114057
|
0 |
0 |
zErr = sqlite3MPrintf(pParse->db, "error in %s %s%s%s: %s",
|
114077
|
0 |
0 |
if( pEList ){
|
114079
|
0 |
0 |
for(i=0; i<pEList->nExpr; i++){
|
114081
|
0 |
0 |
if( ALWAYS(pEList->a[i].fg.eEName==ENAME_NAME)
|
114082
|
0 |
0 |
&& ALWAYS(zName!=0)
|
114083
|
0 |
0 |
&& 0==sqlite3_stricmp(zName, zOld)
|
114102
|
0 |
0 |
if( pIdList ){
|
114104
|
0 |
0 |
for(i=0; i<pIdList->nId; i++){
|
114106
|
0 |
0 |
if( 0==sqlite3_stricmp(zName, zOld) ){
|
114128
|
0 |
0 |
if( zSql==0 ){
|
114131
|
0 |
0 |
if( sqlite3StrNICmp(zSql,"CREATE ",7)!=0 ){
|
114134
|
0 |
0 |
db->init.iDb = bTemp ? 1 : sqlite3FindDbName(db, zDb);
|
114139
|
0 |
0 |
if( db->mallocFailed ) rc = SQLITE_NOMEM;
|
114140
|
0 |
0 |
if( rc==SQLITE_OK
|
114141
|
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)
|
114188
|
0 |
0 |
if( zNew ){
|
114195
|
0 |
0 |
if( zQuot==0 ){
|
114205
|
0 |
0 |
if( zOut ){
|
114215
|
0 |
0 |
if( zOut ){
|
114218
|
0 |
0 |
while( pRename->pList ){
|
114224
|
0 |
0 |
if( zNew ){
|
114225
|
0 |
0 |
if( bQuote==0 && sqlite3IsIdChar(*pBest->t.z) ){
|
|
0 |
0 |
if( bQuote==0 && sqlite3IsIdChar(*pBest->t.z) ){
|
114231
|
0 |
0 |
if( pBest->t.z[pBest->t.n]=='"' ) nReplace++;
|
114243
|
0 |
0 |
sqlite3_snprintf(nSql*2, zBuf2, "%Q%s", zBuf1,
|
114251
|
0 |
0 |
if( pBest->t.n!=nReplace ){
|
114276
|
0 |
0 |
if( pEList ){
|
114278
|
0 |
0 |
for(i=0; i<pEList->nExpr; i++){
|
114307
|
0 |
0 |
if( ALWAYS(pParse->pTriggerTab) ){
|
114312
|
0 |
0 |
if( rc==SQLITE_OK && pNew->pWhen ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pNew->pWhen ){
|
114316
|
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){
|
114317
|
0 |
0 |
if( pStep->pSelect ){
|
114319
|
0 |
0 |
if( pParse->nErr ) rc = pParse->rc;
|
114321
|
0 |
0 |
if( rc==SQLITE_OK && pStep->zTarget ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pStep->zTarget ){
|
114323
|
0 |
0 |
if( pSrc ){
|
114327
|
0 |
0 |
if( pSel==0 ){
|
114346
|
0 |
0 |
if( pStep->pExprList ) pSel->pEList = 0;
|
114350
|
0 |
0 |
if( pStep->pFrom ){
|
114352
|
0 |
0 |
for(i=0; i<pStep->pFrom->nSrc && rc==SQLITE_OK; i++){
|
|
0 |
0 |
for(i=0; i<pStep->pFrom->nSrc && rc==SQLITE_OK; i++){
|
114354
|
0 |
0 |
if( p->pSelect ){
|
114360
|
0 |
0 |
if( db->mallocFailed ){
|
114364
|
0 |
0 |
if( rc==SQLITE_OK && pStep->pWhere ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pStep->pWhere ){
|
114367
|
0 |
0 |
if( rc==SQLITE_OK ){
|
114371
|
0 |
0 |
if( pStep->pUpsert && rc==SQLITE_OK ){
|
|
0 |
0 |
if( pStep->pUpsert && rc==SQLITE_OK ){
|
114377
|
0 |
0 |
if( rc==SQLITE_OK ){
|
114381
|
0 |
0 |
if( rc==SQLITE_OK ){
|
114384
|
0 |
0 |
if( rc==SQLITE_OK ){
|
114410
|
0 |
0 |
for(pStep=pTrigger->step_list; pStep; pStep=pStep->pNext){
|
114414
|
0 |
0 |
if( pStep->pUpsert ){
|
114421
|
0 |
0 |
if( pStep->pFrom ){
|
114423
|
0 |
0 |
for(i=0; i<pStep->pFrom->nSrc; i++){
|
114437
|
0 |
0 |
if( pParse->pVdbe ){
|
114441
|
0 |
0 |
while( (pIdx = pParse->pNewIndex)!=0 ){
|
114501
|
0 |
0 |
if( zSql==0 ) return;
|
114502
|
0 |
0 |
if( zTable==0 ) return;
|
114503
|
0 |
0 |
if( zNew==0 ) return;
|
114504
|
0 |
0 |
if( iCol<0 ) return;
|
114507
|
0 |
0 |
if( pTab==0 || iCol>=pTab->nCol ){
|
|
0 |
0 |
if( pTab==0 || iCol>=pTab->nCol ){
|
114513
|
0 |
0 |
sCtx.iCol = ((iCol==pTab->iPKey) ? -1 : iCol);
|
114528
|
0 |
0 |
if( rc!=SQLITE_OK ) goto renameColumnFunc_done;
|
114529
|
0 |
0 |
if( sParse.pNewTable ){
|
114530
|
0 |
0 |
if( IsView(sParse.pNewTable) ){
|
114535
|
0 |
0 |
rc = (db->mallocFailed ? SQLITE_NOMEM : sParse.rc);
|
114536
|
0 |
0 |
if( rc==SQLITE_OK ){
|
114539
|
0 |
0 |
if( rc!=SQLITE_OK ) goto renameColumnFunc_done;
|
114540
|
0 |
0 |
}else if( IsOrdinaryTable(sParse.pNewTable) ){
|
114545
|
0 |
0 |
if( bFKOnly==0 ){
|
114546
|
0 |
0 |
if( iCol<sParse.pNewTable->nCol ){
|
114551
|
0 |
0 |
if( sCtx.iCol<0 ){
|
114555
|
0 |
0 |
for(pIdx=sParse.pNewTable->pIndex; pIdx; pIdx=pIdx->pNext){
|
114558
|
0 |
0 |
for(pIdx=sParse.pNewIndex; pIdx; pIdx=pIdx->pNext){
|
114562
|
0 |
0 |
for(i=0; i<sParse.pNewTable->nCol; i++){
|
114571
|
0 |
0 |
for(pFKey=sParse.pNewTable->u.tab.pFKey; pFKey; pFKey=pFKey->pNextFrom){
|
114572
|
0 |
0 |
for(i=0; i<pFKey->nCol; i++){
|
114573
|
0 |
0 |
if( bFKOnly==0 && pFKey->aCol[i].iFrom==iCol ){
|
|
0 |
0 |
if( bFKOnly==0 && pFKey->aCol[i].iFrom==iCol ){
|
114576
|
0 |
0 |
if( 0==sqlite3_stricmp(pFKey->zTo, zTable)
|
114577
|
0 |
0 |
&& 0==sqlite3_stricmp(pFKey->aCol[i].zCol, zOld)
|
114584
|
0 |
0 |
}else if( sParse.pNewIndex ){
|
114591
|
0 |
0 |
if( rc!=SQLITE_OK ) goto renameColumnFunc_done;
|
114593
|
0 |
0 |
for(pStep=sParse.pNewTrigger->step_list; pStep; pStep=pStep->pNext){
|
114594
|
0 |
0 |
if( pStep->zTarget ){
|
114596
|
0 |
0 |
if( pTarget==pTab ){
|
114597
|
0 |
0 |
if( pStep->pUpsert ){
|
114609
|
0 |
0 |
if( sParse.pTriggerTab==pTab ){
|
114621
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
114622
|
0 |
0 |
if( rc==SQLITE_ERROR && sqlite3WritableSchema(db) ){
|
|
0 |
0 |
if( rc==SQLITE_ERROR && sqlite3WritableSchema(db) ){
|
114624
|
0 |
0 |
}else if( sParse.zErrMsg ){
|
114644
|
0 |
0 |
if( pExpr->op==TK_COLUMN
|
114645
|
0 |
0 |
&& ALWAYS(ExprUseYTab(pExpr))
|
114646
|
0 |
0 |
&& p->pTab==pExpr->y.pTab
|
114660
|
0 |
0 |
if( pSelect->selFlags & (SF_View|SF_CopyCte) ){
|
114665
|
0 |
0 |
if( NEVER(pSrc==0) ){
|
114669
|
0 |
0 |
for(i=0; i<pSrc->nSrc; i++){
|
114671
|
0 |
0 |
if( pItem->pTab==p->pTab ){
|
114713
|
0 |
0 |
if( zInput && zOld && zNew ){
|
|
0 |
0 |
if( zInput && zOld && zNew ){
|
|
0 |
0 |
if( zInput && zOld && zNew ){
|
114737
|
0 |
0 |
if( rc==SQLITE_OK ){
|
114739
|
0 |
0 |
if( sParse.pNewTable ){
|
114742
|
0 |
0 |
if( IsView(pTab) ){
|
114743
|
0 |
0 |
if( isLegacy==0 ){
|
114752
|
0 |
0 |
if( sParse.nErr ){
|
114761
|
0 |
0 |
if( (isLegacy==0 || (db->flags & SQLITE_ForeignKeys))
|
|
0 |
0 |
if( (isLegacy==0 || (db->flags & SQLITE_ForeignKeys))
|
114762
|
0 |
0 |
&& !IsVirtual(pTab)
|
114766
|
0 |
0 |
for(pFKey=pTab->u.tab.pFKey; pFKey; pFKey=pFKey->pNextFrom){
|
114767
|
0 |
0 |
if( sqlite3_stricmp(pFKey->zTo, zOld)==0 ){
|
114777
|
0 |
0 |
if( sqlite3_stricmp(zOld, pTab->zName)==0 ){
|
114779
|
0 |
0 |
if( isLegacy==0 ){
|
114787
|
0 |
0 |
else if( sParse.pNewIndex ){
|
114789
|
0 |
0 |
if( isLegacy==0 ){
|
114798
|
0 |
0 |
if( 0==sqlite3_stricmp(sParse.pNewTrigger->table, zOld)
|
114799
|
0 |
0 |
&& sCtx.pTab->pSchema==pTrigger->pTabSchema
|
114804
|
0 |
0 |
if( isLegacy==0 ){
|
114806
|
0 |
0 |
if( rc==SQLITE_OK ){
|
114808
|
0 |
0 |
for(pStep=pTrigger->step_list; pStep; pStep=pStep->pNext){
|
114809
|
0 |
0 |
if( pStep->zTarget && 0==sqlite3_stricmp(pStep->zTarget, zOld) ){
|
|
0 |
0 |
if( pStep->zTarget && 0==sqlite3_stricmp(pStep->zTarget, zOld) ){
|
114812
|
0 |
0 |
if( pStep->pFrom ){
|
114814
|
0 |
0 |
for(i=0; i<pStep->pFrom->nSrc; i++){
|
114816
|
0 |
0 |
if( 0==sqlite3_stricmp(pItem->zName, zOld) ){
|
114828
|
0 |
0 |
if( rc==SQLITE_OK ){
|
114831
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
114832
|
0 |
0 |
if( rc==SQLITE_ERROR && sqlite3WritableSchema(db) ){
|
|
0 |
0 |
if( rc==SQLITE_ERROR && sqlite3WritableSchema(db) ){
|
114834
|
0 |
0 |
}else if( sParse.zErrMsg ){
|
114853
|
0 |
0 |
if( pExpr->op==TK_STRING && (pExpr->flags & EP_DblQuoted) ){
|
|
0 |
0 |
if( pExpr->op==TK_STRING && (pExpr->flags & EP_DblQuoted) ){
|
114903
|
0 |
0 |
if( zDb && zInput ){
|
|
0 |
0 |
if( zDb && zInput ){
|
114908
|
0 |
0 |
if( rc==SQLITE_OK ){
|
114920
|
0 |
0 |
if( sParse.pNewTable ){
|
114921
|
0 |
0 |
if( IsView(sParse.pNewTable) ){
|
114926
|
0 |
0 |
rc = (db->mallocFailed ? SQLITE_NOMEM : sParse.rc);
|
114927
|
0 |
0 |
if( rc==SQLITE_OK ){
|
114934
|
0 |
0 |
for(i=0; i<sParse.pNewTable->nCol; i++){
|
114941
|
0 |
0 |
}else if( sParse.pNewIndex ){
|
114947
|
0 |
0 |
if( rc==SQLITE_OK ){
|
114953
|
0 |
0 |
if( rc==SQLITE_OK ){
|
114958
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
114959
|
0 |
0 |
if( sqlite3WritableSchema(db) && rc==SQLITE_ERROR ){
|
|
0 |
0 |
if( sqlite3WritableSchema(db) && rc==SQLITE_ERROR ){
|
115019
|
0 |
0 |
if( zDb && zInput ){
|
|
0 |
0 |
if( zDb && zInput ){
|
115023
|
0 |
0 |
if( bNoDQS ) db->flags &= ~(SQLITE_DqsDML|SQLITE_DqsDDL);
|
115026
|
0 |
0 |
if( rc==SQLITE_OK ){
|
115027
|
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) ){
|
115032
|
0 |
0 |
if( sParse.nErr ) rc = sParse.rc;
|
115035
|
0 |
0 |
else if( sParse.pNewTrigger ){
|
115036
|
0 |
0 |
if( isLegacy==0 ){
|
115039
|
0 |
0 |
if( rc==SQLITE_OK ){
|
115042
|
0 |
0 |
if( i1==i2 ){
|
115050
|
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) ){
|
115098
|
0 |
0 |
if( rc!=SQLITE_OK ) goto drop_column_done;
|
115100
|
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 ){
|
115107
|
0 |
0 |
if( iCol<pTab->nCol-1 ){
|
115114
|
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--;
|
115126
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
115150
|
0 |
0 |
if( NEVER(db->mallocFailed) ) goto exit_drop_column;
|
115152
|
0 |
0 |
if( !pTab ) goto exit_drop_column;
|
115156
|
0 |
0 |
if( SQLITE_OK!=isAlterableTable(pParse, pTab) ) goto exit_drop_column;
|
115157
|
0 |
0 |
if( SQLITE_OK!=isRealTable(pParse, pTab, 1) ) goto exit_drop_column;
|
115161
|
0 |
0 |
if( zCol==0 ){
|
115166
|
0 |
0 |
if( iCol<0 ){
|
115173
|
0 |
0 |
if( pTab->aCol[iCol].colFlags & (COLFLAG_PRIMKEY|COLFLAG_UNIQUE) ){
|
115174
|
0 |
0 |
sqlite3ErrorMsg(pParse, "cannot drop %s column: \"%s\"",
|
115182
|
0 |
0 |
if( pTab->nCol<=1 ){
|
115193
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_ALTER_TABLE, zDb, pTab->zName, zCol) ){
|
115211
|
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 ){
|
115224
|
0 |
0 |
if( HasRowid(pTab) ){
|
115230
|
0 |
0 |
for(i=0; i<pPk->nKeyCol; i++){
|
115236
|
0 |
0 |
for(i=0; i<pTab->nCol; i++){
|
115237
|
0 |
0 |
if( i!=iCol && (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 ){
|
|
0 |
0 |
if( i!=iCol && (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 ){
|
115239
|
0 |
0 |
if( pPk ){
|
115242
|
0 |
0 |
if( iPos<pPk->nKeyCol ) continue;
|
115247
|
0 |
0 |
if( i==pTab->iPKey ){
|
115255
|
0 |
0 |
if( nField==0 ){
|
115262
|
0 |
0 |
if( pPk ){
|
115491
|
0 |
1 |
if( v==0 ) return;
|
115499
|
3 |
1 |
for(i=0; i<ArraySize(aTable); i++){
|
115503
|
3 |
0 |
if( (pStat = sqlite3FindTable(db, zTab, pDb->zDbSName))==0 ){
|
115504
|
1 |
2 |
if( i<nToOpen ){
|
115521
|
0 |
0 |
if( zWhere ){
|
115538
|
1 |
1 |
for(i=0; i<nToOpen; i++){
|
115731
|
0 |
0 |
if( p==0 ){
|
116011
|
0 |
0 |
if( p->nRow==0 ){
|
116013
|
0 |
0 |
for(i=0; i<p->nCol; i++) p->current.anEq[i] = 1;
|
116022
|
0 |
0 |
for(i=0; i<iChng; i++){
|
116025
|
0 |
0 |
for(i=iChng; i<p->nCol; i++){
|
116064
|
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) ){
|
116157
|
0 |
0 |
sqlite3_str_appendf(&sStat, "%llu",
|
116159
|
0 |
0 |
for(i=0; i<p->nKeyCol; i++){
|
116162
|
0 |
0 |
if( iVal==2 && p->nRow*10 <= nDistinct*11 ) iVal = 1;
|
|
0 |
0 |
if( iVal==2 && p->nRow*10 <= nDistinct*11 ) iVal = 1;
|
116301
|
2 |
0 |
if( v==0 || NEVER(pTab==0) ){
|
|
0 |
2 |
if( v==0 || NEVER(pTab==0) ){
|
116304
|
0 |
2 |
if( !IsOrdinaryTable(pTab) ){
|
116308
|
1 |
1 |
if( sqlite3_strlike("sqlite\\_%", pTab->zName, '\\')==0 ){
|
116317
|
0 |
1 |
if( sqlite3AuthCheck(pParse, SQLITE_ANALYZE, pTab->zName, 0,
|
116346
|
0 |
1 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
116353
|
0 |
0 |
if( pOnlyIdx && pOnlyIdx!=pIdx ) continue;
|
|
0 |
0 |
if( pOnlyIdx && pOnlyIdx!=pIdx ) continue;
|
116354
|
0 |
0 |
if( pIdx->pPartIdxWhere==0 ) needTableCnt = 0;
|
116355
|
0 |
0 |
if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIdx) ){
|
|
0 |
0 |
if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIdx) ){
|
116362
|
0 |
0 |
nColTest = pIdx->uniqNotNull ? pIdx->nKeyCol-1 : nCol-1;
|
116451
|
0 |
0 |
if( nColTest>0 ){
|
116455
|
0 |
0 |
if( aGotoChng==0 ) continue;
|
116469
|
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) ){
|
116476
|
0 |
0 |
for(i=0; i<nColTest; i++){
|
116498
|
0 |
0 |
for(i=0; i<nColTest; i++){
|
116538
|
0 |
0 |
if( db->nAnalysisLimit ){
|
116636
|
1 |
0 |
if( pOnlyIdx==0 && needTableCnt ){
|
|
1 |
0 |
if( pOnlyIdx==0 && needTableCnt ){
|
116660
|
1 |
0 |
if( v ){
|
116683
|
2 |
1 |
for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
|
116710
|
0 |
0 |
if( pOnlyIdx ){
|
116744
|
0 |
1 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
|
116749
|
1 |
0 |
if( pName1==0 ){
|
116751
|
2 |
1 |
for(i=0; i<db->nDb; i++){
|
116752
|
1 |
1 |
if( i==1 ) continue; /* Do not analyze the TEMP database */
|
116755
|
0 |
0 |
}else if( pName2->n==0 && (iDb = sqlite3FindDb(db, pName1))>=0 ){
|
|
0 |
0 |
}else if( pName2->n==0 && (iDb = sqlite3FindDb(db, pName1))>=0 ){
|
116761
|
0 |
0 |
if( iDb>=0 ){
|
116762
|
0 |
0 |
zDb = pName2->n ? db->aDb[iDb].zDbSName : 0;
|
116764
|
0 |
0 |
if( z ){
|
116765
|
0 |
0 |
if( (pIdx = sqlite3FindIndex(db, z, zDb))!=0 ){
|
116767
|
0 |
0 |
}else if( (pTab = sqlite3LocateTable(pParse, 0, z, zDb))!=0 ){
|
116774
|
1 |
0 |
if( db->nSqlExec==0 && (v = sqlite3GetVdbe(pParse))!=0 ){
|
|
1 |
0 |
if( db->nSqlExec==0 && (v = sqlite3GetVdbe(pParse))!=0 ){
|
116811
|
0 |
0 |
for(i=0; *z && i<nOut; i++){
|
|
0 |
0 |
for(i=0; *z && i<nOut; i++){
|
116813
|
0 |
0 |
while( (c=z[0])>='0' && c<='9' ){
|
|
0 |
0 |
while( (c=z[0])>='0' && c<='9' ){
|
116826
|
0 |
0 |
if( *z==' ' ) z++;
|
116835
|
0 |
0 |
while( z[0] ){
|
116836
|
0 |
0 |
if( sqlite3_strglob("unordered*", z)==0 ){
|
116838
|
0 |
0 |
}else if( sqlite3_strglob("sz=[0-9]*", z)==0 ){
|
116840
|
0 |
0 |
if( sz<2 ) sz = 2;
|
116842
|
0 |
0 |
}else if( sqlite3_strglob("noskipscan*", z)==0 ){
|
116850
|
0 |
0 |
while( z[0]!=0 && z[0]!=' ' ) z++;
|
|
0 |
0 |
while( z[0]!=0 && z[0]!=' ' ) z++;
|
116851
|
0 |
0 |
while( z[0]==' ' ) z++;
|
116876
|
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 ){
|
116880
|
0 |
0 |
if( pTable==0 ){
|
116883
|
0 |
0 |
if( argv[1]==0 ){
|
116885
|
0 |
0 |
}else if( sqlite3_stricmp(argv[0],argv[1])==0 ){
|
116892
|
0 |
0 |
if( pIndex ){
|
116908
|
0 |
0 |
if( pIndex->pPartIdxWhere==0 ){
|
117224
|
270 |
222 |
for(i=sqliteHashFirst(&pSchema->tblHash); i; i=sqliteHashNext(i)){
|
117228
|
1 |
222 |
for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
|
117240
|
1 |
221 |
if( (pStat1 = sqlite3FindTable(db, "sqlite_stat1", sInfo.zDatabase))
|
117241
|
1 |
0 |
&& IsOrdinaryTable(pStat1)
|
117245
|
0 |
1 |
if( zSql==0 ){
|
117255
|
1 |
222 |
for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
|
117257
|
1 |
0 |
if( !pIdx->hasStat1 ) sqlite3DefaultRowEst(pIdx);
|
117274
|
0 |
222 |
if( rc==SQLITE_NOMEM ){
|
117322
|
10 |
5 |
if( pExpr ){
|
117323
|
3 |
7 |
if( pExpr->op!=TK_ID ){
|
117339
|
1124 |
1079 |
|| (iDb==0 && sqlite3StrICmp("main", zName)==0)
|
|
315 |
809 |
|| (iDb==0 && sqlite3StrICmp("main", zName)==0)
|
|
0 |
315 |
|| (iDb==0 && sqlite3StrICmp("main", zName)==0)
|
117379
|
0 |
5 |
if( zFile==0 ) zFile = "";
|
117380
|
0 |
5 |
if( zName==0 ) zName = "";
|
117388
|
0 |
5 |
if( REOPEN_AS_MEMDB(db) ){
|
117394
|
0 |
0 |
if( pVfs==0 ) return;
|
117396
|
0 |
0 |
if( rc==SQLITE_OK ){
|
117398
|
0 |
0 |
if( pNewSchema ){
|
117403
|
0 |
0 |
if( ALWAYS(pNew->pBt) ) sqlite3BtreeClose(pNew->pBt);
|
117411
|
0 |
0 |
if( rc ) goto attach_error;
|
117421
|
0 |
5 |
if( db->nDb>=db->aLimit[SQLITE_LIMIT_ATTACHED]+2 ){
|
117427
|
10 |
5 |
for(i=0; i<db->nDb; i++){
|
117429
|
0 |
10 |
if( sqlite3DbIsNamed(db, i, zName) ){
|
117438
|
5 |
0 |
if( db->aDb==db->aDbStatic ){
|
117440
|
0 |
5 |
if( aNew==0 ) return;
|
117444
|
0 |
0 |
if( aNew==0 ) return;
|
117456
|
0 |
5 |
if( rc!=SQLITE_OK ){
|
117457
|
0 |
0 |
if( rc==SQLITE_NOMEM ) sqlite3OomFault(db);
|
117469
|
0 |
5 |
if( rc==SQLITE_CONSTRAINT ){
|
117472
|
5 |
0 |
}else if( rc==SQLITE_OK ){
|
117475
|
0 |
5 |
if( !pNew->pSchema ){
|
117477
|
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) ){
|
117494
|
5 |
0 |
if( rc==SQLITE_OK && pNew->zDbSName==0 ){
|
|
0 |
5 |
if( rc==SQLITE_OK && pNew->zDbSName==0 ){
|
117504
|
5 |
0 |
if( rc==SQLITE_OK ){
|
117508
|
5 |
0 |
if( !REOPEN_AS_MEMDB(db) ){
|
117523
|
0 |
5 |
if( rc ){
|
117524
|
0 |
0 |
if( ALWAYS(!REOPEN_AS_MEMDB(db)) ){
|
117527
|
0 |
0 |
if( db->aDb[iDb].pBt ){
|
117534
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){
|
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){
|
117538
|
0 |
0 |
}else if( zErrDyn==0 ){
|
117549
|
0 |
0 |
if( zErrDyn ){
|
117553
|
0 |
0 |
if( rc ) sqlite3_result_error_code(context, rc);
|
117578
|
0 |
0 |
if( zName==0 ) zName = "";
|
117579
|
0 |
0 |
for(i=0; i<db->nDb; i++){
|
117581
|
0 |
0 |
if( pDb->pBt==0 ) continue;
|
117582
|
0 |
0 |
if( sqlite3DbIsNamed(db, i, zName) ) break;
|
117585
|
0 |
0 |
if( i>=db->nDb ){
|
117589
|
0 |
0 |
if( i<2 ){
|
117593
|
0 |
0 |
if( sqlite3BtreeTxnState(pDb->pBt)!=SQLITE_TXN_NONE
|
117594
|
0 |
0 |
|| sqlite3BtreeIsInBackup(pDb->pBt)
|
117604
|
0 |
0 |
while( pEntry ){
|
117606
|
0 |
0 |
if( pTrig->pTabSchema==pDb->pSchema ){
|
117641
|
0 |
5 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ) goto attach_end;
|
117643
|
0 |
5 |
if( pParse->nErr ) goto attach_end;
|
117647
|
5 |
0 |
if(
|
117648
|
5 |
0 |
SQLITE_OK!=resolveAttachExpr(&sName, pFilename) ||
|
117649
|
5 |
0 |
SQLITE_OK!=resolveAttachExpr(&sName, pDbname) ||
|
117656
|
5 |
0 |
if( ALWAYS(pAuthArg) ){
|
117658
|
5 |
0 |
if( pAuthArg->op==TK_STRING ){
|
117665
|
0 |
5 |
if(rc!=SQLITE_OK ){
|
117679
|
5 |
0 |
if( v ){
|
117741
|
0 |
0 |
if( !pFix->bTemp ) ExprSetProperty(pExpr, EP_FromDDL);
|
117742
|
0 |
0 |
if( pExpr->op==TK_VARIABLE ){
|
117743
|
0 |
0 |
if( pFix->pParse->db->init.busy ){
|
117764
|
0 |
10 |
if( NEVER(pList==0) ) return WRC_Continue;
|
117765
|
10 |
10 |
for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
|
117766
|
10 |
0 |
if( pFix->bTemp==0 ){
|
117767
|
0 |
10 |
if( pItem->zDatabase ){
|
117768
|
0 |
0 |
if( iDb!=sqlite3FindDbName(db, pItem->zDatabase) ){
|
117782
|
10 |
0 |
if( pList->a[i].fg.isUsing==0
|
117783
|
0 |
10 |
&& sqlite3WalkExpr(&pFix->w, pList->a[i].u3.pOn)
|
117789
|
0 |
10 |
if( pSelect->pWith ){
|
117790
|
0 |
0 |
for(i=0; i<pSelect->pWith->nCte; i++){
|
117791
|
0 |
0 |
if( sqlite3WalkSelect(p, pSelect->pWith->a[i].pSelect) ){
|
117846
|
10 |
0 |
if( pList ){
|
117874
|
0 |
0 |
while( pStep ){
|
117875
|
0 |
0 |
if( sqlite3WalkSelect(&pFix->w, pStep->pSelect)
|
117876
|
0 |
0 |
|| sqlite3WalkExpr(&pFix->w, pStep->pWhere)
|
117877
|
0 |
0 |
|| sqlite3WalkExprList(&pFix->w, pStep->pExprList)
|
117878
|
0 |
0 |
|| sqlite3FixSrcList(pFix, pStep->pFrom)
|
117885
|
0 |
0 |
for(pUp=pStep->pUpsert; pUp; pUp=pUp->pNextUpsert){
|
117886
|
0 |
0 |
if( sqlite3WalkExprList(&pFix->w, pUp->pUpsertTarget)
|
117887
|
0 |
0 |
|| sqlite3WalkExpr(&pFix->w, pUp->pUpsertTargetWhere)
|
117888
|
0 |
0 |
|| sqlite3WalkExprList(&pFix->w, pUp->pUpsertSet)
|
117889
|
0 |
0 |
|| sqlite3WalkExpr(&pFix->w, pUp->pUpsertWhere)
|
117985
|
2 |
2 |
if( db->xAuth ) sqlite3ExpirePreparedStatements(db, 1);
|
118018
|
0 |
0 |
if( db->init.busy ) return SQLITE_OK;
|
118024
|
0 |
0 |
if( rc==SQLITE_DENY ){
|
118026
|
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);
|
118029
|
0 |
0 |
}else if( rc!=SQLITE_IGNORE && rc!=SQLITE_OK ){
|
|
0 |
0 |
}else if( rc!=SQLITE_IGNORE && rc!=SQLITE_OK ){
|
118060
|
0 |
0 |
if( iDb<0 ){
|
118066
|
0 |
0 |
if( pExpr->op==TK_TRIGGER ){
|
118070
|
0 |
0 |
for(iSrc=0; iSrc<pTabList->nSrc; iSrc++){
|
118071
|
0 |
0 |
if( pExpr->iTable==pTabList->a[iSrc].iCursor ){
|
118078
|
0 |
0 |
if( pTab==0 ) return;
|
118080
|
0 |
0 |
if( iCol>=0 ){
|
118083
|
0 |
0 |
}else if( pTab->iPKey>=0 ){
|
118090
|
0 |
0 |
if( SQLITE_IGNORE==sqlite3AuthReadCol(pParse, pTab->zName, zCol, iDb) ){
|
118115
|
4 |
9814 |
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 ){
|
118135
|
2 |
2 |
if( rc==SQLITE_DENY ){
|
118138
|
0 |
2 |
}else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
|
|
0 |
0 |
}else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){
|
118166
|
0 |
346 |
if( pContext->pParse ){
|
118237
|
0 |
0 |
pToplevel = sqlite3ParseToplevel(pParse);
|
118238
|
0 |
0 |
for(i=0; i<pToplevel->nTableLock; i++){
|
118240
|
0 |
0 |
if( p->iDb==iDb && p->iTab==iTab ){
|
|
0 |
0 |
if( p->iDb==iDb && p->iTab==iTab ){
|
118241
|
0 |
0 |
p->isWriteLock = (p->isWriteLock || isWriteLock);
|
|
0 |
0 |
p->isWriteLock = (p->isWriteLock || isWriteLock);
|
118249
|
0 |
0 |
if( pToplevel->aTableLock ){
|
118267
|
2529 |
2388 |
if( iDb==1 ) return;
|
118268
|
2388 |
0 |
if( !sqlite3BtreeSharable(pParse->db->aDb[iDb].pBt) ) return;
|
118281
|
0 |
5348 |
for(i=0; i<pParse->nTableLock; i++){
|
118323
|
320 |
6118 |
if( pParse->nested ) return;
|
118324
|
21 |
6097 |
if( pParse->nErr ){
|
118325
|
0 |
21 |
if( db->mallocFailed ) pParse->rc = SQLITE_NOMEM;
|
118334
|
749 |
5348 |
if( v==0 ){
|
118335
|
749 |
0 |
if( db->init.busy ){
|
118340
|
0 |
0 |
if( v==0 ) pParse->rc = SQLITE_ERROR;
|
118344
|
5348 |
0 |
if( v ){
|
118345
|
0 |
5348 |
if( pParse->bReturning ){
|
118350
|
0 |
0 |
if( pReturning->nRetCol ){
|
118356
|
0 |
0 |
for(i=0; i<pReturning->nRetCol; i++){
|
118390
|
6324 |
4527 |
if( DbMaskTest(pParse->cookieMask, iDb)==0 ) continue;
|
118400
|
4040 |
487 |
if( db->init.busy==0 ) sqlite3VdbeChangeP5(v, 1);
|
118403
|
5503 |
5348 |
}while( ++iDb<db->nDb );
|
118405
|
22 |
5348 |
for(i=0; i<pParse->nVtabLock; i++){
|
118429
|
932 |
4416 |
if( pParse->pConstExpr ){
|
118432
|
1630 |
932 |
for(i=0; i<pEL->nExpr; i++){
|
118438
|
0 |
5348 |
if( pParse->bReturning ){
|
118440
|
0 |
0 |
if( pRet->nRetCol ){
|
118453
|
5348 |
0 |
if( pParse->nErr==0 ){
|
118484
|
2 |
351 |
if( pParse->nErr ) return;
|
118485
|
31 |
320 |
if( pParse->eParseMode ) return;
|
118490
|
0 |
320 |
if( zSql==0 ){
|
118494
|
0 |
0 |
if( !db->mallocFailed ) pParse->rc = SQLITE_TOOBIG;
|
118544
|
2384 |
4176 |
if( zDatabase ){
|
118545
|
2924 |
0 |
for(i=0; i<db->nDb; i++){
|
118546
|
2384 |
540 |
if( sqlite3StrICmp(zDatabase, db->aDb[i].zDbSName)==0 ) break;
|
118548
|
0 |
2384 |
if( i>=db->nDb ){
|
118551
|
0 |
0 |
if( sqlite3StrICmp(zDatabase,"main")==0 ){
|
118558
|
1345 |
1039 |
if( p==0 && sqlite3StrNICmp(zName, "sqlite_", 7)==0 ){
|
|
767 |
578 |
if( p==0 && sqlite3StrNICmp(zName, "sqlite_", 7)==0 ){
|
118559
|
279 |
488 |
if( i==1 ){
|
118560
|
279 |
0 |
if( sqlite3StrICmp(zName+7, &PREFERRED_TEMP_SCHEMA_TABLE[7])==0
|
118561
|
279 |
0 |
|| sqlite3StrICmp(zName+7, &PREFERRED_SCHEMA_TABLE[7])==0
|
118562
|
63 |
216 |
|| sqlite3StrICmp(zName+7, &LEGACY_SCHEMA_TABLE[7])==0
|
118568
|
0 |
488 |
if( sqlite3StrICmp(zName+7, &PREFERRED_SCHEMA_TABLE[7])==0 ){
|
118577
|
2411 |
1765 |
if( p ) return p;
|
118580
|
1203 |
562 |
if( p ) return p;
|
118582
|
5 |
562 |
for(i=2; i<db->nDb; i++){
|
118585
|
0 |
5 |
if( p ) break;
|
118587
|
562 |
0 |
if( p==0 && sqlite3StrNICmp(zName, "sqlite_", 7)==0 ){
|
|
216 |
346 |
if( p==0 && sqlite3StrNICmp(zName, "sqlite_", 7)==0 ){
|
118588
|
0 |
216 |
if( sqlite3StrICmp(zName+7, &PREFERRED_SCHEMA_TABLE[7])==0 ){
|
118590
|
0 |
216 |
}else if( sqlite3StrICmp(zName+7, &PREFERRED_TEMP_SCHEMA_TABLE[7])==0 ){
|
118620
|
266 |
4338 |
if( (db->mDbFlags & DBFLAG_SchemaKnownOk)==0
|
118621
|
0 |
266 |
&& SQLITE_OK!=sqlite3ReadSchema(pParse)
|
118627
|
22 |
4582 |
if( p==0 ){
|
118632
|
22 |
0 |
if( (pParse->prepFlags & SQLITE_PREPARE_NO_VTAB)==0 && db->init.busy==0 ){
|
|
22 |
0 |
if( (pParse->prepFlags & SQLITE_PREPARE_NO_VTAB)==0 && db->init.busy==0 ){
|
118634
|
22 |
0 |
if( pMod==0 && sqlite3_strnicmp(zName, "pragma_", 7)==0 ){
|
|
0 |
22 |
if( pMod==0 && sqlite3_strnicmp(zName, "pragma_", 7)==0 ){
|
118637
|
0 |
22 |
if( pMod && sqlite3VtabEponymousTableInit(pParse, pMod) ){
|
|
0 |
0 |
if( pMod && sqlite3VtabEponymousTableInit(pParse, pMod) ){
|
118643
|
14 |
8 |
if( flags & LOCATE_NOERR ) return 0;
|
118645
|
185 |
4397 |
}else if( IsVirtual(p) && (pParse->prepFlags & SQLITE_PREPARE_NO_VTAB)!=0 ){
|
|
0 |
185 |
}else if( IsVirtual(p) && (pParse->prepFlags & SQLITE_PREPARE_NO_VTAB)!=0 ){
|
118649
|
8 |
4582 |
if( p==0 ){
|
118650
|
0 |
8 |
const char *zMsg = flags & LOCATE_VIEW ? "no such view" : "no such table";
|
118651
|
0 |
8 |
if( zDbase ){
|
118679
|
10 |
4467 |
if( p->pSchema ){
|
118693
|
0 |
0 |
if( sqlite3StrNICmp(zName, "sqlite_", 7)==0 ){
|
118694
|
0 |
0 |
if( sqlite3StrICmp(zName+7, &LEGACY_SCHEMA_TABLE[7])==0 ){
|
118697
|
0 |
0 |
if( sqlite3StrICmp(zName+7, &LEGACY_TEMP_SCHEMA_TABLE[7])==0 ){
|
118721
|
2193 |
1032 |
for(i=OMIT_TEMPDB; i<db->nDb; i++){
|
118722
|
2157 |
36 |
int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */
|
118725
|
2193 |
0 |
if( zDb && sqlite3DbIsNamed(db, j, zDb)==0 ) continue;
|
|
1114 |
1079 |
if( zDb && sqlite3DbIsNamed(db, j, zDb)==0 ) continue;
|
118728
|
47 |
1032 |
if( p ) break;
|
118743
|
0 |
79 |
if( p->isResized ) sqlite3DbFree(db, (void *)p->azColl);
|
118763
|
0 |
0 |
if( ALWAYS(pIndex) ){
|
118764
|
0 |
0 |
if( pIndex->pTable->pIndex==pIndex ){
|
118771
|
0 |
0 |
while( ALWAYS(p) && p->pNext!=pIndex ){ p = p->pNext; }
|
|
0 |
0 |
while( ALWAYS(p) && p->pNext!=pIndex ){ p = p->pNext; }
|
118772
|
0 |
0 |
if( ALWAYS(p && p->pNext==pIndex) ){
|
|
0 |
0 |
if( ALWAYS(p && p->pNext==pIndex) ){
|
118791
|
5 |
329 |
for(i=j=2; i<db->nDb; i++){
|
118793
|
5 |
0 |
if( pDb->pBt==0 ){
|
118798
|
0 |
0 |
if( j<i ){
|
118804
|
329 |
0 |
if( db->nDb<=2 && db->aDb!=db->aDbStatic ){
|
|
5 |
324 |
if( db->nDb<=2 && db->aDb!=db->aDbStatic ){
|
118820
|
0 |
0 |
if( iDb>=0 ){
|
118827
|
0 |
0 |
if( db->nSchemaLock==0 ){
|
118828
|
0 |
0 |
for(i=0; i<db->nDb; i++){
|
118829
|
0 |
0 |
if( DbHasProperty(db, i, DB_ResetWanted) ){
|
118843
|
28 |
14 |
for(i=0; i<db->nDb; i++){
|
118845
|
28 |
0 |
if( pDb->pSchema ){
|
118846
|
28 |
0 |
if( db->nSchemaLock==0 ){
|
118856
|
14 |
0 |
if( db->nSchemaLock==0 ){
|
118882
|
0 |
4 |
if( pCol->iDflt==0
|
118883
|
0 |
0 |
|| NEVER(pList==0)
|
118884
|
0 |
0 |
|| NEVER(pList->nExpr<pCol->iDflt)
|
118886
|
2 |
2 |
pCol->iDflt = pList==0 ? 1 : pList->nExpr+1;
|
118900
|
202 |
0 |
if( pCol->iDflt==0 ) return 0;
|
118901
|
0 |
0 |
if( NEVER(!IsOrdinaryTable(pTab)) ) return 0;
|
118902
|
0 |
0 |
if( NEVER(pTab->u.tab.pDfltList==0) ) return 0;
|
118903
|
0 |
0 |
if( NEVER(pTab->u.tab.pDfltList->nExpr<pCol->iDflt) ) return 0;
|
118920
|
59 |
26 |
if( pCol->colFlags & COLFLAG_HASTYPE ){
|
118925
|
85 |
0 |
if( zNew ){
|
118937
|
1916 |
147 |
if( (pCol->colFlags & COLFLAG_HASCOLL)==0 ) return 0;
|
118939
|
981 |
147 |
while( *z ){ z++; }
|
118940
|
147 |
0 |
if( pCol->colFlags & COLFLAG_HASTYPE ){
|
118941
|
588 |
147 |
do{ z++; }while( *z );
|
118955
|
1015 |
61 |
if( (pCol = pTable->aCol)!=0 ){
|
118956
|
3487 |
1015 |
for(i=0; i<pTable->nCol; i++, pCol++){
|
118961
|
984 |
31 |
if( IsOrdinaryTable(pTable) ){
|
118964
|
1009 |
6 |
if( db->pnBytesFreed==0 ){
|
118967
|
978 |
31 |
if( IsOrdinaryTable(pTable) ){
|
119008
|
74 |
1076 |
for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){
|
119012
|
74 |
0 |
if( db->pnBytesFreed==0 && !IsVirtual(pTable) ){
|
|
74 |
0 |
if( db->pnBytesFreed==0 && !IsVirtual(pTable) ){
|
119023
|
1015 |
61 |
if( IsOrdinaryTable(pTable) ){
|
119027
|
61 |
0 |
else if( IsVirtual(pTable) ){
|
119050
|
3083 |
5565 |
if( !pTable ) return;
|
119051
|
5559 |
6 |
if( db->pnBytesFreed==0 && (--pTable->nTabRef)>0 ) return;
|
|
4489 |
1070 |
if( db->pnBytesFreed==0 && (--pTable->nTabRef)>0 ) return;
|
119090
|
9052 |
118 |
if( pName ){
|
119107
|
292 |
5 |
if( p->nTab==0 ){
|
119120
|
309 |
0 |
if( zName ){
|
119122
|
630 |
0 |
for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){
|
119123
|
309 |
321 |
if( 0==sqlite3_stricmp(pDb->zDbSName, zName) ) break;
|
119126
|
0 |
321 |
if( i==0 && 0==sqlite3_stricmp("main", zName) ) break;
|
|
0 |
0 |
if( i==0 && 0==sqlite3_stricmp("main", zName) ) break;
|
119173
|
161 |
672 |
if( pName2->n>0 ){
|
119174
|
0 |
161 |
if( db->init.busy ) {
|
119180
|
0 |
161 |
if( iDb<0 ){
|
119225
|
1051 |
0 |
if( sqlite3WritableSchema(db)
|
119226
|
1051 |
0 |
|| db->init.imposterTable
|
119227
|
0 |
1051 |
|| !sqlite3Config.bExtraSchemaChecks
|
119232
|
749 |
302 |
if( db->init.busy ){
|
119233
|
749 |
0 |
if( sqlite3_stricmp(zType, db->init.azInit[0])
|
119234
|
749 |
0 |
|| sqlite3_stricmp(zName, db->init.azInit[1])
|
119235
|
0 |
749 |
|| sqlite3_stricmp(zTblName, db->init.azInit[2])
|
119241
|
297 |
5 |
if( (pParse->nested==0 && 0==sqlite3StrNICmp(zName, "sqlite_", 7))
|
|
297 |
0 |
if( (pParse->nested==0 && 0==sqlite3StrNICmp(zName, "sqlite_", 7))
|
119242
|
1 |
301 |
|| (sqlite3ReadOnlyShadowTables(db) && sqlite3ShadowTableName(db, zName))
|
|
0 |
1 |
|| (sqlite3ReadOnlyShadowTables(db) && sqlite3ShadowTableName(db, zName))
|
119258
|
30 |
46 |
for(p=pTab->pIndex; p && !IsPrimaryKeyIndex(p); p=p->pNext){}
|
|
4 |
26 |
for(p=pTab->pIndex; p && !IsPrimaryKeyIndex(p); p=p->pNext){}
|
119270
|
284 |
53 |
for(i=0; i<pIdx->nColumn; i++){
|
119271
|
106 |
178 |
if( iCol==pIdx->aiColumn[i] ) return i;
|
119289
|
0 |
100 |
if( pTab->tabFlags & TF_HasVirtual ){
|
119291
|
0 |
0 |
for(i=0; i<=iCol; i++){
|
119292
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_VIRTUAL ) iCol++;
|
119340
|
0 |
4669 |
if( (pTab->tabFlags & TF_HasVirtual)==0 || iCol<0 ) return iCol;
|
|
0 |
0 |
if( (pTab->tabFlags & TF_HasVirtual)==0 || iCol<0 ) return iCol;
|
119341
|
0 |
0 |
for(i=0, n=0; i<iCol; i++){
|
119342
|
0 |
0 |
if( (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 ) n++;
|
119344
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_VIRTUAL ){
|
119365
|
2 |
0 |
if( v ){
|
119403
|
744 |
297 |
if( db->init.busy && db->init.newTnum==1 ){
|
|
437 |
307 |
if( db->init.busy && db->init.newTnum==1 ){
|
119406
|
216 |
221 |
zName = sqlite3DbStrDup(db, SCHEMA_TABLE(iDb));
|
119411
|
0 |
604 |
if( iDb<0 ) return;
|
119412
|
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 ){
|
119418
|
25 |
579 |
if( !OMIT_TEMPDB && isTemp ) iDb = 1;
|
119420
|
0 |
604 |
if( IN_RENAME_OBJECT ){
|
119425
|
0 |
1041 |
if( zName==0 ) return;
|
119426
|
0 |
1041 |
if( sqlite3CheckObjectName(pParse, zName, isView?"view":"table", zName) ){
|
|
0 |
1041 |
if( sqlite3CheckObjectName(pParse, zName, isView?"view":"table", zName) ){
|
119429
|
247 |
794 |
if( db->init.iDb==1 ) isTemp = 1;
|
119441
|
272 |
769 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){
|
|
0 |
1041 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){
|
119444
|
980 |
61 |
if( !isVirtual && sqlite3AuthCheck(pParse, (int)aCode[isTemp+2*isView],
|
|
0 |
980 |
if( !isVirtual && sqlite3AuthCheck(pParse, (int)aCode[isTemp+2*isView],
|
119458
|
1010 |
31 |
if( !IN_SPECIAL_PARSE ){
|
119460
|
0 |
1010 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
|
119464
|
0 |
1010 |
if( pTable ){
|
119465
|
0 |
0 |
if( !noErr ){
|
119466
|
0 |
0 |
sqlite3ErrorMsg(pParse, "%s %T already exists",
|
119475
|
0 |
1010 |
if( sqlite3FindIndex(db, zName, zDb)!=0 ){
|
119482
|
0 |
1041 |
if( pTable==0 ){
|
119508
|
297 |
744 |
if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){
|
|
297 |
0 |
if( !db->init.busy && (v = sqlite3GetVdbe(pParse))!=0 ){
|
119517
|
29 |
268 |
if( isVirtual ){
|
119532
|
0 |
297 |
1 : SQLITE_MAX_FILE_FORMAT;
|
119547
|
297 |
0 |
if( isView || isVirtual ){
|
|
29 |
268 |
if( isView || isVirtual ){
|
119626
|
0 |
0 |
if( pParse->pNewTrigger ){
|
119633
|
0 |
0 |
if( pRet==0 ){
|
119643
|
0 |
0 |
if( db->mallocFailed ) return;
|
119657
|
0 |
0 |
if( sqlite3HashInsert(pHash, RETURNING_TRIGGER_NAME, &pRet->retTrig)
|
119684
|
0 |
3341 |
if( (p = pParse->pNewTable)==0 ) return;
|
119685
|
0 |
3341 |
if( p->nCol+1>db->aLimit[SQLITE_LIMIT_COLUMN] ){
|
119689
|
3341 |
0 |
if( !IN_RENAME_OBJECT ) sqlite3DequoteToken(&sName);
|
119695
|
0 |
3341 |
if( sType.n>=16
|
119696
|
0 |
0 |
&& sqlite3_strnicmp(sType.z+(sType.n-6),"always",6)==0
|
119699
|
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--;
|
119700
|
0 |
0 |
if( sType.n>=9
|
119701
|
0 |
0 |
&& sqlite3_strnicmp(sType.z+(sType.n-9),"generated",9)==0
|
119704
|
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--;
|
119711
|
2973 |
368 |
if( sType.n>=3 ){
|
119713
|
15281 |
166 |
for(i=0; i<SQLITE_N_STDTYPE; i++){
|
119714
|
6951 |
8330 |
if( sType.n==sqlite3StdTypeLen[i]
|
119715
|
2807 |
4144 |
&& sqlite3_strnicmp(sType.z, sqlite3StdType[i], sType.n)==0
|
119720
|
1887 |
920 |
if( affinity<=SQLITE_AFF_TEXT ) szEst = 5;
|
119727
|
0 |
3341 |
if( z==0 ) return;
|
119728
|
0 |
3341 |
if( IN_RENAME_OBJECT ) sqlite3RenameTokenMap(pParse, (void*)z, &sName);
|
119733
|
5393 |
3341 |
for(i=0; i<p->nCol; i++){
|
119734
|
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 ){
|
119741
|
0 |
3341 |
if( aNew==0 ){
|
119752
|
3173 |
168 |
if( sType.n==0 ){
|
119788
|
173 |
0 |
if( p==0 || NEVER(p->nCol<1) ) return;
|
|
0 |
173 |
if( p==0 || NEVER(p->nCol<1) ) return;
|
119795
|
0 |
173 |
if( pCol->colFlags & COLFLAG_UNIQUE ){
|
119797
|
0 |
0 |
for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){
|
119799
|
0 |
0 |
if( pIdx->aiColumn[0]==p->nCol-1 ){
|
119837
|
1577 |
199 |
while( zIn[0] ){
|
119840
|
126 |
1451 |
if( h==(('c'<<24)+('h'<<16)+('a'<<8)+'r') ){ /* CHAR */
|
119843
|
0 |
1451 |
}else if( h==(('c'<<24)+('l'<<16)+('o'<<8)+'b') ){ /* CLOB */
|
119845
|
33 |
1418 |
}else if( h==(('t'<<24)+('e'<<16)+('x'<<8)+'t') ){ /* TEXT */
|
119847
|
2 |
1416 |
}else if( h==(('b'<<24)+('l'<<16)+('o'<<8)+'b') /* BLOB */
|
119848
|
0 |
2 |
&& (aff==SQLITE_AFF_NUMERIC || aff==SQLITE_AFF_REAL) ){
|
|
0 |
0 |
&& (aff==SQLITE_AFF_NUMERIC || aff==SQLITE_AFF_REAL) ){
|
119850
|
0 |
2 |
if( zIn[0]=='(' ) zChar = zIn;
|
119852
|
0 |
1416 |
}else if( h==(('r'<<24)+('e'<<16)+('a'<<8)+'l') /* REAL */
|
119853
|
0 |
0 |
&& aff==SQLITE_AFF_NUMERIC ){
|
119855
|
0 |
1416 |
}else if( h==(('f'<<24)+('l'<<16)+('o'<<8)+'a') /* FLOA */
|
119856
|
0 |
0 |
&& aff==SQLITE_AFF_NUMERIC ){
|
119858
|
0 |
1416 |
}else if( h==(('d'<<24)+('o'<<16)+('u'<<8)+'b') /* DOUB */
|
119859
|
0 |
0 |
&& aff==SQLITE_AFF_NUMERIC ){
|
119862
|
7 |
1409 |
}else if( (h&0x00FFFFFF)==(('i'<<16)+('n'<<8)+'t') ){ /* INT */
|
119870
|
168 |
38 |
if( pCol ){
|
119872
|
128 |
40 |
if( aff<SQLITE_AFF_NUMERIC ){
|
119873
|
126 |
2 |
if( zChar ){
|
119874
|
269 |
27 |
while( zChar[0] ){
|
119875
|
99 |
170 |
if( sqlite3Isdigit(zChar[0]) ){
|
119892
|
0 |
168 |
if( v>255 ) v = 255;
|
119918
|
4 |
0 |
if( p!=0 ){
|
119919
|
2 |
2 |
int isInit = db->init.busy && db->init.iDb!=1;
|
|
2 |
0 |
int isInit = db->init.busy && db->init.iDb!=1;
|
119921
|
0 |
4 |
if( !sqlite3ExprIsConstantOrFunction(pExpr, isInit) ){
|
119925
|
0 |
4 |
}else if( pCol->colFlags & COLFLAG_GENERATED ){
|
119945
|
0 |
4 |
if( IN_RENAME_OBJECT ){
|
119968
|
0 |
218 |
if( p->op==TK_STRING ){
|
119970
|
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 ){
|
119981
|
0 |
265 |
if( pCol->colFlags & COLFLAG_GENERATED ){
|
120019
|
0 |
220 |
if( pTab==0 ) goto primary_key_exit;
|
120020
|
0 |
220 |
if( pTab->tabFlags & TF_HasPrimaryKey ){
|
120026
|
179 |
41 |
if( pList==0 ){
|
120033
|
86 |
41 |
for(i=0; i<nTerm; i++){
|
120037
|
86 |
0 |
if( pCExpr->op==TK_ID ){
|
120041
|
159 |
0 |
for(iCol=0; iCol<pTab->nCol; iCol++){
|
120042
|
86 |
73 |
if( sqlite3StrICmp(zCName, pTab->aCol[iCol].zCnName)==0 ){
|
120051
|
189 |
31 |
if( nTerm==1
|
120052
|
189 |
0 |
&& pCol
|
120053
|
167 |
22 |
&& pCol->eCType==COLTYPE_INTEGER
|
120054
|
167 |
0 |
&& sortOrder!=SQLITE_SO_DESC
|
120056
|
0 |
167 |
if( IN_RENAME_OBJECT && pList ){
|
|
0 |
0 |
if( IN_RENAME_OBJECT && pList ){
|
120064
|
6 |
161 |
if( pList ) pParse->iPkSortOrder = pList->a[0].fg.sortFlags;
|
120066
|
0 |
53 |
}else if( autoInc ){
|
120094
|
6 |
0 |
if( pTab && !IN_DECLARE_VTAB
|
|
6 |
0 |
if( pTab && !IN_DECLARE_VTAB
|
120095
|
6 |
0 |
&& !sqlite3BtreeIsReadonly(db->aDb[db->init.iDb].pBt)
|
120098
|
0 |
6 |
if( pParse->constraintName.n ){
|
120102
|
0 |
6 |
for(zStart++; sqlite3Isspace(zStart[0]); zStart++){}
|
120103
|
0 |
6 |
while( sqlite3Isspace(zEnd[-1]) ){ zEnd--; }
|
120125
|
0 |
0 |
if( (p = pParse->pNewTable)==0 || IN_RENAME_OBJECT ) return;
|
|
0 |
0 |
if( (p = pParse->pNewTable)==0 || IN_RENAME_OBJECT ) return;
|
120129
|
0 |
0 |
if( !zColl ) return;
|
120131
|
0 |
0 |
if( sqlite3LocateCollSeq(pParse, zColl) ){
|
120139
|
0 |
0 |
for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){
|
120141
|
0 |
0 |
if( pIdx->aiColumn[0]==i ){
|
120157
|
0 |
0 |
if( pTab==0 ){
|
120162
|
0 |
0 |
if( IN_DECLARE_VTAB ){
|
120166
|
0 |
0 |
if( pCol->iDflt>0 ) goto generated_error;
|
120167
|
0 |
0 |
if( pType ){
|
120168
|
0 |
0 |
if( pType->n==7 && sqlite3StrNICmp("virtual",pType->z,7)==0 ){
|
|
0 |
0 |
if( pType->n==7 && sqlite3StrNICmp("virtual",pType->z,7)==0 ){
|
120170
|
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 ){
|
120176
|
0 |
0 |
if( eType==COLFLAG_VIRTUAL ) pTab->nNVCol--;
|
120181
|
0 |
0 |
if( pCol->colFlags & COLFLAG_PRIMKEY ){
|
120184
|
0 |
0 |
if( ALWAYS(pExpr) && pExpr->op==TK_ID ){
|
|
0 |
0 |
if( ALWAYS(pExpr) && pExpr->op==TK_ID ){
|
120191
|
0 |
0 |
if( pExpr && pExpr->op!=TK_RAISE ) pExpr->affExpr = pCol->affinity;
|
|
0 |
0 |
if( pExpr && pExpr->op!=TK_RAISE ) pExpr->affExpr = pCol->affinity;
|
120246
|
0 |
0 |
for(n=0; *z; n++, z++){
|
120247
|
0 |
0 |
if( *z=='"' ){ n++; }
|
120270
|
0 |
0 |
for(j=0; zIdent[j]; j++){
|
120271
|
0 |
0 |
if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break;
|
|
0 |
0 |
if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break;
|
120274
|
0 |
0 |
|| sqlite3KeywordCode(zIdent, j)!=TK_ID
|
120275
|
0 |
0 |
|| zIdent[j]!=0
|
120276
|
0 |
0 |
|| j==0;
|
|
0 |
0 |
|| j==0;
|
120278
|
0 |
0 |
if( needQuote ) z[i++] = '"';
|
120279
|
0 |
0 |
for(j=0; zIdent[j]; j++){
|
120281
|
0 |
0 |
if( zIdent[j]=='"' ) z[i++] = '"';
|
120283
|
0 |
0 |
if( needQuote ) z[i++] = '"';
|
120299
|
0 |
0 |
for(pCol = p->aCol, i=0; i<p->nCol; i++, pCol++){
|
120303
|
0 |
0 |
if( n<50 ){
|
120314
|
0 |
0 |
if( zStmt==0 ){
|
120322
|
0 |
0 |
for(pCol=p->aCol, i=0; i<p->nCol; i++, pCol++){
|
120367
|
0 |
0 |
if( pIdx->nColumn>=N ) return SQLITE_OK;
|
120371
|
0 |
0 |
if( zExtra==0 ) return SQLITE_NOMEM_BKPT;
|
120395
|
3341 |
980 |
for(i=pTab->nCol, pTabCol=pTab->aCol; i>0; i--, pTabCol++){
|
120398
|
813 |
167 |
if( pTab->iPKey<0 ) wTable++;
|
120409
|
211 |
79 |
for(i=0; i<pIdx->nColumn; i++){
|
120412
|
132 |
79 |
wIndex += x<0 ? 1 : aCol[pIdx->aiColumn[i]].szEst;
|
120422
|
0 |
0 |
while( nCol-- > 0 ){
|
120423
|
0 |
0 |
if( x==*(aiCol++) ){
|
120453
|
0 |
0 |
for(i=0; i<nKey; i++){
|
120455
|
0 |
0 |
if( pIdx->aiColumn[i]==j
|
120456
|
0 |
0 |
&& sqlite3StrICmp(pIdx->azColl[i], pPk->azColl[iCol])==0
|
120487
|
211 |
79 |
for(j=pIdx->nColumn-1; j>=0; j--){
|
120489
|
132 |
79 |
if( x>=0 && (pTab->aCol[x].colFlags & COLFLAG_VIRTUAL)==0 ){
|
|
132 |
0 |
if( x>=0 && (pTab->aCol[x].colFlags & COLFLAG_VIRTUAL)==0 ){
|
120492
|
132 |
0 |
if( x<BMS-1 ) m |= MASKBIT(x);
|
120534
|
0 |
0 |
if( !db->init.imposterTable ){
|
120535
|
0 |
0 |
for(i=0; i<pTab->nCol; i++){
|
120536
|
0 |
0 |
if( (pTab->aCol[i].colFlags & COLFLAG_PRIMKEY)!=0
|
120537
|
0 |
0 |
&& (pTab->aCol[i].notNull==OE_None)
|
120549
|
0 |
0 |
if( pParse->u1.addrCrTab ){
|
120557
|
0 |
0 |
if( pTab->iPKey>=0 ){
|
120563
|
0 |
0 |
if( pList==0 ){
|
120567
|
0 |
0 |
if( IN_RENAME_OBJECT ){
|
120575
|
0 |
0 |
if( pParse->nErr ){
|
120591
|
0 |
0 |
for(i=j=1; i<pPk->nKeyCol; i++){
|
120592
|
0 |
0 |
if( isDupColumn(pPk, j, pPk, i) ){
|
120605
|
0 |
0 |
if( !db->init.imposterTable ) pPk->uniqNotNull = 1;
|
120612
|
0 |
0 |
if( v && pPk->tnum>0 ){
|
|
0 |
0 |
if( v && pPk->tnum>0 ){
|
120623
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
120625
|
0 |
0 |
if( IsPrimaryKeyIndex(pIdx) ) continue;
|
120626
|
0 |
0 |
for(i=n=0; i<nPk; i++){
|
120627
|
0 |
0 |
if( !isDupColumn(pIdx, pIdx->nKeyCol, pPk, i) ){
|
120632
|
0 |
0 |
if( n==0 ){
|
120637
|
0 |
0 |
if( resizeIndexObject(db, pIdx, pIdx->nKeyCol+n) ) return;
|
120638
|
0 |
0 |
for(i=0, j=pIdx->nKeyCol; i<nPk; i++){
|
120639
|
0 |
0 |
if( !isDupColumn(pIdx, pIdx->nKeyCol, pPk, i) ){
|
120643
|
0 |
0 |
if( pPk->aSortOrder[i] ){
|
120657
|
0 |
0 |
for(i=0; i<pTab->nCol; i++){
|
120658
|
0 |
0 |
if( !hasColumn(pPk->aiColumn, nPk, i)
|
120659
|
0 |
0 |
&& (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 ) nExtra++;
|
120661
|
0 |
0 |
if( resizeIndexObject(db, pPk, nPk+nExtra) ) return;
|
120662
|
0 |
0 |
for(i=0, j=nPk; i<pTab->nCol; i++){
|
120663
|
0 |
0 |
if( !hasColumn(pPk->aiColumn, j, i)
|
120664
|
0 |
0 |
&& (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0
|
120687
|
0 |
74 |
if( !IsVirtual(pTab) ) return 0;
|
120689
|
0 |
74 |
if( sqlite3_strnicmp(zName, pTab->zName, nName)!=0 ) return 0;
|
120690
|
0 |
74 |
if( zName[nName]!='_' ) return 0;
|
120692
|
0 |
74 |
if( pMod==0 ) return 0;
|
120693
|
0 |
74 |
if( pMod->pModule->iVersion<3 ) return 0;
|
120694
|
0 |
74 |
if( pMod->pModule->xShadowName==0 ) return 0;
|
120713
|
0 |
32 |
if( pMod==0 ) return;
|
120714
|
0 |
32 |
if( NEVER(pMod->pModule==0) ) return;
|
120715
|
21 |
11 |
if( pMod->pModule->iVersion<3 ) return;
|
120716
|
0 |
11 |
if( pMod->pModule->xShadowName==0 ) return;
|
120719
|
23 |
11 |
for(k=sqliteHashFirst(&pTab->pSchema->tblHash); k; k=sqliteHashNext(k)){
|
120722
|
4 |
19 |
if( !IsOrdinaryTable(pOther) ) continue;
|
120723
|
6 |
13 |
if( pOther->tabFlags & TF_Shadow ) continue;
|
120724
|
0 |
13 |
if( sqlite3StrNICmp(pOther->zName, pTab->zName, nName)==0
|
120725
|
0 |
0 |
&& pOther->zName[nName]=='_'
|
120726
|
0 |
0 |
&& pMod->pModule->xShadowName(pOther->zName+nName+1)
|
120746
|
355 |
626 |
if( zTail==0 ) return 0;
|
120750
|
552 |
74 |
if( pTab==0 ) return 0;
|
120751
|
0 |
74 |
if( !IsVirtual(pTab) ) return 0;
|
120816
|
0 |
980 |
if( pEnd==0 && pSelect==0 ){
|
|
0 |
0 |
if( pEnd==0 && pSelect==0 ){
|
120820
|
0 |
980 |
if( p==0 ) return;
|
120822
|
980 |
0 |
if( pSelect==0 && sqlite3ShadowTableName(db, p->zName) ){
|
|
74 |
906 |
if( pSelect==0 && sqlite3ShadowTableName(db, p->zName) ){
|
120835
|
712 |
268 |
if( db->init.busy ){
|
120836
|
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) ){
|
120841
|
437 |
275 |
if( p->tnum==1 ) p->tabFlags |= TF_Readonly;
|
120853
|
0 |
980 |
if( tabOpts & TF_Strict ){
|
120856
|
0 |
0 |
for(ii=0; ii<p->nCol; ii++){
|
120858
|
0 |
0 |
if( pCol->eCType==COLTYPE_CUSTOM ){
|
120859
|
0 |
0 |
if( pCol->colFlags & COLFLAG_HASTYPE ){
|
120869
|
0 |
0 |
}else if( pCol->eCType==COLTYPE_ANY ){
|
120872
|
0 |
0 |
if( (pCol->colFlags & COLFLAG_PRIMKEY)!=0
|
120873
|
0 |
0 |
&& p->iPKey!=ii
|
120874
|
0 |
0 |
&& pCol->notNull == OE_None
|
120888
|
0 |
980 |
if( tabOpts & TF_WithoutRowid ){
|
120889
|
0 |
0 |
if( (p->tabFlags & TF_Autoincrement) ){
|
120894
|
0 |
0 |
if( (p->tabFlags & TF_HasPrimaryKey)==0 ){
|
120906
|
6 |
974 |
if( p->pCheck ){
|
120908
|
2 |
4 |
if( pParse->nErr ){
|
120919
|
0 |
980 |
if( p->tabFlags & TF_HasGenerated ){
|
120923
|
0 |
0 |
for(ii=0; ii<p->nCol; ii++){
|
120925
|
0 |
0 |
if( (colFlags & COLFLAG_GENERATED)!=0 ){
|
120929
|
0 |
0 |
if( sqlite3ResolveSelfReference(pParse, p, NC_GenCol, pX, 0) ){
|
120943
|
0 |
0 |
if( nNG==0 ){
|
120952
|
69 |
980 |
for(pIdx=p->pIndex; pIdx; pIdx=pIdx->pNext){
|
120962
|
268 |
712 |
if( !db->init.busy ){
|
120970
|
0 |
268 |
if( NEVER(v==0) ) return;
|
120977
|
268 |
0 |
if( IsOrdinaryTable(p) ){
|
121002
|
0 |
268 |
if( pSelect ){
|
121011
|
0 |
0 |
if( IN_SPECIAL_PARSE ){
|
121026
|
0 |
0 |
if( pParse->nErr ) return;
|
121028
|
0 |
0 |
if( pSelTab==0 ) return;
|
121037
|
0 |
0 |
if( pParse->nErr ) return;
|
121052
|
0 |
268 |
if( pSelect ){
|
121055
|
0 |
268 |
Token *pEnd2 = tabOpts ? &pParse->sLastToken : pEnd;
|
121057
|
268 |
0 |
if( pEnd2->z[0]!=';' ) n += pEnd2->n;
|
121086
|
5 |
263 |
if( (p->tabFlags & TF_Autoincrement)!=0 && !IN_SPECIAL_PARSE ){
|
|
5 |
0 |
if( (p->tabFlags & TF_Autoincrement)!=0 && !IN_SPECIAL_PARSE ){
|
121089
|
4 |
1 |
if( pDb->pSchema->pSeqTab==0 ){
|
121105
|
712 |
268 |
if( db->init.busy ){
|
121111
|
0 |
712 |
if( pOld ){
|
121124
|
4 |
708 |
if( strcmp(p->zName, "sqlite_sequence")==0 ){
|
121132
|
980 |
0 |
if( !pSelect && IsOrdinaryTable(p) ){
|
|
980 |
0 |
if( !pSelect && IsOrdinaryTable(p) ){
|
121134
|
931 |
49 |
if( pCons->z==0 ){
|
121165
|
0 |
0 |
if( pParse->nVar>0 ){
|
121171
|
0 |
0 |
if( p==0 || pParse->nErr ) goto create_view_fail;
|
|
0 |
0 |
if( p==0 || pParse->nErr ) goto create_view_fail;
|
121185
|
0 |
0 |
if( sqlite3FixSelect(&sFix, pSelect) ) goto create_view_fail;
|
121193
|
0 |
0 |
if( IN_RENAME_OBJECT ){
|
121201
|
0 |
0 |
if( db->mallocFailed ) goto create_view_fail;
|
121208
|
0 |
0 |
if( sEnd.z[0]!=';' ){
|
121215
|
0 |
0 |
while( sqlite3Isspace(z[n-1]) ){ n--; }
|
121224
|
0 |
0 |
if( IN_RENAME_OBJECT ){
|
121253
|
185 |
0 |
if( IsVirtual(pTable) ){
|
121283
|
0 |
0 |
if( pTable->nCol<0 ){
|
121298
|
0 |
0 |
if( pSel ){
|
121316
|
0 |
0 |
if( pSelTab==0 ){
|
121319
|
0 |
0 |
}else if( pTable->pCheck ){
|
121328
|
0 |
0 |
if( pParse->nErr==0
|
121329
|
0 |
0 |
&& pTable->nCol==pSel->pEList->nExpr
|
121349
|
0 |
0 |
EnableLookaside;
|
121355
|
0 |
0 |
if( db->mallocFailed ){
|
121363
|
3079 |
185 |
if( !IsVirtual(pTable) && pTable->nCol>0 ) return 0;
|
|
3079 |
0 |
if( !IsVirtual(pTable) && pTable->nCol>0 ) return 0;
|
121375
|
7 |
0 |
if( !DbHasProperty(db, idx, DB_UnresetViews) ) return;
|
121376
|
0 |
0 |
for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){
|
121378
|
0 |
0 |
if( IsView(pTab) ){
|
121414
|
0 |
0 |
for(pElem=sqliteHashFirst(pHash); pElem; pElem=sqliteHashNext(pElem)){
|
121416
|
0 |
0 |
if( pTab->tnum==iFrom ){
|
121421
|
0 |
0 |
for(pElem=sqliteHashFirst(pHash); pElem; pElem=sqliteHashNext(pElem)){
|
121423
|
0 |
0 |
if( pIdx->tnum==iFrom ){
|
121439
|
0 |
5 |
if( iTable<2 ) sqlite3ErrorMsg(pParse, "corrupt schema");
|
121490
|
5 |
5 |
if( iDestroyed==0 || iTab<iDestroyed ){
|
|
0 |
5 |
if( iDestroyed==0 || iTab<iDestroyed ){
|
121493
|
0 |
10 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
121496
|
0 |
0 |
if( (iDestroyed==0 || (iIdx<iDestroyed)) && iIdx>iLargest ){
|
|
0 |
0 |
if( (iDestroyed==0 || (iIdx<iDestroyed)) && iIdx>iLargest ){
|
|
0 |
0 |
if( (iDestroyed==0 || (iIdx<iDestroyed)) && iIdx>iLargest ){
|
121500
|
5 |
5 |
if( iLargest==0 ){
|
121523
|
28 |
7 |
for(i=1; i<=4; i++){
|
121526
|
0 |
28 |
if( sqlite3FindTable(pParse->db, zTab, zDbName) ){
|
121549
|
2 |
5 |
if( IsVirtual(pTab) ){
|
121559
|
0 |
7 |
while( pTrigger ){
|
121572
|
0 |
7 |
if( pTab->tabFlags & TF_Autoincrement ){
|
121591
|
7 |
0 |
if( !isView && !IsVirtual(pTab) ){
|
|
5 |
2 |
if( !isView && !IsVirtual(pTab) ){
|
121598
|
2 |
5 |
if( IsVirtual(pTab) ){
|
121613
|
1 |
350 |
if( (db->flags & SQLITE_Defensive)!=0
|
121614
|
1 |
0 |
&& db->pVtabCtx==0
|
121615
|
1 |
0 |
&& db->nVdbeExec==0
|
121616
|
0 |
1 |
&& !sqlite3VtabInSync(db)
|
|
0 |
0 |
&& !sqlite3VtabInSync(db)
|
121628
|
0 |
7 |
if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 ){
|
121629
|
0 |
0 |
if( sqlite3StrNICmp(pTab->zName+7, "stat", 4)==0 ) return 0;
|
121630
|
0 |
0 |
if( sqlite3StrNICmp(pTab->zName+7, "parameters", 10)==0 ) return 0;
|
121633
|
0 |
7 |
if( (pTab->tabFlags & TF_Shadow)!=0 && sqlite3ReadOnlyShadowTables(db) ){
|
|
0 |
0 |
if( (pTab->tabFlags & TF_Shadow)!=0 && sqlite3ReadOnlyShadowTables(db) ){
|
121636
|
0 |
7 |
if( pTab->tabFlags & TF_Eponymous ){
|
121652
|
0 |
15 |
if( db->mallocFailed ){
|
121657
|
0 |
15 |
if( sqlite3ReadSchema(pParse) ) goto exit_drop_table;
|
121658
|
2 |
13 |
if( noErr ) db->suppressErr++;
|
121661
|
2 |
13 |
if( noErr ) db->suppressErr--;
|
121663
|
8 |
7 |
if( pTab==0 ){
|
121664
|
2 |
6 |
if( noErr ){
|
121676
|
2 |
5 |
if( IsVirtual(pTab) && sqlite3ViewGetColumnNames(pParse, pTab) ){
|
|
0 |
2 |
if( IsVirtual(pTab) && sqlite3ViewGetColumnNames(pParse, pTab) ){
|
121682
|
0 |
7 |
const char *zTab = SCHEMA_TABLE(iDb);
|
121685
|
0 |
7 |
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb)){
|
121688
|
0 |
7 |
if( isView ){
|
121689
|
0 |
0 |
if( !OMIT_TEMPDB && iDb==1 ){
|
121695
|
2 |
5 |
}else if( IsVirtual(pTab) ){
|
121700
|
0 |
5 |
if( !OMIT_TEMPDB && iDb==1 ){
|
121706
|
0 |
7 |
if( sqlite3AuthCheck(pParse, code, pTab->zName, zArg2, zDb) ){
|
121709
|
0 |
7 |
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){
|
121714
|
0 |
7 |
if( tableMayNotBeDropped(db, pTab) ){
|
121723
|
0 |
7 |
if( isView && !IsView(pTab) ){
|
|
0 |
0 |
if( isView && !IsView(pTab) ){
|
121727
|
7 |
0 |
if( !isView && IsView(pTab) ){
|
|
0 |
7 |
if( !isView && IsView(pTab) ){
|
121737
|
7 |
0 |
if( v ){
|
121739
|
7 |
0 |
if( !isView ){
|
121784
|
16 |
0 |
if( p==0 || IN_DECLARE_VTAB ) goto fk_end;
|
|
16 |
0 |
if( p==0 || IN_DECLARE_VTAB ) goto fk_end;
|
121785
|
12 |
4 |
if( pFromCol==0 ){
|
121787
|
0 |
12 |
if( NEVER(iCol<0) ) goto fk_end;
|
121788
|
12 |
0 |
if( pToCol && pToCol->nExpr!=1 ){
|
|
0 |
12 |
if( pToCol && pToCol->nExpr!=1 ){
|
121795
|
4 |
0 |
}else if( pToCol && pToCol->nExpr!=pFromCol->nExpr ){
|
|
0 |
4 |
}else if( pToCol && pToCol->nExpr!=pFromCol->nExpr ){
|
121804
|
16 |
0 |
if( pToCol ){
|
121805
|
18 |
16 |
for(i=0; i<pToCol->nExpr; i++){
|
121810
|
0 |
16 |
if( pFKey==0 ){
|
121818
|
0 |
16 |
if( IN_RENAME_OBJECT ){
|
121826
|
12 |
4 |
if( pFromCol==0 ){
|
121829
|
6 |
4 |
for(i=0; i<nCol; i++){
|
121831
|
16 |
0 |
for(j=0; j<p->nCol; j++){
|
121832
|
6 |
10 |
if( sqlite3StrICmp(p->aCol[j].zCnName, pFromCol->a[i].zEName)==0 ){
|
121837
|
0 |
6 |
if( j>=p->nCol ){
|
121843
|
0 |
6 |
if( IN_RENAME_OBJECT ){
|
121848
|
16 |
0 |
if( pToCol ){
|
121849
|
18 |
16 |
for(i=0; i<nCol; i++){
|
121852
|
0 |
18 |
if( IN_RENAME_OBJECT ){
|
121868
|
0 |
16 |
if( pNextTo==pFKey ){
|
121872
|
0 |
16 |
if( pNextTo ){
|
121902
|
0 |
6 |
if( (pTab = pParse->pNewTable)==0 ) return;
|
121903
|
0 |
6 |
if( NEVER(!IsOrdinaryTable(pTab)) ) return;
|
121904
|
0 |
6 |
if( (pFKey = pTab->u.tab.pFKey)==0 ) return;
|
121937
|
0 |
5 |
if( sqlite3AuthCheck(pParse, SQLITE_REINDEX, pIndex->zName, 0,
|
121947
|
0 |
5 |
if( v==0 ) return;
|
121948
|
5 |
0 |
if( memRootPage>=0 ){
|
121973
|
0 |
5 |
if( memRootPage<0 ) sqlite3VdbeAddOp2(v, OP_Clear, tnum, iDb);
|
121976
|
5 |
0 |
sqlite3VdbeChangeP5(v, OPFLAG_BULKCSR|((memRootPage>=0)?OPFLAG_P2ISREG:0));
|
121979
|
2 |
3 |
if( IsUniqueIndex(pIndex) ){
|
121999
|
5 |
0 |
if( !pIndex->bAscKeyBug ){
|
122042
|
80 |
0 |
if( p ){
|
122061
|
59 |
187 |
if( pList ){
|
122063
|
112 |
59 |
for(i=0; i<pList->nExpr; i++){
|
122064
|
0 |
112 |
if( pList->a[i].fg.bNulls ){
|
122066
|
0 |
0 |
sqlite3ErrorMsg(pParse, "unsupported use of NULLS %s",
|
122067
|
0 |
0 |
(sf==0 || sf==3) ? "FIRST" : "LAST"
|
122119
|
0 |
79 |
if( pParse->nErr ){
|
122123
|
0 |
79 |
if( IN_DECLARE_VTAB && idxType!=SQLITE_IDXTYPE_PRIMARYKEY ){
|
|
0 |
0 |
if( IN_DECLARE_VTAB && idxType!=SQLITE_IDXTYPE_PRIMARYKEY ){
|
122126
|
0 |
79 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
|
122129
|
0 |
79 |
if( sqlite3HasExplicitNulls(pParse, pList) ){
|
122136
|
10 |
69 |
if( pTblName!=0 ){
|
122144
|
0 |
10 |
if( iDb<0 ) goto exit_create_index;
|
122152
|
5 |
5 |
if( !db->init.busy ){
|
122154
|
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 ){
|
122168
|
0 |
10 |
if( pTab==0 ) goto exit_create_index;
|
122169
|
0 |
10 |
if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){
|
|
0 |
0 |
if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){
|
122175
|
0 |
10 |
if( !HasRowid(pTab) ) pPk = sqlite3PrimaryKeyIndex(pTab);
|
122180
|
0 |
69 |
if( !pTab ) goto exit_create_index;
|
122186
|
0 |
79 |
if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0
|
122187
|
0 |
0 |
&& db->init.busy==0
|
122188
|
0 |
0 |
&& pTblName!=0
|
122197
|
0 |
79 |
if( IsView(pTab) ){
|
122203
|
0 |
79 |
if( IsVirtual(pTab) ){
|
122222
|
10 |
69 |
if( pName ){
|
122224
|
0 |
10 |
if( zName==0 ) goto exit_create_index;
|
122226
|
0 |
10 |
if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName,"index",pTab->zName) ){
|
122229
|
10 |
0 |
if( !IN_RENAME_OBJECT ){
|
122230
|
5 |
5 |
if( !db->init.busy ){
|
122231
|
0 |
5 |
if( sqlite3FindTable(db, zName, pDb->zDbSName)!=0 ){
|
122236
|
0 |
10 |
if( sqlite3FindIndex(db, zName, pDb->zDbSName)!=0 ){
|
122237
|
0 |
0 |
if( !ifNotExist ){
|
122250
|
2 |
69 |
for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){}
|
122252
|
0 |
69 |
if( zName==0 ){
|
122261
|
0 |
69 |
if( IN_SPECIAL_PARSE ) zName[7]++;
|
122267
|
79 |
0 |
if( !IN_RENAME_OBJECT ){
|
122269
|
2 |
77 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iDb), 0, zDb) ){
|
|
0 |
79 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iDb), 0, zDb) ){
|
122273
|
2 |
77 |
if( !OMIT_TEMPDB && iDb==1 ) i = SQLITE_CREATE_TEMP_INDEX;
|
122274
|
0 |
79 |
if( sqlite3AuthCheck(pParse, i, zName, pTab->zName, zDb) ){
|
122284
|
26 |
53 |
if( pList==0 ){
|
122291
|
0 |
26 |
if( pList==0 ) goto exit_create_index;
|
122296
|
0 |
53 |
if( pParse->nErr ) goto exit_create_index;
|
122302
|
132 |
79 |
for(i=0; i<pList->nExpr; i++){
|
122305
|
0 |
132 |
if( pExpr->op==TK_COLLATE ){
|
122315
|
0 |
79 |
nExtraCol = pPk ? pPk->nKeyCol : 1;
|
122319
|
0 |
79 |
if( db->mallocFailed ){
|
122333
|
0 |
79 |
if( pPIWhere ){
|
122342
|
58 |
21 |
if( pDb->pSchema->file_format>=4 ){
|
122358
|
0 |
79 |
if( IN_RENAME_OBJECT ){
|
122362
|
132 |
79 |
for(i=0; i<pIndex->nKeyCol; i++, pListItem++){
|
122369
|
0 |
132 |
if( pParse->nErr ) goto exit_create_index;
|
122371
|
0 |
132 |
if( pCExpr->op!=TK_COLUMN ){
|
122372
|
0 |
0 |
if( pTab==pParse->pNewTable ){
|
122377
|
0 |
0 |
if( pIndex->aColExpr==0 ){
|
122388
|
0 |
132 |
if( j<0 ){
|
122391
|
104 |
28 |
if( pTab->aCol[j].notNull==0 ){
|
122394
|
0 |
132 |
if( pTab->aCol[j].colFlags & COLFLAG_VIRTUAL ){
|
122402
|
0 |
132 |
if( pListItem->pExpr->op==TK_COLLATE ){
|
122412
|
132 |
0 |
}else if( j>=0 ){
|
122415
|
132 |
0 |
if( !zColl ) zColl = sqlite3StrBINARY;
|
122416
|
65 |
67 |
if( !db->init.busy && !sqlite3LocateCollSeq(pParse, zColl) ){
|
|
0 |
65 |
if( !db->init.busy && !sqlite3LocateCollSeq(pParse, zColl) ){
|
122428
|
0 |
79 |
if( pPk ){
|
122429
|
0 |
0 |
for(j=0; j<pPk->nKeyCol; j++){
|
122432
|
0 |
0 |
if( isDupColumn(pIndex, pIndex->nKeyCol, pPk, j) ){
|
122448
|
10 |
69 |
if( pParse->pNewTable==0 ) estimateIndexWidth(pIndex);
|
122455
|
10 |
69 |
if( pTblName!=0 && pIndex->nColumn>=pTab->nCol ){
|
|
6 |
4 |
if( pTblName!=0 && pIndex->nColumn>=pTab->nCol ){
|
122457
|
10 |
2 |
for(j=0; j<pTab->nCol; j++){
|
122458
|
2 |
8 |
if( j==pTab->iPKey ) continue;
|
122459
|
4 |
4 |
if( sqlite3TableColumnToIndex(pIndex,j)>=0 ) continue;
|
122465
|
69 |
10 |
if( pTab==pParse->pNewTable ){
|
122488
|
2 |
69 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
122494
|
0 |
2 |
if( pIdx->nKeyCol!=pIndex->nKeyCol ) continue;
|
122495
|
2 |
0 |
for(k=0; k<pIdx->nKeyCol; k++){
|
122499
|
2 |
0 |
if( pIdx->aiColumn[k]!=pIndex->aiColumn[k] ) break;
|
122502
|
0 |
0 |
if( sqlite3StrICmp(z1, z2) ) break;
|
122504
|
0 |
2 |
if( k==pIdx->nKeyCol ){
|
122505
|
0 |
0 |
if( pIdx->onError!=pIndex->onError ){
|
122513
|
0 |
0 |
if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){
|
|
0 |
0 |
if( !(pIdx->onError==OE_Default || pIndex->onError==OE_Default) ){
|
122517
|
0 |
0 |
if( pIdx->onError==OE_Default ){
|
122521
|
0 |
0 |
if( idxType==SQLITE_IDXTYPE_PRIMARYKEY ) pIdx->idxType = idxType;
|
122522
|
0 |
0 |
if( IN_RENAME_OBJECT ){
|
122532
|
79 |
0 |
if( !IN_RENAME_OBJECT ){
|
122538
|
40 |
39 |
if( db->init.busy ){
|
122542
|
5 |
35 |
if( pTblName!=0 ){
|
122544
|
0 |
5 |
if( sqlite3IndexHasDuplicateRootPage(pIndex) ){
|
122552
|
0 |
40 |
if( p ){
|
122573
|
0 |
39 |
else if( HasRowid(pTab) || pTblName!=0 ){
|
|
0 |
0 |
else if( HasRowid(pTab) || pTblName!=0 ){
|
122579
|
0 |
39 |
if( v==0 ) goto exit_create_index;
|
122596
|
5 |
34 |
if( pStart ){
|
122598
|
3 |
2 |
if( pName->z[n-1]==';' ) n--;
|
122600
|
3 |
2 |
zStmt = sqlite3MPrintf(db, "CREATE%s INDEX %.*s",
|
122623
|
5 |
34 |
if( pTblName ){
|
122634
|
39 |
40 |
if( db->init.busy || pTblName==0 ){
|
|
34 |
5 |
if( db->init.busy || pTblName==0 ){
|
122639
|
0 |
5 |
else if( IN_RENAME_OBJECT ){
|
122647
|
5 |
74 |
if( pIndex ) sqlite3FreeIndex(db, pIndex);
|
122648
|
79 |
0 |
if( pTab ){
|
122655
|
88 |
79 |
for(ppFrom=&pTab->pIndex; (pThis = *ppFrom)!=0; ppFrom=&pThis->pNext){
|
122657
|
88 |
0 |
if( pThis->onError!=OE_Replace ) continue;
|
122658
|
0 |
0 |
while( (pNext = pThis->pNext)!=0 && pNext->onError!=OE_Replace ){
|
|
0 |
0 |
while( (pNext = pThis->pNext)!=0 && pNext->onError!=OE_Replace ){
|
122706
|
78 |
2 |
int nCopy = MIN(ArraySize(aVal), pIdx->nKeyCol);
|
122724
|
0 |
80 |
if( x<99 ){
|
122727
|
0 |
80 |
if( pIdx->pPartIdxWhere!=0 ){ x -= 10; assert( 10==sqlite3LogEst(2) ); }
|
122733
|
2 |
80 |
for(i=nCopy+1; i<=pIdx->nKeyCol; i++){
|
122738
|
74 |
6 |
if( IsUniqueIndex(pIdx) ) a[pIdx->nKeyCol] = 0;
|
122751
|
0 |
0 |
if( db->mallocFailed ){
|
122756
|
0 |
0 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
|
122760
|
0 |
0 |
if( pIndex==0 ){
|
122761
|
0 |
0 |
if( !ifExists ){
|
122770
|
0 |
0 |
if( pIndex->idxType!=SQLITE_IDXTYPE_APPDEF ){
|
122781
|
0 |
0 |
const char *zTab = SCHEMA_TABLE(iDb);
|
122782
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){
|
122785
|
0 |
0 |
if( !OMIT_TEMPDB && iDb==1 ) code = SQLITE_DROP_TEMP_INDEX;
|
122786
|
0 |
0 |
if( sqlite3AuthCheck(pParse, code, pIndex->zName, pTab->zName, zDb) ){
|
122794
|
0 |
0 |
if( v ){
|
122836
|
224 |
0 |
if( (n & (n-1))==0 ){
|
122837
|
9 |
215 |
sqlite3_int64 sz = (n==0) ? 1 : 2*n;
|
122839
|
0 |
224 |
if( pNew==0 ){
|
122860
|
2294 |
88 |
if( pList==0 ){
|
122862
|
0 |
2294 |
if( pList==0 ) return 0;
|
122867
|
0 |
88 |
if( pNew==0 ){
|
122875
|
0 |
2382 |
if( IN_RENAME_OBJECT && pList->a[i].zName ){
|
|
0 |
0 |
if( IN_RENAME_OBJECT && pList->a[i].zName ){
|
122887
|
405 |
2294 |
if( pList==0 ) return;
|
122889
|
2382 |
2294 |
for(i=0; i<pList->nId; i++){
|
122902
|
0 |
0 |
for(i=0; i<pList->nId; i++){
|
122903
|
0 |
0 |
if( sqlite3StrICmp(pList->a[i].zName, zName)==0 ) return i;
|
122955
|
11 |
0 |
if( (u32)pSrc->nSrc+nExtra>pSrc->nAlloc ){
|
122960
|
0 |
11 |
if( pSrc->nSrc+nExtra>=SQLITE_MAX_SRCLIST ){
|
122965
|
0 |
11 |
if( nAlloc>SQLITE_MAX_SRCLIST ) nAlloc = SQLITE_MAX_SRCLIST;
|
122968
|
0 |
11 |
if( pNew==0 ){
|
122978
|
0 |
11 |
for(i=pSrc->nSrc-1; i>=iStart; i--){
|
122985
|
11 |
11 |
for(i=iStart; i<iStart+nExtra; i++){
|
123041
|
4498 |
11 |
if( pList==0 ){
|
123043
|
0 |
4498 |
if( pList==0 ) return 0;
|
123050
|
0 |
11 |
if( pNew==0 ){
|
123058
|
1768 |
2741 |
if( pDatabase && pDatabase->z==0 ){
|
|
826 |
942 |
if( pDatabase && pDatabase->z==0 ){
|
123061
|
942 |
3567 |
if( pDatabase ){
|
123078
|
1993 |
0 |
if( ALWAYS(pList) ){
|
123079
|
1452 |
1993 |
for(i=0, pItem=pList->a; i<pList->nSrc; i++, pItem++){
|
123080
|
13 |
1439 |
if( pItem->iCursor>=0 ) continue;
|
123082
|
35 |
1404 |
if( pItem->pSelect ){
|
123096
|
69 |
7724 |
if( pList==0 ) return;
|
123097
|
4512 |
7724 |
for(pItem=pList->a, i=0; i<pList->nSrc; i++, pItem++){
|
123098
|
942 |
3570 |
if( pItem->zDatabase ) sqlite3DbNNFreeNN(db, pItem->zDatabase);
|
123099
|
4477 |
35 |
if( pItem->zName ) sqlite3DbNNFreeNN(db, pItem->zName);
|
123100
|
29 |
4483 |
if( pItem->zAlias ) sqlite3DbNNFreeNN(db, pItem->zAlias);
|
123101
|
0 |
4512 |
if( pItem->fg.isIndexedBy ) sqlite3DbFree(db, pItem->u1.zIndexedBy);
|
123102
|
0 |
4512 |
if( pItem->fg.isTabFunc ) sqlite3ExprListDelete(db, pItem->u1.pFuncArg);
|
123104
|
22 |
4490 |
if( pItem->pSelect ) sqlite3SelectDelete(db, pItem->pSelect);
|
123105
|
0 |
4512 |
if( pItem->fg.isUsing ){
|
123107
|
0 |
4512 |
}else if( pItem->u3.pOn ){
|
123141
|
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) ){
|
123142
|
0 |
0 |
sqlite3ErrorMsg(pParse, "a JOIN clause is required before %s",
|
123148
|
0 |
1437 |
if( p==0 ){
|
123155
|
0 |
1437 |
if( IN_RENAME_OBJECT && pItem->zName ){
|
|
0 |
0 |
if( IN_RENAME_OBJECT && pItem->zName ){
|
123156
|
0 |
0 |
Token *pToken = (ALWAYS(pDatabase) && pDatabase->z) ? pDatabase : pTable;
|
|
0 |
0 |
Token *pToken = (ALWAYS(pDatabase) && pDatabase->z) ? pDatabase : pTable;
|
123160
|
29 |
1408 |
if( pAlias->n ){
|
123163
|
35 |
1402 |
if( pSubquery ){
|
123165
|
0 |
35 |
if( pSubquery->selFlags & SF_NestedFrom ){
|
123171
|
0 |
1437 |
if( pOnUsing==0 ){
|
123173
|
0 |
1437 |
}else if( pOnUsing->pUsing ){
|
123194
|
346 |
0 |
if( p && pIndexedBy->n>0 ){
|
|
0 |
346 |
if( p && pIndexedBy->n>0 ){
|
123201
|
0 |
0 |
if( pIndexedBy->n==1 && !pIndexedBy->z ){
|
|
0 |
0 |
if( pIndexedBy->n==1 && !pIndexedBy->z ){
|
123220
|
0 |
0 |
if( p2 ){
|
123222
|
0 |
0 |
if( pNew==0 ){
|
123239
|
0 |
0 |
if( p ){
|
123275
|
1426 |
0 |
if( p && p->nSrc>1 ){
|
|
11 |
1415 |
if( p && p->nSrc>1 ){
|
123280
|
0 |
11 |
}while( (--i)>0 );
|
123285
|
0 |
11 |
if( allFlags & JT_RIGHT ){
|
123286
|
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--){}
|
123291
|
0 |
0 |
}while( (--i)>=0 );
|
123307
|
0 |
139 |
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION, "BEGIN", 0, 0) ){
|
123311
|
0 |
139 |
if( !v ) return;
|
123312
|
100 |
39 |
if( type!=TK_DEFERRED ){
|
123313
|
200 |
100 |
for(i=0; i<db->nDb; i++){
|
123316
|
118 |
82 |
if( pBt && sqlite3BtreeIsReadonly(pBt) ){
|
|
0 |
118 |
if( pBt && sqlite3BtreeIsReadonly(pBt) ){
|
123318
|
12 |
188 |
}else if( type==TK_EXCLUSIVE ){
|
123343
|
28 |
90 |
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION,
|
|
0 |
118 |
if( sqlite3AuthCheck(pParse, SQLITE_TRANSACTION,
|
123348
|
118 |
0 |
if( v ){
|
123359
|
34 |
0 |
if( zName ){
|
123365
|
34 |
0 |
if( !v || sqlite3AuthCheck(pParse, SQLITE_SAVEPOINT, az[op], zName, 0) ){
|
|
0 |
34 |
if( !v || sqlite3AuthCheck(pParse, SQLITE_SAVEPOINT, az[op], zName, 0) ){
|
123379
|
33 |
2454 |
if( db->aDb[1].pBt==0 && !pParse->explain ){
|
|
33 |
0 |
if( db->aDb[1].pBt==0 && !pParse->explain ){
|
123390
|
0 |
33 |
if( rc!=SQLITE_OK ){
|
123398
|
0 |
33 |
if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize, 0, 0) ){
|
123417
|
4531 |
687 |
if( DbMaskTest(pToplevel->cookieMask, iDb)==0 ){
|
123419
|
2484 |
2047 |
if( !OMIT_TEMPDB && iDb==1 ){
|
123425
|
0 |
1829 |
sqlite3CodeVerifySchemaAtToplevel(sqlite3ParseToplevel(pParse), iDb);
|
123436
|
173 |
76 |
for(i=0; i<db->nDb; i++){
|
123438
|
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)) ){
|
123458
|
0 |
3389 |
Parse *pToplevel = sqlite3ParseToplevel(pParse);
|
123472
|
0 |
45 |
Parse *pToplevel = sqlite3ParseToplevel(pParse);
|
123493
|
0 |
1212 |
Parse *pToplevel = sqlite3ParseToplevel(pParse);
|
123514
|
66 |
0 |
if( onError==OE_Abort ){
|
123536
|
0 |
26 |
if( pIdx->aColExpr ){
|
123539
|
37 |
26 |
for(j=0; j<pIdx->nKeyCol; j++){
|
123543
|
11 |
26 |
if( j ) sqlite3_str_append(&errMsg, ", ", 2);
|
123550
|
19 |
7 |
sqlite3HaltConstraint(pParse,
|
123567
|
34 |
0 |
if( pTab->iPKey>=0 ){
|
123587
|
0 |
0 |
for(i=0; i<pIndex->nColumn; i++){
|
123590
|
0 |
0 |
if( pIndex->aiColumn[i]>=0 && 0==sqlite3StrICmp(z, zColl) ){
|
|
0 |
0 |
if( pIndex->aiColumn[i]>=0 && 0==sqlite3StrICmp(z, zColl) ){
|
123604
|
0 |
0 |
if( !IsVirtual(pTab) ){
|
123607
|
0 |
0 |
for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){
|
123608
|
0 |
0 |
if( zColl==0 || collationMatch(zColl, pIndex) ){
|
|
0 |
0 |
if( zColl==0 || collationMatch(zColl, pIndex) ){
|
123632
|
0 |
0 |
for(iDb=0, pDb=db->aDb; iDb<db->nDb; iDb++, pDb++){
|
123634
|
0 |
0 |
for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){
|
123668
|
0 |
0 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
|
123672
|
0 |
0 |
if( pName1==0 ){
|
123675
|
0 |
0 |
}else if( NEVER(pName2==0) || pName2->z==0 ){
|
|
0 |
0 |
}else if( NEVER(pName2==0) || pName2->z==0 ){
|
123679
|
0 |
0 |
if( !zColl ) return;
|
123681
|
0 |
0 |
if( pColl ){
|
123689
|
0 |
0 |
if( iDb<0 ) return;
|
123691
|
0 |
0 |
if( z==0 ) return;
|
123694
|
0 |
0 |
if( pTab ){
|
123701
|
0 |
0 |
if( pIndex ){
|
123721
|
0 |
82 |
if( pParse->nErr ) return 0;
|
123722
|
6 |
76 |
if( pIdx->uniqNotNull ){
|
123727
|
82 |
0 |
if( pKey ){
|
123729
|
222 |
82 |
for(i=0; i<nCol; i++){
|
123731
|
1 |
221 |
pKey->aColl[i] = zColl==sqlite3StrBINARY ? 0 :
|
123736
|
0 |
82 |
if( pParse->nErr ){
|
123738
|
0 |
0 |
if( pIdx->bNoQuery==0 ){
|
123773
|
0 |
0 |
if( db->mallocFailed ){
|
123820
|
0 |
0 |
if( pCte==0 ){
|
123827
|
0 |
0 |
if( zName && pWith ){
|
|
0 |
0 |
if( zName && pWith ){
|
123829
|
0 |
0 |
for(i=0; i<pWith->nCte; i++){
|
123830
|
0 |
0 |
if( sqlite3StrICmp(zName, pWith->a[i].zName)==0 ){
|
123836
|
0 |
0 |
if( pWith ){
|
123844
|
0 |
0 |
if( db->mallocFailed ){
|
123859
|
0 |
0 |
if( pWith ){
|
123861
|
0 |
0 |
for(i=0; i<pWith->nCte; i++){
|
123895
|
12 |
0 |
if( db->xCollNeeded ){
|
123897
|
0 |
12 |
if( !zExternal ) return;
|
123902
|
0 |
12 |
if( db->xCollNeeded16 ){
|
123907
|
0 |
0 |
if( zExternal ){
|
123927
|
0 |
0 |
for(i=0; i<3; i++){
|
123929
|
0 |
0 |
if( pColl2->xCmp!=0 ){
|
123950
|
1944 |
766 |
if( pColl && pColl->xCmp==0 ){
|
|
0 |
1944 |
if( pColl && pColl->xCmp==0 ){
|
123954
|
0 |
0 |
if( !p ){
|
123985
|
1946 |
1845 |
if( 0==pColl && create ){
|
|
967 |
979 |
if( 0==pColl && create ){
|
123988
|
967 |
0 |
if( pColl ){
|
124004
|
0 |
967 |
if( pDel!=0 ){
|
124038
|
3791 |
1776 |
if( zName ){
|
124040
|
2812 |
979 |
if( pColl ) pColl += enc-1;
|
124085
|
21 |
0 |
if( !p ){
|
124088
|
9 |
12 |
if( !p || !p->xCmp ){
|
|
0 |
9 |
if( !p || !p->xCmp ){
|
124095
|
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) ){
|
124099
|
0 |
21 |
if( p==0 ){
|
124133
|
66 |
0 |
if( !initbusy && (!pColl || !pColl->xCmp) ){
|
|
66 |
0 |
if( !initbusy && (!pColl || !pColl->xCmp) ){
|
|
0 |
66 |
if( !initbusy && (!pColl || !pColl->xCmp) ){
|
124178
|
2821 |
2061 |
if( p->nArg!=nArg ){
|
124179
|
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;
|
124180
|
2611 |
204 |
if( p->nArg>=0 ) return 0;
|
124185
|
2061 |
204 |
if( p->nArg==nArg ){
|
124192
|
2265 |
0 |
if( enc==(p->funcFlags & SQLITE_FUNC_ENCMASK) ){
|
124194
|
0 |
0 |
}else if( (enc & p->funcFlags & 2)!=0 ){
|
124210
|
98535 |
21436 |
for(p=sqlite3BuiltinFunctions.a[h]; p; p=p->u.pHash){
|
124212
|
3200 |
95335 |
if( sqlite3StrICmp(p->zName, zFunc)==0 ){
|
124227
|
16500 |
550 |
for(i=0; i<nDef; i++){
|
124234
|
2640 |
13860 |
if( pOther ){
|
124287
|
3848 |
14891 |
while( p ){
|
124289
|
1673 |
2175 |
if( score>bestScore ){
|
124308
|
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) ){
|
124312
|
1034 |
8136 |
while( p ){
|
124314
|
592 |
442 |
if( score>bestScore ){
|
124326
|
5088 |
9803 |
if( createFlag && bestScore<FUNC_PERFECT_MATCH &&
|
|
5082 |
6 |
if( createFlag && bestScore<FUNC_PERFECT_MATCH &&
|
|
5082 |
0 |
if( createFlag && bestScore<FUNC_PERFECT_MATCH &&
|
124334
|
44063 |
5082 |
for(z=(u8*)pBest->zName; *z; z++) *z = sqlite3UpperToLower[*z];
|
124336
|
0 |
5082 |
if( pOther==pBest ){
|
124345
|
7315 |
7576 |
if( pBest && (pBest->xSFunc || createFlag) ){
|
|
5088 |
2227 |
if( pBest && (pBest->xSFunc || createFlag) ){
|
|
5082 |
6 |
if( pBest && (pBest->xSFunc || createFlag) ){
|
124371
|
0 |
651 |
for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){
|
124376
|
731 |
651 |
for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){
|
124383
|
433 |
218 |
if( pSchema->schemaFlags & DB_SchemaLoaded ){
|
124395
|
316 |
311 |
if( pBt ){
|
124400
|
0 |
627 |
if( !p ){
|
124402
|
627 |
0 |
}else if ( 0==p->file_format ){
|
124451
|
3048 |
0 |
if( pTab ){
|
124453
|
0 |
3048 |
if( pItem->fg.isIndexedBy && sqlite3IndexedByLookup(pParse, pItem) ){
|
|
0 |
0 |
if( pItem->fg.isIndexedBy && sqlite3IndexedByLookup(pParse, pItem) ){
|
124490
|
0 |
22 |
if( sqlite3GetVTable(pParse->db, pTab)->pMod->pModule->xUpdate==0 ){
|
124500
|
0 |
22 |
if( pParse->pToplevel!=0
|
124501
|
0 |
0 |
&& pTab->u.vtab.p->eVtabRisk >
|
124511
|
22 |
3021 |
if( IsVirtual(pTab) ){
|
124514
|
2652 |
369 |
if( (pTab->tabFlags & (TF_Readonly|TF_Shadow))==0 ) return 0;
|
124516
|
320 |
49 |
if( (pTab->tabFlags & TF_Readonly)!=0 ){
|
124517
|
318 |
2 |
return sqlite3WritableSchema(db)==0 && pParse->nested==0;
|
|
3 |
315 |
return sqlite3WritableSchema(db)==0 && pParse->nested==0;
|
124531
|
3 |
3040 |
if( tabIsReadOnly(pParse, pTab) ){
|
124536
|
0 |
3040 |
if( IsView(pTab)
|
124537
|
0 |
0 |
&& (pTrigger==0 || (pTrigger->bReturning && pTrigger->pNext==0))
|
|
0 |
0 |
&& (pTrigger==0 || (pTrigger->bReturning && pTrigger->pNext==0))
|
|
0 |
0 |
&& (pTrigger==0 || (pTrigger->bReturning && pTrigger->pNext==0))
|
124568
|
0 |
0 |
if( pFrom ){
|
124738
|
0 |
67 |
if( pParse->nErr ){
|
124750
|
0 |
67 |
if( pTab==0 ) goto delete_from_cleanup;
|
124762
|
67 |
0 |
bComplex = pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0);
|
|
0 |
67 |
bComplex = pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0);
|
124788
|
0 |
67 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ){
|
124792
|
0 |
67 |
if( sqlite3IsReadOnly(pParse, pTab, pTrigger) ){
|
124800
|
2 |
65 |
if( rcauth==SQLITE_DENY ){
|
124809
|
10 |
65 |
for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){
|
124815
|
0 |
65 |
if( isView ){
|
124822
|
0 |
65 |
if( v==0 ){
|
124825
|
58 |
7 |
if( pParse->nested==0 ) sqlite3VdbeCountChanges(v);
|
124832
|
0 |
65 |
if( isView ){
|
124847
|
0 |
65 |
if( sqlite3ResolveExprNames(&sNC, pWhere) ){
|
124854
|
0 |
65 |
if( (db->flags & SQLITE_CountRows)!=0
|
124855
|
0 |
0 |
&& !pParse->nested
|
124856
|
0 |
0 |
&& !pParse->pTriggerTab
|
124857
|
0 |
0 |
&& !pParse->bReturning
|
124875
|
65 |
0 |
if( rcauth==SQLITE_OK
|
124876
|
32 |
33 |
&& pWhere==0
|
124877
|
32 |
0 |
&& !bComplex
|
124878
|
32 |
0 |
&& !IsVirtual(pTab)
|
124885
|
32 |
0 |
if( HasRowid(pTab) ){
|
124886
|
0 |
32 |
sqlite3VdbeAddOp4(v, OP_Clear, pTab->tnum, iDb, memCnt ? memCnt : -1,
|
124889
|
1 |
32 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
124891
|
1 |
0 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
|
|
0 |
1 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
|
124892
|
0 |
0 |
sqlite3VdbeAddOp3(v, OP_Clear, pIdx->tnum, iDb, memCnt ? memCnt : -1);
|
124901
|
0 |
33 |
if( sNC.ncFlags & NC_Subquery ) bComplex = 1;
|
124902
|
0 |
33 |
wcf |= (bComplex ? 0 : WHERE_ONEPASS_MULTIROW);
|
124903
|
33 |
0 |
if( HasRowid(pTab) ){
|
124931
|
0 |
33 |
if( pWInfo==0 ) goto delete_from_cleanup;
|
124935
|
28 |
5 |
if( eOnePass!=ONEPASS_SINGLE ) sqlite3MultiWrite(pParse);
|
124936
|
9 |
24 |
if( sqlite3WhereUsesDeferredSeek(pWInfo) ){
|
124941
|
0 |
33 |
if( memCnt ){
|
124946
|
0 |
33 |
if( pPk ){
|
124947
|
0 |
0 |
for(i=0; i<nPk; i++){
|
124958
|
32 |
1 |
if( eOnePass!=ONEPASS_OFF ){
|
124964
|
0 |
32 |
if( aToOpen==0 ){
|
124970
|
32 |
0 |
if( aiCurOnePass[0]>=0 ) aToOpen[aiCurOnePass[0]-iTabCur] = 0;
|
124971
|
9 |
23 |
if( aiCurOnePass[1]>=0 ) aToOpen[aiCurOnePass[1]-iTabCur] = 0;
|
124972
|
0 |
32 |
if( addrEphOpen ) sqlite3VdbeChangeToNoop(v, addrEphOpen);
|
124975
|
0 |
1 |
if( pPk ){
|
124995
|
33 |
0 |
if( !isView ){
|
124997
|
27 |
6 |
if( eOnePass==ONEPASS_MULTI ){
|
125005
|
27 |
6 |
if( eOnePass==ONEPASS_MULTI ){
|
125013
|
32 |
1 |
if( eOnePass!=ONEPASS_OFF ){
|
125015
|
32 |
0 |
if( !IsVirtual(pTab) && aToOpen[iDataCur-iTabCur] ){
|
|
0 |
32 |
if( !IsVirtual(pTab) && aToOpen[iDataCur-iTabCur] ){
|
125020
|
0 |
1 |
}else if( pPk ){
|
125022
|
0 |
0 |
if( IsVirtual(pTab) ){
|
125036
|
1 |
32 |
if( IsVirtual(pTab) ){
|
125041
|
0 |
1 |
if( eOnePass==ONEPASS_SINGLE ){
|
125043
|
0 |
0 |
if( sqlite3IsToplevel(pParse) ){
|
125058
|
32 |
1 |
if( eOnePass!=ONEPASS_OFF ){
|
125061
|
0 |
1 |
}else if( pPk ){
|
125074
|
58 |
7 |
if( pParse->nested==0 && pParse->pTriggerTab==0 ){
|
|
58 |
0 |
if( pParse->nested==0 && pParse->pTriggerTab==0 ){
|
125082
|
0 |
65 |
if( memCnt ){
|
125094
|
32 |
35 |
if( aToOpen ) sqlite3DbNNFreeNN(db, aToOpen);
|
125175
|
40 |
0 |
opSeek = HasRowid(pTab) ? OP_NotExists : OP_NotFound;
|
125176
|
8 |
32 |
if( eMode==ONEPASS_OFF ){
|
125184
|
40 |
0 |
if( sqlite3FkRequired(pParse, pTab, 0, 0) || pTrigger ){
|
|
0 |
40 |
if( sqlite3FkRequired(pParse, pTab, 0, 0) || pTrigger ){
|
125201
|
0 |
0 |
for(iCol=0; iCol<pTab->nCol; iCol++){
|
125204
|
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) ){
|
125224
|
0 |
0 |
if( addrStart<sqlite3VdbeCurrentAddr(v) ){
|
125248
|
40 |
0 |
if( !IsView(pTab) ){
|
125252
|
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") ){
|
125255
|
32 |
8 |
if( eMode!=ONEPASS_OFF ){
|
125258
|
17 |
23 |
if( iIdxNoSeek>=0 && iIdxNoSeek!=iDataCur ){
|
|
17 |
0 |
if( iIdxNoSeek>=0 && iIdxNoSeek!=iDataCur ){
|
125261
|
27 |
13 |
if( eMode==ONEPASS_MULTI ) p5 |= OPFLAG_SAVEPOSITION;
|
125317
|
0 |
316 |
pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
|
125318
|
17 |
316 |
for(i=0, pIdx=pTab->pIndex; pIdx; i++, pIdx=pIdx->pNext){
|
125320
|
0 |
17 |
if( aRegIdx!=0 && aRegIdx[i]==0 ) continue;
|
|
0 |
0 |
if( aRegIdx!=0 && aRegIdx[i]==0 ) continue;
|
125321
|
0 |
17 |
if( pIdx==pPk ) continue;
|
125322
|
17 |
0 |
if( iIdxCur+i==iIdxNoSeek ) continue;
|
125326
|
0 |
0 |
sqlite3VdbeAddOp3(v, OP_IdxDelete, iIdxCur+i, r1,
|
125380
|
5 |
1 |
if( piPartIdxLabel ){
|
125381
|
0 |
5 |
if( pIdx->pPartIdxWhere ){
|
125393
|
0 |
6 |
nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn;
|
|
0 |
0 |
nCol = (prefixOnly && pIdx->uniqNotNull) ? pIdx->nKeyCol : pIdx->nColumn;
|
125395
|
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;
|
125396
|
14 |
6 |
for(j=0; j<nCol; j++){
|
125397
|
0 |
14 |
if( pPrior
|
125398
|
0 |
0 |
&& pPrior->aiColumn[j]==pIdx->aiColumn[j]
|
125399
|
0 |
0 |
&& pPrior->aiColumn[j]!=XN_EXPR
|
125405
|
8 |
6 |
if( pIdx->aiColumn[j]>=0 ){
|
125415
|
6 |
0 |
if( regOut ){
|
125428
|
0 |
5 |
if( iLabel ){
|
125494
|
0 |
0 |
mask = sqlite3_user_data(context)==0 ? 0 : -1;
|
125499
|
0 |
0 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
|
125500
|
0 |
0 |
for(i=1; i<argc; i++){
|
125501
|
0 |
0 |
if( sqlite3_value_type(argv[i])==SQLITE_NULL ) return;
|
125502
|
0 |
0 |
if( (sqlite3MemCompare(argv[iBest], argv[i], pColl)^mask)>=0 ){
|
125568
|
0 |
14 |
if( z==0 ) return;
|
125570
|
161 |
14 |
while( (c = *z)!=0 ){
|
125572
|
3 |
158 |
if( c>=0xc0 ){
|
125573
|
4 |
3 |
while( (*z & 0xc0)==0x80 ){ z++; z0++; }
|
125598
|
0 |
0 |
if( iVal<0 ){
|
125599
|
0 |
0 |
if( iVal==SMALLEST_INT64 ){
|
125623
|
0 |
0 |
if( rVal<0 ) rVal = -rVal;
|
125660
|
0 |
0 |
if( typeHaystack==SQLITE_NULL || typeNeedle==SQLITE_NULL ) return;
|
|
0 |
0 |
if( typeHaystack==SQLITE_NULL || typeNeedle==SQLITE_NULL ) return;
|
125663
|
0 |
0 |
if( nNeedle>0 ){
|
125664
|
0 |
0 |
if( typeHaystack==SQLITE_BLOB && typeNeedle==SQLITE_BLOB ){
|
|
0 |
0 |
if( typeHaystack==SQLITE_BLOB && typeNeedle==SQLITE_BLOB ){
|
125668
|
0 |
0 |
}else if( typeHaystack!=SQLITE_BLOB && typeNeedle!=SQLITE_BLOB ){
|
|
0 |
0 |
}else if( typeHaystack!=SQLITE_BLOB && typeNeedle!=SQLITE_BLOB ){
|
125675
|
0 |
0 |
if( zHaystack==0 ) goto endInstrOOM;
|
125679
|
0 |
0 |
if( zNeedle==0 ) goto endInstrOOM;
|
125683
|
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;
|
125685
|
0 |
0 |
while( nNeedle<=nHaystack
|
125686
|
0 |
0 |
&& (zHaystack[0]!=firstChar || memcmp(zHaystack, zNeedle, nNeedle)!=0)
|
|
0 |
0 |
&& (zHaystack[0]!=firstChar || memcmp(zHaystack, zNeedle, nNeedle)!=0)
|
125692
|
0 |
0 |
}while( isText && (zHaystack[0]&0xc0)==0x80 );
|
|
0 |
0 |
}while( isText && (zHaystack[0]&0xc0)==0x80 );
|
125694
|
0 |
0 |
if( nNeedle>nHaystack ) N = 0;
|
125720
|
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 ){
|
125758
|
0 |
0 |
if( sqlite3_value_type(argv[1])==SQLITE_NULL
|
125759
|
0 |
0 |
|| (argc==3 && sqlite3_value_type(argv[2])==SQLITE_NULL)
|
|
0 |
0 |
|| (argc==3 && sqlite3_value_type(argv[2])==SQLITE_NULL)
|
125765
|
0 |
0 |
if( p0type==SQLITE_BLOB ){
|
125768
|
0 |
0 |
if( z==0 ) return;
|
125772
|
0 |
0 |
if( z==0 ) return;
|
125774
|
0 |
0 |
if( p1<0 ){
|
125775
|
0 |
0 |
for(z2=z; *z2; len++){
|
125776
|
0 |
0 |
SQLITE_SKIP_UTF8(z2);
|
|
0 |
0 |
SQLITE_SKIP_UTF8(z2);
|
125788
|
0 |
0 |
if( argc==3 ){
|
125790
|
0 |
0 |
if( p2<0 ){
|
125797
|
0 |
0 |
if( p1<0 ){
|
125799
|
0 |
0 |
if( p1<0 ){
|
125801
|
0 |
0 |
if( p2<0 ) p2 = 0;
|
125804
|
0 |
0 |
}else if( p1>0 ){
|
125806
|
0 |
0 |
}else if( p2>0 ){
|
125809
|
0 |
0 |
if( negP2 ){
|
125811
|
0 |
0 |
if( p1<0 ){
|
125817
|
0 |
0 |
if( p0type!=SQLITE_BLOB ){
|
125818
|
0 |
0 |
while( *z && p1 ){
|
|
0 |
0 |
while( *z && p1 ){
|
125819
|
0 |
0 |
SQLITE_SKIP_UTF8(z);
|
|
0 |
0 |
SQLITE_SKIP_UTF8(z);
|
125822
|
0 |
0 |
for(z2=z; *z2 && p2; p2--){
|
|
0 |
0 |
for(z2=z; *z2 && p2; p2--){
|
125823
|
0 |
0 |
SQLITE_SKIP_UTF8(z2);
|
|
0 |
0 |
SQLITE_SKIP_UTF8(z2);
|
125828
|
0 |
0 |
if( p1+p2>len ){
|
125830
|
0 |
0 |
if( p2<0 ) p2 = 0;
|
125845
|
0 |
0 |
if( argc==2 ){
|
125846
|
0 |
0 |
if( SQLITE_NULL==sqlite3_value_type(argv[1]) ) return;
|
125848
|
0 |
0 |
if( n>30 ) n = 30;
|
125849
|
0 |
0 |
if( n<0 ) n = 0;
|
125851
|
0 |
0 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
|
125857
|
0 |
0 |
if( r<-4503599627370496.0 || r>+4503599627370496.0 ){
|
|
0 |
0 |
if( r<-4503599627370496.0 || r>+4503599627370496.0 ){
|
125859
|
0 |
0 |
}else if( n==0 ){
|
125860
|
0 |
0 |
r = (double)((sqlite_int64)(r+(r<0?-0.5:+0.5)));
|
125863
|
0 |
0 |
if( zBuf==0 ){
|
125887
|
0 |
20 |
if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
|
125892
|
0 |
20 |
if( !z ){
|
125911
|
20 |
0 |
if( z2 ){
|
125913
|
20 |
0 |
if( z1 ){
|
125914
|
100 |
20 |
for(i=0; i<n; i++){
|
125930
|
0 |
0 |
if( z2 ){
|
125932
|
0 |
0 |
if( z1 ){
|
125933
|
0 |
0 |
for(i=0; i<n; i++){
|
125962
|
0 |
0 |
if( r<0 ){
|
125990
|
0 |
0 |
if( n<1 ){
|
125994
|
0 |
0 |
if( p ){
|
126138
|
714 |
56 |
while( (c = Utf8Read(zPattern))!=0 ){
|
|
707 |
63 |
while( (c = Utf8Read(zPattern))!=0 ){
|
126139
|
149 |
558 |
if( c==matchAll ){ /* Match "*" */
|
126143
|
149 |
0 |
while( (c=Utf8Read(zPattern)) == matchAll
|
|
0 |
149 |
while( (c=Utf8Read(zPattern)) == matchAll
|
126144
|
0 |
149 |
|| (c == matchOne && matchOne!=0) ){
|
|
0 |
0 |
|| (c == matchOne && matchOne!=0) ){
|
126145
|
0 |
0 |
if( c==matchOne && sqlite3Utf8Read(&zString)==0 ){
|
|
0 |
0 |
if( c==matchOne && sqlite3Utf8Read(&zString)==0 ){
|
126149
|
22 |
127 |
if( c==0 ){
|
126151
|
0 |
127 |
}else if( c==matchOther ){
|
126152
|
0 |
0 |
if( pInfo->matchSet==0 ){
|
126154
|
0 |
0 |
if( c==0 ) return SQLITE_NOWILDCARDMATCH;
|
126159
|
0 |
0 |
while( *zString ){
|
126161
|
0 |
0 |
if( bMatch!=SQLITE_NOMATCH ) return bMatch;
|
126162
|
0 |
0 |
SQLITE_SKIP_UTF8(zString);
|
|
0 |
0 |
SQLITE_SKIP_UTF8(zString);
|
126177
|
127 |
0 |
if( c<0x80 ){
|
126180
|
127 |
0 |
if( noCase ){
|
126190
|
110 |
216 |
if( zString[0]==0 ) break;
|
126193
|
17 |
199 |
if( bMatch!=SQLITE_NOMATCH ) return bMatch;
|
126197
|
0 |
0 |
while( (c2 = Utf8Read(zString))!=0 ){
|
|
0 |
0 |
while( (c2 = Utf8Read(zString))!=0 ){
|
126198
|
0 |
0 |
if( c2!=c ) continue;
|
126200
|
0 |
0 |
if( bMatch!=SQLITE_NOMATCH ) return bMatch;
|
126205
|
9 |
549 |
if( c==matchOther ){
|
126206
|
9 |
0 |
if( pInfo->matchSet==0 ){
|
126208
|
0 |
9 |
if( c==0 ) return SQLITE_NOMATCH;
|
126215
|
0 |
0 |
if( c==0 ) return SQLITE_NOMATCH;
|
126217
|
0 |
0 |
if( c2=='^' ){
|
126221
|
0 |
0 |
if( c2==']' ){
|
126222
|
0 |
0 |
if( c==']' ) seen = 1;
|
126225
|
0 |
0 |
while( c2 && c2!=']' ){
|
|
0 |
0 |
while( c2 && c2!=']' ){
|
126226
|
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 ){
|
126228
|
0 |
0 |
if( c>=prior_c && c<=c2 ) seen = 1;
|
|
0 |
0 |
if( c>=prior_c && c<=c2 ) seen = 1;
|
126231
|
0 |
0 |
if( c==c2 ){
|
126238
|
0 |
0 |
if( c2==0 || (seen ^ invert)==0 ){
|
|
0 |
0 |
if( c2==0 || (seen ^ invert)==0 ){
|
126244
|
530 |
28 |
c2 = Utf8Read(zString);
|
126245
|
236 |
322 |
if( c==c2 ) continue;
|
126246
|
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 ){
|
126249
|
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;
|
126260
|
0 |
0 |
if( zString==0 ){
|
126262
|
0 |
0 |
}else if( zGlobPattern==0 ){
|
126274
|
0 |
131 |
if( zStr==0 ){
|
126276
|
0 |
131 |
}else if( zPattern==0 ){
|
126335
|
0 |
132 |
if( nPat > db->aLimit[SQLITE_LIMIT_LIKE_PATTERN_LENGTH] ){
|
126339
|
0 |
132 |
if( argc==3 ){
|
126344
|
0 |
0 |
if( zEsc==0 ) return;
|
126345
|
0 |
0 |
if( sqlite3Utf8CharLen((char*)zEsc, -1)!=1 ){
|
126351
|
0 |
0 |
if( escape==pInfo->matchAll || escape==pInfo->matchOne ){
|
|
0 |
0 |
if( escape==pInfo->matchAll || escape==pInfo->matchOne ){
|
126354
|
0 |
0 |
if( escape==pInfo->matchAll ) pInfo->matchAll = 0;
|
126355
|
0 |
0 |
if( escape==pInfo->matchOne ) pInfo->matchOne = 0;
|
126362
|
132 |
0 |
if( zA && zB ){
|
|
132 |
0 |
if( zA && zB ){
|
126383
|
0 |
0 |
if( sqlite3MemCompare(argv[0], argv[1], pColl)!=0 ){
|
126452
|
0 |
0 |
if( (zOptName = (const char*)sqlite3_value_text(argv[0]))!=0 ){
|
126504
|
0 |
0 |
if( zVal ){
|
126506
|
0 |
0 |
if( r1!=r2 ){
|
126522
|
0 |
0 |
if( pStr->accError==0 ){
|
126525
|
0 |
0 |
for(i=0; i<nBlob; i++){
|
126569
|
0 |
0 |
if( str.accError!=SQLITE_OK ){
|
126586
|
0 |
0 |
if( z && z[0] ) sqlite3_result_int(context, sqlite3Utf8Read(&z));
|
|
0 |
0 |
if( z && z[0] ) sqlite3_result_int(context, sqlite3Utf8Read(&z));
|
126602
|
0 |
0 |
if( z==0 ){
|
126606
|
0 |
0 |
for(i=0; i<argc; i++){
|
126610
|
0 |
0 |
if( x<0 || x>0x10ffff ) x = 0xfffd;
|
|
0 |
0 |
if( x<0 || x>0x10ffff ) x = 0xfffd;
|
126612
|
0 |
0 |
if( c<0x00080 ){
|
126614
|
0 |
0 |
}else if( c<0x00800 ){
|
126617
|
0 |
0 |
}else if( c<0x10000 ){
|
126649
|
0 |
0 |
if( zHex ){
|
126650
|
0 |
0 |
for(i=0; i<n; i++, pBlob++){
|
126667
|
0 |
0 |
while( z<zEnd ){
|
126668
|
0 |
0 |
u32 tst = Utf8Read(z);
|
126669
|
0 |
0 |
if( tst==ch ) return 1;
|
126712
|
0 |
0 |
if( argc==2 ){
|
126716
|
0 |
0 |
if( !zHex || !zPass ) return;
|
|
0 |
0 |
if( !zHex || !zPass ) return;
|
126719
|
0 |
0 |
if( pBlob ){
|
126723
|
0 |
0 |
while( (c = *zHex)!=0x00 ){
|
126724
|
0 |
0 |
while( !sqlite3Isxdigit(c) ){
|
126725
|
0 |
0 |
u32 ch = Utf8Read(zHex);
|
126727
|
0 |
0 |
if( !strContainsChar(zPass, nPass, ch) ) goto unhex_null;
|
126729
|
0 |
0 |
if( c==0x00 ) goto unhex_done;
|
126735
|
0 |
0 |
if( !sqlite3Isxdigit(d) ) goto unhex_null;
|
126763
|
0 |
1 |
if( n<0 ) n = 0;
|
126765
|
0 |
1 |
if( rc ){
|
126797
|
0 |
0 |
if( zStr==0 ) return;
|
126801
|
0 |
0 |
if( zPattern==0 ){
|
126806
|
0 |
0 |
if( zPattern[0]==0 ){
|
126814
|
0 |
0 |
if( zRep==0 ) return;
|
126820
|
0 |
0 |
if( zOut==0 ){
|
126825
|
0 |
0 |
for(i=j=0; i<=loopLimit; i++){
|
126826
|
0 |
0 |
if( zStr[i]!=zPattern[0] || memcmp(&zStr[i], zPattern, nPattern) ){
|
|
0 |
0 |
if( zStr[i]!=zPattern[0] || memcmp(&zStr[i], zPattern, nPattern) ){
|
126829
|
0 |
0 |
if( nRep>nPattern ){
|
126833
|
0 |
0 |
if( nOut-1>db->aLimit[SQLITE_LIMIT_LENGTH] ){
|
126839
|
0 |
0 |
if( (cntExpand&(cntExpand-1))==0 ){
|
126845
|
0 |
0 |
if( zOut==0 ){
|
126883
|
0 |
6 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ){
|
126887
|
0 |
6 |
if( zIn==0 ) return;
|
126890
|
6 |
0 |
if( argc==1 ){
|
126897
|
0 |
0 |
}else if( (zCharSet = sqlite3_value_text(argv[1]))==0 ){
|
126901
|
0 |
0 |
for(z=zCharSet, nChar=0; *z; nChar++){
|
126902
|
0 |
0 |
SQLITE_SKIP_UTF8(z);
|
|
0 |
0 |
SQLITE_SKIP_UTF8(z);
|
126904
|
0 |
0 |
if( nChar>0 ){
|
126907
|
0 |
0 |
if( azChar==0 ){
|
126911
|
0 |
0 |
for(z=zCharSet, nChar=0; *z; nChar++){
|
126913
|
0 |
0 |
SQLITE_SKIP_UTF8(z);
|
|
0 |
0 |
SQLITE_SKIP_UTF8(z);
|
126918
|
6 |
0 |
if( nChar>0 ){
|
126920
|
6 |
0 |
if( flags & 1 ){
|
126921
|
6 |
0 |
while( nIn>0 ){
|
126923
|
6 |
6 |
for(i=0; i<nChar; i++){
|
126925
|
6 |
0 |
if( len<=nIn && memcmp(zIn, azChar[i], len)==0 ) break;
|
|
0 |
6 |
if( len<=nIn && memcmp(zIn, azChar[i], len)==0 ) break;
|
126927
|
6 |
0 |
if( i>=nChar ) break;
|
126932
|
6 |
0 |
if( flags & 2 ){
|
126933
|
6 |
0 |
while( nIn>0 ){
|
126935
|
6 |
6 |
for(i=0; i<nChar; i++){
|
126937
|
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;
|
126939
|
6 |
0 |
if( i>=nChar ) break;
|
126943
|
0 |
6 |
if( zCharSet ){
|
127047
|
0 |
0 |
if( (db->flags & SQLITE_LoadExtFunc)==0 ){
|
127052
|
0 |
0 |
if( argc==2 ){
|
127057
|
0 |
0 |
if( zFile && sqlite3_load_extension(db, zFile, zProc, &zErrMsg) ){
|
|
0 |
0 |
if( zFile && sqlite3_load_extension(db, zFile, zProc, &zErrMsg) ){
|
127095
|
10 |
0 |
if( p && type!=SQLITE_NULL ){
|
|
10 |
0 |
if( p && type!=SQLITE_NULL ){
|
127097
|
10 |
0 |
if( type==SQLITE_INTEGER ){
|
127100
|
10 |
0 |
if( (p->approx|p->overflow)==0 && sqlite3AddInt64(&p->iSum, v) ){
|
|
0 |
10 |
if( (p->approx|p->overflow)==0 && sqlite3AddInt64(&p->iSum, v) ){
|
127119
|
0 |
0 |
if( ALWAYS(p) && type!=SQLITE_NULL ){
|
|
0 |
0 |
if( ALWAYS(p) && type!=SQLITE_NULL ){
|
127123
|
0 |
0 |
if( type==SQLITE_INTEGER && p->approx==0 ){
|
|
0 |
0 |
if( type==SQLITE_INTEGER && p->approx==0 ){
|
127138
|
5 |
0 |
if( p && p->cnt>0 ){
|
|
5 |
0 |
if( p && p->cnt>0 ){
|
127139
|
0 |
5 |
if( p->overflow ){
|
127141
|
0 |
5 |
}else if( p->approx ){
|
127151
|
0 |
0 |
if( p && p->cnt>0 ){
|
|
0 |
0 |
if( p && p->cnt>0 ){
|
127159
|
0 |
0 |
sqlite3_result_double(context, p ? p->rSum : (double)0);
|
127180
|
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 ){
|
127196
|
40 |
4 |
sqlite3_result_int64(context, p ? p->n : 0);
|
127203
|
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) ){
|
127227
|
0 |
27 |
if( !pBest ) return;
|
127229
|
0 |
27 |
if( sqlite3_value_type(pArg)==SQLITE_NULL ){
|
127230
|
0 |
0 |
if( pBest->flags ) sqlite3SkipAccumulatorLoad(context);
|
127231
|
0 |
27 |
}else if( pBest->flags ){
|
127245
|
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) ){
|
127258
|
27 |
41 |
if( pRes ){
|
127259
|
27 |
0 |
if( pRes->flags ){
|
127262
|
27 |
0 |
if( bValue==0 ) sqlite3VdbeMemRelease(pRes);
|
127309
|
0 |
0 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
|
127311
|
0 |
0 |
if( pGCC ){
|
127315
|
0 |
0 |
if( argc==1 ){
|
127316
|
0 |
0 |
if( !firstTerm ){
|
127324
|
0 |
0 |
}else if( !firstTerm ){
|
127327
|
0 |
0 |
if( zSep ){
|
127334
|
0 |
0 |
if( nSep != pGCC->nFirstSepLength || pGCC->pnSepLengths != 0 ){
|
|
0 |
0 |
if( nSep != pGCC->nFirstSepLength || pGCC->pnSepLengths != 0 ){
|
127336
|
0 |
0 |
if( pnsl == 0 ){
|
127339
|
0 |
0 |
if( pnsl!=0 ){
|
127341
|
0 |
0 |
while( i<nA ) pnsl[i++] = pGCC->nFirstSepLength;
|
127346
|
0 |
0 |
if( pnsl!=0 ){
|
127347
|
0 |
0 |
if( ALWAYS(pGCC->nAccum>0) ){
|
127365
|
0 |
0 |
if( zVal ) sqlite3_str_append(&pGCC->str, zVal, nVal);
|
127378
|
0 |
0 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
|
127382
|
0 |
0 |
if( ALWAYS(pGCC) ){
|
127389
|
0 |
0 |
if( pGCC->pnSepLengths!=0 ){
|
127391
|
0 |
0 |
if( pGCC->nAccum>0 ){
|
127400
|
0 |
0 |
if( nVS>=(int)pGCC->str.nChar ){
|
127406
|
0 |
0 |
if( pGCC->str.nChar==0 ){
|
127419
|
0 |
0 |
if( pGCC ){
|
127430
|
0 |
0 |
if( pGCC ){
|
127432
|
0 |
0 |
if( pAccum->accError==SQLITE_TOOBIG ){
|
127434
|
0 |
0 |
}else if( pAccum->accError==SQLITE_NOMEM ){
|
127454
|
0 |
311 |
if( rc==SQLITE_NOMEM ){
|
127467
|
0 |
0 |
if( caseSensitive ){
|
127503
|
0 |
218 |
if( !pExpr->x.pList ){
|
127512
|
218 |
0 |
if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_LIKE)==0 ){
|
|
99 |
119 |
if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_LIKE)==0 ){
|
127525
|
119 |
0 |
if( nExpr<3 ){
|
127530
|
0 |
0 |
if( pEscape->op!=TK_STRING ) return 0;
|
127533
|
0 |
0 |
if( zEscape[0]==0 || zEscape[1]!=0 ) return 0;
|
|
0 |
0 |
if( zEscape[0]==0 || zEscape[1]!=0 ) return 0;
|
127534
|
0 |
0 |
if( zEscape[0]==aWc[0] ) return 0;
|
127535
|
0 |
0 |
if( zEscape[0]==aWc[1] ) return 0;
|
127625
|
0 |
0 |
switch( sqlite3_value_numeric_type(argv[0]) ){
|
127629
|
0 |
0 |
if( x<=0.0 ) return;
|
127634
|
0 |
0 |
if( argc==2 ){
|
127635
|
0 |
0 |
switch( sqlite3_value_numeric_type(argv[0]) ){
|
127639
|
0 |
0 |
if( b<=0.0 ) return;
|
127641
|
0 |
0 |
if( x<=0.0 ) return;
|
127684
|
0 |
0 |
if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return;
|
|
0 |
0 |
if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return;
|
127706
|
0 |
0 |
if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return;
|
|
0 |
0 |
if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return;
|
127708
|
0 |
0 |
if( type1!=SQLITE_INTEGER && type1!=SQLITE_FLOAT ) return;
|
|
0 |
0 |
if( type1!=SQLITE_INTEGER && type1!=SQLITE_FLOAT ) return;
|
127744
|
0 |
0 |
if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return;
|
|
0 |
0 |
if( type0!=SQLITE_INTEGER && type0!=SQLITE_FLOAT ) return;
|
127746
|
0 |
0 |
sqlite3_result_int(context, x<0.0 ? -1 : x>0.0 ? +1 : 0);
|
128146
|
10 |
0 |
if( nCol==1 ){
|
128154
|
10 |
0 |
if( pParent->iPKey>=0 ){
|
128155
|
0 |
10 |
if( !zKey ) return 0;
|
128156
|
10 |
0 |
if( !sqlite3StrICmp(pParent->aCol[pParent->iPKey].zCnName, zKey) ){
|
128160
|
0 |
0 |
}else if( paiCol ){
|
128163
|
0 |
0 |
if( !aiCol ) return 1;
|
128167
|
0 |
0 |
for(pIdx=pParent->pIndex; pIdx; pIdx=pIdx->pNext){
|
128168
|
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 ){
|
128173
|
0 |
0 |
if( zKey==0 ){
|
128177
|
0 |
0 |
if( IsPrimaryKeyIndex(pIdx) ){
|
128178
|
0 |
0 |
if( aiCol ){
|
128180
|
0 |
0 |
for(i=0; i<nCol; i++) aiCol[i] = pFKey->aCol[i].iFrom;
|
128190
|
0 |
0 |
for(i=0; i<nCol; i++){
|
128195
|
0 |
0 |
if( iCol<0 ) break; /* No foreign keys against expression indexes */
|
128201
|
0 |
0 |
if( !zDfltColl ) zDfltColl = sqlite3StrBINARY;
|
128202
|
0 |
0 |
if( sqlite3StrICmp(pIdx->azColl[i], zDfltColl) ) break;
|
128205
|
0 |
0 |
for(j=0; j<nCol; j++){
|
128206
|
0 |
0 |
if( sqlite3StrICmp(pFKey->aCol[j].zCol, zIdxCol)==0 ){
|
128207
|
0 |
0 |
if( aiCol ) aiCol[i] = pFKey->aCol[j].iFrom;
|
128211
|
0 |
0 |
if( j==nCol ) break;
|
128213
|
0 |
0 |
if( i==nCol ) break; /* pIdx is usable */
|
128218
|
0 |
0 |
if( !pIdx ){
|
128219
|
0 |
0 |
if( !pParse->disableTriggers ){
|
128287
|
2 |
8 |
if( nIncr<0 ){
|
128291
|
10 |
10 |
for(i=0; i<pFKey->nCol; i++){
|
128296
|
10 |
0 |
if( isIgnore==0 ){
|
128297
|
10 |
0 |
if( pIdx==0 ){
|
128317
|
0 |
10 |
if( pTab==pFKey->pFrom && nIncr==1 ){
|
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr==1 ){
|
128334
|
0 |
0 |
for(i=0; i<nCol; i++){
|
128350
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr==1 ){
|
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr==1 ){
|
128352
|
0 |
0 |
for(i=0; i<nCol; i++){
|
128360
|
0 |
0 |
if( pIdx->aiColumn[i]==pTab->iPKey ){
|
128378
|
10 |
0 |
if( !pFKey->isDeferred && !(pParse->db->flags & SQLITE_DeferFKs)
|
|
10 |
0 |
if( !pFKey->isDeferred && !(pParse->db->flags & SQLITE_DeferFKs)
|
128379
|
10 |
0 |
&& !pParse->pToplevel
|
128380
|
6 |
4 |
&& !pParse->isMultiWrite
|
128390
|
2 |
2 |
if( nIncr>0 && pFKey->isDeferred==0 ){
|
|
2 |
0 |
if( nIncr>0 && pFKey->isDeferred==0 ){
|
128421
|
0 |
0 |
if( pExpr ){
|
128422
|
0 |
0 |
if( iCol>=0 && iCol!=pTab->iPKey ){
|
|
0 |
0 |
if( iCol>=0 && iCol!=pTab->iPKey ){
|
128427
|
0 |
0 |
if( zColl==0 ) zColl = db->pDfltColl->zName;
|
128448
|
0 |
0 |
if( pExpr ){
|
128508
|
0 |
0 |
if( nIncr<0 ){
|
128521
|
0 |
0 |
for(i=0; i<pFKey->nCol; i++){
|
128528
|
0 |
0 |
iCol = pIdx ? pIdx->aiColumn[i] : -1;
|
128530
|
0 |
0 |
iCol = aiCol ? aiCol[i] : pFKey->aCol[0].iFrom;
|
128552
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr>0 ){
|
|
0 |
0 |
if( pTab==pFKey->pFrom && nIncr>0 ){
|
128556
|
0 |
0 |
if( HasRowid(pTab) ){
|
128563
|
0 |
0 |
for(i=0; i<pIdx->nKeyCol; i++){
|
128585
|
0 |
0 |
if( pParse->nErr==0 ){
|
128588
|
0 |
0 |
if( pWInfo ){
|
128595
|
0 |
0 |
if( iFkIfZero ){
|
128627
|
0 |
32 |
if( p ){
|
128645
|
486 |
273 |
for(k=sqliteHashFirst(pHash); k; k=sqliteHashNext(k)){
|
128648
|
66 |
420 |
if( !IsOrdinaryTable(pTab) ) continue;
|
128649
|
0 |
420 |
for(pFKey=pTab->u.tab.pFKey; pFKey; pFKey=pFKey->pNextFrom){
|
128675
|
0 |
7 |
if( (db->flags&SQLITE_ForeignKeys) && IsOrdinaryTable(pTab) ){
|
|
0 |
0 |
if( (db->flags&SQLITE_ForeignKeys) && IsOrdinaryTable(pTab) ){
|
128681
|
0 |
0 |
if( sqlite3FkReferences(pTab)==0 ){
|
128688
|
0 |
0 |
for(p=pTab->u.tab.pFKey; p; p=p->pNextFrom){
|
128689
|
0 |
0 |
if( p->isDeferred || (db->flags & SQLITE_DeferFKs) ) break;
|
|
0 |
0 |
if( p->isDeferred || (db->flags & SQLITE_DeferFKs) ) break;
|
128691
|
0 |
0 |
if( !p ) return;
|
128709
|
0 |
0 |
if( (db->flags & SQLITE_DeferFKs)==0 ){
|
128717
|
0 |
0 |
if( iSkip ){
|
128743
|
6 |
0 |
for(i=0; i<p->nCol; i++){
|
128745
|
6 |
0 |
if( aChange[iChildKey]>=0 ) return 1;
|
128746
|
0 |
0 |
if( iChildKey==pTab->iPKey && bChngRowid ) return 1;
|
|
0 |
0 |
if( iChildKey==pTab->iPKey && bChngRowid ) return 1;
|
128770
|
0 |
0 |
for(i=0; i<p->nCol; i++){
|
128773
|
0 |
0 |
for(iKey=0; iKey<pTab->nCol; iKey++){
|
128774
|
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) ){
|
128776
|
0 |
0 |
if( zKey ){
|
128777
|
0 |
0 |
if( 0==sqlite3StrICmp(pCol->zCnName, zKey) ) return 1;
|
128778
|
0 |
0 |
}else if( pCol->colFlags & COLFLAG_PRIMKEY ){
|
128793
|
0 |
8 |
Parse *pTop = sqlite3ParseToplevel(pParse);
|
128794
|
0 |
8 |
if( pTop->pTriggerPrg ){
|
128796
|
0 |
0 |
if( (p==pFKey->apTrigger[0] && pFKey->aAction[0]==OE_SetNull)
|
|
0 |
0 |
if( (p==pFKey->apTrigger[0] && pFKey->aAction[0]==OE_SetNull)
|
128797
|
0 |
0 |
|| (p==pFKey->apTrigger[1] && pFKey->aAction[1]==OE_SetNull)
|
|
0 |
0 |
|| (p==pFKey->apTrigger[1] && pFKey->aAction[1]==OE_SetNull)
|
128843
|
0 |
31 |
if( (db->flags&SQLITE_ForeignKeys)==0 ) return;
|
128844
|
0 |
31 |
if( !IsOrdinaryTable(pTab) ) return;
|
128851
|
10 |
31 |
for(pFKey=pTab->u.tab.pFKey; pFKey; pFKey=pFKey->pNextFrom){
|
128860
|
4 |
6 |
if( aChange
|
128861
|
4 |
0 |
&& sqlite3_stricmp(pTab->zName, pFKey->zTo)!=0
|
128862
|
0 |
4 |
&& fkChildIsModified(pTab, pFKey, aChange, bChngRowid)==0
|
128871
|
0 |
10 |
if( pParse->disableTriggers ){
|
128876
|
10 |
0 |
if( !pTo || sqlite3FkLocateIndex(pParse, pTo, pFKey, &pIdx, &aiFree) ){
|
|
0 |
10 |
if( !pTo || sqlite3FkLocateIndex(pParse, pTo, pFKey, &pIdx, &aiFree) ){
|
128878
|
0 |
0 |
if( !isIgnoreErrors || db->mallocFailed ) return;
|
|
0 |
0 |
if( !isIgnoreErrors || db->mallocFailed ) return;
|
128879
|
0 |
0 |
if( pTo==0 ){
|
128889
|
0 |
0 |
for(i=0; i<pFKey->nCol; i++){
|
128901
|
0 |
10 |
if( aiFree ){
|
128907
|
10 |
10 |
for(i=0; i<pFKey->nCol; i++){
|
128908
|
0 |
10 |
if( aiCol[i]==pTab->iPKey ){
|
128916
|
0 |
10 |
if( db->xAuth ){
|
128918
|
0 |
0 |
char *zCol = pTo->aCol[pIdx ? pIdx->aiColumn[i] : pTo->iPKey].zCnName;
|
128931
|
2 |
8 |
if( regOld!=0 ){
|
128937
|
8 |
2 |
if( regNew!=0 && !isSetNullAction(pParse, pFKey) ){
|
|
8 |
0 |
if( regNew!=0 && !isSetNullAction(pParse, pFKey) ){
|
128954
|
15 |
31 |
for(pFKey = sqlite3FkReferences(pTab); pFKey; pFKey=pFKey->pNextTo){
|
128959
|
0 |
15 |
if( aChange && fkParentIsModified(pTab, pFKey, aChange, bChngRowid)==0 ){
|
|
0 |
0 |
if( aChange && fkParentIsModified(pTab, pFKey, aChange, bChngRowid)==0 ){
|
128963
|
15 |
0 |
if( !pFKey->isDeferred && !(db->flags & SQLITE_DeferFKs)
|
|
15 |
0 |
if( !pFKey->isDeferred && !(db->flags & SQLITE_DeferFKs)
|
128964
|
15 |
0 |
&& !pParse->pToplevel && !pParse->isMultiWrite
|
|
15 |
0 |
&& !pParse->pToplevel && !pParse->isMultiWrite
|
128972
|
0 |
0 |
if( sqlite3FkLocateIndex(pParse, pTab, pFKey, &pIdx, &aiCol) ){
|
128973
|
0 |
0 |
if( !isIgnoreErrors || db->mallocFailed ) return;
|
|
0 |
0 |
if( !isIgnoreErrors || db->mallocFailed ) return;
|
128981
|
0 |
0 |
if( pSrc ){
|
128988
|
0 |
0 |
if( regNew!=0 ){
|
128991
|
0 |
0 |
if( regOld!=0 ){
|
129011
|
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 ){
|
129033
|
2 |
0 |
if( pParse->db->flags&SQLITE_ForeignKeys && IsOrdinaryTable(pTab) ){
|
|
2 |
0 |
if( pParse->db->flags&SQLITE_ForeignKeys && IsOrdinaryTable(pTab) ){
|
129036
|
2 |
2 |
for(p=pTab->u.tab.pFKey; p; p=p->pNextFrom){
|
129037
|
2 |
0 |
for(i=0; i<p->nCol; i++) mask |= COLUMN_MASK(p->aCol[i].iFrom);
|
|
2 |
2 |
for(i=0; i<p->nCol; i++) mask |= COLUMN_MASK(p->aCol[i].iFrom);
|
129039
|
0 |
2 |
for(p=sqlite3FkReferences(pTab); p; p=p->pNextTo){
|
129042
|
0 |
0 |
if( pIdx ){
|
129043
|
0 |
0 |
for(i=0; i<pIdx->nKeyCol; i++){
|
129045
|
0 |
0 |
mask |= COLUMN_MASK(pIdx->aiColumn[i]);
|
129086
|
61 |
366 |
if( pParse->db->flags&SQLITE_ForeignKeys && IsOrdinaryTable(pTab) ){
|
|
61 |
0 |
if( pParse->db->flags&SQLITE_ForeignKeys && IsOrdinaryTable(pTab) ){
|
129087
|
44 |
17 |
if( !aChange ){
|
129091
|
29 |
15 |
bHaveFK = (sqlite3FkReferences(pTab) || pTab->u.tab.pFKey);
|
|
8 |
21 |
bHaveFK = (sqlite3FkReferences(pTab) || pTab->u.tab.pFKey);
|
129098
|
2 |
17 |
for(p=pTab->u.tab.pFKey; p; p=p->pNextFrom){
|
129099
|
2 |
0 |
if( fkChildIsModified(pTab, p, aChange, chngRowid) ){
|
129100
|
0 |
2 |
if( 0==sqlite3_stricmp(pTab->zName, p->zTo) ) eRet = 2;
|
129106
|
0 |
17 |
for(p=sqlite3FkReferences(pTab); p; p=p->pNextTo){
|
129107
|
0 |
0 |
if( fkParentIsModified(pTab, p, aChange, chngRowid) ){
|
129108
|
0 |
0 |
if( p->aAction[1]!=OE_None ) return 2;
|
129114
|
25 |
402 |
return bHaveFK ? eRet : 0;
|
129158
|
0 |
0 |
if( action==OE_Restrict && (db->flags & SQLITE_DeferFKs) ){
|
|
0 |
0 |
if( action==OE_Restrict && (db->flags & SQLITE_DeferFKs) ){
|
129163
|
0 |
0 |
if( action!=OE_None && !pTrigger ){
|
|
0 |
0 |
if( action!=OE_None && !pTrigger ){
|
129175
|
0 |
0 |
if( sqlite3FkLocateIndex(pParse, pTab, pFKey, &pIdx, &aiCol) ) return 0;
|
129178
|
0 |
0 |
for(i=0; i<pFKey->nCol; i++){
|
129186
|
0 |
0 |
iFromCol = aiCol ? aiCol[i] : pFKey->aCol[0].iFrom;
|
129191
|
0 |
0 |
pTab->aCol[pIdx ? pIdx->aiColumn[i] : pTab->iPKey].zCnName);
|
129211
|
0 |
0 |
if( pChanges ){
|
129223
|
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) ){
|
129225
|
0 |
0 |
if( action==OE_Cascade ){
|
129229
|
0 |
0 |
}else if( action==OE_SetDflt ){
|
129232
|
0 |
0 |
if( pCol->colFlags & COLFLAG_GENERATED ){
|
129239
|
0 |
0 |
if( pDflt ){
|
129256
|
0 |
0 |
if( action==OE_Restrict ){
|
129262
|
0 |
0 |
if( pRaise ){
|
129266
|
0 |
0 |
if( pSrc ){
|
129288
|
0 |
0 |
if( pTrigger ){
|
129296
|
0 |
0 |
if( pWhen ){
|
129303
|
0 |
0 |
EnableLookaside;
|
129309
|
0 |
0 |
if( db->mallocFailed==1 ){
|
129321
|
0 |
0 |
if( !pChanges ){
|
129333
|
0 |
0 |
pTrigger->op = (pChanges ? TK_UPDATE : TK_DELETE);
|
129355
|
2 |
40 |
if( pParse->db->flags&SQLITE_ForeignKeys ){
|
129357
|
0 |
2 |
for(pFKey = sqlite3FkReferences(pTab); pFKey; pFKey=pFKey->pNextTo){
|
129358
|
0 |
0 |
if( aChange==0 || fkParentIsModified(pTab, pFKey, aChange, bChngRowid) ){
|
|
0 |
0 |
if( aChange==0 || fkParentIsModified(pTab, pFKey, aChange, bChngRowid) ){
|
129360
|
0 |
0 |
if( pAct ){
|
129381
|
16 |
1015 |
for(pFKey=pTab->u.tab.pFKey; pFKey; pFKey=pNext){
|
129385
|
16 |
0 |
if( db->pnBytesFreed==0 ){
|
129386
|
0 |
16 |
if( pFKey->pPrevTo ){
|
129390
|
0 |
16 |
const char *z = (p ? pFKey->pNextTo->zTo : pFKey->zTo);
|
129393
|
0 |
16 |
if( pFKey->pNextTo ){
|
129456
|
4249 |
0 |
if( HasRowid(pTab) ){
|
129501
|
0 |
17 |
if( !pIdx->zColAff ){
|
129505
|
49 |
17 |
for(n=0; n<pIdx->nColumn; n++){
|
129508
|
32 |
17 |
if( x>=0 ){
|
129510
|
17 |
0 |
}else if( x==XN_ROWID ){
|
129518
|
0 |
49 |
if( aff<SQLITE_AFF_BLOB ) aff = SQLITE_AFF_BLOB;
|
129519
|
43 |
6 |
if( aff>SQLITE_AFF_NUMERIC) aff = SQLITE_AFF_NUMERIC;
|
129526
|
17 |
27 |
if( !pIdx->zColAff ) return computeIndexAffStr(db, pIdx);
|
129539
|
358 |
0 |
if( zColAff ){
|
129541
|
1288 |
358 |
for(i=j=0; i<pTab->nCol; i++){
|
129542
|
1288 |
0 |
if( (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 ){
|
129548
|
442 |
61 |
}while( j>=0 && zColAff[j]<=SQLITE_AFF_BLOB );
|
|
145 |
297 |
}while( j>=0 && zColAff[j]<=SQLITE_AFF_BLOB );
|
129596
|
0 |
2950 |
if( pTab->tabFlags & TF_Strict ){
|
129597
|
0 |
0 |
if( iReg==0 ){
|
129616
|
358 |
2592 |
if( zColAff==0 ){
|
129618
|
0 |
358 |
if( !zColAff ){
|
129626
|
523 |
2427 |
if( i ){
|
129627
|
20 |
503 |
if( iReg ){
|
129648
|
2 |
2 |
VTable *pVTab = IsVirtual(pTab) ? sqlite3GetVTable(p->db, pTab) : 0;
|
129651
|
46 |
4 |
for(i=1; i<iEnd; i++){
|
129654
|
0 |
46 |
if( pOp->opcode==OP_OpenRead && pOp->p3==iDb ){
|
|
0 |
0 |
if( pOp->opcode==OP_OpenRead && pOp->p3==iDb ){
|
129657
|
0 |
0 |
if( tnum==pTab->tnum ){
|
129660
|
0 |
0 |
for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){
|
129661
|
0 |
0 |
if( tnum==pIndex->tnum ){
|
129667
|
0 |
46 |
if( pOp->opcode==OP_VOpen && pOp->p4.pVtab==pVTab ){
|
|
0 |
0 |
if( pOp->opcode==OP_VOpen && pOp->p4.pVtab==pVTab ){
|
129681
|
0 |
0 |
if( pExpr->op==TK_COLUMN && pExpr->iColumn>=0 ){
|
|
0 |
0 |
if( pExpr->op==TK_COLUMN && pExpr->iColumn>=0 ){
|
129715
|
0 |
0 |
if( (pTab->tabFlags & TF_HasStored)!=0 ){
|
129717
|
0 |
0 |
if( pOp->opcode==OP_Affinity ){
|
129725
|
0 |
0 |
for(ii=jj=0; zP4[jj]; ii++){
|
129726
|
0 |
0 |
if( pTab->aCol[ii].colFlags & COLFLAG_VIRTUAL ){
|
129729
|
0 |
0 |
if( pTab->aCol[ii].colFlags & COLFLAG_STORED ){
|
129734
|
0 |
0 |
}else if( pOp->opcode==OP_TypeCheck ){
|
129746
|
0 |
0 |
for(i=0; i<pTab->nCol; i++){
|
129747
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_GENERATED ){
|
129768
|
0 |
0 |
for(i=0; i<pTab->nCol; i++){
|
129770
|
0 |
0 |
if( (pCol->colFlags & COLFLAG_NOTAVAIL)!=0 ){
|
129776
|
0 |
0 |
if( w.eCode & COLFLAG_NOTAVAIL ){
|
129787
|
0 |
0 |
}while( pRedo && eProgress );
|
|
0 |
0 |
}while( pRedo && eProgress );
|
129788
|
0 |
0 |
if( pRedo ){
|
129827
|
2 |
2695 |
if( (pTab->tabFlags & TF_Autoincrement)!=0
|
129828
|
2 |
0 |
&& (pParse->db->mDbFlags & DBFLAG_Vacuum)==0
|
129830
|
0 |
2 |
Parse *pToplevel = sqlite3ParseToplevel(pParse);
|
129837
|
2 |
0 |
if( pSeqTab==0
|
129838
|
2 |
0 |
|| !HasRowid(pSeqTab)
|
129839
|
2 |
0 |
|| NEVER(IsVirtual(pSeqTab))
|
129840
|
0 |
2 |
|| pSeqTab->nCol!=2
|
129848
|
0 |
2 |
while( pInfo && pInfo->pTab!=pTab ){ pInfo = pInfo->pNext; }
|
|
0 |
0 |
while( pInfo && pInfo->pTab!=pTab ){ pInfo = pInfo->pNext; }
|
129849
|
2 |
0 |
if( pInfo==0 ){
|
129853
|
0 |
2 |
if( pParse->db->mallocFailed ) return 0;
|
129884
|
2 |
5348 |
for(p = pParse->pAinc; p; p = p->pNext){
|
129907
|
0 |
2 |
if( aOp==0 ) break;
|
129920
|
0 |
2 |
if( pParse->nTab==0 ) pParse->nTab = 1;
|
129933
|
2 |
2693 |
if( memId>0 ){
|
129951
|
2 |
2 |
for(p = pParse->pAinc; p; p = p->pNext){
|
129971
|
0 |
2 |
if( aOp==0 ) break;
|
129983
|
2 |
2719 |
if( pParse->pAinc ) autoIncrementEnd(pParse);
|
130149
|
0 |
2697 |
if( pParse->nErr ){
|
130159
|
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 ){
|
130170
|
0 |
2697 |
if( pTab==0 ){
|
130175
|
0 |
2697 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0,
|
130209
|
0 |
2697 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ){
|
130215
|
0 |
2697 |
if( sqlite3IsReadOnly(pParse, pTab, pTrigger) ){
|
130222
|
0 |
2697 |
if( v==0 ) goto insert_cleanup;
|
130223
|
2658 |
39 |
if( pParse->nested==0 ) sqlite3VdbeCountChanges(v);
|
130224
|
2693 |
4 |
sqlite3BeginWriteOperation(pParse, pSelect || pTrigger, iDb);
|
|
0 |
2693 |
sqlite3BeginWriteOperation(pParse, pSelect || pTrigger, iDb);
|
130236
|
403 |
2294 |
if( pColumn==0
|
130237
|
2 |
401 |
&& pSelect!=0
|
130238
|
2 |
0 |
&& pTrigger==0
|
130239
|
0 |
2 |
&& xferOptimization(pParse, pTab, pSelect, onError, iDb)
|
130257
|
21 |
2676 |
if( IsVirtual(pTab) ){
|
130283
|
2294 |
403 |
if( pColumn ){
|
130286
|
2382 |
2294 |
for(i=0; i<pColumn->nId; i++){
|
130289
|
2382 |
2294 |
for(i=0; i<pColumn->nId; i++){
|
130290
|
2555 |
0 |
for(j=0; j<pTab->nCol; j++){
|
130291
|
2382 |
173 |
if( sqlite3StrICmp(pColumn->a[i].zName, pTab->aCol[j].zCnName)==0 ){
|
130293
|
53 |
2329 |
if( i!=j ) bIdListInOrder = 0;
|
130294
|
19 |
2363 |
if( j==pTab->iPKey ){
|
130298
|
0 |
2382 |
if( pTab->aCol[j].colFlags & (COLFLAG_STORED|COLFLAG_VIRTUAL) ){
|
130308
|
0 |
2382 |
if( j>=pTab->nCol ){
|
130309
|
0 |
0 |
if( sqlite3IsRowid(pColumn->a[i].zName) && !withoutRowid ){
|
|
0 |
0 |
if( sqlite3IsRowid(pColumn->a[i].zName) && !withoutRowid ){
|
130327
|
4 |
2693 |
if( pSelect ){
|
130338
|
4 |
0 |
dest.iSdst = bIdListInOrder ? regData : 0;
|
130343
|
4 |
0 |
if( rc || pParse->nErr ) goto insert_cleanup;
|
|
4 |
0 |
if( rc || pParse->nErr ) goto insert_cleanup;
|
130359
|
4 |
0 |
if( pTrigger || readsTable(pParse, iDb, pTab) ){
|
|
0 |
4 |
if( pTrigger || readsTable(pParse, iDb, pTab) ){
|
130363
|
0 |
4 |
if( useTempTable ){
|
130400
|
2693 |
0 |
if( pList ){
|
130402
|
2 |
2691 |
if( sqlite3ResolveExprListNames(&sNC, pList) ){
|
130414
|
401 |
2294 |
if( pColumn==0 && nColumn>0 ){
|
|
401 |
0 |
if( pColumn==0 && nColumn>0 ){
|
130417
|
33 |
368 |
if( ipkColumn>=0 && (pTab->tabFlags & TF_HasGenerated)!=0 ){
|
|
0 |
33 |
if( ipkColumn>=0 && (pTab->tabFlags & TF_HasGenerated)!=0 ){
|
130420
|
0 |
0 |
for(i=ipkColumn-1; i>=0; i--){
|
130421
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_GENERATED ){
|
130436
|
0 |
401 |
if( (pTab->tabFlags & (TF_HasGenerated|TF_HasHidden))!=0 ){
|
130437
|
0 |
0 |
for(i=0; i<pTab->nCol; i++){
|
130438
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_NOINSERT ) nHidden++;
|
130441
|
0 |
401 |
if( nColumn!=(pTab->nCol-nHidden) ){
|
130448
|
2294 |
401 |
if( pColumn!=0 && nColumn!=pColumn->nId ){
|
|
0 |
2294 |
if( pColumn!=0 && nColumn!=pColumn->nId ){
|
130455
|
0 |
2695 |
if( (db->flags & SQLITE_CountRows)!=0
|
130456
|
0 |
0 |
&& !pParse->nested
|
130457
|
0 |
0 |
&& !pParse->pTriggerTab
|
130458
|
0 |
0 |
&& !pParse->bReturning
|
130465
|
2695 |
0 |
if( !isView ){
|
130470
|
0 |
2695 |
if( aRegIdx==0 ){
|
130473
|
33 |
2695 |
for(i=0, pIdx=pTab->pIndex; i<nIdx; pIdx=pIdx->pNext, i++){
|
130481
|
0 |
2695 |
if( pUpsert ){
|
130483
|
0 |
0 |
if( IsVirtual(pTab) ){
|
130488
|
0 |
0 |
if( IsView(pTab) ){
|
130492
|
0 |
0 |
if( sqlite3HasExplicitNulls(pParse, pUpsert->pUpsertTarget) ){
|
130502
|
0 |
0 |
if( pNx->pUpsertTarget ){
|
130503
|
0 |
0 |
if( sqlite3UpsertAnalyzeTarget(pParse, pTabList, pNx) ){
|
130508
|
0 |
0 |
}while( pNx!=0 );
|
130514
|
0 |
2695 |
if( useTempTable ){
|
130526
|
4 |
2691 |
}else if( pSelect ){
|
130538
|
2 |
2 |
if( ipkColumn>=0 ){
|
130555
|
3233 |
2695 |
for(i=0; i<pTab->nCol; i++, iRegStore++){
|
130559
|
73 |
3160 |
if( i==pTab->iPKey ){
|
130567
|
51 |
3109 |
if( ((colFlags = pTab->aCol[i].colFlags) & COLFLAG_NOINSERT)!=0 ){
|
130569
|
0 |
51 |
if( (colFlags & COLFLAG_VIRTUAL)!=0 ){
|
130575
|
0 |
51 |
}else if( (colFlags & COLFLAG_STORED)!=0 ){
|
130580
|
0 |
0 |
if( tmask & TRIGGER_BEFORE ){
|
130584
|
0 |
51 |
}else if( pColumn==0 ){
|
130593
|
2418 |
742 |
if( pColumn ){
|
130595
|
2593 |
55 |
for(j=0; j<pColumn->nId && pColumn->a[j].u4.idx!=i; j++){}
|
|
230 |
2363 |
for(j=0; j<pColumn->nId && pColumn->a[j].u4.idx!=i; j++){}
|
130596
|
55 |
2363 |
if( j>=pColumn->nId ){
|
130605
|
0 |
742 |
}else if( nColumn==0 ){
|
130615
|
0 |
3105 |
if( useTempTable ){
|
130617
|
4 |
3101 |
}else if( pSelect ){
|
130618
|
0 |
4 |
if( regFromSelect!=regData ){
|
130624
|
40 |
3061 |
if( y!=iRegStore ){
|
130625
|
0 |
40 |
sqlite3VdbeAddOp2(v,
|
130635
|
0 |
2695 |
if( tmask & TRIGGER_BEFORE ){
|
130644
|
0 |
0 |
if( ipkColumn<0 ){
|
130649
|
0 |
0 |
if( useTempTable ){
|
130670
|
0 |
0 |
if( pTab->tabFlags & TF_HasGenerated ){
|
130682
|
0 |
0 |
if( !isView ){
|
130693
|
2695 |
0 |
if( !isView ){
|
130694
|
21 |
2674 |
if( IsVirtual(pTab) ){
|
130698
|
52 |
2643 |
if( ipkColumn>=0 ){
|
130700
|
0 |
52 |
if( useTempTable ){
|
130702
|
50 |
2 |
}else if( pSelect ){
|
130706
|
0 |
50 |
if( pIpk->op==TK_NULL && !IsVirtual(pTab) ){
|
|
0 |
0 |
if( pIpk->op==TK_NULL && !IsVirtual(pTab) ){
|
130716
|
52 |
0 |
if( !appendFlag ){
|
130718
|
52 |
0 |
if( !IsVirtual(pTab) ){
|
130728
|
2622 |
21 |
}else if( IsVirtual(pTab) || withoutRowid ){
|
|
0 |
2622 |
}else if( IsVirtual(pTab) || withoutRowid ){
|
130741
|
0 |
2695 |
if( pTab->tabFlags & TF_HasGenerated ){
|
130750
|
21 |
2674 |
if( IsVirtual(pTab) ){
|
130754
|
4 |
17 |
sqlite3VdbeChangeP5(v, onError==OE_Default ? OE_Abort : onError);
|
130764
|
27 |
2647 |
if( db->flags & SQLITE_ForeignKeys ){
|
130776
|
26 |
2648 |
bUseSeek = (isReplace==0 || !sqlite3VdbeHasSubProgram(v));
|
|
26 |
0 |
bUseSeek = (isReplace==0 || !sqlite3VdbeHasSubProgram(v));
|
130792
|
0 |
2695 |
if( regRowCount ){
|
130796
|
0 |
2695 |
if( pTrigger ){
|
130806
|
0 |
2695 |
if( useTempTable ){
|
130810
|
4 |
2691 |
}else if( pSelect ){
|
130831
|
2656 |
39 |
if( pParse->nested==0 && pParse->pTriggerTab==0 ){
|
|
2656 |
0 |
if( pParse->nested==0 && pParse->pTriggerTab==0 ){
|
130840
|
0 |
2695 |
if( regRowCount ){
|
130850
|
2695 |
2 |
if( aRegIdx ) sqlite3DbNNFreeNN(db, aRegIdx);
|
130879
|
0 |
0 |
if( pExpr->op==TK_COLUMN ){
|
130881
|
0 |
0 |
if( pExpr->iColumn>=0 ){
|
130882
|
0 |
0 |
if( pWalker->u.aiCol[pExpr->iColumn]>=0 ){
|
130918
|
0 |
0 |
if( !chngRowid ){
|
130967
|
0 |
2950 |
if( pIter->eType ){
|
130978
|
0 |
33 |
if( pIter->eType ){
|
130980
|
0 |
0 |
if( i>=pIter->u.ax.nIdx ){
|
131136
|
2950 |
0 |
if( HasRowid(pTab) ){
|
131150
|
47 |
2903 |
if( pTab->tabFlags & TF_HasNotNull ){
|
131155
|
117 |
47 |
for(i=0; i<nCol; i++){
|
131160
|
17 |
100 |
if( onError==OE_None ) continue; /* No NOT NULL on this column */
|
131161
|
19 |
81 |
if( i==pTab->iPKey ){
|
131165
|
0 |
81 |
if( isGenerated && !b2ndPass ){
|
|
0 |
0 |
if( isGenerated && !b2ndPass ){
|
131169
|
0 |
81 |
if( aiChng && aiChng[i]<0 && !isGenerated ){
|
|
0 |
0 |
if( aiChng && aiChng[i]<0 && !isGenerated ){
|
|
0 |
0 |
if( aiChng && aiChng[i]<0 && !isGenerated ){
|
131173
|
0 |
81 |
if( overrideError!=OE_Default ){
|
131175
|
81 |
0 |
}else if( onError==OE_Default ){
|
131178
|
0 |
81 |
if( onError==OE_Replace ){
|
131179
|
0 |
0 |
if( b2ndPass /* REPLACE becomes ABORT on the 2nd pass */
|
131180
|
0 |
0 |
|| pCol->iDflt==0 /* REPLACE is ABORT if no DEFAULT value */
|
131189
|
0 |
81 |
}else if( b2ndPass && !isGenerated ){
|
|
0 |
0 |
}else if( b2ndPass && !isGenerated ){
|
131230
|
47 |
0 |
if( nGenerated==0 && nSeenReplace==0 ){
|
|
47 |
0 |
if( nGenerated==0 && nSeenReplace==0 ){
|
131236
|
0 |
0 |
if( b2ndPass ) break; /* Never need more than 2 passes */
|
131239
|
0 |
0 |
if( nSeenReplace>0 && (pTab->tabFlags & TF_HasGenerated)!=0 ){
|
|
0 |
0 |
if( nSeenReplace>0 && (pTab->tabFlags & TF_HasGenerated)!=0 ){
|
131253
|
0 |
2950 |
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){
|
|
0 |
0 |
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){
|
131256
|
0 |
0 |
onError = overrideError!=OE_Default ? overrideError : OE_Abort;
|
131257
|
0 |
0 |
for(i=0; i<pCheck->nExpr; i++){
|
131261
|
0 |
0 |
if( aiChng
|
131262
|
0 |
0 |
&& !sqlite3ExprReferencesUpdatedColumn(pExpr, aiChng, pkChng)
|
131268
|
0 |
0 |
if( bAffinityDone==0 ){
|
131275
|
0 |
0 |
if( !db->mallocFailed ){
|
131279
|
0 |
0 |
if( onError==OE_Ignore ){
|
131284
|
0 |
0 |
if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-26383-51744 */
|
131327
|
0 |
2950 |
if( pUpsert ){
|
131328
|
0 |
0 |
if( pUpsert->pUpsertTarget==0 ){
|
131331
|
0 |
0 |
if( pUpsert->isDoUpdate==0 ){
|
131340
|
0 |
0 |
}else if( pTab->pIndex!=0 ){
|
131348
|
0 |
0 |
for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){
|
131355
|
0 |
0 |
if( sIdxIter.u.ax.aIdx==0 ) return; /* OOM */
|
131358
|
0 |
0 |
for(i=0, pTerm=pUpsert; pTerm; pTerm=pTerm->pNextUpsert){
|
131359
|
0 |
0 |
if( pTerm->pUpsertTarget==0 ) break;
|
131360
|
0 |
0 |
if( pTerm->pUpsertIdx==0 ) continue; /* Skip ON CONFLICT for the IPK */
|
131363
|
0 |
0 |
while( ALWAYS(pIdx!=0) && pIdx!=pTerm->pUpsertIdx ){
|
|
0 |
0 |
while( ALWAYS(pIdx!=0) && pIdx!=pTerm->pUpsertIdx ){
|
131367
|
0 |
0 |
if( bUsed[jj] ) continue; /* Duplicate ON CONFLICT clause ignored */
|
131373
|
0 |
0 |
for(jj=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, jj++){
|
131374
|
0 |
0 |
if( bUsed[jj] ) continue;
|
131403
|
2906 |
44 |
if( (db->flags & (SQLITE_RecTriggers|SQLITE_ForeignKeys))==0 ){
|
131409
|
0 |
44 |
if( db->flags&SQLITE_RecTriggers ){
|
131411
|
0 |
0 |
regTrigCnt = pTrigger!=0 || sqlite3FkRequired(pParse, pTab, 0, 0);
|
|
0 |
0 |
regTrigCnt = pTrigger!=0 || sqlite3FkRequired(pParse, pTab, 0, 0);
|
131416
|
23 |
21 |
if( regTrigCnt ){
|
131430
|
52 |
2898 |
if( pkChng && pPk==0 ){
|
|
52 |
0 |
if( pkChng && pPk==0 ){
|
131435
|
18 |
34 |
if( overrideError!=OE_Default ){
|
131437
|
34 |
0 |
}else if( onError==OE_Default ){
|
131442
|
0 |
52 |
if( pUpsert ){
|
131444
|
0 |
0 |
if( pUpsertClause!=0 ){
|
131445
|
0 |
0 |
if( pUpsertClause->isDoUpdate==0 ){
|
131451
|
0 |
0 |
if( pUpsertClause!=pUpsert ){
|
131464
|
18 |
34 |
if( onError==OE_Replace /* IPK rule is REPLACE */
|
131465
|
0 |
18 |
&& onError!=overrideError /* Rules for other constraints are different */
|
131466
|
0 |
0 |
&& pTab->pIndex /* There exist other constraints */
|
131467
|
0 |
0 |
&& !upsertIpkDelay /* IPK check already deferred by UPSERT */
|
131473
|
0 |
52 |
if( isUpdate ){
|
131526
|
0 |
18 |
if( regTrigCnt ){
|
131542
|
0 |
18 |
if( pTab->pIndex ){
|
131563
|
0 |
52 |
if( pUpsert && pUpsertClause!=pUpsert ){
|
|
0 |
0 |
if( pUpsert && pUpsertClause!=pUpsert ){
|
131565
|
0 |
52 |
}else if( ipkTop ){
|
131578
|
33 |
2950 |
for(pIdx = indexIteratorFirst(&sIdxIter, &ix);
|
131588
|
0 |
33 |
if( aRegIdx[ix]==0 ) continue; /* Skip indices that do not change */
|
131589
|
0 |
33 |
if( pUpsert ){
|
131591
|
0 |
0 |
if( upsertIpkDelay && pUpsertClause==pUpsert ){
|
|
0 |
0 |
if( upsertIpkDelay && pUpsertClause==pUpsert ){
|
131596
|
33 |
0 |
if( bAffinityDone==0 ){
|
131605
|
0 |
33 |
if( pIdx->pPartIdxWhere ){
|
131617
|
84 |
33 |
for(i=0; i<pIdx->nColumn; i++){
|
131620
|
0 |
84 |
if( iField==XN_EXPR ){
|
131625
|
51 |
33 |
}else if( iField==XN_ROWID || iField==pTab->iPKey ){
|
|
0 |
51 |
}else if( iField==XN_ROWID || iField==pTab->iPKey ){
|
131649
|
0 |
33 |
if( isUpdate && pPk==pIdx && pkChng==0 ){
|
|
0 |
0 |
if( isUpdate && pPk==pIdx && pkChng==0 ){
|
|
0 |
0 |
if( isUpdate && pPk==pIdx && pkChng==0 ){
|
131656
|
1 |
32 |
if( onError==OE_None ){
|
131660
|
8 |
24 |
if( overrideError!=OE_Default ){
|
131662
|
23 |
1 |
}else if( onError==OE_Default ){
|
131667
|
0 |
32 |
if( pUpsertClause ){
|
131668
|
0 |
0 |
if( pUpsertClause->isDoUpdate==0 ){
|
131687
|
32 |
0 |
if( (ix==0 && pIdx->pNext==0) /* Condition 3 */
|
|
32 |
0 |
if( (ix==0 && pIdx->pNext==0) /* Condition 3 */
|
131688
|
0 |
32 |
&& pPk==pIdx /* Condition 2 */
|
131689
|
0 |
0 |
&& onError==OE_Replace /* Condition 1 */
|
131692
|
0 |
0 |
&& ( 0==(db->flags&SQLITE_ForeignKeys) || /* Condition 5 */
|
|
0 |
0 |
&& ( 0==(db->flags&SQLITE_ForeignKeys) || /* Condition 5 */
|
131693
|
0 |
0 |
(0==pTab->u.tab.pFKey && 0==sqlite3FkReferences(pTab)))
|
131707
|
32 |
0 |
regR = pIdx==pPk ? regIdx : sqlite3GetTempRange(pParse, nPkField);
|
131708
|
32 |
0 |
if( isUpdate || onError==OE_Replace ){
|
|
8 |
24 |
if( isUpdate || onError==OE_Replace ){
|
131709
|
8 |
0 |
if( HasRowid(pTab) ){
|
131713
|
0 |
8 |
if( isUpdate ){
|
131722
|
0 |
0 |
if( pIdx!=pPk ){
|
131723
|
0 |
0 |
for(i=0; i<pPk->nKeyCol; i++){
|
131731
|
0 |
0 |
if( isUpdate ){
|
131741
|
0 |
0 |
int regCmp = (IsPrimaryKeyIndex(pIdx) ? regIdx : regR);
|
131743
|
0 |
0 |
for(i=0; i<pPk->nKeyCol; i++){
|
131747
|
0 |
0 |
if( i==(pPk->nKeyCol-1) ){
|
131795
|
0 |
8 |
if( regTrigCnt ){
|
131799
|
0 |
8 |
if( pTrigger && isUpdate ){
|
|
0 |
0 |
if( pTrigger && isUpdate ){
|
131805
|
0 |
8 |
if( pTrigger && isUpdate ){
|
|
0 |
0 |
if( pTrigger && isUpdate ){
|
131808
|
0 |
8 |
if( regTrigCnt ){
|
131820
|
0 |
0 |
if( pIdx->pPartIdxWhere ){
|
131829
|
0 |
0 |
while( nConflictCk>0 ){
|
131835
|
0 |
0 |
if( x.opcode!=OP_IdxRowid ){
|
131838
|
0 |
0 |
if( sqlite3OpcodeProperty[x.opcode]&OPFLG_JUMP ){
|
131843
|
0 |
0 |
zP4 = x.p4type==P4_INT32 ? SQLITE_INT_TO_PTR(x.p4.i) : x.p4.z;
|
131861
|
32 |
0 |
if( regR!=regIdx ) sqlite3ReleaseTempRange(pParse, regR, nPkField);
|
131862
|
0 |
32 |
if( pUpsertClause
|
131863
|
0 |
0 |
&& upsertIpkReturn
|
131864
|
0 |
0 |
&& sqlite3UpsertNextIsIPK(pUpsertClause)
|
131873
|
0 |
2950 |
if( ipkTop ){
|
131883
|
0 |
2950 |
if( nReplaceTrig ){
|
131885
|
0 |
0 |
if( !pPk ){
|
131886
|
0 |
0 |
if( isUpdate ){
|
131901
|
2950 |
0 |
if( HasRowid(pTab) ){
|
131905
|
2917 |
33 |
if( !bAffinityDone ){
|
131995
|
33 |
2950 |
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
|
132000
|
0 |
33 |
if( aRegIdx[i]==0 ) continue;
|
132001
|
0 |
33 |
if( pIdx->pPartIdxWhere ){
|
132005
|
33 |
0 |
pik_flags = (useSeekResult ? OPFLAG_USESEEKRESULT : 0);
|
132006
|
27 |
6 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
|
|
0 |
27 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
|
132013
|
4 |
29 |
sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iIdxCur+i, aRegIdx[i],
|
132018
|
0 |
2950 |
if( !HasRowid(pTab) ) return;
|
132019
|
308 |
2642 |
if( pParse->nested ){
|
132023
|
7 |
2635 |
pik_flags |= (update_flags?update_flags:OPFLAG_LASTROWID);
|
132025
|
2622 |
328 |
if( appendBias ){
|
132028
|
2674 |
276 |
if( useSeekResult ){
|
132032
|
2642 |
308 |
if( !pParse->nested ){
|
132077
|
22 |
2982 |
if( IsVirtual(pTab) ){
|
132087
|
2674 |
308 |
if( iBase<0 ) iBase = pParse->nTab;
|
132089
|
2706 |
276 |
if( piDataCur ) *piDataCur = iDataCur;
|
132090
|
2982 |
0 |
if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){
|
|
308 |
2674 |
if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){
|
|
7 |
301 |
if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){
|
132095
|
2706 |
276 |
if( piIdxCur ) *piIdxCur = iBase;
|
132096
|
42 |
2982 |
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
|
132099
|
36 |
6 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
|
|
0 |
36 |
if( IsPrimaryKeyIndex(pIdx) && !HasRowid(pTab) ){
|
132100
|
0 |
0 |
if( piDataCur ) *piDataCur = iIdxCur;
|
132103
|
9 |
33 |
if( aToOpen==0 || aToOpen[i+1] ){
|
|
0 |
9 |
if( aToOpen==0 || aToOpen[i+1] ){
|
132110
|
2674 |
308 |
if( iBase>pParse->nTab ) pParse->nTab = iBase;
|
132142
|
0 |
0 |
if( pDest->nKeyCol!=pSrc->nKeyCol || pDest->nColumn!=pSrc->nColumn ){
|
|
0 |
0 |
if( pDest->nKeyCol!=pSrc->nKeyCol || pDest->nColumn!=pSrc->nColumn ){
|
132145
|
0 |
0 |
if( pDest->onError!=pSrc->onError ){
|
132148
|
0 |
0 |
for(i=0; i<pSrc->nKeyCol; i++){
|
132149
|
0 |
0 |
if( pSrc->aiColumn[i]!=pDest->aiColumn[i] ){
|
132152
|
0 |
0 |
if( pSrc->aiColumn[i]==XN_EXPR ){
|
132154
|
0 |
0 |
if( sqlite3ExprCompare(0, pSrc->aColExpr->a[i].pExpr,
|
132159
|
0 |
0 |
if( pSrc->aSortOrder[i]!=pDest->aSortOrder[i] ){
|
132162
|
0 |
0 |
if( sqlite3_stricmp(pSrc->azColl[i],pDest->azColl[i])!=0 ){
|
132166
|
0 |
0 |
if( sqlite3ExprCompare(0, pSrc->pPartIdxWhere, pDest->pPartIdxWhere, -1) ){
|
132223
|
2 |
0 |
if( pParse->pWith || pSelect->pWith ){
|
|
0 |
2 |
if( pParse->pWith || pSelect->pWith ){
|
132230
|
2 |
0 |
if( IsVirtual(pDest) ){
|
132234
|
0 |
0 |
if( onError==OE_Default ){
|
132235
|
0 |
0 |
if( pDest->iPKey>=0 ) onError = pDest->keyConf;
|
132236
|
0 |
0 |
if( onError==OE_Default ) onError = OE_Abort;
|
132239
|
0 |
0 |
if( pSelect->pSrc->nSrc!=1 ){
|
132242
|
0 |
0 |
if( pSelect->pSrc->a[0].pSelect ){
|
132245
|
0 |
0 |
if( pSelect->pWhere ){
|
132248
|
0 |
0 |
if( pSelect->pOrderBy ){
|
132253
|
0 |
0 |
if( pSelect->pGroupBy ){
|
132256
|
0 |
0 |
if( pSelect->pLimit ){
|
132259
|
0 |
0 |
if( pSelect->pPrior ){
|
132262
|
0 |
0 |
if( pSelect->selFlags & SF_Distinct ){
|
132267
|
0 |
0 |
if( pEList->nExpr!=1 ){
|
132271
|
0 |
0 |
if( pEList->a[0].pExpr->op!=TK_ASTERISK ){
|
132281
|
0 |
0 |
if( pSrc==0 ){
|
132284
|
0 |
0 |
if( pSrc->tnum==pDest->tnum && pSrc->pSchema==pDest->pSchema ){
|
|
0 |
0 |
if( pSrc->tnum==pDest->tnum && pSrc->pSchema==pDest->pSchema ){
|
132288
|
0 |
0 |
if( HasRowid(pDest)!=HasRowid(pSrc) ){
|
132291
|
0 |
0 |
if( !IsOrdinaryTable(pSrc) ){
|
132294
|
0 |
0 |
if( pDest->nCol!=pSrc->nCol ){
|
132297
|
0 |
0 |
if( pDest->iPKey!=pSrc->iPKey ){
|
132300
|
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 ){
|
132303
|
0 |
0 |
for(i=0; i<pDest->nCol; i++){
|
132330
|
0 |
0 |
if( (pDestCol->colFlags & COLFLAG_GENERATED) !=
|
132338
|
0 |
0 |
if( (pDestCol->colFlags & COLFLAG_GENERATED)!=0 ){
|
132339
|
0 |
0 |
if( sqlite3ExprCompare(0,
|
132348
|
0 |
0 |
if( pDestCol->affinity!=pSrcCol->affinity ){
|
132351
|
0 |
0 |
if( sqlite3_stricmp(sqlite3ColumnColl(pDestCol),
|
132355
|
0 |
0 |
if( pDestCol->notNull && !pSrcCol->notNull ){
|
|
0 |
0 |
if( pDestCol->notNull && !pSrcCol->notNull ){
|
132359
|
0 |
0 |
if( (pDestCol->colFlags & COLFLAG_GENERATED)==0 && i>0 ){
|
|
0 |
0 |
if( (pDestCol->colFlags & COLFLAG_GENERATED)==0 && i>0 ){
|
132366
|
0 |
0 |
if( (pDestExpr==0)!=(pSrcExpr==0)
|
132367
|
0 |
0 |
|| (pDestExpr!=0 && strcmp(pDestExpr->u.zToken,
|
|
0 |
0 |
|| (pDestExpr!=0 && strcmp(pDestExpr->u.zToken,
|
132374
|
0 |
0 |
for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){
|
132375
|
0 |
0 |
if( IsUniqueIndex(pDestIdx) ){
|
132378
|
0 |
0 |
for(pSrcIdx=pSrc->pIndex; pSrcIdx; pSrcIdx=pSrcIdx->pNext){
|
132379
|
0 |
0 |
if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break;
|
132381
|
0 |
0 |
if( pSrcIdx==0 ){
|
132384
|
0 |
0 |
if( pSrcIdx->tnum==pDestIdx->tnum && pSrc->pSchema==pDest->pSchema
|
|
0 |
0 |
if( pSrcIdx->tnum==pDestIdx->tnum && pSrc->pSchema==pDest->pSchema
|
132385
|
0 |
0 |
&& sqlite3FaultSim(411)==SQLITE_OK ){
|
132393
|
0 |
0 |
if( pDest->pCheck && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1) ){
|
|
0 |
0 |
if( pDest->pCheck && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1) ){
|
132406
|
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 ){
|
132410
|
0 |
0 |
if( (db->flags & SQLITE_CountRows)!=0 ){
|
132432
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_Vacuum)==0 && (
|
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_Vacuum)==0 && (
|
132433
|
0 |
0 |
(pDest->iPKey<0 && pDest->pIndex!=0) /* (1) */
|
132434
|
0 |
0 |
|| destHasUniqueIdx /* (2) */
|
132435
|
0 |
0 |
|| (onError!=OE_Abort && onError!=OE_Rollback) /* (3) */
|
|
0 |
0 |
|| (onError!=OE_Abort && onError!=OE_Rollback) /* (3) */
|
132458
|
0 |
0 |
if( HasRowid(pSrc) ){
|
132462
|
0 |
0 |
if( pDest->iPKey>=0 ){
|
132464
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_Vacuum)==0 ){
|
132472
|
0 |
0 |
}else if( pDest->pIndex==0 && !(db->mDbFlags & DBFLAG_VacuumInto) ){
|
|
0 |
0 |
}else if( pDest->pIndex==0 && !(db->mDbFlags & DBFLAG_VacuumInto) ){
|
132479
|
0 |
0 |
if( db->mDbFlags & DBFLAG_Vacuum ){
|
132495
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_Vacuum)==0 ){
|
132507
|
0 |
0 |
for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){
|
132509
|
0 |
0 |
for(pSrcIdx=pSrc->pIndex; ALWAYS(pSrcIdx); pSrcIdx=pSrcIdx->pNext){
|
132510
|
0 |
0 |
if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break;
|
132521
|
0 |
0 |
if( db->mDbFlags & DBFLAG_Vacuum ){
|
132536
|
0 |
0 |
for(i=0; i<pSrcIdx->nColumn; i++){
|
132538
|
0 |
0 |
if( sqlite3_stricmp(sqlite3StrBINARY, zColl) ) break;
|
132540
|
0 |
0 |
if( i==pSrcIdx->nColumn ){
|
132545
|
0 |
0 |
}else if( !HasRowid(pSrc) && pDestIdx->idxType==SQLITE_IDXTYPE_PRIMARYKEY ){
|
|
0 |
0 |
}else if( !HasRowid(pSrc) && pDestIdx->idxType==SQLITE_IDXTYPE_PRIMARYKEY ){
|
132548
|
0 |
0 |
if( idxInsFlags!=(OPFLAG_USESEEKRESULT|OPFLAG_PREFORMAT) ){
|
132550
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_Vacuum)==0
|
132551
|
0 |
0 |
&& !HasRowid(pDest)
|
132564
|
0 |
0 |
if( emptySrcTest ) sqlite3VdbeJumpHere(v, emptySrcTest);
|
132567
|
0 |
0 |
if( emptyDestTest ){
|
132623
|
0 |
3554 |
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
|
132624
|
0 |
3554 |
if( zSql==0 ) zSql = "";
|
132628
|
7066 |
44 |
while( rc==SQLITE_OK && zSql[0] ){
|
|
3556 |
3510 |
while( rc==SQLITE_OK && zSql[0] ){
|
132635
|
9 |
3547 |
if( rc!=SQLITE_OK ){
|
132638
|
4 |
3543 |
if( !pStmt ){
|
132650
|
835 |
7055 |
if( xCallback && (SQLITE_ROW==rc ||
|
|
488 |
347 |
if( xCallback && (SQLITE_ROW==rc ||
|
|
488 |
0 |
if( xCallback && (SQLITE_ROW==rc ||
|
132651
|
187 |
301 |
(SQLITE_DONE==rc && !callbackIsInit
|
132652
|
0 |
187 |
&& db->flags&SQLITE_NullCallback)) ){
|
132653
|
301 |
46 |
if( !callbackIsInit ){
|
132656
|
0 |
301 |
if( azCols==0 ){
|
132659
|
1505 |
301 |
for(i=0; i<nCol; i++){
|
132667
|
347 |
0 |
if( rc==SQLITE_ROW ){
|
132669
|
1735 |
347 |
for(i=0; i<nCol; i++){
|
132671
|
35 |
1700 |
if( !azVals[i] && sqlite3_column_type(pStmt, i)!=SQLITE_NULL ){
|
|
0 |
35 |
if( !azVals[i] && sqlite3_column_type(pStmt, i)!=SQLITE_NULL ){
|
132678
|
0 |
347 |
if( xCallback(pArg, nCol, azVals, azCols) ){
|
132690
|
3543 |
4347 |
if( rc!=SQLITE_ROW ){
|
132694
|
0 |
3543 |
while( sqlite3Isspace(zSql[0]) ) zSql++;
|
132704
|
0 |
3554 |
if( pStmt ) sqlite3VdbeFinalize((Vdbe *)pStmt);
|
132708
|
44 |
3510 |
if( rc!=SQLITE_OK && pzErrMsg ){
|
|
44 |
0 |
if( rc!=SQLITE_OK && pzErrMsg ){
|
132710
|
0 |
44 |
if( *pzErrMsg==0 ){
|
132714
|
2989 |
521 |
}else if( pzErrMsg ){
|
134004
|
0 |
0 |
if( pzErrMsg ) *pzErrMsg = 0;
|
134013
|
0 |
0 |
if( (db->flags & SQLITE_LoadExtension)==0 ){
|
134014
|
0 |
0 |
if( pzErrMsg ){
|
134020
|
0 |
0 |
zEntry = zProc ? zProc : "sqlite3_extension_init";
|
134030
|
0 |
0 |
if( nMsg>SQLITE_MAX_PATHLEN ) goto extension_not_found;
|
134034
|
0 |
0 |
for(ii=0; ii<ArraySize(azEndings) && handle==0; ii++){
|
|
0 |
0 |
for(ii=0; ii<ArraySize(azEndings) && handle==0; ii++){
|
134036
|
0 |
0 |
if( zAltFile==0 ) return SQLITE_NOMEM_BKPT;
|
134037
|
0 |
0 |
if( nMsg+strlen(azEndings[ii])+1<=SQLITE_MAX_PATHLEN ){
|
134043
|
0 |
0 |
if( handle==0 ) goto extension_not_found;
|
134057
|
0 |
0 |
if( xInit==0 && zProc==0 ){
|
|
0 |
0 |
if( xInit==0 && zProc==0 ){
|
134061
|
0 |
0 |
if( zAltEntry==0 ){
|
134066
|
0 |
0 |
for(iFile=ncFile-1; iFile>=0 && !DirSep(zFile[iFile]); iFile--){}
|
|
0 |
0 |
for(iFile=ncFile-1; iFile>=0 && !DirSep(zFile[iFile]); iFile--){}
|
134068
|
0 |
0 |
if( sqlite3_strnicmp(zFile+iFile, "lib", 3)==0 ) iFile += 3;
|
134069
|
0 |
0 |
for(iEntry=8; (c = zFile[iFile])!=0 && c!='.'; iFile++){
|
|
0 |
0 |
for(iEntry=8; (c = zFile[iFile])!=0 && c!='.'; iFile++){
|
134070
|
0 |
0 |
if( sqlite3Isalpha(c) ){
|
134078
|
0 |
0 |
if( xInit==0 ){
|
134079
|
0 |
0 |
if( pzErrMsg ){
|
134082
|
0 |
0 |
if( zErrmsg ){
|
134095
|
0 |
0 |
if( rc ){
|
134096
|
0 |
0 |
if( rc==SQLITE_OK_LOAD_PERMANENTLY ) return SQLITE_OK;
|
134097
|
0 |
0 |
if( pzErrMsg ){
|
134107
|
0 |
0 |
if( aHandle==0 ){
|
134110
|
0 |
0 |
if( db->nExtension>0 ){
|
134120
|
0 |
0 |
if( pzErrMsg ){
|
134123
|
0 |
0 |
if( zErrmsg ){
|
134153
|
0 |
315 |
for(i=0; i<db->nExtension; i++){
|
134165
|
0 |
0 |
if( onoff ){
|
134215
|
0 |
0 |
if( rc ){
|
134226
|
0 |
0 |
for(i=0; i<wsdAutoext.nExt; i++){
|
134227
|
0 |
0 |
if( wsdAutoext.aExt[i]==xInit ) break;
|
134229
|
0 |
0 |
if( i==wsdAutoext.nExt ){
|
134233
|
0 |
0 |
if( aNew==0 ){
|
134266
|
0 |
0 |
for(i=(int)wsdAutoext.nExt-1; i>=0; i--){
|
134267
|
0 |
0 |
if( wsdAutoext.aExt[i]==xInit ){
|
134283
|
0 |
0 |
if( sqlite3_initialize()==SQLITE_OK )
|
134310
|
311 |
0 |
if( wsdAutoext.nExt==0 ){
|
134314
|
0 |
0 |
for(i=0; go; i++){
|
134325
|
0 |
0 |
if( i>=wsdAutoext.nExt ){
|
134333
|
0 |
0 |
if( xInit && (rc = xInit(db, &zErrmsg, pThunk))!=0 ){
|
|
0 |
0 |
if( xInit && (rc = xInit(db, &zErrmsg, pThunk))!=0 ){
|
135059
|
2 |
17 |
if( sqlite3Isdigit(*z) ){
|
135063
|
25 |
0 |
for(i=0; i<ArraySize(iLength); i++){
|
135064
|
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
|
135065
|
17 |
0 |
&& (!omitFull || iValue[i]<=1)
|
|
17 |
0 |
&& (!omitFull || iValue[i]<=1)
|
135090
|
0 |
0 |
if( z ){
|
135091
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "exclusive") ) return PAGER_LOCKINGMODE_EXCLUSIVE;
|
135092
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "normal") ) return PAGER_LOCKINGMODE_NORMAL;
|
135106
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "none") ) return BTREE_AUTOVACUUM_NONE;
|
135107
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "full") ) return BTREE_AUTOVACUUM_FULL;
|
135108
|
0 |
0 |
if( 0==sqlite3StrICmp(z, "incremental") ) return BTREE_AUTOVACUUM_INCR;
|
135110
|
0 |
0 |
return (u8)((i>=0&&i<=2)?i:0);
|
|
0 |
0 |
return (u8)((i>=0&&i<=2)?i:0);
|
135121
|
0 |
0 |
if( z[0]>='0' && z[0]<='2' ){
|
|
0 |
0 |
if( z[0]>='0' && z[0]<='2' ){
|
135123
|
0 |
0 |
}else if( sqlite3StrICmp(z, "file")==0 ){
|
135125
|
0 |
0 |
}else if( sqlite3StrICmp(z, "memory")==0 ){
|
135140
|
0 |
0 |
if( db->aDb[1].pBt!=0 ){
|
135141
|
0 |
0 |
if( !db->autoCommit
|
135142
|
0 |
0 |
|| sqlite3BtreeTxnState(db->aDb[1].pBt)!=SQLITE_TXN_NONE
|
135165
|
0 |
0 |
if( db->temp_store==ts ) return SQLITE_OK;
|
135166
|
0 |
0 |
if( invalidateTempStorage( pParse ) != SQLITE_OK ){
|
135182
|
185 |
18 |
sqlite3VdbeSetNumCols(v, n==0 ? 1 : n);
|
135183
|
18 |
185 |
if( n==0 ){
|
135187
|
855 |
185 |
for(i=0, j=pPragma->iPragCName; i<n; i++, j++){
|
135208
|
0 |
0 |
if( zValue ){
|
135221
|
19 |
0 |
if( db->autoCommit ){
|
135230
|
38 |
19 |
while( (n--) > 0 ){
|
135231
|
19 |
19 |
if( pDb->pBt ){
|
135283
|
0 |
2 |
if( eMode==ArraySize(azModeName) ) return 0;
|
135294
|
1206 |
0 |
while( lwr<=upr ){
|
135297
|
219 |
987 |
if( rc==0 ) break;
|
135298
|
337 |
650 |
if( rc<0 ){
|
135304
|
219 |
0 |
return lwr>upr ? 0 : &aPragmaName[mid];
|
135324
|
0 |
0 |
if( showInternFuncs ) mask = 0xffffffff;
|
135325
|
0 |
0 |
for(; p; p=p->pNext){
|
135334
|
0 |
0 |
if( p->xSFunc==0 ) continue;
|
135335
|
0 |
0 |
if( (p->funcFlags & SQLITE_FUNC_INTERNAL)!=0
|
135336
|
0 |
0 |
&& showInternFuncs==0
|
135340
|
0 |
0 |
if( p->xValue!=0 ){
|
135342
|
0 |
0 |
}else if( p->xFinalize!=0 ){
|
135407
|
0 |
219 |
if( v==0 ) return;
|
135414
|
0 |
219 |
if( iDb<0 ) return;
|
135420
|
3 |
216 |
if( iDb==1 && sqlite3OpenTempDatabase(pParse) ){
|
|
0 |
3 |
if( iDb==1 && sqlite3OpenTempDatabase(pParse) ){
|
135425
|
0 |
219 |
if( !zLeft ) return;
|
135426
|
0 |
219 |
if( minusFlag ){
|
135433
|
109 |
110 |
zDb = pId2->n>0 ? pDb->zDbSName : 0;
|
135434
|
0 |
219 |
if( sqlite3AuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, zDb) ){
|
135459
|
0 |
219 |
if( rc==SQLITE_OK ){
|
135466
|
0 |
219 |
if( rc!=SQLITE_NOTFOUND ){
|
135467
|
0 |
0 |
if( aFcntl[0] ){
|
135478
|
0 |
219 |
if( pPragma==0 ){
|
135485
|
116 |
103 |
if( (pPragma->mPragFlg & PragFlg_NeedSchema)!=0 ){
|
135486
|
0 |
116 |
if( sqlite3ReadSchema(pParse) ) goto pragma_out;
|
135490
|
219 |
0 |
if( (pPragma->mPragFlg & PragFlg_NoColumns)==0
|
135491
|
34 |
185 |
&& ((pPragma->mPragFlg & PragFlg_NoColumns1)==0 || zRight==0)
|
|
14 |
20 |
&& ((pPragma->mPragFlg & PragFlg_NoColumns1)==0 || zRight==0)
|
135531
|
0 |
0 |
if( !zRight ){
|
135564
|
10 |
0 |
if( !zRight ){
|
135565
|
10 |
0 |
int size = ALWAYS(pBt) ? sqlite3BtreeGetPageSize(pBt) : 0;
|
135572
|
0 |
0 |
if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize,0,0) ){
|
135591
|
0 |
0 |
if( zRight ){
|
135592
|
0 |
0 |
if( sqlite3_stricmp(zRight, "fast")==0 ){
|
135598
|
0 |
0 |
if( pId2->n==0 && b>=0 ){
|
|
0 |
0 |
if( pId2->n==0 && b>=0 ){
|
135600
|
0 |
0 |
for(ii=0; ii<db->nDb; ii++){
|
135631
|
0 |
0 |
if( sqlite3Tolower(zLeft[0])=='p' ){
|
135634
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight,&x)==0 ){
|
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight,&x)==0 ){
|
135635
|
0 |
0 |
if( x<0 ) x = 0;
|
135636
|
0 |
0 |
else if( x>0xfffffffe ) x = 0xfffffffe;
|
135654
|
0 |
0 |
if( pId2->n==0 && eMode==PAGER_LOCKINGMODE_QUERY ){
|
|
0 |
0 |
if( pId2->n==0 && eMode==PAGER_LOCKINGMODE_QUERY ){
|
135662
|
0 |
0 |
if( pId2->n==0 ){
|
135673
|
0 |
0 |
for(ii=2; ii<db->nDb; ii++){
|
135685
|
0 |
0 |
if( eMode==PAGER_LOCKINGMODE_EXCLUSIVE ){
|
135701
|
0 |
0 |
if( zRight==0 ){
|
135708
|
0 |
0 |
for(eMode=0; (zMode = sqlite3JournalModename(eMode))!=0; eMode++){
|
135709
|
0 |
0 |
if( sqlite3StrNICmp(zRight, zMode, n)==0 ) break;
|
135711
|
0 |
0 |
if( !zMode ){
|
135716
|
0 |
0 |
if( eMode==PAGER_JOURNALMODE_OFF && (db->flags & SQLITE_Defensive)!=0 ){
|
|
0 |
0 |
if( eMode==PAGER_JOURNALMODE_OFF && (db->flags & SQLITE_Defensive)!=0 ){
|
135722
|
0 |
0 |
if( eMode==PAGER_JOURNALMODE_QUERY && pId2->n==0 ){
|
|
0 |
0 |
if( eMode==PAGER_JOURNALMODE_QUERY && pId2->n==0 ){
|
135727
|
0 |
0 |
for(ii=db->nDb-1; ii>=0; ii--){
|
135728
|
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) ){
|
135746
|
0 |
0 |
if( zRight ){
|
135748
|
0 |
0 |
if( iLimit<-1 ) iLimit = -1;
|
135768
|
0 |
0 |
if( !zRight ){
|
135780
|
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) ){
|
135819
|
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 ){
|
135847
|
0 |
0 |
if( !zRight ){
|
135881
|
0 |
0 |
if( !zRight ){
|
135882
|
0 |
0 |
returnSingleInt(v,
|
135887
|
0 |
0 |
if( sqlite3GetInt32(zRight, &size) ){
|
135890
|
0 |
0 |
if( sqlite3GetBoolean(zRight, size!=0) ){
|
135918
|
0 |
0 |
if( zRight ){
|
135921
|
0 |
0 |
if( sz<0 ) sz = sqlite3GlobalConfig.szMmap;
|
135922
|
0 |
0 |
if( pId2->n==0 ) db->szMmap = sz;
|
135923
|
0 |
0 |
for(ii=db->nDb-1; ii>=0; ii--){
|
135924
|
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) ){
|
135935
|
0 |
0 |
if( rc==SQLITE_OK ){
|
135937
|
0 |
0 |
}else if( rc!=SQLITE_NOTFOUND ){
|
135956
|
0 |
0 |
if( !zRight ){
|
135976
|
0 |
0 |
if( !zRight ){
|
135980
|
0 |
0 |
if( zRight[0] ){
|
135983
|
0 |
0 |
if( rc!=SQLITE_OK || res==0 ){
|
|
0 |
0 |
if( rc!=SQLITE_OK || res==0 ){
|
135989
|
0 |
0 |
if( SQLITE_TEMP_STORE==0
|
135996
|
0 |
0 |
if( zRight[0] ){
|
136096
|
0 |
0 |
if( !zRight ){
|
136099
|
0 |
0 |
if( !db->autoCommit ){
|
136102
|
0 |
0 |
}else if( iDb!=1 ){
|
136104
|
0 |
0 |
if( iLevel==0 ) iLevel = 1;
|
136116
|
4 |
19 |
if( zRight==0 ){
|
136121
|
0 |
19 |
if( db->autoCommit==0 ){
|
136133
|
14 |
5 |
if( sqlite3GetBoolean(zRight, 0) ){
|
136137
|
0 |
5 |
if( mask==SQLITE_DeferFKs ) db->nDeferredImmCons = 0;
|
136138
|
2 |
3 |
if( (mask & SQLITE_WriteSchema)!=0
|
136139
|
0 |
2 |
&& sqlite3_stricmp(zRight, "reset")==0
|
136173
|
74 |
0 |
case PragTyp_TABLE_INFO: if( zRight ){
|
136177
|
72 |
2 |
if( pTab ){
|
136184
|
147 |
72 |
for(i=0, pCol=pTab->aCol; i<pTab->nCol; i++, pCol++){
|
136187
|
0 |
147 |
if( pCol->colFlags & COLFLAG_NOINSERT ){
|
136188
|
0 |
0 |
if( pPragma->iArg==0 ){
|
136192
|
0 |
0 |
if( pCol->colFlags & COLFLAG_VIRTUAL ){
|
136194
|
0 |
0 |
}else if( pCol->colFlags & COLFLAG_STORED ){
|
136200
|
88 |
59 |
if( (pCol->colFlags & COLFLAG_PRIMKEY)==0 ){
|
136202
|
26 |
33 |
}else if( pPk==0 ){
|
136205
|
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++){}
|
136211
|
147 |
0 |
sqlite3VdbeMultiLoad(v, 1, pPragma->iArg ? "issisii" : "issisi",
|
|
0 |
147 |
sqlite3VdbeMultiLoad(v, 1, pPragma->iArg ? "issisii" : "issisi",
|
136216
|
0 |
147 |
(isHidden>=2 || pColExpr==0) ? 0 : pColExpr->u.zToken,
|
136241
|
0 |
0 |
for(ii=0; ii<db->nDb; ii++){
|
136245
|
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;
|
136254
|
0 |
0 |
while( initNCol-- ){
|
136257
|
0 |
0 |
if( k==0 ){ initNCol = 0; break; }
|
136259
|
0 |
0 |
if( pTab->nCol==0 ){
|
136261
|
0 |
0 |
if( zSql ){
|
136267
|
0 |
0 |
if( db->mallocFailed ){
|
136277
|
0 |
0 |
for(k=sqliteHashFirst(pHash); k; k=sqliteHashNext(k) ){
|
136280
|
0 |
0 |
if( zRight && sqlite3_stricmp(zRight, pTab->zName)!=0 ) continue;
|
|
0 |
0 |
if( zRight && sqlite3_stricmp(zRight, pTab->zName)!=0 ) continue;
|
136281
|
0 |
0 |
if( IsView(pTab) ){
|
136283
|
0 |
0 |
}else if( IsVirtual(pTab) ){
|
136285
|
0 |
0 |
}else if( pTab->tabFlags & TF_Shadow ){
|
136330
|
24 |
0 |
case PragTyp_INDEX_INFO: if( zRight ){
|
136334
|
12 |
12 |
if( pIdx==0 ){
|
136339
|
0 |
12 |
if( pTab && !HasRowid(pTab) ){
|
|
0 |
0 |
if( pTab && !HasRowid(pTab) ){
|
136343
|
12 |
12 |
if( pIdx ){
|
136347
|
0 |
12 |
if( pPragma->iArg ){
|
136359
|
16 |
12 |
for(i=0; i<mx; i++){
|
136361
|
16 |
0 |
sqlite3VdbeMultiLoad(v, 1, "iisX", i, cnum,
|
136363
|
0 |
16 |
if( pPragma->iArg ){
|
136375
|
4 |
0 |
case PragTyp_INDEX_LIST: if( zRight ){
|
136380
|
4 |
0 |
if( pTab ){
|
136384
|
16 |
4 |
for(pIdx=pTab->pIndex, i=0; pIdx; pIdx=pIdx->pNext, i++){
|
136400
|
165 |
69 |
for(i=0; i<db->nDb; i++){
|
136401
|
40 |
125 |
if( db->aDb[i].pBt==0 ) continue;
|
136415
|
0 |
0 |
for(p=sqliteHashFirst(&db->aCollSeq); p; p=sqliteHashNext(p)){
|
136429
|
0 |
0 |
for(i=0; i<SQLITE_FUNC_HASH_SZ; i++){
|
136430
|
0 |
0 |
for(p=sqlite3BuiltinFunctions.a[i]; p; p=p->u.pHash ){
|
136435
|
0 |
0 |
for(j=sqliteHashFirst(&db->aFunc); j; j=sqliteHashNext(j)){
|
136447
|
0 |
0 |
for(j=sqliteHashFirst(&db->aModule); j; j=sqliteHashNext(j)){
|
136457
|
0 |
0 |
for(i=0; i<ArraySize(aPragmaName); i++){
|
136467
|
14 |
0 |
case PragTyp_FOREIGN_KEY_LIST: if( zRight ){
|
136471
|
14 |
0 |
if( pTab && IsOrdinaryTable(pTab) ){
|
|
14 |
0 |
if( pTab && IsOrdinaryTable(pTab) ){
|
136473
|
11 |
3 |
if( pFK ){
|
136478
|
16 |
11 |
while(pFK){
|
136480
|
18 |
16 |
for(j=0; j<pFK->nCol; j++){
|
136521
|
0 |
0 |
while( k ){
|
136522
|
0 |
0 |
if( zRight ){
|
136529
|
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;
|
136538
|
0 |
0 |
for(i=1, pFK=pTab->u.tab.pFKey; pFK; i++, pFK=pFK->pNextFrom){
|
136540
|
0 |
0 |
if( pParent==0 ) continue;
|
136544
|
0 |
0 |
if( x==0 ){
|
136545
|
0 |
0 |
if( pIdx==0 ){
|
136557
|
0 |
0 |
if( pFK ) break;
|
136558
|
0 |
0 |
if( pParse->nTab<i ) pParse->nTab = i;
|
136561
|
0 |
0 |
for(i=1, pFK=pTab->u.tab.pFKey; pFK; i++, pFK=pFK->pNextFrom){
|
136565
|
0 |
0 |
if( pParent ){
|
136576
|
0 |
0 |
for(j=0; j<pFK->nCol; j++){
|
136577
|
0 |
0 |
int iCol = aiCols ? aiCols[j] : pFK->aCol[j].iFrom;
|
136584
|
0 |
0 |
if( pIdx ){
|
136589
|
0 |
0 |
}else if( pParent ){
|
136597
|
0 |
0 |
if( HasRowid(pTab) ){
|
136620
|
0 |
0 |
if( zRight ){
|
136673
|
0 |
0 |
if( pId2->z==0 ) iDb = -1;
|
136680
|
0 |
0 |
if( zRight ){
|
136681
|
0 |
0 |
if( sqlite3GetInt32(zRight, &mxErr) ){
|
136682
|
0 |
0 |
if( mxErr<=0 ){
|
136686
|
0 |
0 |
pObjTab = sqlite3LocateTable(pParse, 0, zRight,
|
136693
|
0 |
0 |
for(i=0; i<db->nDb; i++){
|
136701
|
0 |
0 |
if( iDb>=0 && i!=iDb ) continue;
|
|
0 |
0 |
if( iDb>=0 && i!=iDb ) continue;
|
136713
|
0 |
0 |
for(cnt=0, x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){
|
136717
|
0 |
0 |
if( pObjTab && pObjTab!=pTab ) continue;
|
|
0 |
0 |
if( pObjTab && pObjTab!=pTab ) continue;
|
136718
|
0 |
0 |
if( HasRowid(pTab) ) cnt++;
|
136719
|
0 |
0 |
for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){ cnt++; }
|
136720
|
0 |
0 |
if( nIdx>mxIdx ) mxIdx = nIdx;
|
136722
|
0 |
0 |
if( cnt==0 ) continue;
|
136723
|
0 |
0 |
if( pObjTab ) cnt++;
|
136725
|
0 |
0 |
if( aRoot==0 ) break;
|
136727
|
0 |
0 |
if( pObjTab ) aRoot[++cnt] = 0;
|
136728
|
0 |
0 |
for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){
|
136731
|
0 |
0 |
if( pObjTab && pObjTab!=pTab ) continue;
|
|
0 |
0 |
if( pObjTab && pObjTab!=pTab ) continue;
|
136732
|
0 |
0 |
if( HasRowid(pTab) ) aRoot[++cnt] = pTab->tnum;
|
136733
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
136756
|
0 |
0 |
for(x=sqliteHashFirst(pTbls); x; x=sqliteHashNext(x)){
|
136767
|
0 |
0 |
if( !IsOrdinaryTable(pTab) ) continue;
|
136768
|
0 |
0 |
if( pObjTab && pObjTab!=pTab ) continue;
|
|
0 |
0 |
if( pObjTab && pObjTab!=pTab ) continue;
|
136769
|
0 |
0 |
if( isQuick || HasRowid(pTab) ){
|
|
0 |
0 |
if( isQuick || HasRowid(pTab) ){
|
136783
|
0 |
0 |
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
|
136797
|
0 |
0 |
if( HasRowid(pTab) ){
|
136799
|
0 |
0 |
for(j=0; j<pTab->nCol; j++){
|
136800
|
0 |
0 |
if( (pTab->aCol[j].colFlags & COLFLAG_VIRTUAL)==0 ) mxCol++;
|
136802
|
0 |
0 |
if( mxCol==pTab->iPKey ) mxCol--;
|
136809
|
0 |
0 |
if( mxCol>=0 ){
|
136814
|
0 |
0 |
if( !isQuick ){
|
136815
|
0 |
0 |
if( pPk ){
|
136829
|
0 |
0 |
for(j=0; j<pPk->nKeyCol; j++){
|
136844
|
0 |
0 |
for(j=0; j<pTab->nCol; j++){
|
136852
|
0 |
0 |
if( j==pTab->iPKey ) continue;
|
136853
|
0 |
0 |
if( bStrict ){
|
136858
|
0 |
0 |
if( pCol->notNull==0 && !doTypeCheck ) continue;
|
|
0 |
0 |
if( pCol->notNull==0 && !doTypeCheck ) continue;
|
136862
|
0 |
0 |
if( pCol->colFlags & COLFLAG_VIRTUAL ){
|
136867
|
0 |
0 |
if( pCol->iDflt ){
|
136871
|
0 |
0 |
if( pDfltValue ){
|
136877
|
0 |
0 |
if( !HasRowid(pTab) ){
|
136888
|
0 |
0 |
if( pCol->notNull ){
|
136893
|
0 |
0 |
if( p1<0 ){
|
136909
|
0 |
0 |
if( doTypeCheck ){
|
136917
|
0 |
0 |
if( bStrict && doTypeCheck ){
|
|
0 |
0 |
if( bStrict && doTypeCheck ){
|
136935
|
0 |
0 |
}else if( !bStrict && pCol->affinity==SQLITE_AFF_TEXT ){
|
|
0 |
0 |
}else if( !bStrict && pCol->affinity==SQLITE_AFF_TEXT ){
|
136944
|
0 |
0 |
}else if( !bStrict && pCol->affinity>=SQLITE_AFF_NUMERIC ){
|
|
0 |
0 |
}else if( !bStrict && pCol->affinity>=SQLITE_AFF_NUMERIC ){
|
136950
|
0 |
0 |
if( p1>=0 ){
|
136966
|
0 |
0 |
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){
|
|
0 |
0 |
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){
|
136968
|
0 |
0 |
if( db->mallocFailed==0 ){
|
136974
|
0 |
0 |
for(k=pCheck->nExpr-1; k>0; k--){
|
136989
|
0 |
0 |
if( !isQuick ){ /* Omit the remaining tests for quick_check */
|
136991
|
0 |
0 |
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
|
136995
|
0 |
0 |
if( pPk==pIdx ) continue;
|
137016
|
0 |
0 |
if( HasRowid(pTab) ){
|
137032
|
0 |
0 |
for(kk=0; kk<pIdx->nKeyCol; kk++){
|
137033
|
0 |
0 |
if( pIdx->azColl[kk]==sqlite3StrBINARY ) continue;
|
137034
|
0 |
0 |
if( label6==0 ) label6 = sqlite3VdbeMakeLabel(pParse);
|
137038
|
0 |
0 |
if( label6 ){
|
137051
|
0 |
0 |
if( IsUniqueIndex(pIdx) ){
|
137054
|
0 |
0 |
for(kk=0; kk<pIdx->nKeyCol; kk++){
|
137057
|
0 |
0 |
if( iCol>=0 && pTab->aCol[iCol].notNull ) continue;
|
|
0 |
0 |
if( iCol>=0 && pTab->aCol[iCol].notNull ) continue;
|
137076
|
0 |
0 |
if( !isQuick ){
|
137078
|
0 |
0 |
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
|
137079
|
0 |
0 |
if( pPk==pIdx ) continue;
|
137088
|
0 |
0 |
if( pPk ){
|
137108
|
0 |
0 |
if( aOp ){
|
137160
|
0 |
0 |
if( !zRight ){ /* "PRAGMA encoding" */
|
137161
|
0 |
0 |
if( sqlite3ReadSchema(pParse) ) goto pragma_out;
|
137172
|
0 |
0 |
if( (db->mDbFlags & DBFLAG_EncodingFixed)==0 ){
|
137173
|
0 |
0 |
for(pEnc=&encnames[0]; pEnc->zName; pEnc++){
|
137174
|
0 |
0 |
if( 0==sqlite3StrICmp(zRight, pEnc->zName) ){
|
137175
|
0 |
0 |
u8 enc = pEnc->enc ? pEnc->enc : SQLITE_UTF16NATIVE;
|
137181
|
0 |
0 |
if( !pEnc->zName ){
|
137226
|
1 |
0 |
if( zRight && (pPragma->mPragFlg & PragFlg_ReadOnly)==0 ){
|
|
1 |
0 |
if( zRight && (pPragma->mPragFlg & PragFlg_ReadOnly)==0 ){
|
137241
|
0 |
1 |
if( iCookie==BTREE_SCHEMA_VERSION && (db->flags & SQLITE_Defensive)!=0 ){
|
|
0 |
0 |
if( iCookie==BTREE_SCHEMA_VERSION && (db->flags & SQLITE_Defensive)!=0 ){
|
137277
|
0 |
0 |
while( (zOpt = sqlite3_compileoption_get(i++))!=0 ){
|
137293
|
0 |
0 |
int iBt = (pId2->z?iDb:SQLITE_MAX_DB);
|
137295
|
0 |
0 |
if( zRight ){
|
137296
|
0 |
0 |
if( sqlite3StrICmp(zRight, "full")==0 ){
|
137298
|
0 |
0 |
}else if( sqlite3StrICmp(zRight, "restart")==0 ){
|
137300
|
0 |
0 |
}else if( sqlite3StrICmp(zRight, "truncate")==0 ){
|
137319
|
0 |
0 |
if( zRight ){
|
137322
|
0 |
0 |
returnSingleInt(v,
|
137406
|
0 |
0 |
if( zRight ){
|
137408
|
0 |
0 |
if( (opMask & 0x02)==0 ) break;
|
137413
|
0 |
0 |
for(iDbLast = zDb?iDb:db->nDb-1; iDb<=iDbLast; iDb++){
|
|
0 |
0 |
for(iDbLast = zDb?iDb:db->nDb-1; iDb<=iDbLast; iDb++){
|
137414
|
0 |
0 |
if( iDb==1 ) continue;
|
137417
|
0 |
0 |
for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
|
137423
|
0 |
0 |
if( (pTab->tabFlags & TF_StatsUsed)==0 ) continue;
|
137427
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
137428
|
0 |
0 |
if( !pIdx->hasStat1 ){
|
137433
|
0 |
0 |
if( szThreshold ){
|
137441
|
0 |
0 |
if( opMask & 0x01 ){
|
137465
|
0 |
0 |
if( zRight ){
|
137485
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK ){
|
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK ){
|
137505
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK ){
|
|
0 |
0 |
if( zRight && sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK ){
|
137507
|
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);
|
137522
|
0 |
0 |
if( zRight
|
137523
|
0 |
0 |
&& sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK
|
137524
|
0 |
0 |
&& N>=0
|
137541
|
0 |
0 |
if( zRight
|
137542
|
0 |
0 |
&& sqlite3DecOrHexToI64(zRight, &N)==SQLITE_OK /* IMP: R-40975-20399 */
|
137543
|
0 |
0 |
&& N>=0
|
137646
|
0 |
0 |
for(i=0, j=pPragma->iPragCName; i<pPragma->nPragCName; i++, j++){
|
137650
|
0 |
0 |
if( i==0 ){
|
137655
|
0 |
0 |
if( pPragma->mPragFlg & PragFlg_Result1 ){
|
137659
|
0 |
0 |
if( pPragma->mPragFlg & (PragFlg_SchemaOpt|PragFlg_SchemaReq) ){
|
137667
|
0 |
0 |
if( rc==SQLITE_OK ){
|
137669
|
0 |
0 |
if( pTab==0 ){
|
137709
|
0 |
0 |
if( pTab->nHidden==0 ){ return SQLITE_OK; }
|
137713
|
0 |
0 |
for(i=0; i<pIdxInfo->nConstraint; i++, pConstraint++){
|
137714
|
0 |
0 |
if( pConstraint->usable==0 ) continue;
|
137715
|
0 |
0 |
if( pConstraint->op!=SQLITE_INDEX_CONSTRAINT_EQ ) continue;
|
137716
|
0 |
0 |
if( pConstraint->iColumn < pTab->iHidden ) continue;
|
137721
|
0 |
0 |
if( seen[0]==0 ){
|
137729
|
0 |
0 |
if( seen[1]==0 ) return SQLITE_OK;
|
137742
|
0 |
0 |
if( pCsr==0 ) return SQLITE_NOMEM;
|
137754
|
0 |
0 |
for(i=0; i<ArraySize(pCsr->azArg); i++){
|
137776
|
0 |
0 |
if( SQLITE_ROW!=sqlite3_step(pCsr->pPragma) ){
|
137803
|
0 |
0 |
for(i=0; i<argc; i++, j++){
|
137807
|
0 |
0 |
if( zText ){
|
137809
|
0 |
0 |
if( pCsr->azArg[j]==0 ){
|
137816
|
0 |
0 |
if( pCsr->azArg[1] ){
|
137820
|
0 |
0 |
if( pCsr->azArg[0] ){
|
137824
|
0 |
0 |
if( zSql==0 ) return SQLITE_NOMEM;
|
137827
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
137852
|
0 |
0 |
if( i<pTab->iHidden ){
|
137906
|
0 |
0 |
if( pName==0 ) return 0;
|
137907
|
0 |
0 |
if( (pName->mPragFlg & (PragFlg_Result0|PragFlg_Result1))==0 ) return 0;
|
137945
|
0 |
0 |
if( db->mallocFailed ){
|
137947
|
0 |
0 |
}else if( pData->pzErrMsg[0]!=0 ){
|
137949
|
0 |
0 |
}else if( pData->mInitFlags & (INITFLAG_AlterMask) ){
|
137961
|
0 |
0 |
}else if( db->flags & SQLITE_WriteSchema ){
|
137965
|
0 |
0 |
const char *zObj = azObj[1] ? azObj[1] : "?";
|
137967
|
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);
|
137980
|
43 |
40 |
for(p=pIndex->pTable->pIndex; p; p=p->pNext){
|
137981
|
35 |
8 |
if( p->tnum==pIndex->tnum && p!=pIndex ) return 1;
|
|
0 |
35 |
if( p->tnum==pIndex->tnum && p!=pIndex ) return 1;
|
138021
|
0 |
784 |
if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */
|
138023
|
0 |
784 |
if( db->mallocFailed ){
|
138029
|
0 |
784 |
if( argv[3]==0 ){
|
138031
|
749 |
35 |
}else if( argv[4]
|
138032
|
749 |
0 |
&& 'c'==sqlite3UpperToLower[(unsigned char)argv[4][0]]
|
138033
|
749 |
0 |
&& 'r'==sqlite3UpperToLower[(unsigned char)argv[4][1]] ){
|
138051
|
749 |
0 |
if( sqlite3GetUInt32(argv[3], &db->init.newTnum)==0
|
138052
|
437 |
312 |
|| (db->init.newTnum>pData->mxPage && pData->mxPage>0)
|
|
0 |
437 |
|| (db->init.newTnum>pData->mxPage && pData->mxPage>0)
|
138054
|
0 |
0 |
if( sqlite3Config.bExtraSchemaChecks ){
|
138066
|
0 |
749 |
if( SQLITE_OK!=rc ){
|
138067
|
0 |
0 |
if( db->init.orphanTrigger ){
|
138070
|
0 |
0 |
if( rc > pData->rc ) pData->rc = rc;
|
138071
|
0 |
0 |
if( rc==SQLITE_NOMEM ){
|
138073
|
0 |
0 |
}else if( rc!=SQLITE_INTERRUPT && (rc&0xFF)!=SQLITE_LOCKED ){
|
|
0 |
0 |
}else if( rc!=SQLITE_INTERRUPT && (rc&0xFF)!=SQLITE_LOCKED ){
|
138080
|
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) ){
|
138091
|
0 |
35 |
if( pIndex==0 ){
|
138094
|
35 |
0 |
if( sqlite3GetUInt32(argv[3],&pIndex->tnum)==0
|
138095
|
35 |
0 |
|| pIndex->tnum<2
|
138096
|
35 |
0 |
|| pIndex->tnum>pData->mxPage
|
138097
|
0 |
35 |
|| sqlite3IndexHasDuplicateRootPage(pIndex)
|
138099
|
0 |
0 |
if( sqlite3Config.bExtraSchemaChecks ){
|
138143
|
216 |
221 |
azArg[1] = zSchemaTabName = SCHEMA_TABLE(iDb);
|
138158
|
0 |
437 |
if( initData.rc ){
|
138166
|
216 |
221 |
if( pDb->pBt==0 ){
|
138177
|
197 |
24 |
if( sqlite3BtreeTxnState(pDb->pBt)==SQLITE_TXN_NONE ){
|
138179
|
0 |
197 |
if( rc!=SQLITE_OK ){
|
138203
|
1105 |
221 |
for(i=0; i<ArraySize(meta); i++){
|
138206
|
0 |
221 |
if( (db->flags & SQLITE_ResetDatabase)!=0 ){
|
138216
|
35 |
186 |
if( meta[BTREE_TEXT_ENCODING-1] ){ /* text encoding */
|
138217
|
35 |
0 |
if( iDb==0 && (db->mDbFlags & DBFLAG_EncodingFixed)==0 ){
|
|
32 |
3 |
if( iDb==0 && (db->mDbFlags & DBFLAG_EncodingFixed)==0 ){
|
138222
|
0 |
32 |
if( encoding==0 ) encoding = SQLITE_UTF8;
|
138226
|
0 |
32 |
if( db->nVdbeActive>0 && encoding!=ENC(db)
|
|
0 |
0 |
if( db->nVdbeActive>0 && encoding!=ENC(db)
|
138227
|
0 |
0 |
&& (db->mDbFlags & DBFLAG_Vacuum)==0
|
138236
|
0 |
3 |
if( (meta[BTREE_TEXT_ENCODING-1] & 3)!=ENC(db) ){
|
138246
|
218 |
3 |
if( pDb->pSchema->cache_size==0 ){
|
138249
|
218 |
0 |
if( size==0 ){ size = SQLITE_DEFAULT_CACHE_SIZE; }
|
138264
|
186 |
35 |
if( pDb->pSchema->file_format==0 ){
|
138267
|
0 |
221 |
if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
|
138278
|
216 |
5 |
if( iDb==0 && meta[BTREE_FILE_FORMAT-1]>=4 ){
|
|
35 |
181 |
if( iDb==0 && meta[BTREE_FILE_FORMAT-1]>=4 ){
|
138302
|
221 |
0 |
if( rc==SQLITE_OK ) rc = initData.rc;
|
138305
|
221 |
0 |
if( rc==SQLITE_OK ){
|
138311
|
0 |
221 |
if( db->mallocFailed ){
|
138316
|
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)){
|
138336
|
197 |
24 |
if( openedTransaction ){
|
138342
|
0 |
437 |
if( rc ){
|
138343
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){
|
|
0 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){
|
138371
|
216 |
289 |
if( !DbHasProperty(db, 0, DB_SchemaLoaded) ){
|
138373
|
0 |
216 |
if( rc ) return rc;
|
138376
|
581 |
505 |
for(i=db->nDb-1; i>0; i--){
|
138378
|
221 |
360 |
if( !DbHasProperty(db, i, DB_SchemaLoaded) ){
|
138380
|
0 |
221 |
if( rc ) return rc;
|
138383
|
456 |
49 |
if( commit_internal ){
|
138397
|
487 |
1005 |
if( !db->init.busy ){
|
138399
|
0 |
487 |
if( rc!=SQLITE_OK ){
|
138402
|
487 |
0 |
}else if( db->noSharedCache ){
|
138423
|
20 |
10 |
for(iDb=0; iDb<db->nDb; iDb++){
|
138426
|
10 |
10 |
if( pBt==0 ) continue;
|
138431
|
10 |
0 |
if( sqlite3BtreeTxnState(pBt)==SQLITE_TXN_NONE ){
|
138433
|
10 |
0 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){
|
|
0 |
10 |
if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){
|
138437
|
0 |
10 |
if( rc!=SQLITE_OK ) return;
|
138446
|
0 |
10 |
if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){
|
138447
|
0 |
0 |
if( DbHasProperty(db, iDb, DB_SchemaLoaded) ) pParse->rc = SQLITE_SCHEMA;
|
138452
|
10 |
0 |
if( openedTransaction ){
|
138480
|
13193 |
35 |
if( pSchema ){
|
138483
|
13193 |
5777 |
if( db->aDb[i].pSchema==pSchema ){
|
138501
|
0 |
6162 |
if( pParse->aTableLock ) sqlite3DbNNFreeNN(db, pParse->aTableLock);
|
138503
|
326 |
6162 |
while( pParse->pCleanup ){
|
138509
|
0 |
6162 |
if( pParse->aLabel ) sqlite3DbNNFreeNN(db, pParse->aLabel);
|
138510
|
932 |
5230 |
if( pParse->pConstExpr ){
|
138515
|
5664 |
498 |
db->lookaside.sz = db->lookaside.bDisable ? 0 : db->lookaside.szTrue;
|
138556
|
326 |
0 |
if( pCleanup ){
|
138587
|
0 |
62 |
if( db->mallocFailed ) sqlite3ErrorMsg(pParse, "out of memory");
|
138622
|
0 |
6100 |
if( db->mallocFailed ){
|
138632
|
98 |
6002 |
if( prepFlags & SQLITE_PREPARE_PERSISTENT ){
|
138661
|
0 |
6100 |
if( !db->noSharedCache ){
|
138662
|
0 |
0 |
for(i=0; i<db->nDb; i++) {
|
138664
|
0 |
0 |
if( pBt ){
|
138667
|
0 |
0 |
if( rc ){
|
138678
|
0 |
6100 |
if( db->pDisconnect ) sqlite3VtabUnlockList(db);
|
138681
|
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) ){
|
138686
|
0 |
0 |
if( nBytes>mxLen ){
|
138692
|
0 |
0 |
if( zSqlCopy ){
|
138704
|
4932 |
1168 |
if( pzTail ){
|
138708
|
4864 |
1236 |
if( db->init.busy==0 ){
|
138711
|
0 |
6100 |
if( db->mallocFailed ){
|
138715
|
6092 |
8 |
if( sParse.rc!=SQLITE_OK && sParse.rc!=SQLITE_DONE ){
|
|
26 |
6066 |
if( sParse.rc!=SQLITE_OK && sParse.rc!=SQLITE_DONE ){
|
138716
|
10 |
16 |
if( sParse.checkSchema && db->init.busy==0 ){
|
|
10 |
0 |
if( sParse.checkSchema && db->init.busy==0 ){
|
138719
|
10 |
16 |
if( sParse.pVdbe ){
|
138724
|
26 |
0 |
if( sParse.zErrMsg ){
|
138739
|
0 |
6100 |
while( sParse.pTriggerPrg ){
|
138766
|
5351 |
0 |
if( !sqlite3SafetyCheckOk(db)||zSql==0 ){
|
|
0 |
5351 |
if( !sqlite3SafetyCheckOk(db)||zSql==0 ){
|
138777
|
26 |
5325 |
if( rc==SQLITE_OK || db->mallocFailed ) break;
|
|
26 |
0 |
if( rc==SQLITE_OK || db->mallocFailed ) break;
|
138778
|
0 |
0 |
}while( (rc==SQLITE_ERROR_RETRY && (cnt++)<SQLITE_MAX_PREPARE_RETRY)
|
138779
|
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) );
|
138811
|
0 |
1 |
if( rc ){
|
138812
|
0 |
0 |
if( rc==SQLITE_NOMEM ){
|
138914
|
0 |
0 |
if( !sqlite3SafetyCheckOk(db)||zSql==0 ){
|
|
0 |
0 |
if( !sqlite3SafetyCheckOk(db)||zSql==0 ){
|
138917
|
0 |
0 |
if( nBytes>=0 ){
|
138920
|
0 |
0 |
for(sz=0; sz<nBytes && (z[sz]!=0 || z[sz+1]!=0); sz += 2){}
|
|
0 |
0 |
for(sz=0; sz<nBytes && (z[sz]!=0 || z[sz+1]!=0); sz += 2){}
|
|
0 |
0 |
for(sz=0; sz<nBytes && (z[sz]!=0 || z[sz+1]!=0); sz += 2){}
|
138925
|
0 |
0 |
if( zSql8 ){
|
138929
|
0 |
0 |
if( zTail8 && pzTail ){
|
|
0 |
0 |
if( zTail8 && pzTail ){
|
139079
|
4654 |
4569 |
while( p ){
|
139088
|
0 |
4654 |
if( OK_IF_ALWAYS_TRUE(p->pWith) ) sqlite3WithDelete(db, p->pWith);
|
139090
|
0 |
4654 |
if( OK_IF_ALWAYS_TRUE(p->pWinDefn) ){
|
139093
|
0 |
4654 |
while( p->pWin ){
|
139098
|
4654 |
0 |
if( bFree ) sqlite3DbNNFreeNN(db, p);
|
139135
|
0 |
4651 |
if( pNew==0 ){
|
139139
|
2 |
4649 |
if( pEList==0 ){
|
139152
|
3223 |
1428 |
if( pSrc==0 ) pSrc = sqlite3DbMallocZero(pParse->db, sizeof(*pSrc));
|
139166
|
0 |
4651 |
if( pParse->db->mallocFailed ) {
|
139180
|
4569 |
2693 |
if( OK_IF_ALWAYS_TRUE(p) ) clearSelect(db, p, 1);
|
139187
|
0 |
2 |
while( p->pNext ) p = p->pNext;
|
139277
|
16 |
0 |
for(i=0; i<3 && apAll[i]; i++){
|
|
8 |
8 |
for(i=0; i<3 && apAll[i]; i++){
|
139279
|
32 |
0 |
for(j=0; j<ArraySize(aKeyword); j++){
|
139280
|
16 |
16 |
if( p->n==aKeyword[j].nChar
|
139281
|
8 |
8 |
&& sqlite3StrNICmp((char*)p->z, &zKeyText[aKeyword[j].i], p->n)==0 ){
|
139287
|
0 |
8 |
if( j>=ArraySize(aKeyword) ){
|
139292
|
8 |
0 |
if(
|
139293
|
8 |
0 |
(jointype & (JT_INNER|JT_OUTER))==(JT_INNER|JT_OUTER) ||
|
139294
|
0 |
8 |
(jointype & JT_ERROR)!=0 ||
|
139299
|
0 |
0 |
if( pB==0 ){ zSp1++; }
|
139300
|
0 |
0 |
if( pC==0 ){ zSp2++; }
|
139316
|
0 |
0 |
for(pCol=pTab->aCol, i=0; i<pTab->nCol; pCol++, i++){
|
139317
|
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;
|
139328
|
0 |
0 |
if( pItem->fg.isNestedFrom ){
|
139364
|
0 |
0 |
for(i=iStart; i<=iEnd; i++){
|
139366
|
0 |
0 |
if( iCol>=0
|
139367
|
0 |
0 |
&& (bIgnoreHidden==0 || IsHiddenColumn(&pSrc->a[i].pTab->aCol[iCol])==0)
|
|
0 |
0 |
&& (bIgnoreHidden==0 || IsHiddenColumn(&pSrc->a[i].pTab->aCol[iCol])==0)
|
139369
|
0 |
0 |
if( piTab ){
|
139408
|
72 |
80 |
while( p ){
|
139413
|
0 |
72 |
if( p->op==TK_FUNCTION ){
|
139415
|
0 |
0 |
if( p->x.pList ){
|
139417
|
0 |
0 |
for(i=0; i<p->x.pList->nExpr; i++){
|
139442
|
316 |
610 |
while( p ){
|
139443
|
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) ){
|
139445
|
5 |
308 |
if( iTable>=0 ) ExprSetProperty(p, EP_InnerON);
|
139447
|
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 ){
|
139450
|
96 |
220 |
if( p->op==TK_FUNCTION ){
|
139452
|
96 |
0 |
if( p->x.pList ){
|
139454
|
192 |
96 |
for(i=0; i<p->x.pList->nExpr; i++){
|
139494
|
11 |
1958 |
for(i=0; i<pSrc->nSrc-1; i++, pRight++, pLeft++){
|
139498
|
11 |
0 |
if( NEVER(pLeft->pTab==0 || pRightTab==0) ) continue;
|
|
0 |
11 |
if( NEVER(pLeft->pTab==0 || pRightTab==0) ) continue;
|
139499
|
4 |
7 |
joinType = (pRight->fg.jointype & JT_OUTER)!=0 ? EP_OuterON : EP_InnerON;
|
139504
|
0 |
11 |
if( pRight->fg.jointype & JT_NATURAL ){
|
139506
|
0 |
0 |
if( pRight->fg.isUsing || pRight->u3.pOn ){
|
|
0 |
0 |
if( pRight->fg.isUsing || pRight->u3.pOn ){
|
139511
|
0 |
0 |
for(j=0; j<pRightTab->nCol; j++){
|
139514
|
0 |
0 |
if( IsHiddenColumn(&pRightTab->aCol[j]) ) continue;
|
139516
|
0 |
0 |
if( tableAndColumnIndex(pSrc, 0, i, zName, 0, 0, 1) ){
|
139518
|
0 |
0 |
if( pUsing ){
|
139525
|
0 |
0 |
if( pUsing ){
|
139530
|
0 |
0 |
if( pParse->nErr ) return 1;
|
139540
|
0 |
11 |
if( pRight->fg.isUsing ){
|
139544
|
0 |
0 |
for(j=0; j<pList->nId; j++){
|
139555
|
0 |
0 |
if( iRightCol<0
|
139556
|
0 |
0 |
|| tableAndColumnIndex(pSrc, 0, i, zName, &iLeft, &iLeftCol,
|
139565
|
0 |
0 |
if( (pSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){
|
139581
|
0 |
0 |
while( tableAndColumnIndex(pSrc, iLeft+1, i, zName, &iLeft, &iLeftCol,
|
139583
|
0 |
0 |
if( pSrc->a[iLeft].fg.isUsing==0
|
139584
|
0 |
0 |
|| sqlite3IdListIndex(pSrc->a[iLeft].u3.pUsing, zName)<0
|
139594
|
0 |
0 |
if( pFuncArgs ){
|
139603
|
0 |
0 |
if( pEq ){
|
139616
|
8 |
3 |
else if( pRight->u3.pOn ){
|
139675
|
1 |
106 |
if( pSort->pDeferredRowLoad ){
|
139727
|
107 |
0 |
if( nPrefixReg ){
|
139735
|
0 |
107 |
iLimit = pSelect->iOffset ? pSelect->iOffset+1 : pSelect->iLimit;
|
139737
|
19 |
88 |
sqlite3ExprCodeExprList(pParse, pSort->pOrderBy, regBase, regOrigData,
|
139739
|
1 |
106 |
if( bSeq ){
|
139742
|
0 |
107 |
if( nPrefixReg==0 && nData>0 ){
|
|
0 |
0 |
if( nPrefixReg==0 && nData>0 ){
|
139745
|
18 |
89 |
if( nOBSat>0 ){
|
139757
|
0 |
18 |
if( bSeq ){
|
139765
|
0 |
18 |
if( pParse->db->mallocFailed ) return;
|
139780
|
0 |
18 |
if( iLimit ){
|
139788
|
1 |
106 |
if( iLimit ){
|
139813
|
89 |
18 |
if( regRecord==0 ){
|
139816
|
106 |
1 |
if( pSort->sortFlags & SORTFLAG_UseSorter ){
|
139823
|
1 |
106 |
if( iSkip ){
|
139824
|
0 |
1 |
sqlite3VdbeChangeP2(v, iSkip,
|
139840
|
0 |
1835 |
if( iOffset>0 ){
|
139912
|
0 |
0 |
for(i=0; i<nResultCol; i++){
|
139914
|
0 |
0 |
if( i<nResultCol-1 ){
|
139979
|
4 |
0 |
if( pParse->nErr==0
|
139980
|
4 |
0 |
&& (eTnctType==WHERE_DISTINCT_UNIQUE || eTnctType==WHERE_DISTINCT_ORDERED)
|
|
0 |
4 |
&& (eTnctType==WHERE_DISTINCT_UNIQUE || eTnctType==WHERE_DISTINCT_ORDERED)
|
139984
|
0 |
0 |
if( sqlite3VdbeGetOp(v, iOpenEphAddr+1)->opcode==OP_Explain ){
|
139987
|
0 |
0 |
if( eTnctType==WHERE_DISTINCT_ORDERED ){
|
140124
|
1798 |
143 |
hasDistinct = pDistinct ? pDistinct->eTnctType : WHERE_DISTINCT_NOOP;
|
140125
|
1798 |
143 |
if( pSort && pSort->pOrderBy==0 ) pSort = 0;
|
|
1691 |
107 |
if( pSort && pSort->pOrderBy==0 ) pSort = 0;
|
140126
|
1834 |
107 |
if( pSort==0 && !hasDistinct ){
|
|
1830 |
4 |
if( pSort==0 && !hasDistinct ){
|
140135
|
1836 |
105 |
if( pDest->iSdst==0 ){
|
140136
|
107 |
1729 |
if( pSort ){
|
140138
|
1 |
106 |
if( !(pSort->sortFlags & SORTFLAG_UseSorter) ) nPrefixReg++;
|
140143
|
0 |
105 |
}else if( pDest->iSdst+nResultCol > pParse->nMem ){
|
140153
|
2 |
1939 |
if( srcTab>=0 ){
|
140154
|
2 |
2 |
for(i=0; i<nResultCol; i++){
|
140158
|
1939 |
0 |
}else if( eDest!=SRT_Exists ){
|
140167
|
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 ){
|
140172
|
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 ){
|
140181
|
139 |
107 |
for(i=pSort->nOBSat; i<pSort->pOrderBy->nExpr; i++){
|
140183
|
120 |
19 |
if( (j = pSort->pOrderBy->a[i].u.x.iOrderByCol)>0 ){
|
140205
|
261 |
107 |
for(i=0; i<pEList->nExpr; i++){
|
140206
|
120 |
141 |
if( pEList->a[i].u.x.iOrderByCol>0
|
140232
|
20 |
1919 |
if( p->iLimit
|
140233
|
1 |
19 |
&& (ecelFlags & SQLITE_ECEL_OMITREF)!=0
|
140234
|
1 |
0 |
&& nPrefixReg>0
|
140249
|
4 |
1937 |
if( hasDistinct ){
|
140255
|
4 |
0 |
if( pSort==0 ){
|
140297
|
0 |
0 |
if( eDest==SRT_DistFifo ){
|
140310
|
0 |
0 |
if( pSort ){
|
140325
|
0 |
0 |
if( pSort ){
|
140339
|
0 |
0 |
if( i2<0 ){
|
140354
|
0 |
3 |
if( pSort ){
|
140386
|
0 |
18 |
if( pSort ){
|
140403
|
107 |
1807 |
if( pSort ){
|
140406
|
107 |
1700 |
}else if( eDest==SRT_Coroutine ){
|
140433
|
0 |
0 |
if( eDest==SRT_DistQueue ){
|
140442
|
0 |
0 |
if( eDest==SRT_DistQueue ){
|
140446
|
0 |
0 |
for(i=0; i<nKey; i++){
|
140454
|
0 |
0 |
if( addrTest ) sqlite3VdbeJumpHere(v, addrTest);
|
140480
|
1834 |
107 |
if( pSort==0 && p->iLimit ){
|
|
19 |
1815 |
if( pSort==0 && p->iLimit ){
|
140492
|
737 |
0 |
if( p ){
|
140510
|
764 |
0 |
if( p ){
|
140514
|
737 |
27 |
if( p->nRef==0 ) sqlite3DbNNFreeNN(p->db, p);
|
140522
|
27 |
0 |
if( p ){
|
140567
|
650 |
0 |
if( pInfo ){
|
140569
|
703 |
650 |
for(i=iStart, pItem=pList->a+iStart; i<nExpr; i++, pItem++){
|
140657
|
18 |
89 |
ExplainQueryPlan2(addrExplain, (pParse, 0,
|
140665
|
18 |
89 |
if( pSort->labelBkOut ){
|
140682
|
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 ){
|
140683
|
0 |
107 |
if( eDest==SRT_Mem && p->iOffset ){
|
|
0 |
0 |
if( eDest==SRT_Mem && p->iOffset ){
|
140690
|
0 |
0 |
if( eDest==SRT_EphemTab || eDest==SRT_Table ){
|
|
0 |
0 |
if( eDest==SRT_EphemTab || eDest==SRT_Table ){
|
140698
|
106 |
1 |
if( pSort->sortFlags & SORTFLAG_UseSorter ){
|
140701
|
18 |
88 |
if( pSort->labelBkOut ){
|
140706
|
18 |
88 |
if( addrOnce ) sqlite3VdbeJumpHere(v, addrOnce);
|
140717
|
0 |
1 |
if( p->iOffset>0 ){
|
140721
|
261 |
107 |
for(i=0, iCol=nKey+bSeq-1; i<nColumn; i++){
|
140725
|
141 |
120 |
if( aOutEx[i].u.x.iOrderByCol==0 ) iCol++;
|
140758
|
261 |
107 |
for(i=nColumn-1; i>=0; i--){
|
140766
|
120 |
141 |
if( aOutEx[i].u.x.iOrderByCol ){
|
140802
|
0 |
0 |
if( i2<0 ){
|
140813
|
107 |
0 |
if( eDest==SRT_Output ){
|
140821
|
0 |
107 |
if( regRowid ){
|
140822
|
0 |
0 |
if( eDest==SRT_Set ){
|
140832
|
106 |
1 |
if( pSort->sortFlags & SORTFLAG_UseSorter ){
|
140838
|
18 |
89 |
if( pSort->regReturn ) sqlite3VdbeAddOp1(v, OP_Return, pSort->regReturn);
|
140898
|
7564 |
0 |
while( pNC && !pTab ){
|
|
3782 |
3782 |
while( pNC && !pTab ){
|
140900
|
3787 |
0 |
for(j=0;j<pTabList->nSrc && pTabList->a[j].iCursor!=pExpr->iTable;j++);
|
|
5 |
3782 |
for(j=0;j<pTabList->nSrc && pTabList->a[j].iCursor!=pExpr->iTable;j++);
|
140901
|
3782 |
0 |
if( j<pTabList->nSrc ){
|
140909
|
0 |
3782 |
if( pTab==0 ){
|
140931
|
198 |
3584 |
if( pS ){
|
140936
|
198 |
0 |
if( iCol<pS->pEList->nExpr
|
140940
|
198 |
0 |
&& ALWAYS(iCol>=0)
|
140958
|
101 |
3483 |
if( iCol<0 ) iCol = pTab->iPKey;
|
140960
|
12 |
3572 |
if( iCol<0 ){
|
140968
|
3551 |
33 |
if( pNC->pParse && pTab->pSchema ){
|
|
3551 |
0 |
if( pNC->pParse && pTab->pSchema ){
|
141005
|
4494 |
146 |
if( pzOrigDb ){
|
141031
|
4296 |
1807 |
for(i=0; i<pEList->nExpr; i++){
|
141101
|
0 |
1807 |
if( pParse->explain ){
|
141106
|
0 |
1807 |
if( pParse->colNamesSet ) return;
|
141108
|
0 |
1807 |
while( pSelect->pPrior ) pSelect = pSelect->pPrior;
|
141116
|
1 |
1806 |
srcName = (db->flags & SQLITE_ShortColNames)!=0 || fullName;
|
|
1 |
0 |
srcName = (db->flags & SQLITE_ShortColNames)!=0 || fullName;
|
141118
|
4296 |
1807 |
for(i=0; i<pEList->nExpr; i++){
|
141125
|
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 ){
|
141129
|
1490 |
0 |
}else if( srcName && p->op==TK_COLUMN ){
|
|
866 |
624 |
}else if( srcName && p->op==TK_COLUMN ){
|
141134
|
86 |
780 |
if( iCol<0 ) iCol = pTab->iPKey;
|
141136
|
12 |
854 |
if( iCol<0 ){
|
141141
|
0 |
866 |
if( fullName ){
|
141150
|
0 |
624 |
z = z==0 ? sqlite3MPrintf(db, "column%d", i+1) : sqlite3DbStrDup(db, z);
|
141196
|
35 |
0 |
if( pEList ){
|
141200
|
0 |
35 |
if( NEVER(nCol>32767) ) nCol = 32767;
|
141209
|
146 |
35 |
for(i=0, pCol=aCol; i<nCol && !pParse->nErr; i++, pCol++){
|
|
146 |
0 |
for(i=0, pCol=aCol; i<nCol && !pParse->nErr; i++, pCol++){
|
141214
|
146 |
0 |
if( (zName = pX->zEName)!=0 && pX->fg.eEName==ENAME_NAME ){
|
|
87 |
59 |
if( (zName = pX->zEName)!=0 && pX->fg.eEName==ENAME_NAME ){
|
141218
|
59 |
0 |
while( ALWAYS(pColExpr!=0) && pColExpr->op==TK_DOT ){
|
|
0 |
59 |
while( ALWAYS(pColExpr!=0) && pColExpr->op==TK_DOT ){
|
141222
|
0 |
59 |
if( pColExpr->op==TK_COLUMN
|
141223
|
0 |
0 |
&& ALWAYS( ExprUseYTab(pColExpr) )
|
141224
|
0 |
0 |
&& ALWAYS( pColExpr->y.pTab!=0 )
|
141229
|
0 |
0 |
if( iCol<0 ) iCol = pTab->iPKey;
|
141230
|
0 |
0 |
zName = iCol>=0 ? pTab->aCol[iCol].zCnName : "rowid";
|
141231
|
59 |
0 |
}else if( pColExpr->op==TK_ID ){
|
141239
|
146 |
0 |
if( zName && !sqlite3IsTrueOrFalse(zName) ){
|
|
146 |
0 |
if( zName && !sqlite3IsTrueOrFalse(zName) ){
|
141249
|
146 |
0 |
while( zName && (pCollide = sqlite3HashFind(&ht, zName))!=0 ){
|
|
0 |
146 |
while( zName && (pCollide = sqlite3HashFind(&ht, zName))!=0 ){
|
141250
|
0 |
0 |
if( pCollide->fg.bUsingTerm ){
|
141254
|
0 |
0 |
if( nName>0 ){
|
141255
|
0 |
0 |
for(j=nName-1; j>0 && sqlite3Isdigit(zName[j]); j--){}
|
|
0 |
0 |
for(j=nName-1; j>0 && sqlite3Isdigit(zName[j]); j--){}
|
141256
|
0 |
0 |
if( zName[j]==':' ) nName = j;
|
141260
|
0 |
0 |
if( cnt>3 ){
|
141266
|
0 |
146 |
if( pX->fg.bNoExpand ){
|
141270
|
146 |
0 |
if( zName && sqlite3HashInsert(&ht, zName, pX)==pX ){
|
|
0 |
146 |
if( zName && sqlite3HashInsert(&ht, zName, pX)==pX ){
|
141275
|
0 |
35 |
if( pParse->nErr ){
|
141276
|
0 |
0 |
for(j=0; j<i; j++){
|
141316
|
35 |
0 |
if( db->mallocFailed || IN_RENAME_OBJECT ) return;
|
|
0 |
35 |
if( db->mallocFailed || IN_RENAME_OBJECT ) return;
|
141317
|
75 |
35 |
while( pSelect->pPrior ) pSelect = pSelect->pPrior;
|
141321
|
146 |
35 |
for(i=0, pCol=pTab->aCol; i<pTab->nCol; i++, pCol++){
|
141328
|
87 |
59 |
if( pCol->affinity<=SQLITE_AFF_NONE ){
|
141331
|
59 |
87 |
if( pCol->affinity>=SQLITE_AFF_TEXT && pSelect->pNext ){
|
|
33 |
26 |
if( pCol->affinity>=SQLITE_AFF_TEXT && pSelect->pNext ){
|
141334
|
119 |
33 |
for(m=0, pS2=pSelect->pNext; pS2; pS2=pS2->pNext){
|
141337
|
33 |
0 |
if( pCol->affinity==SQLITE_AFF_TEXT && (m&0x01)!=0 ){
|
|
0 |
33 |
if( pCol->affinity==SQLITE_AFF_TEXT && (m&0x01)!=0 ){
|
141340
|
0 |
33 |
if( pCol->affinity>=SQLITE_AFF_NUMERIC && (m&0x02)!=0 ){
|
|
0 |
0 |
if( pCol->affinity>=SQLITE_AFF_NUMERIC && (m&0x02)!=0 ){
|
141343
|
0 |
33 |
if( pCol->affinity>=SQLITE_AFF_NUMERIC && p->op==TK_CAST ){
|
|
0 |
0 |
if( pCol->affinity>=SQLITE_AFF_NUMERIC && p->op==TK_CAST ){
|
141348
|
33 |
113 |
if( zType==0 || pCol->affinity!=sqlite3AffinityType(zType, 0) ){
|
|
0 |
33 |
if( zType==0 || pCol->affinity!=sqlite3AffinityType(zType, 0) ){
|
141349
|
113 |
0 |
if( pCol->affinity==SQLITE_AFF_NUMERIC
|
141350
|
0 |
113 |
|| pCol->affinity==SQLITE_AFF_FLEXNUM
|
141355
|
565 |
87 |
for(j=1; j<SQLITE_N_STDTYPE; j++){
|
141356
|
26 |
539 |
if( sqlite3StdTypeAffinity[j]==pCol->affinity ){
|
141363
|
59 |
87 |
if( zType ){
|
141368
|
59 |
0 |
if( pCol->zCnName ){
|
141374
|
85 |
61 |
if( pColl ){
|
141396
|
0 |
0 |
if( pParse->nErr ) return 0;
|
141397
|
0 |
0 |
while( pSelect->pPrior ) pSelect = pSelect->pPrior;
|
141399
|
0 |
0 |
if( pTab==0 ){
|
141408
|
0 |
0 |
if( db->mallocFailed ){
|
141420
|
1364 |
5358 |
if( pParse->pVdbe ){
|
141423
|
5358 |
0 |
if( pParse->pToplevel==0
|
141424
|
5358 |
0 |
&& OptimizationEnabled(pParse->db,SQLITE_FactorOutConst)
|
141462
|
0 |
22 |
if( p->iLimit ) return;
|
141470
|
20 |
2 |
if( pLimit ){
|
141476
|
20 |
0 |
if( sqlite3ExprIsInteger(pLimit->pLeft, &n) ){
|
141479
|
0 |
20 |
if( n==0 ){
|
141481
|
20 |
0 |
}else if( n>=0 && p->nSelectRow>sqlite3LogEst((u64)n) ){
|
|
20 |
0 |
}else if( n>=0 && p->nSelectRow>sqlite3LogEst((u64)n) ){
|
141491
|
0 |
20 |
if( pLimit->pRight ){
|
141514
|
4 |
2 |
if( p->pPrior ){
|
141523
|
6 |
0 |
if( pRet==0 && ALWAYS(iCol<p->pEList->nExpr) ){
|
|
6 |
0 |
if( pRet==0 && ALWAYS(iCol<p->pEList->nExpr) ){
|
141540
|
0 |
0 |
int nOrderBy = ALWAYS(pOrderBy!=0) ? pOrderBy->nExpr : 0;
|
141543
|
0 |
0 |
if( pRet ){
|
141545
|
0 |
0 |
for(i=0; i<nOrderBy; i++){
|
141550
|
0 |
0 |
if( pTerm->flags & EP_Collate ){
|
141554
|
0 |
0 |
if( pColl==0 ) pColl = db->pDfltColl;
|
141629
|
0 |
0 |
if( p->pWin ){
|
141636
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_RECURSIVE, 0, 0, 0) ) return;
|
141650
|
0 |
0 |
for(i=0; ALWAYS(i<pSrc->nSrc); i++){
|
141651
|
0 |
0 |
if( pSrc->a[i].fg.isRecursive ){
|
141661
|
0 |
0 |
if( p->op==TK_UNION ){
|
141662
|
0 |
0 |
eDest = pOrderBy ? SRT_DistQueue : SRT_DistFifo;
|
141665
|
0 |
0 |
eDest = pOrderBy ? SRT_Queue : SRT_Fifo;
|
141672
|
0 |
0 |
if( pOrderBy ){
|
141681
|
0 |
0 |
if( iDistinct ){
|
141696
|
0 |
0 |
for(pFirstRec=p; ALWAYS(pFirstRec!=0); pFirstRec=pFirstRec->pPrior){
|
141697
|
0 |
0 |
if( pFirstRec->selFlags & SF_Aggregate ){
|
141702
|
0 |
0 |
if( (pFirstRec->pPrior->selFlags & SF_Recursive)==0 ) break;
|
141711
|
0 |
0 |
if( rc ) goto end_of_recursive_query;
|
141718
|
0 |
0 |
if( pOrderBy ){
|
141730
|
0 |
0 |
if( regLimit ){
|
141794
|
0 |
14 |
if( p->pWin ) return -1;
|
141796
|
4 |
10 |
if( p->pPrior==0 ) break;
|
141801
|
0 |
4 |
ExplainQueryPlan((pParse, 0, "SCAN %d CONSTANT ROW%s", nRow,
|
141803
|
14 |
4 |
while( p ){
|
141805
|
0 |
14 |
if( !bShowAll ) break;
|
141818
|
0 |
0 |
while( p && (p->selFlags & SF_Recursive)!=0 ){ p = p->pPrior; }
|
|
0 |
0 |
while( p && (p->selFlags & SF_Recursive)!=0 ){ p = p->pPrior; }
|
141882
|
0 |
79 |
if( dest.eDest==SRT_EphemTab ){
|
141890
|
4 |
75 |
if( p->selFlags & SF_MultiValue ){
|
141892
|
4 |
0 |
if( rc>=0 ) goto multi_select_end;
|
141903
|
0 |
75 |
if( (p->selFlags & SF_Recursive)!=0 && hasAnchor(p) ){
|
|
0 |
0 |
if( (p->selFlags & SF_Recursive)!=0 && hasAnchor(p) ){
|
141910
|
0 |
75 |
if( p->pOrderBy ){
|
141915
|
22 |
53 |
if( pPrior->pPrior==0 ){
|
141934
|
0 |
71 |
if( rc ){
|
141940
|
0 |
71 |
if( p->iLimit ){
|
141943
|
0 |
0 |
if( p->iOffset ){
|
141955
|
0 |
71 |
if( p->pLimit
|
141956
|
0 |
0 |
&& sqlite3ExprIsInteger(p->pLimit->pLeft, &nLimit)
|
141957
|
0 |
0 |
&& nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit)
|
|
0 |
0 |
&& nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit)
|
141961
|
0 |
71 |
if( addr ){
|
141978
|
2 |
2 |
if( dest.eDest==priorOp ){
|
142004
|
0 |
4 |
if( rc ){
|
142010
|
0 |
4 |
if( p->op==TK_EXCEPT ){
|
142029
|
4 |
0 |
if( p->op==TK_UNION ){
|
142042
|
2 |
2 |
if( dest.eDest!=priorOp && db->mallocFailed==0 ){
|
|
2 |
0 |
if( dest.eDest!=priorOp && db->mallocFailed==0 ){
|
142085
|
0 |
0 |
if( rc ){
|
142105
|
0 |
0 |
if( p->nSelectRow>pPrior->nSelectRow ){
|
142114
|
0 |
0 |
if( rc ) break;
|
142137
|
22 |
53 |
if( p->pNext==0 ){
|
142142
|
0 |
75 |
if( pParse->nErr ) goto multi_select_end;
|
142153
|
2 |
73 |
if( p->selFlags & SF_UsesEphemeral ){
|
142164
|
0 |
2 |
if( !pKeyInfo ){
|
142168
|
2 |
2 |
for(i=0, apColl=pKeyInfo->aColl; i<nCol; i++, apColl++){
|
142170
|
2 |
0 |
if( 0==*apColl ){
|
142175
|
6 |
2 |
for(pLoop=p; pLoop; pLoop=pLoop->pPrior){
|
142176
|
8 |
0 |
for(i=0; i<2; i++){
|
142178
|
6 |
2 |
if( addr<0 ){
|
142196
|
0 |
79 |
if( pDelete ){
|
142210
|
0 |
0 |
if( p->selFlags & SF_Values ){
|
142258
|
0 |
0 |
if( regPrev ){
|
142268
|
0 |
0 |
if( pParse->db->mallocFailed ) return 0;
|
142323
|
0 |
0 |
if( pDest->iSdst==0 ){
|
142349
|
0 |
0 |
if( p->iLimit ){
|
142510
|
0 |
0 |
if( op!=TK_ALL ){
|
142511
|
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++){
|
142513
|
0 |
0 |
for(j=0, pItem=pOrderBy->a; j<nOrderBy; j++, pItem++){
|
142516
|
0 |
0 |
if( pItem->u.x.iOrderByCol==i ) break;
|
142518
|
0 |
0 |
if( j==nOrderBy ){
|
142520
|
0 |
0 |
if( pNew==0 ) return SQLITE_NOMEM_BKPT;
|
142524
|
0 |
0 |
if( pOrderBy ) pOrderBy->a[nOrderBy++].u.x.iOrderByCol = (u16)i;
|
142537
|
0 |
0 |
if( aPermute ){
|
142540
|
0 |
0 |
for(i=1, pItem=pOrderBy->a; i<=nOrderBy; i++, pItem++){
|
142555
|
0 |
0 |
if( op==TK_ALL ){
|
142564
|
0 |
0 |
if( pKeyDup ){
|
142566
|
0 |
0 |
for(i=0; i<nExpr; i++){
|
142576
|
0 |
0 |
if( (op==TK_ALL || op==TK_UNION)
|
|
0 |
0 |
if( (op==TK_ALL || op==TK_UNION)
|
142577
|
0 |
0 |
&& OptimizationEnabled(db, SQLITE_BalancedMerge)
|
142579
|
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){
|
142584
|
0 |
0 |
if( nSelect<=3 ){
|
142588
|
0 |
0 |
for(i=2; i<nSelect; i+=2){ pSplit = pSplit->pPrior; }
|
142602
|
0 |
0 |
if( p->iLimit && op==TK_ALL ){
|
|
0 |
0 |
if( p->iLimit && op==TK_ALL ){
|
142605
|
0 |
0 |
sqlite3VdbeAddOp2(v, OP_Copy, p->iOffset ? p->iOffset+1 : p->iLimit,
|
142662
|
0 |
0 |
if( op==TK_ALL || op==TK_UNION ){
|
|
0 |
0 |
if( op==TK_ALL || op==TK_UNION ){
|
142673
|
0 |
0 |
if( op==TK_EXCEPT || op==TK_INTERSECT ){
|
|
0 |
0 |
if( op==TK_EXCEPT || op==TK_INTERSECT ){
|
142687
|
0 |
0 |
if( op==TK_INTERSECT ){
|
142689
|
0 |
0 |
if( p->nSelectRow > pPrior->nSelectRow ) p->nSelectRow = pPrior->nSelectRow;
|
142706
|
0 |
0 |
if( op==TK_ALL ){
|
142708
|
0 |
0 |
}else if( op==TK_INTERSECT ){
|
142722
|
0 |
0 |
if( op==TK_ALL || op==TK_UNION ){
|
|
0 |
0 |
if( op==TK_ALL || op==TK_UNION ){
|
142749
|
0 |
0 |
if( pSplit->pPrior ){
|
142831
|
1126 |
740 |
if( pExpr==0 ) return 0;
|
142832
|
0 |
740 |
if( ExprHasProperty(pExpr, EP_OuterON|EP_InnerON)
|
142833
|
0 |
0 |
&& pExpr->w.iJoin==pSubst->iTable
|
142838
|
325 |
415 |
if( pExpr->op==TK_COLUMN
|
142839
|
233 |
92 |
&& pExpr->iTable==pSubst->iTable
|
142840
|
233 |
0 |
&& !ExprHasProperty(pExpr, EP_FixedCol)
|
142854
|
0 |
233 |
if( sqlite3ExprIsVector(pCopy) ){
|
142858
|
0 |
233 |
if( pSubst->isOuterJoin
|
142859
|
0 |
0 |
&& (pCopy->op!=TK_COLUMN || pCopy->iTable!=pSubst->iNewTable)
|
|
0 |
0 |
&& (pCopy->op!=TK_COLUMN || pCopy->iTable!=pSubst->iNewTable)
|
142871
|
0 |
233 |
if( db->mallocFailed ){
|
142875
|
0 |
233 |
if( pSubst->isOuterJoin ){
|
142878
|
0 |
233 |
if( ExprHasProperty(pExpr,EP_OuterON|EP_InnerON) ){
|
142884
|
0 |
233 |
if( pExpr->op==TK_TRUEFALSE ){
|
142897
|
197 |
36 |
if( pNat!=pColl || (pExpr->op!=TK_COLUMN && pExpr->op!=TK_COLLATE) ){
|
|
46 |
151 |
if( pNat!=pColl || (pExpr->op!=TK_COLUMN && pExpr->op!=TK_COLLATE) ){
|
|
46 |
0 |
if( pNat!=pColl || (pExpr->op!=TK_COLUMN && pExpr->op!=TK_COLLATE) ){
|
142898
|
36 |
46 |
pExpr = sqlite3ExprAddCollateString(pSubst->pParse, pExpr,
|
142907
|
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 ){
|
142912
|
0 |
507 |
if( ExprUseXSelect(pExpr) ){
|
142918
|
0 |
507 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){
|
142933
|
510 |
219 |
if( pList==0 ) return;
|
142934
|
603 |
219 |
for(i=0; i<pList->nExpr; i++){
|
142946
|
35 |
26 |
if( !p ) return;
|
142955
|
48 |
74 |
for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){
|
142957
|
0 |
48 |
if( pItem->fg.isTabFunc ){
|
142961
|
61 |
13 |
}while( doPrior && (p = p->pPrior)!=0 );
|
|
48 |
13 |
}while( doPrior && (p = p->pPrior)!=0 );
|
142975
|
260 |
198 |
if( pExpr->op!=TK_COLUMN ) return WRC_Continue;
|
142977
|
92 |
106 |
if( pItem->iCursor!=pExpr->iTable ) return WRC_Continue;
|
142978
|
0 |
106 |
if( pExpr->iColumn<0 ) return WRC_Continue;
|
142987
|
0 |
13 |
if( NEVER(pSrcItem->pTab==0) ) return;
|
143019
|
0 |
0 |
for(i=0, pItem=pSrc->a; i<pSrc->nSrc; i++, pItem++){
|
143020
|
0 |
0 |
if( i!=iExcept ){
|
143023
|
0 |
0 |
if( !pItem->fg.isRecursive || aCsrMap[pItem->iCursor+1]==0 ){
|
|
0 |
0 |
if( !pItem->fg.isRecursive || aCsrMap[pItem->iCursor+1]==0 ){
|
143027
|
0 |
0 |
for(p=pItem->pSelect; p; p=p->pPrior){
|
143040
|
0 |
0 |
if( iCsr < aCsrMap[0] && aCsrMap[iCsr+1]>0 ){
|
|
0 |
0 |
if( iCsr < aCsrMap[0] && aCsrMap[iCsr+1]>0 ){
|
143051
|
0 |
0 |
if( op==TK_COLUMN || op==TK_IF_NULL_ROW ){
|
|
0 |
0 |
if( op==TK_COLUMN || op==TK_IF_NULL_ROW ){
|
143054
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_OuterON) ){
|
143100
|
184 |
114 |
while( pSel->pPrior ){
|
143117
|
0 |
0 |
for(ii=0; ii<pList->nExpr; ii++){
|
143122
|
0 |
0 |
for(pSub1=p->pPrior; pSub1; pSub1=pSub1->pPrior){
|
143126
|
0 |
0 |
if( sqlite3ExprAffinity(pSub1->pEList->a[ii].pExpr)!=aff ){
|
143333
|
0 |
35 |
if( OptimizationDisabled(db, SQLITE_QueryFlattener) ) return 0;
|
143342
|
35 |
0 |
if( p->pWin || pSub->pWin ) return 0; /* Restriction (25) */
|
|
0 |
35 |
if( p->pWin || pSub->pWin ) return 0; /* Restriction (25) */
|
143352
|
0 |
35 |
if( pSub->pLimit && p->pLimit ) return 0; /* Restriction (13) */
|
|
0 |
0 |
if( pSub->pLimit && p->pLimit ) return 0; /* Restriction (13) */
|
143353
|
0 |
35 |
if( pSub->pLimit && pSub->pLimit->pRight ) return 0; /* Restriction (14) */
|
|
0 |
0 |
if( pSub->pLimit && pSub->pLimit->pRight ) return 0; /* Restriction (14) */
|
143354
|
0 |
35 |
if( (p->selFlags & SF_Compound)!=0 && pSub->pLimit ){
|
|
0 |
0 |
if( (p->selFlags & SF_Compound)!=0 && pSub->pLimit ){
|
143357
|
22 |
13 |
if( pSubSrc->nSrc==0 ) return 0; /* Restriction (7) */
|
143358
|
0 |
13 |
if( pSub->selFlags & SF_Distinct ) return 0; /* Restriction (4) */
|
143359
|
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) ){
|
143362
|
13 |
0 |
if( p->pOrderBy && pSub->pOrderBy ){
|
|
0 |
13 |
if( p->pOrderBy && pSub->pOrderBy ){
|
143365
|
0 |
13 |
if( isAgg && pSub->pOrderBy ) return 0; /* Restriction (16) */
|
|
0 |
0 |
if( isAgg && pSub->pOrderBy ) return 0; /* Restriction (16) */
|
143366
|
0 |
13 |
if( pSub->pLimit && p->pWhere ) return 0; /* Restriction (19) */
|
|
0 |
0 |
if( pSub->pLimit && p->pWhere ) return 0; /* Restriction (19) */
|
143367
|
0 |
13 |
if( pSub->pLimit && (p->selFlags & SF_Distinct)!=0 ){
|
|
0 |
0 |
if( pSub->pLimit && (p->selFlags & SF_Distinct)!=0 ){
|
143370
|
0 |
13 |
if( pSub->selFlags & (SF_Recursive) ){
|
143389
|
0 |
13 |
if( (pSubitem->fg.jointype & (JT_OUTER|JT_LTORJ))!=0 ){
|
143390
|
0 |
0 |
if( pSubSrc->nSrc>1 /* (3a) */
|
143391
|
0 |
0 |
|| IsVirtual(pSubSrc->a[0].pTab) /* (3b) */
|
143392
|
0 |
0 |
|| (p->selFlags & SF_Distinct)!=0 /* (3d) */
|
143393
|
0 |
0 |
|| (pSubitem->fg.jointype & JT_RIGHT)!=0 /* (26) */
|
143401
|
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 ){
|
143404
|
0 |
13 |
if( pSubitem->fg.isCte && pSubitem->u2.pCteUse->eM10d==M10d_Yes ){
|
|
0 |
0 |
if( pSubitem->fg.isCte && pSubitem->u2.pCteUse->eM10d==M10d_Yes ){
|
143413
|
0 |
13 |
if( pSub->pPrior ){
|
143415
|
0 |
0 |
if( pSub->pOrderBy ){
|
143418
|
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 ){
|
143421
|
0 |
0 |
for(pSub1=pSub; pSub1; pSub1=pSub1->pPrior){
|
143427
|
0 |
0 |
if( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))!=0 /* (17b) */
|
143428
|
0 |
0 |
|| (pSub1->pPrior && pSub1->op!=TK_ALL) /* (17a) */
|
|
0 |
0 |
|| (pSub1->pPrior && pSub1->op!=TK_ALL) /* (17a) */
|
143429
|
0 |
0 |
|| pSub1->pSrc->nSrc<1 /* (17c) */
|
143431
|
0 |
0 |
|| pSub1->pWin /* (17e) */
|
143436
|
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 ){
|
143446
|
0 |
0 |
if( p->pOrderBy ){
|
143447
|
0 |
0 |
for(ii=0; ii<p->pOrderBy->nExpr; ii++){
|
143448
|
0 |
0 |
if( p->pOrderBy->a[ii].u.x.iOrderByCol==0 ) return 0;
|
143453
|
0 |
0 |
if( (p->selFlags & SF_Recursive) ) return 0;
|
143456
|
0 |
0 |
if( compoundHasDifferentAffinities(pSub) ) return 0;
|
143458
|
0 |
0 |
if( pSrc->nSrc>1 ){
|
143459
|
0 |
0 |
if( pParse->nSelect>500 ) return 0;
|
143460
|
0 |
0 |
if( OptimizationDisabled(db, SQLITE_FlttnUnionAll) ) return 0;
|
143462
|
0 |
0 |
if( aCsrMap ) aCsrMap[0] = pParse->nTab;
|
143520
|
0 |
13 |
for(pSub=pSub->pPrior; pSub; pSub=pSub->pPrior){
|
143535
|
0 |
0 |
if( pNew==0 ){
|
143539
|
0 |
0 |
if( aCsrMap && ALWAYS(db->mallocFailed==0) ){
|
|
0 |
0 |
if( aCsrMap && ALWAYS(db->mallocFailed==0) ){
|
143543
|
0 |
0 |
if( pPrior ) pPrior->pNext = pNew;
|
143552
|
0 |
13 |
if( db->mallocFailed ){
|
143564
|
13 |
0 |
if( ALWAYS(pSubitem->pTab!=0) ){
|
143566
|
13 |
0 |
if( pTabToDel->nTabRef==1 ){
|
143567
|
0 |
13 |
Parse *pToplevel = sqlite3ParseToplevel(pParse);
|
143592
|
13 |
13 |
for(pParent=p; pParent; pParent=pParent->pPrior, pSub=pSub->pPrior){
|
143601
|
13 |
0 |
if( pParent==p ){
|
143620
|
0 |
13 |
if( nSubSrc>1 ){
|
143622
|
0 |
0 |
if( pSrc==0 ) break;
|
143629
|
13 |
13 |
for(i=0; i<nSubSrc; i++){
|
143631
|
0 |
13 |
if( pItem->fg.isUsing ) sqlite3IdListDelete(db, pItem->u3.pUsing);
|
143653
|
0 |
13 |
if( pSub->pOrderBy && (pParent->selFlags & SF_NoopOrderBy)==0 ){
|
|
0 |
0 |
if( pSub->pOrderBy && (pParent->selFlags & SF_NoopOrderBy)==0 ){
|
143665
|
0 |
0 |
for(i=0; i<pOrderBy->nExpr; i++){
|
143674
|
0 |
13 |
if( isOuterJoin>0 ){
|
143677
|
0 |
13 |
if( pWhere ){
|
143678
|
0 |
0 |
if( pParent->pWhere ){
|
143684
|
13 |
0 |
if( db->mallocFailed==0 ){
|
143706
|
0 |
13 |
if( pSub->pLimit ){
|
143713
|
13 |
13 |
for(i=0; i<nSubSrc; i++){
|
143770
|
0 |
311 |
if( ExprHasProperty(pColumn, EP_FixedCol) ) return;
|
143771
|
0 |
311 |
if( sqlite3ExprAffinity(pValue)!=0 ) return;
|
143772
|
0 |
311 |
if( !sqlite3IsBinary(sqlite3ExprCompareCollSeq(pConst->pParse,pExpr)) ){
|
143778
|
36 |
311 |
for(i=0; i<pConst->nConst; i++){
|
143781
|
36 |
0 |
if( pE2->iTable==pColumn->iTable
|
143782
|
0 |
36 |
&& pE2->iColumn==pColumn->iColumn
|
143787
|
3 |
308 |
if( sqlite3ExprAffinity(pColumn)==SQLITE_AFF_BLOB ){
|
143794
|
0 |
311 |
if( pConst->apExpr==0 ){
|
143810
|
0 |
981 |
if( NEVER(pExpr==0) ) return;
|
143811
|
3 |
978 |
if( ExprHasProperty(pExpr, pConst->mExcludeOn) ){
|
143816
|
331 |
647 |
if( pExpr->op==TK_AND ){
|
143821
|
333 |
314 |
if( pExpr->op!=TK_EQ ) return;
|
143826
|
2 |
312 |
if( pRight->op==TK_COLUMN && sqlite3ExprIsConstant(pLeft) ){
|
|
0 |
2 |
if( pRight->op==TK_COLUMN && sqlite3ExprIsConstant(pLeft) ){
|
143829
|
314 |
0 |
if( pLeft->op==TK_COLUMN && sqlite3ExprIsConstant(pRight) ){
|
|
311 |
3 |
if( pLeft->op==TK_COLUMN && sqlite3ExprIsConstant(pRight) ){
|
143849
|
0 |
1932 |
if( pConst->pOomFault[0] ) return WRC_Prune;
|
143850
|
1376 |
556 |
if( pExpr->op!=TK_COLUMN ) return WRC_Continue;
|
143851
|
2 |
554 |
if( ExprHasProperty(pExpr, EP_FixedCol|pConst->mExcludeOn) ){
|
143857
|
626 |
554 |
for(i=0; i<pConst->nConst; i++){
|
143859
|
314 |
312 |
if( pColumn==pExpr ) continue;
|
143860
|
2 |
310 |
if( pColumn->iTable!=pExpr->iTable ) continue;
|
143861
|
310 |
0 |
if( pColumn->iColumn!=pExpr->iColumn ) continue;
|
143862
|
0 |
0 |
if( bIgnoreAffBlob && sqlite3ExprAffinity(pColumn)==SQLITE_AFF_BLOB ){
|
|
0 |
0 |
if( bIgnoreAffBlob && sqlite3ExprAffinity(pColumn)==SQLITE_AFF_BLOB ){
|
143871
|
0 |
0 |
if( pConst->pParse->db->mallocFailed ) return WRC_Prune;
|
143899
|
21 |
1905 |
if( pConst->bHasAffBlob ){
|
143900
|
18 |
3 |
if( (pExpr->op>=TK_EQ && pExpr->op<=TK_GE)
|
|
15 |
3 |
if( (pExpr->op>=TK_EQ && pExpr->op<=TK_GE)
|
143901
|
0 |
18 |
|| pExpr->op==TK_IS
|
143904
|
0 |
3 |
if( pConst->pOomFault[0] ) return WRC_Prune;
|
143905
|
3 |
0 |
if( sqlite3ExprAffinity(pExpr->pLeft)!=SQLITE_AFF_TEXT ){
|
143978
|
319 |
0 |
if( ALWAYS(p->pSrc!=0)
|
143979
|
313 |
6 |
&& p->pSrc->nSrc>0
|
143980
|
0 |
313 |
&& (p->pSrc->a[0].fg.jointype & JT_LTORJ)!=0
|
143990
|
275 |
44 |
if( x.nConst ){
|
144002
|
0 |
319 |
}while( x.nChng );
|
144138
|
3 |
22 |
if( pWhere==0 ) return 0;
|
144139
|
0 |
22 |
if( pSubq->selFlags & (SF_Recursive|SF_MultiPart) ){
|
144142
|
0 |
22 |
if( pSrc->fg.jointype & (JT_LTORJ|JT_RIGHT) ){
|
144146
|
22 |
0 |
if( pSubq->pPrior ){
|
144149
|
101 |
22 |
for(pSel=pSubq; pSel; pSel=pSel->pPrior){
|
144153
|
22 |
79 |
if( op!=TK_ALL && op!=TK_SELECT ){
|
|
0 |
22 |
if( op!=TK_ALL && op!=TK_SELECT ){
|
144157
|
0 |
101 |
if( pSel->pWin ) return 0; /* restriction (6b) */
|
144160
|
0 |
22 |
if( notUnionAll ){
|
144164
|
0 |
0 |
for(pSel=pSubq; pSel; pSel=pSel->pPrior){
|
144168
|
0 |
0 |
for(ii=0; ii<pList->nExpr; ii++){
|
144170
|
0 |
0 |
if( !sqlite3IsBinary(pColl) ){
|
144178
|
0 |
0 |
if( pSubq->pWin && pSubq->pWin->pPartition==0 ) return 0;
|
|
0 |
0 |
if( pSubq->pWin && pSubq->pWin->pPartition==0 ) return 0;
|
144195
|
0 |
22 |
if( pSubq->pLimit!=0 ){
|
144198
|
3 |
22 |
while( pWhere->op==TK_AND ){
|
144234
|
22 |
0 |
if( sqlite3ExprIsSingleTableConstraint(pWhere, pSrcList, iSrc) ){
|
144237
|
101 |
22 |
while( pSubq ){
|
144249
|
0 |
101 |
if( pSubq->pWin && 0==pushDownWindowCheck(pParse, pSubq, pNew) ){
|
|
0 |
0 |
if( pSubq->pWin && 0==pushDownWindowCheck(pParse, pSubq, pNew) ){
|
144256
|
0 |
101 |
if( pSubq->selFlags & SF_Aggregate ){
|
144285
|
22 |
0 |
if( pItem->fg.isCorrelated || pItem->fg.isCte ){
|
|
0 |
22 |
if( pItem->fg.isCorrelated || pItem->fg.isCte ){
|
144293
|
0 |
22 |
if( (pSub->selFlags & (SF_Distinct|SF_Aggregate))!=0 ){
|
144298
|
93 |
20 |
for(pX=pSub; pX; pX=pX->pPrior){
|
144299
|
73 |
20 |
if( pX->pPrior && pX->op!=TK_ALL ){
|
|
2 |
71 |
if( pX->pPrior && pX->op!=TK_ALL ){
|
144305
|
0 |
91 |
if( pX->pWin ){
|
144313
|
0 |
20 |
if( pSub->pOrderBy ){
|
144315
|
0 |
0 |
for(j=0; j<pList->nExpr; j++){
|
144317
|
0 |
0 |
if( iCol>0 ){
|
144319
|
0 |
0 |
colUsed |= ((Bitmask)1)<<(iCol>=BMS ? BMS-1 : iCol);
|
144324
|
66 |
20 |
for(j=0; j<nCol; j++){
|
144325
|
66 |
0 |
Bitmask m = j<BMS-1 ? MASKBIT(j) : TOPBIT;
|
144326
|
66 |
0 |
if( (m & colUsed)!=0 ) continue;
|
144327
|
0 |
0 |
for(pX=pSub; pX; pX=pX->pPrior) {
|
144329
|
0 |
0 |
if( pY->op==TK_NULL ) continue;
|
144368
|
54 |
73 |
if( pEList==0
|
144369
|
54 |
0 |
|| pEList->nExpr!=1
|
144370
|
54 |
0 |
|| ExprHasProperty(pFunc, EP_WinFunc)
|
144371
|
0 |
54 |
|| OptimizationDisabled(db, SQLITE_MinMaxOpt)
|
144377
|
0 |
54 |
if( sqlite3StrICmp(zFunc, "min")==0 ){
|
144379
|
0 |
0 |
if( sqlite3ExprCanBeNull(pEList->a[0].pExpr) ){
|
144382
|
16 |
38 |
}else if( sqlite3StrICmp(zFunc, "max")==0 ){
|
144390
|
16 |
0 |
if( pOrderBy ) pOrderBy->a[0].fg.sortFlags = sortFlags;
|
144417
|
99 |
28 |
if( p->pWhere
|
144418
|
99 |
0 |
|| p->pEList->nExpr!=1
|
144419
|
99 |
0 |
|| p->pSrc->nSrc!=1
|
144420
|
99 |
0 |
|| p->pSrc->a[0].pSelect
|
144421
|
99 |
0 |
|| pAggInfo->nFunc!=1
|
144422
|
0 |
99 |
|| p->pHaving
|
144429
|
0 |
99 |
if( !IsOrdinaryTable(pTab) ) return 0;
|
144432
|
0 |
99 |
if( pExpr->op!=TK_AGG_FUNCTION ) return 0;
|
144433
|
0 |
99 |
if( pExpr->pAggInfo!=pAggInfo ) return 0;
|
144434
|
90 |
9 |
if( (pAggInfo->aFunc[0].pFunc->funcFlags&SQLITE_FUNC_COUNT)==0 ) return 0;
|
144438
|
0 |
9 |
if( ExprHasProperty(pExpr, EP_Distinct|EP_WinFunc) ) return 0;
|
144457
|
0 |
0 |
for(pIdx=pTab->pIndex;
|
144458
|
0 |
0 |
pIdx && sqlite3StrICmp(pIdx->zName, zIndexedBy);
|
144461
|
0 |
0 |
if( !pIdx ){
|
144502
|
4 |
4 |
if( p->pPrior==0 ) return WRC_Continue;
|
144503
|
4 |
0 |
if( p->pOrderBy==0 ) return WRC_Continue;
|
144504
|
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){}
|
144505
|
0 |
0 |
if( pX==0 ) return WRC_Continue;
|
144513
|
0 |
0 |
if( a[0].u.x.iOrderByCol ) return WRC_Continue;
|
144515
|
0 |
0 |
for(i=p->pOrderBy->nExpr-1; i>=0; i--){
|
144516
|
0 |
0 |
if( a[i].pExpr->flags & EP_Collate ) break;
|
144518
|
0 |
0 |
if( i<0 ) return WRC_Continue;
|
144525
|
0 |
0 |
if( pNew==0 ) return WRC_Abort;
|
144528
|
0 |
0 |
if( pNewSrc==0 ) return WRC_Abort;
|
144558
|
0 |
1257 |
if( pFrom->fg.isTabFunc ){
|
144585
|
0 |
0 |
for(p=pWith; p; p=p->pOuter){
|
144587
|
0 |
0 |
for(i=0; i<p->nCte; i++){
|
144588
|
0 |
0 |
if( sqlite3StrICmp(zName, p->a[i].zName)==0 ){
|
144593
|
0 |
0 |
if( p->bView ) break;
|
144616
|
0 |
1958 |
if( pWith ){
|
144617
|
0 |
0 |
if( bFree ){
|
144621
|
0 |
0 |
if( pWith==0 ) return 0;
|
144623
|
0 |
0 |
if( pParse->nErr==0 ){
|
144655
|
1404 |
0 |
if( pParse->pWith==0 ){
|
144659
|
0 |
0 |
if( pParse->nErr ){
|
144664
|
0 |
0 |
if( pFrom->zDatabase!=0 ){
|
144669
|
0 |
0 |
if( pFrom->fg.notCte ){
|
144678
|
0 |
0 |
if( pCte ){
|
144694
|
0 |
0 |
if( pCte->zCteErr ){
|
144698
|
0 |
0 |
if( cannotBeFunction(pParse, pFrom) ) return 2;
|
144702
|
0 |
0 |
if( pTab==0 ) return 2;
|
144704
|
0 |
0 |
if( pCteUse==0 ){
|
144706
|
0 |
0 |
if( pCteUse==0
|
144707
|
0 |
0 |
|| sqlite3ParserAddCleanup(pParse,sqlite3DbFree,pCteUse)==0
|
144721
|
0 |
0 |
if( db->mallocFailed ) return 2;
|
144724
|
0 |
0 |
if( pFrom->fg.isIndexedBy ){
|
144734
|
0 |
0 |
bMayRecursive = ( pSel->op==TK_ALL || pSel->op==TK_UNION );
|
|
0 |
0 |
bMayRecursive = ( pSel->op==TK_ALL || pSel->op==TK_UNION );
|
144735
|
0 |
0 |
while( bMayRecursive && pRecTerm->op==pSel->op ){
|
|
0 |
0 |
while( bMayRecursive && pRecTerm->op==pSel->op ){
|
144739
|
0 |
0 |
for(i=0; i<pSrc->nSrc; i++){
|
144741
|
0 |
0 |
if( pItem->zDatabase==0
|
144742
|
0 |
0 |
&& pItem->zName!=0
|
144743
|
0 |
0 |
&& 0==sqlite3StrICmp(pItem->zName, pCte->zName)
|
144748
|
0 |
0 |
if( pRecTerm->selFlags & SF_Recursive ){
|
144755
|
0 |
0 |
if( iRecTab<0 ) iRecTab = pParse->nTab++;
|
144759
|
0 |
0 |
if( (pRecTerm->selFlags & SF_Recursive)==0 ) break;
|
144766
|
0 |
0 |
if( pSel->selFlags & SF_Recursive ){
|
144776
|
0 |
0 |
if( rc ){
|
144781
|
0 |
0 |
if( sqlite3WalkSelect(pWalker, pSel) ){
|
144788
|
0 |
0 |
for(pLeft=pSel; pLeft->pPrior; pLeft=pLeft->pPrior);
|
144790
|
0 |
0 |
if( pCte->pCols ){
|
144791
|
0 |
0 |
if( pEList && pEList->nExpr!=pCte->pCols->nExpr ){
|
|
0 |
0 |
if( pEList && pEList->nExpr!=pCte->pCols->nExpr ){
|
144802
|
0 |
0 |
if( bMayRecursive ){
|
144803
|
0 |
0 |
if( pSel->selFlags & SF_Recursive ){
|
144829
|
0 |
1958 |
if( OK_IF_ALWAYS_TRUE(pParse->pWith) && p->pPrior==0 ){
|
|
0 |
0 |
if( OK_IF_ALWAYS_TRUE(pParse->pWith) && p->pPrior==0 ){
|
144831
|
0 |
0 |
if( pWith!=0 ){
|
144852
|
0 |
35 |
if( pTab==0 ) return SQLITE_NOMEM;
|
144854
|
2 |
33 |
if( pFrom->zAlias ){
|
144859
|
75 |
35 |
while( pSel->pPrior ){ pSel = pSel->pPrior; }
|
144887
|
0 |
0 |
while( N>0 ){
|
144890
|
0 |
0 |
if( pBase->fg.isUsing==0 ) continue;
|
144891
|
0 |
0 |
if( NEVER(pBase->u3.pUsing==0) ) continue;
|
144892
|
0 |
0 |
if( sqlite3IdListIndex(pBase->u3.pUsing, zName)>=0 ) return 1;
|
144934
|
0 |
1993 |
if( db->mallocFailed ){
|
144938
|
35 |
1958 |
if( (selFlags & SF_Expanded)!=0 ){
|
144941
|
0 |
1958 |
if( pWalker->eCode ){
|
144947
|
0 |
1958 |
if( pParse->pWith && (p->selFlags & SF_View) ){
|
|
0 |
0 |
if( pParse->pWith && (p->selFlags & SF_View) ){
|
144948
|
0 |
0 |
if( p->pWith==0 ){
|
144950
|
0 |
0 |
if( p->pWith==0 ){
|
144967
|
1439 |
1958 |
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
|
144970
|
0 |
1439 |
if( pFrom->pTab ) continue;
|
144972
|
35 |
1404 |
if( pFrom->zName==0 ){
|
144978
|
0 |
35 |
if( sqlite3WalkSelect(pWalker, pSel) ) return WRC_Abort;
|
144979
|
0 |
35 |
if( sqlite3ExpandSubquery(pParse, pFrom) ) return WRC_Abort;
|
144982
|
0 |
1404 |
}else if( (rc = resolveFromTermToCte(pParse, pWalker, pFrom))!=0 ){
|
144983
|
0 |
0 |
if( rc>1 ) return WRC_Abort;
|
144991
|
0 |
1404 |
if( pTab==0 ) return WRC_Abort;
|
144992
|
0 |
1404 |
if( pTab->nTabRef>=0xffff ){
|
144999
|
1257 |
147 |
if( !IsVirtual(pTab) && cannotBeFunction(pParse, pFrom) ){
|
|
0 |
1257 |
if( !IsVirtual(pTab) && cannotBeFunction(pParse, pFrom) ){
|
145003
|
147 |
1257 |
if( !IsOrdinaryTable(pTab) ){
|
145006
|
0 |
147 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ) return WRC_Abort;
|
145008
|
0 |
147 |
if( IsView(pTab) ){
|
145009
|
0 |
0 |
if( (db->flags & SQLITE_EnableView)==0
|
145010
|
0 |
0 |
&& pTab->pSchema!=db->aDb[1].pSchema
|
145018
|
147 |
0 |
else if( ALWAYS(IsVirtual(pTab))
|
145019
|
0 |
147 |
&& pFrom->fg.fromDDL
|
145020
|
0 |
0 |
&& ALWAYS(pTab->u.vtab.p!=0)
|
145021
|
0 |
0 |
&& pTab->u.vtab.p->eVtabRisk > ((db->flags & SQLITE_TrustedSchema)!=0)
|
145039
|
0 |
1439 |
if( pFrom->fg.isIndexedBy && sqlite3IndexedByLookup(pParse, pFrom) ){
|
|
0 |
0 |
if( pFrom->fg.isIndexedBy && sqlite3IndexedByLookup(pParse, pFrom) ){
|
145047
|
1958 |
0 |
if( pParse->nErr || sqlite3ProcessJoin(pParse, p) ){
|
|
0 |
1958 |
if( pParse->nErr || sqlite3ProcessJoin(pParse, p) ){
|
145062
|
2560 |
1365 |
for(k=0; k<pEList->nExpr; k++){
|
145064
|
590 |
1970 |
if( pE->op==TK_ASTERISK ) break;
|
145067
|
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;
|
145070
|
593 |
1365 |
if( k<pEList->nExpr ){
|
145080
|
1 |
592 |
&& (flags & SQLITE_ShortColNames)==0;
|
|
1 |
0 |
&& (flags & SQLITE_ShortColNames)==0;
|
145082
|
600 |
593 |
for(k=0; k<pEList->nExpr; k++){
|
145087
|
10 |
590 |
if( pE->op!=TK_ASTERISK
|
145088
|
6 |
4 |
&& (pE->op!=TK_DOT || pRight->op!=TK_ASTERISK)
|
|
3 |
3 |
&& (pE->op!=TK_DOT || pRight->op!=TK_ASTERISK)
|
145093
|
7 |
0 |
if( pNew ){
|
145104
|
3 |
590 |
if( pE->op==TK_DOT ){
|
145109
|
593 |
593 |
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
|
145117
|
593 |
0 |
if( (zTabName = pFrom->zAlias)==0 ){
|
145120
|
0 |
593 |
if( db->mallocFailed ) break;
|
145122
|
0 |
593 |
if( pFrom->fg.isNestedFrom ){
|
145128
|
3 |
590 |
if( zTName && sqlite3StrICmp(zTName, zTabName)!=0 ){
|
|
0 |
3 |
if( zTName && sqlite3StrICmp(zTName, zTabName)!=0 ){
|
145133
|
580 |
13 |
zSchemaName = iDb>=0 ? db->aDb[iDb].zDbSName : "*";
|
145135
|
0 |
593 |
if( i+1<pTabList->nSrc
|
145136
|
0 |
0 |
&& pFrom[1].fg.isUsing
|
145137
|
0 |
0 |
&& (selFlags & SF_NestedFrom)!=0
|
145141
|
0 |
0 |
for(ii=0; ii<pUsing->nId; ii++){
|
145145
|
0 |
0 |
if( pNew ){
|
145156
|
2774 |
593 |
for(j=0; j<pTab->nCol; j++){
|
145161
|
9 |
2765 |
if( zTName
|
145162
|
0 |
9 |
&& pNestedFrom
|
145163
|
0 |
0 |
&& sqlite3MatchEName(&pNestedFrom->a[j], 0, zTName, 0)==0
|
145172
|
2774 |
0 |
if( (p->selFlags & SF_IncludeHidden)==0
|
145173
|
6 |
2768 |
&& IsHiddenColumn(&pTab->aCol[j])
|
145177
|
0 |
2768 |
if( (pTab->aCol[j].colFlags & COLFLAG_NOEXPAND)!=0
|
145178
|
0 |
0 |
&& zTName==0
|
145179
|
0 |
0 |
&& (selFlags & (SF_NestedFrom))==0
|
145185
|
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 ){
|
145186
|
0 |
0 |
if( pFrom->fg.isUsing
|
145187
|
0 |
0 |
&& sqlite3IdListIndex(pFrom->u3.pUsing, zName)>=0
|
145195
|
0 |
2768 |
if( (pTabList->nSrc>1
|
145196
|
0 |
0 |
&& ( (pFrom->fg.jointype & JT_LTORJ)==0
|
145197
|
0 |
0 |
|| (selFlags & SF_NestedFrom)!=0
|
145198
|
0 |
0 |
|| !inAnyUsingClause(zName,pFrom,pTabList->nSrc-i-1)
|
145201
|
0 |
2768 |
|| IN_RENAME_OBJECT
|
145206
|
0 |
0 |
if( IN_RENAME_OBJECT && pE->pLeft ){
|
|
0 |
0 |
if( IN_RENAME_OBJECT && pE->pLeft ){
|
145209
|
0 |
0 |
if( zSchemaName ){
|
145217
|
0 |
2768 |
if( pNew==0 ){
|
145222
|
0 |
2768 |
if( (selFlags & SF_NestedFrom)!=0 && !IN_RENAME_OBJECT ){
|
|
0 |
0 |
if( (selFlags & SF_NestedFrom)!=0 && !IN_RENAME_OBJECT ){
|
145223
|
0 |
0 |
if( pNestedFrom ){
|
145232
|
0 |
0 |
if( (pFrom->fg.isUsing
|
145233
|
0 |
0 |
&& sqlite3IdListIndex(pFrom->u3.pUsing, zName)>=0)
|
145234
|
0 |
0 |
|| (pUsing && sqlite3IdListIndex(pUsing, zName)>=0)
|
|
0 |
0 |
|| (pUsing && sqlite3IdListIndex(pUsing, zName)>=0)
|
145235
|
0 |
0 |
|| (pTab->aCol[j].colFlags & COLFLAG_NOEXPAND)!=0
|
145239
|
3 |
2765 |
}else if( longNames ){
|
145248
|
0 |
593 |
if( !tableSeen ){
|
145249
|
0 |
0 |
if( zTName ){
|
145260
|
1958 |
0 |
if( p->pEList ){
|
145261
|
0 |
1958 |
if( p->pEList->nExpr>db->aLimit[SQLITE_LIMIT_COLUMN] ){
|
145265
|
673 |
1285 |
if( (elistFlags & (EP_HasFunc|EP_Subquery))!=0 ){
|
145305
|
2 |
1815 |
if( OK_IF_ALWAYS_TRUE(pParse->hasCompound) ){
|
145338
|
0 |
1952 |
if( p->selFlags & SF_HasTypeInfo ) return;
|
145342
|
1439 |
1952 |
for(i=0, pFrom=pTabList->a; i<pTabList->nSrc; i++, pFrom++){
|
145345
|
35 |
1404 |
if( (pTab->tabFlags & TF_Ephemeral)!=0 ){
|
145348
|
35 |
0 |
if( pSel ){
|
145395
|
0 |
2010 |
if( pParse->db->mallocFailed ) return;
|
145396
|
193 |
1817 |
if( p->selFlags & SF_HasTypeInfo ) return;
|
145398
|
0 |
1817 |
if( pParse->nErr ) return;
|
145400
|
6 |
1811 |
if( pParse->nErr ) return;
|
145454
|
147 |
147 |
for(i=0; i<pAggInfo->nFunc; i++){
|
145460
|
0 |
147 |
if( ExprHasProperty(pExpr, EP_WinFunc) ){
|
145485
|
0 |
0 |
if( ALWAYS(pAggInfo->nSortingColumn>0) ){
|
145488
|
0 |
0 |
for(j=0; j<pAggInfo->nColumn; j++){
|
145490
|
0 |
0 |
if( k>mx ) mx = k;
|
145521
|
0 |
0 |
if( pExpr->pAggInfo==0 ) return WRC_Continue;
|
145522
|
0 |
0 |
if( pExpr->op==TK_AGG_COLUMN ) return WRC_Continue;
|
145523
|
0 |
0 |
if( pExpr->op==TK_AGG_FUNCTION ) return WRC_Continue;
|
145524
|
0 |
0 |
if( pExpr->op==TK_IF_NULL_ROW ) return WRC_Continue;
|
145526
|
0 |
0 |
if( NEVER(pExpr->iAgg>=pAggInfo->nColumn) ) return WRC_Continue;
|
145546
|
0 |
0 |
for(i=0; i<pAggInfo->nFunc; i++){
|
145592
|
0 |
138 |
if( nReg==0 ) return;
|
145593
|
0 |
138 |
if( pParse->nErr ) return;
|
145596
|
138 |
138 |
for(pFunc=pAggInfo->aFunc, i=0; i<pAggInfo->nFunc; i++, pFunc++){
|
145597
|
0 |
138 |
if( pFunc->iDistinct>=0 ){
|
145600
|
0 |
0 |
if( pE->x.pList==0 || pE->x.pList->nExpr!=1 ){
|
|
0 |
0 |
if( pE->x.pList==0 || pE->x.pList->nExpr!=1 ){
|
145623
|
138 |
138 |
for(i=0, pF=pAggInfo->aFunc; i<pAggInfo->nFunc; i++, pF++){
|
145627
|
62 |
76 |
sqlite3VdbeAddOp2(v, OP_AggFinal, AggInfoFuncReg(pAggInfo,i),
|
145657
|
0 |
138 |
if( pParse->nErr ) return;
|
145659
|
138 |
138 |
for(i=0, pF=pAggInfo->aFunc; i<pAggInfo->nFunc; i++, pF++){
|
145667
|
0 |
138 |
if( ExprHasProperty(pF->pFExpr, EP_WinFunc) ){
|
145669
|
0 |
0 |
if( pAggInfo->nAccumulator
|
145670
|
0 |
0 |
&& (pF->pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL)
|
145671
|
0 |
0 |
&& regAcc
|
145676
|
0 |
0 |
if( regHit==0 ) regHit = ++pParse->nMem;
|
145689
|
62 |
76 |
if( pList ){
|
145697
|
0 |
138 |
if( pF->iDistinct>=0 && pList ){
|
|
0 |
0 |
if( pF->iDistinct>=0 && pList ){
|
145698
|
0 |
0 |
if( addrNext==0 ){
|
145704
|
16 |
122 |
if( pF->pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL ){
|
145709
|
24 |
8 |
for(j=0, pItem=pList->a; !pColl && j<nArg; j++, pItem++){
|
|
16 |
8 |
for(j=0, pItem=pList->a; !pColl && j<nArg; j++, pItem++){
|
145712
|
8 |
8 |
if( !pColl ){
|
145715
|
16 |
0 |
if( regHit==0 && pAggInfo->nAccumulator ) regHit = ++pParse->nMem;
|
|
0 |
16 |
if( regHit==0 && pAggInfo->nAccumulator ) regHit = ++pParse->nMem;
|
145722
|
0 |
138 |
if( addrNext ){
|
145726
|
138 |
0 |
if( regHit==0 && pAggInfo->nAccumulator ){
|
|
14 |
124 |
if( regHit==0 && pAggInfo->nAccumulator ){
|
145729
|
14 |
124 |
if( regHit ){
|
145732
|
15 |
138 |
for(i=0, pC=pAggInfo->aCol; i<pAggInfo->nAccumulator; i++, pC++){
|
145737
|
14 |
124 |
if( addrHitTest ){
|
145752
|
0 |
9 |
if( pParse->explain==2 ){
|
145753
|
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)));
|
145754
|
0 |
0 |
sqlite3VdbeExplain(pParse, 0, "SCAN %s%s%s",
|
|
0 |
0 |
sqlite3VdbeExplain(pParse, 0, "SCAN %s%s%s",
|
145777
|
6 |
0 |
if( pExpr->op!=TK_AND ){
|
145786
|
0 |
6 |
if( sqlite3ExprIsConstantOrGroupBy(pWalker->pParse, pExpr, pS->pGroupBy)
|
145787
|
0 |
0 |
&& ExprAlwaysFalse(pExpr)==0
|
145788
|
0 |
0 |
&& pExpr->pAggInfo==0
|
145792
|
0 |
0 |
if( pNew ){
|
145850
|
19 |
3 |
if( pThis->pSelect->selFlags & SF_PushDown ) return 0;
|
145851
|
0 |
3 |
while( iFirst<iEnd ){
|
145854
|
0 |
0 |
if( pItem->pSelect==0 ) continue;
|
145855
|
0 |
0 |
if( pItem->fg.viaCoroutine ) continue;
|
145856
|
0 |
0 |
if( pItem->zName==0 ) continue;
|
145859
|
0 |
0 |
if( pItem->pTab->pSchema!=pThis->pTab->pSchema ) continue;
|
145860
|
0 |
0 |
if( sqlite3_stricmp(pItem->zName, pThis->zName)!=0 ) continue;
|
145862
|
0 |
0 |
if( pItem->pTab->pSchema==0 && pThis->pSelect->selId!=pS1->selId ){
|
|
0 |
0 |
if( pItem->pTab->pSchema==0 && pThis->pSelect->selId!=pS1->selId ){
|
145867
|
0 |
0 |
if( pItem->pSelect->selFlags & SF_PushDown ){
|
145910
|
1778 |
147 |
if( (p->selFlags & SF_Aggregate)==0 ) return 0; /* This is an aggregate */
|
145911
|
8 |
139 |
if( p->pEList->nExpr!=1 ) return 0; /* Single result column */
|
145912
|
28 |
111 |
if( p->pWhere ) return 0;
|
145913
|
6 |
105 |
if( p->pHaving ) return 0;
|
145914
|
6 |
99 |
if( p->pGroupBy ) return 0;
|
145915
|
0 |
99 |
if( p->pOrderBy ) return 0;
|
145917
|
0 |
99 |
if( pExpr->op!=TK_AGG_FUNCTION ) return 0; /* Result is an aggregate */
|
145919
|
86 |
13 |
if( sqlite3_stricmp(pExpr->u.zToken,"count") ) return 0; /* Is count() */
|
145921
|
4 |
9 |
if( pExpr->x.pList!=0 ) return 0; /* Must be count(*) */
|
145922
|
0 |
9 |
if( p->pSrc->nSrc!=1 ) return 0; /* One table in FROM */
|
145923
|
0 |
9 |
if( ExprHasProperty(pExpr, EP_WinFunc) ) return 0;/* Not a window function */
|
145925
|
9 |
0 |
if( pSub==0 ) return 0; /* The FROM is a subquery */
|
145926
|
0 |
0 |
if( pSub->pPrior==0 ) return 0; /* Must be a compound */
|
145927
|
0 |
0 |
if( pSub->selFlags & SF_CopyCte ) return 0; /* Not a CTE */
|
145929
|
0 |
0 |
if( pSub->op!=TK_ALL && pSub->pPrior ) return 0; /* Must be UNION ALL */
|
|
0 |
0 |
if( pSub->op!=TK_ALL && pSub->pPrior ) return 0; /* Must be UNION ALL */
|
145930
|
0 |
0 |
if( pSub->pWhere ) return 0; /* No WHERE clause */
|
145931
|
0 |
0 |
if( pSub->pLimit ) return 0; /* No LIMIT clause */
|
145932
|
0 |
0 |
if( pSub->selFlags & SF_Aggregate ) return 0; /* Not an aggregate */
|
145935
|
0 |
0 |
}while( pSub );
|
145946
|
0 |
0 |
while( pSub ){
|
145955
|
0 |
0 |
pTerm = pPrior ? sqlite3ExprDup(db, pCount, 0) : pCount;
|
145959
|
0 |
0 |
if( pExpr==0 ){
|
145985
|
0 |
0 |
for(i=0; i<pSrc->nSrc; i++){
|
145987
|
0 |
0 |
if( p1==p0 ) continue;
|
145988
|
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) ){
|
145991
|
0 |
0 |
if( p1->pSelect
|
145992
|
0 |
0 |
&& (p1->pSelect->selFlags & SF_NestedFrom)!=0
|
145993
|
0 |
0 |
&& sameSrcAlias(p0, p1->pSelect->pSrc)
|
146036
|
0 |
22 |
if( pItem->fg.isCte ){
|
146038
|
0 |
0 |
if( pCteUse->eM10d==M10d_Yes ) return 0; /* (2a) */
|
146039
|
0 |
0 |
if( pCteUse->nUse>=2 && pCteUse->eM10d!=M10d_No ) return 0; /* (2b) */
|
|
0 |
0 |
if( pCteUse->nUse>=2 && pCteUse->eM10d!=M10d_No ) return 0; /* (2b) */
|
146041
|
0 |
22 |
if( pTabList->a[0].fg.jointype & JT_LTORJ ) return 0; /* (3) */
|
146042
|
0 |
22 |
if( OptimizationDisabled(pParse->db, SQLITE_Coroutines) ) return 0; /* (4) */
|
146043
|
0 |
22 |
if( isSelfJoinView(pTabList, pItem, i+1, pTabList->nSrc)!=0 ){
|
146046
|
22 |
0 |
if( i==0 ){
|
146047
|
22 |
0 |
if( pTabList->nSrc==1 ) return 1; /* (1a) */
|
146048
|
0 |
0 |
if( pTabList->a[1].fg.jointype & JT_CROSS ) return 1; /* (1b) */
|
146049
|
0 |
0 |
if( selFlags & SF_UpdateFrom ) return 0; /* (1c-iii) */
|
146052
|
0 |
0 |
if( selFlags & SF_UpdateFrom ) return 0; /* (1c-iii) */
|
146054
|
0 |
0 |
if( pItem->fg.jointype & (JT_OUTER|JT_CROSS) ) return 0; /* (1c-ii) */
|
146055
|
0 |
0 |
if( i==0 ) break;
|
146058
|
0 |
0 |
if( pItem->pSelect!=0 ) return 0; /* (1c-i) */
|
146102
|
2010 |
0 |
if( p==0 || pParse->nErr ){
|
|
0 |
2010 |
if( p==0 || pParse->nErr ){
|
146106
|
0 |
2010 |
if( sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0) ) return 1;
|
146122
|
8 |
2002 |
if( IgnorableDistinct(pDest) ){
|
146127
|
0 |
8 |
if( p->pOrderBy ){
|
146144
|
6 |
2004 |
if( pParse->nErr ){
|
146165
|
0 |
2004 |
if( p->selFlags & SF_UFSrcCheck ){
|
146167
|
0 |
0 |
if( sameSrcAlias(p0, p->pSrc) ){
|
146168
|
0 |
0 |
sqlite3ErrorMsg(pParse,
|
146182
|
1807 |
197 |
if( pDest->eDest==SRT_Output ){
|
146187
|
0 |
2004 |
if( sqlite3WindowRewrite(pParse, p) ){
|
146207
|
3364 |
79 |
for(i=0; !p->pPrior && i<pTabList->nSrc; i++){
|
|
1439 |
1925 |
for(i=0; !p->pPrior && i<pTabList->nSrc; i++){
|
146220
|
4 |
1435 |
if( (pItem->fg.jointype & (JT_LEFT|JT_RIGHT))==JT_LEFT
|
146221
|
1 |
3 |
&& sqlite3ExprImpliesNonNullRow(p->pWhere, pItem->iCursor)
|
146222
|
1 |
0 |
&& OptimizationEnabled(db, SQLITE_SimplifyJoin)
|
146233
|
1404 |
35 |
if( pSub==0 ) continue;
|
146237
|
0 |
35 |
if( pTab->nCol!=pSub->pEList->nExpr ){
|
146250
|
0 |
35 |
if( (pSub->selFlags & SF_Aggregate)!=0 ) continue;
|
146273
|
0 |
35 |
if( pSub->pOrderBy!=0
|
146274
|
0 |
0 |
&& (p->pOrderBy!=0 || pTabList->nSrc>1) /* Condition (5) */
|
|
0 |
0 |
&& (p->pOrderBy!=0 || pTabList->nSrc>1) /* Condition (5) */
|
146275
|
0 |
0 |
&& pSub->pLimit==0 /* Condition (1) */
|
146276
|
0 |
0 |
&& (pSub->selFlags & SF_OrderByReqd)==0 /* Condition (2) */
|
146277
|
0 |
0 |
&& (p->selFlags & SF_OrderByReqd)==0 /* Condition (3) and (4) */
|
146278
|
0 |
0 |
&& OptimizationEnabled(db, SQLITE_OmitOrderBy)
|
146306
|
0 |
35 |
if( pSub->pOrderBy!=0
|
146307
|
0 |
0 |
&& i==0
|
146308
|
0 |
0 |
&& (p->selFlags & SF_ComplexResult)!=0
|
146309
|
0 |
0 |
&& (pTabList->nSrc==1
|
146310
|
0 |
0 |
|| (pTabList->a[1].fg.jointype&(JT_OUTER|JT_CROSS))!=0)
|
146315
|
13 |
22 |
if( flattenSubquery(pParse, p, i, isAgg) ){
|
146316
|
0 |
13 |
if( pParse->nErr ) goto select_end;
|
146321
|
0 |
35 |
if( db->mallocFailed ) goto select_end;
|
146322
|
35 |
0 |
if( !IgnorableOrderby(pDest) ){
|
146332
|
79 |
1925 |
if( p->pPrior ){
|
146340
|
26 |
53 |
if( p->pNext==0 ) ExplainQueryPlanPop(pParse);
|
146350
|
984 |
941 |
if( p->pWhere!=0
|
146351
|
319 |
665 |
&& p->pWhere->op==TK_AND
|
146352
|
319 |
0 |
&& OptimizationEnabled(db, SQLITE_PropagateConst)
|
146365
|
1925 |
0 |
if( OptimizationEnabled(db, SQLITE_QueryFlattener|SQLITE_CountOfView)
|
146366
|
0 |
1925 |
&& countOfViewOptimization(pParse, p)
|
146368
|
0 |
0 |
if( db->mallocFailed ) goto select_end;
|
146376
|
1426 |
1925 |
for(i=0; i<pTabList->nSrc; i++){
|
146401
|
81 |
1345 |
if( pItem->colUsed==0 && pItem->zName!=0 ){
|
|
81 |
0 |
if( pItem->colUsed==0 && pItem->zName!=0 ){
|
146409
|
1404 |
22 |
if( pSub==0 ) continue;
|
146426
|
22 |
0 |
if( OptimizationEnabled(db, SQLITE_PushDown)
|
146427
|
0 |
22 |
&& (pItem->fg.isCte==0
|
146428
|
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))
|
146446
|
22 |
0 |
if( OptimizationEnabled(db, SQLITE_NullUnusedCols)
|
146464
|
22 |
0 |
if( fromClauseTermCanBeCoroutine(pParse, pTabList, i, p->selFlags) ){
|
146483
|
0 |
0 |
}else if( pItem->fg.isCte && pItem->u2.pCteUse->addrM9e>0 ){
|
|
0 |
0 |
}else if( pItem->fg.isCte && pItem->u2.pCteUse->addrM9e>0 ){
|
146490
|
0 |
0 |
if( pItem->iCursor!=pCteUse->iCur ){
|
146495
|
0 |
0 |
}else if( (pPrior = isSelfJoinView(pTabList, pItem, 0, i))!=0 ){
|
146498
|
0 |
0 |
if( pPrior->addrFillSub ){
|
146517
|
0 |
0 |
if( pItem->fg.isCorrelated==0 ){
|
146531
|
0 |
0 |
if( onceAddr ) sqlite3VdbeJumpHere(v, onceAddr);
|
146537
|
0 |
0 |
if( pItem->fg.isCte && pItem->fg.isCorrelated==0 ){
|
|
0 |
0 |
if( pItem->fg.isCte && pItem->fg.isCorrelated==0 ){
|
146545
|
0 |
22 |
if( db->mallocFailed ) goto select_end;
|
146581
|
4 |
1921 |
if( (p->selFlags & (SF_Distinct|SF_Aggregate))==SF_Distinct
|
146582
|
0 |
4 |
&& sqlite3ExprListCompare(sSort.pOrderBy, pEList, -1)==0
|
146584
|
0 |
0 |
&& p->pWin==0
|
146612
|
608 |
1317 |
if( sSort.pOrderBy ){
|
146628
|
0 |
1925 |
if( pDest->eDest==SRT_EphemTab ){
|
146630
|
0 |
0 |
if( p->selFlags & SF_NestedFrom ){
|
146633
|
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--){
|
146638
|
0 |
0 |
for(ii=0; ii<pEList->nExpr; ii++){
|
146639
|
0 |
0 |
if( pEList->a[ii].fg.bUsed==0 ) pEList->a[ii].pExpr->op = TK_NULL;
|
146647
|
1925 |
0 |
if( (p->selFlags & SF_FixedLimit)==0 ){
|
146650
|
20 |
1905 |
if( p->pLimit ) computeLimitRegisters(pParse, p, iEnd);
|
146651
|
1905 |
20 |
if( p->iLimit==0 && sSort.addrSortIndex>=0 ){
|
|
607 |
1298 |
if( p->iLimit==0 && sSort.addrSortIndex>=0 ){
|
146658
|
4 |
1921 |
if( p->selFlags & SF_Distinct ){
|
146670
|
1778 |
147 |
if( !isAgg && pGroupBy==0 ){
|
|
1778 |
0 |
if( !isAgg && pGroupBy==0 ){
|
146672
|
4 |
1774 |
u16 wctrlFlags = (sDistinct.isTnct ? WHERE_WANT_DISTINCT : 0)
|
146676
|
0 |
1778 |
if( pWin ){
|
146687
|
0 |
1778 |
if( pWInfo==0 ) goto select_end;
|
146688
|
1777 |
1 |
if( sqlite3WhereOutputRowCount(pWInfo) < p->nSelectRow ){
|
146691
|
4 |
1774 |
if( sDistinct.isTnct && sqlite3WhereIsDistinct(pWInfo) ){
|
|
0 |
4 |
if( sDistinct.isTnct && sqlite3WhereIsDistinct(pWInfo) ){
|
146694
|
606 |
1172 |
if( sSort.pOrderBy ){
|
146697
|
500 |
106 |
if( sSort.nOBSat==sSort.pOrderBy->nExpr ){
|
146707
|
606 |
1172 |
if( sSort.addrSortIndex>=0 && sSort.pOrderBy==0 ){
|
|
500 |
106 |
if( sSort.addrSortIndex>=0 && sSort.pOrderBy==0 ){
|
146713
|
0 |
1778 |
if( pWin ){
|
146762
|
20 |
127 |
if( pGroupBy ){
|
146766
|
29 |
20 |
for(k=p->pEList->nExpr, pItem=p->pEList->a; k>0; k--, pItem++){
|
146769
|
20 |
20 |
for(k=pGroupBy->nExpr, pItem=pGroupBy->a; k>0; k--, pItem++){
|
146773
|
19 |
1 |
if( p->nSelectRow>66 ) p->nSelectRow = 66;
|
146783
|
2 |
18 |
if( sSort.pOrderBy && pGroupBy->nExpr==sSort.pOrderBy->nExpr ){
|
|
2 |
0 |
if( sSort.pOrderBy && pGroupBy->nExpr==sSort.pOrderBy->nExpr ){
|
146790
|
2 |
2 |
for(ii=0; ii<pGroupBy->nExpr; ii++){
|
146795
|
1 |
1 |
if( sqlite3ExprListCompare(pGroupBy, sSort.pOrderBy, -1)==0 ){
|
146812
|
147 |
0 |
if( pAggInfo ){
|
146817
|
0 |
147 |
if( db->mallocFailed ){
|
146829
|
20 |
127 |
pAggInfo->nSortingColumn = pGroupBy ? pGroupBy->nExpr : 0;
|
146833
|
6 |
141 |
if( pHaving ){
|
146834
|
6 |
0 |
if( pGroupBy ){
|
146844
|
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 ){
|
146850
|
0 |
147 |
if( db->mallocFailed ) goto select_end;
|
146867
|
20 |
127 |
if( pGroupBy ){
|
146881
|
20 |
0 |
if( pAggInfo->nFunc==1
|
146882
|
0 |
20 |
&& pAggInfo->aFunc[0].iDistinct>=0
|
146883
|
0 |
0 |
&& ALWAYS(pAggInfo->aFunc[0].pFExpr!=0)
|
146884
|
0 |
0 |
&& ALWAYS(ExprUseXList(pAggInfo->aFunc[0].pFExpr))
|
146885
|
0 |
0 |
&& pAggInfo->aFunc[0].pFExpr->x.pList!=0
|
146891
|
0 |
0 |
distFlag = pDistinct ? (WHERE_WANT_DISTINCT|WHERE_AGG_DISTINCT) : 0;
|
146929
|
0 |
20 |
pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, pGroupBy, pDistinct,
|
|
1 |
19 |
pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, pGroupBy, pDistinct,
|
146933
|
0 |
20 |
if( pWInfo==0 ){
|
146937
|
0 |
20 |
if( pParse->pIdxEpr ){
|
146943
|
0 |
20 |
if( sqlite3WhereIsOrdered(pWInfo)==pGroupBy->nExpr ){
|
146960
|
0 |
20 |
explainTempTable(pParse,
|
146961
|
0 |
0 |
(sDistinct.isTnct && (p->selFlags&SF_Distinct)==0) ?
|
146968
|
23 |
20 |
for(i=0; i<pAggInfo->nColumn; i++){
|
146969
|
9 |
14 |
if( pAggInfo->aCol[i].iSorterColumn>=j ){
|
146978
|
23 |
20 |
for(i=0; i<pAggInfo->nColumn; i++){
|
146980
|
9 |
14 |
if( pCol->iSorterColumn>=j ){
|
147006
|
0 |
20 |
if( pParse->pIdxEpr ){
|
147025
|
1 |
19 |
if( orderByGrp && OptimizationEnabled(db, SQLITE_GroupByOrder)
|
|
1 |
0 |
if( orderByGrp && OptimizationEnabled(db, SQLITE_GroupByOrder)
|
147026
|
0 |
1 |
&& (groupBySort || sqlite3WhereIsSorted(pWInfo))
|
|
0 |
0 |
&& (groupBySort || sqlite3WhereIsSorted(pWInfo))
|
147038
|
20 |
0 |
if( groupBySort ){
|
147042
|
20 |
20 |
for(j=0; j<pGroupBy->nExpr; j++){
|
147043
|
20 |
0 |
if( groupBySort ){
|
147082
|
20 |
0 |
if( groupBySort ){
|
147134
|
0 |
20 |
if( distFlag!=0 && eDist!=WHERE_DISTINCT_NOOP ){
|
|
0 |
0 |
if( distFlag!=0 && eDist!=WHERE_DISTINCT_NOOP ){
|
147141
|
9 |
118 |
if( (pTab = isSimpleCount(p, pAggInfo))!=0 ){
|
147174
|
0 |
9 |
if( !HasRowid(pTab) ) pBest = sqlite3PrimaryKeyIndex(pTab);
|
147175
|
9 |
0 |
if( !p->pSrc->a[0].fg.notIndexed ){
|
147176
|
0 |
9 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
147177
|
0 |
0 |
if( pIdx->bUnordered==0
|
147178
|
0 |
0 |
&& pIdx->szIdxRow<pTab->szTabRow
|
147179
|
0 |
0 |
&& pIdx->pPartIdxWhere==0
|
147180
|
0 |
0 |
&& (!pBest || pIdx->szIdxRow<pBest->szIdxRow)
|
|
0 |
0 |
&& (!pBest || pIdx->szIdxRow<pBest->szIdxRow)
|
147186
|
0 |
9 |
if( pBest ){
|
147193
|
0 |
9 |
if( pKeyInfo ){
|
147215
|
0 |
118 |
if( pAggInfo->nAccumulator ){
|
147216
|
0 |
0 |
for(i=0; i<pAggInfo->nFunc; i++){
|
147217
|
0 |
0 |
if( ExprHasProperty(pAggInfo->aFunc[i].pFExpr, EP_WinFunc) ){
|
147220
|
0 |
0 |
if( pAggInfo->aFunc[i].pFunc->funcFlags&SQLITE_FUNC_NEEDCOLL ){
|
147224
|
0 |
0 |
if( i==pAggInfo->nFunc ){
|
147228
|
118 |
0 |
}else if( pAggInfo->nFunc==1 && pAggInfo->aFunc[0].iDistinct>=0 ){
|
|
0 |
118 |
}else if( pAggInfo->nFunc==1 && pAggInfo->aFunc[0].iDistinct>=0 ){
|
147231
|
0 |
0 |
distFlag = pDistinct ? (WHERE_WANT_DISTINCT|WHERE_AGG_DISTINCT) : 0;
|
147253
|
0 |
118 |
if( pWInfo==0 ){
|
147259
|
0 |
118 |
if( eDist!=WHERE_DISTINCT_NOOP ){
|
147261
|
0 |
0 |
if( pF ){
|
147266
|
0 |
118 |
if( regAcc ) sqlite3VdbeAddOp2(v, OP_Integer, 1, regAcc);
|
147267
|
16 |
102 |
if( minMaxFlag ){
|
147284
|
4 |
1921 |
if( sDistinct.eTnctType==WHERE_DISTINCT_UNORDERED ){
|
147291
|
107 |
1818 |
if( sSort.pOrderBy ){
|
147390
|
0 |
0 |
if( p->nRow==0 && argv!=0 ){
|
|
0 |
0 |
if( p->nRow==0 && argv!=0 ){
|
147395
|
0 |
0 |
if( p->nData + need > p->nAlloc ){
|
147399
|
0 |
0 |
if( azNew==0 ) goto malloc_failed;
|
147406
|
0 |
0 |
if( p->nRow==0 ){
|
147408
|
0 |
0 |
for(i=0; i<nCol; i++){
|
147410
|
0 |
0 |
if( z==0 ) goto malloc_failed;
|
147413
|
0 |
0 |
}else if( (int)p->nColumn!=nCol ){
|
147424
|
0 |
0 |
if( argv!=0 ){
|
147425
|
0 |
0 |
for(i=0; i<nCol; i++){
|
147426
|
0 |
0 |
if( argv[i]==0 ){
|
147431
|
0 |
0 |
if( z==0 ) goto malloc_failed;
|
147470
|
0 |
0 |
if( pnColumn ) *pnColumn = 0;
|
147471
|
0 |
0 |
if( pnRow ) *pnRow = 0;
|
147472
|
0 |
0 |
if( pzErrMsg ) *pzErrMsg = 0;
|
147480
|
0 |
0 |
if( res.azResult==0 ){
|
147488
|
0 |
0 |
if( (rc&0xff)==SQLITE_ABORT ){
|
147490
|
0 |
0 |
if( res.zErrMsg ){
|
147491
|
0 |
0 |
if( pzErrMsg ){
|
147501
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
147505
|
0 |
0 |
if( res.nAlloc>res.nData ){
|
147508
|
0 |
0 |
if( azNew==0 ){
|
147516
|
0 |
0 |
if( pnColumn ) *pnColumn = res.nColumn;
|
147517
|
0 |
0 |
if( pnRow ) *pnRow = res.nRow;
|
147527
|
0 |
0 |
if( azResult ){
|
147532
|
0 |
0 |
for(i=1; i<n; i++){ if( azResult[i] ) sqlite3_free(azResult[i]); }
|
|
0 |
0 |
for(i=1; i<n; i++){ if( azResult[i] ) sqlite3_free(azResult[i]); }
|
147560
|
0 |
0 |
while( pTriggerStep ){
|
147599
|
0 |
7 |
while( p ){
|
147601
|
0 |
0 |
if( pTrig->pTabSchema==pTab->pSchema
|
147602
|
0 |
0 |
&& pTrig->table
|
147603
|
0 |
0 |
&& 0==sqlite3StrICmp(pTrig->table, pTab->zName)
|
147604
|
0 |
0 |
&& (pTrig->pTabSchema!=pTmpSchema || pTrig->bReturning)
|
|
0 |
0 |
&& (pTrig->pTabSchema!=pTmpSchema || pTrig->bReturning)
|
147608
|
0 |
0 |
}else if( pTrig->op==TK_RETURNING ){
|
147667
|
0 |
0 |
if( isTemp ){
|
147669
|
0 |
0 |
if( pName2->n>0 ){
|
147678
|
0 |
0 |
if( iDb<0 ){
|
147682
|
0 |
0 |
if( !pTableName || db->mallocFailed ){
|
|
0 |
0 |
if( !pTableName || db->mallocFailed ){
|
147694
|
0 |
0 |
if( db->init.busy && iDb!=1 ){
|
|
0 |
0 |
if( db->init.busy && iDb!=1 ){
|
147705
|
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
|
147706
|
0 |
0 |
&& pTab->pSchema==db->aDb[1].pSchema ){
|
147711
|
0 |
0 |
if( db->mallocFailed ) goto trigger_cleanup;
|
147714
|
0 |
0 |
if( sqlite3FixSrcList(&sFix, pTableName) ){
|
147718
|
0 |
0 |
if( !pTab ){
|
147722
|
0 |
0 |
if( IsVirtual(pTab) ){
|
147730
|
0 |
0 |
if( zName==0 ){
|
147734
|
0 |
0 |
if( sqlite3CheckObjectName(pParse, zName, "trigger", pTab->zName) ){
|
147738
|
0 |
0 |
if( !IN_RENAME_OBJECT ){
|
147739
|
0 |
0 |
if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash),zName) ){
|
147740
|
0 |
0 |
if( !noErr ){
|
147752
|
0 |
0 |
if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0 ){
|
147760
|
0 |
0 |
if( IsView(pTab) && tr_tm!=TK_INSTEAD ){
|
|
0 |
0 |
if( IsView(pTab) && tr_tm!=TK_INSTEAD ){
|
147761
|
0 |
0 |
sqlite3ErrorMsg(pParse, "cannot create %s trigger on view: %S",
|
147765
|
0 |
0 |
if( !IsView(pTab) && tr_tm==TK_INSTEAD ){
|
|
0 |
0 |
if( !IsView(pTab) && tr_tm==TK_INSTEAD ){
|
147772
|
0 |
0 |
if( !IN_RENAME_OBJECT ){
|
147776
|
0 |
0 |
const char *zDbTrig = isTemp ? db->aDb[1].zDbSName : zDb;
|
147777
|
0 |
0 |
if( iTabDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER;
|
|
0 |
0 |
if( iTabDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER;
|
147778
|
0 |
0 |
if( sqlite3AuthCheck(pParse, code, zName, pTab->zName, zDbTrig) ){
|
147781
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iTabDb),0,zDb)){
|
|
0 |
0 |
if( sqlite3AuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(iTabDb),0,zDb)){
|
147792
|
0 |
0 |
if (tr_tm == TK_INSTEAD){
|
147798
|
0 |
0 |
if( pTrigger==0 ) goto trigger_cleanup;
|
147805
|
0 |
0 |
pTrigger->tr_tm = tr_tm==TK_BEFORE ? TRIGGER_BEFORE : TRIGGER_AFTER;
|
147806
|
0 |
0 |
if( IN_RENAME_OBJECT ){
|
147823
|
0 |
0 |
if( !pParse->pNewTrigger ){
|
147831
|
0 |
0 |
if( db->init.iDb==1 ){
|
147864
|
0 |
0 |
if( NEVER(pParse->nErr) || !pTrig ) goto triggerfinish_cleanup;
|
|
0 |
0 |
if( NEVER(pParse->nErr) || !pTrig ) goto triggerfinish_cleanup;
|
147868
|
0 |
0 |
while( pStepList ){
|
147874
|
0 |
0 |
if( sqlite3FixTriggerStep(&sFix, pTrig->step_list)
|
147875
|
0 |
0 |
|| sqlite3FixExpr(&sFix, pTrig->pWhen)
|
147881
|
0 |
0 |
if( IN_RENAME_OBJECT ){
|
147891
|
0 |
0 |
if( !db->init.busy ){
|
147898
|
0 |
0 |
if( sqlite3ReadOnlyShadowTables(db) ){
|
147900
|
0 |
0 |
for(pStep=pTrig->step_list; pStep; pStep=pStep->pNext){
|
147901
|
0 |
0 |
if( pStep->zTarget!=0
|
147902
|
0 |
0 |
&& sqlite3ShadowTableName(db, pStep->zTarget)
|
147914
|
0 |
0 |
if( v==0 ) goto triggerfinish_cleanup;
|
147929
|
0 |
0 |
if( db->init.busy ){
|
147935
|
0 |
0 |
if( pTrig ){
|
147937
|
0 |
0 |
}else if( pLink->pSchema==pLink->pTabSchema ){
|
147959
|
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] = ' ';
|
147977
|
0 |
0 |
if( pTriggerStep==0 ) {
|
148004
|
0 |
0 |
if( pParse->nErr ) return 0;
|
148006
|
0 |
0 |
if( pTriggerStep ){
|
148013
|
0 |
0 |
if( IN_RENAME_OBJECT ){
|
148043
|
0 |
0 |
if( pTriggerStep ){
|
148044
|
0 |
0 |
if( IN_RENAME_OBJECT ){
|
148053
|
0 |
0 |
if( pUpsert ){
|
148086
|
0 |
0 |
if( pTriggerStep ){
|
148087
|
0 |
0 |
if( IN_RENAME_OBJECT ){
|
148123
|
0 |
0 |
if( pTriggerStep ){
|
148124
|
0 |
0 |
if( IN_RENAME_OBJECT ){
|
148140
|
0 |
0 |
if( pTrigger==0 || pTrigger->bReturning ) return;
|
|
0 |
0 |
if( pTrigger==0 || pTrigger->bReturning ) return;
|
148164
|
0 |
0 |
if( db->mallocFailed ) goto drop_trigger_cleanup;
|
148165
|
0 |
0 |
if( SQLITE_OK!=sqlite3ReadSchema(pParse) ){
|
148173
|
0 |
0 |
for(i=OMIT_TEMPDB; i<db->nDb; i++){
|
148174
|
0 |
0 |
int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */
|
148175
|
0 |
0 |
if( zDb && sqlite3DbIsNamed(db, j, zDb)==0 ) continue;
|
|
0 |
0 |
if( zDb && sqlite3DbIsNamed(db, j, zDb)==0 ) continue;
|
148178
|
0 |
0 |
if( pTrigger ) break;
|
148180
|
0 |
0 |
if( !pTrigger ){
|
148181
|
0 |
0 |
if( !noErr ){
|
148218
|
0 |
0 |
if( pTable ){
|
148221
|
0 |
0 |
const char *zTab = SCHEMA_TABLE(iDb);
|
148222
|
0 |
0 |
if( iDb==1 ) code = SQLITE_DROP_TEMP_TRIGGER;
|
148232
|
0 |
0 |
if( (v = sqlite3GetVdbe(pParse))!=0 ){
|
148252
|
0 |
0 |
if( ALWAYS(pTrigger) ){
|
148253
|
0 |
0 |
if( pTrigger->pSchema==pTrigger->pTabSchema ){
|
148255
|
0 |
0 |
if( pTab ){
|
148257
|
0 |
0 |
for(pp=&pTab->pTrigger; *pp; pp=&((*pp)->pNext)){
|
148258
|
0 |
0 |
if( *pp==pTrigger ){
|
148281
|
0 |
0 |
if( pIdList==0 || NEVER(pEList==0) ) return 1;
|
|
0 |
0 |
if( pIdList==0 || NEVER(pEList==0) ) return 1;
|
148282
|
0 |
0 |
for(e=0; e<pEList->nExpr; e++){
|
148283
|
0 |
0 |
if( sqlite3IdListIndex(pIdList, pEList->a[e].zEName)>=0 ) return 1;
|
148292
|
0 |
3043 |
if( NEVER(db->aDb[1].pSchema==0) ) return 0;
|
148293
|
3043 |
0 |
if( sqliteHashFirst(&db->aDb[1].pSchema->trigHash)==0 ) return 0;
|
148317
|
0 |
0 |
if( pList!=0 ){
|
148319
|
0 |
0 |
if( (pParse->db->flags & SQLITE_EnableTrigger)==0
|
148320
|
0 |
0 |
&& pTab->pTrigger!=0
|
148325
|
0 |
0 |
if( pList==pTab->pTrigger ){
|
148329
|
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;
|
148334
|
0 |
0 |
if( p->op==op && checkColumnOverlap(p->pColumns, pChanges) ){
|
|
0 |
0 |
if( p->op==op && checkColumnOverlap(p->pColumns, pChanges) ){
|
148336
|
0 |
0 |
}else if( p->op==TK_RETURNING ){
|
148341
|
0 |
0 |
if( IsVirtual(pTab) ){
|
148342
|
0 |
0 |
if( op!=TK_INSERT ){
|
148343
|
0 |
0 |
sqlite3ErrorMsg(pParse,
|
148352
|
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
|
148353
|
0 |
0 |
&& sqlite3IsToplevel(pParse) ){
|
148358
|
0 |
0 |
}while( p );
|
148361
|
0 |
0 |
if( pMask ){
|
148364
|
0 |
0 |
return (mask ? pList : 0);
|
148374
|
3043 |
0 |
if( (pTab->pTrigger==0 && !tempTriggersExist(pParse->db))
|
|
0 |
3043 |
if( (pTab->pTrigger==0 && !tempTriggersExist(pParse->db))
|
148375
|
0 |
0 |
|| pParse->disableTriggers
|
148377
|
2976 |
67 |
if( pMask ) *pMask = 0;
|
148403
|
0 |
0 |
if( pSrc ){
|
148406
|
0 |
0 |
if( pSchema!=db->aDb[1].pSchema ){
|
148409
|
0 |
0 |
if( pStep->pFrom ){
|
148411
|
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 ){
|
148437
|
0 |
0 |
if( pTerm->op==TK_ASTERISK ) return 1;
|
148438
|
0 |
0 |
if( pTerm->op!=TK_DOT ) return 0;
|
148441
|
0 |
0 |
if( pTerm->pRight->op!=TK_ASTERISK ) return 0;
|
148461
|
0 |
0 |
for(i=0; i<pList->nExpr; i++){
|
148463
|
0 |
0 |
if( NEVER(pOldExpr==0) ) continue;
|
148464
|
0 |
0 |
if( isAsteriskTerm(pParse, pOldExpr) ){
|
148466
|
0 |
0 |
for(jj=0; jj<pTab->nCol; jj++){
|
148468
|
0 |
0 |
if( IsHiddenColumn(pTab->aCol+jj) ) continue;
|
148471
|
0 |
0 |
if( !db->mallocFailed ){
|
148480
|
0 |
0 |
if( !db->mallocFailed && ALWAYS(pList->a[i].zEName!=0) ){
|
|
0 |
0 |
if( !db->mallocFailed && ALWAYS(pList->a[i].zEName!=0) ){
|
148521
|
0 |
0 |
if( pParse->nErr==0 ){
|
148527
|
0 |
0 |
if( pParse->nErr==0 ){
|
148530
|
0 |
0 |
if( pReturning->nRetCol==0 ){
|
148539
|
0 |
0 |
if( sqlite3ResolveExprListNames(&sNC, pNew)==SQLITE_OK
|
148540
|
0 |
0 |
&& ALWAYS(!db->mallocFailed)
|
148547
|
0 |
0 |
for(i=0; i<nCol; i++){
|
148551
|
0 |
0 |
if( sqlite3ExprAffinity(pCol)==SQLITE_AFF_REAL ){
|
148583
|
0 |
0 |
for(pStep=pStepList; pStep; pStep=pStep->pNext){
|
148597
|
0 |
0 |
pParse->eOrconf = (orconf==OE_Default)?pStep->orconf:(u8)orconf;
|
148601
|
0 |
0 |
if( pStep->zSpan ){
|
148678
|
0 |
0 |
if( pTo->nErr==0 ){
|
148697
|
0 |
0 |
Parse *pTop = sqlite3ParseToplevel(pParse);
|
148714
|
0 |
0 |
if( !pPrg ) return 0;
|
148718
|
0 |
0 |
if( !pProgram ) return 0;
|
148738
|
0 |
0 |
if( v ){
|
148748
|
0 |
0 |
if( pTrigger->zName ){
|
148758
|
0 |
0 |
if( pTrigger->pWhen ){
|
148760
|
0 |
0 |
if( db->mallocFailed==0
|
148761
|
0 |
0 |
&& SQLITE_OK==sqlite3ResolveExprNames(&sNC, pWhen)
|
148773
|
0 |
0 |
if( iEndTrigger ){
|
148780
|
0 |
0 |
if( pParse->nErr==0 ){
|
148811
|
0 |
0 |
Parse *pRoot = sqlite3ParseToplevel(pParse);
|
148820
|
0 |
0 |
for(pPrg=pRoot->pTriggerPrg;
|
148821
|
0 |
0 |
pPrg && (pPrg->pTrigger!=pTrigger || pPrg->orconf!=orconf);
|
|
0 |
0 |
pPrg && (pPrg->pTrigger!=pTrigger || pPrg->orconf!=orconf);
|
148826
|
0 |
0 |
if( !pPrg ){
|
148855
|
0 |
0 |
if( pPrg ){
|
148856
|
0 |
0 |
int bRecursive = (p->zName && 0==(pParse->db->flags&SQLITE_RecTriggers));
|
|
0 |
0 |
int bRecursive = (p->zName && 0==(pParse->db->flags&SQLITE_RecTriggers));
|
148929
|
0 |
316 |
for(p=pTrigger; p; p=p->pNext){
|
148944
|
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))
|
148945
|
0 |
0 |
&& p->tr_tm==tr_tm
|
148946
|
0 |
0 |
&& checkColumnOverlap(p->pColumns, pChanges)
|
148948
|
0 |
0 |
if( !p->bReturning ){
|
148950
|
0 |
0 |
}else if( sqlite3IsToplevel(pParse) ){
|
148991
|
278 |
0 |
const int op = pChanges ? TK_UPDATE : TK_DELETE;
|
148996
|
0 |
278 |
if( IsView(pTab) ){
|
148999
|
0 |
278 |
for(p=pTrigger; p; p=p->pNext){
|
149000
|
0 |
0 |
if( p->op==op
|
149001
|
0 |
0 |
&& (tr_tm&p->tr_tm)
|
149002
|
0 |
0 |
&& checkColumnOverlap(p->pColumns,pChanges)
|
149004
|
0 |
0 |
if( p->bReturning ){
|
149009
|
0 |
0 |
if( pPrg ){
|
149088
|
0 |
4721 |
if( pCol->iDflt ){
|
149097
|
0 |
0 |
if( pValue ){
|
149102
|
0 |
4721 |
if( pCol->affinity==SQLITE_AFF_REAL && !IsVirtual(pTab) ){
|
|
0 |
0 |
if( pCol->affinity==SQLITE_AFF_REAL && !IsVirtual(pTab) ){
|
149127
|
0 |
0 |
if( iIdxCol>=0 ){
|
149154
|
0 |
0 |
if( pIdx->pPartIdxWhere==0 ) return 0;
|
149167
|
0 |
0 |
if( pRet ) pRet->iColumn = iCol+1;
|
149248
|
0 |
0 |
if( pSrc ){
|
149254
|
0 |
0 |
if( pPk ){
|
149255
|
0 |
0 |
for(i=0; i<pPk->nKeyCol; i++){
|
149264
|
0 |
0 |
eDest = IsVirtual(pTab) ? SRT_Table : SRT_Upfrom;
|
149265
|
0 |
0 |
}else if( IsView(pTab) ){
|
149266
|
0 |
0 |
for(i=0; i<pTab->nCol; i++){
|
149271
|
0 |
0 |
eDest = IsVirtual(pTab) ? SRT_Table : SRT_Upfrom;
|
149280
|
0 |
0 |
if( pChanges ){
|
149281
|
0 |
0 |
for(i=0; i<pChanges->nExpr; i++){
|
149291
|
0 |
0 |
if( pSelect ) pSelect->selFlags |= SF_OrderByReqd;
|
149293
|
0 |
0 |
dest.iSDParm2 = (pPk ? pPk->nKeyCol : -1);
|
149377
|
0 |
279 |
if( pParse->nErr ){
|
149385
|
0 |
279 |
if( pTab==0 ) goto update_cleanup;
|
149417
|
0 |
279 |
nChangeFrom = (pTabList->nSrc>1) ? pChanges->nExpr : 0;
|
149430
|
0 |
279 |
if( sqlite3ViewGetColumnNames(pParse, pTab) ){
|
149433
|
3 |
276 |
if( sqlite3IsReadOnly(pParse, pTab, pTrigger) ){
|
149444
|
0 |
276 |
pPk = HasRowid(pTab) ? 0 : sqlite3PrimaryKeyIndex(pTab);
|
149446
|
0 |
276 |
for(nIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdx++){
|
149447
|
0 |
0 |
if( pPk==pIdx ){
|
149452
|
0 |
276 |
if( pUpsert ){
|
149464
|
0 |
276 |
if( aXRef==0 ) goto update_cleanup;
|
149469
|
1367 |
276 |
for(i=0; i<pTab->nCol; i++) aXRef[i] = -1;
|
149480
|
0 |
276 |
if( v==0 ) goto update_cleanup;
|
149489
|
1332 |
276 |
for(i=0; i<pChanges->nExpr; i++){
|
149493
|
1332 |
0 |
if( nChangeFrom==0 && sqlite3ResolveExprNames(&sNC, pChanges->a[i].pExpr) ){
|
|
0 |
1332 |
if( nChangeFrom==0 && sqlite3ResolveExprNames(&sNC, pChanges->a[i].pExpr) ){
|
149496
|
3994 |
0 |
for(j=0; j<pTab->nCol; j++){
|
149497
|
1332 |
2662 |
if( pTab->aCol[j].hName==hCol
|
149498
|
1332 |
0 |
&& sqlite3StrICmp(pTab->aCol[j].zCnName, pChanges->a[i].zEName)==0
|
149500
|
0 |
1332 |
if( j==pTab->iPKey ){
|
149504
|
0 |
1332 |
}else if( pPk && (pTab->aCol[j].colFlags & COLFLAG_PRIMKEY)!=0 ){
|
|
0 |
0 |
}else if( pPk && (pTab->aCol[j].colFlags & COLFLAG_PRIMKEY)!=0 ){
|
149508
|
0 |
1332 |
else if( pTab->aCol[j].colFlags & COLFLAG_GENERATED ){
|
149521
|
0 |
1332 |
if( j>=pTab->nCol ){
|
149522
|
0 |
0 |
if( pPk==0 && sqlite3IsRowid(pChanges->a[i].zEName) ){
|
|
0 |
0 |
if( pPk==0 && sqlite3IsRowid(pChanges->a[i].zEName) ){
|
149536
|
1332 |
0 |
rc = sqlite3AuthCheck(pParse, SQLITE_UPDATE, pTab->zName,
|
149539
|
0 |
1332 |
if( rc==SQLITE_DENY ){
|
149541
|
0 |
1332 |
}else if( rc==SQLITE_IGNORE ){
|
149560
|
0 |
276 |
if( pTab->tabFlags & TF_HasGenerated ){
|
149566
|
0 |
0 |
for(i=0; i<pTab->nCol; i++){
|
149567
|
0 |
0 |
if( aXRef[i]>=0 ) continue;
|
149568
|
0 |
0 |
if( (pTab->aCol[i].colFlags & COLFLAG_GENERATED)==0 ) continue;
|
149569
|
0 |
0 |
if( sqlite3ExprReferencesUpdatedColumn(
|
149577
|
0 |
0 |
}while( bProgress );
|
149586
|
0 |
276 |
pTabList->a[0].colUsed = IsVirtual(pTab) ? ALLBITS : 0;
|
149594
|
0 |
276 |
if( onError==OE_Replace ) bReplace = 1;
|
149595
|
0 |
276 |
for(nAllIdx=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nAllIdx++){
|
149597
|
0 |
0 |
if( chngKey || hasFK>1 || pIdx==pPk
|
|
0 |
0 |
if( chngKey || hasFK>1 || pIdx==pPk
|
|
0 |
0 |
if( chngKey || hasFK>1 || pIdx==pPk
|
149598
|
0 |
0 |
|| indexWhereClauseMightChange(pIdx,aXRef,chngRowid)
|
149604
|
0 |
0 |
for(i=0; i<pIdx->nKeyCol; i++){
|
149605
|
0 |
0 |
if( indexColumnIsBeingUpdated(pIdx, i, aXRef, chngRowid) ){
|
149608
|
0 |
0 |
if( onError==OE_Default && pIdx->onError==OE_Replace ){
|
|
0 |
0 |
if( onError==OE_Default && pIdx->onError==OE_Replace ){
|
149615
|
0 |
0 |
if( reg==0 ) aToOpen[nAllIdx+1] = 0;
|
149619
|
0 |
276 |
if( bReplace ){
|
149625
|
7 |
269 |
if( pParse->nested==0 ) sqlite3VdbeCountChanges(v);
|
149626
|
276 |
0 |
sqlite3BeginWriteOperation(pParse, pTrigger || hasFK, iDb);
|
|
2 |
274 |
sqlite3BeginWriteOperation(pParse, pTrigger || hasFK, iDb);
|
149629
|
276 |
0 |
if( !IsVirtual(pTab) ){
|
149638
|
276 |
0 |
if( chngPk || pTrigger || hasFK ){
|
|
276 |
0 |
if( chngPk || pTrigger || hasFK ){
|
|
2 |
274 |
if( chngPk || pTrigger || hasFK ){
|
149642
|
276 |
0 |
if( chngKey || pTrigger || hasFK ){
|
|
276 |
0 |
if( chngKey || pTrigger || hasFK ){
|
|
2 |
274 |
if( chngKey || pTrigger || hasFK ){
|
149650
|
0 |
276 |
if( isView ){
|
149658
|
276 |
0 |
if( nChangeFrom==0 && isView ){
|
|
0 |
276 |
if( nChangeFrom==0 && isView ){
|
149670
|
276 |
0 |
if( nChangeFrom==0 && sqlite3ResolveExprNames(&sNC, pWhere) ){
|
|
0 |
276 |
if( nChangeFrom==0 && sqlite3ResolveExprNames(&sNC, pWhere) ){
|
149676
|
0 |
276 |
if( IsVirtual(pTab) ){
|
149688
|
0 |
276 |
if( (db->flags&SQLITE_CountRows)!=0
|
149689
|
0 |
0 |
&& !pParse->pTriggerTab
|
149690
|
0 |
0 |
&& !pParse->nested
|
149691
|
0 |
0 |
&& !pParse->bReturning
|
149692
|
0 |
0 |
&& pUpsert==0
|
149698
|
276 |
0 |
if( nChangeFrom==0 && HasRowid(pTab) ){
|
|
276 |
0 |
if( nChangeFrom==0 && HasRowid(pTab) ){
|
149704
|
0 |
0 |
nPk = pPk ? pPk->nKeyCol : 0;
|
149709
|
0 |
0 |
if( pUpsert==0 ){
|
149710
|
0 |
0 |
int nEphCol = nPk + nChangeFrom + (isView ? pTab->nCol : 0);
|
149712
|
0 |
0 |
if( pPk ) sqlite3VdbeAddOp3(v, OP_Null, 0, iPk, iPk+nPk-1);
|
149714
|
0 |
0 |
if( pPk ){
|
149716
|
0 |
0 |
if( pKeyInfo ){
|
149721
|
0 |
0 |
if( nChangeFrom ){
|
149726
|
0 |
0 |
if( isView ) iDataCur = iEph;
|
149732
|
0 |
276 |
if( nChangeFrom ){
|
149738
|
0 |
276 |
if( pUpsert ){
|
149761
|
7 |
269 |
if( !pParse->nested
|
149762
|
7 |
0 |
&& !pTrigger
|
149763
|
5 |
2 |
&& !hasFK
|
149764
|
5 |
0 |
&& !chngKey
|
149765
|
5 |
0 |
&& !bReplace
|
149766
|
5 |
0 |
&& (sNC.ncFlags & NC_Subquery)==0
|
149771
|
0 |
276 |
if( pWInfo==0 ) goto update_cleanup;
|
149785
|
12 |
264 |
if( eOnePass!=ONEPASS_SINGLE ){
|
149787
|
5 |
7 |
if( eOnePass==ONEPASS_MULTI ){
|
149789
|
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] ){
|
149797
|
276 |
0 |
if( HasRowid(pTab) ){
|
149802
|
7 |
269 |
if( eOnePass==ONEPASS_OFF ){
|
149806
|
269 |
0 |
if( ALWAYS(addrOpen) ) sqlite3VdbeChangeToNoop(v, addrOpen);
|
149814
|
0 |
0 |
for(i=0; i<nPk; i++){
|
149819
|
0 |
0 |
if( eOnePass ){
|
149820
|
0 |
0 |
if( addrOpen ) sqlite3VdbeChangeToNoop(v, addrOpen);
|
149831
|
276 |
0 |
if( pUpsert==0 ){
|
149832
|
276 |
0 |
if( nChangeFrom==0 && eOnePass!=ONEPASS_MULTI ){
|
|
271 |
5 |
if( nChangeFrom==0 && eOnePass!=ONEPASS_MULTI ){
|
149836
|
276 |
0 |
if( !isView ){
|
149840
|
269 |
7 |
if( eOnePass!=ONEPASS_OFF ){
|
149841
|
269 |
0 |
if( aiCurOnePass[0]>=0 ) aToOpen[aiCurOnePass[0]-iBaseCur] = 0;
|
149842
|
0 |
269 |
if( aiCurOnePass[1]>=0 ) aToOpen[aiCurOnePass[1]-iBaseCur] = 0;
|
149845
|
5 |
271 |
if( eOnePass==ONEPASS_MULTI && (nIdx-(aiCurOnePass[1]>=0))>0 ){
|
|
0 |
5 |
if( eOnePass==ONEPASS_MULTI && (nIdx-(aiCurOnePass[1]>=0))>0 ){
|
149850
|
0 |
276 |
if( addrOnce ){
|
149856
|
269 |
7 |
if( eOnePass!=ONEPASS_OFF ){
|
149857
|
0 |
269 |
if( aiCurOnePass[0]!=iDataCur
|
149858
|
0 |
0 |
&& aiCurOnePass[1]!=iDataCur
|
149867
|
5 |
264 |
if( eOnePass!=ONEPASS_SINGLE ){
|
149870
|
0 |
269 |
sqlite3VdbeAddOp2(v, OP_IsNull, pPk ? regKey : regOldRowid, labelBreak);
|
149873
|
7 |
0 |
}else if( pPk || nChangeFrom ){
|
|
0 |
7 |
}else if( pPk || nChangeFrom ){
|
149877
|
0 |
0 |
if( nChangeFrom ){
|
149878
|
0 |
0 |
if( !isView ){
|
149879
|
0 |
0 |
if( pPk ){
|
149880
|
0 |
0 |
for(i=0; i<nPk; i++){
|
149913
|
0 |
276 |
if( chngRowid ){
|
149915
|
0 |
0 |
if( nChangeFrom==0 ){
|
149925
|
276 |
0 |
if( chngPk || hasFK || pTrigger ){
|
|
274 |
2 |
if( chngPk || hasFK || pTrigger ){
|
|
0 |
274 |
if( chngPk || hasFK || pTrigger ){
|
149926
|
2 |
0 |
u32 oldmask = (hasFK ? sqlite3FkOldmask(pParse, pTab) : 0);
|
149930
|
6 |
2 |
for(i=0; i<pTab->nCol; i++){
|
149933
|
6 |
0 |
if( oldmask==0xffffffff
|
149934
|
6 |
0 |
|| (i<32 && (oldmask & MASKBIT32(i))!=0)
|
|
4 |
2 |
|| (i<32 && (oldmask & MASKBIT32(i))!=0)
|
149935
|
2 |
2 |
|| (colFlags & COLFLAG_PRIMKEY)!=0
|
149943
|
2 |
0 |
if( chngRowid==0 && pPk==0 ){
|
|
2 |
0 |
if( chngRowid==0 && pPk==0 ){
|
149964
|
1367 |
276 |
for(i=0, k=regNew; i<pTab->nCol; i++, k++){
|
149965
|
2 |
1365 |
if( i==pTab->iPKey ){
|
149967
|
0 |
1365 |
}else if( (pTab->aCol[i].colFlags & COLFLAG_GENERATED)!=0 ){
|
149968
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_VIRTUAL ) k--;
|
149971
|
1332 |
33 |
if( j>=0 ){
|
149972
|
0 |
1332 |
if( nChangeFrom ){
|
149973
|
0 |
0 |
int nOff = (isView ? pTab->nCol : nPk);
|
149979
|
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)) ){
|
149995
|
0 |
276 |
if( pTab->tabFlags & TF_HasGenerated ){
|
150005
|
0 |
276 |
if( tmask&TRIGGER_BEFORE ){
|
150010
|
0 |
0 |
if( !isView ){
|
150017
|
0 |
0 |
if( pPk ){
|
150034
|
0 |
0 |
for(i=0, k=regNew; i<pTab->nCol; i++, k++){
|
150035
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_GENERATED ){
|
150036
|
0 |
0 |
if( pTab->aCol[i].colFlags & COLFLAG_VIRTUAL ) k--;
|
150037
|
0 |
0 |
}else if( aXRef[i]<0 && i!=pTab->iPKey ){
|
|
0 |
0 |
}else if( aXRef[i]<0 && i!=pTab->iPKey ){
|
150042
|
0 |
0 |
if( pTab->tabFlags & TF_HasGenerated ){
|
150051
|
276 |
0 |
if( !isView ){
|
150061
|
276 |
0 |
if( bReplace || chngKey ){
|
|
0 |
276 |
if( bReplace || chngKey ){
|
150062
|
0 |
0 |
if( pPk ){
|
150071
|
2 |
274 |
if( hasFK ){
|
150083
|
0 |
276 |
if( bFinishSeek ){
|
150110
|
276 |
0 |
if( hasFK>1 || chngKey ){
|
|
0 |
276 |
if( hasFK>1 || chngKey ){
|
150115
|
2 |
274 |
if( hasFK ){
|
150120
|
5 |
271 |
sqlite3CompleteInsertion(
|
150129
|
2 |
274 |
if( hasFK ){
|
150136
|
0 |
276 |
if( regRowCount ){
|
150146
|
12 |
264 |
if( eOnePass==ONEPASS_SINGLE ){
|
150148
|
5 |
7 |
}else if( eOnePass==ONEPASS_MULTI ){
|
150161
|
7 |
269 |
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 ){
|
150169
|
0 |
276 |
if( regRowCount ){
|
150250
|
0 |
0 |
if( pSrc->nSrc>1 ){
|
150254
|
0 |
0 |
if( HasRowid(pTab) ){
|
150255
|
0 |
0 |
if( pRowid ){
|
150266
|
0 |
0 |
if( aXRef[iPk]>=0 ){
|
150274
|
0 |
0 |
for(i=0; i<pTab->nCol; i++){
|
150275
|
0 |
0 |
if( aXRef[i]>=0 ){
|
150295
|
0 |
0 |
if( pWInfo==0 ) return;
|
150298
|
0 |
0 |
for(i=0; i<pTab->nCol; i++){
|
150300
|
0 |
0 |
if( aXRef[i]>=0 ){
|
150307
|
0 |
0 |
if( HasRowid(pTab) ){
|
150309
|
0 |
0 |
if( pRowid ){
|
150330
|
0 |
0 |
if( eOnePass ){
|
150351
|
0 |
0 |
if( eOnePass==ONEPASS_OFF ){
|
150353
|
0 |
0 |
if( pSrc->nSrc==1 ){
|
150362
|
0 |
0 |
for(i=0; i<nArg; i++){
|
150368
|
0 |
0 |
sqlite3VdbeChangeP5(v, onError==OE_Default ? OE_Abort : onError);
|
150373
|
0 |
0 |
if( eOnePass==ONEPASS_OFF ){
|
150415
|
0 |
0 |
}while( p );
|
150418
|
0 |
2697 |
if( p ) upsertDelete(db, p);
|
150426
|
0 |
0 |
if( p==0 ) return 0;
|
150449
|
0 |
0 |
if( pNew==0 ){
|
150501
|
0 |
0 |
for(; pUpsert && pUpsert->pUpsertTarget;
|
|
0 |
0 |
for(; pUpsert && pUpsert->pUpsertTarget;
|
150504
|
0 |
0 |
if( rc ) return rc;
|
150506
|
0 |
0 |
if( rc ) return rc;
|
150512
|
0 |
0 |
if( HasRowid(pTab)
|
150513
|
0 |
0 |
&& pTarget->nExpr==1
|
150514
|
0 |
0 |
&& (pTerm = pTarget->a[0].pExpr)->op==TK_COLUMN
|
150515
|
0 |
0 |
&& pTerm->iColumn==XN_ROWID
|
150535
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
150537
|
0 |
0 |
if( !IsUniqueIndex(pIdx) ) continue;
|
150538
|
0 |
0 |
if( pTarget->nExpr!=pIdx->nKeyCol ) continue;
|
150539
|
0 |
0 |
if( pIdx->pPartIdxWhere ){
|
150540
|
0 |
0 |
if( pUpsert->pUpsertTargetWhere==0 ) continue;
|
150541
|
0 |
0 |
if( sqlite3ExprCompare(pParse, pUpsert->pUpsertTargetWhere,
|
150547
|
0 |
0 |
for(ii=0; ii<nn; ii++){
|
150550
|
0 |
0 |
if( pIdx->aiColumn[ii]==XN_EXPR ){
|
150555
|
0 |
0 |
if( pExpr->op!=TK_COLLATE ){
|
150564
|
0 |
0 |
for(jj=0; jj<nn; jj++){
|
150565
|
0 |
0 |
if( sqlite3ExprCompare(pParse,pTarget->a[jj].pExpr,pExpr,iCursor)<2 ){
|
150569
|
0 |
0 |
if( jj>=nn ){
|
150574
|
0 |
0 |
if( ii<nn ){
|
150582
|
0 |
0 |
if( pUpsert->pUpsertIdx==0 ){
|
150584
|
0 |
0 |
if( nClause==0 && pUpsert->pNextUpsert==0 ){
|
|
0 |
0 |
if( nClause==0 && pUpsert->pNextUpsert==0 ){
|
150604
|
0 |
0 |
if( NEVER(pUpsert==0) ) return 0;
|
150606
|
0 |
0 |
if( pNext==0 ) return 1;
|
150607
|
0 |
0 |
if( pNext->pUpsertTarget==0 ) return 1;
|
150608
|
0 |
0 |
if( pNext->pUpsertIdx==0 ) return 1;
|
150619
|
0 |
0 |
while(
|
150621
|
0 |
0 |
&& pUpsert->pUpsertTarget!=0
|
150622
|
0 |
0 |
&& pUpsert->pUpsertIdx!=pIdx
|
150657
|
0 |
0 |
if( pIdx && iCur!=iDataCur ){
|
|
0 |
0 |
if( pIdx && iCur!=iDataCur ){
|
150658
|
0 |
0 |
if( HasRowid(pTab) ){
|
150669
|
0 |
0 |
for(i=0; i<nPk; i++){
|
150690
|
0 |
0 |
for(i=0; i<pTab->nCol; i++){
|
150691
|
0 |
0 |
if( pTab->aCol[i].affinity==SQLITE_AFF_REAL ){
|
150741
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
150742
|
0 |
0 |
while( SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){
|
150750
|
0 |
0 |
if( zSubSql
|
150751
|
0 |
0 |
&& (strncmp(zSubSql,"CRE",3)==0 || strncmp(zSubSql,"INS",3)==0)
|
|
0 |
0 |
&& (strncmp(zSubSql,"CRE",3)==0 || strncmp(zSubSql,"INS",3)==0)
|
150754
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
150758
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK;
|
150759
|
0 |
0 |
if( rc ){
|
150772
|
0 |
0 |
if( z==0 ) return SQLITE_NOMEM;
|
150811
|
0 |
0 |
if( v==0 ) goto build_vacuum_end;
|
150812
|
0 |
0 |
if( pParse->nErr ) goto build_vacuum_end;
|
150813
|
0 |
0 |
if( pNm ){
|
150818
|
0 |
0 |
if( iDb<0 ) goto build_vacuum_end;
|
150829
|
0 |
0 |
if( iDb!=1 ){
|
150831
|
0 |
0 |
if( pInto && sqlite3ResolveSelfReference(pParse,0,0,pInto,0)==0 ){
|
|
0 |
0 |
if( pInto && sqlite3ResolveSelfReference(pParse,0,0,pInto,0)==0 ){
|
150869
|
0 |
0 |
if( !db->autoCommit ){
|
150873
|
0 |
0 |
if( db->nVdbeActive>1 ){
|
150878
|
0 |
0 |
if( pOut ){
|
150879
|
0 |
0 |
if( sqlite3_value_type(pOut)!=SQLITE_TEXT ){
|
150925
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
150930
|
0 |
0 |
if( pOut ){
|
150933
|
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) ){
|
150956
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
150957
|
0 |
0 |
rc = sqlite3BtreeBeginTrans(pMain, pOut==0 ? 2 : 0, 0);
|
150958
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
150961
|
0 |
0 |
if( sqlite3PagerGetJournalMode(sqlite3BtreePager(pMain))
|
150963
|
0 |
0 |
&& pOut==0
|
150968
|
0 |
0 |
if( sqlite3BtreeSetPageSize(pTemp, sqlite3BtreeGetPageSize(pMain), nRes, 0)
|
150969
|
0 |
0 |
|| (!isMemDb && sqlite3BtreeSetPageSize(pTemp, db->nextPagesize, nRes, 0))
|
|
0 |
0 |
|| (!isMemDb && sqlite3BtreeSetPageSize(pTemp, db->nextPagesize, nRes, 0))
|
150970
|
0 |
0 |
|| NEVER(db->mallocFailed)
|
150977
|
0 |
0 |
sqlite3BtreeSetAutoVacuum(pTemp, db->nextAutovac>=0 ? db->nextAutovac :
|
150991
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
150997
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
151013
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
151027
|
0 |
0 |
if( rc ) goto end_of_vacuum;
|
151057
|
0 |
0 |
for(i=0; i<ArraySize(aCopy); i+=2){
|
151062
|
0 |
0 |
if( NEVER(rc!=SQLITE_OK) ) goto end_of_vacuum;
|
151065
|
0 |
0 |
if( pOut==0 ){
|
151068
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
151070
|
0 |
0 |
if( rc!=SQLITE_OK ) goto end_of_vacuum;
|
151072
|
0 |
0 |
if( pOut==0 ){
|
151079
|
0 |
0 |
if( pOut==0 ){
|
151103
|
0 |
0 |
if( pDb ){
|
151168
|
0 |
3123 |
if( pModule==0 ){
|
151174
|
0 |
3123 |
if( pMod==0 ){
|
151188
|
0 |
3123 |
if( pDel ){
|
151189
|
0 |
0 |
if( pDel==pMod ){
|
151218
|
0 |
3123 |
if( rc!=SQLITE_OK && xDestroy ) xDestroy(pAux);
|
|
0 |
0 |
if( rc!=SQLITE_OK && xDestroy ) xDestroy(pAux);
|
151264
|
0 |
0 |
for(pThis=sqliteHashFirst(&db->aModule); pThis; pThis=pNext){
|
151267
|
0 |
0 |
if( azNames ){
|
151269
|
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++){}
|
151270
|
0 |
0 |
if( azNames[ii]!=0 ) continue;
|
151284
|
3103 |
31 |
if( pMod->nRefModule==0 ){
|
151285
|
1249 |
1854 |
if( pMod->xDestroy ){
|
151314
|
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);
|
151331
|
31 |
265 |
if( pVTab->nRef==0 ){
|
151333
|
29 |
2 |
if( p ){
|
151364
|
2 |
63 |
while( pVTable ){
|
151368
|
2 |
0 |
if( db2==db ){
|
151398
|
29 |
3 |
for(ppVTab=&p->u.vtab.p; *ppVTab; ppVTab=&(*ppVTab)->pNext){
|
151399
|
29 |
0 |
if( (*ppVTab)->db==db ){
|
151435
|
0 |
655 |
if( p ){
|
151442
|
0 |
0 |
}while( p );
|
151463
|
61 |
0 |
if( db->pnBytesFreed==0 ) vtabDisconnectAll(0, p);
|
151464
|
61 |
0 |
if( p->u.vtab.azArg ){
|
151466
|
353 |
61 |
for(i=0; i<p->u.vtab.nArg; i++){
|
151467
|
292 |
61 |
if( i!=1 ) sqlite3DbFree(db, p->u.vtab.azArg[i]);
|
151486
|
0 |
353 |
if( pTable->u.vtab.nArg+3>=db->aLimit[SQLITE_LIMIT_COLUMN] ){
|
151490
|
0 |
353 |
if( azModuleArg==0 ){
|
151517
|
0 |
61 |
if( pTable==0 ) return;
|
151540
|
61 |
0 |
if( pTable->u.vtab.azArg ){
|
151555
|
170 |
63 |
if( pParse->sArg.z && pParse->pNewTable ){
|
|
170 |
0 |
if( pParse->sArg.z && pParse->pNewTable ){
|
151571
|
0 |
61 |
if( pTab==0 ) return;
|
151575
|
0 |
61 |
if( pTab->u.vtab.nArg<1 ) return;
|
151583
|
29 |
32 |
if( !db->init.busy ){
|
151593
|
29 |
0 |
if( pEnd ){
|
151637
|
0 |
32 |
if( pOld ){
|
151662
|
170 |
178 |
if( pArg->z==0 ){
|
151697
|
1 |
32 |
for(pCtx=db->pVtabCtx; pCtx; pCtx=pCtx->pPrior){
|
151698
|
0 |
1 |
if( pCtx->pTab==pTab ){
|
151707
|
0 |
32 |
if( !zModuleName ){
|
151712
|
0 |
32 |
if( !pVTable ){
|
151736
|
0 |
32 |
if( rc==SQLITE_NOMEM ) sqlite3OomFault(db);
|
151739
|
1 |
31 |
if( SQLITE_OK!=rc ){
|
151740
|
0 |
1 |
if( zErr==0 ){
|
151747
|
31 |
0 |
}else if( ALWAYS(pVTable->pVtab) ){
|
151754
|
0 |
31 |
if( sCtx.bDeclared==0 ){
|
151770
|
100 |
31 |
for(iCol=0; iCol<pTab->nCol; iCol++){
|
151775
|
233 |
72 |
for(i=0; i<nType; i++){
|
151776
|
28 |
205 |
if( 0==sqlite3StrNICmp("hidden", &zType[i], 6)
|
151777
|
0 |
28 |
&& (i==0 || zType[i-1]==' ')
|
|
0 |
0 |
&& (i==0 || zType[i-1]==' ')
|
151778
|
0 |
28 |
&& (zType[i+6]=='\0' || zType[i+6]==' ')
|
|
0 |
0 |
&& (zType[i+6]=='\0' || zType[i+6]==' ')
|
151783
|
28 |
72 |
if( i<nType ){
|
151785
|
0 |
28 |
int nDel = 6 + (zType[i+6] ? 1 : 0);
|
151786
|
28 |
28 |
for(j=i; (j+nDel)<=nType; j++){
|
151789
|
28 |
0 |
if( zType[i]=='\0' && i>0 ){
|
|
0 |
28 |
if( zType[i]=='\0' && i>0 ){
|
151822
|
182 |
3 |
if( sqlite3GetVTable(db, pTab) ){
|
151830
|
0 |
3 |
if( !pMod ){
|
151837
|
0 |
3 |
if( rc!=SQLITE_OK ){
|
151854
|
71 |
0 |
if( (db->nVTrans%ARRAY_INCR)==0 ){
|
151859
|
0 |
71 |
if( !aVTrans ){
|
151904
|
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 ){
|
151913
|
28 |
1 |
if( rc==SQLITE_OK && ALWAYS(sqlite3GetVTable(db, pTab)) ){
|
|
28 |
0 |
if( rc==SQLITE_OK && ALWAYS(sqlite3GetVTable(db, pTab)) ){
|
151915
|
28 |
0 |
if( rc==SQLITE_OK ){
|
151942
|
31 |
0 |
if( !pCtx || pCtx->bDeclared ){
|
|
0 |
31 |
if( !pCtx || pCtx->bDeclared ){
|
151960
|
31 |
0 |
if( SQLITE_OK==sqlite3RunParser(&sParse, zCreateTable)
|
151961
|
31 |
0 |
&& ALWAYS(sParse.pNewTable!=0)
|
151962
|
31 |
0 |
&& ALWAYS(!db->mallocFailed)
|
151963
|
31 |
0 |
&& IsOrdinaryTable(sParse.pNewTable)
|
151966
|
31 |
0 |
if( !pTab->aCol ){
|
151977
|
0 |
31 |
if( !HasRowid(pNew)
|
151978
|
0 |
0 |
&& pCtx->pVTable->pMod->pModule->xUpdate!=0
|
151979
|
0 |
0 |
&& sqlite3PrimaryKeyIndex(pNew)->nKeyCol!=1
|
151986
|
0 |
31 |
if( pIdx ){
|
151995
|
0 |
0 |
sqlite3ErrorWithMsg(db, SQLITE_ERROR,
|
152002
|
31 |
0 |
if( sParse.pVdbe ){
|
152027
|
2 |
0 |
if( ALWAYS(pTab!=0)
|
152028
|
2 |
0 |
&& ALWAYS(IsVirtual(pTab))
|
152029
|
2 |
0 |
&& ALWAYS(pTab->u.vtab.p!=0)
|
152033
|
2 |
2 |
for(p=pTab->u.vtab.p; p; p=p->pNext){
|
152035
|
0 |
2 |
if( p->pVtab->nRef>0 ){
|
152041
|
0 |
2 |
if( xDestroy==0 ) xDestroy = p->pMod->pModule->xDisconnect;
|
152046
|
2 |
0 |
if( rc==SQLITE_OK ){
|
152068
|
71 |
2995 |
if( db->aVTrans ){
|
152071
|
71 |
71 |
for(i=0; i<db->nVTrans; i++){
|
152074
|
71 |
0 |
if( p ){
|
152077
|
70 |
1 |
if( x ) x(p);
|
152100
|
2449 |
0 |
for(i=0; rc==SQLITE_OK && i<db->nVTrans; i++){
|
|
71 |
2378 |
for(i=0; rc==SQLITE_OK && i<db->nVTrans; i++){
|
152103
|
71 |
0 |
if( pVtab && (x = pVtab->pModule->xSync)!=0 ){
|
|
70 |
1 |
if( pVtab && (x = pVtab->pModule->xSync)!=0 ){
|
152147
|
5 |
74 |
if( sqlite3VtabInSync(db) ){
|
|
0 |
5 |
if( sqlite3VtabInSync(db) ){
|
152150
|
31 |
48 |
if( !pVTab ){
|
152155
|
48 |
0 |
if( pModule->xBegin ){
|
152159
|
5 |
43 |
for(i=0; i<db->nVTrans; i++){
|
152160
|
5 |
0 |
if( db->aVTrans[i]==pVTab ){
|
152168
|
43 |
0 |
if( rc==SQLITE_OK ){
|
152170
|
43 |
0 |
if( rc==SQLITE_OK ){
|
152173
|
0 |
43 |
if( iSvpt && pModule->xSavepoint ){
|
|
0 |
0 |
if( iSvpt && pModule->xSavepoint ){
|
152203
|
2 |
133 |
if( db->aVTrans ){
|
152205
|
4 |
0 |
for(i=0; rc==SQLITE_OK && i<db->nVTrans; i++){
|
|
2 |
2 |
for(i=0; rc==SQLITE_OK && i<db->nVTrans; i++){
|
152208
|
2 |
0 |
if( pVTab->pVtab && pMod->iVersion>=2 ){
|
|
2 |
0 |
if( pVTab->pVtab && pMod->iVersion>=2 ){
|
152223
|
2 |
0 |
if( xMethod && pVTab->iSavepoint>iSavepoint ){
|
|
0 |
2 |
if( xMethod && pVTab->iSavepoint>iSavepoint ){
|
152264
|
0 |
677 |
if( NEVER(pExpr==0) ) return pDef;
|
152265
|
511 |
166 |
if( pExpr->op!=TK_COLUMN ) return pDef;
|
152268
|
0 |
166 |
if( NEVER(pTab==0) ) return pDef;
|
152269
|
137 |
29 |
if( !IsVirtual(pTab) ) return pDef;
|
152274
|
0 |
29 |
if( pMod->xFindFunction==0 ) return pDef;
|
152293
|
4 |
25 |
if( rc==0 ){
|
152301
|
0 |
25 |
if( pNew==0 ){
|
152320
|
0 |
22 |
Parse *pToplevel = sqlite3ParseToplevel(pParse);
|
152325
|
0 |
22 |
for(i=0; i<pToplevel->nVtabLock; i++){
|
152326
|
0 |
0 |
if( pTab==pToplevel->apVtabLock[i] ) return;
|
152330
|
22 |
0 |
if( apVtabLock ){
|
152359
|
0 |
0 |
if( pMod->pEpoTab ) return 1;
|
152360
|
0 |
0 |
if( pModule->xCreate!=0 && pModule->xCreate!=pModule->xConnect ) return 0;
|
|
0 |
0 |
if( pModule->xCreate!=0 && pModule->xCreate!=pModule->xConnect ) return 0;
|
152362
|
0 |
0 |
if( pTab==0 ) return 0;
|
152364
|
0 |
0 |
if( pTab->zName==0 ){
|
152379
|
0 |
0 |
if( rc ){
|
152393
|
0 |
3103 |
if( pTab!=0 ){
|
152438
|
0 |
10 |
if( !p ){
|
152445
|
10 |
0 |
p->pVTable->bConstraint = (u8)va_arg(ap, int);
|
152468
|
0 |
10 |
if( rc!=SQLITE_OK ) sqlite3Error(db, rc);
|
153149
|
0 |
1 |
if( i==XN_EXPR ) return "<expr>";
|
153150
|
0 |
1 |
if( i==XN_ROWID ) return "rowid";
|
153173
|
0 |
0 |
if( bAnd ) sqlite3_str_append(pStr, " AND ", 5);
|
153175
|
0 |
0 |
if( nTerm>1 ) sqlite3_str_append(pStr, "(", 1);
|
153176
|
0 |
0 |
for(i=0; i<nTerm; i++){
|
153177
|
0 |
0 |
if( i ) sqlite3_str_append(pStr, ",", 1);
|
153180
|
0 |
0 |
if( nTerm>1 ) sqlite3_str_append(pStr, ")", 1);
|
153184
|
0 |
0 |
if( nTerm>1 ) sqlite3_str_append(pStr, "(", 1);
|
153185
|
0 |
0 |
for(i=0; i<nTerm; i++){
|
153186
|
0 |
0 |
if( i ) sqlite3_str_append(pStr, ",", 1);
|
153189
|
0 |
0 |
if( nTerm>1 ) sqlite3_str_append(pStr, ")", 1);
|
153212
|
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;
|
153214
|
0 |
0 |
for(i=0; i<nEq; i++){
|
153216
|
0 |
0 |
if( i ) sqlite3_str_append(pStr, " AND ", 5);
|
153217
|
0 |
0 |
sqlite3_str_appendf(pStr, i>=nSkip ? "%s=?" : "ANY(%s)", z);
|
153221
|
0 |
0 |
if( pLoop->wsFlags&WHERE_BTM_LIMIT ){
|
153225
|
0 |
0 |
if( pLoop->wsFlags&WHERE_TOP_LIMIT ){
|
153248
|
0 |
1736 |
if( sqlite3ParseToplevel(pParse)->explain==2 || IS_STMT_SCANSTATUS(pParse->db) )
|
|
0 |
1736 |
if( sqlite3ParseToplevel(pParse)->explain==2 || IS_STMT_SCANSTATUS(pParse->db) )
|
153263
|
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;
|
153266
|
0 |
0 |
|| ((flags&WHERE_VIRTUALTABLE)==0 && (pLoop->u.btree.nEq>0))
|
|
0 |
0 |
|| ((flags&WHERE_VIRTUALTABLE)==0 && (pLoop->u.btree.nEq>0))
|
153267
|
0 |
0 |
|| (wctrlFlags&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX));
|
|
0 |
0 |
|| (wctrlFlags&(WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX));
|
153271
|
0 |
0 |
sqlite3_str_appendf(&str, "%s %S", isSearch ? "SEARCH" : "SCAN", pItem);
|
153272
|
0 |
0 |
if( (flags & (WHERE_IPK|WHERE_VIRTUALTABLE))==0 ){
|
153279
|
0 |
0 |
if( !HasRowid(pItem->pTab) && IsPrimaryKeyIndex(pIdx) ){
|
|
0 |
0 |
if( !HasRowid(pItem->pTab) && IsPrimaryKeyIndex(pIdx) ){
|
153280
|
0 |
0 |
if( isSearch ){
|
153283
|
0 |
0 |
}else if( flags & WHERE_PARTIALIDX ){
|
153285
|
0 |
0 |
}else if( flags & WHERE_AUTO_INDEX ){
|
153287
|
0 |
0 |
}else if( flags & WHERE_IDX_ONLY ){
|
153292
|
0 |
0 |
if( zFmt ){
|
153297
|
0 |
0 |
}else if( (flags & WHERE_IPK)!=0 && (flags & WHERE_CONSTRAINT)!=0 ){
|
|
0 |
0 |
}else if( (flags & WHERE_IPK)!=0 && (flags & WHERE_CONSTRAINT)!=0 ){
|
153307
|
0 |
0 |
if( flags&(WHERE_COLUMN_EQ|WHERE_COLUMN_IN) ){
|
153309
|
0 |
0 |
}else if( (flags&WHERE_BOTH_LIMIT)==WHERE_BOTH_LIMIT ){
|
153312
|
0 |
0 |
}else if( flags&WHERE_BTM_LIMIT ){
|
153321
|
0 |
0 |
else if( (flags & WHERE_VIRTUALTABLE)!=0 ){
|
153326
|
0 |
0 |
if( pItem->fg.jointype & JT_LEFT ){
|
153374
|
0 |
1 |
if( pLoop->wsFlags & WHERE_IPK ){
|
153376
|
0 |
0 |
if( pTab->iPKey>=0 ){
|
153382
|
1 |
1 |
for(i=pLoop->nSkip; i<pLoop->u.btree.nEq; i++){
|
153384
|
0 |
1 |
if( i>pLoop->nSkip ) sqlite3_str_append(&str, " AND ", 5);
|
153488
|
846 |
3 |
while( (pTerm->wtFlags & TERM_CODED)==0
|
153489
|
0 |
846 |
&& (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_OuterON))
|
|
0 |
0 |
&& (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_OuterON))
|
153490
|
846 |
0 |
&& (pLevel->notReady & pTerm->prereqAll)==0
|
153492
|
105 |
741 |
if( nLoop && (pTerm->wtFlags & TERM_LIKE)!=0 ){
|
|
0 |
105 |
if( nLoop && (pTerm->wtFlags & TERM_LIKE)!=0 ){
|
153503
|
720 |
126 |
if( pTerm->iParent<0 ) break;
|
153507
|
21 |
105 |
if( pTerm->nChild!=0 ) break;
|
153525
|
0 |
62 |
if( zAff==0 ){
|
153535
|
67 |
6 |
while( n>0 && zAff[0]<=SQLITE_AFF_BLOB ){
|
|
11 |
56 |
while( n>0 && zAff[0]<=SQLITE_AFF_BLOB ){
|
153540
|
2 |
62 |
while( n>1 && zAff[n-1]<=SQLITE_AFF_BLOB ){
|
|
2 |
0 |
while( n>1 && zAff[n-1]<=SQLITE_AFF_BLOB ){
|
153545
|
56 |
6 |
if( n>0 ){
|
153566
|
38 |
38 |
for(i=0; i<n; i++){
|
153568
|
38 |
0 |
if( sqlite3CompareAffinity(p, zAff[i])==SQLITE_AFF_BLOB
|
153569
|
2 |
36 |
|| sqlite3ExprNeedsNoAffinityChange(p, zAff[i])
|
153616
|
0 |
0 |
if( db->mallocFailed==0 ){
|
153617
|
0 |
0 |
for(pSelect=pNew->x.pSelect; pSelect; pSelect=pSelect->pPrior){
|
153628
|
0 |
0 |
if( pSelect==pNew->x.pSelect ){
|
153631
|
0 |
0 |
for(i=iEq; i<pLoop->nLTerm; i++){
|
153632
|
0 |
0 |
if( pLoop->aLTerm[i]->pExpr==pX ){
|
153636
|
0 |
0 |
if( pOrigRhs->a[iField].pExpr==0 ) continue; /* Duplicate PK column */
|
153639
|
0 |
0 |
if( pOrigLhs ){
|
153647
|
0 |
0 |
if( pOrigLhs ){
|
153652
|
0 |
0 |
if( pLhs && pLhs->nExpr==1 ){
|
|
0 |
0 |
if( pLhs && pLhs->nExpr==1 ){
|
153661
|
0 |
0 |
if( pSelect->pOrderBy ){
|
153670
|
0 |
0 |
for(i=0; i<pOrderBy->nExpr; i++){
|
153716
|
5 |
556 |
if( pX->op==TK_EQ || pX->op==TK_IS ){
|
|
0 |
5 |
if( pX->op==TK_EQ || pX->op==TK_IS ){
|
153718
|
2 |
3 |
}else if( pX->op==TK_ISNULL ){
|
153731
|
0 |
3 |
if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)==0
|
153732
|
0 |
0 |
&& pLoop->u.btree.pIndex!=0
|
153733
|
0 |
0 |
&& pLoop->u.btree.pIndex->aSortOrder[iEq]
|
153742
|
0 |
3 |
for(i=0; i<iEq; i++){
|
153743
|
0 |
0 |
if( pLoop->aLTerm[i] && pLoop->aLTerm[i]->pExpr==pX ){
|
|
0 |
0 |
if( pLoop->aLTerm[i] && pLoop->aLTerm[i]->pExpr==pX ){
|
153748
|
3 |
3 |
for(i=iEq;i<pLoop->nLTerm; i++){
|
153750
|
3 |
0 |
if( pLoop->aLTerm[i]->pExpr==pX ) nEq++;
|
153754
|
3 |
0 |
if( !ExprUseXSelect(pX) || pX->x.pSelect->pEList->nExpr==1 ){
|
|
3 |
0 |
if( !ExprUseXSelect(pX) || pX->x.pSelect->pEList->nExpr==1 ){
|
153758
|
0 |
0 |
if( pExpr->iTable==0 || !ExprHasProperty(pExpr, EP_Subrtn) ){
|
|
0 |
0 |
if( pExpr->iTable==0 || !ExprHasProperty(pExpr, EP_Subrtn) ){
|
153761
|
0 |
0 |
if( !db->mallocFailed ){
|
153775
|
0 |
3 |
if( eType==IN_INDEX_INDEX_DESC ){
|
153779
|
0 |
3 |
sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iTab, 0);
|
153785
|
3 |
0 |
if( pLevel->u.in.nIn==0 ){
|
153788
|
0 |
3 |
if( iEq>0 && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)==0 ){
|
|
0 |
0 |
if( iEq>0 && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)==0 ){
|
153799
|
3 |
0 |
if( pIn ){
|
153802
|
3 |
3 |
for(i=iEq;i<pLoop->nLTerm; i++){
|
153803
|
3 |
0 |
if( pLoop->aLTerm[i]->pExpr==pX ){
|
153805
|
0 |
3 |
if( eType==IN_INDEX_ROWID ){
|
153808
|
0 |
3 |
int iCol = aiMap ? aiMap[iMap++] : 0;
|
153812
|
3 |
0 |
if( i==iEq ){
|
153814
|
0 |
3 |
pIn->eEndLoopOp = bRev ? OP_Prev : OP_Next;
|
153815
|
0 |
3 |
if( iEq>0 ){
|
153830
|
0 |
3 |
if( iEq>0
|
153831
|
0 |
0 |
&& (pLoop->wsFlags & (WHERE_IN_SEEKSCAN|WHERE_VIRTUALTABLE))==0
|
153851
|
0 |
561 |
if( (pLevel->pWLoop->wsFlags & WHERE_TRANSCONS)==0
|
153852
|
0 |
0 |
|| (pTerm->eOperator & WO_EQUIV)==0
|
153940
|
0 |
44 |
if( nSkip ){
|
153943
|
0 |
0 |
sqlite3VdbeAddOp1(v, (bRev?OP_Last:OP_Rewind), iIdxCur);
|
153949
|
0 |
0 |
pLevel->addrSkip = sqlite3VdbeAddOp4Int(v, (bRev?OP_SeekLT:OP_SeekGT),
|
153954
|
0 |
0 |
for(j=0; j<nSkip; j++){
|
153964
|
31 |
44 |
for(j=nSkip; j<nEq; j++){
|
153973
|
0 |
31 |
if( r1!=regBase+j ){
|
153974
|
0 |
0 |
if( nReg==1 ){
|
153982
|
31 |
44 |
for(j=nSkip; j<nEq; j++){
|
153984
|
0 |
31 |
if( pTerm->eOperator & WO_IN ){
|
153985
|
0 |
0 |
if( pTerm->pExpr->flags & EP_xIsSelect ){
|
153990
|
0 |
0 |
if( zAff ) zAff[j] = SQLITE_AFF_BLOB;
|
153992
|
29 |
2 |
}else if( (pTerm->eOperator & WO_ISNULL)==0 ){
|
153994
|
29 |
0 |
if( (pTerm->wtFlags & TERM_IS)==0 && sqlite3ExprCanBeNull(pRight) ){
|
|
23 |
6 |
if( (pTerm->wtFlags & TERM_IS)==0 && sqlite3ExprCanBeNull(pRight) ){
|
153998
|
29 |
0 |
if( pParse->nErr==0 ){
|
154000
|
5 |
24 |
if( sqlite3CompareAffinity(pRight, zAff[j])==SQLITE_AFF_BLOB ){
|
154003
|
11 |
18 |
if( sqlite3ExprNeedsNoAffinityChange(pRight, zAff[j]) ){
|
154036
|
0 |
38 |
if( pTerm->wtFlags & TERM_LIKEOPT ){
|
154306
|
4 |
31 |
if( (pWInfo->wctrlFlags & (WHERE_OR_SUBCLAUSE|WHERE_RIGHT_JOIN))
|
154307
|
0 |
4 |
&& DbMaskAllZero(sqlite3ParseToplevel(pParse)->writeMask)
|
|
4 |
0 |
&& DbMaskAllZero(sqlite3ParseToplevel(pParse)->writeMask)
|
154312
|
4 |
0 |
if( ai ){
|
154314
|
4 |
4 |
for(i=0; i<pIdx->nColumn-1; i++){
|
154320
|
4 |
0 |
if( x1>=0 ) ai[x2+1] = i+1;
|
154338
|
172 |
6 |
if( p && sqlite3ExprIsVector(p) ){
|
|
0 |
172 |
if( p && sqlite3ExprIsVector(p) ){
|
154340
|
0 |
0 |
if( ExprUseXSelect(p) ){
|
154354
|
0 |
0 |
for(i=0; i<nReg; i++){
|
154378
|
0 |
0 |
while( pTruth->op==TK_AND ){
|
154382
|
0 |
0 |
for(i=0, pTerm=pWC->a; i<pWC->nTerm; i++, pTerm++){
|
154384
|
0 |
0 |
if( pTerm->wtFlags & TERM_CODED ) continue;
|
154386
|
0 |
0 |
if( sqlite3ExprCompare(0, pExpr, pTruth, iTabCur)==0 ){
|
154414
|
0 |
1 |
while( ++iLevel < pWInfo->nLevel ){
|
154417
|
0 |
0 |
if( pLevel->regFilter==0 ) continue;
|
154418
|
0 |
0 |
if( pLevel->pWLoop->nSkip ) continue;
|
154421
|
0 |
0 |
if( NEVER(pLoop->prereq & notReady) ) continue;
|
154424
|
0 |
0 |
if( pLoop->wsFlags & WHERE_IPK ){
|
154531
|
11 |
1720 |
if( pLevel->iFrom>0 && (pTabItem[0].fg.jointype & JT_LEFT)!=0 ){
|
|
3 |
8 |
if( pLevel->iFrom>0 && (pTabItem[0].fg.jointype & JT_LEFT)!=0 ){
|
154539
|
11 |
1728 |
for(j=iLevel; j>0; j--){
|
154540
|
3 |
8 |
if( pWInfo->a[j].iLeftJoin ) break;
|
154541
|
0 |
8 |
if( pWInfo->a[j].pRJ ) break;
|
154546
|
22 |
1709 |
if( pTabItem->fg.viaCoroutine ){
|
154556
|
148 |
1561 |
if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)!=0 ){
|
154566
|
143 |
148 |
for(j=0; j<nConstraint; j++){
|
154569
|
0 |
143 |
if( NEVER(pTerm==0) ) continue;
|
154570
|
3 |
140 |
if( pTerm->eOperator & WO_IN ){
|
154571
|
3 |
0 |
if( SMASKBIT32(j) & pLoop->u.vtab.mHandleIn ){
|
|
0 |
3 |
if( SMASKBIT32(j) & pLoop->u.vtab.mHandleIn ){
|
154583
|
0 |
140 |
if( pTerm->eMatchOp==SQLITE_INDEX_CONSTRAINT_OFFSET
|
154584
|
0 |
0 |
&& pLoop->u.vtab.bOmitOffset
|
154596
|
82 |
66 |
sqlite3VdbeAddOp4(v, OP_VFilter, iCur, addrNotFound, iReg,
|
154603
|
0 |
148 |
if( db->mallocFailed ) pLoop->u.vtab.idxStr = 0;
|
154605
|
0 |
148 |
pLevel->op = pWInfo->eOnePass ? OP_Noop : OP_VNext;
|
154609
|
143 |
148 |
for(j=0; j<nConstraint; j++){
|
154611
|
143 |
0 |
if( j<16 && (pLoop->u.vtab.omitMask>>j)&1 ){
|
|
143 |
0 |
if( j<16 && (pLoop->u.vtab.omitMask>>j)&1 ){
|
154615
|
0 |
0 |
if( (pTerm->eOperator & WO_IN)!=0
|
154616
|
0 |
0 |
&& (SMASKBIT32(j) & pLoop->u.vtab.mHandleIn)==0
|
|
0 |
0 |
&& (SMASKBIT32(j) & pLoop->u.vtab.mHandleIn)==0
|
154617
|
0 |
0 |
&& !db->mallocFailed
|
154629
|
0 |
0 |
for(iIn=0; ALWAYS(iIn<pLevel->u.in.nIn); iIn++){
|
154631
|
0 |
0 |
if( (pOp->opcode==OP_Column && pOp->p3==iReg+j+2)
|
|
0 |
0 |
if( (pOp->opcode==OP_Column && pOp->p3==iReg+j+2)
|
154632
|
0 |
0 |
|| (pOp->opcode==OP_Rowid && pOp->p2==iReg+j+2)
|
|
0 |
0 |
|| (pOp->opcode==OP_Rowid && pOp->p2==iReg+j+2)
|
154644
|
0 |
0 |
if( !db->mallocFailed ){
|
154648
|
0 |
0 |
if( iFld>0 ){
|
154657
|
0 |
0 |
if( pRight ){
|
154679
|
1515 |
46 |
if( (pLoop->wsFlags & WHERE_IPK)!=0
|
154680
|
527 |
988 |
&& (pLoop->wsFlags & (WHERE_COLUMN_IN|WHERE_COLUMN_EQ))!=0
|
154694
|
264 |
263 |
if( iRowidReg!=iReleaseReg ) sqlite3ReleaseTempReg(pParse, iReleaseReg);
|
154696
|
0 |
527 |
if( pLevel->regFilter ){
|
154707
|
988 |
46 |
}else if( (pLoop->wsFlags & WHERE_IPK)!=0
|
154708
|
0 |
988 |
&& (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0
|
154719
|
0 |
0 |
if( pLoop->wsFlags & WHERE_BTM_LIMIT ) pStart = pLoop->aLTerm[j++];
|
154720
|
0 |
0 |
if( pLoop->wsFlags & WHERE_TOP_LIMIT ) pEnd = pLoop->aLTerm[j++];
|
154722
|
0 |
0 |
if( bRev ){
|
154728
|
0 |
0 |
if( pStart ){
|
154751
|
0 |
0 |
if( sqlite3ExprIsVector(pX->pRight) ){
|
154776
|
0 |
0 |
sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iCur, addrHalt);
|
154780
|
0 |
0 |
if( pEnd ){
|
154789
|
0 |
0 |
if( 0==sqlite3ExprIsVector(pX->pRight)
|
154790
|
0 |
0 |
&& (pX->op==TK_LT || pX->op==TK_GT)
|
|
0 |
0 |
&& (pX->op==TK_LT || pX->op==TK_GT)
|
154792
|
0 |
0 |
testOp = bRev ? OP_Le : OP_Ge;
|
154794
|
0 |
0 |
testOp = bRev ? OP_Lt : OP_Gt;
|
154796
|
0 |
0 |
if( 0==sqlite3ExprIsVector(pX->pRight) ){
|
154801
|
0 |
0 |
pLevel->op = bRev ? OP_Prev : OP_Next;
|
154805
|
0 |
0 |
if( testOp!=OP_Noop ){
|
154815
|
44 |
990 |
}else if( pLoop->wsFlags & WHERE_INDEXED ){
|
154892
|
20 |
24 |
if( pLoop->wsFlags & WHERE_BTM_LIMIT ){
|
154899
|
18 |
26 |
if( pLoop->wsFlags & WHERE_TOP_LIMIT ){
|
154903
|
0 |
18 |
if( (pRangeEnd->wtFlags & TERM_LIKEOPT)!=0 ){
|
154919
|
0 |
18 |
if( pRangeStart==0 ){
|
154921
|
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 ){
|
154935
|
24 |
20 |
if( (pLoop->wsFlags & (WHERE_TOP_LIMIT|WHERE_BTM_LIMIT))==0
|
154936
|
0 |
24 |
&& (pLoop->wsFlags & WHERE_BIGNULL_SORT)!=0
|
154944
|
0 |
0 |
if( pLevel->iLeftJoin ){
|
154954
|
44 |
0 |
if( (nEq<pIdx->nColumn && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC)) ){
|
|
25 |
19 |
if( (nEq<pIdx->nColumn && bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC)) ){
|
154960
|
1 |
43 |
if( iLevel>0 && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)!=0 ){
|
|
0 |
1 |
if( iLevel>0 && (pLoop->wsFlags & WHERE_IN_SEEKSCAN)!=0 ){
|
154973
|
44 |
0 |
if( zStartAff && nTop ){
|
|
18 |
26 |
if( zStartAff && nTop ){
|
154976
|
0 |
44 |
addrNxt = (regBignull ? pLevel->addrBignull : pLevel->addrNxt);
|
154982
|
20 |
24 |
startEq = !pRangeStart || pRangeStart->eOperator & (WO_LE|WO_GE);
|
|
17 |
3 |
startEq = !pRangeStart || pRangeStart->eOperator & (WO_LE|WO_GE);
|
154983
|
18 |
26 |
endEq = !pRangeEnd || pRangeEnd->eOperator & (WO_LE|WO_GE);
|
|
17 |
1 |
endEq = !pRangeEnd || pRangeEnd->eOperator & (WO_LE|WO_GE);
|
154984
|
24 |
20 |
start_constraints = pRangeStart || nEq>0;
|
|
24 |
0 |
start_constraints = pRangeStart || nEq>0;
|
154988
|
20 |
24 |
if( pRangeStart ){
|
154992
|
19 |
1 |
if( (pRangeStart->wtFlags & TERM_VNULL)==0
|
154993
|
17 |
2 |
&& sqlite3ExprCanBeNull(pRight)
|
154998
|
20 |
0 |
if( zStartAff ){
|
155003
|
20 |
0 |
if( sqlite3ExprIsVector(pRight)==0 ){
|
155009
|
0 |
24 |
}else if( bSeekPastNull ){
|
155014
|
0 |
24 |
}else if( regBignull ){
|
155020
|
0 |
44 |
if( pLoop->nSkip>0 && nConstraint==pLoop->nSkip ){
|
|
0 |
0 |
if( pLoop->nSkip>0 && nConstraint==pLoop->nSkip ){
|
155025
|
0 |
44 |
if( regBignull ){
|
155029
|
1 |
43 |
if( pLevel->regFilter ){
|
155038
|
0 |
44 |
if( (pLoop->wsFlags & WHERE_IN_SEEKSCAN)!=0 && op==OP_SeekGE ){
|
|
0 |
0 |
if( (pLoop->wsFlags & WHERE_IN_SEEKSCAN)!=0 && op==OP_SeekGE ){
|
155050
|
0 |
0 |
if( pRangeStart || pRangeEnd ){
|
|
0 |
0 |
if( pRangeStart || pRangeEnd ){
|
155067
|
0 |
44 |
if( regBignull ){
|
155072
|
0 |
0 |
op = aStartOp[(nConstraint>1)*4 + 2 + bRev];
|
155089
|
18 |
26 |
if( pRangeEnd ){
|
155094
|
18 |
0 |
if( (pRangeEnd->wtFlags & TERM_VNULL)==0
|
155095
|
18 |
0 |
&& sqlite3ExprCanBeNull(pRight)
|
155100
|
18 |
0 |
if( zEndAff ){
|
155109
|
18 |
0 |
if( sqlite3ExprIsVector(pRight)==0 ){
|
155114
|
0 |
26 |
}else if( bStopAtNull ){
|
155115
|
0 |
0 |
if( regBignull==0 ){
|
155121
|
44 |
0 |
if( zStartAff ) sqlite3DbNNFreeNN(db, zStartAff);
|
155122
|
18 |
26 |
if( zEndAff ) sqlite3DbNNFreeNN(db, zEndAff);
|
155128
|
44 |
0 |
if( nConstraint ){
|
155129
|
0 |
44 |
if( regBignull ){
|
155141
|
0 |
44 |
if( addrSeekScan ) sqlite3VdbeJumpHere(v, addrSeekScan);
|
155143
|
0 |
44 |
if( regBignull ){
|
155161
|
0 |
44 |
if( (pLoop->wsFlags & WHERE_IN_EARLYOUT)!=0 ){
|
155167
|
13 |
31 |
&& (pWInfo->wctrlFlags & (WHERE_OR_SUBCLAUSE|WHERE_RIGHT_JOIN))==0;
|
|
9 |
4 |
&& (pWInfo->wctrlFlags & (WHERE_OR_SUBCLAUSE|WHERE_RIGHT_JOIN))==0;
|
155168
|
35 |
9 |
if( omitTable ){
|
155170
|
35 |
0 |
}else if( HasRowid(pIdx->pTable) ){
|
155172
|
0 |
0 |
}else if( iCur!=iIdxCur ){
|
155175
|
0 |
0 |
for(j=0; j<pPk->nKeyCol; j++){
|
155183
|
44 |
0 |
if( pLevel->iLeftJoin==0 ){
|
155191
|
0 |
44 |
if( pIdx->pPartIdxWhere ){
|
155203
|
6 |
38 |
if( pLoop->wsFlags & WHERE_ONEROW ){
|
155205
|
25 |
13 |
}else if( bRev ){
|
155212
|
0 |
44 |
if( (pLoop->wsFlags & WHERE_CONSTRAINT)==0 ){
|
155217
|
9 |
35 |
if( omitTable ) pIdx = 0;
|
155221
|
2 |
988 |
if( pLoop->wsFlags & WHERE_MULTI_OR ){
|
155292
|
0 |
2 |
if( pWInfo->nLevel>1 ){
|
155298
|
0 |
0 |
if( pOrTab==0 ) return notReady;
|
155303
|
0 |
0 |
for(k=1; k<=nNotReady; k++){
|
155322
|
2 |
0 |
if( (pWInfo->wctrlFlags & WHERE_DUPLICATES_OK)==0 ){
|
155323
|
2 |
0 |
if( HasRowid(pTab) ){
|
155364
|
1 |
1 |
if( pWC->nTerm>1 ){
|
155366
|
3 |
1 |
for(iTerm=0; iTerm<pWC->nTerm; iTerm++){
|
155368
|
1 |
2 |
if( &pWC->a[iTerm] == pTerm ) continue;
|
155372
|
1 |
1 |
if( (pWC->a[iTerm].wtFlags & (TERM_VIRTUAL|TERM_CODED|TERM_SLICE))!=0 ){
|
155375
|
0 |
1 |
if( (pWC->a[iTerm].eOperator & WO_ALL)==0 ) continue;
|
155376
|
0 |
1 |
if( ExprHasProperty(pExpr, EP_Subquery) ) continue; /* tag-20220303a */
|
155380
|
1 |
0 |
if( pAndExpr ){
|
155395
|
6 |
2 |
for(ii=0; ii<pOrWc->nTerm; ii++){
|
155397
|
5 |
1 |
if( pOrTerm->leftCursor==iCur || (pOrTerm->eOperator & WO_AND)!=0 ){
|
|
4 |
1 |
if( pOrTerm->leftCursor==iCur || (pOrTerm->eOperator & WO_AND)!=0 ){
|
155406
|
0 |
5 |
if( db->mallocFailed ){
|
155410
|
2 |
3 |
if( pAndExpr ){
|
155420
|
5 |
0 |
if( pSubWInfo ){
|
155432
|
5 |
0 |
if( (pWInfo->wctrlFlags & WHERE_DUPLICATES_OK)==0 ){
|
155433
|
3 |
2 |
int iSet = ((ii==pOrWc->nTerm-1)?-1:ii);
|
155434
|
5 |
0 |
if( HasRowid(pTab) ){
|
155447
|
0 |
0 |
for(iPk=0; iPk<nPk; iPk++){
|
155463
|
0 |
0 |
if( iSet ){
|
155467
|
0 |
0 |
if( iSet>=0 ){
|
155471
|
0 |
0 |
if( iSet ) sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT);
|
155484
|
5 |
0 |
if( jmp1 ) sqlite3VdbeJumpHere(v, jmp1);
|
155491
|
0 |
5 |
if( pSubWInfo->untestedTerms ) untestedTerms = 1;
|
155507
|
4 |
1 |
if( (pSubLoop->wsFlags & WHERE_INDEXED)!=0
|
155508
|
3 |
1 |
&& (ii==0 || pSubLoop->u.btree.pIndex==pCov)
|
|
1 |
2 |
&& (ii==0 || pSubLoop->u.btree.pIndex==pCov)
|
155509
|
0 |
2 |
&& (HasRowid(pTab) || !IsPrimaryKeyIndex(pSubLoop->u.btree.pIndex))
|
|
0 |
0 |
&& (HasRowid(pTab) || !IsPrimaryKeyIndex(pSubLoop->u.btree.pIndex))
|
155516
|
5 |
0 |
if( sqlite3WhereUsesDeferredSeek(pSubWInfo) ){
|
155532
|
0 |
2 |
if( pCov ) pLevel->iIdxCur = iCovCur;
|
155533
|
1 |
1 |
if( pAndExpr ){
|
155549
|
0 |
2 |
if( pWInfo->nLevel>1 ){ sqlite3DbFreeNN(db, pOrTab); }
|
155550
|
2 |
0 |
if( !untestedTerms ) disableTerm(pLevel, pTerm);
|
155561
|
0 |
988 |
if( pTabItem->fg.isRecursive ){
|
155594
|
35 |
1696 |
iLoop = (pIdx ? 1 : 2);
|
155597
|
1935 |
1733 |
for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){
|
155602
|
1045 |
890 |
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue;
|
155603
|
14 |
876 |
if( (pTerm->prereqAll & pLevel->notReady)!=0 ){
|
155611
|
5 |
871 |
if( pTabItem->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT) ){
|
155612
|
2 |
3 |
if( !ExprHasProperty(pE,EP_OuterON|EP_InnerON) ){
|
155616
|
3 |
0 |
}else if( (pTabItem->fg.jointype & JT_LEFT)==JT_LEFT
|
155617
|
0 |
3 |
&& !ExprHasProperty(pE,EP_OuterON) ){
|
155621
|
0 |
3 |
if( m & pLevel->notReady ){
|
155627
|
0 |
874 |
if( iLoop==1 && !sqlite3ExprCoveredByIndex(pE, pLevel->iTabCur, pIdx) ){
|
|
0 |
0 |
if( iLoop==1 && !sqlite3ExprCoveredByIndex(pE, pLevel->iTabCur, pIdx) ){
|
155631
|
872 |
2 |
if( iLoop<3 && (pTerm->wtFlags & TERM_VARSELECT) ){
|
|
2 |
870 |
if( iLoop<3 && (pTerm->wtFlags & TERM_VARSELECT) ){
|
155632
|
2 |
0 |
if( iNext==0 ) iNext = 3;
|
155636
|
0 |
872 |
if( (pTerm->wtFlags & TERM_LIKECOND)!=0 ){
|
155646
|
0 |
0 |
if( x>0 ){
|
155647
|
0 |
0 |
skipLikeAddr = sqlite3VdbeAddOp1(v, (x&1)?OP_IfNot:OP_If,(int)(x>>1));
|
155664
|
0 |
872 |
if( skipLikeAddr ) sqlite3VdbeJumpHere(v, skipLikeAddr);
|
155668
|
2 |
1731 |
}while( iLoop>0 );
|
155678
|
1629 |
1731 |
for(pTerm=pWC->a, j=pWC->nBase; j>0; j--, pTerm++){
|
155681
|
1613 |
16 |
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue;
|
155682
|
3 |
13 |
if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) continue;
|
155683
|
6 |
7 |
if( (pTerm->eOperator & WO_EQUIV)==0 ) continue;
|
155684
|
2 |
5 |
if( pTerm->leftCursor!=iCur ) continue;
|
155685
|
0 |
5 |
if( pTabItem->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT) ) continue;
|
155698
|
5 |
0 |
if( pAlt==0 ) continue;
|
155699
|
0 |
0 |
if( pAlt->wtFlags & (TERM_CODED) ) continue;
|
155700
|
0 |
0 |
if( (pAlt->eOperator & WO_IN)
|
155701
|
0 |
0 |
&& ExprUseXSelect(pAlt->pExpr)
|
155702
|
0 |
0 |
&& (pAlt->pExpr->x.pSelect->pEList->nExpr>1)
|
155719
|
0 |
1731 |
if( pLevel->pRJ ){
|
155732
|
0 |
0 |
if( HasRowid(pTab) ){
|
155741
|
0 |
0 |
for(iPk=0; iPk<nPk; iPk++){
|
155760
|
3 |
1728 |
if( pLevel->iLeftJoin ){
|
155764
|
3 |
0 |
if( pLevel->pRJ==0 ){
|
155769
|
0 |
1728 |
if( pLevel->pRJ ){
|
155788
|
6 |
3 |
for(pTerm=pWC->a, j=0; j<pWC->nBase; j++, pTerm++){
|
155791
|
4 |
2 |
if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue;
|
155792
|
0 |
2 |
if( (pTerm->prereqAll & pLevel->notReady)!=0 ){
|
155796
|
0 |
2 |
if( pTabItem->fg.jointype & JT_LTORJ ) continue;
|
155841
|
0 |
0 |
for(k=0; k<iLevel; k++){
|
155846
|
0 |
0 |
if( iIdxCur ){
|
155850
|
0 |
0 |
if( (pTabItem->fg.jointype & JT_LTORJ)==0 ){
|
155852
|
0 |
0 |
for(k=0; k<pWC->nTerm; k++){
|
155854
|
0 |
0 |
if( (pTerm->wtFlags & (TERM_VIRTUAL|TERM_SLICE))!=0
|
155855
|
0 |
0 |
&& pTerm->eOperator!=WO_ROWVAL
|
155859
|
0 |
0 |
if( pTerm->prereqAll & ~mAll ) continue;
|
155860
|
0 |
0 |
if( ExprHasProperty(pTerm->pExpr, EP_OuterON|EP_InnerON) ) continue;
|
155873
|
0 |
0 |
if( pSubWInfo ){
|
155880
|
0 |
0 |
if( HasRowid(pTab) ){
|
155888
|
0 |
0 |
for(iPk=0; iPk<nPk; iPk++){
|
155972
|
0 |
2080 |
if( pWC->nTerm>=pWC->nSlot ){
|
155976
|
0 |
0 |
if( pWC->a==0 ){
|
155977
|
0 |
0 |
if( wtFlags & TERM_DYNAMIC ){
|
155987
|
1688 |
392 |
if( (wtFlags & TERM_VIRTUAL)==0 ) pWC->nBase = pWC->nTerm;
|
155988
|
2080 |
0 |
if( p && ExprHasProperty(p, EP_Unlikely) ){
|
|
0 |
2080 |
if( p && ExprHasProperty(p, EP_Unlikely) ){
|
156012
|
1969 |
19 |
return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS;
|
|
1632 |
337 |
return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL || op==TK_IS;
|
|
226 |
1406 |
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;
|
156020
|
19 |
0 |
if( pExpr->pLeft->op==TK_VECTOR
|
156021
|
19 |
0 |
|| pExpr->pRight->op==TK_VECTOR
|
156022
|
0 |
19 |
|| sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, pExpr->pRight) !=
|
156028
|
8 |
11 |
if( pExpr->op>=TK_GT ){
|
156045
|
19 |
1318 |
if( op==TK_IN ){
|
156047
|
22 |
1296 |
}else if( op==TK_ISNULL ){
|
156049
|
2 |
1294 |
}else if( op==TK_IS ){
|
156098
|
99 |
119 |
if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, (char*)wc) ){
|
156110
|
0 |
119 |
if( op==TK_VARIABLE && (db->flags & SQLITE_EnableQPSG)==0 ){
|
|
0 |
0 |
if( op==TK_VARIABLE && (db->flags & SQLITE_EnableQPSG)==0 ){
|
156114
|
0 |
0 |
if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
|
|
0 |
0 |
if( pVal && sqlite3_value_type(pVal)==SQLITE_TEXT ){
|
156119
|
119 |
0 |
}else if( op==TK_STRING ){
|
156123
|
119 |
0 |
if( z ){
|
156127
|
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] ){
|
156129
|
0 |
366 |
if( c==wc[3] && z[cnt]!=0 ) cnt++;
|
|
0 |
0 |
if( c==wc[3] && z[cnt]!=0 ) cnt++;
|
156140
|
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]) ){
|
156144
|
6 |
111 |
*pisComplete = c==wc[0] && z[cnt+1]==0;
|
|
6 |
0 |
*pisComplete = c==wc[0] && z[cnt+1]==0;
|
156148
|
117 |
0 |
if( pPrefix ){
|
156154
|
366 |
117 |
for(iFrom=iTo=0; iFrom<cnt; iFrom++){
|
156155
|
0 |
366 |
if( zNew[iFrom]==wc[3] ) iFrom++;
|
156174
|
66 |
51 |
if( pLeft->op!=TK_COLUMN
|
156175
|
63 |
3 |
|| sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT
|
156176
|
63 |
0 |
|| (ALWAYS( ExprUseYTab(pLeft) )
|
156177
|
63 |
0 |
&& ALWAYS(pLeft->y.pTab)
|
156178
|
0 |
63 |
&& IsVirtual(pLeft->y.pTab)) /* Might be numeric */
|
156183
|
54 |
0 |
if( isNum<=0 ){
|
156184
|
2 |
52 |
if( iTo==1 && zNew[0]=='-' ){
|
|
0 |
2 |
if( iTo==1 && zNew[0]=='-' ){
|
156192
|
0 |
54 |
if( isNum>0 ){
|
156203
|
0 |
117 |
if( op==TK_VARIABLE ){
|
156207
|
0 |
0 |
if( *pisComplete && pRight->u.zToken[1] ){
|
|
0 |
0 |
if( *pisComplete && pRight->u.zToken[1] ){
|
156266
|
218 |
1728 |
if( pExpr->op==TK_FUNCTION ){
|
156282
|
218 |
0 |
if( pList==0 || pList->nExpr!=2 ){
|
|
0 |
218 |
if( pList==0 || pList->nExpr!=2 ){
|
156295
|
167 |
51 |
if( ExprIsVtab(pCol) ){
|
|
85 |
82 |
if( ExprIsVtab(pCol) ){
|
156296
|
92 |
0 |
for(i=0; i<ArraySize(aOp); i++){
|
156298
|
85 |
7 |
if( sqlite3StrICmp(pExpr->u.zToken, aOp[i].zOp)==0 ){
|
156320
|
0 |
133 |
if( ExprIsVtab(pCol) ){
|
|
0 |
0 |
if( ExprIsVtab(pCol) ){
|
156330
|
0 |
0 |
if( pMod->xFindFunction!=0 ){
|
156332
|
0 |
0 |
if( i>=SQLITE_INDEX_CONSTRAINT_FUNCTION ){
|
156340
|
1489 |
239 |
}else if( pExpr->op==TK_NE || pExpr->op==TK_ISNOT || pExpr->op==TK_NOTNULL ){
|
|
1486 |
3 |
}else if( pExpr->op==TK_NE || pExpr->op==TK_ISNOT || pExpr->op==TK_NOTNULL ){
|
|
14 |
1472 |
}else if( pExpr->op==TK_NE || pExpr->op==TK_ISNOT || pExpr->op==TK_NOTNULL ){
|
156345
|
256 |
0 |
if( ExprIsVtab(pLeft) ){
|
|
4 |
252 |
if( ExprIsVtab(pLeft) ){
|
156350
|
242 |
14 |
if( pRight && ExprIsVtab(pRight) ){
|
|
0 |
242 |
if( pRight && ExprIsVtab(pRight) ){
|
|
0 |
0 |
if( pRight && ExprIsVtab(pRight) ){
|
156356
|
239 |
17 |
if( pExpr->op==TK_NE ) *peOp2 = SQLITE_INDEX_CONSTRAINT_NE;
|
156357
|
3 |
253 |
if( pExpr->op==TK_ISNOT ) *peOp2 = SQLITE_INDEX_CONSTRAINT_ISNOT;
|
156358
|
14 |
242 |
if( pExpr->op==TK_NOTNULL ) *peOp2 = SQLITE_INDEX_CONSTRAINT_ISNOTNULL;
|
156370
|
270 |
0 |
if( pDerived && ExprHasProperty(pBase, EP_OuterON|EP_InnerON) ){
|
|
0 |
270 |
if( pDerived && ExprHasProperty(pBase, EP_OuterON|EP_InnerON) ){
|
156391
|
0 |
0 |
if( pTerm->eOperator!=WO_AND ){
|
156392
|
0 |
0 |
return N==0 ? pTerm : 0;
|
156394
|
0 |
0 |
if( N<pTerm->u.pAndInfo->wc.nTerm ){
|
156432
|
0 |
0 |
if( (pOne->wtFlags | pTwo->wtFlags) & TERM_VNULL ) return;
|
156433
|
0 |
0 |
if( (pOne->eOperator & (WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE))==0 ) return;
|
156434
|
0 |
0 |
if( (pTwo->eOperator & (WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE))==0 ) return;
|
156435
|
0 |
0 |
if( (eOp & (WO_EQ|WO_LT|WO_LE))!=eOp
|
156436
|
0 |
0 |
&& (eOp & (WO_EQ|WO_GT|WO_GE))!=eOp ) return;
|
156439
|
0 |
0 |
if( sqlite3ExprCompare(0,pOne->pExpr->pLeft, pTwo->pExpr->pLeft, -1) ) return;
|
156440
|
0 |
0 |
if( sqlite3ExprCompare(0,pOne->pExpr->pRight, pTwo->pExpr->pRight,-1) )return;
|
156442
|
0 |
0 |
if( (eOp & (eOp-1))!=0 ){
|
156443
|
0 |
0 |
if( eOp & (WO_LT|WO_LE) ){
|
156452
|
0 |
0 |
if( pNew==0 ) return;
|
156453
|
0 |
0 |
for(op=TK_EQ; eOp!=(WO_EQ<<(op-TK_EQ)); op++){ assert( op<TK_GE ); }
|
156572
|
0 |
5 |
if( pOrInfo==0 ) return;
|
156579
|
0 |
5 |
if( db->mallocFailed ) return;
|
156587
|
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++){
|
156588
|
9 |
6 |
if( (pOrTerm->eOperator & WO_SINGLE)==0 ){
|
156593
|
9 |
0 |
if( pAndInfo ){
|
156608
|
9 |
0 |
if( !db->mallocFailed ){
|
156609
|
30 |
9 |
for(j=0, pAndTerm=pAndWC->a; j<pAndWC->nTerm; j++, pAndTerm++){
|
156611
|
8 |
22 |
if( allowedOp(pAndTerm->pExpr->op)
|
156612
|
0 |
8 |
|| pAndTerm->eOperator==WO_AUX
|
156620
|
3 |
3 |
}else if( pOrTerm->wtFlags & TERM_COPIED ){
|
156626
|
3 |
0 |
if( pOrTerm->wtFlags & TERM_VIRTUAL ){
|
156631
|
0 |
3 |
if( (pOrTerm->eOperator & WO_EQ)==0 ){
|
156646
|
5 |
0 |
if( indexable ){
|
156652
|
5 |
0 |
if( indexable && pOrWc->nTerm==2 ){
|
|
0 |
5 |
if( indexable && pOrWc->nTerm==2 ){
|
156655
|
0 |
0 |
while( (pOne = whereNthSubterm(&pOrWc->a[0],iOne++))!=0 ){
|
156658
|
0 |
0 |
while( (pTwo = whereNthSubterm(&pOrWc->a[1],iTwo++))!=0 ){
|
156685
|
0 |
5 |
if( chngToIN ){
|
156697
|
0 |
0 |
for(j=0; j<2 && !okToChngToIN; j++){
|
|
0 |
0 |
for(j=0; j<2 && !okToChngToIN; j++){
|
156700
|
0 |
0 |
for(i=pOrWc->nTerm-1; i>=0; i--, pOrTerm++){
|
156703
|
0 |
0 |
if( pOrTerm->leftCursor==iCursor ){
|
156709
|
0 |
0 |
if( (chngToIN & sqlite3WhereGetMask(&pWInfo->sMaskSet,
|
156726
|
0 |
0 |
if( i<0 ){
|
156739
|
0 |
0 |
for(; i>=0 && okToChngToIN; i--, pOrTerm++){
|
|
0 |
0 |
for(; i>=0 && okToChngToIN; i--, pOrTerm++){
|
156742
|
0 |
0 |
if( pOrTerm->leftCursor!=iCursor ){
|
156744
|
0 |
0 |
}else if( pOrTerm->u.x.leftColumn!=iColumn || (iColumn==XN_EXPR
|
|
0 |
0 |
}else if( pOrTerm->u.x.leftColumn!=iColumn || (iColumn==XN_EXPR
|
156745
|
0 |
0 |
&& sqlite3ExprCompare(pParse, pOrTerm->pExpr->pLeft, pLeft, -1)
|
156756
|
0 |
0 |
if( affRight!=0 && affRight!=affLeft ){
|
|
0 |
0 |
if( affRight!=0 && affRight!=affLeft ){
|
156769
|
0 |
0 |
if( okToChngToIN ){
|
156775
|
0 |
0 |
for(i=pOrWc->nTerm-1, pOrTerm=pOrWc->a; i>=0; i--, pOrTerm++){
|
156776
|
0 |
0 |
if( (pOrTerm->wtFlags & TERM_OK)==0 ) continue;
|
156788
|
0 |
0 |
if( pNew ){
|
156824
|
0 |
19 |
if( !OptimizationEnabled(pParse->db, SQLITE_Transitive) ) return 0;
|
156825
|
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;
|
156826
|
0 |
11 |
if( ExprHasProperty(pExpr, EP_OuterON) ) return 0;
|
156829
|
0 |
11 |
if( aff1!=aff2
|
156830
|
0 |
0 |
&& (!sqlite3IsNumericAffinity(aff1) || !sqlite3IsNumericAffinity(aff2))
|
|
0 |
0 |
&& (!sqlite3IsNumericAffinity(aff1) || !sqlite3IsNumericAffinity(aff2))
|
156835
|
11 |
0 |
if( sqlite3IsBinary(pColl) ) return 1;
|
156846
|
5 |
10 |
while( pS ){
|
156853
|
5 |
0 |
if( ALWAYS(pSrc!=0) ){
|
156855
|
5 |
5 |
for(i=0; i<pSrc->nSrc; i++){
|
156857
|
5 |
0 |
if( pSrc->a[i].fg.isUsing==0 ){
|
156860
|
0 |
5 |
if( pSrc->a[i].fg.isTabFunc ){
|
156894
|
0 |
0 |
for(pIdx=pFrom->a[j].pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
156895
|
0 |
0 |
if( pIdx->aColExpr==0 ) continue;
|
156896
|
0 |
0 |
for(i=0; i<pIdx->nKeyCol; i++){
|
156897
|
0 |
0 |
if( pIdx->aiColumn[i]!=XN_EXPR ) continue;
|
156899
|
0 |
0 |
if( sqlite3ExprCompareSkip(pExpr,pIdx->aColExpr->a[i].pExpr,iCur)==0
|
156900
|
0 |
0 |
&& pExpr->op!=TK_STRING
|
156908
|
0 |
0 |
}while( ++j < pFrom->nSrc );
|
156925
|
0 |
2829 |
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)) ){
|
156930
|
1337 |
1492 |
if( pExpr->op==TK_COLUMN ){
|
156936
|
1327 |
1492 |
for(i=0; i<pFrom->nSrc; i++){
|
156938
|
91 |
1327 |
for(pIdx=pFrom->a[i].pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
156939
|
0 |
91 |
if( pIdx->aColExpr ){
|
156987
|
0 |
1958 |
if( db->mallocFailed ){
|
156999
|
19 |
1939 |
if( op==TK_IN ){
|
157001
|
0 |
19 |
if( sqlite3ExprCheckIN(pParse, pExpr) ) return;
|
157002
|
3 |
16 |
if( ExprUseXSelect(pExpr) ){
|
157010
|
1716 |
223 |
if( pExpr->pLeft==0
|
157011
|
1716 |
0 |
|| ExprHasProperty(pExpr, EP_xIsSelect|EP_IfNullRow)
|
157012
|
18 |
1698 |
|| pExpr->x.pList!=0
|
157019
|
2 |
1956 |
if( pMaskSet->bVarSelect ) pTerm->wtFlags |= TERM_VARSELECT;
|
157029
|
8 |
1950 |
if( ExprHasProperty(pExpr, EP_OuterON|EP_InnerON) ){
|
157031
|
3 |
5 |
if( ExprHasProperty(pExpr, EP_OuterON) ){
|
157035
|
0 |
3 |
if( (prereqAll>>1)>=x ){
|
157039
|
0 |
5 |
}else if( (prereqAll>>1)>=x ){
|
157046
|
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 ){
|
157057
|
1435 |
523 |
if( allowedOp(op) ){
|
157061
|
1435 |
0 |
u16 opMask = (pTerm->prereqRight & prereqLeft)==0 ? WO_ALL : WO_EQUIV;
|
157063
|
0 |
1435 |
if( pTerm->u.x.iField>0 ){
|
157070
|
1318 |
117 |
if( exprMightBeIndexed(pSrc, aiCurCol, pLeft, op) ){
|
157076
|
2 |
1433 |
if( op==TK_IS ) pTerm->wtFlags |= TERM_IS;
|
157077
|
1394 |
41 |
if( pRight
|
157078
|
19 |
1375 |
&& exprMightBeIndexed(pSrc, aiCurCol, pRight, op)
|
157079
|
19 |
0 |
&& !ExprHasProperty(pRight, EP_FixedCol)
|
157085
|
19 |
0 |
if( pTerm->leftCursor>=0 ){
|
157088
|
0 |
19 |
if( db->mallocFailed ){
|
157093
|
0 |
19 |
if( idxNew==0 ) return;
|
157096
|
0 |
19 |
if( op==TK_IS ) pNew->wtFlags |= TERM_IS;
|
157100
|
11 |
8 |
if( termIsEquivalence(pParse, pDup) ){
|
157117
|
22 |
1394 |
if( op==TK_ISNULL
|
157118
|
22 |
0 |
&& !ExprHasProperty(pExpr,EP_OuterON)
|
157119
|
0 |
22 |
&& 0==sqlite3ExprCanBeNull(pLeft)
|
157146
|
18 |
505 |
else if( pExpr->op==TK_BETWEEN && pWC->op==TK_AND ){
|
|
18 |
0 |
else if( pExpr->op==TK_BETWEEN && pWC->op==TK_AND ){
|
157154
|
36 |
18 |
for(i=0; i<2; i++){
|
157174
|
5 |
500 |
else if( pExpr->op==TK_OR ){
|
157186
|
14 |
486 |
else if( pExpr->op==TK_NOTNULL ){
|
157187
|
14 |
0 |
if( pExpr->pLeft->op==TK_COLUMN
|
157188
|
14 |
0 |
&& pExpr->pLeft->iColumn>=0
|
157189
|
14 |
0 |
&& !ExprHasProperty(pExpr, EP_OuterON)
|
157202
|
14 |
0 |
if( idxNew ){
|
157231
|
218 |
268 |
else if( pExpr->op==TK_FUNCTION
|
157232
|
218 |
0 |
&& pWC->op==TK_AND
|
157233
|
117 |
101 |
&& isLikeOrGlob(pParse, pExpr, &pStr1, &isComplete, &noCase)
|
157255
|
117 |
0 |
if( noCase && !pParse->db->mallocFailed ){
|
|
117 |
0 |
if( noCase && !pParse->db->mallocFailed ){
|
157259
|
366 |
117 |
for(i=0; (c = pStr1->u.zToken[i])!=0; i++){
|
157265
|
117 |
0 |
if( !db->mallocFailed ){
|
157269
|
117 |
0 |
if( noCase ){
|
157276
|
0 |
117 |
if( c=='A'-1 ) isComplete = 0;
|
157281
|
117 |
0 |
zCollSeqName = noCase ? "NOCASE" : sqlite3StrBINARY;
|
157299
|
6 |
111 |
if( isComplete ){
|
157316
|
887 |
1071 |
if( (pExpr->op==TK_EQ || pExpr->op==TK_IS)
|
|
2 |
885 |
if( (pExpr->op==TK_EQ || pExpr->op==TK_IS)
|
157317
|
0 |
1073 |
&& (nLeft = sqlite3ExprVectorSize(pExpr->pLeft))>1
|
157318
|
0 |
0 |
&& sqlite3ExprVectorSize(pExpr->pRight)==nLeft
|
157319
|
0 |
0 |
&& ( (pExpr->pLeft->flags & EP_xIsSelect)==0
|
157320
|
0 |
0 |
|| (pExpr->pRight->flags & EP_xIsSelect)==0)
|
157321
|
0 |
0 |
&& pWC->op==TK_AND
|
157324
|
0 |
0 |
for(i=0; i<nLeft; i++){
|
157349
|
19 |
1939 |
else if( pExpr->op==TK_IN
|
157350
|
19 |
0 |
&& pTerm->u.x.iField==0
|
157351
|
0 |
19 |
&& pExpr->pLeft->op==TK_VECTOR
|
157352
|
0 |
0 |
&& ALWAYS( ExprUseXSelect(pExpr) )
|
157353
|
0 |
0 |
&& (pExpr->x.pSelect->pPrior==0 || (pExpr->x.pSelect->selFlags & SF_Values))
|
|
0 |
0 |
&& (pExpr->x.pSelect->pPrior==0 || (pExpr->x.pSelect->selFlags & SF_Values))
|
157355
|
0 |
0 |
&& pExpr->x.pSelect->pWin==0
|
157357
|
0 |
0 |
&& pWC->op==TK_AND
|
157360
|
0 |
0 |
for(i=0; i<sqlite3ExprVectorSize(pExpr->pLeft); i++){
|
157379
|
1946 |
12 |
else if( pWC->op==TK_AND ){
|
157382
|
89 |
1946 |
while( res-- > 0 ){
|
157389
|
89 |
0 |
if( (prereqExpr & prereqColumn)==0 ){
|
157393
|
0 |
89 |
if( ExprHasProperty(pExpr, EP_OuterON) && pNewExpr ){
|
|
0 |
0 |
if( ExprHasProperty(pExpr, EP_OuterON) && pNewExpr ){
|
157449
|
932 |
2064 |
if( pE2==0 ) return;
|
157450
|
1688 |
376 |
if( pE2->op!=op ){
|
157481
|
0 |
0 |
if( sqlite3ExprIsInteger(pExpr, &iVal) && iVal>=0 ){
|
|
0 |
0 |
if( sqlite3ExprIsInteger(pExpr, &iVal) && iVal>=0 ){
|
157483
|
0 |
0 |
if( pVal==0 ) return;
|
157489
|
0 |
0 |
if( pVal==0 ) return;
|
157493
|
0 |
0 |
if( pNew ){
|
157524
|
19 |
1 |
if( p->pGroupBy==0
|
157525
|
1 |
18 |
&& (p->selFlags & (SF_Distinct|SF_Aggregate))==0 /* 2 */
|
157526
|
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 */
|
157533
|
0 |
0 |
for(ii=0; ii<pWC->nTerm; ii++){
|
157534
|
0 |
0 |
if( pWC->a[ii].wtFlags & TERM_CODED ){
|
157541
|
0 |
0 |
if( pWC->a[ii].nChild ){
|
157548
|
0 |
0 |
if( pWC->a[ii].leftCursor!=iCsr ) return;
|
157552
|
0 |
0 |
if( pOrderBy ){
|
157553
|
0 |
0 |
for(ii=0; ii<pOrderBy->nExpr; ii++){
|
157555
|
0 |
0 |
if( pExpr->op!=TK_COLUMN ) return;
|
157556
|
0 |
0 |
if( pExpr->iTable!=iCsr ) return;
|
157557
|
0 |
0 |
if( pOrderBy->a[ii].fg.sortFlags & KEYINFO_ORDER_BIGNULL ) return;
|
157565
|
0 |
0 |
if( p->iOffset>0 ){
|
157596
|
1312 |
932 |
if( pWC->nTerm>0 ){
|
157608
|
392 |
1688 |
if( a->wtFlags & TERM_DYNAMIC ){
|
157611
|
14 |
2066 |
if( a->wtFlags & (TERM_ORINFO|TERM_ANDINFO) ){
|
157612
|
5 |
9 |
if( a->wtFlags & TERM_ORINFO ){
|
157620
|
1312 |
768 |
if( a==aLast ) break;
|
157663
|
0 |
1308 |
mask = (p->op==TK_IF_NULL_ROW) ? sqlite3WhereGetMask(pMaskSet, p->iTable) : 0;
|
157664
|
556 |
752 |
if( p->pLeft ) mask |= sqlite3WhereExprUsageNN(pMaskSet, p->pLeft);
|
157665
|
66 |
1242 |
if( p->pRight ){
|
157668
|
2 |
1240 |
}else if( ExprUseXSelect(p) ){
|
157669
|
2 |
0 |
if( ExprHasProperty(p, EP_VarSelect) ) pMaskSet->bVarSelect = 1;
|
157671
|
258 |
982 |
}else if( p->x.pList ){
|
157675
|
1068 |
240 |
if( (p->op==TK_FUNCTION || p->op==TK_AGG_FUNCTION) && ExprUseYWin(p) ){
|
|
2 |
1066 |
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) ){
|
157685
|
2033 |
2964 |
if( p->op==TK_COLUMN && !ExprHasProperty(p, EP_FixedCol) ){
|
|
2033 |
0 |
if( p->op==TK_COLUMN && !ExprHasProperty(p, EP_FixedCol) ){
|
157687
|
1656 |
1308 |
}else if( ExprHasProperty(p, EP_TokenOnly|EP_Leaf) ){
|
157694
|
4134 |
527 |
return p ? sqlite3WhereExprUsageNN(pMaskSet,p) : 0;
|
157699
|
297 |
10 |
if( pList ){
|
157700
|
569 |
297 |
for(i=0; i<pList->nExpr; i++){
|
157721
|
1688 |
2244 |
for(i=pWC->nTerm-1; i>=0; i--){
|
157743
|
1731 |
0 |
if( pItem->fg.isTabFunc==0 ) return;
|
157747
|
0 |
0 |
if( pArgs==0 ) return;
|
157748
|
0 |
0 |
for(j=k=0; j<pArgs->nExpr; j++){
|
157751
|
0 |
0 |
while( k<pTab->nCol && (pTab->aCol[k].colFlags & COLFLAG_HIDDEN)==0 ){k++;}
|
|
0 |
0 |
while( k<pTab->nCol && (pTab->aCol[k].colFlags & COLFLAG_HIDDEN)==0 ){k++;}
|
157752
|
0 |
0 |
if( k>=pTab->nCol ){
|
157758
|
0 |
0 |
if( pColRef==0 ) return;
|
157767
|
0 |
0 |
if( pItem->fg.jointype & (JT_LEFT|JT_RIGHT) ){
|
157879
|
606 |
0 |
if( !pWInfo->bOrderedInnerLoop ){
|
157886
|
0 |
0 |
return pInner->pRJ ? pWInfo->iContinue : pInner->addrNxt;
|
157903
|
0 |
16 |
if( !pWInfo->bOrderedInnerLoop ) return;
|
157904
|
0 |
16 |
if( pWInfo->nOBSat==0 ) return;
|
157905
|
16 |
16 |
for(i=pWInfo->nLevel-1; i>=0; i--){
|
157907
|
0 |
16 |
if( (pInner->pWLoop->wsFlags & WHERE_COLUMN_IN)!=0 ){
|
157992
|
11 |
11 |
for(i=pSet->n, p=pSet->a; i>0; i--, p++){
|
157993
|
10 |
1 |
if( rRun<=p->rRun && (prereq & p->prereq)==prereq ){
|
|
10 |
0 |
if( rRun<=p->rRun && (prereq & p->prereq)==prereq ){
|
157996
|
1 |
0 |
if( p->rRun<=rRun && (p->prereq & prereq)==p->prereq ){
|
|
1 |
0 |
if( p->rRun<=rRun && (p->prereq & prereq)==p->prereq ){
|
158000
|
11 |
0 |
if( pSet->n<N_OR_COST ){
|
158005
|
0 |
0 |
for(i=1; i<pSet->n; i++){
|
158006
|
0 |
0 |
if( p->rRun>pSet->a[i].rRun ) p = pSet->a + i;
|
158008
|
0 |
0 |
if( p->rRun<=rRun ) return 0;
|
158013
|
10 |
11 |
if( p->nOut>nOut ) p->nOut = nOut;
|
158026
|
4861 |
146 |
if( pMaskSet->ix[0]==iCursor ){
|
158029
|
61 |
85 |
for(i=1; i<pMaskSet->n; i++){
|
158030
|
61 |
0 |
if( pMaskSet->ix[i]==iCursor ){
|
158042
|
3 |
0 |
if( pBlock ){
|
158052
|
3 |
0 |
if( pNew && pOld ){
|
|
0 |
3 |
if( pNew && pOld ){
|
158080
|
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) ){
|
158107
|
5293 |
3849 |
for(pTerm=pWC->a+k; k<pWC->nTerm; k++, pTerm++){
|
158109
|
3477 |
1816 |
if( pTerm->leftCursor==iCur
|
158110
|
969 |
2508 |
&& pTerm->u.x.leftColumn==iColumn
|
158111
|
0 |
969 |
&& (iColumn!=XN_EXPR
|
158112
|
0 |
0 |
|| sqlite3ExprCompareSkip(pTerm->pExpr->pLeft,
|
158114
|
11 |
958 |
&& (pScan->iEquiv<=1 || !ExprHasProperty(pTerm->pExpr, EP_OuterON))
|
|
11 |
0 |
&& (pScan->iEquiv<=1 || !ExprHasProperty(pTerm->pExpr, EP_OuterON))
|
158116
|
24 |
945 |
if( (pTerm->eOperator & WO_EQUIV)!=0
|
158117
|
24 |
0 |
&& pScan->nEquiv<ArraySize(pScan->aiCur)
|
158118
|
24 |
0 |
&& (pX = whereRightSubexprIsColumn(pTerm->pExpr))!=0
|
158121
|
24 |
13 |
for(j=0; j<pScan->nEquiv; j++){
|
158122
|
11 |
13 |
if( pScan->aiCur[j]==pX->iTable
|
158123
|
11 |
0 |
&& pScan->aiColumn[j]==pX->iColumn ){
|
158127
|
13 |
11 |
if( j==pScan->nEquiv ){
|
158133
|
674 |
295 |
if( (pTerm->eOperator & pScan->opMask)!=0 ){
|
158135
|
109 |
565 |
if( pScan->zCollName && (pTerm->eOperator & WO_ISNULL)==0 ){
|
|
104 |
5 |
if( pScan->zCollName && (pTerm->eOperator & WO_ISNULL)==0 ){
|
158139
|
0 |
104 |
if( !sqlite3IndexAffinityOk(pX, pScan->idxaff) ){
|
158144
|
0 |
104 |
if( pColl==0 ) pColl = pParse->db->pDfltColl;
|
158145
|
0 |
104 |
if( sqlite3StrICmp(pColl->zName, pScan->zCollName) ){
|
158149
|
598 |
76 |
if( (pTerm->eOperator & (WO_EQ|WO_IS))!=0
|
158150
|
598 |
0 |
&& (pX = pTerm->pExpr->pRight, ALWAYS(pX!=0))
|
158151
|
24 |
574 |
&& pX->op==TK_COLUMN
|
158152
|
11 |
13 |
&& pX->iTable==pScan->aiCur[0]
|
158153
|
11 |
0 |
&& pX->iColumn==pScan->aiColumn[0]
|
158178
|
43 |
3806 |
}while( pWC!=0 );
|
158179
|
3793 |
13 |
if( pScan->iEquiv>=pScan->nEquiv ) break;
|
158235
|
1267 |
3078 |
if( pIdx ){
|
158238
|
995 |
272 |
if( iColumn==pIdx->pTable->iPKey ){
|
158240
|
184 |
88 |
}else if( iColumn>=0 ){
|
158243
|
0 |
88 |
}else if( iColumn==XN_EXPR ){
|
158249
|
0 |
3078 |
}else if( iColumn==XN_EXPR ){
|
158295
|
14 |
1504 |
while( p ){
|
158296
|
6 |
8 |
if( (p->prereqRight & notReady)==0 ){
|
158297
|
6 |
0 |
if( p->prereqRight==0 && (p->eOperator&op)!=0 ){
|
|
6 |
0 |
if( p->prereqRight==0 && (p->eOperator&op)!=0 ){
|
158301
|
0 |
0 |
if( pResult==0 ) pResult = p;
|
158325
|
0 |
0 |
for(i=0; i<pList->nExpr; i++){
|
158327
|
0 |
0 |
if( ALWAYS(p!=0)
|
158328
|
0 |
0 |
&& (p->op==TK_COLUMN || p->op==TK_AGG_COLUMN)
|
|
0 |
0 |
&& (p->op==TK_COLUMN || p->op==TK_AGG_COLUMN)
|
158329
|
0 |
0 |
&& p->iColumn==pIdx->aiColumn[iCol]
|
158330
|
0 |
0 |
&& p->iTable==iBase
|
158333
|
0 |
0 |
if( 0==sqlite3StrICmp(pColl->zName, zColl) ){
|
158350
|
7 |
0 |
if( j>=0 ){
|
158352
|
0 |
0 |
}else if( j==(-1) ){
|
158382
|
4 |
0 |
if( pTabList->nSrc!=1 ) return 0;
|
158390
|
0 |
0 |
for(i=0; i<pDistinct->nExpr; i++){
|
158392
|
0 |
0 |
if( NEVER(p==0) ) continue;
|
158393
|
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;
|
158394
|
0 |
0 |
if( p->iTable==iBase && p->iColumn<0 ) return 1;
|
|
0 |
0 |
if( p->iTable==iBase && p->iColumn<0 ) return 1;
|
158410
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
158411
|
0 |
0 |
if( !IsUniqueIndex(pIdx) ) continue;
|
158412
|
0 |
0 |
if( pIdx->pPartIdxWhere ) continue;
|
158413
|
0 |
0 |
for(i=0; i<pIdx->nKeyCol; i++){
|
158414
|
0 |
0 |
if( 0==sqlite3WhereFindTerm(pWC, iBase, i, ~(Bitmask)0, WO_EQ, pIdx) ){
|
158415
|
0 |
0 |
if( findIndexCol(pParse, pDistinct, iBase, pIdx, i)<0 ) break;
|
158416
|
0 |
0 |
if( indexColumnNotNull(pIdx, i)==0 ) break;
|
158419
|
0 |
0 |
if( i==pIdx->nKeyCol ){
|
158433
|
2370 |
3 |
return N<=10 ? 0 : sqlite3LogEst(N) - 33;
|
158458
|
0 |
22 |
if( pParse->db->mallocFailed ) return;
|
158459
|
309 |
22 |
for(; iStart<iEnd; iStart++, pOp++){
|
158460
|
161 |
148 |
if( pOp->p1!=iTabCur ) continue;
|
158461
|
91 |
57 |
if( pOp->opcode==OP_Column ){
|
158467
|
0 |
57 |
}else if( pOp->opcode==OP_Rowid ){
|
158549
|
0 |
2 |
if( !ExprHasProperty(pTerm->pExpr, EP_OuterON|EP_InnerON)
|
158550
|
0 |
0 |
|| pTerm->pExpr->w.iJoin != pSrc->iCursor
|
158554
|
0 |
0 |
if( (pSrc->fg.jointype & (JT_LEFT|JT_RIGHT))!=0
|
158555
|
0 |
0 |
&& ExprHasProperty(pTerm->pExpr, EP_InnerON)
|
158576
|
401 |
709 |
if( pTerm->leftCursor!=pSrc->iCursor ) return 0;
|
158577
|
194 |
515 |
if( (pTerm->eOperator & (WO_EQ|WO_IS))==0 ) return 0;
|
158579
|
0 |
515 |
if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0
|
158580
|
0 |
0 |
&& !constraintCompatibleWithOuterJoin(pTerm,pSrc)
|
158584
|
0 |
515 |
if( (pTerm->prereqRight & notReady)!=0 ) return 0;
|
158586
|
2 |
513 |
if( pTerm->u.x.leftColumn<0 ) return 0;
|
158588
|
0 |
513 |
if( !sqlite3IndexAffinityOk(pTerm->pExpr, aff) ) return 0;
|
158702
|
2 |
1 |
for(pTerm=pWC->a; pTerm<pWCEnd; pTerm++){
|
158707
|
1 |
1 |
if( (pTerm->wtFlags & TERM_VIRTUAL)==0
|
158708
|
0 |
1 |
&& sqlite3ExprIsSingleTableConstraint(pExpr, pTabList, pLevel->iFrom)
|
158713
|
1 |
1 |
if( termCanDriveIndex(pTerm, pSrc, notReady) ){
|
158718
|
1 |
0 |
cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol);
|
158721
|
1 |
0 |
if( !sentWarning ){
|
158727
|
1 |
0 |
if( (idxCols & cMask)==0 ){
|
158728
|
0 |
1 |
if( whereLoopResize(pParse->db, pLoop, nKeyCol+1) ){
|
158749
|
0 |
1 |
if( IsView(pTable) ){
|
158757
|
2 |
1 |
for(i=0; i<mxBitCol; i++){
|
158758
|
1 |
1 |
if( extraCols & MASKBIT(i) ) nKeyCol++;
|
158760
|
0 |
1 |
if( pSrc->colUsed & MASKBIT(BMS-1) ){
|
158766
|
0 |
1 |
if( pIdx==0 ) goto end_auto_index_create;
|
158772
|
2 |
1 |
for(pTerm=pWC->a; pTerm<pWCEnd; pTerm++){
|
158773
|
1 |
1 |
if( termCanDriveIndex(pTerm, pSrc, notReady) ){
|
158778
|
1 |
0 |
cMask = iCol>=BMS ? MASKBIT(BMS-1) : MASKBIT(iCol);
|
158781
|
1 |
0 |
if( (idxCols & cMask)==0 ){
|
158787
|
1 |
0 |
pIdx->azColl[n] = pColl ? pColl->zName : sqlite3StrBINARY;
|
158789
|
1 |
0 |
if( ALWAYS(pX->pLeft!=0)
|
158790
|
1 |
0 |
&& sqlite3ExprAffinity(pX->pLeft)!=SQLITE_AFF_TEXT
|
158806
|
2 |
1 |
for(i=0; i<mxBitCol; i++){
|
158807
|
1 |
1 |
if( extraCols & MASKBIT(i) ){
|
158813
|
0 |
1 |
if( pSrc->colUsed & MASKBIT(BMS-1) ){
|
158814
|
0 |
0 |
for(i=BMS-1; i<pTable->nCol; i++){
|
158831
|
1 |
0 |
if( OptimizationEnabled(pParse->db, SQLITE_BloomFilter) && useBloomFilter ){
|
|
1 |
0 |
if( OptimizationEnabled(pParse->db, SQLITE_BloomFilter) && useBloomFilter ){
|
158839
|
0 |
1 |
if( pSrc->fg.viaCoroutine ){
|
158849
|
0 |
1 |
if( pPartial ){
|
158858
|
1 |
0 |
if( pLevel->regFilter ){
|
158865
|
0 |
1 |
if( pPartial ) sqlite3VdbeResolveLabel(v, iContinue);
|
158866
|
0 |
1 |
if( pSrc->fg.viaCoroutine ){
|
158961
|
0 |
0 |
if( sz<10000 ){
|
158963
|
0 |
0 |
}else if( sz>10000000 ){
|
158970
|
0 |
0 |
for(pTerm=pWInfo->sWC.a; pTerm<pWCEnd; pTerm++){
|
158972
|
0 |
0 |
if( (pTerm->wtFlags & TERM_VIRTUAL)==0
|
158973
|
0 |
0 |
&& sqlite3ExprIsSingleTableConstraint(pExpr, pTabList, iSrc)
|
158978
|
0 |
0 |
if( pLoop->wsFlags & WHERE_IPK ){
|
158988
|
0 |
0 |
for(jj=0; jj<n; jj++){
|
159000
|
0 |
0 |
if( OptimizationDisabled(pParse->db, SQLITE_BloomPulldown) ) break;
|
159001
|
0 |
0 |
while( ++iLevel < pWInfo->nLevel ){
|
159005
|
0 |
0 |
if( pTabItem->fg.jointype & (JT_LEFT|JT_LTORJ) ) continue;
|
159007
|
0 |
0 |
if( NEVER(pLoop==0) ) continue;
|
159008
|
0 |
0 |
if( pLoop->prereq & notReady ) continue;
|
159009
|
0 |
0 |
if( (pLoop->wsFlags & (WHERE_BLOOMFILTER|WHERE_COLUMN_IN))
|
159019
|
0 |
0 |
}while( iLevel < pWInfo->nLevel );
|
159062
|
263 |
148 |
for(i=nTerm=0, pTerm=pWC->a; i<pWC->nTerm; i++, pTerm++){
|
159064
|
104 |
159 |
if( pTerm->leftCursor != pSrc->iCursor ) continue;
|
159065
|
3 |
156 |
if( pTerm->prereqRight & mUnusable ) continue;
|
159071
|
0 |
156 |
if( (pTerm->eOperator & ~(WO_EQUIV))==0 ) continue;
|
159072
|
3 |
153 |
if( pTerm->wtFlags & TERM_VNULL ) continue;
|
159077
|
2 |
151 |
if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0
|
159078
|
2 |
0 |
&& !constraintCompatibleWithOuterJoin(pTerm,pSrc)
|
159091
|
29 |
119 |
if( pOrderBy ){
|
159093
|
29 |
23 |
for(i=0; i<n; i++){
|
159098
|
0 |
29 |
if( sqlite3ExprIsConstant(pExpr) ){
|
159103
|
0 |
29 |
if( pOrderBy->a[i].fg.sortFlags & KEYINFO_ORDER_BIGNULL ) break;
|
159106
|
29 |
0 |
if( pExpr->op==TK_COLUMN && pExpr->iTable==pSrc->iCursor ){
|
|
23 |
6 |
if( pExpr->op==TK_COLUMN && pExpr->iTable==pSrc->iCursor ){
|
159113
|
0 |
6 |
if( pExpr->op==TK_COLLATE
|
159114
|
0 |
0 |
&& (pE2 = pExpr->pLeft)->op==TK_COLUMN
|
159115
|
0 |
0 |
&& pE2->iTable==pSrc->iCursor
|
159122
|
0 |
0 |
if( pE2->iColumn<0 ) continue; /* Collseq does not matter for rowid */
|
159124
|
0 |
0 |
if( zColl==0 ) zColl = sqlite3StrBINARY;
|
159125
|
0 |
0 |
if( sqlite3_stricmp(pExpr->u.zToken, zColl)==0 ) continue;
|
159131
|
23 |
6 |
if( i==n ){
|
159133
|
2 |
21 |
if( (pWInfo->wctrlFlags & WHERE_DISTINCTBY) ){
|
159134
|
0 |
2 |
eDistinct = 2 + ((pWInfo->wctrlFlags & WHERE_SORTBYGROUP)!=0);
|
159135
|
0 |
21 |
}else if( pWInfo->wctrlFlags & WHERE_GROUPBY ){
|
159147
|
0 |
148 |
if( pIdxInfo==0 ){
|
159162
|
263 |
148 |
for(i=j=0, pTerm=pWC->a; i<pWC->nTerm; i++, pTerm++){
|
159164
|
112 |
151 |
if( (pTerm->wtFlags & TERM_OK)==0 ) continue;
|
159168
|
3 |
148 |
if( op==WO_IN ){
|
159169
|
3 |
0 |
if( (pTerm->wtFlags & TERM_SLICE)==0 ){
|
159170
|
3 |
0 |
pHidden->mIn |= SMASKBIT32(j);
|
159174
|
89 |
62 |
if( op==WO_AUX ){
|
159176
|
4 |
58 |
}else if( op & (WO_ISNULL|WO_IS) ){
|
159177
|
3 |
1 |
if( op==WO_ISNULL ){
|
159194
|
32 |
26 |
if( op & (WO_LT|WO_LE|WO_GT|WO_GE)
|
159195
|
0 |
32 |
&& sqlite3ExprIsVector(pTerm->pExpr->pRight)
|
159198
|
0 |
0 |
if( j<16 ) mNoOmit |= (1 << j);
|
159199
|
0 |
0 |
if( op==WO_LT ) pIdxCons[j].op = WO_LE;
|
159200
|
0 |
0 |
if( op==WO_GT ) pIdxCons[j].op = WO_GE;
|
159208
|
23 |
148 |
for(i=j=0; i<nOrderBy; i++){
|
159210
|
0 |
23 |
if( sqlite3ExprIsConstant(pExpr) ) continue;
|
159235
|
151 |
148 |
for(i=0; i<pIdxInfo->nConstraint; i++){
|
159268
|
0 |
156 |
if( rc!=SQLITE_OK && rc!=SQLITE_CONSTRAINT ){
|
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_CONSTRAINT ){
|
159269
|
0 |
0 |
if( rc==SQLITE_NOMEM ){
|
159271
|
0 |
0 |
}else if( !pVtab->zErrMsg ){
|
159277
|
0 |
156 |
if( pTab->u.vtab.p->bAllSchemas ){
|
159500
|
90 |
52 |
if( pTerm ){
|
159501
|
0 |
90 |
if( pTerm->truthProb<=0 ){
|
159503
|
86 |
4 |
}else if( (pTerm->wtFlags & TERM_VNULL)==0 ){
|
159820
|
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 ){
|
159825
|
0 |
71 |
if( nNew<10 ) nNew = 10;
|
159826
|
69 |
2 |
if( nNew<nOut ) nOut = nNew;
|
160077
|
765 |
4402 |
if( p->wsFlags & (WHERE_VIRTUALTABLE|WHERE_AUTO_INDEX) ){
|
160078
|
297 |
468 |
if( (p->wsFlags & WHERE_VIRTUALTABLE)!=0 && p->u.vtab.needFree ){
|
|
5 |
292 |
if( (p->wsFlags & WHERE_VIRTUALTABLE)!=0 && p->u.vtab.needFree ){
|
160082
|
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 ){
|
160095
|
14 |
3383 |
if( p->aLTerm!=p->aLTermSpace ){
|
160110
|
143 |
14 |
if( p->nLSlot>=n ) return SQLITE_OK;
|
160113
|
0 |
14 |
if( paNew==0 ) return SQLITE_NOMEM_BKPT;
|
160115
|
0 |
14 |
if( p->aLTerm!=p->aLTermSpace ) sqlite3DbFreeNN(db, p->aLTerm);
|
160126
|
7 |
1763 |
if( pFrom->nLTerm > pTo->nLSlot
|
160127
|
0 |
7 |
&& whereLoopResize(db, pTo, pFrom->nLTerm)
|
160134
|
153 |
1617 |
if( pFrom->wsFlags & WHERE_VIRTUALTABLE ){
|
160136
|
468 |
1149 |
}else if( (pFrom->wsFlags & WHERE_AUTO_INDEX)!=0 ){
|
160158
|
1688 |
2230 |
while( pWInfo->pLoops ){
|
160163
|
3 |
2230 |
while( pWInfo->pMemToFree ){
|
160195
|
65 |
67 |
if( pX->nLTerm-pX->nSkip >= pY->nLTerm-pY->nSkip ){
|
160198
|
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;
|
160199
|
0 |
4 |
if( pY->nSkip > pX->nSkip ) return 0;
|
160200
|
10 |
4 |
for(i=pX->nLTerm-1; i>=0; i--){
|
160201
|
0 |
10 |
if( pX->aLTerm[i]==0 ) continue;
|
160202
|
30 |
0 |
for(j=pY->nLTerm-1; j>=0; j--){
|
160203
|
10 |
20 |
if( pY->aLTerm[j]==pX->aLTerm[i] ) break;
|
160205
|
0 |
10 |
if( j<0 ) return 0; /* X not a subset of Y since term X[i] not used by Y */
|
160207
|
4 |
0 |
if( (pX->wsFlags&WHERE_IDX_ONLY)!=0
|
160208
|
0 |
4 |
&& (pY->wsFlags&WHERE_IDX_ONLY)==0 ){
|
160229
|
1741 |
119 |
if( (pTemplate->wsFlags & WHERE_INDEXED)==0 ) return;
|
160230
|
203 |
119 |
for(; p; p=p->pNextLoop){
|
160231
|
0 |
203 |
if( p->iTab!=pTemplate->iTab ) continue;
|
160232
|
135 |
68 |
if( (p->wsFlags & WHERE_INDEXED)==0 ) continue;
|
160233
|
4 |
64 |
if( whereLoopCheaperProperSubset(p, pTemplate) ){
|
160242
|
0 |
64 |
}else if( whereLoopCheaperProperSubset(pTemplate, p) ){
|
160274
|
749 |
1697 |
for(p=(*ppPrev); p; ppPrev=&p->pNextLoop, p=*ppPrev){
|
160275
|
717 |
32 |
if( p->iTab!=pTemplate->iTab || p->iSortIdx!=pTemplate->iSortIdx ){
|
|
367 |
350 |
if( p->iTab!=pTemplate->iTab || p->iSortIdx!=pTemplate->iSortIdx ){
|
160295
|
254 |
96 |
if( (p->wsFlags & WHERE_AUTO_INDEX)!=0
|
160296
|
254 |
0 |
&& (pTemplate->nSkip)==0
|
160297
|
9 |
245 |
&& (pTemplate->wsFlags & WHERE_INDEXED)!=0
|
160298
|
9 |
0 |
&& (pTemplate->wsFlags & WHERE_COLUMN_EQ)!=0
|
160299
|
9 |
0 |
&& (p->prereq & pTemplate->prereq)==pTemplate->prereq
|
160309
|
330 |
11 |
if( (p->prereq & pTemplate->prereq)==p->prereq /* (1) */
|
160310
|
134 |
196 |
&& p->rSetup<=pTemplate->rSetup /* (2a) */
|
160311
|
65 |
69 |
&& p->rRun<=pTemplate->rRun /* (2b) */
|
160312
|
64 |
1 |
&& p->nOut<=pTemplate->nOut /* (2c) */
|
160322
|
275 |
2 |
if( (p->prereq & pTemplate->prereq)==pTemplate->prereq /* (1) */
|
160323
|
73 |
202 |
&& p->rRun>=pTemplate->rRun /* (2a) */
|
160324
|
73 |
0 |
&& p->nOut>=pTemplate->nOut /* (2b) */
|
160364
|
0 |
1860 |
if( pBuilder->iPlanLimit==0 ){
|
160366
|
0 |
0 |
if( pBuilder->pOrSet ) pBuilder->pOrSet->n = 0;
|
160376
|
26 |
1834 |
if( pBuilder->pOrSet!=0 ){
|
160377
|
18 |
8 |
if( pTemplate->nLTerm ){
|
160398
|
64 |
1770 |
if( ppPrev==0 ){
|
160428
|
1697 |
73 |
if( p==0 ){
|
160431
|
0 |
1697 |
if( p==0 ) return SQLITE_NOMEM_BKPT;
|
160440
|
9 |
73 |
while( *ppTail ){
|
160442
|
0 |
9 |
if( ppTail==0 ) break;
|
160444
|
0 |
9 |
if( pToDel==0 ) break;
|
160456
|
1617 |
153 |
if( (p->wsFlags & WHERE_VIRTUALTABLE)==0 ){
|
160458
|
1147 |
470 |
if( pIndex && pIndex->idxType==SQLITE_IDXTYPE_IPK ){
|
|
1058 |
89 |
if( pIndex && pIndex->idxType==SQLITE_IDXTYPE_IPK ){
|
160505
|
1143 |
1190 |
for(i=pWC->nBase, pTerm=pWC->a; i>0; i--, pTerm++){
|
160507
|
12 |
1131 |
if( (pTerm->prereqAll & notAllowed)!=0 ) continue;
|
160508
|
42 |
1089 |
if( (pTerm->prereqAll & pLoop->maskSelf)==0 ) continue;
|
160509
|
8 |
1081 |
if( (pTerm->wtFlags & TERM_VIRTUAL)!=0 ) continue;
|
160510
|
202 |
967 |
for(j=pLoop->nLTerm-1; j>=0; j--){
|
160512
|
0 |
202 |
if( pX==0 ) continue;
|
160513
|
59 |
143 |
if( pX==pTerm ) break;
|
160514
|
57 |
86 |
if( pX->iParent>=0 && (&pWC->a[pX->iParent])==pTerm ) break;
|
|
55 |
2 |
if( pX->iParent>=0 && (&pWC->a[pX->iParent])==pTerm ) break;
|
160516
|
967 |
114 |
if( j<0 ){
|
160518
|
967 |
0 |
if( pLoop->maskSelf==pTerm->prereqAll ){
|
160528
|
411 |
556 |
if( (pTerm->eOperator & 0x3f)!=0
|
160529
|
411 |
0 |
|| (pWC->pWInfo->pTabList->a[pLoop->iTab].fg.jointype
|
160535
|
0 |
967 |
if( pTerm->truthProb<=0 ){
|
160543
|
528 |
439 |
if( (pTerm->eOperator&(WO_EQ|WO_IS))!=0
|
160549
|
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 ){
|
160554
|
477 |
51 |
if( iReduce<k ){
|
160562
|
471 |
719 |
if( pLoop->nOut > nRow-iReduce ){
|
160595
|
0 |
71 |
for(i=1; i<nCmp; i++){
|
160606
|
0 |
0 |
if( ExprUseXSelect(pRhs) ){
|
160616
|
0 |
0 |
if( pLhs->op!=TK_COLUMN
|
160617
|
0 |
0 |
|| pLhs->iTable!=iCur
|
160618
|
0 |
0 |
|| pLhs->iColumn!=pIdx->aiColumn[i+nEq]
|
160619
|
0 |
0 |
|| pIdx->aSortOrder[i+nEq]!=pIdx->aSortOrder[nEq]
|
160627
|
0 |
0 |
if( aff!=idxaff ) break;
|
160630
|
0 |
0 |
if( pColl==0 ) break;
|
160631
|
0 |
0 |
if( sqlite3StrICmp(pColl->zName, pIdx->azColl[i+nEq]) ) break;
|
160686
|
0 |
1192 |
if( pParse->nErr ){
|
160695
|
33 |
1159 |
if( pNew->wsFlags & WHERE_BTM_LIMIT ){
|
160701
|
0 |
1192 |
if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE);
|
160720
|
1295 |
0 |
for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){
|
|
103 |
1192 |
for(; rc==SQLITE_OK && pTerm!=0; pTerm = whereScanNext(&scan)){
|
160728
|
98 |
5 |
if( (eOp==WO_ISNULL || (pTerm->wtFlags&TERM_VNULL)!=0)
|
|
2 |
96 |
if( (eOp==WO_ISNULL || (pTerm->wtFlags&TERM_VNULL)!=0)
|
160729
|
0 |
7 |
&& indexColumnNotNull(pProbe, saved_nEq)
|
160733
|
0 |
103 |
if( pTerm->prereqRight & pNew->maskSelf ) continue;
|
160737
|
0 |
103 |
if( pTerm->wtFlags & TERM_LIKEOPT && pTerm->eOperator==WO_LT ) continue;
|
|
0 |
0 |
if( pTerm->wtFlags & TERM_LIKEOPT && pTerm->eOperator==WO_LT ) continue;
|
160739
|
0 |
103 |
if( (pSrc->fg.jointype & (JT_LEFT|JT_LTORJ|JT_RIGHT))!=0
|
160740
|
0 |
0 |
&& !constraintCompatibleWithOuterJoin(pTerm,pSrc)
|
160744
|
83 |
20 |
if( IsUniqueIndex(pProbe) && saved_nEq==pProbe->nKeyCol-1 ){
|
|
11 |
72 |
if( IsUniqueIndex(pProbe) && saved_nEq==pProbe->nKeyCol-1 ){
|
160754
|
1 |
102 |
if( pNew->nLTerm>=pNew->nLSlot
|
160755
|
0 |
1 |
&& whereLoopResize(db, pNew, pNew->nLTerm+1)
|
160768
|
0 |
103 |
if( eOp & WO_IN ){
|
160770
|
0 |
0 |
if( ExprUseXSelect(pExpr) ){
|
160780
|
0 |
0 |
for(i=0; i<pNew->nLTerm-1; i++){
|
160781
|
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;
|
160783
|
0 |
0 |
}else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){
|
|
0 |
0 |
}else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){
|
160787
|
0 |
0 |
if( pProbe->hasStat1 && rLogSize>=10 ){
|
|
0 |
0 |
if( pProbe->hasStat1 && rLogSize>=10 ){
|
160813
|
0 |
0 |
if( x>=0 ){
|
160818
|
0 |
0 |
}else if( nInMul<2 && OptimizationEnabled(db, SQLITE_SeekScan) ){
|
|
0 |
0 |
}else if( nInMul<2 && OptimizationEnabled(db, SQLITE_SeekScan) ){
|
160833
|
27 |
76 |
}else if( eOp & (WO_EQ|WO_IS) ){
|
160837
|
25 |
2 |
if( iCol==XN_ROWID
|
160838
|
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)
|
160840
|
4 |
2 |
if( iCol==XN_ROWID || pProbe->uniqNotNull
|
|
3 |
1 |
if( iCol==XN_ROWID || pProbe->uniqNotNull
|
160841
|
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)
|
160848
|
0 |
27 |
if( scan.iEquiv>1 ) pNew->wsFlags |= WHERE_TRANSCONS;
|
160849
|
5 |
71 |
}else if( eOp & WO_ISNULL ){
|
160855
|
33 |
38 |
if( eOp & (WO_GT|WO_GE) ){
|
160862
|
0 |
33 |
if( pTerm->wtFlags & TERM_LIKEOPT ){
|
160869
|
0 |
0 |
if( whereLoopResize(db, pNew, pNew->nLTerm+1) ) break; /* OOM */
|
160882
|
19 |
19 |
pNew->aLTerm[pNew->nLTerm-2] : 0;
|
160892
|
71 |
32 |
if( pNew->wsFlags & WHERE_COLUMN_RANGE ){
|
160901
|
0 |
32 |
if( pTerm->truthProb<=0 && pProbe->aiColumn[saved_nEq]>=0 ){
|
|
0 |
0 |
if( pTerm->truthProb<=0 && pProbe->aiColumn[saved_nEq]>=0 ){
|
160957
|
5 |
27 |
if( eOp & WO_ISNULL ){
|
160972
|
10 |
93 |
if( pProbe->idxType==SQLITE_IDXTYPE_IPK ){
|
160982
|
51 |
52 |
if( (pNew->wsFlags & (WHERE_IDX_ONLY|WHERE_IPK|WHERE_EXPRIDX))==0 ){
|
160993
|
71 |
32 |
if( pNew->wsFlags & WHERE_COLUMN_RANGE ){
|
160999
|
65 |
38 |
if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0
|
161000
|
63 |
2 |
&& pNew->u.btree.nEq<pProbe->nColumn
|
161001
|
15 |
48 |
&& (pNew->u.btree.nEq<pProbe->nKeyCol ||
|
|
14 |
1 |
&& (pNew->u.btree.nEq<pProbe->nKeyCol ||
|
161004
|
2 |
60 |
if( pNew->u.btree.nEq>3 ){
|
161034
|
1157 |
35 |
if( saved_nEq==saved_nSkip
|
161035
|
52 |
1105 |
&& saved_nEq+1<pProbe->nKeyCol
|
161036
|
35 |
17 |
&& saved_nEq==pNew->nLTerm
|
161037
|
35 |
0 |
&& pProbe->noSkipScan==0
|
161038
|
0 |
35 |
&& pProbe->hasStat1!=0
|
161039
|
0 |
0 |
&& OptimizationEnabled(db, SQLITE_SkipScan)
|
161040
|
0 |
0 |
&& pProbe->aiRowLogEst[saved_nEq+1]>=42 /* TUNING: Minimum for skip-scan */
|
161041
|
0 |
0 |
&& (rc = whereLoopResize(db, pNew, pNew->nLTerm+1))==SQLITE_OK
|
161082
|
0 |
1130 |
if( pIndex->bUnordered ) return 0;
|
161083
|
478 |
652 |
if( (pOB = pBuilder->pWInfo->pOrderBy)==0 ) return 0;
|
161084
|
706 |
118 |
for(ii=0; ii<pOB->nExpr; ii++){
|
161086
|
0 |
706 |
if( NEVER(pExpr==0) ) continue;
|
161087
|
706 |
0 |
if( pExpr->op==TK_COLUMN && pExpr->iTable==iCursor ){
|
|
701 |
5 |
if( pExpr->op==TK_COLUMN && pExpr->iTable==iCursor ){
|
161088
|
509 |
192 |
if( pExpr->iColumn<0 ) return 1;
|
161089
|
200 |
167 |
for(jj=0; jj<pIndex->nKeyCol; jj++){
|
161090
|
25 |
175 |
if( pExpr->iColumn==pIndex->aiColumn[jj] ) return 1;
|
161092
|
0 |
5 |
}else if( (aColExpr = pIndex->aColExpr)!=0 ){
|
161093
|
0 |
0 |
for(jj=0; jj<pIndex->nKeyCol; jj++){
|
161094
|
0 |
0 |
if( pIndex->aiColumn[jj]!=XN_EXPR ) continue;
|
161095
|
0 |
0 |
if( sqlite3ExprCompareSkip(pExpr,aColExpr->a[jj].pExpr,iCursor)==0 ){
|
161117
|
0 |
0 |
if( jointype & JT_LTORJ ) return 0;
|
161119
|
0 |
0 |
while( pWhere->op==TK_AND ){
|
161120
|
0 |
0 |
if( !whereUsablePartialIndex(iTab,jointype,pWC,pWhere->pLeft) ) return 0;
|
161123
|
0 |
0 |
if( pParse->db->flags & SQLITE_EnableQPSG ) pParse = 0;
|
161124
|
0 |
0 |
for(i=0, pTerm=pWC->a; i<pWC->nTerm; i++, pTerm++){
|
161127
|
0 |
0 |
if( (!ExprHasProperty(pExpr, EP_OuterON) || pExpr->w.iJoin==iTab)
|
|
0 |
0 |
if( (!ExprHasProperty(pExpr, EP_OuterON) || pExpr->w.iJoin==iTab)
|
161128
|
0 |
0 |
&& ((jointype & JT_OUTER)==0 || ExprHasProperty(pExpr, EP_OuterON))
|
|
0 |
0 |
&& ((jointype & JT_OUTER)==0 || ExprHasProperty(pExpr, EP_OuterON))
|
161129
|
0 |
0 |
&& sqlite3ExprImpliesExpr(pParse, pExpr, pWhere, iTab)
|
161130
|
0 |
0 |
&& (pTerm->wtFlags & TERM_VNULL)==0
|
161148
|
0 |
0 |
for(i=0; i<pIdx->nColumn; i++){
|
161149
|
0 |
0 |
if( pIdx->aiColumn[i]==XN_EXPR
|
161150
|
0 |
0 |
&& sqlite3ExprCompare(0, pExpr, pIdx->aColExpr->a[i].pExpr, iTabCur)==0
|
161195
|
0 |
0 |
if( (pExpr->op==TK_COLUMN || pExpr->op==TK_AGG_COLUMN) ){
|
|
0 |
0 |
if( (pExpr->op==TK_COLUMN || pExpr->op==TK_AGG_COLUMN) ){
|
161197
|
0 |
0 |
if( pExpr->iTable!=pCk->iTabCur ) return WRC_Continue;
|
161201
|
0 |
0 |
for(i=0; i<nColumn; i++){
|
161202
|
0 |
0 |
if( aiColumn[i]==pExpr->iColumn ) return WRC_Continue;
|
161206
|
0 |
0 |
}else if( pIdx->bHasExpr
|
161207
|
0 |
0 |
&& exprIsCoveredByIndex(pExpr, pIdx, pWalk->u.pCovIdxCk->iTabCur) ){
|
161246
|
0 |
0 |
if( pWInfo->pSelect==0 ){
|
161251
|
0 |
0 |
if( pIdx->bHasExpr==0 ){
|
161252
|
0 |
0 |
for(i=0; i<pIdx->nColumn; i++){
|
161253
|
0 |
0 |
if( pIdx->aiColumn[i]>=BMS-1 ) break;
|
161255
|
0 |
0 |
if( i>=pIdx->nColumn ){
|
161271
|
0 |
0 |
if( ck.bUnidx ){
|
161273
|
0 |
0 |
}else if( ck.bExpr ){
|
161344
|
0 |
1061 |
if( pSrc->fg.isIndexedBy ){
|
161348
|
0 |
1061 |
}else if( !HasRowid(pTab) ){
|
161368
|
1061 |
0 |
if( pSrc->fg.notIndexed==0 ){
|
161379
|
1053 |
8 |
if( !pBuilder->pOrSet /* Not part of an OR optimization */
|
161380
|
1048 |
5 |
&& (pWInfo->wctrlFlags & (WHERE_RIGHT_JOIN|WHERE_OR_SUBCLAUSE))==0
|
161381
|
1048 |
0 |
&& (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0
|
161382
|
1048 |
0 |
&& !pSrc->fg.isIndexedBy /* Has no INDEXED BY clause */
|
161383
|
1048 |
0 |
&& !pSrc->fg.notIndexed /* Has no NOT INDEXED clause */
|
161384
|
1048 |
0 |
&& HasRowid(pTab) /* Not WITHOUT ROWID table. (FIXME: Why not?) */
|
161385
|
1048 |
0 |
&& !pSrc->fg.isCorrelated /* Not a correlated subquery */
|
161386
|
1048 |
0 |
&& !pSrc->fg.isRecursive /* Not a recursive common table expression. */
|
161387
|
1048 |
0 |
&& (pSrc->fg.jointype & JT_RIGHT)==0 /* Not the right tab of a RIGHT JOIN */
|
161394
|
2168 |
0 |
for(pTerm=pWC->a; rc==SQLITE_OK && pTerm<pWCEnd; pTerm++){
|
|
1120 |
1048 |
for(pTerm=pWC->a; rc==SQLITE_OK && pTerm<pWCEnd; pTerm++){
|
161395
|
14 |
1106 |
if( pTerm->prereqRight & pNew->maskSelf ) continue;
|
161396
|
511 |
595 |
if( termCanDriveIndex(pTerm, pSrc, 0) ){
|
161411
|
511 |
0 |
if( !IsView(pTab) && (pTab->tabFlags & TF_Ephemeral)==0 ){
|
|
510 |
1 |
if( !IsView(pTab) && (pTab->tabFlags & TF_Ephemeral)==0 ){
|
161418
|
0 |
511 |
if( pNew->rSetup<0 ) pNew->rSetup = 0;
|
161435
|
2191 |
0 |
for(; rc==SQLITE_OK && pProbe;
|
|
1130 |
1061 |
for(; rc==SQLITE_OK && pProbe;
|
161436
|
1130 |
0 |
pProbe=(pSrc->fg.isIndexedBy ? 0 : pProbe->pNext), iSortIdx++
|
161438
|
0 |
1130 |
if( pProbe->pPartIdxWhere!=0
|
161439
|
0 |
0 |
&& !whereUsablePartialIndex(pSrc->iCursor, pSrc->fg.jointype, pWC,
|
161445
|
0 |
1130 |
if( pProbe->bNoQuery ) continue;
|
161461
|
1061 |
69 |
if( pProbe->idxType==SQLITE_IDXTYPE_IPK ){
|
161466
|
508 |
553 |
pNew->iSortIdx = b ? iSortIdx : 0;
|
161484
|
1061 |
0 |
if( IsView(pTab) || (pTab->tabFlags & TF_Ephemeral)!=0 ){
|
|
22 |
1039 |
if( IsView(pTab) || (pTab->tabFlags & TF_Ephemeral)!=0 ){
|
161491
|
0 |
1061 |
if( rc ) break;
|
161494
|
14 |
55 |
if( pProbe->isCovering ){
|
161500
|
55 |
0 |
if( m==TOPBIT || (pProbe->bHasExpr && !pProbe->bHasVCol && m!=0) ){
|
|
0 |
55 |
if( m==TOPBIT || (pProbe->bHasExpr && !pProbe->bHasVCol && m!=0) ){
|
|
0 |
0 |
if( m==TOPBIT || (pProbe->bHasExpr && !pProbe->bHasVCol && m!=0) ){
|
|
0 |
0 |
if( m==TOPBIT || (pProbe->bHasExpr && !pProbe->bHasVCol && m!=0) ){
|
161502
|
0 |
0 |
if( isCov==0 ){
|
161521
|
18 |
37 |
}else if( m==0 ){
|
161530
|
43 |
26 |
if( b
|
161531
|
43 |
0 |
|| !HasRowid(pTab)
|
161532
|
43 |
0 |
|| pProbe->pPartIdxWhere!=0
|
161533
|
43 |
0 |
|| pSrc->fg.isIndexedBy
|
161534
|
23 |
20 |
|| ( m==0
|
161535
|
23 |
0 |
&& pProbe->bUnordered==0
|
161536
|
9 |
14 |
&& (pProbe->szIdxRow<pTab->szTabRow)
|
161537
|
0 |
9 |
&& (pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0
|
161538
|
0 |
0 |
&& sqlite3GlobalConfig.bUseCis
|
161539
|
0 |
0 |
&& OptimizationEnabled(pWInfo->pParse->db, SQLITE_CoverIdxScan)
|
161542
|
26 |
0 |
pNew->iSortIdx = b ? iSortIdx : 0;
|
161548
|
17 |
9 |
if( m!=0 ){
|
161558
|
51 |
17 |
for(ii=0; ii<pWC2->nTerm; ii++){
|
161560
|
0 |
51 |
if( !sqlite3ExprCoveredByIndex(pTerm->pExpr, iCur, pProbe) ){
|
161565
|
0 |
51 |
if( pTerm->truthProb<=0 ){
|
161569
|
0 |
51 |
if( pTerm->eOperator & (WO_EQ|WO_IS) ) nLookup -= 19;
|
161577
|
0 |
26 |
if( (pSrc->fg.jointype & JT_RIGHT)!=0 && pProbe->aColExpr ){
|
|
0 |
0 |
if( (pSrc->fg.jointype & JT_RIGHT)!=0 && pProbe->aColExpr ){
|
161586
|
0 |
26 |
if( rc ) break;
|
161592
|
43 |
1087 |
if( pBuilder->bldFlags1==SQLITE_BLDF1_INDEXED ){
|
161616
|
0 |
148 |
&& pTerm->eMatchOp<=SQLITE_INDEX_CONSTRAINT_OFFSET;
|
|
0 |
0 |
&& pTerm->eMatchOp<=SQLITE_INDEX_CONSTRAINT_OFFSET;
|
161668
|
159 |
156 |
for(i=0; i<nConstraint; i++, pIdxCons++){
|
161671
|
154 |
5 |
if( (pTerm->prereqRight & mUsable)==pTerm->prereqRight
|
161672
|
151 |
3 |
&& (pTerm->eOperator & mExclude)==0
|
161673
|
0 |
151 |
&& (pbRetryLimit || !isLimitTerm(pTerm))
|
|
0 |
0 |
&& (pbRetryLimit || !isLimitTerm(pTerm))
|
161693
|
0 |
156 |
if( rc ){
|
161694
|
0 |
0 |
if( rc==SQLITE_CONSTRAINT ){
|
161710
|
159 |
156 |
for(i=0; i<nConstraint; i++, pIdxCons++){
|
161712
|
148 |
11 |
if( (iTerm = pUsage[i].argvIndex - 1)>=0 ){
|
161715
|
148 |
0 |
if( iTerm>=nConstraint
|
161716
|
148 |
0 |
|| j<0
|
161717
|
148 |
0 |
|| j>=pWC->nTerm
|
161718
|
148 |
0 |
|| pNew->aLTerm[iTerm]!=0
|
161719
|
0 |
148 |
|| pIdxCons->usable==0
|
161732
|
148 |
0 |
if( iTerm>mxTerm ) mxTerm = iTerm;
|
161735
|
148 |
0 |
if( pUsage[i].omit ){
|
161736
|
148 |
0 |
if( i<16 && ((1<<i)&mNoOmit)==0 ){
|
|
148 |
0 |
if( i<16 && ((1<<i)&mNoOmit)==0 ){
|
161742
|
0 |
148 |
if( pTerm->eMatchOp==SQLITE_INDEX_CONSTRAINT_OFFSET ){
|
161746
|
148 |
0 |
if( SMASKBIT32(i) & pHidden->mHandleIn ){
|
|
0 |
148 |
if( SMASKBIT32(i) & pHidden->mHandleIn ){
|
161748
|
3 |
145 |
}else if( (pTerm->eOperator & WO_IN)!=0 ){
|
161760
|
0 |
148 |
if( isLimitTerm(pTerm) && *pbIn ){
|
|
0 |
0 |
if( isLimitTerm(pTerm) && *pbIn ){
|
161766
|
0 |
0 |
if( pIdxInfo->needToFreeIdxStr ){
|
161778
|
148 |
156 |
for(i=0; i<=mxTerm; i++){
|
161779
|
0 |
148 |
if( pNew->aLTerm[i]==0 ){
|
161792
|
0 |
156 |
pNew->u.vtab.isOrdered = (i8)(pIdxInfo->orderByConsumed ?
|
161800
|
2 |
154 |
if( pIdxInfo->idxFlags & SQLITE_INDEX_SCAN_UNIQUE ){
|
161806
|
3 |
153 |
if( pNew->u.vtab.needFree ){
|
161835
|
0 |
0 |
if( iCons>=0 && iCons<pIdxInfo->nConstraint ){
|
|
0 |
0 |
if( iCons>=0 && iCons<pIdxInfo->nConstraint ){
|
161839
|
0 |
0 |
if( pX->pLeft ){
|
161842
|
0 |
0 |
zRet = (pC ? pC->zName : sqlite3StrBINARY);
|
161854
|
0 |
0 |
u32 m = SMASKBIT32(iCons);
|
161855
|
0 |
0 |
if( m & pHidden->mIn ){
|
161856
|
0 |
0 |
if( bHandle==0 ){
|
161858
|
0 |
0 |
}else if( bHandle>0 ){
|
161880
|
0 |
0 |
if( iCons<0 || iCons>=pIdxInfo->nConstraint ){
|
|
0 |
0 |
if( iCons<0 || iCons>=pIdxInfo->nConstraint ){
|
161883
|
0 |
0 |
if( pH->aRhs[iCons]==0 ){
|
161895
|
0 |
0 |
if( rc==SQLITE_OK && pVal==0 ){ /* IMP: R-19933-32160 */
|
|
0 |
0 |
if( rc==SQLITE_OK && pVal==0 ){ /* IMP: R-19933-32160 */
|
161923
|
0 |
0 |
for(i=0; i<nDb; i++){
|
161926
|
0 |
0 |
if( DbMaskNonZero(pParse->writeMask) ){
|
161927
|
0 |
0 |
for(i=0; i<nDb; i++){
|
161984
|
0 |
148 |
if( p==0 ) return SQLITE_NOMEM_BKPT;
|
161990
|
0 |
148 |
if( whereLoopResize(pParse->db, pNew, nConstraint) ){
|
162001
|
0 |
148 |
if( bRetry ){
|
162013
|
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) ){
|
162021
|
3 |
5 |
if( bIn ){
|
162027
|
3 |
0 |
if( mBestNoIn==0 ){
|
162035
|
13 |
0 |
while( rc==SQLITE_OK ){
|
162039
|
13 |
13 |
for(i=0; i<nConstraint; i++){
|
162043
|
5 |
8 |
if( mThis>mPrev && mThis<mNext ) mNext = mThis;
|
|
5 |
0 |
if( mThis>mPrev && mThis<mNext ) mNext = mThis;
|
162046
|
8 |
5 |
if( mNext==ALLBITS ) break;
|
162047
|
0 |
5 |
if( mNext==mBest || mNext==mBestNoIn ) continue;
|
|
0 |
0 |
if( mNext==mBest || mNext==mBestNoIn ) continue;
|
162052
|
0 |
0 |
if( pNew->prereq==mPrereq ){
|
162054
|
0 |
0 |
if( bIn==0 ) seenZeroNoIN = 1;
|
162061
|
8 |
0 |
if( rc==SQLITE_OK && seenZero==0 ){
|
|
5 |
3 |
if( rc==SQLITE_OK && seenZero==0 ){
|
162065
|
5 |
0 |
if( bIn==0 ) seenZeroNoIN = 1;
|
162071
|
8 |
0 |
if( rc==SQLITE_OK && seenZeroNoIN==0 ){
|
|
0 |
8 |
if( rc==SQLITE_OK && seenZeroNoIN==0 ){
|
162078
|
0 |
148 |
if( p->needToFreeIdxStr ) sqlite3_free(p->idxStr);
|
162113
|
0 |
11 |
if( pItem->fg.jointype & JT_RIGHT ) return SQLITE_OK;
|
162115
|
26 |
11 |
for(pTerm=pWC->a; pTerm<pWCEnd && rc==SQLITE_OK; pTerm++){
|
|
26 |
0 |
for(pTerm=pWC->a; pTerm<pWCEnd && rc==SQLITE_OK; pTerm++){
|
162116
|
4 |
22 |
if( (pTerm->eOperator & WO_OR)!=0
|
162117
|
4 |
0 |
&& (pTerm->u.pOrInfo->indexable & pNew->maskSelf)!=0
|
162129
|
10 |
3 |
for(pOrTerm=pOrWC->a; pOrTerm<pOrWCEnd; pOrTerm++){
|
162130
|
6 |
4 |
if( (pOrTerm->eOperator & WO_AND)!=0 ){
|
162132
|
2 |
2 |
}else if( pOrTerm->leftCursor==iCur ){
|
162152
|
0 |
8 |
if( IsVirtual(pItem->pTab) ){
|
162159
|
8 |
0 |
if( rc==SQLITE_OK ){
|
162164
|
1 |
7 |
if( sCur.n==0 ){
|
162167
|
3 |
4 |
}else if( once ){
|
162174
|
4 |
4 |
for(i=0; i<sPrev.n; i++){
|
162175
|
4 |
4 |
for(j=0; j<sCur.n; j++){
|
162189
|
7 |
0 |
for(i=0; rc==SQLITE_OK && i<sSum.n; i++){
|
|
3 |
4 |
for(i=0; rc==SQLITE_OK && i<sSum.n; i++){
|
162241
|
1201 |
1700 |
for(iTab=0, pItem=pTabList->a; pItem<pEnd; iTab++, pItem++){
|
162246
|
1201 |
0 |
if( bFirstPastRJ
|
162247
|
3 |
1198 |
|| (pItem->fg.jointype & (JT_OUTER|JT_CROSS|JT_LTORJ))!=0
|
162259
|
0 |
3 |
if( pItem->fg.jointype & JT_LTORJ ) hasRightJoin = 1;
|
162262
|
1198 |
0 |
}else if( !hasRightJoin ){
|
162266
|
148 |
1053 |
if( IsVirtual(pItem->pTab) ){
|
162268
|
4 |
148 |
for(p=&pItem[1]; p<pEnd; p++){
|
162269
|
4 |
0 |
if( mUnusable || (p->fg.jointype & (JT_OUTER|JT_CROSS)) ){
|
|
3 |
1 |
if( mUnusable || (p->fg.jointype & (JT_OUTER|JT_CROSS)) ){
|
162279
|
1201 |
0 |
if( rc==SQLITE_OK && pBuilder->pWC->hasOr ){
|
|
3 |
1198 |
if( rc==SQLITE_OK && pBuilder->pWC->hasOr ){
|
162283
|
1201 |
0 |
if( rc || db->mallocFailed ){
|
|
0 |
1201 |
if( rc || db->mallocFailed ){
|
162284
|
0 |
0 |
if( rc==SQLITE_DONE ){
|
162372
|
17 |
1420 |
if( nLoop && OptimizationDisabled(db, SQLITE_OrderByIdxJoin) ) return 0;
|
|
0 |
17 |
if( nLoop && OptimizationDisabled(db, SQLITE_OrderByIdxJoin) ) return 0;
|
162376
|
0 |
1437 |
if( nOrderBy>BMS-1 ) return 0; /* Cannot optimize overly large ORDER BYs */
|
162382
|
774 |
663 |
if( wctrlFlags & (WHERE_ORDERBY_LIMIT|WHERE_ORDERBY_MAX|WHERE_ORDERBY_MIN) ){
|
162385
|
2461 |
344 |
for(iLoop=0; isOrderDistinct && obSat<obDone && iLoop<=nLoop; iLoop++){
|
|
1447 |
1014 |
for(iLoop=0; isOrderDistinct && obSat<obDone && iLoop<=nLoop; iLoop++){
|
|
1447 |
0 |
for(iLoop=0; isOrderDistinct && obSat<obDone && iLoop<=nLoop; iLoop++){
|
162386
|
10 |
1437 |
if( iLoop>0 ) ready |= pLoop->maskSelf;
|
162387
|
17 |
1430 |
if( iLoop<nLoop ){
|
162389
|
10 |
7 |
if( wctrlFlags & WHERE_ORDERBY_LIMIT ) continue;
|
162393
|
77 |
1360 |
if( pLoop->wsFlags & WHERE_VIRTUALTABLE ){
|
162394
|
0 |
77 |
if( pLoop->u.vtab.isOrdered
|
162395
|
0 |
0 |
&& ((wctrlFlags&(WHERE_DISTINCTBY|WHERE_SORTBYGROUP))!=WHERE_DISTINCTBY)
|
162400
|
4 |
1356 |
}else if( wctrlFlags & WHERE_DISTINCTBY ){
|
162410
|
1512 |
1360 |
for(i=0; i<nOrderBy; i++){
|
162411
|
0 |
1512 |
if( MASKBIT(i) & obSat ) continue;
|
162413
|
0 |
1512 |
if( NEVER(pOBExpr==0) ) continue;
|
162414
|
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;
|
162415
|
7 |
1505 |
if( pOBExpr->iTable!=iCur ) continue;
|
162418
|
1499 |
6 |
if( pTerm==0 ) continue;
|
162419
|
0 |
6 |
if( pTerm->eOperator==WO_IN ){
|
162425
|
0 |
0 |
for(j=0; j<pLoop->nLTerm && pTerm!=pLoop->aLTerm[j]; j++){}
|
|
0 |
0 |
for(j=0; j<pLoop->nLTerm && pTerm!=pLoop->aLTerm[j]; j++){}
|
162426
|
0 |
0 |
if( j>=pLoop->nLTerm ) continue;
|
162428
|
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 ){
|
162433
|
6 |
0 |
if( pColl2==0 || sqlite3StrICmp(pColl1->zName, pColl2->zName) ){
|
|
0 |
6 |
if( pColl2==0 || sqlite3StrICmp(pColl1->zName, pColl2->zName) ){
|
162441
|
1360 |
0 |
if( (pLoop->wsFlags & WHERE_ONEROW)==0 ){
|
162442
|
1307 |
53 |
if( pLoop->wsFlags & WHERE_IPK ){
|
162446
|
51 |
2 |
}else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered ){
|
|
0 |
51 |
}else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered ){
|
162459
|
50 |
1 |
&& (pLoop->wsFlags & WHERE_SKIPSCAN)==0;
|
|
50 |
0 |
&& (pLoop->wsFlags & WHERE_SKIPSCAN)==0;
|
162467
|
1424 |
1014 |
for(j=0; j<nColumn; j++){
|
162473
|
16 |
1408 |
if( j<pLoop->u.btree.nEq && j>=pLoop->nSkip ){
|
|
16 |
0 |
if( j<pLoop->u.btree.nEq && j>=pLoop->nSkip ){
|
162488
|
16 |
0 |
if( (eOp & eqOpMask)!=0 ){
|
162489
|
0 |
16 |
if( eOp & (WO_ISNULL|WO_IS) ){
|
162496
|
0 |
0 |
}else if( ALWAYS(eOp & WO_IN) ){
|
162502
|
0 |
0 |
for(i=j+1; i<pLoop->u.btree.nEq; i++){
|
162503
|
0 |
0 |
if( pLoop->aLTerm[i]->pExpr==pX ){
|
162515
|
101 |
1307 |
if( pIndex ){
|
162518
|
16 |
85 |
if( iColumn==pIndex->pTable->iPKey ) iColumn = XN_ROWID;
|
162527
|
1357 |
51 |
if( isOrderDistinct ){
|
162528
|
50 |
1307 |
if( iColumn>=0
|
162529
|
50 |
0 |
&& j>=pLoop->u.btree.nEq
|
162530
|
50 |
0 |
&& pIndex->pTable->aCol[iColumn].notNull==0
|
162534
|
0 |
1357 |
if( iColumn==XN_EXPR ){
|
162543
|
1491 |
267 |
for(i=0; bOnce && i<nOrderBy; i++){
|
|
1448 |
43 |
for(i=0; bOnce && i<nOrderBy; i++){
|
162544
|
56 |
1392 |
if( MASKBIT(i) & obSat ) continue;
|
162548
|
0 |
1392 |
if( NEVER(pOBExpr==0) ) continue;
|
162549
|
1363 |
29 |
if( (wctrlFlags & (WHERE_GROUPBY|WHERE_DISTINCTBY))==0 ) bOnce = 0;
|
162550
|
1392 |
0 |
if( iColumn>=XN_ROWID ){
|
162551
|
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;
|
162552
|
5 |
1387 |
if( pOBExpr->iTable!=iCur ) continue;
|
162553
|
289 |
1098 |
if( pOBExpr->iColumn!=iColumn ) continue;
|
162556
|
0 |
0 |
if( sqlite3ExprCompareSkip(pOBExpr, pIxExpr, iCur) ){
|
162560
|
84 |
1014 |
if( iColumn!=XN_ROWID ){
|
162562
|
0 |
84 |
if( sqlite3StrICmp(pColl->zName, pIndex->azColl[j])!=0 ) continue;
|
162564
|
2 |
1096 |
if( wctrlFlags & WHERE_DISTINCTBY ){
|
162570
|
1098 |
310 |
if( isMatch && (wctrlFlags & WHERE_GROUPBY)==0 ){
|
|
1098 |
0 |
if( isMatch && (wctrlFlags & WHERE_GROUPBY)==0 ){
|
162573
|
34 |
1064 |
if( revSet ){
|
162574
|
34 |
0 |
if( (rev ^ revIdx)
|
162581
|
66 |
998 |
if( rev ) *pRevMask |= MASKBIT(iLoop);
|
162585
|
1064 |
344 |
if( isMatch && (pOrderBy->a[i].fg.sortFlags & KEYINFO_ORDER_BIGNULL) ){
|
|
0 |
1064 |
if( isMatch && (pOrderBy->a[i].fg.sortFlags & KEYINFO_ORDER_BIGNULL) ){
|
162586
|
0 |
0 |
if( j==pLoop->u.btree.nEq ){
|
162592
|
1064 |
344 |
if( isMatch ){
|
162593
|
1014 |
50 |
if( iColumn==XN_ROWID ){
|
162600
|
50 |
294 |
if( j==0 || j<nKeyCol ){
|
|
34 |
16 |
if( j==0 || j<nKeyCol ){
|
162607
|
1014 |
344 |
if( distinctColumns ){
|
162614
|
1014 |
344 |
if( isOrderDistinct ){
|
162616
|
1016 |
1014 |
for(i=0; i<nOrderBy; i++){
|
162619
|
1014 |
2 |
if( MASKBIT(i) & obSat ) continue;
|
162622
|
0 |
2 |
if( mTerm==0 && !sqlite3ExprIsConstant(p) ) continue;
|
|
0 |
0 |
if( mTerm==0 && !sqlite3ExprIsConstant(p) ) continue;
|
162623
|
2 |
0 |
if( (mTerm&~orderDistinctMask)==0 ){
|
162629
|
1034 |
401 |
if( obSat==obDone ) return (i8)nOrderBy;
|
162630
|
324 |
77 |
if( !isOrderDistinct ){
|
162631
|
150 |
288 |
for(i=nOrderBy-1; i>0; i--){
|
162632
|
150 |
0 |
Bitmask m = ALWAYS(i<BMS) ? MASKBIT(i) - 1 : 0;
|
162633
|
36 |
114 |
if( (obSat&m)==m ) return i;
|
162720
|
18 |
115 |
if( nSorted>0 ){
|
162730
|
0 |
133 |
if( (pWInfo->wctrlFlags & WHERE_USE_LIMIT)!=0 ){
|
162732
|
0 |
0 |
if( nSorted!=0 ){
|
162735
|
0 |
0 |
if( pWInfo->iLimit<nRow ){
|
162738
|
2 |
131 |
}else if( (pWInfo->wctrlFlags & WHERE_WANT_DISTINCT) ){
|
162741
|
2 |
0 |
if( nRow>10 ){ nRow -= 10; assert( 10==sqlite3LogEst(2) ); }
|
162785
|
20 |
2326 |
mxChoice = (nLoop<=1) ? 1 : (nLoop==2 ? 5 : 10);
|
|
20 |
0 |
mxChoice = (nLoop<=1) ? 1 : (nLoop==2 ? 5 : 10);
|
162794
|
1292 |
1054 |
if( pWInfo->pOrderBy==0 || nRowEst==0 ){
|
|
646 |
646 |
if( pWInfo->pOrderBy==0 || nRowEst==0 ){
|
162804
|
0 |
2346 |
if( pSpace==0 ) return SQLITE_NOMEM_BKPT;
|
162809
|
4852 |
2346 |
for(ii=mxChoice*2, pFrom=aTo; ii>0; ii--, pFrom++, pX += nLoop){
|
162812
|
646 |
1700 |
if( nOrderBy ){
|
162833
|
646 |
1700 |
if( nOrderBy ){
|
162840
|
0 |
646 |
aFrom[0].isOrdered = nLoop>0 ? -1 : nOrderBy;
|
162846
|
1856 |
2346 |
for(iLoop=0; iLoop<nLoop; iLoop++){
|
162848
|
1872 |
1856 |
for(ii=0, pFrom=aFrom; ii<nFrom; ii++, pFrom++){
|
162849
|
2768 |
1872 |
for(pWLoop=pWInfo->pLoops; pWLoop; pWLoop=pWLoop->pNextLoop){
|
162857
|
36 |
2732 |
if( (pWLoop->prereq & ~pFrom->maskLoop)!=0 ) continue;
|
162858
|
40 |
2692 |
if( (pWLoop->maskSelf & pFrom->maskLoop)!=0 ) continue;
|
162859
|
748 |
1944 |
if( (pWLoop->wsFlags & WHERE_AUTO_INDEX)!=0 && pFrom->nRow<3 ){
|
|
740 |
8 |
if( (pWLoop->wsFlags & WHERE_AUTO_INDEX)!=0 && pFrom->nRow<3 ){
|
162875
|
687 |
1265 |
if( isOrdered<0 ){
|
162883
|
1917 |
35 |
if( isOrdered>=0 && isOrdered<nOrderBy ){
|
|
146 |
1771 |
if( isOrdered>=0 && isOrdered<nOrderBy ){
|
162884
|
133 |
13 |
if( aSortCost[isOrdered]==0 ){
|
162906
|
1904 |
48 |
if( iLoop==0 && (pWLoop->wsFlags & WHERE_VIEWSCAN)!=0 ){
|
|
43 |
1861 |
if( iLoop==0 && (pWLoop->wsFlags & WHERE_VIEWSCAN)!=0 ){
|
162922
|
96 |
1876 |
for(jj=0, pTo=aTo; jj<nTo; jj++, pTo++){
|
162923
|
80 |
16 |
if( pTo->maskLoop==maskNew
|
162924
|
76 |
4 |
&& ((pTo->isOrdered^isOrdered)&0x80)==0
|
162930
|
1876 |
76 |
if( jj>=nTo ){
|
162932
|
0 |
1876 |
if( nTo>=mxChoice
|
162933
|
0 |
0 |
&& (rCost>mxCost || (rCost==mxCost && rUnsorted>=mxUnsorted))
|
|
0 |
0 |
&& (rCost>mxCost || (rCost==mxCost && rUnsorted>=mxUnsorted))
|
|
0 |
0 |
&& (rCost>mxCost || (rCost==mxCost && rUnsorted>=mxUnsorted))
|
162949
|
1876 |
0 |
if( nTo<mxChoice ){
|
162973
|
63 |
13 |
if( pTo->rCost<rCost
|
162974
|
5 |
58 |
|| (pTo->rCost==rCost
|
162975
|
5 |
0 |
&& (pTo->nRow<nOut
|
162976
|
5 |
0 |
|| (pTo->nRow==nOut && pTo->rUnsorted<=rUnsorted)
|
|
5 |
0 |
|| (pTo->nRow==nOut && pTo->rUnsorted<=rUnsorted)
|
163019
|
1866 |
68 |
if( nTo>=mxChoice ){
|
163023
|
0 |
1866 |
for(jj=1, pTo=&aTo[1]; jj<mxChoice; jj++, pTo++){
|
163024
|
0 |
0 |
if( pTo->rCost>mxCost
|
163025
|
0 |
0 |
|| (pTo->rCost==mxCost && pTo->rUnsorted>mxUnsorted)
|
|
0 |
0 |
|| (pTo->rCost==mxCost && pTo->rUnsorted>mxUnsorted)
|
163059
|
0 |
2346 |
if( nFrom==0 ){
|
163067
|
4 |
2346 |
for(ii=1; ii<nFrom; ii++){
|
163068
|
4 |
0 |
if( pFrom->rCost>aFrom[ii].rCost ) pFrom = &aFrom[ii];
|
163072
|
1856 |
2346 |
for(iLoop=0; iLoop<nLoop; iLoop++){
|
163078
|
8 |
2338 |
if( (pWInfo->wctrlFlags & WHERE_WANT_DISTINCT)!=0
|
163079
|
0 |
8 |
&& (pWInfo->wctrlFlags & WHERE_DISTINCTBY)==0
|
163080
|
0 |
0 |
&& pWInfo->eDistinct==WHERE_DISTINCT_NOOP
|
163081
|
0 |
0 |
&& nRowEst
|
163086
|
0 |
0 |
if( rc==pWInfo->pResultSet->nExpr ){
|
163091
|
1292 |
1054 |
if( pWInfo->pOrderBy ){
|
163093
|
8 |
1284 |
if( pWInfo->wctrlFlags & WHERE_DISTINCTBY ){
|
163094
|
0 |
8 |
if( pFrom->isOrdered==pWInfo->pOrderBy->nExpr ){
|
163097
|
0 |
8 |
if( pWInfo->pSelect->pOrderBy
|
163098
|
0 |
0 |
&& pWInfo->nOBSat > pWInfo->pSelect->pOrderBy->nExpr ){
|
163103
|
750 |
534 |
if( pWInfo->nOBSat<=0 ){
|
163105
|
750 |
0 |
if( nLoop>0 ){
|
163107
|
750 |
0 |
if( (wsFlags & WHERE_ONEROW)==0
|
163108
|
750 |
0 |
&& (wsFlags&(WHERE_IPK|WHERE_COLUMN_IN))!=(WHERE_IPK|WHERE_COLUMN_IN)
|
163115
|
516 |
234 |
if( rc==pWInfo->pOrderBy->nExpr ){
|
163121
|
534 |
0 |
}else if( nLoop
|
163122
|
534 |
0 |
&& pWInfo->nOBSat==1
|
163123
|
16 |
518 |
&& (pWInfo->wctrlFlags & (WHERE_ORDERBY_MIN|WHERE_ORDERBY_MAX))!=0
|
163128
|
2 |
1290 |
if( (pWInfo->wctrlFlags & WHERE_SORTBYGROUP)
|
163129
|
0 |
2 |
&& pWInfo->nOBSat==pWInfo->pOrderBy->nExpr && nLoop>0
|
|
0 |
0 |
&& pWInfo->nOBSat==pWInfo->pOrderBy->nExpr && nLoop>0
|
163136
|
0 |
0 |
if( nOrder==pWInfo->pOrderBy->nExpr ){
|
163175
|
5 |
1704 |
if( pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE ) return 0;
|
163179
|
136 |
1568 |
if( IsVirtual(pTab) ) return 0;
|
163180
|
1568 |
0 |
if( pItem->fg.isIndexedBy || pItem->fg.notIndexed ){
|
|
0 |
1568 |
if( pItem->fg.isIndexedBy || pItem->fg.notIndexed ){
|
163191
|
525 |
1043 |
while( pTerm && pTerm->prereqRight ) pTerm = whereScanNext(&scan);
|
|
0 |
525 |
while( pTerm && pTerm->prereqRight ) pTerm = whereScanNext(&scan);
|
163192
|
525 |
1043 |
if( pTerm ){
|
163201
|
62 |
1038 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
|
163204
|
60 |
2 |
if( !IsUniqueIndex(pIdx)
|
163205
|
60 |
0 |
|| pIdx->pPartIdxWhere!=0
|
163206
|
1 |
59 |
|| pIdx->nKeyCol>ArraySize(pLoop->aLTermSpace)
|
163208
|
9 |
50 |
opMask = pIdx->uniqNotNull ? (WO_EQ|WO_IS) : WO_EQ;
|
163209
|
75 |
5 |
for(j=0; j<pIdx->nKeyCol; j++){
|
163211
|
21 |
54 |
while( pTerm && pTerm->prereqRight ) pTerm = whereScanNext(&scan);
|
|
0 |
21 |
while( pTerm && pTerm->prereqRight ) pTerm = whereScanNext(&scan);
|
163212
|
54 |
21 |
if( pTerm==0 ) break;
|
163216
|
54 |
5 |
if( j!=pIdx->nKeyCol ) continue;
|
163218
|
5 |
0 |
if( pIdx->isCovering || (pItem->colUsed & pIdx->colNotIdxed)==0 ){
|
|
0 |
5 |
if( pIdx->isCovering || (pItem->colUsed & pIdx->colNotIdxed)==0 ){
|
163229
|
530 |
1038 |
if( pLoop->wsFlags ){
|
163236
|
0 |
530 |
if( pWInfo->pOrderBy ) pWInfo->nOBSat = pWInfo->pOrderBy->nExpr;
|
163237
|
0 |
530 |
if( pWInfo->wctrlFlags & WHERE_WANT_DISTINCT ){
|
163240
|
0 |
530 |
if( scan.iEquiv>1 ) pLoop->wsFlags |= WHERE_TRANSCONS;
|
163258
|
9 |
43 |
if( pExpr->op==TK_FUNCTION && ExprHasProperty(pExpr, EP_ConstFunc)==0 ){
|
|
0 |
9 |
if( pExpr->op==TK_FUNCTION && ExprHasProperty(pExpr, EP_ConstFunc)==0 ){
|
163356
|
8 |
2 |
if( pWInfo->pOrderBy ){
|
163360
|
10 |
10 |
for(i=pWInfo->nLevel-1; i>=1; i--){
|
163366
|
7 |
3 |
if( (pItem->fg.jointype & (JT_LEFT|JT_RIGHT))!=JT_LEFT ) continue;
|
163367
|
2 |
1 |
if( (pWInfo->wctrlFlags & WHERE_WANT_DISTINCT)==0
|
163368
|
2 |
0 |
&& (pLoop->wsFlags & WHERE_ONEROW)==0
|
163372
|
0 |
1 |
if( (tabUsed & pLoop->maskSelf)!=0 ) continue;
|
163374
|
1 |
0 |
for(pTerm=pWInfo->sWC.a; pTerm<pEnd; pTerm++){
|
163375
|
1 |
0 |
if( (pTerm->prereqAll & pLoop->maskSelf)!=0 ){
|
163376
|
0 |
1 |
if( !ExprHasProperty(pTerm->pExpr, EP_OuterON)
|
163377
|
0 |
0 |
|| pTerm->pExpr->w.iJoin!=pItem->iCursor
|
163382
|
0 |
0 |
if( hasRightJoin
|
163383
|
0 |
0 |
&& ExprHasProperty(pTerm->pExpr, EP_InnerON)
|
163384
|
0 |
0 |
&& pTerm->pExpr->w.iJoin==pItem->iCursor
|
163389
|
1 |
0 |
if( pTerm<pEnd ) continue;
|
163392
|
0 |
0 |
for(pTerm=pWInfo->sWC.a; pTerm<pEnd; pTerm++){
|
163393
|
0 |
0 |
if( (pTerm->prereqAll & pLoop->maskSelf)!=0 ){
|
163397
|
0 |
0 |
if( i!=pWInfo->nLevel-1 ){
|
163433
|
11 |
0 |
for(i=0; i<pWInfo->nLevel; i++){
|
163438
|
11 |
0 |
if( (pTab->tabFlags & TF_HasStat1)==0 ) break;
|
163440
|
0 |
0 |
if( i>=1
|
163441
|
0 |
0 |
&& (pLoop->wsFlags & reqFlags)==reqFlags
|
163443
|
0 |
0 |
&& ALWAYS((pLoop->wsFlags & (WHERE_IPK|WHERE_INDEXED))!=0)
|
163445
|
0 |
0 |
if( nSearch > pTab->nRowLogEst ){
|
163466
|
0 |
0 |
while( pParse->pIdxEpr!=0 ){
|
163496
|
0 |
0 |
for(i=0; i<pIdx->nColumn; i++){
|
163500
|
0 |
0 |
if( j==XN_EXPR ){
|
163506
|
0 |
0 |
}else if( j>=0 && (pTab->aCol[j].colFlags & COLFLAG_VIRTUAL)!=0 ){
|
|
0 |
0 |
}else if( j>=0 && (pTab->aCol[j].colFlags & COLFLAG_VIRTUAL)!=0 ){
|
163512
|
0 |
0 |
if( sqlite3ExprIsConstant(pExpr) ) continue;
|
163514
|
0 |
0 |
if( p==0 ) break;
|
163527
|
0 |
0 |
if( sqlite3IndexAffinityStr(pParse->db, pIdx) ){
|
163534
|
0 |
0 |
if( p->pIENext==0 ){
|
163668
|
642 |
1588 |
if( pOrderBy && pOrderBy->nExpr>=BMS ) pOrderBy = 0;
|
|
0 |
642 |
if( pOrderBy && pOrderBy->nExpr>=BMS ) pOrderBy = 0;
|
163674
|
0 |
2230 |
if( pTabList->nSrc>BMS ){
|
163684
|
2225 |
5 |
nTabList = (wctrlFlags & WHERE_OR_SUBCLAUSE) ? 1 : pTabList->nSrc;
|
163695
|
0 |
2230 |
if( db->mallocFailed ){
|
163740
|
510 |
1720 |
if( nTabList==0 ){
|
163741
|
0 |
510 |
if( pOrderBy ) pWInfo->nOBSat = pOrderBy->nExpr;
|
163742
|
0 |
510 |
if( (wctrlFlags & WHERE_WANT_DISTINCT)!=0
|
163743
|
0 |
0 |
&& OptimizationEnabled(db, SQLITE_DistinctOpt)
|
163767
|
11 |
1720 |
}while( (++ii)<pTabList->nSrc );
|
163782
|
1916 |
314 |
if( pSelect && pSelect->pLimit ){
|
|
20 |
1896 |
if( pSelect && pSelect->pLimit ){
|
163785
|
0 |
2230 |
if( pParse->nErr ) goto whereBeginError;
|
163813
|
1656 |
2230 |
for(ii=0; ii<sWLB.pWC->nBase; ii++){
|
163816
|
0 |
1656 |
if( pT->wtFlags & TERM_VIRTUAL ) continue;
|
163820
|
62 |
1594 |
if( pT->prereqAll==0 /* Conditions (1) and (2) */
|
163821
|
18 |
44 |
&& (nTabList==0 || exprIsDeterministic(pX)) /* Condition (4) */
|
|
18 |
0 |
&& (nTabList==0 || exprIsDeterministic(pX)) /* Condition (4) */
|
163822
|
0 |
62 |
&& !(ExprHasProperty(pX, EP_InnerON) /* Condition (3) */
|
|
0 |
0 |
&& !(ExprHasProperty(pX, EP_InnerON) /* Condition (3) */
|
163830
|
4 |
2226 |
if( wctrlFlags & WHERE_WANT_DISTINCT ){
|
163831
|
0 |
4 |
if( OptimizationDisabled(db, SQLITE_DistinctOpt) ){
|
163836
|
0 |
4 |
}else if( isDistinctRedundant(pParse, pTabList, &pWInfo->sWC, pResultSet) ){
|
163839
|
4 |
0 |
}else if( pOrderBy==0 ){
|
163871
|
1709 |
521 |
if( nTabList!=1 || whereShortCut(&sWLB)==0 ){
|
|
1179 |
530 |
if( nTabList!=1 || whereShortCut(&sWLB)==0 ){
|
163873
|
0 |
1700 |
if( rc ) goto whereBeginError;
|
163898
|
0 |
1700 |
if( db->mallocFailed ) goto whereBeginError;
|
163899
|
646 |
1054 |
if( pWInfo->pOrderBy ){
|
163901
|
0 |
646 |
if( db->mallocFailed ) goto whereBeginError;
|
163904
|
1584 |
646 |
if( pWInfo->pOrderBy==0 && (db->flags & SQLITE_ReverseOrder)!=0 ){
|
|
0 |
1584 |
if( pWInfo->pOrderBy==0 && (db->flags & SQLITE_ReverseOrder)!=0 ){
|
163907
|
0 |
2230 |
if( pParse->nErr ){
|
163949
|
11 |
2219 |
if( pWInfo->nLevel>=2
|
163950
|
10 |
1 |
&& pResultSet!=0 /* these two combine to guarantee */
|
163951
|
10 |
0 |
&& 0==(wctrlFlags & WHERE_AGG_DISTINCT) /* condition (1) above */
|
163952
|
10 |
0 |
&& OptimizationEnabled(db, SQLITE_OmitNoopJoin)
|
163962
|
11 |
2219 |
if( pWInfo->nLevel>=2
|
163963
|
11 |
0 |
&& OptimizationEnabled(db, SQLITE_BloomFilter)
|
163997
|
309 |
1921 |
if( (wctrlFlags & WHERE_ONEPASS_DESIRED)!=0 ){
|
164001
|
40 |
269 |
if( bOnerow || (
|
|
33 |
7 |
if( bOnerow || (
|
164003
|
32 |
1 |
&& !IsVirtual(pTabList->a[0].pTab)
|
164004
|
0 |
32 |
&& (0==(wsFlags & WHERE_MULTI_OR) || (wctrlFlags & WHERE_DUPLICATES_OK))
|
|
0 |
0 |
&& (0==(wsFlags & WHERE_MULTI_OR) || (wctrlFlags & WHERE_DUPLICATES_OK))
|
164006
|
269 |
32 |
pWInfo->eOnePass = bOnerow ? ONEPASS_SINGLE : ONEPASS_MULTI;
|
164007
|
301 |
0 |
if( HasRowid(pTabList->a[0].pTab) && (wsFlags & WHERE_IDX_ONLY) ){
|
|
9 |
292 |
if( HasRowid(pTabList->a[0].pTab) && (wsFlags & WHERE_IDX_ONLY) ){
|
164008
|
9 |
0 |
if( wctrlFlags & WHERE_ONEPASS_MULTIROW ){
|
164019
|
1731 |
2230 |
for(ii=0, pLevel=pWInfo->a; ii<nTabList; ii++, pLevel++){
|
164028
|
1709 |
22 |
if( (pTab->tabFlags & TF_Ephemeral)!=0 || IsView(pTab) ){
|
|
1709 |
0 |
if( (pTab->tabFlags & TF_Ephemeral)!=0 || IsView(pTab) ){
|
164032
|
148 |
1561 |
if( (pLoop->wsFlags & WHERE_VIRTUALTABLE)!=0 ){
|
164036
|
1561 |
0 |
}else if( IsVirtual(pTab) ){
|
164040
|
1549 |
12 |
if( ((pLoop->wsFlags & WHERE_IDX_ONLY)==0
|
164041
|
1 |
1548 |
&& (wctrlFlags & WHERE_OR_SUBCLAUSE)==0)
|
164042
|
0 |
13 |
|| (pTabItem->fg.jointype & (JT_LTORJ|JT_RIGHT))!=0
|
164045
|
301 |
1247 |
if( pWInfo->eOnePass!=ONEPASS_OFF ){
|
164053
|
1247 |
301 |
if( pWInfo->eOnePass==ONEPASS_OFF
|
164054
|
1247 |
0 |
&& pTab->nCol<BMS
|
164055
|
1247 |
0 |
&& (pTab->tabFlags & (TF_HasGenerated|TF_WithoutRowid))==0
|
164056
|
1246 |
1 |
&& (pLoop->wsFlags & (WHERE_AUTO_INDEX|WHERE_BLOOMFILTER))==0
|
164063
|
4237 |
1246 |
for(; b; b=b>>1, n++){}
|
164082
|
43 |
1688 |
if( pLoop->wsFlags & WHERE_INDEXED ){
|
164088
|
0 |
43 |
if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIx)
|
|
0 |
0 |
if( !HasRowid(pTab) && IsPrimaryKeyIndex(pIx)
|
164089
|
0 |
0 |
&& (wctrlFlags & WHERE_OR_SUBCLAUSE)!=0
|
164095
|
9 |
34 |
}else if( pWInfo->eOnePass!=ONEPASS_OFF ){
|
164099
|
9 |
0 |
while( ALWAYS(pJ) && pJ!=pIx ){
|
|
0 |
9 |
while( ALWAYS(pJ) && pJ!=pIx ){
|
164105
|
26 |
8 |
}else if( iAuxArg && (wctrlFlags & WHERE_OR_SUBCLAUSE)!=0 ){
|
|
4 |
22 |
}else if( iAuxArg && (wctrlFlags & WHERE_OR_SUBCLAUSE)!=0 ){
|
164110
|
0 |
30 |
if( pIx->bHasExpr && OptimizationEnabled(db, SQLITE_IndexedExpr) ){
|
|
0 |
0 |
if( pIx->bHasExpr && OptimizationEnabled(db, SQLITE_IndexedExpr) ){
|
164118
|
43 |
0 |
if( op ){
|
164121
|
43 |
0 |
if( (pLoop->wsFlags & WHERE_CONSTRAINT)!=0
|
164122
|
23 |
20 |
&& (pLoop->wsFlags & (WHERE_COLUMN_RANGE|WHERE_SKIPSCAN))==0
|
164123
|
23 |
0 |
&& (pLoop->wsFlags & WHERE_BIGNULL_SORT)==0
|
164124
|
23 |
0 |
&& (pLoop->wsFlags & WHERE_IN_SEEKSCAN)==0
|
164125
|
23 |
0 |
&& (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)==0
|
164126
|
23 |
0 |
&& pWInfo->eDistinct!=WHERE_DISTINCT_ORDERED
|
164148
|
1709 |
22 |
if( iDb>=0 ) sqlite3CodeVerifySchema(pParse, iDb);
|
164149
|
0 |
1731 |
if( (pTabItem->fg.jointype & JT_RIGHT)!=0
|
164150
|
0 |
0 |
&& (pLevel->pRJ = sqlite3WhereMalloc(pWInfo, sizeof(WhereRightJoin)))!=0
|
164159
|
0 |
0 |
if( HasRowid(pTab) ){
|
164163
|
0 |
0 |
if( pInfo ){
|
164182
|
0 |
2230 |
if( db->mallocFailed ) goto whereBeginError;
|
164188
|
1731 |
2230 |
for(ii=0; ii<nTabList; ii++){
|
164192
|
0 |
1731 |
if( pParse->nErr ) goto whereBeginError;
|
164196
|
0 |
1731 |
if( pSrc->fg.isMaterialized ){
|
164197
|
0 |
0 |
if( pSrc->fg.isCorrelated ){
|
164206
|
1 |
1730 |
if( (wsFlags & (WHERE_AUTO_INDEX|WHERE_BLOOMFILTER))!=0 ){
|
164207
|
1 |
0 |
if( (wsFlags & WHERE_AUTO_INDEX)!=0 ){
|
164214
|
0 |
1 |
if( db->mallocFailed ) goto whereBeginError;
|
164222
|
1729 |
2 |
if( (wsFlags&WHERE_MULTI_OR)==0 && (wctrlFlags&WHERE_OR_SUBCLAUSE)==0 ){
|
164234
|
0 |
0 |
if( pWInfo ){
|
164299
|
1731 |
2230 |
for(i=pWInfo->nLevel-1; i>=0; i--){
|
164302
|
0 |
1731 |
if( pLevel->pRJ ){
|
164314
|
1198 |
533 |
if( pLevel->op!=OP_Noop ){
|
164319
|
0 |
1198 |
if( pWInfo->eDistinct==WHERE_DISTINCT_ORDERED
|
164320
|
0 |
0 |
&& i==pWInfo->nLevel-1 /* Ticket [ef9318757b152e3] 2017-10-21 */
|
164321
|
0 |
0 |
&& (pLoop->wsFlags & WHERE_INDEXED)!=0
|
164322
|
0 |
0 |
&& (pIdx = pLoop->u.btree.pIndex)->hasStat1
|
164323
|
0 |
0 |
&& (n = pLoop->u.btree.nDistinctCol)>0
|
164324
|
0 |
0 |
&& pIdx->aiRowLogEst[n]>=36
|
164328
|
0 |
0 |
for(j=0; j<n; j++){
|
164332
|
0 |
0 |
op = pLevel->op==OP_Prev ? OP_SeekLT : OP_SeekGT;
|
164340
|
1198 |
0 |
if( pLevel->addrCont ) sqlite3VdbeResolveLabel(v, pLevel->addrCont);
|
164347
|
0 |
1198 |
if( pLevel->regBignull ){
|
164353
|
0 |
1198 |
if( addrSeek ) sqlite3VdbeJumpHere(v, addrSeek);
|
164355
|
533 |
0 |
}else if( pLevel->addrCont ){
|
164358
|
3 |
1728 |
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 ){
|
164362
|
3 |
3 |
for(j=pLevel->u.in.nIn, pIn=&pLevel->u.in.aInLoop[j-1]; j>0; j--, pIn--){
|
164366
|
3 |
0 |
if( pIn->eEndLoopOp!=OP_Noop ){
|
164367
|
0 |
3 |
if( pIn->nPrefix ){
|
164370
|
0 |
0 |
&& (pLoop->wsFlags & WHERE_IN_EARLYOUT)!=0;
|
|
0 |
0 |
&& (pLoop->wsFlags & WHERE_IN_EARLYOUT)!=0;
|
164371
|
0 |
0 |
if( pLevel->iLeftJoin ){
|
164384
|
0 |
0 |
if( bEarlyOut ){
|
164405
|
0 |
1731 |
if( pLevel->pRJ ){
|
164409
|
0 |
1731 |
if( pLevel->addrSkip ){
|
164416
|
0 |
1731 |
if( pLevel->addrLikeRep ){
|
164422
|
3 |
1728 |
if( pLevel->iLeftJoin ){
|
164426
|
3 |
0 |
if( (ws & WHERE_IDX_ONLY)==0 ){
|
164430
|
3 |
0 |
if( (ws & WHERE_INDEXED)
|
164431
|
0 |
3 |
|| ((ws & WHERE_MULTI_OR) && pLevel->u.pCoveringIdx)
|
|
0 |
0 |
|| ((ws & WHERE_MULTI_OR) && pLevel->u.pCoveringIdx)
|
164433
|
0 |
0 |
if( ws & WHERE_MULTI_OR ){
|
164441
|
0 |
3 |
if( pLevel->op==OP_Return ){
|
164453
|
1731 |
2230 |
for(i=0, pLevel=pWInfo->a; i<pWInfo->nLevel; i++, pLevel++){
|
164466
|
0 |
1731 |
if( pLevel->pRJ ){
|
164475
|
22 |
1709 |
if( pTabItem->fg.viaCoroutine ){
|
164493
|
44 |
1665 |
if( pLoop->wsFlags & (WHERE_INDEXED|WHERE_IDX_ONLY) ){
|
164495
|
2 |
1663 |
}else if( pLoop->wsFlags & WHERE_MULTI_OR ){
|
164498
|
44 |
1665 |
if( pIdx
|
164499
|
44 |
0 |
&& !db->mallocFailed
|
164501
|
9 |
35 |
if( pWInfo->eOnePass==ONEPASS_OFF || !HasRowid(pIdx->pTable) ){
|
|
0 |
9 |
if( pWInfo->eOnePass==ONEPASS_OFF || !HasRowid(pIdx->pTable) ){
|
164506
|
0 |
44 |
if( pIdx->bHasExpr ){
|
164508
|
0 |
0 |
while( p ){
|
164509
|
0 |
0 |
if( p->iIdxCur==pLevel->iIdxCur ){
|
164539
|
129 |
416 |
if( pOp->p1!=pLevel->iTabCur ){
|
164541
|
100 |
29 |
}else if( pOp->opcode==OP_Column
|
164553
|
0 |
100 |
if( !HasRowid(pTab) ){
|
164562
|
51 |
49 |
if( x>=0 ){
|
164582
|
4 |
25 |
}else if( pOp->opcode==OP_Rowid ){
|
164586
|
0 |
25 |
}else if( pOp->opcode==OP_IfNullRow ){
|
164593
|
501 |
44 |
}while( (++pOp)<pLastOp );
|
164767
|
0 |
0 |
if( p ) (*p)++;
|
164773
|
0 |
0 |
sqlite3_result_int64(pCtx, (p ? *p : 0));
|
164799
|
0 |
0 |
if( p ) p->nStep = 1;
|
164806
|
0 |
0 |
if( p ){
|
164807
|
0 |
0 |
if( p->nStep ){
|
164831
|
0 |
0 |
if( p ){
|
164839
|
0 |
0 |
if( ((i64)fVal)!=fVal ) goto error_out;
|
164846
|
0 |
0 |
if( iVal<=0 ) goto error_out;
|
164849
|
0 |
0 |
if( iVal==p->nStep ){
|
164851
|
0 |
0 |
if( !p->pValue ){
|
164868
|
0 |
0 |
if( p && p->pValue ){
|
|
0 |
0 |
if( p && p->pValue ){
|
164884
|
0 |
0 |
if( p && p->pValue==0 ){
|
|
0 |
0 |
if( p && p->pValue==0 ){
|
164886
|
0 |
0 |
if( !p->pValue ){
|
164896
|
0 |
0 |
if( p && p->pValue ){
|
|
0 |
0 |
if( p && p->pValue ){
|
164918
|
0 |
0 |
if( p ){
|
164920
|
0 |
0 |
if( p->nValue==0 ){
|
164930
|
0 |
0 |
if( p ){
|
164951
|
0 |
0 |
if( p ){
|
164969
|
0 |
0 |
if( p ){
|
164971
|
0 |
0 |
if( p->nTotal>1 ){
|
164996
|
0 |
0 |
if( p ){
|
165014
|
0 |
0 |
if( p ){
|
165044
|
0 |
0 |
if( p ){
|
165045
|
0 |
0 |
if( p->nTotal==0 ){
|
165047
|
0 |
0 |
if( p->nParam<=0 ){
|
165070
|
0 |
0 |
if( p && p->nParam>0 ){
|
|
0 |
0 |
if( p && p->nParam>0 ){
|
165072
|
0 |
0 |
if( nSize==0 ){
|
165081
|
0 |
0 |
if( iRow<iSmall ){
|
165110
|
0 |
0 |
if( p ){
|
165113
|
0 |
0 |
if( p->pVal==0 ){
|
165129
|
0 |
0 |
if( ALWAYS(p) ){
|
165131
|
0 |
0 |
if( p->nVal==0 ){
|
165140
|
0 |
0 |
if( p && p->pVal ){
|
|
0 |
0 |
if( p && p->pVal ){
|
165147
|
0 |
0 |
if( p && p->pVal ){
|
|
0 |
0 |
if( p && p->pVal ){
|
165247
|
0 |
0 |
for(p=pList; p; p=p->pNextWin){
|
165248
|
0 |
0 |
if( sqlite3StrICmp(p->zName, zName)==0 ) break;
|
165250
|
0 |
0 |
if( p==0 ){
|
165279
|
0 |
0 |
if( pWin->zName && pWin->eFrmType==0 ){
|
|
0 |
0 |
if( pWin->zName && pWin->eFrmType==0 ){
|
165281
|
0 |
0 |
if( p==0 ) return;
|
165293
|
0 |
0 |
if( (pWin->eFrmType==TK_RANGE)
|
165294
|
0 |
0 |
&& (pWin->pStart || pWin->pEnd)
|
|
0 |
0 |
&& (pWin->pStart || pWin->pEnd)
|
165295
|
0 |
0 |
&& (pWin->pOrderBy==0 || pWin->pOrderBy->nExpr!=1)
|
|
0 |
0 |
&& (pWin->pOrderBy==0 || pWin->pOrderBy->nExpr!=1)
|
165301
|
0 |
0 |
if( pFunc->funcFlags & SQLITE_FUNC_WINDOW ){
|
165303
|
0 |
0 |
if( pWin->pFilter ){
|
165324
|
0 |
0 |
for(i=0; i<ArraySize(aUp); i++){
|
165325
|
0 |
0 |
if( pFunc->zName==aUp[i].zFunc ){
|
165333
|
0 |
0 |
if( pWin->eStart==TK_FOLLOWING ){
|
165373
|
0 |
0 |
if( p->pSubSelect ){
|
165374
|
0 |
0 |
if( pExpr->op!=TK_COLUMN ){
|
165379
|
0 |
0 |
for(i=0; i<nSrc; i++){
|
165380
|
0 |
0 |
if( pExpr->iTable==p->pSrc->a[i].iCursor ) break;
|
165382
|
0 |
0 |
if( i==nSrc ) return WRC_Continue;
|
165389
|
0 |
0 |
if( !ExprHasProperty(pExpr, EP_WinFunc) ){
|
165393
|
0 |
0 |
for(pWin=p->pWin; pWin; pWin=pWin->pNextWin){
|
165394
|
0 |
0 |
if( pExpr->y.pWin==pWin ){
|
165406
|
0 |
0 |
if( pParse->db->mallocFailed ) return WRC_Abort;
|
165407
|
0 |
0 |
if( p->pSub ){
|
165409
|
0 |
0 |
for(i=0; i<p->pSub->nExpr; i++){
|
165410
|
0 |
0 |
if( 0==sqlite3ExprCompare(0, p->pSub->a[i].pExpr, pExpr, -1) ){
|
165416
|
0 |
0 |
if( iCol<0 ){
|
165418
|
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;
|
165421
|
0 |
0 |
if( p->pSub ){
|
165430
|
0 |
0 |
pExpr->iColumn = (iCol<0 ? p->pSub->nExpr-1: iCol);
|
165435
|
0 |
0 |
if( pParse->db->mallocFailed ) return WRC_Abort;
|
165448
|
0 |
0 |
if( pSave==pSelect ){
|
165512
|
0 |
0 |
if( pAppend ){
|
165514
|
0 |
0 |
int nInit = pList ? pList->nExpr : 0;
|
165515
|
0 |
0 |
for(i=0; i<pAppend->nExpr; i++){
|
165518
|
0 |
0 |
if( db->mallocFailed ){
|
165522
|
0 |
0 |
if( bIntToNull ){
|
165526
|
0 |
0 |
if( sqlite3ExprIsInteger(pSub, &iDummy) ){
|
165533
|
0 |
0 |
if( pList ) pList->a[nInit+i].fg.sortFlags = pAppend->a[i].fg.sortFlags;
|
165548
|
0 |
0 |
if( pExpr->op==TK_AGG_FUNCTION
|
165549
|
0 |
0 |
&& pExpr->op2>=pWalker->walkerDepth
|
165557
|
0 |
0 |
if( pExpr->op==TK_AGG_FUNCTION && pExpr->pAggInfo==0 ){
|
|
0 |
0 |
if( pExpr->op==TK_AGG_FUNCTION && pExpr->pAggInfo==0 ){
|
165574
|
0 |
2004 |
if( p->pWin
|
165575
|
0 |
0 |
&& p->pPrior==0
|
165576
|
0 |
0 |
&& ALWAYS((p->selFlags & SF_WinRewrite)==0)
|
165577
|
0 |
0 |
&& ALWAYS(!IN_RENAME_OBJECT)
|
165597
|
0 |
0 |
if( pTab==0 ){
|
165602
|
0 |
0 |
if( (p->selFlags & SF_Aggregate)==0 ){
|
165620
|
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 ){
|
165623
|
0 |
0 |
if( sqlite3ExprListCompare(pSort, p->pOrderBy, -1)==0 ){
|
165638
|
0 |
0 |
pMWin->nBufferCol = (pSublist ? pSublist->nExpr : 0);
|
165650
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
|
165655
|
0 |
0 |
if( pWin->pWFunc->funcFlags & SQLITE_FUNC_SUBTYPE ){
|
165657
|
0 |
0 |
pWin->iArgCol = (pSublist ? pSublist->nExpr : 0);
|
165660
|
0 |
0 |
pWin->iArgCol = (pSublist ? pSublist->nExpr : 0);
|
165663
|
0 |
0 |
if( pWin->pFilter ){
|
165678
|
0 |
0 |
if( pSublist==0 ){
|
165694
|
0 |
0 |
if( p->pSrc ){
|
165702
|
0 |
0 |
if( pTab2==0 ){
|
165721
|
0 |
0 |
if( db->mallocFailed ) rc = SQLITE_NOMEM;
|
165738
|
0 |
0 |
if( p->ppThis ){
|
165740
|
0 |
0 |
if( p->pNextWin ) p->pNextWin->ppThis = p->ppThis;
|
165749
|
0 |
0 |
if( p ){
|
165766
|
0 |
0 |
while( p ){
|
165781
|
0 |
0 |
if( 0==sqlite3ExprIsConstant(pExpr) ){
|
165782
|
0 |
0 |
if( IN_RENAME_OBJECT ) sqlite3RenameExprUnmap(pParse, pExpr);
|
165813
|
0 |
0 |
if( eType==0 ){
|
165832
|
0 |
0 |
if( (eStart==TK_CURRENT && eEnd==TK_PRECEDING)
|
|
0 |
0 |
if( (eStart==TK_CURRENT && eEnd==TK_PRECEDING)
|
165833
|
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))
|
165840
|
0 |
0 |
if( pWin==0 ) goto windowAllocErr;
|
165844
|
0 |
0 |
if( eExclude==0 && OptimizationDisabled(pParse->db, SQLITE_WindowFunc) ){
|
|
0 |
0 |
if( eExclude==0 && OptimizationDisabled(pParse->db, SQLITE_WindowFunc) ){
|
165871
|
0 |
0 |
if( pWin ){
|
165874
|
0 |
0 |
if( pBase ){
|
165892
|
0 |
0 |
if( pWin->zBase ){
|
165895
|
0 |
0 |
if( pExist ){
|
165898
|
0 |
0 |
if( pWin->pPartition ){
|
165900
|
0 |
0 |
}else if( pExist->pOrderBy && pWin->pOrderBy ){
|
|
0 |
0 |
}else if( pExist->pOrderBy && pWin->pOrderBy ){
|
165902
|
0 |
0 |
}else if( pExist->bImplicitFrame==0 ){
|
165905
|
0 |
0 |
if( zErr ){
|
165911
|
0 |
0 |
if( pExist->pOrderBy ){
|
165926
|
0 |
0 |
if( p ){
|
165932
|
0 |
0 |
if( (p->flags & EP_Distinct) && pWin->eFrmType!=TK_FILTER ){
|
|
0 |
0 |
if( (p->flags & EP_Distinct) && pWin->eFrmType!=TK_FILTER ){
|
165949
|
0 |
0 |
if( pSel ){
|
165950
|
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) ){
|
165952
|
0 |
0 |
if( pSel->pWin ){
|
165958
|
0 |
0 |
if( sqlite3ExprListCompare(pWin->pPartition, pSel->pWin->pPartition,-1) ){
|
165977
|
0 |
0 |
if( NEVER(p1==0) || NEVER(p2==0) ) return 1;
|
|
0 |
0 |
if( NEVER(p1==0) || NEVER(p2==0) ) return 1;
|
165978
|
0 |
0 |
if( p1->eFrmType!=p2->eFrmType ) return 1;
|
165979
|
0 |
0 |
if( p1->eStart!=p2->eStart ) return 1;
|
165980
|
0 |
0 |
if( p1->eEnd!=p2->eEnd ) return 1;
|
165981
|
0 |
0 |
if( p1->eExclude!=p2->eExclude ) return 1;
|
165982
|
0 |
0 |
if( sqlite3ExprCompare(pParse, p1->pStart, p2->pStart, -1) ) return 1;
|
165983
|
0 |
0 |
if( sqlite3ExprCompare(pParse, p1->pEnd, p2->pEnd, -1) ) return 1;
|
165984
|
0 |
0 |
if( (res = sqlite3ExprListCompare(p1->pPartition, p2->pPartition, -1)) ){
|
165987
|
0 |
0 |
if( (res = sqlite3ExprListCompare(p1->pOrderBy, p2->pOrderBy, -1)) ){
|
165990
|
0 |
0 |
if( bFilter ){
|
165991
|
0 |
0 |
if( (res = sqlite3ExprCompare(pParse, p1->pFilter, p2->pFilter, -1)) ){
|
166017
|
0 |
0 |
if( pMWin->pPartition ){
|
166027
|
0 |
0 |
if( pMWin->eExclude ){
|
166037
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
|
166039
|
0 |
0 |
if( (p->funcFlags & SQLITE_FUNC_MINMAX) && pWin->eStart!=TK_UNBOUNDED ){
|
|
0 |
0 |
if( (p->funcFlags & SQLITE_FUNC_MINMAX) && pWin->eStart!=TK_UNBOUNDED ){
|
166055
|
0 |
0 |
if( pKeyInfo && pWin->pWFunc->zName[1]=='i' ){
|
|
0 |
0 |
if( pKeyInfo && pWin->pWFunc->zName[1]=='i' ){
|
166063
|
0 |
0 |
else if( p->zName==nth_valueName || p->zName==first_valueName ){
|
|
0 |
0 |
else if( p->zName==nth_valueName || p->zName==first_valueName ){
|
166071
|
0 |
0 |
else if( p->zName==leadName || p->zName==lagName ){
|
|
0 |
0 |
else if( p->zName==leadName || p->zName==lagName ){
|
166104
|
0 |
0 |
if( eCond>=WINDOW_STARTING_NUM ){
|
166142
|
0 |
0 |
return (pList ? pList->nExpr : 0);
|
166237
|
0 |
0 |
if( pOrderBy ){
|
166240
|
0 |
0 |
int iColOff = pMWin->nBufferCol + (pPart ? pPart->nExpr : 0);
|
166242
|
0 |
0 |
for(i=0; i<pOrderBy->nExpr; i++){
|
166277
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
|
166280
|
0 |
0 |
int nArg = pWin->bExprArgs ? 0 : windowArgCount(pWin);
|
166289
|
0 |
0 |
for(i=0; i<nArg; i++){
|
166290
|
0 |
0 |
if( i!=1 || pFunc->zName!=nth_valueName ){
|
|
0 |
0 |
if( i!=1 || pFunc->zName!=nth_valueName ){
|
166298
|
0 |
0 |
if( pMWin->regStartRowid==0
|
166299
|
0 |
0 |
&& (pFunc->funcFlags & SQLITE_FUNC_MINMAX)
|
166300
|
0 |
0 |
&& (pWin->eStart!=TK_UNBOUNDED)
|
166304
|
0 |
0 |
if( bInverse==0 ){
|
166316
|
0 |
0 |
}else if( pWin->regApp ){
|
166322
|
0 |
0 |
}else if( pFunc->xSFunc!=noopStepFunc ){
|
166324
|
0 |
0 |
if( pWin->pFilter ){
|
166336
|
0 |
0 |
if( pWin->bExprArgs ){
|
166345
|
0 |
0 |
for(iEnd=sqlite3VdbeCurrentAddr(v); iOp<iEnd; iOp++){
|
166347
|
0 |
0 |
if( pOp->opcode==OP_Column && pOp->p1==pMWin->iEphCsr ){
|
|
0 |
0 |
if( pOp->opcode==OP_Column && pOp->p1==pMWin->iEphCsr ){
|
166352
|
0 |
0 |
if( pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL ){
|
166359
|
0 |
0 |
sqlite3VdbeAddOp3(v, bInverse? OP_AggInverse : OP_AggStep,
|
166363
|
0 |
0 |
if( pWin->bExprArgs ){
|
166366
|
0 |
0 |
if( addrIf ) sqlite3VdbeJumpHere(v, addrIf);
|
166390
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
|
166391
|
0 |
0 |
if( pMWin->regStartRowid==0
|
166392
|
0 |
0 |
&& (pWin->pWFunc->funcFlags & SQLITE_FUNC_MINMAX)
|
166393
|
0 |
0 |
&& (pWin->eStart!=TK_UNBOUNDED)
|
166400
|
0 |
0 |
}else if( pWin->regApp ){
|
166404
|
0 |
0 |
if( bFin ){
|
166444
|
0 |
0 |
nPeer = (pMWin->pOrderBy ? pMWin->pOrderBy->nExpr : 0);
|
166451
|
0 |
0 |
if( nPeer ){
|
166459
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
|
166470
|
0 |
0 |
if( pMWin->eExclude==TK_CURRENT ){
|
166473
|
0 |
0 |
}else if( pMWin->eExclude!=TK_NO ){
|
166478
|
0 |
0 |
if( pMWin->pOrderBy ){
|
166481
|
0 |
0 |
if( pMWin->eExclude==TK_TIES ){
|
166485
|
0 |
0 |
if( pKeyInfo ){
|
166495
|
0 |
0 |
if( addrEq ) sqlite3VdbeJumpHere(v, addrEq);
|
166507
|
0 |
0 |
if( nPeer ){
|
166533
|
0 |
0 |
if( pMWin->regStartRowid ){
|
166539
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
|
166542
|
0 |
0 |
if( pFunc->zName==nth_valueName
|
166543
|
0 |
0 |
|| pFunc->zName==first_valueName
|
166550
|
0 |
0 |
if( pFunc->zName==nth_valueName ){
|
166565
|
0 |
0 |
else if( pFunc->zName==leadName || pFunc->zName==lagName ){
|
|
0 |
0 |
else if( pFunc->zName==leadName || pFunc->zName==lagName ){
|
166572
|
0 |
0 |
if( nArg<3 ){
|
166578
|
0 |
0 |
if( nArg<2 ){
|
166579
|
0 |
0 |
int val = (pFunc->zName==leadName ? 1 : -1);
|
166582
|
0 |
0 |
int op = (pFunc->zName==leadName ? OP_Add : OP_Subtract);
|
166611
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
|
166615
|
0 |
0 |
nArg = MAX(nArg, windowArgCount(pWin));
|
166616
|
0 |
0 |
if( pMWin->regStartRowid==0 ){
|
166617
|
0 |
0 |
if( pFunc->zName==nth_valueName || pFunc->zName==first_valueName ){
|
|
0 |
0 |
if( pFunc->zName==nth_valueName || pFunc->zName==first_valueName ){
|
166622
|
0 |
0 |
if( (pFunc->funcFlags & SQLITE_FUNC_MINMAX) && pWin->csrApp ){
|
|
0 |
0 |
if( (pFunc->funcFlags & SQLITE_FUNC_MINMAX) && pWin->csrApp ){
|
166640
|
0 |
0 |
if( pMWin->regStartRowid ) return 1;
|
166641
|
0 |
0 |
for(pWin=pMWin; pWin; pWin=pWin->pNextWin){
|
166643
|
0 |
0 |
if( (pFunc->zName==nth_valueName)
|
166644
|
0 |
0 |
|| (pFunc->zName==first_valueName)
|
166645
|
0 |
0 |
|| (pFunc->zName==leadName)
|
166646
|
0 |
0 |
|| (pFunc->zName==lagName)
|
166672
|
0 |
0 |
if( pOrderBy ){
|
166735
|
0 |
0 |
if( pOrderBy->a[0].fg.sortFlags & KEYINFO_ORDER_DESC ){
|
166768
|
0 |
0 |
if( pOrderBy->a[0].fg.sortFlags & KEYINFO_ORDER_BIGNULL ){
|
166789
|
0 |
0 |
sqlite3VdbeAddOp2(v, OP_IsNull, reg2,
|
166790
|
0 |
0 |
(op==OP_Gt || op==OP_Ge) ? addrDone : lbl);
|
166810
|
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) ){
|
166861
|
0 |
0 |
if( op==WINDOW_AGGINVERSE && pMWin->eStart==TK_UNBOUNDED ){
|
|
0 |
0 |
if( op==WINDOW_AGGINVERSE && pMWin->eStart==TK_UNBOUNDED ){
|
166866
|
0 |
0 |
if( regCountdown>0 ){
|
166867
|
0 |
0 |
if( pMWin->eFrmType==TK_RANGE ){
|
166870
|
0 |
0 |
if( op==WINDOW_AGGINVERSE ){
|
166871
|
0 |
0 |
if( pMWin->eStart==TK_FOLLOWING ){
|
166891
|
0 |
0 |
if( op==WINDOW_RETURN_ROW && pMWin->regStartRowid==0 ){
|
|
0 |
0 |
if( op==WINDOW_RETURN_ROW && pMWin->regStartRowid==0 ){
|
166902
|
0 |
0 |
if( pMWin->eStart==pMWin->eEnd && regCountdown
|
|
0 |
0 |
if( pMWin->eStart==pMWin->eEnd && regCountdown
|
166903
|
0 |
0 |
&& pMWin->eFrmType==TK_RANGE
|
166907
|
0 |
0 |
if( op==WINDOW_AGGINVERSE ){
|
166912
|
0 |
0 |
}else if( p->regRowid ){
|
166932
|
0 |
0 |
if( pMWin->regStartRowid ){
|
166944
|
0 |
0 |
if( pMWin->regStartRowid ){
|
166953
|
0 |
0 |
if( op==p->eDelete ){
|
166958
|
0 |
0 |
if( jumpOnEof ){
|
166965
|
0 |
0 |
if( bPeer ){
|
166970
|
0 |
0 |
if( bPeer ){
|
166971
|
0 |
0 |
int nReg = (pMWin->pOrderBy ? pMWin->pOrderBy->nExpr : 0);
|
166972
|
0 |
0 |
int regTmp = (nReg ? sqlite3GetTempRange(pParse, nReg) : 0);
|
166978
|
0 |
0 |
if( addrNextRange ){
|
166993
|
0 |
0 |
if( ALWAYS(p) ){
|
166995
|
0 |
0 |
if( pNew ){
|
167029
|
0 |
3 |
for(pWin=p; pWin; pWin=pWin->pNextWin){
|
167031
|
0 |
0 |
if( *pp==0 ) break;
|
167051
|
0 |
0 |
if( pVal && sqlite3_value_int(pVal)>0 ){
|
|
0 |
0 |
if( pVal && sqlite3_value_int(pVal)>0 ){
|
167454
|
0 |
0 |
if( pMWin->eFrmType!=TK_RANGE
|
167455
|
0 |
0 |
&& windowExprGtZero(pParse, pMWin->pStart)
|
167461
|
0 |
0 |
if( windowCacheFrame(pMWin)==0 ){
|
167462
|
0 |
0 |
if( pMWin->eEnd==TK_PRECEDING ){
|
167463
|
0 |
0 |
if( pMWin->eFrmType!=TK_RANGE
|
167464
|
0 |
0 |
&& windowExprGtZero(pParse, pMWin->pEnd)
|
167489
|
0 |
0 |
if( pMWin->eStart==TK_PRECEDING || pMWin->eStart==TK_FOLLOWING ){
|
|
0 |
0 |
if( pMWin->eStart==TK_PRECEDING || pMWin->eStart==TK_FOLLOWING ){
|
167492
|
0 |
0 |
if( pMWin->eEnd==TK_PRECEDING || pMWin->eEnd==TK_FOLLOWING ){
|
|
0 |
0 |
if( pMWin->eEnd==TK_PRECEDING || pMWin->eEnd==TK_FOLLOWING ){
|
167499
|
0 |
0 |
if( pMWin->eFrmType!=TK_ROWS ){
|
167500
|
0 |
0 |
int nPeer = (pOrderBy ? pOrderBy->nExpr : 0);
|
167502
|
0 |
0 |
if( pMWin->pPartition ) regNewPeer += pMWin->pPartition->nExpr;
|
167512
|
0 |
0 |
for(iInput=0; iInput<nInput; iInput++){
|
167522
|
0 |
0 |
if( pMWin->pPartition ){
|
167548
|
0 |
0 |
if( regStart ){
|
167550
|
0 |
0 |
windowCheckValue(pParse, regStart, 0 + (pMWin->eFrmType==TK_RANGE?3:0));
|
167552
|
0 |
0 |
if( regEnd ){
|
167554
|
0 |
0 |
windowCheckValue(pParse, regEnd, 1 + (pMWin->eFrmType==TK_RANGE?3:0));
|
167557
|
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 ){
|
167558
|
0 |
0 |
int op = ((pMWin->eStart==TK_FOLLOWING) ? OP_Ge : OP_Le);
|
167569
|
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 ){
|
167574
|
0 |
0 |
if( pMWin->eStart!=TK_UNBOUNDED ){
|
167579
|
0 |
0 |
if( regPeer && pOrderBy ){
|
|
0 |
0 |
if( regPeer && pOrderBy ){
|
167591
|
0 |
0 |
if( regPeer ){
|
167594
|
0 |
0 |
if( pMWin->eStart==TK_FOLLOWING ){
|
167596
|
0 |
0 |
if( pMWin->eEnd!=TK_UNBOUNDED ){
|
167597
|
0 |
0 |
if( pMWin->eFrmType==TK_RANGE ){
|
167611
|
0 |
0 |
if( pMWin->eEnd==TK_PRECEDING ){
|
167612
|
0 |
0 |
int bRPS = (pMWin->eStart==TK_PRECEDING && pMWin->eFrmType==TK_RANGE);
|
|
0 |
0 |
int bRPS = (pMWin->eStart==TK_PRECEDING && pMWin->eFrmType==TK_RANGE);
|
167614
|
0 |
0 |
if( bRPS ) windowCodeOp(&s, WINDOW_AGGINVERSE, regStart, 0);
|
167616
|
0 |
0 |
if( !bRPS ) windowCodeOp(&s, WINDOW_AGGINVERSE, regStart, 0);
|
167620
|
0 |
0 |
if( pMWin->eEnd!=TK_UNBOUNDED ){
|
167621
|
0 |
0 |
if( pMWin->eFrmType==TK_RANGE ){
|
167624
|
0 |
0 |
if( regEnd ){
|
167630
|
0 |
0 |
if( regEnd ){
|
167635
|
0 |
0 |
if( regEnd ){
|
167641
|
0 |
0 |
if( regEnd ) sqlite3VdbeJumpHere(v, addr);
|
167651
|
0 |
0 |
if( pMWin->pPartition ){
|
167659
|
0 |
0 |
if( pMWin->eEnd==TK_PRECEDING ){
|
167660
|
0 |
0 |
int bRPS = (pMWin->eStart==TK_PRECEDING && pMWin->eFrmType==TK_RANGE);
|
|
0 |
0 |
int bRPS = (pMWin->eStart==TK_PRECEDING && pMWin->eFrmType==TK_RANGE);
|
167662
|
0 |
0 |
if( bRPS ) windowCodeOp(&s, WINDOW_AGGINVERSE, regStart, 0);
|
167664
|
0 |
0 |
}else if( pMWin->eStart==TK_FOLLOWING ){
|
167670
|
0 |
0 |
if( pMWin->eFrmType==TK_RANGE ){
|
167675
|
0 |
0 |
if( pMWin->eEnd==TK_UNBOUNDED ){
|
167705
|
0 |
0 |
if( pMWin->pPartition ){
|
167706
|
0 |
0 |
if( pMWin->regStartRowid ){
|
167832
|
26 |
4538 |
if( p->pPrior ){
|
167840
|
26 |
85 |
if( pLoop==0 ) break;
|
167842
|
85 |
0 |
if( pLoop->pOrderBy || pLoop->pLimit ){
|
|
0 |
85 |
if( pLoop->pOrderBy || pLoop->pLimit ){
|
167843
|
0 |
0 |
sqlite3ErrorMsg(pParse,"%s clause should come after %s not before",
|
167849
|
22 |
4 |
if( (p->selFlags & SF_MultiValue)==0 &&
|
|
22 |
0 |
if( (p->selFlags & SF_MultiValue)==0 &&
|
167850
|
0 |
22 |
(mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 &&
|
167862
|
0 |
0 |
if( pSelect ){
|
167875
|
9696 |
0 |
if( p ){
|
167893
|
2399 |
7297 |
if( sqlite3Isquote(p->u.zToken[0]) ){
|
167899
|
0 |
9696 |
if( IN_RENAME_OBJECT ){
|
167911
|
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 ){
|
167931
|
24 |
0 |
if( (hasCollate || sortOrder!=SQLITE_SO_UNDEFINED)
|
|
0 |
24 |
if( (hasCollate || sortOrder!=SQLITE_SO_UNDEFINED)
|
167932
|
0 |
0 |
&& pParse->db->init.busy==0
|
170191
|
12258 |
6451 |
while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
|
170275
|
61893 |
161660 |
if( stateno>YY_MAX_SHIFT ) return stateno;
|
170289
|
81987 |
79908 |
if( yy_lookahead[i]!=iLookAhead ){
|
170294
|
235 |
81752 |
if( iFallback!=0 ){
|
170310
|
348 |
81404 |
if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){
|
|
348 |
0 |
if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){
|
170371
|
0 |
0 |
while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
|
170421
|
0 |
79611 |
if( yypParser->yytos>yypParser->yystackEnd ){
|
170435
|
37503 |
42108 |
if( yyNewState > YY_MAX_SHIFT ){
|
171384
|
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 ){
|
171394
|
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 ){
|
171458
|
0 |
0 |
if( p ){
|
171611
|
4564 |
0 |
if( p ){
|
171621
|
75 |
0 |
if( pRhs && pRhs->pPrior ){
|
|
0 |
75 |
if( pRhs && pRhs->pPrior ){
|
171629
|
75 |
0 |
if( pRhs ){
|
171632
|
75 |
0 |
if( ALWAYS(pLhs) ) pLhs->selFlags &= ~SF_MultiValue;
|
171634
|
4 |
71 |
if( yymsp[-1].minor.yy394!=TK_ALL ) pParse->hasCompound = 1;
|
171656
|
0 |
0 |
if( yymsp[-9].minor.yy47 ){
|
171672
|
10 |
0 |
if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue;
|
171673
|
10 |
0 |
if( pRight ){
|
171699
|
316 |
1627 |
if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy322, &yymsp[0].minor.yy0, 1);
|
171735
|
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;
|
171762
|
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 ){
|
171764
|
0 |
0 |
}else if( ALWAYS(yymsp[-3].minor.yy131!=0) && yymsp[-3].minor.yy131->nSrc==1 ){
|
|
0 |
0 |
}else if( ALWAYS(yymsp[-3].minor.yy131!=0) && yymsp[-3].minor.yy131->nSrc==1 ){
|
171766
|
0 |
0 |
if( yymsp[-5].minor.yy131 ){
|
171772
|
0 |
0 |
if( pNew->pSelect && (pNew->pSelect->selFlags & SF_NestedFrom)!=0 ){
|
|
0 |
0 |
if( pNew->pSelect && (pNew->pSelect->selFlags & SF_NestedFrom)!=0 ){
|
171775
|
0 |
0 |
if( pOld->fg.isTabFunc ){
|
171800
|
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);
|
171807
|
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);
|
171820
|
0 |
0 |
if( yymsp[-4].minor.yy131 ) yymsp[-4].minor.yy131->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
|
171826
|
0 |
0 |
if( yymsp[-2].minor.yy131 ) yymsp[-2].minor.yy131->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
|
171929
|
0 |
279 |
if( yymsp[-1].minor.yy131 ){
|
171931
|
0 |
0 |
if( pFromClause->nSrc>1 ){
|
172030
|
0 |
4 |
if( IN_RENAME_OBJECT ){
|
172044
|
561 |
0 |
if( yylhsminor.yy528 ) yylhsminor.yy528->w.iOfst = (int)(yymsp[0].minor.yy0.z - pParse->zTail);
|
172050
|
548 |
1398 |
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
|
|
0 |
548 |
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
|
172060
|
0 |
548 |
if( pParse->nested==0 ){
|
172065
|
548 |
0 |
if( yymsp[0].minor.yy528 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy528->iTable);
|
172117
|
0 |
0 |
if( yymsp[-4].minor.yy528 ){
|
172119
|
0 |
0 |
if( ALWAYS(pList->nExpr) ){
|
172150
|
12 |
136 |
if( bNot ) yymsp[-2].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy528, 0);
|
172151
|
148 |
0 |
if( yymsp[-2].minor.yy528 ) yymsp[-2].minor.yy528->flags |= EP_InfixFunc;
|
172163
|
0 |
0 |
if( bNot ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
|
172164
|
0 |
0 |
if( yymsp[-4].minor.yy528 ) yymsp[-4].minor.yy528->flags |= EP_InfixFunc;
|
172203
|
0 |
1 |
yymsp[-1].minor.yy528 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy528, 0);
|
172224
|
18 |
0 |
if( yymsp[-4].minor.yy528 ){
|
172229
|
0 |
18 |
if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
|
172234
|
0 |
17 |
if( yymsp[-1].minor.yy322==0 ){
|
172244
|
0 |
0 |
yymsp[-4].minor.yy528 = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy394 ? "true" : "false");
|
172245
|
0 |
0 |
if( yymsp[-4].minor.yy528 ) sqlite3ExprIdToTrueFalse(yymsp[-4].minor.yy528);
|
172248
|
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 ){
|
172253
|
0 |
16 |
}else if( yymsp[-1].minor.yy322->nExpr==1 && pRHS->op==TK_SELECT ){
|
|
0 |
0 |
}else if( yymsp[-1].minor.yy322->nExpr==1 && pRHS->op==TK_SELECT ){
|
172260
|
0 |
16 |
if( yymsp[-4].minor.yy528==0 ){
|
172262
|
0 |
16 |
}else if( yymsp[-4].minor.yy528->pLeft->op==TK_VECTOR ){
|
172265
|
0 |
0 |
if( pSelectRHS ){
|
172274
|
0 |
17 |
if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
|
172288
|
0 |
1 |
if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
|
172295
|
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);
|
172298
|
0 |
2 |
if( yymsp[-3].minor.yy394 ) yymsp[-4].minor.yy528 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy528, 0);
|
172311
|
0 |
0 |
if( yymsp[-4].minor.yy528 ){
|
172312
|
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;
|
172347
|
0 |
10 |
if( IN_RENAME_OBJECT && pParse->pNewIndex ){
|
|
0 |
0 |
if( IN_RENAME_OBJECT && pParse->pNewIndex ){
|
172404
|
0 |
0 |
yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
|
172487
|
0 |
0 |
if( yymsp[-3].minor.yy528 ){
|
172495
|
0 |
0 |
if( yymsp[-5].minor.yy528 ) {
|
172622
|
0 |
0 |
if( ALWAYS(yymsp[-1].minor.yy41) ){
|
172714
|
0 |
0 |
if( yymsp[0].minor.yy41 ){
|
172726
|
0 |
0 |
if( yylhsminor.yy41 ){
|
172744
|
0 |
0 |
if( yymsp[-1].minor.yy41 ){
|
172877
|
3 |
0 |
if( TOKEN.z[0] ){
|
172971
|
143611 |
79942 |
if( yyact >= YY_MIN_REDUCE ){
|
172994
|
45643 |
97968 |
if( yyRuleInfoNRhs[yyruleno]==0 ){
|
173003
|
0 |
45643 |
if( yypParser->yytos>=yypParser->yystackEnd ){
|
173017
|
79611 |
331 |
}else if( yyact <= YY_MAX_SHIFTREDUCE ){
|
173023
|
328 |
3 |
}else if( yyact==YY_ACCEPT_ACTION ){
|
173604
|
38467 |
608 |
if( n>=2 ){
|
173606
|
42533 |
18676 |
for(i=(int)aKWHash[i]; i>0; i=aKWNext[i]){
|
173607
|
22389 |
20144 |
if( aKWLen[i]!=n ) continue;
|
173610
|
188 |
19956 |
if( (z[0]&~0x20)!=zKW[0] ) continue;
|
173611
|
140 |
19816 |
if( (z[1]&~0x20)!=zKW[1] ) continue;
|
173613
|
62235 |
19791 |
while( j<n && (z[j]&~0x20)==zKW[j] ){ j++; }
|
|
62210 |
25 |
while( j<n && (z[j]&~0x20)==zKW[j] ){ j++; }
|
173621
|
25 |
19791 |
if( j<n ) continue;
|
173782
|
0 |
0 |
if( i<0 || i>=SQLITE_N_KEYWORD ) return SQLITE_ERROR;
|
|
0 |
0 |
if( i<0 || i>=SQLITE_N_KEYWORD ) return SQLITE_ERROR;
|
173848
|
0 |
0 |
}while( t==TK_SPACE );
|
173849
|
0 |
0 |
if( t==TK_ID
|
173850
|
0 |
0 |
|| t==TK_STRING
|
173851
|
0 |
0 |
|| t==TK_JOIN_KW
|
173852
|
0 |
0 |
|| t==TK_WINDOW
|
173853
|
0 |
0 |
|| t==TK_OVER
|
173854
|
0 |
0 |
|| sqlite3ParserFallback(t)==TK_ID
|
173895
|
0 |
0 |
if( t!=TK_ID ) return TK_ID;
|
173897
|
0 |
0 |
if( t!=TK_AS ) return TK_ID;
|
173901
|
0 |
0 |
if( lastToken==TK_RP ){
|
173903
|
0 |
0 |
if( t==TK_LP || t==TK_ID ) return TK_OVER;
|
|
0 |
0 |
if( t==TK_LP || t==TK_ID ) return TK_OVER;
|
173908
|
0 |
0 |
if( lastToken==TK_RP && getToken(&z)==TK_LP ){
|
|
0 |
0 |
if( lastToken==TK_RP && getToken(&z)==TK_LP ){
|
173930
|
5696 |
38692 |
for(i=1; sqlite3Isspace(z[i]); i++){}
|
173935
|
3 |
1 |
if( z[1]=='-' ){
|
173936
|
51 |
1 |
for(i=2; (c=z[i])!=0 && c!='\n'; i++){}
|
|
49 |
2 |
for(i=2; (c=z[i])!=0 && c!='\n'; i++){}
|
173939
|
0 |
1 |
}else if( z[1]=='>' ){
|
173941
|
0 |
0 |
return 2 + (z[2]=='>');
|
173967
|
1 |
0 |
if( z[1]!='*' || z[2]==0 ){
|
|
0 |
1 |
if( z[1]!='*' || z[2]==0 ){
|
173971
|
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++){}
|
173972
|
1 |
0 |
if( c ) i++;
|
173982
|
0 |
2475 |
return 1 + (z[1]=='=');
|
173985
|
12 |
7 |
if( (c=z[1])=='=' ){
|
173988
|
0 |
7 |
}else if( c=='>' ){
|
173991
|
0 |
7 |
}else if( c=='<' ){
|
174000
|
14 |
20 |
if( (c=z[1])=='=' ){
|
174003
|
0 |
20 |
}else if( c=='>' ){
|
174012
|
0 |
245 |
if( z[1]!='=' ){
|
174021
|
0 |
0 |
if( z[1]!='|' ){
|
174046
|
48293 |
0 |
for(i=1; (c=z[i])!=0; i++){
|
174047
|
4092 |
44201 |
if( c==delim ){
|
174048
|
108 |
3984 |
if( z[i+1]==delim ){
|
174055
|
3021 |
963 |
if( c=='\'' ){
|
174058
|
963 |
0 |
}else if( c!=0 ){
|
174068
|
1197 |
0 |
if( !sqlite3Isdigit(z[1]) )
|
174085
|
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]) ){
|
174086
|
0 |
0 |
for(i=3; sqlite3Isxdigit(z[i]); i++){}
|
174090
|
3405 |
2843 |
for(i=0; sqlite3Isdigit(z[i]); i++){}
|
174092
|
2166 |
677 |
if( z[i]=='.' ){
|
174094
|
32416 |
2166 |
while( sqlite3Isdigit(z[i]) ){ i++; }
|
174097
|
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') &&
|
174099
|
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]))
|
174103
|
0 |
0 |
while( sqlite3Isdigit(z[i]) ){ i++; }
|
174107
|
0 |
2843 |
while( IdChar(z[i]) ){
|
174114
|
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++){}
|
174115
|
6 |
0 |
*tokenType = c==']' ? TK_ID : TK_ILLEGAL;
|
174120
|
13 |
1384 |
for(i=1; sqlite3Isdigit(z[i]); i++){}
|
174129
|
884 |
275 |
for(i=1; (c=z[i])!=0; i++){
|
174130
|
593 |
291 |
if( IdChar(c) ){
|
174133
|
0 |
291 |
}else if( c=='(' && n>0 ){
|
|
0 |
0 |
}else if( c=='(' && n>0 ){
|
174136
|
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!=')' );
|
174137
|
0 |
0 |
if( c==')' ){
|
174143
|
0 |
291 |
}else if( c==':' && z[i+1]==':' ){
|
|
0 |
0 |
}else if( c==':' && z[i+1]==':' ){
|
174150
|
0 |
566 |
if( n==0 ) *tokenType = TK_ILLEGAL;
|
174154
|
183607 |
39783 |
for(i=1; aiClass[z[i]]<=CC_KYWD; i++){}
|
174155
|
708 |
39075 |
if( IdChar(z[i]) ){
|
174168
|
6 |
477 |
if( z[1]=='\'' ){
|
174170
|
327680 |
6 |
for(i=2; sqlite3Isxdigit(z[i]); i++){}
|
174171
|
6 |
0 |
if( z[i]!='\'' || i%2 ){
|
|
0 |
6 |
if( z[i]!='\'' || i%2 ){
|
174173
|
0 |
0 |
while( z[i] && z[i]!='\'' ){ i++; }
|
|
0 |
0 |
while( z[i] && z[i]!='\'' ){ i++; }
|
174175
|
6 |
0 |
if( z[i] ) i++;
|
174189
|
0 |
0 |
if( z[1]==0xbb && z[2]==0xbf ){
|
|
0 |
0 |
if( z[1]==0xbb && z[2]==0xbf ){
|
174205
|
3241 |
1190 |
while( IdChar(z[i]) ){ i++; }
|
174229
|
5544 |
907 |
if( db->nVdbeActive==0 ){
|
174261
|
0 |
118950 |
if( mxSqlLen<0 ){
|
174267
|
45672 |
73278 |
if( tokenType>=TK_WINDOW ){
|
174275
|
0 |
45672 |
if( AtomicLoad(&db->u1.isInterrupted) ){
|
174280
|
38680 |
6992 |
if( tokenType==TK_SPACE ){
|
174284
|
6992 |
0 |
if( zSql[0]==0 ){
|
174287
|
328 |
6664 |
if( lastTokenParsed==TK_SEMI ){
|
174289
|
328 |
6336 |
}else if( lastTokenParsed==0 ){
|
174296
|
0 |
0 |
}else if( tokenType==TK_WINDOW ){
|
174299
|
0 |
0 |
}else if( tokenType==TK_OVER ){
|
174302
|
0 |
0 |
}else if( tokenType==TK_FILTER ){
|
174320
|
6123 |
73819 |
if( pParse->rc!=SQLITE_OK ) break;
|
174335
|
0 |
6451 |
if( db->mallocFailed ){
|
174338
|
6425 |
26 |
if( pParse->zErrMsg || (pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE) ){
|
|
6097 |
328 |
if( pParse->zErrMsg || (pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE) ){
|
|
0 |
6097 |
if( pParse->zErrMsg || (pParse->rc!=SQLITE_OK && pParse->rc!=SQLITE_DONE) ){
|
174339
|
0 |
26 |
if( pParse->zErrMsg==0 ){
|
174350
|
297 |
6154 |
if( pParse->pNewTable && !IN_SPECIAL_PARSE ){
|
|
266 |
31 |
if( pParse->pNewTable && !IN_SPECIAL_PARSE ){
|
174357
|
0 |
6451 |
if( pParse->pNewTrigger && !IN_RENAME_OBJECT ){
|
|
0 |
0 |
if( pParse->pNewTrigger && !IN_RENAME_OBJECT ){
|
174360
|
0 |
6451 |
if( pParse->pVList ) sqlite3DbNNFreeNN(db, pParse->pVList);
|
174646
|
0 |
0 |
while( *zSql ){
|
174661
|
0 |
0 |
if( zSql[1]!='*' ){
|
174666
|
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++; }
|
174667
|
0 |
0 |
if( zSql[0]==0 ) return 0;
|
174673
|
0 |
0 |
if( zSql[1]!='-' ){
|
174677
|
0 |
0 |
while( *zSql && *zSql!='\n' ){ zSql++; }
|
|
0 |
0 |
while( *zSql && *zSql!='\n' ){ zSql++; }
|
174678
|
0 |
0 |
if( *zSql==0 ) return state==1;
|
174684
|
0 |
0 |
while( *zSql && *zSql!=']' ){ zSql++; }
|
|
0 |
0 |
while( *zSql && *zSql!=']' ){ zSql++; }
|
174685
|
0 |
0 |
if( *zSql==0 ) return 0;
|
174694
|
0 |
0 |
while( *zSql && *zSql!=c ){ zSql++; }
|
|
0 |
0 |
while( *zSql && *zSql!=c ){ zSql++; }
|
174695
|
0 |
0 |
if( *zSql==0 ) return 0;
|
174703
|
0 |
0 |
if( IdChar((u8)*zSql) ){
|
174706
|
0 |
0 |
for(nId=1; IdChar(zSql[nId]); nId++){}
|
174712
|
0 |
0 |
if( nId==6 && sqlite3StrNICmp(zSql, "create", 6)==0 ){
|
|
0 |
0 |
if( nId==6 && sqlite3StrNICmp(zSql, "create", 6)==0 ){
|
174720
|
0 |
0 |
if( nId==7 && sqlite3StrNICmp(zSql, "trigger", 7)==0 ){
|
|
0 |
0 |
if( nId==7 && sqlite3StrNICmp(zSql, "trigger", 7)==0 ){
|
174722
|
0 |
0 |
}else if( nId==4 && sqlite3StrNICmp(zSql, "temp", 4)==0 ){
|
|
0 |
0 |
}else if( nId==4 && sqlite3StrNICmp(zSql, "temp", 4)==0 ){
|
174724
|
0 |
0 |
}else if( nId==9 && sqlite3StrNICmp(zSql, "temporary", 9)==0 ){
|
|
0 |
0 |
}else if( nId==9 && sqlite3StrNICmp(zSql, "temporary", 9)==0 ){
|
174732
|
0 |
0 |
if( nId==3 && sqlite3StrNICmp(zSql, "end", 3)==0 ){
|
|
0 |
0 |
if( nId==3 && sqlite3StrNICmp(zSql, "end", 3)==0 ){
|
174736
|
0 |
0 |
if( nId==7 && sqlite3StrNICmp(zSql, "explain", 7)==0 ){
|
|
0 |
0 |
if( nId==7 && sqlite3StrNICmp(zSql, "explain", 7)==0 ){
|
174778
|
0 |
0 |
if( rc ) return rc;
|
174783
|
0 |
0 |
if( zSql8 ){
|
175113
|
75509 |
880 |
if( sqlite3GlobalConfig.isInit ){
|
175127
|
0 |
880 |
if( rc ) return rc;
|
175138
|
110 |
770 |
if( !sqlite3GlobalConfig.isMallocInit ){
|
175141
|
880 |
0 |
if( rc==SQLITE_OK ){
|
175143
|
110 |
770 |
if( !sqlite3GlobalConfig.pInitMutex ){
|
175146
|
110 |
0 |
if( sqlite3GlobalConfig.bCoreMutex && !sqlite3GlobalConfig.pInitMutex ){
|
|
0 |
110 |
if( sqlite3GlobalConfig.bCoreMutex && !sqlite3GlobalConfig.pInitMutex ){
|
175151
|
880 |
0 |
if( rc==SQLITE_OK ){
|
175159
|
0 |
880 |
if( rc!=SQLITE_OK ){
|
175177
|
880 |
0 |
if( sqlite3GlobalConfig.isInit==0 && sqlite3GlobalConfig.inProgress==0 ){
|
|
110 |
770 |
if( sqlite3GlobalConfig.isInit==0 && sqlite3GlobalConfig.inProgress==0 ){
|
175187
|
110 |
0 |
if( sqlite3GlobalConfig.isPCacheInit==0 ){
|
175190
|
110 |
0 |
if( rc==SQLITE_OK ){
|
175195
|
110 |
0 |
if( rc==SQLITE_OK ){
|
175199
|
110 |
0 |
if( rc==SQLITE_OK ){
|
175217
|
110 |
770 |
if( sqlite3GlobalConfig.nRefInitMutex<=0 ){
|
175272
|
0 |
0 |
if( sqlite3GlobalConfig.isInit ){
|
175281
|
0 |
0 |
if( sqlite3GlobalConfig.isPCacheInit ){
|
175285
|
0 |
0 |
if( sqlite3GlobalConfig.isMallocInit ){
|
175301
|
0 |
0 |
if( sqlite3GlobalConfig.isMutexInit ){
|
175326
|
0 |
220 |
if( sqlite3GlobalConfig.isInit ){
|
175331
|
0 |
0 |
if( op<0 || op>63 || (MASKBIT64(op) & mAnytimeConfigOption)==0 ){
|
|
0 |
0 |
if( op<0 || op>63 || (MASKBIT64(op) & mAnytimeConfigOption)==0 ){
|
|
0 |
0 |
if( op<0 || op>63 || (MASKBIT64(op) & mAnytimeConfigOption)==0 ){
|
175374
|
0 |
0 |
sqlite3GlobalConfig.mutex = *va_arg(ap, sqlite3_mutex_methods*);
|
175381
|
0 |
0 |
*va_arg(ap, sqlite3_mutex_methods*) = sqlite3GlobalConfig.mutex;
|
175392
|
110 |
0 |
sqlite3GlobalConfig.m = *va_arg(ap, sqlite3_mem_methods*);
|
175400
|
0 |
0 |
if( sqlite3GlobalConfig.m.xMalloc==0 ) sqlite3MemSetDefault();
|
175401
|
0 |
0 |
*va_arg(ap, sqlite3_mem_methods*) = sqlite3GlobalConfig.m;
|
175409
|
0 |
0 |
sqlite3GlobalConfig.bMemstat = va_arg(ap, int);
|
175413
|
0 |
0 |
sqlite3GlobalConfig.bSmallMalloc = va_arg(ap, int);
|
175421
|
0 |
0 |
sqlite3GlobalConfig.pPage = va_arg(ap, void*);
|
175422
|
0 |
0 |
sqlite3GlobalConfig.szPage = va_arg(ap, int);
|
175423
|
0 |
0 |
sqlite3GlobalConfig.nPage = va_arg(ap, int);
|
175431
|
0 |
0 |
*va_arg(ap, int*) =
|
175453
|
110 |
0 |
sqlite3GlobalConfig.pcache2 = *va_arg(ap, sqlite3_pcache_methods2*);
|
175461
|
0 |
0 |
if( sqlite3GlobalConfig.pcache2.xInit==0 ){
|
175464
|
0 |
0 |
*va_arg(ap, sqlite3_pcache_methods2*) = sqlite3GlobalConfig.pcache2;
|
175514
|
0 |
0 |
sqlite3GlobalConfig.szLookaside = va_arg(ap, int);
|
175515
|
0 |
0 |
sqlite3GlobalConfig.nLookaside = va_arg(ap, int);
|
175529
|
0 |
0 |
LOGFUNC_t xLog = va_arg(ap, LOGFUNC_t);
|
175530
|
0 |
0 |
void *pLogArg = va_arg(ap, void*);
|
175546
|
0 |
0 |
int bOpenUri = va_arg(ap, int);
|
175556
|
0 |
0 |
sqlite3GlobalConfig.bUseCis = va_arg(ap, int);
|
175574
|
0 |
0 |
sqlite3_int64 szMmap = va_arg(ap, sqlite3_int64);
|
175575
|
0 |
0 |
sqlite3_int64 mxMmap = va_arg(ap, sqlite3_int64);
|
175584
|
0 |
0 |
if( mxMmap<0 || mxMmap>SQLITE_MAX_MMAP_SIZE ){
|
|
0 |
0 |
if( mxMmap<0 || mxMmap>SQLITE_MAX_MMAP_SIZE ){
|
175587
|
0 |
0 |
if( szMmap<0 ) szMmap = SQLITE_DEFAULT_MMAP_SIZE;
|
175588
|
0 |
0 |
if( szMmap>mxMmap) szMmap = mxMmap;
|
175605
|
0 |
0 |
sqlite3GlobalConfig.szPma = va_arg(ap, unsigned int);
|
175610
|
0 |
0 |
sqlite3GlobalConfig.nStmtSpill = va_arg(ap, int);
|
175627
|
0 |
0 |
sqlite3GlobalConfig.mxMemdbSize = va_arg(ap, sqlite3_int64);
|
175659
|
0 |
311 |
if( sqlite3LookasideUsed(db,0)>0 ){
|
175666
|
0 |
311 |
if( db->lookaside.bMalloced ){
|
175673
|
0 |
311 |
if( sz<=(int)sizeof(LookasideSlot*) ) sz = 0;
|
175674
|
0 |
311 |
if( cnt<0 ) cnt = 0;
|
175675
|
311 |
0 |
if( sz==0 || cnt==0 ){
|
|
0 |
311 |
if( sz==0 || cnt==0 ){
|
175678
|
311 |
0 |
}else if( pBuf==0 ){
|
175682
|
311 |
0 |
if( pStart ) szAlloc = sqlite3MallocSize(pStart);
|
175687
|
311 |
0 |
if( sz>=LOOKASIDE_SMALL*3 ){
|
175690
|
0 |
0 |
}else if( sz>=LOOKASIDE_SMALL*2 ){
|
175695
|
0 |
0 |
if( sz>0 ){
|
175706
|
311 |
0 |
if( pStart ){
|
175711
|
9330 |
311 |
for(i=0; i<nBig; i++){
|
175720
|
28923 |
311 |
for(i=0; i<nSm; i++){
|
175775
|
0 |
0 |
for(i=0; i<db->nDb; i++){
|
175777
|
0 |
0 |
if( pBt ){
|
175801
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
|
175803
|
0 |
0 |
if( pBt && sqlite3BtreeTxnState(pBt)==SQLITE_TXN_WRITE ){
|
|
0 |
0 |
if( pBt && sqlite3BtreeTxnState(pBt)==SQLITE_TXN_WRITE ){
|
175806
|
0 |
0 |
if( rc==SQLITE_BUSY ){
|
175814
|
0 |
0 |
return ((rc==SQLITE_OK && bSeenBusy) ? SQLITE_BUSY : rc);
|
|
0 |
0 |
return ((rc==SQLITE_OK && bSeenBusy) ? SQLITE_BUSY : rc);
|
175829
|
0 |
0 |
db->aDb[0].zDbSName = va_arg(ap,char*);
|
175834
|
0 |
0 |
void *pBuf = va_arg(ap, void*); /* IMP: R-26835-10964 */
|
175835
|
0 |
0 |
int sz = va_arg(ap, int); /* IMP: R-47871-25994 */
|
175836
|
0 |
0 |
int cnt = va_arg(ap, int); /* IMP: R-04460-53386 */
|
175867
|
4398 |
0 |
for(i=0; i<ArraySize(aFlagOp); i++){
|
175868
|
1008 |
3390 |
if( aFlagOp[i].op==op ){
|
175869
|
1008 |
0 |
int onoff = va_arg(ap, int);
|
175870
|
1008 |
0 |
int *pRes = va_arg(ap, int*);
|
175872
|
334 |
674 |
if( onoff>0 ){
|
175874
|
26 |
648 |
}else if( onoff==0 ){
|
175877
|
352 |
656 |
if( oldFlags!=db->flags ){
|
175880
|
700 |
308 |
if( pRes ){
|
175912
|
596 |
1109 |
if( rc==0 ){
|
175929
|
0 |
0 |
while( nKey1 && pK1[nKey1-1]==' ' ) nKey1--;
|
|
0 |
0 |
while( nKey1 && pK1[nKey1-1]==' ' ) nKey1--;
|
175930
|
0 |
0 |
while( nKey2 && pK2[nKey2-1]==' ' ) nKey2--;
|
|
0 |
0 |
while( nKey2 && pK2[nKey2-1]==' ' ) nKey2--;
|
175939
|
322 |
0 |
return p==0 || p->xCmp==binCollFunc;
|
|
322 |
0 |
return p==0 || p->xCmp==binCollFunc;
|
175959
|
0 |
0 |
if( 0==r ){
|
176031
|
13 |
545 |
while( db->pSavepoint ){
|
176051
|
2472 |
7666 |
if( pDestructor ){
|
176053
|
2472 |
0 |
if( pDestructor->nRef==0 ){
|
176069
|
657 |
326 |
for(i=0; i<db->nDb; i++){
|
176071
|
645 |
12 |
if( pSchema ){
|
176072
|
750 |
645 |
for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){
|
176074
|
32 |
718 |
if( IsVirtual(pTab) ) sqlite3VtabDisconnect(db, pTab);
|
176078
|
3214 |
326 |
for(p=sqliteHashFirst(&db->aModule); p; p=sqliteHashNext(p)){
|
176080
|
0 |
3214 |
if( pMod->pEpoTab ){
|
176098
|
11 |
630 |
if( db->pVdbe ) return 1;
|
176099
|
1270 |
630 |
for(j=0; j<db->nDb; j++){
|
176101
|
694 |
576 |
if( pBt && sqlite3BtreeIsInBackup(pBt) ) return 1;
|
|
0 |
694 |
if( pBt && sqlite3BtreeIsInBackup(pBt) ) return 1;
|
176110
|
0 |
326 |
if( !db ){
|
176115
|
0 |
326 |
if( !sqlite3SafetyCheckSickOrOk(db) ){
|
176119
|
0 |
326 |
if( db->mTrace & SQLITE_TRACE_CLOSE ){
|
176138
|
326 |
0 |
if( !forceZombie && connectionIsBusy(db) ){
|
|
11 |
315 |
if( !forceZombie && connectionIsBusy(db) ){
|
176173
|
0 |
0 |
if( zSchema ){
|
176175
|
0 |
0 |
if( iDb<0 ) nDb--;
|
176180
|
0 |
0 |
for(; iDb<=nDb; iDb++){
|
176182
|
0 |
0 |
int x = pBt!=0 ? sqlite3BtreeTxnState(pBt) : SQLITE_TXN_NONE;
|
176183
|
0 |
0 |
if( x>iTxn ) iTxn = x;
|
176218
|
315 |
1820 |
if( db->eOpenState!=SQLITE_STATE_ZOMBIE || connectionIsBusy(db) ){
|
|
0 |
315 |
if( db->eOpenState!=SQLITE_STATE_ZOMBIE || connectionIsBusy(db) ){
|
176239
|
635 |
315 |
for(j=0; j<db->nDb; j++){
|
176241
|
347 |
288 |
if( pDb->pBt ){
|
176244
|
314 |
33 |
if( j!=1 ){
|
176250
|
309 |
6 |
if( db->aDb[1].pSchema ){
|
176265
|
4432 |
315 |
for(i=sqliteHashFirst(&db->aFunc); i; i=sqliteHashNext(i)){
|
176273
|
618 |
4432 |
}while( p );
|
176276
|
961 |
315 |
for(i=sqliteHashFirst(&db->aCollSeq); i; i=sqliteHashNext(i)){
|
176279
|
2883 |
961 |
for(j=0; j<3; j++){
|
176280
|
0 |
2883 |
if( pColl[j].xDel ){
|
176288
|
3103 |
315 |
for(i=sqliteHashFirst(&db->aModule); i; i=sqliteHashNext(i)){
|
176313
|
0 |
315 |
if( db->xAutovacDestr ){
|
176320
|
309 |
6 |
if( db->lookaside.bMalloced ){
|
176347
|
5 |
361 |
schemaChange = (db->mDbFlags & DBFLAG_SchemaChange)!=0 && db->init.busy==0;
|
|
5 |
0 |
schemaChange = (db->mDbFlags & DBFLAG_SchemaChange)!=0 && db->init.busy==0;
|
176349
|
737 |
366 |
for(i=0; i<db->nDb; i++){
|
176351
|
402 |
335 |
if( p ){
|
176352
|
44 |
358 |
if( sqlite3BtreeTxnState(p)==SQLITE_TXN_WRITE ){
|
176361
|
5 |
361 |
if( schemaChange ){
|
176373
|
2 |
364 |
if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){
|
|
0 |
2 |
if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){
|
|
0 |
0 |
if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){
|
176547
|
23 |
0 |
if( ALWAYS(rc>=0) && rc<ArraySize(aMsg) && aMsg[rc]!=0 ){
|
|
23 |
0 |
if( ALWAYS(rc>=0) && rc<ArraySize(aMsg) && aMsg[rc]!=0 ){
|
|
23 |
0 |
if( ALWAYS(rc>=0) && rc<ArraySize(aMsg) && aMsg[rc]!=0 ){
|
176582
|
120 |
58 |
if( count < NDELAY ){
|
176589
|
14 |
164 |
if( prior + delay > tmout ){
|
176591
|
7 |
7 |
if( delay<=0 ) return 0;
|
176619
|
180 |
0 |
if( p->xBusyHandler==0 || p->nBusy<0 ) return 0;
|
|
2 |
178 |
if( p->xBusyHandler==0 || p->nBusy<0 ) return 0;
|
176621
|
7 |
171 |
if( rc==0 ){
|
176669
|
2 |
2 |
if( nOps>0 ){
|
176691
|
321 |
2 |
if( ms>0 ){
|
176756
|
5088 |
0 |
if( zFunctionName==0 /* Must have a valid name */
|
176757
|
5040 |
48 |
|| (xSFunc!=0 && xFinal!=0) /* Not both xSFunc and xFinal */
|
|
5040 |
0 |
|| (xSFunc!=0 && xFinal!=0) /* Not both xSFunc and xFinal */
|
176758
|
5088 |
0 |
|| ((xFinal==0)!=(xStep==0)) /* Both or neither of xFinal and xStep */
|
176759
|
5088 |
0 |
|| ((xValue==0)!=(xInverse==0)) /* Both or neither of xValue, xInverse */
|
176760
|
5088 |
0 |
|| (nArg<-1 || nArg>SQLITE_MAX_FUNCTION_ARG)
|
|
5088 |
0 |
|| (nArg<-1 || nArg>SQLITE_MAX_FUNCTION_ARG)
|
176761
|
0 |
5088 |
|| (255<sqlite3Strlen30(zFunctionName))
|
176795
|
0 |
0 |
if( rc==SQLITE_OK ){
|
176800
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
176824
|
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 ){
|
176825
|
0 |
6 |
if( db->nVdbeActive ){
|
176833
|
42 |
5040 |
}else if( xSFunc==0 && xFinal==0 ){
|
|
0 |
42 |
}else if( xSFunc==0 && xFinal==0 ){
|
176841
|
0 |
5088 |
if( !p ){
|
176849
|
2488 |
2600 |
if( pDestructor ){
|
176856
|
5040 |
48 |
p->xSFunc = xSFunc ? xSFunc : xStep;
|
176894
|
2488 |
2600 |
if( xDestroy ){
|
176896
|
0 |
2488 |
if( !pArg ){
|
176908
|
2488 |
2600 |
if( pArg && pArg->nRef==0 ){
|
|
0 |
2488 |
if( pArg && pArg->nRef==0 ){
|
177045
|
311 |
2488 |
if( rc ) return SQLITE_OK;
|
177047
|
0 |
2488 |
if( zCopy==0 ) return SQLITE_NOMEM;
|
177073
|
4 |
2 |
db->mTrace = xTrace ? SQLITE_TRACE_LEGACY : 0;
|
177095
|
0 |
0 |
if( mTrace==0 ) xTrace = 0;
|
177096
|
0 |
0 |
if( xTrace==0 ) mTrace = 0;
|
177131
|
4 |
2 |
if( db->xProfile ) db->mTrace |= SQLITE_TRACE_XPROFILE;
|
177252
|
0 |
0 |
if( db->xAutovacDestr ){
|
177276
|
0 |
0 |
if( nFrame>=SQLITE_PTR_TO_INT(pClientData) ){
|
177304
|
311 |
0 |
if( nFrame>0 ){
|
177362
|
0 |
0 |
if( pnLog ) *pnLog = -1;
|
177363
|
0 |
0 |
if( pnCkpt ) *pnCkpt = -1;
|
177369
|
0 |
0 |
if( eMode<SQLITE_CHECKPOINT_PASSIVE || eMode>SQLITE_CHECKPOINT_TRUNCATE ){
|
|
0 |
0 |
if( eMode<SQLITE_CHECKPOINT_PASSIVE || eMode>SQLITE_CHECKPOINT_TRUNCATE ){
|
177376
|
0 |
0 |
if( zDb && zDb[0] ){
|
|
0 |
0 |
if( zDb && zDb[0] ){
|
177381
|
0 |
0 |
if( iDb<0 ){
|
177393
|
0 |
0 |
if( db->nVdbeActive==0 ){
|
177446
|
0 |
0 |
for(i=0; i<db->nDb && rc==SQLITE_OK; i++){
|
|
0 |
0 |
for(i=0; i<db->nDb && rc==SQLITE_OK; i++){
|
177447
|
0 |
0 |
if( i==iDb || iDb==SQLITE_MAX_DB ){
|
|
0 |
0 |
if( i==iDb || iDb==SQLITE_MAX_DB ){
|
177451
|
0 |
0 |
if( rc==SQLITE_BUSY ){
|
177458
|
0 |
0 |
return (rc==SQLITE_OK && bBusy) ? SQLITE_BUSY : rc;
|
|
0 |
0 |
return (rc==SQLITE_OK && bBusy) ? SQLITE_BUSY : rc;
|
177504
|
0 |
128 |
if( !db ){
|
177507
|
0 |
128 |
if( !sqlite3SafetyCheckSickOrOk(db) ){
|
177511
|
0 |
128 |
if( db->mallocFailed ){
|
177515
|
128 |
0 |
z = db->errCode ? (char*)sqlite3_value_text(db->pErr) : 0;
|
177517
|
17 |
111 |
if( z==0 ){
|
177530
|
1 |
0 |
if( db && sqlite3SafetyCheckSickOrOk(db) && db->errCode ){
|
|
1 |
0 |
if( db && sqlite3SafetyCheckSickOrOk(db) && db->errCode ){
|
|
1 |
0 |
if( db && sqlite3SafetyCheckSickOrOk(db) && db->errCode ){
|
177554
|
0 |
0 |
if( !db ){
|
177557
|
0 |
0 |
if( !sqlite3SafetyCheckSickOrOk(db) ){
|
177561
|
0 |
0 |
if( db->mallocFailed ){
|
177565
|
0 |
0 |
if( z==0 ){
|
177586
|
947 |
0 |
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
|
|
0 |
947 |
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
|
177589
|
947 |
0 |
if( !db || db->mallocFailed ){
|
|
0 |
947 |
if( !db || db->mallocFailed ){
|
177595
|
0 |
0 |
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
|
|
0 |
0 |
if( db && !sqlite3SafetyCheckSickOrOk(db) ){
|
177598
|
0 |
0 |
if( !db || db->mallocFailed ){
|
|
0 |
0 |
if( !db || db->mallocFailed ){
|
177604
|
0 |
0 |
return db ? db->iSysErrno : 0;
|
177640
|
1601 |
0 |
if( enc2==SQLITE_UTF16 || enc2==SQLITE_UTF16_ALIGNED ){
|
|
0 |
1601 |
if( enc2==SQLITE_UTF16 || enc2==SQLITE_UTF16_ALIGNED ){
|
177643
|
1601 |
0 |
if( enc2<SQLITE_UTF8 || enc2>SQLITE_UTF16BE ){
|
|
0 |
1601 |
if( enc2<SQLITE_UTF8 || enc2>SQLITE_UTF16BE ){
|
177652
|
634 |
967 |
if( pColl && pColl->xCmp ){
|
|
0 |
634 |
if( pColl && pColl->xCmp ){
|
177653
|
0 |
0 |
if( db->nVdbeActive ){
|
177666
|
0 |
0 |
if( (pColl->enc & ~SQLITE_UTF16_ALIGNED)==enc2 ){
|
177669
|
0 |
0 |
for(j=0; j<3; j++){
|
177671
|
0 |
0 |
if( p->enc==pColl->enc ){
|
177672
|
0 |
0 |
if( p->xDel ){
|
177682
|
0 |
1601 |
if( pColl==0 ) return SQLITE_NOMEM_BKPT;
|
177791
|
6 |
0 |
if( limitId<0 || limitId>=SQLITE_N_LIMIT ){
|
|
0 |
6 |
if( limitId<0 || limitId>=SQLITE_N_LIMIT ){
|
177795
|
2 |
4 |
if( newLimit>=0 ){ /* IMP: R-52476-28732 */
|
177796
|
0 |
2 |
if( newLimit>aHardLimit[limitId] ){
|
177798
|
0 |
2 |
}else if( newLimit<1 && limitId==SQLITE_LIMIT_LENGTH ){
|
|
0 |
0 |
}else if( newLimit<1 && limitId==SQLITE_LIMIT_LENGTH ){
|
177849
|
309 |
13 |
if( ((flags & SQLITE_OPEN_URI) /* IMP: R-48725-32206 */
|
177850
|
0 |
309 |
|| AtomicLoad(&sqlite3GlobalConfig.bOpenUri)) /* IMP: R-51689-46548 */
|
177851
|
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 */
|
177863
|
238 |
12 |
for(iIn=0; iIn<nUri; iIn++) nByte += (zUri[iIn]=='&');
|
177865
|
0 |
12 |
if( !zFile ) return SQLITE_NOMEM_BKPT;
|
177885
|
0 |
12 |
if( zUri[5]=='/' && zUri[6]=='/' ){
|
|
0 |
0 |
if( zUri[5]=='/' && zUri[6]=='/' ){
|
177887
|
0 |
0 |
while( zUri[iIn] && zUri[iIn]!='/' ) iIn++;
|
|
0 |
0 |
while( zUri[iIn] && zUri[iIn]!='/' ) iIn++;
|
177888
|
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)) ){
|
177908
|
178 |
12 |
while( (c = zUri[iIn])!=0 && c!='#' ){
|
|
178 |
0 |
while( (c = zUri[iIn])!=0 && c!='#' ){
|
177910
|
0 |
178 |
if( c=='%'
|
177911
|
0 |
0 |
&& sqlite3Isxdigit(zUri[iIn])
|
177912
|
0 |
0 |
&& sqlite3Isxdigit(zUri[iIn+1])
|
177918
|
0 |
0 |
if( octet==0 ){
|
177924
|
0 |
0 |
while( (c = zUri[iIn])!=0 && c!='#'
|
|
0 |
0 |
while( (c = zUri[iIn])!=0 && c!='#'
|
177925
|
0 |
0 |
&& (eState!=0 || c!='?')
|
|
0 |
0 |
&& (eState!=0 || c!='?')
|
177926
|
0 |
0 |
&& (eState!=1 || (c!='=' && c!='&'))
|
|
0 |
0 |
&& (eState!=1 || (c!='=' && c!='&'))
|
|
0 |
0 |
&& (eState!=1 || (c!='=' && c!='&'))
|
177927
|
0 |
0 |
&& (eState!=2 || c!='&')
|
|
0 |
0 |
&& (eState!=2 || c!='&')
|
177940
|
50 |
128 |
}else if( eState==1 && (c=='&' || c=='=') ){
|
|
50 |
0 |
}else if( eState==1 && (c=='&' || c=='=') ){
|
|
10 |
40 |
}else if( eState==1 && (c=='&' || c=='=') ){
|
177941
|
0 |
10 |
if( zFile[iOut-1]==0 ){
|
177943
|
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++;
|
177946
|
0 |
10 |
if( c=='&' ){
|
177952
|
106 |
62 |
}else if( (eState==0 && c=='?') || (eState==2 && c=='&') ){
|
|
96 |
10 |
}else if( (eState==0 && c=='?') || (eState==2 && c=='&') ){
|
|
22 |
136 |
}else if( (eState==0 && c=='?') || (eState==2 && c=='&') ){
|
|
0 |
22 |
}else if( (eState==0 && c=='?') || (eState==2 && c=='&') ){
|
177958
|
0 |
12 |
if( eState==1 ) zFile[iOut++] = '\0';
|
177966
|
10 |
12 |
while( zOpt[0] ){
|
177971
|
0 |
10 |
if( nOpt==3 && memcmp("vfs", zOpt, 3)==0 ){
|
|
0 |
0 |
if( nOpt==3 && memcmp("vfs", zOpt, 3)==0 ){
|
177982
|
0 |
10 |
if( nOpt==5 && memcmp("cache", zOpt, 5)==0 ){
|
|
0 |
0 |
if( nOpt==5 && memcmp("cache", zOpt, 5)==0 ){
|
177994
|
10 |
0 |
if( nOpt==4 && memcmp("mode", zOpt, 4)==0 ){
|
|
10 |
0 |
if( nOpt==4 && memcmp("mode", zOpt, 4)==0 ){
|
178010
|
10 |
0 |
if( aMode ){
|
178013
|
18 |
0 |
for(i=0; aMode[i].z; i++){
|
178015
|
14 |
4 |
if( nVal==sqlite3Strlen30(z) && 0==memcmp(zVal, z, nVal) ){
|
|
10 |
4 |
if( nVal==sqlite3Strlen30(z) && 0==memcmp(zVal, z, nVal) ){
|
178020
|
0 |
10 |
if( mode==0 ){
|
178025
|
0 |
10 |
if( (mode & ~SQLITE_OPEN_MEMORY)>limit ){
|
178040
|
0 |
310 |
if( !zFile ) return SQLITE_NOMEM_BKPT;
|
178043
|
307 |
3 |
if( nUri ){
|
178051
|
0 |
322 |
if( *ppVfs==0 ){
|
178056
|
0 |
322 |
if( rc!=SQLITE_OK ){
|
178071
|
260 |
0 |
while( ALWAYS(zFilename!=0) && zFilename[0] ){
|
|
28 |
232 |
while( ALWAYS(zFilename!=0) && zFilename[0] ){
|
178074
|
0 |
28 |
if( x==0 ) return zFilename;
|
178106
|
0 |
317 |
if( rc ) return rc;
|
178109
|
0 |
317 |
if( sqlite3GlobalConfig.bCoreMutex==0 ){
|
178111
|
0 |
317 |
}else if( flags & SQLITE_OPEN_NOMUTEX ){
|
178113
|
0 |
317 |
}else if( flags & SQLITE_OPEN_FULLMUTEX ){
|
178119
|
0 |
317 |
if( flags & SQLITE_OPEN_PRIVATECACHE ){
|
178121
|
0 |
317 |
}else if( sqlite3GlobalConfig.sharedCacheEnabled ){
|
178150
|
0 |
317 |
if( db==0 ) goto opendb_out;
|
178151
|
317 |
0 |
if( isThreadsafe
|
178157
|
0 |
317 |
if( db->mutex==0 ){
|
178167
|
0 |
317 |
db->errMask = (flags & SQLITE_OPEN_EXRESCODE)!=0 ? 0xffffffff : 0xff;
|
178279
|
0 |
317 |
if( db->mallocFailed ){
|
178315
|
0 |
317 |
if( ((1<<(flags&7)) & 0x46)==0 ){
|
178320
|
0 |
317 |
if( rc!=SQLITE_OK ){
|
178321
|
0 |
0 |
if( rc==SQLITE_NOMEM ) sqlite3OomFault(db);
|
178322
|
0 |
0 |
sqlite3ErrorWithMsg(db, rc, zErrMsg ? "%s" : 0, zErrMsg);
|
178336
|
6 |
311 |
if( rc!=SQLITE_OK ){
|
178337
|
0 |
6 |
if( rc==SQLITE_IOERR_NOMEM ){
|
178345
|
311 |
0 |
if( !db->mallocFailed ){
|
178360
|
0 |
311 |
if( db->mallocFailed ){
|
178374
|
1866 |
0 |
for(i=0; rc==SQLITE_OK && i<ArraySize(sqlite3BuiltinExtensions); i++){
|
|
1555 |
311 |
for(i=0; rc==SQLITE_OK && i<ArraySize(sqlite3BuiltinExtensions); i++){
|
178381
|
311 |
0 |
if( rc==SQLITE_OK ){
|
178384
|
0 |
311 |
if( rc!=SQLITE_OK ){
|
178406
|
0 |
311 |
if( rc ) sqlite3Error(db, rc);
|
178415
|
317 |
0 |
if( db ){
|
178422
|
0 |
317 |
if( (rc&0xff)==SQLITE_NOMEM ){
|
178425
|
6 |
311 |
}else if( rc!=SQLITE_OK ){
|
178478
|
0 |
0 |
if( rc ) return rc;
|
178480
|
0 |
0 |
if( zFilename==0 ) zFilename = "\000\000";
|
178484
|
0 |
0 |
if( zFilename8 ){
|
178488
|
0 |
0 |
if( rc==SQLITE_OK && !DbHasProperty(*ppDb, 0, DB_SchemaLoaded) ){
|
|
0 |
0 |
if( rc==SQLITE_OK && !DbHasProperty(*ppDb, 0, DB_SchemaLoaded) ){
|
178557
|
0 |
0 |
if( zName8 ){
|
178731
|
0 |
13 |
if( SQLITE_OK!=rc ){
|
178737
|
10 |
3 |
if( !pTab || IsView(pTab) ){
|
|
0 |
10 |
if( !pTab || IsView(pTab) ){
|
178743
|
10 |
0 |
if( zColumnName==0 ){
|
178746
|
22 |
2 |
for(iCol=0; iCol<pTab->nCol; iCol++){
|
178748
|
8 |
14 |
if( 0==sqlite3StrICmp(pCol->zCnName, zColumnName) ){
|
178752
|
2 |
8 |
if( iCol==pTab->nCol ){
|
178753
|
2 |
0 |
if( HasRowid(pTab) && sqlite3IsRowid(zColumnName) ){
|
|
0 |
2 |
if( HasRowid(pTab) && sqlite3IsRowid(zColumnName) ){
|
178755
|
0 |
0 |
pCol = iCol>=0 ? &pTab->aCol[iCol] : 0;
|
178773
|
8 |
0 |
if( pCol ){
|
178778
|
3 |
5 |
autoinc = pTab->iPKey==iCol && (pTab->tabFlags & TF_Autoincrement)!=0;
|
|
2 |
1 |
autoinc = pTab->iPKey==iCol && (pTab->tabFlags & TF_Autoincrement)!=0;
|
178783
|
8 |
0 |
if( !zCollSeq ){
|
178794
|
12 |
1 |
if( pzDataType ) *pzDataType = zDataType;
|
178795
|
12 |
1 |
if( pzCollSeq ) *pzCollSeq = zCollSeq;
|
178796
|
12 |
1 |
if( pNotNull ) *pNotNull = notnull;
|
178797
|
12 |
1 |
if( pPrimaryKey ) *pPrimaryKey = primarykey;
|
178798
|
12 |
1 |
if( pAutoinc ) *pAutoinc = autoinc;
|
178800
|
13 |
0 |
if( SQLITE_OK==rc && !pTab ){
|
|
5 |
8 |
if( SQLITE_OK==rc && !pTab ){
|
178806
|
5 |
8 |
sqlite3ErrorWithMsg(db, rc, (zErrMsg?"%s":0), zErrMsg);
|
178820
|
0 |
0 |
if( pVfs==0 ) return 0;
|
178825
|
0 |
0 |
rc = (sqlite3OsSleep(pVfs, ms<0 ? 0 : 1000*ms)/1000);
|
178837
|
0 |
0 |
db->errMask = onoff ? 0xffffffff : 0xff;
|
178854
|
219 |
0 |
if( pBtree ){
|
178862
|
0 |
219 |
if( op==SQLITE_FCNTL_FILE_POINTER ){
|
178865
|
0 |
219 |
}else if( op==SQLITE_FCNTL_VFS_POINTER ){
|
178868
|
0 |
219 |
}else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){
|
178871
|
0 |
219 |
}else if( op==SQLITE_FCNTL_DATA_VERSION ){
|
178874
|
0 |
219 |
}else if( op==SQLITE_FCNTL_RESERVE_BYTES ){
|
178877
|
0 |
0 |
if( iNew>=0 && iNew<=255 ){
|
|
0 |
0 |
if( iNew>=0 && iNew<=255 ){
|
178881
|
0 |
219 |
}else if( op==SQLITE_FCNTL_RESET_CACHE ){
|
178947
|
0 |
0 |
int x = va_arg(ap, int);
|
178949
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*);
|
178951
|
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; }
|
178967
|
0 |
0 |
int sz = va_arg(ap, int);
|
178968
|
0 |
0 |
int *aProg = va_arg(ap, int*);
|
178994
|
0 |
0 |
sqlite3GlobalConfig.xTestCallback = va_arg(ap, sqlite3FaultFuncType);
|
179009
|
0 |
0 |
xBenignBegin = va_arg(ap, void_function);
|
179010
|
0 |
0 |
xBenignEnd = va_arg(ap, void_function);
|
179031
|
0 |
0 |
unsigned int newVal = va_arg(ap, unsigned int);
|
179032
|
0 |
0 |
if( newVal ) sqlite3PendingByte = newVal;
|
179107
|
0 |
0 |
int x = va_arg(ap,int);
|
179138
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*);
|
179139
|
0 |
0 |
db->dbOptFlags = va_arg(ap, u32);
|
179157
|
0 |
0 |
sqlite3GlobalConfig.bLocaltimeFault = va_arg(ap, int);
|
179158
|
0 |
0 |
if( sqlite3GlobalConfig.bLocaltimeFault==2 ){
|
179160
|
0 |
0 |
sqlite3GlobalConfig.xAltLocaltime = va_arg(ap, sqlite3LocaltimeType);
|
179173
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*);
|
179187
|
0 |
0 |
sqlite3GlobalConfig.neverCorrupt = va_arg(ap, int);
|
179204
|
0 |
0 |
sqlite3GlobalConfig.bExtraSchemaChecks = va_arg(ap, int);
|
179214
|
0 |
0 |
sqlite3GlobalConfig.iOnceResetThreshold = va_arg(ap, int);
|
179235
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*);
|
179236
|
0 |
0 |
db->nMaxSorterMmap = va_arg(ap, int);
|
179246
|
0 |
0 |
if( sqlite3GlobalConfig.isInit==0 ) rc = SQLITE_ERROR;
|
179267
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*);
|
179270
|
0 |
0 |
iDb = sqlite3FindDbName(db, va_arg(ap,const char*));
|
179271
|
0 |
0 |
if( iDb>=0 ){
|
179273
|
0 |
0 |
db->init.busy = db->init.imposterTable = va_arg(ap,int);
|
179274
|
0 |
0 |
db->init.newTnum = va_arg(ap,int);
|
179275
|
0 |
0 |
if( db->init.busy==0 && db->init.newTnum>0 ){
|
|
0 |
0 |
if( db->init.busy==0 && db->init.newTnum>0 ){
|
179310
|
0 |
0 |
sqlite3_context *pCtx = va_arg(ap, sqlite3_context*);
|
179325
|
0 |
0 |
sqlite3 *db = va_arg(ap, sqlite3*);
|
179326
|
0 |
0 |
u64 *pn = va_arg(ap, sqlite3_uint64*);
|
179342
|
0 |
0 |
int opTrace = va_arg(ap, int);
|
179343
|
0 |
0 |
u32 *ptr = va_arg(ap, u32*);
|
179363
|
0 |
0 |
double rIn = va_arg(ap, double);
|
179365
|
0 |
0 |
int *pI1 = va_arg(ap,int*);
|
179366
|
0 |
0 |
u64 *pU64 = va_arg(ap,u64*);
|
179367
|
0 |
0 |
int *pI2 = va_arg(ap,int*);
|
179419
|
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 ){
|
179455
|
0 |
0 |
for(i=0; i<nParam*2; i++){
|
179459
|
0 |
0 |
if( p==0 ) return 0;
|
179463
|
0 |
0 |
for(i=0; i<nParam*2; i++){
|
179481
|
0 |
322 |
if( p==0 ) return;
|
179499
|
232 |
190 |
if( zFilename==0 || zParam==0 ) return 0;
|
|
0 |
232 |
if( zFilename==0 || zParam==0 ) return 0;
|
179508
|
0 |
0 |
if( zFilename==0 || N<0 ) return 0;
|
|
0 |
0 |
if( zFilename==0 || N<0 ) return 0;
|
179511
|
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 ){
|
179515
|
0 |
0 |
return zFilename[0] ? zFilename : 0;
|
179524
|
0 |
410 |
return z ? sqlite3GetBoolean(z, bDflt) : bDflt;
|
179537
|
0 |
0 |
if( z && sqlite3DecOrHexToI64(z, &v)==0 ){
|
|
0 |
0 |
if( z && sqlite3DecOrHexToI64(z, &v)==0 ){
|
179554
|
0 |
0 |
if( zFilename==0 ) return 0;
|
179558
|
0 |
0 |
if( zFilename==0 ) return 0;
|
179561
|
0 |
0 |
while( ALWAYS(zFilename) && zFilename[0] ){
|
|
0 |
0 |
while( ALWAYS(zFilename) && zFilename[0] ){
|
179572
|
0 |
0 |
if( zFilename ) zFilename += sqlite3Strlen30(zFilename) + 1;
|
179581
|
122 |
110 |
int iDb = zDbName ? sqlite3FindDbName(db, zDbName) : 0;
|
179582
|
232 |
0 |
return iDb<0 ? 0 : db->aDb[iDb].pBt;
|
179596
|
0 |
0 |
if( N<0 || N>=db->nDb ){
|
|
0 |
0 |
if( N<0 || N>=db->nDb ){
|
179616
|
9 |
0 |
return pBt ? sqlite3BtreeGetFilename(pBt) : 0;
|
179632
|
4 |
0 |
return pBt ? sqlite3BtreeIsReadonly(pBt) : -1;
|
179790
|
0 |
0 |
if( sqlite3StrNICmp(zOptName, "SQLITE_", 7)==0 ) zOptName += 7;
|
179795
|
0 |
0 |
for(i=0; i<nOpt; i++){
|
179796
|
0 |
0 |
if( sqlite3StrNICmp(zOptName, azCompileOpt[i], n)==0
|
179797
|
0 |
0 |
&& sqlite3IsIdChar((unsigned char)azCompileOpt[i][n])==0
|
179813
|
704 |
0 |
if( N>=0 && N<nOpt ){
|
|
688 |
16 |
if( N>=0 && N<nOpt ){
|
181440
|
138539 |
340344 |
}while( vu!=0 );
|
181460
|
7182 |
1242 |
GETVARINT_INIT(a, p, 0, 0x00, 0x80, *v, 1);
|
181461
|
1240 |
2 |
GETVARINT_STEP(a, p, 7, 0x7F, 0x4000, *v, 2);
|
181462
|
2 |
0 |
GETVARINT_STEP(a, p, 14, 0x3FFF, 0x200000, *v, 3);
|
181463
|
0 |
0 |
GETVARINT_STEP(a, p, 21, 0x1FFFFF, 0x10000000, *v, 4);
|
181466
|
0 |
0 |
for(shift=28; shift<=63; shift+=7){
|
181469
|
0 |
0 |
if( (c & 0x80)==0 ) break;
|
181500
|
0 |
0 |
for(shift=0; shift<=63; shift+=7){
|
181501
|
0 |
0 |
u64 c = p<pX ? *p : 0;
|
181504
|
0 |
0 |
if( (c & 0x80)==0 ) break;
|
181525
|
119 |
0 |
GETVARINT_STEP(a, ptr, 7, 0x7F, 0x4000, *pi, 2);
|
181526
|
0 |
0 |
GETVARINT_STEP(a, ptr, 14, 0x3FFF, 0x200000, *pi, 3);
|
181527
|
0 |
0 |
GETVARINT_STEP(a, ptr, 21, 0x1FFFFF, 0x10000000, *pi, 4);
|
181543
|
614 |
38189 |
}while( v!=0 );
|
181565
|
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=='`' ){
|
181570
|
0 |
7 |
if( quote=='[' ) quote = ']';
|
181572
|
125 |
0 |
while( z[iIn] ){
|
181573
|
7 |
118 |
if( z[iIn]==quote ){
|
181574
|
7 |
0 |
if( z[iIn+1]!=quote ) break;
|
181616
|
0 |
0 |
for(p = (*pp)-2; p>=pStart && *p&0x80; p--);
|
|
0 |
0 |
for(p = (*pp)-2; p>=pStart && *p&0x80; p--);
|
181636
|
360 |
9 |
for(i=0; i<SizeofArray(p->aStmt); i++){
|
181678
|
0 |
32 |
if( *pRc ) return;
|
181682
|
0 |
32 |
if( zSql==0 ){
|
181700
|
0 |
0 |
fts3DbExec(&rc, db,
|
181717
|
0 |
0 |
return (rc==SQLITE_OK ? fts3DisconnectMethod(pVtab) : rc);
|
181731
|
9 |
0 |
if( *pRc==SQLITE_OK ){
|
181738
|
0 |
9 |
zLanguageid = (p->zLanguageid ? p->zLanguageid : "__langid");
|
181743
|
14 |
0 |
for(i=1; zCols && i<p->nColumn; i++){
|
|
5 |
9 |
for(i=1; zCols && i<p->nColumn; i++){
|
181752
|
9 |
0 |
if( !zCols || !zSql ){
|
|
0 |
9 |
if( !zCols || !zSql ){
|
181773
|
5 |
0 |
if( (*pRc)==SQLITE_OK ) p->bHasStat = 1;
|
181790
|
6 |
2 |
if( p->zContentTbl==0 ){
|
181796
|
14 |
0 |
for(i=0; zContentCols && i<p->nColumn; i++){
|
|
8 |
6 |
for(i=0; zContentCols && i<p->nColumn; i++){
|
181800
|
0 |
6 |
if( zLanguageid && zContentCols ){
|
|
0 |
0 |
if( zLanguageid && zContentCols ){
|
181803
|
0 |
6 |
if( zContentCols==0 ) rc = SQLITE_NOMEM;
|
181830
|
5 |
3 |
if( p->bHasDocsize ){
|
181837
|
5 |
3 |
if( p->bHasStat ){
|
181851
|
9 |
0 |
if( *pRc==SQLITE_OK ){
|
181857
|
0 |
9 |
if( !zSql ){
|
181861
|
9 |
0 |
if( rc==SQLITE_OK ){
|
181865
|
0 |
0 |
}else if( rc==SQLITE_AUTH ){
|
181892
|
51 |
3 |
while( *zCsr!='=' ){
|
181893
|
6 |
45 |
if( *zCsr=='\0' ) return 0;
|
181899
|
3 |
0 |
if( zValue ){
|
181915
|
55 |
0 |
if( *pRc==SQLITE_OK ){
|
181921
|
55 |
0 |
if( z && *pz ){
|
|
37 |
18 |
if( z && *pz ){
|
181926
|
0 |
55 |
if( z==0 ) *pRc = SQLITE_NOMEM;
|
181947
|
0 |
0 |
if( zRet ){
|
181951
|
0 |
0 |
for(i=0; zInput[i]; i++){
|
181952
|
0 |
0 |
if( zInput[i]=='"' ) *(z++) = '"';
|
181990
|
6 |
3 |
if( p->zContentTbl==0 ){
|
181991
|
6 |
0 |
if( !zFunc ){
|
181997
|
8 |
6 |
for(i=0; i<p->nColumn; i++){
|
182000
|
0 |
6 |
if( p->zLanguageid ){
|
182006
|
6 |
3 |
for(i=0; i<p->nColumn; i++){
|
182009
|
0 |
3 |
if( p->zLanguageid ){
|
182013
|
3 |
6 |
fts3Appendf(pRc, &zRet, " FROM '%q'.'%q%s' AS x",
|
|
3 |
6 |
fts3Appendf(pRc, &zRet, " FROM '%q'.'%q%s' AS x",
|
182047
|
9 |
0 |
if( !zFunc ){
|
182053
|
14 |
9 |
for(i=0; i<p->nColumn; i++){
|
182056
|
0 |
9 |
if( p->zLanguageid ){
|
182071
|
0 |
0 |
for(i=0; z[i]>='0' && z[i]<='9'; i++){
|
|
0 |
0 |
for(i=0; z[i]>='0' && z[i]<='9'; i++){
|
182073
|
0 |
0 |
if( iVal>0x7FFFFFFF ) return -1;
|
182097
|
0 |
0 |
if( nInt>MAX_NPREFIX ){
|
182100
|
0 |
0 |
if( nByte==0 ){
|
182133
|
0 |
9 |
if( zParam && zParam[0] ){
|
|
0 |
0 |
if( zParam && zParam[0] ){
|
182136
|
0 |
0 |
for(p=zParam; *p; p++){
|
182137
|
0 |
0 |
if( *p==',' ) nIndex++;
|
182143
|
0 |
9 |
if( !aIndex ){
|
182148
|
0 |
9 |
if( zParam ){
|
182151
|
0 |
0 |
for(i=1; i<nIndex; i++){
|
182153
|
0 |
0 |
if( fts3GobbleInt(&p, &nPrefix) ) return SQLITE_ERROR;
|
182155
|
0 |
0 |
if( nPrefix==0 ){
|
182208
|
0 |
2 |
if( !zSql ){
|
182212
|
0 |
2 |
if( rc!=SQLITE_OK ){
|
182218
|
2 |
0 |
if( rc==SQLITE_OK ){
|
182228
|
4 |
2 |
for(i=0; i<nCol; i++){
|
182235
|
0 |
2 |
if( azCol==0 ){
|
182239
|
4 |
2 |
for(i=0; i<nCol; i++){
|
182317
|
10 |
0 |
if( aCol ){
|
182321
|
10 |
0 |
if( azNotindexed ){
|
182324
|
10 |
0 |
if( !aCol || !azNotindexed ){
|
|
0 |
10 |
if( !aCol || !azNotindexed ){
|
182340
|
29 |
1 |
for(i=3; rc==SQLITE_OK && i<argc; i++){
|
|
20 |
9 |
for(i=3; rc==SQLITE_OK && i<argc; i++){
|
182346
|
20 |
0 |
if( !pTokenizer
|
182347
|
11 |
9 |
&& strlen(z)>8
|
182348
|
6 |
5 |
&& 0==sqlite3_strnicmp(z, "tokenize", 8)
|
182349
|
6 |
0 |
&& 0==sqlite3Fts3IsIdChar(z[8])
|
182355
|
9 |
5 |
else if( isFts4 && fts3IsSpecialColumn(z, &nKey, &zVal) ){
|
|
3 |
6 |
else if( isFts4 && fts3IsSpecialColumn(z, &nKey, &zVal) ){
|
182371
|
0 |
3 |
if( !zVal ){
|
182374
|
18 |
0 |
for(iOpt=0; iOpt<SizeofArray(aFts4Opt); iOpt++){
|
182376
|
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) ){
|
182382
|
0 |
0 |
if( strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "fts3", 4) ){
|
|
0 |
0 |
if( strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "fts3", 4) ){
|
182408
|
0 |
0 |
if( (strlen(zVal)!=3 || sqlite3_strnicmp(zVal, "asc", 3))
|
|
0 |
0 |
if( (strlen(zVal)!=3 || sqlite3_strnicmp(zVal, "asc", 3))
|
182409
|
0 |
0 |
&& (strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "desc", 4))
|
|
0 |
0 |
&& (strlen(zVal)!=4 || sqlite3_strnicmp(zVal, "desc", 4))
|
182414
|
0 |
0 |
bDescIdx = (zVal[0]=='d' || zVal[0]=='D');
|
|
0 |
0 |
bDescIdx = (zVal[0]=='d' || zVal[0]=='D');
|
182459
|
9 |
1 |
if( rc==SQLITE_OK && zContent ){
|
|
3 |
6 |
if( rc==SQLITE_OK && zContent ){
|
182464
|
2 |
1 |
if( nCol==0 ){
|
182471
|
2 |
0 |
if( rc==SQLITE_OK && zLanguageid ){
|
|
0 |
2 |
if( rc==SQLITE_OK && zLanguageid ){
|
182473
|
0 |
0 |
for(j=0; j<nCol; j++){
|
182474
|
0 |
0 |
if( sqlite3_stricmp(zLanguageid, aCol[j])==0 ){
|
182476
|
0 |
0 |
for(k=j; k<nCol; k++) aCol[k] = aCol[k+1];
|
182484
|
1 |
9 |
if( rc!=SQLITE_OK ) goto fts3_init_out;
|
182486
|
0 |
9 |
if( nCol==0 ){
|
182493
|
4 |
5 |
if( pTokenizer==0 ){
|
182495
|
0 |
4 |
if( rc!=SQLITE_OK ) goto fts3_init_out;
|
182500
|
0 |
9 |
if( rc==SQLITE_ERROR ){
|
182504
|
0 |
9 |
if( rc!=SQLITE_OK ) goto fts3_init_out;
|
182515
|
0 |
9 |
if( p==0 ){
|
182526
|
6 |
3 |
p->bHasDocsize = (isFts4 && bNoDocsize==0);
|
|
6 |
0 |
p->bHasDocsize = (isFts4 && bNoDocsize==0);
|
182541
|
9 |
9 |
for(i=0; i<nIndex; i++){
|
182556
|
14 |
9 |
for(iCol=0; iCol<nCol; iCol++){
|
182560
|
14 |
0 |
if( n>0 ){
|
182571
|
14 |
9 |
for(iCol=0; iCol<nCol; iCol++){
|
182573
|
0 |
14 |
for(i=0; i<nNotindexed; i++){
|
182575
|
0 |
0 |
if( zNot && n==(int)strlen(zNot)
|
|
0 |
0 |
if( zNot && n==(int)strlen(zNot)
|
182576
|
0 |
0 |
&& 0==sqlite3_strnicmp(p->azColumn[iCol], zNot, n)
|
182584
|
0 |
9 |
for(i=0; i<nNotindexed; i++){
|
182585
|
0 |
0 |
if( azNotindexed[i] ){
|
182591
|
9 |
0 |
if( rc==SQLITE_OK && (zCompress==0)!=(zUncompress==0) ){
|
|
0 |
9 |
if( rc==SQLITE_OK && (zCompress==0)!=(zUncompress==0) ){
|
182592
|
0 |
0 |
char const *zMiss = (zCompress==0 ? "compress" : "uncompress");
|
182598
|
0 |
9 |
if( rc!=SQLITE_OK ) goto fts3_init_out;
|
182603
|
8 |
1 |
if( isCreate ){
|
182610
|
3 |
6 |
if( !isFts4 && !isCreate ){
|
|
0 |
3 |
if( !isFts4 && !isCreate ){
|
182633
|
0 |
10 |
for(i=0; i<nNotindexed; i++) sqlite3_free(azNotindexed[i]);
|
182636
|
1 |
9 |
if( rc!=SQLITE_OK ){
|
182637
|
0 |
1 |
if( p ){
|
182639
|
0 |
1 |
}else if( pTokenizer ){
|
182681
|
0 |
0 |
if( sqlite3_libversion_number()>=3008002 ){
|
182694
|
0 |
0 |
if( sqlite3_libversion_number()>=3008012 ){
|
182718
|
0 |
63 |
if( p->bLock ){
|
182728
|
63 |
63 |
for(i=0; i<pInfo->nConstraint; i++){
|
182731
|
0 |
63 |
if( pCons->usable==0 ){
|
182732
|
0 |
0 |
if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH ){
|
182746
|
63 |
0 |
bDocid = (pCons->iColumn<0 || pCons->iColumn==p->nColumn+1);
|
|
0 |
63 |
bDocid = (pCons->iColumn<0 || pCons->iColumn==p->nColumn+1);
|
182749
|
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 ){
|
182764
|
62 |
1 |
if( pCons->op==SQLITE_INDEX_CONSTRAINT_MATCH
|
182765
|
62 |
0 |
&& pCons->iColumn>=0 && pCons->iColumn<=p->nColumn
|
|
62 |
0 |
&& pCons->iColumn>=0 && pCons->iColumn<=p->nColumn
|
182773
|
1 |
62 |
if( pCons->op==SQLITE_INDEX_CONSTRAINT_EQ
|
182774
|
0 |
1 |
&& pCons->iColumn==p->nColumn + 2
|
182779
|
0 |
63 |
if( bDocid ){
|
182795
|
0 |
63 |
if( pInfo->idxNum==FTS3_DOCID_SEARCH ) fts3SetUniqueFlag(pInfo);
|
182798
|
62 |
1 |
if( iCons>=0 ){
|
182802
|
0 |
63 |
if( iLangidCons>=0 ){
|
182806
|
0 |
63 |
if( iDocidGe>=0 ){
|
182810
|
0 |
63 |
if( iDocidLe>=0 ){
|
182818
|
0 |
63 |
if( pInfo->nOrderBy==1 ){
|
182820
|
0 |
0 |
if( pOrder->iColumn<0 || pOrder->iColumn==p->nColumn+1 ){
|
|
0 |
0 |
if( pOrder->iColumn<0 || pOrder->iColumn==p->nColumn+1 ){
|
182821
|
0 |
0 |
if( pOrder->desc ){
|
182847
|
0 |
63 |
if( !pCsr ){
|
182862
|
30 |
159 |
if( pCsr->bSeekStmt ){
|
182864
|
30 |
0 |
if( p->pSeekStmt==0 ){
|
182911
|
30 |
44 |
if( pCsr->pStmt==0 ){
|
182914
|
22 |
8 |
if( p->pSeekStmt ){
|
182919
|
0 |
8 |
if( !zSql ) return SQLITE_NOMEM;
|
182927
|
30 |
0 |
if( rc==SQLITE_OK ) pCsr->bSeekStmt = 1;
|
182939
|
74 |
17 |
if( pCsr->isRequireSeek ){
|
182941
|
74 |
0 |
if( rc==SQLITE_OK ){
|
182946
|
74 |
0 |
if( SQLITE_ROW==sqlite3_step(pCsr->pStmt) ){
|
182952
|
0 |
0 |
if( rc==SQLITE_OK && ((Fts3Table *)pCsr->base.pVtab)->zContentTbl==0 ){
|
|
0 |
0 |
if( rc==SQLITE_OK && ((Fts3Table *)pCsr->base.pVtab)->zContentTbl==0 ){
|
182963
|
0 |
17 |
if( rc!=SQLITE_OK && pContext ){
|
|
0 |
0 |
if( rc!=SQLITE_OK && pContext ){
|
183016
|
0 |
57 |
if( zCsr>zEnd ){
|
183020
|
561 |
33 |
while( zCsr<zEnd && (piFirst || piLast) ){
|
|
537 |
24 |
while( zCsr<zEnd && (piFirst || piLast) ){
|
|
0 |
24 |
while( zCsr<zEnd && (piFirst || piLast) ){
|
183027
|
480 |
57 |
if( !isFirstTerm ){
|
183028
|
0 |
480 |
zCsr += fts3GetVarint32(zCsr, &nPrefix);
|
183029
|
0 |
480 |
if( nPrefix>nBuffer ){
|
183035
|
0 |
537 |
zCsr += fts3GetVarint32(zCsr, &nSuffix);
|
183038
|
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 ){
|
183042
|
96 |
441 |
if( (i64)nPrefix+nSuffix>nAlloc ){
|
183046
|
0 |
96 |
if( !zNew ){
|
183067
|
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)) ){
|
183072
|
0 |
537 |
if( piLast && cmp<0 ){
|
|
0 |
0 |
if( piLast && cmp<0 ){
|
183080
|
20 |
37 |
if( piFirst ) *piFirst = (i64)iChild;
|
183081
|
0 |
57 |
if( piLast ) *piLast = (i64)iChild;
|
183124
|
0 |
57 |
fts3GetVarint32(zNode, &iHeight);
|
183128
|
57 |
0 |
if( rc==SQLITE_OK && iHeight>1 ){
|
|
0 |
57 |
if( rc==SQLITE_OK && iHeight>1 ){
|
183132
|
0 |
0 |
if( piLeaf && piLeaf2 && (*piLeaf!=*piLeaf2) ){
|
|
0 |
0 |
if( piLeaf && piLeaf2 && (*piLeaf!=*piLeaf2) ){
|
|
0 |
0 |
if( piLeaf && piLeaf2 && (*piLeaf!=*piLeaf2) ){
|
183134
|
0 |
0 |
if( rc==SQLITE_OK ){
|
183142
|
0 |
0 |
if( rc==SQLITE_OK ){
|
183143
|
0 |
0 |
rc = sqlite3Fts3ReadBlock(p, piLeaf?*piLeaf:*piLeaf2, &zBlob, &nBlob, 0);
|
183145
|
0 |
0 |
if( rc==SQLITE_OK ){
|
183147
|
0 |
0 |
fts3GetVarint32(zBlob, &iNewHeight);
|
183148
|
0 |
0 |
if( iNewHeight>=iHeight ){
|
183202
|
20 |
192 |
while( *pEnd | c ){
|
183208
|
8 |
184 |
if( pp ){
|
183242
|
1580 |
172 |
while( 0xFE & (*pEnd | c) ){
|
183246
|
0 |
172 |
if( pp ){
|
183285
|
0 |
0 |
if( (**pp)&0xFE ){
|
183287
|
0 |
0 |
*pp += fts3GetVarint32((*pp), &iVal);
|
183306
|
0 |
0 |
if( iCol ){
|
183331
|
0 |
0 |
while( *p1 || *p2 ){
|
|
0 |
0 |
while( *p1 || *p2 ){
|
183335
|
0 |
0 |
if( *p1==POS_COLUMN ){
|
183336
|
0 |
0 |
fts3GetVarint32(&p1[1], &iCol1);
|
183337
|
0 |
0 |
if( iCol1==0 ) return FTS_CORRUPT_VTAB;
|
183339
|
0 |
0 |
else if( *p1==POS_END ) iCol1 = 0x7fffffff;
|
183342
|
0 |
0 |
if( *p2==POS_COLUMN ){
|
183343
|
0 |
0 |
fts3GetVarint32(&p2[1], &iCol2);
|
183344
|
0 |
0 |
if( iCol2==0 ) return FTS_CORRUPT_VTAB;
|
183346
|
0 |
0 |
else if( *p2==POS_END ) iCol2 = 0x7fffffff;
|
183349
|
0 |
0 |
if( iCol1==iCol2 ){
|
183368
|
0 |
0 |
if( i1<2 || i2<2 ){
|
|
0 |
0 |
if( i1<2 || i2<2 ){
|
183374
|
0 |
0 |
if( i1==i2 ){
|
183377
|
0 |
0 |
}else if( i1<i2 ){
|
183382
|
0 |
0 |
}while( i1!=POSITION_LIST_END || i2!=POSITION_LIST_END );
|
|
0 |
0 |
}while( i1!=POSITION_LIST_END || i2!=POSITION_LIST_END );
|
183383
|
0 |
0 |
}else if( iCol1<iCol2 ){
|
183440
|
0 |
86 |
if( *p1==POS_COLUMN ){
|
183442
|
0 |
0 |
p1 += fts3GetVarint32(p1, &iCol1);
|
183444
|
0 |
86 |
if( *p2==POS_COLUMN ){
|
183446
|
0 |
0 |
p2 += fts3GetVarint32(p2, &iCol2);
|
183450
|
86 |
0 |
if( iCol1==iCol2 ){
|
183456
|
0 |
86 |
if( iCol1 ){
|
183463
|
86 |
0 |
if( iPos1<0 || iPos2<0 ) break;
|
|
86 |
0 |
if( iPos1<0 || iPos2<0 ) break;
|
183466
|
7659 |
142 |
if( iPos2==iPos1+nToken
|
183467
|
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)
|
183470
|
0 |
142 |
iSave = isSaveLeft ? iPos1 : iPos2;
|
183475
|
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 ){
|
183476
|
70 |
4724 |
if( (*p2&0xFE)==0 ) break;
|
183479
|
16 |
2991 |
if( (*p1&0xFE)==0 ) break;
|
183484
|
6 |
80 |
if( pSave ){
|
183492
|
0 |
86 |
if( 0==*p1 || 0==*p2 ) break;
|
|
0 |
0 |
if( 0==*p1 || 0==*p2 ) break;
|
183495
|
0 |
0 |
p1 += fts3GetVarint32(p1, &iCol1);
|
183497
|
0 |
0 |
p2 += fts3GetVarint32(p2, &iCol2);
|
183505
|
0 |
0 |
else if( iCol1<iCol2 ){
|
183507
|
0 |
0 |
if( 0==*p1 ) break;
|
183509
|
0 |
0 |
p1 += fts3GetVarint32(p1, &iCol1);
|
183512
|
0 |
0 |
if( 0==*p2 ) break;
|
183514
|
0 |
0 |
p2 += fts3GetVarint32(p2, &iCol2);
|
183522
|
6 |
80 |
if( *pp==p ){
|
183566
|
0 |
0 |
if( pTmp1!=aTmp && pTmp2!=aTmp2 ){
|
|
0 |
0 |
if( pTmp1!=aTmp && pTmp2!=aTmp2 ){
|
183568
|
0 |
0 |
}else if( pTmp1!=aTmp ){
|
183570
|
0 |
0 |
}else if( pTmp2!=aTmp2 ){
|
183609
|
8 |
8 |
if( *pp>=pEnd ){
|
183614
|
0 |
8 |
if( bDescIdx ){
|
183645
|
0 |
8 |
if( bDescIdx==0 || *pbFirst==0 ){
|
|
0 |
0 |
if( bDescIdx==0 || *pbFirst==0 ){
|
183737
|
0 |
4 |
if( !aOut ) return SQLITE_NOMEM;
|
183742
|
4 |
8 |
while( p1 || p2 ){
|
|
4 |
4 |
while( p1 || p2 ){
|
183743
|
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);
|
183745
|
8 |
0 |
if( p2 && p1 && iDiff==0 ){
|
|
4 |
4 |
if( p2 && p1 && iDiff==0 ){
|
|
0 |
4 |
if( p2 && p1 && iDiff==0 ){
|
183748
|
0 |
0 |
if( rc ) break;
|
183751
|
8 |
0 |
}else if( !p2 || (p1 && iDiff<0) ){
|
|
4 |
4 |
}else if( !p2 || (p1 && iDiff<0) ){
|
|
4 |
0 |
}else if( !p2 || (p1 && iDiff<0) ){
|
183764
|
0 |
4 |
if( rc!=SQLITE_OK ){
|
183807
|
0 |
0 |
if( bDescDoclist ){
|
183809
|
0 |
0 |
if( aOut==0 ) return SQLITE_NOMEM;
|
183818
|
0 |
0 |
while( p1 && p2 ){
|
|
0 |
0 |
while( p1 && p2 ){
|
183819
|
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);
|
183820
|
0 |
0 |
if( iDiff==0 ){
|
183826
|
0 |
0 |
if( 0==fts3PoslistPhraseMerge(&p, nDist, 0, 1, &p1, &p2) ){
|
183833
|
0 |
0 |
}else if( iDiff<0 ){
|
183843
|
0 |
0 |
if( bDescDoclist ){
|
183870
|
0 |
0 |
if( *p!=0x01 ){
|
183871
|
0 |
0 |
if( *p==0x02 ){
|
183879
|
0 |
0 |
while( p<pEnd ){
|
183883
|
0 |
0 |
if( *p==0x02 ){
|
183884
|
0 |
0 |
if( bWritten==0 ){
|
183894
|
0 |
0 |
if( bWritten ){
|
183919
|
128 |
8 |
for(i=0; i<SizeofArray(pTS->aaOutput); i++){
|
183920
|
8 |
120 |
if( pTS->aaOutput[i] ){
|
183921
|
8 |
0 |
if( !aOut ){
|
183932
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
183971
|
8 |
4 |
if( pTS->aaOutput[0]==0 ){
|
183990
|
8 |
0 |
if( pTS->aaOutput[0] ){
|
184001
|
8 |
0 |
for(iOut=0; iOut<SizeofArray(pTS->aaOutput); iOut++){
|
184002
|
4 |
4 |
if( pTS->aaOutput[iOut]==0 ){
|
184014
|
0 |
4 |
if( rc!=SQLITE_OK ){
|
184015
|
0 |
0 |
if( aMerge!=aDoclist ) sqlite3_free(aMerge);
|
184019
|
0 |
4 |
if( aMerge!=aDoclist ) sqlite3_free(aMerge);
|
184025
|
0 |
4 |
if( (iOut+1)==SizeofArray(pTS->aaOutput) ){
|
184042
|
148 |
311 |
if( (pCsr->nSegment%16)==0 ){
|
184046
|
0 |
148 |
if( !apNew ){
|
184084
|
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 ){
|
184086
|
105 |
50 |
rc = sqlite3Fts3SegReaderPending(p, iIndex, zTerm, nTerm, isPrefix||isScan, &pSeg);
|
|
0 |
105 |
rc = sqlite3Fts3SegReaderPending(p, iIndex, zTerm, nTerm, isPrefix||isScan, &pSeg);
|
184087
|
155 |
0 |
if( rc==SQLITE_OK && pSeg ){
|
|
35 |
120 |
if( rc==SQLITE_OK && pSeg ){
|
184092
|
114 |
42 |
if( iLevel!=FTS3_SEGCURSOR_PENDING ){
|
184093
|
114 |
0 |
if( rc==SQLITE_OK ){
|
184097
|
538 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){
|
|
424 |
114 |
while( rc==SQLITE_OK && SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){
|
184109
|
57 |
367 |
if( iStartBlock && zTerm && zRoot ){
|
|
57 |
0 |
if( iStartBlock && zTerm && zRoot ){
|
|
57 |
0 |
if( iStartBlock && zTerm && zRoot ){
|
184110
|
0 |
57 |
sqlite3_int64 *pi = (isPrefix ? &iLeavesEndBlock : 0);
|
184112
|
0 |
57 |
if( rc!=SQLITE_OK ) goto finished;
|
184113
|
57 |
0 |
if( isPrefix==0 && isScan==0 ) iLeavesEndBlock = iStartBlock;
|
|
57 |
0 |
if( isPrefix==0 && isScan==0 ) iLeavesEndBlock = iStartBlock;
|
184116
|
392 |
32 |
rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1,
|
|
389 |
3 |
rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1,
|
184121
|
0 |
424 |
if( rc!=SQLITE_OK ) goto finished;
|
184128
|
114 |
42 |
if( rc==SQLITE_DONE ) rc = rc2;
|
184205
|
113 |
0 |
if( pSegcsr ){
|
184210
|
8 |
105 |
if( isPrefix ){
|
184211
|
8 |
0 |
for(i=1; bFound==0 && i<p->nIndex; i++){
|
|
0 |
8 |
for(i=1; bFound==0 && i<p->nIndex; i++){
|
184212
|
0 |
0 |
if( p->aIndex[i].nPrefix==nTerm ){
|
184221
|
8 |
0 |
for(i=1; bFound==0 && i<p->nIndex; i++){
|
|
0 |
8 |
for(i=1; bFound==0 && i<p->nIndex; i++){
|
184222
|
0 |
0 |
if( p->aIndex[i].nPrefix==nTerm+1 ){
|
184227
|
0 |
0 |
if( rc==SQLITE_OK ){
|
184236
|
113 |
0 |
if( bFound==0 ){
|
184276
|
8 |
0 |
| (pTok->isPrefix ? FTS3_SEGMENT_PREFIX : 0)
|
184277
|
0 |
8 |
| (pTok->bFirst ? FTS3_SEGMENT_FIRST : 0)
|
184278
|
8 |
0 |
| (iColumn<p->nColumn ? FTS3_SEGMENT_COLUMN_FILTER : 0);
|
184284
|
20 |
0 |
while( SQLITE_OK==rc
|
184285
|
12 |
8 |
&& SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, pSegcsr))
|
184290
|
8 |
0 |
if( rc==SQLITE_OK ){
|
184293
|
8 |
0 |
if( rc==SQLITE_OK ){
|
184298
|
0 |
0 |
for(i=0; i<SizeofArray(tsc.aaOutput); i++){
|
184319
|
0 |
0 |
if( aList ){
|
184322
|
0 |
0 |
while( p<aEnd ){
|
184324
|
0 |
0 |
while( (*p++)&0x80 ); /* Skip docid varint */
|
184346
|
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 ){
|
184349
|
1 |
10 |
if( SQLITE_ROW!=sqlite3_step(pCsr->pStmt) ){
|
184370
|
0 |
126 |
if( pVal ){
|
184372
|
0 |
0 |
if( eType==SQLITE_INTEGER ){
|
184417
|
0 |
63 |
if( p->bLock ){
|
184427
|
62 |
1 |
if( eSearch!=FTS3_FULLSCAN_SEARCH ) pCons = apVal[iIdx++];
|
184428
|
0 |
63 |
if( idxNum & FTS3_HAVE_LANGID ) pLangid = apVal[iIdx++];
|
184429
|
0 |
63 |
if( idxNum & FTS3_HAVE_DOCID_GE ) pDocidGe = apVal[iIdx++];
|
184430
|
0 |
63 |
if( idxNum & FTS3_HAVE_DOCID_LE ) pDocidLe = apVal[iIdx++];
|
184440
|
0 |
63 |
if( idxStr ){
|
184447
|
63 |
0 |
if( eSearch!=FTS3_DOCID_SEARCH && eSearch!=FTS3_FULLSCAN_SEARCH ){
|
|
62 |
1 |
if( eSearch!=FTS3_DOCID_SEARCH && eSearch!=FTS3_FULLSCAN_SEARCH ){
|
184451
|
0 |
62 |
if( zQuery==0 && sqlite3_value_type(pCons)!=SQLITE_NULL ){
|
|
0 |
0 |
if( zQuery==0 && sqlite3_value_type(pCons)!=SQLITE_NULL ){
|
184456
|
0 |
62 |
if( pLangid ) pCsr->iLangid = sqlite3_value_int(pLangid);
|
184463
|
0 |
62 |
if( rc!=SQLITE_OK ){
|
184469
|
0 |
62 |
if( rc!=SQLITE_OK ) return rc;
|
184479
|
1 |
62 |
if( eSearch==FTS3_FULLSCAN_SEARCH ){
|
184480
|
1 |
0 |
if( pDocidGe || pDocidLe ){
|
|
0 |
1 |
if( pDocidGe || pDocidLe ){
|
184481
|
0 |
0 |
zSql = sqlite3_mprintf(
|
184487
|
0 |
1 |
zSql = sqlite3_mprintf("SELECT %s ORDER BY rowid %s",
|
184491
|
1 |
0 |
if( zSql ){
|
184501
|
0 |
62 |
}else if( eSearch==FTS3_DOCID_SEARCH ){
|
184503
|
0 |
0 |
if( rc==SQLITE_OK ){
|
184507
|
0 |
63 |
if( rc!=SQLITE_OK ) return rc;
|
184518
|
63 |
120 |
if( pCsr->isEof ){
|
184572
|
0 |
0 |
if( pCsr->pExpr ){
|
184575
|
0 |
0 |
}else if( p->zLanguageid==0 ){
|
184587
|
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 ){
|
184643
|
41 |
0 |
if( rc==SQLITE_OK
|
184644
|
5 |
36 |
&& p->nLeafAdd>(nMinMerge/16)
|
184645
|
2 |
3 |
&& p->nAutoincrmerge && p->nAutoincrmerge!=0xff
|
|
0 |
2 |
&& p->nAutoincrmerge && p->nAutoincrmerge!=0xff
|
184654
|
0 |
0 |
if( A>(int)nMinMerge ) rc = sqlite3Fts3Incrmerge(p, A, p->nAutoincrmerge);
|
184669
|
0 |
33 |
if( p->bHasStat==2 ){
|
184671
|
0 |
0 |
if( zTbl ){
|
184743
|
0 |
0 |
while( p>pStart && (c=*p--)==0 );
|
|
0 |
0 |
while( p>pStart && (c=*p--)==0 );
|
184748
|
0 |
0 |
while( p>pStart && (*p & 0x80) | c ){
|
|
0 |
0 |
while( p>pStart && (*p & 0x80) | c ){
|
184766
|
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]; }
|
184767
|
0 |
0 |
while( *p++&0x80 );
|
184789
|
16 |
0 |
if( (*ppCsr)!=0 ){
|
184820
|
0 |
12 |
if( nVal>6 ){
|
184825
|
0 |
12 |
if( fts3FunctionArg(pContext, "snippet", apVal[0], &pCsr) ) return;
|
184838
|
12 |
0 |
if( !zEllipsis || !zEnd || !zStart ){
|
|
12 |
0 |
if( !zEllipsis || !zEnd || !zStart ){
|
|
0 |
12 |
if( !zEllipsis || !zEnd || !zStart ){
|
184840
|
0 |
12 |
}else if( nToken==0 ){
|
184842
|
12 |
0 |
}else if( SQLITE_OK==fts3CursorSeek(pContext, pCsr) ){
|
184860
|
0 |
4 |
if( fts3FunctionArg(pContext, "offsets", apVal[0], &pCsr) ) return;
|
184862
|
4 |
0 |
if( SQLITE_OK==fts3CursorSeek(pContext, pCsr) ){
|
184888
|
0 |
0 |
if( fts3FunctionArg(pContext, "optimize", apVal[0], &pCursor) ) return;
|
184917
|
0 |
0 |
if( SQLITE_OK==fts3FunctionArg(pContext, "matchinfo", apVal[0], &pCsr) ){
|
184919
|
0 |
0 |
if( nVal>1 ){
|
184952
|
20 |
0 |
for(i=0; i<SizeofArray(aOverload); i++){
|
184953
|
16 |
4 |
if( strcmp(zName, aOverload[i].zName)==0 ){
|
184985
|
0 |
0 |
if( rc==SQLITE_OK ){
|
184989
|
0 |
0 |
if( p->zContentTbl==0 ){
|
184996
|
0 |
0 |
if( p->bHasDocsize ){
|
185002
|
0 |
0 |
if( p->bHasStat ){
|
185030
|
0 |
0 |
if( ((Fts3Table *)pVtab)->bIgnoreSavepoint==0 ){
|
185074
|
208 |
0 |
for(i=0; i<sizeof(azName)/sizeof(azName[0]); i++){
|
185075
|
68 |
140 |
if( sqlite3_stricmp(zName, azName[i])==0 ) return 1;
|
185115
|
309 |
618 |
if( pHash->nRef<=0 ){
|
185170
|
0 |
311 |
if( rc!=SQLITE_OK ) return rc;
|
185177
|
0 |
311 |
if( !pHash ){
|
185185
|
311 |
0 |
if( rc==SQLITE_OK ){
|
185186
|
311 |
0 |
if( sqlite3Fts3HashInsert(&pHash->hash, "simple", 7, (void *)pSimple)
|
185187
|
311 |
0 |
|| sqlite3Fts3HashInsert(&pHash->hash, "porter", 7, (void *)pPorter)
|
185190
|
0 |
311 |
|| sqlite3Fts3HashInsert(&pHash->hash, "unicode61", 10, (void *)pUnicode)
|
185210
|
311 |
0 |
if( SQLITE_OK==rc
|
185211
|
311 |
0 |
&& SQLITE_OK==(rc=sqlite3Fts3InitHashTable(db,&pHash->hash,"fts3_tokenizer"))
|
185212
|
311 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "snippet", -1))
|
185213
|
311 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "offsets", 1))
|
185214
|
311 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 1))
|
185215
|
311 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "matchinfo", 2))
|
185216
|
311 |
0 |
&& SQLITE_OK==(rc = sqlite3_overload_function(db, "optimize", 1))
|
185222
|
311 |
0 |
if( rc==SQLITE_OK ){
|
185228
|
311 |
0 |
if( rc==SQLITE_OK ){
|
185238
|
0 |
0 |
if( pHash ){
|
185267
|
106 |
0 |
if( pExpr && SQLITE_OK==*pRc ){
|
|
106 |
0 |
if( pExpr && SQLITE_OK==*pRc ){
|
185268
|
84 |
22 |
if( pExpr->eType==FTSQUERY_PHRASE ){
|
185272
|
113 |
84 |
for(i=0; i<nToken; i++){
|
185277
|
0 |
113 |
if( rc!=SQLITE_OK ){
|
185312
|
0 |
8 |
if( pList==0 ){
|
185318
|
8 |
0 |
else if( p->iDoclistToken<0 ){
|
185323
|
0 |
0 |
else if( p->doclist.aAll==0 ){
|
185334
|
0 |
0 |
if( p->iDoclistToken<iToken ){
|
185356
|
8 |
0 |
if( iToken>p->iDoclistToken ) p->iDoclistToken = iToken;
|
185374
|
16 |
0 |
for(iToken=0; rc==SQLITE_OK && iToken<p->nToken; iToken++){
|
|
8 |
8 |
for(iToken=0; rc==SQLITE_OK && iToken<p->nToken; iToken++){
|
185378
|
8 |
0 |
if( pToken->pSegcsr ){
|
185382
|
8 |
0 |
if( rc==SQLITE_OK ){
|
185408
|
0 |
0 |
char *aFree = (pPhrase->doclist.bFreeList ? pPhrase->doclist.pList : 0);
|
185410
|
0 |
0 |
for(iToken=0; iToken<pPhrase->nToken; iToken++){
|
185414
|
0 |
0 |
if( pDeferred ){
|
185418
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
185420
|
0 |
0 |
if( pList==0 ){
|
185427
|
0 |
0 |
}else if( aPoslist==0 ){
|
185441
|
0 |
0 |
if( nPoslist==0 ){
|
185453
|
0 |
0 |
if( iPrev>=0 ){
|
185455
|
0 |
0 |
if( nMaxUndeferred<0 ){
|
185466
|
0 |
0 |
if( nMaxUndeferred>iPrev ){
|
185477
|
0 |
0 |
if( !aOut ){
|
185484
|
0 |
0 |
if( fts3PoslistPhraseMerge(&aOut, nDistance, 0, 1, &p1, &p2) ){
|
185496
|
0 |
0 |
if( pPhrase->doclist.pList!=aFree ) sqlite3_free(aFree);
|
185531
|
84 |
0 |
&& pCsr->bDesc==pTab->bDescIdx
|
185532
|
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
|
185537
|
189 |
8 |
for(i=0; bIncrOk==1 && i<p->nToken; i++){
|
|
113 |
76 |
for(i=0; bIncrOk==1 && i<p->nToken; i++){
|
185539
|
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) ){
|
185542
|
113 |
0 |
if( pToken->pSegcsr ) bHaveIncr = 1;
|
185545
|
76 |
8 |
if( bIncrOk && bHaveIncr ){
|
|
76 |
0 |
if( bIncrOk && bHaveIncr ){
|
185547
|
58 |
18 |
int iCol = (p->iColumn >= pTab->nColumn ? -1 : p->iColumn);
|
185548
|
181 |
0 |
for(i=0; rc==SQLITE_OK && i<p->nToken; i++){
|
|
105 |
76 |
for(i=0; rc==SQLITE_OK && i<p->nToken; i++){
|
185551
|
105 |
0 |
if( pSegcsr ){
|
185592
|
0 |
0 |
if( p==0 ){
|
185599
|
0 |
0 |
while( pDocid<pEnd ){
|
185605
|
0 |
0 |
while( pDocid<pEnd && *pDocid==0 ) pDocid++;
|
|
0 |
0 |
while( pDocid<pEnd && *pDocid==0 ) pDocid++;
|
185606
|
0 |
0 |
iMul = (bDescIdx ? -1 : 1);
|
185613
|
0 |
0 |
int iMul = (bDescIdx ? -1 : 1);
|
185618
|
0 |
0 |
if( p==aDoclist ){
|
185647
|
0 |
0 |
if( p==0 ){
|
185652
|
0 |
0 |
while( p<&aDoclist[nDoclist] && *p==0 ) p++;
|
|
0 |
0 |
while( p<&aDoclist[nDoclist] && *p==0 ) p++;
|
185653
|
0 |
0 |
if( p>=&aDoclist[nDoclist] ){
|
185658
|
0 |
0 |
*piDocid += ((bDescIdx ? -1 : 1) * iVar);
|
185677
|
12 |
8 |
if( pDL->pNextDocid ){
|
185684
|
20 |
0 |
if( pIter==0 || pIter>=(pEnd = pDL->aAll + pDL->nAll) ){
|
|
8 |
12 |
if( pIter==0 || pIter>=(pEnd = pDL->aAll + pDL->nAll) ){
|
185690
|
0 |
12 |
if( pTab->bDescIdx==0 || pDL->pNextDocid==0 ){
|
|
0 |
0 |
if( pTab->bDescIdx==0 || pDL->pNextDocid==0 ){
|
185705
|
4 |
8 |
while( pIter<pEnd && *pIter==0 ) pIter++;
|
|
0 |
4 |
while( pIter<pEnd && *pIter==0 ) pIter++;
|
185742
|
0 |
212 |
if( pPhrase->iDoclistToken==iToken ){
|
185753
|
212 |
0 |
if( pToken->pSegcsr ){
|
185758
|
18 |
194 |
if( p->pList==0 ) *pbEof = 1;
|
185799
|
122 |
90 |
if( p->nToken==1 ){
|
185803
|
48 |
74 |
if( pDL->pList==0 ) bEof = 1;
|
185812
|
96 |
18 |
while( bEof==0 ){
|
185818
|
278 |
0 |
for(i=0; rc==SQLITE_OK && i<p->nToken && bEof==0; i++){
|
|
200 |
78 |
for(i=0; rc==SQLITE_OK && i<p->nToken && bEof==0; i++){
|
|
182 |
18 |
for(i=0; rc==SQLITE_OK && i<p->nToken && bEof==0; i++){
|
185820
|
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) ){
|
185829
|
208 |
96 |
for(i=0; i<p->nToken; i++){
|
185830
|
238 |
0 |
while( rc==SQLITE_OK && bEof==0
|
|
194 |
44 |
while( rc==SQLITE_OK && bEof==0
|
185831
|
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
|
185834
|
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 ){
|
185842
|
78 |
18 |
if( bEof==0 ){
|
185846
|
0 |
78 |
if( !aDoclist ) return SQLITE_NOMEM;
|
185850
|
86 |
72 |
for(i=0; i<(p->nToken-1); i++){
|
185851
|
86 |
0 |
if( a[i].bIgnore==0 ){
|
185857
|
6 |
80 |
if( res==0 ) break;
|
185861
|
72 |
6 |
if( i==(p->nToken-1) ){
|
185895
|
212 |
20 |
if( p->bIncr ){
|
185897
|
0 |
20 |
}else if( pCsr->bDesc!=pTab->bDescIdx && pDL->nAll ){
|
|
0 |
0 |
}else if( pCsr->bDesc!=pTab->bDescIdx && pDL->nAll ){
|
185930
|
106 |
0 |
if( pExpr && SQLITE_OK==*pRc ){
|
|
106 |
0 |
if( pExpr && SQLITE_OK==*pRc ){
|
185931
|
84 |
22 |
if( pExpr->eType==FTSQUERY_PHRASE ){
|
185933
|
84 |
0 |
if( nToken ){
|
185935
|
84 |
0 |
for(i=0; i<nToken; i++){
|
185936
|
84 |
0 |
if( pExpr->pPhrase->aToken[i].pDeferred==0 ) break;
|
185944
|
0 |
22 |
pExpr->bDeferred = (pExpr->pLeft->bDeferred && pExpr->pRight->bDeferred);
|
|
0 |
0 |
pExpr->bDeferred = (pExpr->pLeft->bDeferred && pExpr->pRight->bDeferred);
|
185986
|
45 |
0 |
if( *pRc==SQLITE_OK ){
|
185987
|
31 |
14 |
if( pExpr->eType==FTSQUERY_PHRASE ){
|
185990
|
81 |
0 |
for(i=0; *pRc==SQLITE_OK && i<pPhrase->nToken; i++){
|
|
50 |
31 |
for(i=0; *pRc==SQLITE_OK && i<pPhrase->nToken; i++){
|
185999
|
12 |
2 |
}else if( pExpr->eType!=FTSQUERY_NOT ){
|
186005
|
2 |
10 |
if( pExpr->eType==FTSQUERY_OR ){
|
186011
|
2 |
10 |
if( pExpr->eType==FTSQUERY_OR ){
|
186034
|
0 |
0 |
if( pCsr->nRowAvg==0 ){
|
186054
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
186057
|
0 |
0 |
if( a ){
|
186060
|
0 |
0 |
while( a<pEnd ){
|
186064
|
0 |
0 |
if( nDoc==0 || nByte==0 ){
|
|
0 |
0 |
if( nDoc==0 || nByte==0 ){
|
186114
|
9 |
16 |
if( pTab->zContentTbl ){
|
186121
|
38 |
16 |
for(ii=0; ii<nTC; ii++){
|
186122
|
26 |
12 |
if( aTC[ii].pRoot==pRoot ){
|
186127
|
0 |
16 |
if( nOvfl==0 || nToken<2 ) return SQLITE_OK;
|
|
0 |
0 |
if( nOvfl==0 || nToken<2 ) return SQLITE_OK;
|
186156
|
0 |
0 |
for(ii=0; ii<nToken && rc==SQLITE_OK; ii++){
|
|
0 |
0 |
for(ii=0; ii<nToken && rc==SQLITE_OK; ii++){
|
186161
|
0 |
0 |
for(iTC=0; iTC<nTC; iTC++){
|
186162
|
0 |
0 |
if( aTC[iTC].pToken && aTC[iTC].pRoot==pRoot
|
|
0 |
0 |
if( aTC[iTC].pToken && aTC[iTC].pRoot==pRoot
|
186163
|
0 |
0 |
&& (!pTC || aTC[iTC].nOvfl<pTC->nOvfl)
|
|
0 |
0 |
&& (!pTC || aTC[iTC].nOvfl<pTC->nOvfl)
|
186170
|
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 ){
|
186183
|
0 |
0 |
if( ii<12 ) nLoad4 = nLoad4*4;
|
186185
|
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) ){
|
186194
|
0 |
0 |
if( rc==SQLITE_OK ){
|
186199
|
0 |
0 |
if( rc==SQLITE_OK ){
|
186204
|
0 |
0 |
if( ii==0 || nCount<nMinEst ) nMinEst = nCount;
|
|
0 |
0 |
if( ii==0 || nCount<nMinEst ) nMinEst = nCount;
|
186237
|
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 ){
|
186244
|
0 |
21 |
if( !aTC ){
|
186256
|
21 |
0 |
if( rc==SQLITE_OK ){
|
186258
|
25 |
0 |
for(ii=0; rc==SQLITE_OK && ii<nOr; ii++){
|
|
4 |
21 |
for(ii=0; rc==SQLITE_OK && ii<nOr; ii++){
|
186276
|
72 |
244 |
if( pPhrase->doclist.bFreeList ){
|
186326
|
0 |
0 |
if( res ){
|
186329
|
0 |
0 |
if( nNew>=0 && nNew<=pPhrase->doclist.nList ){
|
|
0 |
0 |
if( nNew>=0 && nNew<=pPhrase->doclist.nList ){
|
186387
|
301 |
0 |
if( *pRc==SQLITE_OK && pExpr->bEof==0 ){
|
|
301 |
0 |
if( *pRc==SQLITE_OK && pExpr->bEof==0 ){
|
186398
|
0 |
45 |
if( pLeft->bDeferred ){
|
186404
|
0 |
45 |
}else if( pRight->bDeferred ){
|
186414
|
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 ){
|
186415
|
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);
|
186416
|
31 |
3 |
if( iDiff==0 ) break;
|
186417
|
3 |
0 |
if( iDiff<0 ){
|
186424
|
34 |
11 |
pExpr->bEof = (pLeft->bEof || pRight->bEof);
|
|
3 |
31 |
pExpr->bEof = (pLeft->bEof || pRight->bEof);
|
186425
|
0 |
45 |
if( pExpr->eType==FTSQUERY_NEAR && pExpr->bEof ){
|
|
0 |
0 |
if( pExpr->eType==FTSQUERY_NEAR && pExpr->bEof ){
|
186427
|
0 |
0 |
if( pRight->pPhrase->doclist.aAll ){
|
186429
|
0 |
0 |
while( *pRc==SQLITE_OK && pRight->bEof==0 ){
|
|
0 |
0 |
while( *pRc==SQLITE_OK && pRight->bEof==0 ){
|
186434
|
0 |
0 |
if( pLeft->pPhrase && pLeft->pPhrase->doclist.aAll ){
|
|
0 |
0 |
if( pLeft->pPhrase && pLeft->pPhrase->doclist.aAll ){
|
186436
|
0 |
0 |
while( *pRc==SQLITE_OK && pLeft->bEof==0 ){
|
|
0 |
0 |
while( *pRc==SQLITE_OK && pLeft->bEof==0 ){
|
186450
|
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);
|
186455
|
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) ){
|
186457
|
4 |
4 |
}else if( pLeft->bEof || iCmp>0 ){
|
|
0 |
4 |
}else if( pLeft->bEof || iCmp>0 ){
|
186464
|
8 |
4 |
pExpr->bEof = (pLeft->bEof && pRight->bEof);
|
|
4 |
4 |
pExpr->bEof = (pLeft->bEof && pRight->bEof);
|
186465
|
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);
|
186466
|
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) ){
|
186479
|
4 |
8 |
if( pRight->bStart==0 ){
|
186485
|
8 |
4 |
if( pLeft->bEof==0 ){
|
186486
|
8 |
0 |
while( !*pRc
|
186487
|
8 |
0 |
&& !pRight->bEof
|
186488
|
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
|
186547
|
31 |
0 |
if( *pRc==SQLITE_OK
|
186548
|
0 |
31 |
&& pExpr->eType==FTSQUERY_NEAR
|
186549
|
0 |
0 |
&& (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR)
|
|
0 |
0 |
&& (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR)
|
186556
|
0 |
0 |
for(p=pExpr; p->pLeft; p=p->pLeft){
|
186562
|
0 |
0 |
if( !aTmp ){
|
186569
|
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){
|
186577
|
0 |
0 |
for(p=pExpr->pLeft; p && res; p=p->pLeft){
|
|
0 |
0 |
for(p=pExpr->pLeft; p && res; p=p->pLeft){
|
186583
|
0 |
0 |
p->eType==FTSQUERY_NEAR ? p->pRight->pPhrase : p->pPhrase
|
186612
|
208 |
0 |
if( *pRc==SQLITE_OK ){
|
186618
|
31 |
0 |
&& fts3EvalTestExpr(pCsr, pExpr->pRight, pRc)
|
186619
|
31 |
0 |
&& fts3EvalNearTest(pExpr, pRc)
|
|
31 |
0 |
&& fts3EvalNearTest(pExpr, pRc)
|
186637
|
0 |
31 |
if( bHit==0
|
186638
|
0 |
0 |
&& pExpr->eType==FTSQUERY_NEAR
|
186639
|
0 |
0 |
&& (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR)
|
|
0 |
0 |
&& (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR)
|
186642
|
0 |
0 |
for(p=pExpr; p->pPhrase==0; p=p->pLeft){
|
186643
|
0 |
0 |
if( p->pRight->iDocid==pCsr->iPrevId ){
|
186647
|
0 |
0 |
if( p->iDocid==pCsr->iPrevId ){
|
186657
|
4 |
4 |
bHit = bHit1 || bHit2;
|
|
4 |
0 |
bHit = bHit1 || bHit2;
|
186664
|
8 |
0 |
&& !fts3EvalTestExpr(pCsr, pExpr->pRight, pRc)
|
|
4 |
4 |
&& !fts3EvalTestExpr(pCsr, pExpr->pRight, pRc)
|
186670
|
0 |
161 |
if( pCsr->pDeferred && (pExpr->bDeferred || (
|
|
0 |
0 |
if( pCsr->pDeferred && (pExpr->bDeferred || (
|
|
0 |
0 |
if( pCsr->pDeferred && (pExpr->bDeferred || (
|
186671
|
0 |
0 |
pExpr->iDocid==pCsr->iPrevId && pExpr->pPhrase->doclist.pList
|
186674
|
0 |
0 |
if( pExpr->bDeferred ){
|
186684
|
149 |
8 |
pExpr->bEof==0 && pExpr->iDocid==pCsr->iPrevId
|
186685
|
157 |
4 |
&& pExpr->pPhrase->doclist.nList>0
|
|
149 |
0 |
&& pExpr->pPhrase->doclist.nList>0
|
186722
|
114 |
0 |
if( rc==SQLITE_OK ){
|
186730
|
0 |
114 |
if( pCsr->pDeferred ){
|
186732
|
0 |
0 |
if( rc==SQLITE_OK ){
|
186742
|
114 |
0 |
return (rc==SQLITE_OK && bMiss);
|
|
4 |
110 |
return (rc==SQLITE_OK && bMiss);
|
186753
|
0 |
172 |
if( pExpr==0 ){
|
186757
|
136 |
40 |
if( pCsr->isRequireSeek==0 ){
|
186766
|
114 |
62 |
}while( pCsr->isEof==0 && sqlite3Fts3EvalTestDeferred(pCsr, &rc) );
|
|
4 |
110 |
}while( pCsr->isEof==0 && sqlite3Fts3EvalTestDeferred(pCsr, &rc) );
|
186771
|
172 |
0 |
if( rc==SQLITE_OK && (
|
|
172 |
0 |
if( rc==SQLITE_OK && (
|
186772
|
172 |
0 |
(pCsr->bDesc==0 && pCsr->iPrevId>pCsr->iMaxDocid)
|
186773
|
0 |
172 |
|| (pCsr->bDesc!=0 && pCsr->iPrevId<pCsr->iMinDocid)
|
|
0 |
0 |
|| (pCsr->bDesc!=0 && pCsr->iPrevId<pCsr->iMinDocid)
|
186795
|
0 |
0 |
if( pExpr && *pRc==SQLITE_OK ){
|
|
0 |
0 |
if( pExpr && *pRc==SQLITE_OK ){
|
186798
|
0 |
0 |
if( pPhrase ){
|
186800
|
0 |
0 |
if( pPhrase->bIncr ){
|
186802
|
0 |
0 |
for(i=0; i<pPhrase->nToken; i++){
|
186805
|
0 |
0 |
if( pToken->pSegcsr ){
|
186834
|
0 |
0 |
if( pExpr ){
|
186836
|
0 |
0 |
if( pPhrase && pPhrase->doclist.pList ){
|
|
0 |
0 |
if( pPhrase && pPhrase->doclist.pList ){
|
186843
|
0 |
0 |
while( 0xFE & (*p | c) ){
|
186844
|
0 |
0 |
if( (c&0x80)==0 ) iCnt++;
|
186853
|
0 |
0 |
if( *p==0x00 ) break;
|
186855
|
0 |
0 |
p += fts3GetVarint32(p, &iCol);
|
186856
|
0 |
0 |
}while( iCol<nCol );
|
186872
|
0 |
0 |
if( pExpr->aMI==0 ){
|
186874
|
0 |
0 |
if( pExpr->aMI==0 ) return SQLITE_NOMEM;
|
186898
|
0 |
0 |
if( pExpr->aMI==0 ){
|
186908
|
0 |
0 |
while( pRoot->pParent
|
186909
|
0 |
0 |
&& (pRoot->pParent->eType==FTSQUERY_NEAR || pRoot->bDeferred)
|
|
0 |
0 |
&& (pRoot->pParent->eType==FTSQUERY_NEAR || pRoot->bDeferred)
|
186919
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
186922
|
0 |
0 |
while( pCsr->isEof==0 && rc==SQLITE_OK ){
|
|
0 |
0 |
while( pCsr->isEof==0 && rc==SQLITE_OK ){
|
186926
|
0 |
0 |
if( pCsr->isRequireSeek==0 ) sqlite3_reset(pCsr->pStmt);
|
186936
|
0 |
0 |
&& pRoot->eType==FTSQUERY_NEAR
|
186937
|
0 |
0 |
&& sqlite3Fts3EvalTestDeferred(pCsr, &rc)
|
186938
|
0 |
0 |
);
|
186940
|
0 |
0 |
if( rc==SQLITE_OK && pCsr->isEof==0 ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pCsr->isEof==0 ){
|
186948
|
0 |
0 |
if( bEof ){
|
186961
|
0 |
0 |
if( pRoot->bEof ) rc = FTS_CORRUPT_VTAB;
|
186962
|
0 |
0 |
}while( pRoot->iDocid!=iDocid && rc==SQLITE_OK );
|
|
0 |
0 |
}while( pRoot->iDocid!=iDocid && rc==SQLITE_OK );
|
187007
|
0 |
0 |
if( pExpr->bDeferred && pExpr->pParent->eType!=FTSQUERY_NEAR ){
|
|
0 |
0 |
if( pExpr->bDeferred && pExpr->pParent->eType!=FTSQUERY_NEAR ){
|
187009
|
0 |
0 |
for(iCol=0; iCol<pTab->nColumn; iCol++){
|
187015
|
0 |
0 |
if( rc==SQLITE_OK ){
|
187017
|
0 |
0 |
for(iCol=0; iCol<pTab->nColumn; iCol++){
|
187062
|
16 |
0 |
if( (pPhrase->iColumn<pTab->nColumn && pPhrase->iColumn!=iCol) ){
|
|
0 |
16 |
if( (pPhrase->iColumn<pTab->nColumn && pPhrase->iColumn!=iCol) ){
|
187068
|
16 |
0 |
if( iDocid!=pCsr->iPrevId || pExpr->bEof ){
|
|
0 |
16 |
if( iDocid!=pCsr->iPrevId || pExpr->bEof ){
|
187084
|
0 |
0 |
for(p=pExpr->pParent; p; p=p->pParent){
|
187085
|
0 |
0 |
if( p->eType==FTSQUERY_OR ) bOr = 1;
|
187086
|
0 |
0 |
if( p->eType==FTSQUERY_NEAR ) pNear = p;
|
187087
|
0 |
0 |
if( p->bEof ) bTreeEof = 1;
|
187089
|
0 |
0 |
if( bOr==0 ) return SQLITE_OK;
|
187091
|
0 |
0 |
while( pRun->bDeferred ){
|
187099
|
0 |
0 |
if( pPhrase->bIncr ){
|
187102
|
0 |
0 |
while( rc==SQLITE_OK && !pRun->bEof ){
|
|
0 |
0 |
while( rc==SQLITE_OK && !pRun->bEof ){
|
187104
|
0 |
0 |
if( bEofSave==0 && pRun->iDocid==iDocid ) break;
|
|
0 |
0 |
if( bEofSave==0 && pRun->iDocid==iDocid ) break;
|
187107
|
0 |
0 |
if( rc==SQLITE_OK && pRun->bEof!=bEofSave ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pRun->bEof!=bEofSave ){
|
187111
|
0 |
0 |
if( bTreeEof ){
|
187112
|
0 |
0 |
while( rc==SQLITE_OK && !pRun->bEof ){
|
|
0 |
0 |
while( rc==SQLITE_OK && !pRun->bEof ){
|
187116
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
187119
|
0 |
0 |
for(p=pNear; p; p=p->pLeft){
|
187124
|
0 |
0 |
if( pTest->eType==FTSQUERY_NEAR ) pTest = pTest->pRight;
|
187130
|
0 |
0 |
if( pCsr->bDesc==bDescDoclist ){
|
187131
|
0 |
0 |
bEof = !pPh->doclist.nAll ||
|
|
0 |
0 |
bEof = !pPh->doclist.nAll ||
|
187133
|
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 ){
|
187140
|
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);
|
187141
|
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 ){
|
187151
|
0 |
0 |
if( bEof || iDocid!=pCsr->iPrevId ) bMatch = 0;
|
|
0 |
0 |
if( bEof || iDocid!=pCsr->iPrevId ) bMatch = 0;
|
187154
|
0 |
0 |
if( bMatch ){
|
187160
|
0 |
16 |
if( pIter==0 ) return SQLITE_OK;
|
187162
|
0 |
16 |
if( *pIter==0x01 ){
|
187164
|
0 |
0 |
pIter += fts3GetVarint32(pIter, &iThis);
|
187168
|
0 |
16 |
while( iThis<iCol ){
|
187170
|
0 |
0 |
if( *pIter==0x00 ) return SQLITE_OK;
|
187172
|
0 |
0 |
pIter += fts3GetVarint32(pIter, &iThis);
|
187174
|
0 |
16 |
if( *pIter==0x00 ){
|
187178
|
16 |
0 |
*ppOut = ((iCol==iThis)?pIter:0);
|
187190
|
84 |
22 |
if( pPhrase ){
|
187195
|
113 |
84 |
for(i=0; i<pPhrase->nToken; i++){
|
187312
|
0 |
1 |
if( argc!=4 && argc!=5 ) goto bad_args;
|
|
0 |
0 |
if( argc!=4 && argc!=5 ) goto bad_args;
|
187316
|
0 |
1 |
if( argc==5 ){
|
187317
|
0 |
0 |
if( nDb==4 && 0==sqlite3_strnicmp("temp", zDb, 4) ){
|
|
0 |
0 |
if( nDb==4 && 0==sqlite3_strnicmp("temp", zDb, 4) ){
|
187330
|
0 |
1 |
if( rc!=SQLITE_OK ) return rc;
|
187334
|
0 |
1 |
if( !p ) return SQLITE_NOMEM;
|
187366
|
40 |
1 |
for(i=0; i<SizeofArray(pFts3->aStmt); i++){
|
187395
|
0 |
1 |
if( pInfo->nOrderBy==1
|
187396
|
0 |
0 |
&& pInfo->aOrderBy[0].iColumn==0
|
187397
|
0 |
0 |
&& pInfo->aOrderBy[0].desc==0
|
187404
|
1 |
1 |
for(i=0; i<pInfo->nConstraint; i++){
|
187405
|
1 |
0 |
if( pInfo->aConstraint[i].usable ){
|
187409
|
0 |
1 |
if( iCol==0 ){
|
187410
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_EQ ) iEq = i;
|
187411
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_LT ) iLe = i;
|
187412
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_LE ) iLe = i;
|
187413
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_GT ) iGe = i;
|
187414
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_GE ) iGe = i;
|
187416
|
0 |
1 |
if( iCol==4 ){
|
187417
|
0 |
0 |
if( op==SQLITE_INDEX_CONSTRAINT_EQ ) iLangid = i;
|
187422
|
0 |
1 |
if( iEq>=0 ){
|
187429
|
0 |
1 |
if( iGe>=0 ){
|
187434
|
0 |
1 |
if( iLe>=0 ){
|
187440
|
0 |
1 |
if( iLangid>=0 ){
|
187457
|
0 |
1 |
if( !pCsr ) return SQLITE_NOMEM;
|
187481
|
2 |
7 |
if( nSize>pCsr->nStat ){
|
187486
|
0 |
2 |
if( aNew==0 ) return SQLITE_NOMEM;
|
187507
|
9 |
7 |
for(pCsr->iCol++; pCsr->iCol<pCsr->nStat; pCsr->iCol++){
|
187508
|
6 |
3 |
if( pCsr->aStat[pCsr->iCol].nDoc>0 ) return SQLITE_OK;
|
187512
|
6 |
1 |
if( rc==SQLITE_ROW ){
|
187520
|
0 |
6 |
if( pCsr->zStop ){
|
187523
|
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) ){
|
187529
|
0 |
6 |
if( fts3auxGrowStatArray(pCsr, 2) ) return SQLITE_NOMEM;
|
187534
|
24 |
6 |
while( i<nDoclist ){
|
187556
|
3 |
3 |
if( v>1 ){
|
187563
|
6 |
9 |
if( v==0 ){ /* 0x00. Next integer will be a docid. */
|
187565
|
3 |
6 |
}else if( v==1 ){ /* 0x01. Next integer will be a column number. */
|
187576
|
0 |
3 |
if( iCol<1 ){
|
187580
|
0 |
3 |
if( fts3auxGrowStatArray(pCsr, iCol+2) ) return SQLITE_NOMEM;
|
187625
|
0 |
1 |
if( idxNum==FTS4AUX_EQ_CONSTRAINT ){
|
187629
|
0 |
1 |
if( idxNum & FTS4AUX_GE_CONSTRAINT ){
|
187632
|
0 |
1 |
if( idxNum & FTS4AUX_LE_CONSTRAINT ){
|
187636
|
0 |
1 |
if( iNext<nVal ){
|
187649
|
1 |
0 |
if( isScan ) pCsr->filter.flags |= FTS3_SEGMENT_SCAN;
|
187651
|
1 |
0 |
if( iEq>=0 || iGe>=0 ){
|
|
0 |
1 |
if( iEq>=0 || iGe>=0 ){
|
187654
|
0 |
0 |
if( zStr ){
|
187656
|
0 |
0 |
if( pCsr->filter.zTerm==0 ) return SQLITE_NOMEM;
|
187661
|
0 |
1 |
if( iLe>=0 ){
|
187663
|
0 |
0 |
if( pCsr->zStop==0 ) return SQLITE_NOMEM;
|
187667
|
0 |
1 |
if( iLangid>=0 ){
|
187675
|
0 |
0 |
if( iLangVal<0 ) iLangVal = 0;
|
187682
|
1 |
0 |
if( rc==SQLITE_OK ){
|
187686
|
1 |
0 |
if( rc==SQLITE_OK ) rc = fts3auxNextMethod(pCursor);
|
187715
|
6 |
6 |
if( p->iCol ){
|
187908
|
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';
|
187918
|
101 |
0 |
if( pRet ) memset(pRet, 0, nByte);
|
187935
|
170 |
0 |
if( rc==SQLITE_OK ){
|
187937
|
0 |
170 |
if( pModule->iVersion>=1 ){
|
187939
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
187982
|
459 |
55 |
for(i=0; i<n; i++){
|
187983
|
459 |
0 |
if( sqlite3_fts3_enable_parentheses && (z[i]=='(' || z[i]==')') ) break;
|
|
451 |
8 |
if( sqlite3_fts3_enable_parentheses && (z[i]=='(' || z[i]==')') ) break;
|
187984
|
0 |
451 |
if( z[i]=='"' ) break;
|
187989
|
63 |
0 |
if( rc==SQLITE_OK ){
|
187995
|
63 |
0 |
if( rc==SQLITE_OK ){
|
187998
|
0 |
63 |
if( !pRet ){
|
188009
|
27 |
36 |
if( iEnd<n && z[iEnd]=='*' ){
|
|
8 |
19 |
if( iEnd<n && z[iEnd]=='*' ){
|
188020
|
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]=='^' ){
|
188030
|
0 |
0 |
}else if( i && rc==SQLITE_DONE ){
|
|
0 |
0 |
}else if( i && rc==SQLITE_DONE ){
|
188048
|
0 |
121 |
if( !pRet ){
|
188103
|
21 |
0 |
if( rc==SQLITE_OK ){
|
188105
|
71 |
21 |
for(ii=0; rc==SQLITE_OK; ii++){
|
188109
|
50 |
21 |
if( rc==SQLITE_OK ){
|
188113
|
0 |
50 |
if( !p ) goto no_mem;
|
188116
|
0 |
50 |
if( !zTemp ) goto no_mem;
|
188126
|
29 |
21 |
pToken->isPrefix = (iEnd<nInput && zInput[iEnd]=='*');
|
|
0 |
29 |
pToken->isPrefix = (iEnd<nInput && zInput[iEnd]=='*');
|
188127
|
29 |
21 |
pToken->bFirst = (iBegin>0 && zInput[iBegin-1]=='^');
|
|
0 |
29 |
pToken->bFirst = (iBegin>0 && zInput[iBegin-1]=='^');
|
188136
|
21 |
0 |
if( rc==SQLITE_DONE ){
|
188141
|
0 |
21 |
if( !p ) goto no_mem;
|
188149
|
21 |
0 |
if( zTemp ){
|
188156
|
50 |
21 |
for(jj=0; jj<p->pPhrase->nToken; jj++){
|
188167
|
0 |
0 |
if( pCursor ){
|
188215
|
141 |
62 |
while( nInput>0 && fts3isspace(*zInput) ){
|
|
34 |
107 |
while( nInput>0 && fts3isspace(*zInput) ){
|
188219
|
62 |
107 |
if( nInput==0 ){
|
188224
|
398 |
92 |
for(ii=0; ii<(int)(sizeof(aKeyword)/sizeof(struct Fts3Keyword)); ii++){
|
188227
|
0 |
398 |
if( (pKey->parenOnly & ~sqlite3_fts3_enable_parentheses)!=0 ){
|
188231
|
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) ){
|
188237
|
0 |
15 |
if( pKey->eType==FTSQUERY_NEAR ){
|
188239
|
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' ){
|
188249
|
0 |
15 |
if( fts3isspace(cNext)
|
188250
|
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
|
188253
|
0 |
15 |
if( !pRet ){
|
188274
|
21 |
71 |
if( *zInput=='"' ){
|
188275
|
315 |
0 |
for(ii=1; ii<nInput && zInput[ii]!='"'; ii++);
|
|
294 |
21 |
for(ii=1; ii<nInput && zInput[ii]!='"'; ii++);
|
188277
|
0 |
21 |
if( ii==nInput ){
|
188284
|
4 |
67 |
if( *zInput=='(' ){
|
188290
|
0 |
4 |
if( pParse->nNest>SQLITE_MAX_EXPR_DEPTH ) return SQLITE_ERROR;
|
188295
|
4 |
63 |
}else if( *zInput==')' ){
|
188316
|
74 |
63 |
for(ii=0; ii<pParse->nCol; ii++){
|
188319
|
33 |
41 |
if( nInput>nStr && zInput[nStr]==':'
|
|
0 |
33 |
if( nInput>nStr && zInput[nStr]==':'
|
188320
|
0 |
0 |
&& sqlite3_strnicmp(zStr, zInput, nStr)==0
|
188378
|
0 |
22 |
while( pSplit->pParent && opPrecedence(pSplit->pParent)<=opPrecedence(pNew) ){
|
|
0 |
0 |
while( pSplit->pParent && opPrecedence(pSplit->pParent)<=opPrecedence(pNew) ){
|
188382
|
0 |
22 |
if( pSplit->pParent ){
|
188417
|
169 |
66 |
while( rc==SQLITE_OK ){
|
188423
|
103 |
66 |
if( rc==SQLITE_OK ){
|
188424
|
103 |
0 |
if( p ){
|
188448
|
19 |
84 |
isPhrase = (eType==FTSQUERY_PHRASE || p->pLeft);
|
|
4 |
15 |
isPhrase = (eType==FTSQUERY_PHRASE || p->pLeft);
|
188455
|
15 |
88 |
if( !isPhrase && isRequirePhrase ){
|
|
0 |
15 |
if( !isPhrase && isRequirePhrase ){
|
188461
|
88 |
15 |
if( isPhrase && !isRequirePhrase ){
|
|
7 |
81 |
if( isPhrase && !isRequirePhrase ){
|
188466
|
0 |
7 |
if( !pAnd ){
|
188485
|
37 |
66 |
if( pPrev && (
|
|
0 |
37 |
if( pPrev && (
|
188486
|
0 |
0 |
(eType==FTSQUERY_NEAR && !isPhrase && pPrev->eType!=FTSQUERY_PHRASE)
|
|
0 |
0 |
(eType==FTSQUERY_NEAR && !isPhrase && pPrev->eType!=FTSQUERY_PHRASE)
|
188487
|
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)
|
188494
|
88 |
15 |
if( isPhrase ){
|
188495
|
22 |
66 |
if( pRet ){
|
188516
|
66 |
0 |
if( rc==SQLITE_DONE && pRet && isRequirePhrase ){
|
|
66 |
0 |
if( rc==SQLITE_DONE && pRet && isRequirePhrase ){
|
|
0 |
66 |
if( rc==SQLITE_DONE && pRet && isRequirePhrase ){
|
188520
|
66 |
0 |
if( rc==SQLITE_DONE ){
|
188539
|
0 |
66 |
if( rc!=SQLITE_OK ){
|
188554
|
106 |
168 |
if( p ){
|
188555
|
0 |
106 |
if( nMaxDepth<0 ){
|
188559
|
106 |
0 |
if( rc==SQLITE_OK ){
|
188584
|
0 |
106 |
if( nMaxDepth==0 ){
|
188588
|
106 |
0 |
if( rc==SQLITE_OK ){
|
188589
|
92 |
14 |
if( (eType==FTSQUERY_AND || eType==FTSQUERY_OR) ){
|
|
4 |
88 |
if( (eType==FTSQUERY_AND || eType==FTSQUERY_OR) ){
|
188592
|
0 |
18 |
if( 0==apLeaf ){
|
188598
|
18 |
0 |
if( rc==SQLITE_OK ){
|
188603
|
18 |
18 |
for(p=pRoot; p->eType==eType; p=p->pLeft){
|
188615
|
18 |
18 |
if( pParent ){
|
188621
|
0 |
36 |
if( rc!=SQLITE_OK ) break;
|
188623
|
54 |
36 |
for(iLvl=0; p && iLvl<nMaxDepth; iLvl++){
|
|
54 |
0 |
for(iLvl=0; p && iLvl<nMaxDepth; iLvl++){
|
188624
|
36 |
18 |
if( apLeaf[iLvl]==0 ){
|
188640
|
0 |
36 |
if( p ){
|
188647
|
18 |
18 |
if( pParent==0 ) break;
|
188650
|
0 |
18 |
for(p=pParent->pRight; p->eType==eType; p=p->pLeft);
|
188655
|
0 |
18 |
if( pParent->pParent ){
|
188668
|
18 |
0 |
if( rc==SQLITE_OK ){
|
188670
|
212 |
18 |
for(i=0; i<nMaxDepth; i++){
|
188671
|
18 |
194 |
if( apLeaf[i] ){
|
188672
|
18 |
0 |
if( p==0 ){
|
188694
|
0 |
0 |
for(i=0; i<nMaxDepth; i++){
|
188697
|
0 |
0 |
while( (pDel=pFree)!=0 ){
|
188706
|
4 |
84 |
}else if( eType==FTSQUERY_NOT ){
|
188716
|
4 |
0 |
if( rc==SQLITE_OK ){
|
188720
|
0 |
4 |
if( rc!=SQLITE_OK ){
|
188733
|
0 |
106 |
if( rc!=SQLITE_OK ){
|
188773
|
0 |
62 |
if( z==0 ){
|
188777
|
62 |
0 |
if( n<0 ){
|
188784
|
62 |
0 |
if( rc==SQLITE_OK && sParse.nNest ){
|
|
0 |
62 |
if( rc==SQLITE_OK && sParse.nNest ){
|
188832
|
62 |
0 |
if( rc==SQLITE_OK && *ppExpr ){
|
|
62 |
0 |
if( rc==SQLITE_OK && *ppExpr ){
|
188834
|
62 |
0 |
if( rc==SQLITE_OK ){
|
188839
|
0 |
62 |
if( rc!=SQLITE_OK ){
|
188842
|
0 |
0 |
if( rc==SQLITE_TOOBIG ){
|
188848
|
0 |
0 |
}else if( rc==SQLITE_ERROR ){
|
188876
|
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)){
|
188879
|
106 |
189 |
while( p ){
|
188882
|
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 ){
|
188884
|
22 |
0 |
while( p && (p->pLeft || p->pRight) ){
|
|
0 |
22 |
while( p && (p->pLeft || p->pRight) ){
|
|
0 |
22 |
while( p && (p->pLeft || p->pRight) ){
|
188886
|
0 |
0 |
p = (p->pLeft ? p->pLeft : p->pRight);
|
189127
|
27967 |
0 |
if( p ){
|
189170
|
13775 |
352 |
while( elem ){
|
189172
|
13775 |
0 |
if( pH->copyKey && elem->pKey ){
|
|
13775 |
0 |
if( pH->copyKey && elem->pKey ){
|
189187
|
0 |
326562 |
if( nKey<=0 ) nKey = (int) strlen(z);
|
189188
|
1706129 |
326562 |
while( nKey > 0 ){
|
189195
|
88735 |
292749 |
if( n1!=n2 ) return 1;
|
189205
|
0 |
0 |
while( nKey-- > 0 ){
|
189211
|
0 |
0 |
if( n1!=n2 ) return 1;
|
189228
|
305475 |
0 |
if( keyClass==FTS3_HASH_STRING ){
|
189243
|
304729 |
0 |
if( keyClass==FTS3_HASH_STRING ){
|
189260
|
11496 |
23775 |
if( pHead ){
|
189263
|
6986 |
4510 |
if( pHead->prev ){ pHead->prev->next = pNew; }
|
189268
|
23374 |
401 |
if( pH->first ){ pH->first->prev = pNew; }
|
189290
|
0 |
401 |
if( new_ht==0 ) return 1;
|
189295
|
21488 |
401 |
for(elem=pH->first, pH->first=0; elem; elem = next_elem){
|
189317
|
304729 |
345 |
if( pH->ht ){
|
189322
|
381484 |
25947 |
while( count-- && elem ){
|
|
381484 |
0 |
while( count-- && elem ){
|
189323
|
278782 |
102702 |
if( (*xCompare)(elem->pKey,elem->nKey,pKey,nKey)==0 ){
|
189341
|
0 |
0 |
if( elem->prev ){
|
189346
|
0 |
0 |
if( elem->next ){
|
189350
|
0 |
0 |
if( pEntry->chain==elem ){
|
189354
|
0 |
0 |
if( pEntry->count<=0 ){
|
189357
|
0 |
0 |
if( pH->copyKey && elem->pKey ){
|
|
0 |
0 |
if( pH->copyKey && elem->pKey ){
|
189362
|
0 |
0 |
if( pH->count<=0 ){
|
189377
|
290022 |
0 |
if( pH==0 || pH->ht==0 ) return 0;
|
|
138 |
289884 |
if( pH==0 || pH->ht==0 ) return 0;
|
189394
|
277374 |
12543 |
return pElem ? pElem->data : 0;
|
189431
|
1407 |
13783 |
if( elem ){
|
189433
|
0 |
1407 |
if( data==0 ){
|
189440
|
0 |
13783 |
if( data==0 ) return 0;
|
189441
|
345 |
13438 |
if( (pH->htsize==0 && fts3Rehash(pH,8))
|
|
345 |
0 |
if( (pH->htsize==0 && fts3Rehash(pH,8))
|
189442
|
56 |
13727 |
|| (pH->count>=pH->htsize && fts3Rehash(pH, pH->htsize*2))
|
|
0 |
56 |
|| (pH->count>=pH->htsize && fts3Rehash(pH, pH->htsize*2))
|
189449
|
0 |
13783 |
if( new_elem==0 ) return data;
|
189450
|
13783 |
0 |
if( pH->copyKey && pKey!=0 ){
|
|
13783 |
0 |
if( pH->copyKey && pKey!=0 ){
|
189452
|
0 |
13783 |
if( new_elem->pKey==0 ){
|
189542
|
0 |
0 |
if( t==NULL ) return SQLITE_NOMEM;
|
189572
|
0 |
0 |
if( c==NULL ) return SQLITE_NOMEM;
|
189575
|
0 |
0 |
if( zInput==0 ){
|
189577
|
0 |
0 |
}else if( nInput<0 ){
|
189626
|
0 |
0 |
if( x==0 ) return 0;
|
189629
|
0 |
0 |
if( j<2 ) return j;
|
189630
|
0 |
0 |
return z[1]==0 || isVowel(z + 1);
|
|
0 |
0 |
return z[1]==0 || isVowel(z + 1);
|
189635
|
0 |
0 |
if( x==0 ) return 0;
|
189638
|
0 |
0 |
if( j<2 ) return 1-j;
|
189662
|
0 |
0 |
while( isVowel(z) ){ z++; }
|
189663
|
0 |
0 |
if( *z==0 ) return 0;
|
189664
|
0 |
0 |
while( isConsonant(z) ){ z++; }
|
189672
|
0 |
0 |
while( isVowel(z) ){ z++; }
|
189673
|
0 |
0 |
if( *z==0 ) return 0;
|
189674
|
0 |
0 |
while( isConsonant(z) ){ z++; }
|
189675
|
0 |
0 |
if( *z==0 ) return 0;
|
189676
|
0 |
0 |
while( isVowel(z) ){ z++; }
|
189677
|
0 |
0 |
if( *z==0 ) return 1;
|
189678
|
0 |
0 |
while( isConsonant(z) ){ z++; }
|
189686
|
0 |
0 |
while( isVowel(z) ){ z++; }
|
189687
|
0 |
0 |
if( *z==0 ) return 0;
|
189688
|
0 |
0 |
while( isConsonant(z) ){ z++; }
|
189689
|
0 |
0 |
if( *z==0 ) return 0;
|
189690
|
0 |
0 |
while( isVowel(z) ){ z++; }
|
189691
|
0 |
0 |
if( *z==0 ) return 0;
|
189692
|
0 |
0 |
while( isConsonant(z) ){ z++; }
|
189700
|
0 |
0 |
while( isConsonant(z) ){ z++; }
|
189711
|
0 |
0 |
return isConsonant(z) && z[0]==z[1];
|
|
0 |
0 |
return isConsonant(z) && z[0]==z[1];
|
189724
|
0 |
0 |
isConsonant(z) &&
|
189725
|
0 |
0 |
z[0]!='w' && z[0]!='x' && z[0]!='y' &&
|
189726
|
0 |
0 |
isVowel(z+1) &&
|
|
0 |
0 |
isVowel(z+1) &&
|
189749
|
0 |
0 |
while( *zFrom && *zFrom==*z ){ z++; zFrom++; }
|
|
0 |
0 |
while( *zFrom && *zFrom==*z ){ z++; zFrom++; }
|
189750
|
0 |
0 |
if( *zFrom!=0 ) return 0;
|
189751
|
0 |
0 |
if( xCond && !xCond(z) ) return 1;
|
|
0 |
0 |
if( xCond && !xCond(z) ) return 1;
|
189752
|
0 |
0 |
while( *zTo ){
|
189770
|
0 |
0 |
for(i=0; i<nIn; i++){
|
189772
|
0 |
0 |
if( c>='A' && c<='Z' ){
|
|
0 |
0 |
if( c>='A' && c<='Z' ){
|
189775
|
0 |
0 |
if( c>='0' && c<='9' ) hasDigit = 1;
|
|
0 |
0 |
if( c>='0' && c<='9' ) hasDigit = 1;
|
189779
|
0 |
0 |
mx = hasDigit ? 3 : 10;
|
189780
|
0 |
0 |
if( nIn>mx*2 ){
|
189781
|
0 |
0 |
for(j=mx, i=nIn-mx; i<nIn; i++, j++){
|
189818
|
0 |
0 |
if( nIn<3 || nIn>=(int)sizeof(zReverse)-7 ){
|
|
0 |
0 |
if( nIn<3 || nIn>=(int)sizeof(zReverse)-7 ){
|
189824
|
0 |
0 |
for(i=0, j=sizeof(zReverse)-6; i<nIn; i++, j--){
|
189826
|
0 |
0 |
if( c>='A' && c<='Z' ){
|
|
0 |
0 |
if( c>='A' && c<='Z' ){
|
189828
|
0 |
0 |
}else if( c>='a' && c<='z' ){
|
|
0 |
0 |
}else if( c>='a' && c<='z' ){
|
189842
|
0 |
0 |
if( z[0]=='s' ){
|
189843
|
0 |
0 |
if(
|
189844
|
0 |
0 |
!stem(&z, "sess", "ss", 0) &&
|
189845
|
0 |
0 |
!stem(&z, "sei", "i", 0) &&
|
189854
|
0 |
0 |
if( stem(&z, "dee", "ee", m_gt_0) ){
|
189856
|
0 |
0 |
}else if(
|
189857
|
0 |
0 |
(stem(&z, "gni", "", hasVowel) || stem(&z, "de", "", hasVowel))
|
189858
|
0 |
0 |
&& z!=z2
|
189861
|
0 |
0 |
stem(&z, "lb", "ble", 0) ||
|
189864
|
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') ){
|
189866
|
0 |
0 |
}else if( m_eq_1(z) && star_oh(z) ){
|
|
0 |
0 |
}else if( m_eq_1(z) && star_oh(z) ){
|
189872
|
0 |
0 |
if( z[0]=='y' && hasVowel(z+1) ){
|
|
0 |
0 |
if( z[0]=='y' && hasVowel(z+1) ){
|
189879
|
0 |
0 |
if( !stem(&z, "lanoita", "ate", m_gt_0) ){
|
189884
|
0 |
0 |
if( !stem(&z, "icne", "ence", m_gt_0) ){
|
189895
|
0 |
0 |
if( !stem(&z, "ilb", "ble", m_gt_0)
|
189896
|
0 |
0 |
&& !stem(&z, "illa", "al", m_gt_0)
|
189897
|
0 |
0 |
&& !stem(&z, "iltne", "ent", m_gt_0)
|
189898
|
0 |
0 |
&& !stem(&z, "ile", "e", m_gt_0)
|
189904
|
0 |
0 |
if( !stem(&z, "noitazi", "ize", m_gt_0)
|
189905
|
0 |
0 |
&& !stem(&z, "noita", "ate", m_gt_0)
|
189911
|
0 |
0 |
if( !stem(&z, "msila", "al", m_gt_0)
|
189912
|
0 |
0 |
&& !stem(&z, "ssenevi", "ive", m_gt_0)
|
189913
|
0 |
0 |
&& !stem(&z, "ssenluf", "ful", m_gt_0)
|
189919
|
0 |
0 |
if( !stem(&z, "itila", "al", m_gt_0)
|
189920
|
0 |
0 |
&& !stem(&z, "itivi", "ive", m_gt_0)
|
189930
|
0 |
0 |
if( !stem(&z, "etaci", "ic", m_gt_0)
|
189931
|
0 |
0 |
&& !stem(&z, "evita", "", m_gt_0)
|
189940
|
0 |
0 |
if( !stem(&z, "laci", "ic", m_gt_0) ){
|
189952
|
0 |
0 |
if( z[0]=='l' && m_gt_1(z+2) ){
|
|
0 |
0 |
if( z[0]=='l' && m_gt_1(z+2) ){
|
189957
|
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) ){
|
189962
|
0 |
0 |
if( z[0]=='r' && m_gt_1(z+2) ){
|
|
0 |
0 |
if( z[0]=='r' && m_gt_1(z+2) ){
|
189967
|
0 |
0 |
if( z[0]=='c' && m_gt_1(z+2) ){
|
|
0 |
0 |
if( z[0]=='c' && m_gt_1(z+2) ){
|
189972
|
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) ){
|
189977
|
0 |
0 |
if( z[0]=='t' ){
|
189978
|
0 |
0 |
if( z[2]=='a' ){
|
189979
|
0 |
0 |
if( m_gt_1(z+3) ){
|
189982
|
0 |
0 |
}else if( z[2]=='e' ){
|
189983
|
0 |
0 |
if( !stem(&z, "tneme", "", m_gt_1)
|
189984
|
0 |
0 |
&& !stem(&z, "tnem", "", m_gt_1)
|
189992
|
0 |
0 |
if( z[0]=='u' ){
|
189993
|
0 |
0 |
if( m_gt_1(z+2) ){
|
189996
|
0 |
0 |
}else if( z[3]=='s' || z[3]=='t' ){
|
|
0 |
0 |
}else if( z[3]=='s' || z[3]=='t' ){
|
190001
|
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) ){
|
190006
|
0 |
0 |
if( !stem(&z, "eta", "", m_gt_1) ){
|
190011
|
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) ){
|
190017
|
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) ){
|
190024
|
0 |
0 |
if( z[0]=='e' ){
|
190025
|
0 |
0 |
if( m_gt_1(z+1) ){
|
190027
|
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) ){
|
190033
|
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' ){
|
190042
|
0 |
0 |
while( *z ){
|
190078
|
0 |
0 |
while( c->iOffset<c->nInput ){
|
190082
|
0 |
0 |
while( c->iOffset<c->nInput && isDelim(z[c->iOffset]) ){
|
|
0 |
0 |
while( c->iOffset<c->nInput && isDelim(z[c->iOffset]) ){
|
|
0 |
0 |
while( c->iOffset<c->nInput && isDelim(z[c->iOffset]) ){
|
|
0 |
0 |
while( c->iOffset<c->nInput && isDelim(z[c->iOffset]) ){
|
190088
|
0 |
0 |
while( c->iOffset<c->nInput && !isDelim(z[c->iOffset]) ){
|
|
0 |
0 |
while( c->iOffset<c->nInput && !isDelim(z[c->iOffset]) ){
|
|
0 |
0 |
while( c->iOffset<c->nInput && !isDelim(z[c->iOffset]) ){
|
|
0 |
0 |
while( c->iOffset<c->nInput && !isDelim(z[c->iOffset]) ){
|
190092
|
0 |
0 |
if( c->iOffset>iStartOffset ){
|
190094
|
0 |
0 |
if( n>c->nAllocated ){
|
190098
|
0 |
0 |
if( !pNew ) return SQLITE_NOMEM;
|
190219
|
307 |
0 |
if( argc==2 ){
|
190220
|
0 |
307 |
if( fts3TokenizerEnabled(context) || sqlite3_value_frombind(argv[1]) ){
|
|
0 |
0 |
if( fts3TokenizerEnabled(context) || sqlite3_value_frombind(argv[1]) ){
|
190223
|
307 |
0 |
if( zName==0 || n!=sizeof(pPtr) ){
|
|
0 |
307 |
if( zName==0 || n!=sizeof(pPtr) ){
|
190229
|
0 |
307 |
if( pOld==pPtr ){
|
190237
|
0 |
0 |
if( zName ){
|
190240
|
0 |
0 |
if( !pPtr ){
|
190247
|
0 |
307 |
if( fts3TokenizerEnabled(context) || sqlite3_value_frombind(argv[0]) ){
|
|
0 |
0 |
if( fts3TokenizerEnabled(context) || sqlite3_value_frombind(argv[0]) ){
|
190263
|
159 |
0 |
return (c&0x80 || isFtsIdChar[(int)(c)]);
|
|
129 |
30 |
return (c&0x80 || isFtsIdChar[(int)(c)]);
|
190272
|
28 |
28 |
while( z2==0 ){
|
190280
|
116 |
0 |
while( *++z2 && (*z2!=c || *++z2==c) );
|
|
112 |
4 |
while( *++z2 && (*z2!=c || *++z2==c) );
|
|
0 |
4 |
while( *++z2 && (*z2!=c || *++z2==c) );
|
190285
|
0 |
0 |
while( *z2 && z2[0]!=']' ) z2++;
|
|
0 |
0 |
while( *z2 && z2[0]!=']' ) z2++;
|
190286
|
0 |
0 |
if( *z2 ) z2++;
|
190290
|
24 |
0 |
if( sqlite3Fts3IsIdChar(*z1) ){
|
190292
|
105 |
24 |
while( sqlite3Fts3IsIdChar(*z2) ) z2++;
|
190317
|
0 |
10 |
if( !zCopy ) return SQLITE_NOMEM;
|
190321
|
0 |
10 |
if( z==0 ){
|
190329
|
0 |
10 |
if( !m ){
|
190336
|
4 |
10 |
while( z<zEnd && (NULL!=(z = (char *)sqlite3Fts3NextToken(z, &n))) ){
|
|
4 |
0 |
while( z<zEnd && (NULL!=(z = (char *)sqlite3Fts3NextToken(z, &n))) ){
|
190339
|
0 |
4 |
if( !aNew ){
|
190352
|
1 |
9 |
if( rc!=SQLITE_OK ){
|
190635
|
311 |
0 |
if( SQLITE_OK==rc ){
|
190638
|
311 |
0 |
if( SQLITE_OK==rc ){
|
190713
|
316304 |
59 |
return c<0x80 && t->delim[c];
|
|
121279 |
195025 |
return c<0x80 && t->delim[c];
|
190716
|
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');
|
190729
|
0 |
5 |
if( t==NULL ) return SQLITE_NOMEM;
|
190737
|
0 |
5 |
if( argc>1 ){
|
190739
|
0 |
0 |
for(i=0; i<n; i++){
|
190742
|
0 |
0 |
if( ch>=0x80 ){
|
190751
|
635 |
5 |
for(i=1; i<0x80; i++){
|
190752
|
325 |
310 |
t->delim[i] = !fts3_isalnum(i) ? -1 : 0;
|
190784
|
0 |
66 |
if( c==NULL ) return SQLITE_NOMEM;
|
190787
|
0 |
66 |
if( pInput==0 ){
|
190789
|
46 |
20 |
}else if( nBytes<0 ){
|
190830
|
34331 |
55 |
while( c->iOffset<c->nBytes ){
|
190834
|
121331 |
11 |
while( c->iOffset<c->nBytes && simpleDelim(t, p[c->iOffset]) ){
|
|
87011 |
34320 |
while( c->iOffset<c->nBytes && simpleDelim(t, p[c->iOffset]) ){
|
190840
|
195032 |
63 |
while( c->iOffset<c->nBytes && !simpleDelim(t, p[c->iOffset]) ){
|
|
160764 |
34268 |
while( c->iOffset<c->nBytes && !simpleDelim(t, p[c->iOffset]) ){
|
190844
|
34320 |
11 |
if( c->iOffset>iStartOffset ){
|
190846
|
67 |
34253 |
if( n>c->nTokenAllocated ){
|
190850
|
0 |
67 |
if( !pNew ) return SQLITE_NOMEM;
|
190853
|
160764 |
34320 |
for(i=0; i<n; i++){
|
190858
|
158139 |
2625 |
c->pToken[i] = (char)((ch>='A' && ch<='Z') ? ch-'A'+'a' : ch);
|
|
37310 |
120829 |
c->pToken[i] = (char)((ch>='A' && ch<='Z') ? ch-'A'+'a' : ch);
|
190985
|
0 |
0 |
if( !p ){
|
191012
|
0 |
0 |
if( argc==0 ){
|
191019
|
0 |
0 |
for(i=0; i<argc; i++){
|
191024
|
0 |
0 |
if( azDequote==0 ){
|
191028
|
0 |
0 |
for(i=0; i<argc; i++){
|
191072
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
191077
|
0 |
0 |
if( rc==SQLITE_OK ){
|
191079
|
0 |
0 |
if( nDequote<1 ){
|
191088
|
0 |
0 |
if( rc==SQLITE_OK ){
|
191090
|
0 |
0 |
if( nDequote>1 ) azArg = (const char * const *)&azDequote[1];
|
191091
|
0 |
0 |
rc = pMod->xCreate((nDequote>1 ? nDequote-1 : 0), azArg, &pTok);
|
191094
|
0 |
0 |
if( rc==SQLITE_OK ){
|
191096
|
0 |
0 |
if( pTab==0 ){
|
191101
|
0 |
0 |
if( rc==SQLITE_OK ){
|
191107
|
0 |
0 |
if( pTok ){
|
191139
|
0 |
0 |
for(i=0; i<pInfo->nConstraint; i++){
|
191140
|
0 |
0 |
if( pInfo->aConstraint[i].usable
|
191141
|
0 |
0 |
&& pInfo->aConstraint[i].iColumn==0
|
191142
|
0 |
0 |
&& pInfo->aConstraint[i].op==SQLITE_INDEX_CONSTRAINT_EQ
|
191166
|
0 |
0 |
if( pCsr==0 ){
|
191180
|
0 |
0 |
if( pCsr->pCsr ){
|
191220
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
191222
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK;
|
191245
|
0 |
0 |
if( idxNum==1 ){
|
191249
|
0 |
0 |
if( pCsr->zInput==0 ){
|
191252
|
0 |
0 |
if( nByte>0 ) memcpy(pCsr->zInput, zByte, nByte);
|
191255
|
0 |
0 |
if( rc==SQLITE_OK ){
|
191261
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
191759
|
81 |
460 |
if( !pStmt ){
|
191762
|
6 |
75 |
if( eStmt==SQL_CONTENT_INSERT ){
|
191764
|
1 |
74 |
}else if( eStmt==SQL_SELECT_CONTENT_BY_ROWID ){
|
191770
|
0 |
81 |
if( !zSql ){
|
191779
|
35 |
506 |
if( apVal ){
|
191782
|
112 |
0 |
for(i=0; rc==SQLITE_OK && i<nParam; i++){
|
|
77 |
35 |
for(i=0; rc==SQLITE_OK && i<nParam; i++){
|
191800
|
0 |
0 |
if( rc==SQLITE_OK ){
|
191803
|
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 ){
|
191805
|
0 |
0 |
if( rc==SQLITE_OK ) rc = FTS_CORRUPT_VTAB;
|
191823
|
0 |
0 |
if( rc==SQLITE_OK ){
|
191825
|
0 |
0 |
if( sqlite3_step(pStmt)!=SQLITE_ROW
|
191826
|
0 |
0 |
|| sqlite3_column_type(pStmt, 0)!=SQLITE_BLOB
|
191829
|
0 |
0 |
if( rc==SQLITE_OK ) rc = FTS_CORRUPT_VTAB;
|
191861
|
0 |
5 |
if( *pRC ) return;
|
191863
|
5 |
0 |
if( rc==SQLITE_OK ){
|
191888
|
33 |
4 |
if( p->nPendingData==0 ){
|
191891
|
33 |
0 |
if( rc==SQLITE_OK ){
|
191970
|
114 |
0 |
if( iLevel<0 ){
|
191973
|
114 |
0 |
if( rc==SQLITE_OK ){
|
191982
|
0 |
0 |
if( rc==SQLITE_OK ){
|
192010
|
12543 |
289612 |
if( !p ){
|
192012
|
0 |
12543 |
if( !p ){
|
192019
|
1433 |
288179 |
else if( p->nData+FTS3_VARINT_MAX+1>p->nSpace ){
|
192022
|
0 |
1433 |
if( !p ){
|
192059
|
277364 |
12543 |
if( !p || p->iLastDocid!=iDocid ){
|
|
2841 |
274523 |
if( !p || p->iLastDocid!=iDocid ){
|
192060
|
2841 |
12543 |
u64 iDelta = (u64)iDocid - (u64)(p ? p->iLastDocid : 0);
|
192061
|
2841 |
12543 |
if( p ){
|
192066
|
0 |
15384 |
if( SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, iDelta)) ){
|
192073
|
78 |
289829 |
if( iCol>0 && p->iLastCol!=iCol ){
|
|
78 |
0 |
if( iCol>0 && p->iLastCol!=iCol ){
|
192074
|
78 |
0 |
if( SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, 1))
|
192075
|
78 |
0 |
|| SQLITE_OK!=(rc = fts3PendingListAppendVarint(&p, iCol))
|
192082
|
286615 |
3292 |
if( iCol>=0 ){
|
192085
|
286615 |
0 |
if( rc==SQLITE_OK ){
|
192092
|
13950 |
275957 |
if( p!=*pp ){
|
192121
|
277364 |
12543 |
if( pList ){
|
192124
|
13950 |
275957 |
if( fts3PendingListAppend(&pList, p->iPrevDocid, iCol, iPos, &rc) ){
|
192125
|
0 |
13950 |
if( pList==fts3HashInsert(pHash, zToken, nToken, pList) ){
|
192134
|
289907 |
0 |
if( rc==SQLITE_OK ){
|
192174
|
0 |
70 |
if( zText==0 ){
|
192180
|
0 |
70 |
if( rc!=SQLITE_OK ){
|
192185
|
289977 |
0 |
while( SQLITE_OK==rc
|
192186
|
289907 |
70 |
&& SQLITE_OK==(rc = xNext(pCsr, &zToken, &nToken, &iStart, &iEnd, &iPos))
|
192189
|
289907 |
0 |
if( iPos>=nWord ) nWord = iPos+1;
|
192194
|
289907 |
0 |
if( iPos<0 || !zToken || nToken<=0 ){
|
|
289907 |
0 |
if( iPos<0 || !zToken || nToken<=0 ){
|
|
0 |
289907 |
if( iPos<0 || !zToken || nToken<=0 ){
|
192206
|
289907 |
0 |
for(i=1; rc==SQLITE_OK && i<p->nIndex; i++){
|
|
0 |
289907 |
for(i=1; rc==SQLITE_OK && i<p->nIndex; i++){
|
192208
|
0 |
0 |
if( nToken<pIndex->nPrefix ) continue;
|
192217
|
0 |
70 |
return (rc==SQLITE_DONE ? SQLITE_OK : rc);
|
192240
|
46 |
1 |
if( iDocid<p->iPrevDocid
|
192241
|
0 |
46 |
|| (iDocid==p->iPrevDocid && p->bPrevDelete==0)
|
|
0 |
0 |
|| (iDocid==p->iPrevDocid && p->bPrevDelete==0)
|
192242
|
46 |
0 |
|| p->iPrevLangid!=iLangid
|
192243
|
0 |
46 |
|| p->nPendingData>p->nMaxPendingData
|
192246
|
0 |
1 |
if( rc!=SQLITE_OK ) return rc;
|
192259
|
43 |
43 |
for(i=0; i<p->nIndex; i++){
|
192262
|
12543 |
43 |
for(pElem=fts3HashFirst(pHash); pElem; pElem=fts3HashNext(pElem)){
|
192286
|
48 |
36 |
for(i=2; i<p->nColumn+2; i++){
|
192288
|
48 |
0 |
if( p->abNotindexed[iCol]==0 ){
|
192291
|
0 |
48 |
if( rc!=SQLITE_OK ){
|
192322
|
3 |
33 |
if( p->zContentTbl ){
|
192324
|
0 |
3 |
if( sqlite3_value_type(pRowid)==SQLITE_NULL ){
|
192327
|
0 |
3 |
if( sqlite3_value_type(pRowid)!=SQLITE_INTEGER ){
|
192343
|
33 |
0 |
if( rc==SQLITE_OK && p->zLanguageid ){
|
|
0 |
33 |
if( rc==SQLITE_OK && p->zLanguageid ){
|
192349
|
0 |
33 |
if( rc!=SQLITE_OK ) return rc;
|
192361
|
0 |
33 |
if( SQLITE_NULL!=sqlite3_value_type(apVal[3+p->nColumn]) ){
|
192362
|
0 |
0 |
if( SQLITE_NULL==sqlite3_value_type(apVal[0])
|
192363
|
0 |
0 |
&& SQLITE_NULL!=sqlite3_value_type(apVal[1])
|
192369
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
192397
|
0 |
1 |
if( bContent ) fts3SqlExec(&rc, p, SQL_DELETE_ALL_CONTENT, 0);
|
192400
|
1 |
0 |
if( p->bHasDocsize ){
|
192403
|
1 |
0 |
if( p->bHasStat ){
|
192414
|
0 |
11 |
if( p->zLanguageid ) iLangid = sqlite3_column_int(pSelect, p->nColumn+1);
|
192434
|
0 |
1 |
if( *pRC ) return;
|
192436
|
1 |
0 |
if( rc==SQLITE_OK ){
|
192437
|
1 |
0 |
if( SQLITE_ROW==sqlite3_step(pSelect) ){
|
192442
|
3 |
0 |
for(i=1; rc==SQLITE_OK && i<=p->nColumn; i++){
|
|
2 |
1 |
for(i=1; rc==SQLITE_OK && i<=p->nColumn; i++){
|
192444
|
2 |
0 |
if( p->abNotindexed[iCol]==0 ){
|
192450
|
0 |
1 |
if( rc!=SQLITE_OK ){
|
192501
|
34 |
0 |
if( rc==SQLITE_OK ){
|
192505
|
34 |
0 |
if( SQLITE_ROW==sqlite3_step(pNextIdx) ){
|
192511
|
34 |
0 |
if( rc==SQLITE_OK ){
|
192517
|
0 |
34 |
if( iNext>=MergeCount(p) ){
|
192568
|
87 |
16 |
if( p->pSegments ){
|
192571
|
6 |
10 |
if( 0==p->zSegmentsTbl ){
|
192573
|
0 |
6 |
if( 0==p->zSegmentsTbl ) return SQLITE_NOMEM;
|
192580
|
103 |
0 |
if( rc==SQLITE_OK ){
|
192583
|
57 |
46 |
if( paBlob ){
|
192585
|
0 |
57 |
if( !aByte ){
|
192588
|
0 |
57 |
if( pnLoad && nByte>(FTS3_NODE_CHUNK_THRESHOLD) ){
|
|
0 |
0 |
if( pnLoad && nByte>(FTS3_NODE_CHUNK_THRESHOLD) ){
|
192594
|
0 |
57 |
if( rc!=SQLITE_OK ){
|
192601
|
0 |
0 |
}else if( rc==SQLITE_ERROR ){
|
192629
|
0 |
0 |
if( rc==SQLITE_OK ){
|
192632
|
0 |
0 |
if( pReader->nPopulate==pReader->nNode ){
|
192646
|
0 |
12991 |
while( pReader->pBlob && rc==SQLITE_OK
|
|
0 |
0 |
while( pReader->pBlob && rc==SQLITE_OK
|
192647
|
0 |
0 |
&& (pFrom - pReader->aNode + nByte)>pReader->nPopulate
|
192658
|
59 |
263 |
if( !fts3SegReaderIsRootOnly(pSeg) ){
|
192681
|
459 |
18505 |
if( !pReader->aDoclist ){
|
192687
|
18872 |
92 |
if( !pNext || pNext>=&pReader->aNode[pReader->nNode] ){
|
|
12594 |
6278 |
if( !pNext || pNext>=&pReader->aNode[pReader->nNode] ){
|
192689
|
12578 |
108 |
if( fts3SegReaderIsPending(pReader) ){
|
192693
|
12544 |
34 |
if( pElem ){
|
192699
|
55 |
12489 |
if( (nTerm+1)>pReader->nTermAlloc ){
|
192702
|
0 |
55 |
if( !pReader->zTerm ) return SQLITE_NOMEM;
|
192710
|
0 |
12544 |
if( !aCopy ) return SQLITE_NOMEM;
|
192727
|
51 |
57 |
if( pReader->iCurrentBlock>=pReader->iLeafEndBlock ){
|
192731
|
0 |
57 |
rc = sqlite3Fts3ReadBlock(
|
192735
|
0 |
57 |
if( rc!=SQLITE_OK ) return rc;
|
192737
|
0 |
57 |
if( bIncr && pReader->nPopulate<pReader->nNode ){
|
|
0 |
0 |
if( bIncr && pReader->nPopulate<pReader->nNode ){
|
192747
|
0 |
6335 |
if( rc!=SQLITE_OK ) return rc;
|
192751
|
0 |
6335 |
pNext += fts3GetVarint32(pNext, &nPrefix);
|
192752
|
0 |
6335 |
pNext += fts3GetVarint32(pNext, &nSuffix);
|
192753
|
6335 |
0 |
if( nSuffix<=0
|
192754
|
6335 |
0 |
|| (&pReader->aNode[pReader->nNode] - pNext)<nSuffix
|
192755
|
0 |
6335 |
|| nPrefix>pReader->nTerm
|
192763
|
520 |
5815 |
if( (i64)nPrefix+nSuffix>(i64)pReader->nTermAlloc ){
|
192766
|
0 |
520 |
if( !zNew ){
|
192774
|
0 |
6335 |
if( rc!=SQLITE_OK ) return rc;
|
192779
|
71 |
6264 |
pNext += fts3GetVarint32(pNext, &pReader->nDoclist);
|
192787
|
6335 |
0 |
if( pReader->nDoclist > pReader->nNode-(pReader->aDoclist-pReader->aNode)
|
192788
|
6335 |
0 |
|| (pReader->nPopulate==0 && pReader->aDoclist[pReader->nDoclist-1])
|
|
6335 |
0 |
|| (pReader->nPopulate==0 && pReader->aDoclist[pReader->nDoclist-1])
|
192789
|
0 |
6335 |
|| pReader->nDoclist==0
|
192804
|
0 |
158 |
if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){
|
|
0 |
0 |
if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){
|
192814
|
158 |
0 |
if( rc==SQLITE_OK ){
|
192844
|
0 |
318 |
if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){
|
|
0 |
0 |
if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){
|
192849
|
0 |
0 |
if( ppOffsetList ){
|
192857
|
0 |
0 |
if( bEof ){
|
192876
|
11769 |
318 |
while( *p | c ) c = *p++ & 0x80;
|
192879
|
0 |
318 |
if( pReader->pBlob==0 || p<&pReader->aNode[pReader->nPopulate] ) break;
|
|
0 |
0 |
if( pReader->pBlob==0 || p<&pReader->aNode[pReader->nPopulate] ) break;
|
192881
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
192888
|
302 |
16 |
if( ppOffsetList ){
|
192894
|
163 |
155 |
while( p<pEnd && *p==0 ) p++;
|
|
0 |
163 |
while( p<pEnd && *p==0 ) p++;
|
192901
|
155 |
163 |
if( p>=pEnd ){
|
192905
|
163 |
0 |
if( rc==SQLITE_OK ){
|
192908
|
0 |
163 |
if( pTab->bDescIdx ){
|
192935
|
212 |
0 |
for(ii=0; rc==SQLITE_OK && ii<pMsr->nSegment; ii++){
|
|
162 |
50 |
for(ii=0; rc==SQLITE_OK && ii<pMsr->nSegment; ii++){
|
192937
|
162 |
0 |
if( !fts3SegReaderIsPending(pReader)
|
192938
|
46 |
116 |
&& !fts3SegReaderIsRootOnly(pReader)
|
192941
|
46 |
46 |
for(jj=pReader->iStartBlock; jj<=pReader->iLeafEndBlock; jj++){
|
192944
|
0 |
46 |
if( rc!=SQLITE_OK ) break;
|
192945
|
0 |
46 |
if( (nBlob+35)>pgsz ){
|
192960
|
459 |
0 |
if( pReader ){
|
192962
|
92 |
367 |
if( !fts3SegReaderIsRootOnly(pReader) ){
|
192991
|
367 |
57 |
if( iStartLeaf==0 ){
|
192992
|
0 |
367 |
if( iEndLeaf!=0 ) return FTS_CORRUPT_VTAB;
|
192997
|
0 |
424 |
if( !pReader ){
|
193007
|
367 |
57 |
if( nExtra ){
|
193012
|
367 |
0 |
if( nRoot ) memcpy(pReader->aNode, zRoot, nRoot);
|
193037
|
5452 |
116827 |
if( c==0 ){
|
193078
|
50 |
105 |
if( bPrefix ){
|
193081
|
12543 |
50 |
for(pE=fts3HashFirst(pHash); pE; pE=fts3HashNext(pE)){
|
193084
|
0 |
12543 |
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)) ){
|
193085
|
805 |
11738 |
if( nElem==nAlloc ){
|
193091
|
0 |
805 |
if( !aElem2 ){
|
193107
|
34 |
16 |
if( nElem>1 ){
|
193120
|
1 |
104 |
if( pE ){
|
193126
|
35 |
120 |
if( nElem>0 ){
|
193130
|
0 |
35 |
if( !pReader ){
|
193140
|
50 |
105 |
if( bPrefix ){
|
193161
|
152 |
489 |
if( pLhs->aNode && pRhs->aNode ){
|
|
82 |
70 |
if( pLhs->aNode && pRhs->aNode ){
|
193163
|
13 |
69 |
if( rc2<0 ){
|
193168
|
51 |
31 |
if( rc==0 ){
|
193174
|
364 |
277 |
if( rc==0 ){
|
193194
|
146 |
70 |
if( rc==0 ){
|
193195
|
16 |
130 |
if( pLhs->iDocid==pRhs->iDocid ){
|
193198
|
82 |
48 |
rc = (pLhs->iDocid > pRhs->iDocid) ? 1 : -1;
|
193206
|
0 |
0 |
if( rc==0 ){
|
193207
|
0 |
0 |
if( pLhs->iDocid==pRhs->iDocid ){
|
193210
|
0 |
0 |
rc = (pLhs->iDocid < pRhs->iDocid) ? 1 : -1;
|
193231
|
6462 |
44 |
if( pSeg->aNode ){
|
193232
|
3177 |
3285 |
if( pSeg->nTerm>nTerm ){
|
193237
|
368 |
6094 |
if( res==0 ){
|
193260
|
12966 |
211 |
if( nSuspect==nSegment ) nSuspect--;
|
193261
|
534 |
13177 |
for(i=nSuspect-1; i>=0; i--){
|
193263
|
857 |
376 |
for(j=i; j<(nSegment-1); j++){
|
193265
|
158 |
699 |
if( xCmp(apSegment[j], apSegment[j+1])<0 ) break;
|
193291
|
140 |
0 |
if( rc==SQLITE_OK ){
|
193312
|
0 |
0 |
if( rc==SQLITE_OK ){
|
193313
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){
|
193338
|
34 |
0 |
if( rc==SQLITE_OK ){
|
193343
|
0 |
34 |
if( nLeafData==0 ){
|
193347
|
0 |
34 |
if( !zEnd ) return SQLITE_NOMEM;
|
193373
|
51223 |
2843 |
for(n=0; n<nPrev && n<nNext && zPrev[n]==zNext[n]; n++);
|
|
51223 |
0 |
for(n=0; n<nPrev && n<nNext && zPrev[n]==zNext[n]; n++);
|
|
41389 |
9834 |
for(n=0; n<nPrev && n<nNext && zPrev[n]==zNext[n]; n++);
|
193396
|
134 |
6 |
if( pTree ){
|
193408
|
0 |
134 |
if( nSuffix<=0 ) return FTS_CORRUPT_VTAB;
|
193411
|
0 |
134 |
if( nReq<=p->nNodeSize || !pTree->zTerm ){
|
|
0 |
0 |
if( nReq<=p->nNodeSize || !pTree->zTerm ){
|
193413
|
0 |
134 |
if( nReq>p->nNodeSize ){
|
193423
|
0 |
0 |
if( !pTree->aData ){
|
193428
|
128 |
6 |
if( pTree->zTerm ){
|
193438
|
134 |
0 |
if( isCopyTerm ){
|
193439
|
11 |
123 |
if( pTree->nMalloc<nTerm ){
|
193441
|
0 |
11 |
if( !zNew ){
|
193467
|
0 |
6 |
if( !pNew ){
|
193474
|
0 |
6 |
if( pTree ){
|
193477
|
0 |
0 |
if( pTree->pParent==0 ){
|
193536
|
6 |
0 |
if( !pTree->pParent ){
|
193546
|
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){
|
193554
|
0 |
0 |
if( rc==SQLITE_OK ){
|
193569
|
6 |
34 |
if( pTree ){
|
193572
|
6 |
6 |
while( p ){
|
193574
|
0 |
6 |
if( p->aData!=(char *)&p[1] ){
|
193608
|
34 |
12509 |
if( !pWriter ){
|
193614
|
0 |
34 |
if( !pWriter ) return SQLITE_NOMEM;
|
193620
|
0 |
34 |
if( !pWriter->aData ) return SQLITE_NOMEM;
|
193625
|
0 |
34 |
if( rc!=SQLITE_OK ) return rc;
|
193626
|
34 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){
|
193631
|
0 |
34 |
if( rc!=SQLITE_OK ) return rc;
|
193641
|
0 |
12543 |
if( nSuffix<=0 ) return FTS_CORRUPT_VTAB;
|
193650
|
12509 |
34 |
if( nData>0 && nData+nReq>p->nNodeSize ){
|
|
134 |
12375 |
if( nData>0 && nData+nReq>p->nNodeSize ){
|
193654
|
0 |
134 |
if( pWriter->iFree==LARGEST_INT64 ) return FTS_CORRUPT_VTAB;
|
193656
|
0 |
134 |
if( rc!=SQLITE_OK ) return rc;
|
193673
|
0 |
134 |
if( rc!=SQLITE_OK ) return rc;
|
193693
|
0 |
12543 |
if( nReq>pWriter->nSize ){
|
193695
|
0 |
0 |
if( !aNew ) return SQLITE_NOMEM;
|
193717
|
12543 |
0 |
if( isCopyTerm ){
|
193718
|
59 |
12484 |
if( nTerm>pWriter->nMalloc ){
|
193720
|
0 |
59 |
if( !zNew ){
|
193751
|
6 |
28 |
if( pWriter->pTree ){
|
193759
|
6 |
0 |
if( rc==SQLITE_OK ){
|
193763
|
6 |
0 |
if( rc==SQLITE_OK ){
|
193781
|
34 |
8 |
if( pWriter ){
|
193802
|
1 |
0 |
if( p->zContentTbl ){
|
193808
|
0 |
0 |
if( rc==SQLITE_OK ){
|
193809
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){
|
193843
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
193848
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){
|
193872
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
193879
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){
|
193895
|
0 |
0 |
if( pSeg->iStartBlock ){
|
193898
|
0 |
0 |
if( rc==SQLITE_OK ){
|
193934
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nReader; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nReader; i++){
|
193937
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
193942
|
0 |
0 |
if( iLevel==FTS3_SEGCURSOR_ALL ){
|
193944
|
0 |
0 |
if( rc==SQLITE_OK ){
|
193952
|
0 |
0 |
if( rc==SQLITE_OK ){
|
193959
|
0 |
0 |
if( rc==SQLITE_OK ){
|
193994
|
9062 |
111 |
while( p<pEnd && (c | *p)&0xFE ) c = *p++ & 0x80;
|
|
9055 |
7 |
while( p<pEnd && (c | *p)&0xFE ) c = *p++ & 0x80;
|
193996
|
111 |
7 |
if( iCol==iCurrent ){
|
194003
|
0 |
7 |
if( nList<=0 ){
|
194007
|
0 |
7 |
p += fts3GetVarint32(p, &iCurrent);
|
194010
|
99 |
12 |
if( bZero && (pEnd - &pList[nList])>0){
|
|
0 |
99 |
if( bZero && (pEnd - &pList[nList])>0){
|
194029
|
41 |
12505 |
if( (nList+FTS3_NODE_PADDING)>pMsr->nBuffer ){
|
194033
|
0 |
41 |
if( !pNew ) return SQLITE_NOMEM;
|
194054
|
0 |
334 |
p->bDescIdx ? fts3SegReaderDoclistCmpRev : fts3SegReaderDoclistCmp
|
194057
|
4 |
330 |
if( nMerge==0 ){
|
194066
|
62 |
284 |
if( pSeg->pOffsetList==0 ){
|
194078
|
300 |
0 |
while( rc==SQLITE_OK
|
194079
|
166 |
134 |
&& j<nMerge
|
194080
|
103 |
63 |
&& apSegment[j]->pOffsetList
|
194081
|
16 |
87 |
&& apSegment[j]->iDocid==iDocid
|
194086
|
0 |
284 |
if( rc!=SQLITE_OK ) return rc;
|
194089
|
268 |
16 |
if( nList>0 && fts3SegReaderIsPending(apSegment[0]) ){
|
|
3 |
265 |
if( nList>0 && fts3SegReaderIsPending(apSegment[0]) ){
|
194091
|
0 |
3 |
if( rc!=SQLITE_OK ) return rc;
|
194096
|
99 |
185 |
if( pMsr->iColFilter>=0 ){
|
194100
|
268 |
16 |
if( nList>0 ){
|
194127
|
607 |
0 |
for(i=0; pCsr->bRestart==0 && i<pCsr->nSegment; i++){
|
|
459 |
148 |
for(i=0; pCsr->bRestart==0 && i<pCsr->nSegment; i++){
|
194132
|
0 |
6403 |
if( rc!=SQLITE_OK ) return rc;
|
194133
|
6366 |
37 |
}while( zTerm && (res = fts3SegReaderTermCmp(pSeg, zTerm, nTerm))<0 );
|
|
5944 |
422 |
}while( zTerm && (res = fts3SegReaderTermCmp(pSeg, zTerm, nTerm))<0 );
|
194135
|
389 |
70 |
if( pSeg->bLookup && res!=0 ){
|
|
214 |
175 |
if( pSeg->bLookup && res!=0 ){
|
194164
|
0 |
105 |
p->bDescIdx ? fts3SegReaderDoclistCmpRev : fts3SegReaderDoclistCmp
|
194172
|
0 |
105 |
if( rc!=SQLITE_OK ) return rc;
|
194175
|
218 |
27 |
for(i=0; i<nSegment; i++){
|
194177
|
140 |
78 |
if( !pSeg->aNode || fts3SegReaderTermCmp(pSeg, zTerm, nTerm) ){
|
|
140 |
0 |
if( !pSeg->aNode || fts3SegReaderTermCmp(pSeg, zTerm, nTerm) ){
|
194184
|
140 |
105 |
for(i=0; i<pCsr->nAdvance; i++){
|
194186
|
0 |
140 |
if( rc!=SQLITE_OK ) return rc;
|
194218
|
0 |
0 |
for(i=0; i<pCsr->nSegment; i++){
|
194228
|
9 |
27 |
if( nReq>pCsr->nBuffer ){
|
194232
|
0 |
9 |
if( !aNew ){
|
194258
|
0 |
12604 |
p->bDescIdx ? fts3SegReaderDoclistCmpRev : fts3SegReaderDoclistCmp
|
194261
|
0 |
12604 |
if( pCsr->nSegment==0 ) return SQLITE_OK;
|
194270
|
12561 |
12604 |
for(i=0; i<pCsr->nAdvance; i++){
|
194272
|
0 |
12561 |
if( pSeg->bLookup ){
|
194277
|
0 |
12561 |
if( rc!=SQLITE_OK ) return rc;
|
194284
|
35 |
12569 |
if( apSegment[0]->aNode==0 ) break;
|
194296
|
20 |
12549 |
if( pFilter->zTerm && !isScan ){
|
|
20 |
0 |
if( pFilter->zTerm && !isScan ){
|
194297
|
16 |
4 |
if( pCsr->nTerm<pFilter->nTerm
|
194298
|
0 |
16 |
|| (!isPrefix && pCsr->nTerm>pFilter->nTerm)
|
|
0 |
0 |
|| (!isPrefix && pCsr->nTerm>pFilter->nTerm)
|
194299
|
12 |
4 |
|| memcmp(pCsr->zTerm, pFilter->zTerm, pFilter->nTerm)
|
194306
|
18 |
12543 |
while( nMerge<nSegment
|
194307
|
13 |
5 |
&& apSegment[nMerge]->aNode
|
194308
|
0 |
13 |
&& apSegment[nMerge]->nTerm==pCsr->nTerm
|
194309
|
0 |
0 |
&& 0==memcmp(pCsr->zTerm, apSegment[nMerge]->zTerm, pCsr->nTerm)
|
194315
|
12561 |
0 |
if( nMerge==1
|
194316
|
12543 |
18 |
&& !isIgnoreEmpty
|
194317
|
12543 |
0 |
&& !isFirst
|
194318
|
0 |
12543 |
&& (p->bDescIdx==0 || fts3SegReaderIsPending(apSegment[0])==0)
|
|
0 |
0 |
&& (p->bDescIdx==0 || fts3SegReaderIsPending(apSegment[0])==0)
|
194321
|
12543 |
0 |
if( fts3SegReaderIsPending(apSegment[0]) ){
|
194328
|
12543 |
0 |
if( rc==SQLITE_OK ) rc = SQLITE_ROW;
|
194337
|
18 |
18 |
for(i=0; i<nMerge; i++){
|
194341
|
18 |
18 |
while( apSegment[0]->pOffsetList ){
|
194349
|
0 |
18 |
while( j<nMerge
|
194350
|
0 |
0 |
&& apSegment[j]->pOffsetList
|
194351
|
0 |
0 |
&& apSegment[j]->iDocid==iDocid
|
194357
|
12 |
6 |
if( isColFilter ){
|
194361
|
18 |
0 |
if( !isIgnoreEmpty || nList>0 ){
|
|
18 |
0 |
if( !isIgnoreEmpty || nList>0 ){
|
194366
|
0 |
18 |
if( p->bDescIdx && nDoclist>0 ){
|
|
0 |
0 |
if( p->bDescIdx && nDoclist>0 ){
|
194367
|
0 |
0 |
if( iPrev<=iDocid ) return FTS_CORRUPT_VTAB;
|
194370
|
0 |
18 |
if( nDoclist>0 && iPrev>=iDocid ) return FTS_CORRUPT_VTAB;
|
|
0 |
0 |
if( nDoclist>0 && iPrev>=iDocid ) return FTS_CORRUPT_VTAB;
|
194374
|
18 |
0 |
nByte = sqlite3Fts3VarintLen(iDelta) + (isRequirePos?nList+1:0);
|
194378
|
0 |
18 |
if( rc ) return rc;
|
194380
|
0 |
18 |
if( isFirst ){
|
194385
|
0 |
0 |
if( nWrite ){
|
194392
|
18 |
0 |
if( isRequirePos ){
|
194402
|
18 |
0 |
if( nDoclist>0 ){
|
194404
|
0 |
18 |
if( rc ) return rc;
|
194412
|
0 |
12561 |
}while( rc==SQLITE_OK );
|
194421
|
157 |
8 |
if( pCsr ){
|
194423
|
459 |
157 |
for(i=0; i<pCsr->nSegment; i++){
|
194452
|
0 |
0 |
if( zText ){
|
194456
|
0 |
0 |
for(i=0; zText[i]>='0' && zText[i]<='9'; i++){
|
|
0 |
0 |
for(i=0; zText[i]>='0' && zText[i]<='9'; i++){
|
194460
|
0 |
0 |
while( zText[i]==' ' ) i++;
|
194462
|
0 |
0 |
if( zText[i]=='-' ){
|
194466
|
0 |
0 |
for(/* no-op */; zText[i]>='0' && zText[i]<='9'; i++){
|
|
0 |
0 |
for(/* no-op */; zText[i]>='0' && zText[i]<='9'; i++){
|
194488
|
34 |
0 |
if( rc==SQLITE_OK ){
|
194500
|
0 |
34 |
while( SQLITE_ROW==sqlite3_step(pRange) ){
|
194503
|
0 |
0 |
if( nSize<=0 || nSize>nLimit ){
|
|
0 |
0 |
if( nSize<=0 || nSize>nLimit ){
|
194516
|
0 |
34 |
if( bOk ){
|
194521
|
0 |
0 |
if( rc==SQLITE_OK ){
|
194524
|
0 |
0 |
if( rc==SQLITE_OK ){
|
194528
|
0 |
0 |
if( rc==SQLITE_OK ){
|
194540
|
0 |
0 |
while( SQLITE_ROW==sqlite3_step(pRange) ){
|
194546
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
194552
|
0 |
0 |
if( rc==SQLITE_OK ){
|
194557
|
0 |
0 |
if( rc==SQLITE_OK ){
|
194603
|
42 |
0 |
if( rc!=SQLITE_OK || csr.nSegment==0 ) goto finished;
|
|
34 |
8 |
if( rc!=SQLITE_OK || csr.nSegment==0 ) goto finished;
|
194605
|
0 |
34 |
if( iLevel!=FTS3_SEGCURSOR_PENDING ){
|
194607
|
0 |
0 |
if( rc!=SQLITE_OK ) goto finished;
|
194610
|
0 |
34 |
if( iLevel==FTS3_SEGCURSOR_ALL ){
|
194615
|
0 |
0 |
if( csr.nSegment==1 && 0==fts3SegReaderIsPending(csr.apSegment[0]) ){
|
|
0 |
0 |
if( csr.nSegment==1 && 0==fts3SegReaderIsPending(csr.apSegment[0]) ){
|
194630
|
0 |
34 |
bIgnoreEmpty = (iLevel!=FTS3_SEGCURSOR_PENDING) && (iNewLevel>iMaxLevel);
|
|
0 |
0 |
bIgnoreEmpty = (iLevel!=FTS3_SEGCURSOR_PENDING) && (iNewLevel>iMaxLevel);
|
194632
|
0 |
34 |
if( rc!=SQLITE_OK ) goto finished;
|
194642
|
0 |
34 |
filter.flags |= (bIgnoreEmpty ? FTS3_SEGMENT_IGNORE_EMPTY : 0);
|
194645
|
12577 |
0 |
while( SQLITE_OK==rc ){
|
194647
|
34 |
12543 |
if( rc!=SQLITE_ROW ) break;
|
194651
|
0 |
34 |
if( rc!=SQLITE_OK ) goto finished;
|
194654
|
0 |
34 |
if( iLevel!=FTS3_SEGCURSOR_PENDING ){
|
194658
|
0 |
0 |
if( rc!=SQLITE_OK ) goto finished;
|
194660
|
34 |
0 |
if( pWriter ){
|
194662
|
34 |
0 |
if( rc==SQLITE_OK ){
|
194663
|
0 |
34 |
if( iLevel==FTS3_SEGCURSOR_PENDING || iNewLevel<iMaxLevel ){
|
|
0 |
0 |
if( iLevel==FTS3_SEGCURSOR_PENDING || iNewLevel<iMaxLevel ){
|
194683
|
84 |
0 |
for(i=0; rc==SQLITE_OK && i<p->nIndex; i++){
|
|
42 |
42 |
for(i=0; rc==SQLITE_OK && i<p->nIndex; i++){
|
194685
|
0 |
42 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK;
|
194692
|
42 |
0 |
if( rc==SQLITE_OK && p->bHasStat
|
|
23 |
19 |
if( rc==SQLITE_OK && p->bHasStat
|
194693
|
9 |
14 |
&& p->nAutoincrmerge==0xff && p->nLeafAdd>0
|
|
5 |
4 |
&& p->nAutoincrmerge==0xff && p->nLeafAdd>0
|
194697
|
5 |
0 |
if( rc==SQLITE_OK ){
|
194700
|
0 |
5 |
if( rc==SQLITE_ROW ){
|
194702
|
0 |
0 |
if( p->nAutoincrmerge==1 ) p->nAutoincrmerge = 8;
|
194703
|
5 |
0 |
}else if( rc==SQLITE_DONE ){
|
194722
|
124 |
52 |
for(i=j=0; i<N; i++){
|
194738
|
17 |
0 |
if( nBuf && (zBuf[nBuf-1]&0x80)==0 ){
|
|
17 |
0 |
if( nBuf && (zBuf[nBuf-1]&0x80)==0 ){
|
194740
|
58 |
17 |
for(i=j=0; i<N && j<nBuf; i++){
|
|
58 |
0 |
for(i=j=0; i<N && j<nBuf; i++){
|
194746
|
0 |
17 |
while( i<N ) a[i++] = 0;
|
194764
|
0 |
30 |
if( *pRC ) return;
|
194766
|
0 |
30 |
if( pBlob==0 ){
|
194772
|
0 |
30 |
if( rc ){
|
194814
|
0 |
22 |
if( *pRC ) return;
|
194816
|
0 |
22 |
if( a==0 ){
|
194822
|
0 |
22 |
if( rc ){
|
194828
|
17 |
5 |
if( sqlite3_step(pStmt)==SQLITE_ROW ){
|
194836
|
0 |
22 |
if( rc!=SQLITE_OK ){
|
194841
|
1 |
21 |
if( nChng<0 && a[0]<(u32)(-nChng) ){
|
|
0 |
1 |
if( nChng<0 && a[0]<(u32)(-nChng) ){
|
194846
|
54 |
22 |
for(i=0; i<p->nColumn+1; i++){
|
194848
|
0 |
54 |
if( x+aSzIns[i] < aSzDel[i] ){
|
194857
|
0 |
22 |
if( rc ){
|
194880
|
0 |
0 |
if( rc==SQLITE_OK ){
|
194883
|
0 |
0 |
if( rc==SQLITE_OK ){
|
194887
|
0 |
0 |
while( sqlite3_step(pAllLangid)==SQLITE_ROW ){
|
194890
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<p->nIndex; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<p->nIndex; i++){
|
194892
|
0 |
0 |
if( rc==SQLITE_DONE ){
|
194899
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
194904
|
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;
|
194921
|
1 |
0 |
if( rc==SQLITE_OK ){
|
194930
|
0 |
1 |
if( !zSql ){
|
194937
|
1 |
0 |
if( rc==SQLITE_OK ){
|
194940
|
0 |
1 |
if( aSz==0 ){
|
194949
|
11 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){
|
|
10 |
1 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){
|
194954
|
30 |
0 |
for(iCol=0; rc==SQLITE_OK && iCol<p->nColumn; iCol++){
|
|
20 |
10 |
for(iCol=0; rc==SQLITE_OK && iCol<p->nColumn; iCol++){
|
194955
|
20 |
0 |
if( p->abNotindexed[iCol]==0 ){
|
194961
|
10 |
0 |
if( p->bHasDocsize ){
|
194964
|
0 |
10 |
if( rc!=SQLITE_OK ){
|
194969
|
30 |
10 |
for(iCol=0; iCol<=p->nColumn; iCol++){
|
194974
|
1 |
0 |
if( p->bFts4 ){
|
194979
|
1 |
0 |
if( pStmt ){
|
194981
|
1 |
0 |
if( rc==SQLITE_OK ){
|
195012
|
0 |
0 |
if( pCsr->apSegment==0 ){
|
195018
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195023
|
0 |
0 |
for(i=0; rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW && i<nSeg; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW && i<nSeg; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW && i<nSeg; i++){
|
195035
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
195114
|
0 |
0 |
if( *pRc==SQLITE_OK && nMin>pBlob->nAlloc ){
|
|
0 |
0 |
if( *pRc==SQLITE_OK && nMin>pBlob->nAlloc ){
|
195117
|
0 |
0 |
if( a ){
|
195143
|
0 |
0 |
if( p->iChild && bFirst==0 ) p->iChild++;
|
|
0 |
0 |
if( p->iChild && bFirst==0 ) p->iChild++;
|
195144
|
0 |
0 |
if( p->iOff>=p->nNode ){
|
195148
|
0 |
0 |
if( bFirst==0 ){
|
195149
|
0 |
0 |
p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &nPrefix);
|
195151
|
0 |
0 |
p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &nSuffix);
|
195153
|
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 ){
|
195157
|
0 |
0 |
if( rc==SQLITE_OK && ALWAYS(p->term.a!=0) ){
|
|
0 |
0 |
if( rc==SQLITE_OK && ALWAYS(p->term.a!=0) ){
|
195161
|
0 |
0 |
if( p->iChild==0 ){
|
195162
|
0 |
0 |
p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &p->nDoclist);
|
195163
|
0 |
0 |
if( (p->nNode-p->iOff)<p->nDoclist ){
|
195196
|
0 |
0 |
if( aNode && aNode[0] ){
|
|
0 |
0 |
if( aNode && aNode[0] ){
|
195203
|
0 |
0 |
return aNode ? nodeReaderNext(p) : SQLITE_OK;
|
195226
|
0 |
0 |
for(iLayer=1; ALWAYS(iLayer<FTS_MAX_APPENDABLE_HEIGHT); iLayer++){
|
195240
|
0 |
0 |
if(nSuffix<=0 ) return FTS_CORRUPT_VTAB;
|
195244
|
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 ){
|
195250
|
0 |
0 |
if( pBlk->n==0 ){
|
195252
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195260
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195261
|
0 |
0 |
if( pNode->key.n ){
|
195288
|
0 |
0 |
if( rc!=SQLITE_OK || iNextPtr==0 ) return rc;
|
|
0 |
0 |
if( rc!=SQLITE_OK || iNextPtr==0 ) return rc;
|
195339
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
195343
|
0 |
0 |
if( nSuffix<=0 ) return FTS_CORRUPT_VTAB;
|
195347
|
0 |
0 |
if( bFirst==0 ){
|
195354
|
0 |
0 |
if( aDoclist ){
|
195389
|
0 |
0 |
if(nSuffix<=0 ) return FTS_CORRUPT_VTAB;
|
195398
|
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 ){
|
195414
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195431
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195432
|
0 |
0 |
if( pLeaf->block.n==0 ){
|
195471
|
0 |
0 |
for(iRoot=FTS_MAX_APPENDABLE_HEIGHT-1; iRoot>=0; iRoot--){
|
195473
|
0 |
0 |
if( pNode->block.n>0 ) break;
|
195481
|
0 |
0 |
if( iRoot<0 ) return;
|
195498
|
0 |
0 |
if( iRoot==0 ){
|
195501
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195512
|
0 |
0 |
for(i=0; i<iRoot; i++){
|
195514
|
0 |
0 |
if( pNode->block.n>0 && rc==SQLITE_OK ){
|
|
0 |
0 |
if( pNode->block.n>0 && rc==SQLITE_OK ){
|
195522
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195523
|
0 |
0 |
rc = fts3WriteSegdir(p,
|
195554
|
0 |
0 |
if( nCmp && ALWAYS(zLhs) && ALWAYS(zRhs) ){
|
|
0 |
0 |
if( nCmp && ALWAYS(zLhs) && ALWAYS(zRhs) ){
|
|
0 |
0 |
if( nCmp && ALWAYS(zLhs) && ALWAYS(zRhs) ){
|
195559
|
0 |
0 |
if( res==0 ) res = nLhs - nRhs;
|
195583
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195585
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pCheck) ) bRes = 1;
|
195620
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195632
|
0 |
0 |
if( sqlite3_step(pSelect)==SQLITE_ROW ){
|
195636
|
0 |
0 |
if( pWriter->nLeafData<0 ){
|
195642
|
0 |
0 |
if( aRoot==0 ){
|
195644
|
0 |
0 |
return nRoot ? SQLITE_NOMEM : FTS_CORRUPT_VTAB;
|
195654
|
0 |
0 |
if( rc==SQLITE_OK && bAppendable ){
|
|
0 |
0 |
if( rc==SQLITE_OK && bAppendable ){
|
195659
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195661
|
0 |
0 |
for(rc = nodeReaderInit(&reader, aLeaf, nLeaf);
|
195662
|
0 |
0 |
rc==SQLITE_OK && reader.aNode;
|
195667
|
0 |
0 |
if( fts3TermCmp(zKey, nKey, reader.term.a, reader.term.n)<=0 ){
|
195675
|
0 |
0 |
if( rc==SQLITE_OK && bAppendable ){
|
|
0 |
0 |
if( rc==SQLITE_OK && bAppendable ){
|
195681
|
0 |
0 |
if( nHeight<1 || nHeight>=FTS_MAX_APPENDABLE_HEIGHT ){
|
|
0 |
0 |
if( nHeight<1 || nHeight>=FTS_MAX_APPENDABLE_HEIGHT ){
|
195692
|
0 |
0 |
for(i=nHeight+1; i<FTS_MAX_APPENDABLE_HEIGHT; i++){
|
195701
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195707
|
0 |
0 |
for(i=nHeight; i>=0 && rc==SQLITE_OK; i--){
|
|
0 |
0 |
for(i=nHeight; i>=0 && rc==SQLITE_OK; i--){
|
195711
|
0 |
0 |
if( pNode->block.a){
|
195713
|
0 |
0 |
while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader);
|
|
0 |
0 |
while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader);
|
195715
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195717
|
0 |
0 |
if( reader.term.n>0 ){
|
195721
|
0 |
0 |
if( i>0 ){
|
195730
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195744
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
195768
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195819
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195822
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pLeafEst) ){
|
195827
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
195831
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195832
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pFirstBlock) ){
|
195839
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
195845
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
195852
|
0 |
0 |
for(i=0; i<FTS_MAX_APPENDABLE_HEIGHT; i++){
|
195878
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195906
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195909
|
0 |
0 |
while( SQLITE_ROW==sqlite3_step(pSelect) ){
|
195910
|
0 |
0 |
if( nIdx>=nAlloc ){
|
195914
|
0 |
0 |
if( !aNew ){
|
195923
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
195926
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195929
|
0 |
0 |
if( rc==SQLITE_OK ){
|
195935
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nIdx; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nIdx; i++){
|
195936
|
0 |
0 |
if( aIdx[i]!=i ){
|
195951
|
0 |
0 |
if( iChild ){
|
195981
|
0 |
0 |
if( nNode<1 ) return FTS_CORRUPT_VTAB;
|
195986
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
195990
|
0 |
0 |
for(rc = nodeReaderInit(&reader, aNode, nNode);
|
195991
|
0 |
0 |
rc==SQLITE_OK && reader.aNode;
|
195994
|
0 |
0 |
if( pNew->n==0 ){
|
195996
|
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;
|
196004
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
196006
|
0 |
0 |
if( pNew->n==0 ){
|
196042
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196046
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pFetch) ){
|
196053
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
196056
|
0 |
0 |
while( rc==SQLITE_OK && iBlock ){
|
|
0 |
0 |
while( rc==SQLITE_OK && iBlock ){
|
196062
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196065
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196072
|
0 |
0 |
if( rc==SQLITE_OK && iNewStart ){
|
|
0 |
0 |
if( rc==SQLITE_OK && iNewStart ){
|
196075
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196083
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196086
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196122
|
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--){
|
196128
|
0 |
0 |
for(j=0; ALWAYS(j<pCsr->nSegment); j++){
|
196130
|
0 |
0 |
if( pSeg->iIdx==i ) break;
|
196134
|
0 |
0 |
if( pSeg->aNode==0 ){
|
196137
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196152
|
0 |
0 |
if( rc==SQLITE_OK && nRem!=pCsr->nSegment ){
|
|
0 |
0 |
if( rc==SQLITE_OK && nRem!=pCsr->nSegment ){
|
196168
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196193
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196196
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pSelect) ){
|
196199
|
0 |
0 |
if( aHint ){
|
196201
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196202
|
0 |
0 |
if( ALWAYS(pHint->a!=0) ) memcpy(pHint->a, aHint, nHint);
|
196208
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
196230
|
0 |
0 |
if( *pRc==SQLITE_OK ){
|
196249
|
0 |
0 |
if( (pHint->a[i] & 0x80) ) return FTS_CORRUPT_VTAB;
|
196250
|
0 |
0 |
while( i>0 && (pHint->a[i-1] & 0x80) ) i--;
|
|
0 |
0 |
while( i>0 && (pHint->a[i-1] & 0x80) ) i--;
|
196251
|
0 |
0 |
if( i==0 ) return FTS_CORRUPT_VTAB;
|
196253
|
0 |
0 |
while( i>0 && (pHint->a[i-1] & 0x80) ) i--;
|
|
0 |
0 |
while( i>0 && (pHint->a[i-1] & 0x80) ) i--;
|
196257
|
0 |
0 |
i += fts3GetVarint32(&pHint->a[i], pnInput);
|
196259
|
0 |
0 |
if( i!=nHint ) return FTS_CORRUPT_VTAB;
|
196288
|
0 |
0 |
if( !pWriter ) return SQLITE_NOMEM;
|
196293
|
0 |
0 |
while( rc==SQLITE_OK && nRem>0 ){
|
|
0 |
0 |
while( rc==SQLITE_OK && nRem>0 ){
|
196307
|
0 |
0 |
if( sqlite3_step(pFindLevel)==SQLITE_ROW ){
|
196321
|
0 |
0 |
if( rc==SQLITE_OK && hint.n ){
|
|
0 |
0 |
if( rc==SQLITE_OK && hint.n ){
|
196327
|
0 |
0 |
if( nSeg<0 || (iAbsLevel % nMod) >= (iHintAbsLevel % nMod) ){
|
|
0 |
0 |
if( nSeg<0 || (iAbsLevel % nMod) >= (iHintAbsLevel % nMod) ){
|
196348
|
0 |
0 |
if( nSeg<=0 ) break;
|
196351
|
0 |
0 |
if( iAbsLevel<0 || iAbsLevel>(nMod<<32) ){
|
|
0 |
0 |
if( iAbsLevel<0 || iAbsLevel>(nMod<<32) ){
|
196365
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196368
|
0 |
0 |
if( iIdx==0 || (bUseHint && iIdx==1) ){
|
|
0 |
0 |
if( iIdx==0 || (bUseHint && iIdx==1) ){
|
|
0 |
0 |
if( iIdx==0 || (bUseHint && iIdx==1) ){
|
196371
|
0 |
0 |
if( bIgnore ){
|
196377
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196380
|
0 |
0 |
if( SQLITE_OK==rc && pCsr->nSegment==nSeg
|
|
0 |
0 |
if( SQLITE_OK==rc && pCsr->nSegment==nSeg
|
196381
|
0 |
0 |
&& SQLITE_OK==(rc = sqlite3Fts3SegReaderStart(p, pCsr, pFilter))
|
196385
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196387
|
0 |
0 |
}else if( rc!=SQLITE_ROW ){
|
196391
|
0 |
0 |
if( bUseHint && iIdx>0 ){
|
|
0 |
0 |
if( bUseHint && iIdx>0 ){
|
196399
|
0 |
0 |
if( rc==SQLITE_OK && pWriter->nLeafEst ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pWriter->nLeafEst ){
|
196401
|
0 |
0 |
if( bEmpty==0 ){
|
196404
|
0 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts3SegReaderStep(p, pCsr);
|
196405
|
0 |
0 |
if( pWriter->nWork>=nRem && rc==SQLITE_ROW ) rc = SQLITE_OK;
|
|
0 |
0 |
if( pWriter->nWork>=nRem && rc==SQLITE_ROW ) rc = SQLITE_OK;
|
196406
|
0 |
0 |
}while( rc==SQLITE_ROW );
|
196410
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196413
|
0 |
0 |
if( nSeg!=0 ){
|
196420
|
0 |
0 |
if( nSeg!=0 ){
|
196424
|
0 |
0 |
if( nSeg==0 && pWriter->bNoLeafData==0 ){
|
|
0 |
0 |
if( nSeg==0 && pWriter->bNoLeafData==0 ){
|
196433
|
0 |
0 |
if( bDirtyHint && rc==SQLITE_OK ){
|
|
0 |
0 |
if( bDirtyHint && rc==SQLITE_OK ){
|
196453
|
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';
|
196481
|
0 |
0 |
if( z[0]==',' && z[1]!='\0' ){
|
|
0 |
0 |
if( z[0]==',' && z[1]!='\0' ){
|
196486
|
0 |
0 |
if( z[0]!='\0' || nMin<2 ){
|
|
0 |
0 |
if( z[0]!='\0' || nMin<2 ){
|
196490
|
0 |
0 |
if( !p->bHasStat ){
|
196494
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196517
|
0 |
0 |
if( p->nAutoincrmerge==1 || p->nAutoincrmerge>MergeCount(p) ){
|
|
0 |
0 |
if( p->nAutoincrmerge==1 || p->nAutoincrmerge>MergeCount(p) ){
|
196520
|
0 |
0 |
if( !p->bHasStat ){
|
196523
|
0 |
0 |
if( rc ) return rc;
|
196526
|
0 |
0 |
if( rc ) return rc;
|
196554
|
0 |
0 |
for(i=0; i<nTerm; i++) ret += (ret<<3) + zTerm[i];
|
196589
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196593
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196594
|
0 |
0 |
while( SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, &csr)) ){
|
196603
|
0 |
0 |
while( pCsr<pEnd ){
|
196606
|
0 |
0 |
if( pCsr<pEnd ){
|
196607
|
0 |
0 |
if( iVal==0 || iVal==1 ){
|
|
0 |
0 |
if( iVal==0 || iVal==1 ){
|
196610
|
0 |
0 |
if( iVal ){
|
196614
|
0 |
0 |
if( p->bDescIdx ){
|
196654
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196658
|
0 |
0 |
while( rc==SQLITE_OK && sqlite3_step(pAllLangid)==SQLITE_ROW ){
|
|
0 |
0 |
while( rc==SQLITE_OK && sqlite3_step(pAllLangid)==SQLITE_ROW ){
|
196661
|
0 |
0 |
for(i=0; i<p->nIndex; i++){
|
196666
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
196670
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196676
|
0 |
0 |
if( !zSql ){
|
196683
|
0 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){
|
|
0 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){
|
196688
|
0 |
0 |
for(iCol=0; rc==SQLITE_OK && iCol<p->nColumn; iCol++){
|
|
0 |
0 |
for(iCol=0; rc==SQLITE_OK && iCol<p->nColumn; iCol++){
|
196689
|
0 |
0 |
if( p->abNotindexed[iCol]==0 ){
|
196694
|
0 |
0 |
while( rc==SQLITE_OK ){
|
196701
|
0 |
0 |
if( rc==SQLITE_OK ){
|
196706
|
0 |
0 |
for(i=1; i<p->nIndex; i++){
|
196707
|
0 |
0 |
if( p->aIndex[i].nPrefix<=nToken ){
|
196715
|
0 |
0 |
if( pT ) pModule->xClose(pT);
|
196716
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK;
|
196765
|
0 |
0 |
if( rc==SQLITE_OK && bOk==0 ) rc = FTS_CORRUPT_VTAB;
|
|
0 |
0 |
if( rc==SQLITE_OK && bOk==0 ) rc = FTS_CORRUPT_VTAB;
|
196782
|
0 |
1 |
if( !zVal ){
|
196784
|
0 |
1 |
}else if( nVal==8 && 0==sqlite3_strnicmp(zVal, "optimize", 8) ){
|
|
0 |
0 |
}else if( nVal==8 && 0==sqlite3_strnicmp(zVal, "optimize", 8) ){
|
196786
|
1 |
0 |
}else if( nVal==7 && 0==sqlite3_strnicmp(zVal, "rebuild", 7) ){
|
|
1 |
0 |
}else if( nVal==7 && 0==sqlite3_strnicmp(zVal, "rebuild", 7) ){
|
196788
|
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) ){
|
196790
|
0 |
0 |
}else if( nVal>6 && 0==sqlite3_strnicmp(zVal, "merge=", 6) ){
|
|
0 |
0 |
}else if( nVal>6 && 0==sqlite3_strnicmp(zVal, "merge=", 6) ){
|
196792
|
0 |
0 |
}else if( nVal>10 && 0==sqlite3_strnicmp(zVal, "automerge=", 10) ){
|
|
0 |
0 |
}else if( nVal>10 && 0==sqlite3_strnicmp(zVal, "automerge=", 10) ){
|
196825
|
0 |
114 |
for(pDef=pCsr->pDeferred; pDef; pDef=pDef->pNext){
|
196838
|
0 |
189 |
for(pDef=pCsr->pDeferred; pDef; pDef=pNext){
|
196856
|
0 |
0 |
if( pCsr->pDeferred ){
|
196868
|
0 |
0 |
for(i=0; i<p->nColumn && rc==SQLITE_OK; i++){
|
|
0 |
0 |
for(i=0; i<p->nColumn && rc==SQLITE_OK; i++){
|
196869
|
0 |
0 |
if( p->abNotindexed[i]==0 ){
|
196874
|
0 |
0 |
while( rc==SQLITE_OK ){
|
196881
|
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){
|
196883
|
0 |
0 |
if( (pDef->iCol>=p->nColumn || pDef->iCol==i)
|
|
0 |
0 |
if( (pDef->iCol>=p->nColumn || pDef->iCol==i)
|
196884
|
0 |
0 |
&& (pPT->bFirst==0 || iPos==0)
|
|
0 |
0 |
&& (pPT->bFirst==0 || iPos==0)
|
196885
|
0 |
0 |
&& (pPT->n==nToken || (pPT->isPrefix && pPT->n<nToken))
|
|
0 |
0 |
&& (pPT->n==nToken || (pPT->isPrefix && pPT->n<nToken))
|
|
0 |
0 |
&& (pPT->n==nToken || (pPT->isPrefix && pPT->n<nToken))
|
196886
|
0 |
0 |
&& (0==memcmp(zToken, pPT->z, pPT->n))
|
196892
|
0 |
0 |
if( pTC ) pModule->xClose(pTC);
|
196893
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK;
|
196897
|
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){
|
196898
|
0 |
0 |
if( pDef->pList ){
|
196919
|
0 |
0 |
if( p->pList==0 ){
|
196924
|
0 |
0 |
if( !pRet ) return SQLITE_NOMEM;
|
196944
|
0 |
0 |
if( !pDeferred ){
|
196975
|
1 |
0 |
if( bFound && rc==SQLITE_OK ){
|
|
1 |
0 |
if( bFound && rc==SQLITE_OK ){
|
196978
|
1 |
0 |
if( rc==SQLITE_OK ){
|
196979
|
0 |
1 |
if( isEmpty ){
|
196988
|
0 |
1 |
if( p->zContentTbl==0 ){
|
196991
|
1 |
0 |
if( p->bHasDocsize ){
|
197041
|
37 |
1 |
if( nArg>1
|
197042
|
37 |
0 |
&& sqlite3_value_type(apVal[0])==SQLITE_NULL
|
197043
|
1 |
36 |
&& sqlite3_value_type(apVal[p->nColumn+2])!=SQLITE_NULL
|
197049
|
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 ){
|
197056
|
0 |
37 |
if( aSzDel==0 ){
|
197064
|
0 |
37 |
if( rc!=SQLITE_OK ) goto update_out;
|
197075
|
36 |
1 |
if( nArg>1 && p->zContentTbl==0 ){
|
|
33 |
3 |
if( nArg>1 && p->zContentTbl==0 ){
|
197078
|
33 |
0 |
if( sqlite3_value_type(pNewRowid)==SQLITE_NULL ){
|
197084
|
0 |
0 |
|| sqlite3_value_int64(apVal[0])!=sqlite3_value_int64(pNewRowid)
|
197103
|
0 |
0 |
if( sqlite3_vtab_on_conflict(p->db)==SQLITE_REPLACE ){
|
197111
|
0 |
37 |
if( rc!=SQLITE_OK ){
|
197116
|
1 |
36 |
if( sqlite3_value_type(apVal[0])!=SQLITE_NULL ){
|
197122
|
36 |
1 |
if( nArg>1 && rc==SQLITE_OK ){
|
|
36 |
0 |
if( nArg>1 && rc==SQLITE_OK ){
|
197124
|
36 |
0 |
if( bInsertDone==0 ){
|
197126
|
0 |
36 |
if( rc==SQLITE_CONSTRAINT && p->zContentTbl==0 ){
|
|
0 |
0 |
if( rc==SQLITE_CONSTRAINT && p->zContentTbl==0 ){
|
197130
|
36 |
0 |
if( rc==SQLITE_OK ){
|
197133
|
36 |
0 |
if( rc==SQLITE_OK ){
|
197137
|
20 |
16 |
if( p->bHasDocsize ){
|
197143
|
21 |
16 |
if( p->bFts4 ){
|
197161
|
0 |
0 |
if( rc==SQLITE_OK ){
|
197163
|
0 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_DONE ){
|
|
0 |
0 |
if( rc==SQLITE_OK || rc==SQLITE_DONE ){
|
197165
|
0 |
0 |
if( rc2!=SQLITE_OK ) rc = rc2;
|
197320
|
0 |
0 |
if( pRet ){
|
197339
|
0 |
0 |
if( (u32*)p==&pBuf->aMatchinfo[1] ){
|
197345
|
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 ){
|
197354
|
0 |
0 |
if( p->aRef[1]==0 ){
|
197359
|
0 |
0 |
else if( p->aRef[2]==0 ){
|
197365
|
0 |
0 |
if( aOut ){
|
197367
|
0 |
0 |
if( p->bGlobal ) memcpy(aOut, &p->aMatchinfo[1], p->nElem*sizeof(u32));
|
197384
|
0 |
189 |
if( p ){
|
197387
|
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 ){
|
197420
|
48 |
16 |
*pp += fts3GetVarint32(*pp, &iVal);
|
197436
|
0 |
32 |
if( eType!=FTSQUERY_PHRASE ){
|
197439
|
0 |
0 |
if( rc==SQLITE_OK && eType!=FTSQUERY_NOT ){
|
|
0 |
0 |
if( rc==SQLITE_OK && eType!=FTSQUERY_NOT ){
|
197505
|
12 |
4 |
if( pnPhrase ) *pnPhrase = sCtx.nPhrase;
|
197506
|
4 |
12 |
if( pnToken ) *pnToken = sCtx.nToken;
|
197528
|
44 |
0 |
if( pIter ){
|
197531
|
44 |
32 |
while( iIter<iNext ){
|
197532
|
12 |
32 |
if( 0==(*pIter & 0xFE) ){
|
197551
|
12 |
28 |
if( pIter->iCurrent<0 ){
|
197561
|
12 |
12 |
for(i=0; i<pIter->nPhrase; i++){
|
197569
|
28 |
28 |
for(i=0; i<pIter->nPhrase; i++){
|
197571
|
16 |
12 |
if( pPhrase->pHead && pPhrase->iHead<iEnd ){
|
|
16 |
0 |
if( pPhrase->pHead && pPhrase->iHead<iEnd ){
|
197575
|
12 |
16 |
if( iEnd==0x7FFFFFFF ){
|
197580
|
16 |
16 |
for(i=0; i<pIter->nPhrase; i++){
|
197608
|
28 |
28 |
for(i=0; i<pIter->nPhrase; i++){
|
197610
|
28 |
0 |
if( pPhrase->pTail ){
|
197614
|
28 |
16 |
while( iCsr<(iStart+pIter->nSnippet) && iCsr>=iStart ){
|
|
28 |
0 |
while( iCsr<(iStart+pIter->nSnippet) && iCsr>=iStart ){
|
197620
|
0 |
28 |
if( (mCover|mCovered)&mPhrase ){
|
197627
|
76 |
28 |
for(j=0; j<pPhrase->nToken; j++){
|
197631
|
12 |
16 |
if( 0==(*pCsr & 0x0FE) ) break;
|
197658
|
12 |
0 |
if( pCsr ){
|
197662
|
0 |
12 |
if( iFirst<0 ){
|
197716
|
0 |
12 |
if( rc!=SQLITE_OK ){
|
197725
|
0 |
12 |
if( !sIter.aPhrase ){
|
197740
|
12 |
0 |
if( rc==SQLITE_OK ){
|
197743
|
12 |
12 |
for(i=0; i<nList; i++){
|
197744
|
12 |
0 |
if( sIter.aPhrase[i].pHead ){
|
197753
|
28 |
12 |
while( !fts3SnippetNextCandidate(&sIter) ){
|
197760
|
12 |
16 |
if( iScore>iBestScore ){
|
197786
|
72 |
260 |
if( nAppend<0 ){
|
197794
|
24 |
308 |
if( pStr->n+nAppend+1>=pStr->nAlloc ){
|
197797
|
0 |
24 |
if( !zNew ){
|
197844
|
12 |
0 |
if( hlmask ){
|
197849
|
20 |
12 |
for(nLeft=0; !(hlmask & ((u64)1 << nLeft)); nLeft++);
|
197850
|
132 |
12 |
for(nRight=0; !(hlmask & ((u64)1 << (nSnippet-1-nRight))); nRight++);
|
197861
|
0 |
12 |
if( nDesired>0 ){
|
197873
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
197876
|
0 |
0 |
while( rc==SQLITE_OK && iCurrent<(nSnippet+nDesired) ){
|
|
0 |
0 |
while( rc==SQLITE_OK && iCurrent<(nSnippet+nDesired) ){
|
197881
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_DONE ){ return rc; }
|
|
0 |
0 |
if( rc!=SQLITE_OK && rc!=SQLITE_DONE ){ return rc; }
|
197885
|
0 |
0 |
if( nShift>0 ){
|
197923
|
0 |
12 |
if( zDoc==0 ){
|
197924
|
0 |
0 |
if( sqlite3_column_type(pCsr->pStmt, iCol)!=SQLITE_NULL ){
|
197934
|
0 |
12 |
if( rc!=SQLITE_OK ){
|
197938
|
148 |
0 |
while( rc==SQLITE_OK ){
|
197957
|
4 |
144 |
if( rc!=SQLITE_OK ){
|
197958
|
4 |
0 |
if( rc==SQLITE_DONE ){
|
197967
|
0 |
144 |
if( iCurrent<iPos ){ continue; }
|
197969
|
12 |
132 |
if( !isShiftDone ){
|
197980
|
12 |
0 |
if( rc==SQLITE_OK ){
|
197981
|
12 |
0 |
if( iPos>0 || iFragment>0 ){
|
|
0 |
12 |
if( iPos>0 || iFragment>0 ){
|
197983
|
0 |
12 |
}else if( iBegin ){
|
197987
|
12 |
0 |
if( rc!=SQLITE_OK || iCurrent<iPos ) continue;
|
|
0 |
12 |
if( rc!=SQLITE_OK || iCurrent<iPos ) continue;
|
197990
|
8 |
136 |
if( iCurrent>=(iPos+nSnippet) ){
|
197991
|
8 |
0 |
if( isLast ){
|
198000
|
124 |
12 |
if( iCurrent>iPos ) rc = fts3StringAppend(pOut, &zDoc[iEnd], iBegin-iEnd);
|
198001
|
136 |
0 |
if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zOpen, -1);
|
|
28 |
108 |
if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zOpen, -1);
|
198002
|
136 |
0 |
if( rc==SQLITE_OK ) rc = fts3StringAppend(pOut, &zDoc[iBegin], iFin-iBegin);
|
198003
|
136 |
0 |
if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zClose, -1);
|
|
28 |
108 |
if( rc==SQLITE_OK && isHighlight ) rc = fts3StringAppend(pOut, zClose, -1);
|
198032
|
0 |
0 |
while( 0xFE & (*pEnd | c) ){
|
198034
|
0 |
0 |
if( !c ) nEntry++;
|
198055
|
0 |
0 |
if( p->flag==FTS3_MATCHINFO_LHITS ){
|
198061
|
0 |
0 |
if( pIter ) while( 1 ){
|
198063
|
0 |
0 |
if( (pPhrase->iColumn>=pTab->nColumn || pPhrase->iColumn==iCol) ){
|
|
0 |
0 |
if( (pPhrase->iColumn>=pTab->nColumn || pPhrase->iColumn==iCol) ){
|
198064
|
0 |
0 |
if( p->flag==FTS3_MATCHINFO_LHITS ){
|
198066
|
0 |
0 |
}else if( nHit ){
|
198071
|
0 |
0 |
if( *pIter!=0x01 ) break;
|
198073
|
0 |
0 |
pIter += fts3GetVarint32(pIter, &iCol);
|
198074
|
0 |
0 |
if( iCol>=p->nCol ) return FTS_CORRUPT_VTAB;
|
198088
|
0 |
0 |
if( pExpr->bEof==0 && pExpr->iDocid==p->pCursor->iPrevId ){
|
|
0 |
0 |
if( pExpr->bEof==0 && pExpr->iDocid==p->pCursor->iPrevId ){
|
198089
|
0 |
0 |
if( pExpr->pLeft ){
|
198091
|
0 |
0 |
if( rc==SQLITE_OK ) rc = fts3ExprLHitGather(pExpr->pRight, p);
|
198152
|
0 |
0 |
for(i=0; i<p->nCol && rc==SQLITE_OK; i++){
|
|
0 |
0 |
for(i=0; i<p->nCol && rc==SQLITE_OK; i++){
|
198155
|
0 |
0 |
if( pCsr ){
|
198170
|
0 |
0 |
if( (cArg==FTS3_MATCHINFO_NPHRASE)
|
198171
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_NCOL)
|
198172
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_NDOC && pTab->bFts4)
|
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_NDOC && pTab->bFts4)
|
198173
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_AVGLENGTH && pTab->bFts4)
|
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_AVGLENGTH && pTab->bFts4)
|
198174
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LENGTH && pTab->bHasDocsize)
|
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LENGTH && pTab->bHasDocsize)
|
198175
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LCS)
|
198176
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_HITS)
|
198177
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LHITS)
|
198178
|
0 |
0 |
|| (cArg==FTS3_MATCHINFO_LHITS_BM)
|
198233
|
0 |
0 |
if( !*ppStmt ){
|
198235
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
198242
|
0 |
0 |
if( a==0 ){
|
198247
|
0 |
0 |
if( nDoc<=0 || a>pEnd ){
|
|
0 |
0 |
if( nDoc<=0 || a>pEnd ){
|
198252
|
0 |
0 |
if( paLen ) *paLen = a;
|
198253
|
0 |
0 |
if( ppEnd ) *ppEnd = pEnd;
|
198297
|
0 |
0 |
if( NEVER(pIter==0) ) return 1;
|
198300
|
0 |
0 |
if( iRead==0 || iRead==1 ){
|
|
0 |
0 |
if( iRead==0 || iRead==1 ){
|
198333
|
0 |
0 |
if( !aIter ) return SQLITE_NOMEM;
|
198336
|
0 |
0 |
for(i=0; i<pInfo->nPhrase; i++){
|
198342
|
0 |
0 |
for(iCol=0; iCol<pInfo->nCol; iCol++){
|
198346
|
0 |
0 |
for(i=0; i<pInfo->nPhrase; i++){
|
198349
|
0 |
0 |
if( rc!=SQLITE_OK ) goto matchinfo_lcs_out;
|
198350
|
0 |
0 |
if( pIt->pRead ){
|
198353
|
0 |
0 |
if( pIt->pRead==0 ){
|
198361
|
0 |
0 |
while( nLive>0 ){
|
198365
|
0 |
0 |
for(i=0; i<pInfo->nPhrase; i++){
|
198367
|
0 |
0 |
if( pIter->pRead==0 ){
|
198371
|
0 |
0 |
if( pAdv==0 || pIter->iPos<pAdv->iPos ){
|
|
0 |
0 |
if( pAdv==0 || pIter->iPos<pAdv->iPos ){
|
198374
|
0 |
0 |
if( nThisLcs==0 || pIter->iPos==pIter[-1].iPos ){
|
|
0 |
0 |
if( nThisLcs==0 || pIter->iPos==pIter[-1].iPos ){
|
198379
|
0 |
0 |
if( nThisLcs>nLcs ) nLcs = nThisLcs;
|
198382
|
0 |
0 |
if( fts3LcsIteratorAdvance(pAdv) ) nLive--;
|
198421
|
0 |
0 |
for(i=0; rc==SQLITE_OK && zArg[i]; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && zArg[i]; i++){
|
198425
|
0 |
0 |
if( bGlobal ) pInfo->aMatchinfo[0] = pInfo->nPhrase;
|
198429
|
0 |
0 |
if( bGlobal ) pInfo->aMatchinfo[0] = pInfo->nCol;
|
198433
|
0 |
0 |
if( bGlobal ){
|
198441
|
0 |
0 |
if( bGlobal ){
|
198447
|
0 |
0 |
if( rc==SQLITE_OK ){
|
198449
|
0 |
0 |
for(iCol=0; iCol<pInfo->nCol; iCol++){
|
198453
|
0 |
0 |
if( a>pEnd ){
|
198467
|
0 |
0 |
if( rc==SQLITE_OK ){
|
198471
|
0 |
0 |
for(iCol=0; iCol<pInfo->nCol; iCol++){
|
198474
|
0 |
0 |
if( a>pEnd ){
|
198487
|
0 |
0 |
if( rc==SQLITE_OK ){
|
198505
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
198506
|
0 |
0 |
if( bGlobal ){
|
198507
|
0 |
0 |
if( pCsr->pDeferred ){
|
198509
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
198513
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
198552
|
0 |
0 |
if( pCsr->pMIBuffer && strcmp(pCsr->pMIBuffer->zMatchinfo, zArg) ){
|
|
0 |
0 |
if( pCsr->pMIBuffer && strcmp(pCsr->pMIBuffer->zMatchinfo, zArg) ){
|
198562
|
0 |
0 |
if( pCsr->pMIBuffer==0 ){
|
198571
|
0 |
0 |
for(i=0; zArg[i]; i++){
|
198573
|
0 |
0 |
if( fts3MatchinfoCheck(pTab, zArg[i], &zErr) ){
|
198583
|
0 |
0 |
if( !pCsr->pMIBuffer ) rc = SQLITE_NOMEM;
|
198589
|
0 |
0 |
if( rc==SQLITE_OK ){
|
198591
|
0 |
0 |
if( xDestroyOut==0 ){
|
198596
|
0 |
0 |
if( rc==SQLITE_OK ){
|
198600
|
0 |
0 |
if( bGlobal ){
|
198605
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
198607
|
0 |
0 |
if( xDestroyOut ) xDestroyOut(aOut);
|
198643
|
0 |
12 |
if( !pCsr->pExpr ){
|
198649
|
0 |
12 |
if( nToken<-64 ) nToken = -64;
|
198650
|
0 |
12 |
if( nToken>+64 ) nToken = +64;
|
198658
|
12 |
0 |
if( nToken>=0 ){
|
198664
|
12 |
12 |
for(iSnip=0; iSnip<nSnippet; iSnip++){
|
198675
|
12 |
12 |
for(iRead=0; iRead<pTab->nColumn; iRead++){
|
198678
|
0 |
12 |
if( iCol>=0 && iRead!=iCol ) continue;
|
|
0 |
0 |
if( iCol>=0 && iRead!=iCol ) continue;
|
198682
|
0 |
12 |
if( rc!=SQLITE_OK ){
|
198685
|
12 |
0 |
if( iS>iBestScore ){
|
198698
|
0 |
12 |
if( mSeen==mCovered || nSnippet==SizeofArray(aSnippet) ) break;
|
|
0 |
0 |
if( mSeen==mCovered || nSnippet==SizeofArray(aSnippet) ) break;
|
198703
|
12 |
12 |
for(i=0; i<nSnippet && rc==SQLITE_OK; i++){
|
|
12 |
0 |
for(i=0; i<nSnippet && rc==SQLITE_OK; i++){
|
198711
|
0 |
12 |
if( rc!=SQLITE_OK ){
|
198751
|
4 |
0 |
if( pList ){
|
198756
|
4 |
4 |
for(iTerm=0; iTerm<nTerm; iTerm++){
|
198781
|
0 |
4 |
if( !pCsr->pExpr ){
|
198791
|
0 |
4 |
if( rc!=SQLITE_OK ) goto offsets_out;
|
198795
|
0 |
4 |
if( 0==sCtx.aTerm ){
|
198805
|
4 |
4 |
for(iCol=0; iCol<pTab->nColumn; iCol++){
|
198823
|
0 |
4 |
if( rc!=SQLITE_OK ) goto offsets_out;
|
198833
|
0 |
4 |
if( zDoc==0 ){
|
198834
|
0 |
0 |
if( sqlite3_column_type(pCsr->pStmt, iCol+1)==SQLITE_NULL ){
|
198845
|
0 |
4 |
if( rc!=SQLITE_OK ) goto offsets_out;
|
198848
|
8 |
4 |
while( rc==SQLITE_OK ){
|
198853
|
8 |
8 |
for(i=0; i<nToken; i++){
|
198855
|
4 |
4 |
if( pT->pList && (pT->iPos-pT->iOff)<iMinPos ){
|
|
4 |
0 |
if( pT->pList && (pT->iPos-pT->iOff)<iMinPos ){
|
198861
|
4 |
4 |
if( !pTerm ){
|
198866
|
4 |
0 |
if( 0==(0xFE&*pTerm->pList) ){
|
198871
|
12 |
0 |
while( rc==SQLITE_OK && iCurrent<iMinPos ){
|
|
8 |
4 |
while( rc==SQLITE_OK && iCurrent<iMinPos ){
|
198874
|
4 |
0 |
if( rc==SQLITE_OK ){
|
198880
|
0 |
0 |
}else if( rc==SQLITE_DONE && pTab->zContentTbl==0 ){
|
|
0 |
0 |
}else if( rc==SQLITE_DONE && pTab->zContentTbl==0 ){
|
198885
|
4 |
0 |
if( rc==SQLITE_DONE ){
|
198890
|
0 |
4 |
if( rc!=SQLITE_OK ) goto offsets_out;
|
198897
|
0 |
4 |
if( rc!=SQLITE_OK ){
|
198917
|
0 |
0 |
if( zArg ){
|
198923
|
0 |
0 |
if( !pCsr->pExpr ){
|
199041
|
0 |
0 |
if( pTokenizer ){
|
199080
|
0 |
0 |
while( z<zTerm ){
|
199081
|
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);
|
199083
|
0 |
0 |
if( sqlite3FtsUnicodeIsalnum((int)iCode)!=bAlnum
|
199084
|
0 |
0 |
&& sqlite3FtsUnicodeIsdiacritic((int)iCode)==0
|
199090
|
0 |
0 |
if( nEntry ){
|
199095
|
0 |
0 |
if( aNew==0 ) return SQLITE_NOMEM;
|
199099
|
0 |
0 |
while( z<zTerm ){
|
199100
|
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);
|
199101
|
0 |
0 |
if( sqlite3FtsUnicodeIsalnum((int)iCode)!=bAlnum
|
199102
|
0 |
0 |
&& sqlite3FtsUnicodeIsdiacritic((int)iCode)==0
|
199105
|
0 |
0 |
for(i=0; i<nNew && aNew[i]<(int)iCode; i++);
|
|
0 |
0 |
for(i=0; i<nNew && aNew[i]<(int)iCode; i++);
|
199106
|
0 |
0 |
for(j=nNew; j>i; j--) aNew[j] = aNew[j-1];
|
199122
|
0 |
0 |
if( p->nException>0 ){
|
199127
|
0 |
0 |
while( iHi>=iLo ){
|
199129
|
0 |
0 |
if( iCode==a[iTest] ){
|
199131
|
0 |
0 |
}else if( iCode>a[iTest] ){
|
199164
|
0 |
0 |
if( pNew==NULL ) return SQLITE_NOMEM;
|
199168
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nArg; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nArg; i++){
|
199172
|
0 |
0 |
if( n==19 && memcmp("remove_diacritics=1", z, 19)==0 ){
|
|
0 |
0 |
if( n==19 && memcmp("remove_diacritics=1", z, 19)==0 ){
|
199175
|
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 ){
|
199178
|
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 ){
|
199181
|
0 |
0 |
else if( n>=11 && memcmp("tokenchars=", z, 11)==0 ){
|
|
0 |
0 |
else if( n>=11 && memcmp("tokenchars=", z, 11)==0 ){
|
199184
|
0 |
0 |
else if( n>=11 && memcmp("separators=", z, 11)==0 ){
|
|
0 |
0 |
else if( n>=11 && memcmp("separators=", z, 11)==0 ){
|
199193
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
199216
|
0 |
0 |
if( pCsr==0 ){
|
199222
|
0 |
0 |
if( aInput==0 ){
|
199225
|
0 |
0 |
}else if( nInput<0 ){
|
199271
|
0 |
0 |
while( z<zTerm ){
|
199272
|
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);
|
199273
|
0 |
0 |
if( unicodeIsAlnum(p, (int)iCode) ) break;
|
199276
|
0 |
0 |
if( zStart>=zTerm ) return SQLITE_DONE;
|
199283
|
0 |
0 |
if( (zOut-pCsr->zToken)>=(pCsr->nAlloc-4) ){
|
199285
|
0 |
0 |
if( !zNew ) return SQLITE_NOMEM;
|
199294
|
0 |
0 |
if( iOut ){
|
199295
|
0 |
0 |
WRITE_UTF8(zOut, iOut);
|
|
0 |
0 |
WRITE_UTF8(zOut, iOut);
|
|
0 |
0 |
WRITE_UTF8(zOut, iOut);
|
199299
|
0 |
0 |
if( z>=zTerm ) break;
|
199300
|
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);
|
199302
|
0 |
0 |
|| sqlite3FtsUnicodeIsdiacritic((int)iCode)
|
199303
|
0 |
0 |
);
|
199466
|
0 |
0 |
if( (unsigned int)c<128 ){
|
199468
|
0 |
0 |
}else if( (unsigned int)c<(1<<22) ){
|
199473
|
0 |
0 |
while( iHi>=iLo ){
|
199475
|
0 |
0 |
if( key >= aEntry[iTest] ){
|
199546
|
0 |
0 |
while( iHi>=iLo ){
|
199548
|
0 |
0 |
if( key >= aDia[iTest] ){
|
199556
|
0 |
0 |
if( bComplex==0 && (aChar[iRes] & 0x80) ) return c;
|
|
0 |
0 |
if( bComplex==0 && (aChar[iRes] & 0x80) ) return c;
|
199557
|
0 |
0 |
return (c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : ((int)aChar[iRes] & 0x7F);
|
199568
|
0 |
0 |
if( c<768 || c>817 ) return 0;
|
|
0 |
0 |
if( c<768 || c>817 ) return 0;
|
199569
|
0 |
0 |
return (c < 768+32) ?
|
199680
|
0 |
0 |
if( c<128 ){
|
199681
|
0 |
0 |
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A');
|
|
0 |
0 |
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A');
|
199682
|
0 |
0 |
}else if( c<65536 ){
|
199689
|
0 |
0 |
while( iHi>=iLo ){
|
199692
|
0 |
0 |
if( cmp>=0 ){
|
199702
|
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)) ){
|
199707
|
0 |
0 |
if( eRemoveDiacritic ){
|
199712
|
0 |
0 |
else if( c>=66560 && c<66600 ){
|
|
0 |
0 |
else if( c>=66560 && c<66600 ){
|
199900
|
0 |
0 |
if( !p->bStatic ) sqlite3_free(p->zBuf);
|
199917
|
0 |
0 |
u64 nTotal = N<p->nAlloc ? p->nAlloc*2 : p->nAlloc+N+10;
|
199919
|
0 |
0 |
if( p->bStatic ){
|
199920
|
0 |
0 |
if( p->bErr ) return 1;
|
199922
|
0 |
0 |
if( zNew==0 ){
|
199931
|
0 |
0 |
if( zNew==0 ){
|
199944
|
0 |
0 |
if( N==0 ) return;
|
199945
|
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;
|
199954
|
0 |
0 |
if( (p->nUsed + N >= p->nAlloc) && jsonGrow(p, N) ) return;
|
|
0 |
0 |
if( (p->nUsed + N >= p->nAlloc) && jsonGrow(p, N) ) return;
|
199964
|
0 |
0 |
if( p->nUsed>=p->nAlloc && jsonGrow(p,1)!=0 ) return;
|
|
0 |
0 |
if( p->nUsed>=p->nAlloc && jsonGrow(p,1)!=0 ) return;
|
199973
|
0 |
0 |
if( p->nUsed==0 ) return;
|
199975
|
0 |
0 |
if( c!='[' && c!='{' ) jsonAppendChar(p, ',');
|
|
0 |
0 |
if( c!='[' && c!='{' ) jsonAppendChar(p, ',');
|
199985
|
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;
|
199987
|
0 |
0 |
for(i=0; i<N; i++){
|
199989
|
0 |
0 |
if( c=='"' || c=='\\' ){
|
|
0 |
0 |
if( c=='"' || c=='\\' ){
|
199991
|
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;
|
199993
|
0 |
0 |
}else if( c<=0x1f ){
|
200004
|
0 |
0 |
if( aSpecial[c] ){
|
200008
|
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;
|
200032
|
0 |
0 |
while( N>0 ){
|
200033
|
0 |
0 |
for(i=0; i<N && zIn[i]!='\\'; i++){}
|
|
0 |
0 |
for(i=0; i<N && zIn[i]!='\\'; i++){}
|
200034
|
0 |
0 |
if( i>0 ){
|
200038
|
0 |
0 |
if( N==0 ) break;
|
200058
|
0 |
0 |
if( zIn[2]=='\n' ){
|
200088
|
0 |
0 |
if( zIn[0]=='+' ){
|
200091
|
0 |
0 |
}else if( zIn[0]=='-' ){
|
200096
|
0 |
0 |
if( zIn[0]=='0' && (zIn[1]=='x' || zIn[1]=='X') ){
|
|
0 |
0 |
if( zIn[0]=='0' && (zIn[1]=='x' || zIn[1]=='X') ){
|
|
0 |
0 |
if( zIn[0]=='0' && (zIn[1]=='x' || zIn[1]=='X') ){
|
200099
|
0 |
0 |
if( rc<=1 ){
|
200117
|
0 |
0 |
if( zIn[0]=='+' ){
|
200120
|
0 |
0 |
}else if( zIn[0]=='-' ){
|
200125
|
0 |
0 |
if( zIn[0]=='.' ){
|
200128
|
0 |
0 |
for(i=0; i<N; i++){
|
200129
|
0 |
0 |
if( zIn[i]=='.' && (i+1==N || !sqlite3Isdigit(zIn[i+1])) ){
|
|
0 |
0 |
if( zIn[i]=='.' && (i+1==N || !sqlite3Isdigit(zIn[i+1])) ){
|
|
0 |
0 |
if( zIn[i]=='.' && (i+1==N || !sqlite3Isdigit(zIn[i+1])) ){
|
200138
|
0 |
0 |
if( N>0 ){
|
200171
|
0 |
0 |
if( sqlite3_value_subtype(pValue)==JSON_SUBTYPE ){
|
200179
|
0 |
0 |
if( p->bErr==0 ){
|
200193
|
0 |
0 |
if( p->bErr==0 ){
|
200194
|
0 |
0 |
sqlite3_result_text64(p->pCtx, p->zBuf, p->nUsed,
|
200216
|
0 |
0 |
return pNode->eType>=JSON_ARRAY ? pNode->n+1 : 1;
|
200251
|
0 |
0 |
if( pNode->jnFlags & (JNODE_REPLACE|JNODE_PATCH) ){
|
200252
|
0 |
0 |
if( (pNode->jnFlags & JNODE_REPLACE)!=0 && ALWAYS(aReplace!=0) ){
|
|
0 |
0 |
if( (pNode->jnFlags & JNODE_REPLACE)!=0 && ALWAYS(aReplace!=0) ){
|
200276
|
0 |
0 |
if( pNode->jnFlags & JNODE_RAW ){
|
200277
|
0 |
0 |
if( pNode->jnFlags & JNODE_LABEL ){
|
200284
|
0 |
0 |
}else if( pNode->jnFlags & JNODE_JSON5 ){
|
200293
|
0 |
0 |
if( pNode->jnFlags & JNODE_JSON5 ){
|
200302
|
0 |
0 |
if( pNode->jnFlags & JNODE_JSON5 ){
|
200313
|
0 |
0 |
while( j<=pNode->n ){
|
200314
|
0 |
0 |
if( (pNode[j].jnFlags & JNODE_REMOVE)==0 ){
|
200320
|
0 |
0 |
if( (pNode->jnFlags & JNODE_APPEND)==0 ) break;
|
200332
|
0 |
0 |
while( j<=pNode->n ){
|
200333
|
0 |
0 |
if( (pNode[j+1].jnFlags & JNODE_REMOVE)==0 ){
|
200341
|
0 |
0 |
if( (pNode->jnFlags & JNODE_APPEND)==0 ) break;
|
200429
|
0 |
0 |
if( z[0]=='-' ){ z++; bNeg = 1; }
|
200430
|
0 |
0 |
else if( z[0]=='+' ){ z++; }
|
200432
|
0 |
0 |
if( rc<=1 ){
|
200433
|
0 |
0 |
sqlite3_result_int64(pCtx, bNeg ? -i : i);
|
200434
|
0 |
0 |
}else if( rc==3 && bNeg ){
|
|
0 |
0 |
}else if( rc==3 && bNeg ){
|
200452
|
0 |
0 |
if( pNode->jnFlags & JNODE_RAW ){
|
200456
|
0 |
0 |
}else if( (pNode->jnFlags & JNODE_ESCAPE)==0 ){
|
200472
|
0 |
0 |
if( zOut==0 ){
|
200476
|
0 |
0 |
for(i=1, j=0; i<n-1; i++){
|
200478
|
0 |
0 |
if( c=='\\' ){
|
200480
|
0 |
0 |
if( c=='u' ){
|
200483
|
0 |
0 |
if( v==0 ) break;
|
200484
|
0 |
0 |
if( v<=0x7f ){
|
200486
|
0 |
0 |
}else if( v<=0x7ff ){
|
200491
|
0 |
0 |
if( (v&0xfc00)==0xd800
|
200492
|
0 |
0 |
&& i<n-6
|
200493
|
0 |
0 |
&& z[i+1]=='\\'
|
200494
|
0 |
0 |
&& z[i+2]=='u'
|
200495
|
0 |
0 |
&& ((vlo = jsonHexToInt4(z+i+3))&0xfc00)==0xdc00
|
200511
|
0 |
0 |
}else if( c=='b' ){
|
200513
|
0 |
0 |
}else if( c=='f' ){
|
200515
|
0 |
0 |
}else if( c=='n' ){
|
200517
|
0 |
0 |
}else if( c=='r' ){
|
200519
|
0 |
0 |
}else if( c=='t' ){
|
200521
|
0 |
0 |
}else if( c=='v' ){
|
200523
|
0 |
0 |
}else if( c=='\'' || c=='"' || c=='/' || c=='\\' ){
|
|
0 |
0 |
}else if( c=='\'' || c=='"' || c=='/' || c=='\\' ){
|
|
0 |
0 |
}else if( c=='\'' || c=='"' || c=='/' || c=='\\' ){
|
|
0 |
0 |
}else if( c=='\'' || c=='"' || c=='/' || c=='\\' ){
|
200525
|
0 |
0 |
}else if( c=='0' ){
|
200527
|
0 |
0 |
}else if( c=='x' ){
|
200530
|
0 |
0 |
}else if( c=='\r' && z[i+1]=='\n' ){
|
|
0 |
0 |
}else if( c=='\r' && z[i+1]=='\n' ){
|
200533
|
0 |
0 |
}else if( 0xe2==(u8)c ){
|
200582
|
0 |
0 |
if( pParse->oom ) return -1;
|
200585
|
0 |
0 |
if( pNew==0 ){
|
200607
|
0 |
0 |
if( pParse->aNode==0 || pParse->nNode>=pParse->nAlloc ){
|
|
0 |
0 |
if( pParse->aNode==0 || pParse->nNode>=pParse->nAlloc ){
|
200623
|
0 |
0 |
return sqlite3Isxdigit(z[0]) && sqlite3Isxdigit(z[1]);
|
|
0 |
0 |
return sqlite3Isxdigit(z[0]) && sqlite3Isxdigit(z[1]);
|
200630
|
0 |
0 |
return jsonIs2Hex(z) && jsonIs2Hex(&z[2]);
|
|
0 |
0 |
return jsonIs2Hex(z) && jsonIs2Hex(&z[2]);
|
200684
|
0 |
0 |
if( z[n+1]=='*' && z[n+2]!=0 ){
|
|
0 |
0 |
if( z[n+1]=='*' && z[n+2]!=0 ){
|
200686
|
0 |
0 |
for(j=n+3; z[j]!='/' || z[j-1]!='*'; j++){
|
|
0 |
0 |
for(j=n+3; z[j]!='/' || z[j-1]!='*'; j++){
|
200687
|
0 |
0 |
if( z[j]==0 ) goto whitespace_done;
|
200691
|
0 |
0 |
}else if( z[n+1]=='/' ){
|
200694
|
0 |
0 |
for(j=n+2; (c = z[j])!=0; j++){
|
200695
|
0 |
0 |
if( c=='\n' || c=='\r' ) break;
|
|
0 |
0 |
if( c=='\n' || c=='\r' ) break;
|
200696
|
0 |
0 |
if( 0xe2==(u8)c && 0x80==(u8)z[j+1]
|
|
0 |
0 |
if( 0xe2==(u8)c && 0x80==(u8)z[j+1]
|
200697
|
0 |
0 |
&& (0xa8==(u8)z[j+2] || 0xa9==(u8)z[j+2])
|
|
0 |
0 |
&& (0xa8==(u8)z[j+2] || 0xa9==(u8)z[j+2])
|
200704
|
0 |
0 |
if( z[n] ) n++;
|
200710
|
0 |
0 |
if( z[n+1]==0xa0 ){
|
200717
|
0 |
0 |
if( z[n+1]==0x9a && z[n+2]==0x80 ){
|
|
0 |
0 |
if( z[n+1]==0x9a && z[n+2]==0x80 ){
|
200724
|
0 |
0 |
if( z[n+1]==0x80 ){
|
200726
|
0 |
0 |
if( c<0x80 ) goto whitespace_done;
|
200727
|
0 |
0 |
if( c<=0x8a || c==0xa8 || c==0xa9 || c==0xaf ){
|
|
0 |
0 |
if( c<=0x8a || c==0xa8 || c==0xa9 || c==0xaf ){
|
|
0 |
0 |
if( c<=0x8a || c==0xa8 || c==0xa9 || c==0xaf ){
|
|
0 |
0 |
if( c<=0x8a || c==0xa8 || c==0xa9 || c==0xaf ){
|
200731
|
0 |
0 |
}else if( z[n+1]==0x81 && z[n+2]==0x9f ){
|
|
0 |
0 |
}else if( z[n+1]==0x81 && z[n+2]==0x9f ){
|
200738
|
0 |
0 |
if( z[n+1]==0x80 && z[n+2]==0x80 ){
|
|
0 |
0 |
if( z[n+1]==0x80 && z[n+2]==0x80 ){
|
200745
|
0 |
0 |
if( z[n+1]==0xbb && z[n+2]==0xbf ){
|
|
0 |
0 |
if( z[n+1]==0xbb && z[n+2]==0xbf ){
|
200804
|
0 |
0 |
if( iThis<0 ) return -1;
|
200805
|
0 |
0 |
if( ++pParse->iDepth > JSON_MAX_DEPTH ){
|
200812
|
0 |
0 |
if( x<=0 ){
|
200813
|
0 |
0 |
if( x==(-2) ){
|
200815
|
0 |
0 |
if( pParse->nNode!=(u32)iThis+1 ) pParse->hasNonstd = 1;
|
200819
|
0 |
0 |
if( sqlite3JsonId1(z[j])
|
200820
|
0 |
0 |
|| (z[j]=='\\' && z[j+1]=='u' && jsonIs4Hex(&z[j+2]))
|
|
0 |
0 |
|| (z[j]=='\\' && z[j+1]=='u' && jsonIs4Hex(&z[j+2]))
|
|
0 |
0 |
|| (z[j]=='\\' && z[j+1]=='u' && jsonIs4Hex(&z[j+2]))
|
200823
|
0 |
0 |
while( (sqlite3JsonId2(z[k]) && json5Whitespace(&z[k])==0)
|
|
0 |
0 |
while( (sqlite3JsonId2(z[k]) && json5Whitespace(&z[k])==0)
|
200824
|
0 |
0 |
|| (z[k]=='\\' && z[k+1]=='u' && jsonIs4Hex(&z[k+2]))
|
|
0 |
0 |
|| (z[k]=='\\' && z[k+1]=='u' && jsonIs4Hex(&z[k+2]))
|
|
0 |
0 |
|| (z[k]=='\\' && z[k+1]=='u' && jsonIs4Hex(&z[k+2]))
|
200832
|
0 |
0 |
if( x!=-1 ) pParse->iErr = j;
|
200836
|
0 |
0 |
if( pParse->oom ) return -1;
|
200838
|
0 |
0 |
if( pNode->eType!=JSON_STRING ){
|
200844
|
0 |
0 |
if( z[j]==':' ){
|
200847
|
0 |
0 |
if( fast_isspace(z[j]) ){
|
200848
|
0 |
0 |
do{ j++; }while( fast_isspace(z[j]) );
|
200849
|
0 |
0 |
if( z[j]==':' ){
|
200855
|
0 |
0 |
if( x!=(-5) ){
|
200856
|
0 |
0 |
if( x!=(-1) ) pParse->iErr = j;
|
200863
|
0 |
0 |
if( x<=0 ){
|
200864
|
0 |
0 |
if( x!=(-1) ) pParse->iErr = j;
|
200868
|
0 |
0 |
if( z[j]==',' ){
|
200870
|
0 |
0 |
}else if( z[j]=='}' ){
|
200873
|
0 |
0 |
if( fast_isspace(z[j]) ){
|
200874
|
0 |
0 |
do{ j++; }while( fast_isspace(z[j]) );
|
200875
|
0 |
0 |
if( z[j]==',' ){
|
200877
|
0 |
0 |
}else if( z[j]=='}' ){
|
200882
|
0 |
0 |
if( x==(-4) ){
|
200886
|
0 |
0 |
if( x==(-2) ){
|
200901
|
0 |
0 |
if( iThis<0 ) return -1;
|
200902
|
0 |
0 |
if( ++pParse->iDepth > JSON_MAX_DEPTH ){
|
200909
|
0 |
0 |
if( x<=0 ){
|
200910
|
0 |
0 |
if( x==(-3) ){
|
200912
|
0 |
0 |
if( pParse->nNode!=(u32)iThis+1 ) pParse->hasNonstd = 1;
|
200915
|
0 |
0 |
if( x!=(-1) ) pParse->iErr = j;
|
200919
|
0 |
0 |
if( z[j]==',' ){
|
200921
|
0 |
0 |
}else if( z[j]==']' ){
|
200924
|
0 |
0 |
if( fast_isspace(z[j]) ){
|
200925
|
0 |
0 |
do{ j++; }while( fast_isspace(z[j]) );
|
200926
|
0 |
0 |
if( z[j]==',' ){
|
200928
|
0 |
0 |
}else if( z[j]==']' ){
|
200933
|
0 |
0 |
if( x==(-4) ){
|
200937
|
0 |
0 |
if( x==(-3) ){
|
200963
|
0 |
0 |
if( (c & ~0x1f)==0 ){
|
200968
|
0 |
0 |
if( c=='\\' ){
|
200970
|
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'
|
200971
|
0 |
0 |
|| c=='n' || c=='r' || c=='t'
|
|
0 |
0 |
|| c=='n' || c=='r' || c=='t'
|
|
0 |
0 |
|| c=='n' || c=='r' || c=='t'
|
200972
|
0 |
0 |
|| (c=='u' && jsonIs4Hex(&z[j+1])) ){
|
|
0 |
0 |
|| (c=='u' && jsonIs4Hex(&z[j+1])) ){
|
200974
|
0 |
0 |
}else if( c=='\'' || c=='0' || c=='v' || c=='\n'
|
|
0 |
0 |
}else if( c=='\'' || c=='0' || c=='v' || c=='\n'
|
|
0 |
0 |
}else if( c=='\'' || c=='0' || c=='v' || c=='\n'
|
|
0 |
0 |
}else if( c=='\'' || c=='0' || c=='v' || c=='\n'
|
200975
|
0 |
0 |
|| (0xe2==(u8)c && 0x80==(u8)z[j+1]
|
|
0 |
0 |
|| (0xe2==(u8)c && 0x80==(u8)z[j+1]
|
200976
|
0 |
0 |
&& (0xa8==(u8)z[j+2] || 0xa9==(u8)z[j+2]))
|
|
0 |
0 |
&& (0xa8==(u8)z[j+2] || 0xa9==(u8)z[j+2]))
|
200977
|
0 |
0 |
|| (c=='x' && jsonIs2Hex(&z[j+1])) ){
|
|
0 |
0 |
|| (c=='x' && jsonIs2Hex(&z[j+1])) ){
|
200980
|
0 |
0 |
}else if( c=='\r' ){
|
200981
|
0 |
0 |
if( z[j+1]=='\n' ) j++;
|
200988
|
0 |
0 |
}else if( c==cDelim ){
|
200997
|
0 |
0 |
if( strncmp(z+i,"true",4)==0 && !sqlite3Isalnum(z[i+4]) ){
|
|
0 |
0 |
if( strncmp(z+i,"true",4)==0 && !sqlite3Isalnum(z[i+4]) ){
|
201005
|
0 |
0 |
if( strncmp(z+i,"false",5)==0 && !sqlite3Isalnum(z[i+5]) ){
|
|
0 |
0 |
if( strncmp(z+i,"false",5)==0 && !sqlite3Isalnum(z[i+5]) ){
|
201018
|
0 |
0 |
if( sqlite3Isdigit(z[i+1]) ){
|
201048
|
0 |
0 |
if( c<='0' ){
|
201049
|
0 |
0 |
if( c=='0' ){
|
201050
|
0 |
0 |
if( (z[i+1]=='x' || z[i+1]=='X') && sqlite3Isxdigit(z[i+2]) ){
|
|
0 |
0 |
if( (z[i+1]=='x' || z[i+1]=='X') && sqlite3Isxdigit(z[i+2]) ){
|
|
0 |
0 |
if( (z[i+1]=='x' || z[i+1]=='X') && sqlite3Isxdigit(z[i+2]) ){
|
201054
|
0 |
0 |
for(j=i+3; sqlite3Isxdigit(z[j]); j++){}
|
201056
|
0 |
0 |
}else if( sqlite3Isdigit(z[i+1]) ){
|
201061
|
0 |
0 |
if( !sqlite3Isdigit(z[i+1]) ){
|
201065
|
0 |
0 |
if( (z[i+1]=='I' || z[i+1]=='i')
|
|
0 |
0 |
if( (z[i+1]=='I' || z[i+1]=='i')
|
201066
|
0 |
0 |
&& sqlite3StrNICmp(&z[i+1], "inf",3)==0
|
201069
|
0 |
0 |
if( z[i]=='-' ){
|
201074
|
0 |
0 |
return i + (sqlite3StrNICmp(&z[i+4],"inity",5)==0 ? 9 : 4);
|
201076
|
0 |
0 |
if( z[i+1]=='.' ){
|
201084
|
0 |
0 |
if( z[i+1]=='0' ){
|
201085
|
0 |
0 |
if( sqlite3Isdigit(z[i+2]) ){
|
201088
|
0 |
0 |
}else if( (z[i+2]=='x' || z[i+2]=='X') && sqlite3Isxdigit(z[i+3]) ){
|
|
0 |
0 |
}else if( (z[i+2]=='x' || z[i+2]=='X') && sqlite3Isxdigit(z[i+3]) ){
|
|
0 |
0 |
}else if( (z[i+2]=='x' || z[i+2]=='X') && sqlite3Isxdigit(z[i+3]) ){
|
201091
|
0 |
0 |
for(j=i+4; sqlite3Isxdigit(z[j]); j++){}
|
201100
|
0 |
0 |
if( sqlite3Isdigit(c) ) continue;
|
201101
|
0 |
0 |
if( c=='.' ){
|
201102
|
0 |
0 |
if( seenDP==JSON_REAL ){
|
201109
|
0 |
0 |
if( c=='e' || c=='E' ){
|
|
0 |
0 |
if( c=='e' || c=='E' ){
|
201110
|
0 |
0 |
if( z[j-1]<'0' ){
|
201111
|
0 |
0 |
if( ALWAYS(z[j-1]=='.') && ALWAYS(j-2>=i) && sqlite3Isdigit(z[j-2]) ){
|
|
0 |
0 |
if( ALWAYS(z[j-1]=='.') && ALWAYS(j-2>=i) && sqlite3Isdigit(z[j-2]) ){
|
|
0 |
0 |
if( ALWAYS(z[j-1]=='.') && ALWAYS(j-2>=i) && sqlite3Isdigit(z[j-2]) ){
|
201119
|
0 |
0 |
if( seenE ){
|
201126
|
0 |
0 |
if( c=='+' || c=='-' ){
|
|
0 |
0 |
if( c=='+' || c=='-' ){
|
201130
|
0 |
0 |
if( c<'0' || c>'9' ){
|
|
0 |
0 |
if( c<'0' || c>'9' ){
|
201138
|
0 |
0 |
if( z[j-1]<'0' ){
|
201139
|
0 |
0 |
if( ALWAYS(z[j-1]=='.') && ALWAYS(j-2>=i) && sqlite3Isdigit(z[j-2]) ){
|
|
0 |
0 |
if( ALWAYS(z[j-1]=='.') && ALWAYS(j-2>=i) && sqlite3Isdigit(z[j-2]) ){
|
|
0 |
0 |
if( ALWAYS(z[j-1]=='.') && ALWAYS(j-2>=i) && sqlite3Isdigit(z[j-2]) ){
|
201176
|
0 |
0 |
}while( fast_isspace(z[i]) );
|
201188
|
0 |
0 |
if( j>0 ){
|
201197
|
0 |
0 |
if( strncmp(z+i,"null",4)==0 && !sqlite3Isalnum(z[i+4]) ){
|
|
0 |
0 |
if( strncmp(z+i,"null",4)==0 && !sqlite3Isalnum(z[i+4]) ){
|
201207
|
0 |
0 |
for(k=0; k<sizeof(aNanInfName)/sizeof(aNanInfName[0]); k++){
|
201208
|
0 |
0 |
if( c!=aNanInfName[k].c1 && c!=aNanInfName[k].c2 ) continue;
|
|
0 |
0 |
if( c!=aNanInfName[k].c1 && c!=aNanInfName[k].c2 ) continue;
|
201210
|
0 |
0 |
if( sqlite3StrNICmp(&z[i], aNanInfName[k].zMatch, nn)!=0 ){
|
201213
|
0 |
0 |
if( sqlite3Isalnum(z[i+nn]) ) continue;
|
201239
|
0 |
0 |
if( zJson==0 ) return 1;
|
201242
|
0 |
0 |
if( pParse->oom ) i = -1;
|
201243
|
0 |
0 |
if( i>0 ){
|
201245
|
0 |
0 |
while( fast_isspace(zJson[i]) ) i++;
|
201246
|
0 |
0 |
if( zJson[i] ){
|
201248
|
0 |
0 |
if( zJson[i] ){
|
201255
|
0 |
0 |
if( i<=0 ){
|
201256
|
0 |
0 |
if( pCtx!=0 ){
|
201257
|
0 |
0 |
if( pParse->oom ){
|
201278
|
0 |
0 |
for(j=1; j<=pNode->n; j += jsonNodeSize(pNode+j)){
|
201284
|
0 |
0 |
for(j=1; j<=pNode->n; j += jsonNodeSize(pNode+j+1)+1){
|
201303
|
0 |
0 |
if( aUp==0 ){
|
201347
|
0 |
0 |
if( zJson==0 ) return 0;
|
201348
|
0 |
0 |
for(iKey=0; iKey<JSON_CACHE_SZ; iKey++){
|
201350
|
0 |
0 |
if( p==0 ){
|
201354
|
0 |
0 |
if( pMatch==0
|
201355
|
0 |
0 |
&& p->nJson==nJson
|
201356
|
0 |
0 |
&& memcmp(p->zJson,zJson,nJson)==0
|
201360
|
0 |
0 |
}else if( p->iHold<iMinHold ){
|
201364
|
0 |
0 |
if( p->iHold>iMaxHold ){
|
201368
|
0 |
0 |
if( pMatch ){
|
201374
|
0 |
0 |
if( p==0 ){
|
201381
|
0 |
0 |
if( jsonParse(p, pErrCtx, p->zJson) ){
|
201382
|
0 |
0 |
if( pErrCtx==0 ){
|
201402
|
0 |
0 |
if( pNode->jnFlags & JNODE_RAW ){
|
201403
|
0 |
0 |
if( pNode->n!=nKey ) return 0;
|
201406
|
0 |
0 |
if( pNode->n!=nKey+2 ) return 0;
|
201411
|
0 |
0 |
if( p1->jnFlags & JNODE_RAW ){
|
201413
|
0 |
0 |
}else if( p2->jnFlags & JNODE_RAW ){
|
201416
|
0 |
0 |
return p1->n==p2->n && strncmp(p1->u.zJContent,p2->u.zJContent,p1->n)==0;
|
|
0 |
0 |
return p1->n==p2->n && strncmp(p1->u.zJContent,p2->u.zJContent,p1->n)==0;
|
201442
|
0 |
0 |
if( zPath[0]==0 ) return pRoot;
|
201443
|
0 |
0 |
if( pRoot->jnFlags & JNODE_REPLACE ) return 0;
|
201444
|
0 |
0 |
if( zPath[0]=='.' ){
|
201445
|
0 |
0 |
if( pRoot->eType!=JSON_OBJECT ) return 0;
|
201447
|
0 |
0 |
if( zPath[0]=='"' ){
|
201449
|
0 |
0 |
for(i=1; zPath[i] && zPath[i]!='"'; i++){}
|
|
0 |
0 |
for(i=1; zPath[i] && zPath[i]!='"'; i++){}
|
201451
|
0 |
0 |
if( zPath[i] ){
|
201460
|
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++){}
|
201462
|
0 |
0 |
if( nKey==0 ){
|
201469
|
0 |
0 |
while( j<=pRoot->n ){
|
201470
|
0 |
0 |
if( jsonLabelCompare(pRoot+j, zKey, nKey) ){
|
201476
|
0 |
0 |
if( (pRoot->jnFlags & JNODE_APPEND)==0 ) break;
|
201482
|
0 |
0 |
if( pApnd ){
|
201489
|
0 |
0 |
if( pParse->oom ) return 0;
|
201490
|
0 |
0 |
if( pNode ){
|
201500
|
0 |
0 |
}else if( zPath[0]=='[' ){
|
201503
|
0 |
0 |
while( sqlite3Isdigit(zPath[j]) ){
|
201507
|
0 |
0 |
if( j<2 || zPath[j]!=']' ){
|
|
0 |
0 |
if( j<2 || zPath[j]!=']' ){
|
201508
|
0 |
0 |
if( zPath[1]=='#' ){
|
201511
|
0 |
0 |
if( pRoot->eType!=JSON_ARRAY ) return 0;
|
201513
|
0 |
0 |
while( j<=pBase->n ){
|
201514
|
0 |
0 |
if( (pBase[j].jnFlags & JNODE_REMOVE)==0 ) i++;
|
201517
|
0 |
0 |
if( (pBase->jnFlags & JNODE_APPEND)==0 ) break;
|
201524
|
0 |
0 |
if( zPath[2]=='-' && sqlite3Isdigit(zPath[3]) ){
|
|
0 |
0 |
if( zPath[2]=='-' && sqlite3Isdigit(zPath[3]) ){
|
201530
|
0 |
0 |
}while( sqlite3Isdigit(zPath[j]) );
|
201531
|
0 |
0 |
if( x>i ) return 0;
|
201534
|
0 |
0 |
if( zPath[j]!=']' ){
|
201543
|
0 |
0 |
if( pRoot->eType!=JSON_ARRAY ) return 0;
|
201547
|
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) ){
|
201548
|
0 |
0 |
if( (pRoot[j].jnFlags & JNODE_REMOVE)==0 ) i--;
|
201551
|
0 |
0 |
if( (pRoot->jnFlags & JNODE_APPEND)==0 ) break;
|
201557
|
0 |
0 |
if( j<=pRoot->n ){
|
201560
|
0 |
0 |
if( i==0 && pApnd ){
|
|
0 |
0 |
if( i==0 && pApnd ){
|
201565
|
0 |
0 |
if( pParse->oom ) return 0;
|
201566
|
0 |
0 |
if( pNode ){
|
201592
|
0 |
0 |
if( zPath[0]==0 ){
|
201594
|
0 |
0 |
return pParse->oom ? 0 : &pParse->aNode[pParse->nNode-1];
|
201596
|
0 |
0 |
if( zPath[0]=='.' ){
|
201598
|
0 |
0 |
}else if( strncmp(zPath,"[0]",3)==0 ){
|
201603
|
0 |
0 |
if( pParse->oom ) return 0;
|
201635
|
0 |
0 |
if( zPath==0 ) return 0;
|
201636
|
0 |
0 |
if( zPath[0]!='$' ){
|
201642
|
0 |
0 |
if( zErr==0 ) return pNode;
|
201648
|
0 |
0 |
if( zMsg ){
|
201679
|
0 |
0 |
for(i=2; i<=n; i += jsonNodeSize(&pNode[i])+1){
|
201793
|
0 |
0 |
for(i=0; i<argc; i++){
|
201821
|
0 |
0 |
if( p==0 ) return;
|
201823
|
0 |
0 |
if( argc==2 ){
|
201829
|
0 |
0 |
if( pNode==0 ){
|
201832
|
0 |
0 |
if( pNode->eType==JSON_ARRAY ){
|
201834
|
0 |
0 |
for(i=1; i<=pNode->n; n++){
|
201881
|
0 |
0 |
if( argc<2 ) return;
|
201883
|
0 |
0 |
if( p==0 ) return;
|
201884
|
0 |
0 |
if( argc==2 ){
|
201887
|
0 |
0 |
if( zPath==0 ) return;
|
201888
|
0 |
0 |
if( flags & JSON_ABPATH ){
|
201889
|
0 |
0 |
if( zPath[0]!='$' || (zPath[1]!='.' && zPath[1]!='[' && zPath[1]!=0) ){
|
|
0 |
0 |
if( zPath[0]!='$' || (zPath[1]!='.' && zPath[1]!='[' && zPath[1]!=0) ){
|
|
0 |
0 |
if( zPath[0]!='$' || (zPath[1]!='.' && zPath[1]!='[' && zPath[1]!=0) ){
|
|
0 |
0 |
if( zPath[0]!='$' || (zPath[1]!='.' && zPath[1]!='[' && zPath[1]!=0) ){
|
201899
|
0 |
0 |
if( sqlite3Isdigit(zPath[0]) ){
|
201904
|
0 |
0 |
jsonAppendRaw(&jx, "$.", 1 + (zPath[0]!='['));
|
201908
|
0 |
0 |
pNode = jx.bErr ? 0 : jsonLookup(p, jx.zBuf, 0, ctx);
|
201913
|
0 |
0 |
if( pNode ){
|
201914
|
0 |
0 |
if( flags & JSON_JSON ){
|
201923
|
0 |
0 |
if( p->nErr==0 && pNode ) jsonReturn(pNode, ctx, 0);
|
|
0 |
0 |
if( p->nErr==0 && pNode ) jsonReturn(pNode, ctx, 0);
|
201931
|
0 |
0 |
for(i=1; i<argc; i++){
|
201934
|
0 |
0 |
if( p->nErr ) break;
|
201936
|
0 |
0 |
if( pNode ){
|
201942
|
0 |
0 |
if( i==argc ){
|
201961
|
0 |
0 |
if( pPatch->eType!=JSON_OBJECT ){
|
201967
|
0 |
0 |
if( pTarget->eType!=JSON_OBJECT ){
|
201972
|
0 |
0 |
for(i=1; i<pPatch->n; i += jsonNodeSize(&pPatch[i+1])+1){
|
201980
|
0 |
0 |
for(j=1; j<pTarget->n; j += jsonNodeSize(&pTarget[j+1])+1 ){
|
201983
|
0 |
0 |
if( jsonSameLabel(&pPatch[i], &pTarget[j]) ){
|
201984
|
0 |
0 |
if( pTarget[j+1].jnFlags & (JNODE_REMOVE|JNODE_PATCH) ) break;
|
201985
|
0 |
0 |
if( pPatch[i+1].eType==JSON_NULL ){
|
201989
|
0 |
0 |
if( pNew==0 ) return 0;
|
201991
|
0 |
0 |
if( pNew!=&pTarget[j+1] ){
|
202005
|
0 |
0 |
if( j>=pTarget->n && pPatch[i+1].eType!=JSON_NULL ){
|
|
0 |
0 |
if( j>=pTarget->n && pPatch[i+1].eType!=JSON_NULL ){
|
202010
|
0 |
0 |
if( pParse->oom ) return 0;
|
202043
|
0 |
0 |
if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return;
|
202044
|
0 |
0 |
if( jsonParse(&y, ctx, (const char*)sqlite3_value_text(argv[1])) ){
|
202050
|
0 |
0 |
if( pResult ){
|
202075
|
0 |
0 |
if( argc&1 ){
|
202082
|
0 |
0 |
for(i=0; i<argc; i+=2){
|
202083
|
0 |
0 |
if( sqlite3_value_type(argv[i])!=SQLITE_TEXT ){
|
202117
|
0 |
0 |
if( argc<1 ) return;
|
202118
|
0 |
0 |
if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return;
|
202120
|
0 |
0 |
for(i=1; i<(u32)argc; i++){
|
202122
|
0 |
0 |
if( zPath==0 ) goto remove_done;
|
202124
|
0 |
0 |
if( x.nErr ) goto remove_done;
|
202125
|
0 |
0 |
if( pNode ) pNode->jnFlags |= JNODE_REMOVE;
|
202127
|
0 |
0 |
if( (x.aNode[0].jnFlags & JNODE_REMOVE)==0 ){
|
202150
|
0 |
0 |
if( argc<1 ) return;
|
202151
|
0 |
0 |
if( (argc&1)==0 ) {
|
202155
|
0 |
0 |
if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return;
|
202157
|
0 |
0 |
for(i=1; i<(u32)argc; i+=2){
|
202160
|
0 |
0 |
if( x.nErr ) goto replace_err;
|
202161
|
0 |
0 |
if( pNode ){
|
202169
|
0 |
0 |
if( x.aNode[0].jnFlags & JNODE_REPLACE ){
|
202204
|
0 |
0 |
if( argc<1 ) return;
|
202205
|
0 |
0 |
if( (argc&1)==0 ) {
|
202206
|
0 |
0 |
jsonWrongNumArgs(ctx, bIsSet ? "set" : "insert");
|
202209
|
0 |
0 |
if( jsonParse(&x, ctx, (const char*)sqlite3_value_text(argv[0])) ) return;
|
202211
|
0 |
0 |
for(i=1; i<(u32)argc; i+=2){
|
202215
|
0 |
0 |
if( x.oom ){
|
202218
|
0 |
0 |
}else if( x.nErr ){
|
202220
|
0 |
0 |
}else if( pNode && (bApnd || bIsSet) ){
|
|
0 |
0 |
}else if( pNode && (bApnd || bIsSet) ){
|
|
0 |
0 |
}else if( pNode && (bApnd || bIsSet) ){
|
202228
|
0 |
0 |
if( x.aNode[0].jnFlags & JNODE_REPLACE ){
|
202255
|
0 |
0 |
if( p==0 ) return;
|
202256
|
0 |
0 |
if( argc==2 ){
|
202262
|
0 |
0 |
if( pNode ){
|
202280
|
0 |
0 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
|
202282
|
0 |
0 |
if( p==0 || p->oom ){
|
|
0 |
0 |
if( p==0 || p->oom ){
|
202286
|
0 |
0 |
sqlite3_result_int(ctx, p->nErr==0 && p->hasNonstd==0);
|
|
0 |
0 |
sqlite3_result_int(ctx, p->nErr==0 && p->hasNonstd==0);
|
202287
|
0 |
0 |
if( p->nErr ) jsonParseFree(p);
|
202326
|
0 |
0 |
if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return;
|
202328
|
0 |
0 |
if( p==0 || p->oom ){
|
|
0 |
0 |
if( p==0 || p->oom ){
|
202331
|
0 |
0 |
}else if( p->nErr==0 ){
|
202337
|
0 |
0 |
for(i=0; i<p->iErr && ALWAYS(z[i]); i++){
|
|
0 |
0 |
for(i=0; i<p->iErr && ALWAYS(z[i]); i++){
|
202338
|
0 |
0 |
if( (z[i]&0xc0)!=0x80 ) n++;
|
202362
|
0 |
0 |
if( pStr ){
|
202363
|
0 |
0 |
if( pStr->zBuf==0 ){
|
202366
|
0 |
0 |
}else if( pStr->nUsed>1 ){
|
202376
|
0 |
0 |
if( pStr ){
|
202379
|
0 |
0 |
if( pStr->bErr ){
|
202380
|
0 |
0 |
if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx);
|
202382
|
0 |
0 |
}else if( isFinal ){
|
202383
|
0 |
0 |
sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed,
|
202426
|
0 |
0 |
if( NEVER(!pStr) ) return;
|
202429
|
0 |
0 |
for(i=1; i<pStr->nUsed && ((c = z[i])!=',' || inStr || nNest); i++){
|
|
0 |
0 |
for(i=1; i<pStr->nUsed && ((c = z[i])!=',' || inStr || nNest); i++){
|
|
0 |
0 |
for(i=1; i<pStr->nUsed && ((c = z[i])!=',' || inStr || nNest); i++){
|
|
0 |
0 |
for(i=1; i<pStr->nUsed && ((c = z[i])!=',' || inStr || nNest); i++){
|
202430
|
0 |
0 |
if( c=='"' ){
|
202432
|
0 |
0 |
}else if( c=='\\' ){
|
202434
|
0 |
0 |
}else if( !inStr ){
|
202435
|
0 |
0 |
if( c=='{' || c=='[' ) nNest++;
|
|
0 |
0 |
if( c=='{' || c=='[' ) nNest++;
|
202436
|
0 |
0 |
if( c=='}' || c==']' ) nNest--;
|
|
0 |
0 |
if( c=='}' || c==']' ) nNest--;
|
202439
|
0 |
0 |
if( i<pStr->nUsed ){
|
202467
|
0 |
0 |
if( pStr ){
|
202468
|
0 |
0 |
if( pStr->zBuf==0 ){
|
202471
|
0 |
0 |
}else if( pStr->nUsed>1 ){
|
202485
|
0 |
0 |
if( pStr ){
|
202487
|
0 |
0 |
if( pStr->bErr ){
|
202488
|
0 |
0 |
if( pStr->bErr==1 ) sqlite3_result_error_nomem(ctx);
|
202490
|
0 |
0 |
}else if( isFinal ){
|
202491
|
0 |
0 |
sqlite3_result_text(ctx, pStr->zBuf, (int)pStr->nUsed,
|
202563
|
0 |
0 |
if( rc==SQLITE_OK ){
|
202565
|
0 |
0 |
if( pNew==0 ) return SQLITE_NOMEM;
|
202584
|
0 |
0 |
if( pCur==0 ) return SQLITE_NOMEM;
|
202593
|
0 |
0 |
if( rc==SQLITE_OK ){
|
202632
|
0 |
0 |
if( p->bRecursive ){
|
202633
|
0 |
0 |
if( p->sParse.aNode[p->i].jnFlags & JNODE_LABEL ) p->i++;
|
202636
|
0 |
0 |
if( p->i<p->iEnd ){
|
202640
|
0 |
0 |
if( pUp->eType==JSON_ARRAY ){
|
202644
|
0 |
0 |
if( iUp==p->i-1 ){
|
202686
|
0 |
0 |
if( (pNode->jnFlags & JNODE_RAW)==0 ){
|
202690
|
0 |
0 |
if( nn>2 && sqlite3Isalpha(z[1]) ){
|
|
0 |
0 |
if( nn>2 && sqlite3Isalpha(z[1]) ){
|
202691
|
0 |
0 |
for(jj=2; jj<nn-1 && sqlite3Isalnum(z[jj]); jj++){}
|
|
0 |
0 |
for(jj=2; jj<nn-1 && sqlite3Isalnum(z[jj]); jj++){}
|
202692
|
0 |
0 |
if( jj==nn-1 ){
|
202710
|
0 |
0 |
if( i==0 ){
|
202718
|
0 |
0 |
if( pUp->eType==JSON_ARRAY ){
|
202724
|
0 |
0 |
if( (pNode->jnFlags & JNODE_LABEL)==0 ) pNode--;
|
202739
|
0 |
0 |
if( p->i==0 ) break;
|
202740
|
0 |
0 |
if( p->eType==JSON_OBJECT ){
|
202742
|
0 |
0 |
}else if( p->eType==JSON_ARRAY ){
|
202744
|
0 |
0 |
if( p->bRecursive ){
|
202745
|
0 |
0 |
if( p->iRowid==0 ) break;
|
202756
|
0 |
0 |
if( pThis->jnFlags & JNODE_LABEL ) pThis++;
|
202761
|
0 |
0 |
if( pThis->jnFlags & JNODE_LABEL ) pThis++;
|
202766
|
0 |
0 |
if( pThis->jnFlags & JNODE_LABEL ) pThis++;
|
202767
|
0 |
0 |
if( pThis->eType>=JSON_ARRAY ) break;
|
202777
|
0 |
0 |
if( p->i>p->iBegin && p->bRecursive ){
|
|
0 |
0 |
if( p->i>p->iBegin && p->bRecursive ){
|
202785
|
0 |
0 |
if( p->bRecursive ){
|
202788
|
0 |
0 |
if( p->zRoot ){
|
202793
|
0 |
0 |
if( p->eType==JSON_ARRAY ){
|
202795
|
0 |
0 |
}else if( p->eType==JSON_OBJECT ){
|
202803
|
0 |
0 |
if( p->bRecursive ){
|
202816
|
0 |
0 |
if( zRoot==0 ) zRoot = "$";
|
202857
|
0 |
0 |
for(i=0; i<pIdxInfo->nConstraint; i++, pConstraint++){
|
202860
|
0 |
0 |
if( pConstraint->iColumn < JEACH_JSON ) continue;
|
202865
|
0 |
0 |
if( pConstraint->usable==0 ){
|
202867
|
0 |
0 |
}else if( pConstraint->op==SQLITE_INDEX_CONSTRAINT_EQ ){
|
202872
|
0 |
0 |
if( pIdxInfo->nOrderBy>0
|
202873
|
0 |
0 |
&& pIdxInfo->aOrderBy[0].iColumn<0
|
202874
|
0 |
0 |
&& pIdxInfo->aOrderBy[0].desc==0
|
202879
|
0 |
0 |
if( (unusableMask & ~idxMask)!=0 ){
|
202884
|
0 |
0 |
if( aIdx[0]<0 ){
|
202894
|
0 |
0 |
if( aIdx[1]<0 ){
|
202920
|
0 |
0 |
if( idxNum==0 ) return SQLITE_OK;
|
202922
|
0 |
0 |
if( z==0 ) return SQLITE_OK;
|
202925
|
0 |
0 |
if( p->zJson==0 ) return SQLITE_NOMEM;
|
202927
|
0 |
0 |
if( jsonParse(&p->sParse, 0, p->zJson) ){
|
202929
|
0 |
0 |
if( p->sParse.oom==0 ){
|
202932
|
0 |
0 |
if( cur->pVtab->zErrMsg ) rc = SQLITE_ERROR;
|
202936
|
0 |
0 |
}else if( p->bRecursive && jsonParseFindParents(&p->sParse) ){
|
|
0 |
0 |
}else if( p->bRecursive && jsonParseFindParents(&p->sParse) ){
|
202941
|
0 |
0 |
if( idxNum==3 ){
|
202944
|
0 |
0 |
if( zRoot==0 ) return SQLITE_OK;
|
202947
|
0 |
0 |
if( p->zRoot==0 ) return SQLITE_NOMEM;
|
202949
|
0 |
0 |
if( zRoot[0]!='$' ){
|
202954
|
0 |
0 |
if( zErr ){
|
202958
|
0 |
0 |
return cur->pVtab->zErrMsg ? SQLITE_ERROR : SQLITE_NOMEM;
|
202959
|
0 |
0 |
}else if( pNode==0 ){
|
202967
|
0 |
0 |
if( p->eType>=JSON_ARRAY ){
|
202972
|
0 |
0 |
if( p->bRecursive ){
|
202974
|
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 ){
|
203098
|
622 |
311 |
for(i=0; i<sizeof(aMod)/sizeof(aMod[0]) && rc==SQLITE_OK; i++){
|
|
622 |
0 |
for(i=0; i<sizeof(aMod)/sizeof(aMod[0]) && rc==SQLITE_OK; i++){
|
203712
|
0 |
15 |
if( p ){
|
203740
|
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);
|
203760
|
15 |
0 |
if( pNode->iNode!=0 ){
|
203762
|
0 |
15 |
for( ; (*pp)!=pNode; pp = &(*pp)->pNext){ assert(*pp); }
|
203777
|
0 |
0 |
if( pNode ){
|
203793
|
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 ){
|
203815
|
18 |
15 |
if( (pNode = nodeHashLookup(pRtree, iNode))!=0 ){
|
203816
|
0 |
18 |
if( pParent && pParent!=pNode->pParent ){
|
|
0 |
0 |
if( pParent && pParent!=pNode->pParent ){
|
203825
|
0 |
15 |
if( pRtree->pNodeBlob ){
|
203830
|
0 |
0 |
if( rc ){
|
203832
|
0 |
0 |
if( rc==SQLITE_NOMEM ) return SQLITE_NOMEM;
|
203835
|
15 |
0 |
if( pRtree->pNodeBlob==0 ){
|
203837
|
0 |
15 |
if( zTab==0 ) return SQLITE_NOMEM;
|
203842
|
0 |
15 |
if( rc ){
|
203847
|
0 |
0 |
if( rc==SQLITE_ERROR ){
|
203851
|
15 |
0 |
}else if( pRtree->iNodeSize==sqlite3_blob_bytes(pRtree->pNodeBlob) ){
|
203853
|
0 |
15 |
if( !pNode ){
|
203874
|
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 ){
|
203876
|
0 |
15 |
if( pRtree->iDepth>RTREE_MAX_DEPTH ){
|
203886
|
15 |
0 |
if( pNode && rc==SQLITE_OK ){
|
|
15 |
0 |
if( pNode && rc==SQLITE_OK ){
|
203887
|
0 |
15 |
if( NCELL(pNode)>((pRtree->iNodeSize-4)/pRtree->nBytesPerCell) ){
|
203893
|
15 |
0 |
if( rc==SQLITE_OK ){
|
203894
|
15 |
0 |
if( pNode!=0 ){
|
203903
|
0 |
0 |
if( pNode ){
|
203925
|
28 |
7 |
for(ii=0; ii<pRtree->nDim2; ii++){
|
203961
|
7 |
0 |
if( nCell<nMaxCell ){
|
203975
|
7 |
8 |
if( pNode->isDirty ){
|
203977
|
7 |
0 |
if( pNode->iNode ){
|
203987
|
0 |
7 |
if( pNode->iNode==0 && rc==SQLITE_OK ){
|
|
0 |
0 |
if( pNode->iNode==0 && rc==SQLITE_OK ){
|
204001
|
33 |
88 |
if( pNode ){
|
204005
|
15 |
18 |
if( pNode->nRef==0 ){
|
204007
|
15 |
0 |
if( pNode->iNode==1 ){
|
204010
|
0 |
15 |
if( pNode->pParent ){
|
204013
|
15 |
0 |
if( rc==SQLITE_OK ){
|
204071
|
0 |
0 |
}while( ii<pRtree->nDim2 );
|
204121
|
1 |
15 |
if( pRtree->nBusy==0 ){
|
204162
|
0 |
0 |
if( !zCreate ){
|
204169
|
0 |
0 |
if( rc==SQLITE_OK ){
|
204185
|
8 |
0 |
if( pCsr ){
|
204204
|
6 |
10 |
if( pCsr->aConstraint ){
|
204206
|
24 |
6 |
for(i=0; i<pCsr->nConstraint; i++){
|
204208
|
0 |
24 |
if( pInfo ){
|
204209
|
0 |
0 |
if( pInfo->xDelUser ) pInfo->xDelUser(pInfo->pUser);
|
204216
|
80 |
16 |
for(ii=0; ii<RTREE_CACHE_SZ; ii++) nodeRelease(pRtree, pCsr->aNode[ii]);
|
204318
|
0 |
0 |
if( pConstraint->op==RTREE_QUERY && pSearch->iLevel==1 ){
|
|
0 |
0 |
if( pConstraint->op==RTREE_QUERY && pSearch->iLevel==1 ){
|
204323
|
0 |
0 |
if( eInt==0 ){
|
204352
|
0 |
0 |
if( pConstraint->op==RTREE_MATCH ){
|
204356
|
0 |
0 |
if( eWithin==0 ) *peWithin = NOT_WITHIN;
|
204364
|
0 |
0 |
if( pInfo->eWithin<*peWithin ) *peWithin = pInfo->eWithin;
|
204365
|
0 |
0 |
if( pInfo->rScore<*prScore || *prScore<RTREE_ZERO ){
|
|
0 |
0 |
if( pInfo->rScore<*prScore || *prScore<RTREE_ZERO ){
|
204398
|
0 |
0 |
RTREE_DECODE_COORD(eInt, pCellData, val);
|
204400
|
0 |
0 |
if( p->u.rValue>=val ){
|
204402
|
0 |
0 |
RTREE_DECODE_COORD(eInt, pCellData, val);
|
204404
|
0 |
0 |
if( p->u.rValue<=val ) return;
|
204409
|
0 |
0 |
RTREE_DECODE_COORD(eInt, pCellData, val);
|
204411
|
0 |
0 |
if( p->u.rValue>=val ) return;
|
204416
|
0 |
0 |
RTREE_DECODE_COORD(eInt, pCellData, val);
|
204418
|
0 |
0 |
if( p->u.rValue<=val ) return;
|
204447
|
119 |
0 |
RTREE_DECODE_COORD(eInt, pCellData, xN);
|
204451
|
40 |
15 |
case RTREE_LE: if( xN <= p->u.rValue ) return; break;
|
204452
|
0 |
0 |
case RTREE_LT: if( xN < p->u.rValue ) return; break;
|
204453
|
55 |
9 |
case RTREE_GE: if( xN >= p->u.rValue ) return; break;
|
204454
|
0 |
0 |
case RTREE_GT: if( xN > p->u.rValue ) return; break;
|
204455
|
0 |
0 |
default: if( xN == p->u.rValue ) return; break;
|
204473
|
3 |
0 |
for(ii=0; ii<nCell; ii++){
|
204474
|
2 |
1 |
if( nodeGetRowid(pRtree, pNode, ii)==iRowid ){
|
204489
|
0 |
0 |
if( ALWAYS(pParent) ){
|
204511
|
0 |
0 |
if( pA->rScore<pB->rScore ) return -1;
|
204512
|
0 |
0 |
if( pA->rScore>pB->rScore ) return +1;
|
204513
|
0 |
0 |
if( pA->iLevel<pB->iLevel ) return -1;
|
204514
|
0 |
0 |
if( pA->iLevel>pB->iLevel ) return +1;
|
204527
|
0 |
0 |
if( i<RTREE_CACHE_SZ ){
|
204528
|
0 |
0 |
if( j>=RTREE_CACHE_SZ ){
|
204543
|
57 |
47 |
return pCur->bPoint ? &pCur->sPoint : pCur->nPoint ? pCur->aPoint : 0;
|
|
31 |
16 |
return pCur->bPoint ? &pCur->sPoint : pCur->nPoint ? pCur->aPoint : 0;
|
204554
|
18 |
34 |
if( pCur->aNode[ii]==0 ){
|
204556
|
0 |
18 |
id = ii ? pCur->aPoint[0].id : pCur->sPoint.id;
|
204572
|
5 |
0 |
if( pCur->nPoint>=pCur->nPointAlloc ){
|
204575
|
0 |
5 |
if( pNew==0 ) return 0;
|
204584
|
0 |
5 |
while( i>0 ){
|
204588
|
0 |
0 |
if( rtreeSearchPointCompare(pNew, pParent)>=0 ) break;
|
204608
|
18 |
8 |
if( pFirst==0
|
204609
|
18 |
0 |
|| pFirst->rScore>rScore
|
204610
|
18 |
0 |
|| (pFirst->rScore==rScore && pFirst->iLevel>iLevel)
|
|
18 |
0 |
|| (pFirst->rScore==rScore && pFirst->iLevel>iLevel)
|
204612
|
5 |
21 |
if( pCur->bPoint ){
|
204615
|
0 |
5 |
if( pNew==0 ) return 0;
|
204618
|
5 |
0 |
if( ALWAYS(ii<RTREE_CACHE_SZ) ){
|
204672
|
26 |
0 |
if( p->aNode[i] ){
|
204676
|
21 |
5 |
if( p->bPoint ){
|
204679
|
5 |
0 |
}else if( ALWAYS(p->nPoint) ){
|
204683
|
5 |
0 |
if( n<RTREE_CACHE_SZ-1 ){
|
204688
|
0 |
5 |
while( (j = i*2+1)<n ){
|
204690
|
0 |
0 |
if( k<n && rtreeSearchPointCompare(&p->aPoint[k], &p->aPoint[j])<0 ){
|
|
0 |
0 |
if( k<n && rtreeSearchPointCompare(&p->aPoint[k], &p->aPoint[j])<0 ){
|
204691
|
0 |
0 |
if( rtreeSearchPointCompare(&p->aPoint[k], &p->aPoint[i])<0 ){
|
204698
|
0 |
0 |
if( rtreeSearchPointCompare(&p->aPoint[j], &p->aPoint[i])<0 ){
|
204729
|
42 |
8 |
while( (p = rtreeSearchPointFirst(pCur))!=0 && p->iLevel>0 ){
|
|
24 |
18 |
while( (p = rtreeSearchPointFirst(pCur))!=0 && p->iLevel>0 ){
|
204732
|
0 |
24 |
if( rc ) return rc;
|
204736
|
42 |
6 |
while( p->iCell<nCell ){
|
204739
|
119 |
18 |
for(ii=0; ii<nConstraint; ii++){
|
204741
|
0 |
119 |
if( pConstraint->op>=RTREE_MATCH ){
|
204744
|
0 |
0 |
if( rc ) return rc;
|
204745
|
119 |
0 |
}else if( p->iLevel==1 ){
|
204750
|
24 |
95 |
if( eWithin==NOT_WITHIN ){
|
204756
|
24 |
18 |
if( eWithin==NOT_WITHIN ) continue;
|
204759
|
0 |
18 |
if( x.iLevel ){
|
204761
|
0 |
0 |
for(ii=0; ii<pCur->nPoint; ii++){
|
204762
|
0 |
0 |
if( pCur->aPoint[ii].id==x.id ){
|
204772
|
0 |
18 |
if( p->iCell>=nCell ){
|
204776
|
18 |
0 |
if( rScore<RTREE_ZERO ) rScore = RTREE_ZERO;
|
204778
|
0 |
18 |
if( p==0 ) return SQLITE_NOMEM;
|
204785
|
6 |
18 |
if( p->iCell>=nCell ){
|
204803
|
0 |
20 |
if( pCsr->bAuxValid ){
|
204820
|
0 |
0 |
if( rc==SQLITE_OK && ALWAYS(p) ){
|
|
0 |
0 |
if( rc==SQLITE_OK && ALWAYS(p) ){
|
204837
|
0 |
28 |
if( rc ) return rc;
|
204838
|
0 |
28 |
if( NEVER(p==0) ) return SQLITE_OK;
|
204839
|
20 |
8 |
if( i==0 ){
|
204841
|
8 |
0 |
}else if( i<=pRtree->nDim2 ){
|
204844
|
0 |
8 |
if( pRtree->eCoordType==RTREE_COORD_REAL32 ){
|
204853
|
0 |
0 |
if( !pCsr->bAuxValid ){
|
204854
|
0 |
0 |
if( pCsr->pReadAux==0 ){
|
204857
|
0 |
0 |
if( rc ) return rc;
|
204862
|
0 |
0 |
if( rc==SQLITE_ROW ){
|
204866
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK;
|
204892
|
2 |
0 |
if( sqlite3_step(pRtree->pReadRowid)==SQLITE_ROW ){
|
204894
|
2 |
0 |
if( piNode ) *piNode = iNode;
|
204914
|
0 |
0 |
if( pSrc==0 ) return SQLITE_ERROR;
|
204917
|
0 |
0 |
if( !pInfo ) return SQLITE_NOMEM;
|
204926
|
0 |
0 |
if( pBlob->cb.xGeom ){
|
204957
|
2 |
6 |
if( idxNum==1 ){
|
204964
|
0 |
2 |
if( eType==SQLITE_INTEGER
|
204965
|
0 |
0 |
|| (eType==SQLITE_FLOAT && sqlite3_value_double(argv[0])==iRowid)
|
|
0 |
0 |
|| (eType==SQLITE_FLOAT && sqlite3_value_double(argv[0])==iRowid)
|
204972
|
2 |
0 |
if( rc==SQLITE_OK && pLeaf!=0 ){
|
|
2 |
0 |
if( rc==SQLITE_OK && pLeaf!=0 ){
|
204989
|
6 |
0 |
if( rc==SQLITE_OK && argc>0 ){
|
|
6 |
0 |
if( rc==SQLITE_OK && argc>0 ){
|
204992
|
0 |
6 |
if( !pCsr->aConstraint ){
|
204999
|
24 |
6 |
for(ii=0; ii<argc; ii++){
|
205004
|
0 |
24 |
if( p->op>=RTREE_MATCH ){
|
205010
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
205016
|
0 |
24 |
}else if( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT ){
|
|
0 |
0 |
}else if( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT ){
|
205024
|
0 |
0 |
if( eType==SQLITE_NULL ){
|
205026
|
0 |
0 |
}else if( p->op==RTREE_LT || p->op==RTREE_LE ){
|
|
0 |
0 |
}else if( p->op==RTREE_LT || p->op==RTREE_LE ){
|
205035
|
6 |
0 |
if( rc==SQLITE_OK ){
|
205039
|
0 |
6 |
if( NEVER(pNew==0) ){ /* Because pCsr->bPoint was FALSE */
|
205107
|
26 |
8 |
for(ii=0; ii<pIdxInfo->nConstraint; ii++){
|
205108
|
0 |
26 |
if( pIdxInfo->aConstraint[ii].op==SQLITE_INDEX_CONSTRAINT_MATCH ){
|
205114
|
26 |
6 |
for(ii=0; ii<pIdxInfo->nConstraint && iIdx<(int)(sizeof(zIdxStr)-1); ii++){
|
|
26 |
0 |
for(ii=0; ii<pIdxInfo->nConstraint && iIdx<(int)(sizeof(zIdxStr)-1); ii++){
|
205117
|
26 |
0 |
if( bMatch==0 && p->usable
|
|
26 |
0 |
if( bMatch==0 && p->usable
|
205118
|
2 |
24 |
&& p->iColumn<=0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ
|
|
2 |
0 |
&& p->iColumn<=0 && p->op==SQLITE_INDEX_CONSTRAINT_EQ
|
205122
|
0 |
2 |
for(jj=0; jj<ii; jj++){
|
205142
|
24 |
0 |
if( p->usable
|
205143
|
24 |
0 |
&& ((p->iColumn>0 && p->iColumn<=pRtree->nDim2)
|
|
0 |
24 |
&& ((p->iColumn>0 && p->iColumn<=pRtree->nDim2)
|
205144
|
0 |
0 |
|| p->op==SQLITE_INDEX_CONSTRAINT_MATCH)
|
205156
|
24 |
0 |
if( op ){
|
205167
|
6 |
0 |
if( iIdx>0 && 0==(pIdxInfo->idxStr = sqlite3_mprintf("%s", zIdxStr)) ){
|
|
0 |
6 |
if( iIdx>0 && 0==(pIdxInfo->idxStr = sqlite3_mprintf("%s", zIdxStr)) ){
|
205185
|
0 |
0 |
if( pRtree->eCoordType==RTREE_COORD_REAL32 ){
|
205215
|
0 |
0 |
margin += (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii]));
|
|
0 |
0 |
margin += (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii]));
|
205217
|
0 |
0 |
}while( ii>=0 );
|
205226
|
0 |
0 |
if( pRtree->eCoordType==RTREE_COORD_REAL32 ){
|
205228
|
0 |
0 |
p1->aCoord[ii].f = MIN(p1->aCoord[ii].f, p2->aCoord[ii].f);
|
205229
|
0 |
0 |
p1->aCoord[ii+1].f = MAX(p1->aCoord[ii+1].f, p2->aCoord[ii+1].f);
|
205231
|
0 |
0 |
}while( ii<pRtree->nDim2 );
|
205237
|
0 |
0 |
}while( ii<pRtree->nDim2 );
|
205248
|
0 |
0 |
for(ii=0; ii<pRtree->nDim2; ii+=2){
|
205251
|
0 |
0 |
if( (!isInt && (a2[0].f<a1[0].f || a2[1].f>a1[1].f))
|
|
0 |
0 |
if( (!isInt && (a2[0].f<a1[0].f || a2[1].f>a1[1].f))
|
|
0 |
0 |
if( (!isInt && (a2[0].f<a1[0].f || a2[1].f>a1[1].f))
|
205252
|
0 |
0 |
|| ( isInt && (a2[0].i<a1[0].i || a2[1].i>a1[1].i))
|
|
0 |
0 |
|| ( isInt && (a2[0].i<a1[0].i || a2[1].i>a1[1].i))
|
|
0 |
0 |
|| ( isInt && (a2[0].i<a1[0].i || a2[1].i>a1[1].i))
|
205280
|
0 |
0 |
for(ii=0; ii<nCell; ii++){
|
205283
|
0 |
0 |
for(jj=0; jj<pRtree->nDim2; jj+=2){
|
205285
|
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]));
|
205286
|
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]));
|
205287
|
0 |
0 |
if( x2<x1 ){
|
205315
|
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++){
|
205332
|
0 |
0 |
for(iCell=0; iCell<nCell; iCell++){
|
205339
|
0 |
0 |
if( iCell==0||growth<fMinGrowth||(growth==fMinGrowth && area<fMinArea) ){
|
|
0 |
0 |
if( iCell==0||growth<fMinGrowth||(growth==fMinGrowth && area<fMinArea) ){
|
|
0 |
0 |
if( iCell==0||growth<fMinGrowth||(growth==fMinGrowth && area<fMinArea) ){
|
|
0 |
0 |
if( iCell==0||growth<fMinGrowth||(growth==fMinGrowth && area<fMinArea) ){
|
205342
|
0 |
0 |
if( bBest ){
|
205372
|
0 |
7 |
while( p->pParent ){
|
205378
|
0 |
0 |
if( NEVER(cnt>100) ){
|
205383
|
0 |
0 |
if( NEVER(rc!=SQLITE_OK) ){
|
205389
|
0 |
0 |
if( !cellContains(pRtree, &cell, pCell) ){
|
205445
|
0 |
0 |
if( nIdx>1 ){
|
205460
|
0 |
0 |
while( iLeft<nLeft || iRight<nRight ){
|
|
0 |
0 |
while( iLeft<nLeft || iRight<nRight ){
|
205461
|
0 |
0 |
if( iLeft==nLeft ){
|
205464
|
0 |
0 |
}else if( iRight==nRight ){
|
205470
|
0 |
0 |
if( fLeft<fRight ){
|
205513
|
0 |
0 |
if( nIdx>1 ){
|
205528
|
0 |
0 |
while( iLeft<nLeft || iRight<nRight ){
|
|
0 |
0 |
while( iLeft<nLeft || iRight<nRight ){
|
205529
|
0 |
0 |
RtreeDValue xleft1 = DCOORD(aCell[aLeft[iLeft]].aCoord[iDim*2]);
|
205530
|
0 |
0 |
RtreeDValue xleft2 = DCOORD(aCell[aLeft[iLeft]].aCoord[iDim*2+1]);
|
205531
|
0 |
0 |
RtreeDValue xright1 = DCOORD(aCell[aRight[iRight]].aCoord[iDim*2]);
|
205532
|
0 |
0 |
RtreeDValue xright2 = DCOORD(aCell[aRight[iRight]].aCoord[iDim*2+1]);
|
205533
|
0 |
0 |
if( (iLeft!=nLeft) && ((iRight==nRight)
|
|
0 |
0 |
if( (iLeft!=nLeft) && ((iRight==nRight)
|
205534
|
0 |
0 |
|| (xleft1<xright1)
|
205535
|
0 |
0 |
|| (xleft1==xright1 && xleft2<xright2)
|
|
0 |
0 |
|| (xleft1==xright1 && xleft2<xright2)
|
205584
|
0 |
0 |
if( !aaSorted ){
|
205590
|
0 |
0 |
for(ii=0; ii<pRtree->nDim; ii++){
|
205593
|
0 |
0 |
for(jj=0; jj<nCell; jj++){
|
205599
|
0 |
0 |
for(ii=0; ii<pRtree->nDim; ii++){
|
205606
|
0 |
0 |
for(
|
205619
|
0 |
0 |
for(kk=1; kk<(nCell-1); kk++){
|
205620
|
0 |
0 |
if( kk<nLeft ){
|
205630
|
0 |
0 |
if( (nLeft==RTREE_MINCELLS(pRtree))
|
205631
|
0 |
0 |
|| (overlap<fBestOverlap)
|
205632
|
0 |
0 |
|| (overlap==fBestOverlap && area<fBestArea)
|
|
0 |
0 |
|| (overlap==fBestOverlap && area<fBestArea)
|
205640
|
0 |
0 |
if( ii==0 || margin<fBestMargin ){
|
|
0 |
0 |
if( ii==0 || margin<fBestMargin ){
|
205649
|
0 |
0 |
for(ii=0; ii<nCell; ii++){
|
205650
|
0 |
0 |
RtreeNode *pTarget = (ii<iBestSplit)?pLeft:pRight;
|
205651
|
0 |
0 |
RtreeCell *pBbox = (ii<iBestSplit)?pBboxLeft:pBboxRight;
|
205669
|
0 |
0 |
xSetMapping = ((iHeight==0)?rowidWrite:parentWrite);
|
205670
|
0 |
0 |
if( iHeight>0 ){
|
205673
|
0 |
0 |
for(p=pNode; p; p=p->pParent){
|
205674
|
0 |
0 |
if( p==pChild ) return SQLITE_CORRUPT_VTAB;
|
205676
|
0 |
0 |
if( pChild ){
|
205682
|
0 |
0 |
if( NEVER(pNode==0) ) return SQLITE_ERROR;
|
205710
|
0 |
0 |
if( !aCell ){
|
205716
|
0 |
0 |
for(i=0; i<nCell; i++){
|
205723
|
0 |
0 |
if( pNode->iNode==1 ){
|
205735
|
0 |
0 |
if( !pLeft || !pRight ){
|
|
0 |
0 |
if( !pLeft || !pRight ){
|
205745
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
205754
|
0 |
0 |
if( SQLITE_OK!=(rc = nodeWrite(pRtree, pRight))
|
205755
|
0 |
0 |
|| (0==pLeft->iNode && SQLITE_OK!=(rc = nodeWrite(pRtree, pLeft)))
|
|
0 |
0 |
|| (0==pLeft->iNode && SQLITE_OK!=(rc = nodeWrite(pRtree, pLeft)))
|
205763
|
0 |
0 |
if( pNode->iNode==1 ){
|
205765
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
205772
|
0 |
0 |
if( ALWAYS(rc==SQLITE_OK) ){
|
205777
|
0 |
0 |
if( NEVER(rc!=SQLITE_OK) ){
|
205781
|
0 |
0 |
if( (rc = rtreeInsertCell(pRtree, pRight->pParent, &rightbbox, iHeight+1)) ){
|
205785
|
0 |
0 |
for(i=0; i<NCELL(pRight); i++){
|
205788
|
0 |
0 |
if( iRowid==pCell->iRowid ){
|
205791
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
205795
|
0 |
0 |
if( pNode->iNode==1 ){
|
205796
|
0 |
0 |
for(i=0; i<NCELL(pLeft); i++){
|
205799
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
205803
|
0 |
0 |
}else if( newCellIsRight==0 ){
|
205807
|
0 |
0 |
if( rc==SQLITE_OK ){
|
205811
|
0 |
0 |
if( rc==SQLITE_OK ){
|
205837
|
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 ){
|
205841
|
0 |
0 |
if( rc==SQLITE_ROW ){
|
205851
|
0 |
0 |
for(pTest=pLeaf; pTest && pTest->iNode!=iNode; pTest=pTest->pParent);
|
|
0 |
0 |
for(pTest=pLeaf; pTest && pTest->iNode!=iNode; pTest=pTest->pParent);
|
205852
|
0 |
0 |
if( pTest==0 ){
|
205857
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
205858
|
0 |
0 |
if( rc==SQLITE_OK && !pChild->pParent ){
|
|
0 |
0 |
if( rc==SQLITE_OK && !pChild->pParent ){
|
205879
|
0 |
0 |
if( rc==SQLITE_OK ){
|
205886
|
0 |
0 |
if( rc==SQLITE_OK ){
|
205889
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
205896
|
0 |
0 |
if( SQLITE_OK!=(rc = sqlite3_reset(pRtree->pDeleteNode)) ){
|
205903
|
0 |
0 |
if( SQLITE_OK!=(rc = sqlite3_reset(pRtree->pDeleteParent)) ){
|
205922
|
0 |
0 |
if( pParent ){
|
205927
|
0 |
0 |
for(ii=1; ii<nCell; ii++){
|
205934
|
0 |
0 |
if( rc==SQLITE_OK ){
|
205950
|
0 |
0 |
if( SQLITE_OK!=(rc = fixLeafParent(pRtree, pNode)) ){
|
205966
|
0 |
0 |
if( pParent ){
|
205967
|
0 |
0 |
if( NCELL(pNode)<RTREE_MINCELLS(pRtree) ){
|
206008
|
0 |
0 |
if( !aCell ){
|
206015
|
0 |
0 |
for(ii=0; ii<nCell; ii++){
|
206016
|
0 |
0 |
if( ii==(nCell-1) ){
|
206022
|
0 |
0 |
for(iDim=0; iDim<pRtree->nDim; iDim++){
|
206023
|
0 |
0 |
aCenterCoord[iDim] += DCOORD(aCell[ii].aCoord[iDim*2]);
|
206024
|
0 |
0 |
aCenterCoord[iDim] += DCOORD(aCell[ii].aCoord[iDim*2+1]);
|
206027
|
0 |
0 |
for(iDim=0; iDim<pRtree->nDim; iDim++){
|
206031
|
0 |
0 |
for(ii=0; ii<nCell; ii++){
|
206033
|
0 |
0 |
for(iDim=0; iDim<pRtree->nDim; iDim++){
|
206034
|
0 |
0 |
RtreeDValue coord = (DCOORD(aCell[ii].aCoord[iDim*2+1]) -
|
206035
|
0 |
0 |
DCOORD(aCell[ii].aCoord[iDim*2]));
|
206043
|
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++){
|
206046
|
0 |
0 |
if( p->iRowid==pCell->iRowid ){
|
206047
|
0 |
0 |
if( iHeight==0 ){
|
206054
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206057
|
0 |
0 |
for(; rc==SQLITE_OK && ii<nCell; ii++){
|
|
0 |
0 |
for(; rc==SQLITE_OK && ii<nCell; ii++){
|
206064
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206068
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206089
|
0 |
7 |
if( iHeight>0 ){
|
206091
|
0 |
0 |
if( pChild ){
|
206097
|
0 |
7 |
if( nodeInsertCell(pRtree, pNode, pCell) ){
|
206098
|
0 |
0 |
if( iHeight<=pRtree->iReinsertHeight || pNode->iNode==1){
|
|
0 |
0 |
if( iHeight<=pRtree->iReinsertHeight || pNode->iNode==1){
|
206106
|
7 |
0 |
if( ALWAYS(rc==SQLITE_OK) ){
|
206107
|
7 |
0 |
if( iHeight==0 ){
|
206122
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii<nCell; ii++){
|
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii<nCell; ii++){
|
206131
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206135
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206172
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206181
|
0 |
0 |
if( rc==SQLITE_OK && pLeaf ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pLeaf ){
|
206184
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206188
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206194
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206208
|
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 ){
|
206213
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206217
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
206218
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206226
|
0 |
0 |
for(pLeaf=pRtree->pDeleted; pLeaf; pLeaf=pRtree->pDeleted){
|
206227
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206236
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206259
|
0 |
0 |
if( f>d ){
|
206260
|
0 |
0 |
f = (float)(d*(d<0 ? RNDAWAY : RNDTOWARDS));
|
206267
|
0 |
0 |
if( f<d ){
|
206268
|
0 |
0 |
f = (float)(d*(d<0 ? RNDTOWARDS : RNDAWAY));
|
206294
|
0 |
0 |
if( zSql ){
|
206301
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206302
|
0 |
0 |
if( iCol==0 ){
|
206317
|
0 |
0 |
return (rc==SQLITE_OK ? SQLITE_CONSTRAINT : rc);
|
206336
|
0 |
7 |
if( pRtree->nNodeRef ){
|
206358
|
7 |
0 |
if( nData>1 ){
|
206362
|
0 |
7 |
if( nn > pRtree->nDim2 ) nn = pRtree->nDim2;
|
206373
|
0 |
7 |
if( pRtree->eCoordType==RTREE_COORD_REAL32 ){
|
206374
|
0 |
0 |
for(ii=0; ii<nn; ii+=2){
|
206377
|
0 |
0 |
if( cell.aCoord[ii].f>cell.aCoord[ii+1].f ){
|
206385
|
14 |
7 |
for(ii=0; ii<nn; ii+=2){
|
206388
|
0 |
14 |
if( cell.aCoord[ii].i>cell.aCoord[ii+1].i ){
|
206397
|
7 |
0 |
if( sqlite3_value_type(aData[2])!=SQLITE_NULL ){
|
206399
|
0 |
7 |
if( sqlite3_value_type(aData[0])==SQLITE_NULL
|
206400
|
0 |
0 |
|| sqlite3_value_int64(aData[0])!=cell.iRowid
|
206406
|
0 |
7 |
if( SQLITE_ROW==steprc ){
|
206407
|
0 |
0 |
if( sqlite3_vtab_on_conflict(pRtree->db)==SQLITE_REPLACE ){
|
206423
|
0 |
7 |
if( sqlite3_value_type(aData[0])!=SQLITE_NULL ){
|
206431
|
7 |
0 |
if( rc==SQLITE_OK && nData>1 ){
|
|
7 |
0 |
if( rc==SQLITE_OK && nData>1 ){
|
206436
|
0 |
7 |
if( bHaveRowid==0 ){
|
206441
|
7 |
0 |
if( rc==SQLITE_OK ){
|
206444
|
7 |
0 |
if( rc==SQLITE_OK ){
|
206449
|
7 |
0 |
if( rc==SQLITE_OK ){
|
206453
|
7 |
0 |
if( rc==SQLITE_OK && pRtree->nAux ){
|
|
0 |
7 |
if( rc==SQLITE_OK && pRtree->nAux ){
|
206457
|
0 |
0 |
for(jj=0; jj<pRtree->nAux; jj++){
|
206505
|
0 |
0 |
if( zSql ){
|
206552
|
1 |
0 |
if( rc!=SQLITE_OK ){
|
206554
|
0 |
1 |
return rc==SQLITE_ERROR ? SQLITE_OK : rc;
|
206557
|
0 |
0 |
if( zSql==0 ){
|
206561
|
0 |
0 |
if( rc==SQLITE_OK ){
|
206562
|
0 |
0 |
if( sqlite3_step(p)==SQLITE_ROW ) nRow = sqlite3_column_int64(p, 0);
|
206581
|
12 |
0 |
for(i=0; i<sizeof(azName)/sizeof(azName[0]); i++){
|
206582
|
6 |
6 |
if( sqlite3_stricmp(zName, azName[i])==0 ) return 1;
|
206645
|
1 |
0 |
if( isCreate ){
|
206652
|
0 |
1 |
for(ii=0; ii<pRtree->nAux; ii++){
|
206665
|
0 |
1 |
if( !zCreate ){
|
206670
|
0 |
1 |
if( rc!=SQLITE_OK ){
|
206685
|
8 |
1 |
for(i=0; i<N_STATEMENT && rc==SQLITE_OK; i++){
|
|
8 |
0 |
for(i=0; i<N_STATEMENT && rc==SQLITE_OK; i++){
|
206688
|
1 |
7 |
if( i!=3 || pRtree->nAux==0 ){
|
|
1 |
0 |
if( i!=3 || pRtree->nAux==0 ){
|
206697
|
8 |
0 |
if( zSql ){
|
206704
|
0 |
1 |
if( pRtree->nAux ){
|
206708
|
0 |
0 |
if( pRtree->zReadAuxSql==0 ){
|
206715
|
0 |
0 |
for(ii=0; ii<pRtree->nAux; ii++){
|
206716
|
0 |
0 |
if( ii ) sqlite3_str_append(p, ",", 1);
|
206728
|
0 |
0 |
if( zSql==0 ){
|
206749
|
1 |
0 |
if( zSql ){
|
206752
|
1 |
0 |
if( rc==SQLITE_OK ){
|
206753
|
1 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){
|
206785
|
1 |
0 |
if( isCreate ){
|
206789
|
1 |
0 |
if( rc==SQLITE_OK ){
|
206791
|
1 |
0 |
if( (4+pRtree->nBytesPerCell*RTREE_MAXCELLS)<pRtree->iNodeSize ){
|
206803
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
206805
|
0 |
0 |
}else if( pRtree->iNodeSize<(512-64) ){
|
206861
|
1 |
0 |
if( argc<6 || argc>RTREE_MAX_AUX_COLUMN+3 ){
|
|
0 |
1 |
if( argc<6 || argc>RTREE_MAX_AUX_COLUMN+3 ){
|
206862
|
0 |
0 |
*pzErr = sqlite3_mprintf("%s", aErrMsg[2 + (argc>=6)]);
|
206872
|
0 |
1 |
if( !pRtree ){
|
206892
|
4 |
1 |
for(ii=4; ii<argc; ii++){
|
206894
|
0 |
4 |
if( zArg[0]=='+' ){
|
206897
|
0 |
4 |
}else if( pRtree->nAux>0 ){
|
206908
|
0 |
1 |
if( !zSql ){
|
206910
|
0 |
1 |
}else if( ii<argc ){
|
206913
|
0 |
1 |
}else if( SQLITE_OK!=(rc = sqlite3_declare_vtab(db, zSql)) ){
|
206917
|
0 |
1 |
if( rc ) goto rtreeInit_fail;
|
206919
|
0 |
1 |
if( pRtree->nDim<1 ){
|
206921
|
0 |
1 |
}else if( pRtree->nDim2>RTREE_MAX_DIMENSIONS*2 ){
|
206923
|
0 |
1 |
}else if( pRtree->nDim2 % 2 ){
|
206928
|
0 |
1 |
if( iErr ){
|
206936
|
0 |
1 |
if( rc ) goto rtreeInit_fail;
|
206938
|
0 |
1 |
if( rc ){
|
206947
|
0 |
0 |
if( rc==SQLITE_OK ) rc = SQLITE_ERROR;
|
206983
|
0 |
0 |
if( tree.nDim<1 || tree.nDim>5 ) return;
|
|
0 |
0 |
if( tree.nDim<1 || tree.nDim>5 ) return;
|
206987
|
0 |
0 |
if( node.zData==0 ) return;
|
206989
|
0 |
0 |
if( nData<4 ) return;
|
206990
|
0 |
0 |
if( nData<NCELL(&node)*tree.nBytesPerCell ) return;
|
206993
|
0 |
0 |
for(ii=0; ii<NCELL(&node); ii++){
|
206998
|
0 |
0 |
if( ii>0 ) sqlite3_str_append(pOut, " ", 1);
|
207000
|
0 |
0 |
for(jj=0; jj<tree.nDim2; jj++){
|
207025
|
0 |
0 |
if( sqlite3_value_type(apArg[0])!=SQLITE_BLOB
|
207026
|
0 |
0 |
|| sqlite3_value_bytes(apArg[0])<2
|
207032
|
0 |
0 |
if( zBlob ){
|
207068
|
0 |
0 |
if( pCheck->rc==SQLITE_OK ) pCheck->rc = rc;
|
207090
|
0 |
0 |
if( pCheck->rc==SQLITE_OK ){
|
207091
|
0 |
0 |
if( z==0 ){
|
207111
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pCheck->nErr<RTREE_CHECK_MAX_ERROR ){
|
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pCheck->nErr<RTREE_CHECK_MAX_ERROR ){
|
207113
|
0 |
0 |
if( z==0 ){
|
207116
|
0 |
0 |
pCheck->zReport = sqlite3_mprintf("%z%s%z",
|
207119
|
0 |
0 |
if( pCheck->zReport==0 ){
|
207145
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pCheck->pGetNode==0 ){
|
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pCheck->pGetNode==0 ){
|
207152
|
0 |
0 |
if( pCheck->rc==SQLITE_OK ){
|
207154
|
0 |
0 |
if( sqlite3_step(pCheck->pGetNode)==SQLITE_ROW ){
|
207158
|
0 |
0 |
if( pRet==0 ){
|
207166
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pRet==0 ){
|
|
0 |
0 |
if( pCheck->rc==SQLITE_OK && pRet==0 ){
|
207200
|
0 |
0 |
if( pCheck->aCheckMapping[bLeaf]==0 ){
|
207205
|
0 |
0 |
if( pCheck->rc!=SQLITE_OK ) return;
|
207210
|
0 |
0 |
if( rc==SQLITE_DONE ){
|
207211
|
0 |
0 |
rtreeCheckAppendMsg(pCheck, "Mapping (%lld -> %lld) missing from %s table",
|
207214
|
0 |
0 |
}else if( rc==SQLITE_ROW ){
|
207216
|
0 |
0 |
if( ii!=iVal ){
|
207217
|
0 |
0 |
rtreeCheckAppendMsg(pCheck,
|
207249
|
0 |
0 |
for(i=0; i<pCheck->nDim; i++){
|
207254
|
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 ){
|
207260
|
0 |
0 |
if( pParent ){
|
207264
|
0 |
0 |
if( (pCheck->bInt ? c1.i<p1.i : c1.f<p1.f)
|
|
0 |
0 |
if( (pCheck->bInt ? c1.i<p1.i : c1.f<p1.f)
|
|
0 |
0 |
if( (pCheck->bInt ? c1.i<p1.i : c1.f<p1.f)
|
207265
|
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)
|
207297
|
0 |
0 |
if( aNode ){
|
207298
|
0 |
0 |
if( nNode<4 ){
|
207305
|
0 |
0 |
if( aParent==0 ){
|
207307
|
0 |
0 |
if( iDepth>RTREE_MAX_DEPTH ){
|
207314
|
0 |
0 |
if( (4 + nCell*(8 + pCheck->nDim*2*4))>nNode ){
|
207320
|
0 |
0 |
for(i=0; i<nCell; i++){
|
207325
|
0 |
0 |
if( iDepth>0 ){
|
207348
|
0 |
0 |
if( pCheck->rc==SQLITE_OK ){
|
207353
|
0 |
0 |
if( pCount ){
|
207354
|
0 |
0 |
if( sqlite3_step(pCount)==SQLITE_ROW ){
|
207356
|
0 |
0 |
if( nActual!=nExpect ){
|
207391
|
0 |
0 |
if( sqlite3_get_autocommit(db) ){
|
207397
|
0 |
0 |
if( check.rc==SQLITE_OK ){
|
207399
|
0 |
0 |
if( pStmt ){
|
207403
|
0 |
0 |
if( check.rc!=SQLITE_NOMEM ){
|
207410
|
0 |
0 |
if( pStmt ){
|
207413
|
0 |
0 |
if( check.nDim<1 ){
|
207415
|
0 |
0 |
}else if( SQLITE_ROW==sqlite3_step(pStmt) ){
|
207419
|
0 |
0 |
if( rc!=SQLITE_CORRUPT ) check.rc = rc;
|
207423
|
0 |
0 |
if( check.nDim>=1 ){
|
207424
|
0 |
0 |
if( check.rc==SQLITE_OK ){
|
207437
|
0 |
0 |
if( bEnd ){
|
207439
|
0 |
0 |
if( check.rc==SQLITE_OK ) check.rc = rc;
|
207483
|
0 |
0 |
if( nArg!=1 && nArg!=2 ){
|
|
0 |
0 |
if( nArg!=1 && nArg!=2 ){
|
207492
|
0 |
0 |
if( nArg==1 ){
|
207499
|
0 |
0 |
if( rc==SQLITE_OK ){
|
207500
|
0 |
0 |
sqlite3_result_text(ctx, zReport ? zReport : "ok", -1, SQLITE_TRANSIENT);
|
209362
|
311 |
0 |
if( rc==SQLITE_OK ){
|
209365
|
311 |
0 |
if( rc==SQLITE_OK ){
|
209368
|
311 |
0 |
if( rc==SQLITE_OK ){
|
209376
|
311 |
0 |
if( rc==SQLITE_OK ){
|
209398
|
0 |
0 |
if( pInfo->xDestructor ) pInfo->xDestructor(pInfo->pContext);
|
209408
|
0 |
0 |
for(i=0; i<p->nParam; i++){
|
209437
|
0 |
0 |
if( !pBlob ){
|
209445
|
0 |
0 |
for(i=0; i<nArg; i++){
|
209447
|
0 |
0 |
if( pBlob->apSqlParam[i]==0 ) memErr = 1;
|
209454
|
0 |
0 |
if( memErr ){
|
209476
|
0 |
0 |
if( !pGeomCtx ) return SQLITE_NOMEM;
|
209501
|
0 |
0 |
if( !pGeomCtx ){
|
209502
|
0 |
0 |
if( xDestructor ) xDestructor(pContext);
|
225798
|
0 |
0 |
if( fts5yypParser ){
|
225893
|
0 |
0 |
while( pParser->fts5yytos>pParser->fts5yystack ) fts5yy_pop_parser_stack(pParser);
|
225913
|
0 |
0 |
if( p==0 ) return;
|
225977
|
0 |
0 |
if( stateno>fts5YY_MAX_SHIFT ) return stateno;
|
225991
|
0 |
0 |
if( fts5yy_lookahead[i]!=iLookAhead ){
|
226073
|
0 |
0 |
while( fts5yypParser->fts5yytos>fts5yypParser->fts5yystack ) fts5yy_pop_parser_stack(fts5yypParser);
|
226123
|
0 |
0 |
if( fts5yypParser->fts5yytos>fts5yypParser->fts5yystackEnd ){
|
226137
|
0 |
0 |
if( fts5yyNewState > fts5YY_MAX_SHIFT ){
|
226546
|
0 |
0 |
if( fts5yyact >= fts5YY_MIN_REDUCE ){
|
226569
|
0 |
0 |
if( fts5yyRuleInfoNRhs[fts5yyruleno]==0 ){
|
226578
|
0 |
0 |
if( fts5yypParser->fts5yytos>=fts5yypParser->fts5yystackEnd ){
|
226592
|
0 |
0 |
}else if( fts5yyact <= fts5YY_MAX_SHIFTREDUCE ){
|
226598
|
0 |
0 |
}else if( fts5yyact==fts5YY_ACCEPT_ACTION ){
|
226791
|
0 |
0 |
while( rc==SQLITE_OK && pIter->iInst<pIter->nInst ){
|
|
0 |
0 |
while( rc==SQLITE_OK && pIter->iInst<pIter->nInst ){
|
226794
|
0 |
0 |
if( rc==SQLITE_OK ){
|
226795
|
0 |
0 |
if( ic==pIter->iCol ){
|
226797
|
0 |
0 |
if( pIter->iStart<0 ){
|
226800
|
0 |
0 |
}else if( io<=pIter->iEnd ){
|
226801
|
0 |
0 |
if( iEnd>pIter->iEnd ) pIter->iEnd = iEnd;
|
226831
|
0 |
0 |
if( rc==SQLITE_OK ){
|
226871
|
0 |
0 |
if( *pRc==SQLITE_OK && z ){
|
|
0 |
0 |
if( *pRc==SQLITE_OK && z ){
|
226872
|
0 |
0 |
if( n<0 ) n = (int)strlen(z);
|
226874
|
0 |
0 |
if( p->zOut==0 ) *pRc = SQLITE_NOMEM;
|
226895
|
0 |
0 |
if( tflags & FTS5_TOKEN_COLOCATED ) return SQLITE_OK;
|
226898
|
0 |
0 |
if( p->iRangeEnd>=0 ){
|
226899
|
0 |
0 |
if( iPos<p->iRangeStart || iPos>p->iRangeEnd ) return SQLITE_OK;
|
|
0 |
0 |
if( iPos<p->iRangeStart || iPos>p->iRangeEnd ) return SQLITE_OK;
|
226900
|
0 |
0 |
if( p->iRangeStart && iPos==p->iRangeStart ) p->iOff = iStartOff;
|
|
0 |
0 |
if( p->iRangeStart && iPos==p->iRangeStart ) p->iOff = iStartOff;
|
226903
|
0 |
0 |
if( iPos==p->iter.iStart ){
|
226909
|
0 |
0 |
if( iPos==p->iter.iEnd ){
|
226910
|
0 |
0 |
if( p->iRangeEnd>=0 && p->iter.iStart<p->iRangeStart ){
|
|
0 |
0 |
if( p->iRangeEnd>=0 && p->iter.iStart<p->iRangeStart ){
|
226916
|
0 |
0 |
if( rc==SQLITE_OK ){
|
226921
|
0 |
0 |
if( p->iRangeEnd>=0 && iPos==p->iRangeEnd ){
|
|
0 |
0 |
if( p->iRangeEnd>=0 && iPos==p->iRangeEnd ){
|
226924
|
0 |
0 |
if( iPos>=p->iter.iStart && iPos<p->iter.iEnd ){
|
|
0 |
0 |
if( iPos>=p->iter.iStart && iPos<p->iter.iEnd ){
|
226946
|
0 |
0 |
if( nVal!=3 ){
|
226959
|
0 |
0 |
if( ctx.zIn ){
|
226960
|
0 |
0 |
if( rc==SQLITE_OK ){
|
226964
|
0 |
0 |
if( rc==SQLITE_OK ){
|
226969
|
0 |
0 |
if( rc==SQLITE_OK ){
|
226974
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
227000
|
0 |
0 |
if( p->nFirstAlloc==p->nFirst ){
|
227001
|
0 |
0 |
int nNew = p->nFirstAlloc ? p->nFirstAlloc*2 : 64;
|
227005
|
0 |
0 |
if( aNew==0 ) return SQLITE_NOMEM;
|
227031
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ){
|
227033
|
0 |
0 |
if( p->iPos>0 ){
|
227036
|
0 |
0 |
for(i=iStartOff-1; i>=0; i--){
|
227038
|
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;
|
227040
|
0 |
0 |
if( i!=iStartOff-1 && (c=='.' || c==':') ){
|
|
0 |
0 |
if( i!=iStartOff-1 && (c=='.' || c==':') ){
|
|
0 |
0 |
if( i!=iStartOff-1 && (c=='.' || c==':') ){
|
227074
|
0 |
0 |
for(i=0; i<nInst && rc==SQLITE_OK; i++){
|
|
0 |
0 |
for(i=0; i<nInst && rc==SQLITE_OK; i++){
|
227076
|
0 |
0 |
if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff<iEnd ){
|
|
0 |
0 |
if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff<iEnd ){
|
|
0 |
0 |
if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff<iEnd ){
|
|
0 |
0 |
if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff<iEnd ){
|
227077
|
0 |
0 |
nScore += (aSeen[ip] ? 1 : 1000);
|
227079
|
0 |
0 |
if( iFirst<0 ) iFirst = iOff;
|
227085
|
0 |
0 |
if( piPos ){
|
227087
|
0 |
0 |
if( (iAdj+nToken)>nDocsize ) iAdj = nDocsize - nToken;
|
227088
|
0 |
0 |
if( iAdj<0 ) iAdj = 0;
|
227102
|
0 |
0 |
return zRet ? zRet : "";
|
227131
|
0 |
0 |
if( nVal!=5 ){
|
227149
|
0 |
0 |
if( aSeen==0 ){
|
227152
|
0 |
0 |
if( rc==SQLITE_OK ){
|
227157
|
0 |
0 |
for(i=0; i<nCol; i++){
|
227158
|
0 |
0 |
if( iCol<0 || iCol==i ){
|
|
0 |
0 |
if( iCol<0 || iCol==i ){
|
227165
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
227169
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
227171
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
227173
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii<nInst; ii++){
|
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii<nInst; ii++){
|
227180
|
0 |
0 |
if( ic!=i ) continue;
|
227181
|
0 |
0 |
if( io>nDocsize ) rc = FTS5_CORRUPT;
|
227182
|
0 |
0 |
if( rc!=SQLITE_OK ) continue;
|
227187
|
0 |
0 |
if( rc==SQLITE_OK && nScore>nBestScore ){
|
|
0 |
0 |
if( rc==SQLITE_OK && nScore>nBestScore ){
|
227194
|
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 ){
|
227195
|
0 |
0 |
for(jj=0; jj<(sFinder.nFirst-1); jj++){
|
227196
|
0 |
0 |
if( sFinder.aFirst[jj+1]>io ) break;
|
227199
|
0 |
0 |
if( sFinder.aFirst[jj]<io ){
|
227205
|
0 |
0 |
nScore += (sFinder.aFirst[jj]==0 ? 120 : 100);
|
227206
|
0 |
0 |
if( rc==SQLITE_OK && nScore>nBestScore ){
|
|
0 |
0 |
if( rc==SQLITE_OK && nScore>nBestScore ){
|
227218
|
0 |
0 |
if( rc==SQLITE_OK ){
|
227221
|
0 |
0 |
if( rc==SQLITE_OK && nColSize==0 ){
|
|
0 |
0 |
if( rc==SQLITE_OK && nColSize==0 ){
|
227224
|
0 |
0 |
if( ctx.zIn ){
|
227225
|
0 |
0 |
if( rc==SQLITE_OK ){
|
227232
|
0 |
0 |
if( iBestStart>0 ){
|
227238
|
0 |
0 |
while( ctx.iter.iStart>=0 && ctx.iter.iStart<iBestStart && rc==SQLITE_OK ){
|
|
0 |
0 |
while( ctx.iter.iStart>=0 && ctx.iter.iStart<iBestStart && rc==SQLITE_OK ){
|
|
0 |
0 |
while( ctx.iter.iStart>=0 && ctx.iter.iStart<iBestStart && rc==SQLITE_OK ){
|
227242
|
0 |
0 |
if( rc==SQLITE_OK ){
|
227245
|
0 |
0 |
if( ctx.iRangeEnd>=(nColSize-1) ){
|
227251
|
0 |
0 |
if( rc==SQLITE_OK ){
|
227304
|
0 |
0 |
if( p==0 ){
|
227315
|
0 |
0 |
if( p==0 ){
|
227325
|
0 |
0 |
if( rc==SQLITE_OK ) rc = pApi->xRowCount(pFts, &nRow);
|
227327
|
0 |
0 |
if( rc==SQLITE_OK ) rc = pApi->xColumnTotalSize(pFts, -1, &nToken);
|
227328
|
0 |
0 |
if( rc==SQLITE_OK ) p->avgdl = (double)nToken / (double)nRow;
|
227331
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nPhrase; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nPhrase; i++){
|
227334
|
0 |
0 |
if( rc==SQLITE_OK ){
|
227349
|
0 |
0 |
if( idf<=0.0 ) idf = 1e-6;
|
227354
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
227359
|
0 |
0 |
if( rc!=SQLITE_OK ) p = 0;
|
227388
|
0 |
0 |
if( rc==SQLITE_OK ){
|
227393
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nInst; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nInst; i++){
|
227396
|
0 |
0 |
if( rc==SQLITE_OK ){
|
227397
|
0 |
0 |
double w = (nVal > ic) ? sqlite3_value_double(apVal[ic]) : 1.0;
|
227403
|
0 |
0 |
if( rc==SQLITE_OK ){
|
227411
|
0 |
0 |
if( rc==SQLITE_OK ){
|
227412
|
0 |
0 |
for(i=0; i<pData->nPhrase; i++){
|
227438
|
1244 |
0 |
for(i=0; rc==SQLITE_OK && i<ArraySize(aBuiltin); i++){
|
|
933 |
311 |
for(i=0; rc==SQLITE_OK && i<ArraySize(aBuiltin); i++){
|
227468
|
0 |
0 |
if( (u32)pBuf->nSpace<nByte ){
|
227469
|
0 |
0 |
u64 nNew = pBuf->nSpace ? pBuf->nSpace : 64;
|
227471
|
0 |
0 |
while( nNew<nByte ){
|
227475
|
0 |
0 |
if( pNew==0 ){
|
227492
|
0 |
0 |
if( fts5BufferGrow(pRc, pBuf, 9) ) return;
|
|
0 |
0 |
if( fts5BufferGrow(pRc, pBuf, 9) ) return;
|
227518
|
0 |
0 |
if( nData ){
|
227519
|
0 |
0 |
if( fts5BufferGrow(pRc, pBuf, nData) ) return;
|
|
0 |
0 |
if( fts5BufferGrow(pRc, pBuf, nData) ) return;
|
227553
|
0 |
0 |
if( *pRc==SQLITE_OK ){
|
227560
|
0 |
0 |
if( zTmp==0 ){
|
227571
|
0 |
0 |
if( *pRc==SQLITE_OK ){
|
227576
|
0 |
0 |
if( zRet==0 ){
|
227621
|
0 |
0 |
if( i>=n ){
|
227628
|
0 |
0 |
fts5FastGetVarint32(a, i, iVal);
|
227629
|
0 |
0 |
if( iVal<=1 ){
|
227630
|
0 |
0 |
if( iVal==0 ){
|
227634
|
0 |
0 |
fts5FastGetVarint32(a, i, iVal);
|
227637
|
0 |
0 |
fts5FastGetVarint32(a, i, iVal);
|
227638
|
0 |
0 |
if( iVal<2 ){
|
227659
|
0 |
0 |
if( sqlite3Fts5PoslistNext64(pIter->a, pIter->n, &pIter->i, &pIter->iPos) ){
|
227687
|
0 |
0 |
if( iPos>=*piPrev ){
|
227689
|
0 |
0 |
if( (iPos & colmask) != (*piPrev & colmask) ){
|
227705
|
0 |
0 |
if( fts5BufferGrow(&rc, pBuf, 5+5+5) ) return rc;
|
|
0 |
0 |
if( fts5BufferGrow(&rc, pBuf, 5+5+5) ) return rc;
|
227712
|
0 |
0 |
if( *pRc==SQLITE_OK ){
|
227714
|
0 |
0 |
if( pRet==0 ){
|
227715
|
0 |
0 |
if( nByte>0 ) *pRc = SQLITE_NOMEM;
|
227733
|
0 |
0 |
if( *pRc==SQLITE_OK ){
|
227734
|
0 |
0 |
if( nIn<0 ){
|
227738
|
0 |
0 |
if( zRet ){
|
227771
|
0 |
0 |
return (t & 0x80) || aBareword[(int)t];
|
|
0 |
0 |
return (t & 0x80) || aBareword[(int)t];
|
227803
|
0 |
0 |
if( p ){
|
227812
|
0 |
0 |
for(i=nTerm-1; i>=0; i--){
|
227818
|
0 |
0 |
for(pEntry=p->apHash[hash]; pEntry; pEntry=pEntry->pNext){
|
227819
|
0 |
0 |
if( pEntry->iIdx==iIdx
|
227820
|
0 |
0 |
&& pEntry->nTerm==nTerm
|
227821
|
0 |
0 |
&& memcmp(pEntry->pTerm, pTerm, nTerm)==0
|
227828
|
0 |
0 |
if( pEntry==0 ){
|
227830
|
0 |
0 |
if( pEntry ){
|
227845
|
0 |
0 |
if( p ){
|
227847
|
0 |
0 |
for(i=0; i<ArraySize(p->apHash); i++){
|
227849
|
0 |
0 |
while( pEntry ){
|
227891
|
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=='`');
|
227901
|
0 |
0 |
if( p ){
|
227902
|
0 |
0 |
while( fts5_iswhitespace(*p) ){ p++; }
|
227914
|
0 |
0 |
while ( sqlite3Fts5IsBareword(*p) ) p++;
|
227915
|
0 |
0 |
if( p==pIn ) p = 0;
|
227920
|
0 |
0 |
return (a>='0' && a<='9');
|
|
0 |
0 |
return (a>='0' && a<='9');
|
227929
|
0 |
0 |
if( sqlite3_strnicmp("null", p, 4)==0 ){
|
227938
|
0 |
0 |
if( *p=='\'' ){
|
227940
|
0 |
0 |
while( (*p>='a' && *p<='f')
|
|
0 |
0 |
while( (*p>='a' && *p<='f')
|
227941
|
0 |
0 |
|| (*p>='A' && *p<='F')
|
|
0 |
0 |
|| (*p>='A' && *p<='F')
|
227942
|
0 |
0 |
|| (*p>='0' && *p<='9')
|
|
0 |
0 |
|| (*p>='0' && *p<='9')
|
227946
|
0 |
0 |
if( *p=='\'' && 0==((p-pIn)%2) ){
|
|
0 |
0 |
if( *p=='\'' && 0==((p-pIn)%2) ){
|
227958
|
0 |
0 |
while( p ){
|
227959
|
0 |
0 |
if( *p=='\'' ){
|
227961
|
0 |
0 |
if( *p!='\'' ) break;
|
227964
|
0 |
0 |
if( *p==0 ) p = 0;
|
227970
|
0 |
0 |
if( *p=='+' || *p=='-' ) p++;
|
|
0 |
0 |
if( *p=='+' || *p=='-' ) p++;
|
227971
|
0 |
0 |
while( fts5_isdigit(*p) ) p++;
|
227976
|
0 |
0 |
if( *p=='.' && fts5_isdigit(p[1]) ){
|
|
0 |
0 |
if( *p=='.' && fts5_isdigit(p[1]) ){
|
227978
|
0 |
0 |
while( fts5_isdigit(*p) ) p++;
|
227980
|
0 |
0 |
if( p==pIn ) p = 0;
|
228009
|
0 |
0 |
if( q=='[' ) q = ']';
|
228011
|
0 |
0 |
while( z[iIn] ){
|
228012
|
0 |
0 |
if( z[iIn]==q ){
|
228013
|
0 |
0 |
if( z[iIn+1]!=q ){
|
228051
|
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=='`' ){
|
228072
|
0 |
0 |
for(i=0; aEnum[i].zName; i++){
|
228073
|
0 |
0 |
if( sqlite3_strnicmp(aEnum[i].zName, zEnum, nEnum)==0 ){
|
228074
|
0 |
0 |
if( iVal>=0 ) return SQLITE_ERROR;
|
228101
|
0 |
0 |
if( sqlite3_strnicmp("prefix", zCmd, nCmd)==0 ){
|
228105
|
0 |
0 |
if( pConfig->aPrefix==0 ){
|
228107
|
0 |
0 |
if( rc ) return rc;
|
228114
|
0 |
0 |
while( p[0]==' ' ) p++;
|
228115
|
0 |
0 |
if( bFirst==0 && p[0]==',' ){
|
|
0 |
0 |
if( bFirst==0 && p[0]==',' ){
|
228117
|
0 |
0 |
while( p[0]==' ' ) p++;
|
228118
|
0 |
0 |
}else if( p[0]=='\0' ){
|
228121
|
0 |
0 |
if( p[0]<'0' || p[0]>'9' ){
|
|
0 |
0 |
if( p[0]<'0' || p[0]>'9' ){
|
228127
|
0 |
0 |
if( pConfig->nPrefix==FTS5_MAX_PREFIX_INDEXES ){
|
228135
|
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 ){
|
228140
|
0 |
0 |
if( nPre<=0 || nPre>=1000 ){
|
|
0 |
0 |
if( nPre<=0 || nPre>=1000 ){
|
228154
|
0 |
0 |
if( sqlite3_strnicmp("tokenize", zCmd, nCmd)==0 ){
|
228161
|
0 |
0 |
if( azArg && pSpace ){
|
|
0 |
0 |
if( azArg && pSpace ){
|
228162
|
0 |
0 |
if( pConfig->pTok ){
|
228166
|
0 |
0 |
for(nArg=0; p && *p; nArg++){
|
|
0 |
0 |
for(nArg=0; p && *p; nArg++){
|
228168
|
0 |
0 |
if( *p2=='\'' ){
|
228173
|
0 |
0 |
if( p ){
|
228181
|
0 |
0 |
if( p==0 ){
|
228198
|
0 |
0 |
if( sqlite3_strnicmp("content", zCmd, nCmd)==0 ){
|
228199
|
0 |
0 |
if( pConfig->eContent!=FTS5_CONTENT_NORMAL ){
|
228203
|
0 |
0 |
if( zArg[0] ){
|
228213
|
0 |
0 |
if( sqlite3_strnicmp("content_rowid", zCmd, nCmd)==0 ){
|
228214
|
0 |
0 |
if( pConfig->zContentRowid ){
|
228223
|
0 |
0 |
if( sqlite3_strnicmp("columnsize", zCmd, nCmd)==0 ){
|
228224
|
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' ){
|
228233
|
0 |
0 |
if( sqlite3_strnicmp("detail", zCmd, nCmd)==0 ){
|
228241
|
0 |
0 |
if( (rc = fts5ConfigSetEnum(aDetail, zArg, &pConfig->eDetail)) ){
|
228291
|
0 |
0 |
if( zOut==0 ){
|
228295
|
0 |
0 |
if( fts5_isopenquote(zOut[0]) ){
|
228301
|
0 |
0 |
if( zRet ){
|
228307
|
0 |
0 |
if( zRet==0 ){
|
228323
|
0 |
0 |
if( 0==sqlite3_stricmp(zCol, FTS5_RANK_NAME)
|
228324
|
0 |
0 |
|| 0==sqlite3_stricmp(zCol, FTS5_ROWID_NAME)
|
228328
|
0 |
0 |
}else if( zArg ){
|
228329
|
0 |
0 |
if( 0==sqlite3_stricmp(zArg, "unindexed") ){
|
228350
|
0 |
0 |
if( p->eContent!=FTS5_CONTENT_NONE ){
|
228351
|
0 |
0 |
for(i=0; i<p->nCol; i++){
|
228352
|
0 |
0 |
if( p->eContent==FTS5_CONTENT_EXTERNAL ){
|
228391
|
0 |
0 |
if( pRet==0 ) return SQLITE_NOMEM;
|
228398
|
0 |
0 |
pRet->abUnindexed = pRet->azCol ? (u8*)&pRet->azCol[nArg] : 0;
|
228406
|
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 ){
|
228412
|
0 |
0 |
for(i=3; rc==SQLITE_OK && i<nArg; i++){
|
|
0 |
0 |
for(i=3; rc==SQLITE_OK && i<nArg; i++){
|
228422
|
0 |
0 |
if( z && *z=='=' ){
|
|
0 |
0 |
if( z && *z=='=' ){
|
228426
|
0 |
0 |
if( bMustBeCol ) z = 0;
|
228429
|
0 |
0 |
if( z && z[0] ){
|
|
0 |
0 |
if( z && z[0] ){
|
228432
|
0 |
0 |
if( z && z[0] ) z = 0;
|
|
0 |
0 |
if( z && z[0] ) z = 0;
|
228435
|
0 |
0 |
if( rc==SQLITE_OK ){
|
228436
|
0 |
0 |
if( z==0 ){
|
228440
|
0 |
0 |
if( bOption ){
|
228441
|
0 |
0 |
rc = fts5ConfigParseSpecial(pGlobal, pRet,
|
|
0 |
0 |
rc = fts5ConfigParseSpecial(pGlobal, pRet,
|
228460
|
0 |
0 |
if( rc==SQLITE_OK && pRet->pTok==0 ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pRet->pTok==0 ){
|
228465
|
0 |
0 |
if( rc==SQLITE_OK && pRet->zContent==0 ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pRet->zContent==0 ){
|
228470
|
0 |
0 |
if( pRet->eContent==FTS5_CONTENT_NORMAL ){
|
228472
|
0 |
0 |
}else if( pRet->bColumnsize ){
|
228476
|
0 |
0 |
if( zTail ){
|
228483
|
0 |
0 |
if( rc==SQLITE_OK && pRet->zContentRowid==0 ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pRet->zContentRowid==0 ){
|
228488
|
0 |
0 |
if( rc==SQLITE_OK ){
|
228492
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
228503
|
0 |
0 |
if( pConfig ){
|
228505
|
0 |
0 |
if( pConfig->pTok ){
|
228510
|
0 |
0 |
for(i=0; i<pConfig->nCol; i++){
|
228535
|
0 |
0 |
for(i=0; zSql && i<pConfig->nCol; i++){
|
|
0 |
0 |
for(i=0; zSql && i<pConfig->nCol; i++){
|
228536
|
0 |
0 |
const char *zSep = (i==0?"":", ");
|
228544
|
0 |
0 |
if( zSql ){
|
228582
|
0 |
0 |
if( pText==0 ) return SQLITE_OK;
|
228601
|
0 |
0 |
if( p==0 || *p==')' ) break;
|
|
0 |
0 |
if( p==0 || *p==')' ) break;
|
228602
|
0 |
0 |
if( *p!=',' ){
|
228635
|
0 |
0 |
if( p==0 ){
|
228642
|
0 |
0 |
if( p ){
|
228644
|
0 |
0 |
if( zRank ) memcpy(zRank, pRank, p-pRank);
|
228649
|
0 |
0 |
if( rc==SQLITE_OK ){
|
228651
|
0 |
0 |
if( *p!='(' ) rc = SQLITE_ERROR;
|
228654
|
0 |
0 |
if( rc==SQLITE_OK ){
|
228658
|
0 |
0 |
if( *p!=')' ){
|
228660
|
0 |
0 |
if( p==0 ){
|
228664
|
0 |
0 |
if( zRankArgs ) memcpy(zRankArgs, pArgs, p-pArgs);
|
228670
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
228688
|
0 |
0 |
if( 0==sqlite3_stricmp(zKey, "pgsz") ){
|
228690
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
|
228693
|
0 |
0 |
if( pgsz<32 || pgsz>FTS5_MAX_PAGE_SIZE ){
|
|
0 |
0 |
if( pgsz<32 || pgsz>FTS5_MAX_PAGE_SIZE ){
|
228700
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "hashsize") ){
|
228702
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
|
228705
|
0 |
0 |
if( nHashSize<=0 ){
|
228712
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "automerge") ){
|
228714
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
|
228717
|
0 |
0 |
if( nAutomerge<0 || nAutomerge>64 ){
|
|
0 |
0 |
if( nAutomerge<0 || nAutomerge>64 ){
|
228720
|
0 |
0 |
if( nAutomerge==1 ) nAutomerge = FTS5_DEFAULT_AUTOMERGE;
|
228725
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "usermerge") ){
|
228727
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
|
228730
|
0 |
0 |
if( nUsermerge<2 || nUsermerge>16 ){
|
|
0 |
0 |
if( nUsermerge<2 || nUsermerge>16 ){
|
228737
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "crisismerge") ){
|
228739
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
|
228742
|
0 |
0 |
if( nCrisisMerge<0 ){
|
228745
|
0 |
0 |
if( nCrisisMerge<=1 ) nCrisisMerge = FTS5_DEFAULT_CRISISMERGE;
|
228746
|
0 |
0 |
if( nCrisisMerge>=FTS5_MAX_SEGMENT ) nCrisisMerge = FTS5_MAX_SEGMENT-1;
|
228751
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "rank") ){
|
228756
|
0 |
0 |
if( rc==SQLITE_OK ){
|
228761
|
0 |
0 |
}else if( rc==SQLITE_ERROR ){
|
228767
|
0 |
0 |
else if( 0==sqlite3_stricmp(zKey, "secure-delete") ){
|
228769
|
0 |
0 |
if( SQLITE_INTEGER==sqlite3_value_numeric_type(pVal) ){
|
228772
|
0 |
0 |
if( bVal<0 ){
|
228801
|
0 |
0 |
if( zSql ){
|
228807
|
0 |
0 |
if( rc==SQLITE_OK ){
|
228808
|
0 |
0 |
while( SQLITE_ROW==sqlite3_step(p) ){
|
228811
|
0 |
0 |
if( 0==sqlite3_stricmp(zK, "version") ){
|
228821
|
0 |
0 |
if( rc==SQLITE_OK
|
228822
|
0 |
0 |
&& iVersion!=FTS5_CURRENT_VERSION
|
228823
|
0 |
0 |
&& iVersion!=FTS5_CURRENT_VERSION_SECUREDELETE
|
228826
|
0 |
0 |
if( pConfig->pzErrmsg ){
|
228837
|
0 |
0 |
if( rc==SQLITE_OK ){
|
229014
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){
|
229023
|
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';
|
229038
|
0 |
0 |
while( fts5ExprIsspace(*z) ) z++;
|
229060
|
0 |
0 |
if( z2[0]=='"' ){
|
229062
|
0 |
0 |
if( z2[0]!='"' ) break;
|
229064
|
0 |
0 |
if( z2[0]=='\0' ){
|
229075
|
0 |
0 |
if( sqlite3Fts5IsBareword(z[0])==0 ){
|
229080
|
0 |
0 |
for(z2=&z[1]; sqlite3Fts5IsBareword(*z2); z2++);
|
229082
|
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;
|
229083
|
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;
|
229084
|
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;
|
229116
|
0 |
0 |
if( pEngine==0 ){ return SQLITE_NOMEM; }
|
229122
|
0 |
0 |
}while( sParse.rc==SQLITE_OK && t!=FTS5_EOF );
|
|
0 |
0 |
}while( sParse.rc==SQLITE_OK && t!=FTS5_EOF );
|
229129
|
0 |
0 |
if( iCol<pConfig->nCol && sParse.pExpr && sParse.rc==SQLITE_OK ){
|
|
0 |
0 |
if( iCol<pConfig->nCol && sParse.pExpr && sParse.rc==SQLITE_OK ){
|
|
0 |
0 |
if( iCol<pConfig->nCol && sParse.pExpr && sParse.rc==SQLITE_OK ){
|
229132
|
0 |
0 |
if( pColset ){
|
229140
|
0 |
0 |
if( sParse.rc==SQLITE_OK ){
|
229142
|
0 |
0 |
if( pNew==0 ){
|
229146
|
0 |
0 |
if( !sParse.pExpr ){
|
229149
|
0 |
0 |
if( pNew->pRoot ){
|
229178
|
0 |
0 |
for(ii=0; ii<nByte; ii++){
|
229179
|
0 |
0 |
if( (z[ii] & 0xC0)!=0x80 ) nRet++;
|
229199
|
0 |
0 |
if( zExpr==0 ){
|
229207
|
0 |
0 |
if( bGlob==0 ){
|
229217
|
0 |
0 |
while( i<=nText ){
|
229218
|
0 |
0 |
if( i==nText
|
229219
|
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]
|
229222
|
0 |
0 |
if( fts5ExprCountChar(&zText[iFirst], i-iFirst)>=3 ){
|
229225
|
0 |
0 |
for(jj=iFirst; jj<i; jj++){
|
229227
|
0 |
0 |
if( zText[jj]=='"' ) zExpr[iOut++] = '"';
|
229232
|
0 |
0 |
if( zText[i]==aSpec[2] ){
|
229234
|
0 |
0 |
if( zText[i-1]=='^' ) i++;
|
229235
|
0 |
0 |
while( i<nText && zText[i]!=']' ) i++;
|
|
0 |
0 |
while( i<nText && zText[i]!=']' ) i++;
|
229241
|
0 |
0 |
if( iOut>0 ){
|
229243
|
0 |
0 |
if( pConfig->eDetail!=FTS5_DETAIL_FULL ){
|
229245
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_NONE ){
|
229264
|
0 |
0 |
if( p ){
|
229266
|
0 |
0 |
for(i=0; i<p->nChild; i++){
|
229278
|
0 |
0 |
if( p ){
|
229289
|
0 |
0 |
if( *pp1 && p2 ){
|
|
0 |
0 |
if( *pp1 && p2 ){
|
229296
|
0 |
0 |
if( sParse.rc==SQLITE_OK ){
|
229300
|
0 |
0 |
if( ap==0 ){
|
229305
|
0 |
0 |
for(i=0; i<p2->nPhrase; i++){
|
229314
|
0 |
0 |
}else if( p2 ){
|
229333
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){
|
229334
|
0 |
0 |
if( 0==sqlite3Fts5IterEof(p->pIter) ){
|
229336
|
0 |
0 |
if( bRetValid==0 || (bDesc!=(iRowid<iRet)) ){
|
|
0 |
0 |
if( bRetValid==0 || (bDesc!=(iRowid<iRet)) ){
|
229343
|
0 |
0 |
if( pbEof && bRetValid==0 ) *pbEof = 1;
|
|
0 |
0 |
if( pbEof && bRetValid==0 ) *pbEof = 1;
|
229364
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){
|
229366
|
0 |
0 |
if( sqlite3Fts5IterEof(pIter)==0 && pIter->iRowid==iRowid ){
|
|
0 |
0 |
if( sqlite3Fts5IterEof(pIter)==0 && pIter->iRowid==iRowid ){
|
229367
|
0 |
0 |
if( pIter->nData==0 ) continue;
|
229368
|
0 |
0 |
if( nIter==nAlloc ){
|
229371
|
0 |
0 |
if( aNew==0 ){
|
229377
|
0 |
0 |
if( aIter!=aStatic ) sqlite3_free(aIter);
|
229386
|
0 |
0 |
if( nIter==1 ){
|
229396
|
0 |
0 |
for(i=0; i<nIter; i++){
|
229397
|
0 |
0 |
if( aIter[i].bEof==0 ){
|
229398
|
0 |
0 |
if( aIter[i].iPos==iPrev ){
|
229399
|
0 |
0 |
if( sqlite3Fts5PoslistReaderNext(&aIter[i]) ) continue;
|
229401
|
0 |
0 |
if( aIter[i].iPos<iMin ){
|
229406
|
0 |
0 |
if( iMin==FTS5_LARGEST_INT64 || rc!=SQLITE_OK ) break;
|
|
0 |
0 |
if( iMin==FTS5_LARGEST_INT64 || rc!=SQLITE_OK ) break;
|
229410
|
0 |
0 |
if( rc==SQLITE_OK ){
|
229417
|
0 |
0 |
if( aIter!=aStatic ) sqlite3_free(aIter);
|
229449
|
0 |
0 |
if( pPhrase->nTerm>ArraySize(aStatic) ){
|
229452
|
0 |
0 |
if( !aIter ) return SQLITE_NOMEM;
|
229457
|
0 |
0 |
for(i=0; i<pPhrase->nTerm; i++){
|
229462
|
0 |
0 |
if( pTerm->pSynonym ){
|
229465
|
0 |
0 |
if( rc ){
|
229469
|
0 |
0 |
if( a==buf.p ) bFlag = 1;
|
229476
|
0 |
0 |
if( aIter[i].bEof ) goto ismatch_out;
|
229484
|
0 |
0 |
for(i=0; i<pPhrase->nTerm; i++){
|
229487
|
0 |
0 |
if( pPos->iPos!=iAdj ){
|
229489
|
0 |
0 |
while( pPos->iPos<iAdj ){
|
229490
|
0 |
0 |
if( sqlite3Fts5PoslistReaderNext(pPos) ) goto ismatch_out;
|
229492
|
0 |
0 |
if( pPos->iPos>iAdj ) iPos = pPos->iPos-i;
|
229495
|
0 |
0 |
}while( bMatch==0 );
|
229498
|
0 |
0 |
if( bFirst==0 || FTS5_POS2OFFSET(iPos)==0 ){
|
|
0 |
0 |
if( bFirst==0 || FTS5_POS2OFFSET(iPos)==0 ){
|
229500
|
0 |
0 |
if( rc!=SQLITE_OK ) goto ismatch_out;
|
229503
|
0 |
0 |
for(i=0; i<pPhrase->nTerm; i++){
|
229504
|
0 |
0 |
if( sqlite3Fts5PoslistReaderNext(&aIter[i]) ) goto ismatch_out;
|
229510
|
0 |
0 |
for(i=0; i<pPhrase->nTerm; i++){
|
229511
|
0 |
0 |
if( aIter[i].bFlag ) sqlite3_free((u8*)aIter[i].a);
|
229513
|
0 |
0 |
if( aIter!=aStatic ) sqlite3_free(aIter);
|
229530
|
0 |
0 |
if( sqlite3Fts5PoslistNext64(p->a, p->n, &p->i, &p->iLookahead) ){
|
229584
|
0 |
0 |
if( pNear->nPhrase>ArraySize(aStatic) ){
|
229590
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
229603
|
0 |
0 |
for(i=0; i<pNear->nPhrase; i++){
|
229620
|
0 |
0 |
for(i=0; i<pNear->nPhrase; i++){
|
229623
|
0 |
0 |
if( pPos->iPos<iMin || pPos->iPos>iMax ){
|
|
0 |
0 |
if( pPos->iPos<iMin || pPos->iPos>iMax ){
|
229625
|
0 |
0 |
while( pPos->iPos<iMin ){
|
229626
|
0 |
0 |
if( fts5LookaheadReaderNext(pPos) ) goto ismatch_out;
|
229628
|
0 |
0 |
if( pPos->iPos>iMax ) iMax = pPos->iPos;
|
229631
|
0 |
0 |
}while( bMatch==0 );
|
229634
|
0 |
0 |
for(i=0; i<pNear->nPhrase; i++){
|
229637
|
0 |
0 |
if( a[i].pOut->n==0 || iPos!=pWriter->iPrev ){
|
|
0 |
0 |
if( a[i].pOut->n==0 || iPos!=pWriter->iPrev ){
|
229644
|
0 |
0 |
for(i=0; i<pNear->nPhrase; i++){
|
229645
|
0 |
0 |
if( a[i].reader.iLookahead < iMin ){
|
229650
|
0 |
0 |
if( fts5LookaheadReaderNext(&a[iAdv].reader) ) goto ismatch_out;
|
229656
|
0 |
0 |
if( a!=aStatic ) sqlite3_free(a);
|
229681
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast<iRowid) ){
|
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast<iRowid) ){
|
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast<iRowid) ){
|
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast<iRowid) ){
|
229683
|
0 |
0 |
if( rc || sqlite3Fts5IterEof(pIter) ){
|
|
0 |
0 |
if( rc || sqlite3Fts5IterEof(pIter) ){
|
229707
|
0 |
0 |
for(p=pTerm; rc==SQLITE_OK && p; p=p->pSynonym){
|
|
0 |
0 |
for(p=pTerm; rc==SQLITE_OK && p; p=p->pSynonym){
|
229708
|
0 |
0 |
if( sqlite3Fts5IterEof(p->pIter)==0 ){
|
229710
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast<iRowid) ){
|
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast<iRowid) ){
|
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast<iRowid) ){
|
|
0 |
0 |
if( (bDesc==0 && iLast>iRowid) || (bDesc && iLast<iRowid) ){
|
229716
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
229734
|
0 |
0 |
if( pExpr->pConfig->eDetail!=FTS5_DETAIL_FULL ){
|
229738
|
0 |
0 |
for(pTerm=&pPhrase->aTerm[0]; pTerm; pTerm=pTerm->pSynonym){
|
229740
|
0 |
0 |
if( sqlite3Fts5IterEof(pIter)==0 ){
|
229741
|
0 |
0 |
if( pIter->iRowid==pNode->iRowid && pIter->nData>0 ){
|
|
0 |
0 |
if( pIter->iRowid==pNode->iRowid && pIter->nData>0 ){
|
229753
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<pNear->nPhrase; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<pNear->nPhrase; i++){
|
229755
|
0 |
0 |
if( pPhrase->nTerm>1 || pPhrase->aTerm[0].pSynonym
|
|
0 |
0 |
if( pPhrase->nTerm>1 || pPhrase->aTerm[0].pSynonym
|
229756
|
0 |
0 |
|| pNear->pColset || pPhrase->aTerm[0].bFirst
|
|
0 |
0 |
|| pNear->pColset || pPhrase->aTerm[0].bFirst
|
229760
|
0 |
0 |
if( bMatch==0 ) break;
|
229768
|
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)) ){
|
229793
|
0 |
0 |
for(i=0; i<pNear->nPhrase; i++){
|
229795
|
0 |
0 |
if( pPhrase->nTerm==0 ){
|
229800
|
0 |
0 |
for(j=0; j<pPhrase->nTerm; j++){
|
229805
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){
|
229807
|
0 |
0 |
if( p->pIter ){
|
229814
|
0 |
0 |
(pExpr->bDesc ? FTS5INDEX_QUERY_DESC : 0),
|
229819
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
229820
|
0 |
0 |
if( 0==sqlite3Fts5IterEof(p->pIter) ){
|
229825
|
0 |
0 |
if( bHit==0 ){
|
229853
|
0 |
0 |
if( pExpr->bDesc==0 ){
|
229854
|
0 |
0 |
if( iLhs<iRhs ) return -1;
|
229857
|
0 |
0 |
if( iLhs>iRhs ) return -1;
|
229866
|
0 |
0 |
for(i=0; i<pNode->nChild; i++){
|
229872
|
0 |
0 |
if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){
|
|
0 |
0 |
if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){
|
229875
|
0 |
0 |
for(i=0; i<pNear->nPhrase; i++){
|
229881
|
0 |
0 |
for(i=0; i<pNode->nChild; i++){
|
229906
|
0 |
0 |
if( p2->bEof ) return -1;
|
229907
|
0 |
0 |
if( p1->bEof ) return +1;
|
229945
|
0 |
0 |
if( pLeft->aTerm[0].pSynonym ){
|
229953
|
0 |
0 |
for(i=0; i<pNear->nPhrase; i++){
|
229955
|
0 |
0 |
for(j=0; j<pPhrase->nTerm; j++){
|
229957
|
0 |
0 |
if( pTerm->pSynonym ){
|
229959
|
0 |
0 |
if( iRowid==iLast ) continue;
|
229961
|
0 |
0 |
if( fts5ExprSynonymAdvanceto(pTerm, bDesc, &iLast, &rc) ){
|
229968
|
0 |
0 |
if( pIter->iRowid==iLast || pIter->bEof ) continue;
|
|
0 |
0 |
if( pIter->iRowid==iLast || pIter->bEof ) continue;
|
229970
|
0 |
0 |
if( fts5ExprAdvanceto(pIter, bDesc, &iLast, &rc, &pNode->bEof) ){
|
229976
|
0 |
0 |
}while( bMatch==0 );
|
229979
|
0 |
0 |
pNode->bNomatch = ((0==fts5ExprNearTest(&rc, pExpr, pNode)) && rc==SQLITE_OK);
|
|
0 |
0 |
pNode->bNomatch = ((0==fts5ExprNearTest(&rc, pExpr, pNode)) && rc==SQLITE_OK);
|
230002
|
0 |
0 |
if( pTerm->pSynonym ){
|
230011
|
0 |
0 |
for(p=pTerm; p; p=p->pSynonym){
|
230012
|
0 |
0 |
if( sqlite3Fts5IterEof(p->pIter)==0 ){
|
230014
|
0 |
0 |
if( ii==iRowid
|
230015
|
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)
|
230017
|
0 |
0 |
if( bFromValid ){
|
230022
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
230023
|
0 |
0 |
if( sqlite3Fts5IterEof(p->pIter)==0 ){
|
230034
|
0 |
0 |
pNode->bEof = (rc || bEof);
|
|
0 |
0 |
pNode->bEof = (rc || bEof);
|
230039
|
0 |
0 |
if( bFromValid ){
|
230045
|
0 |
0 |
pNode->bEof = (rc || sqlite3Fts5IterEof(pIter));
|
|
0 |
0 |
pNode->bEof = (rc || sqlite3Fts5IterEof(pIter));
|
230048
|
0 |
0 |
if( pNode->bEof==0 ){
|
230074
|
0 |
0 |
if( pExpr->pConfig->eDetail==FTS5_DETAIL_FULL ){
|
230095
|
0 |
0 |
if( bFromValid ){
|
230100
|
0 |
0 |
if( rc==SQLITE_OK && sqlite3Fts5IterEof(pIter)==0 ){
|
|
0 |
0 |
if( rc==SQLITE_OK && sqlite3Fts5IterEof(pIter)==0 ){
|
230116
|
0 |
0 |
for(i=1; i<pNode->nChild; i++){
|
230119
|
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) ){
|
230137
|
0 |
0 |
for(i=0; i<pNode->nChild; i++){
|
230140
|
0 |
0 |
if( p1->bEof==0 ){
|
230141
|
0 |
0 |
if( (p1->iRowid==iLast)
|
230142
|
0 |
0 |
|| (bFromValid && fts5RowidCmp(pExpr, p1->iRowid, iFrom)<0)
|
|
0 |
0 |
|| (bFromValid && fts5RowidCmp(pExpr, p1->iRowid, iFrom)<0)
|
230145
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
230173
|
0 |
0 |
for(iChild=0; iChild<pAnd->nChild; iChild++){
|
230176
|
0 |
0 |
if( cmp>0 ){
|
230179
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
230190
|
0 |
0 |
if( pChild->bEof ){
|
230194
|
0 |
0 |
}else if( iLast!=pChild->iRowid ){
|
230199
|
0 |
0 |
if( pChild->bNomatch ){
|
230203
|
0 |
0 |
}while( bMatch==0 );
|
230205
|
0 |
0 |
if( pAnd->bNomatch && pAnd!=pExpr->pRoot ){
|
|
0 |
0 |
if( pAnd->bNomatch && pAnd!=pExpr->pRoot ){
|
230219
|
0 |
0 |
if( rc==SQLITE_OK ){
|
230236
|
0 |
0 |
while( rc==SQLITE_OK && p1->bEof==0 ){
|
|
0 |
0 |
while( rc==SQLITE_OK && p1->bEof==0 ){
|
230238
|
0 |
0 |
if( cmp>0 ){
|
230243
|
0 |
0 |
if( cmp || p2->bNomatch ) break;
|
|
0 |
0 |
if( cmp || p2->bNomatch ) break;
|
230249
|
0 |
0 |
if( p1->bEof ){
|
230262
|
0 |
0 |
if( rc==SQLITE_OK ){
|
230265
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
230281
|
0 |
0 |
if( pNode->bEof==0 ){
|
230326
|
0 |
0 |
if( Fts5NodeIsString(pNode) ){
|
|
0 |
0 |
if( Fts5NodeIsString(pNode) ){
|
230329
|
0 |
0 |
}else if( pNode->xNext==0 ){
|
230334
|
0 |
0 |
for(i=0; i<pNode->nChild && rc==SQLITE_OK; i++){
|
|
0 |
0 |
for(i=0; i<pNode->nChild && rc==SQLITE_OK; i++){
|
230344
|
0 |
0 |
if( nEof>0 ) fts5ExprSetEof(pNode);
|
230348
|
0 |
0 |
if( pNode->nChild==nEof ) fts5ExprSetEof(pNode);
|
230358
|
0 |
0 |
if( rc==SQLITE_OK ){
|
230390
|
0 |
0 |
if( rc==SQLITE_OK
|
230391
|
0 |
0 |
&& 0==pRoot->bEof
|
230392
|
0 |
0 |
&& fts5RowidCmp(p, pRoot->iRowid, iFirst)<0
|
230398
|
0 |
0 |
while( pRoot->bNomatch && rc==SQLITE_OK ){
|
|
0 |
0 |
while( pRoot->bNomatch && rc==SQLITE_OK ){
|
230418
|
0 |
0 |
}while( pRoot->bNomatch );
|
230419
|
0 |
0 |
if( fts5RowidCmp(p, pRoot->iRowid, iLast)>0 ){
|
230443
|
0 |
0 |
if( pPhrase ){
|
230445
|
0 |
0 |
for(i=0; i<pPhrase->nTerm; i++){
|
230451
|
0 |
0 |
for(pSyn=pTerm->pSynonym; pSyn; pSyn=pNext){
|
230458
|
0 |
0 |
if( pPhrase->poslist.nSpace>0 ) fts5BufferFree(&pPhrase->poslist);
|
230468
|
0 |
0 |
if( pPhrase && pPhrase->nTerm ){
|
|
0 |
0 |
if( pPhrase && pPhrase->nTerm ){
|
230489
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){
|
230490
|
0 |
0 |
if( pPhrase==0 ){
|
230493
|
0 |
0 |
if( pNear==0 ){
|
230497
|
0 |
0 |
if( pRet==0 ){
|
230502
|
0 |
0 |
}else if( (pNear->nPhrase % SZALLOC)==0 ){
|
230508
|
0 |
0 |
if( pRet==0 ){
|
230516
|
0 |
0 |
if( pRet==0 ){
|
230521
|
0 |
0 |
if( pRet->nPhrase>0 ){
|
230527
|
0 |
0 |
if( pPhrase->nTerm==0 ){
|
230532
|
0 |
0 |
}else if( pLast->nTerm==0 ){
|
230569
|
0 |
0 |
if( pCtx->rc!=SQLITE_OK ) return pCtx->rc;
|
230570
|
0 |
0 |
if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE;
|
230572
|
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) ){
|
230576
|
0 |
0 |
if( pSyn==0 ){
|
230587
|
0 |
0 |
if( pPhrase==0 || (pPhrase->nTerm % SZALLOC)==0 ){
|
|
0 |
0 |
if( pPhrase==0 || (pPhrase->nTerm % SZALLOC)==0 ){
|
230589
|
0 |
0 |
int nNew = SZALLOC + (pPhrase ? pPhrase->nTerm : 0);
|
230594
|
0 |
0 |
if( pNew==0 ){
|
230597
|
0 |
0 |
if( pPhrase==0 ) memset(pNew, 0, sizeof(Fts5ExprPhrase));
|
230603
|
0 |
0 |
if( rc==SQLITE_OK ){
|
230626
|
0 |
0 |
if( pNear ){
|
230628
|
0 |
0 |
for(i=0; i<pNear->nPhrase; i++){
|
230642
|
0 |
0 |
if( (pParse->nPhrase % 8)==0 ){
|
230646
|
0 |
0 |
if( apNew==0 ){
|
230675
|
0 |
0 |
if( rc==SQLITE_OK ){
|
230676
|
0 |
0 |
int flags = FTS5_TOKENIZE_QUERY | (bPrefix ? FTS5_TOKENIZE_PREFIX : 0);
|
230683
|
0 |
0 |
if( rc || (rc = sCtx.rc) ){
|
|
0 |
0 |
if( rc || (rc = sCtx.rc) ){
|
230689
|
0 |
0 |
if( pAppend==0 ){
|
230690
|
0 |
0 |
if( parseGrowPhraseArray(pParse) ){
|
230697
|
0 |
0 |
if( sCtx.pPhrase==0 ){
|
230701
|
0 |
0 |
}else if( sCtx.pPhrase->nTerm ){
|
230726
|
0 |
0 |
if( rc==SQLITE_OK ){
|
230730
|
0 |
0 |
if( rc==SQLITE_OK ){
|
230734
|
0 |
0 |
if( rc==SQLITE_OK ){
|
230738
|
0 |
0 |
if( rc==SQLITE_OK ){
|
230740
|
0 |
0 |
if( pColsetOrig ){
|
230745
|
0 |
0 |
if( pColset ){
|
230752
|
0 |
0 |
if( pOrig->nTerm ){
|
230754
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<pOrig->nTerm; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<pOrig->nTerm; i++){
|
230757
|
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){
|
230763
|
0 |
0 |
if( rc==SQLITE_OK ){
|
230774
|
0 |
0 |
if( rc==SQLITE_OK && ALWAYS(sCtx.pPhrase) ){
|
|
0 |
0 |
if( rc==SQLITE_OK && ALWAYS(sCtx.pPhrase) ){
|
230784
|
0 |
0 |
if( pOrig->nTerm==1
|
230785
|
0 |
0 |
&& pOrig->aTerm[0].pSynonym==0
|
230786
|
0 |
0 |
&& pOrig->aTerm[0].bFirst==0
|
230811
|
0 |
0 |
if( pTok->n!=4 || memcmp("NEAR", pTok->p, 4) ){
|
|
0 |
0 |
if( pTok->n!=4 || memcmp("NEAR", pTok->p, 4) ){
|
230823
|
0 |
0 |
if( pNear ){
|
230826
|
0 |
0 |
if( p->n ){
|
230827
|
0 |
0 |
for(i=0; i<p->n; i++){
|
230829
|
0 |
0 |
if( c<'0' || c>'9' ){
|
|
0 |
0 |
if( c<'0' || c>'9' ){
|
230858
|
0 |
0 |
int nCol = p ? p->nCol : 0; /* Num. columns already in colset object */
|
230865
|
0 |
0 |
if( pNew==0 ){
|
230870
|
0 |
0 |
for(i=0; i<nCol; i++){
|
230871
|
0 |
0 |
if( aiCol[i]==iCol ) return pNew;
|
230872
|
0 |
0 |
if( aiCol[i]>iCol ) break;
|
230874
|
0 |
0 |
for(j=nCol; j>i; j--){
|
230901
|
0 |
0 |
if( pRet ){
|
230904
|
0 |
0 |
for(i=0; i<nCol; i++){
|
230905
|
0 |
0 |
if( iOld>=p->nCol || p->aiCol[iOld]!=i ){
|
|
0 |
0 |
if( iOld>=p->nCol || p->aiCol[iOld]!=i ){
|
230927
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){
|
230930
|
0 |
0 |
for(iCol=0; iCol<pConfig->nCol; iCol++){
|
230931
|
0 |
0 |
if( 0==sqlite3_stricmp(pConfig->azCol[iCol], z) ) break;
|
230933
|
0 |
0 |
if( iCol==pConfig->nCol ){
|
230941
|
0 |
0 |
if( pRet==0 ){
|
230959
|
0 |
0 |
if( pOrig ){
|
230962
|
0 |
0 |
if( pRet ){
|
230979
|
0 |
0 |
while( iIn<pColset->nCol && iMerge<pMerge->nCol ){
|
|
0 |
0 |
while( iIn<pColset->nCol && iMerge<pMerge->nCol ){
|
230981
|
0 |
0 |
if( iDiff==0 ){
|
230985
|
0 |
0 |
}else if( iDiff>0 ){
|
231006
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){
|
231011
|
0 |
0 |
if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){
|
|
0 |
0 |
if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){
|
231013
|
0 |
0 |
if( pNear->pColset ){
|
231015
|
0 |
0 |
if( pNear->pColset->nCol==0 ){
|
231019
|
0 |
0 |
}else if( *ppFree ){
|
231028
|
0 |
0 |
for(i=0; i<pNode->nChild; i++){
|
231044
|
0 |
0 |
if( pParse->pConfig->eDetail==FTS5_DETAIL_NONE ){
|
231058
|
0 |
0 |
if( pNear->nPhrase==1 && pNear->apPhrase[0]->nTerm==1
|
|
0 |
0 |
if( pNear->nPhrase==1 && pNear->apPhrase[0]->nTerm==1
|
231059
|
0 |
0 |
&& pNear->apPhrase[0]->aTerm[0].pSynonym==0
|
231060
|
0 |
0 |
&& pNear->apPhrase[0]->aTerm[0].bFirst==0
|
231089
|
0 |
0 |
if( p->eType!=FTS5_NOT && pSub->eType==p->eType ){
|
|
0 |
0 |
if( p->eType!=FTS5_NOT && pSub->eType==p->eType ){
|
231097
|
0 |
0 |
for( ; ii<p->nChild; ii++){
|
231127
|
0 |
0 |
if( pRet ){
|
231133
|
0 |
0 |
for(ii=0; ii<nTerm; ii++){
|
231137
|
0 |
0 |
if( pPhrase ){
|
231138
|
0 |
0 |
if( parseGrowPhraseArray(pParse) ){
|
231153
|
0 |
0 |
if( pParse->rc ){
|
231177
|
0 |
0 |
if( pParse->rc==SQLITE_OK ){
|
231184
|
0 |
0 |
if( eType==FTS5_STRING && pNear==0 ) return 0;
|
|
0 |
0 |
if( eType==FTS5_STRING && pNear==0 ) return 0;
|
231185
|
0 |
0 |
if( eType!=FTS5_STRING && pLeft==0 ) return pRight;
|
|
0 |
0 |
if( eType!=FTS5_STRING && pLeft==0 ) return pRight;
|
231186
|
0 |
0 |
if( eType!=FTS5_STRING && pRight==0 ) return pLeft;
|
|
0 |
0 |
if( eType!=FTS5_STRING && pRight==0 ) return pLeft;
|
231188
|
0 |
0 |
if( eType==FTS5_STRING
|
231189
|
0 |
0 |
&& pParse->bPhraseToAnd
|
231190
|
0 |
0 |
&& pNear->apPhrase[0]->nTerm>1
|
231194
|
0 |
0 |
if( eType==FTS5_NOT ){
|
231196
|
0 |
0 |
}else if( eType==FTS5_AND || eType==FTS5_OR ){
|
|
0 |
0 |
}else if( eType==FTS5_AND || eType==FTS5_OR ){
|
231198
|
0 |
0 |
if( pLeft->eType==eType ) nChild += pLeft->nChild-1;
|
231199
|
0 |
0 |
if( pRight->eType==eType ) nChild += pRight->nChild-1;
|
231205
|
0 |
0 |
if( pRet ){
|
231209
|
0 |
0 |
if( eType==FTS5_STRING ){
|
231211
|
0 |
0 |
for(iPhrase=0; iPhrase<pNear->nPhrase; iPhrase++){
|
231213
|
0 |
0 |
if( pNear->apPhrase[iPhrase]->nTerm==0 ){
|
231219
|
0 |
0 |
if( pParse->pConfig->eDetail!=FTS5_DETAIL_FULL ){
|
231221
|
0 |
0 |
if( pNear->nPhrase!=1
|
231222
|
0 |
0 |
|| pPhrase->nTerm>1
|
231223
|
0 |
0 |
|| (pPhrase->nTerm>0 && pPhrase->aTerm[0].bFirst)
|
|
0 |
0 |
|| (pPhrase->nTerm>0 && pPhrase->aTerm[0].bFirst)
|
231225
|
0 |
0 |
sqlite3Fts5ParseError(pParse,
|
231236
|
0 |
0 |
if( pRet->iHeight>SQLITE_FTS5_MAX_EXPR_DEPTH ){
|
231249
|
0 |
0 |
if( pRet==0 ){
|
231266
|
0 |
0 |
if( pParse->rc ){
|
231281
|
0 |
0 |
if( pLeft->eType==FTS5_AND ){
|
231291
|
0 |
0 |
if( pRight->eType==FTS5_EOF ){
|
231297
|
0 |
0 |
else if( pPrev->eType==FTS5_EOF ){
|
231300
|
0 |
0 |
if( pPrev==pLeft ){
|
231733
|
0 |
0 |
return (pExpr ? pExpr->nPhrase : 0);
|
231740
|
0 |
0 |
if( iPhrase<0 || iPhrase>=pExpr->nPhrase ) return 0;
|
|
0 |
0 |
if( iPhrase<0 || iPhrase>=pExpr->nPhrase ) return 0;
|
231752
|
0 |
0 |
if( pNode->bEof==0 && pNode->iRowid==pExpr->pRoot->iRowid ){
|
|
0 |
0 |
if( pNode->bEof==0 && pNode->iRowid==pExpr->pRoot->iRowid ){
|
231780
|
0 |
0 |
if( pRet ){
|
231783
|
0 |
0 |
for(i=0; i<pExpr->nPhrase; i++){
|
231787
|
0 |
0 |
if( bLive &&
|
|
0 |
0 |
if( bLive &&
|
231788
|
0 |
0 |
(pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof)
|
|
0 |
0 |
(pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof)
|
231811
|
0 |
0 |
for(i=0; i<pColset->nCol; i++){
|
231812
|
0 |
0 |
if( pColset->aiCol[i]==iCol ) return 1;
|
231831
|
0 |
0 |
if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE;
|
231832
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ) p->iOff++;
|
231833
|
0 |
0 |
for(i=0; i<pExpr->nPhrase; i++){
|
231835
|
0 |
0 |
if( p->aPopulator[i].bOk==0 ) continue;
|
231836
|
0 |
0 |
for(pTerm=&pExpr->apExprPhrase[i]->aTerm[0]; pTerm; pTerm=pTerm->pSynonym){
|
231838
|
0 |
0 |
if( (nTerm==nToken || (nTerm<nToken && pTerm->bPrefix))
|
|
0 |
0 |
if( (nTerm==nToken || (nTerm<nToken && pTerm->bPrefix))
|
|
0 |
0 |
if( (nTerm==nToken || (nTerm<nToken && pTerm->bPrefix))
|
231839
|
0 |
0 |
&& memcmp(pTerm->zTerm, pToken, nTerm)==0
|
231844
|
0 |
0 |
if( rc ) return rc;
|
231865
|
0 |
0 |
for(i=0; i<pExpr->nPhrase; i++){
|
231868
|
0 |
0 |
if( (pColset && 0==fts5ExprColsetTest(pColset, iCol))
|
|
0 |
0 |
if( (pColset && 0==fts5ExprColsetTest(pColset, iCol))
|
231869
|
0 |
0 |
|| aPopulator[i].bMiss
|
231883
|
0 |
0 |
if( pNode->eType==FTS5_TERM || pNode->eType==FTS5_STRING ){
|
|
0 |
0 |
if( pNode->eType==FTS5_TERM || pNode->eType==FTS5_STRING ){
|
231887
|
0 |
0 |
for(i=0; i<pNode->nChild; i++){
|
231903
|
0 |
0 |
for(i=0; i<pNode->nChild; i++){
|
231904
|
0 |
0 |
if( fts5ExprCheckPoslists(pNode->apChild[i], iRowid)==0 ){
|
231915
|
0 |
0 |
for(i=0; i<pNode->nChild; i++){
|
231916
|
0 |
0 |
if( fts5ExprCheckPoslists(pNode->apChild[i], iRowid) ){
|
231925
|
0 |
0 |
if( 0==fts5ExprCheckPoslists(pNode->apChild[0], iRowid)
|
231926
|
0 |
0 |
|| 0!=fts5ExprCheckPoslists(pNode->apChild[1], iRowid)
|
231957
|
0 |
0 |
if( pNode->bEof==0
|
231958
|
0 |
0 |
&& pNode->iRowid==pExpr->pRoot->iRowid
|
231959
|
0 |
0 |
&& pPhrase->poslist.n>0
|
231962
|
0 |
0 |
if( pTerm->pSynonym ){
|
232068
|
0 |
0 |
if( pNew==0 ){
|
232079
|
0 |
0 |
if( pNew->aSlot==0 ){
|
232094
|
0 |
0 |
if( pHash ){
|
232106
|
0 |
0 |
for(i=0; i<pHash->nSlot; i++){
|
232109
|
0 |
0 |
for(pSlot=pHash->aSlot[i]; pSlot; pSlot=pNext){
|
232121
|
0 |
0 |
for(i=n-1; i>=0; i--){
|
232130
|
0 |
0 |
for(i=n-1; i>=0; i--){
|
232147
|
0 |
0 |
if( !apNew ) return SQLITE_NOMEM;
|
232150
|
0 |
0 |
for(i=0; i<pHash->nSlot; i++){
|
232151
|
0 |
0 |
while( apOld[i] ){
|
232174
|
0 |
0 |
if( p->iSzPoslist ){
|
232175
|
0 |
0 |
u8 *pPtr = p2 ? (u8*)p2 : (u8*)p;
|
232177
|
0 |
0 |
if( pHash->eDetail==FTS5_DETAIL_NONE ){
|
232179
|
0 |
0 |
if( p->bDel ){
|
232181
|
0 |
0 |
if( p->bContent ){
|
232190
|
0 |
0 |
if( nPos<=127 ){
|
232201
|
0 |
0 |
if( p2==0 ){
|
232237
|
0 |
0 |
for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){
|
232239
|
0 |
0 |
if( zKey[0]==bByte
|
232240
|
0 |
0 |
&& p->nKey==nToken
|
232241
|
0 |
0 |
&& memcmp(&zKey[1], pToken, nToken)==0
|
232248
|
0 |
0 |
if( p==0 ){
|
232252
|
0 |
0 |
if( nByte<128 ) nByte = 128;
|
232255
|
0 |
0 |
if( (pHash->nEntry*2)>=pHash->nSlot ){
|
232257
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
232263
|
0 |
0 |
if( !p ) return SQLITE_NOMEM;
|
232282
|
0 |
0 |
if( pHash->eDetail!=FTS5_DETAIL_NONE ){
|
232284
|
0 |
0 |
p->iCol = (pHash->eDetail==FTS5_DETAIL_FULL ? 0 : -1);
|
232299
|
0 |
0 |
if( (p->nAlloc - p->nData) < (9 + 4 + 1 + 3 + 5) ){
|
232304
|
0 |
0 |
if( pNew==0 ) return SQLITE_NOMEM;
|
232306
|
0 |
0 |
for(pp=&pHash->aSlot[iHash]; *pp!=p; pp=&(*pp)->pHashNext);
|
232318
|
0 |
0 |
if( iRowid!=p->iRowid ){
|
232325
|
0 |
0 |
if( pHash->eDetail!=FTS5_DETAIL_NONE ){
|
232327
|
0 |
0 |
p->iCol = (pHash->eDetail==FTS5_DETAIL_FULL ? 0 : -1);
|
232332
|
0 |
0 |
if( iCol>=0 ){
|
232333
|
0 |
0 |
if( pHash->eDetail==FTS5_DETAIL_NONE ){
|
232338
|
0 |
0 |
if( iCol!=p->iCol ){
|
232339
|
0 |
0 |
if( pHash->eDetail==FTS5_DETAIL_FULL ){
|
232351
|
0 |
0 |
if( bNew ){
|
232381
|
0 |
0 |
while( p1 || p2 ){
|
|
0 |
0 |
while( p1 || p2 ){
|
232382
|
0 |
0 |
if( p1==0 ){
|
232385
|
0 |
0 |
}else if( p2==0 ){
|
232392
|
0 |
0 |
while( zKey1[i]==zKey2[i] ) i++;
|
232394
|
0 |
0 |
if( ((u8)zKey1[i])>((u8)zKey2[i]) ){
|
232431
|
0 |
0 |
if( !ap ) return SQLITE_NOMEM;
|
232434
|
0 |
0 |
for(iSlot=0; iSlot<pHash->nSlot; iSlot++){
|
232436
|
0 |
0 |
for(pIter=pHash->aSlot[iSlot]; pIter; pIter=pIter->pHashNext){
|
232437
|
0 |
0 |
if( pTerm==0
|
232438
|
0 |
0 |
|| (pIter->nKey+1>=nTerm && 0==memcmp(fts5EntryKey(pIter), pTerm, nTerm))
|
|
0 |
0 |
|| (pIter->nKey+1>=nTerm && 0==memcmp(fts5EntryKey(pIter), pTerm, nTerm))
|
232442
|
0 |
0 |
for(i=0; ap[i]; i++){
|
232452
|
0 |
0 |
for(i=0; i<nMergeSlot; i++){
|
232476
|
0 |
0 |
for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){
|
232479
|
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;
|
232482
|
0 |
0 |
if( p ){
|
232486
|
0 |
0 |
if( pRet ){
|
232526
|
0 |
0 |
if( (p = pHash->pScan) ){
|
233147
|
0 |
0 |
res = fts5Memcmp(pLeft->p, pRight->p, nCmp);
|
233148
|
0 |
0 |
return (res==0 ? (pLeft->n - pRight->n) : res);
|
233161
|
0 |
0 |
if( p->pReader ){
|
233176
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
233179
|
0 |
0 |
if( p->pReader ){
|
233188
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
233191
|
0 |
0 |
if( rc==SQLITE_ABORT ) rc = SQLITE_OK;
|
233196
|
0 |
0 |
if( p->pReader==0 && rc==SQLITE_OK ){
|
|
0 |
0 |
if( p->pReader==0 && rc==SQLITE_OK ){
|
233208
|
0 |
0 |
if( rc==SQLITE_ERROR ) rc = FTS5_CORRUPT;
|
233210
|
0 |
0 |
if( rc==SQLITE_OK ){
|
233215
|
0 |
0 |
if( pRet ){
|
233222
|
0 |
0 |
if( rc==SQLITE_OK ){
|
233225
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
233254
|
0 |
0 |
if( pRet ){
|
233255
|
0 |
0 |
if( pRet->nn<4 || pRet->szLeaf>pRet->nn ){
|
|
0 |
0 |
if( pRet->nn<4 || pRet->szLeaf>pRet->nn ){
|
233269
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
233270
|
0 |
0 |
if( zSql ){
|
233287
|
0 |
0 |
if( p->rc!=SQLITE_OK ) return;
|
233289
|
0 |
0 |
if( p->pWriter==0 ){
|
233295
|
0 |
0 |
if( p->rc ) return;
|
233311
|
0 |
0 |
if( p->rc!=SQLITE_OK ) return;
|
233313
|
0 |
0 |
if( p->pDeleter==0 ){
|
233319
|
0 |
0 |
if( fts5IndexPrepareStmt(p, &p->pDeleter, zSql) ) return;
|
233335
|
0 |
0 |
if( p->pIdxDeleter==0 ){
|
233342
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
233354
|
0 |
0 |
if( pStruct && 0>=(--pStruct->nRef) ){
|
|
0 |
0 |
if( pStruct && 0>=(--pStruct->nRef) ){
|
233357
|
0 |
0 |
for(i=0; i<pStruct->nLevel; i++){
|
233373
|
0 |
0 |
if( p ){
|
233378
|
0 |
0 |
if( p->pStruct!=(Fts5Structure*)pStruct ){
|
233392
|
0 |
0 |
if( *pRc==SQLITE_OK && p->nRef>1 ){
|
|
0 |
0 |
if( *pRc==SQLITE_OK && p->nRef>1 ){
|
233396
|
0 |
0 |
if( pNew ){
|
233399
|
0 |
0 |
for(i=0; i<p->nLevel; i++) pNew->aLevel[i].aSeg = 0;
|
233400
|
0 |
0 |
for(i=0; i<p->nLevel; i++){
|
233404
|
0 |
0 |
if( pLvl->aSeg==0 ){
|
233405
|
0 |
0 |
for(i=0; i<p->nLevel; i++){
|
233447
|
0 |
0 |
if( piCookie ) *piCookie = sqlite3Fts5Get32(pData);
|
233454
|
0 |
0 |
if( nLevel>FTS5_MAX_SEGMENT || nLevel<0
|
|
0 |
0 |
if( nLevel>FTS5_MAX_SEGMENT || nLevel<0
|
233455
|
0 |
0 |
|| nSegment>FTS5_MAX_SEGMENT || nSegment<0
|
|
0 |
0 |
|| nSegment>FTS5_MAX_SEGMENT || nSegment<0
|
233465
|
0 |
0 |
if( pRet ){
|
233471
|
0 |
0 |
for(iLvl=0; rc==SQLITE_OK && iLvl<nLevel; iLvl++){
|
|
0 |
0 |
for(iLvl=0; rc==SQLITE_OK && iLvl<nLevel; iLvl++){
|
233476
|
0 |
0 |
if( i>=nData ){
|
233481
|
0 |
0 |
if( nTotal<pLvl->nMerge ) rc = FTS5_CORRUPT;
|
233488
|
0 |
0 |
if( rc==SQLITE_OK ){
|
233490
|
0 |
0 |
for(iSeg=0; iSeg<nTotal; iSeg++){
|
233492
|
0 |
0 |
if( i>=nData ){
|
233500
|
0 |
0 |
if( pSeg->pgnoLast<pSeg->pgnoFirst ){
|
233505
|
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;
|
233506
|
0 |
0 |
if( iLvl==nLevel-1 && pLvl->nMerge ) rc = FTS5_CORRUPT;
|
|
0 |
0 |
if( iLvl==nLevel-1 && pLvl->nMerge ) rc = FTS5_CORRUPT;
|
233509
|
0 |
0 |
if( nSegment!=0 && rc==SQLITE_OK ) rc = FTS5_CORRUPT;
|
|
0 |
0 |
if( nSegment!=0 && rc==SQLITE_OK ) rc = FTS5_CORRUPT;
|
233511
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
233528
|
0 |
0 |
if( *pRc==SQLITE_OK ){
|
233537
|
0 |
0 |
if( pStruct ){
|
233558
|
0 |
0 |
if( *pRc==SQLITE_OK ){
|
233565
|
0 |
0 |
if( aNew ){
|
233566
|
0 |
0 |
if( bInsert==0 ){
|
233587
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
233591
|
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) ){
|
233595
|
0 |
0 |
if( p->rc!=SQLITE_OK ){
|
233607
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
233608
|
0 |
0 |
if( p->pDataVersion==0 ){
|
233612
|
0 |
0 |
if( p->rc ) return 0;
|
233615
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(p->pDataVersion) ){
|
233637
|
0 |
0 |
if( p->pStruct==0 ){
|
233639
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
233667
|
0 |
0 |
if( p->rc!=SQLITE_OK ) return 0;
|
233675
|
0 |
0 |
if( p->pStruct ){
|
233718
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
233728
|
0 |
0 |
if( iCookie<0 ) iCookie = 0;
|
233730
|
0 |
0 |
if( 0==sqlite3Fts5BufferSize(&p->rc, &buf, 4+9+9+9) ){
|
233738
|
0 |
0 |
for(iLvl=0; iLvl<pStruct->nLevel; iLvl++){
|
233745
|
0 |
0 |
for(iSeg=0; iSeg<pLvl->nSeg; iSeg++){
|
233790
|
0 |
0 |
if( pOut->nMerge==0 ){
|
233791
|
0 |
0 |
for(il=iPromote+1; il<pStruct->nLevel; il++){
|
233793
|
0 |
0 |
if( pLvl->nMerge ) return;
|
233794
|
0 |
0 |
for(is=pLvl->nSeg-1; is>=0; is--){
|
233796
|
0 |
0 |
if( sz>szPromote ) return;
|
233798
|
0 |
0 |
if( p->rc ) return;
|
233829
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
233837
|
0 |
0 |
if( nSeg==0 ) return;
|
233842
|
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--);
|
233843
|
0 |
0 |
if( iTst>=0 ){
|
233848
|
0 |
0 |
for(i=0; i<pTst->nSeg; i++){
|
233850
|
0 |
0 |
if( sz>szMax ) szMax = sz;
|
233852
|
0 |
0 |
if( szMax>=szSeg ){
|
233862
|
0 |
0 |
if( iPromote<0 ){
|
233878
|
0 |
0 |
if( pLvl->iOff==0 ){
|
233886
|
0 |
0 |
for(iOff=pLvl->iOff; iOff<pData->nn; iOff++){
|
233887
|
0 |
0 |
if( pData->p[iOff] ) break;
|
233890
|
0 |
0 |
if( iOff<pData->nn ){
|
233911
|
0 |
0 |
if( fts5DlidxLvlNext(pLvl) ){
|
233912
|
0 |
0 |
if( (iLvl+1) < pIter->nLvl ){
|
233914
|
0 |
0 |
if( pLvl[1].bEof==0 ){
|
233920
|
0 |
0 |
if( pLvl->pData ) fts5DlidxLvlNext(pLvl);
|
233944
|
0 |
0 |
for(i=0; i<pIter->nLvl; i++){
|
233952
|
0 |
0 |
return p->rc!=SQLITE_OK || pIter->aLvl[0].bEof;
|
|
0 |
0 |
return p->rc!=SQLITE_OK || pIter->aLvl[0].bEof;
|
233959
|
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--){
|
233961
|
0 |
0 |
while( fts5DlidxLvlNext(pLvl)==0 );
|
233964
|
0 |
0 |
if( i>0 ){
|
233982
|
0 |
0 |
if( iOff<=pLvl->iFirstOff ){
|
233994
|
0 |
0 |
while( a[ii]==0 ){
|
234000
|
0 |
0 |
if( ii>=iOff ) break;
|
234014
|
0 |
0 |
if( fts5DlidxLvlPrev(pLvl) ){
|
234015
|
0 |
0 |
if( (iLvl+1) < pIter->nLvl ){
|
234017
|
0 |
0 |
if( pLvl[1].bEof==0 ){
|
234023
|
0 |
0 |
if( pLvl->pData ){
|
234024
|
0 |
0 |
while( fts5DlidxLvlNext(pLvl)==0 );
|
234041
|
0 |
0 |
if( pIter ){
|
234043
|
0 |
0 |
for(i=0; i<pIter->nLvl; i++){
|
234060
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){
|
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){
|
234065
|
0 |
0 |
if( pNew==0 ){
|
234073
|
0 |
0 |
if( pLvl->pData && (pLvl->pData->p[0] & 0x0001)==0 ){
|
|
0 |
0 |
if( pLvl->pData && (pLvl->pData->p[0] & 0x0001)==0 ){
|
234080
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
234082
|
0 |
0 |
if( bRev==0 ){
|
234089
|
0 |
0 |
if( p->rc!=SQLITE_OK ){
|
234115
|
0 |
0 |
if( pIter->pNextLeaf ){
|
234118
|
0 |
0 |
}else if( pIter->iLeafPgno<=pSeg->pgnoLast ){
|
234127
|
0 |
0 |
if( pLeaf ){
|
234129
|
0 |
0 |
if( fts5LeafIsTermless(pLeaf) ){
|
234148
|
0 |
0 |
fts5FastGetVarint32(p, n, nSz);
|
234167
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
234170
|
0 |
0 |
if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){
|
234174
|
0 |
0 |
if( iOff<iEod && pIter->pLeaf->p[iOff]==0 ){
|
|
0 |
0 |
if( iOff<iEod && pIter->pLeaf->p[iOff]==0 ){
|
234177
|
0 |
0 |
if( iOff<iEod && pIter->pLeaf->p[iOff]==0 ){
|
|
0 |
0 |
if( iOff<iEod && pIter->pLeaf->p[iOff]==0 ){
|
234186
|
0 |
0 |
fts5FastGetVarint32(pIter->pLeaf->p, iOff, nSz);
|
234200
|
0 |
0 |
while( iOff>=pIter->pLeaf->szLeaf ){
|
234202
|
0 |
0 |
if( pIter->pLeaf==0 ){
|
234203
|
0 |
0 |
if( p->rc==SQLITE_OK ) p->rc = FTS5_CORRUPT;
|
234234
|
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 ){
|
234246
|
0 |
0 |
if( pIter->iPgidxOff>=pIter->pLeaf->nn ){
|
234262
|
0 |
0 |
if( pIter->flags & FTS5_SEGITER_REVERSE ){
|
234264
|
0 |
0 |
}else if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){
|
234284
|
0 |
0 |
if( pSeg->pgnoFirst==0 ){
|
234294
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
234301
|
0 |
0 |
}while( p->rc==SQLITE_OK && pIter->pLeaf && pIter->pLeaf->nn==4 );
|
|
0 |
0 |
}while( p->rc==SQLITE_OK && pIter->pLeaf && pIter->pLeaf->nn==4 );
|
|
0 |
0 |
}while( p->rc==SQLITE_OK && pIter->pLeaf && pIter->pLeaf->nn==4 );
|
234304
|
0 |
0 |
if( p->rc==SQLITE_OK && pIter->pLeaf ){
|
|
0 |
0 |
if( p->rc==SQLITE_OK && pIter->pLeaf ){
|
234337
|
0 |
0 |
if( n>pIter->iEndofDoclist ){
|
234345
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ){
|
234347
|
0 |
0 |
if( i<n && a[i]==0 ){
|
|
0 |
0 |
if( i<n && a[i]==0 ){
|
234349
|
0 |
0 |
if( i<n && a[i]==0 ) i++;
|
|
0 |
0 |
if( i<n && a[i]==0 ) i++;
|
234357
|
0 |
0 |
if( i>=n ) break;
|
234362
|
0 |
0 |
if( iRowidOffset>=pIter->nRowidOffset ){
|
234365
|
0 |
0 |
if( aNew==0 ){
|
234389
|
0 |
0 |
while( p->rc==SQLITE_OK && pIter->iLeafPgno>pIter->iTermLeafPgno ){
|
|
0 |
0 |
while( p->rc==SQLITE_OK && pIter->iLeafPgno>pIter->iTermLeafPgno ){
|
234395
|
0 |
0 |
if( pNew ){
|
234399
|
0 |
0 |
if( pIter->iLeafPgno==pIter->iTermLeafPgno ){
|
234401
|
0 |
0 |
if( pIter->iTermLeafOffset<pNew->szLeaf ){
|
234408
|
0 |
0 |
if( iRowidOff ){
|
234409
|
0 |
0 |
if( iRowidOff>=pNew->szLeaf ){
|
234418
|
0 |
0 |
if( pIter->pLeaf ){
|
234428
|
0 |
0 |
if( pIter->pLeaf ){
|
234441
|
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);
|
234458
|
0 |
0 |
if( pIter->iRowidOffset>0 ){
|
234467
|
0 |
0 |
if( p->pConfig->eDetail!=FTS5_DETAIL_NONE ){
|
234498
|
0 |
0 |
while( pIter->pSeg && iOff>=pIter->pLeaf->szLeaf ){
|
|
0 |
0 |
while( pIter->pSeg && iOff>=pIter->pLeaf->szLeaf ){
|
234500
|
0 |
0 |
if( p->rc || pIter->pLeaf==0 ) return;
|
|
0 |
0 |
if( p->rc || pIter->pLeaf==0 ) return;
|
234505
|
0 |
0 |
if( iOff<pIter->iEndofDoclist ){
|
234511
|
0 |
0 |
}else if( (pIter->flags & FTS5_SEGITER_ONETERM)==0 ){
|
234512
|
0 |
0 |
if( pIter->pSeg ){
|
234514
|
0 |
0 |
if( iOff!=fts5LeafFirstTermOff(pIter->pLeaf) ){
|
234525
|
0 |
0 |
if( pList==0 ) goto next_none_eof;
|
234534
|
0 |
0 |
if( pbNewTerm ) *pbNewTerm = 1;
|
234577
|
0 |
0 |
if( iOff<n ){
|
234580
|
0 |
0 |
if( iOff>=pIter->iEndofDoclist ){
|
234582
|
0 |
0 |
if( iOff!=fts5LeafFirstTermOff(pLeaf) ){
|
234593
|
0 |
0 |
}else if( pIter->pSeg==0 ){
|
234598
|
0 |
0 |
if( 0==(pIter->flags & FTS5_SEGITER_ONETERM) ){
|
234602
|
0 |
0 |
if( pList==0 ){
|
234618
|
0 |
0 |
while( iOff==0 ){
|
234621
|
0 |
0 |
if( pLeaf==0 ) break;
|
234623
|
0 |
0 |
if( (iOff = fts5LeafFirstRowidOff(pLeaf)) && iOff<pLeaf->szLeaf ){
|
|
0 |
0 |
if( (iOff = fts5LeafFirstRowidOff(pLeaf)) && iOff<pLeaf->szLeaf ){
|
234627
|
0 |
0 |
if( pLeaf->nn>pLeaf->szLeaf ){
|
234633
|
0 |
0 |
else if( pLeaf->nn>pLeaf->szLeaf ){
|
234642
|
0 |
0 |
if( iOff>pLeaf->szLeaf ){
|
234650
|
0 |
0 |
if( pIter->pLeaf ){
|
234651
|
0 |
0 |
if( bNewTerm ){
|
234652
|
0 |
0 |
if( pIter->flags & FTS5_SEGITER_ONETERM ){
|
234658
|
0 |
0 |
if( pbNewTerm ) *pbNewTerm = 1;
|
234666
|
0 |
0 |
fts5FastGetVarint32(pIter->pLeaf->p, pIter->iLeafOffset, nSz);
|
234691
|
0 |
0 |
if( pDlidx && p->pConfig->iVersion==FTS5_CURRENT_VERSION ){
|
|
0 |
0 |
if( pDlidx && p->pConfig->iVersion==FTS5_CURRENT_VERSION ){
|
234702
|
0 |
0 |
if( pIter->iTermLeafPgno==pIter->iLeafPgno ){
|
234707
|
0 |
0 |
fts5IndexSkipVarint(pLeaf->p, iPoslist);
|
|
0 |
0 |
fts5IndexSkipVarint(pLeaf->p, iPoslist);
|
234713
|
0 |
0 |
if( pIter->iEndofDoclist>=pLeaf->szLeaf ){
|
234719
|
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++){
|
234722
|
0 |
0 |
if( pNew ){
|
234726
|
0 |
0 |
if( iRowid ){
|
234731
|
0 |
0 |
if( bTermless==0 ) break;
|
234746
|
0 |
0 |
if( pLast ){
|
234752
|
0 |
0 |
if( iOff>pLast->szLeaf ){
|
234759
|
0 |
0 |
if( fts5LeafIsTermless(pLast) ){
|
234786
|
0 |
0 |
if( pIter->iTermLeafPgno==pIter->iLeafPgno
|
234787
|
0 |
0 |
&& pIter->iEndofDoclist<pLeaf->szLeaf
|
234831
|
0 |
0 |
if( iOff>n ){
|
234839
|
0 |
0 |
fts5FastGetVarint32(a, iOff, nNew);
|
234840
|
0 |
0 |
if( nKeep<nMatch ){
|
234845
|
0 |
0 |
if( nKeep==nMatch ){
|
234849
|
0 |
0 |
for(i=0; i<nCmp; i++){
|
234850
|
0 |
0 |
if( a[iOff+i]!=pTerm[nMatch+i] ) break;
|
234854
|
0 |
0 |
if( (u32)nTerm==nMatch ){
|
234855
|
0 |
0 |
if( i==nNew ){
|
234860
|
0 |
0 |
}else if( i<nNew && a[iOff+i]>pTerm[nMatch] ){
|
|
0 |
0 |
}else if( i<nNew && a[iOff+i]>pTerm[nMatch] ){
|
234865
|
0 |
0 |
if( iPgidx>=n ){
|
234874
|
0 |
0 |
if( iOff>=n ){
|
234880
|
0 |
0 |
fts5FastGetVarint32(a, iOff, nKeep);
|
234884
|
0 |
0 |
if( bGe==0 ){
|
234888
|
0 |
0 |
}else if( bEndOfPage ){
|
234891
|
0 |
0 |
if( pIter->pLeaf==0 ) return;
|
234893
|
0 |
0 |
if( fts5LeafIsTermless(pIter->pLeaf)==0 ){
|
234896
|
0 |
0 |
if( iOff<4 || (i64)iOff>=pIter->pLeaf->szLeaf ){
|
|
0 |
0 |
if( iOff<4 || (i64)iOff>=pIter->pLeaf->szLeaf ){
|
234911
|
0 |
0 |
if( (i64)iOff+nNew>n || nNew<1 ){
|
|
0 |
0 |
if( (i64)iOff+nNew>n || nNew<1 ){
|
234922
|
0 |
0 |
if( iPgidx>=n ){
|
234936
|
0 |
0 |
if( p->pIdxSelect==0 ){
|
234974
|
0 |
0 |
if( p->rc ) return;
|
234977
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pIdxSelect) ){
|
234985
|
0 |
0 |
if( iPg<pSeg->pgnoFirst ){
|
234993
|
0 |
0 |
if( pIter->pLeaf ){
|
234997
|
0 |
0 |
if( p->rc==SQLITE_OK && bGe==0 ){
|
|
0 |
0 |
if( p->rc==SQLITE_OK && bGe==0 ){
|
234999
|
0 |
0 |
if( pIter->pLeaf ){
|
235000
|
0 |
0 |
if( flags & FTS5INDEX_QUERY_DESC ){
|
235003
|
0 |
0 |
if( bDlidx ){
|
235006
|
0 |
0 |
if( flags & FTS5INDEX_QUERY_DESC ){
|
235051
|
0 |
0 |
if( pTerm==0 || (flags & FTS5INDEX_QUERY_SCAN) ){
|
|
0 |
0 |
if( pTerm==0 || (flags & FTS5INDEX_QUERY_SCAN) ){
|
235056
|
0 |
0 |
n = (z ? (int)strlen((const char*)z) : 0);
|
235057
|
0 |
0 |
if( pList ){
|
235059
|
0 |
0 |
if( pLeaf ){
|
235067
|
0 |
0 |
if( pLeaf ){
|
235075
|
0 |
0 |
if( pLeaf ){
|
235082
|
0 |
0 |
if( flags & FTS5INDEX_QUERY_DESC ){
|
235211
|
0 |
0 |
if( iOut>=(pIter->nSeg/2) ){
|
235222
|
0 |
0 |
if( p1->pLeaf==0 ){ /* If p1 is at EOF */
|
235224
|
0 |
0 |
}else if( p2->pLeaf==0 ){ /* If p2 is at EOF */
|
235228
|
0 |
0 |
if( res==0 ){
|
235232
|
0 |
0 |
if( p1->iRowid==p2->iRowid ){
|
235236
|
0 |
0 |
res = ((p1->iRowid > p2->iRowid)==pIter->bRev) ? -1 : +1;
|
235239
|
0 |
0 |
if( res<0 ){
|
235262
|
0 |
0 |
if( iLeafPgno>pIter->pSeg->pgnoLast ){
|
235269
|
0 |
0 |
while( p->rc==SQLITE_OK ){
|
235272
|
0 |
0 |
if( pIter->pLeaf==0 ) break;
|
235274
|
0 |
0 |
if( iOff>0 ){
|
235277
|
0 |
0 |
if( iOff<4 || iOff>=n ){
|
|
0 |
0 |
if( iOff<4 || iOff>=n ){
|
235309
|
0 |
0 |
if( bRev==0 ){
|
235310
|
0 |
0 |
while( !fts5DlidxIterEof(p, pDlidx) && iMatch>fts5DlidxIterRowid(pDlidx) ){
|
|
0 |
0 |
while( !fts5DlidxIterEof(p, pDlidx) && iMatch>fts5DlidxIterRowid(pDlidx) ){
|
235315
|
0 |
0 |
if( iLeafPgno>pIter->iLeafPgno ){
|
235322
|
0 |
0 |
while( !fts5DlidxIterEof(p, pDlidx) && iMatch<fts5DlidxIterRowid(pDlidx) ){
|
|
0 |
0 |
while( !fts5DlidxIterEof(p, pDlidx) && iMatch<fts5DlidxIterRowid(pDlidx) ){
|
235329
|
0 |
0 |
if( iLeafPgno<pIter->iLeafPgno ){
|
235337
|
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);
|
235338
|
0 |
0 |
if( pIter->pLeaf==0 ) break;
|
235339
|
0 |
0 |
if( bRev==0 && pIter->iRowid>=iMatch ) break;
|
|
0 |
0 |
if( bRev==0 && pIter->iRowid>=iMatch ) break;
|
235340
|
0 |
0 |
if( bRev!=0 && pIter->iRowid<=iMatch ) break;
|
|
0 |
0 |
if( bRev!=0 && pIter->iRowid<=iMatch ) break;
|
235342
|
0 |
0 |
}while( p->rc==SQLITE_OK );
|
235350
|
0 |
0 |
if( pIter ){
|
235352
|
0 |
0 |
for(i=0; i<pIter->nSeg; i++){
|
235367
|
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){
|
235369
|
0 |
0 |
if( (iEq = fts5MultiIterDoCompare(pIter, i)) ){
|
235395
|
0 |
0 |
if( pNew->iRowid==pIter->iSwitchRowid
|
235396
|
0 |
0 |
|| (pNew->iRowid<pIter->iSwitchRowid)==pIter->bRev
|
235400
|
0 |
0 |
pIter->iSwitchRowid = pIter->bRev ? SMALLEST_INT64 : LARGEST_INT64;
|
235407
|
0 |
0 |
if( pRes->bTermEq ){
|
235408
|
0 |
0 |
if( pNew->iRowid==pOther->iRowid ){
|
235410
|
0 |
0 |
}else if( (pOther->iRowid>pNew->iRowid)==pIter->bRev ){
|
235413
|
0 |
0 |
}else if( (pOther->iRowid>pIter->iSwitchRowid)==pIter->bRev ){
|
235418
|
0 |
0 |
if( i==1 ) break;
|
235452
|
0 |
0 |
while( p->rc==SQLITE_OK ){
|
235457
|
0 |
0 |
if( bUseFrom && pSeg->pDlidx ){
|
|
0 |
0 |
if( bUseFrom && pSeg->pDlidx ){
|
235463
|
0 |
0 |
if( pSeg->pLeaf==0 || bNewTerm
|
|
0 |
0 |
if( pSeg->pLeaf==0 || bNewTerm
|
235464
|
0 |
0 |
|| fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg)
|
235469
|
0 |
0 |
if( pSeg->pLeaf==0 ) return;
|
235474
|
0 |
0 |
if( pIter->bSkipEmpty==0 || pSeg->nPos ){
|
|
0 |
0 |
if( pIter->bSkipEmpty==0 || pSeg->nPos ){
|
235488
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
235497
|
0 |
0 |
if( pSeg->pLeaf==0 || bNewTerm
|
|
0 |
0 |
if( pSeg->pLeaf==0 || bNewTerm
|
235498
|
0 |
0 |
|| fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg)
|
235506
|
0 |
0 |
}while( fts5MultiIterIsEmpty(p, pIter) );
|
235521
|
0 |
0 |
for(nSlot=2; nSlot<nSeg; nSlot=nSlot*2);
|
235527
|
0 |
0 |
if( pNew ){
|
235543
|
0 |
0 |
if( nChunk>0 ){
|
235568
|
0 |
0 |
for(i=0; i<pColset->nCol; i++){
|
235569
|
0 |
0 |
if( pColset->aiCol[i]==iCol ) return 1;
|
235582
|
0 |
0 |
if( nChunk>0 ){
|
235584
|
0 |
0 |
while( i<nChunk ){
|
235589
|
0 |
0 |
if( fts5IndexColsetTest(pCtx->pColset, iVal) ){
|
235605
|
0 |
0 |
if( nChunk>0 ){
|
235611
|
0 |
0 |
if( pCtx->eState==2 ){
|
235613
|
0 |
0 |
fts5FastGetVarint32(pChunk, i, iCol);
|
235614
|
0 |
0 |
if( fts5IndexColsetTest(pCtx->pColset, iCol) ){
|
235623
|
0 |
0 |
while( i<nChunk && pChunk[i]!=0x01 ){
|
|
0 |
0 |
while( i<nChunk && pChunk[i]!=0x01 ){
|
235624
|
0 |
0 |
while( pChunk[i] & 0x80 ) i++;
|
235627
|
0 |
0 |
if( pCtx->eState ){
|
235630
|
0 |
0 |
if( i<nChunk ){
|
235634
|
0 |
0 |
if( i>=nChunk ){
|
235637
|
0 |
0 |
fts5FastGetVarint32(pChunk, i, iCol);
|
235639
|
0 |
0 |
if( pCtx->eState ){
|
235645
|
0 |
0 |
}while( i<nChunk );
|
235665
|
0 |
0 |
if( (pSeg->flags & FTS5_SEGITER_REVERSE)==0 ){
|
235673
|
0 |
0 |
if( nRem<=0 ){
|
235675
|
0 |
0 |
}else if( pSeg->pSeg==0 ){
|
235681
|
0 |
0 |
if( pData==0 ) break;
|
235684
|
0 |
0 |
if( pgno==pgnoSave ){
|
235707
|
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) ){
|
235711
|
0 |
0 |
if( pColset==0 ){
|
235714
|
0 |
0 |
if( p->pConfig->eDetail==FTS5_DETAIL_FULL ){
|
235750
|
0 |
0 |
if( *pRc==SQLITE_OK ){
|
235757
|
0 |
0 |
if( pColset->nCol>1 && sqlite3Fts5BufferSize(pRc, &pIter->poslist, nPos) ){
|
|
0 |
0 |
if( pColset->nCol>1 && sqlite3Fts5BufferSize(pRc, &pIter->poslist, nPos) ){
|
235762
|
0 |
0 |
while( pColset->aiCol[i]<iCurrent ){
|
235764
|
0 |
0 |
if( i==pColset->nCol ){
|
235773
|
0 |
0 |
while( p<pEnd && *p!=0x01 ){
|
|
0 |
0 |
while( p<pEnd && *p!=0x01 ){
|
235774
|
0 |
0 |
while( *p++ & 0x80 );
|
235777
|
0 |
0 |
if( pColset->aiCol[i]==iCurrent ){
|
235778
|
0 |
0 |
if( pColset->nCol==1 ){
|
235785
|
0 |
0 |
if( p>=pEnd ){
|
235792
|
0 |
0 |
if( iCurrent & 0x80 ){
|
235821
|
0 |
0 |
if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){
|
235872
|
0 |
0 |
if( pSeg->iLeafOffset+pSeg->nPos>pSeg->pLeaf->szLeaf ){
|
235886
|
0 |
0 |
while( a<pEnd ){
|
235888
|
0 |
0 |
while( *aiCol<iPrev ){
|
235890
|
0 |
0 |
if( aiCol==aiColEnd ) goto setoutputs_col_out;
|
235892
|
0 |
0 |
if( *aiCol==iPrev ){
|
235914
|
0 |
0 |
if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){
|
235934
|
0 |
0 |
if( *pRc==SQLITE_OK ){
|
235936
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_NONE ){
|
235940
|
0 |
0 |
else if( pIter->pColset==0 ){
|
235944
|
0 |
0 |
else if( pIter->pColset->nCol==0 ){
|
235948
|
0 |
0 |
else if( pConfig->eDetail==FTS5_DETAIL_FULL ){
|
235954
|
0 |
0 |
if( pConfig->nCol<=100 ){
|
235995
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
235996
|
0 |
0 |
if( iLevel<0 ){
|
235999
|
0 |
0 |
nSeg += (p->pHash && 0==(flags & FTS5INDEX_QUERY_SKIPHASH));
|
|
0 |
0 |
nSeg += (p->pHash && 0==(flags & FTS5INDEX_QUERY_SKIPHASH));
|
236005
|
0 |
0 |
if( pNew==0 ){
|
236012
|
0 |
0 |
if( (flags & FTS5INDEX_QUERY_NOOUTPUT)==0 ){
|
236017
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
236018
|
0 |
0 |
if( iLevel<0 ){
|
236020
|
0 |
0 |
if( p->pHash && 0==(flags & FTS5INDEX_QUERY_SKIPHASH) ){
|
|
0 |
0 |
if( p->pHash && 0==(flags & FTS5INDEX_QUERY_SKIPHASH) ){
|
236025
|
0 |
0 |
for(pLvl=&pStruct->aLevel[0]; pLvl<pEnd; pLvl++){
|
236026
|
0 |
0 |
for(iSeg=pLvl->nSeg-1; iSeg>=0; iSeg--){
|
236029
|
0 |
0 |
if( pTerm==0 ){
|
236038
|
0 |
0 |
for(iSeg=nSeg-1; iSeg>=0; iSeg--){
|
236049
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
236050
|
0 |
0 |
for(iIter=pNew->nSeg-1; iIter>0; iIter--){
|
236052
|
0 |
0 |
if( (iEq = fts5MultiIterDoCompare(pNew, iIter)) ){
|
236054
|
0 |
0 |
if( p->rc==SQLITE_OK ) pSeg->xNext(p, pSeg, 0);
|
236061
|
0 |
0 |
if( pNew->bSkipEmpty && fts5MultiIterIsEmpty(p, pNew) ){
|
|
0 |
0 |
if( pNew->bSkipEmpty && fts5MultiIterIsEmpty(p, pNew) ){
|
236063
|
0 |
0 |
}else if( pNew->base.bEof==0 ){
|
236090
|
0 |
0 |
if( pNew ){
|
236094
|
0 |
0 |
if( pData->szLeaf>0 ){
|
236099
|
0 |
0 |
if( bDesc ){
|
236127
|
0 |
0 |
return (p->rc || pIter->base.bEof);
|
|
0 |
0 |
return (p->rc || pIter->base.bEof);
|
236151
|
0 |
0 |
if( fts5MultiIterEof(p, pIter) ) break;
|
236153
|
0 |
0 |
if( pIter->bRev==0 && iRowid>=iMatch ) break;
|
|
0 |
0 |
if( pIter->bRev==0 && iRowid>=iMatch ) break;
|
236154
|
0 |
0 |
if( pIter->bRev!=0 && iRowid<=iMatch ) break;
|
|
0 |
0 |
if( pIter->bRev!=0 && iRowid<=iMatch ) break;
|
236180
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
236181
|
0 |
0 |
if( pStruct->nSegment>=FTS5_MAX_SEGMENT ){
|
236191
|
0 |
0 |
for(iLvl=0; iLvl<pStruct->nLevel; iLvl++){
|
236192
|
0 |
0 |
for(iSeg=0; iSeg<pStruct->aLevel[iLvl].nSeg; iSeg++){
|
236194
|
0 |
0 |
if( iId<=FTS5_MAX_SEGMENT && iId>0 ){
|
|
0 |
0 |
if( iId<=FTS5_MAX_SEGMENT && iId>0 ){
|
236200
|
0 |
0 |
for(i=0; aUsed[i]==0xFFFFFFFF; i++);
|
236202
|
0 |
0 |
for(iSegid=0; mask & ((u32)1 << iSegid); iSegid++);
|
236236
|
0 |
0 |
if( p->pHash ){
|
236251
|
0 |
0 |
for(i=0; i<nOld; i++){
|
236252
|
0 |
0 |
if( pOld[i]!=pNew[i] ) break;
|
236264
|
0 |
0 |
for(i=0; i<pWriter->nDlidx; i++){
|
236266
|
0 |
0 |
if( pDlidx->buf.n==0 ) break;
|
236267
|
0 |
0 |
if( bFlush ){
|
236288
|
0 |
0 |
if( p->rc==SQLITE_OK && nLvl>=pWriter->nDlidx ){
|
|
0 |
0 |
if( p->rc==SQLITE_OK && nLvl>=pWriter->nDlidx ){
|
236292
|
0 |
0 |
if( aDlidx==0 ){
|
236314
|
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 ){
|
236337
|
0 |
0 |
if( pWriter->iBtPage==0 ) return;
|
236340
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
236341
|
0 |
0 |
const char *z = (pWriter->btterm.n>0?(const char*)pWriter->btterm.p:"");
|
236368
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
236384
|
0 |
0 |
if( pWriter->bFirstRowidInPage && pWriter->aDlidx[0].buf.n>0 ){
|
|
0 |
0 |
if( pWriter->bFirstRowidInPage && pWriter->aDlidx[0].buf.n>0 ){
|
236416
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){
|
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){
|
236420
|
0 |
0 |
if( pDlidx->buf.n>=p->pConfig->pgsz ){
|
236433
|
0 |
0 |
if( p->rc==SQLITE_OK && pDlidx[1].buf.n==0 ){
|
|
0 |
0 |
if( p->rc==SQLITE_OK && pDlidx[1].buf.n==0 ){
|
236452
|
0 |
0 |
if( pDlidx->bPrevValid ){
|
236455
|
0 |
0 |
i64 iPgno = (i==0 ? pWriter->writer.pgno : pDlidx[-1].pgno);
|
236479
|
0 |
0 |
if( pWriter->bFirstTermInPage ){
|
236529
|
0 |
0 |
if( (pPage->buf.n + pPgidx->n + nTerm + 2)>=p->pConfig->pgsz ){
|
236530
|
0 |
0 |
if( pPage->buf.n>4 ){
|
236532
|
0 |
0 |
if( p->rc!=SQLITE_OK ) return;
|
236534
|
0 |
0 |
fts5BufferGrow(&p->rc, &pPage->buf, nTerm+FTS5_DATA_PADDING);
|
236547
|
0 |
0 |
if( pWriter->bFirstTermInPage ){
|
236549
|
0 |
0 |
if( pPage->pgno!=1 ){
|
236564
|
0 |
0 |
if( pPage->term.n ){
|
236568
|
0 |
0 |
if( p->rc!=SQLITE_OK ) return;
|
236600
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
236603
|
0 |
0 |
if( (pPage->buf.n + pPage->pgidx.n)>=p->pConfig->pgsz ){
|
236610
|
0 |
0 |
if( pWriter->bFirstRowidInPage ){
|
236616
|
0 |
0 |
if( pWriter->bFirstRowidInDoclist || pWriter->bFirstRowidInPage ){
|
|
0 |
0 |
if( pWriter->bFirstRowidInDoclist || pWriter->bFirstRowidInPage ){
|
236641
|
0 |
0 |
while( p->rc==SQLITE_OK
|
236642
|
0 |
0 |
&& (pPage->buf.n + pPage->pgidx.n + n)>=p->pConfig->pgsz
|
236646
|
0 |
0 |
while( nCopy<nReq ){
|
236655
|
0 |
0 |
if( n>0 ){
|
236671
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
236673
|
0 |
0 |
if( pLeaf->buf.n>4 ){
|
236677
|
0 |
0 |
if( pLeaf->pgno>1 ){
|
236686
|
0 |
0 |
for(i=0; i<pWriter->nDlidx; i++){
|
236714
|
0 |
0 |
if( p->pIdxWriter==0 ){
|
236722
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
236743
|
0 |
0 |
for(i=0; i<pIter->nSeg && p->rc==SQLITE_OK; i++){
|
|
0 |
0 |
for(i=0; i<pIter->nSeg && p->rc==SQLITE_OK; i++){
|
236745
|
0 |
0 |
if( pSeg->pSeg==0 ){
|
236747
|
0 |
0 |
}else if( pSeg->pLeaf==0 ){
|
236762
|
0 |
0 |
if( pData ){
|
236763
|
0 |
0 |
if( iOff>pData->szLeaf ){
|
236771
|
0 |
0 |
fts5BufferGrow(&p->rc, &buf, pData->nn);
|
236776
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
236783
|
0 |
0 |
if( pSeg->iLeafPgno==pSeg->iTermLeafPgno
|
236784
|
0 |
0 |
&& pSeg->iEndofDoclist<pData->szLeaf
|
236785
|
0 |
0 |
&& pSeg->iPgidxOff<=pData->nn
|
236827
|
0 |
0 |
int nRem = pnRem ? *pnRem : 0; /* Output leaf pages left to write */
|
236842
|
0 |
0 |
if( pLvl->nMerge ){
|
236856
|
0 |
0 |
if( iLvl==pStruct->nLevel-1 ){
|
236861
|
0 |
0 |
if( p->rc ) return;
|
236877
|
0 |
0 |
bOldest = (pLvlOut->nSeg==1 && pStruct->nLevel==iLvl+2);
|
|
0 |
0 |
bOldest = (pLvlOut->nSeg==1 && pStruct->nLevel==iLvl+2);
|
236880
|
0 |
0 |
for(fts5MultiIterNew(p, pStruct, flags, 0, 0, 0, iLvl, nInput, &pIter);
|
236890
|
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) ){
|
236891
|
0 |
0 |
if( pnRem && writer.nLeafWritten>nRem ){
|
|
0 |
0 |
if( pnRem && writer.nLeafWritten>nRem ){
|
236899
|
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;
|
236901
|
0 |
0 |
if( p->rc==SQLITE_OK && bTermWritten==0 ){
|
|
0 |
0 |
if( p->rc==SQLITE_OK && bTermWritten==0 ){
|
236911
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ){
|
236912
|
0 |
0 |
if( pSegIter->bDel ){
|
236914
|
0 |
0 |
if( pSegIter->nPos>0 ){
|
236931
|
0 |
0 |
if( fts5MultiIterEof(p, pIter) ){
|
236935
|
0 |
0 |
for(i=0; i<nInput; i++){
|
236940
|
0 |
0 |
if( pLvl->nSeg!=nInput ){
|
236947
|
0 |
0 |
if( pSeg->pgnoLast==0 ){
|
236959
|
0 |
0 |
if( pnRem ) *pnRem -= writer.nLeafWritten;
|
236976
|
0 |
0 |
while( nRem>0 && p->rc==SQLITE_OK ){
|
|
0 |
0 |
while( nRem>0 && p->rc==SQLITE_OK ){
|
236983
|
0 |
0 |
for(iLvl=0; iLvl<pStruct->nLevel; iLvl++){
|
236985
|
0 |
0 |
if( pLvl->nMerge ){
|
236986
|
0 |
0 |
if( pLvl->nMerge>nBest ){
|
236992
|
0 |
0 |
if( pLvl->nSeg>nBest ){
|
237005
|
0 |
0 |
if( nBest<nMin && pStruct->aLevel[iBestLvl].nMerge==0 ){
|
|
0 |
0 |
if( nBest<nMin && pStruct->aLevel[iBestLvl].nMerge==0 ){
|
237010
|
0 |
0 |
if( p->rc==SQLITE_OK && pStruct->aLevel[iBestLvl].nMerge==0 ){
|
|
0 |
0 |
if( p->rc==SQLITE_OK && pStruct->aLevel[iBestLvl].nMerge==0 ){
|
237031
|
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) ){
|
237053
|
0 |
0 |
if( pStruct && pStruct->nLevel>0 ){
|
|
0 |
0 |
if( pStruct && pStruct->nLevel>0 ){
|
237055
|
0 |
0 |
while( p->rc==SQLITE_OK && pStruct->aLevel[iLvl].nSeg>=nCrisis ){
|
|
0 |
0 |
while( p->rc==SQLITE_OK && pStruct->aLevel[iLvl].nSeg>=nCrisis ){
|
237086
|
0 |
0 |
if( ret<nMax ){
|
237089
|
0 |
0 |
if( (ret + i) > nMax ) break;
|
237112
|
0 |
0 |
if( iPgno!=1 ){
|
237114
|
0 |
0 |
if( p->pDeleteFromIdx==0 ){
|
237120
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
237151
|
0 |
0 |
for(pgno=iPgno; p->rc==SQLITE_OK && pgno<=pSeg->pgnoLast; pgno++){
|
|
0 |
0 |
for(pgno=iPgno; p->rc==SQLITE_OK && pgno<=pSeg->pgnoLast; pgno++){
|
237157
|
0 |
0 |
if( pLeaf==0 ) break;
|
237161
|
0 |
0 |
if( iNext!=0 ){
|
237164
|
0 |
0 |
if( iNext==0 && pLeaf->szLeaf!=pLeaf->nn ){
|
|
0 |
0 |
if( iNext==0 && pLeaf->szLeaf!=pLeaf->nn ){
|
237168
|
0 |
0 |
if( iNext==0 ){
|
237173
|
0 |
0 |
if( bDetailNone==0 ) fts5DataWrite(p, iRowid, aEmpty, sizeof(aEmpty));
|
237176
|
0 |
0 |
}else if( bDetailNone ){
|
237178
|
0 |
0 |
}else if( iNext>=pLeaf->szLeaf || iNext<4 ){
|
|
0 |
0 |
}else if( iNext>=pLeaf->szLeaf || iNext<4 ){
|
237192
|
0 |
0 |
if( pLeaf->nn>pLeaf->szLeaf ){
|
237198
|
0 |
0 |
if( aIdx==0 ) break;
|
237201
|
0 |
0 |
if( i1<pLeaf->nn ){
|
237213
|
0 |
0 |
if( fts5GetU16(&aPg[0]) ) fts5PutU16(&aPg[0], 4);
|
237214
|
0 |
0 |
if( nIdx>0 ){
|
237258
|
0 |
0 |
if( p->rc ) return;
|
237282
|
0 |
0 |
if( pSeg->iLeafPgno==pSeg->iTermLeafPgno ){
|
237291
|
0 |
0 |
if( bDetailNone ){
|
237292
|
0 |
0 |
while( iSOP<pSeg->iLeafOffset ){
|
237293
|
0 |
0 |
if( aPg[iSOP]==0x00 ) iSOP++;
|
237294
|
0 |
0 |
if( aPg[iSOP]==0x00 ) iSOP++;
|
237300
|
0 |
0 |
if( iNextOff<pSeg->iEndofDoclist && aPg[iNextOff]==0x00 ) iNextOff++;
|
|
0 |
0 |
if( iNextOff<pSeg->iEndofDoclist && aPg[iNextOff]==0x00 ) iNextOff++;
|
237301
|
0 |
0 |
if( iNextOff<pSeg->iEndofDoclist && aPg[iNextOff]==0x00 ) iNextOff++;
|
|
0 |
0 |
if( iNextOff<pSeg->iEndofDoclist && aPg[iNextOff]==0x00 ) iNextOff++;
|
237306
|
0 |
0 |
while( iSOP<pSeg->iLeafOffset ){
|
237317
|
0 |
0 |
if( iNextOff>=iPgIdx ){
|
237324
|
0 |
0 |
for(iIdx=0, iKeyOff=0; iIdx<nIdx; /* no-op */){
|
237328
|
0 |
0 |
if( iKeyOff==iNextOff ){
|
237334
|
0 |
0 |
if( fts5GetU16(&aPg[0])==iStart && (bLastInDoclist||iNextOff==iPgIdx) ){
|
|
0 |
0 |
if( fts5GetU16(&aPg[0])==iStart && (bLastInDoclist||iNextOff==iPgIdx) ){
|
|
0 |
0 |
if( fts5GetU16(&aPg[0])==iStart && (bLastInDoclist||iNextOff==iPgIdx) ){
|
237338
|
0 |
0 |
if( bLastInDoclist==0 ){
|
237339
|
0 |
0 |
if( iNextOff!=iPgIdx ){
|
237343
|
0 |
0 |
}else if(
|
237344
|
0 |
0 |
iStart==pSeg->iTermLeafOffset && pSeg->iLeafPgno==pSeg->iTermLeafPgno
|
237349
|
0 |
0 |
for(iIdx=0, iKeyOff=0; iIdx<nIdx; iKey++){
|
237352
|
0 |
0 |
if( (iKeyOff+iVal)>(u32)iStart ) break;
|
237357
|
0 |
0 |
if( iNextOff!=iPgIdx ){
|
237367
|
0 |
0 |
if( iKey!=1 ){
|
237375
|
0 |
0 |
if( (iKeyOff+nSuffix)>iPgIdx || (iNextOff+nSuffix2)>iPgIdx ){
|
|
0 |
0 |
if( (iKeyOff+nSuffix)>iPgIdx || (iNextOff+nSuffix2)>iPgIdx ){
|
237378
|
0 |
0 |
if( iKey!=1 ){
|
237382
|
0 |
0 |
if( nPrefix2>nPrefix ){
|
237391
|
0 |
0 |
}else if( iStart==4 ){
|
237397
|
0 |
0 |
for(iPgno=pSeg->iLeafPgno-1; iPgno>pSeg->iTermLeafPgno; iPgno-- ){
|
237399
|
0 |
0 |
int bEmpty = (pPg && pPg->nn==4);
|
|
0 |
0 |
int bEmpty = (pPg && pPg->nn==4);
|
237401
|
0 |
0 |
if( bEmpty==0 ) break;
|
237404
|
0 |
0 |
if( iPgno==pSeg->iTermLeafPgno ){
|
237407
|
0 |
0 |
if( pTerm && pTerm->szLeaf==pSeg->iTermLeafOffset ){
|
|
0 |
0 |
if( pTerm && pTerm->szLeaf==pSeg->iTermLeafOffset ){
|
237417
|
0 |
0 |
if( (iTermIdx+nByte)>=nTermIdx ) break;
|
237426
|
0 |
0 |
if( nTermIdx==0 ){
|
237434
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
237444
|
0 |
0 |
for(iIdx=0, iKeyOff=0, iPrevKeyOff=0; iIdx<nIdx; /* no-op */){
|
237448
|
0 |
0 |
if( iKeyOff!=iDelKeyOff ){
|
237449
|
0 |
0 |
if( iKeyOff>iOff ){
|
237458
|
0 |
0 |
if( iPgIdx==nPg && nIdx>0 && pSeg->iLeafPgno!=1 ){
|
|
0 |
0 |
if( iPgIdx==nPg && nIdx>0 && pSeg->iLeafPgno!=1 ){
|
|
0 |
0 |
if( iPgIdx==nPg && nIdx>0 && pSeg->iLeafPgno!=1 ){
|
237484
|
0 |
0 |
if( fts5MultiIterEof(p, pIter)==0 ){
|
237486
|
0 |
0 |
if( iThis<iRowid ){
|
237490
|
0 |
0 |
if( p->rc==SQLITE_OK
|
237491
|
0 |
0 |
&& fts5MultiIterEof(p, pIter)==0
|
237492
|
0 |
0 |
&& iRowid==fts5MultiIterRowid(pIter)
|
237522
|
0 |
0 |
if( iSegid ){
|
237543
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
237546
|
0 |
0 |
while( p->rc==SQLITE_OK && 0==sqlite3Fts5HashScanEof(pHash) ){
|
|
0 |
0 |
while( p->rc==SQLITE_OK && 0==sqlite3Fts5HashScanEof(pHash) ){
|
237555
|
0 |
0 |
if( bSecureDelete==0 ){
|
237557
|
0 |
0 |
if( p->rc!=SQLITE_OK ) break;
|
237561
|
0 |
0 |
if( !bSecureDelete && pgsz>=(pBuf->n + pPgidx->n + nDoclist + 1) ){
|
|
0 |
0 |
if( !bSecureDelete && pgsz>=(pBuf->n + pPgidx->n + nDoclist + 1) ){
|
237573
|
0 |
0 |
while( p->rc==SQLITE_OK && iOff<nDoclist ){
|
|
0 |
0 |
while( p->rc==SQLITE_OK && iOff<nDoclist ){
|
237581
|
0 |
0 |
if( bSecureDelete ){
|
237582
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ){
|
237583
|
0 |
0 |
if( iOff<nDoclist && pDoclist[iOff]==0x00 ){
|
|
0 |
0 |
if( iOff<nDoclist && pDoclist[iOff]==0x00 ){
|
237586
|
0 |
0 |
if( iOff<nDoclist && pDoclist[iOff]==0x00 ){
|
|
0 |
0 |
if( iOff<nDoclist && pDoclist[iOff]==0x00 ){
|
237593
|
0 |
0 |
}else if( (pDoclist[iOff] & 0x01) ){
|
237595
|
0 |
0 |
if( p->rc!=SQLITE_OK || pDoclist[iOff]==0x01 ){
|
|
0 |
0 |
if( p->rc!=SQLITE_OK || pDoclist[iOff]==0x01 ){
|
237602
|
0 |
0 |
if( p->rc==SQLITE_OK && bTermWritten==0 ){
|
|
0 |
0 |
if( p->rc==SQLITE_OK && bTermWritten==0 ){
|
237608
|
0 |
0 |
if( writer.bFirstRowidInPage ){
|
237616
|
0 |
0 |
if( p->rc!=SQLITE_OK ) break;
|
237620
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ){
|
237621
|
0 |
0 |
if( iOff<nDoclist && pDoclist[iOff]==0 ){
|
|
0 |
0 |
if( iOff<nDoclist && pDoclist[iOff]==0 ){
|
237624
|
0 |
0 |
if( iOff<nDoclist && pDoclist[iOff]==0 ){
|
|
0 |
0 |
if( iOff<nDoclist && pDoclist[iOff]==0 ){
|
237629
|
0 |
0 |
if( (pBuf->n + pPgidx->n)>=pgsz ){
|
237637
|
0 |
0 |
if( (pBuf->n + pPgidx->n + nCopy) <= pgsz ){
|
237647
|
0 |
0 |
while( p->rc==SQLITE_OK ){
|
237650
|
0 |
0 |
if( (nCopy - iPos)<=nSpace ){
|
237658
|
0 |
0 |
if( (pBuf->n + pPgidx->n)>=pgsz ){
|
237661
|
0 |
0 |
if( iPos>=nCopy ) break;
|
237672
|
0 |
0 |
if( p->rc==SQLITE_OK ) sqlite3Fts5HashScanNext(pHash);
|
237678
|
0 |
0 |
if( pgnoLast>0 ){
|
237681
|
0 |
0 |
if( pStruct->nLevel==0 ){
|
237685
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
237707
|
0 |
0 |
if( p->nPendingData ){
|
237733
|
0 |
0 |
if( nSeg<2 ) return 0;
|
237734
|
0 |
0 |
for(i=0; i<pStruct->nLevel; i++){
|
237736
|
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) ){
|
237746
|
0 |
0 |
if( pNew ){
|
237754
|
0 |
0 |
if( pLvl->aSeg ){
|
237760
|
0 |
0 |
for(iLvl=pStruct->nLevel-1; iLvl>=0; iLvl--){
|
237761
|
0 |
0 |
for(iSeg=0; iSeg<pStruct->aLevel[iLvl].nSeg; iSeg++){
|
237785
|
0 |
0 |
if( pStruct ){
|
237791
|
0 |
0 |
if( pNew ){
|
237793
|
0 |
0 |
for(iLvl=0; pNew->aLevel[iLvl].nSeg==0; iLvl++){}
|
237794
|
0 |
0 |
while( p->rc==SQLITE_OK && pNew->aLevel[iLvl].nSeg>0 ){
|
|
0 |
0 |
while( p->rc==SQLITE_OK && pNew->aLevel[iLvl].nSeg>0 ){
|
237812
|
0 |
0 |
if( pStruct ){
|
237815
|
0 |
0 |
if( nMerge<0 ){
|
237822
|
0 |
0 |
if( pStruct && pStruct->nLevel ){
|
|
0 |
0 |
if( pStruct && pStruct->nLevel ){
|
237823
|
0 |
0 |
if( fts5IndexMerge(p, &pStruct, nMerge, nMin) ){
|
237851
|
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) ){
|
237864
|
0 |
0 |
if( p>=pIter->aEof ){
|
237873
|
0 |
0 |
if( p[0] & 0x80 ){
|
237883
|
0 |
0 |
if( &pIter->aPoslist[pIter->nPoslist]>pIter->aEof ){
|
237894
|
0 |
0 |
if( pBuf->n>0 ){
|
237936
|
0 |
0 |
if( i>=pBuf->n ){
|
237967
|
0 |
0 |
if( p->rc ) return;
|
237971
|
0 |
0 |
while( i1>=0 || i2>=0 ){
|
|
0 |
0 |
while( i1>=0 || i2>=0 ){
|
237972
|
0 |
0 |
if( i1>=0 && (i2<0 || iRowid1<iRowid2) ){
|
|
0 |
0 |
if( i1>=0 && (i2<0 || iRowid1<iRowid2) ){
|
|
0 |
0 |
if( i1>=0 && (i2<0 || iRowid1<iRowid2) ){
|
237981
|
0 |
0 |
if( i1>=0 && iRowid1==iRowid2 ){
|
|
0 |
0 |
if( i1>=0 && iRowid1==iRowid2 ){
|
238005
|
0 |
0 |
if( p->iter.aPoslist ){
|
238007
|
0 |
0 |
while( *pp && p->iter.iRowid>(*pp)->iter.iRowid ){
|
|
0 |
0 |
while( *pp && p->iter.iRowid>(*pp)->iter.iRowid ){
|
238019
|
0 |
0 |
if( p->iPos>=0 ){
|
238021
|
0 |
0 |
while( *pp && p->iPos>(*pp)->iPos ){
|
|
0 |
0 |
while( *pp && p->iPos>(*pp)->iPos ){
|
238058
|
0 |
0 |
for(i=0; i<nBuf; i++){
|
238063
|
0 |
0 |
if( nOut==0 ) return;
|
238078
|
0 |
0 |
if( sqlite3Fts5BufferSize(&p->rc, &out, nOut) ) return;
|
238080
|
0 |
0 |
while( pHead ){
|
238083
|
0 |
0 |
if( pHead->pNext && iLastRowid==pHead->pNext->iter.iRowid ){
|
|
0 |
0 |
if( pHead->pNext && iLastRowid==pHead->pNext->iter.iRowid ){
|
238093
|
0 |
0 |
while( pSave && pSave->iter.iRowid==iLastRowid ){
|
|
0 |
0 |
while( pSave && pSave->iter.iRowid==iLastRowid ){
|
238105
|
0 |
0 |
if( pHead==0 || pHead->pNext==0 ){
|
|
0 |
0 |
if( pHead==0 || pHead->pNext==0 ){
|
238113
|
0 |
0 |
if( sqlite3Fts5BufferSize(&p->rc, &tmp, nTmp+nMerge*10) ){
|
238124
|
0 |
0 |
while( pHead->pNext ){
|
238126
|
0 |
0 |
if( pThis->iPos!=iPrev ){
|
238134
|
0 |
0 |
if( pHead->iPos!=iPrev ){
|
238142
|
0 |
0 |
if( tmp.n+nTail>nTmp-FTS5_DATA_ZERO_PADDING ){
|
238143
|
0 |
0 |
if( p->rc==SQLITE_OK ) p->rc = FTS5_CORRUPT;
|
238148
|
0 |
0 |
if( nTail>0 ){
|
238153
|
0 |
0 |
for(i=0; i<nBuf+1; i++){
|
238155
|
0 |
0 |
if( pX->iter.aPoslist && pX->iter.iRowid==iLastRowid ){
|
|
0 |
0 |
if( pX->iter.aPoslist && pX->iter.iRowid==iLastRowid ){
|
238194
|
0 |
0 |
if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){
|
238207
|
0 |
0 |
if( aBuf && pStruct ){
|
|
0 |
0 |
if( aBuf && pStruct ){
|
238219
|
0 |
0 |
if( iIdx!=0 ){
|
238225
|
0 |
0 |
for(;
|
238231
|
0 |
0 |
if( p1->base.nData ){
|
238242
|
0 |
0 |
for( /* no-op */ ;
|
238252
|
0 |
0 |
if( bNewTerm ){
|
238253
|
0 |
0 |
if( nTerm<nToken || memcmp(pToken, pTerm, nToken) ) break;
|
|
0 |
0 |
if( nTerm<nToken || memcmp(pToken, pTerm, nToken) ) break;
|
238256
|
0 |
0 |
if( p1->base.nData==0 ) continue;
|
238258
|
0 |
0 |
if( p1->base.iRowid<=iLastRowid && doclist.n>0 ){
|
|
0 |
0 |
if( p1->base.iRowid<=iLastRowid && doclist.n>0 ){
|
238259
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && doclist.n; i++){
|
|
0 |
0 |
for(i=0; p->rc==SQLITE_OK && doclist.n; i++){
|
238263
|
0 |
0 |
for(iStore=i1; iStore<i1+nMerge; iStore++){
|
238264
|
0 |
0 |
if( aBuf[iStore].n==0 ){
|
238270
|
0 |
0 |
if( iStore==i1+nMerge ){
|
238272
|
0 |
0 |
for(iStore=i1; iStore<i1+nMerge; iStore++){
|
238285
|
0 |
0 |
for(i=0; i<nBuf; i+=nMerge){
|
238287
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
238290
|
0 |
0 |
for(iFree=i; iFree<i+nMerge; iFree++){
|
238297
|
0 |
0 |
if( pData ){
|
238300
|
0 |
0 |
if( doclist.n ) memcpy(pData->p, doclist.p, doclist.n);
|
238319
|
0 |
0 |
if( p->pHash==0 ){
|
238324
|
0 |
0 |
if( iRowid<p->iWriteRowid
|
238325
|
0 |
0 |
|| (iRowid==p->iWriteRowid && p->bDelete==0)
|
|
0 |
0 |
|| (iRowid==p->iWriteRowid && p->bDelete==0)
|
238326
|
0 |
0 |
|| (p->nPendingData > p->pConfig->nHashSize)
|
238392
|
0 |
0 |
if( rc==SQLITE_OK ){
|
238396
|
0 |
0 |
if( p->zDataTbl && bCreate ){
|
|
0 |
0 |
if( p->zDataTbl && bCreate ){
|
238400
|
0 |
0 |
if( rc==SQLITE_OK ){
|
238406
|
0 |
0 |
if( rc==SQLITE_OK ){
|
238413
|
0 |
0 |
if( rc ){
|
238425
|
0 |
0 |
if( p ){
|
238454
|
0 |
0 |
for(i=0; i<nChar; i++){
|
238455
|
0 |
0 |
if( n>=nByte ) return 0; /* Input contains fewer than nChar chars */
|
238456
|
0 |
0 |
if( (unsigned char)p[n++]>=0xc0 ){
|
238457
|
0 |
0 |
if( n>=nByte ) return 0;
|
238458
|
0 |
0 |
while( (p[n] & 0xc0)==0x80 ){
|
238460
|
0 |
0 |
if( n>=nByte ){
|
238461
|
0 |
0 |
if( i+1==nChar ) break;
|
238477
|
0 |
0 |
while( i<nIn ){
|
238478
|
0 |
0 |
if( (unsigned char)pIn[i++]>=0xc0 ){
|
238479
|
0 |
0 |
while( i<nIn && (pIn[i] & 0xc0)==0x80 ) i++;
|
|
0 |
0 |
while( i<nIn && (pIn[i] & 0xc0)==0x80 ) i++;
|
238514
|
0 |
0 |
for(i=0; i<pConfig->nPrefix && rc==SQLITE_OK; i++){
|
|
0 |
0 |
for(i=0; i<pConfig->nPrefix && rc==SQLITE_OK; i++){
|
238517
|
0 |
0 |
if( nByte ){
|
238546
|
0 |
0 |
if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){
|
238549
|
0 |
0 |
if( nToken>0 ) memcpy(&buf.p[1], pToken, nToken);
|
238567
|
0 |
0 |
if( flags & FTS5INDEX_QUERY_PREFIX ){
|
238569
|
0 |
0 |
for(iIdx=1; iIdx<=pConfig->nPrefix; iIdx++){
|
238571
|
0 |
0 |
if( nIdxChar==nChar ) break;
|
238572
|
0 |
0 |
if( nIdxChar==nChar+1 ) iPrefixIdx = iIdx;
|
238576
|
0 |
0 |
if( iIdx<=pConfig->nPrefix ){
|
238580
|
0 |
0 |
if( pStruct ){
|
238590
|
0 |
0 |
if( pRet==0 ){
|
238595
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
238597
|
0 |
0 |
if( pSeg->pLeaf ) pRet->xSetOutputs(pRet, pSeg);
|
238602
|
0 |
0 |
if( p->rc ){
|
238637
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
238639
|
0 |
0 |
if( pSeg->pLeaf && pSeg->term.p[0]!=FTS5_MAIN_PREFIX ){
|
|
0 |
0 |
if( pSeg->pLeaf && pSeg->term.p[0]!=FTS5_MAIN_PREFIX ){
|
238668
|
0 |
0 |
return (z ? &z[1] : 0);
|
238675
|
0 |
0 |
if( pIndexIter ){
|
238696
|
0 |
0 |
if( p->rc==SQLITE_OK && pData->nn ){
|
|
0 |
0 |
if( p->rc==SQLITE_OK && pData->nn ){
|
238700
|
0 |
0 |
for(iCol=0; i<pData->nn && iCol<nCol; iCol++){
|
|
0 |
0 |
for(iCol=0; i<pData->nn && iCol<nCol; iCol++){
|
238746
|
0 |
0 |
if( rc==SQLITE_OK ){
|
238783
|
0 |
0 |
if( iIdx>=0 ) ret += (ret<<3) + (FTS5_MAIN_PREFIX + iIdx);
|
238784
|
0 |
0 |
for(i=0; i<nTerm; i++) ret += (ret<<3) + pTerm[i];
|
239000
|
0 |
0 |
for(i=iFirst; p->rc==SQLITE_OK && i<=iLast; i++){
|
|
0 |
0 |
for(i=iFirst; p->rc==SQLITE_OK && i<=iLast; i++){
|
239002
|
0 |
0 |
if( pLeaf ){
|
239003
|
0 |
0 |
if( !fts5LeafIsTermless(pLeaf) ) p->rc = FTS5_CORRUPT;
|
239004
|
0 |
0 |
if( i>=iNoRowid && 0!=fts5LeafFirstRowidOff(pLeaf) ) p->rc = FTS5_CORRUPT;
|
|
0 |
0 |
if( i>=iNoRowid && 0!=fts5LeafFirstRowidOff(pLeaf) ) p->rc = FTS5_CORRUPT;
|
239018
|
0 |
0 |
while( ii<pLeaf->nn && p->rc==SQLITE_OK ){
|
|
0 |
0 |
while( ii<pLeaf->nn && p->rc==SQLITE_OK ){
|
239027
|
0 |
0 |
if( iOff>=pLeaf->szLeaf ){
|
239029
|
0 |
0 |
}else if( iTermOff==nIncr ){
|
239032
|
0 |
0 |
if( (iOff+nByte)>pLeaf->szLeaf ){
|
239041
|
0 |
0 |
if( nKeep>buf1.n || (iOff+nByte)>pLeaf->szLeaf ){
|
|
0 |
0 |
if( nKeep>buf1.n || (iOff+nByte)>pLeaf->szLeaf ){
|
239048
|
0 |
0 |
if( p->rc==SQLITE_OK ){
|
239050
|
0 |
0 |
if( res<=0 ) p->rc = FTS5_CORRUPT;
|
239071
|
0 |
0 |
if( pSeg->pgnoFirst==0 ) return;
|
239080
|
0 |
0 |
while( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){
|
|
0 |
0 |
while( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){
|
239091
|
0 |
0 |
if( iIdxLeaf<pSeg->pgnoFirst ) continue;
|
239094
|
0 |
0 |
if( pLeaf==0 ) break;
|
239100
|
0 |
0 |
if( pLeaf->nn<=pLeaf->szLeaf ){
|
239102
|
0 |
0 |
if( nIdxTerm==0
|
239103
|
0 |
0 |
&& pConfig->iVersion==FTS5_CURRENT_VERSION_SECUREDELETE
|
239104
|
0 |
0 |
&& pLeaf->nn==pLeaf->szLeaf
|
239105
|
0 |
0 |
&& pLeaf->nn==4
|
239122
|
0 |
0 |
if( iRowidOff>=iOff || iOff>=pLeaf->szLeaf ){
|
|
0 |
0 |
if( iRowidOff>=iOff || iOff>=pLeaf->szLeaf ){
|
239126
|
0 |
0 |
res = fts5Memcmp(&pLeaf->p[iOff], zIdxTerm, MIN(nTerm, nIdxTerm));
|
239127
|
0 |
0 |
if( res==0 ) res = nTerm - nIdxTerm;
|
239128
|
0 |
0 |
if( res<0 ) p->rc = FTS5_CORRUPT;
|
239134
|
0 |
0 |
if( p->rc ) break;
|
239141
|
0 |
0 |
if( p->rc ) break;
|
239144
|
0 |
0 |
if( bIdxDlidx ){
|
239151
|
0 |
0 |
for(pDlidx=fts5DlidxIterInit(p, 0, iSegid, iIdxLeaf);
|
239157
|
0 |
0 |
for(iPg=iPrevLeaf+1; iPg<fts5DlidxIterPgno(pDlidx); iPg++){
|
239160
|
0 |
0 |
if( pLeaf ){
|
239161
|
0 |
0 |
if( fts5LeafFirstRowidOff(pLeaf)!=0 ) p->rc = FTS5_CORRUPT;
|
239171
|
0 |
0 |
if( pLeaf ){
|
239175
|
0 |
0 |
if( iRowidOff>=pLeaf->szLeaf ){
|
239177
|
0 |
0 |
}else if( bSecureDelete==0 || iRowidOff>0 ){
|
|
0 |
0 |
}else if( bSecureDelete==0 || iRowidOff>0 ){
|
239180
|
0 |
0 |
if( iRowid<iDlRowid || (bSecureDelete==0 && iRowid!=iDlRowid) ){
|
|
0 |
0 |
if( iRowid<iDlRowid || (bSecureDelete==0 && iRowid!=iDlRowid) ){
|
|
0 |
0 |
if( iRowid<iDlRowid || (bSecureDelete==0 && iRowid!=iDlRowid) ){
|
239200
|
0 |
0 |
if( p->rc==SQLITE_OK ) p->rc = rc2;
|
239238
|
0 |
0 |
if( pStruct==0 ){
|
239244
|
0 |
0 |
for(iLvl=0; iLvl<pStruct->nLevel; iLvl++){
|
239245
|
0 |
0 |
for(iSeg=0; iSeg<pStruct->aLevel[iLvl].nSeg; iSeg++){
|
239264
|
0 |
0 |
for(fts5MultiIterNew(p, pStruct, flags, 0, 0, 0, -1, 0, &pIter);
|
239276
|
0 |
0 |
if( p->rc ) break;
|
239278
|
0 |
0 |
if( eDetail==FTS5_DETAIL_NONE ){
|
239279
|
0 |
0 |
if( 0==fts5MultiIterIsEmpty(p, pIter) ){
|
239286
|
0 |
0 |
while( 0==sqlite3Fts5PoslistNext64(poslist.p, poslist.n, &iOff, &iPos) ){
|
239296
|
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;
|
239813
|
0 |
0 |
if( fts5IndexDataVersion(p)!=p->iStructVersion ){
|
240135
|
0 |
0 |
if( pTab ){
|
240157
|
0 |
0 |
if( rc==SQLITE_OK ){
|
240191
|
0 |
0 |
if( rc==SQLITE_OK ){
|
240195
|
0 |
0 |
if( rc==SQLITE_OK ){
|
240201
|
0 |
0 |
if( rc==SQLITE_OK ){
|
240206
|
0 |
0 |
if( rc==SQLITE_OK ){
|
240213
|
0 |
0 |
if( rc==SQLITE_OK ){
|
240218
|
0 |
0 |
if( rc==SQLITE_OK ){
|
240226
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
240293
|
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 ){
|
240296
|
0 |
0 |
if( pConfig->ePattern==FTS5_PATTERN_LIKE
|
240297
|
0 |
0 |
&& (p->op==FTS5_PATTERN_LIKE || p->op==FTS5_PATTERN_GLOB)
|
|
0 |
0 |
&& (p->op==FTS5_PATTERN_LIKE || p->op==FTS5_PATTERN_GLOB)
|
240389
|
0 |
0 |
if( pConfig->bLock ){
|
240397
|
0 |
0 |
if( idxStr==0 ) return SQLITE_NOMEM;
|
240401
|
0 |
0 |
for(i=0; i<pInfo->nConstraint; i++){
|
240404
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_MATCH
|
240405
|
0 |
0 |
|| (p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol>=nCol)
|
|
0 |
0 |
|| (p->op==SQLITE_INDEX_CONSTRAINT_EQ && iCol>=nCol)
|
240408
|
0 |
0 |
if( p->usable==0 || iCol<0 ){
|
|
0 |
0 |
if( p->usable==0 || iCol<0 ){
|
240416
|
0 |
0 |
if( iCol==nCol+1 ){
|
240417
|
0 |
0 |
if( bSeenRank ) continue;
|
240420
|
0 |
0 |
}else if( iCol>=0 ){
|
240430
|
0 |
0 |
}else if( p->usable ){
|
240431
|
0 |
0 |
if( iCol>=0 && iCol<nCol && fts5UsePatternMatch(pConfig, p) ){
|
|
0 |
0 |
if( iCol>=0 && iCol<nCol && fts5UsePatternMatch(pConfig, p) ){
|
|
0 |
0 |
if( iCol>=0 && iCol<nCol && fts5UsePatternMatch(pConfig, p) ){
|
240433
|
0 |
0 |
idxStr[iIdxStr++] = p->op==FTS5_PATTERN_LIKE ? 'L' : 'G';
|
240438
|
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 ){
|
240446
|
0 |
0 |
if( bSeenEq==0 ){
|
240447
|
0 |
0 |
for(i=0; i<pInfo->nConstraint; i++){
|
240449
|
0 |
0 |
if( p->iColumn<0 && p->usable ){
|
|
0 |
0 |
if( p->iColumn<0 && p->usable ){
|
240451
|
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 ){
|
240452
|
0 |
0 |
if( bSeenLt ) continue;
|
240457
|
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 ){
|
240458
|
0 |
0 |
if( bSeenGt ) continue;
|
240469
|
0 |
0 |
if( pInfo->nOrderBy==1 ){
|
240471
|
0 |
0 |
if( iSort==(pConfig->nCol+1) && bSeenMatch ){
|
|
0 |
0 |
if( iSort==(pConfig->nCol+1) && bSeenMatch ){
|
240473
|
0 |
0 |
}else if( iSort==-1 ){
|
240476
|
0 |
0 |
if( BitFlagTest(idxFlags, FTS5_BI_ORDER_RANK|FTS5_BI_ORDER_ROWID) ){
|
240478
|
0 |
0 |
if( pInfo->aOrderBy[0].desc ){
|
240485
|
0 |
0 |
if( bSeenEq ){
|
240486
|
0 |
0 |
pInfo->estimatedCost = bSeenMatch ? 100.0 : 10.0;
|
240487
|
0 |
0 |
if( bSeenMatch==0 ) fts5SetUniqueFlag(pInfo);
|
240488
|
0 |
0 |
}else if( bSeenLt && bSeenGt ){
|
|
0 |
0 |
}else if( bSeenLt && bSeenGt ){
|
240489
|
0 |
0 |
pInfo->estimatedCost = bSeenMatch ? 500.0 : 250000.0;
|
240490
|
0 |
0 |
}else if( bSeenLt || bSeenGt ){
|
|
0 |
0 |
}else if( bSeenLt || bSeenGt ){
|
240491
|
0 |
0 |
pInfo->estimatedCost = bSeenMatch ? 750.0 : 750000.0;
|
240493
|
0 |
0 |
pInfo->estimatedCost = bSeenMatch ? 1000.0 : 1000000.0;
|
240502
|
0 |
0 |
for(pCsr=pTab->pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){
|
240503
|
0 |
0 |
if( pCsr->base.pVtab==(sqlite3_vtab*)pTab ) return SQLITE_OK;
|
240519
|
0 |
0 |
if( rc==SQLITE_OK ){
|
240522
|
0 |
0 |
if( pCsr ){
|
240538
|
0 |
0 |
if( pCsr->ePlan==FTS5_PLAN_SCAN ){
|
240565
|
0 |
0 |
if( pCsr->pStmt ){
|
240569
|
0 |
0 |
if( pCsr->pSorter ){
|
240575
|
0 |
0 |
if( pCsr->ePlan!=FTS5_PLAN_SOURCE ){
|
240579
|
0 |
0 |
for(pData=pCsr->pAuxdata; pData; pData=pNext){
|
240581
|
0 |
0 |
if( pData->xDelete ) pData->xDelete(pData->pPtr);
|
240588
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_FREE_ZRANK) ){
|
240603
|
0 |
0 |
if( pCursor ){
|
240610
|
0 |
0 |
for(pp=&pTab->pGlobal->pCsr; (*pp)!=pCsr; pp=&(*pp)->pNext);
|
240623
|
0 |
0 |
if( rc==SQLITE_DONE ){
|
240626
|
0 |
0 |
}else if( rc==SQLITE_ROW ){
|
240639
|
0 |
0 |
if( nBlob>0 ){
|
240640
|
0 |
0 |
for(i=0; i<(pSorter->nIdx-1); i++){
|
240663
|
0 |
0 |
for(pCsr=pTab->pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){
|
240664
|
0 |
0 |
if( pCsr->ePlan==FTS5_PLAN_MATCH
|
240665
|
0 |
0 |
&& pCsr->base.pVtab==(sqlite3_vtab*)pTab
|
240687
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_RESEEK) ){
|
240693
|
0 |
0 |
if( rc==SQLITE_OK && iRowid!=sqlite3Fts5ExprRowid(pCsr->pExpr) ){
|
|
0 |
0 |
if( rc==SQLITE_OK && iRowid!=sqlite3Fts5ExprRowid(pCsr->pExpr) ){
|
240699
|
0 |
0 |
if( sqlite3Fts5ExprEof(pCsr->pExpr) ){
|
240725
|
0 |
0 |
if( pCsr->ePlan<3 ){
|
240727
|
0 |
0 |
if( (rc = fts5CursorReseek(pCsr, &bSkip)) || bSkip ) return rc;
|
|
0 |
0 |
if( (rc = fts5CursorReseek(pCsr, &bSkip)) || bSkip ) return rc;
|
240749
|
0 |
0 |
if( rc!=SQLITE_ROW ){
|
240752
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
240782
|
0 |
0 |
if( zSql==0 ){
|
240787
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
240814
|
0 |
0 |
if( pSorter==0 ) return SQLITE_NOMEM;
|
240825
|
0 |
0 |
rc = fts5PrepareStatement(&pSorter->pStmt, pConfig,
|
|
0 |
0 |
rc = fts5PrepareStatement(&pSorter->pStmt, pConfig,
|
|
0 |
0 |
rc = fts5PrepareStatement(&pSorter->pStmt, pConfig,
|
240834
|
0 |
0 |
if( rc==SQLITE_OK ){
|
240841
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
240854
|
0 |
0 |
if( sqlite3Fts5ExprEof(pExpr) ){
|
240876
|
0 |
0 |
while( z[0]==' ' ) z++;
|
240877
|
0 |
0 |
for(n=0; z[n] && z[n]!=' '; n++);
|
|
0 |
0 |
for(n=0; z[n] && z[n]!=' '; n++);
|
240882
|
0 |
0 |
if( n==5 && 0==sqlite3_strnicmp("reads", z, n) ){
|
|
0 |
0 |
if( n==5 && 0==sqlite3_strnicmp("reads", z, n) ){
|
240885
|
0 |
0 |
else if( n==2 && 0==sqlite3_strnicmp("id", z, n) ){
|
|
0 |
0 |
else if( n==2 && 0==sqlite3_strnicmp("id", z, n) ){
|
240905
|
0 |
0 |
for(pAux=pTab->pGlobal->pAux; pAux; pAux=pAux->pNext){
|
240906
|
0 |
0 |
if( sqlite3_stricmp(zName, pAux->zFunc)==0 ) return pAux;
|
240922
|
0 |
0 |
if( zRankArgs ){
|
240924
|
0 |
0 |
if( zSql ){
|
240930
|
0 |
0 |
if( rc==SQLITE_OK ){
|
240931
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pStmt) ){
|
240936
|
0 |
0 |
if( rc==SQLITE_OK ){
|
240938
|
0 |
0 |
for(i=0; i<pCsr->nRankArg; i++){
|
240951
|
0 |
0 |
if( rc==SQLITE_OK ){
|
240953
|
0 |
0 |
if( pAux==0 ){
|
240971
|
0 |
0 |
if( pRank ){
|
240976
|
0 |
0 |
if( z==0 ){
|
240977
|
0 |
0 |
if( sqlite3_value_type(pRank)==SQLITE_NULL ) rc = SQLITE_ERROR;
|
240981
|
0 |
0 |
if( rc==SQLITE_OK ){
|
240985
|
0 |
0 |
}else if( rc==SQLITE_ERROR ){
|
240991
|
0 |
0 |
if( pConfig->zRank ){
|
241003
|
0 |
0 |
if( pVal ){
|
241005
|
0 |
0 |
if( eType==SQLITE_INTEGER ){
|
241046
|
0 |
0 |
if( pConfig->bLock ){
|
241053
|
0 |
0 |
if( pCsr->ePlan ){
|
241070
|
0 |
0 |
for(i=0; i<nVal; i++){
|
241077
|
0 |
0 |
if( zText==0 ) zText = "";
|
241082
|
0 |
0 |
}while( idxStr[iIdxStr]>='0' && idxStr[iIdxStr]<='9' );
|
|
0 |
0 |
}while( idxStr[iIdxStr]>='0' && idxStr[iIdxStr]<='9' );
|
241084
|
0 |
0 |
if( zText[0]=='*' ){
|
241093
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241097
|
0 |
0 |
if( rc!=SQLITE_OK ) goto filter_out;
|
241110
|
0 |
0 |
}while( idxStr[iIdxStr]>='0' && idxStr[iIdxStr]<='9' );
|
|
0 |
0 |
}while( idxStr[iIdxStr]>='0' && idxStr[iIdxStr]<='9' );
|
241111
|
0 |
0 |
if( zText ){
|
241114
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241118
|
0 |
0 |
if( rc!=SQLITE_OK ) goto filter_out;
|
241139
|
0 |
0 |
if( pRowidEq ){
|
241142
|
0 |
0 |
if( bDesc ){
|
241150
|
0 |
0 |
if( pTab->pSortCsr ){
|
241161
|
0 |
0 |
if( pTab->pSortCsr->bDesc ){
|
241171
|
0 |
0 |
}else if( pCsr->pExpr ){
|
241173
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241174
|
0 |
0 |
if( bOrderByRank ){
|
241182
|
0 |
0 |
}else if( pConfig->zContent==0 ){
|
241190
|
0 |
0 |
pCsr->ePlan = (pRowidEq ? FTS5_PLAN_ROWID : FTS5_PLAN_SCAN);
|
241194
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241195
|
0 |
0 |
if( pRowidEq!=0 ){
|
241229
|
0 |
0 |
if( pCsr->pSorter ){
|
241277
|
0 |
0 |
if( pCsr->pStmt==0 ){
|
241280
|
0 |
0 |
rc = sqlite3Fts5StorageStmt(
|
241287
|
0 |
0 |
if( rc==SQLITE_OK && CsrFlagTest(pCsr, FTS5CSR_REQUIRE_CONTENT) ){
|
|
0 |
0 |
if( rc==SQLITE_OK && CsrFlagTest(pCsr, FTS5CSR_REQUIRE_CONTENT) ){
|
241295
|
0 |
0 |
if( rc==SQLITE_ROW ){
|
241300
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241302
|
0 |
0 |
}else if( pTab->pConfig->pzErrmsg ){
|
241344
|
0 |
0 |
if( 0==sqlite3_stricmp("delete-all", zCmd) ){
|
241345
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){
|
241354
|
0 |
0 |
}else if( 0==sqlite3_stricmp("rebuild", zCmd) ){
|
241355
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NONE ){
|
241363
|
0 |
0 |
}else if( 0==sqlite3_stricmp("optimize", zCmd) ){
|
241365
|
0 |
0 |
}else if( 0==sqlite3_stricmp("merge", zCmd) ){
|
241368
|
0 |
0 |
}else if( 0==sqlite3_stricmp("integrity-check", zCmd) ){
|
241377
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241380
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241381
|
0 |
0 |
if( bError ){
|
241397
|
0 |
0 |
if( eType1==SQLITE_INTEGER ){
|
241411
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241414
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241456
|
0 |
0 |
if( pConfig->pgsz==0 ){
|
241458
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
241467
|
0 |
0 |
if( eType0==SQLITE_NULL
|
241468
|
0 |
0 |
&& sqlite3_value_type(apVal[2+pConfig->nCol])!=SQLITE_NULL
|
241472
|
0 |
0 |
if( pConfig->eContent!=FTS5_CONTENT_NORMAL
|
241473
|
0 |
0 |
&& 0==sqlite3_stricmp("delete", z)
|
241492
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){
|
241501
|
0 |
0 |
if( eType0==SQLITE_INTEGER && fts5IsContentless(pTab) ){
|
|
0 |
0 |
if( eType0==SQLITE_INTEGER && fts5IsContentless(pTab) ){
|
241502
|
0 |
0 |
pTab->p.base.zErrMsg = sqlite3_mprintf(
|
241510
|
0 |
0 |
else if( nArg==1 ){
|
241520
|
0 |
0 |
if( eType1!=SQLITE_INTEGER && eType1!=SQLITE_NULL ){
|
|
0 |
0 |
if( eType1!=SQLITE_INTEGER && eType1!=SQLITE_NULL ){
|
241524
|
0 |
0 |
else if( eType0!=SQLITE_INTEGER ){
|
241526
|
0 |
0 |
if( eConflict==SQLITE_REPLACE && eType1==SQLITE_INTEGER ){
|
|
0 |
0 |
if( eConflict==SQLITE_REPLACE && eType1==SQLITE_INTEGER ){
|
241538
|
0 |
0 |
if( eType1==SQLITE_INTEGER && iOld!=iNew ){
|
|
0 |
0 |
if( eType1==SQLITE_INTEGER && iOld!=iNew ){
|
241539
|
0 |
0 |
if( eConflict==SQLITE_REPLACE ){
|
241541
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241547
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241550
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241563
|
0 |
0 |
if( rc==SQLITE_OK
|
241564
|
0 |
0 |
&& bUpdateOrDelete
|
241565
|
0 |
0 |
&& pConfig->bSecureDelete
|
241566
|
0 |
0 |
&& pConfig->iVersion==FTS5_CURRENT_VERSION
|
241571
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241685
|
0 |
0 |
if( fts5IsContentless((Fts5FullTable*)(pCsr->base.pVtab))
|
241686
|
0 |
0 |
|| pCsr->ePlan==FTS5_PLAN_SPECIAL
|
241692
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241710
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_POSLIST) ){
|
241712
|
0 |
0 |
if( pConfig->eDetail!=FTS5_DETAIL_FULL ){
|
241716
|
0 |
0 |
if( aPopulator==0 ) rc = SQLITE_NOMEM;
|
241717
|
0 |
0 |
for(i=0; i<pConfig->nCol && rc==SQLITE_OK; i++){
|
|
0 |
0 |
for(i=0; i<pConfig->nCol && rc==SQLITE_OK; i++){
|
241720
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241728
|
0 |
0 |
if( pCsr->pSorter ){
|
241735
|
0 |
0 |
if( pCsr->pSorter && pConfig->eDetail==FTS5_DETAIL_FULL ){
|
|
0 |
0 |
if( pCsr->pSorter && pConfig->eDetail==FTS5_DETAIL_FULL ){
|
241737
|
0 |
0 |
int i1 = (iPhrase==0 ? 0 : pSorter->aIdx[iPhrase-1]);
|
241759
|
0 |
0 |
if( pCsr->aInstIter==0 ){
|
241765
|
0 |
0 |
if( aIter ){
|
241770
|
0 |
0 |
for(i=0; i<nIter && rc==SQLITE_OK; i++){
|
|
0 |
0 |
for(i=0; i<nIter && rc==SQLITE_OK; i++){
|
241774
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241779
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241783
|
0 |
0 |
for(i=0; i<nIter; i++){
|
241784
|
0 |
0 |
if( (aIter[i].bEof==0)
|
241785
|
0 |
0 |
&& (iBest<0 || aIter[i].iPos<aIter[iBest].iPos)
|
|
0 |
0 |
&& (iBest<0 || aIter[i].iPos<aIter[iBest].iPos)
|
241790
|
0 |
0 |
if( iBest<0 ) break;
|
241793
|
0 |
0 |
if( nInst>=pCsr->nInstAlloc ){
|
241794
|
0 |
0 |
int nNewSize = pCsr->nInstAlloc ? pCsr->nInstAlloc*2 : 32;
|
241798
|
0 |
0 |
if( aInst ){
|
241812
|
0 |
0 |
if( aInst[1]<0 || aInst[1]>=nCol ){
|
|
0 |
0 |
if( aInst[1]<0 || aInst[1]>=nCol ){
|
241829
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_INST)==0
|
241830
|
0 |
0 |
|| SQLITE_OK==(rc = fts5CacheInstArray(pCsr)) ){
|
241845
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_INST)==0
|
241846
|
0 |
0 |
|| SQLITE_OK==(rc = fts5CacheInstArray(pCsr))
|
241848
|
0 |
0 |
if( iIdx<0 || iIdx>=pCsr->nInstCount ){
|
|
0 |
0 |
if( iIdx<0 || iIdx>=pCsr->nInstCount ){
|
241880
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ){
|
241892
|
0 |
0 |
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_DOCSIZE) ){
|
241893
|
0 |
0 |
if( pConfig->bColumnsize ){
|
241896
|
0 |
0 |
}else if( pConfig->zContent==0 ){
|
241898
|
0 |
0 |
for(i=0; i<pConfig->nCol; i++){
|
241899
|
0 |
0 |
if( pConfig->abUnindexed[i]==0 ){
|
241905
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<pConfig->nCol; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<pConfig->nCol; i++){
|
241906
|
0 |
0 |
if( pConfig->abUnindexed[i]==0 ){
|
241911
|
0 |
0 |
if( rc==SQLITE_OK ){
|
241921
|
0 |
0 |
if( iCol<0 ){
|
241924
|
0 |
0 |
for(i=0; i<pConfig->nCol; i++){
|
241927
|
0 |
0 |
}else if( iCol<pConfig->nCol ){
|
241949
|
0 |
0 |
for(pData=pCsr->pAuxdata; pData; pData=pData->pNext){
|
241950
|
0 |
0 |
if( pData->pAux==pCsr->pAux ) break;
|
241953
|
0 |
0 |
if( pData ){
|
241954
|
0 |
0 |
if( pData->xDelete ){
|
241960
|
0 |
0 |
if( pData==0 ){
|
241961
|
0 |
0 |
if( xDelete ) xDelete(pPtr);
|
241979
|
0 |
0 |
for(pData=pCsr->pAuxdata; pData; pData=pData->pNext){
|
241980
|
0 |
0 |
if( pData->pAux==pCsr->pAux ) break;
|
241983
|
0 |
0 |
if( pData ){
|
241985
|
0 |
0 |
if( bClear ){
|
242000
|
0 |
0 |
if( pIter->a>=pIter->b ){
|
242006
|
0 |
0 |
if( iVal==1 ){
|
242025
|
0 |
0 |
if( rc==SQLITE_OK ){
|
242027
|
0 |
0 |
pIter->b = (pIter->a ? &pIter->a[n] : 0);
|
242043
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){
|
242044
|
0 |
0 |
if( pIter->a>=pIter->b ){
|
242054
|
0 |
0 |
if( pIter->a>=pIter->b ){
|
242058
|
0 |
0 |
if( pIter->a[0]==0x01 ) break;
|
242075
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){
|
242078
|
0 |
0 |
if( pSorter ){
|
242079
|
0 |
0 |
int i1 = (iPhrase==0 ? 0 : pSorter->aIdx[iPhrase-1]);
|
242085
|
0 |
0 |
if( rc==SQLITE_OK ){
|
242087
|
0 |
0 |
pIter->b = (pIter->a ? &pIter->a[n] : 0);
|
242094
|
0 |
0 |
if( rc==SQLITE_OK ){
|
242096
|
0 |
0 |
pIter->b = (pIter->a ? &pIter->a[n] : 0);
|
242097
|
0 |
0 |
if( n<=0 ){
|
242099
|
0 |
0 |
}else if( pIter->a[0]==0x01 ){
|
242153
|
0 |
0 |
if( rc==SQLITE_OK ){
|
242161
|
0 |
0 |
if( rc==SQLITE_OK ){
|
242162
|
0 |
0 |
for(rc = fts5CursorFirst(pTab, pNew, 0);
|
242163
|
0 |
0 |
rc==SQLITE_OK && CsrFlagTest(pNew, FTS5CSR_EOF)==0;
|
242167
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
242168
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK;
|
242193
|
0 |
0 |
for(pCsr=pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){
|
242194
|
0 |
0 |
if( pCsr->iCsrId==iCsrId ) break;
|
242214
|
0 |
0 |
if( pCsr==0 || pCsr->ePlan==0 ){
|
|
0 |
0 |
if( pCsr==0 || pCsr->ePlan==0 ){
|
242234
|
0 |
0 |
if( pCsr ){
|
242266
|
0 |
0 |
for(i=0; i<(nPhrase-1); i++){
|
242273
|
0 |
0 |
for(i=0; i<nPhrase; i++){
|
242284
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<(nPhrase-1); i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<(nPhrase-1); i++){
|
242292
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nPhrase; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nPhrase; i++){
|
242324
|
0 |
0 |
if( pCsr->ePlan==FTS5_PLAN_SPECIAL ){
|
242325
|
0 |
0 |
if( iCol==pConfig->nCol ){
|
242330
|
0 |
0 |
if( iCol==pConfig->nCol ){
|
242336
|
0 |
0 |
}else if( iCol==pConfig->nCol+1 ){
|
242339
|
0 |
0 |
if( pCsr->ePlan==FTS5_PLAN_SOURCE ){
|
242341
|
0 |
0 |
}else if(
|
242343
|
0 |
0 |
|| pCsr->ePlan==FTS5_PLAN_SORTED_MATCH
|
242345
|
0 |
0 |
if( pCsr->pRank || SQLITE_OK==(rc = fts5FindRankFunction(pCsr)) ){
|
|
0 |
0 |
if( pCsr->pRank || SQLITE_OK==(rc = fts5FindRankFunction(pCsr)) ){
|
242349
|
0 |
0 |
}else if( !fts5IsContentless(pTab) ){
|
242352
|
0 |
0 |
if( rc==SQLITE_OK ){
|
242377
|
0 |
0 |
if( pAux ){
|
242451
|
933 |
0 |
if( rc==SQLITE_OK ){
|
242459
|
933 |
0 |
if( pAux ){
|
242497
|
1244 |
0 |
if( pNew ){
|
242506
|
311 |
933 |
if( pNew->pNext==0 ){
|
242522
|
0 |
0 |
if( zName==0 ){
|
242525
|
0 |
0 |
for(pMod=pGlobal->pTok; pMod; pMod=pMod->pNext){
|
242526
|
0 |
0 |
if( sqlite3_stricmp(zName, pMod->zName)==0 ) break;
|
242547
|
0 |
0 |
if( pMod ){
|
242568
|
0 |
0 |
pMod = fts5LocateTokenizer(pGlobal, nArg==0 ? 0 : azArg[0]);
|
242569
|
0 |
0 |
if( pMod==0 ){
|
242574
|
0 |
0 |
rc = pMod->x.xCreate(
|
|
0 |
0 |
rc = pMod->x.xCreate(
|
242578
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
242579
|
0 |
0 |
if( pzErr ) *pzErr = sqlite3_mprintf("error in tokenizer constructor");
|
242587
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
242600
|
927 |
309 |
for(pAux=pGlobal->pAux; pAux; pAux=pNextAux){
|
242602
|
0 |
927 |
if( pAux->xDestroy ) pAux->xDestroy(pAux->pUserData);
|
242606
|
1236 |
309 |
for(pTok=pGlobal->pTok; pTok; pTok=pNextTok){
|
242608
|
0 |
1236 |
if( pTok->xDestroy ) pTok->xDestroy(pTok->pUserData);
|
242625
|
0 |
0 |
if( ppApi ) *ppApi = &pGlobal->api;
|
242650
|
0 |
0 |
for(i=0; i<sizeof(azName)/sizeof(azName[0]); i++){
|
242651
|
0 |
0 |
if( sqlite3_stricmp(zName, azName[i])==0 ) return 1;
|
242688
|
0 |
311 |
if( pGlobal==0 ){
|
242699
|
311 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5IndexInit(db);
|
242700
|
311 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5ExprInit(pGlobal, db);
|
242701
|
311 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5AuxInit(&pGlobal->api);
|
242702
|
311 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5TokenizerInit(&pGlobal->api);
|
242703
|
311 |
0 |
if( rc==SQLITE_OK ) rc = sqlite3Fts5VocabInit(pGlobal, db);
|
242704
|
311 |
0 |
if( rc==SQLITE_OK ){
|
242709
|
311 |
0 |
if( rc==SQLITE_OK ){
|
242842
|
0 |
0 |
if( p->aStmt[eStmt]==0 ){
|
242890
|
0 |
0 |
if( zBind ){
|
242891
|
0 |
0 |
for(i=0; i<nCol; i++){
|
242907
|
0 |
0 |
if( zSql==0 ){
|
242911
|
0 |
0 |
if( eStmt>FTS5_STMT_LOOKUP ) f |= SQLITE_PREPARE_NO_VTAB;
|
242916
|
0 |
0 |
if( rc!=SQLITE_OK && pzErrMsg ){
|
|
0 |
0 |
if( rc!=SQLITE_OK && pzErrMsg ){
|
242941
|
0 |
0 |
if( zSql==0 ){
|
242965
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){
|
242971
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){
|
242986
|
0 |
0 |
if( *pRc==SQLITE_OK ){
|
243001
|
0 |
0 |
if( pConfig->bColumnsize ){
|
243004
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){
|
243024
|
0 |
0 |
rc = fts5ExecPrintf(pConfig->db, &zErr, "CREATE TABLE %Q.'%q_%q'(%s)%s",
|
243031
|
0 |
0 |
if( zErr ){
|
243063
|
0 |
0 |
if( !p ) return SQLITE_NOMEM;
|
243070
|
0 |
0 |
if( bCreate ){
|
243071
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){
|
243074
|
0 |
0 |
if( zDefn==0 ){
|
243081
|
0 |
0 |
for(i=0; i<pConfig->nCol; i++){
|
243090
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){
|
243095
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243100
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243105
|
0 |
0 |
if( rc ){
|
243117
|
0 |
0 |
if( p ){
|
243121
|
0 |
0 |
for(i=0; i<ArraySize(p->aStmt); i++){
|
243151
|
0 |
0 |
if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE;
|
243152
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){
|
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){
|
243175
|
0 |
0 |
if( apVal==0 ){
|
243177
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
243179
|
0 |
0 |
if( sqlite3_step(pSeek)!=SQLITE_ROW ){
|
243187
|
0 |
0 |
for(iCol=1; rc==SQLITE_OK && iCol<=pConfig->nCol; iCol++){
|
|
0 |
0 |
for(iCol=1; rc==SQLITE_OK && iCol<=pConfig->nCol; iCol++){
|
243188
|
0 |
0 |
if( pConfig->abUnindexed[iCol-1]==0 ){
|
243193
|
0 |
0 |
if( pSeek ){
|
243196
|
0 |
0 |
}else if( ALWAYS(apVal) ){
|
243207
|
0 |
0 |
if( p->aTotalSize[iCol-1]<0 ){
|
243212
|
0 |
0 |
if( rc==SQLITE_OK && p->nTotalRow<1 ){
|
|
0 |
0 |
if( rc==SQLITE_OK && p->nTotalRow<1 ){
|
243219
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
243238
|
0 |
0 |
if( p->pConfig->bColumnsize ){
|
243241
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243264
|
0 |
0 |
if( p->bTotalsValid==0 ){
|
243286
|
0 |
0 |
for(i=0; i<nCol; i++){
|
243289
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243309
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243314
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){
|
243316
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243324
|
0 |
0 |
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){
|
243325
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243328
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243354
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){
|
243363
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243366
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243382
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243386
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243390
|
0 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pScan) ){
|
|
0 |
0 |
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pScan) ){
|
243395
|
0 |
0 |
for(ctx.iCol=0; rc==SQLITE_OK && ctx.iCol<pConfig->nCol; ctx.iCol++){
|
|
0 |
0 |
for(ctx.iCol=0; rc==SQLITE_OK && ctx.iCol<pConfig->nCol; ctx.iCol++){
|
243397
|
0 |
0 |
if( pConfig->abUnindexed[ctx.iCol]==0 ){
|
243412
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243418
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
243421
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243450
|
0 |
0 |
if( p->pConfig->bColumnsize ){
|
243453
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243459
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243478
|
0 |
0 |
if( pConfig->eContent!=FTS5_CONTENT_NORMAL ){
|
243479
|
0 |
0 |
if( sqlite3_value_type(apVal[1])==SQLITE_INTEGER ){
|
243488
|
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++){
|
243491
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243518
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243521
|
0 |
0 |
for(ctx.iCol=0; rc==SQLITE_OK && ctx.iCol<pConfig->nCol; ctx.iCol++){
|
|
0 |
0 |
for(ctx.iCol=0; rc==SQLITE_OK && ctx.iCol<pConfig->nCol; ctx.iCol++){
|
243523
|
0 |
0 |
if( pConfig->abUnindexed[ctx.iCol]==0 ){
|
243539
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243555
|
0 |
0 |
if( zSql==0 ){
|
243560
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243561
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pCnt) ){
|
243606
|
0 |
0 |
if( nToken>FTS5_MAX_TOKEN_SIZE ) nToken = FTS5_MAX_TOKEN_SIZE;
|
243608
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){
|
|
0 |
0 |
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){
|
243631
|
0 |
0 |
if( rc==SQLITE_OK && bPresent==0 ){
|
|
0 |
0 |
if( rc==SQLITE_OK && bPresent==0 ){
|
243637
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii<pCtx->pConfig->nPrefix; ii++){
|
|
0 |
0 |
for(ii=0; rc==SQLITE_OK && ii<pCtx->pConfig->nPrefix; ii++){
|
243640
|
0 |
0 |
if( nByte ){
|
243642
|
0 |
0 |
if( bPresent==0 ){
|
243671
|
0 |
0 |
if( !aTotalSize ) return SQLITE_NOMEM;
|
243676
|
0 |
0 |
|| (pConfig->eContent==FTS5_CONTENT_EXTERNAL && iArg)
|
|
0 |
0 |
|| (pConfig->eContent==FTS5_CONTENT_EXTERNAL && iArg)
|
|
0 |
0 |
|| (pConfig->eContent==FTS5_CONTENT_EXTERNAL && iArg)
|
243678
|
0 |
0 |
if( bUseCksum ){
|
243682
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243684
|
0 |
0 |
while( SQLITE_ROW==sqlite3_step(pScan) ){
|
243688
|
0 |
0 |
if( pConfig->bColumnsize ){
|
243691
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eDetail==FTS5_DETAIL_NONE ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eDetail==FTS5_DETAIL_NONE ){
|
243694
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<pConfig->nCol; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<pConfig->nCol; i++){
|
243695
|
0 |
0 |
if( pConfig->abUnindexed[i] ) continue;
|
243698
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){
|
243701
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243711
|
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] ){
|
243715
|
0 |
0 |
if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){
|
243723
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
243726
|
0 |
0 |
if( rc==SQLITE_OK ) rc = rc2;
|
243730
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243733
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<pConfig->nCol; i++){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<pConfig->nCol; i++){
|
243734
|
0 |
0 |
if( p->aTotalSize[i]!=aTotalSize[i] ) rc = FTS5_CORRUPT;
|
243740
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_NORMAL ){
|
243743
|
0 |
0 |
if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT;
|
|
0 |
0 |
if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT;
|
243745
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pConfig->bColumnsize ){
|
243748
|
0 |
0 |
if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT;
|
|
0 |
0 |
if( rc==SQLITE_OK && nRow!=p->nTotalRow ) rc = FTS5_CORRUPT;
|
243755
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243779
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243800
|
0 |
0 |
if( p->aStmt[eStmt]==0 ){
|
243814
|
0 |
0 |
for(i=0; i<nCol; i++){
|
243815
|
0 |
0 |
if( iOff>=nBlob ) return 1;
|
243836
|
0 |
0 |
if( pLookup ){
|
243840
|
0 |
0 |
if( SQLITE_ROW==sqlite3_step(pLookup) ){
|
243843
|
0 |
0 |
if( 0==fts5StorageDecodeSizeArray(aCol, nCol, aBlob, nBlob) ){
|
243848
|
0 |
0 |
if( bCorrupt && rc==SQLITE_OK ){
|
|
0 |
0 |
if( bCorrupt && rc==SQLITE_OK ){
|
243860
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243862
|
0 |
0 |
if( iCol<0 ){
|
243864
|
0 |
0 |
for(i=0; i<p->pConfig->nCol; i++){
|
243867
|
0 |
0 |
}else if( iCol<p->pConfig->nCol ){
|
243878
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243885
|
0 |
0 |
if( p->nTotalRow<=0 ) rc = FTS5_CORRUPT;
|
243896
|
0 |
0 |
if( p->bTotalsValid ){
|
243900
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243920
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243922
|
0 |
0 |
if( pVal ){
|
243931
|
0 |
0 |
if( rc==SQLITE_OK && pVal ){
|
|
0 |
0 |
if( rc==SQLITE_OK && pVal ){
|
243934
|
0 |
0 |
if( rc==SQLITE_OK ){
|
243987
|
0 |
0 |
for(i=0; zArg[i]; i++){
|
243988
|
0 |
0 |
if( (zArg[i] & 0x80)==0 ){
|
244012
|
0 |
0 |
if( nArg%2 ){
|
244016
|
0 |
0 |
if( p==0 ){
|
244022
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nArg; i+=2){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nArg; i+=2){
|
244024
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "tokenchars") ){
|
244027
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "separators") ){
|
244033
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
244047
|
0 |
0 |
for(i=0; i<nByte; i++){
|
244049
|
0 |
0 |
if( c>='A' && c<='Z' ) c += 32;
|
|
0 |
0 |
if( c>='A' && c<='Z' ) c += 32;
|
244076
|
0 |
0 |
while( is<nText && rc==SQLITE_OK ){
|
|
0 |
0 |
while( is<nText && rc==SQLITE_OK ){
|
244080
|
0 |
0 |
while( is<nText && ((pText[is]&0x80)==0 && a[(int)pText[is]]==0) ){
|
|
0 |
0 |
while( is<nText && ((pText[is]&0x80)==0 && a[(int)pText[is]]==0) ){
|
|
0 |
0 |
while( is<nText && ((pText[is]&0x80)==0 && a[(int)pText[is]]==0) ){
|
244083
|
0 |
0 |
if( is==nText ) break;
|
244087
|
0 |
0 |
while( ie<nText && ((pText[ie]&0x80) || a[(int)pText[ie]] ) ){
|
|
0 |
0 |
while( ie<nText && ((pText[ie]&0x80) || a[(int)pText[ie]] ) ){
|
|
0 |
0 |
while( ie<nText && ((pText[ie]&0x80) || a[(int)pText[ie]] ) ){
|
244093
|
0 |
0 |
if( nByte>nFold ){
|
244094
|
0 |
0 |
if( pFold!=aFold ) sqlite3_free(pFold);
|
244096
|
0 |
0 |
if( pFold==0 ){
|
244109
|
0 |
0 |
if( pFold!=aFold ) sqlite3_free(pFold);
|
244110
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK;
|
244198
|
0 |
0 |
if( n>0 ){
|
244201
|
0 |
0 |
if( aNew ){
|
244205
|
0 |
0 |
while( zCsr<zTerm ){
|
244208
|
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);
|
244209
|
0 |
0 |
if( iCode<128 ){
|
244215
|
0 |
0 |
if( bToken!=bTokenChars && sqlite3Fts5UnicodeIsdiacritic(iCode)==0 ){
|
|
0 |
0 |
if( bToken!=bTokenChars && sqlite3Fts5UnicodeIsdiacritic(iCode)==0 ){
|
244217
|
0 |
0 |
for(i=0; i<nNew; i++){
|
244218
|
0 |
0 |
if( (u32)aNew[i]>iCode ) break;
|
244240
|
0 |
0 |
if( p->nException>0 ){
|
244245
|
0 |
0 |
while( iHi>=iLo ){
|
244247
|
0 |
0 |
if( iCode==a[iTest] ){
|
244249
|
0 |
0 |
}else if( iCode>a[iTest] ){
|
244264
|
0 |
0 |
if( pTok ){
|
244276
|
0 |
0 |
while( *z ){
|
244277
|
0 |
0 |
while( *z==' ' || *z=='\t' ) z++;
|
|
0 |
0 |
while( *z==' ' || *z=='\t' ) z++;
|
244278
|
0 |
0 |
if( *z && sqlite3Fts5UnicodeCatParse(z, p->aCategory) ){
|
|
0 |
0 |
if( *z && sqlite3Fts5UnicodeCatParse(z, p->aCategory) ){
|
244281
|
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++;
|
244301
|
0 |
0 |
if( nArg%2 ){
|
244305
|
0 |
0 |
if( p ){
|
244313
|
0 |
0 |
if( p->aFold==0 ){
|
244318
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nArg; i+=2){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nArg; i+=2){
|
244319
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "categories") ){
|
244324
|
0 |
0 |
if( rc==SQLITE_OK ){
|
244328
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nArg; i+=2){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nArg; i+=2){
|
244330
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "remove_diacritics") ){
|
244331
|
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] ){
|
244341
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "tokenchars") ){
|
244344
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "separators") ){
|
244347
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "categories") ){
|
244357
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
244401
|
0 |
0 |
while( rc==SQLITE_OK ){
|
244409
|
0 |
0 |
if( zCsr>=zTerm ) goto tokenize_done;
|
244410
|
0 |
0 |
if( *zCsr & 0x80 ) {
|
244414
|
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);
|
244415
|
0 |
0 |
if( fts5UnicodeIsAlnum(p, iCode) ){
|
244419
|
0 |
0 |
if( a[*zCsr] ){
|
244429
|
0 |
0 |
while( zCsr<zTerm ){
|
244433
|
0 |
0 |
if( zOut>pEnd ){
|
244435
|
0 |
0 |
if( aFold==0 ){
|
244447
|
0 |
0 |
if( *zCsr & 0x80 ){
|
244450
|
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);
|
244451
|
0 |
0 |
if( fts5UnicodeIsAlnum(p,iCode)||sqlite3Fts5UnicodeIsdiacritic(iCode) ){
|
|
0 |
0 |
if( fts5UnicodeIsAlnum(p,iCode)||sqlite3Fts5UnicodeIsdiacritic(iCode) ){
|
244454
|
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);
|
244458
|
0 |
0 |
}else if( a[*zCsr]==0 ){
|
244463
|
0 |
0 |
if( *zCsr>='A' && *zCsr<='Z' ){
|
|
0 |
0 |
if( *zCsr>='A' && *zCsr<='Z' ){
|
244478
|
0 |
0 |
if( rc==SQLITE_DONE ) rc = SQLITE_OK;
|
244501
|
0 |
0 |
if( pTok ){
|
244503
|
0 |
0 |
if( p->pTokenizer ){
|
244524
|
0 |
0 |
if( nArg>0 ){
|
244529
|
0 |
0 |
if( pRet ){
|
244535
|
0 |
0 |
if( rc==SQLITE_OK ){
|
244536
|
0 |
0 |
int nArg2 = (nArg>0 ? nArg-1 : 0);
|
244537
|
0 |
0 |
const char **azArg2 = (nArg2 ? &azArg[1] : 0);
|
244541
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
244593
|
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')
|
244602
|
0 |
0 |
for(i=0; i<nStem; i++){
|
244603
|
0 |
0 |
if( 0==(bCons = !fts5PorterIsVowel(zStem[i], bCons)) ) break;
|
244607
|
0 |
0 |
for(i++; i<nStem; i++){
|
244608
|
0 |
0 |
if( (bCons = !fts5PorterIsVowel(zStem[i], bCons)) ) return i+1;
|
244622
|
0 |
0 |
if( n && fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){
|
|
0 |
0 |
if( n && fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){
|
244632
|
0 |
0 |
if( n && 0==fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){
|
|
0 |
0 |
if( n && 0==fts5PorterGobbleVC(&zStem[n], nStem-n, 1) ){
|
244640
|
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' ){
|
244646
|
0 |
0 |
for(i=0; i<nStem; i++){
|
244658
|
0 |
0 |
return (zStem[nStem-1]=='s' || zStem[nStem-1]=='t')
|
244659
|
0 |
0 |
&& fts5Porter_MGt1(zStem, nStem);
|
|
0 |
0 |
&& fts5Porter_MGt1(zStem, nStem);
|
244665
|
0 |
0 |
for(i=0; i<nStem; i++){
|
244666
|
0 |
0 |
if( fts5PorterIsVowel(zStem[i], i>0) ){
|
244685
|
0 |
0 |
if( nBuf>2 && 0==memcmp("al", &aBuf[nBuf-2], 2) ){
|
|
0 |
0 |
if( nBuf>2 && 0==memcmp("al", &aBuf[nBuf-2], 2) ){
|
244686
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-2) ){
|
244693
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ance", &aBuf[nBuf-4], 4) ){
|
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ance", &aBuf[nBuf-4], 4) ){
|
244694
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){
|
244697
|
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) ){
|
244698
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){
|
244705
|
0 |
0 |
if( nBuf>2 && 0==memcmp("er", &aBuf[nBuf-2], 2) ){
|
|
0 |
0 |
if( nBuf>2 && 0==memcmp("er", &aBuf[nBuf-2], 2) ){
|
244706
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-2) ){
|
244713
|
0 |
0 |
if( nBuf>2 && 0==memcmp("ic", &aBuf[nBuf-2], 2) ){
|
|
0 |
0 |
if( nBuf>2 && 0==memcmp("ic", &aBuf[nBuf-2], 2) ){
|
244714
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-2) ){
|
244721
|
0 |
0 |
if( nBuf>4 && 0==memcmp("able", &aBuf[nBuf-4], 4) ){
|
|
0 |
0 |
if( nBuf>4 && 0==memcmp("able", &aBuf[nBuf-4], 4) ){
|
244722
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){
|
244725
|
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) ){
|
244726
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){
|
244733
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ant", &aBuf[nBuf-3], 3) ){
|
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ant", &aBuf[nBuf-3], 3) ){
|
244734
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){
|
244737
|
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) ){
|
244738
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-5) ){
|
244741
|
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) ){
|
244742
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-4) ){
|
244745
|
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) ){
|
244746
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){
|
244753
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ion", &aBuf[nBuf-3], 3) ){
|
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ion", &aBuf[nBuf-3], 3) ){
|
244754
|
0 |
0 |
if( fts5Porter_MGt1_and_S_or_T(aBuf, nBuf-3) ){
|
244757
|
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) ){
|
244758
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-2) ){
|
244765
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ism", &aBuf[nBuf-3], 3) ){
|
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ism", &aBuf[nBuf-3], 3) ){
|
244766
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){
|
244773
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ate", &aBuf[nBuf-3], 3) ){
|
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ate", &aBuf[nBuf-3], 3) ){
|
244774
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){
|
244777
|
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) ){
|
244778
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){
|
244785
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ous", &aBuf[nBuf-3], 3) ){
|
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ous", &aBuf[nBuf-3], 3) ){
|
244786
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){
|
244793
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ive", &aBuf[nBuf-3], 3) ){
|
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ive", &aBuf[nBuf-3], 3) ){
|
244794
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){
|
244801
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ize", &aBuf[nBuf-3], 3) ){
|
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ize", &aBuf[nBuf-3], 3) ){
|
244802
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-3) ){
|
244819
|
0 |
0 |
if( nBuf>2 && 0==memcmp("at", &aBuf[nBuf-2], 2) ){
|
|
0 |
0 |
if( nBuf>2 && 0==memcmp("at", &aBuf[nBuf-2], 2) ){
|
244827
|
0 |
0 |
if( nBuf>2 && 0==memcmp("bl", &aBuf[nBuf-2], 2) ){
|
|
0 |
0 |
if( nBuf>2 && 0==memcmp("bl", &aBuf[nBuf-2], 2) ){
|
244835
|
0 |
0 |
if( nBuf>2 && 0==memcmp("iz", &aBuf[nBuf-2], 2) ){
|
|
0 |
0 |
if( nBuf>2 && 0==memcmp("iz", &aBuf[nBuf-2], 2) ){
|
244853
|
0 |
0 |
if( nBuf>7 && 0==memcmp("ational", &aBuf[nBuf-7], 7) ){
|
|
0 |
0 |
if( nBuf>7 && 0==memcmp("ational", &aBuf[nBuf-7], 7) ){
|
244854
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){
|
244858
|
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) ){
|
244859
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-6) ){
|
244867
|
0 |
0 |
if( nBuf>4 && 0==memcmp("enci", &aBuf[nBuf-4], 4) ){
|
|
0 |
0 |
if( nBuf>4 && 0==memcmp("enci", &aBuf[nBuf-4], 4) ){
|
244868
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){
|
244872
|
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) ){
|
244873
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){
|
244881
|
0 |
0 |
if( nBuf>4 && 0==memcmp("izer", &aBuf[nBuf-4], 4) ){
|
|
0 |
0 |
if( nBuf>4 && 0==memcmp("izer", &aBuf[nBuf-4], 4) ){
|
244882
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){
|
244890
|
0 |
0 |
if( nBuf>4 && 0==memcmp("logi", &aBuf[nBuf-4], 4) ){
|
|
0 |
0 |
if( nBuf>4 && 0==memcmp("logi", &aBuf[nBuf-4], 4) ){
|
244891
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){
|
244899
|
0 |
0 |
if( nBuf>3 && 0==memcmp("bli", &aBuf[nBuf-3], 3) ){
|
|
0 |
0 |
if( nBuf>3 && 0==memcmp("bli", &aBuf[nBuf-3], 3) ){
|
244900
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-3) ){
|
244904
|
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) ){
|
244905
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){
|
244909
|
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) ){
|
244910
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){
|
244914
|
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) ){
|
244915
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-3) ){
|
244919
|
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) ){
|
244920
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){
|
244928
|
0 |
0 |
if( nBuf>7 && 0==memcmp("ization", &aBuf[nBuf-7], 7) ){
|
|
0 |
0 |
if( nBuf>7 && 0==memcmp("ization", &aBuf[nBuf-7], 7) ){
|
244929
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){
|
244933
|
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) ){
|
244934
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){
|
244938
|
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) ){
|
244939
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){
|
244947
|
0 |
0 |
if( nBuf>5 && 0==memcmp("alism", &aBuf[nBuf-5], 5) ){
|
|
0 |
0 |
if( nBuf>5 && 0==memcmp("alism", &aBuf[nBuf-5], 5) ){
|
244948
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){
|
244952
|
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) ){
|
244953
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){
|
244957
|
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) ){
|
244958
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){
|
244962
|
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) ){
|
244963
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-7) ){
|
244971
|
0 |
0 |
if( nBuf>5 && 0==memcmp("aliti", &aBuf[nBuf-5], 5) ){
|
|
0 |
0 |
if( nBuf>5 && 0==memcmp("aliti", &aBuf[nBuf-5], 5) ){
|
244972
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){
|
244976
|
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) ){
|
244977
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){
|
244981
|
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) ){
|
244982
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-6) ){
|
245000
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ical", &aBuf[nBuf-4], 4) ){
|
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ical", &aBuf[nBuf-4], 4) ){
|
245001
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){
|
245009
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ness", &aBuf[nBuf-4], 4) ){
|
|
0 |
0 |
if( nBuf>4 && 0==memcmp("ness", &aBuf[nBuf-4], 4) ){
|
245010
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-4) ){
|
245017
|
0 |
0 |
if( nBuf>5 && 0==memcmp("icate", &aBuf[nBuf-5], 5) ){
|
|
0 |
0 |
if( nBuf>5 && 0==memcmp("icate", &aBuf[nBuf-5], 5) ){
|
245018
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){
|
245022
|
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) ){
|
245023
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){
|
245031
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ful", &aBuf[nBuf-3], 3) ){
|
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ful", &aBuf[nBuf-3], 3) ){
|
245032
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-3) ){
|
245039
|
0 |
0 |
if( nBuf>5 && 0==memcmp("ative", &aBuf[nBuf-5], 5) ){
|
|
0 |
0 |
if( nBuf>5 && 0==memcmp("ative", &aBuf[nBuf-5], 5) ){
|
245040
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){
|
245047
|
0 |
0 |
if( nBuf>5 && 0==memcmp("alize", &aBuf[nBuf-5], 5) ){
|
|
0 |
0 |
if( nBuf>5 && 0==memcmp("alize", &aBuf[nBuf-5], 5) ){
|
245048
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-5) ){
|
245066
|
0 |
0 |
if( nBuf>3 && 0==memcmp("eed", &aBuf[nBuf-3], 3) ){
|
|
0 |
0 |
if( nBuf>3 && 0==memcmp("eed", &aBuf[nBuf-3], 3) ){
|
245067
|
0 |
0 |
if( fts5Porter_MGt0(aBuf, nBuf-3) ){
|
245071
|
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) ){
|
245072
|
0 |
0 |
if( fts5Porter_Vowel(aBuf, nBuf-2) ){
|
245080
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ing", &aBuf[nBuf-3], 3) ){
|
|
0 |
0 |
if( nBuf>3 && 0==memcmp("ing", &aBuf[nBuf-3], 3) ){
|
245081
|
0 |
0 |
if( fts5Porter_Vowel(aBuf, nBuf-3) ){
|
245099
|
0 |
0 |
if( aBuf[nBuf-1]=='s' ){
|
245100
|
0 |
0 |
if( aBuf[nBuf-2]=='e' ){
|
245101
|
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')
|
245102
|
0 |
0 |
|| (nBuf>3 && aBuf[nBuf-3]=='i' )
|
|
0 |
0 |
|| (nBuf>3 && aBuf[nBuf-3]=='i' )
|
245109
|
0 |
0 |
else if( aBuf[nBuf-2]!='s' ){
|
245128
|
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;
|
245135
|
0 |
0 |
if( fts5PorterStep1B(aBuf, &nBuf) ){
|
245136
|
0 |
0 |
if( fts5PorterStep1B2(aBuf, &nBuf)==0 ){
|
245138
|
0 |
0 |
if( fts5PorterIsVowel(c, 0)==0
|
245139
|
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]
|
245142
|
0 |
0 |
}else if( fts5Porter_MEq1(aBuf, nBuf) && fts5Porter_Ostar(aBuf, nBuf) ){
|
|
0 |
0 |
}else if( fts5Porter_MEq1(aBuf, nBuf) && fts5Porter_Ostar(aBuf, nBuf) ){
|
245149
|
0 |
0 |
if( aBuf[nBuf-1]=='y' && fts5Porter_Vowel(aBuf, nBuf-1) ){
|
|
0 |
0 |
if( aBuf[nBuf-1]=='y' && fts5Porter_Vowel(aBuf, nBuf-1) ){
|
245160
|
0 |
0 |
if( aBuf[nBuf-1]=='e' ){
|
245161
|
0 |
0 |
if( fts5Porter_MGt1(aBuf, nBuf-1)
|
245162
|
0 |
0 |
|| (fts5Porter_MEq1(aBuf, nBuf-1) && !fts5Porter_Ostar(aBuf, nBuf-1))
|
|
0 |
0 |
|| (fts5Porter_MEq1(aBuf, nBuf-1) && !fts5Porter_Ostar(aBuf, nBuf-1))
|
245169
|
0 |
0 |
if( nBuf>1 && aBuf[nBuf-1]=='l'
|
|
0 |
0 |
if( nBuf>1 && aBuf[nBuf-1]=='l'
|
245170
|
0 |
0 |
&& aBuf[nBuf-2]=='l' && fts5Porter_MGt1(aBuf, nBuf-1)
|
|
0 |
0 |
&& aBuf[nBuf-2]=='l' && fts5Porter_MGt1(aBuf, nBuf-1)
|
245228
|
0 |
0 |
if( pNew==0 ){
|
245233
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nArg; i+=2){
|
|
0 |
0 |
for(i=0; rc==SQLITE_OK && i<nArg; i+=2){
|
245235
|
0 |
0 |
if( 0==sqlite3_stricmp(azArg[i], "case_sensitive") ){
|
245236
|
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] ){
|
245245
|
0 |
0 |
if( rc!=SQLITE_OK ){
|
245277
|
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);
|
245278
|
0 |
0 |
if( iCode==0 ) break;
|
245280
|
0 |
0 |
if( zIn<zEof ){
|
245281
|
0 |
0 |
if( p->bFold ) iCode = sqlite3Fts5UnicodeFold(iCode, 0);
|
245282
|
0 |
0 |
WRITE_UTF8(zOut, iCode);
|
|
0 |
0 |
WRITE_UTF8(zOut, iCode);
|
|
0 |
0 |
WRITE_UTF8(zOut, iCode);
|
245283
|
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);
|
245284
|
0 |
0 |
if( iCode==0 ) break;
|
245288
|
0 |
0 |
if( zIn<zEof ){
|
245289
|
0 |
0 |
if( p->bFold ) iCode = sqlite3Fts5UnicodeFold(iCode, 0);
|
245290
|
0 |
0 |
WRITE_UTF8(zOut, iCode);
|
|
0 |
0 |
WRITE_UTF8(zOut, iCode);
|
|
0 |
0 |
WRITE_UTF8(zOut, iCode);
|
245291
|
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);
|
245292
|
0 |
0 |
if( iCode==0 ) break;
|
245293
|
0 |
0 |
if( p->bFold ) iCode = sqlite3Fts5UnicodeFold(iCode, 0);
|
245294
|
0 |
0 |
WRITE_UTF8(zOut, iCode);
|
|
0 |
0 |
WRITE_UTF8(zOut, iCode);
|
|
0 |
0 |
WRITE_UTF8(zOut, iCode);
|
245299
|
0 |
0 |
if( rc!=SQLITE_OK ) break;
|
245321
|
0 |
0 |
if( xCreate==fts5TriCreate ){
|
245323
|
0 |
0 |
return p->bFold ? FTS5_PATTERN_LIKE : FTS5_PATTERN_GLOB;
|
245345
|
1555 |
0 |
for(i=0; rc==SQLITE_OK && i<ArraySize(aBuiltin); i++){
|
|
1244 |
311 |
for(i=0; rc==SQLITE_OK && i<ArraySize(aBuiltin); i++){
|
245435
|
0 |
0 |
while( iHi>=iLo ){
|
245437
|
0 |
0 |
if( key >= aDia[iTest] ){
|
245445
|
0 |
0 |
if( bComplex==0 && (aChar[iRes] & 0x80) ) return c;
|
|
0 |
0 |
if( bComplex==0 && (aChar[iRes] & 0x80) ) return c;
|
245446
|
0 |
0 |
return (c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : ((int)aChar[iRes] & 0x7F);
|
245457
|
0 |
0 |
if( c<768 || c>817 ) return 0;
|
|
0 |
0 |
if( c<768 || c>817 ) return 0;
|
245458
|
0 |
0 |
return (c < 768+32) ?
|
245569
|
0 |
0 |
if( c<128 ){
|
245570
|
0 |
0 |
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A');
|
|
0 |
0 |
if( c>='A' && c<='Z' ) ret = c + ('a' - 'A');
|
245571
|
0 |
0 |
}else if( c<65536 ){
|
245578
|
0 |
0 |
while( iHi>=iLo ){
|
245581
|
0 |
0 |
if( cmp>=0 ){
|
245591
|
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)) ){
|
245596
|
0 |
0 |
if( eRemoveDiacritic ){
|
245601
|
0 |
0 |
else if( c>=66560 && c<66600 ){
|
|
0 |
0 |
else if( c>=66560 && c<66600 ){
|
246097
|
0 |
0 |
if( iCode>=(1<<20) ){
|
246103
|
0 |
0 |
while( iHi>iLo ){
|
246106
|
0 |
0 |
if( iKey>=aFts5UnicodeMap[iTest] ){
|
246114
|
0 |
0 |
if( iRes<0 ) return 0;
|
246115
|
0 |
0 |
if( iKey>=(aFts5UnicodeMap[iRes]+(aFts5UnicodeData[iRes]>>5)) ) return 0;
|
246117
|
0 |
0 |
if( ret!=30 ) return ret;
|
246118
|
0 |
0 |
return ((iKey - aFts5UnicodeMap[iRes]) & 0x01) ? 5 : 9;
|
246124
|
0 |
0 |
while( i<128 ){
|
246127
|
0 |
0 |
for(; i<128 && i<n; i++){
|
|
0 |
0 |
for(; i<128 && i<n; i++){
|
246165
|
0 |
0 |
if (!(a&0x80))
|
246176
|
0 |
0 |
if (!(b&0x80))
|
246190
|
0 |
0 |
if (!(a&0x80))
|
246242
|
0 |
0 |
if (!(a&0x80))
|
246251
|
0 |
0 |
if (!(b&0x80))
|
246268
|
0 |
0 |
if (!(a&0x80))
|
246284
|
0 |
0 |
if (!(b&0x80))
|
246308
|
0 |
0 |
if (!(a&0x80))
|
246329
|
0 |
0 |
if (!(b&0x80))
|
246345
|
0 |
0 |
if (!(a&0x80))
|
246362
|
0 |
0 |
if (!(b&0x80))
|
246434
|
0 |
0 |
if( v & (((u64)0xff000000)<<32) ){
|
246437
|
0 |
0 |
for(i=7; i>=0; i--){
|
246447
|
0 |
0 |
}while( v!=0 );
|
246450
|
0 |
0 |
for(i=0, j=n-1; j>=0; j--, i++){
|
246457
|
0 |
0 |
if( v<=0x7f ){
|
246461
|
0 |
0 |
if( v<=0x3fff ){
|
246475
|
0 |
0 |
if( iVal<(1 << 14) ) return 2;
|
246476
|
0 |
0 |
if( iVal<(1 << 21) ) return 3;
|
246477
|
0 |
0 |
if( iVal<(1 << 28) ) return 4;
|
246587
|
0 |
0 |
if( rc==SQLITE_OK ){
|
246589
|
0 |
0 |
if( sqlite3_stricmp(zCopy, "col")==0 ){
|
246593
|
0 |
0 |
if( sqlite3_stricmp(zCopy, "row")==0 ){
|
246596
|
0 |
0 |
if( sqlite3_stricmp(zCopy, "instance")==0 ){
|
246667
|
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);
|
246669
|
0 |
0 |
if( argc!=5 && bDb==0 ){
|
|
0 |
0 |
if( argc!=5 && bDb==0 ){
|
246674
|
0 |
0 |
const char *zDb = bDb ? argv[3] : argv[1];
|
246675
|
0 |
0 |
const char *zTab = bDb ? argv[4] : argv[3];
|
246676
|
0 |
0 |
const char *zType = bDb ? argv[5] : argv[4];
|
246682
|
0 |
0 |
if( rc==SQLITE_OK ){
|
246689
|
0 |
0 |
if( pRet ){
|
246757
|
0 |
0 |
for(i=0; i<pInfo->nConstraint; i++){
|
246759
|
0 |
0 |
if( p->usable==0 ) continue;
|
246760
|
0 |
0 |
if( p->iColumn==0 ){ /* term column */
|
246761
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_EQ ) iTermEq = i;
|
246762
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_LE ) iTermLe = i;
|
246763
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_LT ) iTermLe = i;
|
246764
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_GE ) iTermGe = i;
|
246765
|
0 |
0 |
if( p->op==SQLITE_INDEX_CONSTRAINT_GT ) iTermGe = i;
|
246769
|
0 |
0 |
if( iTermEq>=0 ){
|
246775
|
0 |
0 |
if( iTermGe>=0 ){
|
246780
|
0 |
0 |
if( iTermLe>=0 ){
|
246792
|
0 |
0 |
if( pInfo->nOrderBy==1
|
246793
|
0 |
0 |
&& pInfo->aOrderBy[0].iColumn==0
|
246794
|
0 |
0 |
&& pInfo->aOrderBy[0].desc==0
|
246817
|
0 |
0 |
if( pTab->bBusy ){
|
246827
|
0 |
0 |
if( zSql ){
|
246832
|
0 |
0 |
if( rc==SQLITE_ERROR ) rc = SQLITE_OK;
|
246835
|
0 |
0 |
if( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){
|
|
0 |
0 |
if( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){
|
246841
|
0 |
0 |
if( rc==SQLITE_OK ){
|
246842
|
0 |
0 |
if( pFts5==0 ){
|
246845
|
0 |
0 |
if( rc==SQLITE_OK ){
|
246856
|
0 |
0 |
if( rc==SQLITE_OK ){
|
246861
|
0 |
0 |
if( pCsr ){
|
246902
|
0 |
0 |
if( sqlite3Fts5IterEof(pCsr->pIter) ){
|
246908
|
0 |
0 |
if( pCsr->nLeTerm>=0 ){
|
246911
|
0 |
0 |
if( bCmp<0 || (bCmp==0 && pCsr->nLeTerm<nTerm) ){
|
|
0 |
0 |
if( bCmp<0 || (bCmp==0 && pCsr->nLeTerm<nTerm) ){
|
|
0 |
0 |
if( bCmp<0 || (bCmp==0 && pCsr->nLeTerm<nTerm) ){
|
246930
|
0 |
0 |
while( eDetail==FTS5_DETAIL_NONE
|
246931
|
0 |
0 |
|| sqlite3Fts5PoslistNext64(pIter->pData, pIter->nData, po, pp)
|
246937
|
0 |
0 |
if( rc==SQLITE_OK ){
|
246939
|
0 |
0 |
if( pCsr->bEof || eDetail==FTS5_DETAIL_NONE ) break;
|
|
0 |
0 |
if( pCsr->bEof || eDetail==FTS5_DETAIL_NONE ) break;
|
246941
|
0 |
0 |
if( rc ){
|
246960
|
0 |
0 |
if( rc!=SQLITE_OK ) return rc;
|
246963
|
0 |
0 |
if( pTab->eType==FTS5_VOCAB_INSTANCE ){
|
246967
|
0 |
0 |
if( pTab->eType==FTS5_VOCAB_COL ){
|
246968
|
0 |
0 |
for(pCsr->iCol++; pCsr->iCol<nCol; pCsr->iCol++){
|
246969
|
0 |
0 |
if( pCsr->aDoc[pCsr->iCol] ) break;
|
246973
|
0 |
0 |
if( pTab->eType!=FTS5_VOCAB_COL || pCsr->iCol>=nCol ){
|
|
0 |
0 |
if( pTab->eType!=FTS5_VOCAB_COL || pCsr->iCol>=nCol ){
|
246974
|
0 |
0 |
if( sqlite3Fts5IterEof(pCsr->pIter) ){
|
246982
|
0 |
0 |
if( pCsr->nLeTerm>=0 ){
|
246985
|
0 |
0 |
if( bCmp<0 || (bCmp==0 && pCsr->nLeTerm<nTerm) ){
|
|
0 |
0 |
if( bCmp<0 || (bCmp==0 && pCsr->nLeTerm<nTerm) ){
|
|
0 |
0 |
if( bCmp<0 || (bCmp==0 && pCsr->nLeTerm<nTerm) ){
|
246997
|
0 |
0 |
while( rc==SQLITE_OK ){
|
247008
|
0 |
0 |
if( eDetail==FTS5_DETAIL_FULL ){
|
247009
|
0 |
0 |
while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff, &iPos) ){
|
247017
|
0 |
0 |
if( eDetail==FTS5_DETAIL_FULL ){
|
247019
|
0 |
0 |
while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff, &iPos) ){
|
247021
|
0 |
0 |
if( iCol!=ii ){
|
247022
|
0 |
0 |
if( ii>=nCol ){
|
247031
|
0 |
0 |
}else if( eDetail==FTS5_DETAIL_COLUMNS ){
|
247032
|
0 |
0 |
while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff,&iPos) ){
|
247034
|
0 |
0 |
if( iPos>=nCol ){
|
247051
|
0 |
0 |
if( rc==SQLITE_OK ){
|
247054
|
0 |
0 |
if( pTab->eType==FTS5_VOCAB_INSTANCE ) break;
|
247056
|
0 |
0 |
if( rc==SQLITE_OK ){
|
247058
|
0 |
0 |
if( nTerm!=pCsr->term.n
|
247059
|
0 |
0 |
|| (nTerm>0 && memcmp(zTerm, pCsr->term.p, nTerm))
|
|
0 |
0 |
|| (nTerm>0 && memcmp(zTerm, pCsr->term.p, nTerm))
|
247063
|
0 |
0 |
if( sqlite3Fts5IterEof(pCsr->pIter) ) break;
|
247069
|
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 ){
|
247070
|
0 |
0 |
for(/* noop */; pCsr->iCol<nCol && pCsr->aDoc[pCsr->iCol]==0; pCsr->iCol++);
|
|
0 |
0 |
for(/* noop */; pCsr->iCol<nCol && pCsr->aDoc[pCsr->iCol]==0; pCsr->iCol++);
|
247071
|
0 |
0 |
if( pCsr->iCol==nCol ){
|
247105
|
0 |
0 |
if( idxNum & FTS5_VOCAB_TERM_EQ ) pEq = apVal[iVal++];
|
247106
|
0 |
0 |
if( idxNum & FTS5_VOCAB_TERM_GE ) pGe = apVal[iVal++];
|
247107
|
0 |
0 |
if( idxNum & FTS5_VOCAB_TERM_LE ) pLe = apVal[iVal++];
|
247109
|
0 |
0 |
if( pEq ){
|
247114
|
0 |
0 |
if( pGe ){
|
247118
|
0 |
0 |
if( pLe ){
|
247120
|
0 |
0 |
if( zCopy==0 ) zCopy = "";
|
247123
|
0 |
0 |
if( pCsr->zLeTerm==0 ){
|
247131
|
0 |
0 |
if( rc==SQLITE_OK ){
|
247134
|
0 |
0 |
if( rc==SQLITE_OK ){
|
247138
|
0 |
0 |
if( rc==SQLITE_OK && eType==FTS5_VOCAB_INSTANCE ){
|
|
0 |
0 |
if( rc==SQLITE_OK && eType==FTS5_VOCAB_INSTANCE ){
|
247141
|
0 |
0 |
if( rc==SQLITE_OK && !pCsr->bEof
|
|
0 |
0 |
if( rc==SQLITE_OK && !pCsr->bEof
|
247142
|
0 |
0 |
&& (eType!=FTS5_VOCAB_INSTANCE
|
247143
|
0 |
0 |
|| pCsr->pFts5->pConfig->eDetail!=FTS5_DETAIL_NONE)
|
247170
|
0 |
0 |
if( iCol==0 ){
|
247174
|
0 |
0 |
}else if( eType==FTS5_VOCAB_COL ){
|
247176
|
0 |
0 |
if( iCol==1 ){
|
247177
|
0 |
0 |
if( eDetail!=FTS5_DETAIL_NONE ){
|
247181
|
0 |
0 |
}else if( iCol==2 ){
|
247186
|
0 |
0 |
}else if( eType==FTS5_VOCAB_ROW ){
|
247188
|
0 |
0 |
if( iCol==1 ){
|
247201
|
0 |
0 |
if( eDetail==FTS5_DETAIL_FULL ){
|
247203
|
0 |
0 |
}else if( eDetail==FTS5_DETAIL_COLUMNS ){
|
247206
|
0 |
0 |
if( ii>=0 && ii<pCsr->pFts5->pConfig->nCol ){
|
|
0 |
0 |
if( ii>=0 && ii<pCsr->pFts5->pConfig->nCol ){
|
247214
|
0 |
0 |
if( eDetail==FTS5_DETAIL_FULL ){
|
247223
|
0 |
0 |
if( iVal>0 ) sqlite3_result_int64(pCtx, iVal);
|