Lines Matching refs:pDest

9411   sqlite3 *pDest,                        /* Destination database handle */
18894 ** identified by pDest->iSDParm.
18896 ** SRT_Except Remove results from the temporary index pDest->iSDParm.
18898 ** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result
18910 ** in register pDest->iSDParm then abandon the rest
18914 ** row of result as the key in table pDest->iSDParm.
18915 ** Apply the affinity pDest->affSdst before storing
18918 ** SRT_EphemTab Create an temporary table pDest->iSDParm and store
18926 ** of the co-routine is stored in register pDest->iSDParm
18927 ** and the result row is stored in pDest->nDest registers
18928 ** starting with pDest->iSdst.
18930 ** SRT_Table Store results in temporary table pDest->iSDParm.
18936 ** SRT_DistFifo Store results in a temporary table pDest->iSDParm.
18937 ** But also use temporary table pDest->iSDParm+1 as
18941 ** SRT_Queue Store results in priority queue pDest->iSDParm (really
18945 ** SRT_DistQueue Store results in priority queue pDest->iSDParm only if
18947 ** index at pDest->iSDParm+1 hold all prior stores.
18950 ** pDest->iSDParm. If (pDest->iSDParm<0), then the temp
18953 ** key. If (pDest->iSDParm>0), then the table is an index
18954 ** table. (pDest->iSDParm) is the number of key columns in
57731 SQLITE_PRIVATE void sqlite3PagerAlignReserve(Pager *pDest, Pager *pSrc){
57732 if( pDest->nReserve!=pSrc->nReserve ){
57733 pDest->nReserve = pSrc->nReserve;
57734 pagerReportSize(pDest);
59384 ** that pDest points to.
59396 SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned char *pDest){
59398 memset(pDest, 0, N);
59409 rc = sqlite3OsRead(pPager->fd, pDest, N, 0);
77503 /* Overwrite content from pX into pDest. Only do the write if the
77508 u8 *pDest, /* Pointer to the place to start writing */
77517 for(i=0; i<iAmt && pDest[i]==0; i++){}
77521 memset(pDest + i, 0, iAmt - i);
77527 int rc = btreeOverwriteContent(pPage, pDest+nData, pX, iOffset+nData,
77532 if( memcmp(pDest, ((u8*)pX->pData) + iOffset, iAmt)!=0 ){
77539 memmove(pDest, ((u8*)pX->pData) + iOffset, iAmt);
77929 ** pSrc into cursor pDest. If the cursors are open on intkey tables, then
77931 ** into pDest. Otherwise, the record is copied verbatim.
77933 ** This function does not actually write the new value to cursor pDest.
77942 SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor *pDest, BtCursor *pSrc, i64 iKey){
77944 BtShared *pBt = pDest->pBt;
77956 if( pDest->pKeyInfo==0 ) aOut += putVarint(aOut, iKey);
77963 if( nIn==nRem && nIn<pDest->pPage->maxLocal ){
77974 nOut = btreePayloadToLocal(pDest->pPage, pSrc->info.nPayload);
79769 Btree *pDest; /* Destination b-tree file */
79771 int bDestLocked; /* True once a write-transaction is open on pDest */
79860 rc = sqlite3BtreeSetPageSize(p->pDest,sqlite3BtreeGetPageSize(p->pSrc),0,0);
79931 p->pDest = findBtree(pDestDb, pDestDb, zDestDb);
79937 if( 0==p->pSrc || 0==p->pDest
79938 || checkReadTransaction(pDestDb, p->pDest)!=SQLITE_OK
79978 Pager * const pDestPager = sqlite3BtreePager(p->pDest);
79980 int nDestPgsz = sqlite3BtreeGetPageSize(p->pDest);
79988 int nDestReserve = sqlite3BtreeGetRequestedReserve(p->pDest);
80031 if( iDest==PENDING_BYTE_PAGE(p->pDest->pBt) ) continue;
80109 Pager * const pDestPager = sqlite3BtreePager(p->pDest); /* Dest pager */
80144 && SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2,
80153 pgszDest = sqlite3BtreeGetPageSize(p->pDest);
80154 destMode = sqlite3PagerGetJournalMode(sqlite3BtreePager(p->pDest));
80193 rc = sqlite3BtreeNewDb(p->pDest);
80197 rc = sqlite3BtreeUpdateMeta(p->pDest,1,p->iDestSchema+1);
80204 rc = sqlite3BtreeSetVersion(p->pDest, 2);
80222 assert( pgszDest==sqlite3BtreeGetPageSize(p->pDest) );
80226 if( nDestTruncate==(int)PENDING_BYTE_PAGE(p->pDest->pBt) ){
80254 nDestTruncate==(int)(PENDING_BYTE_PAGE(p->pDest->pBt)-1)
80266 if( iPg!=PENDING_BYTE_PAGE(p->pDest->pBt) ){
80310 && SQLITE_OK==(rc = sqlite3BtreeCommitPhaseTwo(p->pDest, 0))
80374 sqlite3BtreeRollback(p->pDest, SQLITE_OK, 0);
80516 b.pDest = pTo;
80536 sqlite3PagerClearCache(sqlite3BtreePager(b.pDest));
93177 Mem *pDest; /* Where to write the extracted value */
93212 pDest = &aMem[pOp->p3];
93213 memAboutToChange(p, pDest);
93214 sqlite3VdbeMemSetNull(pDest);
93361 pDest = &aMem[pOp->p3];
93362 memAboutToChange(p, pDest);
93364 sqlite3VdbeMemShallowCopy(pDest, pOp->p4.pMem, MEM_Static);
93366 sqlite3VdbeMemSetNull(pDest);
93380 pDest = &aMem[pOp->p3];
93381 memAboutToChange(p, pDest);
93382 assert( sqlite3VdbeCheckMemInvariants(pDest) );
93383 if( VdbeMemDynamic(pDest) ){
93384 sqlite3VdbeMemSetNull(pDest);
93392 sqlite3VdbeSerialGet(zData, t, pDest);
93399 pDest->n = len = (t-12)/2;
93400 pDest->enc = encoding;
93401 if( pDest->szMalloc < len+2 ){
93403 pDest->flags = MEM_Null;
93404 if( sqlite3VdbeMemGrow(pDest, len+2, 0) ) goto no_mem;
93406 pDest->z = pDest->zMalloc;
93408 memcpy(pDest->z, zData, len);
93409 pDest->z[len] = 0;
93410 pDest->z[len+1] = 0;
93411 pDest->flags = aFlag[t&1];
93414 pDest->enc = encoding;
93433 sqlite3VdbeSerialGet((u8*)sqlite3CtypeMap, t, pDest);
93436 rc = sqlite3VdbeMemFromBtree(pC->uc.pCursor, aOffset[p2], len, pDest);
93438 sqlite3VdbeSerialGet((const u8*)pDest->z, t, pDest);
93439 pDest->flags &= ~MEM_Ephem;
93444 UPDATE_MAX_BLOBSIZE(pDest);
93445 REGISTER_TRACE(pOp->p3, pDest);
95992 VdbeCursor *pDest; /* Cursor to write to */
95999 pDest = p->apCsr[pOp->p1];
96002 rc = sqlite3BtreeTransferRow(pDest->uc.pCursor, pSrc->uc.pCursor, iKey);
98500 Mem *pDest;
98506 pDest = &aMem[pOp->p3];
98507 memAboutToChange(p, pDest);
98509 sqlite3VdbeMemSetNull(pDest);
98517 sContext.pOut = pDest;
98521 sqlite3VdbeMemSetNull(pDest);
98522 pDest->flags = MEM_Null|MEM_Zero;
98523 pDest->u.nZero = 0;
98525 MemSetTypeFlag(pDest, MEM_Null);
98530 sqlite3VdbeError(p, "%s", sqlite3_value_text(pDest));
98533 sqlite3VdbeChangeEncoding(pDest, encoding);
98534 REGISTER_TRACE(pOp->p3, pDest);
98535 UPDATE_MAX_BLOBSIZE(pDest);
129182 Table *pDest, /* The table we are inserting into */
129185 int iDbDest /* The database of pDest */
131312 ** for index pDest in an insert transfer optimization. The rules
131321 static int xferCompatibleIndex(Index *pDest, Index *pSrc){
131323 assert( pDest && pSrc );
131324 assert( pDest->pTable!=pSrc->pTable );
131325 if( pDest->nKeyCol!=pSrc->nKeyCol || pDest->nColumn!=pSrc->nColumn ){
131328 if( pDest->onError!=pSrc->onError ){
131332 if( pSrc->aiColumn[i]!=pDest->aiColumn[i] ){
131336 assert( pSrc->aColExpr!=0 && pDest->aColExpr!=0 );
131338 pDest->aColExpr->a[i].pExpr, -1)!=0 ){
131342 if( pSrc->aSortOrder[i]!=pDest->aSortOrder[i] ){
131345 if( sqlite3_stricmp(pSrc->azColl[i],pDest->azColl[i])!=0 ){
131349 if( sqlite3ExprCompare(0, pSrc->pPartIdxWhere, pDest->pPartIdxWhere, -1) ){
131384 Table *pDest, /* The table we are inserting into */
131387 int iDbDest /* The database of pDest */
131398 int emptyDestTest = 0; /* Address of test for empty pDest */
131402 int destHasUniqueIdx = 0; /* True if pDest has a UNIQUE index */
131413 if( IsVirtual(pDest) ){
131418 if( pDest->iPKey>=0 ) onError = pDest->keyConf;
131467 if( pSrc->tnum==pDest->tnum && pSrc->pSchema==pDest->pSchema ){
131468 testcase( pSrc!=pDest ); /* Possible due to bad sqlite_schema.rootpage */
131471 if( HasRowid(pDest)!=HasRowid(pSrc) ){
131477 if( pDest->nCol!=pSrc->nCol ){
131480 if( pDest->iPKey!=pSrc->iPKey ){
131483 if( (pDest->tabFlags & TF_Strict)!=0 && (pSrc->tabFlags & TF_Strict)==0 ){
131486 for(i=0; i<pDest->nCol; i++){
131487 Column *pDestCol = &pDest->aCol[i];
131524 sqlite3ColumnExpr(pDest, pDestCol), -1)!=0 ){
131543 Expr *pDestExpr = sqlite3ColumnExpr(pDest, pDestCol);
131557 for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){
131567 if( pSrcIdx->tnum==pDestIdx->tnum && pSrc->pSchema==pDest->pSchema
131576 if( pDest->pCheck && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1) ){
131588 assert( IsOrdinaryTable(pDest) );
131589 if( (db->flags & SQLITE_ForeignKeys)!=0 && pDest->u.tab.pFKey!=0 ){
131609 regAutoinc = autoIncBegin(pParse, iDbDest, pDest);
131613 sqlite3OpenTable(pParse, iDest, iDbDest, pDest, OP_OpenWrite);
131614 assert( HasRowid(pDest) || destHasUniqueIdx );
131616 (pDest->iPKey<0 && pDest->pIndex!=0) /* (1) */
131645 if( pDest->iPKey>=0 ){
131651 sqlite3RowidConstraint(pParse, onError, pDest);
131655 }else if( pDest->pIndex==0 && !(db->mDbFlags & DBFLAG_VacuumInto) ){
131659 assert( (pDest->tabFlags & TF_Autoincrement)==0 );
131679 sqlite3VdbeChangeP4(v, -1, (char*)pDest, P4_TABLE);
131687 sqlite3TableLock(pParse, iDbDest, pDest->tnum, 1, pDest->zName);
131690 for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){
131734 && !HasRowid(pDest)
131737 codeWithoutRowidPreupdate(pParse, pDest, iDest, regData);
138318 SQLITE_PRIVATE void sqlite3SelectDestInit(SelectDest *pDest, int eDest, int iParm){
138319 pDest->eDest = (u8)eDest;
138320 pDest->iSDParm = iParm;
138321 pDest->iSDParm2 = 0;
138322 pDest->zAffSdst = 0;
138323 pDest->iSdst = 0;
138324 pDest->nSdst = 0;
139305 SelectDest *pDest, /* How to dispose of the results */
139312 int eDest = pDest->eDest; /* How to dispose of results */
139313 int iParm = pDest->iSDParm; /* First argument to disposal method */
139357 if( pDest->iSdst==0 ){
139363 pDest->iSdst = pParse->nMem+1;
139365 }else if( pDest->iSdst+nResultCol > pParse->nMem ){
139373 pDest->nSdst = nResultCol;
139374 regOrig = regResult = pDest->iSdst;
139528 if( pDest->zAffSdst ){
139529 sqlite3VdbeChangeP4(v, -1, pDest->zAffSdst, nResultCol);
139564 int i2 = pDest->iSDParm2;
139598 assert( sqlite3Strlen30(pDest->zAffSdst)==nResultCol );
139600 r1, pDest->zAffSdst, nResultCol);
139622 assert( nResultCol<=pDest->nSdst );
139626 assert( nResultCol==pDest->nSdst );
139642 sqlite3VdbeAddOp1(v, OP_Yield, pDest->iSDParm);
139651 ** pDest->pOrderBy (in pSO). pDest->iSDParm (in iParm) is the cursor for an
139662 pSO = pDest->pOrderBy;
139868 SelectDest *pDest /* Write the sorted results here */
139877 int eDest = pDest->eDest;
139878 int iParm = pDest->iSDParm;
139909 sqlite3VdbeAddOp2(v, OP_Null, 0, pDest->iSdst);
139912 regRow = pDest->iSdst;
140023 assert( nColumn==sqlite3Strlen30(pDest->zAffSdst) );
140025 pDest->zAffSdst, nColumn);
140035 int i2 = pDest->iSDParm2;
140050 sqlite3VdbeAddOp2(v, OP_ResultRow, pDest->iSdst, nColumn);
140052 sqlite3VdbeAddOp1(v, OP_Yield, pDest->iSDParm);
140781 ** one. Each row extracted from Queue is output to pDest. Then the single
140797 ** have been output to pDest. A LIMIT of zero means to output no rows and a
140800 ** than being sent to pDest. The LIMIT count does not begin until after OFFSET
140806 SelectDest *pDest /* What to do with query results */
140928 0, 0, pDest, addrCont, addrBreak);
140960 SelectDest *pDest /* What to do with query results */
140982 SelectDest *pDest /* What to do with query results */
141003 selectInnerLoop(pParse, p, -1, 0, 0, pDest, 1, 1);
141055 SelectDest *pDest /* What to do with query results */
141072 dest = *pDest;
141110 return multiSelectOrderBy(pParse, p, pDest);
141393 pDest->iSdst = dest.iSdst;
141394 pDest->nSdst = dest.nSdst;
141423 ** pIn->nSdst columns to be output. pDest is where the output should
141442 SelectDest *pDest, /* Where to send the data */
141473 assert( pDest->eDest!=SRT_Exists );
141474 assert( pDest->eDest!=SRT_Table );
141475 switch( pDest->eDest ){
141482 sqlite3VdbeAddOp2(v, OP_NewRowid, pDest->iSDParm, r2);
141483 sqlite3VdbeAddOp3(v, OP_Insert, pDest->iSDParm, r1, r2);
141498 r1, pDest->zAffSdst, pIn->nSdst);
141499 sqlite3VdbeAddOp4Int(v, OP_IdxInsert, pDest->iSDParm, r1,
141512 sqlite3ExprCodeMove(pParse, pIn->iSdst, pDest->iSDParm, pIn->nSdst);
141519 ** starting at pDest->iSdst. Then the co-routine yields.
141522 if( pDest->iSdst==0 ){
141523 pDest->iSdst = sqlite3GetTempRange(pParse, pIn->nSdst);
141524 pDest->nSdst = pIn->nSdst;
141526 sqlite3ExprCodeMove(pParse, pIn->iSdst, pDest->iSdst, pIn->nSdst);
141527 sqlite3VdbeAddOp1(v, OP_Yield, pDest->iSDParm);
141540 assert( pDest->eDest==SRT_Output );
141649 SelectDest *pDest /* What to do with query results */
141855 p, &destA, pDest, regOutA,
141864 p, &destB, pDest, regOutB,
144898 SelectDest *pDest /* What to do with the query results */
144937 assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistFifo );
144938 assert( p->pOrderBy==0 || pDest->eDest!=SRT_Fifo );
144939 assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistQueue );
144940 assert( p->pOrderBy==0 || pDest->eDest!=SRT_Queue );
144941 if( IgnorableDistinct(pDest) ){
144942 assert(pDest->eDest==SRT_Exists || pDest->eDest==SRT_Union ||
144943 pDest->eDest==SRT_Except || pDest->eDest==SRT_Discard ||
144944 pDest->eDest==SRT_DistQueue || pDest->eDest==SRT_DistFifo );
145001 if( pDest->eDest==SRT_Output ){
145141 if( !IgnorableOrderby(pDest) ){
145152 rc = multiSelect(pParse, p, pDest);
145445 if( pDest->eDest==SRT_EphemTab ){
145446 sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pDest->iSDParm, pEList->nExpr);
145542 selectInnerLoop(pParse, p, -1, &sSort, &sDistinct, pDest, iCont, iBreak);
145551 selectInnerLoop(pParse, p, -1, &sSort, &sDistinct, pDest,
145943 &sDistinct, pDest,
146098 pDest, addrEnd, addrEnd);
146115 generateSortTail(pParse, p, &sSort, pEList->nExpr, pDest);
156739 ** Move the content of pSrc into pDest
156741 static void whereOrMove(WhereOrSet *pDest, WhereOrSet *pSrc){
156742 pDest->n = pSrc->n;
156743 memcpy(pDest->a, pSrc->a, pDest->n*sizeof(pDest->a[0]));