Fallout from
fcec6caafa2: mark a variable in
set_tablefunc_size_estimates as used for asserts only.
Also, the planner_rte_fetch() call is pointless with assertions
disabled, so enclose it in a USE_ASSERT_CHECKING #ifdef; fix the same
problem in set_subquery_size_estimates().
First problem noted by David Rowley, whose compiler is noisier than mine
in this regard.
/* Should only be applied to base relations that are subqueries */
Assert(rel->relid > 0);
+#ifdef USE_ASSERT_CHECKING
rte = planner_rt_fetch(rel->relid, root);
Assert(rte->rtekind == RTE_SUBQUERY);
+#endif
/*
* Copy raw number of output rows from subquery. All of its paths should
void
set_tablefunc_size_estimates(PlannerInfo *root, RelOptInfo *rel)
{
- RangeTblEntry *rte;
+ RangeTblEntry *rte PG_USED_FOR_ASSERTS_ONLY;
/* Should only be applied to base relations that are functions */
Assert(rel->relid > 0);
+#ifdef USE_ASSERT_CHECKING
rte = planner_rt_fetch(rel->relid, root);
Assert(rte->rtekind == RTE_TABLEFUNC);
+#endif
rel->tuples = 100;