Lines Matching refs:pC
78294 SQLITE_PRIVATE void sqlite3VdbeIncrWriteCounter(Vdbe *p, VdbeCursor *pC){
78295 if( pC==0
78296 || (pC->eCurType!=CURTYPE_SORTER
78297 && pC->eCurType!=CURTYPE_PSEUDO
78298 && !pC->isEphemeral)
80055 VdbeCursor *pC = p->apCsr[i];
80056 if( pC ){
80057 sqlite3VdbeFreeCursor(p, pC);
82522 VdbeCursor *pC, /* The cursor to compare against */
82531 assert( pC->eCurType==CURTYPE_BTREE );
82532 pCur = pC->uc.pCursor;
87692 VdbeCursor *pC; /* The VDBE cursor */
87694 pC = p->apCsr[pOp->p1];
87696 if( NEVER(pC==0) || pC->eCurType!=CURTYPE_BTREE ){
87699 sqlite3VdbeMemSetInt64(pOut, sqlite3BtreeOffset(pC->uc.pCursor));
87727 VdbeCursor *pC; /* The VDBE cursor */
87742 pC = p->apCsr[pOp->p1];
87743 assert( pC!=0 );
87749 rc = sqlite3VdbeCursorMoveto(&pC, &p2);
87755 assert( pC!=0 );
87756 assert( p2<pC->nField );
87757 aOffset = pC->aOffset;
87758 assert( pC->eCurType!=CURTYPE_VTAB );
87759 assert( pC->eCurType!=CURTYPE_PSEUDO || pC->nullRow );
87760 assert( pC->eCurType!=CURTYPE_SORTER );
87762 if( pC->cacheStatus!=p->cacheCtr ){ /*OPTIMIZATION-IF-FALSE*/
87763 if( pC->nullRow ){
87764 if( pC->eCurType==CURTYPE_PSEUDO ){
87767 assert( pC->seekResult>0 );
87768 pReg = &aMem[pC->seekResult];
87771 pC->payloadSize = pC->szRow = pReg->n;
87772 pC->aRow = (u8*)pReg->z;
87778 pCrsr = pC->uc.pCursor;
87779 assert( pC->eCurType==CURTYPE_BTREE );
87782 pC->payloadSize = sqlite3BtreePayloadSize(pCrsr);
87783 pC->aRow = sqlite3BtreePayloadFetch(pCrsr, &pC->szRow);
87784 assert( pC->szRow<=pC->payloadSize );
87785 assert( pC->szRow<=65536 ); /* Maximum page size is 64KiB */
87786 if( pC->payloadSize > (u32)db->aLimit[SQLITE_LIMIT_LENGTH] ){
87790 pC->cacheStatus = p->cacheCtr;
87791 pC->iHdrOffset = getVarint32(pC->aRow, aOffset[0]);
87792 pC->nHdrParsed = 0;
87795 if( pC->szRow<aOffset[0] ){ /*OPTIMIZATION-IF-FALSE*/
87800 pC->aRow = 0;
87801 pC->szRow = 0;
87812 if( aOffset[0] > 98307 || aOffset[0] > pC->payloadSize ){
87829 zData = pC->aRow;
87830 assert( pC->nHdrParsed<=p2 ); /* Conditional skipped */
87839 if( pC->nHdrParsed<=p2 ){
87843 if( pC->iHdrOffset<aOffset[0] ){
87845 if( pC->aRow==0 ){
87847 rc = sqlite3VdbeMemFromBtreeZeroOffset(pC->uc.pCursor,aOffset[0],&sMem);
87851 zData = pC->aRow;
87856 i = pC->nHdrParsed;
87858 zHdr = zData + pC->iHdrOffset;
87862 if( (pC->aType[i] = t = zHdr[0])<0x80 ){
87867 pC->aType[i] = t;
87878 if( (zHdr>=zEndHdr && (zHdr>zEndHdr || offset64!=pC->payloadSize))
87879 || (offset64 > pC->payloadSize)
87885 if( pC->aRow==0 ) sqlite3VdbeMemRelease(&sMem);
87890 pC->nHdrParsed = i;
87891 pC->iHdrOffset = (u32)(zHdr - zData);
87892 if( pC->aRow==0 ) sqlite3VdbeMemRelease(&sMem);
87901 if( pC->nHdrParsed<=p2 ){
87910 t = pC->aType[p2];
87917 assert( p2<pC->nHdrParsed );
87923 assert( t==pC->aType[p2] );
87924 if( pC->szRow>=aOffset[p2+1] ){
87927 zData = pC->aRow + aOffset[p2];
87971 rc = sqlite3VdbeMemFromBtree(pC->uc.pCursor, aOffset[p2], len, pDest);
89137 VdbeCursor *pC;
89139 pC = p->apCsr[pOp->p1];
89140 assert( isSorter(pC) );
89141 if( (pC->seqCount++)==0 ){
89206 VdbeCursor *pC;
89207 pC = p->apCsr[pOp->p1];
89208 assert( pC->eCurType==CURTYPE_BTREE );
89209 pC->maskUsed = *(u64*)pOp->p4.pI64;
89310 VdbeCursor *pC; /* The cursor to seek */
89318 pC = p->apCsr[pOp->p1];
89319 assert( pC!=0 );
89320 assert( pC->eCurType==CURTYPE_BTREE );
89324 assert( pC->isOrdered );
89325 assert( pC->uc.pCursor!=0 );
89328 pC->nullRow = 0;
89330 pC->seekOp = pOp->opcode;
89333 pC->deferredMoveto = 0;
89334 pC->cacheStatus = CACHE_STALE;
89335 if( pC->isTable ){
89338 assert( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ)==0
89361 rc = sqlite3BtreeLast(pC->uc.pCursor, &res);
89390 rc = sqlite3BtreeMovetoUnpacked(pC->uc.pCursor, 0, (u64)iKey, 0, &res);
89391 pC->movetoTarget = iKey; /* Used by OP_Delete */
89401 if( sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ) ){
89416 r.pKeyInfo = pC->pKeyInfo;
89437 rc = sqlite3BtreeMovetoUnpacked(pC->uc.pCursor, &r, 0, 0, &res);
89452 rc = sqlite3BtreeNext(pC->uc.pCursor, 0);
89468 rc = sqlite3BtreePrevious(pC->uc.pCursor, 0);
89481 res = sqlite3BtreeEof(pC->uc.pCursor);
89506 VdbeCursor *pC;
89508 pC = p->apCsr[pOp->p1];
89509 assert( pC!=0 );
89511 pC->seekHit = pOp->p2 & 1;
89616 VdbeCursor *pC;
89618 pC = p->apCsr[pOp->p1];
89619 assert( pC!=0 );
89620 if( pC->seekHit ) break;
89629 VdbeCursor *pC;
89641 pC = p->apCsr[pOp->p1];
89642 assert( pC!=0 );
89644 pC->seekOp = pOp->opcode;
89647 assert( pC->eCurType==CURTYPE_BTREE );
89648 assert( pC->uc.pCursor!=0 );
89649 assert( pC->isTable==0 );
89651 r.pKeyInfo = pC->pKeyInfo;
89668 pFree = pIdxKey = sqlite3VdbeAllocUnpackedRecord(pC->pKeyInfo);
89670 sqlite3VdbeRecordUnpack(pC->pKeyInfo, pIn3->n, pIn3->z, pIdxKey);
89685 rc = sqlite3BtreeMovetoUnpacked(pC->uc.pCursor, pIdxKey, 0, 0, &res);
89690 pC->seekResult = res;
89692 pC->nullRow = 1-alreadyExists;
89693 pC->deferredMoveto = 0;
89694 pC->cacheStatus = CACHE_STALE;
89753 VdbeCursor *pC;
89782 pC = p->apCsr[pOp->p1];
89783 assert( pC!=0 );
89785 if( pOp->opcode==OP_SeekRowid ) pC->seekOp = OP_SeekRowid;
89787 assert( pC->isTable );
89788 assert( pC->eCurType==CURTYPE_BTREE );
89789 pCrsr = pC->uc.pCursor;
89794 pC->movetoTarget = iKey; /* Used by OP_Delete */
89795 pC->nullRow = 0;
89796 pC->cacheStatus = CACHE_STALE;
89797 pC->deferredMoveto = 0;
89799 pC->seekResult = res;
89847 VdbeCursor *pC; /* Cursor of table to get the new rowid */
89857 pC = p->apCsr[pOp->p1];
89858 assert( pC!=0 );
89859 assert( pC->isTable );
89860 assert( pC->eCurType==CURTYPE_BTREE );
89861 assert( pC->uc.pCursor!=0 );
89876 assert( pC->isTable );
89888 if( !pC->useRandomRowid ){
89889 rc = sqlite3BtreeLast(pC->uc.pCursor, &res);
89896 assert( sqlite3BtreeCursorIsValid(pC->uc.pCursor) );
89897 v = sqlite3BtreeIntegerKey(pC->uc.pCursor);
89899 pC->useRandomRowid = 1;
89926 if( pMem->u.i==MAX_ROWID || pC->useRandomRowid ){
89936 if( pC->useRandomRowid ){
89947 }while( ((rc = sqlite3BtreeMovetoUnpacked(pC->uc.pCursor, 0, (u64)v,
89958 pC->deferredMoveto = 0;
89959 pC->cacheStatus = CACHE_STALE;
90005 VdbeCursor *pC; /* Cursor to table into which insert is written */
90014 pC = p->apCsr[pOp->p1];
90015 assert( pC!=0 );
90016 assert( pC->eCurType==CURTYPE_BTREE );
90017 assert( pC->deferredMoveto==0 );
90018 assert( pC->uc.pCursor!=0 );
90019 assert( (pOp->p5 & OPFLAG_ISNOOP) || pC->isTable );
90022 sqlite3VdbeIncrWriteCounter(p, pC);
90031 assert( pC->iDb>=0 );
90032 zDb = db->aDb[pC->iDb].zDbSName;
90044 sqlite3VdbePreUpdateHook(p, pC, SQLITE_INSERT, zDb, pTab, x.nKey,pOp->p2);
90059 seekResult = ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0);
90066 rc = sqlite3BtreeInsert(pC->uc.pCursor, &x,
90069 pC->deferredMoveto = 0;
90070 pC->cacheStatus = CACHE_STALE;
90120 VdbeCursor *pC;
90127 pC = p->apCsr[pOp->p1];
90128 assert( pC!=0 );
90129 assert( pC->eCurType==CURTYPE_BTREE );
90130 assert( pC->uc.pCursor!=0 );
90131 assert( pC->deferredMoveto==0 );
90132 sqlite3VdbeIncrWriteCounter(p, pC);
90138 && sqlite3BtreeCursorIsValidNN(pC->uc.pCursor)
90143 i64 iKey = sqlite3BtreeIntegerKey(pC->uc.pCursor);
90144 assert( CORRUPT_DB || pC->movetoTarget==iKey );
90154 assert( pC->iDb>=0 );
90156 zDb = db->aDb[pC->iDb].zDbSName;
90158 if( (pOp->p5 & OPFLAG_SAVEPOSITION)!=0 && pC->isTable ){
90159 pC->movetoTarget = sqlite3BtreeIntegerKey(pC->uc.pCursor);
90173 sqlite3VdbePreUpdateHook(p, pC,
90175 zDb, pTab, pC->movetoTarget,
90189 if( pC->isEphemeral==0
90191 && (pC->wrFlag & OPFLAG_FORDELETE)==0
90201 rc = sqlite3BtreeDelete(pC->uc.pCursor, pOp->p5);
90202 pC->cacheStatus = CACHE_STALE;
90203 pC->seekResult = 0;
90211 pC->movetoTarget);
90212 assert( pC->iDb>=0 );
90247 VdbeCursor *pC;
90251 pC = p->apCsr[pOp->p1];
90252 assert( isSorter(pC) );
90257 rc = sqlite3VdbeSorterCompare(pC, pIn3, nKeyCol, &res);
90277 VdbeCursor *pC;
90280 pC = p->apCsr[pOp->p1];
90281 assert( isSorter(pC) );
90282 rc = sqlite3VdbeSorterRowkey(pC, pOut);
90319 VdbeCursor *pC;
90326 pC = p->apCsr[pOp->p1];
90327 assert( pC!=0 );
90328 assert( pC->eCurType==CURTYPE_BTREE );
90329 assert( isSorter(pC)==0 );
90330 assert( pC->nullRow==0 );
90331 assert( pC->uc.pCursor!=0 );
90332 pCrsr = pC->uc.pCursor;
90342 assert( pC->deferredMoveto==0 );
90345 rc = sqlite3VdbeCursorMoveto(pC);
90373 VdbeCursor *pC;
90380 pC = p->apCsr[pOp->p1];
90381 assert( pC!=0 );
90382 assert( pC->eCurType!=CURTYPE_PSEUDO || pC->nullRow );
90383 if( pC->nullRow ){
90386 }else if( pC->deferredMoveto ){
90387 v = pC->movetoTarget;
90389 }else if( pC->eCurType==CURTYPE_VTAB ){
90390 assert( pC->uc.pVCur!=0 );
90391 pVtab = pC->uc.pVCur->pVtab;
90394 rc = pModule->xRowid(pC->uc.pVCur, &v);
90399 assert( pC->eCurType==CURTYPE_BTREE );
90400 assert( pC->uc.pCursor!=0 );
90401 rc = sqlite3VdbeCursorRestore(pC);
90403 if( pC->nullRow ){
90407 v = sqlite3BtreeIntegerKey(pC->uc.pCursor);
90420 VdbeCursor *pC;
90423 pC = p->apCsr[pOp->p1];
90424 assert( pC!=0 );
90425 pC->nullRow = 1;
90426 pC->cacheStatus = CACHE_STALE;
90427 if( pC->eCurType==CURTYPE_BTREE ){
90428 assert( pC->uc.pCursor!=0 );
90429 sqlite3BtreeClearCursor(pC->uc.pCursor);
90432 if( pC->seekOp==0 ) pC->seekOp = OP_NullRow;
90461 VdbeCursor *pC;
90466 pC = p->apCsr[pOp->p1];
90467 assert( pC!=0 );
90468 assert( pC->eCurType==CURTYPE_BTREE );
90469 pCrsr = pC->uc.pCursor;
90473 pC->seekOp = pOp->opcode;
90477 pC->seekResult = -1;
90483 pC->nullRow = (u8)res;
90484 pC->deferredMoveto = 0;
90485 pC->cacheStatus = CACHE_STALE;
90500 VdbeCursor *pC;
90506 pC = p->apCsr[pOp->p1];
90507 assert( pC!=0 );
90508 pCrsr = pC->uc.pCursor;
90565 VdbeCursor *pC;
90571 pC = p->apCsr[pOp->p1];
90572 assert( pC!=0 );
90573 assert( isSorter(pC)==(pOp->opcode==OP_SorterSort) );
90576 pC->seekOp = OP_Rewind;
90578 if( isSorter(pC) ){
90579 rc = sqlite3VdbeSorterRewind(pC, &res);
90581 assert( pC->eCurType==CURTYPE_BTREE );
90582 pCrsr = pC->uc.pCursor;
90585 pC->deferredMoveto = 0;
90586 pC->cacheStatus = CACHE_STALE;
90589 pC->nullRow = (u8)res;
90657 VdbeCursor *pC;
90659 pC = p->apCsr[pOp->p1];
90660 assert( isSorter(pC) );
90661 rc = sqlite3VdbeSorterNext(db, pC);
90667 pC = p->apCsr[pOp->p1];
90668 assert( pC!=0 );
90669 assert( pC->deferredMoveto==0 );
90670 assert( pC->eCurType==CURTYPE_BTREE );
90677 || pC->seekOp==OP_SeekGT || pC->seekOp==OP_SeekGE
90678 || pC->seekOp==OP_Rewind || pC->seekOp==OP_Found
90679 || pC->seekOp==OP_NullRow|| pC->seekOp==OP_SeekRowid
90680 || pC->seekOp==OP_IfNoHope);
90682 || pC->seekOp==OP_SeekLT || pC->seekOp==OP_SeekLE
90683 || pC->seekOp==OP_Last || pC->seekOp==OP_IfNoHope
90684 || pC->seekOp==OP_NullRow);
90686 rc = pOp->p4.xAdvance(pC->uc.pCursor, pOp->p3);
90688 pC->cacheStatus = CACHE_STALE;
90691 pC->nullRow = 0;
90700 pC->nullRow = 1;
90733 VdbeCursor *pC;
90737 pC = p->apCsr[pOp->p1];
90738 sqlite3VdbeIncrWriteCounter(p, pC);
90739 assert( pC!=0 );
90740 assert( !isSorter(pC) );
90744 assert( pC->eCurType==CURTYPE_BTREE );
90745 assert( pC->isTable==0 );
90752 rc = sqlite3BtreeInsert(pC->uc.pCursor, &x,
90754 ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0)
90756 assert( pC->deferredMoveto==0 );
90757 pC->cacheStatus = CACHE_STALE;
90770 VdbeCursor *pC;
90773 pC = p->apCsr[pOp->p1];
90774 sqlite3VdbeIncrWriteCounter(p, pC);
90775 assert( pC!=0 );
90776 assert( isSorter(pC) );
90779 assert( pC->isTable==0 );
90782 rc = sqlite3VdbeSorterWrite(pC, pIn2);
90802 VdbeCursor *pC;
90810 pC = p->apCsr[pOp->p1];
90811 assert( pC!=0 );
90812 assert( pC->eCurType==CURTYPE_BTREE );
90813 sqlite3VdbeIncrWriteCounter(p, pC);
90814 pCrsr = pC->uc.pCursor;
90816 r.pKeyInfo = pC->pKeyInfo;
90829 assert( pC->deferredMoveto==0 );
90830 pC->cacheStatus = CACHE_STALE;
90831 pC->seekResult = 0;
90865 VdbeCursor *pC; /* The P1 index cursor */
90870 pC = p->apCsr[pOp->p1];
90871 assert( pC!=0 );
90872 assert( pC->eCurType==CURTYPE_BTREE );
90873 assert( pC->uc.pCursor!=0 );
90874 assert( pC->isTable==0 );
90875 assert( pC->deferredMoveto==0 );
90876 assert( !pC->nullRow || pOp->opcode==OP_IdxRowid );
90880 rc = sqlite3VdbeCursorRestore(pC);
90887 if( !pC->nullRow ){
90889 rc = sqlite3VdbeIdxRowid(db, pC->uc.pCursor, &rowid);
90905 pTabCur->pAltCursor = pC;
90924 VdbeCursor *pC; /* The P1 index cursor */
90927 pC = p->apCsr[pOp->p1];
90928 if( pC->deferredMoveto ){
90929 rc = sqlite3VdbeFinishMoveto(pC);
90983 VdbeCursor *pC;
90988 pC = p->apCsr[pOp->p1];
90989 assert( pC!=0 );
90990 assert( pC->isOrdered );
90991 assert( pC->eCurType==CURTYPE_BTREE );
90992 assert( pC->uc.pCursor!=0);
90993 assert( pC->deferredMoveto==0 );
90996 r.pKeyInfo = pC->pKeyInfo;
91016 rc = sqlite3VdbeIdxKeyCompare(db, pC, &r, &res);
91140 VdbeCursor *pC;
91143 pC = p->apCsr[pOp->p1];
91144 assert( pC!=0 );
91145 if( isSorter(pC) ){
91146 sqlite3VdbeSorterReset(db, pC->uc.pSorter);
91148 assert( pC->eCurType==CURTYPE_BTREE );
91149 assert( pC->isEphemeral );
91150 rc = sqlite3BtreeClearTableOfCursor(pC->uc.pCursor);
92247 VdbeCursor *pC;
92249 pC = p->apCsr[pOp->p1];
92250 assert( pC!=0 );
92251 assert( pC->eCurType==CURTYPE_BTREE );
92252 sqlite3BtreeCursorPin(pC->uc.pCursor);
92262 VdbeCursor *pC;
92264 pC = p->apCsr[pOp->p1];
92265 assert( pC!=0 );
92266 assert( pC->eCurType==CURTYPE_BTREE );
92267 sqlite3BtreeCursorUnpin(pC->uc.pCursor);
92946 VdbeCursor *pC;
92950 pC = p->apCsr[pOp->p1];
92951 if( pC ){
92952 assert( pC->eCurType==CURTYPE_BTREE );
92953 sqlite3BtreeCursorHint(pC->uc.pCursor, BTREE_HINT_RANGE,
93235 VdbeCursor *pC = v->apCsr[0];
93236 u32 type = pC->nHdrParsed>p->iCol ? pC->aType[p->iCol] : 0;
93237 testcase( pC->nHdrParsed==p->iCol );
93238 testcase( pC->nHdrParsed==p->iCol+1 );
93247 p->iOffset = pC->aType[p->iCol + pC->nField];
93249 p->pCsr = pC->uc.pCursor;
129168 SQLITE_PRIVATE int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){
129190 apAll[2] = pC;
129212 if( pC==0 ){ zSp++; }
129214 "%T %T%s%T", pA, pB, zSp, pC);
134373 struct AggInfo_col *pC;
134445 for(i=0, pC=pAggInfo->aCol; i<pAggInfo->nAccumulator; i++, pC++){
134446 sqlite3ExprCode(pParse, pC->pExpr, pC->iMem);
144575 u8 c, *pC; /* Last character before the first wildcard */
144576 pC = (u8*)&pStr2->u.zToken[sqlite3Strlen30(pStr2->u.zToken)-1];
144577 c = *pC;
144588 *pC = c + 1;
148264 CollSeq *pC = 0;
148268 pC = sqlite3ExprCompareCollSeq(pHidden->pParse, pX);
148270 zRet = (pC ? pC->zName : sqlite3StrBINARY);
182837 sqlite3_tokenizer_cursor *pC;
182843 rc = sqlite3Fts3OpenTokenizer(pTab->pTokenizer, iLangid, zDoc, nDoc, &pC);
182849 rc = pMod->xNext(pC, &ZDUMMY, &DUMMY1, &DUMMY2, &DUMMY3, &iCurrent);
182851 pMod->xClose(pC);
182891 sqlite3_tokenizer_cursor *pC; /* Tokenizer cursor open on zDoc/nDoc */
182904 rc = sqlite3Fts3OpenTokenizer(pTab->pTokenizer, pCsr->iLangid, zDoc,nDoc,&pC);
182927 rc = pMod->xNext(pC, &ZDUMMY, &DUMMY1, &iBegin, &iFin, &iCurrent);
182979 pMod->xClose(pC);
183776 sqlite3_tokenizer_cursor *pC; /* Tokenizer cursor */
183811 zDoc, nDoc, &pC
183815 rc = pMod->xNext(pC, &ZDUMMY, &NDUMMY, &iStart, &iEnd, &iCurrent);
183840 rc = pMod->xNext(pC, &ZDUMMY, &NDUMMY, &iStart, &iEnd, &iCurrent);
183857 pMod->xClose(pC);
184219 sqlite3_tokenizer_cursor *pC, /* Cursor returned by simpleOpen */
184226 unicode_cursor *pCsr = (unicode_cursor *)pC;
202877 SessionChange *pC;
202878 for(pC=pTab->apChange[iHash]; pC; pC=pC->pNext){
202879 if( sessionPreupdateEqual(pSession, pTab, pC, op) ) break;
202882 if( pC==0 ){
202945 }else if( pC->bIndirect ){
202951 pC->bIndirect = 0;
225177 Fts5Config *pC = p->pConfig;
225183 pC->zContentExprlist, pC->zContent
225189 zSql = sqlite3_mprintf(azStmt[eStmt], pC->zContentExprlist,
225190 pC->zContent, pC->zContentRowid, pC->zContentRowid,
225191 pC->zContentRowid
225197 pC->zContentExprlist, pC->zContent, pC->zContentRowid
225203 int nCol = pC->nCol + 1;
225214 zSql = sqlite3_mprintf(azStmt[eStmt], pC->zDb, pC->zName, zBind);
225221 zSql = sqlite3_mprintf(azStmt[eStmt], pC->zDb, pC->zName);
225231 rc = sqlite3_prepare_v3(pC->db, zSql, -1, f, &p->aStmt[eStmt], 0);
225235 *pzErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pC->db));