Lines Matching refs:pCell
66689 u8 *pCell, /* Pointer to the cell text. */
66715 pInfo->nSize = (u16)(&pInfo->pPayload[pInfo->nLocal] - pCell) + 4;
66752 u8 *pCell, /* Pointer to the cell text. */
66761 pInfo->nSize = 4 + getVarint(&pCell[4], (u64*)&pInfo->nKey);
66769 u8 *pCell, /* Pointer to the cell text. */
66780 pIter = pCell;
66828 pInfo->nSize = nPayload + (u16)(pIter - pCell);
66832 btreeParseCellAdjustSizeForOverflow(pPage, pCell, pInfo);
66837 u8 *pCell, /* Pointer to the cell text. */
66846 pIter = pCell + pPage->childPtrSize;
66865 pInfo->nSize = nPayload + (u16)(pIter - pCell);
66869 btreeParseCellAdjustSizeForOverflow(pPage, pCell, pInfo);
66892 static u16 cellSizePtr(MemPage *pPage, u8 *pCell){
66893 u8 *pIter = pCell + pPage->childPtrSize; /* For looping over bytes of pCell */
66903 pPage->xParseCell(pPage, pCell, &debuginfo);
66925 nSize += (u32)(pIter - pCell);
66935 nSize += 4 + (u16)(pIter - pCell);
66940 static u16 cellSizePtrNoPayload(MemPage *pPage, u8 *pCell){
66941 u8 *pIter = pCell + 4; /* For looping over bytes of pCell */
66950 pPage->xParseCell(pPage, pCell, &debuginfo);
66958 assert( debuginfo.nSize==(u16)(pIter - pCell) || CORRUPT_DB );
66959 return (u16)(pIter - pCell);
66978 static void ptrmapPutOvflPtr(MemPage *pPage, MemPage *pSrc, u8 *pCell,int *pRC){
66981 assert( pCell!=0 );
66982 pPage->xParseCell(pPage, pCell, &info);
66985 if( SQLITE_WITHIN(pSrc->aDataEnd, pCell, pCell+info.nLocal) ){
66990 ovfl = get4byte(&pCell[info.nSize-4]);
69171 u8 *pCell = findCell(pPage, i);
69173 ptrmapPutOvflPtr(pPage, pPage, pCell, &rc);
69176 Pgno childPgno = get4byte(pCell);
69222 u8 *pCell = findCell(pPage, i);
69225 pPage->xParseCell(pPage, pCell, &info);
69227 if( pCell+info.nSize > pPage->aData+pPage->pBt->usableSize ){
69230 if( iFrom==get4byte(pCell+info.nSize-4) ){
69231 put4byte(pCell+info.nSize-4, iTo);
69236 if( get4byte(pCell)==iFrom ){
69237 put4byte(pCell, iTo);
71115 u8 *pCell; /* Pointer to current cell in pPage */
71132 pCell = findCellPastPtr(pPage, idx);
71134 while( 0x80 <= *(pCell++) ){
71135 if( pCell>=pPage->aDataEnd ){
71140 getVarint(pCell, (u64*)&nCellKey);
71258 u8 *pCell; /* Pointer to current cell in pPage */
71274 pCell = findCellPastPtr(pPage, idx);
71284 nCell = pCell[0];
71289 testcase( pCell+nCell+1==pPage->aDataEnd );
71290 c = xRecordCompare(nCell, (void*)&pCell[1], pIdxKey);
71291 }else if( !(pCell[1] & 0x80)
71292 && (nCell = ((nCell&0x7f)<<7) + pCell[1])<=pPage->maxLocal
71296 testcase( pCell+nCell+2==pPage->aDataEnd );
71297 c = xRecordCompare(nCell, (void*)&pCell[2], pIdxKey);
71309 u8 * const pCellBody = pCell - pPage->childPtrSize;
72096 unsigned char *pCell, /* First byte of the Cell */
72107 testcase( pCell + pInfo->nSize == pPage->aDataEnd );
72108 testcase( pCell + (pInfo->nSize-1) == pPage->aDataEnd );
72109 if( pCell + pInfo->nSize > pPage->aDataEnd ){
72113 ovflPgno = get4byte(pCell + pInfo->nSize - 4);
72168 #define BTREE_CLEAR_CELL(rc, pPage, pCell, sInfo) \
72169 pPage->xParseCell(pPage, pCell, &sInfo); \
72171 rc = clearCellOverflow(pPage, pCell, &sInfo); \
72191 unsigned char *pCell, /* Complete text of the cell */
72210 assert( pCell<pPage->aData || pCell>=&pPage->aData[pPage->pBt->pageSize]
72220 nHeader += putVarint32(&pCell[nHeader], nPayload);
72221 nHeader += putVarint(&pCell[nHeader], *(u64*)&pX->nKey);
72226 nHeader += putVarint32(&pCell[nHeader], nPayload);
72230 pPayload = &pCell[nHeader];
72256 pPrior = &pCell[nHeader+n];
72276 pPage->xParseCell(pPage, pCell, &info);
72277 assert( nHeader==(int)(info.pPayload - pCell) );
72440 u8 *pCell, /* Content of the new cell */
72458 assert( sz==pPage->xCellSize(pPage, pCell) || CORRUPT_DB );
72462 memcpy(pTemp, pCell, sz);
72463 pCell = pTemp;
72466 put4byte(pCell, iChild);
72473 pPage->apOvfl[j] = pCell;
72506 memcpy(&data[idx+4], pCell+4, sz-4);
72509 memcpy(&data[idx], pCell, sz);
72523 ptrmapPutOvflPtr(pPage, pPage, pCell, pRC);
72698 u8 *pCell = pCArray->apCell[i];
72701 if( SQLITE_WITHIN(pCell,aData+j,pEnd) ){
72702 if( ((uptr)(pCell+sz))>(uptr)pEnd ) return SQLITE_CORRUPT_BKPT;
72703 pCell = &pTmp[pCell - aData];
72704 }else if( (uptr)(pCell+sz)>(uptr)pSrcEnd
72705 && (uptr)(pCell)<(uptr)pSrcEnd
72714 memmove(pData, pCell, sz);
72715 assert( sz==pPg->xCellSize(pPg, pCell) || CORRUPT_DB );
72840 u8 *pCell = pCArray->apCell[i];
72841 if( SQLITE_WITHIN(pCell, pStart, pEnd) ){
72847 if( pFree!=(pCell + sz) ){
72852 pFree = pCell;
72858 pFree = pCell;
72970 u8 *pCell = pCArray->apCell[i+iNew];
72972 if( SQLITE_WITHIN(pCell, aData, &aData[pPg->pBt->usableSize]) ){
72973 pCell = &pTmp[pCell - aData];
72975 assert( 0==memcmp(pCell, &aData[iOff],
73035 u8 *pCell = pPage->apOvfl[0];
73036 u16 szCell = pPage->xCellSize(pPage, pCell);
73045 b.apCell = &pCell;
73068 ptrmapPutOvflPtr(pNew, pNew, pCell, &rc);
73085 pCell = findCell(pPage, pPage->nCell-1);
73086 pStop = &pCell[9];
73087 while( (*(pCell++)&0x80) && pCell<pStop );
73088 pStop = &pCell[9];
73089 while( ((*(pOut++) = *(pCell++))&0x80) && pCell<pStop );
73795 u8 *pCell = b.apCell[i];
73816 || !SQLITE_WITHIN(pCell,pOld->aData,pOld->aDataEnd)
73819 ptrmapPut(pBt, get4byte(pCell), PTRMAP_BTREE, pNew->pgno, &rc);
73822 ptrmapPutOvflPtr(pNew, pOld, pCell, &rc);
73831 u8 *pCell;
73840 pCell = b.apCell[j];
73844 memcpy(&pNew->aData[8], pCell, 4);
73854 pCell = pTemp;
73855 sz = 4 + putVarint(&pCell[4], info.nKey);
73858 pCell -= 4;
73872 sz = pParent->xCellSize(pParent, pCell);
73880 if( SQLITE_WITHIN(pSrcEnd, pCell, pCell+sz) ){
73884 insertCell(pParent, nxDiv+i, pCell, sz, pTemp, pNew->pgno, &rc);
74799 unsigned char *pCell; /* Pointer to cell to delete */
74823 pCell = findCell(pPage, iCellIdx);
74842 || (pPage->nFree+cellSizePtr(pPage,pCell)+2)>(int)(pBt->usableSize*2/3)
74885 BTREE_CLEAR_CELL(rc, pPage, pCell, info);
74909 pCell = findCell(pLeaf, pLeaf->nCell-1);
74910 if( pCell<&pLeaf->aData[4] ) return SQLITE_CORRUPT_BKPT;
74911 nCell = pLeaf->xCellSize(pLeaf, pCell);
74917 insertCell(pPage, iCellIdx, pCell-4, nCell+4, pTmp, n, &rc);
75149 unsigned char *pCell;
75168 pCell = findCell(pPage, i);
75170 rc = clearDatabasePage(pBt, get4byte(pCell), 1, pnChange);
75173 BTREE_CLEAR_CELL(rc, pPage, pCell, info);
75764 u8 *pCell; /* Cell content */
75859 pCell = &data[pc];
75860 pPage->xParseCell(pPage, pCell, &info);
75882 pgnoOvfl = get4byte(&pCell[info.nSize - 4]);
75893 pgno = get4byte(pCell);
194757 RtreeCell *pCell, /* The cell to write */
194762 p += writeInt64(p, pCell->iRowid);
194764 p += writeCoord(p, &pCell->aCoord[ii]);
194790 RtreeCell *pCell /* The cell to be inserted */
194800 nodeOverwriteCell(pRtree, pNode, pCell, nCell);
194896 RtreeCell *pCell /* OUT: Write the cell contents here */
194901 pCell->iRowid = nodeGetRowid(pRtree, pNode, iCell);
194903 pCoord = pCell->aCoord;
196101 static RtreeDValue cellGrowth(Rtree *pRtree, RtreeCell *p, RtreeCell *pCell){
196106 cellUnion(pRtree, &cell, pCell);
196144 RtreeCell *pCell, /* Cell to insert into rtree */
196175 growth = cellGrowth(pRtree, &cell, pCell);
196205 RtreeCell *pCell /* This cell was just inserted */
196227 if( !cellContains(pRtree, &cell, pCell) ){
196228 cellUnion(pRtree, &cell, pCell);
196490 RtreeCell *pCell = &aCell[aaSorted[iBestDim][ii]];
196491 nodeInsertCell(pRtree, pTarget, pCell);
196492 cellUnion(pRtree, pBbox, pCell);
196527 RtreeCell *pCell,
196558 memcpy(&aCell[nCell], pCell, sizeof(RtreeCell));
196626 if( iRowid==pCell->iRowid ){
196642 rc = updateMapping(pRtree, pCell->iRowid, pLeft, iHeight);
196818 RtreeCell *pCell,
196855 memcpy(&aCell[ii], pCell, sizeof(RtreeCell));
196884 if( p->iRowid==pCell->iRowid ){
196923 RtreeCell *pCell,
196928 RtreeNode *pChild = nodeHashLookup(pRtree, pCell->iRowid);
196935 if( nodeInsertCell(pRtree, pNode, pCell) ){
196937 rc = SplitNode(pRtree, pNode, pCell, iHeight);
196940 rc = Reinsert(pRtree, pNode, pCell, iHeight);
196943 rc = AdjustTree(pRtree, pNode, pCell);
196946 rc = rowidWrite(pRtree, pCell->iRowid, pNode->iNode);
196948 rc = parentWrite(pRtree, pCell->iRowid, pNode->iNode);
198080 u8 *pCell, /* Pointer to cell coordinates */
198088 readCoord(&pCell[4*2*i], &c1);
198089 readCoord(&pCell[4*(2*i + 1)], &c2);
198159 u8 *pCell = &aNode[4 + i*(8 + pCheck->nDim*2*4)];
198160 i64 iVal = readInt64(pCell);
198161 rtreeCheckCellCoord(pCheck, iNode, i, &pCell[8], aParent);
198165 rtreeCheckNode(pCheck, iDepth-1, &pCell[8], iVal);
207575 StatCell *pCell = &p->aCell[i];
207580 pCell->iChildPg = sqlite3Get4byte(&aData[iOff]);
207596 pCell->nLocal = nLocal;
207605 pCell->nLastOvfl = (nPayload-nLocal) - (nOvfl-1) * (nUsable-4);
207606 pCell->nOvfl = nOvfl;
207607 pCell->aOvfl = sqlite3_malloc64(sizeof(u32)*nOvfl);
207608 if( pCell->aOvfl==0 ) return SQLITE_NOMEM_BKPT;
207609 pCell->aOvfl[0] = sqlite3Get4byte(&aData[iOff+nLocal]);
207612 u32 iPrev = pCell->aOvfl[j-1];
207619 pCell->aOvfl[j] = sqlite3Get4byte(sqlite3PagerGetData(pPg));
207741 StatCell *pCell = &p->aCell[p->iCell];
207742 while( pCell->iOvfl<pCell->nOvfl ){
207750 if( pCell->iOvfl<pCell->nOvfl-1 ){
207753 pCsr->nPayload += pCell->nLastOvfl;
207754 pCsr->nUnused += nUsable - 4 - pCell->nLastOvfl;
207756 iOvfl = pCell->iOvfl;
207757 pCell->iOvfl++;
207760 pCsr->iPageno = pCell->aOvfl[iOvfl];