From 329fb11262b79a45749a8005e7a31ff178eb6d10 Mon Sep 17 00:00:00 2001 From: "Vadim B. Mikheev" Date: Wed, 16 Apr 1997 01:48:29 +0000 Subject: 1. BTREE_VERSION_1: using bti_itup->t_tid as unique identifier for a given index tuple (logical position within A LEVEL). bti_oid & bti_dummy taken off from BTItemData. 2. Fix for multi-column indices (nbtsearch.c): _bt_binsrch() - for searches on internal pages having keysize < number of attrs we point at the last item < the scankey, not at the first item = the scankey; _bt_moveright() - if keysize < number of attrs we compare scankey with _last_ item on current page to decide should we move right or not. --- src/backend/access/nbtree/nbtsort.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/backend/access/nbtree/nbtsort.c') diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c index 7ec926f9e2..6e382982a9 100644 --- a/src/backend/access/nbtree/nbtsort.c +++ b/src/backend/access/nbtree/nbtsort.c @@ -5,7 +5,7 @@ * * * IDENTIFICATION - * $Id: nbtsort.c,v 1.13 1997/03/24 08:48:15 vadim Exp $ + * $Id: nbtsort.c,v 1.14 1997/04/16 01:48:27 vadim Exp $ * * NOTES * @@ -1021,9 +1021,13 @@ _bt_buildadd(Relation index, void *pstate, BTItem bti, int flags) } #endif /* FASTBUILD_DEBUG && FASTBUILD_MERGE */ #endif - if (last_bti == (BTItem) NULL) { + if (last_bti == (BTItem) NULL) + { first_off = P_FIRSTKEY; - } else if (!_bt_itemcmp(index, _bt_nattr, bti, last_bti, BTEqualStrategyNumber)) { + } + else if ( !_bt_itemcmp(index, _bt_nattr, + bti, last_bti, BTEqualStrategyNumber) ) + { first_off = off; } last_off = off; @@ -1061,7 +1065,7 @@ _bt_uppershutdown(Relation index, BTPageState *state) if (s->btps_doupper) { if (s->btps_next == (BTPageState *) NULL) { opaque->btpo_flags |= BTP_ROOT; - _bt_metaproot(index, blkno); + _bt_metaproot(index, blkno, s->btps_level + 1); } else { bti = _bt_minitem(s->btps_page, blkno, 0); (void) _bt_buildadd(index, s->btps_next, bti, 0); -- cgit v1.2.1