]> granicus.if.org Git - postgresql/commitdiff
Allow 8-key indexes.
authorBruce Momjian <bruce@momjian.us>
Wed, 23 Sep 1998 04:22:14 +0000 (04:22 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 23 Sep 1998 04:22:14 +0000 (04:22 +0000)
src/backend/access/index/istrat.c
src/backend/catalog/indexing.c
src/backend/commands/cluster.c
src/backend/commands/copy.c
src/backend/commands/defind.c
src/backend/commands/vacuum.c
src/backend/executor/execUtils.c
src/backend/optimizer/util/plancat.c
src/bin/pg_dump/pg_dump.c

index 403a51f3ba6414d025c9f961deba53bf6647cfb8..ca4f6eeaeb92b06f70916d3893be8f356d193d7a 100644 (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;
                }
index 2fae39790007c213e65d48e8af08190dd5c8862a..b3c9db48b85bea3620667a758a5d3e36d7a87853 100644 (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;
index 415ad4a8dfb2653a653588ebf6d238e372cb768b..3fba38a351a11661d7311346b1348b37724daaf1 100644 (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++);
 
        /*
index 8e1b2cb75e6e98928bf07473701d61a6594b0aac..c6fcb958e5ff632bd6a42031031f7e2a6106d736 100644 (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)
                                {
index ab6e26f1e127c0797d8935e3822aba0597e30859..f0d985d3a93a9aef909af4faaf86b31a48604138 100644 (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;
 
index d40f7d5055c3c312b605e69f9ed9a192440808f1..a39355e195aa5b9fcbdc8e626d845f68ab274338 100644 (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)
                {
index fb83fd6e55ab7b8d8f962aab0720709683b5fbcf..3f9e82902de5f974919777778bc8f41f0c4fa44f 100644 (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];
index 786947e809a8456adba57baef48a6d3ed518b452..a27989184fbe57819825c505b9b55c2caecdde8e 100644 (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 ?? */
index 24f8c4e36ed920ea7b4cc7d4be0c18c8f27edb8c..63d81ac0b7b828662a89c92a722bc7cd70dc2794 100644 (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)