aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-10-14 23:27:40 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-10-14 23:27:40 +0000
commitce0fb501d9be8a6d5b0ed47bd036ecf21e4bc189 (patch)
tree2723e7a17e32bad3f7ca78a75155989feab569f8 /src
parent5b5ee14a4be3a981681df78a8874dd55405009a3 (diff)
downloadpostgresql-ce0fb501d9be8a6d5b0ed47bd036ecf21e4bc189.tar.gz
postgresql-ce0fb501d9be8a6d5b0ed47bd036ecf21e4bc189.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/catalog/heap.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 50a2a98bbb2..478eb045c09 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.340 2008/09/30 10:52:12 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/heap.c,v 1.341 2008/10/14 23:27:40 tgl Exp $
*
*
* INTERFACE ROUTINES
@@ -551,7 +551,7 @@ AddNewAttributeTuples(Oid new_rel_oid,
if (relkind != RELKIND_VIEW && relkind != RELKIND_COMPOSITE_TYPE)
{
dpp = SysAtt;
- for (i = 0; i < -1 - FirstLowInvalidHeapAttributeNumber; i++)
+ for (i = 0; i < (int) lengthof(SysAtt); i++, dpp++)
{
if (tupdesc->tdhasoid ||
(*dpp)->attnum != ObjectIdAttributeNumber)
@@ -587,7 +587,6 @@ AddNewAttributeTuples(Oid new_rel_oid,
heap_freetuple(tup);
}
- dpp++;
}
}