]> granicus.if.org Git - postgresql/commitdiff
Fix unused variable compiler warning in !debug builds.
authorAndres Freund <andres@anarazel.de>
Wed, 1 May 2019 00:45:32 +0000 (17:45 -0700)
committerAndres Freund <andres@anarazel.de>
Wed, 1 May 2019 00:45:32 +0000 (17:45 -0700)
Introduced in 3dbb317d3.  Fix by using the new local variable in more
places.

Reported-By: Bruce Momjian (off-list)
Backpatch: 9.4-, like 3dbb317d3

src/backend/catalog/indexing.c

index 8ae8f470df47f3c9e1b8ef5b911ba369f12ff7aa..b028c460b6d23351b26a21057a43be4fa6ea3acd 100644 (file)
@@ -135,7 +135,7 @@ CatalogIndexInsert(CatalogIndexState indstate, HeapTuple heapTuple)
                        Assert(!ReindexIsProcessingIndex(RelationGetRelid(index)));
                        continue;
                }
-#endif /* USE_ASSERT_CHECKING */
+#endif                                                 /* USE_ASSERT_CHECKING */
 
                /*
                 * FormIndexDatum fills in its values and isnull parameters with the
@@ -150,12 +150,12 @@ CatalogIndexInsert(CatalogIndexState indstate, HeapTuple heapTuple)
                /*
                 * The index AM does the rest.
                 */
-               index_insert(relationDescs[i],  /* index relation */
+               index_insert(index,             /* index relation */
                                         values,        /* array of index Datums */
                                         isnull,        /* is-null flags */
                                         &(heapTuple->t_self),          /* tid of heap tuple */
                                         heapRelation,
-                                        relationDescs[i]->rd_index->indisunique ?
+                                        index->rd_index->indisunique ?
                                         UNIQUE_CHECK_YES : UNIQUE_CHECK_NO);
        }