From 83c4913be174845c080c5ebb0ccf40b7f29b6773 Mon Sep 17 00:00:00 2001 From: kuriyama Date: Mon, 13 Sep 2004 22:07:24 +0000 Subject: Fix a condition where the hole would be inserted in the wrong place during a split. Obtained from: NetBSD --- lib/libc/db/btree/bt_split.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/db/btree/bt_split.c b/lib/libc/db/btree/bt_split.c index 0e478de..1dd4666 100644 --- a/lib/libc/db/btree/bt_split.c +++ b/lib/libc/db/btree/bt_split.c @@ -361,8 +361,6 @@ bt_page(t, h, lp, rp, skip, ilen) r->nextpg = h->nextpg; r->prevpg = h->pgno; r->flags = h->flags & P_TYPE; - /* XXX: Workaround for broken page data access. */ - r->linp[0] = 0xffff; /* * If we're splitting the last page on a level because we're appending @@ -728,7 +726,7 @@ bt_psplit(t, h, l, r, pskip, ilen) * the right page. */ if (skip <= off) { - skip = 0; + skip = MAX_PAGE_OFFSET; rval = l; } else { rval = r; @@ -738,7 +736,7 @@ bt_psplit(t, h, l, r, pskip, ilen) for (off = 0; nxt < top; ++off) { if (skip == nxt) { ++off; - skip = 0; + skip = MAX_PAGE_OFFSET; } switch (h->flags & P_TYPE) { case P_BINTERNAL: -- cgit v1.1