1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-08 06:02:22 +03:00

Check for attributeList is NULL in ConstructTupleDescriptor ().

Submitted by Raymond Toy.
This commit is contained in:
Vadim B. Mikheev
1997-04-05 03:36:21 +00:00
parent 3ded1cc530
commit 50faf40903

View File

@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.14 1997/03/27 04:13:44 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.15 1997/04/05 03:36:21 vadim Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
@@ -369,9 +369,13 @@ ConstructTupleDescriptor(Oid heapoid,
if (atnum > natts) if (atnum > natts)
elog(WARN, "Cannot create index: attribute %d does not exist", elog(WARN, "Cannot create index: attribute %d does not exist",
atnum); atnum);
if (attributeList) {
IndexKey = (IndexElem*) lfirst(attributeList); IndexKey = (IndexElem*) lfirst(attributeList);
attributeList = lnext(attributeList); attributeList = lnext(attributeList);
IndexKeyType = IndexKey->tname; IndexKeyType = IndexKey->tname;
} else {
IndexKeyType = NULL;
}
indexTupDesc->attrs[i] = (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE); indexTupDesc->attrs[i] = (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE);