summaryrefslogtreecommitdiff
path: root/src/backend/access/nbtree/nbtsort.c
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>1997-04-16 01:48:29 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>1997-04-16 01:48:29 +0000
commit329fb11262b79a45749a8005e7a31ff178eb6d10 (patch)
tree29688f93c8cb433804684cd71318639661cd01dd /src/backend/access/nbtree/nbtsort.c
parentafd92957868ad2438910ad2db7f7719b46a2c2b9 (diff)
downloadpostgresql-329fb11262b79a45749a8005e7a31ff178eb6d10.tar.gz
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.
Diffstat (limited to 'src/backend/access/nbtree/nbtsort.c')
-rw-r--r--src/backend/access/nbtree/nbtsort.c12
1 files changed, 8 insertions, 4 deletions
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);