• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/sqlite-3.6.22/

Lines Matching defs:pRtree

107408 ** formatted as a double. This macro assumes that local variable pRtree points
107412 (pRtree->eCoordType==RTREE_COORD_REAL32) ? \
107550 static void nodeZero(Rtree *pRtree, RtreeNode *p){
107552 memset(&p->zData[2], 0, pRtree->iNodeSize-2);
107572 static RtreeNode *nodeHashLookup(Rtree *pRtree, i64 iNode){
107575 for(p=pRtree->aHash[nodeHash(iNode)]; p && p->iNode!=iNode; p=p->pNext);
107582 static void nodeHashInsert(Rtree *pRtree, RtreeNode *pNode){
107587 pNode->pNext = pRtree->aHash[iHash];
107588 pRtree->aHash[iHash] = pNode;
107595 static void nodeHashDelete(Rtree *pRtree, RtreeNode *pNode){
107598 pp = &pRtree->aHash[nodeHash(pNode->iNode)];
107611 static RtreeNode *nodeNew(Rtree *pRtree, RtreeNode *pParent, int zero){
107613 pNode = (RtreeNode *)sqlite3_malloc(sizeof(RtreeNode) + pRtree->iNodeSize);
107615 memset(pNode, 0, sizeof(RtreeNode) + (zero?pRtree->iNodeSize:0));
107630 Rtree *pRtree, /* R-tree structure */
107641 if( (pNode = nodeHashLookup(pRtree, iNode)) ){
107652 pNode = (RtreeNode *)sqlite3_malloc(sizeof(RtreeNode) + pRtree->iNodeSize);
107664 sqlite3_bind_int64(pRtree->pReadNode, 1, iNode);
107665 rc = sqlite3_step(pRtree->pReadNode);
107667 const u8 *zBlob = sqlite3_column_blob(pRtree->pReadNode, 0);
107668 memcpy(pNode->zData, zBlob, pRtree->iNodeSize);
107676 rc = sqlite3_reset(pRtree->pReadNode);
107679 pRtree->iDepth = readInt16(pNode->zData);
107683 nodeHashInsert(pRtree, pNode);
107692 Rtree *pRtree,
107698 u8 *p = &pNode->zData[4 + pRtree->nBytesPerCell*iCell];
107700 for(ii=0; ii<(pRtree->nDim*2); ii++){
107709 static void nodeDeleteCell(Rtree *pRtree, RtreeNode *pNode, int iCell){
107710 u8 *pDst = &pNode->zData[4 + pRtree->nBytesPerCell*iCell];
107711 u8 *pSrc = &pDst[pRtree->nBytesPerCell];
107712 int nByte = (NCELL(pNode) - iCell - 1) * pRtree->nBytesPerCell;
107726 Rtree *pRtree,
107733 nMaxCell = (pRtree->iNodeSize-4)/pRtree->nBytesPerCell;
107739 nodeOverwriteCell(pRtree, pNode, pCell, nCell);
107751 nodeWrite(Rtree *pRtree, RtreeNode *pNode){
107754 sqlite3_stmt *p = pRtree->pWriteNode;
107760 sqlite3_bind_blob(p, 2, pNode->zData, pRtree->iNodeSize, SQLITE_STATIC);
107765 pNode->iNode = sqlite3_last_insert_rowid(pRtree->db);
107766 nodeHashInsert(pRtree, pNode);
107777 nodeRelease(Rtree *pRtree, RtreeNode *pNode){
107784 pRtree->iDepth = -1;
107787 rc = nodeRelease(pRtree, pNode->pParent);
107790 rc = nodeWrite(pRtree, pNode);
107792 nodeHashDelete(pRtree, pNode);
107805 Rtree *pRtree,
107810 return readInt64(&pNode->zData[4 + pRtree->nBytesPerCell*iCell]);
107817 Rtree *pRtree,
107823 readCoord(&pNode->zData[12 + pRtree->nBytesPerCell*iCell + 4*iCoord], pCoord);
107831 Rtree *pRtree,
107837 pCell->iRowid = nodeGetRowid(pRtree, pNode, iCell);
107838 for(ii=0; ii<pRtree->nDim*2; ii++){
107839 nodeGetCoord(pRtree, pNode, iCell, ii, &pCell->aCoord[ii]);
107880 static void rtreeReference(Rtree *pRtree){
107881 pRtree->nBusy++;
107888 static void rtreeRelease(Rtree *pRtree){
107889 pRtree->nBusy--;
107890 if( pRtree->nBusy==0 ){
107891 sqlite3_finalize(pRtree->pReadNode);
107892 sqlite3_finalize(pRtree->pWriteNode);
107893 sqlite3_finalize(pRtree->pDeleteNode);
107894 sqlite3_finalize(pRtree->pReadRowid);
107895 sqlite3_finalize(pRtree->pWriteRowid);
107896 sqlite3_finalize(pRtree->pDeleteRowid);
107897 sqlite3_finalize(pRtree->pReadParent);
107898 sqlite3_finalize(pRtree->pWriteParent);
107899 sqlite3_finalize(pRtree->pDeleteParent);
107900 sqlite3_free(pRtree);
107916 Rtree *pRtree = (Rtree *)pVtab;
107922 pRtree->zDb, pRtree->zName,
107923 pRtree->zDb, pRtree->zName,
107924 pRtree->zDb, pRtree->zName
107929 rc = sqlite3_exec(pRtree->db, zCreate, 0, 0, 0);
107933 rtreeRelease(pRtree);
107961 Rtree *pRtree = (Rtree *)(cur->pVtab);
107965 rc = nodeRelease(pRtree, pCsr->pNode);
107987 static int testRtreeCell(Rtree *pRtree, RtreeCursor *pCursor){
107992 nodeGetCell(pRtree, pCursor->pNode, pCursor->iCell, &cell);
108021 static int testRtreeEntry(Rtree *pRtree, RtreeCursor *pCursor){
108025 nodeGetCell(pRtree, pCursor->pNode, pCursor->iCell, &cell);
108054 Rtree *pRtree,
108071 isEof = testRtreeEntry(pRtree, pCursor);
108073 isEof = testRtreeCell(pRtree, pCursor);
108080 iRowid = nodeGetRowid(pRtree, pCursor->pNode, pCursor->iCell);
108081 rc = nodeAcquire(pRtree, iRowid, pCursor->pNode, &pChild);
108086 nodeRelease(pRtree, pCursor->pNode);
108091 rc = descendToCell(pRtree, pCursor, iHeight-1, &isEof);
108100 nodeRelease(pRtree, pChild);
108113 static int nodeRowidIndex(Rtree *pRtree, RtreeNode *pNode, i64 iRowid){
108115 for(ii=0; nodeGetRowid(pRtree, pNode, ii)!=iRowid; ii++){
108125 static int nodeParentIndex(Rtree *pRtree, RtreeNode *pNode){
108128 return nodeRowidIndex(pRtree, pParent, pNode->iNode);
108137 Rtree *pRtree = (Rtree *)(pVtabCursor->pVtab);
108143 nodeRelease(pRtree, pCsr->pNode);
108155 rc = descendToCell(pRtree, pCsr, iHeight, &isEof);
108161 pCsr->iCell = nodeParentIndex(pRtree, pNode);
108163 nodeRelease(pRtree, pNode);
108175 Rtree *pRtree = (Rtree *)pVtabCursor->pVtab;
108179 *pRowid = nodeGetRowid(pRtree, pCsr->pNode, pCsr->iCell);
108188 Rtree *pRtree = (Rtree *)cur->pVtab;
108192 i64 iRowid = nodeGetRowid(pRtree, pCsr->pNode, pCsr->iCell);
108196 nodeGetCoord(pRtree, pCsr->pNode, pCsr->iCell, i-1, &c);
108197 if( pRtree->eCoordType==RTREE_COORD_REAL32 ){
108200 assert( pRtree->eCoordType==RTREE_COORD_INT32 );
108215 static int findLeafNode(Rtree *pRtree, i64 iRowid, RtreeNode **ppLeaf){
108218 sqlite3_bind_int64(pRtree->pReadRowid, 1, iRowid);
108219 if( sqlite3_step(pRtree->pReadRowid)==SQLITE_ROW ){
108220 i64 iNode = sqlite3_column_int64(pRtree->pReadRowid, 0);
108221 rc = nodeAcquire(pRtree, iNode, 0, ppLeaf);
108222 sqlite3_reset(pRtree->pReadRowid);
108224 rc = sqlite3_reset(pRtree->pReadRowid);
108238 Rtree *pRtree = (Rtree *)pVtabCursor->pVtab;
108245 rtreeReference(pRtree);
108255 rc = findLeafNode(pRtree, iRowid, &pLeaf);
108258 pCsr->iCell = nodeRowidIndex(pRtree, pLeaf, iRowid);
108282 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
108290 rc = descendToCell(pRtree, pCsr, pRtree->iDepth, &isEof);
108297 nodeRelease(pRtree, pRoot);
108304 rtreeRelease(pRtree);
108432 static float cellArea(Rtree *pRtree, RtreeCell *p){
108435 for(ii=0; ii<(pRtree->nDim*2); ii+=2){
108445 static float cellMargin(Rtree *pRtree, RtreeCell *p){
108448 for(ii=0; ii<(pRtree->nDim*2); ii+=2){
108457 static void cellUnion(Rtree *pRtree, RtreeCell *p1, RtreeCell *p2){
108459 if( pRtree->eCoordType==RTREE_COORD_REAL32 ){
108460 for(ii=0; ii<(pRtree->nDim*2); ii+=2){
108465 for(ii=0; ii<(pRtree->nDim*2); ii+=2){
108476 static int cellContains(Rtree *pRtree, RtreeCell *p1, RtreeCell *p2){
108478 int isInt = (pRtree->eCoordType==RTREE_COORD_INT32);
108479 for(ii=0; ii<(pRtree->nDim*2); ii+=2){
108494 static float cellGrowth(Rtree *pRtree, RtreeCell *p, RtreeCell *pCell){
108498 area = cellArea(pRtree, &cell);
108499 cellUnion(pRtree, &cell, pCell);
108500 return (cellArea(pRtree, &cell)-area);
108505 Rtree *pRtree,
108517 for(jj=0; jj<(pRtree->nDim*2); jj+=2){
108540 Rtree *pRtree,
108549 before = cellOverlap(pRtree, p, aCell, nCell, iExclude);
108550 cellUnion(pRtree, p, pInsert);
108551 after = cellOverlap(pRtree, p, aCell, nCell, iExclude);
108562 Rtree *pRtree, /* Rtree table */
108570 rc = nodeAcquire(pRtree, 1, 0, &pNode);
108572 for(ii=0; rc==SQLITE_OK && ii<(pRtree->iDepth-iHeight); ii++){
108587 if( ii==(pRtree->iDepth-1) ){
108592 nodeRelease(pRtree, pNode);
108597 nodeGetCell(pRtree, pNode, jj, &aCell[jj]);
108610 nodeGetCell(pRtree, pNode, iCell, &cell);
108611 growth = cellGrowth(pRtree, &cell, pCell);
108612 area = cellArea(pRtree, &cell);
108614 if( ii==(pRtree->iDepth-1) ){
108615 overlap = cellOverlapEnlargement(pRtree,&cell,pCell,aCell,nCell,iCell);
108631 rc = nodeAcquire(pRtree, iBest, pNode, &pChild);
108632 nodeRelease(pRtree, pNode);
108646 Rtree *pRtree, /* Rtree table */
108654 int iCell = nodeParentIndex(pRtree, p);
108656 nodeGetCell(pRtree, pParent, iCell, &cell);
108657 if( !cellContains(pRtree, &cell, pCell) ){
108658 cellUnion(pRtree, &cell, pCell);
108659 nodeOverwriteCell(pRtree, pParent, &cell, iCell);
108669 static int rowidWrite(Rtree *pRtree, sqlite3_int64 iRowid, sqlite3_int64 iNode){
108670 sqlite3_bind_int64(pRtree->pWriteRowid, 1, iRowid);
108671 sqlite3_bind_int64(pRtree->pWriteRowid, 2, iNode);
108672 sqlite3_step(pRtree->pWriteRowid);
108673 return sqlite3_reset(pRtree->pWriteRowid);
108679 static int parentWrite(Rtree *pRtree, sqlite3_int64 iNode, sqlite3_int64 iPar){
108680 sqlite3_bind_int64(pRtree->pWriteParent, 1, iNode);
108681 sqlite3_bind_int64(pRtree->pWriteParent, 2, iPar);
108682 sqlite3_step(pRtree->pWriteParent);
108683 return sqlite3_reset(pRtree->pWriteParent);
108694 Rtree *pRtree,
108712 Rtree *pRtree,
108728 for(i=0; i<pRtree->nDim; i++){
108774 Rtree *pRtree,
108788 float left = cellGrowth(pRtree, pLeftBox, &aCell[ii]);
108789 float right = cellGrowth(pRtree, pLeftBox, &aCell[ii]);
108806 Rtree *pRtree,
108821 float right = cellArea(pRtree, &aCell[jj]);
108822 float growth = cellGrowth(pRtree, &aCell[ii], &aCell[jj]);
108922 Rtree *pRtree,
108939 SortByDimension(pRtree, aLeft, nLeft, iDim, aCell, aSpare);
108940 SortByDimension(pRtree, aRight, nRight, iDim, aCell, aSpare);
108982 Rtree *pRtree,
108998 int nByte = (pRtree->nDim+1)*(sizeof(int*)+nCell*sizeof(int));
109005 aSpare = &((int *)&aaSorted[pRtree->nDim])[pRtree->nDim*nCell];
109007 for(ii=0; ii<pRtree->nDim; ii++){
109009 aaSorted[ii] = &((int *)&aaSorted[pRtree->nDim])[ii*nCell];
109013 SortByDimension(pRtree, aaSorted[ii], nCell, ii, aCell, aSpare);
109016 for(ii=0; ii<pRtree->nDim; ii++){
109024 nLeft=RTREE_MINCELLS(pRtree);
109025 nLeft<=(nCell-RTREE_MINCELLS(pRtree));
109038 cellUnion(pRtree, &left, &aCell[aaSorted[ii][kk]]);
109040 cellUnion(pRtree, &right, &aCell[aaSorted[ii][kk]]);
109043 margin += cellMargin(pRtree, &left);
109044 margin += cellMargin(pRtree, &right);
109045 overlap = cellOverlap(pRtree, &left, &right, 1, -1);
109046 area = cellArea(pRtree, &left) + cellArea(pRtree, &right);
109047 if( (nLeft==RTREE_MINCELLS(pRtree))
109070 nodeInsertCell(pRtree, pTarget, pCell);
109071 cellUnion(pRtree, pBbox, pCell);
109084 Rtree *pRtree,
109103 PickSeeds(pRtree, aCell, nCell, &iLeftSeed, &iRightSeed);
109107 nodeInsertCell(pRtree, pLeft, &aCell[iLeftSeed]);
109108 nodeInsertCell(pRtree, pRight, &aCell[iRightSeed]);
109114 pNext = PickNext(pRtree, aCell, nCell, pBboxLeft, pBboxRight, aiUsed);
109116 cellGrowth(pRtree, pBboxLeft, pNext) -
109117 cellGrowth(pRtree, pBboxRight, pNext)
109119 if( (RTREE_MINCELLS(pRtree)-NCELL(pRight)==i)
109120 || (diff>0.0 && (RTREE_MINCELLS(pRtree)-NCELL(pLeft)!=i))
109122 nodeInsertCell(pRtree, pRight, pNext);
109123 cellUnion(pRtree, pBboxRight, pNext);
109125 nodeInsertCell(pRtree, pLeft, pNext);
109126 cellUnion(pRtree, pBboxLeft, pNext);
109136 Rtree *pRtree,
109144 RtreeNode *pChild = nodeHashLookup(pRtree, iRowid);
109146 nodeRelease(pRtree, pChild->pParent);
109151 return xSetMapping(pRtree, iRowid, pNode->iNode);
109155 Rtree *pRtree,
109185 nodeGetCell(pRtree, pNode, i, &aCell[i]);
109187 nodeZero(pRtree, pNode);
109192 pRight = nodeNew(pRtree, pNode, 1);
109193 pLeft = nodeNew(pRtree, pNode, 1);
109194 pRtree->iDepth++;
109196 writeInt16(pNode->zData, pRtree->iDepth);
109199 pRight = nodeNew(pRtree, pLeft->pParent, 1);
109208 memset(pLeft->zData, 0, pRtree->iNodeSize);
109209 memset(pRight->zData, 0, pRtree->iNodeSize);
109211 rc = AssignCells(pRtree, aCell, nCell, pLeft, pRight, &leftbbox, &rightbbox);
109217 if( (0==pRight->iNode && SQLITE_OK!=(rc = nodeWrite(pRtree, pRight)))
109218 || (0==pLeft->iNode && SQLITE_OK!=(rc = nodeWrite(pRtree, pLeft)))
109227 rc = rtreeInsertCell(pRtree, pLeft->pParent, &leftbbox, iHeight+1);
109233 int iCell = nodeParentIndex(pRtree, pLeft);
109234 nodeOverwriteCell(pRtree, pParent, &leftbbox, iCell);
109235 AdjustTree(pRtree, pParent, &leftbbox);
109237 if( (rc = rtreeInsertCell(pRtree, pRight->pParent, &rightbbox, iHeight+1)) ){
109242 i64 iRowid = nodeGetRowid(pRtree, pRight, i);
109243 rc = updateMapping(pRtree, iRowid, pRight, iHeight);
109253 i64 iRowid = nodeGetRowid(pRtree, pLeft, i);
109254 rc = updateMapping(pRtree, iRowid, pLeft, iHeight);
109260 rc = updateMapping(pRtree, pCell->iRowid, pLeft, iHeight);
109264 rc = nodeRelease(pRtree, pRight);
109268 rc = nodeRelease(pRtree, pLeft);
109273 nodeRelease(pRtree, pRight);
109274 nodeRelease(pRtree, pLeft);
109279 static int fixLeafParent(Rtree *pRtree, RtreeNode *pLeaf){
109282 sqlite3_bind_int64(pRtree->pReadParent, 1, pLeaf->iNode);
109283 if( sqlite3_step(pRtree->pReadParent)==SQLITE_ROW ){
109284 i64 iNode = sqlite3_column_int64(pRtree->pReadParent, 0);
109285 rc = nodeAcquire(pRtree, iNode, 0, &pLeaf->pParent);
109289 sqlite3_reset(pRtree->pReadParent);
109291 rc = fixLeafParent(pRtree, pLeaf->pParent);
109299 static int removeNode(Rtree *pRtree, RtreeNode *pNode, int iHeight){
109307 iCell = nodeParentIndex(pRtree, pNode);
109310 if( SQLITE_OK!=(rc = deleteCell(pRtree, pParent, iCell, iHeight+1))
109311 || SQLITE_OK!=(rc = nodeRelease(pRtree, pParent))
109317 sqlite3_bind_int64(pRtree->pDeleteNode, 1, pNode->iNode);
109318 sqlite3_step(pRtree->pDeleteNode);
109319 if( SQLITE_OK!=(rc = sqlite3_reset(pRtree->pDeleteNode)) ){
109324 sqlite3_bind_int64(pRtree->pDeleteParent, 1, pNode->iNode);
109325 sqlite3_step(pRtree->pDeleteParent);
109326 if( SQLITE_OK!=(rc = sqlite3_reset(pRtree->pDeleteParent)) ){
109333 nodeHashDelete(pRtree, pNode);
109335 pNode->pNext = pRtree->pDeleted;
109337 pRtree->pDeleted = pNode;
109342 static void fixBoundingBox(Rtree *pRtree, RtreeNode *pNode){
109348 nodeGetCell(pRtree, pNode, 0, &box);
109351 nodeGetCell(pRtree, pNode, ii, &cell);
109352 cellUnion(pRtree, &box, &cell);
109355 ii = nodeParentIndex(pRtree, pNode);
109356 nodeOverwriteCell(pRtree, pParent, &box, ii);
109357 fixBoundingBox(pRtree, pParent);
109365 static int deleteCell(Rtree *pRtree, RtreeNode *pNode, int iCell, int iHeight){
109368 if( SQLITE_OK!=(rc = fixLeafParent(pRtree, pNode)) ){
109375 nodeDeleteCell(pRtree, pNode, iCell);
109385 && (NCELL(pNode)<RTREE_MINCELLS(pRtree))
109387 rc = removeNode(pRtree, pNode, iHeight);
109389 fixBoundingBox(pRtree, pNode);
109397 Rtree *pRtree,
109436 nodeGetCell(pRtree, pNode, ii, &aCell[ii]);
109439 for(iDim=0; iDim<pRtree->nDim; iDim++){
109444 for(iDim=0; iDim<pRtree->nDim; iDim++){
109450 for(iDim=0; iDim<pRtree->nDim; iDim++){
109458 nodeZero(pRtree, pNode);
109460 for(ii=0; rc==SQLITE_OK && ii<(nCell-(RTREE_MINCELLS(pRtree)+1)); ii++){
109462 nodeInsertCell(pRtree, pNode, p);
109465 rc = rowidWrite(pRtree, p->iRowid, pNode->iNode);
109467 rc = parentWrite(pRtree, p->iRowid, pNode->iNode);
109472 fixBoundingBox(pRtree, pNode);
109480 rc = ChooseLeaf(pRtree, p, iHeight, &pInsert);
109483 rc = rtreeInsertCell(pRtree, pInsert, p, iHeight);
109484 rc2 = nodeRelease(pRtree, pInsert);
109500 Rtree *pRtree,
109507 RtreeNode *pChild = nodeHashLookup(pRtree, pCell->iRowid);
109509 nodeRelease(pRtree, pChild->pParent);
109514 if( nodeInsertCell(pRtree, pNode, pCell) ){
109516 if( iHeight<=pRtree->iReinsertHeight || pNode->iNode==1){
109517 rc = SplitNode(pRtree, pNode, pCell, iHeight);
109519 pRtree->iReinsertHeight = iHeight;
109520 rc = Reinsert(pRtree, pNode, pCell, iHeight);
109523 rc = SplitNode(pRtree, pNode, pCell, iHeight);
109526 AdjustTree(pRtree, pNode, pCell);
109528 rc = rowidWrite(pRtree, pCell->iRowid, pNode->iNode);
109530 rc = parentWrite(pRtree, pCell->iRowid, pNode->iNode);
109536 static int reinsertNodeContent(Rtree *pRtree, RtreeNode *pNode){
109544 nodeGetCell(pRtree, pNode, ii, &cell);
109549 rc = ChooseLeaf(pRtree, &cell, pNode->iNode, &pInsert);
109552 rc = rtreeInsertCell(pRtree, pInsert, &cell, pNode->iNode);
109553 rc2 = nodeRelease(pRtree, pInsert);
109565 static int newRowid(Rtree *pRtree, i64 *piRowid){
109567 sqlite3_bind_null(pRtree->pWriteRowid, 1);
109568 sqlite3_bind_null(pRtree->pWriteRowid, 2);
109569 sqlite3_step(pRtree->pWriteRowid);
109570 rc = sqlite3_reset(pRtree->pWriteRowid);
109571 *piRowid = sqlite3_last_insert_rowid(pRtree->db);
109576 static int hashIsEmpty(Rtree *pRtree){
109579 assert( !pRtree->aHash[ii] );
109594 Rtree *pRtree = (Rtree *)pVtab;
109597 rtreeReference(pRtree);
109600 assert(hashIsEmpty(pRtree));
109613 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
109620 rc = findLeafNode(pRtree, iDelete, &pLeaf);
109626 iCell = nodeRowidIndex(pRtree, pLeaf, iDelete);
109627 rc = deleteCell(pRtree, pLeaf, iCell, 0);
109628 rc2 = nodeRelease(pRtree, pLeaf);
109636 sqlite3_bind_int64(pRtree->pDeleteRowid, 1, iDelete);
109637 sqlite3_step(pRtree->pDeleteRowid);
109638 rc = sqlite3_reset(pRtree->pDeleteRowid);
109649 if( rc==SQLITE_OK && pRtree->iDepth>0 ){
109652 i64 iChild = nodeGetRowid(pRtree, pRoot, 0);
109653 rc = nodeAcquire(pRtree, iChild, pRoot, &pChild);
109655 rc = removeNode(pRtree, pChild, pRtree->iDepth-1);
109658 pRtree->iDepth--;
109659 writeInt16(pRoot->zData, pRtree->iDepth);
109666 for(pLeaf=pRtree->pDeleted; pLeaf; pLeaf=pRtree->pDeleted){
109668 rc = reinsertNodeContent(pRtree, pLeaf);
109670 pRtree->pDeleted = pLeaf->pNext;
109676 rc = nodeRelease(pRtree, pRoot);
109678 nodeRelease(pRtree, pRoot);
109693 assert( nData==(pRtree->nDim*2 + 3) );
109694 if( pRtree->eCoordType==RTREE_COORD_REAL32 ){
109695 for(ii=0; ii<(pRtree->nDim*2); ii+=2){
109704 for(ii=0; ii<(pRtree->nDim*2); ii+=2){
109716 rc = newRowid(pRtree, &cell.iRowid);
109719 sqlite3_bind_int64(pRtree->pReadRowid, 1, cell.iRowid);
109720 if( SQLITE_ROW==sqlite3_step(pRtree->pReadRowid) ){
109721 sqlite3_reset(pRtree->pReadRowid);
109725 rc = sqlite3_reset(pRtree->pReadRowid);
109729 rc = ChooseLeaf(pRtree, &cell, 0, &pLeaf);
109733 pRtree->iReinsertHeight = -1;
109734 rc = rtreeInsertCell(pRtree, pLeaf, &cell, 0);
109735 rc2 = nodeRelease(pRtree, pLeaf);
109743 rtreeRelease(pRtree);
109751 Rtree *pRtree = (Rtree *)pVtab;
109757 , pRtree->zDb, pRtree->zName, zNewName
109758 , pRtree->zDb, pRtree->zName, zNewName
109759 , pRtree->zDb, pRtree->zName, zNewName
109762 rc = sqlite3_exec(pRtree->db, zSql, 0, 0, 0);
109792 Rtree *pRtree,
109820 pRtree->db = db;
109828 zDb, zPrefix, zDb, zPrefix, zDb, zPrefix, zDb, zPrefix, pRtree->iNodeSize
109840 appStmt[0] = &pRtree->pReadNode;
109841 appStmt[1] = &pRtree->pWriteNode;
109842 appStmt[2] = &pRtree->pDeleteNode;
109843 appStmt[3] = &pRtree->pReadRowid;
109844 appStmt[4] = &pRtree->pWriteRowid;
109845 appStmt[5] = &pRtree->pDeleteRowid;
109846 appStmt[6] = &pRtree->pReadParent;
109847 appStmt[7] = &pRtree->pWriteParent;
109848 appStmt[8] = &pRtree->pDeleteParent;
109910 Rtree *pRtree;
109936 pRtree = (Rtree *)sqlite3_malloc(sizeof(Rtree)+nDb+nName+2);
109937 if( !pRtree ){
109940 memset(pRtree, 0, sizeof(Rtree)+nDb+nName+2);
109941 pRtree->nBusy = 1;
109942 pRtree->base.pModule = &rtreeModule;
109943 pRtree->zDb = (char *)&pRtree[1];
109944 pRtree->zName = &pRtree->zDb[nDb+1];
109945 pRtree->nDim = (argc-4)/2;
109946 pRtree->nBytesPerCell = 8 + pRtree->nDim*4*2;
109947 pRtree->eCoordType = eCoordType;
109948 memcpy(pRtree->zDb, argv[1], nDb);
109949 memcpy(pRtree->zName, argv[2], nName);
109958 pRtree->iNodeSize = iPageSize-64;
109959 if( (4+pRtree->nBytesPerCell*RTREE_MAXCELLS)<pRtree->iNodeSize ){
109960 pRtree->iNodeSize = 4+pRtree->nBytesPerCell*RTREE_MAXCELLS;
109967 if( (rc = rtreeSqlInit(pRtree, db, argv[1], argv[2], isCreate)) ){
109992 *ppVtab = (sqlite3_vtab *)pRtree;
109994 rtreeRelease(pRtree);