Home | History | Annotate | Download | only in dist

Lines Matching defs:pLevel

104560 ** and to set up the WhereLevel object pLevel so that the code generator
104568 WhereLevel *pLevel /* Write new index here */
104613 pLevel->plan.nEq = nColumn;
104633 pLevel->plan.wsFlags |= WHERE_COLUMN_EQ | WHERE_IDX_ONLY | WO_EQ;
104642 pLevel->plan.u.pIdx = pIdx;
104665 assert( (u32)n==pLevel->plan.nEq );
104687 assert( pLevel->iIdxCur>=0 );
104688 sqlite3VdbeAddOp4(v, OP_OpenAutoindex, pLevel->iIdxCur, nColumn+1, 0,
104693 addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, pLevel->iTabCur);
104695 sqlite3GenerateIndexKey(pParse, pIdx, pLevel->iTabCur, regRecord, 1);
104696 sqlite3VdbeAddOp2(v, OP_IdxInsert, pLevel->iIdxCur, regRecord);
104698 sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1);
105976 static void disableTerm(WhereLevel *pLevel, WhereTerm *pTerm){
105979 && (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_FromJoin))
105985 disableTerm(pLevel, pOther);
106045 WhereLevel *pLevel, /* When level of the FROM clause we are working on */
106069 assert( pLevel->plan.wsFlags & WHERE_IN_ABLE );
106070 if( pLevel->u.in.nIn==0 ){
106071 pLevel->addrNxt = sqlite3VdbeMakeLabel(v);
106073 pLevel->u.in.nIn++;
106074 pLevel->u.in.aInLoop =
106075 sqlite3DbReallocOrFree(pParse->db, pLevel->u.in.aInLoop,
106076 sizeof(pLevel->u.in.aInLoop[0])*pLevel->u.in.nIn);
106077 pIn = pLevel->u.in.aInLoop;
106079 pIn += pLevel->u.in.nIn - 1;
106088 pLevel->u.in.nIn = 0;
106092 disableTerm(pLevel, pTerm);
106110 ** The only thing it does is allocate the pLevel->iMem memory cell and
106137 WhereLevel *pLevel, /* Which nested loop of the FROM we are coding */
106143 int nEq = pLevel->plan.nEq; /* The number of == or IN constraints to code */
106146 int iCur = pLevel->iTabCur; /* The cursor of the table */
106154 assert( pLevel->plan.wsFlags & WHERE_INDEXED );
106155 pIdx = pLevel->plan.u.pIdx;
106160 nReg = pLevel->plan.nEq + nExtraReg;
106174 pTerm = findTerm(pWC, iCur, k, notReady, pLevel->plan.wsFlags, pIdx);
106180 r1 = codeEqualityTerm(pParse, pTerm, pLevel, regBase+j);
106193 sqlite3ExprCodeIsNullJump(v, pRight, regBase+j, pLevel->addrBrk);
106230 ** Argument pLevel describes a strategy for scanning table pTab. This
106248 static char *explainIndexRange(sqlite3 *db, WhereLevel *pLevel, Table *pTab){
106249 WherePlan *pPlan = &pLevel->plan;
106284 ** pLevel.
106289 WhereLevel *pLevel, /* Scan to write OP_Explain opcode for */
106295 u32 flags = pLevel->plan.wsFlags;
106296 struct SrcList_item *pItem = &pTabList->a[pLevel->iFrom];
106306 isSearch = (pLevel->plan.nEq>0)
106321 char *zWhere = explainIndexRange(db, pLevel, pItem->pTab);
106326 ((flags & WHERE_TEMP_INDEX)?"": pLevel->plan.u.pIdx->zName),
106345 sqlite3_index_info *pVtabIdx = pLevel->plan.u.pVtabIdx;
106354 nRow = (sqlite3_int64)pLevel->plan.nRow;
106380 WhereLevel *pLevel; /* The where level to be coded */
106394 pLevel = &pWInfo->a[iLevel];
106395 pTabItem = &pWInfo->pTabList->a[pLevel->iFrom];
106397 bRev = (pLevel->plan.wsFlags & WHERE_REVERSE)!=0;
106398 omitTable = (pLevel->plan.wsFlags & WHERE_IDX_ONLY)!=0
106411 addrBrk = pLevel->addrBrk = pLevel->addrNxt = sqlite3VdbeMakeLabel(v);
106412 addrCont = pLevel->addrCont = sqlite3VdbeMakeLabel(v);
106418 if( pLevel->iFrom>0 && (pTabItem[0].jointype & JT_LEFT)!=0 ){
106419 pLevel->iLeftJoin = ++pParse->nMem;
106420 sqlite3VdbeAddOp2(v, OP_Integer, 0, pLevel->iLeftJoin);
106425 if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){
106430 sqlite3_index_info *pVtabIdx = pLevel->plan.u.pVtabIdx;
106457 disableTerm(pLevel, &pWC->a[iTerm]);
106460 pLevel->op = OP_VNext;
106461 pLevel->p1 = iCur;
106462 pLevel->p2 = sqlite3VdbeCurrentAddr(v);
106468 if( pLevel->plan.wsFlags & WHERE_ROWID_EQ ){
106481 iRowidReg = codeEqualityTerm(pParse, pTerm, pLevel, iReleaseReg);
106482 addrNxt = pLevel->addrNxt;
106487 pLevel->op = OP_Noop;
106488 }else if( pLevel->plan.wsFlags & WHERE_ROWID_RANGE ){
106530 disableTerm(pLevel, pStart);
106547 disableTerm(pLevel, pEnd);
106550 pLevel->op = bRev ? OP_Prev : OP_Next;
106551 pLevel->p1 = iCur;
106552 pLevel->p2 = start;
106554 pLevel->p5 = SQLITE_STMTSTATUS_FULLSCAN_STEP;
106556 assert( pLevel->p5==0 );
106565 }else if( pLevel->plan.wsFlags & (WHERE_COLUMN_RANGE|WHERE_COLUMN_EQ) ){
106612 int nEq = pLevel->plan.nEq; /* Number of == or IN terms */
106629 pIdx = pLevel->plan.u.pIdx;
106630 iIdxCur = pLevel->iIdxCur;
106642 && (pLevel->plan.wsFlags&WHERE_ORDERBY)
106654 if( pLevel->plan.wsFlags & WHERE_TOP_LIMIT ){
106658 if( pLevel->plan.wsFlags & WHERE_BTM_LIMIT ){
106668 pParse, pLevel, pWC, notReady, nExtraReg, &zStartAff
106671 addrNxt = pLevel->addrNxt;
106759 pLevel->p2 = sqlite3VdbeCurrentAddr(v);
106776 testcase( pLevel->plan.wsFlags & WHERE_BTM_LIMIT );
106777 testcase( pLevel->plan.wsFlags & WHERE_TOP_LIMIT );
106778 if( (pLevel->plan.wsFlags & (WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))!=0 ){
106785 disableTerm(pLevel, pRangeStart);
106786 disableTerm(pLevel, pRangeEnd);
106797 if( pLevel->plan.wsFlags & WHERE_UNIQUE ){
106798 pLevel->op = OP_Noop;
106800 pLevel->op = OP_Prev;
106802 pLevel->op = OP_Next;
106804 pLevel->p1 = iIdxCur;
106808 if( pLevel->plan.wsFlags & WHERE_MULTI_OR ){
106860 pTerm = pLevel->plan.u.pTerm;
106865 pLevel->op = OP_Return;
106866 pLevel->p1 = regReturn;
106884 memcpy(&pOrTab->a[k], &origSrc[pLevel[k].iFrom], sizeof(pOrTab->a[k]));
106948 pParse, pOrTab, &pSubWInfo->a[0], iLevel, pLevel->iFrom, 0
106977 sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrBrk);
106981 if( !untestedTerms ) disableTerm(pLevel, pTerm);
106993 pLevel->op = aStep[bRev];
106994 pLevel->p1 = iCur;
106995 pLevel->p2 = 1 + sqlite3VdbeAddOp2(v, aStart[bRev], iCur, addrBrk);
106996 pLevel->p5 = SQLITE_STMTSTATUS_FULLSCAN_STEP;
107020 if( pLevel->iLeftJoin && !ExprHasProperty(pE, EP_FromJoin) ){
107030 if( pLevel->iLeftJoin ){
107031 pLevel->addrFirst = sqlite3VdbeCurrentAddr(v);
107032 sqlite3VdbeAddOp2(v, OP_Integer, 1, pLevel->iLeftJoin);
107200 WhereLevel *pLevel; /* A single level in the pWInfo list */
107347 for(i=iFrom=0, pLevel=pWInfo->a; i<nTabList; i++, pLevel++){
107495 bestJ, pLevel-pWInfo->a, bestPlan.rCost, bestPlan.plan.nRow));
107505 pLevel->plan = bestPlan.plan;
107509 pLevel->iIdxCur = pParse->nTab++;
107511 pLevel->iIdxCur = -1;
107514 pLevel->iFrom = (u8)bestJ;
107566 for(i=0, pLevel=pWInfo->a; i<nTabList; i++, pLevel++){
107570 pTabItem = &pTabList->a[pLevel->iFrom];
107572 pLevel->iTabCur = pTabItem->iCursor;
107573 pWInfo->nRowOut *= pLevel->plan.nRow;
107579 if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){
107585 if( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
107603 if( (pLevel->plan.wsFlags & WHERE_TEMP_INDEX)!=0 ){
107604 constructAutomaticIndex(pParse, pWC, pTabItem, notReady, pLevel);
107607 if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){
107608 Index *pIx = pLevel->plan.u.pIdx;
107610 int iIdxCur = pLevel->iIdxCur;
107629 pLevel = &pWInfo->a[i];
107630 explainOneScan(pParse, pTabList, pLevel, i, pLevel->iFrom, wctrlFlags);
107632 pWInfo->iContinue = pLevel->addrCont;
107645 pLevel = &pWInfo->a[i];
107646 pTabItem = &pTabList->a[pLevel->iFrom];
107651 if( pLevel->plan.wsFlags & WHERE_IDX_ONLY ){
107660 testcase( pLevel->plan.wsFlags & WHERE_ROWID_EQ );
107661 testcase( pLevel->plan.wsFlags & WHERE_ROWID_RANGE );
107662 if( pLevel->plan.wsFlags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){
107665 }else if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){
107666 n = sqlite3Strlen30(pLevel->plan.u.pIdx->zName);
107668 memcpy(&sqlite3_query_plan[nQPlan], pLevel->plan.u.pIdx->zName, n);
107706 WhereLevel *pLevel;
107714 pLevel = &pWInfo->a[i];
107715 sqlite3VdbeResolveLabel(v, pLevel->addrCont);
107716 if( pLevel->op!=OP_Noop ){
107717 sqlite3VdbeAddOp2(v, pLevel->op, pLevel->p1, pLevel->p2);
107718 sqlite3VdbeChangeP5(v, pLevel->p5);
107720 if( pLevel->plan.wsFlags & WHERE_IN_ABLE && pLevel->u.in.nIn>0 ){
107723 sqlite3VdbeResolveLabel(v, pLevel->addrNxt);
107724 for(j=pLevel->u.in.nIn, pIn=&pLevel->u.in.aInLoop[j-1]; j>0; j--, pIn--){
107729 sqlite3DbFree(db, pLevel->u.in.aInLoop);
107731 sqlite3VdbeResolveLabel(v, pLevel->addrBrk);
107732 if( pLevel->iLeftJoin ){
107734 addr = sqlite3VdbeAddOp1(v, OP_IfPos, pLevel->iLeftJoin);
107735 assert( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
107736 || (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 );
107737 if( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0 ){
107740 if( pLevel->iIdxCur>=0 ){
107741 sqlite3VdbeAddOp1(v, OP_NullRow, pLevel->iIdxCur);
107743 if( pLevel->op==OP_Return ){
107744 sqlite3VdbeAddOp2(v, OP_Gosub, pLevel->p1, pLevel->addrFirst);
107746 sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrFirst);
107760 for(i=0, pLevel=pWInfo->a; i<pWInfo->nLevel; i++, pLevel++){
107761 struct SrcList_item *pTabItem = &pTabList->a[pLevel->iFrom];
107768 int ws = pLevel->plan.wsFlags;
107773 sqlite3VdbeAddOp1(v, OP_Close, pLevel->iIdxCur);
107790 if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 && !db->mallocFailed){
107793 Index *pIdx = pLevel->plan.u.pIdx;
107799 if( pOp->p1!=pLevel->iTabCur ) continue;
107804 pOp->p1 = pLevel->iIdxCur;
107808 assert( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0
107811 pOp->p1 = pLevel->iIdxCur;