Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch tree-testing Excluding Merge-Ins
This is equivalent to a diff from c74c07cc86 to f7ad73c495
2021-09-16
| ||
05:39 | Mark various unreachable branches in rtree.c with ALWAYS() or NEVER(). (check-in: 4fab908986 user: drh tags: trunk) | |
05:24 | New ALWAYS() and assert() to mark unreachable branches in rtree.c. (Closed-Leaf check-in: f7ad73c495 user: drh tags: tree-testing) | |
2021-09-15
| ||
19:53 | In rtree.c, remove an incorrect ALWAYS(). Add other ALWAYS() and NEVER(). (check-in: cbaac8878a user: drh tags: tree-testing) | |
19:13 | Add more ALWAYS() macros on unreachable branches in rtree.c (check-in: fbba89dac9 user: drh tags: tree-testing) | |
16:20 | Fix the xBestIndex method on rtree so that it correctly recognizes that rowid=? works the same as id=?. (check-in: c74c07cc86 user: drh tags: trunk) | |
15:56 | Add ALWAYS() macros on some unreachable branches in rtree. (check-in: 9123f680ae user: drh tags: trunk) | |
Changes to ext/rtree/rtree.c.
︙ | |||
1687 1688 1689 1690 1691 1692 1693 | 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 | - + - + | ** Rtree virtual table module xRowid method. */ static int rtreeRowid(sqlite3_vtab_cursor *pVtabCursor, sqlite_int64 *pRowid){ RtreeCursor *pCsr = (RtreeCursor *)pVtabCursor; RtreeSearchPoint *p = rtreeSearchPointFirst(pCsr); int rc = SQLITE_OK; RtreeNode *pNode = rtreeNodeOfFirstSearchPoint(pCsr, &rc); |
︙ | |||
2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 | 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 | + + + + + + - + + | static int AdjustTree( Rtree *pRtree, /* Rtree table */ RtreeNode *pNode, /* Adjust ancestry of this node. */ RtreeCell *pCell /* This cell was just inserted */ ){ RtreeNode *p = pNode; int cnt = 0; int rc; while( p->pParent ){ RtreeNode *pParent = p->pParent; RtreeCell cell; int iCell; cnt++; if( NEVER(cnt>100) ){ RTREE_IS_CORRUPT(pRtree); return SQLITE_CORRUPT_VTAB; } |
︙ | |||
2624 2625 2626 2627 2628 2629 2630 | 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 | - + + - + | if( rc!=SQLITE_OK ){ goto splitnode_out; } }else{ RtreeNode *pParent = pLeft->pParent; int iCell; rc = nodeParentIndex(pRtree, pLeft, &iCell); |
︙ | |||
2703 2704 2705 2706 2707 2708 2709 | 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 | - + | /* Before setting pChild->pParent, test that we are not creating a ** loop of references (as we would if, say, pChild==pParent). We don't ** want to do this as it leads to a memory leak when trying to delete ** the referenced counted node structures. */ iNode = sqlite3_column_int64(pRtree->pReadParent, 0); for(pTest=pLeaf; pTest && pTest->iNode!=iNode; pTest=pTest->pParent); |
︙ | |||
2730 2731 2732 2733 2734 2735 2736 | 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 | - + + - + | RtreeNode *pParent = 0; int iCell; assert( pNode->nRef==1 ); /* Remove the entry in the parent cell. */ rc = nodeParentIndex(pRtree, pNode, &iCell); |
︙ | |||
2956 2957 2958 2959 2960 2961 2962 | 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 | - + | rc = SplitNode(pRtree, pNode, pCell, iHeight); }else{ pRtree->iReinsertHeight = iHeight; rc = Reinsert(pRtree, pNode, pCell, iHeight); } }else{ rc = AdjustTree(pRtree, pNode, pCell); |
︙ |