Allow 8-key indexes.

This commit is contained in:
Bruce Momjian 1998-09-23 04:22:14 +00:00
parent 747e19aa6c
commit b932b1b1c4
9 changed files with 21 additions and 21 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.28 1998/09/01 04:26:56 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/index/Attic/istrat.c,v 1.29 1998/09/23 04:21:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -583,7 +583,7 @@ IndexSupportInitialize(IndexStrategy indexStrategy,
if (!OidIsValid(iform->indkey[attributeIndex]))
{
if (attributeIndex == 0)
if (attributeIndex == InvalidAttrNumber)
elog(ERROR, "IndexSupportInitialize: no pg_index tuple");
break;
}

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.31 1998/09/07 05:35:39 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.32 1998/09/23 04:21:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -137,7 +137,7 @@ CatalogIndexInsert(Relation *idescs,
* Compute the number of attributes we are indexing upon.
*/
for (attnumP = index_form->indkey, fatts = 0;
*attnumP != InvalidAttrNumber && fatts < INDEX_MAX_KEYS;
fatts < INDEX_MAX_KEYS && *attnumP != InvalidAttrNumber;
attnumP++, fatts++)
;
FIgetnArgs(&finfo) = fatts;

View File

@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.31 1998/09/01 04:27:44 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.32 1998/09/23 04:22:01 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -282,7 +282,7 @@ copy_index(Oid OIDOldIndex, Oid OIDNewHeap)
* got to be sure.
*/
for (attnumP = &(Old_pg_index_Form->indkey[0]), natts = 0;
*attnumP != InvalidAttrNumber;
natts < INDEX_MAX_KEYS && *attnumP != InvalidAttrNumber;
attnumP++, natts++);
/*

View File

@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.61 1998/09/08 22:15:42 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.62 1998/09/23 04:22:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -453,7 +453,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
Assert(pgIndexTup);
pgIndexP[i] = (Form_pg_index) GETSTRUCT(pgIndexTup);
for (attnumP = &(pgIndexP[i]->indkey[0]), natts = 0;
*attnumP != InvalidAttrNumber;
natts < INDEX_MAX_KEYS && *attnumP != InvalidAttrNumber;
attnumP++, natts++);
if (pgIndexP[i]->indproc != InvalidOid)
{

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.26 1998/09/01 04:27:52 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.27 1998/09/23 04:22:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -274,7 +274,7 @@ ExtendIndex(char *indexRelationName, Expr *predicate, List *rangetable)
indproc = index->indproc;
for (i = 0; i < INDEX_MAX_KEYS; i++)
if (index->indkey[i] == 0)
if (index->indkey[i] == InvalidAttrNumber)
break;
numberOfAttributes = i;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.81 1998/09/02 23:05:25 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.82 1998/09/23 04:22:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -2227,7 +2227,7 @@ vc_mkindesc(Relation onerel, int nindices, Relation *Irel, IndDesc **Idesc)
*/
idcur->tform = (Form_pg_index) GETSTRUCT(cachetuple);
for (attnumP = &(idcur->tform->indkey[0]), natts = 0;
*attnumP != InvalidAttrNumber && natts != INDEX_MAX_KEYS;
natts < INDEX_MAX_KEYS && *attnumP != InvalidAttrNumber;
attnumP++, natts++);
if (idcur->tform->indproc != InvalidOid)
{

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.38 1998/09/01 04:28:22 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.39 1998/09/23 04:22:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -629,7 +629,8 @@ ExecGetIndexKeyInfo(Form_pg_index indexTuple,
* ----------------
*/
numKeys = 0;
for (i = 0; i < 8 && indexTuple->indkey[i] != 0; i++)
for (i = 0; i < INDEX_MAX_KEYS &&
indexTuple->indkey[i] != InvalidAttrNumber; i++)
numKeys++;
/* ----------------
@ -663,8 +664,7 @@ ExecGetIndexKeyInfo(Form_pg_index indexTuple,
*/
CXT1_printf("ExecGetIndexKeyInfo: context is %d\n", CurrentMemoryContext);
attKeys = (AttrNumber *)
palloc(numKeys * sizeof(AttrNumber));
attKeys = (AttrNumber *)palloc(numKeys * sizeof(AttrNumber));
for (i = 0; i < numKeys; i++)
attKeys[i] = indexTuple->indkey[i];

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.21 1998/09/01 04:30:09 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/plancat.c,v 1.22 1998/09/23 04:22:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -165,9 +165,9 @@ index_info(Query *root, bool first, int relid, IdxInfoRetval *info)
/* Extract info from the index tuple */
index = (Form_pg_index) GETSTRUCT(indexTuple);
info->relid = index->indexrelid; /* index relation */
for (i = 0; i < 8; i++)
for (i = 0; i < INDEX_MAX_KEYS; i++)
info->indexkeys[i] = index->indkey[i];
for (i = 0; i < 8; i++)
for (i = 0; i < INDEX_MAX_KEYS; i++)
info->classlist[i] = index->indclass[i];
info->indproc = index->indproc; /* functional index ?? */

View File

@ -21,7 +21,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.85 1998/09/20 03:18:43 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.86 1998/09/23 04:22:14 momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
@ -2649,7 +2649,7 @@ dumpIndices(FILE *fout, IndInfo *indinfo, int numIndices,
char *attname;
indkey = atoi(indinfo[i].indkey[k]);
if (indkey == 0)
if (indkey == InvalidAttrNumber)
break;
indkey--;
if (indkey == ObjectIdAttributeNumber - 1)