Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Add explicit cast to amcostestimate call.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 18 Jan 2016 03:56:16 +0000 (22:56 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 18 Jan 2016 03:56:16 +0000 (22:56 -0500)
My compiler doesn't complain here, but David Rowley's does ...

src/backend/optimizer/path/costsize.c

index 8fb483aaebd96618d421e510bea1d5ef67ed2602..eaeb17fcd4158facd283aa7ac38e55df066c52a4 100644 (file)
@@ -419,9 +419,10 @@ cost_index(IndexPath *path, PlannerInfo *root, double loop_count)
     * Call index-access-method-specific code to estimate the processing cost
     * for scanning the index, as well as the selectivity of the index (ie,
     * the fraction of main-table tuples we will have to retrieve) and its
-    * correlation to the main-table tuple order.
+    * correlation to the main-table tuple order.  We need a cast here because
+    * relation.h uses a weak function type to avoid including amapi.h.
     */
-   amcostestimate = index->amcostestimate;     /* cast to proper type */
+   amcostestimate = (amcostestimate_function) index->amcostestimate;
    amcostestimate(root, path, loop_count,
                   &indexStartupCost, &indexTotalCost,
                   &indexSelectivity, &indexCorrelation);