diff options
-rw-r--r-- | src/backend/access/nbtree/nbtinsert.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/access/nbtree/nbtinsert.c b/src/backend/access/nbtree/nbtinsert.c index 4bbcb0e10cd..39dd2840c70 100644 --- a/src/backend/access/nbtree/nbtinsert.c +++ b/src/backend/access/nbtree/nbtinsert.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.106.2.3 2006/11/01 19:50:15 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.106.2.4 2007/01/27 20:53:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1063,7 +1063,12 @@ _bt_findsplitloc(Relation rel, /* need to try it both ways! */ _bt_checksplitloc(&state, offnum, leftfree, rightfree, true, itemsz); - /* here we are contemplating newitem as first on right */ + /* + * Here we are contemplating newitem as first on right. In this + * case it, not the current item, will become the high key of the + * left page, and so we have to correct the allowance made above. + */ + leftfree += (int) itemsz - (int) newitemsz; _bt_checksplitloc(&state, offnum, leftfree, rightfree, false, newitemsz); } |