Skip to content

Commit ce0fb50

Browse files
committed
Make the system-attributes loop in AddNewAttributeTuples depend on
lengthof(SysAtt) not FirstLowInvalidHeapAttributeNumber, for consistency with the other uses of the SysAtt array, and to make it clearer that it doesn't walk off the end of that array.
1 parent 5b5ee14 commit ce0fb50

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/backend/catalog/heap.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.340 2008/09/30 10:52:12 heikki Exp $
11+
* $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.341 2008/10/14 23:27:40 tgl Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -551,7 +551,7 @@ AddNewAttributeTuples(Oid new_rel_oid,
551551
if (relkind != RELKIND_VIEW && relkind != RELKIND_COMPOSITE_TYPE)
552552
{
553553
dpp = SysAtt;
554-
for (i = 0; i < -1 - FirstLowInvalidHeapAttributeNumber; i++)
554+
for (i = 0; i < (int) lengthof(SysAtt); i++, dpp++)
555555
{
556556
if (tupdesc->tdhasoid ||
557557
(*dpp)->attnum != ObjectIdAttributeNumber)
@@ -587,7 +587,6 @@ AddNewAttributeTuples(Oid new_rel_oid,
587587

588588
heap_freetuple(tup);
589589
}
590-
dpp++;
591590
}
592591
}
593592

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy