*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.18 1998/07/27 19:37:58 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.19 1998/07/31 15:10:40 vadim Exp $
*
*-------------------------------------------------------------------------
*/
int curIndxKey;
Oid curClass;
- if (clauseinfo_list == NIL)
+ if (clauseinfo_list == NIL || indexkeys[0] == 0)
return NIL;
- while (!DoneMatchingIndexKeys(indexkeys, index))
+ do
{
List *tempgroup = NIL;
indexkeys++;
classes++;
- }
+ } while (!DoneMatchingIndexKeys(indexkeys, index));
/* clausegroup holds all matched clauses ordered by indexkeys */
Oid curClass;
bool jfound = false;
- if (join_cinfo_list == NIL)
+ if (join_cinfo_list == NIL || indexkeys[0] == 0)
return NIL;
- while (!DoneMatchingIndexKeys(indexkeys, index))
+ do
{
List *tempgroup = NIL;
indexkeys++;
classes++;
- }
+ } while (!DoneMatchingIndexKeys(indexkeys, index));
/* clausegroup holds all matched clauses ordered by indexkeys */