Unix Technical Forum

Re: Replace offnum++ by OffsetNumberNext

This is a discussion on Re: Replace offnum++ by OffsetNumberNext within the Pgsql Patches forums, part of the PostgreSQL category; --> Patch applied. Thanks. --------------------------------------------------------------------------- Fujii Masao wrote: > This is the patch replace offnum++ by OffsetNumberNext. > > According ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-13-2008, 06:16 PM
Bruce Momjian
 
Posts: n/a
Default Re: Replace offnum++ by OffsetNumberNext


Patch applied. Thanks.

---------------------------------------------------------------------------


Fujii Masao wrote:
> This is the patch replace offnum++ by OffsetNumberNext.
>
> According to off.h, OffsetNumberNext is the macro prepared to
> disambiguate the different manipulations on OffsetNumbers.
> But, increment operator was used in some places instead of the macro.
>
> --
> Fujii Masao
> NIPPON TELEGRAPH AND TELEPHONE CORPORATION
> NTT Open Source Software Center
> TEL (03)5860-5115
> FAX (03)5463-5490


> ? patch.diff
> Index: src/backend/access/heap/pruneheap.c
> ================================================== =================
> RCS file: /projects/cvsroot/pgsql/src/backend/access/heap/pruneheap.c,v
> retrieving revision 1.9
> diff -c -r1.9 pruneheap.c
> *** src/backend/access/heap/pruneheap.c 26 Mar 2008 21:10:37 -0000 1.9
> --- src/backend/access/heap/pruneheap.c 4 Apr 2008 14:34:19 -0000
> ***************
> *** 789,795 ****
> MemSet(root_offsets, 0, MaxHeapTuplesPerPage * sizeof(OffsetNumber));
>
> maxoff = PageGetMaxOffsetNumber(page);
> ! for (offnum = FirstOffsetNumber; offnum <= maxoff; offnum++)
> {
> ItemId lp = PageGetItemId(page, offnum);
> HeapTupleHeader htup;
> --- 789,795 ----
> MemSet(root_offsets, 0, MaxHeapTuplesPerPage * sizeof(OffsetNumber));
>
> maxoff = PageGetMaxOffsetNumber(page);
> ! for (offnum = FirstOffsetNumber; offnum <= maxoff; offnum = OffsetNumberNext(offnum))
> {
> ItemId lp = PageGetItemId(page, offnum);
> HeapTupleHeader htup;
> Index: src/backend/executor/nodeBitmapHeapscan.c
> ================================================== =================
> RCS file: /projects/cvsroot/pgsql/src/backend/executor/nodeBitmapHeapscan.c,v
> retrieving revision 1.25
> diff -c -r1.25 nodeBitmapHeapscan.c
> *** src/backend/executor/nodeBitmapHeapscan.c 26 Mar 2008 21:10:38 -0000 1.25
> --- src/backend/executor/nodeBitmapHeapscan.c 4 Apr 2008 14:34:19 -0000
> ***************
> *** 301,307 ****
> OffsetNumber maxoff = PageGetMaxOffsetNumber(dp);
> OffsetNumber offnum;
>
> ! for (offnum = FirstOffsetNumber; offnum <= maxoff; offnum++)
> {
> ItemId lp;
> HeapTupleData loctup;
> --- 301,307 ----
> OffsetNumber maxoff = PageGetMaxOffsetNumber(dp);
> OffsetNumber offnum;
>
> ! for (offnum = FirstOffsetNumber; offnum <= maxoff; offnum = OffsetNumberNext(offnum))
> {
> ItemId lp;
> HeapTupleData loctup;
> Index: src/backend/storage/page/bufpage.c
> ================================================== =================
> RCS file: /projects/cvsroot/pgsql/src/backend/storage/page/bufpage.c,v
> retrieving revision 1.78
> diff -c -r1.78 bufpage.c
> *** src/backend/storage/page/bufpage.c 10 Feb 2008 20:39:08 -0000 1.78
> --- src/backend/storage/page/bufpage.c 4 Apr 2008 14:34:19 -0000
> ***************
> *** 533,539 ****
> * Since this is just a hint, we must confirm that there is
> * indeed a free line pointer
> */
> ! for (offnum = FirstOffsetNumber; offnum <= nline; offnum++)
> {
> ItemId lp = PageGetItemId(page, offnum);
>
> --- 533,539 ----
> * Since this is just a hint, we must confirm that there is
> * indeed a free line pointer
> */
> ! for (offnum = FirstOffsetNumber; offnum <= nline; offnum = OffsetNumberNext(offnum))
> {
> ItemId lp = PageGetItemId(page, offnum);
>
> ***************
> *** 736,742 ****
> totallen = 0;
> nused = 0;
> nextitm = 0;
> ! for (offnum = 1; offnum <= nline; offnum++)
> {
> lp = PageGetItemId(page, offnum);
> Assert(ItemIdHasStorage(lp));
> --- 736,742 ----
> totallen = 0;
> nused = 0;
> nextitm = 0;
> ! for (offnum = FirstOffsetNumber; offnum <= nline; offnum = OffsetNumberNext(offnum))
> {
> lp = PageGetItemId(page, offnum);
> Assert(ItemIdHasStorage(lp));
>
>
> --
> Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-patches


--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

--
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:01 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com