From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Fujii Masao <fujii(dot)masao(at)oss(dot)ntt(dot)co(dot)jp> |
Cc: | pgsql-patches(at)postgresql(dot)org |
Subject: | Re: Replace offnum++ by OffsetNumberNext |
Date: | 2008-05-13 15:46:14 |
Message-ID: | 200805131546.m4DFkEB03832@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-patches
--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Dunstan | 2008-05-13 16:05:58 | Re: odd output in restore mode |
Previous Message | Tom Lane | 2008-05-13 15:36:57 | Re: Making sure \timing is on |