Re: Dead code in _bt_split? - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Dead code in _bt_split?
Date
Msg-id 45C8585D.9090703@enterprisedb.com
Whole thread Raw
In response to Re: Dead code in _bt_split?  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Dead code in _bt_split?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Bruce Momjian wrote:
> Heikki Linnakangas wrote:
>> Bruce Momjian wrote:
>>> Heikki, did this code cleanup get included in your recent btree split
>>> fix?
>> No.
>
> OK, would you please send a patch to remove the unused code.  Thanks.

Ok, here you are.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com
Index: src/backend/access/nbtree/nbtinsert.c
===================================================================
RCS file: /home/hlinnaka/pgcvsrepository/pgsql/src/backend/access/nbtree/nbtinsert.c,v
retrieving revision 1.148
diff -c -r1.148 nbtinsert.c
*** src/backend/access/nbtree/nbtinsert.c    27 Jan 2007 20:53:30 -0000    1.148
--- src/backend/access/nbtree/nbtinsert.c    6 Feb 2007 10:23:26 -0000
***************
*** 855,876 ****
      /* cope with possibility that newitem goes at the end */
      if (i <= newitemoff)
      {
!         if (newitemonleft)
!         {
!             _bt_pgaddtup(rel, leftpage, newitemsz, newitem, leftoff,
!                          "left sibling");
!             itup_off = leftoff;
!             itup_blkno = BufferGetBlockNumber(buf);
!             leftoff = OffsetNumberNext(leftoff);
!         }
!         else
!         {
!             _bt_pgaddtup(rel, rightpage, newitemsz, newitem, rightoff,
!                          "right sibling");
!             itup_off = rightoff;
!             itup_blkno = BufferGetBlockNumber(rbuf);
!             rightoff = OffsetNumberNext(rightoff);
!         }
      }

      /*
--- 855,865 ----
      /* cope with possibility that newitem goes at the end */
      if (i <= newitemoff)
      {
!         _bt_pgaddtup(rel, rightpage, newitemsz, newitem, rightoff,
!                      "right sibling");
!         itup_off = rightoff;
!         itup_blkno = BufferGetBlockNumber(rbuf);
!         rightoff = OffsetNumberNext(rightoff);
      }

      /*

pgsql-hackers by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Pl/pgsql functions causing crashes in 8.2.2
Next
From: "Marko Kreen"
Date:
Subject: Re: Pl/pgsql functions causing crashes in 8.2.2