Lines Matching refs:pDest
10069 sqlite3 *pDest, /* Destination database handle */
20687 ** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result
20699 ** in register pDest->iSDParm then abandon the rest
20703 ** row of result as the key in table pDest->iSDParm.
20704 ** Apply the affinity pDest->affSdst before storing
20705 ** results. if pDest->iSDParm2 is positive, then it is
20708 ** pDest->iSDParm table. This SRT is used to
20711 ** SRT_EphemTab Create an temporary table pDest->iSDParm and store
20719 ** of the co-routine is stored in register pDest->iSDParm
20720 ** and the result row is stored in pDest->nDest registers
20721 ** starting with pDest->iSdst.
20723 ** SRT_Table Store results in temporary table pDest->iSDParm.
20729 ** SRT_DistFifo Store results in a temporary table pDest->iSDParm.
20730 ** But also use temporary table pDest->iSDParm+1 as
20734 ** SRT_Queue Store results in priority queue pDest->iSDParm (really
20738 ** SRT_DistQueue Store results in priority queue pDest->iSDParm only if
20740 ** index at pDest->iSDParm+1 hold all prior stores.
20743 ** pDest->iSDParm. If (pDest->iSDParm<0), then the temp
20746 ** key. If (pDest->iSDParm>0), then the table is an index
20747 ** table. (pDest->iSDParm) is the number of key columns in
63469 ** that pDest points to.
63481 SQLITE_PRIVATE int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned char *pDest){
63483 memset(pDest, 0, N);
63494 rc = sqlite3OsRead(pPager->fd, pDest, N, 0);
82365 /* Overwrite content from pX into pDest. Only do the write if the
82370 u8 *pDest, /* Pointer to the place to start writing */
82379 for(i=0; i<iAmt && pDest[i]==0; i++){}
82383 memset(pDest + i, 0, iAmt - i);
82389 int rc = btreeOverwriteContent(pPage, pDest+nData, pX, iOffset+nData,
82394 if( memcmp(pDest, ((u8*)pX->pData) + iOffset, iAmt)!=0 ){
82401 memmove(pDest, ((u8*)pX->pData) + iOffset, iAmt);
82818 ** pSrc into cursor pDest. If the cursors are open on intkey tables, then
82820 ** into pDest. Otherwise, the record is copied verbatim.
82822 ** This function does not actually write the new value to cursor pDest.
82831 SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor *pDest, BtCursor *pSrc, i64 iKey){
82832 BtShared *pBt = pDest->pBt;
82844 if( pDest->pKeyInfo==0 ) aOut += putVarint(aOut, iKey);
82851 if( nIn==nRem && nIn<pDest->pPage->maxLocal ){
82864 nOut = btreePayloadToLocal(pDest->pPage, pSrc->info.nPayload);
84713 Btree *pDest; /* Destination b-tree file */
84715 int bDestLocked; /* True once a write-transaction is open on pDest */
84804 rc = sqlite3BtreeSetPageSize(p->pDest,sqlite3BtreeGetPageSize(p->pSrc),0,0);
84875 p->pDest = findBtree(pDestDb, pDestDb, zDestDb);
84881 if( 0==p->pSrc || 0==p->pDest
84882 || checkReadTransaction(pDestDb, p->pDest)!=SQLITE_OK
84922 Pager * const pDestPager = sqlite3BtreePager(p->pDest);
84924 int nDestPgsz = sqlite3BtreeGetPageSize(p->pDest);
84944 if( iDest==PENDING_BYTE_PAGE(p->pDest->pBt) ) continue;
85022 Pager * const pDestPager = sqlite3BtreePager(p->pDest); /* Dest pager */
85057 && SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2,
85066 pgszDest = sqlite3BtreeGetPageSize(p->pDest);
85067 destMode = sqlite3PagerGetJournalMode(sqlite3BtreePager(p->pDest));
85109 rc = sqlite3BtreeNewDb(p->pDest);
85113 rc = sqlite3BtreeUpdateMeta(p->pDest,1,p->iDestSchema+1);
85120 rc = sqlite3BtreeSetVersion(p->pDest, 2);
85138 assert( pgszDest==sqlite3BtreeGetPageSize(p->pDest) );
85142 if( nDestTruncate==(int)PENDING_BYTE_PAGE(p->pDest->pBt) ){
85170 nDestTruncate==(int)(PENDING_BYTE_PAGE(p->pDest->pBt)-1)
85182 if( iPg!=PENDING_BYTE_PAGE(p->pDest->pBt) ){
85226 && SQLITE_OK==(rc = sqlite3BtreeCommitPhaseTwo(p->pDest, 0))
85290 sqlite3BtreeRollback(p->pDest, SQLITE_OK, 0);
85432 b.pDest = pTo;
85448 sqlite3PagerClearCache(sqlite3BtreePager(b.pDest));
97172 Mem *pDest /* Store the value into this register. */
97175 sqlite3 *db = pDest->db;
97176 int encoding = pDest->enc;
97223 rc = sqlite3VdbeMemSetStr(pDest, pBuf, len, encoding,
97225 pDest->flags |= MEM_Term;
97227 rc = sqlite3VdbeMemSetStr(pDest, pBuf, len, 0,
97231 rc = sqlite3VdbeMemFromBtree(pC->uc.pCursor, iOffset, len, pDest);
97233 sqlite3VdbeSerialGet((const u8*)pDest->z, t, pDest);
97235 pDest->z[len] = 0;
97236 pDest->flags |= MEM_Term;
97239 pDest->flags &= ~MEM_Ephem;
99428 Mem *pDest; /* Where to write the extracted value */
99463 pDest = &aMem[pOp->p3];
99464 memAboutToChange(p, pDest);
99465 sqlite3VdbeMemSetNull(pDest);
99612 pDest = &aMem[pOp->p3];
99613 memAboutToChange(p, pDest);
99615 sqlite3VdbeMemShallowCopy(pDest, pOp->p4.pMem, MEM_Static);
99617 sqlite3VdbeMemSetNull(pDest);
99631 pDest = &aMem[pOp->p3];
99632 memAboutToChange(p, pDest);
99633 assert( sqlite3VdbeCheckMemInvariants(pDest) );
99634 if( VdbeMemDynamic(pDest) ){
99635 sqlite3VdbeMemSetNull(pDest);
99643 sqlite3VdbeSerialGet(zData, t, pDest);
99650 pDest->n = len = (t-12)/2;
99651 pDest->enc = encoding;
99652 if( pDest->szMalloc < len+2 ){
99654 pDest->flags = MEM_Null;
99655 if( sqlite3VdbeMemGrow(pDest, len+2, 0) ) goto no_mem;
99657 pDest->z = pDest->zMalloc;
99659 memcpy(pDest->z, zData, len);
99660 pDest->z[len] = 0;
99661 pDest->z[len+1] = 0;
99662 pDest->flags = aFlag[t&1];
99666 pDest->enc = encoding;
99667 assert( pDest->db==db );
99689 sqlite3VdbeSerialGet((u8*)sqlite3CtypeMap, t, pDest);
99692 p->cacheCtr, colCacheCtr, pDest);
99702 UPDATE_MAX_BLOBSIZE(pDest);
99703 REGISTER_TRACE(pOp->p3, pDest);
102294 VdbeCursor *pDest; /* Cursor to write to */
102301 pDest = p->apCsr[pOp->p1];
102304 rc = sqlite3BtreeTransferRow(pDest->uc.pCursor, pSrc->uc.pCursor, iKey);
105003 Mem *pDest;
105010 pDest = &aMem[pOp->p3];
105011 memAboutToChange(p, pDest);
105013 sqlite3VdbeMemSetNull(pDest);
105021 sContext.pOut = pDest;
105028 sqlite3VdbeMemSetNull(pDest);
105029 pDest->flags = MEM_Null|MEM_Zero;
105030 pDest->u.nZero = 0;
105032 MemSetTypeFlag(pDest, MEM_Null);
105037 sqlite3VdbeError(p, "%s", sqlite3_value_text(pDest));
105040 sqlite3VdbeChangeEncoding(pDest, encoding);
105041 REGISTER_TRACE(pOp->p3, pDest);
105042 UPDATE_MAX_BLOBSIZE(pDest);
139451 Table *pDest, /* The table we are inserting into */
139454 int iDbDest /* The database of pDest */
141602 ** for index pDest in an insert transfer optimization. The rules
141611 static int xferCompatibleIndex(Index *pDest, Index *pSrc){
141613 assert( pDest && pSrc );
141614 assert( pDest->pTable!=pSrc->pTable );
141615 if( pDest->nKeyCol!=pSrc->nKeyCol || pDest->nColumn!=pSrc->nColumn ){
141618 if( pDest->onError!=pSrc->onError ){
141622 if( pSrc->aiColumn[i]!=pDest->aiColumn[i] ){
141626 assert( pSrc->aColExpr!=0 && pDest->aColExpr!=0 );
141628 pDest->aColExpr->a[i].pExpr, -1)!=0 ){
141632 if( pSrc->aSortOrder[i]!=pDest->aSortOrder[i] ){
141635 if( sqlite3_stricmp(pSrc->azColl[i],pDest->azColl[i])!=0 ){
141639 if( sqlite3ExprCompare(0, pSrc->pPartIdxWhere, pDest->pPartIdxWhere, -1) ){
141674 Table *pDest, /* The table we are inserting into */
141677 int iDbDest /* The database of pDest */
141688 int emptyDestTest = 0; /* Address of test for empty pDest */
141692 int destHasUniqueIdx = 0; /* True if pDest has a UNIQUE index */
141703 if( IsVirtual(pDest) ){
141708 if( pDest->iPKey>=0 ) onError = pDest->keyConf;
141757 if( pSrc->tnum==pDest->tnum && pSrc->pSchema==pDest->pSchema ){
141758 testcase( pSrc!=pDest ); /* Possible due to bad sqlite_schema.rootpage */
141761 if( HasRowid(pDest)!=HasRowid(pSrc) ){
141767 if( pDest->nCol!=pSrc->nCol ){
141770 if( pDest->iPKey!=pSrc->iPKey ){
141773 if( (pDest->tabFlags & TF_Strict)!=0 && (pSrc->tabFlags & TF_Strict)==0 ){
141776 for(i=0; i<pDest->nCol; i++){
141777 Column *pDestCol = &pDest->aCol[i];
141814 sqlite3ColumnExpr(pDest, pDestCol), -1)!=0 ){
141833 Expr *pDestExpr = sqlite3ColumnExpr(pDest, pDestCol);
141847 for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){
141857 if( pSrcIdx->tnum==pDestIdx->tnum && pSrc->pSchema==pDest->pSchema
141866 if( pDest->pCheck
141868 && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1)
141881 assert( IsOrdinaryTable(pDest) );
141882 if( (db->flags & SQLITE_ForeignKeys)!=0 && pDest->u.tab.pFKey!=0 ){
141902 regAutoinc = autoIncBegin(pParse, iDbDest, pDest);
141906 sqlite3OpenTable(pParse, iDest, iDbDest, pDest, OP_OpenWrite);
141907 assert( HasRowid(pDest) || destHasUniqueIdx );
141909 (pDest->iPKey<0 && pDest->pIndex!=0) /* (1) */
141938 if( pDest->iPKey>=0 ){
141944 sqlite3RowidConstraint(pParse, onError, pDest);
141948 }else if( pDest->pIndex==0 && !(db->mDbFlags & DBFLAG_VacuumInto) ){
141952 assert( (pDest->tabFlags & TF_Autoincrement)==0 );
141972 sqlite3VdbeChangeP4(v, -1, (char*)pDest, P4_TABLE);
141980 sqlite3TableLock(pParse, iDbDest, pDest->tnum, 1, pDest->zName);
141983 for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){
142027 && !HasRowid(pDest)
142030 codeWithoutRowidPreupdate(pParse, pDest, iDest, regData);
148871 SQLITE_PRIVATE void sqlite3SelectDestInit(SelectDest *pDest, int eDest, int iParm){
148872 pDest->eDest = (u8)eDest;
148873 pDest->iSDParm = iParm;
148874 pDest->iSDParm2 = 0;
148875 pDest->zAffSdst = 0;
148876 pDest->iSdst = 0;
148877 pDest->nSdst = 0;
149904 SelectDest *pDest, /* How to dispose of the results */
149911 int eDest = pDest->eDest; /* How to dispose of results */
149912 int iParm = pDest->iSDParm; /* First argument to disposal method */
149938 if( pDest->iSdst==0 ){
149944 pDest->iSdst = pParse->nMem+1;
149946 }else if( pDest->iSdst+nResultCol > pParse->nMem ){
149954 pDest->nSdst = nResultCol;
149955 regOrig = regResult = pDest->iSdst;
150082 if( eDest==SRT_Table && pDest->iSDParm2 ){
150119 int i2 = pDest->iSDParm2;
150151 pDest->iSDParm2 = 0; /* Signal that any Bloom filter is unpopulated */
150154 assert( sqlite3Strlen30(pDest->zAffSdst)==nResultCol );
150156 r1, pDest->zAffSdst, nResultCol);
150158 if( pDest->iSDParm2 ){
150159 sqlite3VdbeAddOp4Int(v, OP_FilterAdd, pDest->iSDParm2, 0,
150183 assert( nResultCol<=pDest->nSdst );
150186 pDest->iSDParm = regResult;
150188 assert( nResultCol==pDest->nSdst );
150208 sqlite3VdbeAddOp1(v, OP_Yield, pDest->iSDParm);
150217 ** pDest->pOrderBy (in pSO). pDest->iSDParm (in iParm) is the cursor for an
150228 pSO = pDest->pOrderBy;
150437 SelectDest *pDest /* Write the sorted results here */
150446 int eDest = pDest->eDest;
150447 int iParm = pDest->iSDParm;
150495 sqlite3VdbeAddOp2(v, OP_Null, 0, pDest->iSdst);
150498 regRow = pDest->iSdst;
150597 assert( nColumn==sqlite3Strlen30(pDest->zAffSdst) );
150599 pDest->zAffSdst, nColumn);
150609 int i2 = pDest->iSDParm2;
150624 sqlite3VdbeAddOp2(v, OP_ResultRow, pDest->iSdst, nColumn);
150626 sqlite3VdbeAddOp1(v, OP_Yield, pDest->iSDParm);
151394 ** one. Each row extracted from Queue is output to pDest. Then the single
151410 ** have been output to pDest. A LIMIT of zero means to output no rows and a
151413 ** than being sent to pDest. The LIMIT count does not begin until after OFFSET
151419 SelectDest *pDest /* What to do with query results */
151561 0, 0, pDest, addrCont, addrBreak);
151593 SelectDest *pDest /* What to do with query results */
151615 SelectDest *pDest /* What to do with query results */
151636 selectInnerLoop(pParse, p, -1, 0, 0, pDest, 1, 1);
151688 SelectDest *pDest /* What to do with query results */
151705 dest = *pDest;
151742 return multiSelectByMerge(pParse, p, pDest);
151753 return multiSelectByMerge(pParse, p, pDest);
151812 pDest->iSdst = dest.iSdst;
151813 pDest->nSdst = dest.nSdst;
151814 pDest->iSDParm2 = dest.iSDParm2;
151841 ** starting at register pIn->iSdst. pDest is where the output should
151860 SelectDest *pDest, /* Where to send the data */
151893 switch( pDest->eDest ){
151902 int iParm = pDest->iSDParm;
151903 testcase( pDest->eDest==SRT_Table );
151904 testcase( pDest->eDest==SRT_EphemTab );
151905 testcase( pDest->eDest==SRT_Fifo );
151906 testcase( pDest->eDest==SRT_DistFifo );
151914 if( pDest->eDest==SRT_Table && pDest->iSDParm2 ){
151919 if( pDest->eDest==SRT_DistFifo ){
151942 sqlite3VdbeAddOp2(v, OP_Integer, 1, pDest->iSDParm);
151955 r1, pDest->zAffSdst, pIn->nSdst);
151956 sqlite3VdbeAddOp4Int(v, OP_IdxInsert, pDest->iSDParm, r1,
151958 if( pDest->iSDParm2>0 ){
151959 sqlite3VdbeAddOp4Int(v, OP_FilterAdd, pDest->iSDParm2, 0,
151974 sqlite3ExprCodeMove(pParse, pIn->iSdst, pDest->iSDParm, pIn->nSdst);
151981 ** starting at pDest->iSdst. Then the co-routine yields.
151984 if( pDest->iSdst==0 ){
151985 pDest->iSdst = sqlite3GetTempRange(pParse, pIn->nSdst);
151986 pDest->nSdst = pIn->nSdst;
151988 sqlite3ExprCodeMove(pParse, pIn->iSdst, pDest->iSdst, pIn->nSdst);
151989 sqlite3VdbeAddOp1(v, OP_Yield, pDest->iSDParm);
151995 ** pDest->pOrderBy (in pSO). pDest->iSDParm (in iParm) is the cursor for an
152005 int iParm = pDest->iSDParm;
152006 pSO = pDest->pOrderBy;
152014 if( pDest->eDest==SRT_DistQueue ){
152044 assert( pDest->eDest==SRT_Output );
152152 SelectDest *pDest /* What to do with query results */
152359 p, &destA, pDest, regOutA,
152368 p, &destB, pDest, regOutB,
156340 SelectDest *pDest /* What to do with the query results */
156380 assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistFifo );
156381 assert( p->pOrderBy==0 || pDest->eDest!=SRT_Fifo );
156382 assert( p->pOrderBy==0 || pDest->eDest!=SRT_DistQueue );
156383 assert( p->pOrderBy==0 || pDest->eDest!=SRT_Queue );
156384 if( IgnorableDistinct(pDest) ){
156385 assert(pDest->eDest==SRT_Exists || pDest->eDest==SRT_Discard ||
156386 pDest->eDest==SRT_DistQueue || pDest->eDest==SRT_DistFifo );
156441 if( pDest->eDest==SRT_Output ){
156633 if( !IgnorableOrderby(pDest) ){
156644 rc = multiSelect(pParse, p, pDest);
156982 if( pDest->eDest==SRT_EphemTab ){
156983 sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pDest->iSDParm, pEList->nExpr);
157044 if( pDest->eDest<=SRT_DistQueue && pDest->eDest>=SRT_DistFifo ){
157085 selectInnerLoop(pParse, p, -1, &sSort, &sDistinct, pDest, iCont, iBreak);
157094 selectInnerLoop(pParse, p, -1, &sSort, &sDistinct, pDest,
157496 &sDistinct, pDest,
157658 pDest, addrEnd, addrEnd);
157673 generateSortTail(pParse, p, &sSort, pEList->nExpr, pDest);
168764 ** Move the content of pSrc into pDest
168766 static void whereOrMove(WhereOrSet *pDest, WhereOrSet *pSrc){
168767 pDest->n = pSrc->n;
168768 memcpy(pDest->a, pSrc->a, pDest->n*sizeof(pDest->a[0]));