Skip to content
Snippets Groups Projects
Commit 50faf409 authored by Vadim B. Mikheev's avatar Vadim B. Mikheev
Browse files

Check for attributeList is NULL in ConstructTupleDescriptor ().

Submitted by Raymond Toy.
parent 3ded1cc5
No related branches found
No related tags found
No related merge requests found
...@@ -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);
IndexKey = (IndexElem*) lfirst(attributeList); if (attributeList) {
attributeList = lnext(attributeList); IndexKey = (IndexElem*) lfirst(attributeList);
IndexKeyType = IndexKey->tname; attributeList = lnext(attributeList);
IndexKeyType = IndexKey->tname;
} else {
IndexKeyType = NULL;
}
indexTupDesc->attrs[i] = (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE); indexTupDesc->attrs[i] = (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment