Commit 50faf409 authored by Vadim B. Mikheev's avatar Vadim B. Mikheev

Check for attributeList is NULL in ConstructTupleDescriptor ().

Submitted by Raymond Toy.
parent 3ded1cc5
...@@ -7,7 +7,7 @@ ...@@ -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, ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment