Lines Matching refs:pCell
1115 u8 *pCell, /* Pointer to the cell text. */ in btreeParseCellAdjustSizeForOverflow() argument
1141 pInfo->nSize = (u16)(&pInfo->pPayload[pInfo->nLocal] - pCell) + 4; in btreeParseCellAdjustSizeForOverflow()
1178 u8 *pCell, /* Pointer to the cell text. */ in btreeParseCellPtrNoPayload() argument
1187 pInfo->nSize = 4 + getVarint(&pCell[4], (u64*)&pInfo->nKey); in btreeParseCellPtrNoPayload()
1195 u8 *pCell, /* Pointer to the cell text. */ in btreeParseCellPtr() argument
1206 pIter = pCell; in btreeParseCellPtr()
1268 pInfo->nSize = nPayload + (u16)(pIter - pCell); in btreeParseCellPtr()
1272 btreeParseCellAdjustSizeForOverflow(pPage, pCell, pInfo); in btreeParseCellPtr()
1277 u8 *pCell, /* Pointer to the cell text. */ in btreeParseCellPtrIndex() argument
1286 pIter = pCell + pPage->childPtrSize; in btreeParseCellPtrIndex()
1305 pInfo->nSize = nPayload + (u16)(pIter - pCell); in btreeParseCellPtrIndex()
1309 btreeParseCellAdjustSizeForOverflow(pPage, pCell, pInfo); in btreeParseCellPtrIndex()
1333 static u16 cellSizePtr(MemPage *pPage, u8 *pCell){ in cellSizePtr() argument
1334 u8 *pIter = pCell + pPage->childPtrSize; /* For looping over bytes of pCell */ in cellSizePtr()
1344 pPage->xParseCell(pPage, pCell, &debuginfo); in cellSizePtr()
1359 nSize += (u32)(pIter - pCell); in cellSizePtr()
1369 nSize += 4 + (u16)(pIter - pCell); in cellSizePtr()
1374 static u16 cellSizePtrNoPayload(MemPage *pPage, u8 *pCell){ in cellSizePtrNoPayload() argument
1375 u8 *pIter = pCell + 4; /* For looping over bytes of pCell */ in cellSizePtrNoPayload()
1384 pPage->xParseCell(pPage, pCell, &debuginfo); in cellSizePtrNoPayload()
1392 assert( debuginfo.nSize==(u16)(pIter - pCell) || CORRUPT_DB ); in cellSizePtrNoPayload()
1393 return (u16)(pIter - pCell); in cellSizePtrNoPayload()
1395 static u16 cellSizePtrTableLeaf(MemPage *pPage, u8 *pCell){ in cellSizePtrTableLeaf() argument
1396 u8 *pIter = pCell; /* For looping over bytes of pCell */ in cellSizePtrTableLeaf()
1406 pPage->xParseCell(pPage, pCell, &debuginfo); in cellSizePtrTableLeaf()
1432 nSize += (u32)(pIter - pCell); in cellSizePtrTableLeaf()
1442 nSize += 4 + (u16)(pIter - pCell); in cellSizePtrTableLeaf()
1464 static void ptrmapPutOvflPtr(MemPage *pPage, MemPage *pSrc, u8 *pCell,int *pRC){ in ptrmapPutOvflPtr() argument
1467 assert( pCell!=0 ); in ptrmapPutOvflPtr()
1468 pPage->xParseCell(pPage, pCell, &info); in ptrmapPutOvflPtr()
1471 if( SQLITE_WITHIN(pSrc->aDataEnd, pCell, pCell+info.nLocal) ){ in ptrmapPutOvflPtr()
1476 ovfl = get4byte(&pCell[info.nSize-4]); in ptrmapPutOvflPtr()
3680 u8 *pCell = findCell(pPage, i); in setChildPtrmaps() local
3682 ptrmapPutOvflPtr(pPage, pPage, pCell, &rc); in setChildPtrmaps()
3685 Pgno childPgno = get4byte(pCell); in setChildPtrmaps()
3731 u8 *pCell = findCell(pPage, i); in modifyPagePointer() local
3734 pPage->xParseCell(pPage, pCell, &info); in modifyPagePointer()
3736 if( pCell+info.nSize > pPage->aData+pPage->pBt->usableSize ){ in modifyPagePointer()
3739 if( iFrom==get4byte(pCell+info.nSize-4) ){ in modifyPagePointer()
3740 put4byte(pCell+info.nSize-4, iTo); in modifyPagePointer()
3745 if( pCell+4 > pPage->aData+pPage->pBt->usableSize ){ in modifyPagePointer()
3748 if( get4byte(pCell)==iFrom ){ in modifyPagePointer()
3749 put4byte(pCell, iTo); in modifyPagePointer()
5632 u8 *pCell; /* Pointer to current cell in pPage */ in sqlite3BtreeTableMoveto() local
5648 pCell = findCellPastPtr(pPage, idx); in sqlite3BtreeTableMoveto()
5650 while( 0x80 <= *(pCell++) ){ in sqlite3BtreeTableMoveto()
5651 if( pCell>=pPage->aDataEnd ){ in sqlite3BtreeTableMoveto()
5656 getVarint(pCell, (u64*)&nCellKey); in sqlite3BtreeTableMoveto()
5730 u8 *pCell = findCellPastPtr(pPage, idx); in indexCellCompare() local
5732 nCell = pCell[0]; in indexCellCompare()
5737 testcase( pCell+nCell+1==pPage->aDataEnd ); in indexCellCompare()
5738 c = xRecordCompare(nCell, (void*)&pCell[1], pIdxKey); in indexCellCompare()
5739 }else if( !(pCell[1] & 0x80) in indexCellCompare()
5740 && (nCell = ((nCell&0x7f)<<7) + pCell[1])<=pPage->maxLocal in indexCellCompare()
5744 testcase( pCell+nCell+2==pPage->aDataEnd ); in indexCellCompare()
5745 c = xRecordCompare(nCell, (void*)&pCell[2], pIdxKey); in indexCellCompare()
5876 u8 *pCell; /* Pointer to current cell in pPage */ in sqlite3BtreeIndexMoveto() local
5891 pCell = findCellPastPtr(pPage, idx); in sqlite3BtreeIndexMoveto()
5901 nCell = pCell[0]; in sqlite3BtreeIndexMoveto()
5906 testcase( pCell+nCell+1==pPage->aDataEnd ); in sqlite3BtreeIndexMoveto()
5907 c = xRecordCompare(nCell, (void*)&pCell[1], pIdxKey); in sqlite3BtreeIndexMoveto()
5908 }else if( !(pCell[1] & 0x80) in sqlite3BtreeIndexMoveto()
5909 && (nCell = ((nCell&0x7f)<<7) + pCell[1])<=pPage->maxLocal in sqlite3BtreeIndexMoveto()
5913 testcase( pCell+nCell+2==pPage->aDataEnd ); in sqlite3BtreeIndexMoveto()
5914 c = xRecordCompare(nCell, (void*)&pCell[2], pIdxKey); in sqlite3BtreeIndexMoveto()
5926 u8 * const pCellBody = pCell - pPage->childPtrSize; in sqlite3BtreeIndexMoveto()
6706 unsigned char *pCell, /* First byte of the Cell */ in clearCellOverflow() argument
6717 testcase( pCell + pInfo->nSize == pPage->aDataEnd ); in clearCellOverflow()
6718 testcase( pCell + (pInfo->nSize-1) == pPage->aDataEnd ); in clearCellOverflow()
6719 if( pCell + pInfo->nSize > pPage->aDataEnd ){ in clearCellOverflow()
6723 ovflPgno = get4byte(pCell + pInfo->nSize - 4); in clearCellOverflow()
6778 #define BTREE_CLEAR_CELL(rc, pPage, pCell, sInfo) \ argument
6779 pPage->xParseCell(pPage, pCell, &sInfo); \
6781 rc = clearCellOverflow(pPage, pCell, &sInfo); \
6801 unsigned char *pCell, /* Complete text of the cell */ in fillInCell() argument
6820 assert( pCell<pPage->aData || pCell>=&pPage->aData[pPage->pBt->pageSize] in fillInCell()
6830 nHeader += putVarint32(&pCell[nHeader], nPayload); in fillInCell()
6831 nHeader += putVarint(&pCell[nHeader], *(u64*)&pX->nKey); in fillInCell()
6836 nHeader += putVarint32(&pCell[nHeader], nPayload); in fillInCell()
6840 pPayload = &pCell[nHeader]; in fillInCell()
6866 pPrior = &pCell[nHeader+n]; in fillInCell()
6886 pPage->xParseCell(pPage, pCell, &info); in fillInCell()
6887 assert( nHeader==(int)(info.pPayload - pCell) ); in fillInCell()
7050 u8 *pCell, /* Content of the new cell */ in insertCell() argument
7068 assert( sz==pPage->xCellSize(pPage, pCell) || CORRUPT_DB ); in insertCell()
7072 memcpy(pTemp, pCell, sz); in insertCell()
7073 pCell = pTemp; in insertCell()
7076 put4byte(pCell, iChild); in insertCell()
7083 pPage->apOvfl[j] = pCell; in insertCell()
7116 memcpy(&data[idx+4], pCell+4, sz-4); in insertCell()
7119 memcpy(&data[idx], pCell, sz); in insertCell()
7133 ptrmapPutOvflPtr(pPage, pPage, pCell, pRC); in insertCell()
7308 u8 *pCell = pCArray->apCell[i]; in rebuildPage() local
7311 if( SQLITE_WITHIN(pCell,aData+j,pEnd) ){ in rebuildPage()
7312 if( ((uptr)(pCell+sz))>(uptr)pEnd ) return SQLITE_CORRUPT_BKPT; in rebuildPage()
7313 pCell = &pTmp[pCell - aData]; in rebuildPage()
7314 }else if( (uptr)(pCell+sz)>(uptr)pSrcEnd in rebuildPage()
7315 && (uptr)(pCell)<(uptr)pSrcEnd in rebuildPage()
7324 memmove(pData, pCell, sz); in rebuildPage()
7325 assert( sz==pPg->xCellSize(pPg, pCell) || CORRUPT_DB ); in rebuildPage()
7450 u8 *pCell = pCArray->apCell[i]; in pageFreeArray() local
7451 if( SQLITE_WITHIN(pCell, pStart, pEnd) ){ in pageFreeArray()
7457 if( pFree!=(pCell + sz) ){ in pageFreeArray()
7462 pFree = pCell; in pageFreeArray()
7468 pFree = pCell; in pageFreeArray()
7580 u8 *pCell = pCArray->apCell[i+iNew]; in editPage() local
7582 if( SQLITE_WITHIN(pCell, aData, &aData[pPg->pBt->usableSize]) ){ in editPage()
7583 pCell = &pTmp[pCell - aData]; in editPage()
7585 assert( 0==memcmp(pCell, &aData[iOff], in editPage()
7645 u8 *pCell = pPage->apOvfl[0]; in balance_quick() local
7646 u16 szCell = pPage->xCellSize(pPage, pCell); in balance_quick()
7655 b.apCell = &pCell; in balance_quick()
7678 ptrmapPutOvflPtr(pNew, pNew, pCell, &rc); in balance_quick()
7695 pCell = findCell(pPage, pPage->nCell-1); in balance_quick()
7696 pStop = &pCell[9]; in balance_quick()
7697 while( (*(pCell++)&0x80) && pCell<pStop ); in balance_quick()
7698 pStop = &pCell[9]; in balance_quick()
7699 while( ((*(pOut++) = *(pCell++))&0x80) && pCell<pStop ); in balance_quick()
8400 u8 *pCell = b.apCell[i]; in balance_nonroot() local
8421 || !SQLITE_WITHIN(pCell,pOld->aData,pOld->aDataEnd) in balance_nonroot()
8424 ptrmapPut(pBt, get4byte(pCell), PTRMAP_BTREE, pNew->pgno, &rc); in balance_nonroot()
8427 ptrmapPutOvflPtr(pNew, pOld, pCell, &rc); in balance_nonroot()
8436 u8 *pCell; in balance_nonroot() local
8445 pCell = b.apCell[j]; in balance_nonroot()
8449 memcpy(&pNew->aData[8], pCell, 4); in balance_nonroot()
8459 pCell = pTemp; in balance_nonroot()
8460 sz = 4 + putVarint(&pCell[4], info.nKey); in balance_nonroot()
8463 pCell -= 4; in balance_nonroot()
8477 sz = pParent->xCellSize(pParent, pCell); in balance_nonroot()
8485 if( SQLITE_WITHIN(pSrcEnd, pCell, pCell+sz) ){ in balance_nonroot()
8489 insertCell(pParent, nxDiv+i, pCell, sz, pTemp, pNew->pgno, &rc); in balance_nonroot()
9421 unsigned char *pCell; /* Pointer to cell to delete */ in sqlite3BtreeDelete() local
9451 pCell = findCell(pPage, iCellIdx); in sqlite3BtreeDelete()
9475 || (pPage->nFree+pPage->xCellSize(pPage,pCell)+2) > in sqlite3BtreeDelete()
9519 BTREE_CLEAR_CELL(rc, pPage, pCell, info); in sqlite3BtreeDelete()
9543 pCell = findCell(pLeaf, pLeaf->nCell-1); in sqlite3BtreeDelete()
9544 if( pCell<&pLeaf->aData[4] ) return SQLITE_CORRUPT_BKPT; in sqlite3BtreeDelete()
9545 nCell = pLeaf->xCellSize(pLeaf, pCell); in sqlite3BtreeDelete()
9551 insertCell(pPage, iCellIdx, pCell-4, nCell+4, pTmp, n, &rc); in sqlite3BtreeDelete()
9791 unsigned char *pCell; in clearDatabasePage() local
9810 pCell = findCell(pPage, i); in clearDatabasePage()
9812 rc = clearDatabasePage(pBt, get4byte(pCell), 1, pnChange); in clearDatabasePage()
9815 BTREE_CLEAR_CELL(rc, pPage, pCell, info); in clearDatabasePage()
10406 u8 *pCell; /* Cell content */ in checkTreePage() local
10501 pCell = &data[pc]; in checkTreePage()
10502 pPage->xParseCell(pPage, pCell, &info); in checkTreePage()
10524 pgnoOvfl = get4byte(&pCell[info.nSize - 4]); in checkTreePage()
10535 pgno = get4byte(pCell); in checkTreePage()