Lines Matching refs:pParse

34   Parse *pParse;           /* The parsing context */  member
260 pBlock = sqlite3DbMallocRawNN(pWInfo->pParse->db, nByte+sizeof(*pBlock)); in sqlite3WhereMalloc()
356 Parse *pParse = pWC->pWInfo->pParse; in whereScanNext() local
362 pColl = sqlite3ExprCompareCollSeq(pParse, pX); in whereScanNext()
363 if( pColl==0 ) pColl = pParse->db->pDfltColl; in whereScanNext()
535 Parse *pParse, /* Parse context */ in findIndexCol() argument
551 CollSeq *pColl = sqlite3ExprNNCollSeq(pParse, pList->a[i].pExpr); in findIndexCol()
588 Parse *pParse, /* Parsing context */ in isDistinctRedundant() argument
634 if( findIndexCol(pParse, pDistinct, iBase, pIdx, i)<0 ) break; in isDistinctRedundant()
668 Parse *pParse, /* Parsing context */ in translateColumnToCopy() argument
674 Vdbe *v = pParse->pVdbe; in translateColumnToCopy()
677 if( pParse->db->mallocFailed ) return; in translateColumnToCopy()
821 Parse *pParse, /* The parsing context */ in constructAutomaticIndex() argument
853 v = pParse->pVdbe; in constructAutomaticIndex()
872 pPartial = sqlite3ExprAnd(pParse, pPartial, in constructAutomaticIndex()
873 sqlite3ExprDup(pParse->db, pExpr, 0)); in constructAutomaticIndex()
890 if( whereLoopResize(pParse->db, pLoop, nKeyCol+1) ){ in constructAutomaticIndex()
898 assert( nKeyCol>0 || pParse->db->mallocFailed ); in constructAutomaticIndex()
923 pIdx = sqlite3AllocateIndexObject(pParse->db, nKeyCol+1, 0, &zNotUsed); in constructAutomaticIndex()
943 pColl = sqlite3ExprCompareCollSeq(pParse, pX); in constructAutomaticIndex()
944 assert( pColl!=0 || pParse->nErr>0 ); /* TH3 collate01.800 */ in constructAutomaticIndex()
974 pLevel->iIdxCur = pParse->nTab++; in constructAutomaticIndex()
976 sqlite3VdbeSetP4KeyInfo(pParse, pIdx); in constructAutomaticIndex()
978 if( OptimizationEnabled(pParse->db, SQLITE_BloomFilter) ){ in constructAutomaticIndex()
979 pLevel->regFilter = ++pParse->nMem; in constructAutomaticIndex()
996 iContinue = sqlite3VdbeMakeLabel(pParse); in constructAutomaticIndex()
997 sqlite3ExprIfFalse(pParse, pPartial, iContinue, SQLITE_JUMPIFNULL); in constructAutomaticIndex()
1000 regRecord = sqlite3GetTempReg(pParse); in constructAutomaticIndex()
1002 pParse, pIdx, pLevel->iTabCur, regRecord, 0, 0, 0, 0 in constructAutomaticIndex()
1013 testcase( pParse->db->mallocFailed ); in constructAutomaticIndex()
1015 translateColumnToCopy(pParse, addrTop, pLevel->iTabCur, in constructAutomaticIndex()
1024 sqlite3ReleaseTempReg(pParse, regRecord); in constructAutomaticIndex()
1030 sqlite3ExprDelete(pParse->db, pPartial); in constructAutomaticIndex()
1065 Parse *pParse = pWInfo->pParse; /* Parsing context */ in sqlite3ConstructBloomFilter() local
1066 Vdbe *v = pParse->pVdbe; /* VDBE under construction */ in sqlite3ConstructBloomFilter()
1079 sqlite3WhereExplainBloomFilter(pParse, pWInfo, pLevel); in sqlite3ConstructBloomFilter()
1080 addrCont = sqlite3VdbeMakeLabel(pParse); in sqlite3ConstructBloomFilter()
1082 pLevel->regFilter = ++pParse->nMem; in sqlite3ConstructBloomFilter()
1111 sqlite3ExprIfFalse(pParse, pTerm->pExpr, addrCont, SQLITE_JUMPIFNULL); in sqlite3ConstructBloomFilter()
1115 int r1 = sqlite3GetTempReg(pParse); in sqlite3ConstructBloomFilter()
1118 sqlite3ReleaseTempReg(pParse, r1); in sqlite3ConstructBloomFilter()
1122 int r1 = sqlite3GetTempRange(pParse, n); in sqlite3ConstructBloomFilter()
1130 sqlite3ReleaseTempRange(pParse, r1, n); in sqlite3ConstructBloomFilter()
1137 if( OptimizationDisabled(pParse->db, SQLITE_BloomPulldown) ) break; in sqlite3ConstructBloomFilter()
1176 Parse *pParse = pWInfo->pParse; in allocateIndexInfo() local
1279 pIdxInfo = sqlite3DbMallocZero(pParse->db, sizeof(*pIdxInfo) in allocateIndexInfo()
1284 sqlite3ErrorMsg(pParse, "out of memory"); in allocateIndexInfo()
1295 pHidden->pParse = pParse; in allocateIndexInfo()
1369 assert( pHidden->pParse!=0 ); in freeIndexInfo()
1370 assert( pHidden->pParse->db==db ); in freeIndexInfo()
1394 static int vtabBestIndex(Parse *pParse, Table *pTab, sqlite3_index_info *p){ in vtabBestIndex() argument
1395 sqlite3_vtab *pVtab = sqlite3GetVTable(pParse->db, pTab)->pVtab; in vtabBestIndex()
1399 pParse->db->nSchemaLock++; in vtabBestIndex()
1401 pParse->db->nSchemaLock--; in vtabBestIndex()
1406 sqlite3OomFault(pParse->db); in vtabBestIndex()
1408 sqlite3ErrorMsg(pParse, "%s", sqlite3ErrStr(rc)); in vtabBestIndex()
1410 sqlite3ErrorMsg(pParse, "%s", pVtab->zErrMsg); in vtabBestIndex()
1434 Parse *pParse, /* Database connection */ in whereKeyStats() argument
1451 UNUSED_PARAMETER( pParse ); in whereKeyStats()
1541 if( pParse->db->mallocFailed==0 ){ in whereKeyStats()
1548 || pParse->db->mallocFailed in whereKeyStats()
1558 || pParse->db->mallocFailed ); in whereKeyStats()
1567 || pParse->db->mallocFailed ); in whereKeyStats()
1572 || pParse->db->mallocFailed ); in whereKeyStats()
1690 Parse *pParse, /* Parsing & code generating context */ in whereRangeSkipScanEst() argument
1698 sqlite3 *db = pParse->db; in whereRangeSkipScanEst()
1709 pColl = sqlite3LocateCollSeq(pParse, p->azColl[nEq]); in whereRangeSkipScanEst()
1711 rc = sqlite3Stat4ValueFromExpr(pParse, pLower->pExpr->pRight, aff, &p1); in whereRangeSkipScanEst()
1715 rc = sqlite3Stat4ValueFromExpr(pParse, pUpper->pExpr->pRight, aff, &p2); in whereRangeSkipScanEst()
1802 Parse *pParse, /* Parsing & code generating context */ in whereRangeScanEst() argument
1817 && OptimizationEnabled(pParse->db, SQLITE_Stat4) in whereRangeScanEst()
1860 whereKeyStats(pParse, p, pRec, 0, a); in whereRangeScanEst()
1878 rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, nBtm, nEq, &n); in whereRangeScanEst()
1883 iLwrIdx = whereKeyStats(pParse, p, pRec, 0, a); in whereRangeScanEst()
1895 rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, nTop, nEq, &n); in whereRangeScanEst()
1900 iUprIdx = whereKeyStats(pParse, p, pRec, 1, a); in whereRangeScanEst()
1928 rc = whereRangeSkipScanEst(pParse, pLower, pUpper, pLoop, &bDone); in whereRangeScanEst()
1933 UNUSED_PARAMETER(pParse); in whereRangeScanEst()
1983 Parse *pParse, /* Parsing & code generating context */ in whereEqualScanEst() argument
2014 rc = sqlite3Stat4ProbeSetValue(pParse, p, &pRec, pExpr, 1, nEq-1, &bOk); in whereEqualScanEst()
2020 whereKeyStats(pParse, p, pRec, 0, a); in whereEqualScanEst()
2047 Parse *pParse, /* Parsing & code generating context */ in whereInScanEst() argument
2063 rc = whereEqualScanEst(pParse, pBuilder, pList->a[i].pExpr, &nEst); in whereInScanEst()
2487 sqlite3 *db = pWInfo->pParse->db; in whereLoopInsert()
2711 Parse *pParse, /* Parsing context */ in whereRangeVectorLen() argument
2755 pColl = sqlite3BinaryCompareCollSeq(pParse, pLhs, pRhs); in whereRangeVectorLen()
2791 Parse *pParse = pWInfo->pParse; /* Parsing context */ in whereLoopAddBtreeIndex() local
2792 sqlite3 *db = pParse->db; /* Database connection malloc context */ in whereLoopAddBtreeIndex()
2976 pParse, pSrc->iCursor, pProbe, saved_nEq, pTerm in whereLoopAddBtreeIndex()
3018 whereRangeScanEst(pParse, pBuilder, pBtm, pTop, pNew); in whereLoopAddBtreeIndex()
3043 rc = whereEqualScanEst(pParse, pBuilder, pExpr->pRight, &nOut); in whereLoopAddBtreeIndex()
3045 rc = whereInScanEst(pParse, pBuilder, pExpr->x.pList, &nOut); in whereLoopAddBtreeIndex()
3227 Parse *pParse; in whereUsablePartialIndex() local
3230 pParse = pWC->pWInfo->pParse; in whereUsablePartialIndex()
3235 if( pParse->db->flags & SQLITE_EnableQPSG ) pParse = 0; in whereUsablePartialIndex()
3241 && sqlite3ExprImpliesExpr(pParse, pExpr, pWhere, iTab) in whereUsablePartialIndex()
3438 && (pWInfo->pParse->db->flags & SQLITE_AutoIndex)!=0 in whereLoopAddBtree()
3571 && OptimizationEnabled(pWInfo->pParse->db, SQLITE_CoverIdxScan) in whereLoopAddBtree()
3689 Parse *pParse = pBuilder->pWInfo->pParse; in whereLoopAddVirtualOne() local
3724 rc = vtabBestIndex(pParse, pSrc->pTab, pIdxInfo); in whereLoopAddVirtualOne()
3753 sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName); in whereLoopAddVirtualOne()
3814 sqlite3ErrorMsg(pParse,"%s.xBestIndex malfunction",pSrc->pTab->zName); in whereLoopAddVirtualOne()
3872 pC = sqlite3ExprCompareCollSeq(pHidden->pParse, pX); in sqlite3_vtab_collation()
3918 pH->pParse->db, pTerm->pExpr->pRight, ENC(pH->pParse->db), in sqlite3_vtab_rhs_value()
3956 Parse *pParse = pHidden->pParse; in sqlite3VtabUsesAllSchemas() local
3957 int nDb = pParse->db->nDb; in sqlite3VtabUsesAllSchemas()
3960 sqlite3CodeVerifySchema(pParse, i); in sqlite3VtabUsesAllSchemas()
3962 if( pParse->writeMask ){ in sqlite3VtabUsesAllSchemas()
3964 sqlite3BeginWriteOperation(pParse, 0, i); in sqlite3VtabUsesAllSchemas()
4002 Parse *pParse; /* The parsing context */ in whereLoopAddVirtual() local
4015 pParse = pWInfo->pParse; in whereLoopAddVirtual()
4027 if( whereLoopResize(pParse->db, pNew, nConstraint) ){ in whereLoopAddVirtual()
4028 freeIndexInfo(pParse->db, p); in whereLoopAddVirtual()
4116 freeIndexInfo(pParse->db, p); in whereLoopAddVirtual()
4263 sqlite3 *db = pWInfo->pParse->db; in whereLoopAddAll()
4382 sqlite3 *db = pWInfo->pParse->db; /* Database connection */ in wherePathSatisfiesOrderBy()
4468 Parse *pParse = pWInfo->pParse; in wherePathSatisfiesOrderBy() local
4469 CollSeq *pColl1 = sqlite3ExprNNCollSeq(pParse, pOrderBy->a[i].pExpr); in wherePathSatisfiesOrderBy()
4470 CollSeq *pColl2 = sqlite3ExprCompareCollSeq(pParse, pTerm->pExpr); in wherePathSatisfiesOrderBy()
4600 pColl = sqlite3ExprNNCollSeq(pWInfo->pParse, pOrderBy->a[i].pExpr); in wherePathSatisfiesOrderBy()
4782 Parse *pParse; /* Parsing context */ in wherePathSolver() local
4800 pParse = pWInfo->pParse; in wherePathSolver()
4823 pSpace = sqlite3StackAllocRawNN(pParse->db, nSpace); in wherePathSolver()
4850 aFrom[0].nRow = MIN(pParse->nQueryLoop, 48); assert( 48==sqlite3LogEst(28) ); in wherePathSolver()
5080 sqlite3ErrorMsg(pParse, "no query solution"); in wherePathSolver()
5081 sqlite3StackFreeNN(pParse->db, pSpace); in wherePathSolver()
5163 sqlite3StackFreeNN(pParse->db, pSpace); in wherePathSolver()
5356 assert( OptimizationEnabled(pWInfo->pParse->db, SQLITE_OmitNoopJoin) ); in whereOmitNoopJoin()
5433 assert( OptimizationEnabled(pWInfo->pParse->db, SQLITE_BloomFilter) ); in whereCheckIfBloomFilterIsUseful()
5467 Parse *pParse = (Parse*)pObject; in whereIndexedExprCleanup() local
5468 while( pParse->pIdxExpr!=0 ){ in whereIndexedExprCleanup()
5469 IndexedExpr *p = pParse->pIdxExpr; in whereIndexedExprCleanup()
5470 pParse->pIdxExpr = p->pIENext; in whereIndexedExprCleanup()
5488 Parse *pParse, /* Add IndexedExpr entries to pParse->pIdxExpr */ in whereAddIndexedExpr() argument
5515 p = sqlite3DbMallocRaw(pParse->db, sizeof(IndexedExpr)); in whereAddIndexedExpr()
5517 p->pIENext = pParse->pIdxExpr; in whereAddIndexedExpr()
5518 p->pExpr = sqlite3ExprDup(pParse->db, pExpr, 0); in whereAddIndexedExpr()
5526 pParse->pIdxExpr = p; in whereAddIndexedExpr()
5528 sqlite3ParserAddCleanup(pParse, whereIndexedExprCleanup, pParse); in whereAddIndexedExpr()
5622 Parse *pParse, /* The parser context */ in sqlite3WhereBegin() argument
5635 Vdbe *v = pParse->pVdbe; /* The virtual database engine */ in sqlite3WhereBegin()
5656 db = pParse->db; in sqlite3WhereBegin()
5668 sqlite3ErrorMsg(pParse, "at most %d tables in a join", BMS); in sqlite3WhereBegin()
5693 pWInfo->pParse = pParse; in sqlite3WhereBegin()
5702 pWInfo->iBreak = pWInfo->iContinue = sqlite3VdbeMakeLabel(pParse); in sqlite3WhereBegin()
5705 pWInfo->savedNQueryLoop = pParse->nQueryLoop; in sqlite3WhereBegin()
5740 ExplainQueryPlan((pParse, 0, "SCAN CONSTANT ROW")); in sqlite3WhereBegin()
5759 sqlite3WhereTabFuncArgs(pParse, &pTabList->a[ii], &pWInfo->sWC); in sqlite3WhereBegin()
5778 if( pParse->nErr ) goto whereBeginError; in sqlite3WhereBegin()
5795 sqlite3ExprIfFalse(pParse, pT->pExpr, pWInfo->iBreak, SQLITE_JUMPIFNULL); in sqlite3WhereBegin()
5806 }else if( isDistinctRedundant(pParse, pTabList, &pWInfo->sWC, pResultSet) ){ in sqlite3WhereBegin()
5877 if( pParse->nErr ){ in sqlite3WhereBegin()
5945 pWInfo->pParse->nQueryLoop += pWInfo->nRowOut; in sqlite3WhereBegin()
6019 sqlite3OpenTable(pParse, pTabItem->iCursor, iDb, pTab, op); in sqlite3WhereBegin()
6050 sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName); in sqlite3WhereBegin()
6079 iIndexCur = pParse->nTab++; in sqlite3WhereBegin()
6081 whereAddIndexedExpr(pParse, pIx, iIndexCur, pTabItem); in sqlite3WhereBegin()
6090 sqlite3VdbeSetP4KeyInfo(pParse, pIx); in sqlite3WhereBegin()
6118 if( iDb>=0 ) sqlite3CodeVerifySchema(pParse, iDb); in sqlite3WhereBegin()
6123 pRJ->iMatch = pParse->nTab++; in sqlite3WhereBegin()
6124 pRJ->regBloom = ++pParse->nMem; in sqlite3WhereBegin()
6126 pRJ->regReturn = ++pParse->nMem; in sqlite3WhereBegin()
6132 pInfo = sqlite3KeyInfoAlloc(pParse->db, 1, 0); in sqlite3WhereBegin()
6141 sqlite3VdbeSetP4KeyInfo(pParse, pPk); in sqlite3WhereBegin()
6162 if( pParse->nErr ) goto whereBeginError; in sqlite3WhereBegin()
6178 constructAutomaticIndex(pParse, &pWInfo->sWC, in sqlite3WhereBegin()
6187 pParse, pTabList, pLevel, wctrlFlags in sqlite3WhereBegin()
6190 notReady = sqlite3WhereCodeOneLoopStart(pParse,v,pWInfo,ii,pLevel,notReady); in sqlite3WhereBegin()
6205 pParse->nQueryLoop = pWInfo->savedNQueryLoop; in sqlite3WhereBegin()
6256 Parse *pParse = pWInfo->pParse; in sqlite3WhereEnd() local
6257 Vdbe *v = pParse->pVdbe; in sqlite3WhereEnd()
6262 sqlite3 *db = pParse->db; in sqlite3WhereEnd()
6296 int r1 = pParse->nMem+1; in sqlite3WhereEnd()
6301 pParse->nMem += n+1; in sqlite3WhereEnd()
6334 || pParse->db->mallocFailed ); in sqlite3WhereEnd()
6407 sqlite3VdbeSetP4KeyInfo(pParse, pIx); in sqlite3WhereEnd()
6446 testcase( pParse->db->mallocFailed ); in sqlite3WhereEnd()
6447 translateColumnToCopy(pParse, pLevel->addrBody, pLevel->iTabCur, in sqlite3WhereEnd()
6477 IndexedExpr *p = pParse->pIdxExpr; in sqlite3WhereEnd()
6569 pParse->nQueryLoop = pWInfo->savedNQueryLoop; in sqlite3WhereEnd()
6571 pParse->withinRJSubrtn -= nRJ; in sqlite3WhereEnd()